[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/compta/prelevement/ -> bons.php (source)

   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: bons.php,v 1.11 2005/09/10 14:24:10 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/prelevement/bons.php,v $
  21   */
  22  
  23  /**
  24          \file       htdocs/compta/prelevement/bons.php
  25          \ingroup    prelevement
  26          \brief      Page liste des bons de prelevements
  27          \version    $Revision: 1.11 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  
  32  if (!$user->rights->prelevement->bons->lire)
  33    accessforbidden();
  34  
  35  $page = $_GET["page"];
  36  $sortorder = $_GET["sortorder"];
  37  $sortfield = $_GET["sortfield"];
  38  
  39  
  40  llxHeader('','Prélèvements - Bons');
  41  
  42  /*
  43   * Sécurité accés client
  44   */
  45  if ($user->societe_id > 0) 
  46  {
  47    $action = '';
  48    $socidp = $user->societe_id;
  49  }
  50  
  51  
  52  if ($page == -1) { $page = 0 ; }
  53  $offset = $conf->liste_limit * $page ;
  54  $pageprev = $page - 1;
  55  $pagenext = $page + 1;
  56  if (! $sortorder) $sortorder="DESC";
  57  if (! $sortfield) $sortfield="p.datec";
  58  
  59  
  60  /*
  61   * Mode Liste
  62   *
  63   */
  64  $sql = "SELECT p.rowid, p.ref, p.amount,".$db->pdate("p.datec")." as datec";
  65  $sql .= ", p.statut";
  66  $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
  67  
  68  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
  69  
  70  $result = $db->query($sql);
  71  if ($result)
  72  {
  73    $num = $db->num_rows($result);
  74    $i = 0;
  75    
  76    $urladd= "&amp;statut=".$_GET["statut"];
  77  
  78    print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, "bons.php", $urladd, $sortfield, $sortorder, '', $num);
  79  
  80    print"\n<!-- debut table -->\n";
  81    print '<table class="liste" width="100%">';
  82  
  83    print '<tr class="liste_titre">';
  84    print_liste_field_titre($langs->trans("WithdrawalReceipt"),"bons.php","p.ref",'','','class="liste_titre"');
  85    print_liste_field_titre($langs->trans("Date"),"bons.php","p.datec","","",'class="liste_titre" align="center"');
  86    print '<td class="liste_titre" align="right">'.$langs->trans("Amount").'</td>';
  87    print '</tr>';
  88    
  89    print '<tr class="liste_titre">';
  90    print '<form action="bons.php" method="GET">';
  91    print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="'. $_GET["search_ligne"].'" size="10"></td>'; 
  92    print '<td class="liste_titre">&nbsp;</td>';
  93    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>';
  94    print '</form>';
  95    print '</tr>';
  96  
  97    $var=True;
  98  
  99    while ($i < min($num,$conf->liste_limit))
 100      {
 101        $obj = $db->fetch_object($result);
 102        $var=!$var;
 103  
 104        print "<tr $bc[$var]><td>";
 105        print '<img border="0" src="./statut'.$obj->statut.'.png"></a>&nbsp;';
 106  
 107        print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
 108  
 109        print '<td align="center">'.strftime("%d/%m/%Y",$obj->datec)."</td>\n";
 110  
 111        print '<td align="right">'.price($obj->amount).' '.$langs->trans("Currency".$conf->monnaie)."</td>\n";
 112  
 113        print "</tr>\n";
 114        $i++;
 115      }
 116    print "</table>";
 117    $db->free($result);
 118  }
 119  else 
 120  {
 121    dolibarr_print_error($db);
 122  }
 123  
 124  $db->close();
 125  
 126  llxFooter('$Date: 2005/09/10 14:24:10 $ - $Revision: 1.11 $');
 127  
 128  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics