function GetResult($select, $from, $where = '', $order_by = NULL) { $results = GetResults($select, $from, $where, $order_by); if (!$results) { return $results; } return GetArr($results); }
// }else{ // $quotation_transfers = 1; // } $update_data = array(); $update_data = array_copy('id,country_residence,destination,source,handled_by,agent_name,client_name,email,in_date,tr_date,arrival_date,arrival_option,number_of_night,adults,child,infant,currency,budget_from,budget_to,remarks,hotel_start_preference,status' . $dated, $_POST); InsertUpdateRecord($update_data, DB_TABLE_PREFIX . 'inquiry', 'id'); $message = "Inquiry has beed updated"; enqueueMsg($message, "success", "inquiry.php"); } if (isset($_GET['id'])) { $id = $_GET["id"]; $where = array('id' => $id); $result_arr = getRows(DB_TABLE_PREFIX . 'inquiry', $where); if ($result_arr['total_recs'] > 0) { $result = $result_arr['result']; $row_data = GetArr($result); extract($row_data); $var_clear = false; } else { enqueueMsg('Invalid record id.', "alert"); } } if ($var_clear) { $id = 0; $full_name = ""; $email = ""; $mobile = ""; $hotel_name = ""; $hotel_address = ""; $total_adult = ""; $total_child = "";
function greaterthanRows($from, $where = '', $select = '*', $sort_order = '', $join = '', $group_by = '', $do_paging = "N", $record_per_page = '20', $rewrite_url = false) { $order_by = ""; $sqlWhere = ""; $joinSql = ""; if (is_array($select)) { $select = implode(",", $select); } $sqlWhere2 = array(); if (is_array($where) && count($where) > 0) { foreach ($where as $col => $val) { $sqlWhere2[] = $col . " >= '" . Encode($val) . "'"; } } else { if (!empty($where)) { $sqlWhere = $where; } } if ($sort_order != "") { $order_by = "ORDER BY {$sort_order}"; } if ($group_by != "") { $group_by = "GROUP BY {$group_by}"; } if (count($sqlWhere2)) { $sqlWhere = " WHERE " . implode(' AND ', $sqlWhere2); } if (is_array($join) && !empty($join)) { foreach ($join as $tbl => $con) { $tmp = explode("|", $tbl); if (isset($tmp[1])) { $joinSql .= ' ' . strtoupper($tmp[0]) . ' JOIN ' . $tmp[1] . ' ON ' . $con; } else { $joinSql .= ' JOIN ' . $tbl . ' ON ' . $con; } } } else { if (!empty($join)) { $joinSql = $join; } } $sql = "SELECT " . $select . " FROM `" . $from . '` ' . $joinSql . " {$sqlWhere} {$group_by} {$order_by}"; //echo $sql; //exit; if ($do_paging == "Y") { return customPaging($sql, $record_per_page, $rewrite_url); } else { $r = Query($sql); $num_rows = Num($r); $data = array(); if ($num_rows > 0) { while ($o = GetArr($r)) { array_push($data, $o); } } mysql_data_seek($r, 0); return array('data' => $data, 'result' => $r, 'total_recs' => $num_rows); } }
include_once 'inc/class.phpmailer.php'; if ($_SESSION['Auth_user']) { if (!empty($_POST)) { $pid = $_POST["pid"]; $chk = 'select * from wishlist where id =' . $pid . ' and user_id = ' . $_SESSION['Auth_id']; $chk_ret = Query($chk); $obj_chk = Num($chk_ret); if ($obj_chk > 0) { echo "This product already exist in your wishlist"; exit; } else { $return = 'select * from product where id =' . $pid; $ret = Query($return); if ($ret) { $i = 1; $obj = GetArr($ret); $len = count($obj); $insert1 = "insert into wishlist( "; $insert2 = " VALUES ( "; foreach ($obj as $key => $field) { if ($i == $len) { $insert1 .= $key . ",user_id)"; } else { $insert1 .= $key . ','; } if ($i == $len) { $field1 = mysql_real_escape_string($field); $insert3 .= "'" . $field1 . "','" . $_SESSION['Auth_id'] . "')"; } else { $field1 = mysql_real_escape_string($field); $insert3 .= "'" . $field1 . "',";
<?php include_once 'inc/config.inc.php'; require_once 'inc/admin_secure.inc.php'; $msg = deQueueMsg(); include 'header_dashboard.php'; $sql = "select * from users where email = '" . $_SESSION['Auth_user'] . "'"; $sql_user = Query($sql); $obj = GetArr($sql_user); ?> <div> <ul class="breadcrumb"> <li><a href="dashboard.php">Home</a> <span class="divider">/</span></li> </ul> </div> <div class="row-fluid sortable"> <div class="box span12"> <div class="box-header well" data-original-title> <h2><i class="icon-edit"></i> Edit Profile</h2> <div class="box-icon"> <!--<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>--> <a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a> <a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a> </div> </div> <div class="box-content"> <form class="form-horizontal"> <input name="id" value="" type="hidden" /> <fieldset>
<?php include_once '../inc/config.inc.php'; require_once '../inc/admin_secure.inc.php'; $msg = deQueueMsg(); $res = Query("SELECT * FROM admin_user WHERE id = '" . Encode($_SESSION['S_ID']) . "'"); if (Num($res) > 0) { $user_arr = GetArr($res); extract($user_arr); } else { enqueueMsg("Invalid User"); } if (!empty($_POST)) { extract($_POST); if (!isset($new_password) && !isset($password_confirm)) { if (empty($email)) { enqueueMsg("Enter your email address"); } else { if (empty($name)) { enqueueMsg("Enter your name"); } else { Query("UPDATE admin_user SET full_name = '" . Encode($name) . "', email = '" . Encode($email) . "' WHERE id = '" . Encode($_SESSION['S_ID']) . "'"); enqueueMsg("Profile has been updated successfully!", "success"); } } } else { if (isset($new_password) && isset($password_confirm)) { $r = Query("SELECT * FROM admin_user WHERE id = '" . Encode($_SESSION['S_ID']) . "' AND password = '******'"); if (Num($r) > 0) { if ($new_password != $password_confirm) { enqueueMsg("Password and confirm password does not match!");