Beispiel #1
0
    $input_error = 0;
    $sub1 = substr($_POST['year'], 2);
    $beg = $sub1 . "-" . $_POST['begin'];
    $end = $sub1 . "-" . $_POST['end'];
    $input_error = 0;
    if ($checkIfExists > 0) {
        $input_error = 1;
        display_error(_("The series you have entered already exists."));
        //set_focus('no');
    }
    if ($input_error != 1) {
        if ($selected_id != -1) {
            update_booklet($selected_id, $_POST['type'], $_POST['year'], $_POST['begin'], $_POST['end'], $_POST['status']);
            $note = _('Selected booklet has been updated');
        } else {
            add_booklet($_POST['type'], $_POST['year'], $_POST['begin'], $_POST['end'], $_POST['status']);
            $note = _('New booklet has been added');
        }
        display_notification($note);
        $Mode = 'RESET';
    }
}
if ($Mode == 'Delete') {
    $cancel_delete = 0;
    // PREVENT DELETES IF DEPENDENT RECORDS IN ''
    /*if (key_in_foreign_table($selected_id, 'cust_branch', 'group_no'))
    	{
    		$cancel_delete = 1;
    		display_error(_("Cannot delete this group because customers have been created using this group."));
    	} */
    if ($cancel_delete == 0) {
Beispiel #2
0
        $Mode = 'RESET';
    }
}
if ($Mode == 'UPDATE_ITEM') {
    $input_error = 0;
    if (strlen($_POST['no']) == 0) {
        $input_error = 1;
        display_error(_("The booklet no. cannot be empty."));
        set_focus('no');
    }
    if ($input_error != 1) {
        if ($selected_id != -1) {
            update_booklet($selected_id, $_POST['no'], $_POST['type'], $_POST['year']);
            $note = _('Selected booklet has been updated');
        } else {
            add_booklet($_POST['no'], $_POST['type'], $_POST['year']);
            $note = _('New booklet has been added');
        }
        display_notification($note);
        $Mode = 'RESET';
    }
}
if ($Mode == 'Delete') {
    $cancel_delete = 0;
    // PREVENT DELETES IF DEPENDENT RECORDS IN ''
    /*if (key_in_foreign_table($selected_id, 'cust_branch', 'group_no'))
    	{
    		$cancel_delete = 1;
    		display_error(_("Cannot delete this group because customers have been created using this group."));
    	} */
    if ($cancel_delete == 0) {