1. Import
This commit is contained in:
92
html/tools/cron_export_SB_FZG.php
Normal file
92
html/tools/cron_export_SB_FZG.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* cron_export_SB_FZG.php
|
||||
*
|
||||
* Export of vehicles only
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/ftp.inc.php");
|
||||
|
||||
|
||||
if ($argv[1] == "acapella7890") :
|
||||
|
||||
// Error reporting
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
|
||||
$path = getAbsoluteSystemPath();
|
||||
$passwd = "acapella7890";
|
||||
$logFile = $path . "/log/sys_auto_export.log";
|
||||
$emptyArgument = "\"\"";
|
||||
$fileNamePrefix = substr(getDateTime("6"), 0, 12); // Format: "YmdHi"
|
||||
|
||||
if ($argv[2] == "today") :
|
||||
$toDay = getDateTime("day");
|
||||
$toMonth = getDateTime("month");
|
||||
$toYear = getDateTime("year");
|
||||
else :
|
||||
$toDay = getDateTime("day_yesterday");
|
||||
$toMonth = getDateTime("month_yesterday");
|
||||
$toYear = getDateTime("year_yesterday");
|
||||
endif;
|
||||
|
||||
|
||||
$exportPars = array();
|
||||
|
||||
$exportPars["SB_HB_FZG"] = array("1","100001","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".039.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["SB_HH_FZG"] = array("2","200001","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".041.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["SB_B_FZG"] = array("3","300001","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".077.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["SB_H_FZG"] = array("4","400001","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".093.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["SB_F_FZG"] = array("5","500001","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".024.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["SB_DD_FZG"] = array("6","600001","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".055.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["SB_E_FZG"] = array("7","700001","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".026.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["SB_M_FZG"] = array("9","826760","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".043.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["SB_S_FZG"] = array("11","826762","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".052.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
// $exportPars["SB_SL_FZG"] = array("90","826884","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".060.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportParsKeys = array_keys($exportPars);
|
||||
$exportParsKeysLen = count($exportParsKeys);
|
||||
if ($exportParsKeysLen != "" && is_numeric($exportParsKeysLen)) :
|
||||
|
||||
// Exports
|
||||
for ($i = 0; $i < $exportParsKeysLen; $i++) :
|
||||
|
||||
list($hq_id,$usr_id,$dummy_01,$f_act,$f_exp_category,$f_delimiter,$f_parname,$f_parname_export,$f_fileName,
|
||||
$day_to,$month_to,$year_to,$f_cs_eid_filter,$f_jbp_filter,$specialJbPayment,$jbpc_id) = $exportPars[$exportParsKeys[$i]];
|
||||
|
||||
$cmd = "php " . $path . "/export/export.php " . $passwd . " " . $hq_id . " " . $usr_id . " " . $dummy_01 . " " . $f_act . " " . $f_exp_category . " " . "\"" . $f_delimiter. "\"" . " "
|
||||
. "\"" . $f_parname . "\"" . " " . "\"" . $f_parname_export . "\"" . " " . "\"" . $f_fileName . "\"" . " " . $day_to . " " . $month_to . " " . $year_to . " "
|
||||
. $f_cs_eid_filter . " " . $f_jbp_filter . " " . $specialJbPayment . " " . $jbpc_id . " &";
|
||||
$cmdOutput = null;
|
||||
exec($cmd, $cmdOutput);
|
||||
// list($errNo, $errDesc) = $cmdOutput;
|
||||
|
||||
$currentTime = getDateTime("0");
|
||||
writeToFile($logFile, "OP=AUTO_EXPORT|DATETIME=" . $currentTime . "|CUST=" . $exportParsKeys[$i]);
|
||||
|
||||
sleep(5); // Avoid too many tasks
|
||||
endfor;
|
||||
|
||||
// FTP Uploads
|
||||
for ($i = 0; $i < $exportParsKeysLen; $i++) :
|
||||
|
||||
list($hq_id,$usr_id,$dummy_01,$f_act,$f_exp_category,$f_delimiter,$f_parname,$f_parname_export,$f_fileName,
|
||||
$day_to,$month_to,$year_to,$f_cs_eid_filter,$f_jbp_filter,$specialJbPayment,$jbpc_id) = $exportPars[$exportParsKeys[$i]];
|
||||
|
||||
$cmd = "php " . $path . "/export/exportdata_ftp_auto.php " . $passwd . " " . $f_fileName . " " . $hq_id . " " . "0" . " &";
|
||||
|
||||
$cmdOutput = null;
|
||||
exec($cmd, $cmdOutput);
|
||||
// list($errNo, $errDesc) = $cmdOutput;
|
||||
|
||||
$currentTime = getDateTime("0");
|
||||
writeToFile($logFile, "OP=AUTO_UPLOAD|DATETIME=" . $currentTime . "|CUST=" . $exportParsKeys[$i]);
|
||||
|
||||
sleep(5); // Avoid too many tasks
|
||||
endfor;
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
Reference in New Issue
Block a user