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

<h2 align="center">Daily Production  List</h2>
<a href="index.php?route=daily_production_agnst_job_card&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>">Add Daily Production Entry</a>
<br><br>
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<th>Entry Slip No</th>
<th>Job Card No </th>
<th>Item</th>
<th>PP Slip Date</th>
<th>Job Card Date</th>
<th>View</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<?php
$sql=DB_query("Select * from daily_production_process",$db);	
$i=0;
$num=DB_num_rows($sql);
if($num>0)
{
while($myrow=DB_fetch_array($sql))
{
	$jobcard=$s->getField('job_route_card','id',$myrow['job_card_id'],'job_card_no');
?>
<tr bgcolor="#FFFFFF">
<td><?php echo $myrow['entry_slip_no'];?></td>
<td><?php echo $jobcard;?></td>
<td><?php echo $myrow['item'];?></td>
<td><?php echo $myrow['pp_slip_date'];?></td>
<td><?php echo $myrow['job_card_date'];?></td>
<td><div align="center"><a href="index.php?route=view_daily_production_entryjobcard&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=edit&Id=<?php echo $myrow['daily_id'];?>">View</a></div></td>
<td><div align="center"><a href="">Edit</a></div></td>
<td><div align="center"><a href="index.php?route=daily_production_entrylist&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=delete&Id=<?php echo $myrow['daily_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>
