Sindbad~EG File Manager
{% extends "dashboard/admin_layout.html" %}
{% block title %}
Search Delegate
{% endblock %}
{% block style %}
{% endblock %}
{% block content %}
<div class="container-fluid" style="padding: 10px 5px 10px 5px; width:97%;" >
<div style="display:None">
<center>
<!-- <h2>MC Info</h2> -->
<div class="row mb-4">
<div class="col-lg-2 col-sm-12 p-3"></div>
<div class="col-lg-3 col-sm-12 p-3" style="background: #397ae7;">
<h5 style="color: white;">Total Delegate</h5>
<div class="row">
<div class="col-lg-12 p-1">
<input readonly class="form-control" id="total_registered_count" value="{{total_registered_count or '0'}}" />
</div>
</div>
</div>
<div class="col-lg-3 col-sm-12 p-3" style="background: #639cfb;">
<h5 style="color: white;">Total signedup count</h5>
<div class="row">
<div class="col-lg-12 p-1">
<input readonly class="form-control" id="total_signed_on_count" value="{{total_signed_on_count or '0'}}" />
</div>
</div>
</div>
<div class="col-lg-3 col-sm-12 p-3" style="background: #397ae7;">
<h5 style="color: white;">Total pending count</h5>
<div class="row">
<div class="col-lg-12 p-1">
<input readonly class="form-control" id="total_pending_count" value="{{total_pending_count or '0'}}" />
</div>
</div>
</div>
<div class="col-lg-1 col-sm-12 p-3"></div>
</div>
</center>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<a href="{{url_for('signup.QRScanToSignup',conf_id=conf_id,conf_key=conf_key)}}" class="btn btn-primary">Scan to signup</a>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<label><h3>Search</h3></label>
</div>
<div class="col-lg-6 col-md-6 col-sm-12" style="float:right;">
</div>
</div>
{% if default_type == 'search' %}
<div class="row" id="search_div">
<div class="col-md-12 col-sm-12">
<form method="POST" action="{{url_for('signup.postSearch',conf_id=conf_id,conf_key=conf_key)}}" id="search_frm">
<input type="hidden" name="conf_id" id="conf_id" value="{{conf_id}}">
<input type="hidden" name="conf_key" id="conf_key" value="{{conf_key}}">
<div id="msg_div" style="display: none;background-color: #e7d1d1;" class="alert alert-danger text-center alert-dismissible successMessage"><label id="msg_label" class="text-black"></label>
</div>
<div class="input-group">
<input type="search" id="search_delegate" name="search_delegate" placeholder="Search here..." class="form-control" value="{{search_data or ''}}" autofocus>
<div class="input-group-append">
<a href="{{url_for('signup.getSearch',conf_id=conf_id,conf_key=conf_key,default_type='search')}}" class="btn btn-danger"><i class="fa fa-times-circle" aria-hidden="true"></i></a>
</div>
</div>
<label id="search_delegate-error" class="error" for="search_delegate"></label>
<br>
<div class="col-md-12 p-0">
<div class="text-md-center text-sm-left">
<input class="btn btn-danger" type="submit" id="search_delegate_btn" value="Search Del. No" name="search_btn">
<!--<i class="fa fa-search" aria-hidden="true"></i> Del No. / Ref No. -->
<!--<button class="btn btn-danger" type="submit" id="search_delegate_btn" value="Search Del. No" name="search_btn">-->
<!--<i class="fa fa-search" aria-hidden="true"></i> Del No. / Ref No. -->
<!--</button>-->
<button class="btn btn-primary" type="submit" id="search_content_btn" value="Search Name/Email/Mobile" name="search_btn">
<i class="fa fa-search" aria-hidden="true"></i> Name/Email/Mobile
</button>
</div>
</div>
<br>
{% if msg: %}
<h3 class="alert alert-danger text-center text-danger">{{msg}}</h3>
{% endif %}
<label style="font-size:25px;font-weight: bold;">Signedup count : </label><span class="text-danger" id="total_signed_on" name="total_signed_on" style="font-size:25px;font-weight: bold;"> {{total_signed_on_count or '0'}}</span>
{% if members: %}
{% for row in members %}
<div class="card p-1">
<div class="alert p-2 mb-2 alert-success alert-{{row.delegate_no}}" style="display:none;">
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6" >
<label>{{row.prefix or ''}} {{row.full_name or ''}}</label>
</div>
</div>
<div class="row">
<div class="col-md-6 col-sm-4">
<label>{% if row.counter %}<span style="color:#bd2130;"> {{row.counter or ''}}</span> - {% endif %} {% if row.batch %}<span style="color:#0286b0;">{{row.batch or ''}}</span> - {% endif %}<span style="color:#bd2130;"> Del no : {{row.delegate_no or ''}} {% if row.ref_no :%} | Ref no : {{row.ref_no or ''}} {% endif %} </span><span style="color:#8f227e !important;"> {% if row.role :%} | {{row.role or ''}} {% endif %} </span></label>
</div>
</div>
<div class="row">
<div class="col-md-12">
<label>{{row.email or ''}} {% if row.email and row.mobile: %}/{% endif %} {{row.mobile or ''}}</label>
</div>
</div>
{% if row.company_name: %}
<div class="row">
<div class="col-md-12">
<label><b>{{row.company_name or ''}}</b></label>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 mr-3">
{% if row.signed_on == None : %}
<button style="float: right;" type="button" class="btn btn-danger btn-sm sign_btn" id="signup_btn_{{row.delegate_no}}" data-id="{{row.delegate_no}}">Signup <i class="fa fa-sign-in" aria-hidden="true"></i></button>
{% else %}
<label id="signed_date_{{row.delegate_no}}" name="signed_date" style="float: right;" class="text-danger">Signed on : {{row.signed_on.strftime('%d-%m-%Y %H:%M') if row.signed_on else ''}}</label>
{% endif %}
</div>
</div>
{% if row.reg_remarks : %}
<div class="row">
<div class="col-md-12">
<label>Remarks : <span style="color:red;"> {{row.reg_remarks or ''}} </span></label>
</div>
</div>
{% endif %}
</div>
{% endfor %}
{% endif %}
</form>
<div class="modal" id="myModal">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<label><h3>SignUp</h3></label>
<button type="button" class="btn close popup_close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div class="col-md-12">
<label>Signedup By</label>
</div>
<input type="hidden" name="delegate_no" id="delegate_no">
<div class="col-md-12">
<input type="radio" class="form-input" name="signup" id="representive" value="Representive"><label for="representive" class="ml-2"> Representive</label>
<input type="radio" class="form-input ml-3" name="signup" id="delegate" value="Delegate" checked><label for="delegate" class="ml-2"> Delegate</label><br>
<label id="signup-error" class="error" for="signup" style="color:rgb(226, 5, 5)"></label>
</div>
<div class="col-md-12">
<label>Remarks</label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"></textarea>
</div>
</div>
<hr>
<div class="col-md-12 text-center p-2 mb-2">
<input type="button" class="btn btn-primary" id="save" name="save_btn" onclick="save_signeddata()" value="Save">
</div>
</div>
</div>
</div>
</div>
</div>
{% elif default_type == 'scan' %}
<div class="row" id="scan_div">
<div class="col-md-12 col-sm-12">
<form method="POST" action="{{url_for('signup.PostScan',conf_id=conf_id,conf_key=conf_key)}}" id="scan_frm">
<input type="hidden" name="conf_id" id="conf_id" value="{{conf_id}}">
<input type="hidden" name="conf_key" id="conf_key" value="{{conf_key}}">
<div id="msg_div" style="display: none;background-color: #e7d1d1;" class="alert alert-danger text-center alert-dismissible successMessage"><label id="msg_label" class="text-black"></label>
</div>
<div class="input-group">
<input type="search" id="scan_delegate" name="scan_delegate" placeholder="Search here..." class="form-control" value="{{search_data or ''}}" autofocus>
<div class="input-group-append">
<a href="{{url_for('signup.getSearch',conf_id=conf_id,conf_key=conf_key,default_type='scan')}}" class="btn btn-danger"><i class="fa fa-times-circle" aria-hidden="true"></i></a>
</div>
</div>
<div class="row text-center mt-3">
<div class="col-lg-12">
<input type="submit" name="submit_btn" id="submit_btn" value="Submit" class="btn btn-primary">
</div>
</div>
</form>
<br>
<label style="font-size:25px;font-weight: bold;">Signedup count : </label><span class="text-danger" id="total_signed_on" name="total_signed_on" style="font-size:25px;font-weight: bold;"> {{total_signed_on_count or '0'}}</span>
<br>
{% for mesg in get_flashed_messages(category_filter=["successMsg"]) %}
<div class="alert alert-success text-center successMessage alert-dismissible" id="successMessage" onchange="call_success_timeout()">
<p class="close" data-dismiss="alert" style="float:right;margin-right: 8px" aria-label="close">×</p>
<h3>{{ mesg|safe }}</h3>
</div>
{% endfor %}
{% for mesg in get_flashed_messages(category_filter=["errorMsg"]) %}
<div class="alert alert-danger text-center errorMessage" id="errorMessage" onchange="call_error_timeout()">
<p class="close" data-dismiss="alert" style="float:right;margin-right: 8px" aria-label="close">×</p>
<h3>{{ mesg|safe }}</h3>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>
{% endblock %}
{% block bottomscript %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
var BaseUrl = document.location.origin;
$(document).ready( function ()
{
call_error_timeout();
call_success_timeout();
});
$(document).on("click", "button[name = 'search_btn']", function (e) {
e.preventDefault();
var search_data = $("#search_delegate").val();
if(!search_data)
{
return false;
}
else{
$("#search_frm").submit();
}
});
$(document).on("click", ".popup_close", function (e) {
e.preventDefault();
$("#myModal").modal("hide");
});
$(document).on("click", ".sign_btn", function () {
$("#myModal").modal("show");
var delegate_no = $(this).data('id');
$("#delegate_no").val(delegate_no);
});
function call_success_timeout() {
window.setTimeout(function () {
$("#successMessage").fadeTo(5000, 500).slideUp(500, function() {
$("#successMessage").slideUp(500);
});
});
}
function call_error_timeout() {
window.setTimeout(function () {
$("#errorMessage").fadeTo(5000, 500).slideUp(500, function() {
$("#successMessage").slideUp(500);
});
});
}
function validate_signup()
{
$("#signup-error").text("");
if ($("input[type=radio]").is(":checked")) {
return true;
}
else {
$("#signup-error").text("Please select Signup type");
return false;
}
}
function save_signeddata()
{
$("#signup-error").text("");
var signup = $("input[type=radio]:checked").val();
if ($("input[type=radio]").is(":checked") == false) {
$("#signup-error").text("Please select Signup type");
}
else
{
var remarks = $("#remarks").val();
var delegate_no = $("#delegate_no").val();
var conf_id = $("#conf_id").val();
var conf_key = $("#conf_key").val();
$.ajax({
type: 'POST',
url: "/"+conf_id+"/"+conf_key+"/insert_signup",
data:{'signup':signup,'remarks':remarks,'delegate_no': delegate_no},
dataType: 'html',
success: function(data){
var data_1 = JSON.parse(data);
var status= data_1.status;
var msg = data_1.msg;
$("#myModal").modal("hide");
$("#scan_div").hide();
$("#search_div").show();
if (status ==2) {
$("#myModal").modal("hide");
$("#total_signed_on").html(data_1.total_signed_on_count);
$("#total_signed_on_count").val(data_1.total_signed_on_count);
$("#total_pending_count").val(data_1.total_pending_count);
$("#total_registered_count").val(data_1.total_registered_count);
$("#signed_date_"+delegate_no).html(data_1.signup_date);
$("#signup_btn_"+delegate_no).hide();
$(".alert-"+delegate_no).show()
$(".alert-"+delegate_no).html(data_1.msg);
setTimeout(function(){
$("#msg_label").html('');
}, 20000);
}
else {
$("#msg_div").show();
$("#msg_label").html(msg);
$("#msg_div").css("background" ,"#e7d1d1" );
}
},
error: function(XMLHttpRequest, textStatus, errorThrown){}
});
return false;
}
}
</script>
{% endblock %}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists