<?php
session_start();
include "connect.php";

$currentpage=731;
$activepage="NoPayment";

if(!isset($_SESSION['admin_login'])){ header("location:index.php");}
$limit = 20;
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; };  
$start_from = ($page-1) * $limit;  

$q_sql="SELECT no_date_tbl.* FROM no_date_tbl  ORDER BY no_date_tbl.id DESC";
$q_query=mysqli_query($conn,$q_sql);
	
	
	if(isset($_POST['product_tbl']) && $_POST['product_tbl']=='PRODUCT')
	{
		$from_date = $_POST['from_date'];
		$to_date = $_POST['to_date'];
		
		
		$checkLogin=mysqli_query($conn,"INSERT INTO `no_date_tbl`(`id`, `from_date`, `to_date`) 
		VALUES (NULL,'$from_date','$to_date')");
		if($checkLogin){
				echo "<script> window.location = 'no_payment_date.php?success'; </script>";			
		}else{
			 header("location:no_payment_date.php?err");			 
		}
	}
$success='<div class="alert alert-success alert-dismissible" role="alert" style="margin-top: -18px; padding: 10px;"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true" style="margin-left:-50px; color:white;">&times;</span><span class="sr-only">Close</span></button><strong>Success!</strong> Insert is successfull.</div>';
$err='<div class="alert alert-danger alert-dismissible" role="alert" style="margin-top: -18px; padding: 10px;"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true" style="margin-left:-50px; color:white;">&times;</span><span class="sr-only">Close</span></button><strong>Wrong!</strong> Invalid credentials.</div>';

if (isset($_REQUEST['idd']) && $_REQUEST['delete'] == 'true') {
    $query_service = "DELETE FROM `no_date_tbl` WHERE id ='".$_REQUEST['idd']."'";
     
        $result_service = mysqli_query($conn,$query_service);
		
		if($result_service){
			echo "<script>alert('you deleted successfully. ');   window.location = 'no_payment_date.php'; </script>";
			// header("location:view_branch.php");
		}
}
if (isset($_REQUEST['id']) && $_REQUEST['edit'] == 'true'){
    $query_service = "SELECT * FROM `no_date_tbl`  WHERE id ='".$_REQUEST['id']."'";

        $result_service = mysqli_query($conn,$query_service);
		$row_service = mysqli_fetch_assoc($result_service);
} 
if (isset($_POST['btnedit']) && $_POST['btnedit'] == 'Modify'){
	    $from_date =$_POST['from_date'];
		$to_date =$_POST['to_date'];
		
		
	$query_service1 = "UPDATE `no_date_tbl` SET `from_date`='$from_date',`to_date`='$to_date' WHERE id = '".$_REQUEST['id']."'";
//echo $query_service1; die;
        $result_service1 = mysqli_query($conn,$query_service1);
		if($result_service1){
			 header("location:no_payment_date.php?success");
		}else{
			 header("location:no_payment_date.php?err");			
		}
		
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>:: JOYRAM HELP LINE 80 | Date::</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<?php include "common/CSS_link.php";?> 
<link rel="stylesheet" href="js/jquery.com_ui.css">
<script src="js/jquery-1.10.2.js"></script>
<script src="js/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="js/jquery.com_ui.css">
<script src="js/jquery-1.10.2.js"></script>
<script src="js/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="assets/bower_components/select2/dist/css/select2.min.css">

<style>

/*.frmSearch {border: 1px solid #a8d4b1;background-color: #c6f7d0;margin: 2px 0px;padding:40px;border-radius:4px;}*/
#country-list{float:left;list-style:none;margin-top:-3px;padding:0;width:90%;position: absolute; z-index:800;}
#country-list li{padding: 10px; background: #008B8B; color:#fff; border-bottom: #bbb9b9 1px solid;}
#country-list li:hover{background:#f39c12;cursor: pointer; color:#000;}
#search-box{padding: 10px;border: #a8d4b1 1px solid;border-radius:4px;}
</style>


<script>
$( function() {
$( ".datepicker1" ).datepicker({ dateFormat: 'dd/mm/yy' });
} );

$( function() {
$( ".datepicker2" ).datepicker({ dateFormat: 'yy-mm-dd' });
} );
</script>
<script>
$(function() {

	$("#dist_name").focus();
	var clients = [
	<?php						
		$q_pps=mysqli_query($conn,"SELECT * FROM district_cnf_tbl ORDER BY dist_name ASC");
		while($r_pps=mysqli_fetch_array($q_pps)){
	?>
	  {        
        label: "<?php echo $r_pps['dist_name'];?>",
        desc: "<?php echo $r_pps['cnf_id'];?>",
        icon: "<?php echo $r_pps['id'];?>"
      },
	<?php	}	?>
	 ];
    $( "#dist_name" ).autocomplete({
      minLength: 0,
      source: clients,
      focus: function( event, ui ) {
        $( "#dist_name" ).val( ui.item.label );
		return false;
      },
      select: function( event, ui ) {			
        $( "#dist_name" ).val( ui.item.label );
		$( "#cnf_id" ).val( ui.item.desc );
		$( "#district_cnf_id" ).val( ui.item.icon );
        return false;
      }
    })
    .autocomplete( "instance" )._renderItem = function( ul, item ) {
		$( "#district_cnf_id" ).val('0');
	 return $( "<li>" )      
	    .append( "<a>" + item.label + "<br>" + item.desc + "</a>"  )
        .appendTo( ul );
		};
  });
</script>
 <style>
[class*=" pe-7s-"], [class^=pe-7s-] {
    display: inline-block;
    font-family: Pe-icon-7-stroke;
    speak: none;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}
user agent stylesheet
i, cite, em, var, address, dfn {
    font-style: italic;
}
.content-header .header-icon {
    font-size: 55px;
    color: #37a000;
    width: 68px;
    float: left;
    margin-top: -4px;
    line-height: 0;
}

</style>
<script>



$(document).ready(function () {
  
	  document.getElementById("user_type_D").checked="checked";
      var str = $('.user_type:checked').val();     
	  if(str=="FRANCHAISE"){		  
		  document.getElementById("text_chnge").innerHTML="CNF ID <span style='color:red;'>*</span>";
		  document.getElementById("company_id").value="";
		  document.getElementById("u_name").value="";
		  document.getElementById("u_type").value="CNF";
		  document.getElementById("new_submit").disabled=false;
		  document.getElementById("dist_change").style.display="none";
		  document.getElementById("text_chnge1").innerHTML="Franchaise Name <span style='color:red;'>*</span>";		 
			var res = "FC"+Date.now();
			$('#user_id').val(res);
	  }
	  
  
  });


function get_userName(ref_ID)
{	
	var utype = $('.user_type:checked').val();	
	$.ajax({
		type: "POST",
		url: "ajax/user.php",
		data: { ref_ID: ref_ID, utype: utype} ,
		success: function(data){
			$("#u_name").val(data);
		}		
	});	
}

function lfn_Show_AgentName(p_ID)
{	
	$.ajax({
		type: "POST",
		url: "ajax/user.php",
		data: { referral_id: p_ID, get_AgentName: "GetAgentName"} ,
		success: function(data){
			$("#agent_name").val(data);	
			
		}		
	});
}

function lfn_Show_user(str)
{	
	$.ajax({
		type: "POST",
		url: "ajax/user.php",
		data: { referral_id: str, get_userName: "GetUserName"},
		success: function(data){		
			$("#company_id").html(data);
		}		
	});
}


$(document).ready(function () {
  $(".user_type").change(function () {

      var str = $('.user_type:checked').val();
		if(str=="SUPERSTOCKIST"){
		  document.getElementById("text_chnge").innerHTML="Company ID *";	
		  lfn_Show_user(str);
		  $('.districtID').attr('disabled', true);
		  document.getElementById("u_name").value="";     
		  document.getElementById("u_type").value="COMPANY";
		  document.getElementById("new_submit").disabled=false;
		  document.getElementById("dist_change").style.display="block";
		  document.getElementById("text_chnge1").innerHTML="SUPER STOCKIST Name <span style='color:red;'>*</span>";
			$('#bonus_cnf').show('slow');
			$('#f_plan').hide('slow');
			$('#agent_show').hide('slow');
			$("#registration_fee").val('');
			$('#registration_fee').attr('readonly', false);
		   var res = "SD"+Date.now();
		   $('#user_id').val(res);
	  }else if(str=="CNF"){
		  document.getElementById("text_chnge").innerHTML="SUPER STOCKIST ID *";	
		  lfn_Show_user(str);
		  $('.districtID').attr('disabled', false);
		  document.getElementById("u_name").value="";     
		  document.getElementById("u_type").value="COMPANY";
		  document.getElementById("new_submit").disabled=false;
		  document.getElementById("dist_change").style.display="block";
		  document.getElementById("text_chnge1").innerHTML="CNF Name <span style='color:red;'>*</span>";
			$('#bonus_cnf').show('slow');
			$('#f_plan').hide('slow');
			$("#registration_fee").val('');
			$('#agent_show').show('slow');
			$('#registration_fee').attr('readonly', false);
		   var res = "SD"+Date.now();
		   $('#user_id').val(res);
	  }else if(str=="FRANCHAISE"){		  
		  document.getElementById("text_chnge").innerHTML="CNF ID <span style='color:red;'>*</span>";	  
		  lfn_Show_user(str);		  
		  document.getElementById("u_name").value="";
		  document.getElementById("u_type").value="CNF";
		  document.getElementById("new_submit").disabled=false;
		  document.getElementById("dist_change").style.display="none";
		  document.getElementById("text_chnge1").innerHTML="Franchaise Name <span style='color:red;'>*</span>";
			$('#f_plan').show('slow');
			$('#bonus_cnf').hide('slow');
			$('#agent_show').show('slow');
			var res = "FC"+Date.now();
			$('#user_id').val(res);
			$('#registration_fee').attr('readonly', true);
	  }else{
		   document.getElementById("new_submit").disabled=true;
	  }
	  
  });
  });
function isNumber(evt) {
	var iKeyCode = (evt.which) ? evt.which : evt.keyCode
	if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57)){
		return false;
	}
	return true;
}	

function get_plan(ftypeID){
	$.ajax({
		type: "POST",
		url: "ajax/user.php",
		data: { ftypeID: ftypeID} ,
		success: function(data){
				var res = data.split("@@@",2);				
			$("#plan_id").html(res[0]);			
			$("#registration_fee").val(res[1]);
		}		
	});
}


/*function get_plan_price(plan){
	var utype = $('.user_type:checked').val();
	if(utype=="FRANCHAISE"){
		$.ajax({
			type: "POST",
			url: "ajax/user.php",
			data: { plan: plan, utype: utype} ,
			success: function(data){				
				$("#registration_fee").val(data);				
			}		
		});
	}else{
		$("#registration_fee").val('');
	}
}*/

</script>
<script>
/*$(document).ready(function(){
	$("#company_id").keyup(function(){
		var u_type=$('#u_type').val();	
		var z = $("#company_id").val();
		if(z=="cn"){
			$.ajax({
			type: "POST",
			url: "ajax/get_user1.php",
			data:'keyword='+$(this).val()+'&u_type='+u_type,			
			success: function(data){
				$("#suggesstion-box").show();
				$("#suggesstion-box").html(data);			
				$("#company_id").css("background","#FFF");	
				
			}
			});
	
		}else{
			$.ajax({
			type: "POST",
			url: "ajax/get_user.php",
			data:'keyword='+$(this).val()+'&u_type='+u_type,			
			success: function(data){
				$("#suggesstion-box").show();
				$("#suggesstion-box").html(data);			
				$("#company_id").css("background","#FFF");	
				
			}
			});
		}
	
	
	
	
	});
});

function selectCountry(val,val1) {
$("#company_id").val(val);
$("#u_name").val(val1);
$("#suggesstion-box").hide();
}*/

function check_pan(pan){
	var regExp = /[a-zA-z]{5}\d{4}[a-zA-Z]{1}/;	 
	if (pan.length == 10 ) { 
		if( pan.match(regExp) ){ 
			document.getElementById("pan_match").innerHTML='<span style="color:green; font-size:12px;">PAN number verified.</span>';			
		}else {
			document.getElementById("pan_match").innerHTML='<span style="color:red; font-size:12px;">* Not a valid PAN.</span>';	     
		} 
 }else{ 
	document.getElementById("pan_match").innerHTML='<span style="color:red; font-size:12px;">* Please enter 10 digits for a valid PAN.</span>';
            
	} 
}

function choose_payMode(pay_mode){
	if(pay_mode=="Cash"){
		$('#show_div').hide('slow');
		$('#show_div123').hide('slow');
	}else if(pay_mode=="Bank Transfer"){
		$('#show_div').show('slow');
		$('#show_div123').hide('slow');
	}else if(pay_mode=="Cheque/DD"){
		$('#show_div').hide('slow');
		$('#show_div123').show('slow');
	}else if(pay_mode=="Online Payment"){
		$('#show_div').show('slow');
		$('#show_div123').hide('slow');
	}else if(pay_mode==""){
		$('#show_div').style.display="none";
		$('#show_div123').style.display="none";
	}
}

function calculate_due(paid_fee,reg_fee){	
	if(Number(paid_fee) <= Number(reg_fee)){
		var due=0;
		due = parseFloat(reg_fee) - parseFloat(paid_fee);
		$('#due_amount').val(due);
	}else {		
		alert("Paid amount cannot exceeded application fees");
		$('#due_amount').val('0.00');
		$('#paid_amount').val('0.00');
	}
}
</script>
<script>
function ff(url) {
  var txt;
  var r = confirm("Are you want to delete this?");
  if (r == true) {
    window.location = url;
  } else {
    
  }
  document.getElementById("demo").innerHTML = txt;
}
</script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
  <header class="main-header">
    <?php include "common/header.php";?>
  </header> 
  <aside class="main-sidebar">    
    <section class="sidebar">
      <?php include "common/LEFT_sidebar.php";?>
  </aside>  
  <div class="content-wrapper">    
     <section class="content-header">
      <div class="header-icon">
		<i class="fa fa-file-text-o" style="color:#37a000; font-size:50px;"></i>
	   </div>
      <h1 style="fonyt-family:'Alegreya Sans',sans-serif; margin: 0; font-size: 24px">Add No payment Date<br><span style="font-size: 13px; display: inline-block; padding-left: 4px; font-weight: 600; color: #7a7a7a;">Add No payment Date</span></h1>
      <ol class="breadcrumb">
        <li><a href="home.php"><i class="fa fa-dashboard"></i>Home</a></li>        
        <li class="active" style="color:#37a000; font-weight:bold;">Add No payment Date</li>
      </ol>
    </section>       
    <section class="invoice">           
      <div class="row">
	  <div class="col-xs-8">
		<div class="modal-body" style="">		                  
			<div id='msg'><?php if(isset($_GET['success'])){ echo $success; echo "<script> setTimeout(\"window.location = 'no_payment_date.php'\",2000); </script>"; } ?><?php if(isset($_GET['err'])){ echo $err; echo "<script> setTimeout(\"window.location = 'no_payment_date.php'\",2000); </script>"; } ?></div>                        
			<form class="form-horizontal" role="form" id="addSalHead" action="" method="POST"  enctype='multipart/form-data'  >
			<?php if (isset($_REQUEST['id']) && $_REQUEST['edit'] == 'true'){ ?>  
			<input type="hidden" name="btnedit" value="Modify" />
			<?php }else{ ?>
				<input type="hidden" name="product_tbl" value="PRODUCT" />
			<?php } ?>	
				
				<div class="form-group">					
					
					<div class="col-sm-6">
					<label class="control-label">From Date <span style="color:red;">*</span></label>
						<input type="text" class="form-control datepicker2" name="from_date" id="from_date" value="<?php echo isset($_REQUEST['id']) ? $row_service['from_date'] : date("Y-m-d"); ?>" autocomplete="off" required>
					</div><div class="col-sm-6">
					<label class="control-label">To Date <span style="color:red;">*</span></label>
						<input type="text" class="form-control datepicker2" name="to_date" id="to_date" value="<?php echo isset($_REQUEST['id']) ? $row_service['to_date'] : date("Y-m-d"); ?>" autocomplete="off" required>
					</div>
					
				</div>
				<div class="form-group">					
					<div class="col-sm-6">
					<div class=" col-sm-12">
					<label class="control-label">&nbsp;&nbsp;&nbsp;	</label>
					<label class="control-label">&nbsp;&nbsp;&nbsp;	</label> </div>
					  <button type="submit" class="btn btn-success" name="submit" >Submit</button>				 
					</div>				
				</div>				
			</form>
		</div>
                    
	  </div>
        <div class="col-xs-4 table-responsive">
		<div id="result" style="margin:15px 0;"></div>
          <table class="table table-bordered table-sm">
            <thead>
            <tr style="fonyt-family:sans; background:#008B8B; color:#fff;">
			  <th>Sl</th>
			  <th class="text-center">From Date</th>
              <th class="text-left">To Date</th>            
              <th class="text-left">Action</th>
            </tr>
            </thead>
            <tbody>
			<?php $sno = 1; ?>
            <?php
				$bg_color="#FFF";
				while($row=mysqli_fetch_array($q_query)){				
				$from_date=$row['from_date'];
				$to_date=$row['to_date'];
				$id=$row['id'];
				if($bg_color=="#FFF") $bg_color="#fff";
					else $bg_color="#FFF";
			?>
            <tr bgcolor="<?php echo $bg_color;?>">
              <td style="font-size:11px;"><?php echo $sno; ?></td>
              <td class="text-left" style="font-size:11px;"><?php echo $from_date; ?></td>           
              <td class="text-left" style="font-size:11px;"><?php echo $to_date; ?></td>           
              <td class="text-center"> <div> 
				<a href="no_payment_date.php?edit=true&id=<?php echo $row['id']; ?>" ><i class="fa fa-edit"></i></a>
				<span onclick=ff("no_payment_date.php?delete=true&idd=<?php echo $row['id']; ?>"); title="Delete"><i class="glyphicon glyphicon-remove" style="color:red; cursor:pointer;"></i></span>
			
			</div></td>
            </tr>			
				<?php $sno = $sno+1;  } ?>
            </tbody>
          </table>	
			<div class="pull-right no-print" style="text-align: center">
			
			
			</div>		  
        </div>        
      </div>  
    </section>
    <div class="clearfix"></div>
  </div>  
     <div class="modal fade" id="modal-container-222456" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header" style="background:#fff; padding:0;" id="msg">
				
				
			</div>
			<div class="modal-body">								
				<div class="form-group">					
					<div class="col-sm-12">
					<center><label class="control-label" id="user_data"></label></center>						
					</div>
									
				</div>	
				<div class="clearfix" style="height:15px;"></div>
				<div class="form-group">
				  <div class="col-sm-offset-5 col-sm-12">
					  <button type="button" data-dismiss="modal" aria-hidden="true" class="btn btn-primary">Close</button>
				  </div>
				</div>                          
				 <div class="clearfix" style="height:30px;"></div>
			</div>
			</div>                    
		</div>
	</div>   
  <footer class="main-footer">
    <?php include "common/footer.php";?>
  </footer>
</body>
</html>     
 <script>  	
	$(document).ready(function (e){
		$("#addUser").on('submit',(function(e){
			var password = $("#user_password").val();
            var confirmPassword = $("#user_cpassword").val();
            if (password != confirmPassword) {
                alert("Passwords do not match.");
                return false;
            }     
        
			e.preventDefault();
			var url = $(this).attr('action');			
			console.log(url);			
				$.ajax({
					url: url,
					type: "POST",
					data:  new FormData(this),
					contentType: false,
					cache: false,
					processData:false,
						success: function(data){							
						var res=data.split("@@@",2);						
						$('#user_data').html(res[0]);
						$('#msg').html(res[1]);	                  
						$('#addUser')[0].reset();
						
						},
					error: function(){} 	        
				});
			
			
			}));
		});
</script>
<script>
$("#modal-container-666931").on('hidden.bs.modal', function(e){window.location.reload();});
$("#modal-container-222456").on('hidden.bs.modal', function(e){window.location.reload();});
</script>
<script>
var count = 2;
    var limits = 500;    
    function addpruduct(e) {
        var t = $("tbody#proudt_item tr:first-child").html();
        count == limits ? alert("You have reached the limit of adding " + count + " inputs") : $("tbody#proudt_item").append("<tr>" + t + "</tr>")
    }
      function deleteRow(e) {
        var t = $("#product_table > tbody > tr").length;
        if (1 == t) alert("There only one row you can't delete.");
        else {
            var a = e.parentNode.parentNode;
            a.parentNode.removeChild(a)
        }
        calculateSum()
    }

function get_userData(id){
	$.ajax({
		type: "POST",
		url: "ajax/user.php",
		data: { id: id, get_userData: "User"} ,
		success: function(data){		
			var res=data.split("#",29);				
			document.getElementById('u_id').value=res[0];
			document.getElementById('user_id123').innerHTML=res[1];
			document.getElementById('user_type123').innerHTML=res[2];
			document.getElementById('company_id123').value=res[3];
			document.getElementById('doj123').value=res[4];
			document.getElementById('user_name123').value=res[5];
			document.getElementById('user_address123').value=res[6];
			document.getElementById('state_name123').value=res[7];
			document.getElementById('user_pin123').value=res[8];
			document.getElementById('user_phone123').value=res[9];
			document.getElementById('user_phone1123').value=res[10];
			document.getElementById('user_gender123').value=res[11];
			document.getElementById('user_email123').value=res[12];
			document.getElementById('aadhar_no123').value=res[13];
			document.getElementById('pan_no123').value=res[14];
			document.getElementById('dob123').value=res[15];
			document.getElementById('nominee_name123').value=res[16];
			document.getElementById('nominee_age123').value=res[17];
			document.getElementById('nominee_relation123').value=res[18];
			document.getElementById('user_fa_hus123').value=res[19];
			document.getElementById('user_fa_occupation123').value=res[20];
			document.getElementById('bank_name123').value=res[21];
			document.getElementById('account_no123').value=res[22];
			document.getElementById('account_name123').value=res[23];
			document.getElementById('ifsc_code123').value=res[24];
			document.getElementById('registration_fee123').value=res[25];
			document.getElementById('user_area123').value=res[26];
			document.getElementById('user_location123').value=res[27];
			document.getElementById('user_password123').value=res[28];
			
		}		
	});
}
function delete_user(id){
	var url = "ajax/user.php";	
	var msg = confirm("Are you sure?");	
	if (msg == true) { 
		$.ajax({
			url: url,
			type:"POST",
			data:'id='+id+'&delete_user=User'
			}).done(function(data){					
			$("#msg").html(data);
			setTimeout('document.location.href="new_joining.php"',400);			
			
		});
	}else{
	 return false;
	}
}
 $("#item-search").on('click', function (e){
    e.preventDefault();
    var item = $("#item").val();	
    console.log(item);	
        $.ajax({
            type:'POST',
            url:'ajax/client.php',
            data:'q='+item
        }).done(function (data){
            $("#response-table").html(data);			
        });
    
});


	$(function(){
        $( "#editUser" ).submit(function( event ) {
           event.preventDefault();
            var url = $(this).attr('action');
            console.log(url);            
            $.ajax({
                url: url,
                data: $("#editUser").serialize(),
                type: $(this).attr('method')
              }).done(function(data) {
                   $("#ajax_edit").html(data);
				   setTimeout('window.location.href="new_joining.php"',4000);             
              });
            
        });
    });
</script>
<script src="assets/bower_components/select2/dist/js/select2.full.min.js"></script>
<script>
$('.select2').select2({  
  sorter: function(results) {
    var query = $('.select2-search__field').val().toLowerCase();
    return results.sort(function(a, b) {
      return a.text.toLowerCase().indexOf(query) -
        b.text.toLowerCase().indexOf(query);
    });
  }
});
</script>

<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<script src="assets/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="assets/bower_components/raphael/raphael.min.js"></script>
<script src="assets/bower_components/morris.js/morris.min.js"></script>
<script src="assets/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
<script src="assets/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="assets/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="assets/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
<script src="assets/bower_components/moment/min/moment.min.js"></script>
<script src="assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="assets/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="assets/bower_components/fastclick/lib/fastclick.js"></script>
<script src="assets/dist/js/adminlte.min.js"></script>
<script src="assets/dist/js/pages/dashboard.js"></script>
<script src="assets/dist/js/demo.js"></script>
