<?php
include 'connection.php'; 
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
	?>
<?php $querylogin = "select * from user where username = '". $_SESSION["LOGIN_NAME"]."' AND password = '".$_SESSION["EMPLOYEE_PASSWORD"]."'";
$resultlogin = mysql_query($querylogin,$conn);
while($row=mysql_fetch_array($resultlogin))
{
$Designation = $row['Designation'];
$staff_name = $row['full_name'];
$Deparment = $row['Deparment'];
$Head = $row['Head'];
$Division = $row['Division'];
$Customer_type = $row['Customer_type'];

}



if(isset($_POST['customer_id']))
{

$name=trim($_POST['customer_id']);
if(strlen(trim($name)) >= 3) {


$query31=mysql_query("SELECT * FROM customer_master WHERE customer_name LIKE '%$name%'");
 $num_rows = mysql_num_rows($query31);

}

 if($num_rows=='0')
{



?>
<table style="border-collapse:collapse; width:100%; border-radius:3px 3px 3px 3px">
  <tr>
    <td colspan="5" bgcolor="#fff">
	<div align="left" style="padding:2px;"><font color="#000000">(Record Not Found)</font></div>
	</td>
  </tr></table>
<? }else{

?>
  
  <? 
  while($query3=mysql_fetch_array($query31))
{

  ?>
  <table style="border-collapse:collapse; width:100%; border-radius:3px 3px 3px 3px" bgcolor="#fff">
  <tr>
    <td colspan="5" bgcolor="#fff">
	
	<? echo $customer_type;?>

	<div align="left" style="padding:2px;" onclick='fillsale("<?php echo $query3['customer_id']; ?>")'><font color="#000000"><strong><?php echo $query3['customer_name']; ?> </strong>&nbsp;&nbsp; ( Address : <?php echo $query3['billing_address']; ?> , Mobile No : <?php echo $query3['bphone']; ?> ) </font></div>
	</td>
  </tr><br />
 

 
</table><? }
} ?>
 
<?php


}
?>

