[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2004-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.5 2005/10/19 05:12:49 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/param/comptes/liste.php,v $ 21 */ 22 23 require ("./pre.inc.php"); 24 25 26 llxHeader('','Compta - Liste des comptes'); 27 28 $page = $_GET["page"]; 29 $sortorder = $_GET["sortorder"]; 30 $sortfield = $_GET["sortfield"]; 31 if ($sortorder == "") $sortorder="ASC"; 32 if ($sortfield == "") $sortfield="cg.numero"; 33 34 $offset = $conf->liste_limit * $page ; 35 36 /* 37 * Mode Liste 38 * 39 * 40 * 41 */ 42 43 $sql = "SELECT cg.rowid, cg.numero, cg.intitule, ".$db->pdate("cg.date_creation")." as dc"; 44 45 $sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux as cg"; 46 47 if (strlen(trim($_GET["search_numero"])) ) 48 { 49 50 $sql .= " WHERE cg.numero LIKE '%".$_GET["search_numero"]."%'"; 51 52 if ( strlen(trim($_GET["search_intitule"]))) 53 { 54 $sql .= " AND cg.intitule LIKE '%".$_GET["search_intitule"]."%'"; 55 } 56 57 } 58 else 59 { 60 if ( strlen(trim($_GET["search_intitule"]))) 61 { 62 $sql .= " WHERE cg.intitule LIKE '%".$_GET["search_intitule"]."%'"; 63 } 64 } 65 66 67 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); 68 69 $resql = $db->query($sql); 70 if ($resql) 71 { 72 $num = $db->num_rows($resql); 73 $i = 0; 74 75 print_barre_liste("Comptes généraux", $page, "liste.php", "", $sortfield, $sortorder, '', $num); 76 77 print '<table class="liste">'; 78 print '<tr class="liste_titre">'; 79 print_liste_field_titre($langs->trans("AccountNumberShort"),"liste.php","cg.numero"); 80 print_liste_field_titre($langs->trans("Label"),"liste.php","cg.intitule"); 81 print_liste_field_titre($langs->trans("DateCreation"),"liste.php","cg.date_creation"); 82 print "</tr>\n"; 83 84 print '<tr class="liste_titre">'; 85 print '<form action="liste.php" method="GET">'; 86 print '<td><input type="text" name="search_numero" value="'.$_GET["search_numero"].'"></td>'; 87 print '<td><input type="text" name="search_intitule" value="'.$_GET["search_intitule"].'"></td>'; 88 print '<td align="right">'; 89 print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">'; 90 print '</td>'; 91 print '</form>'; 92 print '</tr>'; 93 94 $var=True; 95 96 while ($i < min($num,$conf->liste_limit)) 97 { 98 $obj = $db->fetch_object($resql); 99 $var=!$var; 100 101 print "<tr $bc[$var]>"; 102 103 print '<td>'.$obj->numero.'</td>'."\n"; 104 print '<td>'.$obj->intitule.'</td>'; 105 print '<td align="right" width="100">'; 106 print dolibarr_print_date($obj->dc); 107 108 print '</td>'; 109 print "</tr>\n"; 110 $i++; 111 } 112 print "</table>"; 113 $db->free($resql); 114 } 115 else 116 { 117 dolibarr_print_error($db); 118 } 119 120 $db->close(); 121 122 llxFooter("<em>Dernière modification $Date: 2005/10/19 05:12:49 $ révision $Revision: 1.5 $</em>"); 123 ?>
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 |
![]() |