id=$_REQUEST['p_jrn']; else { $def_ledger=$Ledger->get_first('fin'); $Ledger->id=$def_ledger['jrn_def_id']; } $jrn_priv=$g_user->get_ledger_access($Ledger->id); // Check privilege if ( isset($_REQUEST['p_jrn']) && ( $jrn_priv == 'X')) { NoAccess(); exit -1; } //---------------------------------------- // Confirm the operations //---------------------------------------- if ( isset($_POST['save'])) { try { $Ledger->verify($_POST); } catch (Exception $e) { alert($e->getMessage()); $correct=1; } if ( ! isset ($correct )) { echo '
'; echo '

'._('Confirmation').'

'; echo '
'; echo HtmlInput::hidden('ac',$_REQUEST['ac']); echo $Ledger->confirm($_POST); echo HtmlInput::submit('confirm',_('Confirmer')); echo HtmlInput::submit('correct',_('Corriger')); echo '
'; echo '
'; exit(); } } //---------------------------------------- // Confirm and save the operations // into the database //---------------------------------------- if ( isset($_POST['confirm'])) { try { $Ledger->verify($_POST); } catch (Exception $e) { alert($e->getMessage()); $correct=1; } if ( !isset($correct)) { echo '
'; echo '

' . $Ledger->get_name() . '

'; echo '
'; echo '
'; $a= $Ledger->insert($_POST); echo '

'._('Enregistrement').'

'; echo '
'; echo $a; echo '
'; echo '
'; exit(); } } //---------------------------------------- // Correct the operations //---------------------------------------- if ( isset($_POST['correct'])) { $correct=1; } //---------------------------------------- // Blank form //---------------------------------------- echo '
'; echo '
'; echo HtmlInput::hidden('ledger_type','fin'); echo HtmlInput::hidden('ac',$_REQUEST['ac']); $array=( isset($correct))?$_POST:null; // show select ledger echo $Ledger->input($array); echo HtmlInput::button('add_item',_('Ajout article'), ' onClick="ledger_fin_add_row()"'); echo HtmlInput::submit('save',_('Sauve')); echo HtmlInput::reset(_('Effacer')); echo create_script(" get_last_date();ajax_saldo('first_sold');"); exit(); exit();