function db_do_login($email_id, $password) { LOG_MSG('INFO', "db_do_login(): START {\n\t\t\t\t\t\t\t\t\t\temail_id=[{$email_id}],\n\t\t\t\t\t\t\t\t\t\tpassword=[{$password}]\n}"); $param_arr = _init_db_params(); $param_arr = _db_prepare_param($param_arr, "s", "email_id", $email_id, true); $param_arr = _db_prepare_param($param_arr, "s", "password", $password, true); // Create Query $resp = execSQL("SELECT \n\t\t\t\t\t\tu.user_id,\n\t\t\t\t\t\tu.name,\n\t\t\t\t\t\tu.email_id,\n\t\t\t\t\t\tu.password,\n\t\t\t\t\t\tu.phone_no,\n\t\t\t\t\t\tu.address,\n\t\t\t\t\t\tu.type,\n\t\t\t\t\t\tu.is_active,\n\t\t\t\t\t\tu.created_dt,\n\t\t\t\t\t\ts.supervisor_id,\n\t\t\t\t\t\tt.travel_id,\n\t\t\t\t\t\tt.name travel_name,\n\t\t\t\t\t\tt.domain\n\t\t\t\t\tFROM\n\t\t\t\t\t\ttUser u\n\t\t\t\t\t\tLEFT OUTER JOIN tSupervisor s ON(s.user_id=u.user_id)\n\t\t\t\t\t\tLEFT OUTER JOIN tTravel t ON(u.travel_id=t.travel_id)\n\t\t\t\t\tWHERE \n\t\t\t\t\t\tu.email_id=? \n\t\t\t\t\t\tAND u.password=? AND\n\t\t\t\t\t\tt.travel_id=" . TRAVEL_ID, $param_arr['params'], false); LOG_MSG('INFO', "db_do_login(): END"); return $resp; }
function db_room_select($room_id = "", $room_name = "") { LOG_MSG('INFO', "db_wallet_select: START { \n\t\t\t\t\t\t\troom_id=[{$room_id}],\n\t\t\t\t\t\t\troom_name=[{$room_name}] \n}"); $param_arr = _init_db_params(); $where_clause = "WHERE room_name={$room_name} AND room_id = {$room_id}"; $param_arr['params'] = array(); LOG_MSG('INFO', "db_room_select(): WHERE CLAUSE = [{$where_clause}]"); $resp = execSQL("SELECT \n\t\t\t\t\t\troom_name,\n\t\t\t\t\t\troom_id,\n\t\t\t\t\t\tis_booked\n\t\t\t\t\tFROM \n\t\t\t\t\t\tbookrooms\n\t\t\t\t\t" . $where_clause, $param_arr['params'], false); LOG_MSG('INFO', "db_room_select(): END"); return $resp; }
function db_page_delete($page_id) { $param_arr = _init_db_params(); LOG_MSG('INFO', "db_page_delete(): START { page_id=[{$page_id}]"); // For the where clause $where_clause = " WHERE page_id=? AND shop_id=" . SHOP_ID; $param_arr = _db_prepare_param($param_arr, "i", "page_id", $page_id, true); $resp = execSQL("DELETE FROM \n\t\t\t\t\t\t\ttPage" . $where_clause, $param_arr['params'], true); LOG_MSG('INFO', "db_page_delete(): END"); return $resp; }
function db_is_sync_supervisor_update($is_sync) { $param_arr = _init_db_params(); LOG_MSG('INFO', "db_is_sync_supervisor_update(): START {\n\t\t\t\t\t\t\tis_sync=[{$is_sync}]\n}"); // Add params to params_arr $param_arr = _db_prepare_param($param_arr, "i", "is_sync", $is_sync); // For the where clause $where_clause = " WHERE travel_id= " . TRAVEL_ID; $resp = execSQL("UPDATE \n\t\t\t\t\t\ttSupervisor\n\t\t\t\t\tSET " . $param_arr['update_fields'] . $where_clause, $param_arr['params'], true); LOG_MSG('INFO', "db_is_sync_supervisor_update(): END"); return $resp; }
function modulesetting_db_get($name, $category = '') { LOG_MSG('INFO', "modulesetting_db_get(): START { name=[{$name}] category=[{$category}] \n}"); $param_arr = _init_db_params(); // Where Clause $where_clause = "WHERE name = ? AND travel_id=" . TRAVEL_ID; $param_arr = _db_prepare_param($param_arr, "s", "name", $name, true); if ($category != '') { $where_clause .= " AND category=? "; $param_arr = _db_prepare_param($param_arr, "s", "category", $category, true); } $resp = execSQL("SELECT \n\t\t\t\t\t\tvalue\n\t\t\t\t\tFROM \n\t\t\t\t\t\ttSetting \n\t\t\t\t\t{$where_clause} ", $param_arr['params'], false); LOG_MSG('INFO', "modulesetting_db_get(): END"); if ($resp[0]['STATUS'] != 'OK') { LOG_MSG('ERROR', "modulesetting_db_get(): There was an error loading name=[{$name}]"); return false; } if ($resp[0]['NROWS'] != 1) { LOG_MSG('INFO', "modulesetting_get(): No value found for [{$name}]"); return false; } return $resp[0]['value']; }