<?php
$PageSecurity = 2;
include('includes/session.inc');
include('includes/function_lib.php');
$sql=DB_query("Select * from qc_parameter_master where process_id=".$_REQUEST['id']." and CompanyId=".$_SESSION['ACGCompanyId'],$db);
$sql2=DB_query("SELECT * FROM `stockmaincategory` WHERE stockmaincategoryname LIKE '%measur%'",$db);
	while($row2=DB_fetch_array($sql2)){
		$arr[]=$row2['id'];
	}
	$string=implode(',',$arr);
?>
<table width="100%" border="1" cellpadding="3" cellspacing="0">
  <tr bgcolor="#CCCCCC" height="25" >
    <td width="6%" align="left"><strong>Sr. No.</strong></td>
	<td width="10%" align="left"><strong>Flow No.</strong></td>
    <td width="10%" align="left"><strong>Parameter</strong></td>
    <td width="20%" align="left"><strong>Specification</strong></td>
    <td width="15%" align="left"><strong>Measurment Instrument</strong></td>
    <td width="15%" align="left"><strong>Min</strong></td>
    <td align="left"><strong>Max</strong></td>
    <td align="left"><strong>Remarks</strong></td>
  </tr>
  <?php $j=0;
  while($row=DB_fetch_array($sql)){
  	extract($row);
  ?>
  <tr class="row1">
    <td><input name="qc_product_parameter_details[<?php echo $j;?>][check]" id="check_<?php echo $j;?>" type="checkbox" value="1" onclick="activate(<?php echo $j;?>)"/></td>
	<td><input type="text" name="qc_product_parameter_details[<?php echo $j;?>][flow_no]" value="" id="flow_no_<?php echo $j;?>" style="width:100%;" disabled="disabled" /></td>
    <td><input type="text" name="" value="<?php echo $parameter;?>" id="parameter_<?php echo $j;?>" style="width:100%;" readonly="true" disabled="disabled"/><input type="hidden" name="qc_product_parameter_details[<?php echo $j;?>][parameter_id]" value="<?php echo $id;?>" id="" style="width:100%;" /></td>
    <td><input type="text" name="qc_product_parameter_details[<?php echo $j;?>][parameter_specs]" value="" id="parameter_specs_<?php echo $j;?>" style="width:100%;" disabled="disabled"/></td>
	<td><select name="qc_product_parameter_details[<?php echo $j;?>][instrument_id]" disabled="disabled" id="instrument_id_<?php echo $j;?>">
		<?php 
		$sql3=DB_query("Select id, item_name from item_master where CategoryID in (".$string.")",$db);
		while($row3=DB_fetch_array($sql3)){
			extract($row3);
		?>
			<option value="<?php echo $id?>"><?php echo $item_name;?></option>
		<?php 
		}
		?>
		</select>
	</td>
    <td><input type="text" name="qc_product_parameter_details[<?php echo $j;?>][range_min]" value="" id="range_min_<?php echo $j;?>" style="width:100%;" disabled="disabled"/></td>
    <td><input type="text" name="qc_product_parameter_details[<?php echo $j;?>][range_max]" value="" id="range_max_<?php echo $j;?>" style="width:100%;" disabled="disabled"/></td>
    <td><input type="text" name="qc_product_parameter_details[<?php echo $j;?>][remarks]" value="" id="remarks_<?php echo $j;?>" style="width:100%;" disabled="disabled"/></td>
  </tr> 
  <?php $j++;} ?>
</table>