'Toutes', 'Pending' => 'En attente ', // Espace pour le pluriel 'Completed' => 'Completées', 'Delivered' => 'Délivrées', 'Undeliverable' => 'Non délivrables', 'NonD' => 'Non délivrées'); define('NB_PAR_PAGE', 10); // --------------------------------------------------------------------------- // // afficheElem // --------------------------------------------------------------------------- // function afficheElem($obj, $retrait = '') { if (is_object($obj) == true) { $tab = get_object_vars($obj); } else if (is_array($obj) == true) { $tab = $obj; } else { $obj = str_replace('&', '&', $obj); print "$retrait$obj\n"; return; } foreach ($tab as $label => $valeur) { if (is_object($valeur) == true) { print "$retrait<$label>\n"; afficheElem($valeur, $retrait.' '); print "$retrait$label>\n"; } else if (is_array($valeur) == true) { foreach ($valeur as $indice => $elem) { print "$retrait<$label>\n"; afficheElem($elem, $retrait.' '); print "$retrait$label>\n"; } } else { $valeur = str_replace('&', '&', $valeur); print "$retrait<$label>$valeur$label>\n"; } } } // --------------------------------------------------------------------------- // // Affichage du document // --------------------------------------------------------------------------- // if ($action == 'xml' || $action == 'txt') { $commande = Doctrine_Query::create() ->from('Commandes') ->where('OrderId = ?', $commande_id) ->andWhere('User = ?', $_SESSION['tabInfo']['login']) ->fetchOne(); $nom = $commande->CompanyName.'.'.$action; $rapport = Doctrine_Query::create() ->from('Rapports') ->where('OrderId = ?', $commande_id) ->andWhere('User = ?', $_SESSION['tabInfo']['login']) ->fetchOne(); $obj = unserialize($rapport->DataSet); if ($action == 'xml') { header('Content-type: text/xml'); header('Content-Disposition: attachment; filename="'.$nom.'"'); afficheElem($obj); } else { header('Content-type: text/plain'); header('Content-Disposition: attachment; filename="'.$nom.'"'); print_r($obj); } if ($commande->OrderStatus == 'Completed') { $commande->OrderStatus = 'Delivered'; $commande->save(); } exit; } // --------------------------------------------------------------------------- // // Affichage du document HTML // --------------------------------------------------------------------------- // if ($action == 'html') { $commande = Doctrine_Query::create() ->from('Commandes') ->where('OrderId = ?', $commande_id) ->andWhere('User = ?', $_SESSION['tabInfo']['login']) ->fetchOne(); if ($commande->OrderStatus == 'Completed') { $commande->OrderStatus = 'Delivered'; $commande->save(); } $r = Doctrine_Query::create() ->from('Rapports') ->where('OrderId = ?', $commande_id) ->andWhere('User = ?', $_SESSION['tabInfo']['login']) ->fetchOne(); header('Location: /?page=giant_rapport&OrderId='.$commande_id); print 'Veuillez suivre ce lien'; exit; } ?>
'.$c1.' | '.$c2.' |
';
if ($delivree == true) {
print '';
}
print $commande->CompanyName;
if ($delivree == true) {
print '';
}
print ' '. 'Type d\'enquête: '. ''.$commande->ServiceLevelName.', '. ''.$commande->DataSetType.'. '. 'Langage: '. ''.$commande->LanguageCode.' '. 'État: '; if ($delivree == true) { print ''; } print substr($etatsEnq[$commande->OrderStatus], 0, -1); if ($delivree == true) { print ' '; $reports = Doctrine_Query::create() ->from('Rapports') ->where('OrderId = ?', $commande->OrderId) ->andWhere('User = ?', $_SESSION['tabInfo']['login']) ->orderby('ReportId') ->execute(); foreach ($reports as $report) { boutonPost('html', 'commande_id', $commande->OrderId, $etat_enq); boutonPost('xml', 'commande_id', $commande->OrderId, $etat_enq); boutonPost('txt', 'commande_id', $commande->OrderId, $etat_enq); } if (count($reports) > 0) { boutonPost('Supprimer', 'commande_id', $commande->OrderId, $etat_enq); } else { $delivree = false; } } print ' | '; tableDebut(); tableLigne('Date de commande:', datetime2date($commande->OrderDateTime)); tableLigne('Date de réception prévue:', datetime2date($commande->DueDateTime)); if ($delivree == true) { tableLigne('Date de mise à jour:', datetime2date($commande->DateTimeCompleted)); } tableFin(); print ' |
'; if ($page_num > 1) { print ''; print ''; print ''; } print ' | '; print 'Page '.$page_num.'/'.$nb_pages.' | '; print ''; if ($page_num < $nb_pages) { print ''; print ''; print ''; } print ' | '; print '