<?php
$modid=$_REQUEST['modid'];
$frmid=$_REQUEST['frmid'];
$rurl="&modid=".$modid."&frmid=".$frmid;
if($_REQUEST['action']=='delete' and $_REQUEST['Id']!='')
{
$del=DB_query("delete from job_route_card where id='".$_REQUEST['Id']."'",$db);	
$s->pageLocation("index.php?route=job_route_cardlist&daction=Updated".$rurl);
}
?>

<h2 align="center">Job Route Card List</h2>
<a href="index.php?route=job_route_card_creation&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>">Add Job Route Card</a>
<br><br>
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<th>Job Card No</th>
<th>Customer Name </th>
<th>Sop No</th>
<th>Party Order No</th>
<th>Part Code</th>
<th>View</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<?php
$sql=DB_query("Select * from job_route_card",$db);	
$i=0;
$num=DB_num_rows($sql);
if($num>0)
{
while($myrow=DB_fetch_array($sql))
{
$sopname=$s->getField('salesorder','id',$myrow['sop_no'],'orderNo');	
?>
<tr bgcolor="#FFFFFF">
<td><?php echo $myrow['job_card_no'];?></td>
<td><?php echo $myrow['customer_name'];?></td>
<td><?php echo $sopname;?></td>
<td><?php echo $myrow['party_order_no'];?></td>
<td><?php echo $myrow['part_code'];?></td>
<td><div align="center"><a href="index.php?route=view_job_route_card&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=edit&Id=<?php echo $myrow['id'];?>">View</a></div></td>
<td><div align="center"><a href="index.php?route=edit_job_routecard&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=edit&Id=<?php echo $myrow['id'];?>">Edit</a></div></td>
<td><div align="center"><a href="index.php?route=job_route_cardlist&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=delete&Id=<?php echo $myrow['id'];?>" onclick="return confirm('Are you sure you want to delete?')">Delete</a></div></td>
</tr>
<?php $i++;}}
else { ?>
	<tr bgcolor="#FFFFFF">
<td colspan="12">No Records Find</td>
</tr>
<?php }   ?>
	
</table>
