<?php 
session_start();
include('../includes/dbcon.php');

$str=" ";

$data = array();

$edate=date("Y-m-d");
$userid=$_SESSION['rm_id'];
//$loc_id=$_SESSION['loc_id_bill'];



if (isset($_POST['cus_id'])) {
    $cus_id = $_POST['cus_id'];



if (empty($cus_id)){   $item=0;   $error=1;       }   


if ( $error<>1){

///////////////opening inv header //////////////////////

	$sqlinv=mysqli_query($con,"SELECT  * from inv_header where cus_id=$cus_id  ")or die(mysqli_error($con));
	        	$countinv=mysqli_num_rows($sqlinv);	
	        	if ($countinv>0) {
	        		 $options = '<option value="0">~~~Select ~~~~</option>';
	        		while($row=mysqli_fetch_array($sqlinv)){			
					//$loc_id =$row['loc_id'];
	        			  $options .= '<option value="' . $row['inv_id'] . '">' . $row['inv_id'] . '</option>';
							
				   }
				    echo $options;
				}
				else {  echo '<option value="0">~~~Select ~~~~</option>'; }
///////  end of inv header


} /// if ( $error<>1){


} /////if (isset($_POST['cus_id'])) {
				else {  echo '<option value="0">~~~Select ~~~~</option>'; }
	

?>