HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/FograCT1/pbnCT42CR40apicc.php

<?php
//error_reporting(0);
$f123= $_GET['f123'];
$sn= $_GET['sn'];
$f321= $_GET['f321'];
$TR15= $_GET['TR15']; 
$target=$_GET['target'];
$iccName=$_GET['po'];
$trimmed=$_GET['trimmed'];

if ($target==''){
	$target='CRPC6';
}
//echo "目標:".$target;

$po=$_GET['po'];

include 'spXYZ.php';
include 'sp38XYZ.php';
include 'lab2xyz.php';
include 'SCCA06.php';
include 'xyz2lab01.php';
include 'xyz2lab.php';
  include 'DensityV38.php';
   include 'DensityV.php';
//include 'DensityV38.php';
include 'invert.php';

$sum=120;
$check=1;
$dtime=time();
$dStr=substr($dtime,7,9)."-";


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;
}

	  $contentT = file($f321);
	  //echo substr('abcdef', 1, 3);  // bcd
	  $filedb=substr($f321,7,60);
	  $dbstr=explode("_", $filedb);
	 // echo $dbstr[0]."XX".$dbstr[1]."XX".$dbstr[2]."XX".$dbstr[3].$dbstr[4].$dbstr[5];
	  $filename=$filedb;
	  $po=$_GET['po'];
	 // echo "po:".$po;
	  
	  ///////////get last ok////////////////////////// 
///////////////////////// get ok
	  
	  

		$stringT = implode($contentT);
		//echo $contents[20]; 
		//echo $stringT; 
//$pt = ereg_replace("\r\n?", "	", $stringT);

//$datastring=get_between($pt,"BEGIN_DATA","END_DATA");

$dotTx = explode("_", $stringT);////Measure upload

//print_r ($dotTx);


$myFile = $trimmed."-".$iccName.".ti3";
//$icclab="upload/".$filename."T.ti1";
$fh = fopen($myFile, 'w') or die("can't open file");
//fwrite($fh, $p);
//1 "A1" 0.00000 0.00000 0.00000 '.$dotTx[0].' '.$dotTx[1].' '.$dotTx[2].'

$viHead='CTI3
DESCRIPTOR "Argyll Calibration Target chart information 3"
ORIGINATOR "Argyll chartread"
CREATED "Thu May 11 16:41:43 2023"
DEVICE_CLASS "OUTPUT"
COLOR_REP "CMYK_LAB"
TARGET_INSTRUMENT "GretagMacbeth i1 Pro"
DEVCALSTD "GMDI"
NUMBER_OF_FIELDS 8
BEGIN_DATA_FORMAT
SAMPLE_ID SAMPLE_LOC CMYK_C CMYK_M CMYK_Y CMYK_K LAB_L LAB_A LAB_B
END_DATA_FORMAT

NUMBER_OF_SETS 42
BEGIN_DATA
1 A1 0 0 0 0 '.$dotTx[0].' '.$dotTx[1].' '.$dotTx[2].' 
2 A2 100 0 0 0 '.$dotTx[3].' '.$dotTx[4].' '.$dotTx[5].' 
3 A3 0 100 0 0 '.$dotTx[6].' '.$dotTx[7].' '.$dotTx[8].' 
4 A4 0 0 100 0 '.$dotTx[9].' '.$dotTx[10].' '.$dotTx[11].' 
5 A5 0 0 0 100 '.$dotTx[12].' '.$dotTx[13].' '.$dotTx[14].' 
6 A6 100 100 0 0 '.$dotTx[15].' '.$dotTx[16].' '.$dotTx[17].' 
7 A7 100 0 100 0 '.$dotTx[18].' '.$dotTx[19].' '.$dotTx[20].' 
8 B1 25.09 25.09 25.09 0 '.$dotTx[21].' '.$dotTx[22].' '.$dotTx[23].' 
9 B2 74.90 74.90 74.90 0 '.$dotTx[24].' '.$dotTx[25].' '.$dotTx[26].' 
10 B3 0 0 0 25.09804 '.$dotTx[27].' '.$dotTx[28].' '.$dotTx[29].' 
11 B4 0 0 0 50.19608 '.$dotTx[30].' '.$dotTx[31].' '.$dotTx[32].' 
12 B5 0 0 0 74.90196 '.$dotTx[33].' '.$dotTx[34].' '.$dotTx[35].' 
13 B6 5.098039 3.921569 3.921569 0 '.$dotTx[36].' '.$dotTx[37].' '.$dotTx[38].' 
14 B7 14.90196 12.15686 12.15686 0 '.$dotTx[39].' '.$dotTx[40].' '.$dotTx[41].' 
15 C1 25.09804 34.90196 50.19608 0 '.$dotTx[42].' '.$dotTx[43].' '.$dotTx[44].' 
16 C2 45.09804 60 74.90196 0 '.$dotTx[45].' '.$dotTx[46].' '.$dotTx[47].' 
17 C3 14.90196 25.09804 34.90196 5.098039 '.$dotTx[48].' '.$dotTx[49].' '.$dotTx[50].' 
18 C4 80 20 0 0 '.$dotTx[51].' '.$dotTx[52].' '.$dotTx[53].' 
19 C5 20 80 0 0 '.$dotTx[54].' '.$dotTx[55].' '.$dotTx[56].' 
20 C6 80 0 20 0 '.$dotTx[57].' '.$dotTx[58].' '.$dotTx[59].' 
21 C7 0 20 80 0 '.$dotTx[60].' '.$dotTx[61].' '.$dotTx[62].' 
22 D1 60 40 0 0 '.$dotTx[63].' '.$dotTx[64].' '.$dotTx[65].' 
23 D2 40 60 0 0 '.$dotTx[66].' '.$dotTx[67].' '.$dotTx[68].' 
24 D3 60 0 40 0 '.$dotTx[69].' '.$dotTx[70].' '.$dotTx[71].' 
25 D4 0 40 60 0 '.$dotTx[72].' '.$dotTx[73].' '.$dotTx[74].' 
26 D5 40 0 60 0 '.$dotTx[75].' '.$dotTx[76].' '.$dotTx[77].' 
27 D6 0 60 40 0 '.$dotTx[78].' '.$dotTx[79].' '.$dotTx[80].' 
28 D7 40 40 20 0 '.$dotTx[81].' '.$dotTx[82].' '.$dotTx[83].' 
29 E1 20 40 60 0 '.$dotTx[84].' '.$dotTx[85].' '.$dotTx[86].' 
30 E2 80 69.80392 69.80392 20 '.$dotTx[87].' '.$dotTx[88].' '.$dotTx[89].' 
31 E3 60 50.19608 50.19608 40 '.$dotTx[90].' '.$dotTx[91].' '.$dotTx[92].' 
32 E4 40 29.80392 29.80392 60 '.$dotTx[93].' '.$dotTx[94].' '.$dotTx[95].' 
33 E5 14.90196 5.098039 14.90196 0 '.$dotTx[96].' '.$dotTx[97].' '.$dotTx[98].' 
34 E6 5.098039 14.90196 5.098039 0 '.$dotTx[99].' '.$dotTx[100].' '.$dotTx[101].' 
35 E7 60 29.80392 40 0 '.$dotTx[102].' '.$dotTx[103].' '.$dotTx[104].' 
36 F1 0 100 100 0 '.$dotTx[105].' '.$dotTx[106].' '.$dotTx[107].' 
37 F2 50.19608 50.19608 50.19608 0 '.$dotTx[108].' '.$dotTx[109].' '.$dotTx[110].' 
38 F3 29.80392 23.92157 23.92157 0 '.$dotTx[111].' '.$dotTx[112].' '.$dotTx[113].' 
39 F4 7.843137 14.90196 20 0 '.$dotTx[114].' '.$dotTx[115].' '.$dotTx[116].' 
40 F5 20 0 80 0 '.$dotTx[117].' '.$dotTx[118].' '.$dotTx[119].' 
41 F6 0 80 20 0 '.$dotTx[120].' '.$dotTx[121].' '.$dotTx[122].' 
42 F7 29.80392 60 20 0 '.$dotTx[123].' '.$dotTx[124].' '.$dotTx[125].' 
END_DATA
';	

fwrite($fh, $viHead);
  
fclose($fh);

//echo "colprof -v -D'".$iccName."' -qm ".$iccName;

exec("echo . | colprof -v -D'".$iccName."' -qm ".$trimmed."-".$iccName); 

//run(@ScriptDir&"\"&"colprof.exe -v -D"&'"'&$barcode&'"'&" -ql "&$barcode)

$jsonData = json_encode(array(
"status" => "warning",
"message" => "failed",
"affected_rows" => 0
));

header('Content-Type: application/json');
echo $jsonData;

?>