[ 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/ -> charges.php (source)

   1  <?php
   2  /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * $Id: charges.php,v 1.6 2004/10/23 17:01:20 eldy Exp $
   5   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/charges.php,v $
   6   *
   7   * This program is free software; you can redistribute it and/or modify
   8   * it under the terms of the GNU General Public License as published by
   9   * the Free Software Foundation; either version 2 of the License, or
  10   * (at your option) any later version.
  11   *
  12   * This program is distributed in the hope that it will be useful,
  13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15   * GNU General Public License for more details.
  16   *
  17   * You should have received a copy of the GNU General Public License
  18   * along with this program; if not, write to the Free Software
  19   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20   *
  21   */
  22  
  23  /*!    \file htdocs/compta/charges.php
  24          \ingroup    compta
  25          \brief      Page liste des charges sociales
  26          \version    $Revision: 1.6 $
  27  */
  28  
  29  require ("./pre.inc.php");
  30  
  31  $langs->load("compta");
  32  
  33  llxHeader();
  34  
  35  
  36  function valeur($sql) {
  37    global $db;
  38    if ( $db->query($sql) ) {
  39      if ( $db->num_rows() ) {
  40        $valeur = $db->result(0,0);
  41      }
  42      $db->free();
  43    }
  44    return $valeur;
  45  }
  46  
  47  /*
  48   * Action ajout en bookmark
  49   */
  50  if ($action == 'add_bookmark') {
  51    $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");";
  52    if (! $db->query($sql) ) {
  53      print $db->error();
  54    }
  55  }
  56  
  57  if ($action == 'del_bookmark') {
  58    $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=$bid";
  59    $result = $db->query($sql);
  60  }
  61  
  62  
  63  print_titre("Charges");
  64  
  65  print '<table width="100%">';
  66  
  67  print '<tr><td valign="top" width="30%">';
  68  
  69  
  70  print '<table class="noborder" width="100%">';
  71  print "<tr class=\"liste_titre\">";
  72  print "<td colspan=\"2\">Factures</td>";
  73  print "</tr>\n";
  74  
  75  $sql = "SELECT c.libelle as nom, sum(s.amount) as total";
  76  $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."chargesociales as s";
  77  $sql .= " WHERE s.fk_type = c.id AND s.paye = 1";
  78  $sql .= " GROUP BY lower(c.libelle) ASC";
  79  
  80  if ( $db->query($sql) ) {
  81    $num = $db->num_rows();
  82    $i = 0;
  83  
  84    while ($i < $num) {
  85      $obj = $db->fetch_object();
  86      $var = !$var;
  87      print "<tr $bc[$var]>";
  88      print '<td>'.$obj->nom.'</td><td>'.price($obj->total).'</td>';
  89      print '</tr>';
  90      $i++;
  91    }
  92  } else {
  93    dolibarr_print_error($db);
  94  }
  95  
  96  
  97  print "</table><br>";
  98  
  99  print '</td></tr>';
 100  
 101  print '</table>';
 102  
 103  $db->close();
 104   
 105  llxFooter("<em>Derni&egrave;re modification $Date: 2004/10/23 17:01:20 $ r&eacute;vision $Revision: 1.6 $</em>");
 106  ?>


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