<?php 
if($_REQUEST['action']=='del')
{
	$condition2="id='".$_REQUEST['id']."'";
	$s->DeleteRecord('dbl_coplaint',  $condition2);
	$s->pageLocation("index.php?route=DealerDistrbutions/Transaction/complaint_form_index".$rurl);
}
?>

<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1>Complaint Form </h1>
<p align="left">
<a href="index.php?route=DealerDistrbutions/Transaction/complaint_form_add&frmid=<?php echo $_REQUEST['frmid']; ?>&modid=<?php echo $_REQUEST['modid']; ?>"><input type="button" value="Add New Complaint" class="search"></a>
</p>
<table width="100%" border="1" cellpadding="3" cellspacing="0">
<tr class="row1">
    <td class="tabledata">Sr No.</td>
	<td class="tabledata">Complaint  No.</td>
	<td class="tabledata">Complaint date</td>
	<td class="tabledata">Customer Name</td>
	<td class="tabledata">Complaint  Category</td>
	<td class="tabledata">Against Pick List</td>
	<td class="tabledata">Nature of Complaint</td>
	<td class="tabledata">Delete</td>
</tr>
<?php
$i=0;
$sqlGet=DB_query("SELECT * FROM dbl_coplaint where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
if(DB_num_rows($sqlGet)>0){
while($GetRec=DB_fetch_array($sqlGet)){ extract($GetRec);?>
<tr class="row1">
    <td><?php echo $i+1; ?></td>
	<td><?php echo $comlaint_no; ?></td>
	<td><?php echo ConvertSQLDate($comlaint_date); ?></td>
	<td><?php echo $s->GetFieldValue('clientmaster',"id='".$customer."'",'c_name'); ?></td>
	<td><?php echo $s->GetFieldValue('dbl_complaint_category',"id='".$complaint_category."'",'category_name'); ?></td>
	<td><?php echo $s->GetFieldValue('dbl_dealer_dispatch',"id='".$pick_list_no."'",'pick_list_no'); ?></td>
	<td><?php echo $s->GetFieldValue('dbl_nature_of_complaint',"id='".$nature_of_complaint."'",'nature_of_complaints'); ?></td>
	<td><a href="index.php?route=DealerDistrbutions/Transaction/complaint_form_index&action=del&id=<?php echo $id; ?>&frmid=<?php echo $_REQUEST['frmid']; ?>&modid=<?php echo $_REQUEST['modid']; ?>"><img src="images/Icon_Delete3.gif" width="10" height="10" /></a></td>
</tr>
<?php $i++;}}else{ ?>
<tr class="row1">
	<td colspan="8" class="tabledata1" style="color:#FF0000;">No Record Found</td>
</tr>
<?php } ?>
</table>
</div>
</div>
