<?php
   $PageSecurity = 3;
$title = _('View/Search Items') ;
include('includes/SQL_CommonFunctions.inc');
$_SESSION['modid']=$_REQUEST['modid'];
$_SESSION['frmid']=$_REQUEST['frmid'];
$frmpermission= $px->GetFileAccess($_SESSION['modid'],$_SESSION['frmid'],$_SESSION['ACGRoleId']);
$_SESSION['frmAdd']=$frmpermission[0];
$_SESSION['frmEdit']=$frmpermission[1];
$_SESSION['frmDelete']=$frmpermission[2];
$_SESSION['frmView']=$frmpermission[3];
?>
<p><h2 align="center">Job Work MASTER</h2></p>
<form action="" method="post">
<table width="30%" border="0" cellspacing="1" cellpadding="2" align="center">
  <tr>
    <th style="width:60%"><strong>job Work NAME</strong></th>
    <td><select name="contractor">
    	<option value="000">Select</option>
    	<?php
    	$contractor_search="select * from job_work_master";
		$contractor_res=DB_query($contractor_search,$db);
		while($contractor_row=DB_fetch_array($contractor_res))
		{
			?>
			<option value=""><?php echo $contractor_row['jobwork_name'] ?></option>
			<?php
			
		}
    	?>
    </select>
		</td>
   </tr>
 </table>
<p align="center"><input type="submit" name="search" value="Search" /></p>
</form>
<p align="center"><a href="index.php?route=Inventory/maintenance/job_work_master&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>">ADD NEW Job Work Master</a></p>
<br>
<form action="" method="post">
 <div style="overflow:auto; height:200px;width:100%"> 
  <table width="100%" border="1" cellspacing="0" cellpadding="3">
  <tr>
      <th width="20%"><strong>Job Work NAME </strong></th>
      <th width="5%"><div align="center"><strong>EDIT</strong></div></th>
      <th width="5%"><div align="center"><strong>DELETE</strong></div></th>
    </tr>

<?php 
      $contractor_search="select * from job_work_master";
		
	$result=DB_query($contractor_search,$db);
	$i=1;
	if(DB_num_rows($result)>0)
	{
	while($myrow=DB_fetch_array($result))
	{
?> 
 <tr bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#fffeb3'; this.style.color='#00f';" onmouseout="this.style.backgroundColor='#FFF'; this.style.color='#000000';">
    <td width="20%"><?php echo $myrow['jobwork_name'];?></td>
   	<td width="5%"><a href="#"><img src="images/icon-edit.png" height="15" width="15"></a></td>
	<td width="5%"><a href="#" onClick="return confirm('Are you sure you want to delete this Item record?');"><img src="images/Icon_Delete.png" height="15" width="15"></a></td>
  </tr>
  <?php $i++;} 
  }
  else
  {?>
  <tr>
  <td colspan="4"><h3 align="center"><font color="#FF0000">No Record Found!</font></h3>
  </td>
  </tr>
  <?php 	
  }?>
</table>
  </div>
</form>
<?php 
include('includes/footer.inc');

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