<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css" />


<!--jscript-->
<script language="JavaScript" src="../jscript/numbers_only.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/numbers_only_decimal.js"  type="text/javascript"></script>  
<script language="javascript" src="../jscript/no_spaces.js"></script>
<script language="javascript" src="../jscript/calendar.js"></script>
<script language="JavaScript" src="../jscript/alert_message.js"  type="text/javascript"></script> 
<script language="JavaScript" src="../jscript/confirm_exit.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script> 

<?php
$_SESSION['current_page'] = "quality";
include ("../navigation/header.php");
$page_name = "Quality-wet inspection";

date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 

include ("../navigation/access.php");
if ($permission_num==1) {
include ("../navigation/quality_sidebar.php");

$report_no = $_GET['report_no'];
$approve = $_GET['approve'];
if ($report_no=='') {
	$table_name = $_SESSION['db_prefix']."_wet_tile_spec";
	$no_query = "SELECT wet_report_no FROM $table_name ORDER BY wet_report_no DESC  LIMIT 1";
	$no_result = mySQL_query($no_query);
	$report_no = mysql_result($no_result, 0, "wet_report_no") + 1;
		

$production_text = $_GET['production_text'];
$production_no_text = '';
$mix_design_name_text = '';
$pieces = explode("|", $production_text);
$result = count($pieces);
$i = 0;
while ($i<$result-1) {
$production_no_text = $production_no_text.$pieces[$i].'; '; 

$table_name = $_SESSION['db_prefix']."_production_plan";
$product_query = "SELECT mix_design_name, production_date, item_type FROM $table_name WHERE production_no = '".$pieces[$i]."' ";
$product_result = mySQL_query($product_query);
$mix_design_name = mysql_result($product_result, 0, "mix_design_name");
$production_date = mysql_result($product_result, 0, "production_date");
$item_type = mysql_result($product_result, 0, "item_type");

$mix_design_name_text = $mix_design_name_text.$mix_design_name.'; ';

if (strpos($mix_design_name, 'Double Roman') !== false) { $type = 'DR'; }
if (strpos($mix_design_name, 'Venetian') !== false) { $type = 'VE'; }
if (strpos($mix_design_name, 'Slate') !== false) { $type = 'SL'; }


$table_name = $_SESSION['db_prefix']."_production_plan";
$report_query = "UPDATE $table_name SET wet_report_no = '".$report_no."' WHERE production_no = '".$pieces[$i]."' ";
execsql($report_query);

$i++;
}
//$item_type = $_GET['item_type'];

$table_name = $_SESSION['db_prefix']."_wet_tile_spec";
$insert_query = "INSERT INTO $table_name (wet_report_no, production_no, production_date, mix_design_name, item_type ) VALUES ( '".$report_no."', '".$production_no_text."', '".$production_date."', '".$mix_design_name_text."', '".$item_type."' ) ";
execsql($insert_query);

$table_name = $_SESSION['db_prefix']."_production_plan";
$report_query = "UPDATE $table_name SET wet_report_no = '".$report_no."' WHERE production_no = '".$pieces[$i]."' ";
execsql($report_query);

?>
<script language="javascript" type="text/javascript">
			needToConfirm = false;
          //	window.location="wet_tile_inspection_sheet.php?report_no=<?php echo $report_no ?>&approve=0";
</script>

<?php
}

if ($approve==1) {
$user_name = $_GET['user_select'];	
$password = $_GET['password'];

$table_name = $_SESSION['db_prefix']."_users";
$verify_query = "SELECT  username, password, access_id FROM $table_name WHERE username = '".$user_name."' AND password = '".$password."' ";
$verify_result = mySQL_query($verify_query);
$verify_num = mysql_num_rows($verify_result);

if ($verify_num!=0) {
$access_id = mysql_result($verify_result, 0, "access_id");
$table_name = $_SESSION['db_prefix']."_permissions";
$permission_query = "SELECT access_id  FROM  $table_name  WHERE access_id ='".$access_id."' AND page_name = 'Quality-approve' ";
$permission_result = mySQL_query($permission_query);
$permission_num = mysql_num_rows($permission_result);
if ($permission_num>0) { 
		$approve_date = $_GET['approve_date'];
		$approved_by = $_GET['user_select'];
		$table_name = $_SESSION['db_prefix']."_wet_tile_spec";
		$approve_query = "UPDATE $table_name SET approved = '1', approve_date = '".$approve_date."', approved_by = '".$approved_by."' WHERE wet_report_no = '".$report_no."' ";
		execsql($approve_query);
		
		$table_name = $_SESSION['db_prefix']."_production_plan";
		$plan_query = "UPDATE $table_name SET wet_approved = '1' WHERE wet_report_no = '".$report_no."' ";
		execsql($plan_query);
		
		$table_name = $_SESSION['db_prefix']."_tracking_quality";
		$trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entry_date."' ,'".$_SESSION['username']."', '92', '', '".$report_no."' ,'".$approved_by."','".$approve_date."' )";
		$trackingResult = mySQL_query($trackingQuery);	
		?>
        <script language="javascript" type="text/javascript">
			needToConfirm = false;
        	window.location="wet_tile_report.php?report_no=<?php echo $report_no ?>";
		</script>
        <?php
}
else {
	$approve_message='This user is not allowed to approve inspection reports.'; 
}

}
else {
	$approve_message='User name and/or password were not correct, inspection report is not approved.';
}

}

if ($approve=='5') {
	    $approve_message_2='Request for approval of this report is send.';
}

$table_name = $_SESSION['db_prefix']."_list_quality_names";
    $position_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
	$arrId1 = array ();
	$arrName1 = array ();
	$position_result = execsql($position_query);
	if ($position_result!="") {
	$position_num = mysql_num_rows($position_result);
	$b = 0;
	while ($b < $position_num) {
		$arrId1[$b] = mysql_result($position_result, $b, "item_name");
		$arrName1[$b] = mysql_result($position_result, $b, "item_name");
		$b++;
	}
	}	
	
$table_name = $_SESSION['db_prefix']."_list_approve_names";
    $position_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
	$arrId2 = array ();
	$arrName2 = array ();
	$position_result = execsql($position_query);
	if ($position_result!="") {
	$position_num = mysql_num_rows($position_result);
	$b = 0;
	while ($b < $position_num) {
		$arrId2[$b] = mysql_result($position_result, $b, "item_name");
		$arrName2[$b] = mysql_result($position_result, $b, "item_name");
		$b++;
	}
	}	

$table_name = $_SESSION['db_prefix']."_wet_tile_spec";
$report_query = "SELECT * FROM $table_name WHERE wet_report_no = '".$report_no."'  ";
$report_result = mySQL_query($report_query);
$production_date = mysql_result($report_result, 0, "production_date");
$production_no_text = mysql_result($report_result, 0, "production_no");
$mix_design_name = mysql_result($report_result, 0, "mix_design_name");
$item_type = mysql_result($report_result, 0, "item_type");
$tested_by = mysql_result($report_result, 0, "tested_by");
$test_date = mysql_result($report_result, 0, "test_date");
$approved = mysql_result($report_result, 0, "approved");
$approved_by = mysql_result($report_result, 0, "approved_by");
$approve_date = mysql_result($report_result, 0, "approve_date");
$surface_finish_1 = mysql_result($report_result, 0, "surface_finish_1");
$surface_finish_2 = mysql_result($report_result, 0, "surface_finish_2");
$surface_finish_3 = mysql_result($report_result, 0, "surface_finish_3");
$surface_finish_4 = mysql_result($report_result, 0, "surface_finish_4");
$surface_finish_5 = mysql_result($report_result, 0, "surface_finish_5");
$surface_finish_6 = mysql_result($report_result, 0, "surface_finish_6");
$length_1 = mysql_result($report_result, 0, "length_1");
$length_2 = mysql_result($report_result, 0, "length_2");
$length_3 = mysql_result($report_result, 0, "length_3");
$length_4 = mysql_result($report_result, 0, "length_4");
$length_5 = mysql_result($report_result, 0, "length_5");
$length_6 = mysql_result($report_result, 0, "length_6");
$width_1 = mysql_result($report_result, 0, "width_1");
$width_2 = mysql_result($report_result, 0, "width_2");
$width_3 = mysql_result($report_result, 0, "width_3");
$width_4 = mysql_result($report_result, 0, "width_4");
$width_5 = mysql_result($report_result, 0, "width_5");
$width_6 = mysql_result($report_result, 0, "width_6");
$th_body_1 = mysql_result($report_result, 0, "th_body_1");
$th_body_2 = mysql_result($report_result, 0, "th_body_2");
$th_body_3 = mysql_result($report_result, 0, "th_body_3");
$th_body_4 = mysql_result($report_result, 0, "th_body_4");
$th_body_5 = mysql_result($report_result, 0, "th_body_5");
$th_body_6 = mysql_result($report_result, 0, "th_body_6");
$th_lock_1 = mysql_result($report_result, 0, "th_lock_1");
$th_lock_2 = mysql_result($report_result, 0, "th_lock_2");
$th_lock_3 = mysql_result($report_result, 0, "th_lock_3");
$th_lock_4 = mysql_result($report_result, 0, "th_lock_4");
$th_lock_5 = mysql_result($report_result, 0, "th_lock_5");
$th_lock_6 = mysql_result($report_result, 0, "th_lock_6");
$side_lap_1 = mysql_result($report_result, 0, "side_lap_1");
$side_lap_2 = mysql_result($report_result, 0, "side_lap_2");
$side_lap_3 = mysql_result($report_result, 0, "side_lap_3");
$side_lap_4 = mysql_result($report_result, 0, "side_lap_4");
$side_lap_5 = mysql_result($report_result, 0, "side_lap_5");
$side_lap_6 = mysql_result($report_result, 0, "side_lap_6");
$batten_l_1 = mysql_result($report_result, 0, "batten_l_1");
$batten_l_2 = mysql_result($report_result, 0, "batten_l_2");
$batten_l_3 = mysql_result($report_result, 0, "batten_l_3");
$batten_l_4 = mysql_result($report_result, 0, "batten_l_4");
$batten_l_5 = mysql_result($report_result, 0, "batten_l_5");
$batten_l_6 = mysql_result($report_result, 0, "batten_l_6");
$batten_t_1 = mysql_result($report_result, 0, "batten_t_1");
$batten_t_2 = mysql_result($report_result, 0, "batten_t_2");
$batten_t_3 = mysql_result($report_result, 0, "batten_t_3");
$batten_t_4 = mysql_result($report_result, 0, "batten_t_4");
$batten_t_5 = mysql_result($report_result, 0, "batten_t_5");
$batten_t_6 = mysql_result($report_result, 0, "batten_t_6");
$batten_d_1 = mysql_result($report_result, 0, "batten_d_1");
$batten_d_2 = mysql_result($report_result, 0, "batten_d_2");
$batten_d_3 = mysql_result($report_result, 0, "batten_d_3");
$batten_d_4 = mysql_result($report_result, 0, "batten_d_4");
$batten_d_5 = mysql_result($report_result, 0, "batten_d_5");
$batten_d_6 = mysql_result($report_result, 0, "batten_d_6");
$b_nibs_1 = mysql_result($report_result, 0, "b_nibs_1");
$b_nibs_2 = mysql_result($report_result, 0, "b_nibs_2");
$b_nibs_3 = mysql_result($report_result, 0, "b_nibs_3");
$b_nibs_4 = mysql_result($report_result, 0, "b_nibs_4");
$b_nibs_5 = mysql_result($report_result, 0, "b_nibs_5");
$b_nibs_6 = mysql_result($report_result, 0, "b_nibs_6");
$nail_hole_1 = mysql_result($report_result, 0, "nail_hole_1");
$nail_hole_2 = mysql_result($report_result, 0, "nail_hole_2");
$nail_hole_3 = mysql_result($report_result, 0, "nail_hole_3");
$nail_hole_4 = mysql_result($report_result, 0, "nail_hole_4");
$nail_hole_5 = mysql_result($report_result, 0, "nail_hole_5");
$nail_hole_6 = mysql_result($report_result, 0, "nail_hole_6");
$mass_1 = mysql_result($report_result, 0, "mass_1");
$mass_2 = mysql_result($report_result, 0, "mass_2");
$mass_3 = mysql_result($report_result, 0, "mass_3");
$mass_4 = mysql_result($report_result, 0, "mass_4");
$mass_5 = mysql_result($report_result, 0, "mass_5");
$mass_6 = mysql_result($report_result, 0, "mass_6");
$knife_cut_1 = mysql_result($report_result, 0, "knife_cut_1");
$knife_cut_2 = mysql_result($report_result, 0, "knife_cut_2");
$knife_cut_3 = mysql_result($report_result, 0, "knife_cut_3");
$knife_cut_4 = mysql_result($report_result, 0, "knife_cut_4");
$knife_cut_5 = mysql_result($report_result, 0, "knife_cut_5");
$knife_cut_6 = mysql_result($report_result, 0, "knife_cut_6");
$colour_1 = mysql_result($report_result, 0, "colour_1");
$colour_2 = mysql_result($report_result, 0, "colour_2");
$colour_3 = mysql_result($report_result, 0, "colour_3");
$colour_4 = mysql_result($report_result, 0, "colour_4");
$colour_5 = mysql_result($report_result, 0, "colour_5");
$colour_6 = mysql_result($report_result, 0, "colour_6");
$cracks_1 = mysql_result($report_result, 0, "cracks_1");
$cracks_2 = mysql_result($report_result, 0, "cracks_2");
$cracks_3 = mysql_result($report_result, 0, "cracks_3");
$cracks_4 = mysql_result($report_result, 0, "cracks_4");
$cracks_5 = mysql_result($report_result, 0, "cracks_5");
$cracks_6 = mysql_result($report_result, 0, "cracks_6");
$compaction_1 = mysql_result($report_result, 0, "compaction_1");
$compaction_2 = mysql_result($report_result, 0, "compaction_2");
$compaction_3 = mysql_result($report_result, 0, "compaction_3");
$compaction_4 = mysql_result($report_result, 0, "compaction_4");
$compaction_5 = mysql_result($report_result, 0, "compaction_5");
$compaction_6 = mysql_result($report_result, 0, "compaction_6");
$lock_feather_1 = mysql_result($report_result, 0, "lock_feather_1");
$lock_feather_2 = mysql_result($report_result, 0, "lock_feather_2");
$lock_feather_3 = mysql_result($report_result, 0, "lock_feather_3");
$lock_feather_4 = mysql_result($report_result, 0, "lock_feather_4");
$lock_feather_5 = mysql_result($report_result, 0, "lock_feather_5");
$lock_feather_6 = mysql_result($report_result, 0, "lock_feather_6");
$granule_1 = mysql_result($report_result, 0, "granule_1");
$granule_2 = mysql_result($report_result, 0, "granule_2");
$granule_3 = mysql_result($report_result, 0, "granule_3");
$granule_4 = mysql_result($report_result, 0, "granule_4");
$granule_5 = mysql_result($report_result, 0, "granule_5");
$granule_6 = mysql_result($report_result, 0, "granule_6");
$pigment_1 = mysql_result($report_result, 0, "pigment_1");
$pigment_2 = mysql_result($report_result, 0, "pigment_2");
$pigment_3 = mysql_result($report_result, 0, "pigment_3");
$river_sand_1 = mysql_result($report_result, 0, "river_sand_1");
$river_sand_2 = mysql_result($report_result, 0, "river_sand_2");
$river_sand_3 = mysql_result($report_result, 0, "river_sand_3");
$silica_sand_1 = mysql_result($report_result, 0, "silica_sand_1");
$silica_sand_2 = mysql_result($report_result, 0, "silica_sand_2");
$silica_sand_3 = mysql_result($report_result, 0, "silica_sand_3");
$cement_1 = mysql_result($report_result, 0, "cement_1");
$cement_2 = mysql_result($report_result, 0, "cement_2");
$cement_3 = mysql_result($report_result, 0, "cement_3");
$water_1 = mysql_result($report_result, 0, "water_1");
$water_2 = mysql_result($report_result, 0, "water_2");
$water_3 = mysql_result($report_result, 0, "water_3");
$temperature = mysql_result($report_result, 0, "temperature");
$humidity = mysql_result($report_result, 0, "humidity");

if (strpos($mix_design_name, 'Double Roman') !== false) { $type = 'DR'; }
if (strpos($mix_design_name, 'Venetian') !== false) { $type = 'VE'; }
if (strpos($mix_design_name, 'Slate') !== false) { $type = 'SL'; }

if (($test_date=='0000-00-00') OR ($test_date=='') ) {
	   $test_date = date("Y-m-d");
}
require_once ('../include/tc_calendar.php');
$testing_date = strtotime($test_date);
$d = date("d", $testing_date );
$m = date("m", $testing_date );
$y = date("Y", $testing_date );

if ($length_1==0) {$length_1='';}
if ($length_2==0) {$length_2='';}
if ($length_3==0) {$length_3='';}
if ($length_4==0) {$length_4='';}
if ($length_5==0) {$length_5='';}
if ($length_6==0) {$length_6='';}
if ($width_1==0) {$width_1='';}
if ($width_2==0) {$width_2='';}
if ($width_3==0) {$width_3='';}
if ($width_4==0) {$width_4='';}
if ($width_5==0) {$width_5='';}
if ($width_6==0) {$width_6='';}
if ($th_body_1==0) {$th_body_1='';}
if ($th_body_2==0) {$th_body_2='';}
if ($th_body_3==0) {$th_body_3='';}
if ($th_body_4==0) {$th_body_4='';}
if ($th_body_5==0) {$th_body_5='';}
if ($th_body_6==0) {$th_body_6='';}
if ($th_lock_1==0) {$th_lock_1='';}
if ($th_lock_2==0) {$th_lock_2='';}
if ($th_lock_3==0) {$th_lock_3='';}
if ($th_lock_4==0) {$th_lock_4='';}
if ($th_lock_5==0) {$th_lock_5='';}
if ($th_lock_6==0) {$th_lock_6='';}
if ($side_lap_1==0) {$side_lap_1='';}
if ($side_lap_2==0) {$side_lap_2='';}
if ($side_lap_3==0) {$side_lap_3='';}
if ($side_lap_4==0) {$side_lap_4='';}
if ($side_lap_5==0) {$side_lap_5='';}
if ($side_lap_6==0) {$side_lap_6='';}
if ($batten_l_1==0) {$batten_l_1='';}
if ($batten_l_2==0) {$batten_l_2='';}
if ($batten_l_3==0) {$batten_l_3='';}
if ($batten_l_4==0) {$batten_l_4='';}
if ($batten_l_5==0) {$batten_l_5='';}
if ($batten_l_6==0) {$batten_l_6='';}
if ($batten_t_1==0) {$batten_t_1='';}
if ($batten_t_2==0) {$batten_t_2='';}
if ($batten_t_3==0) {$batten_t_3='';}
if ($batten_t_4==0) {$batten_t_4='';}
if ($batten_t_5==0) {$batten_t_5='';}
if ($batten_t_6==0) {$batten_t_6='';}
if ($batten_d_1==0) {$batten_d_1='';}
if ($batten_d_2==0) {$batten_d_2='';}
if ($batten_d_3==0) {$batten_d_3='';}
if ($batten_d_4==0) {$batten_d_4='';}
if ($batten_d_5==0) {$batten_d_5='';}
if ($batten_d_6==0) {$batten_d_6='';}
if ($nail_hole_1==0) {$nail_hole_1='';}
if ($nail_hole_2==0) {$nail_hole_2='';}
if ($nail_hole_3==0) {$nail_hole_3='';}
if ($nail_hole_4==0) {$nail_hole_4='';}
if ($nail_hole_5==0) {$nail_hole_5='';}
if ($nail_hole_6==0) {$nail_hole_6='';}
if ($mass_1==0) {$mass_1='';}
if ($mass_2==0) {$mass_2='';}
if ($mass_3==0) {$mass_3='';}
if ($mass_4==0) {$mass_4='';}
if ($mass_5==0) {$mass_5='';}
if ($mass_6==0) {$mass_6='';}
if ($pigment_1==0) {$pigment_1='';}
if ($pigment_2==0) {$pigment_2='';}
if ($pigment_3==0) {$pigment_3='';}
if ($river_sand_1==0) {$river_sand_1='';}
if ($river_sand_2==0) {$river_sand_2='';}
if ($river_sand_3==0) {$river_sand_3='';}
if ($silica_sand_1==0) {$silica_sand_1='';}
if ($silica_sand_2==0) {$silica_sand_2='';}
if ($silica_sand_3==0) {$silica_sand_3='';}
if ($cement_1==0) {$cement_1='';}
if ($cement_2==0) {$cement_2='';}
if ($cement_3==0) {$cement_3='';}
if ($water_1==0) {$water_1='';}
if ($water_2==0) {$water_2='';}
if ($water_3==0) {$water_3='';}
if ($temperature==0) {$temperature='';}
if ($humidity==0) {$humidity='';}

?>

</head>

<body onLoad="<?php if ($approve==1) {?> alertMessage(1, '', '<?php echo $approve_message ?> ')<?php } ?>; <?php if ($approve==5) {?> alertMessage(1, '', '<?php echo $approve_message_2 ?> ')<?php } ?>;">

<div class="main_frame">
 
<div class="page_head_frame">
        <table width="630" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><label class="label_page_head">Wet tile &amp; process inspections <?php echo $item_type ?></label></td>
            </tr>
        </table>
</div>
<br>
<br>
<form action="wet_tile_inspection_save.php" method="POST" name='form1'>
<div class="page_middle_frame">
<div class="page_inside_frame">
<table width="682" id="table_details_display">
  <tr>
    <td>Report no:</td>
    <td><?php echo $report_no ?></td>
    <td>Production date:</td>
    <td><?php echo date("l, d-m-Y", strtotime($production_date))?>
      <input type="hidden" name="production_date" id="production_date" value="<?php echo $production_date ?>">
      <input type="hidden" name="report_no" id="report_no" value="<?php echo $report_no ?>"></td>
  </tr>
  <tr>
    <td colspan="4"><label class="label_std" style="font-size:14px;">Production no: <?php echo $production_no_text ?></label></td>
    </tr>
  <tr>
    <td>Product(s):</td>
    <td colspan="3"><?php echo $mix_design_name ?>&nbsp;&nbsp;(<?php echo $type; ?>)<input name="type" type="hidden" value="<?php echo $type ?>">
      </td>
    </tr>
  <tr>
    <td width="98">Tested by:</td>
    <td width="244"><span class="wizard_frame">
      <select name="tested_by_select" id="tested_by_select" class="select160" onChange="document.getElementById('edit').value='1'">
        <option value="<?php echo $tested_by?>" selected="selected"><?php echo $tested_by?></option>
        <?php 
    	for ($w = 0; $w < count($arrId1); $w++) {
		echo "<option value=\"".$arrId1[$w] . "\"" . ">" . $arrName1[$w] . "</option>";	
	    }
     ?>
      </select>
    </span></td>
    <td width="136"><input type="hidden" name="edit" id="edit" value='0'></td>
    <td width="184">Click <a href="" onMouseOver="ddrivetip('Click to approve this inspection report.', 250)"; onMouseOut="hideddrivetip()" onClick=
    "if (document.getElementById('edit').value==1) {alertMessage(1, '', 'The last changes were not saved.<br><br>Save the report first and than try again.'); return false;  } else { editwindow=dhtmlmodal.open('editBox', 'iframe', '../edit_windows/wet_tile_approve.php?report_no=<?php echo $report_no ?>', 'Approve wet tile inspection.', 'width=450px,height=300px,center=1,resize=0,scrolling=0');
needToConfirm = false;
editwindow.onclose=function(){return window}; return false; }"><b>here</b></a> to approve.</td>
  </tr>
  <tr>
    <td>Date:</td>
    <td colspan="3">
      <?php

		$myCalendar = new tc_calendar("test_date", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($d, $m, $y);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2015, 2090);
		$myCalendar->writeScript();
?>
      &nbsp;&nbsp;</td>
    </tr>
</table>
</div>
<div class="page_inside_frame">
<table id="table_details_display">
  <tr>
    <td colspan="2">Description</td>
    <td width="56" align="center">1</td>
    <td width="56" align="center">2</td>
    <td width="56" align="center">3</td>
    <td width="56" align="center">4</td>
    <td width="56" align="center">5</td>
    <td width="59" align="center">6</td>
  </tr>
  <tr>
    <td width="149">Surface finish</td>
    <td width="156">(pass/fail)</td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="surface_finish_1a"  id="surface_finish_1a" <?php if ($surface_finish_1==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_1a').checked=true) {document.getElementById('surface_finish_1b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="surface_finish_1b" id="surface_finish_1b" <?php if ($surface_finish_1==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_1b').checked=true) {document.getElementById('surface_finish_1a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;" onClick="document.getElementById('surface_finish_1a').checked=false; document.getElementById('surface_finish_1b').checked=false; document.getElementById('p_edit').value='yes' " ></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="surface_finish_2a"  id="surface_finish_2a" <?php if ($surface_finish_2==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_2a').checked=true) {document.getElementById('surface_finish_2b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="surface_finish_2b" id="surface_finish_2b" <?php if ($surface_finish_2==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_2b').checked=true) {document.getElementById('surface_finish_2a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('surface_finish_2a').checked=false; document.getElementById('surface_finish_2b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="surface_finish_3a"  id="surface_finish_3a" <?php if ($surface_finish_3==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_3a').checked=true) {document.getElementById('surface_finish_3b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="surface_finish_3b" id="surface_finish_3b" <?php if ($surface_finish_3==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_3b').checked=true) {document.getElementById('surface_finish_3a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('surface_finish_3a').checked=false; document.getElementById('surface_finish_3b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="surface_finish_4a"  id="surface_finish_4a" <?php if ($surface_finish_4==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_4a').checked=true) {document.getElementById('surface_finish_4b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="surface_finish_4b" id="surface_finish_4b" <?php if ($surface_finish_4==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_4b').checked=true) {document.getElementById('surface_finish_4a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('surface_finish_4a').checked=false; document.getElementById('surface_finish_4b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="surface_finish_5a"  id="surface_finish_5a" <?php if ($surface_finish_5==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_5a').checked=true) {document.getElementById('surface_finish_5b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="surface_finish_5b" id="surface_finish_5b" <?php if ($surface_finish_5==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_5b').checked=true) {document.getElementById('surface_finish_5a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('surface_finish_5a').checked=false; document.getElementById('surface_finish_5b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="surface_finish_6a"  id="surface_finish_6a" <?php if ($surface_finish_6==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_6a').checked=true) {document.getElementById('surface_finish_6b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="surface_finish_6b" id="surface_finish_6b" <?php if ($surface_finish_6==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('surface_finish_6b').checked=true) {document.getElementById('surface_finish_6a').checked=false; } document.getElementById('p_edit').value='yes' "></div>
                       <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('surface_finish_6a').checked=false; document.getElementById('surface_finish_6b').checked=false; document.getElementById('p_edit').value='yes' "></td>
  </tr>
  <tr>
    <td>Length</td>
    <td>
	<?php if ($item_type=='Double Roman') { echo '418 mm &plusmn;4';} ?>
    <?php if ($item_type=='Slate') { echo '419 mm &plusmn;4';} ?>
    <?php if ($item_type=='Venetian') { echo '418 mm &plusmn;4';} ?>
    </td>
    <td align="center"><input type="text" name="length_1" id="length_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $length_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="length_2" id="length_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $length_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="length_3" id="length_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $length_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="length_4" id="length_4" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $length_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="length_5" id="length_5" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $length_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="length_6" id="length_6" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $length_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>Width</td>
    <td>
    <?php if ($item_type=='Double Roman') { echo '330 mm &plusmn;2';} ?>
    <?php if ($item_type=='Slate') { echo '332 mm &plusmn;2';} ?>
    <?php if ($item_type=='Venetian') { echo '330 mm &plusmn;2';} ?>
    </td>
    <td align="center"><input type="text" name="width_1" id="width_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $width_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="width_2" id="width_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $width_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="width_3" id="width_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $width_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="width_4" id="width_4" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $width_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="width_5" id="width_5" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $width_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="width_6" id="width_6" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3" value="<?php echo $width_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>Thickness body</td>
    <td>
    <?php if ($item_type=='Double Roman') { echo '12 mm minimum';} ?>
    <?php if ($item_type=='Slate') { echo '14 mm minimum';} ?>
    <?php if ($item_type=='Venetian') { echo '12 mm minimum';} ?> 
    </td>
    <td align="center"><input type="text" name="th_body_1" id="th_body_1" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $th_body_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_body_2" id="th_body_2" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $th_body_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_body_3" id="th_body_3" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $th_body_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_body_4" id="th_body_4" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $th_body_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_body_5" id="th_body_5" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $th_body_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_body_6" id="th_body_6" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $th_body_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>Thickness lock</td>
    <td>
    <?php if ($item_type=='Double Roman') { echo '5 mm minimum';} ?>
    <?php if ($item_type=='Slate') { echo '8-10 mm';} ?>
    <?php if ($item_type=='Venetian') { echo '3 mm minimum';} ?>
    </td>
    <td align="center"><input type="text" name="th_lock_1" id="th_lock_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2" value="<?php echo $th_lock_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_lock_2" id="th_lock_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2" value="<?php echo $th_lock_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_lock_3" id="th_lock_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2" value="<?php echo $th_lock_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_lock_4" id="th_lock_4" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2" value="<?php echo $th_lock_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_lock_5" id="th_lock_5" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2" value="<?php echo $th_lock_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="th_lock_6" id="th_lock_6" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2" value="<?php echo $th_lock_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>Side lap</td>
    <td>30 mm (minimum)</td>
    <td align="center"><input type="text" name="side_lap_1" id="side_lap_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $side_lap_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="side_lap_2" id="side_lap_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $side_lap_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="side_lap_3" id="side_lap_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $side_lap_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="side_lap_4" id="side_lap_4" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $side_lap_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="side_lap_5" id="side_lap_5" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $side_lap_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="side_lap_6" id="side_lap_6" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $side_lap_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td rowspan="3">Batten lugs</td>
    <td>
    <?php if ($item_type=='Double Roman') { echo 'L = 20 mm (minimum)';} ?>
    <?php if ($item_type=='Slate') { echo 'L = 50 mm (minimum)';} ?>
    <?php if ($item_type=='Venetian') { echo 'L = 20 mm (minimum)';} ?>
    </td>
    <td align="center"><input type="text" name="batten_l_1" id="batten_l_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_l_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_l_2" id="batten_l_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_l_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_l_3" id="batten_l_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_l_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_l_4" id="batten_l_4" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_l_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_l_5" id="batten_l_5" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_l_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_l_6" id="batten_l_6" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_l_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>
    <?php if ($item_type=='Double Roman') { echo 'T = 13 mm (minimum)';} ?>
    <?php if ($item_type=='Slate') { echo 'T = 12 mm (minimum)';} ?>
    <?php if ($item_type=='Venetian') { echo 'T = 13 mm (minimum)';} ?>
    </td>
    <td align="center"><input type="text" name="batten_t_1" id="batten_t_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_t_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_t_2" id="batten_t_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_t_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_t_3" id="batten_t_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_t_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_t_4" id="batten_t_4" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_t_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_t_5" id="batten_t_5" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_t_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_t_6" id="batten_t_6" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_t_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>D = 10-20 mm</td>
    <td align="center"><input type="text" name="batten_d_1" id="batten_d_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_d_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_d_2" id="batten_d_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_d_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_d_3" id="batten_d_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_d_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_d_4" id="batten_d_4" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_d_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_d_5" id="batten_d_5" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_d_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="batten_d_6" id="batten_d_6" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $batten_d_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>Bottom nibs</td>
    <td>(pass/fail) </td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="b_nibs_1a"  id="b_nibs_1a" <?php if ($b_nibs_1==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_1a').checked=true) {document.getElementById('b_nibs_1b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="b_nibs_1b" id="b_nibs_1b" <?php if ($b_nibs_1==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_1b').checked=true) {document.getElementById('b_nibs_1a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('b_nibs_1a').checked=false; document.getElementById('b_nibs_1b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="b_nibs_2a"  id="b_nibs_2a" <?php if ($b_nibs_2==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_2a').checked=true) {document.getElementById('b_nibs_2b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="b_nibs_2b" id="b_nibs_2b" <?php if ($b_nibs_2==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_2b').checked=true) {document.getElementById('b_nibs_2a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('b_nibs_2a').checked=false; document.getElementById('b_nibs_2b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="b_nibs_3a"  id="b_nibs_3a" <?php if ($b_nibs_3==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_3a').checked=true) {document.getElementById('b_nibs_3b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="b_nibs_3b" id="b_nibs_3b" <?php if ($b_nibs_3==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_3b').checked=true) {document.getElementById('b_nibs_3a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('b_nibs_3a').checked=false; document.getElementById('b_nibs_3b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="b_nibs_4a"  id="b_nibs_4a" <?php if ($b_nibs_4==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_4a').checked=true) {document.getElementById('b_nibs_4b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="b_nibs_4b" id="b_nibs_4b" <?php if ($b_nibs_4==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_4b').checked=true) {document.getElementById('b_nibs_4a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('b_nibs_4a').checked=false; document.getElementById('b_nibs_4b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="b_nibs_5a"  id="b_nibs_5a" <?php if ($b_nibs_5==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_5a').checked=true) {document.getElementById('b_nibs_5b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="b_nibs_5b" id="b_nibs_5b" <?php if ($b_nibs_5==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_5b').checked=true) {document.getElementById('b_nibs_5a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('b_nibs_5a').checked=false; document.getElementById('b_nibs_5b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="b_nibs_6a"  id="b_nibs_6a" <?php if ($b_nibs_6==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_6a').checked=true) {document.getElementById('b_nibs_6b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="b_nibs_6b" id="b_nibs_6b" <?php if ($b_nibs_6==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('b_nibs_6b').checked=true) {document.getElementById('b_nibs_6a').checked=false; } document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('b_nibs_6a').checked=false; document.getElementById('b_nibs_6b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    </tr>
  <tr>
    <td>Nail hole</td>
    <td>
    <?php if ($item_type=='Double Roman') { echo '14-20 mm';} ?>
    <?php if ($item_type=='Slate') { echo '40 mm -4/+2';} ?>
    <?php if ($item_type=='Venetian') { echo '42 mm -4/+2';} ?>
    </td>
    <td align="center"><input type="text" name="nail_hole_1" id="nail_hole_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $nail_hole_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="nail_hole_2" id="nail_hole_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $nail_hole_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="nail_hole_3" id="nail_hole_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $nail_hole_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="nail_hole_4" id="nail_hole_4" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $nail_hole_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="nail_hole_5" id="nail_hole_5" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $nail_hole_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="nail_hole_6" id="nail_hole_6" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="2"  value="<?php echo $nail_hole_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>Mass</td>
    <td>
    <?php if ($item_type=='Double Roman') { echo '4.5 kg &plusmn;10%';} ?>
    <?php if ($item_type=='Slate') { echo '5.2 kg &plusmn;10%';} ?>
    <?php if ($item_type=='Venetian') { echo '5.0 kg &plusmn;10%';} ?>
    </td>
    <td align="center"><input type="text" name="mass_1" id="mass_1" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $mass_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="mass_2" id="mass_2" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $mass_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="mass_3" id="mass_3" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $mass_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="mass_4" id="mass_4" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $mass_4 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="mass_5" id="mass_5" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $mass_5 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td align="center"><input type="text" name="mass_6" id="mass_6" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $mass_6 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
  </tr>
  <tr>
    <td>Knife cut</td>
    <td>(pass/fail)</td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="knife_cut_1a"  id="knife_cut_1a" <?php if ($knife_cut_1==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_1a').checked=true) {document.getElementById('knife_cut_1b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="knife_cut_1b" id="knife_cut_1b" <?php if ($knife_cut_1==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_1b').checked=true) {document.getElementById('knife_cut_1a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('knife_cut_1a').checked=false; document.getElementById('knife_cut_1b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="knife_cut_2a"  id="knife_cut_2a" <?php if ($knife_cut_2==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_2a').checked=true) {document.getElementById('knife_cut_2b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="knife_cut_2b" id="knife_cut_2b" <?php if ($knife_cut_2==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_2b').checked=true) {document.getElementById('knife_cut_2a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('knife_cut_2a').checked=false; document.getElementById('knife_cut_2b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="knife_cut_3a"  id="knife_cut_3a" <?php if ($knife_cut_3==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_3a').checked=true) {document.getElementById('knife_cut_3b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="knife_cut_3b" id="knife_cut_3b" <?php if ($knife_cut_3==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_3b').checked=true) {document.getElementById('knife_cut_3a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('knife_cut_3a').checked=false; document.getElementById('knife_cut_3b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="knife_cut_4a"  id="knife_cut_4a" <?php if ($knife_cut_4==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_4a').checked=true) {document.getElementById('knife_cut_4b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="knife_cut_4b" id="knife_cut_4b" <?php if ($knife_cut_4==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_4b').checked=true) {document.getElementById('knife_cut_4a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('knife_cut_4a').checked=false; document.getElementById('knife_cut_4b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="knife_cut_5a"  id="knife_cut_5a" <?php if ($knife_cut_5==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_5a').checked=true) {document.getElementById('knife_cut_5b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="knife_cut_5b" id="knife_cut_5b" <?php if ($knife_cut_5==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_5b').checked=true) {document.getElementById('knife_cut_5a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('knife_cut_5a').checked=false; document.getElementById('knife_cut_5b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="knife_cut_6a"  id="knife_cut_6a" <?php if ($knife_cut_6==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_6a').checked=true) {document.getElementById('knife_cut_6b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="knife_cut_6b" id="knife_cut_6b" <?php if ($knife_cut_6==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('knife_cut_6b').checked=true) {document.getElementById('knife_cut_6a').checked=false; } document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('knife_cut_6a').checked=false; document.getElementById('knife_cut_6b').checked=false; document.getElementById('p_edit').value='yes' "></td>
  </tr>
  <tr>
    <td>Body color</td>
    <td>(pass/fail)</td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="colour_1a"  id="colour_1a" <?php if ($colour_1==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_1a').checked=true) {document.getElementById('colour_1b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="colour_1b" id="colour_1b" <?php if ($colour_1==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_1b').checked=true) {document.getElementById('colour_1a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('colour_1a').checked=false; document.getElementById('colour_1b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="colour_2a"  id="colour_2a" <?php if ($colour_2==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_2a').checked=true) {document.getElementById('colour_2b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="colour_2b" id="colour_2b" <?php if ($colour_2==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_2b').checked=true) {document.getElementById('colour_2a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('colour_2a').checked=false; document.getElementById('colour_2b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="colour_3a"  id="colour_3a" <?php if ($colour_3==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_3a').checked=true) {document.getElementById('colour_3b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="colour_3b" id="colour_3b" <?php if ($colour_3==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_3b').checked=true) {document.getElementById('colour_3a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('colour_3a').checked=false; document.getElementById('colour_3b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="colour_4a"  id="colour_4a" <?php if ($colour_4==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_4a').checked=true) {document.getElementById('colour_4b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="colour_4b" id="colour_4b" <?php if ($colour_4==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_4b').checked=true) {document.getElementById('colour_4a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('colour_4a').checked=false; document.getElementById('colour_4b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="colour_5a"  id="colour_5a" <?php if ($colour_5==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_5a').checked=true) {document.getElementById('colour_5b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="colour_5b" id="colour_5b" <?php if ($colour_5==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_5b').checked=true) {document.getElementById('colour_5a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('colour_5a').checked=false; document.getElementById('colour_5b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="colour_6a"  id="colour_6a" <?php if ($colour_6==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_6a').checked=true) {document.getElementById('colour_6b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="colour_6b" id="colour_6b" <?php if ($colour_6==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('colour_6b').checked=true) {document.getElementById('colour_6a').checked=false; } document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('colour_6a').checked=false; document.getElementById('colour_6b').checked=false; document.getElementById('p_edit').value='yes' "></td>
  </tr>
  <tr>
    <td>Cracks</td>
    <td>(pass/fail)</td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="cracks_1a"  id="cracks_1a" <?php if ($cracks_1==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_1a').checked=true) {document.getElementById('cracks_1b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="cracks_1b" id="cracks_1b" <?php if ($cracks_1==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_1b').checked=true) {document.getElementById('cracks_1a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('cracks_1a').checked=false; document.getElementById('cracks_1b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="cracks_2a"  id="cracks_2a" <?php if ($cracks_2==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_2a').checked=true) {document.getElementById('cracks_2b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="cracks_2b" id="cracks_2b" <?php if ($cracks_2==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_2b').checked=true) {document.getElementById('cracks_2a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('cracks_2a').checked=false; document.getElementById('cracks_2b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="cracks_3a"  id="cracks_3a" <?php if ($cracks_3==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_3a').checked=true) {document.getElementById('cracks_3b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="cracks_3b" id="cracks_3b" <?php if ($cracks_3==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_3b').checked=true) {document.getElementById('cracks_3a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('cracks_3a').checked=false; document.getElementById('cracks_3b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="cracks_4a"  id="cracks_4a" <?php if ($cracks_4==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_4a').checked=true) {document.getElementById('cracks_4b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="cracks_4b" id="cracks_4b" <?php if ($cracks_4==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_4b').checked=true) {document.getElementById('cracks_4a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('cracks_4a').checked=false; document.getElementById('cracks_4b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="cracks_5a"  id="cracks_5a" <?php if ($cracks_5==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_5a').checked=true) {document.getElementById('cracks_5b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="cracks_5b" id="cracks_5b" <?php if ($cracks_5==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_5b').checked=true) {document.getElementById('cracks_5a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('cracks_5a').checked=false; document.getElementById('cracks_5b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="cracks_6a"  id="cracks_6a" <?php if ($cracks_6==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_6a').checked=true) {document.getElementById('cracks_6b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="cracks_6b" id="cracks_6b" <?php if ($cracks_6==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('cracks_6b').checked=true) {document.getElementById('cracks_6a').checked=false; } document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('cracks_6a').checked=false; document.getElementById('cracks_6b').checked=false; document.getElementById('p_edit').value='yes' "></td>
  </tr>
  <tr>
    <td>Compaction</td>
    <td>(pass/fail)</td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="compaction_1a"  id="compaction_1a" <?php if ($compaction_1==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_1a').checked=true) {document.getElementById('compaction_1b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="compaction_1b" id="compaction_1b" <?php if ($compaction_1==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_1b').checked=true) {document.getElementById('compaction_1a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('compaction_1a').checked=false; document.getElementById('compaction_1b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="compaction_2a"  id="compaction_2a" <?php if ($compaction_2==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_2a').checked=true) {document.getElementById('compaction_2b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="compaction_2b" id="compaction_2b" <?php if ($compaction_2==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_2b').checked=true) {document.getElementById('compaction_2a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('compaction_2a').checked=false; document.getElementById('compaction_2b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="compaction_3a"  id="compaction_3a" <?php if ($compaction_3==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_3a').checked=true) {document.getElementById('compaction_3b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="compaction_3b" id="compaction_3b" <?php if ($compaction_3==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_3b').checked=true) {document.getElementById('compaction_3a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('compaction_3a').checked=false; document.getElementById('compaction_3b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="compaction_4a"  id="compaction_4a" <?php if ($compaction_4==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_4a').checked=true) {document.getElementById('compaction_4b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="compaction_4b" id="compaction_4b" <?php if ($compaction_4==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_4b').checked=true) {document.getElementById('compaction_4a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('compaction_4a').checked=false; document.getElementById('compaction_4b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="compaction_5a"  id="compaction_5a" <?php if ($compaction_5==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_5a').checked=true) {document.getElementById('compaction_5b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="compaction_5b" id="compaction_5b" <?php if ($compaction_5==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_5b').checked=true) {document.getElementById('compaction_5a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('compaction_5a').checked=false; document.getElementById('compaction_5b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="compaction_6a"  id="compaction_6a" <?php if ($compaction_6==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_6a').checked=true) {document.getElementById('compaction_6b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="compaction_6b" id="compaction_6b" <?php if ($compaction_6==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('compaction_6b').checked=true) {document.getElementById('compaction_6a').checked=false; } document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('compaction_6a').checked=false; document.getElementById('compaction_6b').checked=false; document.getElementById('p_edit').value='yes' "></td>
  </tr>
  <tr>
    <td>Lock feather</td>
    <td>(pass/fail)</td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="lock_feather_1a"  id="lock_feather_1a" <?php if ($lock_feather_1==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_1a').checked=true) {document.getElementById('lock_feather_1b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="lock_feather_1b" id="lock_feather_1b" <?php if ($lock_feather_1==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_1b').checked=true) {document.getElementById('lock_feather_1a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('lock_feather_1a').checked=false; document.getElementById('lock_feather_1b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="lock_feather_2a"  id="lock_feather_2a" <?php if ($lock_feather_2==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_2a').checked=true) {document.getElementById('lock_feather_2b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="lock_feather_2b" id="lock_feather_2b" <?php if ($lock_feather_2==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_2b').checked=true) {document.getElementById('lock_feather_2a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('lock_feather_2a').checked=false; document.getElementById('lock_feather_2b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="lock_feather_3a"  id="lock_feather_3a" <?php if ($lock_feather_3==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_3a').checked=true) {document.getElementById('lock_feather_3b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="lock_feather_3b" id="lock_feather_3b" <?php if ($lock_feather_3==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_3b').checked=true) {document.getElementById('lock_feather_3a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('lock_feather_3a').checked=false; document.getElementById('lock_feather_3b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="lock_feather_4a"  id="lock_feather_4a" <?php if ($lock_feather_4==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_4a').checked=true) {document.getElementById('lock_feather_4b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="lock_feather_4b" id="lock_feather_4b" <?php if ($lock_feather_4==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_4b').checked=true) {document.getElementById('lock_feather_4a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('lock_feather_4a').checked=false; document.getElementById('lock_feather_4b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="lock_feather_5a"  id="lock_feather_5a" <?php if ($lock_feather_5==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_5a').checked=true) {document.getElementById('lock_feather_5b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="lock_feather_5b" id="lock_feather_5b" <?php if ($lock_feather_5==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_5b').checked=true) {document.getElementById('lock_feather_5a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('lock_feather_5a').checked=false; document.getElementById('lock_feather_5b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="lock_feather_6a"  id="lock_feather_6a" <?php if ($lock_feather_6==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_6a').checked=true) {document.getElementById('lock_feather_6b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="lock_feather_6b" id="lock_feather_6b" <?php if ($lock_feather_6==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('lock_feather_6b').checked=true) {document.getElementById('lock_feather_6a').checked=false; } document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('lock_feather_6a').checked=false; document.getElementById('lock_feather_6b').checked=false; document.getElementById('p_edit').value='yes' "></td>
  </tr>
  <tr>
    <td>Granule apply</td>
    <td>(pass/fail)</td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="granule_1a"  id="granule_1a" <?php if ($granule_1==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_1a').checked=true) {document.getElementById('granule_1b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="granule_1b" id="granule_1b" <?php if ($granule_1==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_1b').checked=true) {document.getElementById('granule_1a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('granule_1a').checked=false; document.getElementById('granule_1b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="granule_2a"  id="granule_2a" <?php if ($granule_2==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_2a').checked=true) {document.getElementById('granule_2b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="granule_2b" id="granule_2b" <?php if ($granule_2==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_2b').checked=true) {document.getElementById('granule_2a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('granule_2a').checked=false; document.getElementById('granule_2b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="granule_3a"  id="granule_3a" <?php if ($granule_3==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_3a').checked=true) {document.getElementById('granule_3b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="granule_3b" id="granule_3b" <?php if ($granule_3==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_3b').checked=true) {document.getElementById('granule_3a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('granule_3a').checked=false; document.getElementById('granule_3b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="granule_4a"  id="granule_4a" <?php if ($granule_4==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_4a').checked=true) {document.getElementById('granule_4b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="granule_4b" id="granule_4b" <?php if ($granule_4==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_4b').checked=true) {document.getElementById('granule_4a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('granule_4a').checked=false; document.getElementById('granule_4b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="granule_5a"  id="granule_5a" <?php if ($granule_5==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_5a').checked=true) {document.getElementById('granule_5b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="granule_5b" id="granule_5b" <?php if ($granule_5==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_5b').checked=true) {document.getElementById('granule_5a').checked=false;} document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('granule_5a').checked=false; document.getElementById('granule_5b').checked=false; document.getElementById('p_edit').value='yes' "></td>
    <td align="center"><div style="float:left; background-color:#090; width:22px;"><input type="checkbox" name="granule_6a"  id="granule_6a" <?php if ($granule_6==1) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_6a').checked=true) {document.getElementById('granule_6b').checked=false;} document.getElementById('p_edit').value='yes' "></div>
                       <div style="float:left; background-color:#F00; width:22px;"><input type="checkbox" name="granule_6b" id="granule_6b" <?php if ($granule_6==2) { ?> checked <?php } ?>  onChange="if (document.getElementById('granule_6b').checked=true) {document.getElementById('granule_6a').checked=false; } document.getElementById('p_edit').value='yes' "></div>
              <img src="../images/clear.png" width="10" height="10" style="cursor:pointer;"  onClick="document.getElementById('granule_6a').checked=false; document.getElementById('granule_6b').checked=false; document.getElementById('p_edit').value='yes' "></td>
  </tr>
</table>
</div>
<div class="page_inside_frame">
<table width="673"  id="table_details_display">
  <tr>
    <td align="center">&nbsp;</td>
    <td align="left">Pigment weight test (kg)</td>
    <td align="center">&nbsp;</td>
    <td width="216">&nbsp;</td>
  </tr>
  <tr>
    <td width="49" align="center">1</td>
    <td width="167">
      <input type="text" name="pigment_1" id="pigment_1" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $pigment_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center">2</td>
    <td><input type="text" name="pigment_2" id="pigment_2" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $pigment_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center">3</td>
    <td><input type="text" name="pigment_3" id="pigment_3" width="40px;" class="text40" autocomplete="off" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\..).*/, '$1')" style="text-align:right" maxlength="4"  value="<?php echo $pigment_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td>(optional)</td>
    <td>&nbsp;</td>
  </tr>
</table>
<br>
<table id="table_details_display">
  <tr>
    <td colspan="5">Applied mixture</td>
    <td width="219">&nbsp;</td>
  </tr>
  <tr>
    <td width="49">&nbsp;</td>
    <td width="96">River sand (kg)</td>
    <td width="105">Silica sand (kg)</td>
    <td width="107">Cement (kg)</td>
    <td width="76">Water (ltr)</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>1</td>
    <td><input type="text" name="river_sand_1" id="river_sand_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $river_sand_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="silica_sand_1" id="silica_sand_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $silica_sand_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="cement_1" id="cement_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $cement_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="water_1" id="water_1" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $water_1 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>2</td>
    <td><input type="text" name="river_sand_2" id="river_sand_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $river_sand_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="silica_sand_2" id="silica_sand_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $silica_sand_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="cement_2" id="cement_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $cement_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="water_2" id="water_2" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $water_2 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>3</td>
    <td><input type="text" name="river_sand_3" id="river_sand_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $river_sand_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="silica_sand_3" id="silica_sand_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $silica_sand_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="cement_3" id="cement_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $cement_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td><input type="text" name="water_3" id="water_3" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $water_3 ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td>&nbsp;</td>
  </tr>
</table>
<br>
<table width="681" id="table_details_display">
  <tr>
    <td colspan="2">Curing chambers</td>
    <td width="220">&nbsp;</td>
  </tr>
  <tr>
    <td width="229">Max temperature:&nbsp;&nbsp;
      <input type="text" name="temperature" id="temperature" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $temperature ?>" onfocus = "this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td width="216">Max humidy:&nbsp;&nbsp;
      <input type="text" name="humidity" id="humidity" width="40px;" class="text40" autocomplete="off" onkeypress="return numbersonly(this, event)" style="text-align:right" maxlength="3"  value="<?php echo $humidity ?>" onfocus="this.select();" onChange="document.getElementById('edit').value='1'"></td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>

</div>
<div class="page_inside_frame">
  <table width="645" border="0">
    <tr>
      <td width="114"><a href="../include/wet_tiles_alert.php?report_no=<?php echo $report_no ?>" onClick="needToConfirm = false;"><input type="button" name="request_button" id="request_button" value="Request approval" class="imagebutton"></a></td>
      <td width="521" align="right">
        <input name="p_edit" id="p_edit" type="hidden" value="no">
<input name="button2" type="button" class="imagebutton" id="button2" onClick="if (document.getElementById('p_edit').value=='yes') { cancel_confirmation(3, '../quality/quality_main.php?date=&branch=&subCatSelect=Tiles');} else {needToConfirm = false; window.location='../quality/quality_main.php?date=&branch=&subCatSelect=Tiles';}" value="Close"/>
        <input name="save_button"  id="save_button" type="submit" class="imagebutton" value="Save" onClick="needToConfirm = false; confirmRefresh();" />
        <input name="save_close_button"  id="save_close_button" type="submit" class="imagebutton" value="Save &amp; Close" onClick="needToConfirm = false; confirmRefresh();" /></td>
    </tr>
  </table>
 
</div> 
</div>
</form>
</div>

<?php include ('../navigation/side_bar.php'); ?>
</body>

<?php } else { ?>
<script> needToConfirm = false; </script>
<?php
    $_SESSION['denied_return'] = "quality/quality_main.php";	
    include ("../navigation/quality_sidebar.php");?>
    <?php include ('../navigation/side_bar.php'); ?>
	<body onLoad="accessdenied(); return false">	
	</body>
<?php }
?>
</html>