
				<div class="panel panel-primary">
					<div class="panel-heading"style="font-size:1.2em;">سحب المستأجرين القدامي</div>
          <div class="panel-body"style="background-color:#00324d;color:#cce5ff;">
						<br /><br />
						<br /><br />
						<!-- <form mehtod="post" id="export_excel">
								 <label>Select Excel</label>
								 <input type="file" name="excel_file" id="excel_file" />
						</form> -->
						<br />
						<br /><br />
						<form mehtod="post" id="export_cont" enctype='multipart/form-data'>
								 <label>Select cont Excel</label>
								 <input type="file" name="excel_cont" id="excel_cont" />
						</form>
						<br />
						<!-- <h2 align="center">Update Mysql Database through Upload CSV File using PHP</a></h2>
	         <br />
	       <form method="post" id="csv" enctype='multipart/form-data'>
	               <p><label>Please Select File(Only CSV Formate)</label>
	             <input type="file" name="csv_file" /></p>
	             <br />
	       <input type="submit" id="csv_btn" name="csv_btn" class="btn btn-info" value="Upload" />
	      </form> -->
	    <br />
						<br />
						<div class="row" style="padding:2px;">
					        <div class="col-xs-3 col-md-3"style="float:right;">
					            <label for="carid" class="control-label "style="float:left;">فتح عقد لسيارة رقم</label>
					        </div>
									<div class="col-xs-3 col-md-3"style="float:right;">
							    <input type="text" id="nn" name="nn" class="form-control" name="nn" style="float:left; margin-right:8px; color: #000 ;" placeholder="ابحث بالرقم">
							  </div>
									<div class="col-xs-2 col-md-2"style="float:right;">
						      <a id="nn_sr" href=""target="_blank"><button type="button" style="float:right;  margin-right:8px; color: #000 ;" class="btn btn-success">فتح</button></a>
						    </div>
					    </div>
          </div>
				</div>

				<?php
			 $outcont = array();
			 include "../actions/dbPDO.php";
			 $sql =$db->prepare("SELECT concat(kind ,' ', numbers,' ' , color,' ' , model) as info ,
			 carid from cars ") ;
			 $sql->execute();
			 $i= 0;
	 if($sql->rowCount()>0)
		 {
			while($row = $sql->fetch()){
				$outcont[$i] = array(
						 "data" => $row["carid"],
						"value" => $row["info"]
						);
						$i++ ;
			            }
			         }
			     else
			     {
			          $outcont[0]= 'لا يوجد ';
			     }
			 ?>
  <script>
  $(document).ready(function(){
		var arr=  JSON.parse('<?php echo json_encode($outcont) ; ?>');
		$('#nn').autocomplete({
		 lookup: arr,
		 maxHeight : 200,
		 onSelect: function(suggestion) {
			$('#nn_sr').attr("href","mass/cont2close.php?id= " + suggestion.data);
					//  one_invoice(suggestion.data);
					 },
			}) ;

       $('#excel_file').change(function(){
            $('#export_excel').submit();
       });
       $('#export_excel').on('submit', function(event){
            event.preventDefault();
            $.ajax({
                 url:"mass/export.php",
                 method:"POST",
                 data:new FormData(this),
                 contentType:false,
                 processData:false,
                 success:function(data){
                      $('#signup_msg').html(data);
                      $('#excel_file').val('');
                 }
            });
       });

			 $('#excel_cont').change(function(){
            $('#export_cont').submit();
       });
       $('#export_cont').on('submit', function(event){
            event.preventDefault();
            $.ajax({
                 url				:"mass/ex_cont.php",
                 method			:"POST",
                 data				:new FormData(this),
                 contentType:false,
                 processData:false,
                 success:function(data){
                      $('#signup_msg').html(data);
                      $('#excel_cont').val('');
                 }
            });
       });


			$("#csv_btn").click(function(event){
						event.preventDefault();
						// alert(123);
						$.ajax({
								 url			: "acc/csv.php",
								 method		: "POST",
								 data:new FormData(this),
							   contentType:false,
							   processData:false,
								 success:function(data){
											$('#signup_msg').html(data);
											$('#csv_file').val('');
								 }
						});
			 });
  });
  </script>
