from('Commandes') ->where('ServiceLevelName != ?', 'Immediate') ->andWhere('OrderStatus = ?', 'Pending') ->execute(); foreach ($commandes as $c) { if ($date < $c->DueDateTime) { continue; } $status = giantEtatDeCommande($c); if ($status == 'Pending') { print $c->OrderId." pas encore disponible\n"; continue; } else if ($status == 'Undeliverable') { continue; } print $c->OrderId." complete\n"; } ?>