extranet/batch/giant.php

33 lines
928 B
PHP
Raw Normal View History

<?php
// --------------------------------------------------------------------------- //
// giant.php
// --------------------------------------------------------------------------- //
require_once '../config/config.inc';
require_once '../includes/giant/config.php';
require_once '../includes/giant/client.php';
require_once '../includes/dbbootstrap.php';
setDbConn('giantclient');
$date = date('Y-m-d H:i:s');
$commandes = Doctrine_Query::create()
->from('Commandes')
->where('ServiceLevelName != ?', 'Immediate')
->andWhere('OrderStatus = ?', 'Pending')
2010-10-28 14:27:28 +00:00
->execute();
foreach ($commandes as $c) {
2010-10-28 14:27:28 +00:00
if ($date < $c->DueDateTime) {
continue;
}
2010-10-28 14:27:28 +00:00
$status = giantEtatDeCommande($c);
if ($status == 'Pending') {
2010-10-28 14:27:28 +00:00
print $c->OrderId." pas encore disponible\n";
continue;
} else if ($status == 'Undeliverable') {
continue;
}
2010-10-28 14:27:28 +00:00
print $c->OrderId." complete\n";
}
?>