<?php
   echo"<div class='modal fade' id='Modaldis-$i' tabindex='-1' role='dialog' aria-labelledby='exampleModalLabel' aria-hidden='true'>
  <div class='modal-dialog' role='document'><div class='modal-content'><div class='modal-header text-left'>
        <h5 class='modal-title' id='exampleModalLabel'>$af
        <span class='pull-right'>  </span></h5>

      </div><form action='' method='post'>
      <div class='modal-body text-left'><div class='row'>

        <div class='form-group'>
			<div class='col-md-5' align='right'> 
    <label class='control-label' style='padding-top:10px;'>Due Date</label>
        </div>
            <div class='col-md-6'>
        <div class='input-group date' data-provide='datepicker'>	
      <input class='form-control form-center' name='dati' type='text' value='$dati' onkeypress='return isNumberKey(event)' required>
	  <span class='input-group-addon'><i class='lnr lnr-calendar-full'></i></span></div>
            </div></div>
		<div class='row'> </div>
		
		
			<div class='form-group'>	 
			  <div class='col-md-5' align='right'>
			  <label class='control-label'> &nbsp; </label></div>	

	 <div class='col-md-6'> &nbsp; </div>
		</div>
		<div class='row'> </div>
		
		<div class='form-group'>
			<div class='col-md-5' align='right'> 
    <label class='control-label' style='padding-top:10px;'>Supplier`s Name</label>
        </div>
            <div class='col-md-6'>
<input name='name' class='form-control' type='text' OnKeyup='return cUpper(this);' value='$name' list='takere'><datalist id='takere'>";
            
            for($l=1; $l<$kt; $l++){
                $sup=$supo[$l];
				if($name==$sup)
					$t='selected';
				else
					$t='';
			echo"<option value='$sup' $t>";
						}

            echo"</datalist></div></div>
		<div class='row'> </div>
		
			<div class='form-group'>	 
			  <div class='col-md-5' align='right'>
			  <label class='control-label'> &nbsp; </label></div>	

	 <div class='col-md-6'> &nbsp; </div>
		</div>
		<div class='row'> </div>
		
		<div class='form-group'>
			<div class='col-md-5' align='right'> 
    <label class='control-label' style='padding-top:10px;'>Invoice Number</label>
        </div>
            <div class='col-md-6'>
<input name='invo' class='form-control text-center' OnKeyup='return cUpper(this);' type='text' value='$invo'>
            </div></div>
		<div class='row'> </div>
		
			<div class='form-group'>	 
			  <div class='col-md-5' align='right'>
			  <label class='control-label'> &nbsp; </label></div>	

	 <div class='col-md-6'> &nbsp; </div>
		</div>
		<div class='row'> </div>
		
		<div class='form-group'>	 
			  <div class='col-md-5' align='right'>
			  <label class='control-label' style='padding-top:10px;'>Amount / Currency </label></div>	

	 <div class='col-md-3'>
          <input name='amo' class='form-control text-center' type='text' onkeyup='format(this);' value='$tam' onkeypress='return isNumberKey(event)' required>
            </div><div class='col-sm-3 col-xs-5' style='padding-left:0px; margin-left:0px;'>
	    
	    <select class='form-control' name='curre' title='Currency' data-toggle='tooltip' data-placement='top' style='margin-left:0px;' required><option value='' selected='selected'>Currency</option>";
		
			$doi=mysqli_query($conn, "SELECT `Code`, `Rate` FROM `currency` WHERE `Code`!='' ORDER BY `Code` ASC");
			while($roi=mysqli_fetch_assoc($doi)){
				$fna=$roi['Code'];
				$rate=$roi['Rate'];
				if($curre==$fna)
				    $s="selected";
				else
				    $s='';
				$rte=number_format($rate, 2);
			echo"<option value='$fna' $s> $fna @ $rte </option>";
			}
		
		   echo"</select></div>
		</div>
	
		<div class='row'> </div>
		
		
		
		
			<div class='form-group'>	 
			  <div class='col-md-5' align='right'>
			  <label class='control-label'> &nbsp; </label></div>	

	 <div class='col-md-6'> &nbsp; </div>
		</div>
		<div class='row'> </div>
		
		<div class='form-group'>	 
			  <div class='col-md-5' align='right'>
			  <label class='control-label' style='padding-top:10px;'>VAT / WithHolding</label></div>	

	 <div class='col-md-3'>
          <input name='vat' class='form-control text-center' type='text' onkeyup='format(this);' value='$vato' onkeypress='return isNumberKey(event)' required>
            </div><div class='col-sm-3 col-xs-5' style='padding-left:0px; margin-left:0px;'>
	    
	   <input name='holding' class='form-control text-center' type='text' onkeyup='format(this);' value='$taxo' onkeypress='return isNumberKey(event)' required></div>
		</div>
	
		<div class='row'> </div>
		
			<div class='form-group'>	 
			  <div class='col-md-5' align='right'>
			  <label class='control-label'> &nbsp; </label></div>	

	 <div class='col-md-6'> &nbsp; </div>
		</div>
		<div class='row'> </div>
			 	
		 <div class='form-group'>	 
			  <div class='col-md-5' align='right'>
			  <label class='control-label' style='padding-top:10px;'>Purpose/Comment</label></div>	

	 <div class='col-md-6'>
          <textarea name='purpo' class='form-control' type='text'>$purpo</textarea>
            </div>
		</div>
		
		
		
		<div class='row'> </div>
		
			

		
	</div></div>";
	
	if($i=='0')
	    echo"<div class='modal-header text-right' style='height:50px; padding-top:15px;'>
	<input type='hidden' name='dato' value='$dato'><input type='hidden' name='datos' value='$datos'>
	<input type='hidden' name='p' value='$p'><input type='hidden' name='custo' value='$custo'>
		<button type='button' class='btn btn-xs btn-danger' data-dismiss='modal' style='width:80px;'> CANCEL </button>
        <button type='submit' name='addo' class='btn btn-xs btn-success' style='width:80px;'> SAVE </button></div>";
    else
	    echo"<div class='modal-header text-right' style='height:50px; padding-top:15px;'>
	<input type='hidden' name='dato' value='$dato'><input type='hidden' name='datos' value='$datos'>
	<input type='hidden' name='p' value='$p'><input type='hidden' name='custo' value='$custo'><input type='hidden' name='code' value='$code'>
		<button type='button' class='btn btn-xs btn-danger' data-dismiss='modal' style='width:80px;'> CANCEL </button>
        <button type='submit' name='updo' class='btn btn-xs btn-success' style='width:80px;'> UPDATE </button></div>";
        
      echo"</form>
  </div></div>
</div>";
?>