function _set_pulldown_date_($var_pulldown_id, $var_value = "", $var_parameter = "", $var_type = "day", $var_reinsert_value = true) { global $HTTP_GET_VARS, $HTTP_POST_VARS; $var_pulldown_value = '<select name="' . $var_pulldown_id . '"'; if (_is_not_null_($var_parameter)) { $var_pulldown_value .= ' ' . $var_parameter; } $var_pulldown_value .= '>'; if ($var_reinsert_value == true && (isset($HTTP_GET_VARS[$var_pulldown_id]) && is_string($HTTP_GET_VARS[$var_pulldown_id]) || isset($HTTP_POST_VARS[$var_pulldown_id]) && is_string($HTTP_POST_VARS[$var_pulldown_id]))) { if (isset($HTTP_GET_VARS[$var_pulldown_id]) && is_string($HTTP_GET_VARS[$var_pulldown_id])) { $var_value = stripslashes($HTTP_GET_VARS[$var_pulldown_id]); } elseif (isset($HTTP_POST_VARS[$var_pulldown_id]) && is_string($HTTP_POST_VARS[$var_pulldown_id])) { $var_value = stripslashes($HTTP_POST_VARS[$var_pulldown_id]); } } else { date_default_timezone_set('Asia/Krasnoyarsk'); if ($var_type == "day") { $var_value = date("d"); } elseif ($var_type == "month") { $var_value = date("m"); } elseif ($var_type == "year") { $var_value = date("Y"); } } $var_start = 1; if ($var_type == "day") { $var_size = 31; } else { if ($var_type == "month") { $var_size = 12; } else { if ($var_type == "year") { $var_size = 2100; $var_start = 2008; } else { $var_size = 0; } } } for ($var_counter = $var_start; $var_counter <= $var_size; $var_counter++) { if ($var_type != "year") { $var_pulldown_value .= '<option value="' . _set_padding_($var_counter, 2, "0", false) . '"'; } else { $var_pulldown_value .= '<option value="' . $var_counter . '"'; } if ($var_type != "year") { if ($var_value == _set_padding_($var_counter, 2, "0", false)) { $var_pulldown_value .= " SELECTED"; } } else { if ($var_value == $var_counter) { $var_pulldown_value .= " SELECTED"; } } if ($var_type != "year") { $var_pulldown_value .= '>' . _set_padding_($var_counter, 2, "0", false) . '</option>'; } else { $var_pulldown_value .= '>' . $var_counter . '</option>'; } } $var_pulldown_value .= '</select>'; return $var_pulldown_value; }
function _set_increment_id_() { $var_query_link = _set_query_("SELECT notransaksi FROM " . def_table_pesan_header); date_default_timezone_set('Asia/Krasnoyarsk'); if (_get_num_rows_($var_query_link) > 0) { $var_hole = 0; for ($var_counter = 1; $var_counter <= _get_num_rows_($var_query_link); $var_counter++) { $var_check_link = _set_query_("SELECT notransaksi FROM " . def_table_pesan_header . " WHERE notransaksi='" . _set_input_string_(date("dmY") . _set_padding_($var_counter, 2, "0", false)) . "'"); if (_get_num_rows_($var_check_link) <= 0) { $var_hole = $var_counter; break; } } if ($var_hole == 0) { $var_hole = _get_num_rows_($var_query_link) + 1; } return date("dmY") . _set_padding_($var_hole, 2, "0", false); } else { return date("dmY") . _set_padding_("1", 2, "0", false); } }
function _set_increment_id_() { $var_query_link = _set_query_("SELECT restoranid FROM " . def_table_restoran); if (_get_num_rows_($var_query_link) > 0) { $var_hole = 0; for ($var_counter = 1; $var_counter <= _get_num_rows_($var_query_link); $var_counter++) { $var_check_link = _set_query_("SELECT restoranid FROM " . def_table_restoran . " WHERE restoranid='" . _set_input_string_(_set_padding_($var_counter, 3, "0", false)) . "'"); if (_get_num_rows_($var_check_link) <= 0) { $var_hole = $var_counter; break; } } if ($var_hole == 0) { $var_hole = _get_num_rows_($var_query_link) + 1; } return _set_padding_($var_hole, 3, "0", false); } else { return _set_padding_("1", 3, "0", false); } }
function _save_data_($var_menuid, $var_tanggal, $var_harga) { if (!_is_not_null_($var_menuid)) { return false; } if (!_is_not_null_($var_tanggal)) { return false; } else { if ($var_tanggal == "NOW()") { date_default_timezone_set('Asia/Krasnoyarsk'); $var_tanggal = date("Y-m-d"); } } $var_kode = _set_padding_($var_menuid, 3) . $var_tanggal; if ($this->_is_primary_exist2_($var_kode)) { return _set_query_("UPDATE " . def_table_daftarharga . " SET harga=" . _set_input_string_($var_harga) . " WHERE kode='" . _set_input_string_($var_kode) . "'"); } else { return _set_query_("INSERT INTO " . def_table_daftarharga . " VALUES ('" . _set_input_string_($var_kode) . "', '" . _set_input_string_($var_menuid) . "', '" . _set_input_string_($var_tanggal) . "', " . _set_input_string_($var_harga) . ")"); } }
function _set_increment_output_id_($var_userid) { $var_query_link = _set_query_("SELECT outputid FROM " . def_table_output); date_default_timezone_set('Asia/Krasnoyarsk'); if (_get_num_rows_($var_query_link) > 0) { $var_hole = 0; for ($var_counter = 1; $var_counter <= _get_num_rows_($var_query_link); $var_counter++) { $var_check_link = _set_query_("SELECT outputid FROM " . def_table_output . " WHERE outputid='" . _set_input_string_(_set_padding_($var_userid, 15)) . _set_input_string_(date("dmY") . _set_padding_($var_counter, 2, "0", false)) . "'"); if (_get_num_rows_($var_check_link) <= 0) { $var_hole = $var_counter; break; } } if ($var_hole == 0) { $var_hole = _get_num_rows_($var_query_link) + 1; } return _set_input_string_(_set_padding_($var_userid, 15)) . date("dmY") . _set_padding_($var_hole, 2, "0", false); } else { return _set_input_string_(_set_padding_($var_userid, 15)) . date("dmY") . _set_padding_("1", 2, "0", false); } }