[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * $Id: archives.php,v 1.5 2005/04/18 09:10:11 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/commande/archives.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 /* 25 * Sécurité accés client 26 */ 27 if ($user->societe_id > 0) 28 accessforbidden(); 29 30 31 llxHeader("","Telephonie - Commande - Archives"); 32 33 /* ***************************************** */ 34 $page = $_GET["page"]; 35 $sortorder = $_GET["sortorder"]; 36 $sortfield = $_GET["sortfield"]; 37 38 if ($sortorder == "") { 39 $sortorder="DESC"; 40 } 41 if ($sortfield == "") { 42 $sortfield="c.datec"; 43 } 44 45 if ($page == -1) { $page = 0 ; } 46 47 $offset = $conf->liste_limit * $page ; 48 $pageprev = $page - 1; 49 $pagenext = $page + 1; 50 51 $sql = "SELECT c.filename, u.name, u.firstname, f.nom,".$db->pdate("c.datec"). " as datec"; 52 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_commande as c"; 53 $sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f"; 54 $sql .= " ,".MAIN_DB_PREFIX."user as u"; 55 $sql .= " WHERE c.fk_user_creat = u.rowid AND c.fk_fournisseur = f.rowid"; 56 57 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); 58 59 $result = $db->query($sql); 60 if ($result) 61 { 62 $num = $db->num_rows(); 63 $i = 0; 64 65 print_barre_liste("Commandes archives", $page, "archives.php", "", $sortfield, $sortorder, '', $num); 66 67 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 68 print '<tr class="liste_titre"><td valign="center">Date</td>'; 69 print '<td>Utilisateur</td>'; 70 print '<td>Fournisseur</td>'; 71 print '<td>Fichier</td>'; 72 print '</tr>'; 73 74 $var=True; 75 76 while ($i < min($num,$conf->liste_limit)) 77 { 78 $obj = $db->fetch_object($i); 79 $var=!$var; 80 81 print "<tr $bc[$var]>"; 82 print "<td>".strftime("%a %d %b %Y %HH%M",$obj->datec)."</td>\n"; 83 84 print "<td>".$obj->firstname . " ".$obj->name."</td>\n"; 85 print "<td>".$obj->nom."</td>\n"; 86 87 $dir = $conf->telephonie->dir_output . "/ligne/commande/"; 88 $relativepath = urlencode("ligne/commande/".$obj->filename); 89 90 if (substr($obj->filename, -3) == 'txt') 91 { 92 print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=telephonie&file='.urlencode($relativepath).'&type=plain/text">'.$obj->filename.'</a></td>'; 93 } 94 else 95 { 96 print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=telephonie&file='.urlencode($relativepath).'&type=application/msexcel">'.$obj->filename.'</a></td>'; 97 } 98 99 print "</tr>\n"; 100 $i++; 101 } 102 print "</table>"; 103 $db->free(); 104 } 105 else 106 { 107 dolibarr_print_error($db); 108 } 109 110 $db->close(); 111 112 llxFooter("<em>Dernière modification $Date: 2005/04/18 09:10:11 $ révision $Revision: 1.5 $</em>"); 113 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |