[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-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.15 2005/08/11 20:28:11 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/dons/liste.php,v $ 21 * 22 */ 23 24 /** 25 \file htdocs/compta/dons/liste.php 26 \ingroup don 27 \brief Page de liste des dons 28 \version $Revision: 1.15 $ 29 */ 30 31 require ("./pre.inc.php"); 32 33 $langs->load("donations"); 34 35 llxHeader(); 36 37 $sortorder=$_GET["sortorder"]; 38 $sortfield=$_GET["sortfield"]; 39 $statut=isset($_GET["statut"])?$_GET["statut"]:"-1"; 40 $page=$_GET["page"]; 41 42 if ($sortorder == "") { $sortorder="DESC"; } 43 if ($sortfield == "") { $sortfield="d.datedon"; } 44 45 if ($page == -1) { $page = 0 ; } 46 47 $offset = $conf->liste_limit * $page ; 48 $pageprev = $page - 1; 49 $pagenext = $page + 1; 50 51 // Genere requete de liste des dons 52 $sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet"; 53 $sql .= " FROM ".MAIN_DB_PREFIX."don as d left join ".MAIN_DB_PREFIX."don_projet as p"; 54 $sql .= " ON p.rowid = d.fk_don_projet WHERE 1 = 1"; 55 if ($statut >= 0) 56 { 57 $sql .= " AND d.fk_statut = ".$statut; 58 } 59 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); 60 61 $result = $db->query($sql); 62 if ($result) 63 { 64 $num = $db->num_rows($result); 65 $i = 0; 66 67 if ($statut >= 0) 68 { 69 print_barre_liste($libelle[$statut], $page, "liste.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield"); 70 } 71 else 72 { 73 print_barre_liste($langs->trans("Donation"), $page, "liste.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield"); 74 } 75 print "<table class=\"noborder\" width=\"100%\">"; 76 77 print '<tr class="liste_titre">'; 78 print_liste_field_titre($langs->trans("Ref"),"liste.php","d.rowid","&page=$page&statut=$statut","","",$sortfield); 79 print_liste_field_titre($langs->trans("Firstname"),"liste.php","d.prenom","&page=$page&statut=$statut","","",$sortfield); 80 print_liste_field_titre($langs->trans("Name"),"liste.php","d.nom","&page=$page&statut=$statut","","",$sortfield); 81 print_liste_field_titre($langs->trans("Company"),"liste.php","d.societe","&page=$page&statut=$statut","","",$sortfield); 82 print_liste_field_titre($langs->trans("Date"),"liste.php","d.datedon","&page=$page&statut=$statut","","",$sortfield); 83 if ($conf->projet->enabled) { 84 $langs->load("projects"); 85 print_liste_field_titre($langs->trans("Project"),"liste.php","projet","&page=$page&statut=$statut","","",$sortfield); 86 } 87 print_liste_field_titre($langs->trans("Amount"),"liste.php","d.amount","&page=$page&statut=$statut","",'align="right"',$sortfield); 88 print '<td> </td>'; 89 print "</tr>\n"; 90 91 $var=True; 92 while ($i < $num) 93 { 94 $objp = $db->fetch_object($result); 95 $var=!$var; 96 print "<tr $bc[$var]>"; 97 print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".$objp->rowid."</a></td>\n"; 98 print "<td>".stripslashes($objp->prenom)."</td>\n"; 99 print "<td>".stripslashes($objp->nom)."</td>\n"; 100 print "<td>".stripslashes($objp->societe)."</td>\n"; 101 print "<td>".dolibarr_print_date($objp->datedon).'</td>'; 102 if ($conf->projet->enabled) { 103 print "<td>$objp->projet</td>\n"; 104 } 105 print '<td align="right">'.price($objp->amount).'</td><td> </td>'; 106 107 print "</tr>"; 108 $i++; 109 } 110 print "</table>"; 111 } 112 else 113 { 114 dolibarr_print_error($db); 115 } 116 117 118 $db->close(); 119 120 llxFooter('$Date: 2005/08/11 20:28:11 $ - $Revision: 1.15 $'); 121 ?>
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 |
![]() |