File: C:/xampp/htdocs/pbntrigger/pbntriger.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>
;$objErr = ObjEvent("AutoIt.Error","MyErrFunc")
$cp='K'
$aim=''
$sw =''
$target=''
$st="cmyk"
$hFile1=''
$barcode=''
$filenameT2=''
$ftarget=''
$company='ecolor'
GUICreate("SID�z", 320,220, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES
$btn = GUICtrlCreateButton ("�ʬ�", 20, 175, 60, 20)
$btn2 = GUICtrlCreateButton ("��Ctrl-`����ʬ�", 85 , 175, 120, 20)
GUISetState ()
While 1
$iMsg = GUIGetMsg()
Select
Case $iMsg= $btn
;$iOrdinal = 1
GUICtrlSetData($btn, "�ʬݤ�")
$k = 0
while $k<100000000
Opt("WinTitleMatchMode", 2)
Opt("PixelCoordMode",2)
$txt_in=("C:\xampp\htdocs\pbntrigger");;;;;;;;;;��|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)
;_ArrayDisplay($FileList, "here")
if not @Error=4 then
for $j=1 to $FileList[0] step 1
$filenameT=StringTrimLeft($FileList[$j],4)
;MsgBox(0,"here",$filenameT)
$fileString = StringSplit($filenameT, '_')
;_ArrayDisplay($fileString, "here 93")
$company=$filestring[6]
$st=$filestring[3]
$rr1=($txt_in& "\" & $FileList[$j])
sleep(500)
filemove($rr1,$txt_in&"\"&$filenameT)
sleep(1000)
$filetxt = FileOpen("fileup.bat", 2);;;;;;;;;;;;;;;;;write sql
sleep(1000)
$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 $st='spotde' and $aim='' then
$url = "http://pbn.acsite.org//spotde/6pmmTVI-parsingCTOKX3.php?f123=target.txt&f321=upload/"&$filenameT&"&company="&$company&"&aim="&$aim&"&fin=y"
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&"&fin=y"
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)
sleep(500)
FileDelete($filenameT)
sleep(500)
FileDelete("fileup.bat")
sleep(500)
next ;j loop
;jloop
endif;;if error 4
;if erreo4
$k=1
Wend
;K
;K
Case $iMsg = $GUI_EVENT_CLOSE
Exit
EndSelect
Wend;;1