<?php
    if($_REQUEST['act']=='delete' && $_REQUEST[Id]!='')
    {
        DB_query("delete from material_request_slip_details where mrs_id='".$_REQUEST['Id']."'",$db);
        DB_query("delete from material_request_slip where id='".$_REQUEST['Id']."'",$db);
    }
?>
<div style="display:none" id="div_id"></div>
<link rel="stylesheet" href="css/new_mxerp1.css">
<div class="body_contain">
<div class="tab_div">  
<p align="left"><a href="index.php?route=ToolPlants/fixed_assets/material_request_slip&modid=<?php echo $_REQUEST['modid']; ?>&frmid=<?php echo $_REQUEST['frmid']; ?>">
  <input type="button" name="Add Title" value="Add MRS" class="search"></a></p>	
<form action="" method="post">
<table width="100%" border="1" cellspacing="3" cellpadding="3" align="center" style="border:#808080 1px solid;">
  <tr bgcolor="#CCCCCC" height="25">  
    <td><strong>S. No.</strong></td> 		
    <td><strong>Branch</strong></td>
    <td><strong>MRS No.</strong></td>
    <td><strong>MRS Date</strong></td>
    <td><strong>Type</strong></td>
    <td><strong>Jobcard No.</strong></td>
    <td><strong>Jobcard Date</strong></td> 
    <td><strong>Prepared By</strong></td>
    <td><strong>Remark</strong></td> 
    <td colspan="3" ><strong>Action</strong></td>    
</tr>
<?php 
$i=1;
$sql=DB_query("select * from material_request_slip where companyId='".$_SESSION['ACGCompanyId']."'",$db);
while($row=DB_fetch_array($sql))
{  
?>
<tr bgcolor="#FFFFFF">  
    <td ><?php echo $i; ?></td>     
    <td ><?php echo $s->getField('locations','loccode',$row['branch'],'locationname'); ?></td>
    <td ><?php echo $row['mrs_no']; ?></td>
    <td ><?php echo ConvertSQLDate($row['mrs_date']); ?></td>
    <td ><?php echo ($row['mrs_type']=='J')?'Job Card':'Direct'; ?></td>
    <td ><?php echo $s->getField('tpl_breakdown_mgmt','id',$row['jobcard_id'],'tt_no'); ?></td>
    <td ><?php echo ConvertSQLDate($row['jobcard_date']); ?></td>
    <td ><?php echo $s->getField('www_users','id',$row['created_by'],'realname'); ?></td>  
    <td ><?php echo $row['remark']; ?></td> 
    <td><a href="index.php?route=ToolPlants/fixed_assets/material_request_slip_edit&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&mrs_id=<?php echo $row['id'];?>"><img src="images/icon-edit.png" height="15" width="15"></a></td>
<td><a href="index.php?route=ToolPlants/material_request_slip_index&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=delete&Id=<?php echo $row['id'];?>" onclick="return confirm('Are you sure you want to delete?')"><img src="images/Icon_Delete.png" height="15" width="15"></a></td>
<td><a target="_blank" href="mrs_print.php?rid=<?php echo $row['id'];?>"><img width="18" height="18" src="images/icon_print.jpg"></a></td>
</tr>
<?php $i++;} ?>
</table>
</form>
</div></div>

<style type="text/css" >
.button{ background-color:#666666;
color: #FFFFFF;
height:25px;
margin:0px 5px 0px 5px;
border:1px solid #359CA2;
}
.link{ color:#9900CC; font-family:"Comic Sans MS"; letter-spacing:1px
}
</style>

