<link rel="stylesheet" href="css/new_mxerp.css">
<?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=daily_production_entrylist&daction=Updated".$rurl);
}
?>

<div class="body_contain">
<div class="tab_div">


<h1>Daily Production  List</h1>

<a href="index.php?route=daily_production_agnst_job_card&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=addNew">Add Daily Production Entry</a>
<br><br>
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse; border:#999999 solid 1px;">
<tr>
<td class="tabledata">Entry Slip No</td>
<td class="tabledata">Job Card No </td>
<td class="tabledata">Item</td>
<td class="tabledata">PP Slip Date</td>
<td class="tabledata">Job Card Date</td>
<td class="tabledata">View</td>
<td class="tabledata">Edit</td>
<td class="tabledata">Delete</td>
</tr>
<?php
$sql=DB_query("Select * from daily_production_process where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);	
$i=0;
$num=DB_num_rows($sql);
if($num>0)
{
while($myrow=DB_fetch_array($sql))
{
	if($myrow['job_card_type']==1)
		$jobcard=$s->getField('job_card','id',$myrow['job_card_id'],'job_card_no');
	else
		$jobcard=$s->getField('job_route_card','id',$myrow['job_card_id'],'job_card_no');	
?>
<tr bgcolor="#c1c1c1">
<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'] != '') ?  date('d/m/Y',strtotime($myrow['pp_slip_date'])):"" ;?></td>
<td><?php echo ($myrow['job_card_date'] !='')? date('d/m/Y',strtotime($myrow['job_card_date'])):""?></td>
<td><div align="center">

<a href="index.php?route=daily_production_agnst_job_card&modid=<?php echo $_REQUEST['modid'];?>
&frmid=<?php echo $_REQUEST['frmid'];?>&action=view
&ID=<?php echo $myrow['daily_id'];?>">View</a></div></td>

<td><div align="center">
<a href="index.php?route=daily_production_agnst_job_card&modid=<?php echo $_REQUEST['modid'];?>
&frmid=<?php echo $_REQUEST['frmid'];?>&action=edit
&ID=<?php echo $myrow['daily_id'];?>">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="#c1c1c1">
<td colspan="12">No Records Find</td>
</tr>
<?php }   ?>
	
</table>
</div></div>