<?php 
ob_start();
session_start();
require_once("../conn/conn.php");
//include('../utility/chksession.php');
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>Sanko Quality- Admin</title>

		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="../assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="../assets/font-awesome/4.5.0/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="../assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="../assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
		<link rel="stylesheet" href="../assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="../assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="../assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="assets/js/html5shiv.min.js"></script>
		<script src="assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body class="no-skin">
		
		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try{ace.settings.loadState('main-container')}catch(e){}
			</script>


			<div class="main-content">
				<div class="main-content-inner">
					
					<div class="page-content">
						<div class="ace-settings-container" id="ace-settings-container">
							

							<div class="ace-settings-box clearfix" id="ace-settings-box">
								<div class="pull-left width-50">
									<div class="ace-settings-item">
										
									
									</div>

								</div><!-- /.pull-left -->
							</div><!-- /.ace-settings-box -->
						</div><!-- /.ace-settings-container -->

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<div class="space-6"></div>

								<div class="row">
									<div class="col-sm-10 col-sm-offset-1">
										<div class="widget-box transparent">
											<div class="widget-header widget-header-large">
												<h3 class="widget-title grey lighter">
                                                แบบฟอร์ม Snift Test</h3>

												<div class="widget-toolbar no-border invoice-info">
													<span>หมายเลขเอกสาร :</span>
													<span>FM-QA-SS-xx</span>

													<br />
													<span>แก้ไขครั้งที่ : </span>
													<span>00/2017</span>

                                                    <br />
													<span>วันที่มีผลบังคับใช้ : </span>
													<span>17/07/2017</span>
												</div>

											
											</div>

											<div class="widget-body">
									
                                                <?php
										$rsub_id = $_REQUEST['rsub_id'];
									    //echo $rsub_id;

                                        $strSQLc = "SELECT * FROM qc_resultsnift
                                        where rsub_id='$rsub_id'";									
                                        $objQueryc = mysqli_query($con,$strSQLc); 
                                        $objResultc = mysqli_fetch_array($objQueryc);
                                        
                                        $Item_id=$objResultc['Item_id'];
                                        $Cli_code=$objResultc['Cli_code'];
                                        $per_id=$objResultc['per_id'];
                                        


                                        $strSQL1 = "SELECT * FROM qc_resultsnift,qc_resultsniftsub,qc_topic 
                                        where qc_resultsnift.Item_id=qc_resultsniftsub.Item_id
                                        and qc_resultsnift.Cli_code=qc_resultsniftsub.Cli_code
                                        and qc_resultsniftsub.Topic_id=qc_topic.Topic_id
                                        and qc_resultsniftsub.Item_id='$Item_id'
                                        and qc_resultsniftsub.cli_code='$Cli_code'
                                        and qc_resultsniftsub.per_id='$per_id'";									
                                        $objQuery1 = mysqli_query($con,$strSQL1); 
                                        $objResult1 = mysqli_fetch_array($objQuery1);


										$strSQL = "SELECT * FROM qc_resultsniftsub,qc_topic 
                                        where qc_resultsniftsub.Topic_id=qc_topic.Topic_id
                                         and qc_resultsniftsub.Item_id='$Item_id'
                                        and qc_resultsniftsub.cli_code='$Cli_code'
                                        and qc_resultsniftsub.per_id='$per_id'";								
                                        $objQuery = mysqli_query($con,$strSQL);  
									    ?></br>
									    </br>

										 
										   <table  width='100%'>
                                       <tr>
                                           <td><?php echo  "ผู้ประเมิน : ".$objResult1['per_id'];?></td>
                                           <td></td>
                                           <td align='right'><?php echo  "วันที่ประเมิน : ".$objResult1['result_daterecode'];?></td>
                                       </tr>
                                       <tr>
                                           <td><?php echo  " Item : ".$objResult1['Item_id'];?></td>
                                           <td></td>
                                           <td></td>
                                       </tr>
                                       </table>
                                       <p></p>
														<table class="table table-striped table-bordered" width='100%'>
															<thead>
																<tr>
																	<th class="center">lot number</th>
																	<th>หัวข้อการประเมิน </th>
																	<th class="hidden-xs">ผลการประเมิน</th>
																</tr>
															</thead>

															<tbody>
                                                            <?php
                                               
													        while($objResult = mysqli_fetch_array($objQuery)){
													        ?>
																<tr>
																	<td width="150" class="center"><?=$objResult['Cli_code'];  ?></td>
																	<td width="200"><?=$objResult['Topic_name']; ?></td>
                                                                    <td width="100" align='center'><?=$objResult['result']; ?></td>

																</tr>
                                                            <?php
                                                                }
                                                               // }
                                                            ?>
															</tbody>
														</table>
														<?php
														
												
													    echo "Comment  : ".$objResult1['result_note']; ?>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>

								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->


			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="../assets/js/jquery-2.1.4.min.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="../assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->

		<!-- ace scripts -->
		<script src="../assets/js/ace-elements.min.js"></script>
		<script src="../assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->
	</body>
</html>
