<!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> 



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

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

$report_no = $_GET['report_no'];


$table_name = $_SESSION['db_prefix']."_dry_tile_spec";
$report_query = "SELECT * FROM $table_name WHERE dry_report_no = '".$report_no."'  ";
$report_result = mySQL_query($report_query);
$production_date = mysql_result($report_result, 0, "production_date");
//$mix_design_name = mysql_result($report_result, 0, "mix_design_name");
$item_type = mysql_result($report_result, 0, "item_type");
$batch_code = mysql_result($report_result, 0, "batch_code");
$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");
$flat_type = mysql_result($report_result, 0, "flat_type");
$profiled_type = mysql_result($report_result, 0, "profiled_type");
$colour_1 = mysql_result($report_result, 0, "colour_1");
$colour_2 = mysql_result($report_result, 0, "colour_2");
$true_colour = mysql_result($report_result, 0, "true_colour");
$antique = mysql_result($report_result, 0, "antique");
$length_L2_1 = mysql_result($report_result, 0, "length_L2_1");
$length_L2_2 = mysql_result($report_result, 0, "length_L2_2");
$length_L2_3 = mysql_result($report_result, 0, "length_L2_3");
$length_L2_4 = mysql_result($report_result, 0, "length_L2_4");
$length_L2_5 = mysql_result($report_result, 0, "length_L2_5");
$length_L2_6 = mysql_result($report_result, 0, "length_L2_6");
$length_L3_1 = mysql_result($report_result, 0, "length_L3_1");
$length_L3_2 = mysql_result($report_result, 0, "length_L3_2");
$length_L3_3 = mysql_result($report_result, 0, "length_L3_3");
$length_L3_4 = mysql_result($report_result, 0, "length_L3_4");
$length_L3_5 = mysql_result($report_result, 0, "length_L3_5");
$length_L3_6 = mysql_result($report_result, 0, "length_L3_6");
$length_L1_1 = mysql_result($report_result, 0, "length_L1_1");
$length_L1_2 = mysql_result($report_result, 0, "length_L1_2");
$length_L1_3 = mysql_result($report_result, 0, "length_L1_3");
$length_L1_4 = mysql_result($report_result, 0, "length_L1_4");
$length_L1_5 = mysql_result($report_result, 0, "length_L1_5");
$length_L1_6 = mysql_result($report_result, 0, "length_L1_6");
$flatness_1 = mysql_result($report_result, 0, "flatness_1");
$flatness_2 = mysql_result($report_result, 0, "flatness_2");
$flatness_3 = mysql_result($report_result, 0, "flatness_3");
$flatness_4 = mysql_result($report_result, 0, "flatness_4");
$flatness_5 = mysql_result($report_result, 0, "flatness_5");
$flatness_6 = mysql_result($report_result, 0, "flatness_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");
$nail_1 = mysql_result($report_result, 0, "nail_1");
$nail_2 = mysql_result($report_result, 0, "nail_2");
$nail_3 = mysql_result($report_result, 0, "nail_3");
$nail_4 = mysql_result($report_result, 0, "nail_4");
$nail_5 = mysql_result($report_result, 0, "nail_5");
$nail_6 = mysql_result($report_result, 0, "nail_6");
$rain_1 = mysql_result($report_result, 0, "rain_1");
$rain_2 = mysql_result($report_result, 0, "rain_2");
$rain_3 = mysql_result($report_result, 0, "rain_3");
$rain_4 = mysql_result($report_result, 0, "rain_4");
$rain_5 = mysql_result($report_result, 0, "rain_5");
$rain_6 = mysql_result($report_result, 0, "rain_6");
$mass_1_1 = mysql_result($report_result, 0, "mass_1_1");
$mass_1_2 = mysql_result($report_result, 0, "mass_1_2");
$mass_1_3 = mysql_result($report_result, 0, "mass_1_3");
$mass_1_4 = mysql_result($report_result, 0, "mass_1_4");
$mass_1_5 = mysql_result($report_result, 0, "mass_1_5");
$mass_1_6 = mysql_result($report_result, 0, "mass_1_6");
$mass_2_1 = mysql_result($report_result, 0, "mass_2_1");
$mass_2_2 = mysql_result($report_result, 0, "mass_2_2");
$mass_2_3 = mysql_result($report_result, 0, "mass_2_3");
$mass_2_4 = mysql_result($report_result, 0, "mass_2_4");
$mass_2_5 = mysql_result($report_result, 0, "mass_2_5");
$mass_2_6 = mysql_result($report_result, 0, "mass_2_6");
$mass_3_1 = mysql_result($report_result, 0, "mass_3_1");
$mass_3_2 = mysql_result($report_result, 0, "mass_3_2");
$mass_3_3 = mysql_result($report_result, 0, "mass_3_3");
$mass_3_4 = mysql_result($report_result, 0, "mass_3_4");
$mass_3_5 = mysql_result($report_result, 0, "mass_3_5");
$mass_3_6 = mysql_result($report_result, 0, "mass_3_6");
$divisions_1_1 = mysql_result($report_result, 0, "divisions_1_1");
$divisions_1_2 = mysql_result($report_result, 0, "divisions_1_2");
$divisions_1_3 = mysql_result($report_result, 0, "divisions_1_3");
$divisions_1_4 = mysql_result($report_result, 0, "divisions_1_4");
$divisions_1_5 = mysql_result($report_result, 0, "divisions_1_5");
$divisions_1_6 = mysql_result($report_result, 0, "divisions_1_6");
$divisions_2_1 = mysql_result($report_result, 0, "divisions_2_1");
$divisions_2_2 = mysql_result($report_result, 0, "divisions_2_2");
$divisions_2_3 = mysql_result($report_result, 0, "divisions_2_3");
$divisions_2_4 = mysql_result($report_result, 0, "divisions_2_4");
$divisions_2_5 = mysql_result($report_result, 0, "divisions_2_5");
$divisions_2_6 = mysql_result($report_result, 0, "divisions_2_6");
$divisions_3_1 = mysql_result($report_result, 0, "divisions_3_1");
$divisions_3_2 = mysql_result($report_result, 0, "divisions_3_2");
$divisions_3_3 = mysql_result($report_result, 0, "divisions_3_3");
$divisions_3_4 = mysql_result($report_result, 0, "divisions_3_4");
$divisions_3_5 = mysql_result($report_result, 0, "divisions_3_5");
$divisions_3_6 = mysql_result($report_result, 0, "divisions_3_6");
$kn_1_1 = mysql_result($report_result, 0, "kn_1_1");
$kn_1_2 = mysql_result($report_result, 0, "kn_1_2");
$kn_1_3 = mysql_result($report_result, 0, "kn_1_3");
$kn_1_4 = mysql_result($report_result, 0, "kn_1_4");
$kn_1_5 = mysql_result($report_result, 0, "kn_1_5");
$kn_1_6 = mysql_result($report_result, 0, "kn_1_6");
$kn_2_1 = mysql_result($report_result, 0, "kn_2_1");
$kn_2_2 = mysql_result($report_result, 0, "kn_2_2");
$kn_2_3 = mysql_result($report_result, 0, "kn_2_3");
$kn_2_4 = mysql_result($report_result, 0, "kn_2_4");
$kn_2_5 = mysql_result($report_result, 0, "kn_2_5");
$kn_2_6 = mysql_result($report_result, 0, "kn_2_6");
$kn_3_1 = mysql_result($report_result, 0, "kn_3_1");
$kn_3_2 = mysql_result($report_result, 0, "kn_3_2");
$kn_3_3 = mysql_result($report_result, 0, "kn_3_3");
$kn_3_4 = mysql_result($report_result, 0, "kn_3_4");
$kn_3_5 = mysql_result($report_result, 0, "kn_3_5");
$kn_3_6 = mysql_result($report_result, 0, "kn_3_6");
$thickness_1_1 = mysql_result($report_result, 0, "thickness_1_1");
$thickness_1_2 = mysql_result($report_result, 0, "thickness_1_2");
$thickness_1_3 = mysql_result($report_result, 0, "thickness_1_3");
$thickness_1_4 = mysql_result($report_result, 0, "thickness_1_4");
$thickness_1_5 = mysql_result($report_result, 0, "thickness_1_5");
$thickness_1_6 = mysql_result($report_result, 0, "thickness_1_6");
$thickness_2_1 = mysql_result($report_result, 0, "thickness_2_1");
$thickness_2_2 = mysql_result($report_result, 0, "thickness_2_2");
$thickness_2_3 = mysql_result($report_result, 0, "thickness_2_3");
$thickness_2_4 = mysql_result($report_result, 0, "thickness_2_4");
$thickness_2_5 = mysql_result($report_result, 0, "thickness_2_5");
$thickness_2_6 = mysql_result($report_result, 0, "thickness_2_6");
$thickness_3_1 = mysql_result($report_result, 0, "thickness_3_1");
$thickness_3_2 = mysql_result($report_result, 0, "thickness_3_2");
$thickness_3_3 = mysql_result($report_result, 0, "thickness_3_3");
$thickness_3_4 = mysql_result($report_result, 0, "thickness_3_4");
$thickness_3_5 = mysql_result($report_result, 0, "thickness_3_5");
$thickness_3_6 = mysql_result($report_result, 0, "thickness_3_6");
$release_1_date = mysql_result($report_result, 0, "release_1_date");
$release_3_date = mysql_result($report_result, 0, "release_3_date");
$release_7_date = mysql_result($report_result, 0, "release_7_date");
$remarks = mysql_result($report_result, 0, "remarks");


if ($length_L2_1==0) {$length_L2_1='';}
if ($length_L2_2==0) {$length_L2_2='';}
if ($length_L2_3==0) {$length_L2_3='';}
if ($length_L2_4==0) {$length_L2_4='';}
if ($length_L2_5==0) {$length_L2_5='';}
if ($length_L2_6==0) {$length_L2_6='';}
if ($length_L3_1==0) {$length_L3_1='';}
if ($length_L3_2==0) {$length_L3_2='';}
if ($length_L3_3==0) {$length_L3_3='';}
if ($length_L3_4==0) {$length_L3_4='';}
if ($length_L3_5==0) {$length_L3_5='';}
if ($length_L3_6==0) {$length_L3_6='';}
if ($length_L1_1==0) {$length_L1_1='';}
if ($length_L1_2==0) {$length_L1_2='';}
if ($length_L1_3==0) {$length_L1_3='';}
if ($length_L1_4==0) {$length_L1_4='';}
if ($length_L1_5==0) {$length_L1_5='';}
if ($length_L1_6==0) {$length_L1_6='';}
if ($flatness_1==0) {$flatness_1='';}
if ($flatness_2==0) {$flatness_2='';}
if ($flatness_3==0) {$flatness_3='';}
if ($flatness_4==0) {$flatness_4='';}
if ($flatness_5==0) {$flatness_5='';}
if ($flatness_6==0) {$flatness_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 ($nail_1==0) {$nail_1='';}
if ($nail_2==0) {$nail_2='';}
if ($nail_3==0) {$nail_3='';}
if ($nail_4==0) {$nail_4='';}
if ($nail_5==0) {$nail_5='';}
if ($nail_6==0) {$nail_6='';}
if ($rain_1==0) {$rain_1='';}
if ($rain_2==0) {$rain_2='';}
if ($rain_3==0) {$rain_3='';}
if ($rain_4==0) {$rain_4='';}
if ($rain_5==0) {$rain_5='';}
if ($rain_6==0) {$rain_6='';}
if ($mass_1_1==0) {$mass_1_1='';}
if ($mass_1_2==0) {$mass_1_2='';}
if ($mass_1_3==0) {$mass_1_3='';}
if ($mass_1_4==0) {$mass_1_4='';}
if ($mass_1_5==0) {$mass_1_5='';}
if ($mass_1_6==0) {$mass_1_6='';}
if ($divisions_1_1==0) {$divisions_1_1='';}
if ($divisions_1_2==0) {$divisions_1_2='';}
if ($divisions_1_3==0) {$divisions_1_3='';}
if ($divisions_1_4==0) {$divisions_1_4='';}
if ($divisions_1_5==0) {$divisions_1_5='';}
if ($divisions_1_6==0) {$divisions_1_6='';}
if ($kn_1_1==0) {$kn_1_1='';}
if ($kn_1_2==0) {$kn_1_2='';}
if ($kn_1_3==0) {$kn_1_3='';}
if ($kn_1_4==0) {$kn_1_4='';}
if ($kn_1_5==0) {$kn_1_5='';}
if ($kn_1_6==0) {$kn_1_6='';}
if ($thickness_1_1==0) {$thickness_1_1='';}
if ($thickness_1_2==0) {$thickness_1_2='';}
if ($thickness_1_3==0) {$thickness_1_3='';}
if ($thickness_1_4==0) {$thickness_1_4='';}
if ($thickness_1_5==0) {$thickness_1_5='';}
if ($thickness_1_6==0) {$thickness_1_6='';}
if ($mass_2_1==0) {$mass_2_1='';}
if ($mass_2_2==0) {$mass_2_2='';}
if ($mass_2_3==0) {$mass_2_3='';}
if ($mass_2_4==0) {$mass_2_4='';}
if ($mass_2_5==0) {$mass_2_5='';}
if ($mass_2_6==0) {$mass_2_6='';}
if ($divisions_2_1==0) {$divisions_2_1='';}
if ($divisions_2_2==0) {$divisions_2_2='';}
if ($divisions_2_3==0) {$divisions_2_3='';}
if ($divisions_2_4==0) {$divisions_2_4='';}
if ($divisions_2_5==0) {$divisions_2_5='';}
if ($divisions_2_6==0) {$divisions_2_6='';}
if ($kn_2_1==0) {$kn_2_1='';}
if ($kn_2_2==0) {$kn_2_2='';}
if ($kn_2_3==0) {$kn_2_3='';}
if ($kn_2_4==0) {$kn_2_4='';}
if ($kn_2_5==0) {$kn_2_5='';}
if ($kn_2_6==0) {$kn_2_6='';}
if ($thickness_2_1==0) {$thickness_2_1='';}
if ($thickness_2_2==0) {$thickness_2_2='';}
if ($thickness_2_3==0) {$thickness_2_3='';}
if ($thickness_2_4==0) {$thickness_2_4='';}
if ($thickness_2_5==0) {$thickness_2_5='';}
if ($thickness_2_6==0) {$thickness_2_6='';}
if ($mass_3_1==0) {$mass_3_1='';}
if ($mass_3_2==0) {$mass_3_2='';}
if ($mass_3_3==0) {$mass_3_3='';}
if ($mass_3_4==0) {$mass_3_4='';}
if ($mass_3_5==0) {$mass_3_5='';}
if ($mass_3_6==0) {$mass_3_6='';}
if ($divisions_3_1==0) {$divisions_3_1='';}
if ($divisions_3_2==0) {$divisions_3_2='';}
if ($divisions_3_3==0) {$divisions_3_3='';}
if ($divisions_3_4==0) {$divisions_3_4='';}
if ($divisions_3_5==0) {$divisions_3_5='';}
if ($divisions_3_6==0) {$divisions_3_6='';}
if ($kn_3_1==0) {$kn_3_1='';}
if ($kn_3_2==0) {$kn_3_2='';}
if ($kn_3_3==0) {$kn_3_3='';}
if ($kn_3_4==0) {$kn_3_4='';}
if ($kn_3_5==0) {$kn_3_5='';}
if ($kn_3_6==0) {$kn_3_6='';}
if ($thickness_3_1==0) {$thickness_3_1='';}
if ($thickness_3_2==0) {$thickness_3_2='';}
if ($thickness_3_3==0) {$thickness_3_3='';}
if ($thickness_3_4==0) {$thickness_3_4='';}
if ($thickness_3_5==0) {$thickness_3_5='';}
if ($thickness_3_6==0) {$thickness_3_6='';}


$c = 0;
$total = 0;
$mass_1_ave = 0;
if (($mass_1_1!=0)) {$c = $c + 1;  $total = $total + $mass_1_1;} else {$mass_1_1=''; $total = $total + 0;}
if (($mass_1_2!=0)) {$c = $c + 1;  $total = $total + $mass_1_2;} else {$mass_1_2=''; $total = $total + 0;}
if (($mass_1_3!=0)) {$c = $c + 1;  $total = $total + $mass_1_3;} else {$mass_1_3=''; $total = $total + 0;}
if (($mass_1_4!=0)) {$c = $c + 1;  $total = $total + $mass_1_4;} else {$mass_1_4=''; $total = $total + 0;}
if (($mass_1_5!=0)) {$c = $c + 1;  $total = $total + $mass_1_5;} else {$mass_1_5=''; $total = $total + 0;}
if (($mass_1_6!=0)) {$c = $c + 1;  $total = $total + $mass_1_6;} else {$mass_1_6=''; $total = $total + 0;}
if ($c!=0) {
$mass_1_ave = $total / $c;
}
else {
$mass_1_ave = 0;
}


$c = 0;
$total = 0;
$mass_2_ave = 0;
if (($mass_2_1!=0)) {$c = $c + 1;  $total = $total + $mass_2_1;} else {$mass_2_1=''; $total = $total + 0;}
if (($mass_2_2!=0)) {$c = $c + 1;  $total = $total + $mass_2_2;} else {$mass_2_2=''; $total = $total + 0;}
if (($mass_2_3!=0)) {$c = $c + 1;  $total = $total + $mass_2_3;} else {$mass_2_3=''; $total = $total + 0;}
if (($mass_2_4!=0)) {$c = $c + 1;  $total = $total + $mass_2_4;} else {$mass_2_4=''; $total = $total + 0;}
if (($mass_2_5!=0)) {$c = $c + 1;  $total = $total + $mass_2_5;} else {$mass_2_5=''; $total = $total + 0;}
if (($mass_2_6!=0)) {$c = $c + 1;  $total = $total + $mass_2_6;} else {$mass_2_6=''; $total = $total + 0;}
if ($c!=0) {
$mass_2_ave = $total / $c;
}
else {
$mass_2_ave = 0;
}

$c = 0;
$total = 0;
$mass_3_ave = 0;
if (($mass_3_1!=0)) {$c = $c + 1;  $total = $total + $mass_3_1;} else {$mass_3_1=''; $total = $total + 0;}
if (($mass_3_2!=0)) {$c = $c + 1;  $total = $total + $mass_3_2;} else {$mass_3_2=''; $total = $total + 0;}
if (($mass_3_3!=0)) {$c = $c + 1;  $total = $total + $mass_3_3;} else {$mass_3_3=''; $total = $total + 0;}
if (($mass_3_4!=0)) {$c = $c + 1;  $total = $total + $mass_3_4;} else {$mass_3_4=''; $total = $total + 0;}
if (($mass_3_5!=0)) {$c = $c + 1;  $total = $total + $mass_3_5;} else {$mass_3_5=''; $total = $total + 0;}
if (($mass_3_6!=0)) {$c = $c + 1;  $total = $total + $mass_3_6;} else {$mass_3_6=''; $total = $total + 0;}
if ($c!=0) {
$mass_3_ave = $total / $c;
}
else {
$mass_3_ave = 0;
}

$c = 0;
$total = 0;
$divisions_1_ave = 0;
if (($divisions_1_1!=0)) {$c = $c + 1;  $total = $total + $divisions_1_1;} else {$divisions_1_1=''; $total = $total + 0;}
if (($divisions_1_2!=0)) {$c = $c + 1;  $total = $total + $divisions_1_2;} else {$divisions_1_2=''; $total = $total + 0;}
if (($divisions_1_3!=0)) {$c = $c + 1;  $total = $total + $divisions_1_3;} else {$divisions_1_3=''; $total = $total + 0;}
if (($divisions_1_4!=0)) {$c = $c + 1;  $total = $total + $divisions_1_4;} else {$divisions_1_4=''; $total = $total + 0;}
if (($divisions_1_5!=0)) {$c = $c + 1;  $total = $total + $divisions_1_5;} else {$divisions_1_5=''; $total = $total + 0;}
if (($divisions_1_6!=0)) {$c = $c + 1;  $total = $total + $divisions_1_6;} else {$divisions_1_6=''; $total = $total + 0;}
if ($c!=0) {
$divisions_1_ave = $total / $c;
}
else {
$divisions_1_ave = 0;
}

$c = 0;
$total = 0;
$divisions_2_ave = 0;
if (($divisions_2_1!=0)) {$c = $c + 1;  $total = $total + $divisions_2_1;} else {$divisions_2_1=''; $total = $total + 0;}
if (($divisions_2_2!=0)) {$c = $c + 1;  $total = $total + $divisions_2_2;} else {$divisions_2_2=''; $total = $total + 0;}
if (($divisions_2_3!=0)) {$c = $c + 1;  $total = $total + $divisions_2_3;} else {$divisions_2_3=''; $total = $total + 0;}
if (($divisions_2_4!=0)) {$c = $c + 1;  $total = $total + $divisions_2_4;} else {$divisions_2_4=''; $total = $total + 0;}
if (($divisions_2_5!=0)) {$c = $c + 1;  $total = $total + $divisions_2_5;} else {$divisions_2_5=''; $total = $total + 0;}
if (($divisions_2_6!=0)) {$c = $c + 1;  $total = $total + $divisions_2_6;} else {$divisions_2_6=''; $total = $total + 0;}
if ($c!=0) {
$divisions_2_ave = $total / $c;
}
else {
$divisions_2_ave = 0;
}

$c = 0;
$total = 0;
$divisions_3_ave = 0;
if (($divisions_3_1!=0)) {$c = $c + 1;  $total = $total + $divisions_3_1;} else {$divisions_3_1=''; $total = $total + 0;}
if (($divisions_3_2!=0)) {$c = $c + 1;  $total = $total + $divisions_3_2;} else {$divisions_3_2=''; $total = $total + 0;}
if (($divisions_3_3!=0)) {$c = $c + 1;  $total = $total + $divisions_3_3;} else {$divisions_3_3=''; $total = $total + 0;}
if (($divisions_3_4!=0)) {$c = $c + 1;  $total = $total + $divisions_3_4;} else {$divisions_3_4=''; $total = $total + 0;}
if (($divisions_3_5!=0)) {$c = $c + 1;  $total = $total + $divisions_3_5;} else {$divisions_3_5=''; $total = $total + 0;}
if (($divisions_3_6!=0)) {$c = $c + 1;  $total = $total + $divisions_3_6;} else {$divisions_3_6=''; $total = $total + 0;}
if ($c!=0) {
$divisions_3_ave = $total / $c;
}
else {
$divisions_3_ave = 0;
}

$c = 0;
$total = 0;
$kn_1_ave = 0;
if (($kn_1_1!=0)) {$c = $c + 1;  $total = $total + $kn_1_1;} else {$kn_1_1=''; $total = $total + 0;}
if (($kn_1_2!=0)) {$c = $c + 1;  $total = $total + $kn_1_2;} else {$kn_1_2=''; $total = $total + 0;}
if (($kn_1_3!=0)) {$c = $c + 1;  $total = $total + $kn_1_3;} else {$kn_1_3=''; $total = $total + 0;}
if (($kn_1_4!=0)) {$c = $c + 1;  $total = $total + $kn_1_4;} else {$kn_1_4=''; $total = $total + 0;}
if (($kn_1_5!=0)) {$c = $c + 1;  $total = $total + $kn_1_5;} else {$kn_1_5=''; $total = $total + 0;}
if (($kn_1_6!=0)) {$c = $c + 1;  $total = $total + $kn_1_6;} else {$kn_1_6=''; $total = $total + 0;}
if ($c!=0) {
$kn_1_ave = $total / $c;
}
else {
$kn_1_ave = 0;
}

$c = 0;
$total = 0;
$kn_2_ave = 0;
if (($kn_2_1!=0)) {$c = $c + 1;  $total = $total + $kn_2_1;} else {$kn_2_1=''; $total = $total + 0;}
if (($kn_2_2!=0)) {$c = $c + 1;  $total = $total + $kn_2_2;} else {$kn_2_2=''; $total = $total + 0;}
if (($kn_2_3!=0)) {$c = $c + 1;  $total = $total + $kn_2_3;} else {$kn_2_3=''; $total = $total + 0;}
if (($kn_2_4!=0)) {$c = $c + 1;  $total = $total + $kn_2_4;} else {$kn_2_4=''; $total = $total + 0;}
if (($kn_2_5!=0)) {$c = $c + 1;  $total = $total + $kn_2_5;} else {$kn_2_5=''; $total = $total + 0;}
if (($kn_2_6!=0)) {$c = $c + 1;  $total = $total + $kn_2_6;} else {$kn_2_6=''; $total = $total + 0;}
if ($c!=0) {
$kn_2_ave = $total / $c;
}
else {
$kn_2_ave = 0;
}

$c = 0;
$total = 0;
$kn_3_ave = 0;
if (($kn_3_1!=0)) {$c = $c + 1;  $total = $total + $kn_3_1;} else {$kn_3_1=''; $total = $total + 0;}
if (($kn_3_2!=0)) {$c = $c + 1;  $total = $total + $kn_3_2;} else {$kn_3_2=''; $total = $total + 0;}
if (($kn_3_3!=0)) {$c = $c + 1;  $total = $total + $kn_3_3;} else {$kn_3_3=''; $total = $total + 0;}
if (($kn_3_4!=0)) {$c = $c + 1;  $total = $total + $kn_3_4;} else {$kn_3_4=''; $total = $total + 0;}
if (($kn_3_5!=0)) {$c = $c + 1;  $total = $total + $kn_3_5;} else {$kn_3_5=''; $total = $total + 0;}
if (($kn_3_6!=0)) {$c = $c + 1;  $total = $total + $kn_3_6;} else {$kn_3_6=''; $total = $total + 0;}
if ($c!=0) {
$kn_3_ave = $total / $c;
}
else {
$kn_3_ave = 0;
}

$c = 0;
$total = 0;
$thickness_1_ave = 0;
if (($thickness_1_1!=0)) {$c = $c + 1;  $total = $total + $thickness_1_1;} else {$thickness_1_1=''; $total = $total + 0;}
if (($thickness_1_2!=0)) {$c = $c + 1;  $total = $total + $thickness_1_2;} else {$thickness_1_2=''; $total = $total + 0;}
if (($thickness_1_3!=0)) {$c = $c + 1;  $total = $total + $thickness_1_3;} else {$thickness_1_3=''; $total = $total + 0;}
if (($thickness_1_4!=0)) {$c = $c + 1;  $total = $total + $thickness_1_4;} else {$thickness_1_4=''; $total = $total + 0;}
if (($thickness_1_5!=0)) {$c = $c + 1;  $total = $total + $thickness_1_5;} else {$thickness_1_5=''; $total = $total + 0;}
if (($thickness_1_6!=0)) {$c = $c + 1;  $total = $total + $thickness_1_6;} else {$thickness_1_6=''; $total = $total + 0;}
if ($c!=0) {
$thickness_1_ave = $total / $c;
}
else {
$thickness_1_ave = 0;
}

$c = 0;
$total = 0;
$thickness_2_ave = 0;
if (($thickness_2_1!=0)) {$c = $c + 1;  $total = $total + $thickness_2_1;} else {$thickness_2_1=''; $total = $total + 0;}
if (($thickness_2_2!=0)) {$c = $c + 1;  $total = $total + $thickness_2_2;} else {$thickness_2_2=''; $total = $total + 0;}
if (($thickness_2_3!=0)) {$c = $c + 1;  $total = $total + $thickness_2_3;} else {$thickness_2_3=''; $total = $total + 0;}
if (($thickness_2_4!=0)) {$c = $c + 1;  $total = $total + $thickness_2_4;} else {$thickness_2_4=''; $total = $total + 0;}
if (($thickness_2_5!=0)) {$c = $c + 1;  $total = $total + $thickness_2_5;} else {$thickness_2_5=''; $total = $total + 0;}
if (($thickness_2_6!=0)) {$c = $c + 1;  $total = $total + $thickness_2_6;} else {$thickness_2_6=''; $total = $total + 0;}
if ($c!=0) {
$thickness_2_ave = $total / $c;
}
else {
$thickness_2_ave = 0;
}

$c = 0;
$total = 0;
$thickness_3_ave = 0;
if (($thickness_3_1!=0)) {$c = $c + 1;  $total = $total + $thickness_3_1;} else {$thickness_3_1=''; $total = $total + 0;}
if (($thickness_3_2!=0)) {$c = $c + 1;  $total = $total + $thickness_3_2;} else {$thickness_3_2=''; $total = $total + 0;}
if (($thickness_3_3!=0)) {$c = $c + 1;  $total = $total + $thickness_3_3;} else {$thickness_3_3=''; $total = $total + 0;}
if (($thickness_3_4!=0)) {$c = $c + 1;  $total = $total + $thickness_3_4;} else {$thickness_3_4=''; $total = $total + 0;}
if (($thickness_3_5!=0)) {$c = $c + 1;  $total = $total + $thickness_3_5;} else {$thickness_3_5=''; $total = $total + 0;}
if (($thickness_3_6!=0)) {$c = $c + 1;  $total = $total + $thickness_3_6;} else {$thickness_3_6=''; $total = $total + 0;}
if ($c!=0) {
$thickness_3_ave = $total / $c;
}
else {
$thickness_3_ave = 0;
}

?>

</head>

<body>

<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">Dry tile inspections <?php echo $item_type ?></label></td>
            </tr>
        </table>
</div>
<br>
<br>

<div class="page_middle_frame">
<div class="page_inside_frame">
<table width="682" id="table_details_display">
  <tr>
    <td><label class="label_std" style="font-size:14px;">Report No.:</label></td>
    <td><?php echo $report_no ?></td>
    <td>Batch code:</td>
    <td width="215"><?php echo $batch_code ?>
      <input type="hidden" name="batch_code" id="batch_code" value="<?php echo $batch_code ?>"></td>
    </tr>
  <tr>
    <td>Tested by:</td>
    <td><?php echo $tested_by?>
    </span></td>
    <td>Production date:</td>
    <td><?php echo date("d-m-Y", strtotime($production_date))?>
      <input type="hidden" name="production_date" id="production_date" value="<?php echo $production_date ?>"></td>
    </tr>
  <tr>
    <td width="95">Date:</td>
    <td width="246"><?php echo date("d-m-Y", strtotime($test_date)) ?>
&nbsp;&nbsp;</td>
    <td width="106">Tile type:</td>
    <td>
       Flat <?php if ($flat_type==1) { ?> <img src="../images/check_mark_blue.png" width="16" height="16"> <?php } ?>
       &nbsp;&nbsp;&nbsp;&nbsp;
       Profiled <?php if ($profiled_type==1) { ?> <img src="../images/check_mark_blue.png" width="16" height="16"> <?php } ?>
      <br>
    </td>
  </tr>
  <tr>
    <td>Approved by:</td>
    <td><?php echo $approved_by?></td>
    <td>Colour:</td>
    <td><?php echo $colour_1?> / <?php echo $colour_2?></td>
    </tr>
  <tr>
    <td>Approve date:</td>
    <td><?php echo date("d-m-Y", strtotime($approve_date)) ?>
      <input type="hidden" name="approve_date" id="approve_date" value="<?php echo $approve_date ?>"></td>
    <td>Finish:</td>
    <td>True Colour: 
      <?php if ($true_colour==1) { ?> <img src="../images/check_mark_blue.png" width="16" height="16"> <?php } ?> 
      &nbsp;&nbsp;&nbsp;&nbsp;Antique:&nbsp;&nbsp;
      <?php if ($antique==1) { ?> <img src="../images/check_mark_blue.png" width="16" height="16"> <?php } ?></td>
  </tr>
</table>
</div>
<div class="page_inside_frame">
  <table width="689" id="table_details_display">
    <tr>
      <td width="95"><b>Requirements<br>
        BOS24:2009</b></td>
      <td colspan="2">Manufacturing<br>
        specification</td>
      <td colspan="7">Recordings</td>
      </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="2">&nbsp;</td>
      <td width="36" align="center">Tile</td>
      <td width="68" align="center">1</td>
      <td width="72" align="center">2</td>
      <td width="68" align="center">3</td>
      <td width="65" align="center">4</td>
      <td width="56" align="center">5</td>
      <td width="63" align="center">6</td>
      </tr>
    <tr>
      <td rowspan="2">Hanging lengths</td>
      <td colspan="2" rowspan="2">
      	<?php if ($item_type=='Double Roman') { echo '400 mm &plusmn;4mm'; $l_min=396; $l_max=404;} ?>
    	<?php if ($item_type=='Venetian') { echo '40 mm &plusmn;4mm'; $l_min=396; $l_max=404;} ?>
    	<?php if ($item_type=='Slate') { echo '400 mm &plusmn;4mm';} $l_min=396; $l_max=404;?>
      </td>
      <td align="center">L2</td>
      <td align="center"><?php if (($length_L2_1<$l_min)||($length_L2_1>$l_max)) { echo '<font color=red>'.$length_L2_1.'</font>'; } else { echo $length_L2_1; } ?></td>
      <td align="center"><?php if (($length_L2_2<$l_min)||($length_L2_2>$l_max)) { echo '<font color=red>'.$length_L2_2.'</font>'; } else { echo $length_L2_2; } ?></td>
      <td align="center"><?php if (($length_L2_3<$l_min)||($length_L2_3>$l_max)) { echo '<font color=red>'.$length_L2_3.'</font>'; } else { echo $length_L2_3; } ?></td>
      <td align="center"><?php if (($length_L2_4<$l_min)||($length_L2_4>$l_max)) { echo '<font color=red>'.$length_L2_4.'</font>'; } else { echo $length_L2_4; } ?></td>
      <td align="center"><?php if (($length_L2_5<$l_min)||($length_L2_5>$l_max)) { echo '<font color=red>'.$length_L2_5.'</font>'; } else { echo $length_L2_5; } ?></td>
      <td align="center"><?php if (($length_L2_6<$l_min)||($length_L2_6>$l_max)) { echo '<font color=red>'.$length_L2_6.'</font>'; } else { echo $length_L2_6; } ?></td>
      </tr>
    <tr>
      <td align="center">L3</td>
      <td align="center"><?php if (($length_L3_1<$l_min)||($length_L3_1>$l_max)) { echo '<font color=red>'.$length_L3_1.'</font>'; } else { echo $length_L3_1; } ?></td>
      <td align="center"><?php if (($length_L3_2<$l_min)||($length_L3_2>$l_max)) { echo '<font color=red>'.$length_L3_2.'</font>'; } else { echo $length_L3_2; } ?></td>
      <td align="center"><?php if (($length_L3_3<$l_min)||($length_L3_3>$l_max)) { echo '<font color=red>'.$length_L3_3.'</font>'; } else { echo $length_L3_3; } ?></td>
      <td align="center"><?php if (($length_L3_4<$l_min)||($length_L3_4>$l_max)) { echo '<font color=red>'.$length_L3_4.'</font>'; } else { echo $length_L3_4; } ?></td>
      <td align="center"><?php if (($length_L3_5<$l_min)||($length_L3_5>$l_max)) { echo '<font color=red>'.$length_L3_5.'</font>'; } else { echo $length_L3_5; } ?></td>
      <td align="center"><?php if (($length_L3_6<$l_min)||($length_L3_6>$l_max)) { echo '<font color=red>'.$length_L3_6.'</font>'; } else { echo $length_L3_6; } ?></td>
      </tr>
    <tr>
      <td>Squarness</td>
      <td colspan="2">
      	<?php if ($item_type=='Double Roman') { echo '400 mm &plusmn;4mm'; $l_min=396; $l_max=404;} ?>
    	<?php if ($item_type=='Venetian') { echo '40 mm &plusmn;4mm'; $l_min=396; $l_max=404;} ?>
    	<?php if ($item_type=='Slate') { echo '400 mm &plusmn;4mm';} $l_min=396; $l_max=404;?>
      </td>
      <td align="center">L1</td>
      <td align="center"><?php if (($length_L1_1<$l_min)||($length_L1_1>$l_max)) { echo '<font color=red>'.$length_L1_1.'</font>'; } else { echo $length_L1_1; } ?></td>
      <td align="center"><?php if (($length_L1_2<$l_min)||($length_L1_2>$l_max)) { echo '<font color=red>'.$length_L1_2.'</font>'; } else { echo $length_L1_2; } ?></td>
      <td align="center"><?php if (($length_L1_3<$l_min)||($length_L1_3>$l_max)) { echo '<font color=red>'.$length_L1_3.'</font>'; } else { echo $length_L1_3; } ?></td>
      <td align="center"><?php if (($length_L1_4<$l_min)||($length_L1_4>$l_max)) { echo '<font color=red>'.$length_L1_4.'</font>'; } else { echo $length_L1_4; } ?></td>
      <td align="center"><?php if (($length_L1_5<$l_min)||($length_L1_5>$l_max)) { echo '<font color=red>'.$length_L1_5.'</font>'; } else { echo $length_L1_5; } ?></td>
      <td align="center"><?php if (($length_L1_6<$l_min)||($length_L1_6>$l_max)) { echo '<font color=red>'.$length_L1_6.'</font>'; } else { echo $length_L1_6; } ?></td>
      </tr>
    <tr>
      <td>Flatness</td>
      <td colspan="2">3 mm max pass/fail</td>
      <td>&nbsp;</td>
      <td align="center"><?php if ($flatness_1==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($flatness_1==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($flatness_2==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($flatness_2==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($flatness_3==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($flatness_3==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($flatness_4==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($flatness_4==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($flatness_5==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($flatness_5==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($flatness_6==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($flatness_6==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      </tr>
    <tr>
      <td>Cover width</td>
      <td width="56" align="center">profiled</td>
      <td width="66" align="center">flat</td>
      <td align="center">&nbsp;</td>
      <td align="center">Prof C wc</td>
      <td align="center">Prof C wd</td>
      <td align="center">Prof C w</td>
      <td align="center">Flat C wc</td>
      <td align="center">Flat C wd</td>
      <td align="center">Flat C w</td>
      </tr>
    <tr>
      <td>&nbsp;</td>
      <td align="center">
	  <?php echo '334 mm<br>&plusmn;4mm'; if ($item_type=='Double Roman') {  $w_min=330; $w_max=338;} ?>
      <?php if ($item_type=='Venetian') {  $w_min=330; $w_max=338;} ?></td>
      <td align="center">
      <?php echo '334 mm<br>&plusmn;5mm'; if ($item_type=='Slate') {  $w_min=329; $w_max=339;} ?>
      </td>
      <td>&nbsp;</td>
      <td align="center"><?php echo $width_1;  ?></td>
      <td align="center"><?php echo $width_2;  ?></td>
      <td align="center"><?php if (($width_3<$w_min)||($width_3>$w_max)) {echo '<font color=red>'.$width_3.'</font>'; } else { echo $width_3; } ?></td>
      <td align="center"><?php echo $width_4;  ?></td>
      <td align="center"><?php echo $width_5;  ?></td>
      <td align="center"><?php if (($width_6<$w_min)||($width_6>$w_max)) {echo '<font color=red>'.$width_6.'</font>'; } else { echo $width_6; } ?></td>
      </tr>
    <tr>
      <td>Nail hole</td>
      <td colspan="2">
      <?php if ($item_type=='Double Roman') { echo '14-20 mm'; $n_min=14; $n_max=20; } ?>
      <?php if ($item_type=='Venetian') { echo '14-20 mm'; $n_min=14; $n_max=20; } ?>
	  <?php if ($item_type=='Slate') { echo '14-20 mm'; $n_min=14; $n_max=20; } ?>
      </td>
      <td>&nbsp;</td>
      <td align="center"><?php if (($nail_1<$n_min)||($nail_1>$n_max)) {echo '<font color=red>'.$nail_1.'</font>'; } else { echo $nail_1; } ?></td>
      <td align="center"><?php if (($nail_2<$n_min)||($nail_2>$n_max)) {echo '<font color=red>'.$nail_2.'</font>'; } else { echo $nail_2; } ?></td>
      <td align="center"><?php if (($nail_3<$n_min)||($nail_3>$n_max)) {echo '<font color=red>'.$nail_3.'</font>'; } else { echo $nail_3; } ?></td>
      <td align="center"><?php if (($nail_4<$n_min)||($nail_4>$n_max)) {echo '<font color=red>'.$nail_4.'</font>'; } else { echo $nail_4; } ?></td>
      <td align="center"><?php if (($nail_5<$n_min)||($nail_5>$n_max)) {echo '<font color=red>'.$nail_5.'</font>'; } else { echo $nail_5; } ?></td>
      <td align="center"><?php if (($nail_6<$n_min)||($nail_6>$n_max)) {echo '<font color=red>'.$nail_6.'</font>'; } else { echo $nail_6; } ?></td>
      </tr>
    <tr>
      <td>Rain penetration</td>
      <td colspan="2">pass/fail</td>
      <td>&nbsp;</td>
      <td align="center"><?php if ($rain_1==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($rain_1==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($rain_2==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($rain_2==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($rain_3==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($rain_3==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($rain_4==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($rain_4==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($rain_5==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($rain_5==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      <td align="center"><?php if ($rain_6==1) { ?> <img src="../images/check_mark_green.png" width="16" height="16"> <?php }; if ($rain_6==2) { ?> <img src="../images/error.png" width="16" height="16"><?php } ?></td>
      </tr>
   </table>
<br>

   <table width="686" id="table_details_display">   
    <tr>
      <td>&nbsp;</td>
      <td colspan="4" align="center">One day</td>
      <td colspan="4" align="center" style="border-left:double;">Three days</td>
      <td colspan="4" align="center" style="border-left:double;">Seven days</td>
      </tr>
    <tr>
      <td width="41" align="center">Tile</td>
      <td width="49" align="center">Mass</td>
      <td width="49" align="center">Div</td>
      <td width="49" align="center">Kn</td>
      <td width="49" align="center">Thick</td>
      <td width="49" align="center" style="border-left:double;">Mass</td>
      <td width="49" align="center">Div</td>
      <td width="49" align="center">Kn</td>
      <td width="49" align="center">Thick</td>
      <td width="49" align="center" style="border-left:double;">Mass</td>
      <td width="49" align="center">Div</td>
      <td width="49" align="center">Kn</td>
      <td width="50" align="center">Thick</td>
      </tr>
    <tr>
      <td align="center">1</td>
      <td align="center"><?php echo $mass_1_1;  ?></td>
      <td align="center"><?php echo $divisions_1_1 ?></td>
      <td align="center"><?php echo $kn_1_1 ?></td>
      <td align="center"><?php echo $thickness_1_1 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_2_1 ?></td>
      <td align="center"><?php echo $divisions_2_1 ?></td>
      <td align="center"><?php echo $kn_2_1 ?></td>
      <td align="center"><?php echo $thickness_2_1 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_3_1 ?></td>
      <td align="center"><?php echo $divisions_3_1 ?></td>
      <td align="center"><?php echo $kn_3_1 ?></td>
      <td align="center"><?php echo $thickness_3_1 ?></td>
      </tr>
    <tr>
      <td align="center">2</td>
      <td align="center"><?php echo $mass_1_2;  ?></td>
      <td align="center"><?php echo $divisions_1_2 ?></td>
      <td align="center"><?php echo $kn_1_2 ?></td>
      <td align="center"><?php echo $thickness_1_2 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_2_2 ?></td>
      <td align="center"><?php echo $divisions_2_2 ?></td>
      <td align="center"><?php echo $kn_2_2 ?></td>
      <td align="center"><?php echo $thickness_2_2 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_3_2 ?></td>
      <td align="center"><?php echo $divisions_3_2 ?></td>
      <td align="center"><?php echo $kn_3_2 ?></td>
      <td align="center"><?php echo $thickness_3_2 ?></td>
      </tr>
    <tr>
      <td align="center">3</td>
      <td align="center"><?php echo $mass_1_3; ?></td>
      <td align="center"><?php echo $divisions_1_3 ?></td>
      <td align="center"><?php echo $kn_1_3 ?></td>
      <td align="center"><?php echo $thickness_1_3 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_2_3 ?></td>
      <td align="center"><?php echo $divisions_2_3 ?></td>
      <td align="center"><?php echo $kn_2_3 ?></td>
      <td align="center"><?php echo $thickness_2_3 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_3_3 ?></td>
      <td align="center"><?php echo $divisions_3_3 ?></td>
      <td align="center"><?php echo $kn_3_3 ?></td>
      <td align="center"><?php echo $thickness_3_3 ?></td>
      </tr>
    <tr>
      <td align="center">4</td>
      <td align="center"><?php echo $mass_1_4;  ?></td>
      <td align="center"><?php echo $divisions_1_4 ?></td>
      <td align="center"><?php echo $kn_1_4 ?></td>
      <td align="center"><?php echo $thickness_1_4 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_2_4 ?></td>
      <td align="center"><?php echo $divisions_2_4 ?></td>
      <td align="center"><?php echo $kn_2_4 ?></td>
      <td align="center"><?php echo $thickness_2_4 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_3_4 ?></td>
      <td align="center"><?php echo $divisions_3_4 ?></td>
      <td align="center"><?php echo $kn_3_4 ?></td>
      <td align="center"><?php echo $thickness_3_4 ?></td>
      </tr>
    <tr>
      <td align="center">5</td>
      <td align="center"><?php echo $mass_1_5; ?></td>
      <td align="center"><?php echo $divisions_1_5 ?></td>
      <td align="center"><?php echo $kn_1_5 ?></td>
      <td align="center"><?php echo $thickness_1_5 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_2_5 ?></td>
      <td align="center"><?php echo $divisions_2_5 ?></td>
      <td align="center"><?php echo $kn_2_5 ?></td>
      <td align="center"><?php echo $thickness_2_5 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_3_5 ?></td>
      <td align="center"><?php echo $divisions_3_5 ?></td>
      <td align="center"><?php echo $kn_3_5 ?></td>
      <td align="center"><?php echo $thickness_3_5 ?></td>
      </tr>
    <tr>
      <td align="center">6</td>
      <td align="center"><?php echo $mass_1_6;  ?></td>
      <td align="center"><?php echo $divisions_1_6 ?></td>
      <td align="center"><?php echo $kn_1_6 ?></td>
      <td align="center"><?php echo $thickness_1_6 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_2_6 ?></td>
      <td align="center"><?php echo $divisions_2_6 ?></td>
      <td align="center"><?php echo $kn_2_6 ?></td>
      <td align="center"><?php echo $thickness_2_6 ?></td>
      <td align="center" style="border-left:double;"><?php echo $mass_3_6 ?></td>
      <td align="center"><?php echo $divisions_3_6 ?></td>
      <td align="center"><?php echo $kn_3_6 ?></td>
      <td align="center"><?php echo $thickness_3_6 ?></td>
      </tr>
    <tr style="background-color:#CEE0FD">
      <td align="center">Ave</td>
      <td align="center"><?php if ($mass_1_ave!=0) {echo  number_format($mass_1_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($divisions_1_ave!=0) {echo  number_format($divisions_1_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($kn_1_ave!=0) {echo  number_format($kn_1_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($thickness_1_ave!=0) {echo  number_format($thickness_1_ave, 2, '.', ',') ;} ?></td>
      <td align="center" style="border-left:double;"><?php  if ($mass_2_ave!=0) {echo number_format($mass_2_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($divisions_2_ave!=0) {echo  number_format($divisions_2_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($kn_2_ave!=0) {echo  number_format($kn_2_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($thickness_2_ave!=0) {echo  number_format($thickness_2_ave, 2, '.', ',') ;} ?></td>
      <td align="center" style="border-left:double;"><?php  if ($mass_3_ave!=0) {echo number_format($mass_3_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($divisions_3_ave!=0) {echo  number_format($divisions_3_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($kn_3_ave!=0) {echo  number_format($kn_3_ave, 2, '.', ',') ;} ?></td>
      <td align="center"><?php if ($thickness_3_ave!=0) {echo  number_format($thickness_3_ave, 2, '.', ',') ;} ?></td>
    </tr>
    <tr>
      <td colspan="13" valign="top">Profiled: Ave=5.0N Min=4.5N Mass 4.23 - 5.17&nbsp;&nbsp;&nbsp;&nbsp;Flat: Ave=4.0N Min=3.5N 
        Mass=4.68-5.72</td>
      </tr>
   </table>
</div>
<div class="page_inside_frame">
  <table width="689" id="table_details_display"> 
    <tr>
      <td width="217">Release for delivery day 1:</td>
      <td width="348"><?php echo date("d-m-Y", strtotime($release_1_date)); ?></td>
      <td width="95">&nbsp;</td>
    </tr>
    <tr>
      <td>Release for delivery day 3: </td>
      <td><?php echo date("d-m-Y", strtotime($release_3_date)); ?></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Release for delivery day 7:</td>
      <td><?php echo date("d-m-Y", strtotime($release_7_date)); ?></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td align="right">Remarks:&nbsp;&nbsp;</td>
      <td colspan="2"><?php echo $remarks ?></td>
    </tr>
  </table>
</div>
<div class="page_inside_frame">
  <table width="645" border="0">
    <tr>
      <td width="106">
       <a href="dry_tile_report_print.php?report_no=<?php echo $report_no ?>" target="_blank">
          <input name="print_button" type="button" class="imagebutton" id="print_button" value="Print"/>
      </a></td>
      <td width="529" align="right"><input name="button2" type="button" class="imagebutton" id="button2" onClick="cancel_confirmation(3, '../store/store_main.php?date=&branch=&subCatSelect=Tiles');" value="Close"/></td>
    </tr>
  </table>
</div> 
</div>
</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>