Sindbad~EG File Manager

Current Path : /home/numerotech/hs.numerotech.com/scan_v1/core/templates/signup/
Upload File :
Current File : //home/numerotech/hs.numerotech.com/scan_v1/core/templates/signup/search_delegate.html

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/static/css/style.css">
	<title>Search Delegate</title>
	<style type="text/css">
		.card{
			line-height: 0.80rem;
		}
	</style>
</head>
<body>
	<div class="container-fluid" style="padding: 10px 5px 10px 5px;  width:97%;">
		 <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 text-right mb-1">
				<a type="button" href="{{url_for('signup.SignupLogout',conf_id=conf_id,conf_key=conf_key)}}" class="btn btn-danger">logout</a>
			</div>
			</div>
		<div class="row">
			<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="min-height: 10px;max-height:50px;text-align: center;color:green;vertical-align: middle; font-weight:bold;font-size: 13px;display: none"><label id="msg_label" class="text-success"></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 ''}}">  
									<div class="input-group-append">  
										<a href="{{url_for('signup.getSearch',conf_id=conf_id,conf_key=conf_key)}}" 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">
									<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> Delegate 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>

										<!-- <input type="submit"  id="search_delegate_btn" class="btn btn-primary" value="Search Del. No"  name="search_btn"> -->
										<!-- <input type="submit"  id="search_content_btn" class="btn  btn-primary" value="Search Name/Email/Mobile" name="search_btn"> -->
								</div>
								
							</div>
					
						<br>
						{% if msg: %}
							<h3 class="alert alert-danger text-center text-danger">{{msg}}</h3>
						{% endif %}
						<label>SignedUp count : </label><span class="text-danger" id="total_signed_on" name="total_signed_on"> {{total.total_signed_on 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><span style="color:#bd2130;">{{row.counter or ''}}</span> - <span style="color:#0286b0;">{{row.batch or ''}}</span> - <span style="color:#bd2130;">{{row.delegate_no or ''}}</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>
										<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-toggle="modal" data-target="#myModal" data-id="{{row.delegate_no}}">Signup &nbsp;<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="close" data-dismiss="modal">&times;</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"><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>
	</div>
</body>
<script src="/static/js/jquery.min.js" charset="utf-8"></script>
<script src="/static/js/jquery.validate.js" charset="utf-8"></script>
<script src="/static/js/popper.min.js" charset="utf-8"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">


$(document).ready( function ()
{
	$("button[name = 'search_btn']").click(function()
		{ 

		validate_prosec_form()
		if(!$("#search_frm").valid())
		{
				return false  
		}
	})


	

	$(document).on("click", ".sign_btn", function () {
		 var delegate_no = $(this).data('id');
		 $("#delegate_no").val(delegate_no);
	});
	
})
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: 'json',
					success: function(data)
					{
							var status= data.status;
						var msg = data.msg;
						if (status ==1) {
							$("#myModal").modal("hide");
							$("#total_signed_on").html(data.total_signed_on);
						
							$("#signed_date_"+delegate_no).html(data.signup_date);
							$("#signup_btn_"+delegate_no).hide();
					//  	$("#msg_div").show();
							//  $("#msg_label").html("#"+delegate_no+" Signed Up successfully");
								$(".alert-"+delegate_no).show()
								$(".alert-"+delegate_no).html("#"+delegate_no+" Signed Up successfully on "+data.signup_date);
								
								setTimeout(function(){ 
								$("#msg_label").html('');
								}, 20000);
						}
						else {
							$("#myModal").modal("hide");
							$("#msg_div").show();
								$("#msg_label").html(msg);
								$("#msg_div").css("background" ,"red" );
						}   
					},
					error: function(XMLHttpRequest, textStatus, errorThrown){} 
				});
				return false; 
		}

	 
}

function  validate_prosec_form()
{
	errorclass : 'error',
	$("#search_frm").validate({
		rules : {
		 
			search_delegate : {
														required : true,
														normalizer: function (value) {
																return $.trim(value);
														}
													},
			},
		messages : {
			search_delegate : {
														required :  "Please enter data"
													},
			},
			highlight: function(element) {
					$(element).parent().addClass('error')
			},
	
			unhighlight: function(element) {
					$(element).parent().removeClass('error')
			},

			submitHandler: function(form) {
					form.submit();
			}
		})
}
</script>
</html>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists