Skip to content

Commit

Permalink
Fix form outside table
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 27, 2015
1 parent 39cbd76 commit 6624182
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
18 changes: 10 additions & 8 deletions htdocs/comm/remise.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
Expand Down Expand Up @@ -99,6 +99,13 @@

$head = societe_prepare_head($objsoc);



print '<form method="POST" action="remise.php?id='.$objsoc->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setremise">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';

dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company');


Expand All @@ -119,11 +126,6 @@

print_fiche_titre($langs->trans("NewRelativeDiscount"),'','');

print '<form method="POST" action="remise.php?id='.$objsoc->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setremise">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';

print '<table class="border" width="100%">';

// Nouvelle valeur
Expand All @@ -136,6 +138,8 @@

print "</table>";

dol_fiche_end();

print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
if (! empty($backtopage))
Expand All @@ -147,8 +151,6 @@

print "</form>";

dol_fiche_end();

print '<br>';


Expand Down
39 changes: 22 additions & 17 deletions htdocs/comm/remx.php
Expand Up @@ -221,14 +221,14 @@
*/
$head = societe_prepare_head($objsoc);

dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"),0,'company');


print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$objsoc->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setremise">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';

dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"),0,'company');

print '<table class="border" width="100%">';

// Name
Expand Down Expand Up @@ -278,6 +278,8 @@

print "</table>";

dol_fiche_end();

print '<div class="center">';
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("AddGlobalDiscount").'">';
if (! empty($backtopage))
Expand All @@ -289,7 +291,6 @@

print '</form>';

dol_fiche_end();

print '<br>';

Expand Down Expand Up @@ -329,8 +330,10 @@
print '<td width="50">&nbsp;</td>';
print '</tr>';

$showconfirminfo=array();

$var = true;
$i = 0 ;
$i = 0;
$num = $db->num_rows($resql);
while ($i < $num)
{
Expand Down Expand Up @@ -382,24 +385,26 @@

if ($_GET["action"]=='split' && $_GET['remid'] == $obj->rowid)
{
print "<tr ".$bc[$var].">";
print '<td colspan="8">';
$amount1=price2num($obj->amount_ttc/2,'MT');
$amount2=($obj->amount_ttc-$amount1);
$formquestion=array(
'text' => $langs->trans('TypeAmountOfEachNewDiscount'),
array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'),
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
);
$langs->load("dict");
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
print '</td>';
print '</tr>';
$showconfirminfo['rowid']=$obj->rowid;
$showconfirminfo['amount_ttc']=$obj->amount_ttc;
}
$i++;
}
$db->free($resql);
print "</table>";

if (count($showconfirminfo))
{
$amount1=price2num($showconfirminfo['amount_ttc']/2,'MT');
$amount2=($showconfirminfo['amount_ttc']-$amount1);
$formquestion=array(
'text' => $langs->trans('TypeAmountOfEachNewDiscount'),
array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'),
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
);
$langs->load("dict");
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
}
}
else
{
Expand Down

0 comments on commit 6624182

Please sign in to comment.