Exemplo n.º 1
0
DrawBC("Food Service >> " . ProgramTitle());
if ($_REQUEST['modfunc'] == 'delete') {
    require_once 'modules/Food_Service/includes/DeletePromptX.fnc.php';
    if ($_REQUEST['item_id'] != '') {
        if (DeletePromptX('transaction item')) {
            require_once 'modules/Food_Service/includes/DeleteTransactionItem.fnc.php';
            DeleteTransactionItem($_REQUEST['transaction_id'], $_REQUEST['item_id'], $_REQUEST['type']);
            unset($_REQUEST['modfunc']);
            unset($_REQUEST['delete_ok']);
            unset($_SESSION['_REQUEST_vars']['modfunc']);
            unset($_SESSION['_REQUEST_vars']['delete_ok']);
        }
    } else {
        if (DeletePromptX('transaction')) {
            require_once 'modules/Food_Service/includes/DeleteTransaction.fnc.php';
            DeleteTransaction($_REQUEST['transaction_id'], $_REQUEST['type']);
            unset($_REQUEST['modfunc']);
            unset($_REQUEST['delete_ok']);
            unset($_SESSION['_REQUEST_vars']['modfunc']);
            unset($_SESSION['_REQUEST_vars']['delete_ok']);
        }
    }
}
if (!$_REQUEST['modfunc']) {
    $types = array('DEPOSIT' => 'Deposit', 'CREDIT' => 'Credit', 'DEBIT' => 'Debit');
    $menus_RET = DBGet(DBQuery('SELECT TITLE FROM FOOD_SERVICE_MENUS WHERE SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY SORT_ORDER'));
    $type_select = 'Type<SELECT name=type_select><OPTION value=\'\'>Not Specified</OPTION>';
    foreach ($types as $short_name => $type) {
        $type_select .= '<OPTION value=' . $short_name . ($_REQUEST['type_select'] == $short_name ? ' SELECTED' : '') . '>' . $type . '</OPTION>';
    }
    foreach ($menus_RET as $menu) {
Exemplo n.º 2
0
                         AddProd($user_id, $object_id, GetTransactionId($object_id), $prod_id, $prod_quantity, $s_price, $price);
                     }
                 } else {
                     $error = GetProductionInfo($object_id, $prod_id);
                 }
             }
         }
     }
     break;
 case 'delete_prod':
     $trans_det_id = $_REQUEST['trans_id'];
     $object_id = $_REQUEST['obj_id'];
     DeleteLog($trans_det_id);
     DeleteProduct($trans_det_id);
     if (CheckTransStatus($object_id)) {
         DeleteTransaction($object_id);
     }
     break;
 case 'save_transaction':
     $object_id = $_REQUEST['obj_id'];
     $car_number = $_REQUEST['car_number'];
     $status = CheckObjectStatus($object_id);
     if (!$status) {
         $error = 'პროდუქციის სია ცარიელია!';
     } else {
         SaveTransaction($object_id, $car_number);
     }
     break;
 case 'abort_transaction':
     $object_id = $_REQUEST['obj_id'];
     AbortTransaction($object_id);