code cleaning
This commit is contained in:
parent
bcc0fd244a
commit
3815c2157b
@ -1,6 +1,5 @@
|
||||
<?PHP
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -19,30 +18,30 @@
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*******************************************************************************/
|
||||
*/
|
||||
require("./pre.inc.php3");
|
||||
|
||||
llxHeader();
|
||||
$db = new Db();
|
||||
|
||||
$bc[0]="bgcolor=\"#90c090\"";
|
||||
$bc[1]="bgcolor=\"#b0e0b0\"";
|
||||
|
||||
if ($action == 'class') {
|
||||
if ($action == 'class')
|
||||
{
|
||||
$author = $GLOBALS["REMOTE_USER"];
|
||||
|
||||
$sql = "INSERT INTO llx_bank_class (lineid, fk_categ) VALUES ($rowid, $cat1)";
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
if ($action == 'update') {
|
||||
if ($action == 'update')
|
||||
{
|
||||
$author = $GLOBALS["REMOTE_USER"];
|
||||
|
||||
$sql = "update llx_bank set label='$label' where rowid = $rowid;";
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
if ($action == 'type') {
|
||||
if ($action == 'type')
|
||||
{
|
||||
$author = $GLOBALS["REMOTE_USER"];
|
||||
$sql = "update llx_bank set fk_type='$value' where rowid = $rowid;";
|
||||
$result = $db->query($sql);
|
||||
@ -51,15 +50,17 @@ if ($action == 'type') {
|
||||
|
||||
$sql = "SELECT rowid, label FROM llx_bank_categ;";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$var=True;
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
$options = "<option value=\"0\" SELECTED></option>";
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($i);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
|
||||
}
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
|
||||
@ -78,76 +79,81 @@ $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do, b.amount, b.label, b.rap
|
||||
$sql .= " FROM llx_bank as b WHERE rowid=$rowid";
|
||||
$sql .= " ORDER BY dateo ASC";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$var=True;
|
||||
$num = $db->num_rows();
|
||||
$i = 0; $total = 0;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$total = $total + $objp->amount;
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<form method=\"post\" action=\"$PHP_SELF\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"class\">";
|
||||
print "<input type=\"hidden\" name=\"rowid\" value=\"$objp->rowid\">";
|
||||
|
||||
print "<td>".strftime("%d %b %Y",$objp->do)."</TD>\n";
|
||||
print "<td>$objp->label</td>";
|
||||
if ($objp->amount < 0) {
|
||||
print "<td align=\"right\">".price($objp->amount * -1)."</TD><td> </td>\n";
|
||||
} else {
|
||||
print "<td> </td><td align=\"right\">".price($objp->amount)."</TD>\n";
|
||||
}
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$total = $total + $objp->amount;
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<form method=\"post\" action=\"$PHP_SELF\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"class\">";
|
||||
print "<input type=\"hidden\" name=\"rowid\" value=\"$objp->rowid\">";
|
||||
|
||||
print "<td>".strftime("%d %b %Y",$objp->do)."</TD>\n";
|
||||
print "<td>$objp->label</td>";
|
||||
if ($objp->amount < 0)
|
||||
{
|
||||
print "<td align=\"right\">".price($objp->amount * -1)."</TD><td> </td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td> </td><td align=\"right\">".price($objp->amount)."</TD>\n";
|
||||
}
|
||||
|
||||
print "<td align=\"center\"><a href=\"releve.php3?num=$objp->num_releve&ve=1\">$objp->num_releve</a></td>";
|
||||
print "<td align=\"center\">$objp->author</td>";
|
||||
print "<td align=\"center\"><a href=\"releve.php3?num=$objp->num_releve&ve=1\">$objp->num_releve</a></td>";
|
||||
print "<td align=\"center\">$objp->author</td>";
|
||||
|
||||
print "</tr>";
|
||||
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"5\">";
|
||||
print $objp->fk_type .' - ';
|
||||
print $objp->num_chq;
|
||||
print "</tr>";
|
||||
|
||||
print "</tr>";
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"5\">";
|
||||
print "<select name=\"cat1\">$options";
|
||||
|
||||
print "</select> ";
|
||||
print "<input type=\"submit\" value=\"add\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
print "</form><form method=\"post\" action=\"$PHP_SELF?rowid=$objp->rowid\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"5\">";
|
||||
print '<input name="label" value="'.$objp->label.'">';
|
||||
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"5\">";
|
||||
print $objp->fk_type .' - ';
|
||||
print $objp->num_chq;
|
||||
print "</tr>";
|
||||
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"5\">";
|
||||
print "<select name=\"cat1\">$options";
|
||||
|
||||
print "</select> ";
|
||||
print "<input type=\"submit\" value=\"add\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
print "</form><form method=\"post\" action=\"$PHP_SELF?rowid=$objp->rowid\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"5\">";
|
||||
print '<input name="label" value="'.$objp->label.'">';
|
||||
|
||||
print "<input type=\"submit\" value=\"update\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
print "<form method=\"post\" action=\"$PHP_SELF?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="action" value="type">';
|
||||
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"5\">";
|
||||
print '<select name="value">';
|
||||
print '<option value="CHQ">CHQ';
|
||||
print '<option value="PRE">PRE';
|
||||
print '<option value="VIR">VIR';
|
||||
print '<option value="CB">CB';
|
||||
print '<option value="DEP">Dépôt';
|
||||
|
||||
print "</select><input type=\"submit\" value=\"update\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
print "<input type=\"submit\" value=\"update\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
print "<form method=\"post\" action=\"$PHP_SELF?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="action" value="type">';
|
||||
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"5\">";
|
||||
print '<select name="value">';
|
||||
print '<option value="CHQ">CHQ';
|
||||
print '<option value="PRE">PRE';
|
||||
print '<option value="VIR">VIR';
|
||||
print '<option value="CB">CB';
|
||||
print '<option value="DEP">Dépôt';
|
||||
|
||||
print "</select><input type=\"submit\" value=\"update\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
print "</table>";
|
||||
@ -163,29 +169,29 @@ $sql = "SELECT c.label, c.rowid";
|
||||
$sql .= " FROM llx_bank_class as a, llx_bank_categ as c WHERE a.lineid=$rowid AND a.fk_categ = c.rowid ";
|
||||
$sql .= " ORDER BY c.label";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$var=True;
|
||||
$num = $db->num_rows();
|
||||
$i = 0; $total = 0;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print "<td>$objp->label</td>";
|
||||
print "<td align=\"center\"><a href=\"budget.php3?bid=$objp->rowid\">voir</a></td>";
|
||||
print "</tr>";
|
||||
|
||||
print "<td>$objp->label</td>";
|
||||
print "<td align=\"center\"><a href=\"budget.php3?bid=$objp->rowid\">voir</a></td>";
|
||||
print "</tr>";
|
||||
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user