[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * $Id: liste.php,v 1.16 2005/09/10 14:41:53 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/prelevement/liste.php,v $ 21 */ 22 23 /** 24 \file htdocs/compta/prelevement/liste.php 25 \ingroup prelevement 26 \brief Page liste des prelevements 27 \version $Revision: 1.16 $ 28 */ 29 30 require ("./pre.inc.php"); 31 32 if (!$user->rights->prelevement->bons->lire) 33 accessforbidden(); 34 35 $langs->load("withdrawals"); 36 37 // Sécurité accés client 38 if ($user->societe_id > 0) 39 { 40 $action = ''; 41 $socidp = $user->societe_id; 42 } 43 44 45 /* 46 * 47 * 48 * 49 */ 50 51 llxHeader('',$langs->trans("WithdrawalsLines")); 52 53 $page = $_GET["page"]; 54 $sortorder = (empty($_GET["sortorder"])) ? "DESC" : $_GET["sortorder"]; 55 $sortfield = (empty($_GET["sortfield"])) ? "p.datec" : $_GET["sortfield"]; 56 $offset = $conf->liste_limit * $page ; 57 58 $sql = "SELECT p.rowid, p.statut, p.ref, pl.amount,".$db->pdate("p.datec")." as datec"; 59 $sql .= " , s.nom, s.code_client"; 60 $sql .= " , pl.rowid as rowid_ligne, pl.statut as statut_ligne"; 61 $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; 62 $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; 63 $sql .= " , ".MAIN_DB_PREFIX."societe as s"; 64 $sql .= " WHERE pl.fk_prelevement_bons = p.rowid"; 65 $sql .= " AND s.idp = pl.fk_soc"; 66 67 if ($_GET["search_ligne"]) 68 { 69 $sql .= " AND pl.rowid = '".$_GET["search_ligne"]."'"; 70 } 71 72 if ($_GET["search_bon"]) 73 { 74 $sql .= " AND p.ref LIKE '%".$_GET["search_bon"]."%'"; 75 } 76 77 if ($_GET["search_code"]) 78 { 79 $sql .= " AND s.code_client LIKE '%".$_GET["search_code"]."%'"; 80 } 81 82 if ($_GET["search_societe"]) 83 { 84 $sel =urldecode($_GET["search_societe"]); 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 92 if ($result) 93 { 94 $num = $db->num_rows($result); 95 $i = 0; 96 97 $urladd = "&statut=".$_GET["statut"]; 98 $urladd .= "&search_bon=".$_GET["search_bon"]; 99 100 print_barre_liste($langs->trans("WithdrawalsLines"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num); 101 102 print"\n<!-- debut table -->\n"; 103 print '<table class="liste" width="100%">'; 104 105 print '<tr class="liste_titre">'; 106 print '<td class="liste_titre">'.$langs->trans("Line").'</td>'; 107 print_liste_field_titre($langs->trans("WithdrawalReceipt"),"liste.php","p.ref"); 108 print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom"); 109 print_liste_field_titre($langs->trans("Date"),"liste.php","p.datec","","",'align="center"'); 110 print_liste_field_titre($langs->trans("Amount"),"liste.php","pl.amount"); 111 print_liste_field_titre($langs->trans("CustomerCode"),"liste.php","s.code_client",'','','align="center"'); 112 print '<td class="liste_titre"> </td>'; 113 print '</tr>'; 114 115 print '<form action="liste.php" method="GET">'; 116 print '<tr class="liste_titre">'; 117 print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="'. $_GET["search_ligne"].'" size="6"></td>'; 118 print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'. $_GET["search_bon"].'" size="8"></td>'; 119 print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" value="'. $_GET["search_societe"].'" size="12"></td>'; 120 print '<td class="liste_titre"> </td>'; 121 print '<td class="liste_titre"> </td>'; 122 print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'. $_GET["search_code"].'" size="8"></td>'; 123 print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'"></td>'; 124 print '</tr>'; 125 print '</form>'; 126 127 $var=True; 128 129 while ($i < min($num,$conf->liste_limit)) 130 { 131 $obj = $db->fetch_object($result); 132 133 $var=!$var; 134 135 print "<tr $bc[$var]><td>"; 136 137 print '<img border="0" src="./statut'.$obj->statut_ligne.'.png"></a> '; 138 print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid_ligne.'">'; 139 print substr('000000'.$obj->rowid_ligne, -6); 140 print '</a></td>'; 141 142 print '<td><img border="0" src="./statut'.$obj->statut.'.png"></a> '; 143 144 print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n"; 145 print '<td><a href="fiche.php?id='.$obj->rowid.'">'.stripslashes($obj->nom)."</a></td>\n"; 146 print '<td align="center">'.dolibarr_print_date($obj->datec)."</td>\n"; 147 print '<td align="right">'.price($obj->amount).' '.$langs->trans("Currency".$conf->monnaie)."</td>\n"; 148 print '<td align="center"><a href="fiche.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n"; 149 print '<td> </td>'; 150 151 print "</tr>\n"; 152 $i++; 153 } 154 print "</table>"; 155 $db->free($result); 156 } 157 else 158 { 159 dolibarr_print_error($db); 160 } 161 162 $db->close(); 163 164 165 llxFooter('$Date: 2005/09/10 14:41:53 $ - $Revision: 1.16 $'); 166 ?>
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 |
![]() |