File: C:/xampp/htdocs/FograCT1/FWspotTransOVX.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>Control-9 Check</title>
<style type="text/css">
body,td,th {
font-size: 12px;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.ssss {
font-size: 12px;
color: #F00;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-style: 0;
border-right-style: 0;
border-bottom-style: 0;
border-left-style: 0;
}
.z {
color: #CCC;
}
.SS {
color: #F00;
}
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 方塊外部的空間 */
}aph
</style></head>
<body class="oneColElsCtr">
<body class="oneColElsCtr">
<head><h1> 特別色 分析報告</h1> </head>
<?php
error_reporting(0);
$f123= $_GET['f123'];
$f321= $_GET['f321'];
$color1= $_GET['color1'];
$po= $_GET['po'];
$company= $_GET['company'];
$sn= $_GET['sn'];
$filename=substr($f321,7,60);
include 'sp38XYZ.php';
include 'lab2xyz.php';
include 'xyz2lab01.php';
include 'xyz2lab.php';
include 'de00.php';
include 'DensityV38.php';
$contentT = file($f321);
$stringT = implode($contentT);
//echo $contents[20];
//echo $stringT;
$pp = str_replace("\r\n", " ", $stringT);
//$pp = str_replace("\r\n", " ", $pp);
$dotTx = explode("_", $pp);////Measure upload
//print_r ($dotTx);
foreach ($dotTx as $value) {
$dotT[] = $value * 0.01;
}
//print_r ($dotT);
function DensitySp38S($V,$s1,$s2,$s3,$s4,$s5,$s6,$s7,$s8,$s9,$s10,$s11,$s12,$s13,$s14,$s15,$s16,$s17,$s18,$s19,$s20,$s21,$s22,$s23,$s24,$s25,$s26,$s27,$s28,$s29,$s30,$s31,$s32,$s33,$s34,$s35,$s36,$ft0,$ft1, $ft2, $ft3, $ft4, $ft5, $ft6, $ft7, $ft8, $ft9, $ft10, $ft11, $ft12, $ft13, $ft14, $ft15, $ft16, $ft17, $ft18, $ft19, $ft20, $ft21, $ft22, $ft23, $ft24, $ft25, $ft26, $ft27, $ft28, $ft29, $ft30, $ft31, $ft32, $ft33, $ft34, $ft35) {
$values=array("34" => 0.0,"35" => 0.0,"36" => 0.0,"37" => 0.0,"38" => $s1,"39" =>$s2,"40" => $s3,"41" => $s4,"42" => $s5,"43" => $s6,"44" => $s7,"45" => $s8,"46" => $s9,"47" => $s10,"48" => $s11,"49" => $s12,"50" => $s13,"51" => $s14,"52" => $s15,"53" => $s16,"54" => $s17,"55" => $s18,"56" => $s19,"57" => $s20,"58" => $s21,"59" => $s22,"60" => $s23,"61" => $s24,"62" => $s25,"63" => $s26,"64" => $s27,"65" => $s28,"66" => $s29,"67" => $s30,"68" => $s31,"69" => $s32,"70" => $s33, "71" => $s34,"72" => $s35,"73" => $s36,"74" => 0.0,"75" => 0.0,"76" => 0.0,"77" => 0.0,"78" => 0.0,"79" => 0.0,"80" => 0.0,"81" => 0.0,"82" => 0.0,"83" => 0.0);
$SpectraU=array(0,0,0,0,$ft0,$ft1, $ft2, $ft3, $ft4, $ft5, $ft6, $ft7, $ft8, $ft9, $ft10, $ft11, $ft12, $ft13, $ft14, $ft15, $ft16, $ft17, $ft18, $ft19, $ft20, $ft21, $ft22, $ft23, $ft24, $ft25, $ft26, $ft27, $ft28, $ft29, $ft30, $ft31, $ft32, $ft33, $ft34, $ft35);
//-LOG10(SUMPRODUCT(AZ2:AZ51,AV2:AV51)/SUM(AV2:AV51)) =-LOG10(SUMPRODUCT(Sample,TT)/SUM(Den_StatusT_R))
$sPSum=0;
$sProduct=0;
if ($V=="U") {
for ( $i = 34; $i <= 83; $i += 1) {
$sProduct=$values[$i]*$SpectraU[$i-34];
$sPSum=$sProduct+$sPSum;}
$sumV=array_sum($SpectraU);}
//$sumduct=$values[40];
$den=-log10($sPSum/($sumV));
return round($den,4);
}
$S0Xm=sp38XYZ("X",0,0,$dotT[-1+1],$dotT[-1+2],$dotT[-1+3],$dotT[-1+4],$dotT[-1+5],$dotT[-1+6],$dotT[-1+7],$dotT[-1+8],$dotT[-1+9],$dotT[-1+10],$dotT[-1+11],$dotT[-1+12],$dotT[-1+13],$dotT[-1+14],$dotT[-1+15],$dotT[-1+16],$dotT[-1+17],$dotT[-1+18],$dotT[-1+19],$dotT[-1+20],$dotT[-1+21],$dotT[-1+22],$dotT[-1+23],$dotT[-1+24],$dotT[-1+25],$dotT[-1+26],$dotT[-1+27],$dotT[-1+28],$dotT[-1+29],$dotT[-1+30],$dotT[-1+31],0,0,0);
$S0Ym=sp38XYZ("Y",0,0,$dotT[-1+1],$dotT[-1+2],$dotT[-1+3],$dotT[-1+4],$dotT[-1+5],$dotT[-1+6],$dotT[-1+7],$dotT[-1+8],$dotT[-1+9],$dotT[-1+10],$dotT[-1+11],$dotT[-1+12],$dotT[-1+13],$dotT[-1+14],$dotT[-1+15],$dotT[-1+16],$dotT[-1+17],$dotT[-1+18],$dotT[-1+19],$dotT[-1+20],$dotT[-1+21],$dotT[-1+22],$dotT[-1+23],$dotT[-1+24],$dotT[-1+25],$dotT[-1+26],$dotT[-1+27],$dotT[-1+28],$dotT[-1+29],$dotT[-1+30],$dotT[-1+31],0,0,0);
$S0Zm=sp38XYZ("Z",0,0,$dotT[-1+1],$dotT[-1+2],$dotT[-1+3],$dotT[-1+4],$dotT[-1+5],$dotT[-1+6],$dotT[-1+7],$dotT[-1+8],$dotT[-1+9],$dotT[-1+10],$dotT[-1+11],$dotT[-1+12],$dotT[-1+13],$dotT[-1+14],$dotT[-1+15],$dotT[-1+16],$dotT[-1+17],$dotT[-1+18],$dotT[-1+19],$dotT[-1+20],$dotT[-1+21],$dotT[-1+22],$dotT[-1+23],$dotT[-1+24],$dotT[-1+25],$dotT[-1+26],$dotT[-1+27],$dotT[-1+28],$dotT[-1+29],$dotT[-1+30],$dotT[-1+31],0,0,0);
$S0Lm=xyz2lab01("l",$S0Xm,$S0Ym,$S0Zm);
$S0am=xyz2lab01("a",$S0Xm,$S0Ym,$S0Zm);
$S0bm=xyz2lab01("b",$S0Xm,$S0Ym,$S0Zm);
$avalues=array($dotT[-1+1],$dotT[-1+2],$dotT[-1+3],$dotT[-1+4],$dotT[-1+5],$dotT[-1+6],$dotT[-1+7],$dotT[-1+8],$dotT[-1+9],$dotT[-1+10],$dotT[-1+11],$dotT[-1+12],$dotT[-1+13],$dotT[-1+14],$dotT[-1+15],$dotT[-1+16],$dotT[-1+17],$dotT[-1+18],$dotT[-1+19],$dotT[-1+20],$dotT[-1+21],$dotT[-1+22],$dotT[-1+23],$dotT[-1+24],$dotT[-1+25],$dotT[-1+26],$dotT[-1+27],$dotT[-1+28],$dotT[-1+29],$dotT[-1+30],$dotT[-1+31]);
$min = min($avalues);
$index = array_search($min, $avalues);
$index=$index+2;
//echo "<br>min Check:".$index."<br>";
$nm=380+$index*10;
//$index=$index+1;
$f0=0;$f1=0;$f2=0;$f3=0;$f4=0;$f5=0;$f6=0;$f7=0;$f8=0;$f9=0;$f10=0;$f11=0;$f12=0;$f13=0;$f14=0;$f15=0;$f16=0;$f17=0;$f18=0;$f19=0;$f20=0;$f21=0;$f22=0;$f23=0;$f24=0;$f25=0;$f26=0;$f27=0;$f28=0;$f29=0;$f30=0;$f31=0;$f32=0;$f33=0;$f34=0;$f35=0;$f36=0;
${'f'.$index}=14.0388;
//echo "index" .$index."_".$nm;
$stdSum=($dotT[-1+1]+$dotT[-1+2]+$dotT[-1+3]+$dotT[-1+4]+$dotT[-1+5]+$dotT[-1+6]+$dotT[-1+7]+$dotT[-1+8]+$dotT[-1+9]+$dotT[-1+10]+$dotT[-1+11]+$dotT[-1+12]+$dotT[-1+13]+$dotT[-1+14]+$dotT[-1+15]+$dotT[-1+16]+$dotT[-1+17]+$dotT[-1+18]+$dotT[-1+19]+$dotT[-1+20]+$dotT[-1+21]+$dotT[-1+22]+$dotT[-1+23]+$dotT[-1+24]+$dotT[-1+25]+$dotT[-1+26]+$dotT[-1+27]+$dotT[-1+28]+$dotT[-1+29]+$dotT[-1+30]+$dotT[-1+31]);
//echo "stdSum:".$stdSum;
$S0d=DensitySp38S("U",0,0,$dotT[-1+1],$dotT[-1+2],$dotT[-1+3],$dotT[-1+4],$dotT[-1+5],$dotT[-1+6],$dotT[-1+7],$dotT[-1+8],$dotT[-1+9],$dotT[-1+10],$dotT[-1+11],$dotT[-1+12],$dotT[-1+13],$dotT[-1+14],$dotT[-1+15],$dotT[-1+16],$dotT[-1+17],$dotT[-1+18],$dotT[-1+19],$dotT[-1+20],$dotT[-1+21],$dotT[-1+22],$dotT[-1+23],$dotT[-1+24],$dotT[-1+25],$dotT[-1+26],$dotT[-1+27],$dotT[-1+28],$dotT[-1+29],$dotT[-1+30],$dotT[-1+31],0,0,0,$f0,$f1, $f2, $f3, $f4, $f5, $f6, $f7, $f8, $f9, $f10, $f11, $f12, $f13, $f14, $f15, $f16, $f17, $f18, $f19, $f20, $f21, $f22, $f23, $f24, $f25, $f26, $f27, $f28, $f29, $f30, $f31, $f32, $f33, $f34, $f35);
//echo "<br>s0d:".$S0d;
$S1Xm=sp38XYZ("X",0,0,$dotT[30+1],$dotT[30+2],$dotT[30+3],$dotT[30+4],$dotT[30+5],$dotT[30+6],$dotT[30+7],$dotT[30+8],$dotT[30+9],$dotT[30+10],$dotT[30+11],$dotT[30+12],$dotT[30+13],$dotT[30+14],$dotT[30+15],$dotT[30+16],$dotT[30+17],$dotT[30+18],$dotT[30+19],$dotT[30+20],$dotT[30+21],$dotT[30+22],$dotT[30+23],$dotT[30+24],$dotT[30+25],$dotT[30+26],$dotT[30+27],$dotT[30+28],$dotT[30+29],$dotT[30+30],$dotT[30+31],0,0,0);
$S1Ym=sp38XYZ("Y",0,0,$dotT[30+1],$dotT[30+2],$dotT[30+3],$dotT[30+4],$dotT[30+5],$dotT[30+6],$dotT[30+7],$dotT[30+8],$dotT[30+9],$dotT[30+10],$dotT[30+11],$dotT[30+12],$dotT[30+13],$dotT[30+14],$dotT[30+15],$dotT[30+16],$dotT[30+17],$dotT[30+18],$dotT[30+19],$dotT[30+20],$dotT[30+21],$dotT[30+22],$dotT[30+23],$dotT[30+24],$dotT[30+25],$dotT[30+26],$dotT[30+27],$dotT[30+28],$dotT[30+29],$dotT[30+30],$dotT[30+31],0,0,0);
$S1Zm=sp38XYZ("Z",0,0,$dotT[30+1],$dotT[30+2],$dotT[30+3],$dotT[30+4],$dotT[30+5],$dotT[30+6],$dotT[30+7],$dotT[30+8],$dotT[30+9],$dotT[30+10],$dotT[30+11],$dotT[30+12],$dotT[30+13],$dotT[30+14],$dotT[30+15],$dotT[30+16],$dotT[30+17],$dotT[30+18],$dotT[30+19],$dotT[30+20],$dotT[30+21],$dotT[30+22],$dotT[30+23],$dotT[30+24],$dotT[30+25],$dotT[30+26],$dotT[30+27],$dotT[30+28],$dotT[30+29],$dotT[30+30],$dotT[30+31],0,0,0);
$S1Lm=xyz2lab01("l",$S1Xm,$S1Ym,$S1Zm);
$S1am=xyz2lab01("a",$S1Xm,$S1Ym,$S1Zm);
$S1bm=xyz2lab01("b",$S1Xm,$S1Ym,$S1Zm);
$upSum=($dotT[30+1]+$dotT[30+2]+$dotT[30+3]+$dotT[30+4]+$dotT[30+5]+$dotT[30+6]+$dotT[30+7]+$dotT[30+8]+$dotT[30+9]+$dotT[30+10]+$dotT[30+11]+$dotT[30+12]+$dotT[30+13]+$dotT[30+14]+$dotT[30+15]+$dotT[30+16]+$dotT[30+17]+$dotT[30+18]+$dotT[30+19]+$dotT[30+20]+$dotT[30+21]+$dotT[30+22]+$dotT[30+23]+$dotT[30+24]+$dotT[30+25]+$dotT[30+26]+$dotT[30+27]+$dotT[30+28]+$dotT[30+29]+$dotT[30+30]+$dotT[30+31]);
//echo "upSum:".$upSum;
$S1d=DensitySp38S("U",0,0,$dotT[30+1],$dotT[30+2],$dotT[30+3],$dotT[30+4],$dotT[30+5],$dotT[30+6],$dotT[30+7],$dotT[30+8],$dotT[30+9],$dotT[30+10],$dotT[30+11],$dotT[30+12],$dotT[30+13],$dotT[30+14],$dotT[30+15],$dotT[30+16],$dotT[30+17],$dotT[30+18],$dotT[30+19],$dotT[30+20],$dotT[30+21],$dotT[30+22],$dotT[30+23],$dotT[30+24],$dotT[30+25],$dotT[30+26],$dotT[30+27],$dotT[30+28],$dotT[30+29],$dotT[30+30],$dotT[30+31],0,0,0,$f0,$f1, $f2, $f3, $f4, $f5, $f6, $f7, $f8, $f9, $f10, $f11, $f12, $f13, $f14, $f15, $f16, $f17, $f18, $f19, $f20, $f21, $f22, $f23, $f24, $f25, $f26, $f27, $f28, $f29, $f30, $f31, $f32, $f33, $f34, $f35);
//echo "<br>s1d:".$S1d;
$S2Xm=sp38XYZ("X",0,0,$dotT[61+1],$dotT[61+2],$dotT[61+3],$dotT[61+4],$dotT[61+5],$dotT[61+6],$dotT[61+7],$dotT[61+8],$dotT[61+9],$dotT[61+10],$dotT[61+11],$dotT[61+12],$dotT[61+13],$dotT[61+14],$dotT[61+15],$dotT[61+16],$dotT[61+17],$dotT[61+18],$dotT[61+19],$dotT[61+20],$dotT[61+21],$dotT[61+22],$dotT[61+23],$dotT[61+24],$dotT[61+25],$dotT[61+26],$dotT[61+27],$dotT[61+28],$dotT[61+29],$dotT[61+30],$dotT[61+31],0,0,0);
$S2Ym=sp38XYZ("Y",0,0,$dotT[61+1],$dotT[61+2],$dotT[61+3],$dotT[61+4],$dotT[61+5],$dotT[61+6],$dotT[61+7],$dotT[61+8],$dotT[61+9],$dotT[61+10],$dotT[61+11],$dotT[61+12],$dotT[61+13],$dotT[61+14],$dotT[61+15],$dotT[61+16],$dotT[61+17],$dotT[61+18],$dotT[61+19],$dotT[61+20],$dotT[61+21],$dotT[61+22],$dotT[61+23],$dotT[61+24],$dotT[61+25],$dotT[61+26],$dotT[61+27],$dotT[61+28],$dotT[61+29],$dotT[61+30],$dotT[61+31],0,0,0);
$S2Zm=sp38XYZ("Z",0,0,$dotT[61+1],$dotT[61+2],$dotT[61+3],$dotT[61+4],$dotT[61+5],$dotT[61+6],$dotT[61+7],$dotT[61+8],$dotT[61+9],$dotT[61+10],$dotT[61+11],$dotT[61+12],$dotT[61+13],$dotT[61+14],$dotT[61+15],$dotT[61+16],$dotT[61+17],$dotT[61+18],$dotT[61+19],$dotT[61+20],$dotT[61+21],$dotT[61+22],$dotT[61+23],$dotT[61+24],$dotT[61+25],$dotT[61+26],$dotT[61+27],$dotT[61+28],$dotT[61+29],$dotT[61+30],$dotT[61+31],0,0,0);
$S2Lm=xyz2lab01("l",$S2Xm,$S2Ym,$S2Zm);
$S2am=xyz2lab01("a",$S2Xm,$S2Ym,$S2Zm);
$S2bm=xyz2lab01("b",$S2Xm,$S2Ym,$S2Zm);
$LoSum=($dotT[61+1]+$dotT[61+2]+$dotT[61+3]+$dotT[61+4]+$dotT[61+5]+$dotT[61+6]+$dotT[61+7]+$dotT[61+8]+$dotT[61+9]+$dotT[61+10]+$dotT[61+11]+$dotT[61+12]+$dotT[61+13]+$dotT[61+14]+$dotT[61+15]+$dotT[61+16]+$dotT[61+17]+$dotT[61+18]+$dotT[61+19]+$dotT[61+20]+$dotT[61+21]+$dotT[61+22]+$dotT[61+23]+$dotT[61+24]+$dotT[61+25]+$dotT[61+26]+$dotT[61+27]+$dotT[61+28]+$dotT[61+29]+$dotT[61+30]+$dotT[61+31]);
//echo "LoSum:".$LoSum;
$S2d=DensitySp38S("U",0,0,$dotT[61+1],$dotT[61+2],$dotT[61+3],$dotT[61+4],$dotT[61+5],$dotT[61+6],$dotT[61+7],$dotT[61+8],$dotT[61+9],$dotT[61+10],$dotT[61+11],$dotT[61+12],$dotT[61+13],$dotT[61+14],$dotT[61+15],$dotT[61+16],$dotT[61+17],$dotT[61+18],$dotT[61+19],$dotT[61+20],$dotT[61+21],$dotT[61+22],$dotT[61+23],$dotT[61+24],$dotT[61+25],$dotT[61+26],$dotT[61+27],$dotT[61+28],$dotT[61+29],$dotT[61+30],$dotT[61+31],0,0,0,$f0,$f1, $f2, $f3, $f4, $f5, $f6, $f7, $f8, $f9, $f10, $f11, $f12, $f13, $f14, $f15, $f16, $f17, $f18, $f19, $f20, $f21, $f22, $f23, $f24, $f25, $f26, $f27, $f28, $f29, $f30, $f31, $f32, $f33, $f34, $f35);
//echo "<br>s2d:".$S2d;
/* $S0Xm=lab2xyz("x",$dotT[6],$dotT[7],$dotT[8])
$S0Ym=lab2xyz("y",$dotT[6],$dotT[7],$dotT[8])
$S0Zm=lab2xyz("z",$dotT[6],$dotT[7],$dotT[8]) */
function RGBToHex($r, $g, $b) {
//String padding bug found and the solution put forth by Pete Williams (http://snipplr.com/users/PeteW)
$hex = "#";
$hex.= str_pad(dechex($r), 2, "0", STR_PAD_LEFT);
$hex.= str_pad(dechex($g), 2, "0", STR_PAD_LEFT);
$hex.= str_pad(dechex($b), 2, "0", STR_PAD_LEFT);
return $hex;
}
function cieXYZtoSRGB($X, $Y, $Z) {
// Normalize XYZ values
$X /= 1.0;
$Y /= 1.0;
$Z /= 1.0;
// Linear transformation from XYZ to RGB
$R = $X * 3.2406 + $Y * -1.5372 + $Z * -0.4986;
$G = $X * -0.9689 + $Y * 1.8758 + $Z * 0.0415;
$B = $X * 0.0557 + $Y * -0.2040 + $Z * 1.0570;
// Compensate for out-of-range RGB values
$R = ($R > 0.0031308) ? (1.055 * pow($R, (1 / 2.4)) - 0.055) : (12.92 * $R);
$G = ($G > 0.0031308) ? (1.055 * pow($G, (1 / 2.4)) - 0.055) : (12.92 * $G);
$B = ($B > 0.0031308) ? (1.055 * pow($B, (1 / 2.4)) - 0.055) : (12.92 * $B);
// Clamp RGB values to [0, 1] range
$R = max(0, min(1, $R));
$G = max(0, min(1, $G));
$B = max(0, min(1, $B));
// Scale to 8-bit sRGB values
$R = round($R * 255);
$G = round($G * 255);
$B = round($B * 255);
// Return sRGB color array
return [$R, $G, $B];
}
// Example usage
$cieXYZ = [$S0Xm, $S0Ym, $S0Zm]; // Example CIE XYZ values
$sRGB = cieXYZtoSRGB($cieXYZ[0], $cieXYZ[1], $cieXYZ[2]);
//echo "sRGB: R={$sRGB[0]}, G={$sRGB[1]}, B={$sRGB[2]}";
$sR = $sRGB[0];
$sG = $sRGB[1];
$sB = $sRGB[2];
$ch1C4=RGBToHex($sR,$sG,$sB);
$ch1C4s=substr($ch1C4,1);
//echo "_hex 252:".$ch1C4;
$cieXYZ = [$S1Xm, $S1Ym, $S1Zm]; // Example CIE XYZ values
$sRGB = cieXYZtoSRGB($cieXYZ[0], $cieXYZ[1], $cieXYZ[2]);
//echo "sRGB: R={$sRGB[0]}, G={$sRGB[1]}, B={$sRGB[2]}";
$sR = $sRGB[0];
$sG = $sRGB[1];
$sB = $sRGB[2];
$ch1C3=RGBToHex($sR,$sG,$sB);
$ch1C3s=substr($ch1C3,1);
echo "_hex 261:".$ch1C3;
echo "_hex 262:".$ch1C3s;
$cieXYZ = [$S2Xm, $S2Ym, $S2Zm]; // Example CIE XYZ values
$sRGB = cieXYZtoSRGB($cieXYZ[0], $cieXYZ[1], $cieXYZ[2]);
//echo "sRGB: R={$sRGB[0]}, G={$sRGB[1]}, B={$sRGB[2]}";
$sR = $sRGB[0];
$sG = $sRGB[1];
$sB = $sRGB[2];
$ch1C5=RGBToHex($sR,$sG,$sB);
$ch1C5s=substr($ch1C5,1);
//echo "_hex 270:".$ch1C5;
//echo "_hex:".$ch1C5;
$deUp=round(de00($S0Lm,$S0am,$S0bm,$S1Lm,$S1am,$S1bm),2);
$deLo=round(de00($S1Lm,$S1am,$S1bm,$S2Lm,$S2am,$S2bm),2);
?>
<table width="600" align="center">
<tr>
<td>印號:<?php echo $po?></td>
</tr>
</table>
<table width="600" border="1" align="center">
<tr>
<td><?php echo $color1?></td>
<td bgcolor="<?php echo $ch1C4;?>">上限</td><td bgcolor="<?php echo $ch1C3;?>">標準</td><td bgcolor="<?php echo $ch1C5;?>">下限</td>
</tr>
<tr>
<td>L</td>
<td><?php echo $S0Lm;?></td><td><?php echo $S1Lm;?></td><td><?php echo $S2Lm;?></td>
</tr>
<tr>
<td>a</td>
<td><?php echo $S0am;?></td><td><?php echo $S1am;?></td><td><?php echo $S2am;?></td>
</tr>
<tr>
<td>b</td>
<td><?php echo $S0bm;?></td><td><?php echo $S1bm;?></td><td><?php echo $S2bm;?></td>
</tr>
<tr>
<td>ΔE00</td>
<td><?php echo $deUp;?></td><td></td><td><?php echo $deLo;?></td>
</tr>
<tr>
</tr>
</table>
<?php
// Build the URL with parameters
$fullUrl = 'https://quickchart.io/qr?text='.$company.','.$po.'&size=256';
// Output the QR code image
echo "<img src='" . $fullUrl . "' alt='QR Code'>";
?>
<?php
$servername = "127.0.0.1";
$username = "root";
$password = "fredsql";
$DBNAME = "tvicheck-st";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
//echo "Connected successfully";
if( !mysqli_select_db($conn, $DBNAME)) {
die ("無法選擇資料庫");
}
mysqli_query( $conn, "SET NAMES 'utf8'");
$query = "update spotreport set po='$po', sn='$sn',company='$company',ddate=NOW(), stdL='$S1Lm',stda='$S1am', stdb='$S1bm', stdSum='$stdSum='$stdSum',stdD='$S0d',rgbS='$ch1C3s', fn='$index', Filename='$filename', upL='$S0Lm', upa='$S0am', upb='$S0bm', upSum='$upSum',upD='$S1d',rgbUp='$ch1C4s',LoL='$S2Lm', Loa='$S2am', Lob='$S2bm',LoSum='$LoSum',LoD='$S2d',rgbLo='$ch1C5s' where company='$company' and po='$po'";
//echo $query;
//$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$results = mysqli_query($conn, $query);
mysqli_close($conn);
?>
<!--
<table align="center">
<tr>
<td align="center"><font size="-2"> © <a href="mailto:[email protected]">Fred Kuo</a>, 2023. All rights reserved.<br>
</td>
</tr>
</table>
-->
</body>
</html>