<?php 
ob_start();
session_start();
include("inc/config.php");


    $client_id = $_POST['id'];


         $statement = $pdo->prepare("SELECT * FROM tbl_customer where client_id='$client_id' and cust_type='regular'");
							$statement->execute();
							$result = $statement->fetchAll(PDO::FETCH_ASSOC);
							$total = $statement->rowCount();
							   echo '<option value="">Select Customer</option>'; 
							   if($total!=0){
                             foreach ($result as $row) {
                             echo '<option value="'.$row['cust_id'].'">'.$row['cust_name'].'('.$row['cust_code'].')</option>'; 
                              } 
							   }
                              else
                              { 
                                echo '<option value="">Customer not available</option>'; 
                                  }
                                 
                                
                                 ?>