
<link rel="stylesheet" href="css/new_mxerp.css">
<style type="text/css">
.body_lightbox {
width:100%;
background-color:#e7e7e7;
position:absolute;
left:280px;
top:95px;
padding-left:5px;
padding-right:5px;
border:#666666 solid 3px;
}
</style>
<?php 
$PageSecurity = 2;
$title = _('Material Conversion');
      
if($_REQUEST['action']=='Delete' && $_REQUEST['id']!='')
{   
	  DB_query("delete from mat_conversion where id='".$_REQUEST['id']."' ",$db);
	  DB_query("delete from mat_conversion_details where parent_id='".$_REQUEST['id']."' ",$db);
     prnMsg( _('Record delete Successfully'),'success');
	echo "<script>location.href='index.php?route=Inventory/transation/material_conversion_index&modid=".$_REQUEST['modid']."&frmid=".$_REQUEST['frmid']."'</script>";
}




?>

 

<?php if($_REQUEST['action']==''){ ?>
<h2 align="center"><strong>Material Conversion</strong></h2>
<?php //if($_SESSION['frmAdd']!='1') {?>
<div align="center"><a href="index.php?route=Inventory/transation/material_conversion&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&NewIssue=yes"><input type="button" class="search" value="Add New" /></a></div>
<?php //} ?>
<br />


	
<table width="100%" border="1" cellspacing="0" cellpadding="3">
  <tr>
    <th><strong>MCT SlIP NO </strong></th>
    <th><strong>DATE </strong></th>
    <th><strong>Type </strong></th>
    <th><strong>ITEM FROM </strong></th>
    <th><strong>ITEM TO </strong></th>
	<th><strong>VIEW</strong></th>
	<!-- <th><strong>EDIT</strong></th>
	<th><strong>DELETE</strong></th> -->
  </tr>
  <?php
     
    $sql=DB_query("Select * from mat_conversion where  site in('".$_SESSION['AssignedBranch']."') and mat_con_date between '".$_SESSION['financialYrStart']."' and '".$_SESSION['financialYrEnd']."'  order by id desc",$db);
 
  $i=0;
  if(DB_num_rows($sql)>0)
  {
  while($myrow=DB_fetch_array($sql))
  {
  ?>
  <tr bgcolor="#FFFFFF">
    <td><?php echo $myrow['mat_con_slip_no'];?></td>
    <td><?php echo ConvertSQLDate($myrow['mat_con_date']);?></td>
    <td><?php if($myrow['conv_type']=='B') { echo "Breakage"; } else { echo "Non-Breakage"; } ?></td>
    <td><?php 
	echo $s->getField('item_master','id',$myrow['item_from'],'item_name');
	?></td>
	<td><?php 
  echo $s->getField('item_master','id',$myrow['item_to'],'item_name');
  ?></td>
	<td><?php if($_SESSION['frmView']=='1'){?>
	<a href="index.php?route=Inventory/transation/material_conversion_edit&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=view&id=<?php echo $myrow['id']; ?>"><img src='images/search.gif' height='15' width='15'></a><?php }else{echo "No Permission";}?></td>
	<!-- <td>
	<?php //if($_SESSION['frmEdit']=='1'){?>
	<a href="index.php?route=Inventory/transation/material_conversion_edit&modid=<?php //echo $_REQUEST['modid'];?>&frmid=<?php //echo $_REQUEST['frmid'];?>&action=Edit&id=<?php //echo $myrow['id']; ?>"><img src='images/icon-edit.png' height='15' width='15'></a><?php //}else{echo "No Permission";}?>
	</td>
	<td>
	<?php //if($_SESSION['frmDelete']=='1'){?>
	<a href="index.php?route=Inventory/transation/material_conversion_index&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?')"><img src='images/Icon_Delete4.gif' height='15' width='15'></a><?php //}else{echo "No Permission";}?>
	</td> -->
  </tr>
  <?php $i++;} }
  else
  {?>
  <tr>
  <td colspan="12"><h3 align="center"><strong>No Record Found</strong></h3></td>
  </tr>
  <?php 	
  }
  ?>
</table>

<?php } 
 ?>

<?php 
include('includes/footer.inc');
?>
	<?php if(isset($_SESSION['success_msg']))
{ ?>
	<script> alert("<?php echo ($_SESSION['success_msg']);?>");</script>
<?php 
}	unset($_SESSION['success_msg']);
?>