/** * @param $pnIdUtilisateur * @param $chk */ function getSuppPlanche($pnIdUtilisateur, $chk) { $objSmartgang = new smartgang(); $objSmartgang->getConDbo(); //-- conn to dbo $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "RUN", "arg=>{$chk}"); $data_planche = $objSmartgang->getDataPlanchToSupp($pnIdUtilisateur, $chk); if (is_array($data_planche) && count($data_planche) > 0) { foreach ($data_planche as $key => $arg) { $pnIdPlanche = intval($arg->IDPlanche); if (is_numeric($pnIdPlanche) && $pnIdPlanche > 0) { $qSql = "EXEC dbo.P_CommandeCommentaireInternePersoAjoute {$pnIdUtilisateur},{$pnIdPlanche},null,'planche detruite en attente amalgame'"; $objSmartgang->execMsSql($qSql); $path = "http://" . $_SERVER['SERVER_ADDR'] . "/appli/smartgang/rollback.php?numero={$pnIdPlanche}"; $url = "{$path}"; $options = $objSmartgang->curlopt($url); //-- options cURL $ch = curl_init(); curl_setopt_array($ch, $options); $content = curl_exec($ch); //-- exec cURL to url $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "EXE", "{$url}"); if (curl_error($ch)) { $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "ERR", "{$pnIdPlanche} | method cURLexec() : " . curl_error($ch) . $content); } //-- LOG $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "OK ", "{$pnIdPlanche}"); curl_close($ch); } } } $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "END", "arg=>{$chk}"); }
/** * @param $pnIdUtilisateur * @param $chk */ function getFtp($pnIdUtilisateur, $chk) { /*$headers = 'From: MonteurAuto<*****@*****.**>' . "\r\n" . 'Reply-To: automation@exaprint.fr' . "\r\n" . 'Content-Type: text/html; charset="iso-8859-1"' . "\r\n" . 'X-Mailer: PHP/' . phpversion();*/ $objSmartgang = new smartgang(); $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "RUN", ""); $objSmartgang->getConDbo(); $data_planche = $objSmartgang->getDataPlancheReadyToSent($pnIdUtilisateur, $chk); if (is_array($data_planche) && count($data_planche) > 0) { foreach ($data_planche as $value) { $verif = null; $pnIdPlanche = $value->IDPlanche; $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "EXE", " : START EntreeFTP -> {$pnIdPlanche}"); if (is_numeric($pnIdPlanche) && $pnIdPlanche > 0) { $verif = $objSmartgang->getVerifElement($data_planche); $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "EXE", " : {$pnIdPlanche} => Verif = {$verif}"); /*if (preg_match('/2/',$verif)) { mail('*****@*****.**', "$pnIdPlanche => Verif = $verif", "planche $pnIdPlanche => Verif = $verif", $headers); mail('*****@*****.**', "$pnIdPlanche => Verif = $verif", "$pnIdPlanche => Verif = $verif", $headers); }*/ if (preg_match('/111/', $verif) && !preg_match('/2/', $verif)) { $objSmartgang->getEstValide($pnIdPlanche); $objSmartgang->getEntreeFtpXml($pnIdPlanche); $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "END", ""); } else { $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "ERR", " : {$pnIdPlanche} => Verif = {$verif}"); } } } } else { $objSmartgang->logFile(basename(__FILE__), __FUNCTION__, "ERR", " : {$data_planche}"); } }
include '/var/www/appli/lib/srv.php'; require_once '/var/www/appli/class/class.gang.php'; $objSmartgang = new smartgang(); $objSmartgang->logFile(basename(__FILE__), "script", "RUN", "negoce/start.php"); $start = $objSmartgang->getmicrotime(); if (isset($_GET['idcommande']) && $_GET['idcommande'] > 0 && (isset($_GET['idatelier']) && $_GET['idatelier'] > 0)) { $pnIdCommande = $_GET['idcommande']; $pnIDAtelier = $_GET['idatelier']; if (isset($_GET['dateExp']) && $_GET['dateExp'] != "null") { $date = \DateTime::createFromFormat('d/m/Y', $_GET['dateExp']); if (is_object($date)) { $pdDateExpe = "'" . $date->format('Ymd') . "'"; } } $objSmartgang->logFile(basename(__FILE__), "script", "EXE", "Commande -> {$pnIdCommande}"); $conDbo = $objSmartgang->getConDbo(); //-- conn to dbo if (!$conDbo) { //-- success connect $pnIdPlanche = $objSmartgang->getCreationPlancheNegoce($pnIdCommande, $pnIDAtelier, $pnIdUtilisateur, $pdDateExpe); //-- creationsql planche negoce if (is_numeric($pnIdPlanche)) { //-- recuperation des infos de planches $objSmartgang->getPapierBrochure($pnIdCommande, $pnIdPlanche); //-- add format "BROCHURE" if needed $resu_info = $objSmartgang->getInfoPlanche($pnIdPlanche); //-- recup info planche $objSmartgang->getFicheFabV2($resu_info); //-- create Fiche de fab negoce PDF $objSmartgang->getXmlFile($pnIdPlanche); //-- genere le xml de la fiche de fab
$pnIdPlanche = intval($_GET['idplanche']); if (isset($_GET['exportPdf']) && $_GET['exportPdf'] != "") { $exportAsked = $_GET['exportPdf']; } include '/var/www/appli/lib/srv.php'; require_once "/var/www/appli/class/class.gang.php"; $exaprint = new smartgang(); $start = $exaprint->getmicrotime(); $exaprint->logFile(basename(__FILE__), "script", "RUN", "IDPlanche: {$pnIdPlanche} - ExportPDF: {$exportAsked}"); $deviceId = "Speedmaster 102"; $bascule = "Sheetwise"; $bleed = "2"; $params = $exaprint->getParams(); $pathMontage = $params['montage']['url']; $pathInputMxml = $params['metrix']['path']; $conDbo = $exaprint->getConDbo(); if ($exportAsked != "non") { $exec = "exec dbo.P_FluxEvenementCreation null,{$pnIdPlanche},3,687,'MetrixAutomation',0"; } else { $exec = "exec dbo.P_FluxEvenementCreation null,{$pnIdPlanche},2,687,'MetrixAutomation',0"; } $exaprint->execMsSql($exec); $info_planche = $exaprint->getInfoPlanche($pnIdPlanche); $pListeCommandes = $info_planche['pListeCommandes']; $psCodeTete = $info_planche['psCodeTete']; $psActiviteProd = $info_planche['psActiviteProd']; $pdDateCreationPlanche = $info_planche['pdDateCreationPlanche']; $psCodeatelier = $info_planche['psCodeAtelier']; $pathImport = "Volumes/mnt/raid1/datas/Production/Chef_de_fab_v2/MONTAGE/{$psCodeTete}/{$pdDateCreationPlanche}/{$pnIdPlanche}/IMPORTS"; $pathPlanche = "Volumes/Chef_de_fab_v2/MONTAGE/{$psCodeTete}/{$pdDateCreationPlanche}/{$pnIdPlanche}/{$psCodeatelier}_{$psActiviteProd}_{$pnIdPlanche}"; $import_content = $exaprint->getReadDir("/" . $pathImport);