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

   1  <?php
   2  /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004      Laurent Destailleur  <eldy@users.sourceforge.net>
   4   *
   5   * $Id: pmt.php,v 1.8 2005/09/17 00:53:50 eldy Exp $
   6   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/pmt.php,v $
   7   *
   8   * This program is free software; you can redistribute it and/or modify
   9   * it under the terms of the GNU General Public License as published by
  10   * the Free Software Foundation; either version 2 of the License, or
  11   * (at your option) any later version.
  12   *
  13   * This program is distributed in the hope that it will be useful,
  14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16   * GNU General Public License for more details.
  17   *
  18   * You should have received a copy of the GNU General Public License
  19   * along with this program; if not, write to the Free Software
  20   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21   *
  22   */
  23  require ("./pre.inc.php");
  24  
  25  
  26  /*
  27   *
  28   */
  29  
  30  llxHeader();
  31  
  32  print "Point mort";
  33  
  34  
  35  
  36  if ($action == 'update') {
  37    $datepm = mktime(12, 0 , 0, $pmonth, 1, $pyear); 
  38  
  39    $sql = "DELETE FROM ".MAIN_DB_PREFIX."pointmort WHERE int(month) = $datepm ;";
  40    $sql .= "INSERT INTO ".MAIN_DB_PREFIX."pointmort VALUES ($datepm, $pm)";
  41    $result = $db->query($sql);
  42  }
  43  
  44  
  45  
  46  print "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">";
  47  print "<tr><td valign=\"top\">";
  48  
  49  $sql = "SELECT amount, int(month) as dm FROM ".MAIN_DB_PREFIX."pointmort ORDER BY month DESC";
  50  
  51  $result = $db->query($sql);
  52  
  53  if ($result) {
  54  
  55    print "<table class=\"noborder\">";
  56    print "<tr bgcolor=\"orange\">";
  57    print "<td>".$langs->trans("Month")."</td>";
  58    print "<td align=\"right\">".$langs->trans("Amount")."</td>";
  59    print "</tr>\n";
  60  
  61    $bc[0]="bgcolor=\"#90c090\"";
  62    $bc[1]="bgcolor=\"#b0e0b0\"";
  63    $var = 1 ; 
  64    
  65    $i = 0;
  66    $num = $db->num_rows();
  67    while ($i < $num) {
  68    $obj = $db->fetch_object($result);
  69      $var=!$var;
  70      
  71      print "<tr $bc[$var]>";
  72      
  73      print "<td>".strftime("%Y %B",$obj->dm)."</td>\n";
  74      print "<td align=\"right\">$obj->amount</td>\n";
  75  
  76  
  77      print "</tr>\n";
  78  
  79  
  80      $i++;
  81    }
  82  
  83    print "</table>";
  84  }
  85  
  86  print "</td><td valign=\"top\">";
  87  
  88  print '<form action="pmt.php" method="post">';
  89  print "<input type=\"hidden\" name=\"action\" value=\"update\">";
  90  
  91  $strmonth[1] = "Janvier";
  92  $strmonth[2] = "F&eacute;vrier";
  93  $strmonth[3] = "Mars";
  94  $strmonth[4] = "Avril";
  95  $strmonth[5] = "Mai";
  96  $strmonth[6] = "Juin";
  97  $strmonth[7] = "Juillet";
  98  $strmonth[8] = "Ao&ucirc;t";
  99  $strmonth[9] = "Septembre";
 100  $strmonth[10] = "Octobre";
 101  $strmonth[11] = "Novembre";
 102  $strmonth[12] = "D&eacute;cembre";
 103  
 104  print "Date :";
 105  $cmonth = date("n", time());
 106  print "<select name=\"pmonth\">";    
 107  for ($month = 1 ; $month <= 12 ; $month++) {
 108    if ($month == $cmonth) {
 109      print "<option value=\"$month\" selected=\"true\">" . $strmonth[$month];
 110    } else {
 111      print "<option value=\"$month\">" . $strmonth[$month];
 112    }
 113  }
 114  print "</select>";
 115  
 116  print "<select name=\"pyear\">";
 117  $syear = date("Y", time() ) ;
 118  print "<option value=\"".($syear-1)."\">".($syear-1);
 119  print "<option value=\"$syear\" selected=\"true\">$syear";
 120  
 121  for ($year = $syear +1 ; $year < $syear + 5 ; $year++) {
 122    print "<option value=\"$year\">$year";
 123  }
 124  print "</select><br>";
 125  
 126  print "Valeur : <input type=\"text\" name=\"pm\"><br>";
 127  print "<input type=\"submit\" value=\"Mettre a jour\">";
 128  print "</form>";
 129  
 130  
 131  
 132  
 133  print "</td></tr></table>";
 134  
 135  $db->close();
 136  
 137  
 138  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/17 00:53:50 $ r&eacute;vision $Revision: 1.8 $</em>");
 139  ?>


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