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/pbntrigger/ColorPortSaveMix3Web2.au3
;Recursive File Lister
#include <Date.au3>
#Include <Array.au3>
#include <GUIConstants.au3>
#include <String.au3>
;#include <_sql.au3>
#include <INet.au3>
#Include <File.au3>

Local $MyDocsFolder = "C:\xampp\htdocs\FWOK\"
;FileCopy("C:\xampp\htdocs\SpotDe\target\target.txt","C:\xampp\htdocs\SpotDe\target.txt",1)
;$objErr = ObjEvent("AutoIt.Error","MyErrFunc")

$barcode=''
$aim=''
$sw =''
$target=''
$st="cmyk"
$filenameT2=''
$ftarget=''
;FileDelete("C:\xampp\htdocs\SpotDe\SpotDe\target.txt")
Global $Paused
HotKeySet("^`", "Terminate")
HotKeySet("^1", "kill")

Global $iOrdinal=-1
Global $sFilename = "" ; Default file is "shell32.dll"
$path_check=''
GUICreate("�L��ƾں޲z-Cloud", 320,220, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES





GUIStartGroup()

   $radio8 = GUICtrlCreateRadio("Process CMYK", 70, 20, 90, 20)
   $radio7 = GUICtrlCreateRadio("CT12", 140, 50, 60, 20)
    $radio9 = GUICtrlCreateRadio("Spot", 210, 80, 60, 20)

   $radio1 = GUICtrlCreateRadio("CT9", 70, 50, 60, 20)
    $radio2 = GUICtrlCreateRadio("TVI84", 210, 50, 60, 20)
    ;$radio6 = GUICtrlCreateRadio("CMYKG", 140, 20, 60, 20)

   $radio3 = GUICtrlCreateRadio("Plate21", 70, 80, 60, 20)
   $radio4 = GUICtrlCreateRadio("Plate3", 140, 80, 60, 20)
  ; $radio5 = GUICtrlCreateRadio("TV", 210, 20, 60, 20)









GuiCtrlCreateLabel("�u���X: ", 15, 125, 60, 16)
$hFile1 = GUICtrlCreateInput($sFilename, 90,  125, 185, 16, -1)

GuiCtrlCreateLabel("�L��s��:", 15, 145, 60, 16)
$hFile2 = GUICtrlCreateInput("", 90,  145, 145, 16, -1)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$hFileSel2 = GUICtrlCreateButton("...", 245,  145, 26, 18)


;$hToggle = GUICtrlCreateButton("by Name", 300,  45, 60, 24, $BS_FLAT)
$btn = GUICtrlCreateButton ("�ʬ�", 20,  175, 60, 20)
$btn2 = GUICtrlCreateButton ("��Ctrl-`����ʬ�", 85 , 175, 110, 20)

GUISetState ()

While 1
    $iMsg = GUIGetMsg()
    Select


   Case $iMsg  = $radio8 And BitAND(GUICtrlRead($radio8), $GUI_CHECKED) = $GUI_CHECKED
                $st="cmyk"

   Case $iMsg  = $radio9 And BitAND(GUICtrlRead($radio9), $GUI_CHECKED) = $GUI_CHECKED
                $st="spotde"

   Case $iMsg  = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
                $st="ct9"

   Case $iMsg  = $radio7 And BitAND(GUICtrlRead($radio7), $GUI_CHECKED) = $GUI_CHECKED
                $st="ct12"

   Case $iMsg  = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
                $st="tvi"

   Case $iMsg  = $radio3 And BitAND(GUICtrlRead($radio3), $GUI_CHECKED) = $GUI_CHECKED
                $st="pc10"

   Case $iMsg  = $radio4 And BitAND(GUICtrlRead($radio4), $GUI_CHECKED) = $GUI_CHECKED
                $st="pc3"

   ;Case $iMsg  = $radio5 And BitAND(GUICtrlRead($radio5), $GUI_CHECKED) = $GUI_CHECKED
               ; $st="tv"


	Case $iMsg = $hFile1
            ;GUICtrlSetData($hFile1, $sTmpFile); GUI will be updated at next iteration
			$barcode=GUICtrlRead($hFile1)
			;MsgBox (4096, "drag drop file", $path_pdf

		Case $iMsg = $hFileSel2
			$sTmpFile= FileSaveDialog("Choose a name.", "C:\xampp\htdocs\FWOK\", "Scripts (*.txt)", 2)
            If @error Then ContinueLoop
            GUICtrlSetData($hFile2, $sTmpFile); GUI will be updated at next iteration
			$path_check=GUICtrlRead($hFile2)

		 if not $path_check='' then
		 ;FileCopy($path_check,"C:\xampp\htdocs\SpotDe\upload\*.*",1)
		  ;FileCopy($path_check,"C:\xampp\htdocs\SpotDe\target.txt",1)
		 $fString = StringSplit($path_check, "\")
		 ;_ArrayDisplay($fString,"file")
		 $last=$fstring[0]
		 $ftarget=$fstring[$last]
		 $aim=$ftarget
		 MsgBox(0,$ftarget,$path_check)
	  else
		 ;Filecopy("C:\xampp\htdocs\SpotDe\SpotDe\target\target.txt","C:\xampp\htdocs\SpotDe\target.txt",1)
		 endif


	Case $iMsg= $btn
			;$iOrdinal = 1
				GUICtrlSetData($btn, "�ʬݤ�")
				;WinSetTitle($hGui,"","Icon Selector by Name value")
			$k = 0




Opt("WinTitleMatchMode", 2)
Opt("PixelCoordMode",2)


if $barcode='' Then
   msgbox(0,"","�п�J�渹")
   send("^`")
   endif




msgbox(0,$k,"�Ұʺʬ�",1)

while WinExists("[TITLE:ColorPort; CLASS:#32770]", "")
winactivate("[TITLE:ColorPort; CLASS:#32770]", "")
sleep(500)

send("{enter}")
sleep(500)
SplashTextOn("ĵ�i", "��Ʀ��~�A���s���q!",500, 100, -1, -1, 0, "", 24)
Sleep(2000)
SplashOff()


wend
;;while WinExists("[TITLE:ColorPort; CLASS:#32770]", "")
winactivate("[CLASS:RBWindow]","")
sleep(500)
;15791353 F0F4F9 16777215 FFFFFF 7775850 76A66A
$var = PixelGetColor( 212 , 466 )

while $var<16777215

while WinExists("[TITLE:ColorPort; CLASS:#32770]", "")
winactivate("[TITLE:ColorPort; CLASS:#32770]", "")
sleep(500)
send("{enter}")
sleep(500)
SplashTextOn("ĵ�i",  "��Ʀ��~�A���s���q!",500, 100, -1, -1, 0, "", 24)
Sleep(2000)
SplashOff()
wend
;while title

ControlClick("ColorPort", "�x�s���", "[CLASS:Button;  INSTANCE:4]")

sleep(500)
while WinExists("�x�s -")

if WinExists("�x�s - CGATS")  then
   ;WinSetTrans("�x�s - CGATS", "", 10) ; Make Notepad window semi-transparent.

sleep(500)
ControlClick("�x�s - CGATS", "�x�s", "[CLASS:Button;  INSTANCE:1]")
	sleep(500)
Else
 sleep(500)
    MsgBox(0, "", "CGATES was not active",1)

	sleep(500)
ControlClick("[CLASS:RBWindow]", "", "ComboBox1")
sleep(1000)
Send("cg")
sleep(500)
send("{enter}")
sleep(500)

;ControlClick("[CLASS:RBWindow]", "", "ComboBox2")
;sleep(700)
;Send("{up}")
;sleep(1000)
;send("{enter}")
;sleep(700)


sleep(700)
ControlClick("�x�s - CGATS", "�x�s", "[CLASS:Button;  INSTANCE:1]")
	sleep(500)
;wend
endif
;;if
$rn=Random(0, 100, 1)
;WinSetTrans("Save", "", 10)
send("!n")
ClipPut(@ScriptDir&"\adfs\Xin\"&@min&@sec&".txt")
sleep(300)
send("^v")
sleep(300)
send("!s")
sleep(500)



WinActivate("ColorPort","")
sleep(500)
ControlClick("ColorPort", "�M�����", "[CLASS:Button;  INSTANCE:5]")
;WinSetTrans("", "�T�w", 10)
sleep(30)
winactivate ("","�T�w")
sleep(300)
ControlClick("", "�T�w", "[CLASS:Button;  INSTANCE:1]")
sleep(500)

wend ;;40WinExists("�x�s -")
;;;while WinExists("�x�s -")



$txt_in=(@ScriptDir&"\adfs\Xin");;;;;;;;;;��|1

$txt_out=("C:\adfs\Xout\")
$status="DE"
;;$pdfhold=("C:\adsf\cal-hold")


;msgbox(0,$status,$barcode&"-"&$st)
$MyVar1=($txt_in)


			$FileList11=_FileListToArray($MyVar1, '*.txt',1)
			if not @Error=4  then
				$fa1=$FileList11[0]
			Else
			$fa1=0
			endif

			sleep(500)
			$FileList21=_FileListToArray($MyVar1, '*.txt',1)

			if not @Error=4  then
				$fb1=$FileList21[0]
			Else
			$fb1=0
			endif


			while $fa1<$fb1
		$FileList11=_FileListToArray($MyVar1, '*.txt',1)
			$fa1=$FileList11[0]

sleep(1000)
$FileList21=_FileListToArray($MyVar1, '*.txt',1)
			$fb1=$FileList21[0]
		wend
	;run("C:\bnTest\convertZ.exe  /i:utf8 /o:big5 /f:t " & $rr1)
	sleep(500)


$FileList=_FileListToArray($MyVar1, '*.txt',1)
		;_ArraySort($FileList, 0, 1, 0, 0)


if not @Error=4  then




for $j=1 to $FileList[0] step 1
	;sleep(500)

;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if $st='pc10' or $st='pc3' then
GUICreate("Plate Check", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES
GUIStartGroup()

    $radio14 = GUICtrlCreateRadio("C", 20, 20, 50, 20)
	$radio15 = GUICtrlCreateRadio("M", 70, 20, 50, 20)
	$radio16 = GUICtrlCreateRadio("Y", 120, 20, 50, 20)
    $radio17 = GUICtrlCreateRadio("K", 170, 20, 50, 20)

$btn2 = GUICtrlCreateButton ("OK", 20,  80, 60, 20)

GUISetState ()

While $sw =''
   ;msgbox (0,$var,$sw,2)

    $iMsg = GUIGetMsg()
	 Select


   Case $iMsg  = $radio14 And BitAND(GUICtrlRead($radio14), $GUI_CHECKED) = $GUI_CHECKED
                $cp="C"
   Case $iMsg  = $radio15 And BitAND(GUICtrlRead($radio15), $GUI_CHECKED) = $GUI_CHECKED
                $cp="M"
   Case $iMsg  = $radio16 And BitAND(GUICtrlRead($radio16), $GUI_CHECKED) = $GUI_CHECKED
                $cp="Y"
   Case $iMsg  = $radio17 And BitAND(GUICtrlRead($radio17), $GUI_CHECKED) = $GUI_CHECKED
                $cp="K"


	Case $iMsg= $btn2

	   ;$sw =-1

	    msgbox(0,"your select2:", $cp,1)
			 Exitloop 1

	Case $iMsg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
Wend;;1
;;AutoIt v3 GUI
 GUIDelete();
sleep(1000)
WinClose("[AutoIt v3 GUI]","")
sleep(500)
endif
;;plate select


	$rr1=($txt_in& "\" & $Filelist[$j])
   $rr2=$path_check
	;sleep(500)

$text = StringReplace(_DateTimeFormat(_NowCalc(), 2), "/", "-")
$text2 = StringReplace(_DateTimeFormat(_NowCalc(), 5), ":", "")
;msgbox(0,$text2,$text)
$filename=$status&"_"&$barcode&"_"&$st&"_"&$text&"_"&$text2
;msgbox(0,$text2,$filename)

;$filenameT=$filename
$filenameT=$filename&"_"&$Filelist[$j]
$filenameT2=$ftarget
filemove($rr1,@ScriptDir&"\"&$filenameT,1)
filecopy($rr2,@ScriptDir&"\"&$filenameT2,1)


;filemove($rr1,"C:\xampp\htdocs\Fogra123\upload\*.*",1)
sleep(1000)
	;;ProgressOn("Progress Meter", "Increments every eml", "0 eml")
Opt( "WinTitleMatchMode" ,2 )
Opt("MouseCoordMode",0)

;WinActivate("Mozilla Firefox")
;msgbox(0,$text2,$filename)




;if $st='spotde'  then
;filemove($rr1,"C:\xampp\htdocs\SpotDe\upload\"&$filenameT,1)
;elseif $st='cmyk'  then
;filemove($rr1,"C:\xampp\htdocs\cmykDe\upload\"&$filenameT,1)
;endif

$filetxt = FileOpen("fileup.bat", 2);;;;;;;;;;;;;;;;;write sql



$lineS=("@echo off"&@CRLF)
FileWrite($filetxt,$lineS)

if $st='cmyk' then
$lineS=("echo user [email protected]> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)

elseif $st='spotde' then
$lineS=("echo user [email protected]> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)

elseif $st='ct9' then
$lineS=("echo user [email protected]> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)

elseif $st='ct12' then
$lineS=("echo user [email protected]> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)

elseif $st='tvi' then
$lineS=("echo user [email protected]> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)

elseif $st='pc10' then
$lineS=("echo user [email protected]> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)

elseif $st='pc3' then
$lineS=("echo user [email protected]> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)

endif

$lineS=("echo ink5697>> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)

$lineS=("echo put %1>> ftpcmd.dat"&@CRLF)

FileWrite($filetxt,$lineS)
$lineS=("echo quit>> ftpcmd.dat"&@CRLF)
FileWrite($filetxt,$lineS)
$lineS=("ftp -n -s:ftpcmd.dat ftp.pbn.acsite.org"&@CRLF)
FileWrite($filetxt,$lineS)
$lineS=("del ftpcmd.dat")
FileWrite($filetxt,$lineS)
FileClose($filetxt)
sleep(1000)




$commandf3 = "fileup.bat "&$filenameT
;$commandf3 = "ftp -s:commands3.txt"
Run($commandf3 , "", @SW_HIDE)

;msgbox(0,"Ft2",$filenameT2,1)
sleep(1000)


SplashTextOn("Data Upload", "��ƤW��!", -1, 100, -1, -1, $DLG_CENTERONTOP , "", 24)
sleep(1000)
ProcessWaitClose("ftp.exe")
Sleep(1000)
SplashOff()


if $filenameT2<>'' then
   sleep(1000)
   msgbox(0,"Ft2x",$filenameT2,1)

   $filetxt2 = FileOpen("fileup2.bat", 2);;;;;;;;;;;;;;;;;write sql
$lineS2=("@echo off"&@CRLF)
FileWrite($filetxt2,$lineS2)
$lineS2=("echo user [email protected]> ftpcmd.dat"&@CRLF)
FileWrite($filetxt2,$lineS2)
$lineS=("echo ink5697>> ftpcmd2.dat"&@CRLF)
FileWrite($filetxt2,$lineS2)
$lineS2=("echo put %1>> ftpcmd2.dat"&@CRLF)
FileWrite($filetxt2,$lineS2)
$lineS2=("echo quit>> ftpcmd2.dat"&@CRLF)
FileWrite($filetxt2,$lineS2)
$lineS2=("ftp -n -s:ftpcmd2.dat ftp.pbn.acsite.org"&@CRLF)
FileWrite($filetxt2,$lineS2)
$lineS2=("del ftpcmd2.dat")
FileWrite($filetxt2,$lineS2)
FileClose($filetxt2)
sleep(1000)

$commandf4 = "fileup2.bat "&$filenameT2
;$commandf3 = "ftp -s:commands3.txt"
Run($commandf4 , "", @SW_HIDE)
;msgbox(0,"","check 205")
sleep(1000)

SplashTextOn("Data Upload", "�ؼи�ƤW��!", -1, 100, -1, -1, $DLG_CENTERONTOP , "", 24)
sleep(1000)
ProcessWaitClose("ftp.exe")
Sleep(1000)
SplashOff()

endif




;FileDelete("commands3.txt")
sleep(500)
FileDelete(".\adfs\mac.txt")
sleep(500)
FileDelete($filenameT)
sleep(500)
FileDelete("fileup.bat")



;msgbox(0,$text2,$filename)

				Opt( "WinTitleMatchMode" ,2 )
				Opt("MouseCoordMode",0)
			   $company='shu2017'

			   if $st='spotde' and $aim='' then
				$url = "http://pbn.acsite.org//spotde/6pmmTVI-parsingCTOKX3.php?f123=target.txt&f321=upload/"&$filenameT&"&company="&$company&"&aim="&$aim
			   elseif $st='spotde' and $aim<>'' then
				$url = "http://pbn.acsite.org/spotde/6pmmTVI-parsingCTOKX3.php?f123=target.txt&f321=upload/"&$filenameT&"&company="&$company&"&aim="&$aim
				elseif $st='cmyk' then
				$url = "http://pbn.acsite.org/cmykDe/6pmmTVI-parsingCTOKXg.php?f123=target.txt&f321=upload/"&$filenameT&"&company="&$company
			    elseif $st='CT9' then
			    $url = "http://pbn.acsite.org/FograCT9/6pmmTVI-parsingCTOKX.php?f123=target.txt&f321=upload/"&$filenameT&"&plC=1&plM=1&plY=1&plK=1&company="&$company
			    elseif $st='CT12' then
			    $url = "http://pbn.acsite.org/FograCT12/6pmmTVI-parsingCTOKX.php?f123=target.txt&f321=upload/"&$filenameT&"&plC=1&plM=1&plY=1&plK=1&company="&$company
			    elseif $st='tvi' then
			   $url = "http://pbn.acsite.org/FograTVI/6pmmTVI-parsingCTOKX.php?f123=target.txt&f321=upload/"&$filenameT&"&plC=1&plM=1&plY=1&plK=1&company="&$company
			   elseif $st='pc10' then
			   $url = "http://pbn.acsite.org/FograPC10/6pmmTVI-parsingCTOKX.php?f123=target.txt&f321=upload/"&$filenameT&"&plC=1&plM=1&plY=1&plK=1&company="&$company&"&color="&$cp
			   elseif $st='pc3' then
			   $url = "http://pbn.acsite.org/FograPC4/6pmmTVI-parsingCTOKX.php?f123=target.txt&f321=upload/"&$filenameT&"&plC=1&plM=1&plY=1&plK=1&company="&$company&"&color="&$cp
			   endif
 ShellExecute($url)

FileDelete($rr1)
sleep(1000)

;


next ;;;$j





endif
;;@Error=4
		  	if  $iOrdinal=1 then
				sleep(1000)

				MsgBox(0,"","����ʬ�",1)
				sleep(1000)
				GUICtrlSetData($btn, "���s�ʬ�")
				GUICtrlSetData($hFile1, $barcode)
				$iOrdinal=-1

				;FileCopy("C:\xampp\htdocs\SpotDe\target\target.txt","C:\xampp\htdocs\SpotDe\target.txt",1)
				exitloop
			endif



wend

	Case $iMsg = $GUI_EVENT_CLOSE
            Exit
		EndSelect




 Wend;;1


Func Terminate()
    ;ProcessClose("Wscript.exe")
   ;Exit 0
MsgBox(0,"","�Ȱ�",1)
;FileCopy("C:\xampp\htdocs\SpotDe\target\target.txt","C:\xampp\htdocs\SpotDe\target.txt",1)
$aim=''
	$iOrdinal=1
	GUICtrlSetData($btn, "�ʬ�x")
 EndFunc


Func kill()
    ;ProcessClose("Wscript.exe")
   Exit 0
MsgBox(0,"","�Ȱ�",1)
;FileCopy("C:\xampp\htdocs\SpotDe\target\target.txt","C:\xampp\htdocs\SpotDe\target.txt",1)
$aim=''
	$iOrdinal=1
	GUICtrlSetData($btn, "�ʬ�x")
 EndFunc