Correction script

This commit is contained in:
Michael RICOIS 2011-10-19 07:11:37 +00:00
parent 87c255e1ee
commit d73143f4ae

View File

@ -30,7 +30,7 @@ if ($argv[1] == 'reprise')
require_once 'infogreffe/infogreffews.php'; require_once 'infogreffe/infogreffews.php';
$wdb = new WDB('sdv1'); $wdb = new WDB('sdv1');
$repErreur = $wdb->select('commandes_erreur', '*', "erreur != '' AND dateCommande > DATE_SUB(NOW(),INTERVAL 120 HOUR)"); $repErreur = $wdb->select('commandes_erreur', '*', "erreur!='' AND dateCommande > DATE_SUB(NOW(),INTERVAL 120 HOUR)");
if (count($repErreur)==0) exit; if (count($repErreur)==0) exit;
foreach($repErreur as $cmd){ foreach($repErreur as $cmd){
@ -51,7 +51,7 @@ if ($argv[1] == 'reprise')
} }
elseif (in_array($argv[1], array('rapport', 'rapportcomplet'))) elseif (in_array($argv[1], array('rapport', 'rapportcomplet')))
{ {
require_once realpath(dirname(__FILE__)) . '../config/prepend.php'; require_once realpath(dirname(__FILE__)) . '/../config/prepend.php';
require_once 'common/curl.php'; require_once 'common/curl.php';
require_once 'common/mysql.php'; require_once 'common/mysql.php';
require_once 'sendmail/mail.php'; require_once 'sendmail/mail.php';
@ -60,13 +60,13 @@ elseif (in_array($argv[1], array('rapport', 'rapportcomplet')))
$wdb = new WDB('sdv1'); $wdb = new WDB('sdv1');
if ($argv[1] == 'rapportcomplet') { if ($argv[1] == 'rapportcomplet') {
$repErreur = $wdb->select('commandes_erreur', '*', "erreur != '' AND dateReception!='0000-00-00 00:00:00' ORDER BY dateCommande ASC"); $repErreur = $wdb->select('commandes_erreur', '*', "erreur!='' AND dateReception=='0000-00-00 00:00:00' ORDER BY dateCommande ASC");
$sujet = "[Commandes Greffe - Erreur WebService] - Rapport Complet"; $sujet = "[Commandes Greffe - Erreur WebService] - Rapport Complet";
} else { } else {
$timestamp = mktime(0, 0, 0, date("m") , date("d")-1, date("Y")); $timestamp = mktime(0, 0, 0, date("m") , date("d")-1, date("Y"));
$hier = date('Y-m-d', $timestamp); $hier = date('Y-m-d', $timestamp);
$sujet = "[Commandes Greffe - Erreur WebService] - ".$hier; $sujet = "[Commandes Greffe - Erreur WebService] - ".$hier;
$repErreur = $wdb->select('commandes_erreur', '*', "erreur != '' AND dateReception!='0000-00-00 00:00:00' AND (dateCommande BETWEEN '.$hier.' 00:00:00 AND '.$hier.' 23:59:59) ORDER BY dateCommande ASC"); $repErreur = $wdb->select('commandes_erreur', '*', "erreur!='' AND dateReception=='0000-00-00 00:00:00' AND (dateCommande BETWEEN '.$hier.' 00:00:00 AND '.$hier.' 23:59:59) ORDER BY dateCommande ASC");
} }
$emailTxt = '<b><u>Commandes Greffe - Erreur WebService</u></b>'; $emailTxt = '<b><u>Commandes Greffe - Erreur WebService</u></b>';
$emailTxt.= '<br/>'; $emailTxt.= '<br/>';