Sindbad~EG File Manager
{% extends 'master_table_templates/master_table_layout.html' %}
{% block head %}
{% endblock %}
{% block title %}{% endblock %}
{% block style %}
<style type="text/css">
label.error{
color: red;
}
</style>
{% endblock %}
{% block content %}
<div class="container">
<div class="card">
<div class="card-body">
<div class="modal fade" id="myModal" role="dialog">
<form method="POST" id="add_delegate">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title">Conference Form</h4>
</div>
<div id="new_del_model"></div>
<div class="modal-body text-left form-group">
<div class="row" >
<div class="col-12">
<div class="alert alert-danger" id="errorMsg" style="display: none;" >
<p class="close" data-dismiss="alert" aria-label="close">×</p>
</div>
</div>
</div>
<h6>Conference Name: <label class="text-danger">*</label></h6>
<input type="text" name="conf_name" id="conf_name" class="form-group form-control">
<h9 for="msg_model" id="msg_label"></h9>
<h6>Conference Title : <label class="text-danger">*</label></h6>
<input type="text" name="conf_title" id="conf_title" class="form-group form-control">
<h9 for="name" id="full_name"></h9>
<h6>Conference Key : <label class="text-danger">*</label></h6>
<input type="text" name="conf_key" id="conf_key" class="form-group form-control">
<h6>Conference Start : <label class="text-danger">*</label></h6>
<input type="datetime-local" name="conf_start" id="conf_start" class="form-group form-control">
<!-- <h6>Role :</h6>
<select id='role_model' class="form-group form-control" >
<option></option>
{% if get_delegate_role : %}
{% for i in get_delegate_role %}
<option id="role_model" name="role">{{i.role}}</option>
{% endfor %}
{% endif %}
</select> -->
<!-- <h6>Attendance:</h6>
<label>
<input type="radio" class="w3-radio" name="Attendance" value="1"> Present
</label>
<label>
<input type="radio" class="w3-radio" name="Attendance" value="0"> Absent
</label> -->
<h6>Conference End : <label class="text-danger">*</label></h6>
<input type="datetime-local" name="conf_end" id="conf_end" class="form-group form-control">
<input type="hidden" name="society_id" id="society_id" >
</div>
<div class="modal-footer text-center">
<button type="button" class="btn btn-success" id="btn_save">Save</button>
<!-- <button type="submit" id="btn_save" name="modal_submit_btn" class="btn btn-primary">Save</button> -->
<button type="button" class="btn btn-danger" id="close_btn" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</form>
</div>
<h6>Society :</h6>
<div class="row">
<div class="col-lg-3 col-sm-6">
<select id="society" class="form-control">
<option id="0" value="0">--Select--</option>
<option value="all">All</option>
{% if get_society :%}
{% for i in get_society %}
{% if data.society_id|int == i.society_id|int %}
<option value="{{i.society_id}}" selected>{{i.society_name}}</option>
{% else %}
<option id="{{i.society_id}}" value="{{i.society_id}}">{{i.society_name}}</option>
{% endif %}
{% endfor %}
{% endif %}
</select>
</div>
<button type="button" class="btn_society_1 btn btn-success" id="#btn_society_1">GO</button>
</div>
<div>
<h6 for="msg" style="color:red;"></h6>
<h2 class="text-center">Abstract List</h2>
</div>
<button class="btn btn-danger float-right" data-toggle="modal" data-target="#myModal">Add Conference</button>
<div id="Conference">
<div class="mobile-responsive">
<table class="table table-striped table-bordered">
<thead style="background-color: #c12c27;color: white;">
<tr >
<th scope="col">Conference ID</th>
<th scope="col">Conference Key</th>
<th scope="col">Conference Name</th>
<th scope="col">Conference Title</th>
<th scope="col">Conference Start Time</th>
<th scope="col">Conference End Time</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
{% if get_conference : %}
{% for row in get_conference %}
<tr>
<input type="hidden" name="society_id" id="society_id" value="{{row.society_id}}">
<input type="hidden" name="conf_id" id="conf_id" value="{{row.conf_id}}">
<td data-label="Conference ID">{{row.conf_id or ''}}</td>
<td data-label="Conference Key">{{row.conf_key or ''}}</td>
<td data-label="Conference Name" id="Name">{{row.conf_name or ''}}</td>
<td data-label="Conference Title" id="emailormobile">{{row.conf_title or ''}}</td>
<td data-label="Conference Start Time" id="Role">{% if row.conf_start_time: %}{{row.conf_start_time.strftime('%d-%m-%Y %H:%M:%S') or ''}}{% else %}{{row.conf_start_time or ''}}{% endif %}</td>
<td data-label="Conference End Time" id="ABS_no">{% if row.conf_end_time: %}{{row.conf_end_time.strftime('%d-%m-%Y %H:%M:%S') or ''}} {% else %} {{row.conf_end_time or ''}}{% endif %}</td>
<td data-label="Action" id="title">
<a href="{{url_for('master_table.AbstractAdmin',conf_id=row.conf_id,society_id=row.society_id)}}" title="Add/Edit Abstract" class="btn btn-primary">Edit Abstract</a>
</td>
</tr>
{% endfor %}
{% else : %}
<tr>
<td data-label="" colspan="7" style="color: red;"> Record not found</td>
<tr>
{% endif %}
</tbody>
</table>
</div><br>
<h2>Add New Abstract</h2>
<div class="mobile-responsive">
<table class="table table-striped table-bordered">
<thead style="background-color: #c12c27;color: white;">
<tr >
<th scope="col">Conference ID</th>
<th scope="col">Conference Key</th>
<th scope="col">Conference Name</th>
<th scope="col">Conference Title</th>
<th scope="col">Conference Start Time</th>
<th scope="col">Conference End Time</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
{% if get_new_conference : %}
{% for row in get_new_conference %}
<tr>
<input type="hidden" name="society_id" id="society_id" value="{{row.society_id}}">
<input type="hidden" name="conf_id" id="conf_id" value="{{row.conf_id}}">
<td data-label="Conference ID">{{row.conf_id or ''}}</td>
<td data-label="Conference Key">{{row.conf_key or ''}}</td>
<td data-label="Conference Name" id="Name">{{row.conf_name or ''}}</td>
<td data-label="Conference Title" id="emailormobile">{{row.conf_title or ''}}</td>
<td data-label="Conference Start Time" id="Role">{% if row.conf_start_time: %}{{row.conf_start_time.strftime('%d-%m-%Y %H:%M:%S') or ''}}{% else %}{{row.conf_start_time or ''}}{% endif %}</td>
<td data-label="Conference End Time" id="ABS_no">{% if row.conf_end_time: %}{{row.conf_end_time.strftime('%d-%m-%Y %H:%M:%S') or ''}} {% else %} {{row.conf_end_time or ''}}{% endif %}</td>
<td data-label="Action" id="title">
<a href="{{url_for('master_table.AbstractAdmin',conf_id=row.conf_id,society_id=row.society_id)}}" title="Add/Edit Abstract" class="btn btn-primary">Add Abstract</a>
</td>
</tr>
{% endfor %}
{% else : %}
<tr>
<td data-label="" colspan="7" style="color: red;"> Record not found</td>
<tr>
{% endif %}
</tbody>
</table>
</div>
</div>
<div id="Conference_1"></div>
</div>
</div>
</div>
{% endblock %}
{% block bottomscript %}
<script type="text/javascript">
var BaseUrl=document.location.origin
$(document).ready(function(){
$("h6[for='msg']").show();
$(".btn_society_1").click(function(){
var society_id = $('select#society option:selected').val();
if (society_id==0){
$("h6[for='msg']").text("Please Select the Society");
return false;
}
if (society_id=='all'){
society_id=null
}
$.ajax({
// type:"POST",
url:BaseUrl+"/index_page",
data:{'society_id':society_id},
success:function(reposnse){
var data_1=JSON.parse(reposnse);
var msg = data_1.msg;
var html_data=data_1.html_data;
// alert(html_data)
if (msg='success'){
$("#Conference_1").html(html_data);
$("#Conference").hide();
$("h6[for='msg']").hide();
}
else{
$("h6[for='msg']").show();
}
}
});
});
});
$("#btn_save").click(function(){
var society_id = $('select#society option:selected').val();
// alert(society_id)
$("#society_id").val(society_id)
conf_validate()
if ($("#add_delegate").valid()){
var fd=$("#add_delegate").serialize();
alert(fd)
$.ajax({
type:"POST",
url:BaseUrl+"/insert_new_conference",
data:fd,
success:function(reposnse){
var data_1=JSON.parse(reposnse);
var msg = data_1.msg;
if(msg=="success"){
location.reload()
}
}
})
}
else{
return false
}
});
function conf_validate() {
$("#add_delegate").validate({
errorclass:"error",
rules:{
conf_name:{
required:true
},
conf_title:{
required:true
},
conf_key:{
required:true
},
conf_start:{
required:true
},
conf_end:{
required:true
}
},
messages: {
conf_name: {
required: "Please Enter Conference Name"
},
conf_title: {
required: "Please Enter Conference Title"
},
conf_key: {
required: "Please Enter the Conference Key"
},
conf_start:{
required: "Please Choose the Start Date"
},
conf_end:{
required: "Please Enter the End Date"
}
} ,
highlight: function(element) {
$(element).parent().addClass('error')
},
unhighlight: function(element) {
$(element).parent().removeClass('error')
},
submitHandler: function(form) {
return false;
},
invalidHandler: function(form, validator) {
if (!validator.numberOfInvalids())
return;
$('.error').animate({
scrollTop: $(validator.errorList[0].element).offset().top
}, 300);
StopProgress();
}
});
};
</script>
{% endblock %}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists