function _check_it_($var_userid, $var_menuid, $var_qty, &$var_subtotal, &$var_total) { require_once def_directory_classes . "class_keranjang.php"; $var_class_keranjang = new _class_keranjang_(); $var_subtotal = 0; $var_total = 0; $var_query_link = _set_query_("SELECT menuid, qty FROM " . def_table_keranjang . " WHERE userid='" . _set_input_string_($var_userid) . "' AND menuid='" . _set_input_string_($var_menuid) . "'"); while ($var_menu = _set_fetch_array_($var_query_link)) { $var_subtotal += (int) $var_qty * _set_double_($var_class_keranjang->_set_harga_($var_menu['menuid']), 0); } $var_query_link = _set_query_("SELECT menuid, qty FROM " . def_table_keranjang . " WHERE userid='" . _set_input_string_($var_userid) . "'"); while ($var_menu = _set_fetch_array_($var_query_link)) { if ($var_menu['menuid'] == $var_menuid) { $var_total += (int) $var_qty * _set_double_($var_class_keranjang->_set_harga_($var_menu['menuid']), 0); } else { $var_total += (int) $var_menu['qty'] * _set_double_($var_class_keranjang->_set_harga_($var_menu['menuid']), 0); } } }
<?php require_once "includes/application_startup.php"; $var_login = false; if (_is_session_registered_("session_userid")) { if (isset($HTTP_GET_VARS["process"]) && $HTTP_GET_VARS["process"] == "pesan") { $var_menuid = _set_variable_http_("menuid"); $var_restoranid = _set_variable_http_("restoranid"); require_once def_directory_classes_master . "class_menu.php"; $var_class_menu = new _class_menu_(); if ($var_class_menu->_is_primary_exist_($var_menuid)) { require_once def_directory_classes . "class_keranjang.php"; $var_class_keranjang = new _class_keranjang_(); $var_class_keranjang->_add_cart_($var_menuid); $session_success = "Pesanan anda berhasil disimpan"; _set_session_register_("session_success"); } else { $session_error = "Harap mengikuti prosedur"; _set_session_register_("session_error"); } } else { $session_error = "Harap mengikuti prosedur"; _set_session_register_("session_error"); } } else { $session_error = "Anda mesti login terlebih dahulu"; _set_session_register_("session_error"); $var_login = true; } ?>
<?php require_once "includes/application_startup.php"; $var_login = false; if (_is_session_registered_("session_userid")) { require_once def_directory_classes . "class_keranjang.php"; $var_class_keranjang = new _class_keranjang_(); require_once def_directory_classes_transaksi . "class_voucher.php"; $var_class_voucher = new _class_voucher_(); require_once def_directory_classes_master . "class_pemakai.php"; $var_class_pemakai = new _class_pemakai_(); $var_class_pemakai->_set_data_($session_userid); if (isset($HTTP_GET_VARS["process"])) { if ($HTTP_GET_VARS["process"] == "confirm") { if (isset($HTTP_GET_VARS["action"])) { if ($HTTP_GET_VARS["action"] == "true") { if (isset($HTTP_POST_VARS["txt_confirm"])) { $session_error = "Voucher Anda Tidak Mencukupi Untuk Melakukan Transaksi ini"; _set_session_register_("session_error"); } else { $var_menuid = _set_variable_http_('txt_menuid', false); $var_alamat = _set_variable_http_('slt_alamat', false); $var_valid = true; for ($var_counter = 0; $var_counter < count($var_menuid); $var_counter++) { $var_qty_temp = _set_numeric_(_set_variable_http_('txt_qty' . $var_menuid[$var_counter], false)); $var_class_keranjang->_update_qty2_($var_menuid[$var_counter], $var_qty_temp); if ($var_qty_temp <= 0) { $var_valid = false; } } if ($var_valid == false) {