Skip to content

Commit

Permalink
Fix: uniform code
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Oct 24, 2011
1 parent dbd4bdf commit 45a7ec5
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions htdocs/compta/deplacement/fiche.php
Expand Up @@ -70,12 +70,7 @@
{
$error=0;

$dated=dol_mktime(12, 0, 0,
$_POST["remonth"],
$_POST["reday"],
$_POST["reyear"]);

$object->date = $dated;
$object->date = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
$object->km = $_POST["km"];
$object->type = $_POST["type"];
$object->socid = $_POST["socid"];
Expand Down Expand Up @@ -105,7 +100,7 @@

if ($id > 0)
{
Header("Location: " . $_SERVER["PHP_SELF"] . "?id=".$id);
Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
exit;
}
else
Expand All @@ -132,14 +127,12 @@
{
$result = $object->fetch($id);

$object->date = dol_mktime(12, 0 , 0,
$_POST["remonth"],
$_POST["reday"],
$_POST["reyear"]);
$object->km = $_POST["km"];
$object->type = $_POST["type"];
$object->fk_user = $_POST["fk_user"];
$object->socid = $_POST["socid"];
$object->date = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
$object->km = $_POST["km"];
$object->type = $_POST["type"];
$object->fk_user = $_POST["fk_user"];
$object->socid = $_POST["socid"];

$result = $object->update($user);

if ($result > 0)
Expand Down Expand Up @@ -187,10 +180,7 @@

dol_htmloutput_errors($mesg);

$datec = dol_mktime(12, 0, 0,
$_POST["remonth"],
$_POST["reday"],
$_POST["reyear"]);
$datec = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);

print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
Expand All @@ -200,12 +190,12 @@

print "<tr>";
print '<td width="25%" class="fieldrequired">'.$langs->trans("Type").'</td><td>';
print $html->select_type_fees($_POST["type"]?$_POST["type"]:$_GET["type"],'type',1);
print $html->select_type_fees(GETPOST("type"),'type',1);
print '</td></tr>';

print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
print $html->select_users($_POST["fk_user"]?$_POST["fk_user"]:$_GET["fk_user"],'fk_user',1);
print $html->select_users(GETPOST("fk_user"),'fk_user',1);
print '</td></tr>';

print "<tr>";
Expand All @@ -214,12 +204,12 @@
print '</td></tr>';

// Km
print '<tr><td class="fieldrequired">'.$langs->trans("FeesKilometersOrAmout").'</td><td><input name="km" size="10" value="'.($_POST["km"]?$_POST["km"]:'').'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("FeesKilometersOrAmout").'</td><td><input name="km" size="10" value="' . GETPOST("km") . '"></td></tr>';

// Company
print "<tr>";
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
print $html->select_societes($_POST["socid"]?$_POST["socid"]:$_GET["socid"],'socid','',1);
print $html->select_societes(GETPOST("socid"),'socid','',1);
print '</td></tr>';

// Public note
Expand Down

0 comments on commit 45a7ec5

Please sign in to comment.