<!-------------------------INCLUDE ROOT FILES---------------------START HERE--------------------------->
<?php session_name('CAKEPHP'); session_start();
$PageSecurity = 4;
$PageName = 'Add Items';
include('includes/DefinePOClass.php');
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/DefineSuppTransClass.php');
include('includes/function_lib.php');
 //echo $_REQUEST['action'];
 
?>
<!-------------------------INCLUDE ROOT FILES---------------------START HERE--------------------------->
<link href="css/tender_project.css" rel="stylesheet" type="text/css" />
<script> 
 
function ExitWindow()
{
	opener.window.location="index.php?route=PMS/Transcations/boq_template_entry&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>";self.close();
}
</script>
<!--<link href="css/professional/default.css" rel="stylesheet" type="text/css" />-->
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
 <h1 align="center">Search BOQ </h1>
 <form action="" method="post" >
<table width="60%" align="center" border="0" cellpadding="3" cellspacing="0">
  <tr>
  <td class="labe1">Search By Category</td>
  <td><select name="groupId" id="group_title">
  	<option value="">Select Group</option>
            <?php 
		 $query ="SELECT * FROM sub_activity_group";
		$res = DB_query($query,$db);
		while($result = DB_fetch_array($res,$db))
		{
			//$p='';
			//if($result['id'] == $_REQUEST['group_title '])	
			//$p="selected";
		
		?>
            <option value="<?php echo $result['id']; ?>" ><?php echo $result['group_name']; ?></option>
        <?php } ?>
</select>  </td>
  </tr>
   <tr> <td colspan="2" ><input name="Search" type="submit" value="Search"  class="search"/></td>
  </tr>
</table>
 </form>
 
<form name="form1" action="" method="post">
<table width="100%" border="0">
	<tr><td><input style="margin:0px 0px 10px 0px;" type="submit" name="Select" id="Select" value="Add To List">
	<input style="margin:0px 0px 10px 0px;" type="submit" name="Reset" id="Reset" value="Reset"></td>
		<td><div align="right"><input style="margin:0px 0px 10px 0px;" type="button" name="Exit" id="Exit" value="Exit" onclick="ExitWindow()" ></div>
		</td>
	</tr></table>
	<div style="overflow: scroll; height: 300px" id="ItemListDiv">
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="font-family:Arial, Helvetica, sans-serif; font-size:12px;">
	 <tr>
	<td class="tabledata">Select</td>
  	<td class="tabledata">BOQ Group</td>
    <td class="tabledata">BOQ Activity</td>
	<td class="tabledata">BOQ Description</td>
	<td class="tabledata">BOQ Qty</td>
    <td class="tabledata">BOQ Rate.</td>
    <td class="tabledata">BOQ Amt.</td>
	<td class="tabledata">Start Date</td>
	<td class="tabledata">End Date</td>
	<td class="tabledata">Remarks</td>
	<td class="tabledata">Total Amount</td>
	</tr>
	 <tr>
		<?php 
			if(isset($_REQUEST['Search']))
			{
				echo $_REQUEST['groupId'];
				$query = "SELECT sub_activity_group.group_name,sub_activity_defination.activity_name,sub_activity_defination.work_description,sub_activity_defination.unit,sub_activity_defination.rate FROM sub_activity_group JOIN sub_activity_defination ON sub_activity_group.id=sub_activity_defination.group_name;
";
				$res = DB_query($query,$db) or die(DB_error());
				$i=1;
				while($result = DB_fetch_array($res,$db))
				{
				extract($result);
		?>
	
	 	<td><input type="checkbox" name="check[]"></td>
		<td><?php echo $group_name;?></td>
		<td><?php echo $activity_name;?></td>
		<td><?php echo $work_description;?></td>
		<td><?php echo $unit; ?></td>
		<td><?php echo $rate; ?></td>
		<td><?php echo $unit*$rate; ?></td>
		<td><input name="fromdate" value="<?php echo $_REQUEST['fromdate']; ?>" type="text" style="width:150px;"  class="datepicker"/></td>
		<td><input name="todate" value="<?php echo $_REQUEST['todate']; ?>" type="text" style="width:150px;"  class="datepicker"/></td>
		<td><textarea name="remarks" ,></textarea></td>
		<td></td>
	 </tr>
	 <?php } }?>
	 
<td>
<tr>	
<input type="hidden" name="row_sount" id="row_count" value="<?php echo $i;?>">
</tr>
</td>
</table></div>
 </form>

