<?php
include("class_countrymaster.php");
 
/****************************DELETE THE DATA START HERE*******************************/ 
 
if($_REQUEST['action']=='Delete')
{
	$condition="id='".$_REQUEST['id']."'";
	$s->DeleteRecord('psm_estimation_type',$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>Estimation Type </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/estimation_type&modid=<?php echo $_REQUEST['modid']; ?>&frmid=<?php echo $_REQUEST['frmid']; ?>" class="submit_button" style="text-decoration: none;"  >New Estimate Entry</a></p>
	<table width="100%" border="1" cellspacing="0" cellpadding="3">
  <tr>
  	<th style="width:10px; white-space:nowrap">Sr No</th>
    <th>Estimate Type </th>
	<th>PBSE Group</th>
	<th>PBSE Name</th>
	<th>Activity</th>
    <th>Quantity</th>
	<th>Edit</th>
	<th>Delete</th>  
  </tr>
  <?php 
  $i=1;
  $sql=DB_query("select * from psm_estimation_type",$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('mst_estimation',"id='".$row['estimation_name']."'",'estimation_name'); ?></td>
	<td><?php  echo $s->GetFieldValue('psm_psb_project',"id='".$row['pbse_code']."'",'pbse_description'); ?></td>
	<td><?php  
	$x=explode(',',$row['group_id']);
	for($j=0;$j<count($x);$j++)
	{
	echo $s->GetFieldValue('psm_psb_project',"id='".$x[$j]."'",'pbse_description').'<br>'; 
	}
	
	?></td>
    <td><?php  echo $s->GetFieldValue('locations',"loccode='".$row['project']."'",'locationname'); ?></td>
	<td><?php echo $row['qty']; ?></td>
	<td><a href="index.php?route=PMS/Transcations/estimation_type&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/estimation_type_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>

