<?php error_reporting(0);
include("../../include/db.php");
$show = 20;
$num_links = 19;
session_start();
$user_id = $_SESSION['login_user_id'];
$from = $_GET['from'];
$_GET['cus_name'];
$_GET['status_type'];
//  exit();
if (empty($from))
	 {
		$from = "0";
	 } 
else 
	{
	$html_query = $html_query. "&from=$from";
	}
$cus_name=mysql_escape_string($_GET['cus_name']);	
$status_type=mysql_escape_string($_GET['status_type']);	
// echo $cus_name;

if($cus_name=='')
{
	 echo $sql12="select * from  party_creation where delete_status!='1' and `party_type`='Customer' and status_type!='' and party_id!=''  order by party_name ASC "; 
}
else
{
    echo $sql12="select * from  party_creation where party_name='$cus_name' and status_type='$status_type' and delete_status!='1' and party_id!='' and `party_type`='Customer'  order by party_name ASC "; 
}

$html_query = "main_fram.php?file=party_creation";
$result=mysql_query($sql12);
$num_results=mysql_num_rows($result);

if ($num_results == 0) 
{
 $confirmation = "No Records!";
} 
elseif ($num_results == 1) 
{
$confirmation = "Found 1 Record.";
} 
else 
{
$confirmation = "Found $num_results Records.";
} 
?>
<style type="text/css">
.style1 {font-size: 16px}
</style>

<table align="right" > 
<tr>
<td width="7%" align="right"><a href="javascript:addd_party_print('master_entry/party_creation/party_creation_print.php?customer_name=<?php echo $_GET['cus_name'];?>');" style="text-decoration:none;"><img src="img/PrinterBlack.png" width="35" height="35" title="Print" value="Print"/></a></td></tr></table>
<br><br>
<div class="container" >
<div class="row-fluid">
<div class="span12">
<div class="table-responsive">
<div class="CSSTableGenerator"> 



<table border="0" width="98%"  align="center" cellpadding="0" cellspacing="0"  >
<thead>
    <tr>
    <th  align="center" width="74" style="border:1px solid #ddd">S.no</td>
    <th  align="left" style="border:1px solid #ddd">&nbsp;Party Name</th>
    <th  align="left" style="border:1px solid #ddd">Mobile No</th>
    <th  align="left" style="border:1px solid #ddd">Address</th>
    <th  width="102" style="border:1px solid #ddd">Edit</th>
    <th  width="109" style="border:1px solid #ddd">Delete</th>
    </tr>
  <?php
include("../../include/db.php");

$cus_name=mysql_escape_string($_GET['cus_name']);	

if($cus_name=='')
{
 	 $sql="select * from  party_creation where delete_status!='1' and party_id!='' and `party_type`='Customer'  and status_type!='' order by party_name ASC LIMIT $from,20"; 
}
else
{
     $sql="select * from  party_creation where party_name='$cus_name' and status_type='$status_type' and delete_status!='1' and party_id!='' and `party_type`='Customer'  order by party_name ASC LIMIT $from,20"; 
}
   $rs=mysql_query($sql);
	$sno=0;
   while($rsdata=mysql_fetch_array($rs))
  {
      $sno=$sno+1;
      $from=$from+1;
      $id=$rsdata['party_id'];
      $party_no=$rsdata['party_no'];
      $party_name=$rsdata['party_name'];
	  $mobile_no=$rsdata['mobile_no'];
	  $phone_no=$rsdata['phone_no'];
	  $email_id=$rsdata['email_id'];
	  $address=$rsdata['address'];
	  $city=$rsdata['city']; 
	  $create_date=$rsdata['create_date'];   
 ?>
 
  <tr style="border:1px solid #ddd">
    <td width="74"  align="center" style="border:thin  #ddd" ><?php echo $from; ?></td>
    <td width="351" align="left" style="border:1px solid #ddd">&nbsp;&nbsp;<?php echo ucfirst($party_name);?></td>
    <td width="244" align="left" style="border:1px solid #ddd"><?php echo $mobile_no;?></td>
    <td width="421" align="left" style="border:1px solid #ddd"><?php echo ucfirst($address);?></td>
    <?php if($user_id==1){ ?>
    <td align="center" style="border:1px solid #ddd" > <img src="img/edit.png" style="cursor:pointer"width="13" height="15" title="EDIT" onclick="javascript:addd_party_creation('master_entry/party_creation/party_creation.php?edit_id=<?php echo $id;?>')"/></td>
    <td align="center" style="border:1px solid #ddd"><a href="#" onClick="party_del_rows('<?php echo $id;?>','<?php echo $party_no;?>');"><img src="img/cross_deletes.png" alt="delete" title="DELETE" border="0" width="13px;" height="14px;" /></a>  </td>
    <?php } ?>
  </tr>
  <?php } ?>
  </thead>
</table>
</div>
<table border="0" width="99%"  align="center" cellpadding="0" cellspacing="0" >

 <tr>
    <th height="19" align="left" style="font-size:12px; font-family:sans-serif; padding-top:10px;" scope="col"><?php echo $confirmation;?></th>
	<th scope="cols" width="8%" align="right"><?php  
			  if ($num_results > $show) 
			  {
			  $show;
			  include("footer_links1.php");
			  }
	?></th>
 </tr>
</table>
</div>
</div>
</div>

