diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php
index c6c0a827237..9dd7f3c9788 100644
--- a/htdocs/admin/compta.php
+++ b/htdocs/admin/compta.php
@@ -27,10 +27,10 @@
\version $Revision$
*/
-require("./pre.inc.php");
+require('./pre.inc.php');
-$langs->load("admin");
-$langs->load("compta");
+$langs->load('admin');
+$langs->load('compta');
if (!$user->admin)
accessforbidden();
@@ -39,12 +39,12 @@ if (!$user->admin)
llxHeader();
-$compta_mode = defined("COMPTA_MODE")?COMPTA_MODE:"RECETTES-DEPENSES";
+$compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES';
-if ($_POST["action"] == 'setcomptamode')
+if ($_POST['action'] == 'setcomptamode')
{
- $compta_mode = $_POST["compta_mode"];
- if (! dolibarr_set_const($db, "COMPTA_MODE",$compta_mode)) { print $db->error(); }
+ $compta_mode = $_POST['compta_mode'];
+ if (! dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode)) { print $db->error(); }
}
@@ -52,43 +52,43 @@ $form = new Form($db);
$typeconst=array('yesno','texte','chaine');
-if ($_POST["action"] == 'update' || $_POST["action"] == 'add')
+if ($_POST['action'] == 'update' || $_POST['action'] == 'add')
{
- if (! dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],0,isset($_POST["constnote"])?$_POST["constnote"]:''));
+ if (! dolibarr_set_const($db, $_POST['constname'], $_POST['constvalue'], $typeconst[$_POST['consttype']], 0, isset($_POST['constnote']) ? $_POST['constnote'] : ''));
{
print $db->error();
}
}
-if ($_GET["action"] == 'delete')
+if ($_GET['action'] == 'delete')
{
- if (! dolibarr_del_const($db, $_GET["constname"]));
+ if (! dolibarr_del_const($db, $_GET['constname']));
{
print $db->error();
}
}
-print_titre($langs->trans("ComptaSetup"));
+print_titre($langs->trans('ComptaSetup'));
-print "
";
+print '
';
-print '
';
+print '\n";
@@ -101,67 +101,59 @@ $sql.=" WHERE name like 'COMPTA_%' and name not in ('COMPTA_MODE')";
$result = $db->query($sql);
if ($result)
{
- $num = $db->num_rows($result);
- $i = 0;
- $var=true;
+ $num = $db->num_rows($result);
+ $i = 0;
+ $var=true;
- if ($num) {
- print '';
+ if ($num)
+ {
+ print '';
print '';
- print '| '.$langs->trans("OtherOptions").' | | | '.$langs->trans("Description").' | ';
- print ' | ';
+ print ''.$langs->trans('OtherOptions').' | ';
print "
\n";
- }
-
- while ($i < $num)
- {
- $obj = $db->fetch_object($result);
- $var=!$var;
-
- print '';
-
- $i++;
- }
- if ($num) {
- print "
\n";
- }
+ if ($num)
+ {
+ print "
\n";
+ }
}