
<?php 
date_default_timezone_set("Asia/Bangkok");
require_once("../conn/conn.php");




$strSQL1 = "SELECT * FROM qc_item,qc_checklistitem where qc_item.Item_id=qc_checklistitem.Item_id";
$objQuery1 = mysqli_query($con,$strSQL1); 
$objResult1 = mysqli_fetch_array($objQuery1);
echo $objResult1['Item_id']."  ".$objResult1['Item_name'];



$strSQL = "SELECT * FROM qc_topic";
$objQuery = mysqli_query($con,$strSQL); 
$Num_Rows = mysqli_num_rows($objQuery);
$i=1;
         
?>
<form name="frmMain" method="post" action="testsave.php" ">
<table width="500"  border="0" >
  <tr>
    <th>หัวข้อที่ตรวจ</th>
    <th>In</th>
    <th>Just IN</th>
    <th>OUT</th>
  </tr>
  <?php 
  while($objResult = mysqli_fetch_array($objQuery))
        { 
            $Topic_id = $objResult['Topic_id'];
    ?>
  <tr>
    <td><?=$objResult['Topic_name']; ?> <input type="hidden" id="Topic_id<?=$i;?>" name="Topic_id<?=$i;?>" value="<?=$objResult['Topic_id']; ?>"></td>
    <td width="70" align="center"><input name="radionNo<?=$i;?>" id="radionNo<?=$i;?>_<?=$Topic_id;?>" type="radio" value="IN"></td>
    <td width="63" align="center"><input name="radionNo<?=$i;?>" id="radionNo<?=$i;?>_<?=$Topic_id;?>" type="radio" value="Just IN"></td>
    <td width="71" align="center"><input name="radionNo<?=$i;?>" id="radionNo<?=$i;?>_<?=$Topic_id;?>" type="radio" value="OUT"></td>
  </tr>
  <?php
  	$i++;
}
      
      
  ?>
</table>
<input type="hidden" id="Item_id" name="Item_id" value="<?=$objResult1['Item_id']; ?>">
<input type="hidden" id="cli_code" name="cli_code" value="<?=$objResult1['Cli_code'];?>">
<input type="hidden" name="hdnRows" value="<?=$i-1;?>">
<br/><input type="submit" name="Submit" value="ตอบแบบสอบถาม">

</form>
        
	