[ 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: contrats.php,v 1.2 2005/09/02 11:47:19 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/service/contrats.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 if (!$user->rights->telephonie->service->lire) 25 accessforbidden(); 26 27 $page = $_GET["page"]; 28 $sortorder = $_GET["sortorder"]; 29 $sortfield = $_GET["sortfield"]; 30 31 llxHeader('','Telephonie - Services - Liste'); 32 /* 33 * Sécurité accés client 34 */ 35 if ($user->societe_id > 0) 36 { 37 $action = ''; 38 $socidp = $user->societe_id; 39 } 40 41 if ($sortorder == "") { 42 $sortorder="ASC"; 43 } 44 if ($sortfield == "") { 45 $sortfield="s.nom"; 46 } 47 48 /* 49 * Recherche 50 * 51 * 52 */ 53 54 if ($page == -1) { $page = 0 ; } 55 56 $offset = $conf->liste_limit * $page ; 57 $pageprev = $page - 1; 58 $pagenext = $page + 1; 59 60 /* 61 * Mode Liste 62 * 63 * 64 * 65 */ 66 67 if ($_GET["id"]) 68 { 69 70 $service = new TelephonieService($db); 71 72 if ( $service->fetch($_GET["id"]) == 0 ) 73 { 74 75 76 $h=0; 77 $head[$h][0] = DOL_URL_ROOT."/telephonie/service/fiche.php?id=".$service->id; 78 $head[$h][1] = $langs->trans("Service"); 79 $h++; 80 81 $head[$h][0] = DOL_URL_ROOT."/telephonie/service/contrats.php?id=".$service->id; 82 $head[$h][1] = "Contrats"; 83 $hselected = $h; 84 $h++; 85 86 dolibarr_fiche_head($head, $hselected, 'Service : '.$service->id); 87 88 89 $sql = "SELECT s.idp as socidp, s.nom as nom_facture"; 90 $sql .= " , c.ref, cs.montant, c.rowid as crowid"; 91 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; 92 $sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat as c"; 93 $sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat_service as cs"; 94 $sql .= " WHERE cs.fk_service = ".$_GET["id"]; 95 $sql .= " AND cs.fk_contrat = c.rowid"; 96 $sql .= " AND s.idp = c.fk_soc_facture"; 97 98 if ($_GET["search_client"]) 99 { 100 $sel =urldecode($_GET["search_client"]); 101 $sql .= " AND s.nom LIKE '%".$sel."%'"; 102 } 103 104 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); 105 106 $resql = $db->query($sql); 107 if ($resql) 108 { 109 $num = $db->num_rows($resql); 110 $i = 0; 111 112 $urladd= "&id=".$_GET["id"]; 113 114 print_barre_liste("Contrats", $page, "contrats.php", $urladd, $sortfield, $sortorder, '', $num); 115 print"\n<!-- debut table -->\n"; 116 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 117 print '<tr class="liste_titre">'; 118 119 print_liste_field_titre("Contrat","contrats.php","c.ref","",$urladd); 120 print_liste_field_titre("Client","contrats.php","s.nom","",$urladd); 121 122 print '<td align="right">Montant</td>'; 123 124 print "</tr>\n"; 125 126 /* 127 print '<tr class="liste_titre">'; 128 print '<form action="liste.php" method="GET">'; 129 print '<td><input type="text" name="search_ligne" value="'. $_GET["search_ligne"].'" size="10"></td>'; 130 print '<td><input type="text" name="search_client" value="'. $_GET["search_client"].'" size="10"></td>'; 131 print '<td><input type="submit" value="Chercher"></td>'; 132 print '</form>'; 133 print '</tr>'; 134 */ 135 136 $var=True; 137 138 while ($i < min($num,$conf->liste_limit)) 139 { 140 $obj = $db->fetch_object($resql); 141 $var=!$var; 142 143 print "<tr $bc[$var]><td>"; 144 145 print '<a href="'.DOL_URL_ROOT.'/telephonie/contrat/fiche.php?id='.$obj->crowid.'">'; 146 print img_file(); 147 print '</a> '; 148 149 print '<a href="'.DOL_URL_ROOT.'/telephonie/contrat/fiche.php?id='.$obj->crowid.'">'.$obj->ref."</a></td>\n"; 150 151 print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->sfidp.'">'.stripslashes($obj->nom_facture).'</a></td>'; 152 153 print '<td align="right">'.price($obj->montant)."</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 } 166 167 $db->close(); 168 169 llxFooter("<em>Dernière modification $Date: 2005/09/02 11:47:19 $ révision $Revision: 1.2 $</em>"); 170 ?>
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 |
![]() |