File: C:/xampp/htdocs/PSA/TVI-parsing13.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CRPC6 TVI Check</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #ffffff;
margin: 0; /* 比較好的做法是將 Body 元素的邊界與欄位間隔調整為零,以處理不同的瀏覽器預設值 */
padding: 0;
text-align: center; /* 這樣會讓容器在 IE 5* 瀏覽器內置中對齊。然後,文字會在 #container 選取器中設定為靠左對齊預設值 */
color: #000000;
}
.oneColElsCtr #container {
width: 46em;
background: #FFFFFF;
margin: 0 auto; /* 自動邊界 (搭配寬度) 會讓頁面置中對齊 */
border: 0px solid #000000;
text-align: left; /* 這樣做會覆寫 Body 元素上的 text-align: center。 */
}
.oneColElsCtr #mainContent {
padding: 0 20px; /* 請記住,欄位間隔就是 Div 方塊內部的空間,而邊界就是 Div 方塊外部的空間 */
}
-->
</style></head>
<body class="oneColElsCtr">
<?php
$sum=260;
$check=1;
$dtime=time();
$dStr=substr($dtime,7,9)."-";
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "CRPC6 TVI Checking form! (for Type 1 paper, white backing)" . "<br />";
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
$filename=$dStr.$_FILES["file"]["name"];
//echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
// echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists("upload/" .$dStr. $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ". "<br />";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" .$dStr. $_FILES["file"]["name"]);
echo "upload sucess! " . "<br />";
echo "if you see anything in ";$check=0;$sid=0;?><font color="red">RED</font><?php echo", Fix it! " . "<br />";
echo "Report start: " . "<br />";
// echo "Stored in: " . "upload/" . $_FILES["file"]["name"]. "<br />";
///parsing start
$contents = file("upload/".$dStr.$_FILES["file"]["name"]);
$string = implode($contents);
//echo $contents[20];
//echo $string;
$p = ereg_replace("\r\n?", "\n", $string);
$p = str_replace("\n", ',', $p);
//echo $p;
function get_between ($text, $s1, $s2) {
$mid_url = "";
$pos_s = strrpos($text,$s1);
$pos_e = strrpos($text,$s2);
for ( $i=$pos_s+strlen($s1) ; (( $i<($pos_e)) && $i < strlen($text)) ; $i++ ) {
$mid_url .= $text[$i];
}
return $mid_url;
}
$datastring=get_between($p,"BEGIN_DATA","END_DATA");
$dot = explode("\t", $datastring);
$Pdot=0;
$PL=$dot[6+40*$Pdot-$Pdot];
$Pa=$dot[6+40*$Pdot-$Pdot+1];
$Pb=$dot[6+40*$Pdot-$Pdot+2];
echo "CRPC6 paper: L:95, a:1, b:-4<br />";
echo "paper measured: L:".$PL.", a:".$Pa.", b:".$Pb. "<br />";
include 'lab2xyz.php';
include 'SCCA06.php';
include 'xyz2lab.php';
$RPCCl=56;$RPCCa=-37;$RPCCb=-50;
$RPCMl=48;$RPCMa=75;$RPCMb=-4;
$RPCYl=89;$RPCYa=-4;$RPCYb=93;
$RPCKl=16;$RPCKa=0.01;$RPCKb=0.01;
$Xp=lab2xyz("x",$PL,$Pa,$Pb);
$Yp=lab2xyz("y",$PL,$Pa,$Pb);
$Zp=lab2xyz("z",$PL,$Pa,$Pb);
//////////////////////////////////////////////////////////////
$RPCCX=lab2xyz("x",$RPCCl,$RPCCa,$RPCCb);
$RPCCY=lab2xyz("y",$RPCCl,$RPCCa,$RPCCb);
$RPCCZ=lab2xyz("z",$RPCCl,$RPCCa,$RPCCb);
$scCX=SCCA06("x",$RPCCX,$Xp);
$scCY=SCCA06("y",$RPCCY,$Yp);
$scCZ=SCCA06("z",$RPCCZ,$Zp);
$scCL=xyz2lab("l",$scCX,$scCY,$scCZ);
$scCa=xyz2lab("a",$scCX,$scCY,$scCZ);
$scCb=xyz2lab("b",$scCX,$scCY,$scCZ);
/////////////////////////////////////////////////////////////
$RPCMX=lab2xyz("x",$RPCMl,$RPCMa,$RPCMb);
$RPCMY=lab2xyz("y",$RPCMl,$RPCMa,$RPCMb);
$RPCMZ=lab2xyz("z",$RPCMl,$RPCMa,$RPCMb);
$scMX=SCCA06("x",$RPCMX,$Xp);
$scMY=SCCA06("y",$RPCMY,$Yp);
$scMZ=SCCA06("z",$RPCMZ,$Zp);
$scML=xyz2lab("l",$scMX,$scMY,$scMZ);
$scMa=xyz2lab("a",$scMX,$scMY,$scMZ);
$scMb=xyz2lab("b",$scMX,$scMY,$scMZ);
////////////////////////////////////////////////////////////////
$RPCYX=lab2xyz("x",$RPCYl,$RPCYa,$RPCYb);
$RPCYY=lab2xyz("y",$RPCYl,$RPCYa,$RPCYb);
$RPCYZ=lab2xyz("z",$RPCYl,$RPCYa,$RPCYb);
$scYX=SCCA06("x",$RPCYX,$Xp);
$scYY=SCCA06("y",$RPCYY,$Yp);
$scYZ=SCCA06("z",$RPCYZ,$Zp);
$scYL=xyz2lab("l",$scYX,$scYY,$scYZ);
$scYa=xyz2lab("a",$scYX,$scYY,$scYZ);
$scYb=xyz2lab("b",$scYX,$scYY,$scYZ);
////////////////////////////////////////////////////////////////////
$RPCKX=lab2xyz("x",$RPCKl,$RPCKa,$RPCKb);
$RPCKY=lab2xyz("y",$RPCKl,$RPCKa,$RPCKb);
$RPCKZ=lab2xyz("z",$RPCKl,$RPCKa,$RPCKb);
$scKX=SCCA06("x",$RPCKX,$Xp);
$scKY=SCCA06("y",$RPCKY,$Yp);
$scKZ=SCCA06("z",$RPCKZ,$Zp);
$scKL=xyz2lab("l",$scKX,$scKY,$scKZ);
$scKa=xyz2lab("a",$scKX,$scKY,$scKZ);
$scKb=xyz2lab("b",$scKX,$scKY,$scKZ);
//echo "CRPC 6 SCCA <br> Cyan L:".round($scCL,2)." a:".round($scCa,2)." b:".round($scCb,2)."<br>Magenta L:".round($scML,2)." a:".round($scMa,2)." b:".round($scMb,2)."<br>Yellow L:".round($scYL,2)." a:".round($scYa,2)." b:".round($scYb,2)."<br>Black L:".round($scKL,2)." a:".round($scKa,2)." b:".round($scKb,2). "<br />";
?>
<p><p>
<table width="200" border="1" align="center">
<tr>
<td><div align="center">主色</div></td>
<td><font color="#aaaaaa">5%</td>
<td><font color="#aaaaaa">10%</td>
<td><font color="#aaaaaa">15%</td>
<td><font color="#aaaaaa">20%</td>
<td><font color="#aaaaaa">25%</td>
<td><font color="#666666">30%</td>
<td><font color="#666666">35%</td>
<td><font color="#666666">40%</td>
<td><font color="#666666">45%</td>
<td><font color="#666666">50%</td>
<td><font color="#666666">55%</td>
<td><font color="#666666">60%</td>
<td><font color="#666666">65%</td>
<td>70%</td>
<td>75%</td>
<td>80%</td>
<td>85%</td>
<td>90%</td>
<td>95%</td>
</tr>
<?php
//////////////////////////////////////////////////Fogra Media Check
$psum=20;
// $pl=95; $pa=-0.01;$pb=-2;
$cl=$scCL; $ca=$scCa;$cb=$scCb;
$ml=$scML; $ma=$scMa;$mb=$scMb;
$yl=$scYL; $ya=$scYa;$yb=$scYb;
$kl=$scKL; $ka=$scKa;$kb=$scKb;
//$pal=$dot[312]; $paa=$dot[313];$pab=$dot[314];$pad=$dot[315];
//$Pdot=26;
//$PL=$dot[6+40*$Pdot-$Pdot];
//$Pa=$dot[6+40*$Pdot-$Pdot+1];
//$Pb=$dot[6+40*$Pdot-$Pdot+2];
//////////////////CRPC6 TVI/////////////////////////////////**
?>
<!--1287 100 0 0 0 56 -37 -50
1288 98 0 0 0 56.42 -36.56 -49.48
1289 95 0 0 0 57.19 -35.7 -48.59
1290 90 0 0 0 58.91 -33.77 -46.62
1291 85 0 0 0 60.64,-31.84,-44.65
1292 80 0 0 0 62.65 -29.61 -42.36
1293 75 0 0 0 64.69 -27.39 -40.02
1294 70 0 0 0 66.79 -25.16 -37.63
1295 60 0 0 0 71.02 -20.77 -32.75
1296 50 0 0 0 75.14 -16.63 -27.88
1297 40 0 0 0 79.15 -12.76 -23.17
1298 30 0 0 0 83.14 -9.14 -18.38
1299 25 0 0 0 85.11 -7.4 -16
1300 20 0 0 0 87.09 -5.66 -13.59
1301 15 0 0 0 88.99 -4.03 -11.27
1302 10 0 0 0 90.99 -2.33 -8.84
1303 7 0 0 0 92.18 -1.33 -7.39
1304 5 0 0 0 92.97 -0.68 -6.43
1305 3 0 0 0 93.78 -0.02 -5.45
1306 2 0 0 0 94.18 0.31 -4.95
1307 0 100 0 0 48 75 -4
1308 0 98 0 0 48.46 74.11 -4.16
1309 0 95 0 0 49.27 72.54 -4.39
1310 0 90 0 0 51.04 69.19 -4.87
1311 0 85 0 0 52.96 65.55 -5.37
1312 0 80 0 0 55.23 61.34 -5.89
1313 0 75 0 0 57.52 57.16 -6.36
1314 0 70 0 0 59.97 52.78 -6.79
1315 0 60 0 0 64.98 44.16 -7.38
1316 0 50 0 0 70.07 35.98 -7.49
1317 0 40 0 0 75.09 28.3 -7.25
1318 0 30 0 0 80.06 21.14 -6.71
1319 0 25 0 0 82.52 17.67 -6.39
1320 0 20 0 0 85.05 14.22 -5.96
1321 0 15 0 0 87.46 10.97 -5.52
1322 0 10 0 0 89.89 7.72 -5.04
1323 0 7 0 0 91.42 5.69 -4.72
1324 0 5 0 0 92.44 4.34 -4.51
1325 0 3 0 0 93.45 3.02 -4.29
1326 0 2 0 0 93.95 2.34 -4.18
1327 0 0 100 0 89 -4 93
1328 0 0 98 0 89.03 -4.01 91.57
1329 0 0 95 0 89.11 -3.98 89.15
1330 0 0 90 0 89.3 -3.94 84.28
1331 0 0 85 0 89.52 -3.89 79.22
1332 0 0 80 0 89.77 -3.8 73.57
1333 0 0 75 0 90.02 -3.7 68.06
1334 0 0 70 0 90.29 -3.55 62.44
1335 0 0 60 0 90.87 -3.24 51.71
1336 0 0 50 0 91.49 -2.75 41.34
1337 0 0 40 0 92.13 -2.16 31.6
1338 0 0 30 0 92.8 -1.48 22.4
1339 0 0 25 0 93.13 -1.11 17.92
1340 0 0 20 0 93.49 -0.71 13.36
1341 0 0 15 0 93.85 -0.3 9.13
1342 0 0 10 0 94.22 0.12 4.76
1343 0 0 7 0 94.45 0.38 2.14
1344 0 0 5 0 94.6 0.55 0.41
1345 0 0 3 0 94.76 0.72 -1.32
1346 0 0 2 0 94.83 0.8 -2.19
1347 0 0 0 100 16 0 0
1348 0 0 0 98 17.69 -0.09 -0.11
1349 0 0 0 95 20.62 0.02 -0.3
1350 0 0 0 90 25.78 0.13 -0.63
1351 0 0 0 85 30.82 0.18 -0.94
1352 0 0 0 80 35.68 0.18 -1.23
1353 0 0 0 75 40.37 0.21 -1.49
1354 0 0 0 70 44.71 0.27 -1.75
1355 0 0 0 60 52.81 0.41 -2.21
1356 0 0 0 50 60.4 0.46 -2.59
1357 0 0 0 40 67.4 0.55 -2.9
1358 0 0 0 30 74.3 0.64 -3.22
1359 0 0 0 25 77.66 0.7 -3.37
1360 0 0 0 20 81.17 0.76 -3.5
1361 0 0 0 15 84.46 0.82 -3.62
1362 0 0 0 10 87.87 0.88 -3.73
1363 0 0 0 7 89.99 0.92 -3.8
1364 0 0 0 5 91.41 0.94 -3.85
1365 0 0 0 3 92.81 0.96 -3.89
1366 0 0 0 2 93.55 0.96 -3.92
1367 0 0 0 0 95 1 -4
-->
<?php
//$TVI_c=round(($PX-$Xi)/($PX-$C100X)*100-$cmy,2);
$PX=lab2xyz("x",95,1,-4);
$PY=lab2xyz("y",95,1,-4);
$PZ=lab2xyz("z",95,1,-4);
$RC100X=lab2xyz("x",56,-37,-50);
$RC100Y=lab2xyz("y",56,-37,-50);
$RC100Z=lab2xyz("z",56,-37,-50);
$RM100X=lab2xyz("x",48,75,-4);
$RM100Y=lab2xyz("y",48,75,-4);
$RM100Z=lab2xyz("z",48,75,-4);
$RY100X=lab2xyz("x",89,-4,93);
$RY100Y=lab2xyz("y",89,-4,93);
$RY100Z=lab2xyz("z",89,-4,93);
$RK100X=lab2xyz("x",16,0.01,0.01);
$RK100Y=lab2xyz("y",16,0.01,0.01);
$RK100Z=lab2xyz("z",16,0.01,0.01);
/////////////////////////////////////////////////////////
$RTVIc5x=lab2xyz("x",92.97,-0.68,-6.43);
$RTVIc5y=lab2xyz("y",92.97,-0.68,-6.43);
$RTVIc5z=lab2xyz("z",92.97,-0.68,-6.43);
$RTVIc10x=lab2xyz("x",90.99,-2.33,-8.84);
$RTVIc10y=lab2xyz("y",90.99,-2.33,-8.84);
$RTVIc10z=lab2xyz("z",90.99,-2.33,-8.84);
$RTVIc15x=lab2xyz("x",88.99,-4.03,-11.27);
$RTVIc15y=lab2xyz("y",88.99,-4.03,-11.27);
$RTVIc15z=lab2xyz("z",88.99,-4.03,-11.27);
$RTVIc20x=lab2xyz("x",87.09,-5.66,-13.59);
$RTVIc20y=lab2xyz("y",87.09,-5.66,-13.59);
$RTVIc20z=lab2xyz("z",87.09,-5.66,-13.59);
$RTVIc25x=lab2xyz("x",85.11,-7.4,-16);
$RTVIc25y=lab2xyz("y",85.11,-7.4,-16);
$RTVIc25z=lab2xyz("z",85.11,-7.4,-16);
$RTVIc30x=lab2xyz("x",83.14,-9.14,-18.38);
$RTVIc30y=lab2xyz("y",83.14,-9.14,-18.38);
$RTVIc30z=lab2xyz("z",83.14,-9.14,-18.38);
$RTVIc40x=lab2xyz("x",79.15,-12.76,-23.17);
$RTVIc40y=lab2xyz("y",79.15,-12.76,-23.17);
$RTVIc40z=lab2xyz("z",79.15,-12.76,-23.17);
$RTVIc50x=lab2xyz("x",75.14,-16.63,-27.88);
$RTVIc50y=lab2xyz("y",75.14,-16.63,-27.88);
$RTVIc50z=lab2xyz("z",75.14,-16.63,-27.88);
$RTVIc60x=lab2xyz("x",71.02,-20.77,-32.75);
$RTVIc60y=lab2xyz("y",71.02,-20.77,-32.75);
$RTVIc60z=lab2xyz("z",71.02,-20.77,-32.75);
$RTVIc70x=lab2xyz("x",66.79,-25.16,-37.63);
$RTVIc70y=lab2xyz("y",66.79,-25.16,-37.63);
$RTVIc70z=lab2xyz("z",66.79,-25.16,-37.63);
$RTVIc75x=lab2xyz("x",64.69,-27.39,-40.02);
$RTVIc75y=lab2xyz("y",64.69,-27.39,-40.02);
$RTVIc75z=lab2xyz("z",64.69,-27.39,-40.02);
$RTVIc80x=lab2xyz("x",62.65,-29.61,-42.36);
$RTVIc80y=lab2xyz("y",62.65,-29.61,-42.36);
$RTVIc80z=lab2xyz("z",62.65,-29.61,-42.36);
$RTVIc85x=lab2xyz("x",60.64,-31.84,-44.65);
$RTVIc85y=lab2xyz("y",60.64,-31.84,-44.65);
$RTVIc85z=lab2xyz("z",60.64,-31.84,-44.65);
$RTVIc90x=lab2xyz("x",58.91,-33.77,-46.62);
$RTVIc90y=lab2xyz("y",58.91,-33.77,-46.62);
$RTVIc90z=lab2xyz("z",58.91,-33.77,-46.62);
$RTVIc95x=lab2xyz("x",57.19,-35.7,-48.59);
$RTVIc95y=lab2xyz("y",57.19,-35.7,-48.59);
$RTVIc95z=lab2xyz("z",57.19,-35.7,-48.59);
////////////////////////////////////////////////////////////
$RTVIc5=((($PX-0.55*$PZ)-($RTVIc5x-0.55*$RTVIc5z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc10=((($PX-0.55*$PZ)-($RTVIc10x-0.55*$RTVIc10z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc15=((($PX-0.55*$PZ)-($RTVIc15x-0.55*$RTVIc15z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc20=((($PX-0.55*$PZ)-($RTVIc20x-0.55*$RTVIc20z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc25=((($PX-0.55*$PZ)-($RTVIc25x-0.55*$RTVIc25z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc30=((($PX-0.55*$PZ)-($RTVIc30x-0.55*$RTVIc30z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc40=((($PX-0.55*$PZ)-($RTVIc40x-0.55*$RTVIc40z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc50=((($PX-0.55*$PZ)-($RTVIc50x-0.55*$RTVIc50z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc60=((($PX-0.55*$PZ)-($RTVIc60x-0.55*$RTVIc60z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc70=((($PX-0.55*$PZ)-($RTVIc70x-0.55*$RTVIc70z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc75=((($PX-0.55*$PZ)-($RTVIc75x-0.55*$RTVIc75z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc80=((($PX-0.55*$PZ)-($RTVIc80x-0.55*$RTVIc80z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc85=((($PX-0.55*$PZ)-($RTVIc85x-0.55*$RTVIc85z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc90=((($PX-0.55*$PZ)-($RTVIc90x-0.55*$RTVIc90z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
$RTVIc95=((($PX-0.55*$PZ)-($RTVIc95x-0.55*$RTVIc95z))/(($PX-0.55*$PZ)-($RC100X-0.55*$RC100Z)))*100;
//////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
$RTVIm5x=lab2xyz("x",92.44,4.34,-4.51);
$RTVIm5y=lab2xyz("y",92.44,4.34,-4.51);
$RTVIm5z=lab2xyz("z",92.44,4.34,-4.51);
$RTVIm10x=lab2xyz("x",89.89,7.72,-5.04);
$RTVIm10y=lab2xyz("y",89.89,7.72,-5.04);
$RTVIm10z=lab2xyz("z",89.89,7.72,-5.04);
$RTVIm15x=lab2xyz("x",87.46,10.97,-5.52);
$RTVIm15y=lab2xyz("y",87.46,10.97,-5.52);
$RTVIm15z=lab2xyz("z",87.46,10.97,-5.52);
$RTVIm20x=lab2xyz("x",85.05,14.22,-5.96);
$RTVIm20y=lab2xyz("y",85.05,14.22,-5.96);
$RTVIm20z=lab2xyz("z",85.05,14.22,-5.96);
$RTVIm25x=lab2xyz("x",82.52,17.67,-6.39);
$RTVIm25y=lab2xyz("y",82.52,17.67,-6.39);
$RTVIm25z=lab2xyz("z",82.52,17.67,-6.39);
$RTVIm30x=lab2xyz("x",80.06,21.14,-6.71);
$RTVIm30y=lab2xyz("y",80.06,21.14,-6.71);
$RTVIm30z=lab2xyz("z",80.06,21.14,-6.71);
$RTVIm40x=lab2xyz("x",75.09,28.3,-7.25);
$RTVIm40y=lab2xyz("y",75.09,28.3,-7.25);
$RTVIm40z=lab2xyz("z",75.09,28.3,-7.25);
$RTVIm50x=lab2xyz("x",70.07,35.98,-7.49);
$RTVIm50y=lab2xyz("y",70.07,35.98,-7.49);
$RTVIm50z=lab2xyz("z",70.07,35.98,-7.49);
$RTVIm60x=lab2xyz("x",64.98,44.16,-7.38);
$RTVIm60y=lab2xyz("y",64.98,44.16,-7.38);
$RTVIm60z=lab2xyz("z",64.98,44.16,-7.38);
$RTVIm70x=lab2xyz("x",59.97,52.78,-6.79);
$RTVIm70y=lab2xyz("y",59.97,52.78,-6.79);
$RTVIm70z=lab2xyz("z",59.97,52.78,-6.79);
$RTVIm75x=lab2xyz("x",57.52,57.16,-6.36);
$RTVIm75y=lab2xyz("y",57.52,57.16,-6.36);
$RTVIm75z=lab2xyz("z",57.52,57.16,-6.36);
$RTVIm80x=lab2xyz("x",55.23,61.34,-5.89);
$RTVIm80y=lab2xyz("y",55.23,61.34,-5.89);
$RTVIm80z=lab2xyz("z",55.23,61.34,-5.89);
$RTVIm85x=lab2xyz("x",52.96,65.55,-5.37);
$RTVIm85y=lab2xyz("y",52.96,65.55,-5.37);
$RTVIm85z=lab2xyz("z",52.96,65.55,-5.37);
$RTVIm90x=lab2xyz("x",51.04,69.19,-4.87);
$RTVIm90y=lab2xyz("y",51.04,69.19,-4.87);
$RTVIm90z=lab2xyz("z",51.04,69.19,-4.87);
$RTVIm95x=lab2xyz("x",49.27,72.54,-4.39);
$RTVIm95y=lab2xyz("y",49.27,72.54,-4.39);
$RTVIm95z=lab2xyz("z",49.27,72.54,-4.39);
////////////////////////////////////////////////////////////
$RTVIm5=((($PX-0.55*$PZ)-($RTVIm5x-0.55*$RTVIm5z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm10=((($PX-0.55*$PZ)-($RTVIm10x-0.55*$RTVIm10z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm15=((($PX-0.55*$PZ)-($RTVIm15x-0.55*$RTVIm15z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm20=((($PX-0.55*$PZ)-($RTVIm20x-0.55*$RTVIm20z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm25=((($PX-0.55*$PZ)-($RTVIm25x-0.55*$RTVIm25z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm30=((($PX-0.55*$PZ)-($RTVIm30x-0.55*$RTVIm30z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm40=((($PX-0.55*$PZ)-($RTVIm40x-0.55*$RTVIm40z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm50=((($PX-0.55*$PZ)-($RTVIm50x-0.55*$RTVIm50z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm60=((($PX-0.55*$PZ)-($RTVIm60x-0.55*$RTVIm60z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm70=((($PX-0.55*$PZ)-($RTVIm70x-0.55*$RTVIm70z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm75=((($PX-0.55*$PZ)-($RTVIm75x-0.55*$RTVIm75z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm80=((($PX-0.55*$PZ)-($RTVIm80x-0.55*$RTVIm80z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm85=((($PX-0.55*$PZ)-($RTVIm85x-0.55*$RTVIm85z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm90=((($PX-0.55*$PZ)-($RTVIm90x-0.55*$RTVIm90z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
$RTVIm95=((($PX-0.55*$PZ)-($RTVIm95x-0.55*$RTVIm95z))/(($PX-0.55*$PZ)-($RM100X-0.55*$RM100Z)))*100;
//////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
$RTVIy5x=lab2xyz("x",94.6,0.55,0.41);
$RTVIy5y=lab2xyz("y",94.6,0.55,0.41);
$RTVIy5z=lab2xyz("z",94.6,0.55,0.41);
$RTVIy10x=lab2xyz("x",94.22,0.12,4.76);
$RTVIy10y=lab2xyz("y",94.22,0.12,4.76);
$RTVIy10z=lab2xyz("z",94.22,0.12,4.76);
$RTVIy15x=lab2xyz("x",93.85,-0.3,9.13);
$RTVIy15y=lab2xyz("y",93.85,-0.3,9.13);
$RTVIy15z=lab2xyz("z",93.85,-0.3,9.13);
$RTVIy20x=lab2xyz("x",93.49,-0.71,13.36);
$RTVIy20y=lab2xyz("y",93.49,-0.71,13.36);
$RTVIy20z=lab2xyz("z",93.49,-0.71,13.36);
$RTVIy25x=lab2xyz("x",93.13,-1.11,17.92);
$RTVIy25y=lab2xyz("y",93.13,-1.11,17.92);
$RTVIy25z=lab2xyz("z",93.13,-1.11,17.92);
$RTVIy30x=lab2xyz("x",92.8,-1.48,22.4);
$RTVIy30y=lab2xyz("y",92.8,-1.48,22.4);
$RTVIy30z=lab2xyz("z",92.8,-1.48,22.4);
$RTVIy40x=lab2xyz("x",92.13,-2.16,31.6);
$RTVIy40y=lab2xyz("y",92.13,-2.16,31.6);
$RTVIy40z=lab2xyz("z",92.13,-2.16,31.6);
$RTVIy50x=lab2xyz("x",91.49,-2.75,41.34);
$RTVIy50y=lab2xyz("y",91.49,-2.75,41.34);
$RTVIy50z=lab2xyz("z",91.49,-2.75,41.34);
$RTVIy60x=lab2xyz("x",90.87,-3.24,51.71);
$RTVIy60y=lab2xyz("y",90.87,-3.24,51.71);
$RTVIy60z=lab2xyz("z",90.87,-3.24,51.71);
$RTVIy70x=lab2xyz("x",90.29,-3.55,62.44);
$RTVIy70y=lab2xyz("y",90.29,-3.55,62.44);
$RTVIy70z=lab2xyz("z",90.29,-3.55,62.44);
$RTVIy75x=lab2xyz("x",90.02,-3.7,68.06);
$RTVIy75y=lab2xyz("y",90.02,-3.7,68.06);
$RTVIy75z=lab2xyz("z",90.02,-3.7,68.06);
$RTVIy80x=lab2xyz("x",89.77,-3.8,73.57);
$RTVIy80y=lab2xyz("y",89.77,-3.8,73.57);
$RTVIy80z=lab2xyz("z",89.77,-3.8,73.57);
$RTVIy85x=lab2xyz("x",89.52,-3.89,79.22);
$RTVIy85y=lab2xyz("y",89.52,-3.89,79.22);
$RTVIy85z=lab2xyz("z",89.52,-3.89,79.22);
$RTVIy90x=lab2xyz("x",89.3,-3.94,84.28);
$RTVIy90y=lab2xyz("y",89.3,-3.94,84.28);
$RTVIy90z=lab2xyz("z",89.3,-3.94,84.28);
$RTVIy95x=lab2xyz("x",89.11,-3.98,89.15);
$RTVIy95y=lab2xyz("y",89.11,-3.98,89.15);
$RTVIy95z=lab2xyz("z",89.11,-3.98,89.15);
////////////////////////////////////////////////////////////
$RTVIy5=((($PX-0.55*$PZ)-($RTVIy5x-0.55*$RTVIy5z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy10=((($PX-0.55*$PZ)-($RTVIy10x-0.55*$RTVIy10z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy15=((($PX-0.55*$PZ)-($RTVIy15x-0.55*$RTVIy15z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy20=((($PX-0.55*$PZ)-($RTVIy20x-0.55*$RTVIy20z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy25=((($PX-0.55*$PZ)-($RTVIy25x-0.55*$RTVIy25z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy30=((($PX-0.55*$PZ)-($RTVIy30x-0.55*$RTVIy30z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy40=((($PX-0.55*$PZ)-($RTVIy40x-0.55*$RTVIy40z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy50=((($PX-0.55*$PZ)-($RTVIy50x-0.55*$RTVIy50z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy60=((($PX-0.55*$PZ)-($RTVIy60x-0.55*$RTVIy60z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy70=((($PX-0.55*$PZ)-($RTVIy70x-0.55*$RTVIy70z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy75=((($PX-0.55*$PZ)-($RTVIy75x-0.55*$RTVIy75z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy80=((($PX-0.55*$PZ)-($RTVIy80x-0.55*$RTVIy80z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy85=((($PX-0.55*$PZ)-($RTVIy85x-0.55*$RTVIy85z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy90=((($PX-0.55*$PZ)-($RTVIy90x-0.55*$RTVIy90z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
$RTVIy95=((($PX-0.55*$PZ)-($RTVIy95x-0.55*$RTVIy95z))/(($PX-0.55*$PZ)-($RY100X-0.55*$RY100Z)))*100;
//////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
$RTVIk5x=lab2xyz("x",91.41,0.94,-3.85);
$RTVIk5y=lab2xyz("y",91.41,0.94,-3.85);
$RTVIk5z=lab2xyz("z",91.41,0.94,-3.85);
$RTVIk10x=lab2xyz("x",87.87,0.88,-3.73);
$RTVIk10y=lab2xyz("y",87.87,0.88,-3.73);
$RTVIk10z=lab2xyz("z",87.87,0.88,-3.73);
$RTVIk15x=lab2xyz("x",84.46,0.82,-3.62);
$RTVIk15y=lab2xyz("y",84.46,0.82,-3.62);
$RTVIk15z=lab2xyz("z",84.46,0.82,-3.62);
$RTVIk20x=lab2xyz("x",81.17,0.76,-3.5);
$RTVIk20y=lab2xyz("y",81.17,0.76,-3.5);
$RTVIk20z=lab2xyz("z",81.17,0.76,-3.5);
$RTVIk25x=lab2xyz("x",77.66,0.7,-3.37);
$RTVIk25y=lab2xyz("y",77.66,0.7,-3.37);
$RTVIk25z=lab2xyz("z",77.66,0.7,-3.37);
$RTVIk30x=lab2xyz("x",74.3,0.64,-3.22);
$RTVIk30y=lab2xyz("y",74.3,0.64,-3.22);
$RTVIk30z=lab2xyz("z",74.3,0.64,-3.22);
$RTVIk40x=lab2xyz("x",67.4,0.55,-2.9);
$RTVIk40y=lab2xyz("y",67.4,0.55,-2.9);
$RTVIk40z=lab2xyz("z",67.4,0.55,-2.9);
$RTVIk50x=lab2xyz("x",60.4,0.46,-2.59);
$RTVIk50y=lab2xyz("y",60.4,0.46,-2.59);
$RTVIk50z=lab2xyz("z",60.4,0.46,-2.59);
$RTVIk60x=lab2xyz("x",52.81,0.41,-2.21);
$RTVIk60y=lab2xyz("y",52.81,0.41,-2.21);
$RTVIk60z=lab2xyz("z",52.81,0.41,-2.21);
$RTVIk70x=lab2xyz("x",44.71,0.27,-1.75);
$RTVIk70y=lab2xyz("y",44.71,0.27,-1.75);
$RTVIk70z=lab2xyz("z",44.71,0.27,-1.75);
$RTVIk75x=lab2xyz("x",40.37,0.21,-1.49);
$RTVIk75y=lab2xyz("y",40.37,0.21,-1.49);
$RTVIk75z=lab2xyz("z",40.37,0.21,-1.49);
$RTVIk80x=lab2xyz("x",35.68,0.18,-1.23);
$RTVIk80y=lab2xyz("y",35.68,0.18,-1.23);
$RTVIk80z=lab2xyz("z",35.68,0.18,-1.23);
$RTVIk85x=lab2xyz("x",30.82,0.18,-0.94);
$RTVIk85y=lab2xyz("y",30.82,0.18,-0.94);
$RTVIk85z=lab2xyz("z",30.82,0.18,-0.94);
$RTVIk90x=lab2xyz("x",25.78,0.13,-0.63);
$RTVIk90y=lab2xyz("y",25.78,0.13,-0.63);
$RTVIk90z=lab2xyz("z",25.78,0.13,-0.63);
$RTVIk95x=lab2xyz("x",20.62,0.02,-0.3);
$RTVIk95y=lab2xyz("y",20.62,0.02,-0.3);
$RTVIk95z=lab2xyz("z",20.62,0.02,-0.3);
////////////////////////////////////////////////////////////
$RTVIk5=((($PX-0.55*$PZ)-($RTVIk5x-0.55*$RTVIk5z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk10=((($PX-0.55*$PZ)-($RTVIk10x-0.55*$RTVIk10z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk15=((($PX-0.55*$PZ)-($RTVIk15x-0.55*$RTVIk15z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk20=((($PX-0.55*$PZ)-($RTVIk20x-0.55*$RTVIk20z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk25=((($PX-0.55*$PZ)-($RTVIk25x-0.55*$RTVIk25z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk30=((($PX-0.55*$PZ)-($RTVIk30x-0.55*$RTVIk30z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk40=((($PX-0.55*$PZ)-($RTVIk40x-0.55*$RTVIk40z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk50=((($PX-0.55*$PZ)-($RTVIk50x-0.55*$RTVIk50z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk60=((($PX-0.55*$PZ)-($RTVIk60x-0.55*$RTVIk60z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk70=((($PX-0.55*$PZ)-($RTVIk70x-0.55*$RTVIk70z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk75=((($PX-0.55*$PZ)-($RTVIk75x-0.55*$RTVIk75z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk80=((($PX-0.55*$PZ)-($RTVIk80x-0.55*$RTVIk80z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk85=((($PX-0.55*$PZ)-($RTVIk85x-0.55*$RTVIk85z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk90=((($PX-0.55*$PZ)-($RTVIk90x-0.55*$RTVIk90z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
$RTVIk95=((($PX-0.55*$PZ)-($RTVIk95x-0.55*$RTVIk95z))/(($PX-0.55*$PZ)-($RK100X-0.55*$RK100Z)))*100;
//////////////////////////////////////////////////////////////////////////////////////////////////////
for ( $i = 1; $i <= 19; $i += 1) {
$Pdot=$i; ${'c'.($i*5).'l'}=$dot[6+40*$Pdot-$Pdot];${'c'.($i*5).'a'}=$dot[6+40*$Pdot-$Pdot+1];${'c'.($i*5).'b'}=$dot[6+40*$Pdot-$Pdot+2];}
for ( $i = 22; $i <= 40; $i += 1) {
$Pdot=$i;$j=$i-21; ${'m'.($j*5).'l'}=$dot[6+40*$Pdot-$Pdot];${'m'.($j*5).'a'}=$dot[6+40*$Pdot-$Pdot+1];${'m'.($j*5).'b'}=$dot[6+40*$Pdot-$Pdot+2];}
for ( $i = 43; $i <= 61; $i += 1) {
$Pdot=$i;$j=$i-42; ${'y'.($j*5).'l'}=$dot[6+40*$Pdot-$Pdot];${'y'.($j*5).'a'}=$dot[6+40*$Pdot-$Pdot+1];${'y'.($j*5).'b'}=$dot[6+40*$Pdot-$Pdot+2];}
for ( $i = 64; $i <= 82; $i += 1) {
$Pdot=$i;$j=$i-63; ${'k'.($j*5).'l'}=$dot[6+40*$Pdot-$Pdot];${'k'.($j*5).'a'}=$dot[6+40*$Pdot-$Pdot+1];${'k'.($j*5).'b'}=$dot[6+40*$Pdot-$Pdot+2];}
$TVIk5x=lab2xyz("x",$c5l,$c5a,$c5b);
$TVIk5y=lab2xyz("y",$c5l,$c5b,$c5b);
$TVIc95zz=lab2xyz("z",$c95l,$c95a,$c95b);
for ( $t = 5; $t <= 95; $t += 5) {
${'TVIc'.($t).'x'}=lab2xyz("x",${'c'.$t.'l'},${'c'.$t.'a'},${'c'.$t.'b'});
${'TVIc'.($t).'y'}=lab2xyz("y",${'c'.$t.'l'},${'c'.$t.'a'},${'c'.$t.'b'});
${'TVIc'.($t).'z'}=lab2xyz("z",${'c'.$t.'l'},${'c'.$t.'a'},${'c'.$t.'b'});
}
for ( $t = 5; $t <= 95; $t += 5) {
${'TVIm'.($t).'x'}=lab2xyz("x",${'m'.$t.'l'},${'m'.$t.'a'},${'m'.$t.'b'});
${'TVIm'.($t).'y'}=lab2xyz("y",${'m'.$t.'l'},${'m'.$t.'a'},${'m'.$t.'b'});
${'TVIm'.($t).'z'}=lab2xyz("z",${'m'.$t.'l'},${'m'.$t.'a'},${'m'.$t.'b'});
}
for ( $t = 5; $t <= 95; $t += 5) {
${'TVIy'.($t).'x'}=lab2xyz("x",${'y'.$t.'l'},${'y'.$t.'a'},${'y'.$t.'b'});
${'TVIy'.($t).'y'}=lab2xyz("y",${'y'.$t.'l'},${'y'.$t.'a'},${'y'.$t.'b'});
${'TVIy'.($t).'z'}=lab2xyz("z",${'y'.$t.'l'},${'y'.$t.'a'},${'y'.$t.'b'});
}
for ( $t = 5; $t <= 95; $t += 5) {
${'TVIk'.($t).'x'}=lab2xyz("x",${'k'.$t.'l'},${'k'.$t.'a'},${'k'.$t.'b'});
${'TVIk'.($t).'y'}=lab2xyz("y",${'k'.$t.'l'},${'k'.$t.'a'},${'k'.$t.'b'});
${'TVIk'.($t).'z'}=lab2xyz("z",${'k'.$t.'l'},${'k'.$t.'a'},${'k'.$t.'b'});
}
$Pdot=20; $c100l=$dot[6+40*$Pdot-$Pdot]; $c100a=$dot[6+40*$Pdot-$Pdot+1];$c100b=$dot[6+40*$Pdot-$Pdot+2];
$Pdot=41; $m100l=$dot[6+40*$Pdot-$Pdot]; $m100a=$dot[6+40*$Pdot-$Pdot+1];$m100b=$dot[6+40*$Pdot-$Pdot+2];
$Pdot=62; $y100l=$dot[6+40*$Pdot-$Pdot]; $y100a=$dot[6+40*$Pdot-$Pdot+1];$y100b=$dot[6+40*$Pdot-$Pdot+2];
$Pdot=83; $k100l=$dot[6+40*$Pdot-$Pdot]; $k100a=$dot[6+40*$Pdot-$Pdot+1];$k100b=$dot[6+40*$Pdot-$Pdot+2];
$C100X=lab2xyz("x",$c100l,$c100a,$c100b);
$C100Y=lab2xyz("y",$c100l,$c100a,$c100b);
$C100Z=lab2xyz("z",$c100l,$c100a,$c100b);
$M100X=lab2xyz("x",$m100l,$m100a,$m100b);
$M100Y=lab2xyz("y",$m100l,$m100a,$m100b);
$M100Z=lab2xyz("z",$m100l,$m100a,$m100b);
$Y100X=lab2xyz("x",$y100l,$y100a,$y100b);
$Y100Y=lab2xyz("y",$y100l,$y100a,$y100b);
$Y100Z=lab2xyz("z",$y100l,$y100a,$y100b);
$K100X=lab2xyz("x",$k100l,$k100a,$k100b);
$K100Y=lab2xyz("y",$k100l,$k100a,$k100b);
$K100Z=lab2xyz("z",$k100l,$k100a,$k100b);
$TVIc5s=((($Xp-0.55*$Zp)-($TVIc5x-0.55*$TVIc5z))/(($Xp-0.55*$Zp)-($C100X-0.55*$C100Z)))*100;
for ( $t = 5; $t <= 95; $t += 5) {
${'TVIc'.$t}=((($Xp-0.55*$Zp)-(${'TVIc'.$t.'x'}-0.55*${'TVIc'.$t.'z'}))/(($Xp-0.55*$Zp)-($C100X-0.55*$C100Z)))*100;
}
for ( $t = 5; $t <= 95; $t += 5) {
${'TVIm'.$t}=((($Xp-0.55*$Zp)-(${'TVIm'.$t.'x'}-0.55*${'TVIm'.$t.'z'}))/(($Xp-0.55*$Zp)-($M100X-0.55*$M100Z)))*100;
}
for ( $t = 5; $t <= 95; $t += 5) {
${'TVIy'.$t}=((($Xp-0.55*$Zp)-(${'TVIy'.$t.'x'}-0.55*${'TVIy'.$t.'z'}))/(($Xp-0.55*$Zp)-($Y100X-0.55*$Y100Z)))*100;
}
for ( $t = 5; $t <= 95; $t += 5) {
${'TVIk'.$t}=((($Xp-0.55*$Zp)-(${'TVIk'.$t.'x'}-0.55*${'TVIk'.$t.'z'}))/(($Xp-0.55*$Zp)-($K100X-0.55*$K100Z)))*100;
}
//echo "c5x=".$TVIc95z."y:".$RTVIc10."zz:".$TVIc10;
?>
<tr>
<td bgcolor="#bbFFFF"><div align="center">C</div></td>
<?php //////////////////////////////////////////C
for ( $t = 5; $t <= 95; $t += 5) {
//
?><td bgcolor="#bbFFFF"><div align="right"><?php
if ($t==35) {$rounddv=0;}
elseif ($t==45) {$rounddv=0;}
elseif ($t==55) {$rounddv=0;}
elseif ($t==65) {$rounddv=0;}
else {$rounddv=${'TVIc'.$t}-${'RTVIc'.$t};}
if ($t<=25 and abs($rounddv)>3.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
elseif ($t>25 and abs($rounddv)>4.5){
$check=1;$sum=$sum-abs($rounddv);;?><font color="red"><div align="right"><?php
}
elseif ($t>65 and abs($rounddv)>3.5){
$check=1;$sum=$sum-abs($rounddv);;?><font color="red"><div align="right"><?php
}
echo round($rounddv,2);
$sum=$sum-abs($rounddv);
?> </td><?php
}
?>
</tr>
<tr>
<td bgcolor="#FFccFF"><div align="center">M</div></td>
<?php //////////////////////////////////////////////M
for ( $t = 5; $t <= 95; $t += 5) {
//
?><td bgcolor="#FFccFF"><div align="right"><?php
if ($t==35) {$rounddv=0;}
elseif ($t==45) {$rounddv=0;}
elseif ($t==55) {$rounddv=0;}
elseif ($t==65) {$rounddv=0;}
else {$rounddv=${'TVIm'.$t}-${'RTVIm'.$t};}
if ($t<=25 and abs($rounddv)>3.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
elseif ($t>25 and abs($rounddv)>4.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
elseif ($t>65 and abs($rounddv)>3.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
echo round($rounddv,2);
$sum=$sum-abs($rounddv);
?> </td><?php
}
?>
</tr>
<tr>
<td bgcolor="#FFFFbb"><div align="center">Y</div></td>
<?php //////////////////////////////////////////////M
for ( $t = 5; $t <= 95; $t += 5) {
//
?><td bgcolor="#FFFFbb"><div align="right"><?php
if ($t==35) {$rounddv=0;}
elseif ($t==45) {$rounddv=0;}
elseif ($t==55) {$rounddv=0;}
elseif ($t==65) {$rounddv=0;}
else {$rounddv=${'TVIy'.$t}-${'RTVIy'.$t};}
if ($t<=25 and abs($rounddv)>3.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
elseif ($t>25 and abs($rounddv)>4.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
elseif ($t>65 and abs($rounddv)>3.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
echo round($rounddv,2);
$sum=$sum-abs($rounddv);
?> </td><?php
}
?>
</tr>
<tr>
<td bgcolor="#DDDDDD"><div align="center">K</div></td>
<?php //////////////////////////////////////////////M
for ( $t = 5; $t <= 95; $t += 5) {
//
?><td bgcolor="#DDDDDD"><div align="right"><?php
if ($t==35) {$rounddv=0;}
elseif ($t==45) {$rounddv=0;}
elseif ($t==55) {$rounddv=0;}
elseif ($t==65) {$rounddv=0;}
else {$rounddv=${'TVIk'.$t}-${'RTVIk'.$t};}
if ($t<=25 and abs($rounddv)>3.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
elseif ($t>25 and abs($rounddv)>4.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
elseif ($t>65 and abs($rounddv)>3.5){
$check=1;$sum=$sum-abs($rounddv);?><font color="red"><div align="right"><?php
}
echo round($rounddv,2);
$sum=$sum-abs($rounddv);
?> </td><?php
}
?>
</tr>
<?php
include 'dE00.php';
$pa00=de00(95,1,-4,$PL,$Pa,$Pb);
$dc00=de00($cl,$ca,$cb,$c100l,$c100a,$c100b);
$dm00=de00($ml,$ma,$mb,$m100l,$m100a,$m100b);
$dy00=de00($yl,$ya,$yb,$y100l,$y100a,$y100b);
$dk00=de00($kl,$ka,$kb,$k100l,$k100a,$k100b);
?>
<tr><td><div align="center">W</div></td>
<td><div align="right">95</div></td>
<td><div align="right">1</div></td>
<td><div align="right">-4</div></td>
<td><div align="center"></div></td>
<td><div align="right"><?php echo $PL;?></div></td>
<td><div align="right"><?php echo $Pa;?></div></td>
<td><div align="right"><?php echo $Pb;?></div></td>
<td><div align="right"><?php echo round($pa00,2);?></div></td></tr>
<tr><td bgcolor="#bbFFFF"><div align="center">C</div></td>
<td bgcolor="#bbFFFF"><div align="right"><?php echo round($cl,2);?></div></td>
<td bgcolor="#bbFFFF"><div align="right"><?php echo round($ca,2);?></div></td>
<td bgcolor="#bbFFFF"><div align="right"><?php echo round($cb,2);?></div></td>
<td bgcolor="#bbFFFF"><div align="center"></div></td>
<td bgcolor="#bbFFFF"><div align="right"><?php echo $c100l;?></div></td>
<td bgcolor="#bbFFFF"><div align="right"><?php echo $c100a;?></div></td>
<td bgcolor="#bbFFFF"><div align="right"><?php echo $c100b;?></div></td>
<td bgcolor="#bbFFFF"><div align="right"><?php if ($dc00>5) {$sid=1;?><font color="red"><?php }
echo round($dc00,2);$psum=$psum-$dc00;?></div></td></tr>
<tr><td bgcolor="#FFccFF"><div align="center">M</div></td>
<td bgcolor="#FFccFF"><div align="right"><?php echo round($ml,2);?></div></td>
<td bgcolor="#FFccFF"><div align="right"><?php echo round($ma,2);?></div></td>
<td bgcolor="#FFccFF"><div align="right"><?php echo round($mb,2);?></div></td>
<td bgcolor="#FFccFF"><div align="center"></div></td>
<td bgcolor="#FFccFF"><div align="right"><?php echo $m100l;?></div></td>
<td bgcolor="#FFccFF"><div align="right"><?php echo $m100a;?></div></td>
<td bgcolor="#FFccFF"><div align="right"><?php echo $m100b;?></div></td>
<td bgcolor="#FFccFF"><div align="right"><?php if ($dm00>5) {$sid=1;?><font color="red"><?php }
echo round($dm00,2);$psum=$psum-$dm00;?></div></td></tr>
<tr><td bgcolor="#FFFFbb"><div align="center">Y</div></td>
<td bgcolor="#FFFFbb"><div align="right"><?php echo round($yl,2);?></div></td>
<td bgcolor="#FFFFbb"><div align="right"><?php echo round($ya,2);?></div></td>
<td bgcolor="#FFFFbb"><div align="right"><?php echo round($yb,2);?></div></td>
<td bgcolor="#FFFFbb"><div align="center"></div></td>
<td bgcolor="#FFFFbb"><div align="right"><?php echo $y100l;?></div></td>
<td bgcolor="#FFFFbb"><div align="right"><?php echo $y100a;?></div></td>
<td bgcolor="#FFFFbb"><div align="right"><?php echo $y100b;?></div></td>
<td bgcolor="#FFFFbb"><div align="right"><?php if ($dy00>5) {$sid=1;?><font color="red"><?php }
echo round($dy00,2);$psum=$psum-$dy00;?></div></td></tr>
<tr><td bgcolor="#DDDDDD"><div align="center">K</div></td>
<td bgcolor="#DDDDDD"><div align="right"><?php echo round($kl,2);?></div></td>
<td bgcolor="#DDDDDD"><div align="right"><?php echo round($ka,2);?></div></td>
<td bgcolor="#DDDDDD"><div align="right"><?php echo round($kb,2);?></div></td>
<td bgcolor="#DDDDDD"><div align="center"></div></td>
<td bgcolor="#DDDDDD"><div align="right"><?php echo $k100l;?></div></td>
<td bgcolor="#DDDDDD"><div align="right"><?php echo $k100a;?></div></td>
<td bgcolor="#DDDDDD"><div align="right"><?php echo $k100b;?></div></td>
<td bgcolor="#DDDDDD"><div align="right"><?php if ($dk00>5) {$sid=1;?><font color="red"><?php }
echo round($dk00,2);$psum=$psum-$dk00;?></div></td></tr>
</table>
<table width="200" border="1" align="center">
<tr>
<td><div align="center">
<?php
include 'graphFixC.php';
GenGraphC(round($TVIc5,2)-5,round($TVIc10,2)-10,round($TVIc15,2)-15,round($TVIc20,2)-20,round($TVIc25,2)-25,round($TVIc30,2)-30,0.01,round($TVIc40,2)-40,0.01,round($TVIc50,2)-50,0.01,round($TVIc60,2)-60,0.01,round($TVIc70,2)-70,round($TVIc75,2)-75,round($TVIc80,2)-80,round($TVIc85,2)-85,round($TVIc90,2)-90,round($TVIc95,2)-95,round($RTVIc5,2)-5,round($RTVIc10,2)-10,round($RTVIc15,2)-15,round($RTVIc20,2)-20,round($RTVIc25,2)-25,round($RTVIc30,2)-30,0.01,round($RTVIc40,2)-40,0.01,round($RTVIc50,2)-50,0.01,round($RTVIc60,2)-60,0.01,round($RTVIc70,2)-70,round($RTVIc75,2)-75,round($RTVIc80,2)-80,round($RTVIc85,2)-85,round($RTVIc90,2)-90,round($RTVIc95,2)-95);
?>
<img src="graphC.gif">
</div>
</table>
<table>
<div>
<?php
include 'graphFixM.php';
GenGraphM(round($TVIm5,2)-5,round($TVIm10,2)-10,round($TVIm15,2)-15,round($TVIm20,2)-20,round($TVIm25,2)-25,round($TVIm30,2)-30,0.01,round($TVIm40,2)-40,0.01,round($TVIm50,2)-50,0.01,round($TVIm60,2)-60,0.01,round($TVIm70,2)-70,round($TVIm75,2)-75,round($TVIm80,2)-80,round($TVIm85,2)-85,round($TVIm90,2)-90,round($TVIm95,2)-95,round($RTVIm5,2)-5,round($RTVIm10,2)-10,round($RTVIm15,2)-15,round($RTVIm20,2)-20,round($RTVIm25,2)-25,round($RTVIm30,2)-30,0.01,round($RTVIm40,2)-40,0.01,round($RTVIm50,2)-50,0.01,round($RTVIm60,2)-60,0.01,round($RTVIm70,2)-70,round($RTVIm75,2)-75,round($RTVIm80,2)-80,round($RTVIm85,2)-85,round($RTVIm90,2)-90,round($RTVIm95,2)-95);
?>
<img src="graphM.gif">
</div>
</table>
<table>
<div>
<?php
include 'graphFixY.php';
GenGraphY(round($TVIy5,2)-5,round($TVIy10,2)-10,round($TVIy15,2)-15,round($TVIy20,2)-20,round($TVIy25,2)-25,round($TVIy30,2)-30,0.01,round($TVIy40,2)-40,0.01,round($TVIy50,2)-50,0.01,round($TVIy60,2)-60,0.01,round($TVIy70,2)-70,round($TVIy75,2)-75,round($TVIy80,2)-80,round($TVIy85,2)-85,round($TVIy90,2)-90,round($TVIy95,2)-95,round($RTVIy5,2)-5,round($RTVIy10,2)-10,round($RTVIy15,2)-15,round($RTVIy20,2)-20,round($RTVIy25,2)-25,round($RTVIy30,2)-30,0.01,round($RTVIy40,2)-40,0.01,round($RTVIy50,2)-50,0.01,round($RTVIy60,2)-60,0.01,round($RTVIy70,2)-70,round($RTVIy75,2)-75,round($RTVIy80,2)-80,round($RTVIy85,2)-85,round($RTVIy90,2)-90,round($RTVIy95,2)-95);
?>
<img src="graphY.gif">
</div>
</table>
<table>
<div>
<?php
include 'graphFixK.php';
GenGraphK(round($TVIk5,2)-5,round($TVIk10,2)-10,round($TVIk15,2)-15,round($TVIk20,2)-20,round($TVIk25,2)-25,round($TVIk30,2)-30,0.01,round($TVIk40,2)-40,0.01,round($TVIk50,2)-50,0.01,round($TVIk60,2)-60,0.01,round($TVIk70,2)-70,round($TVIk75,2)-75,round($TVIk80,2)-80,round($TVIk85,2)-85,round($TVIk90,2)-90,round($TVIk95,2)-95,round($RTVIk5,2)-5,round($RTVIk10,2)-10,round($RTVIk15,2)-15,round($RTVIk20,2)-20,round($RTVIk25,2)-25,round($RTVIk30,2)-30,0.01,round($RTVIk40,2)-40,0.01,round($RTVIk50,2)-50,0.01,round($RTVIk60,2)-60,0.01,round($RTVIk70,2)-70,round($RTVIk75,2)-75,round($RTVIk80,2)-80,round($RTVIk85,2)-85,round($RTVIk90,2)-90,round($RTVIk95,2)-95);
?>
<img src="graphK.gif">
</div>
</table>
<?php
$Tsum=(($sum/260)*60)+(($psum/20)*40);
$Rsum=round($Tsum,2);
if (($check==0) && ($sid==0)){
$passbit=1;}
$connection = mysql_connect("127.0.0.1", "root", "fredsql") or die ("Unable to connect!");
mysql_query("SET NAMES 'utf8'");
$db = "tvicheck-st";
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "INSERT INTO PSATVI(company, contact, email, type, filename, score, passbit, date, device, dsn, printer, paper, ink, rankbit) VALUES('$company', '$contact', '$email', '$type', '$filename','$Rsum', '$passbit', NOW(), '$device', '$dsn', '$printer', '$paper', '$ink', '$rankbit')";
//echo $query;
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
mysql_close($connection);
}} ?>
<tr>
<td align="center">TVI Score=<?php echo round($sum,2);?></a><br>
</td>
</tr>
<tr>
<td align="center">Primaries color score=<?php echo round($psum,2);?></a><br>
</td>
</tr>
<tr>
<td align="center">Total score=<?php echo round($Tsum,2);?></a><br>
</td>
</tr>
<tr>
<td align="center"> <a href="rank.php">Report</a><br>
</td>
<td align="center"> <a href="index.htm">MainPage</a><br>
</td>
</tr
<tr>
<td align="center"><font size="-2"> © <a href="mailto:[email protected]">Fred Kuo</a>, 2014. All rights reserved.<br><a href="http://www.fredkuo.idv.tw/wordpress/?p=1025">Read more.</a><br>
</td>
</tr>
</body>
</html>