[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2004 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: groupe.php,v 1.3 2005/03/23 09:23:33 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/groupe.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="ASC"; 40 } 41 if ($sortfield == "") { 42 $sortfield="l.statut"; 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 g.nom as gnom, s.idp as socidp, sf.idp as sfidp, sf.nom as nom_facture,s.nom, l.ligne, l.statut, l.rowid, l.remise"; 65 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; 66 $sql .= " , ".MAIN_DB_PREFIX."societe as sf"; 67 68 69 $sql .= " , ".MAIN_DB_PREFIX."telephonie_groupeligne as g"; 70 $sql .= " , ".MAIN_DB_PREFIX."telephonie_groupe_ligne as gl"; 71 72 73 $sql .= " WHERE l.fk_soc = s.idp "; 74 75 $sql .= " AND g.rowid = gl.fk_groupe"; 76 $sql .= " AND gl.fk_ligne = l.rowid"; 77 78 79 $sql .= " AND l.fk_soc_facture = sf.idp"; 80 81 if ($_GET["search_ligne"]) 82 { 83 $sel =urldecode($_GET["search_ligne"]); 84 $sel = ereg_replace("\.","",$sel); 85 $sel = ereg_replace(" ","",$sel); 86 $sql .= " AND l.ligne LIKE '%".$sel."%'"; 87 } 88 89 if ($_GET["search_client"]) 90 { 91 $sel =urldecode($_GET["search_client"]); 92 $sql .= " AND s.nom LIKE '%".$sel."%'"; 93 } 94 95 if ($_GET["search_client_facture"]) 96 { 97 $sel =urldecode($_GET["search_client_facture"]); 98 $sql .= " AND sf.nom LIKE '%".$sel."%'"; 99 } 100 101 if (strlen($_GET["statut"])) 102 { 103 $sql .= " AND l.statut = ".$_GET["statut"]; 104 } 105 106 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); 107 108 $result = $db->query($sql); 109 if ($result) 110 { 111 $num = $db->num_rows(); 112 $i = 0; 113 114 $urladd= "&statut=".$_GET["statut"]; 115 116 print_barre_liste("Lignes", $page, "groupe.php", $urladd, $sortfield, $sortorder, '', $num); 117 print"\n<!-- debut table -->\n"; 118 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 119 print '<tr class="liste_titre"><td>Groupe</td>'; 120 121 print_liste_field_titre("Ligne","groupe.php","l.ligne"); 122 print_liste_field_titre("Client","groupe.php","s.nom"); 123 124 print '<td>Client facturé</td>'; 125 print '<td align="center">Statut</td>'; 126 127 print_liste_field_titre("Remise LMN","groupe.php","l.remise","","",' align="center"'); 128 129 print "</tr>\n"; 130 131 print '<tr class="liste_titre">'; 132 print '<form action="groupe.php" method="GET">'; 133 print '<td> </td>'; 134 print '<td><input type="text" name="search_ligne" value="'. $_GET["search_ligne"].'" size="12"></td>'; 135 print '<td><input type="text" name="search_client" value="'. $_GET["search_client"].'" size="20"></td>'; 136 print '<td><input type="text" name="search_client_facture" value="'. $_GET["search_client_facture"].'" size="20"></td>'; 137 138 print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td>'; 139 140 print '<td> </td>'; 141 142 print '</form>'; 143 print '</tr>'; 144 145 146 $var=True; 147 148 $ligne = new LigneTel($db); 149 150 while ($i < min($num,$conf->liste_limit)) 151 { 152 $obj = $db->fetch_object(); 153 $var=!$var; 154 155 print "<tr $bc[$var]>"; 156 157 print "<td>".$obj->gnom."</td><td>\n"; 158 159 print '<img src="./graph'.$obj->statut.'.png"> '; 160 161 print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'; 162 print img_file(); 163 print '</a> '; 164 165 print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne)."</a></td>\n"; 166 167 print '<td>'.$obj->nom.'</td>'; 168 print '<td>'.$obj->nom_facture.'</td>'; 169 170 print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n"; 171 172 print '<td align="center">'.$obj->remise." %</td>\n"; 173 174 print "</tr>\n"; 175 $i++; 176 } 177 print "</table>"; 178 $db->free(); 179 } 180 else 181 { 182 print $db->error() . ' ' . $sql; 183 } 184 185 $db->close(); 186 187 llxFooter("<em>Dernière modification $Date: 2005/03/23 09:23:33 $ révision $Revision: 1.3 $</em>"); 188 ?>
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 |
![]() |