From 2e926bf54dcc1f7b62b1614c32162a380e573884 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 20 Jul 2004 08:31:06 +0000 Subject: [PATCH] GEstion du register_global=off --- htdocs/admin/facture.php | 140 +++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 72 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 7f5747426cd..bcc794230bc 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2004 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -24,51 +24,48 @@ require("./pre.inc.php"); if (!$user->admin) accessforbidden(); +/* +if ($HTTP_POST_VARS["action"] == 'update') +{ + dolibarr_set_const($db, "FAC_PDF_INTITULE2",$HTTP_POST_VARS["nom2"]); + dolibarr_set_const($db, "FAC_PDF_INTITULE",$HTTP_POST_VARS["nom"]); + dolibarr_set_const($db, "FAC_PDF_ADRESSE",$HTTP_POST_VARS["adresse"]); + dolibarr_set_const($db, "FAC_PDF_TEL",$HTTP_POST_VARS["tel"]); + dolibarr_set_const($db, "FAC_PDF_FAX",$HTTP_POST_VARS["fax"]); + dolibarr_set_const($db, "FAC_PDF_SIREN",$HTTP_POST_VARS["siren"]); + dolibarr_set_const($db, "FAC_PDF_SIRET",$HTTP_POST_VARS["siret"]); -#if ($HTTP_POST_VARS["action"] == 'update') -#{ -# dolibarr_set_const($db, "FAC_PDF_INTITULE2",$HTTP_POST_VARS["nom2"]); -# dolibarr_set_const($db, "FAC_PDF_INTITULE",$HTTP_POST_VARS["nom"]); -# dolibarr_set_const($db, "FAC_PDF_ADRESSE",$HTTP_POST_VARS["adresse"]); -# dolibarr_set_const($db, "FAC_PDF_TEL",$HTTP_POST_VARS["tel"]); -# dolibarr_set_const($db, "FAC_PDF_FAX",$HTTP_POST_VARS["fax"]); -# dolibarr_set_const($db, "FAC_PDF_SIREN",$HTTP_POST_VARS["siren"]); -# dolibarr_set_const($db, "FAC_PDF_SIRET",$HTTP_POST_VARS["siret"]); -# -# Header("Location: $PHP_SELF"); -#} + Header("Location: facture.php"); +} +*/ - -llxHeader(); - - -$facture_addon_var = FACTURE_ADDON; -$facture_addon_var_pdf = FACTURE_ADDON_PDF; +$facture_addon_var = FACTURE_ADDON; +$facture_addon_var_pdf = FACTURE_ADDON_PDF; $facture_rib_number_var = FACTURE_RIB_NUMBER; $facture_chq_number_var = FACTURE_CHQ_NUMBER; -$facture_tva_option = FACTURE_TVAOPTION; +$facture_tva_option = FACTURE_TVAOPTION; -if ($action == 'set') +if ($_GET["action"] == 'set') { - if (dolibarr_set_const($db, "FACTURE_ADDON",$value)) $facture_addon_var = $value; + if (dolibarr_set_const($db, "FACTURE_ADDON",$_GET["value"])) $facture_addon_var = $_GET["value"]; } -if ($action == 'setribchq') +if ($_POST["action"] == 'setribchq') { - if (dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$rib)) $facture_rib_number_var = $rib; - if (dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$chq)) $facture_chq_number_var = $chq; + if (dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$_POST["rib"])) $facture_rib_number_var = $_POST["rib"]; + if (dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$_POST["chq"])) $facture_chq_number_var = $_POST["chq"]; } -if ($action == 'setpdf') +if ($_GET["action"] == 'setpdf') { - if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value)) $facture_addon_var_pdf = $value; + if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$_GET["value"])) $facture_addon_var_pdf = $_GET["value"]; } -if ($action == 'settvaoption') +if ($_POST["action"] == 'settvaoption') { - if (dolibarr_set_const($db, "FACTURE_TVAOPTION",$optiontva)) $facture_tva_option = $optiontva; + if (dolibarr_set_const($db, "FACTURE_TVAOPTION",$_POST["optiontva"])) $facture_tva_option = $_POST["optiontva"]; } - +llxHeader(); $dir = "../includes/modules/facture/"; @@ -194,7 +191,7 @@ print_titre( "Mode de r print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -207,30 +204,30 @@ $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_account where clos = 0"; $var=True; if ($db->query($sql)) { - $num = $db->num_rows(); - $i = 0; - if ($num > 0) { - print ""; + print ''; + while ($i < $num) + { + $var=!$var; + $row = $db->fetch_row($i); + + if ($facture_rib_number_var == $row[0]) + { + print ''; + } + else + { + print ''; + } $i++; - } - print ""; - } else { - print "Aucun compte bancaire actif créé"; - } + } + print ""; + } else { + print "Aucun compte bancaire actif créé"; + } } print ""; @@ -243,31 +240,31 @@ if ($db->query($sql)) { $num = $db->num_rows(); $i = 0; - if ($num > 0) { - print ""; + print ''; + while ($i < $num) { $var=!$var; $row = $db->fetch_row($i); - + if ($facture_chq_number_var == $row[0]) - { - print ''; - } + { + print ''; + } else - { - print ''; - } + { + print ''; + } $i++; } - print ""; - } else { - print "Aucun compte bancaire actif créé"; - } + print ""; + } else { + print "Aucun compte bancaire actif créé"; + } } print ""; - print ""; print "
Mode règlement à proposer
"; $db->close(); @@ -283,7 +280,6 @@ print ''; print 'NomValeur'; print "\n"; print 'Répertoire'.FAC_OUTPUTDIR.''; -print 'URL'.FAC_OUTPUT_URL.''; print ""; @@ -294,7 +290,7 @@ print '
'; print_titre("Options fiscales de facturation de la TVA"); print ''; -print ''; +print ''; print ''; print ''; print '';
OptionDescription