[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 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: historique.php,v 1.2 2005/03/23 09:22:18 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/commande/historique.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 $page = $_GET["page"]; 25 $sortorder = $_GET["sortorder"]; 26 $sortfield = $_GET["sortfield"]; 27 28 llxHeader('','Telephonie - Ligne - Liste'); 29 /* 30 * Sécurité accés client 31 */ 32 if ($user->societe_id > 0) 33 { 34 $action = ''; 35 $socidp = $user->societe_id; 36 } 37 38 if ($sortorder == "") { 39 $sortorder="DESC"; 40 } 41 if ($sortfield == "") { 42 $sortfield="ls.tms"; 43 } 44 45 /* 46 * Recherche 47 * 48 * 49 */ 50 51 if ($page == -1) { $page = 0 ; } 52 53 $offset = $conf->liste_limit * $page ; 54 $pageprev = $page - 1; 55 $pagenext = $page + 1; 56 57 /* 58 * Mode Liste 59 * 60 * 61 * 62 */ 63 64 $sql = "SELECT s.idp as socidp, s.nom, l.ligne, f.nom as fournisseur, l.statut, l.rowid, l.remise"; 65 $sql .= " , ".$db->pdate("ls.tms")." as dc"; 66 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; 67 $sql .= " ,".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; 68 $sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne_statut as ls"; 69 $sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f"; 70 $sql .= " WHERE l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid"; 71 $sql .= " AND ls.fk_ligne = l.rowid"; 72 $sql .= " AND ls.statut = 2"; 73 74 if ($_GET["search_ligne"]) 75 { 76 $sel =urldecode($_GET["search_ligne"]); 77 $sel = ereg_replace("\.","",$sel); 78 $sel = ereg_replace(" ","",$sel); 79 $sql .= " AND l.ligne LIKE '%".$sel."%'"; 80 } 81 82 if ($_GET["search_client"]) 83 { 84 $sel =urldecode($_GET["search_client"]); 85 $sql .= " AND s.nom LIKE '%".$sel."%'"; 86 } 87 88 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); 89 90 $result = $db->query($sql); 91 if ($result) 92 { 93 $num = $db->num_rows(); 94 $i = 0; 95 96 $urladd= "&statut=".$_GET["statut"]; 97 98 print_barre_liste("Lignes", $page, "historique.php", $urladd, $sortfield, $sortorder, '', $num); 99 print"\n<!-- debut table -->\n"; 100 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 101 print '<tr class="liste_titre">'; 102 103 print '<td> </td>'; 104 105 print_liste_field_titre("Ligne","historique.php","l.ligne"); 106 print_liste_field_titre("Client (Agence/Filiale)","historique.php","s.nom"); 107 108 print '<td align="center">Statut</td>'; 109 110 print '<td>Fournisseur</td>'; 111 112 print "</tr>\n"; 113 114 print '<tr class="liste_titre">'; 115 print '<form action="historique.php" method="GET">'; 116 print '<td> </td>'; 117 print '<td><input type="text" name="search_ligne" value="'. $_GET["search_ligne"].'" size="10"></td>'; 118 119 print '<td><input type="submit" value="Chercher"></td>'; 120 121 print '<td> </td>'; 122 print '<td> </td>'; 123 124 print '</form>'; 125 print '</tr>'; 126 127 128 $var=True; 129 130 $ligne = new LigneTel($db); 131 132 while ($i < min($num,$conf->liste_limit)) 133 { 134 $obj = $db->fetch_object(); 135 $var=!$var; 136 137 print "<tr $bc[$var]>"; 138 print '<td>'.strftime("%d/%m/%Y %H:%M", $obj->dc).'</td>'; 139 print '<td><img src="./graph'.$obj->statut.'.png"> '; 140 141 print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'; 142 print img_file(); 143 print '</a> '; 144 145 print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne)."</a></td>\n"; 146 147 print '<td><a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$obj->socidp.'">'.stripslashes($obj->nom).'</a></td>'; 148 149 150 print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n"; 151 152 153 print "<td>".$obj->fournisseur."</td>\n"; 154 print "</tr>\n"; 155 $i++; 156 } 157 print "</table>"; 158 $db->free(); 159 } 160 else 161 { 162 print $db->error() . ' ' . $sql; 163 } 164 165 $db->close(); 166 167 llxFooter("<em>Dernière modification $Date: 2005/03/23 09:22:18 $ révision $Revision: 1.2 $</em>"); 168 ?>
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 |
![]() |