[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2001-2005 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: index.php,v 1.28 2005/10/16 14:09:57 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/fourn/index.php,v $ 21 */ 22 23 /** 24 \file htdocs/fourn/index.php 25 \ingroup fournisseur 26 \brief Page accueil de la zone fournisseurs 27 \version $Revision: 1.28 $ 28 */ 29 30 require ("./pre.inc.php"); 31 32 if (!$user->rights->societe->lire) 33 accessforbidden(); 34 35 36 $page = isset($_GET["page"])?$_GET["page"]:''; 37 $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:''; 38 $sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:''; 39 $socname = isset($_GET["socname"])?$_GET["socname"]:''; 40 $search_nom = isset($_GET["search_nom"])?$_GET["search_nom"]:''; 41 $search_ville = isset($_GET["search_ville"])?$_GET["search_ville"]:''; 42 43 $langs->load("suppliers"); 44 $langs->load("orders"); 45 $langs->load("companies"); 46 47 llxHeader(); 48 49 // Sécurité accés client 50 $socidp=''; 51 if ($user->societe_id > 0) 52 { 53 $action = ''; 54 $socidp = $user->societe_id; 55 } 56 57 if ($page == -1) { $page = 0 ; } 58 59 $offset = $conf->liste_limit * $page ; 60 if (! $sortorder) $sortorder="ASC"; 61 if (! $sortfield) $sortfield="nom"; 62 63 64 /* 65 * Mode Liste 66 * 67 */ 68 69 $sql = "SELECT s.idp, s.nom, s.ville,".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm"; 70 $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st"; 71 $sql.= " WHERE s.fk_stcomm = st.id AND s.fournisseur=1"; 72 if ($socidp) $sql .= " AND s.idp=$socidp"; 73 if ($socname) { 74 $sql .= " AND lower(s.nom) like '%".strtolower($socname)."%'"; 75 $sortfield = "lower(s.nom)"; 76 $sortorder = "ASC"; 77 } 78 if ($search_nom) 79 { 80 $sql .= " AND s.nom LIKE '%".$search_nom."%'"; 81 } 82 if ($search_ville) 83 { 84 $sql .= " AND s.ville LIKE '%".$search_ville."%'"; 85 } 86 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); 87 88 $resql = $db->query($sql); 89 if ($resql) 90 { 91 $num = $db->num_rows($resql); 92 $i = 0; 93 94 print_barre_liste($langs->trans("ListOfSuppliers"), $page, "index.php", "", $sortfield, $sortorder, '', $num); 95 96 print '<table class="liste" width="100%">'; 97 print '<tr class="liste_titre">'; 98 print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","",'valign="middle"',$sortfield); 99 print_liste_field_titre($langs->trans("Town"),"index.php","s.ville","","",'valign="middle"',$sortfield); 100 print_liste_field_titre($langs->trans("DateCreation"),"index.php","datec","","",'align="center"',$sortfield); 101 print '<td class="liste_titre"> </td>'; 102 print "</tr>\n"; 103 104 print '<tr class="liste_titre">'; 105 print '<form action="index.php" method="GET">'; 106 print '<td class="liste_titre"><input type="text" class="flat" name="search_nom" value="'.$search_nom.'"></td>'; 107 print '<td class="liste_titre"><input type="text" class="flat" name="search_ville" value="'.$search_ville.'"></td>'; 108 print '<td class="liste_titre" colspan="2" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'"></td>'; 109 print '</form>'; 110 print '</tr>'; 111 112 $var=True; 113 114 while ($i < min($num,$conf->liste_limit)) 115 { 116 $obj = $db->fetch_object($resql); 117 $var=!$var; 118 119 print "<tr $bc[$var]>"; 120 print '<td><a href="fiche.php?socid='.$obj->idp.'">'.img_object($langs->trans("ShowSupplier"),"company").'</a>'; 121 print " <a href=\"fiche.php?socid=$obj->idp\">$obj->nom</a></td>\n"; 122 print "<td>".$obj->ville."</td>\n"; 123 print '<td align="center">'.dolibarr_print_date($obj->datec).'</td>'; 124 print "<td> </td>\n"; 125 print "</tr>\n"; 126 $i++; 127 } 128 print "</table>"; 129 $db->free($resql); 130 } 131 else 132 { 133 dolibarr_print_error($db); 134 } 135 136 $db->close(); 137 138 llxFooter('$Date: 2005/10/16 14:09:57 $ - $Revision: 1.28 $'); 139 ?>
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 |
![]() |