<?php
include("class_countrymaster.php");
 
/****************************DELETE THE DATA START HERE*******************************/ 
 
if($_REQUEST['action']=='Delete')
{
	$cond="parent_id='".$_REQUEST['id']."'";
	$s->DeleteRecord('mbook_preparation_child',$cond);
	$condition="id='".$_REQUEST['id']."'";
	$s->DeleteRecord('mbook_preparation',$condition);
}

/****************************DELETE THE DATA  END HERE*******************************/ 
?>
<link href="css/tender_project.css" rel="stylesheet" type="text/css" />
	<script src="js1/jquery-1.7.2.js"></script>
	<script src="js1/jquery.ui.widget.js"></script>
	<script src="js1/jquery.ui.tabs.js"></script>
<script>
	$(function() {
		$( "#tabs" ).tabs();
	});
	</script>
<div class="tender_main_page">
<h1>MBook Preparation </h1>
<!-- Body Content Start -->
<form action="" method="post">
<div id="body_content">
	<!-- TAble 1 Start --><div>
	<p align="center"><a href="index.php?route=PMS/Transcations/mbook_preparation&modid=<?php echo $_REQUEST['modid']; ?>&frmid=<?php echo $_REQUEST['frmid']; ?>" class="submit_button" style="text-decoration: none;"  >ADD NEW MBOOK </a></p>
	<table width="100%" border="1" cellspacing="0" cellpadding="3">
  <tr>
  	<th style="width:10px; white-space:nowrap">Sr No</th>
    <th>Project</th>
	<th>Block</th>
	<th>Contractor Name</th>
	<th>Work Order No</th>
    <th>MBook No</th>
	<th>Edit</th>
	<th>Delete</th>  
  </tr>
  <?php 
  $i=1;
  $sql=DB_query("select * from mbook_preparation",$db);
  $numrow=DB_num_rows($sql);
   if($numrow>0)
  {
  while($row=DB_fetch_array($sql))
  {
  ?>  
  <tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#fffeb3'; this.style.color='#00f';" onMouseOut="this.style.backgroundColor='#FFF'; this.style.color='#000000';" >
  	<td><?php echo $i; ?></td>
	<td><?php echo $s->GetFieldValue('locations',"loccode='".$row['project']."'",'locationname'); ?></td>
	<td><?php echo $s->GetFieldValue('sub_block_master',"id='".$row['block']."'",'block_name'); ?></td>
	<td><?php echo $s->GetFieldValue('sub_contractor_definition',"id='".$row['contractor_name']."'",'contractor_name'); ?></td>
    <td><?php echo $s->GetFieldValue('pms_sub_preparation',"id='".$row['work_order_no']."'",'work_order_no'); ?></td>
	<td><?php echo $row['mbook_no']; ?></td>
	<td><a href="index.php?route=PMS/Transcations/mbook_preparation&modid=<?php echo $_REQUEST['modid'];?>&amp;frmid=<?php echo $_REQUEST['frmid'];?>&action=Edit&id=<?php echo $row['id']; ?>" style="color:#000000; text-decoration: none;">Edit</a></td>
    <td><a href="index.php?route=PMS/Transcations/mbook_preparation_view&modid=<?php echo $_REQUEST['modid'];?>&amp;frmid=<?php echo $_REQUEST['frmid'];?>&action=Delete&id=<?php echo $row['id']; ?>" style="color:#000000; text-decoration: none;">Delete</a></td>
    </tr>
  <?php $i++; } } else {?>
  	<tt bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#fffeb3'; this.style.color='#00f';" onMouseOut="this.style.backgroundColor='#FFF'; this.style.color='#000000';">
  	<td colspan="3" align="center" bgcolor="#FFFFFF"><?php echo "No Records"; ?></td>	
  	</tt>
  	<?php } ?>
</table>
	</div><!-- TAble 1 Close -->
</div><!-- Body Content Close -->
<div style="height:30px;"></div>
<div class="button_nav">
</div>
</form>

