";
}
// Add an item
if ( isset ($_POST['add_item'])) {
// Add a line
$nb_number=$_POST["nb_item"];
$nb_number++;
// submit button in the form
$submit='
';
$r=FormODS($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
echo '
';
echo $r;
echo "
On-line calculator
".JS_CALC_LINE."
";
echo "
";
}
// Correct it
if ( isset ($_POST['correct'])) {
// Get number of lines
$nb_number=$_POST["nb_item"];
// submit button in the form
$submit='
';
$r=FormODS($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
echo '
';
echo $r;
echo "
On-line calculator
".JS_CALC_LINE."
";
echo "
";
}
// View the charge and show a submit button to save it
// TODO: the name 'view_invoice' should be changed to something more self-explaining, like
// 'submit_od', no?
if ( isset ($_POST['view_invoice']) ) {
$nb_number=$_POST["nb_item"];
$submit='';
$submit.='';
$submit.='';
$r=FormODS($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,true,$nb_number);
// if something goes wrong, correct it
if ( $r == null ) {
// submit button in the form
$submit='
';
$r=FormODS($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
}else {
$submit='
';
}
echo '
';
echo $r;
echo "
On-line calculator
".JS_CALC_LINE."
";
echo "
";
}
// Save the change into database
if ( isset($_POST['save'] )) {
$r=RecordODS($cn,$_POST,$User,$_GET['p_jrn']);
// Get number of lines
$nb_number=$_POST["nb_item"];
if ( $r != null ) {
// submit button in the form
$submit='
';
echo $search_box;
// if nofirst is set then show result
if ( isset ($_GET['nofirst'] ) ) {
list ($max_line,$a)=ListJrn($cn,$_GET['p_jrn'],"",$_POST);
echo $a;
}
echo '