예제 #1
0
$p_mesg = "";
$sa = isset($_REQUEST['sa']) ? $_REQUEST['sa'] : '';
$g_user->Check();
require_once NOALYSS_INCLUDE . '/user_menu.php';
// Correct (last step)
if (isset($_POST['correct'])) {
    $ledger = new Acc_Ledger($cn, $_REQUEST['p_jrn']);
    require_once NOALYSS_INCLUDE . '/operation_ods_new.inc.php';
    return;
}
// confirm before saving
if (isset($_POST['summary'])) {
    try {
        $ledger = new Acc_Ledger($cn, $_REQUEST['p_jrn']);
        $ledger->with_concerned = false;
        $ledger->verify($_POST);
        require_once NOALYSS_INCLUDE . '/operation_ods_confirm.inc.php';
    } catch (Exception $e) {
        echo alert($e->getMessage());
        require 'operation_ods_new.inc.php';
    }
    return;
}
// record
if (isset($_POST['save'])) {
    $array = $_POST;
    $ledger = new Acc_Ledger($cn, $_REQUEST['p_jrn']);
    $ledger->with_concerned = false;
    try {
        $ledger->save($array);
        $jr_id = $cn->get_value('select jr_id from jrn where jr_internal=$1', array($ledger->internal));