

         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		
		
		
    </script> 

         <script type="text/javascript">
  
		$(document).on("click", "#editbtn", function()
        {
          var mycategoryid = $(this).data('id');
		  $("#mycategoryid").val(mycategoryid); 
		       var paid = $(this).data('paid');
		   $("#paid").val(paid);
		    var ordernumber = $(this).data('ordernumber');
		   $("#ordernumber").val(ordernumber);
  		   
   var shippingto = $(this).data('shippingto');
		   $("#shippingto").val(shippingto);
 
		    var remarks = $(this).data('remarks');
		   $("#remarks").val(remarks); 
		   
		     var taxable = $(this).data('taxable');
		   $("#taxable").val(taxable); 
		   
		     var vat = $(this).data('vat');
		   $("#vat").val(vat);
 
		    var vatrate = $(this).data('vatrate');
		   $("#vatrate").val(vatrate); 
		   
		     var amount = $(this).data('amount');
		   $("#amount").val(amount); 
		     var paiddate = $(this).data('paiddate');
		   $("#paiddate").val(paiddate);
 
		    var pin = $(this).data('pin');
		   $("#pin").val(pin); 
		   
		     var fromdate = $(this).data('fromdate');
		   $("#fromdate").val(fromdate); 
		 
		   var invoice_number = $(this).data('invoice_number');
		   $("#invoice_number").val(invoice_number); 

		     var supplier = $(this).data('supplier');
		   $("#supplier").val(supplier); 
		  
		   
		  
		  
		   
        });
		
		
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
			$(document).on("click", "#paybtn", function()
        {
          var billid = $(this).data('id');
		  $("#billid").val(billid); 
		   
		     var amount = $(this).data('amount');
		   $("#amount1").val(amount); 
		      var 	paid = $(this).data('paid');
		   $("#paid1").val(paid); 
   var invoice = $(this).data('invoice');
		   $("#invoice1").val(invoice); 
		   
		   
		     var balance = $(this).data('balance');
		   $("#balance1").val(balance); 
		 
		  
		  
		   
        });
			function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

    // document.body.innerHTML = printContents.fontsize(12);
     window.print();

	 if( window.print()) {
         window.location.href = "../user/startsales";
		alert(" printing...........");
    }else {

	
		      return      window.location.href = "../user/startsales";

		    // document.body.innerHTML = originalContents;

	}
}
		
    </script>  
  <style type="text/css">
  
  

    #printableArea { display: none; }
#print{  	


    background-repeat: no-repeat;
	font-size;20px;
  
    width:100%; 


}

#sale{  	


    background-repeat: no-repeat;
  
    width:100px; height:50px;


}
    @media print
    {
    	#non-printable { display: none; }
    	#printableArea { display: block; font-size:16; width:100%; }
		    	#myprint { display: block; font-size:16; width:100%; }

    }
    </style>
 
 <div class="row">
  
   	

   	<div class="col-md-12">
			<?PHP
 echo $this->session->flashdata('deletemsg'); 
	 $session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	    $addproductaction=$this->usermodel->populatuserpermissionsdataarray('purchases','add',$userid);

	 $updateaction=$this->usermodel->populatuserpermissionsdataarray('purchases','update',$userid);
  $updatebuyingpriceaction=$this->usermodel->populatuserpermissionsdataarray('purchases','updatebuyingprice',$userid);
  $deleteaction=$this->usermodel->populatuserpermissionsdataarray('purchases','delete',$userid);
  $updatesellingpriceaction=$this->usermodel->populatuserpermissionsdataarray('purchases','updatesellingprice',$userid);
    $updateclosedinvoiceaction=$this->usermodel->populatuserpermissionsdataarray('purchases','updateclosedinvoice',$userid);
 $wiewinvoices=$this->usermodel->populatuserpermissionsdataarray('incomeexpenses','wiewinvoices',$userid);
	      $viewbills=$this->usermodel->populatuserpermissionsdataarray('incomeexpenses','viewbills',$userid);
  $viewdebtors=$this->usermodel->populatuserpermissionsdataarray('incomeexpenses','viewdebtors',$userid);
  $viewcreditors=$this->usermodel->populatuserpermissionsdataarray('incomeexpenses','viewcreditors',$userid);
    $viewexpense=$this->usermodel->populatuserpermissionsdataarray('incomeexpenses','viewexpense',$userid);

  $addpeople=$this->usermodel->populatuserpermissionsdataarray('members','add',$userid);
	 
function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						return $number;
					}
								?>	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading" ID="non-printable">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
				 <span class="pull-right"> View purchases</span>
	  <a data-toggle='modal' data-target='#addModal' class="btn btn-default">Add New Purchase </a>
				 				 	  <a data-toggle='modal' data-target='#purchaseModal' class="btn btn-default">Search for aging purchases</a>
 <a data-toggle='modal' data-target='#uploadModal' class="btn btn-default">Upload purchased products  </a>
  <a href="<?php echo base_url();?>downloads/purchasestock.csv" class="btn btn-default">Download   purchases template </a>	 


 <?php

 if( $viewexpense==true){
 ?>
 						 <a href="<?php echo base_url();?>user/viewexpenses" class="btn btn-default"> View Expense</a>

 
<?php	
}
  ?>
 <?php

 if( $viewbills==true){
 ?>
 						 <a href="<?php echo base_url();?>user/paybill" class="btn btn-default"> Pay bills</a>

 
<?php	
}
  ?>
	  <?php

 if( $wiewinvoices==true){
 ?>
 	  	  				 	  	  				 <a href="<?php echo base_url();?>user/allinvoices" class="btn btn-default"> All Invoices</a>
	  	  				 <a href="<?php echo base_url();?>user/incoicepayments" class="btn btn-default"> Receive Payments</a>

 
<?php	
}
  ?>
	  <?php

 if( $viewdebtors==true){
 ?>
 	  	  				 <a href="<?php echo base_url();?>user/allcreditors" class="btn btn-default"> All Debtors</a>

 
<?php	
}
  ?>
	  <?php

 if( $viewcreditors==true){
 ?>
 						 	  	  				 <a href="<?php echo base_url();?>user/viewallcreditors" class="btn btn-default"> All Creditors</a>

 
<?php	
}
  ?>
	  <?php

 if( $addpeople==true){
 ?>
                         <a data-toggle='modal' data-target='#addsupplierModal' class="btn btn-default">Add Campany </a>

 
<?php	
}
  ?>
	 					<?php
		    
$session_data = $this->session->userdata('logged_in');


$data['surname'] = $session_data['surname'];
$data['id'] = $session_data['id'];

$surname=$data['surname'];
   $userid=$data['id'];

										$bussinessname=$configuration[0]['businessname']; if(isset($bussinessname)) {echo   $bussinessname; }
							$mysupplier=$this->usermodel->populateallarray('people','id', $userid);
								$customername=$mysupplier[0]['firstname'];
										?> 					

			
			

            	</div>
            </div>
			<div class="panel-body">

			
	<div class="widget-content nopadding table_holder table-responsive" >				
	
					<div class="row">
						<div class="col-md-12">
									<div class="row">
					
                 </div>
							<div class="panel-body">
	
			
  <table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" id="example" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
			 
			 
			   <tr>
						
								<td colspan="4" ><center  >
								
						
									

					
												<span id="mytitle"><b><BR> CREDITORS REPORT </b>		
								
								<br><b>Printed by: <?php echo $customername;  ?>----Signature--------</b></span>

								</center></td>
																	<td id="non-printable"></td>

								
							</tr>
         <tr>
		  	<th> Supplier  Name</th>

			<th> Amount </th>
					<th> Paid </th>

			<th> Balance </th>

				
					
					<th id="non-printable">More</th>

		


                 </tr>
             </thead>
<?php
 $finaltotal=0;
   $totalamount=0;
   $ttpaid=0;
   $ttbalance=0;
 if(!is_array($viewpurchases)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='14'>";
    
       echo '<div class="alert alert-default text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 

  	foreach ($viewpurchases as $c): 

		 
	 $supplier= $c->supplier;

             ?>



             <tr>
                
            <?php 

$totalamount=$totalamount+$c->amount ; 
?>

            <td>
	 

	 <?php  

$myuser=$this->usermodel->getpeople($supplier);
if($myuser[0]['company']==""){
	    echo $myuser[0]['firstname']." ".$myuser[0]['phone'];

}else{
    echo $myuser[0]['company']."-".$myuser[0]['phone'];
	
}

  ?>

  </td>
	    

  <td><?php  echo formatMoney($c->amount, true); ?></td>
      <td><?php  echo formatMoney($c->paid, true); ?></td>

    <td><?php 
		$balance=$c->amount-$c->paid ;
		 $ttpaid= $ttpaid+$c->paid;
   $ttbalance=  $ttbalance+$balance;
		 echo formatMoney($balance, true);?></td>

   
	 


	   
	   

 <td id="non-printable"> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									
									
				
								
                                    <ul class="dropdown-menu dropdown-default pull-right" role="menu">
                                        
                                
                                      <li> 
											<?php 
								
	
											?>
	  	  	  	 <a  id="more" class="btn btn-default"  href="<?php echo base_url();?>user/viewmypurchases?randomitemidentifier=<?php   {echo  $supplier;}  ?>">

						 


                                                <i class="glyphicon glyphicon-pencil"></i>
																View Purchases  
                                                </a>
                                                        </li>
                                        
                                    </ul>
										
                                </div>
</td>
                  
             </tr>

	<?php endforeach;} ?>
<tfoot>
            <tr border="1" background="green">
			
									<td><b>Total amount</b></td>
 
									<td>
									<b>
<?php
 $finaltotal=$ttbalance;
 if(isset($totalamount)) {echo formatMoney($totalamount, true);   }?>

									</b></td>
									
							<td><b>
<?php if(isset($ttpaid)) {echo formatMoney($ttpaid, true);   }?>

								</b>	</td>
	<td><b>
<?php if(isset($ttbalance)) {echo formatMoney($ttbalance, true);   }?>

							</b>		</td>									
									
								<td id="non-printable"></td>		
								
</tr>
	
	</tfoot>
        </table>
		
		
		
		
		<b><CENTER> PENDING BILLS</CENTER></b>
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
         <tr>

				  
   <th>Supplier</th>
		   <th>Amount</th>
		      <th>	 Paid </th>
		   	   <th>Balance</th>
		   
		 
			

		<th>More</th>

                 </tr>
             </thead>
<?php

 if(!is_array($viewexpenses)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='11'>";
    
       echo '<div class="alert alert-default text-center">There is no pending bills  found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  $total=0;
  
      $TTBILLBALANCE=0;

  	foreach ($viewexpenses as $row): 

		 	 $nysupplierid= $row->supplier ;


             ?>



             <tr>
                
            <?php 




?>

 	  
<td>

	 <?php 

  $total=$total+$row->amount;	 
	 $allusers = $this->usermodel->populateallarray('people','id', $nysupplierid);



if($allusers[0]['company']==""){
	    echo "No name -".$allusers[0]['phone'];

}else{
   echo $allusers[0]['company']."-".$allusers[0]['phone'];
	
}

  ?>



</td>

           
	  <td><?php echo formatMoney($row->amount, true); ?></td>
	  
	  	   
  <td><?php 

  $BILLBALANCE=$row->amount-$row->paid;
    $TTBILLBALANCE=$TTBILLBALANCE+ $BILLBALANCE;
 echo formatMoney($row->paid, true);
  ?></td>
  
	  <td><?php 
	  echo formatMoney($BILLBALANCE, true);
	  ?></td>
	 


 
 

  
  <td id="non-printable"> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									
									
				
								
                                    <ul class="dropdown-menu dropdown-default pull-right" role="menu">
                                        
                                
								
                                      <li> 
											<?php 
								
	
											?>
	  	  	  	 <a  id="more" class="btn btn-default"  href="<?php echo base_url();?>user/mypaybill?randomitemidentifier=<?php   {echo  $nysupplierid;}  ?>">

						 


                                                <i class="glyphicon glyphicon-pencil"></i>
																View Bills  
                                                </a>
                                                        </li>
                                        
                                    </ul>
										
                                </div>
</td>

             </tr>

	<?php endforeach;} ?>
<tr>

<td colspan="3">
<b>
Bill Balance
</b>
</td>
<td colspan="2">
<b>
<?php 
if(isset($total)) {echo  formatMoney($total, true);
 $finaltotal=$ttbalance+$total;

}else{
	 $finaltotal=$ttbalance+0;

}

?>
</b>
</td>




</tr>
      <tr>

<td>
<b>
	Total Pending Balance
</b>
</td>
<td>
<b>
<?php 
if(isset($finaltotal)) {echo formatMoney($finaltotal, true); }

?>
</b>
</td>




</tr>
                

        </table>

		
		
		
		
		
		
		
		
		
		
	
	</div>

	
	<div id="addModal2" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add new sub product category</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');

				echo $this->session->flashdata('deletemsg'); 


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addproductcategory' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
				  		
	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter name">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>

  
  <div class="form-group">
    <label for="inputmaincategory" class="col-sm-2 control-label">Main Category?</label>
    <div class="col-sm-10">
	<select class="form-control" name="maincategory"  required>
		<option value=""  >---Select Sub-category---</option>


	
	
	<?php 
					 

					 


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $maincategoryrow->id;   ?>"><?=  $maincategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No main category available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('viewmaincategory'); ?>

	</div>
  </div>
  
  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Order / Priority No</label>
    <div class="col-sm-10">
		  		<input type="text" name="description" value="<?php echo set_value('description'); ?>" class="form-control"  placeholder="Enter Order / Priority No">

			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="category" name="btn_addproductcategory" class="btn btn-default"> Add Category   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>



	
	
				<div id="addsupplierModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add new  Campany/Customer</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addmember' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
<input type="hidden" name="status" value="1"id="status" class="form-control" required placeholder="Enter status">

<input type="hidden" name="view" value="user/viewpurchases"id="view" class="form-control" required placeholder="Enter status">


	
		  		<input type="hidden" name="category" readonly     value="<?php echo set_value('category','supplier'); ?>" class="form-control"  placeholder="Enter ocategory">
		 
				
				
						
						
					<div class="form-group">
    <label for="inputcompany" class="col-sm-2 control-label">	Company Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="company" required value="<?php echo set_value('company'); ?>" class="form-control"  placeholder="Enter company name if any">
		 
				
		<span class="text-danger"> <?php echo form_error('company'); ?>
		
		</span>
	</div>
  </div>	
						
						
						
						
						
						
						
	<div class="form-group">
    <label for="inputfirstname" class="col-sm-2 control-label"> Contact	Names<span style="color:red;">*</span></label>
    <div class="col-sm-10">
	
		  		<input type="text" name="firstname" value="<?php echo set_value('firstname'); ?>" class="form-control" required placeholder="Enter first and last name">
		 
				
		<span class="text-danger"> <?php echo form_error('firstname'); ?>
		
		</span>
	</div>
  </div>

  
  	<div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label">	Phone <span style="color:red;">*</span></label>
    <div class="col-sm-10">
	
		  		<input type="text" name="phone" value="<?php echo set_value('phone'); ?>" class="form-control" required placeholder="Enter phone e.g 254712345678">
		 
				
		<span class="text-danger"> e.g 254712345678 <?php echo form_error('phone'); ?>
		
		</span>
	</div>
  </div>
  
   	<div class="form-group">
    <label for="inputphoneaddress_1" class="col-sm-2 control-label">Phone 2	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="address_1" value="<?php echo set_value('address_1'); ?>" class="form-control"  placeholder="Enter other line e.g 254712345678">
		 
				
		<span class="text-danger">Other Number e.g 254712345678 <?php echo form_error('address_1'); ?>
		
		</span>
	</div>
  </div>
  
   	<div class="form-group">
    <label for="inputphonegender" class="col-sm-2 control-label">Contact	Gender	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="gender" >
	
	<option value=""  >---Select Gender---</option>
	<option value="female"  >female</option>
		<option value="male"  >male</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('gender'); ?>
		
		</span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputcountry" class="col-sm-2 control-label">Country?</label>
    <div class="col-sm-10">
	<select class="form-control" name="country" >
	


	
	<?php 
					 
			$mycountry = $this->nationmodel->populatenation();
	


if(is_array($mycountry)) {

   foreach($mycountry as $mycountryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $mycountryrow->id;   ?>"><?=  $mycountryrow->name; ?></option>



	<?php

}} else {
    echo 'No country available.';
}
	
?>
	<option value=""  >---Select country---</option>
</select>
		
						<span class="text-danger"><?php echo form_error('country'); ?>

	</div>
  </div>
  
  
  
  
    	<div class="form-group">
    <label for="inputemail" class="col-sm-2 control-label">	Email </label>
    <div class="col-sm-10">
	
		  		<input type="email" name="email" value="<?php echo set_value('email'); ?>" class="form-control"  placeholder="Enter Your email">
		 
				
		<span class="text-danger"> <?php echo form_error('email'); ?>
		
		</span>
	</div>
  </div>
  
  	
  	<div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">		ID Number	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="idno" value="<?php echo set_value('idno'); ?>" class="form-control"  placeholder="Enter idno if any or Campany Pin">
		 
				
		<span class="text-danger"> <?php echo form_error('idno'); ?>
		
		</span>
	</div>
  </div>
  
  
  
     
  
  
  
  
    
  	<div class="form-group">
    <label for="inputcity" class="col-sm-2 control-label">	City 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="city" value="<?php echo set_value('city'); ?>" class="form-control"  placeholder="Enter City or town">
		 
				
		<span class="text-danger"> <?php echo form_error('city'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  	<div class="form-group">
    <label for="inputzip" class="col-sm-2 control-label">	Zip Code 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="zip" value="<?php echo set_value('zip'); ?>" class="form-control"  placeholder="Enter Zip Code">
		 
				
		<span class="text-danger"> <?php echo form_error('zip'); ?>
		
		</span>
	</div>
  </div>
  
  
  
 
  
  	
 
  
    	<div class="form-group">
    <label for="inputwebsite" class="col-sm-2 control-label">		Website/Link 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="website" value="<?php echo set_value('website'); ?>" class="form-control"  placeholder="Enter website if any">
		 
				
		<span class="text-danger"> <?php echo form_error('website'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputentrydate" class="col-sm-2 control-label">	Entry date  	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="entrydate" value="<?php echo set_value('entrydate'); ?>" class="form-control"  placeholder="Enter Entry date">
		 
				
		<span class="text-danger"> <?php echo form_error('entrydate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
	<div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">

				<textarea name="comments" value="<?php echo set_value('comments'); ?>"  class="form-control"  placeholder="Enter comments"></textarea>
			
		<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</span>
	</div>
  </div>
		

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="member" name="btn_addmember" class="btn btn-default"> Add Campany   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>						
			
			
	
			<div id="purchaseModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Purchases Report</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');
					  $mydate=date("Y-m-d H:i:s");
					  $frommydate=date("Y-m-d 00:00:00");

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/viewagingpurchasereport' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>

	
	

	
	
		 <div class="form-group">
    <label for="inputreporttype" class="col-sm-2 control-label">Report type?</label>
    <div class="col-sm-10">
	<select class="form-control" name="reporttype" required>
	
	<option value=""  >---Select your option---</option>

		<option value="all" selected="selected" >-Normal Report-</option>
			<option value="Aging"  >--Aging report(Due Dates)</option>

</select>
		

	</div>
  </diV>
	
	
  <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">From Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="fromdate" value="<?php echo set_value('fromdate',$frommydate); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputtodate" class="col-sm-2 control-label">	To Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="todate" value="<?php echo set_value('todate',$mydate); ?>" class="form-control" required placeholder="Enter End date">
		 
				
		<span class="text-danger"> <?php echo form_error('todate'); ?>
		
		</span>
	</div>
  </div>
  
  
    <div class="form-group">
    <label for="inputsupplier" class="col-sm-2 control-label">supplier?</label>
    <div class="col-sm-10">
	<select class="form-control" name="supplier" required>
	
	<option value=""  >---Select supplier---</option>

		<option value="all" selected="selected"  >--I want view all/any supplier---</option>
	<?php 
					 
			$mysuppliers =  $this->usermodel->populatemysupplier($companyid);
	

	
if(is_array($mysuppliers)) {

   foreach($mysuppliers as $suppliersrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $suppliersrow->id;   ?>"><?=  $suppliersrow->company ."(". $suppliersrow->firstname ."- ".$suppliersrow->phone.")"; ?></option>



	<?php

}} else {
    echo 'No supplier available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('supplier'); ?>

	</div>
  </div>
  

  
	 <div class="form-group">
    <label for="inputdownload" class="col-sm-2 control-label">Download?</label>
    <div class="col-sm-10">
	<select class="form-control" name="download" required>
	
	<option value=""  >---Select your option---</option>

		<option value="no" selected="selected" >--I want to view the purchases---</option>
			<option value="yes"  >--I want to download the purchases---</option>

</select>
		

	</div>
  </diV>
	
	
	  
	 <div class="form-group">
    <label for="inputgroup" class="col-sm-2 control-label">Group?</label>
    <div class="col-sm-10">
	<select class="form-control" name="group" required id="group">
	
	<option value="" selected="selected" >---Select grouping type---</option>

		<option value="all"   >-All/Everything-</option>
			<option value="yes" >--Yes-Grouping</option>

</select>
		

	</div>
  </diV>
	
	 
	
	
	
	
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="event" name="btn_addevent" class="btn btn-default"> View Purchases  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>	
	
	
	
	
	
	
	
	
	
	
	
	<div id="deleteModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('logged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="purchaseorder">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewpurchases">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>		
	
	
	

						<div id="uploadModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Please Upload Correct Products data(CSV)</h4>
		
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/uploadpurchases' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
<input type="hidden" name="type" value="product"id="type" class="form-control" required placeholder="Enter type">
				<input type="hidden" name="view" value="user/viewpurchases"id="view" class="form-control" required placeholder="Enter view">
	
	
	<div class="form-group">
    <label for="inputsurname" class="col-sm-2 control-label">	CSV LIST</label>
    <div class="col-sm-10">
		
			<input type="file" name="file" width="400"  value="<?php echo set_value('file') ;?>" placeholder="Select EXCELL" class="form-control" required placeholder="Enter Surname"  >

		  		
				
		<span class="text-danger"> Upload correct format of CSV File  here..<?php echo form_error('file'); ?>
		
		</span>
	</div>
  </div>	
  
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="uploadpurchases" name="btn_uploadpurchases" class="btn btn-default">Upload new purchases  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>
	<div id="editProductModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update purchases</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');

			 $finalsalesid = $userid.time();


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addpurchases' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
	<input type="hidden" name="view" required value="user/viewpurchases" class="form-control"  placeholder="view">

	<input type="hidden" name="action" required value="update" class="form-control"  placeholder="insert">

	<input type="hidden" name="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">
			  		
		<input type="hidden" name="vattype" required value="VATABLE" class="form-control"  placeholder="vattype">

<div class="form-group">
    <label for="inputsupplier" class="col-sm-2 control-label">Supplier</label>
    <div class="col-sm-10">
		
	
		<select class="form-control"name="supplier" id="supplier" >
	
	<option value=""  >---Select Customer/supplier/vender---</option>

	


	<?php 
					 
			$mycustomer= $this->usermodel->populateviewcustomers('people','firstname','ASC','companyid', $companyid);
	     // $mycustomer=$this->usermodel->populatealldatawhere('products','bulk',$userid);


if(is_array($mycustomer)) {

   foreach($mycustomer as $mycustomerrow){

   //echo $courserow->coursename;
   ?>
					<option value="<?=  $mycustomerrow->id;   ?>"><?=  $mycustomerrow->company ."(". $mycustomerrow->firstname ." ".$mycustomerrow->lastname.")"; ?></option>




	<?php

}} else {
    echo 'No Customer available.';
}
	
?>
</select>		
		  		
				
		<span class="text-danger"> 	<?php echo form_error('supplier'); ?>
		
		</span>
	</div>
  </div>	
  
  	
  
	<div class="form-group">
    <label for="inputinvoice_number" class="col-sm-2 control-label">	Ref No :  </label>
    <div class="col-sm-10">
			  		<input type="text" readonly id="invoice_number" name="invoice_number" value="<?php echo set_value('invoice_number'); ?>" class="form-control"  placeholder="Enter  invoice number ">

		 
				
		<span class="text-danger"> <?php echo form_error('invoice_number'); ?>
		
		</span>
	</div>
  </div>
  
  
  		<div class="form-group">
    <label for="inputordernumber" class="col-sm-2 control-label">Invoice / Receipt No : </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="ordernumber"  name="ordernumber" value="<?php echo set_value('ordernumber'); ?>" class="form-control"  placeholder="Enter  order number if any ">
		 
				
		<span class="text-danger"> <?php echo form_error('ordernumber'); ?>
		
		</span>
	</div>
  </div>

  
  <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">Invoice Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="fromdate" name="fromdate" value="<?php echo set_value('fromdate',$mydate); ?>" class="form-control" required placeholder="Enter Entry date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
  	<div class="form-group">
    <label for="inputpin" class="col-sm-2 control-label">	Supplier Pin :  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="pin"  id="pin"  value="<?php echo set_value('pin'); ?>" class="form-control"  placeholder="Enter supplier PIN">
		 
				
		<span class="text-danger"> <?php echo form_error('pin'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  

  
  	<div class="form-group">
    <label for="inputpaiddate" class="col-sm-2 control-label">Payment Date</label>
    <div class="col-sm-10">
	
		  		<input type="text"  id="paiddate" name="paiddate" value="<?php echo set_value('paiddate',$mydate); ?>" class="form-control" required placeholder="Enter Payment Date">
		 
				
		<span class="text-danger"> <?php echo form_error('paiddate'); ?>
		
		</span>
	</div>
  </div>
  
    	<div class="form-group">
    <label for="inputamount" class="col-sm-2 control-label">Total Amount :  </label>
    <div class="col-sm-10">
	
		  		<input type="text"  name="amount" id="amount" value="<?php echo set_value('amount'); ?>" class="form-control"  placeholder="This is automatic">
		 
				
		<span class="text-danger"> <?php echo form_error('amount'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputpaid" class="col-sm-2 control-label">Paid Amount :  </label>
    <div class="col-sm-10">
	
		  		<input type="text"  name="paid" id="paid" value="<?php echo set_value('paid'); ?>" class="form-control"  placeholder="enter paid amount">
		 
				
		<span class="text-danger"> <?php echo form_error('paid'); ?>
		
		</span>
	</div>
  </div>
  
  
  

	

  
  
  
  
  
      	<div class="form-group">
    <label for="inputpin" class="col-sm-2 control-label">	VAT Rate  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="vatrate" id="vatrate"  value="16" class="form-control"  placeholder="Enter vat rate (%)">
		 
				
		<span class="text-danger"> <?php echo form_error('vatrate'); ?>
		
		</span>
	</div>
  </div>
 <div class="form-group">
    <label for="inputvat" class="col-sm-2 control-label">  VAT Amount :  </label>
    <div class="col-sm-10">
	
		  		<input type="text"  id="vat"  name="vat" value="<?php echo set_value('vat'); ?>" class="form-control" required placeholder="This is automatic upon saving">
		 
				
		<span class="text-danger"> <?php echo form_error('vat'); ?>
		
		</span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputtaxable" class="col-sm-2 control-label">Taxable  Amount :  </label>
    <div class="col-sm-10">
	
		  		<input type="text"  id="taxable" name="taxable" value="<?php echo set_value('taxable'); ?>" class="form-control" required placeholder="This is automatic upon saving">
		 
				
		<span class="text-danger"> <?php echo form_error('taxable'); ?>
		
		</span>
	</div>
  </div>
  
  
    
  
  <div class="form-group">
    <label for="inputshippingto" class="col-sm-2 control-label">Shipping to details..</label>
    <div class="col-sm-10">

	<textarea name="shippingto"  id="shippingto"  class="form-control" placeholder="Shipping to details if any."><?php echo set_value('shippingto'); ?></textarea> 
			
	</div>
  </div>
  
  
  
  
	<div class="form-group">
    <label for="inputremarks" class="col-sm-2 control-label">	Remarks/Note </label>
    <div class="col-sm-10">

				<textarea name="remarks"  id="remarks" value="<?php echo set_value('remarks'); ?>"  class="form-control"  placeholder="Enter remarks"></textarea>
			
		<span class="text-danger"> <?php echo form_error('remarks'); ?>
		
		</span>
	</div>
  </div>
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="purchase" name="btn_purchase" class="btn btn-default"> Update Purchase   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>
					
			
	
	
		
					<div id="payModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Pay this Supplier</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');

      $mydate=date("Y-m-d H:i:s");

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/updatesupplierpayment' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
	<input type="hidden" name="billid" value=""id="billid" class="form-control" required placeholder="Enter billid">
			  	<input type="hidden" name="invoice" value=""id="invoice1" class="form-control" required placeholder="Enter invoice">
					  	<input type="hidden" name="paymentmethodes" value="n/a"id="invoice1" class="form-control" required placeholder="Enter invoice">

	
	
	
	<div class="form-group">
    <label for="inputpaiddate" class="col-sm-2 control-label">Payment Date</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="paiddate" value="<?php echo set_value('paiddate',$mydate); ?>" class="form-control" required placeholder="Enter Banking Date">
		 
				
		<span class="text-danger"> <?php echo form_error('paiddate'); ?>
		
		</span>
	</div>
  </div>
	
 
  <div class="form-group">
    <label for="inputbankname" class="col-sm-2 control-label">Bank from?</label>
    <div class="col-sm-10">
	<select class="form-control" name="bankid" required>
	
	<option value=""  >---Select bank name---</option>
	
	<?php 
	$session_data = $this->session->userdata('logged_in');

  
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
		 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
					 
										$banking= $this->usermodel->populatealldatanoarray('glaccounts','companyid',$companyid,'accounttype','1');


	
if(is_array($banking)) {

   foreach($banking as $bankingrow){

   //echo $courserow->coursename;
    ?>
		<option value="<?=  $bankingrow->number;   ?>"><?=  $bankingrow->accountname ."(Acc No:". $bankingrow->number ."-Acc Name: ".$bankingrow->accountname.")  Balance ".$bankingrow->amount; ?></option>



	<?php

}} else {
    echo 'No bank available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('bankname'); ?>

	</div>
  </div>
  
	 
	
	
	
	
	
	
	
	
	<div class="form-group">
    <label for="inputpayment" class="col-sm-2 control-label">	Amount To pay </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="payment" value="<?php echo set_value('payment'); ?>" id="payment" class="form-control" required placeholder="Enter payment">
		 
				
		<span class="text-danger"> <?php echo form_error('payment'); ?>
		
		</span>
	</div>
  </div>
 
 
 
 
		

 
 
 
 
 
 
 
 
 
  	
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">

				<textarea name="description" value="<?php echo set_value('description'); ?>"  id="description" class="form-control"  placeholder="Enter payment details e.g paid to? "></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
			<div class="form-group">
    <label for="inputamount" class="col-sm-2 control-label">Original Amount </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="amount" value="<?php echo set_value('amount'); ?>" id="amount1" class="form-control" required placeholder="Enter amount">
		 
				
		<span class="text-danger"> <?php echo form_error('amount'); ?>
		
		</span>
	</div>
  </div>
	<div class="form-group">
    <label for="inputpaid" class="col-sm-2 control-label">Paid Amount </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="paid" value="<?php echo set_value('amount'); ?>" id="paid1" class="form-control" required placeholder="Enter paid">
		 
				
		<span class="text-danger"> <?php echo form_error('paid'); ?>
		
		</span>
	</div>
  </div>
	
<div class="form-group">
    <label for="inputbalance" class="col-sm-2 control-label">Balance Due </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="balance" value="<?php echo set_value('balance'); ?>" id="balance1" class="form-control" required placeholder="Enter balance">
		 
				
		<span class="text-danger"> <?php echo form_error('balance'); ?>
		
		</span>
	</div>
  </div>
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="purchase" name="btn_paypurchases" class="btn btn-default"> Make payment  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>
	
	<div id="addModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add new Purchases</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addpurchases' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
	<input type="hidden" name="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">
	<input type="hidden" name="view" value="user/viewreceivedproducts?randomitemidentifier" class="form-control" required placeholder="Enter mycategoryid">

  		  		<input type="hidden" name="vattype" required value="VATABLE" class="form-control"  placeholder="vattype">
  		  		<input type="hidden" name="action" required value="insert" class="form-control"  placeholder="insert">

<div class="form-group">
    <label for="inputsupplier" class="col-sm-2 control-label">Supplier</label>
    <div class="col-sm-10">
		
	
		<select class="form-control"name="supplier" id="supplier" >
	
	<option value=""  >---Select Customer/supplier/vender---</option>

	


	<?php 
					 
			//$mycustomer= $this->usermodel->populateviewcustomers('people','firstname','ASC','companyid', $companyid);
	     // $mycustomer=$this->usermodel->populatealldatawhere('products','bulk',$userid);
						$mycustomer  = $this->usermodel->populatealldatanoarray('people','category',"supplier",'companyid', $companyid);


if(is_array($mycustomer)) {

   foreach($mycustomer as $mycustomerrow){

   //echo $courserow->coursename;
   ?>
					<option value="<?=  $mycustomerrow->id;   ?>"><?=  $mycustomerrow->company ."(". $mycustomerrow->firstname ." ".$mycustomerrow->lastname.")"; ?></option>




	<?php

}} else {
    echo 'No Customer available.';
}
	
?>
</select>		
		  		
				
		<span class="text-danger"> 	<?php echo form_error('supplier'); ?>
		
		</span>
	</div>
  </div>	
  
  	
		 		  		<input readonly type="hidden" name="invoice_number" id="invoice_number" required value="<?php echo set_value('invoice_number',$finalsalesid); ?>" class="form-control"  placeholder="Enter invoice or Receip tnumber">

	

  
	<div class="form-group">
    <label for="inputinvoice_number" class="col-sm-2 control-label">	Invoice / Receipt No :  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="ordernumber" required value="<?php echo set_value('ordernumber'); ?>" class="form-control"  placeholder="Enter invoice or Receipt number">
		 
				
		<span class="text-danger"> <?php echo form_error('ordernumber'); ?>
		
		</span>
	</div>
  </div>
  
  		  		<input type="hidden"  name="paid" id="paid" value="0.00" class="form-control"  placeholder="enter paid amount">

  <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">Invoice Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="fromdate" value="<?php echo set_value('fromdate',$mydate); ?>" class="form-control" required placeholder="Enter Entry date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
  	<div class="form-group">
    <label for="inputpin" class="col-sm-2 control-label">	Supplier Pin :  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="pin" value="<?php echo set_value('pin'); ?>" class="form-control"  placeholder="Enter supplier PIN">
		 
				
		<span class="text-danger"> <?php echo form_error('pin'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  

  
  	<div class="form-group">
    <label for="inputpaiddate" class="col-sm-2 control-label">Payment Date</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="paiddate" value="<?php echo set_value('paiddate',$mydate); ?>" class="form-control" required placeholder="Enter Payment Date">
		 
				
		<span class="text-danger"> <?php echo form_error('paiddate'); ?>
		
		</span>
	</div>
  </div>
  
    	<div class="form-group">
    <label for="inputamount" class="col-sm-2 control-label">Total Amount :  </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="amount" value="0.00" class="form-control"  placeholder="This is automatic">
		 
				
		<span class="text-danger"> <?php echo form_error('amount'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  

	

  
  
  
  
  
      	<div class="form-group">
    <label for="inputpin" class="col-sm-2 control-label">	VAT Rate  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="vatrate" value="16" class="form-control"  placeholder="Enter vat rate (%)">
		 
				
		<span class="text-danger"> <?php echo form_error('vatrate'); ?>
		
		</span>
	</div>
  </div>
 <div class="form-group">
    <label for="inputvat" class="col-sm-2 control-label">  VAT Amount :  </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="vat" value="<?php echo set_value('vat'); ?>" class="form-control" required placeholder="This is automatic upon saving">
		 
				
		<span class="text-danger"> <?php echo form_error('vat'); ?>
		
		</span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputtaxable" class="col-sm-2 control-label">Taxable  Amount :  </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="taxable" value="<?php echo set_value('taxable'); ?>" class="form-control" required placeholder="This is automatic upon saving">
		 
				
		<span class="text-danger"> <?php echo form_error('taxable'); ?>
		
		</span>
	</div>
  </div>
  
  
  	

    
  
  <div class="form-group">
    <label for="inputshippingto" class="col-sm-2 control-label">Shipping to details..</label>
    <div class="col-sm-10">

	<textarea name="shippingto" class="form-control" placeholder="Shipping to details if any."><?php echo set_value('shippingto'); ?></textarea> 
			
	</div>
  </div>
  
  
  
  
	<div class="form-group">
    <label for="inputremarks" class="col-sm-2 control-label">	Remarks/Note </label>
    <div class="col-sm-10">

				<textarea name="remarks" value="<?php echo set_value('remarks'); ?>"  class="form-control"  placeholder="Enter remarks"></textarea>
			
		<span class="text-danger"> <?php echo form_error('remarks'); ?>
		
		</span>
	</div>
  </div>
		

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="purchase" name="btn_purchase" class="btn btn-default"> NEXT >>   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>			
									
									
									
									
							</div>
						</div>
				

			
			</div>
		</div>
  
  </div>
			
			
			
		
		
  

 
</div>


















