<?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'>CREATE A NEW ORDER
        <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' 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'>
            </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' style='padding-top:10px;'>LC&nbsp;No/Container </label></div>	

	 <div class='col-md-3'>
          <input name='lcno' class='form-control text-center' type='text' onkeyup='format(this);' value='$lcno'>
            </div><div class='col-sm-3 col-xs-5' style='padding-left:0px; margin-left:0px;'>
	    
	    <select class='form-control' name='conte' title='Container' data-toggle='tooltip' data-placement='top' style='margin-left:0px;' required>
	    <option value='' selected='selected'></option>";
		    
		    if($conte=='40FT'){
		        $f='selected';
		        $t=$l='';
		    }
		    if($conte=='20FT'){
		        $f=$l='';
		        $t='selected';
		    }
		    if($conte=='FLAT'){
		        $f=$t='';
		        $l='selected';
		    }
			echo"<option value='20FT' $t> 20FT </option><option value='40FT' $f> 40FT </option><option value='FLAT' $l> FLAT </option>";
			
		   echo"</select></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;'>Item Name</label>
        </div>
            <div class='col-md-6'>
<input name='item' class='form-control text-center' id='searchi' type='text' value='$item'>
            </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;'>Quantity/Unit </label></div>	

	 <div class='col-md-4'>
          <input name='qty' class='form-control text-center' type='text' onkeyup='format(this);' value='$qto' onkeypress='return isNumberKey(event)' required>
            </div><div class='col-sm-2 col-xs-5' style='padding-left:0px; margin-left:0px;'>
	    
	    <select class='form-control' name='unit' title='Count Unit' data-toggle='tooltip' data-placement='top' style='margin-left:0px;' required>
	    <option value='' selected='selected'>UNIT</option>";
		    
		    if($unit=='SQM'){
		        $sq='selected';
		        $pc=$st='';
		    }
		    if($unit=='PCS'){
		        $sq=$st='';
		        $pc='selected';
		    }
		    if($unit=='SET'){
		        $sq=$pc='';
		        $st='selected';
		    }
		    
			echo"<option value='SQM' $sq> SQM </option>
			<option value='PCS' $pc> PCS </option>
			<option value='SET' $st> SET </option>";
			
		   echo"</select></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;'>Total Amount</label>
        </div>
            <div class='col-md-6'>
           <div class='input-group'>
<span class='input-group-addon'>&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;</span>	
      <input class='form-control form-center' name='amo' class='form-control text-center' onkeyup='format(this);' onkeypress='return isNumberKey(event)' type='text' value='$amoo' required></div>
              </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;'>Purchase Type</label>
        </div>
            <div class='col-md-6'>
	    
	    <select class='form-control' name='type' title='Purchase Type' data-toggle='tooltip' data-placement='top' style='margin-left:0px;' required><option value='' selected='selected'></option>";
		    
		    if($type=='LOCAL'){
		        $c='selected';
		        $e=$o='';
		    }
		    if($type=='EAC'){
		        $e='selected';
		        $c=$o='';
		    }
		    if($type=='OVERSEASE'){
		        $o='selected';
		        $e=$c='';
		    }
			echo"<option value='LOCAL' $c> LOCAL PURCHASE </option><option value='EAC' $e> EAC PURCHASE </option><option value='OVERSEASE' $o> OVERSEASE </option>";
			
		   echo"</select></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>";
?>