Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php class Administrator_Model extends CI_Model { public function __construct() { $this..
Decoded Output download
<?php
class Administrator_Model extends CI_Model { public function __construct() { $this->load->database(); } public function adminLogin($email, $encrypt_password) { $this->db->where("email", $email); $this->db->where("password", $encrypt_password); $result = $this->db->get("users"); if ($result->num_rows() == 1) { return $result->row(0); } else { return false; } } public function app_setting() { $query = $this->db->get("app_setting"); $app_data = $query->row(); return $app_data; } public function withdrawal_slot() { $query = $this->db->get("timeslots"); $app_data = $query->row(); return $app_data; } public function stastics($type = '') { if ($type == '') { $stats = 0; } if ($type == "add_point") { $stats = $this->db->select("SUM(request_points) as points")->where(array("type" => "Add", "request_status" => "approved"))->get("tblRequest")->row()->points; } if ($type == "withdrawl_point") { $stats = $this->db->select("SUM(request_points) as points")->where(array("type" => "Withdrawal", "request_status" => "approved"))->get("tblRequest")->row()->points * -1; } if ($stats == '') { $stats = 0; } return $stats; } public function games() { return $this->db->order_by("game_id", DESC)->get("tblgame")->result(); } public function gamedata($from = '', $to = '', $type = '') { if ($from == '') { $from = date("d/m/Y"); } else { $fr = explode("-", $from); $from = $fr[2] . "/" . $fr[1] . "/" . $fr[0]; } if ($to == '') { $to = date("d/m/Y"); } else { $t = explode("-", $to); $to = $t[2] . "/" . $t[1] . "/" . $t[0]; } $this->db->order_by("id", "DESC"); $this->db->where("date >=", $from); $this->db->where("date <=", $to); if ($type == "is_fc_game") { $this->db->where_in("matka_id", array(121, 122)); } else { $this->db->where_not_in("matka_id", array(121, 122)); } return $this->db->get("tblgamedata")->result(); } public function gamebyid($id) { $this->db->where("id", $id); return $this->db->get("games")->row(); } public function userbyid($id) { $this->db->where("id", $id); return $this->db->get("user_profile")->row(); } public function matkabyid($id) { $this->db->where("id", $id); return $this->db->get("matka")->row(); } public function update_appsetting() { $app = array("message" => $this->input->post("message"), "home_text" => $this->input->post("hometext"), "withdraw_text" => $this->input->post("withdrawtext"), "withdraw_no" => $this->input->post("withdrawnumber"), "whatsapp_no" => $this->input->post("whatsapp_no"), "upi" => $this->input->post("upi"), "upi_name" => $this->input->post("upi_name"), "min_amount" => $this->input->post("min_amount"), "w_amount" => $this->input->post("w_amount"), "how_to_play" => $this->input->post("how_to_play"), "add_point_text" => $this->input->post("add_point_text"), "add_transfer_text" => $this->input->post("add_transfer_text"), "withdraw_note" => $this->input->post("withdraw_note"), "refer_amount" => $this->input->post("refer_amount"), "upi_desc" => $this->input->post("upi_desc"), "telegram_id" => $this->input->post("telegram_id"), "transfer_fee" => $this->input->post("transfer_fee"), "wallet_to_wallet_transfer_fee" => $this->input->post("wallet_to_wallet_transfer_fee")); $timeslot = array("start_time" => $this->input->post("start_time"), "end_time" => $this->input->post("end_time")); $this->db->where("id", 1)->update("timeslots", $timeslot); $this->db->where("id", 1); return $this->db->update("app_setting", $app); } public function get_posts($slug = FALSE) { if ($slug === FALSE) { $query = $this->db->order_by("id", "DESC"); $query = $this->db->get("posts"); return $query->result_array(); } $query = $this->db->get_where("posts", array("slug" => $slug)); return $query->row_array(); } public function deletegamedata($id) { $this->db->where("id", $id); return $this->db->delete("tblgamedata"); } public function del_request($id) { $this->db->where("request_id", $id); return $this->db->delete("tblRequest"); } public function create_post() { $slug = url_title($this->input->post("title"), "dash", TRUE); $data = array("title" => $this->input->post("title"), "slug" => $slug, "body" => $this->input->post("body"), "category_id" => $this->input->post("category_id")); return $this->db->insert("posts", $data); } public function delete($id, $table) { $this->db->where("id", $id); $this->db->delete($table); return true; } public function get_categories() { $this->db->order_by("id", "DESC"); $query = $this->db->get("categories"); return $query->result_array(); } public function add_user($post_image, $password) { $data = array("name" => $this->input->post("name"), "email" => $this->input->post("email"), "password" => $password, "username" => $this->input->post("username"), "zipcode" => $this->input->post("zipcode"), "contact" => $this->input->post("contact"), "address" => $this->input->post("address"), "gender" => $this->input->post("gender"), "role_id" => "2", "status" => $this->input->post("status"), "dob" => $this->input->post("dob"), "image" => $post_image, "password" => $password, "register_date" => date("Y-m-d H:i:s")); return $this->db->insert("users", $data); } public function get_users($username = FALSE, $limit = FALSE, $offset = FALSE) { if ($limit) { $this->db->limit($limit, $offset); } if ($username === FALSE) { $this->db->order_by("users.id", "DESC"); $query = $this->db->get("users"); return $query->result_array(); } $query = $this->db->get_where("users", array("username" => $username)); return $query->row_array(); } public function enable($id, $table) { $data = array("status" => 0); $this->db->where("id", $id); return $this->db->update($table, $data); } public function disable($id, $table) { $data = array("status" => 1); $this->db->where("id", $id); return $this->db->update($table, $data); } public function get_user($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("users"); return $query->result_array(); } $query = $this->db->get_where("users", array("id" => $id)); return $query->row_array(); } public function get_user_profile() { $query = $this->db->join("tblwallet", "user_profile.id=tblwallet.user_id")->where("is_deleted", 0)->order_by("tblwallet.user_id", "DESC")->get("user_profile"); return $query->result_array(); } public function deleteuser($id) { $data = array("is_deleted" => 1, "mobileno" => "0"); $this->db->where("id", $id); return $this->db->set("deleted_mobileno", "mobileno", false)->update("user_profile", $data); } public function change_status($id, $set_status = 0) { $data = array("login_status" => $set_status); $this->db->where("id", $id); return $this->db->update("user_profile", $data); } public function getGameName($id) { $q = "SELECT name FROM tblgame WHERE game_id='{$id}'"; $query = $this->db->query($q)->row_array(); return $query["name"]; } public function get_games($mid) { $q = "SELECT tblgamedata.game_id,name FROM tblgamedata LEFT JOIN tblgame ON tblgamedata.game_id=tblgame.game_id
WHERE tblgamedata.matka_id='{$mid}' GROUP BY game_id"; $query = $this->db->query($q); return $query->result_array(); } public function get_point_lists($mid, $from = '', $to = '') { $limit = 0; $d = date("Y-m-d"); if ($from == '') { $from = date("Y-m-d"); } else { $fr = explode("-", $from); $from = date("Y-m-d", strtotime($from)); } if ($to == '') { $to = date("Y-m-d"); } else { $to = date("Y-m-d", strtotime($to)); } $this->db->select("tblgamedata.game_id, tblgamedata.game_name,tblgamedata.date, tblgamedata.bet_type, tblgamedata.digits,\xa \x9 tblgamedata.points, user_profile.mobileno, tblgamedata.bs_game_name"); $this->db->from("tblgamedata"); $this->db->join("user_profile", "user_profile.id = tblgamedata.user_id", "left"); $this->db->join("tblgame", "tblgame.game_id = tblgamedata.game_id", "left"); $this->db->where("tblgamedata.matka_id", $mid); $this->db->where("tblgamedata.id >", $limit); $this->db->where("DATE(tblgamedata.time) BETWEEN '{$from}' AND '{$to}'"); $this->db->order_by("tblgamedata.digits", "asc"); return $query = $this->db->get()->result_array(); $q = "SELECT game_id,date,bet_type,digits,tblgamedata.points,user_profile.mobileno FROM tblgamedata LEFT JOIN user_profile ON user_profile.id=tblgamedata.user_id WHERE tblgamedata.matka_id='{$mid}' and tblgamedata.id>" . $limit . " and date BETWEEN '{$from}' AND '{$to}' ORDER BY date DESC"; $query = $this->db->query($q); $tbl = $query->result_array(); $t = array(); foreach ($tbl as $tb) { $gid = $tb["game_id"]; $bet_type = $tb["bet_type"]; $digits = $tb["digits"]; $mobileno = $tb["mobileno"]; $bs_game_name = $tb["bs_game_name"]; if ($gid == 12 || $gid == 13) { $bet = "--"; $digit = $bet_type . "-" . $digits; } else { $bet = $bet_type; $digit = $digits; } if (!isset($t[$tb["date"]][$gid][$bet][$digit])) { $t[$tb["date"]][$gid][$bet][$digit][$mobileno] = 0; } $t[$tb["date"]][$gid][$bet][$digit][$mobileno] += $tb["points"]; } $d = array(); $i = 0; if (isset($t)) { foreach ($t as $k => $tx) { foreach ($tx as $k1 => $txt) { foreach ($txt as $k2 => $txts) { foreach ($txts as $k3 => $txtx) { foreach ($txtx as $k4 => $mob) { $d[$i][] = $this->getGameName($k1); $d[$i][] = $k2; $d[$i][] = $k; $d[$i][] = $k3; $d[$i][] = $k4; $d[$i][] = $mob; $i++; } } } } } } return $d; } public function get_user_games($id, $mid) { $q = "SELECT DISTINCT user_profile.id, user_profile.username FROM tblgamedata LEFT JOIN user_profile ON tblgamedata.user_id=user_profile.id WHERE tblgamedata.game_id='{$id}' and tblgamedata.matka_id='{$mid}'"; $query = $this->db->query($q); return $query->result_array(); } public function get_history($user_id, $matka_id, $game_id, $from = '', $to = '') { if ($from == '') { $from = date("d/m/Y"); } if ($to == '') { $to = date("d/m/Y"); } $sel = "SELECT DISTINCT tblgame.name,user_profile.username, tblgamedata.points, tblgamedata.digits, date, tblgamedata.time,bet_type,tblgamedata.user_id, tblgamedata.matka_id,tblgamedata.game_id, tblgamedata.id from tblgame, user_profile,tblgamedata where tblgame.game_id='{$game_id}' and tblgamedata.game_id='{$game_id}' and user_id=user_profile.id and user_id='{$user_id}' and matka_id='{$matka_id}' and date BETWEEN '{$from}' AND '{$to}' order by tblgamedata.id"; $query = $this->db->query($sel); $aa = $query->result_array(); return $aa ? $aa : false; } public function get_bid_history($user_id) { $dt = date("d/m/Y"); $sel = "SELECT tblgamedata.*, matka.name as matka_name,tblgame.name as game_name FROM `tblgamedata` JOIN matka ON tblgamedata.matka_id=matka.id JOIN tblgame ON tblgamedata.game_id=tblgame.game_id where user_id='{$user_id}' && date='{$dt}' ORDER BY tblgamedata.id DESC"; $query = $this->db->query($sel); $aa = $query->result_array(); return $aa ? $aa : false; } public function add_wallet($no = '') { if ($no == '') { return NULL; } $query = $this->db->query("SELECT * FROM user_profile where mobileno='{$no}'"); return $query->result_array(); } public function add_wallet2($id, $wa) { $query = $this->db->query("Update tblwallet set main_wallet_points=main_wallet_points+'{$wa}' where user_id='{$id}'"); if ($query) { return true; } } public function update_point_to_winning($id, $wa) { $query = $this->db->query("Update tblwallet set wallet_points=wallet_points+'{$wa}' where user_id='{$id}'"); if ($query) { return true; } } public function add_wallet3($id, $wa) { $query = $this->db->query("Insert into tblwallet(main_wallet_points,user_id) values('{$wa}','{$id}')"); if ($query) { return true; } } public function add_point_to_winning($id, $wa) { $query = $this->db->query("Insert into tblwallet(wallet_points,user_id) values('{$wa}','{$id}')"); if ($query) { return true; } } public function check_wallet($id) { $query = $this->db->query("select * from tblwallet where user_id= '{$id}'"); return $query->result_array(); } public function check_wallet_amt($id) { $query = $this->db->query("select wallet_points as amt from tblwallet where user_id= '{$id}'"); return $query->row_array()["amt"]; } public function ch_amt($amt, $id) { $wallet = $this->check_wallet_amt($id); $am = $wallet - $amt; return (int) $am; } public function notify($notification) { if ($notification == '') { return false; } $query = $this->db->insert("tblNotification", array("notification" => $notification)); if ($query) { return true; } return false; } public function add_point_req_by_admin($points, $user_id) { $type = $points > 0 ? "Add" : "Withdrawal"; $insert_query = array("request_points" => $points, "user_id" => $user_id, "type" => $type, "request_status" => "approved"); $query = $this->db->insert("tblRequest", $insert_query); return $query; } public function add_point_req() { $query = $this->db->where(array("type" => "Add"))->order_by("request_id", "DESC")->limit(10000)->get("tblRequest"); return $query->result_array(); } public function delete_point_req($req_id) { $this->db->where("request_id", $req_id); $this->db->delete("tblRequest"); return true; } public function add_point_req2($id) { $query = $this->db->query("SELECT * FROM `tblRequest` where request_id='{$id}' and type = 'Add' and request_status='pending'"); if ($query->num_rows() == 0) { return redirect("admin/add_point_req"); } else { $query2 = $this->db->query("UPDATE `tblRequest` set request_status='approved' where request_id='{$id}' and request_status='pending'"); return $query->result_array(); } } public function add_point_req3($id, $points) { $pints = $this->check_wallet($id); if ($pints) { $query = $this->add_wallet2($id, $points); } else { $query = $this->add_wallet3($id, $points); } if ($query) { return true; } } public function withdraw_point_req() { $query = $this->db->where(array("type" => "Withdrawal"))->order_by("request_id", "DESC")->limit(5000)->get("tblRequest"); return $query->result_array(); } public function delete_withdraw_point_req($req_id) { $this->db->where("request_id", $req_id); $this->db->delete("tblRequest"); return true; } public function transfer_money_history() { $query = $this->db->order_by("create_at", "DESC")->get("tbltransfer_request"); return $query->result_array(); } public function refer_history() { $query = $this->db->order_by("created_at", "DESC")->get("refer_history"); return $query->result_array(); } public function withdraw_point_req2($id) { $query = $this->db->get_where("tblRequest", array("request_status" => "pending", "request_id" => $id)); $aa = $query->row_array(); $amt = 0; if (isset($aa)) { $amt = -$aa["request_points"]; } if ($this->ch_amt($amt, $aa["user_id"]) >= 0) { $query2 = $this->db->update("tblRequest", array("request_status" => "approved"), array("request_id" => $id)); } return $aa; } public function withdraw_point_req3($id, $points) { if ($this->ch_amt($points, $id) >= 0) { $query = $this->db->query(" UPDATE tblwallet set wallet_points=wallet_points-'{$points}' where user_id='{$id}' "); } if ($query) { return true; } } public function starline() { $query = $this->db->query(" SELECT * FROM `tblStarline`"); return $query->result_array(); } public function starline_update($id) { $query = $this->db->query(" SELECT * FROM `tblStarline` where id='{$id}' "); return $query->result_array(); } public function starline_update2($id) { $snum = trim($this->input->post("snum")); $stime = trim($this->input->post("stime")); $snums = explode("-", $snum); $data = array("s_game_number" => $snum, "s_game_time" => $stime); $query = $this->db->update("tblStarline", $data, array("id" => $id)); $this->update_chart($id, "Jannat Starline", $snums[0], $snums[1]); if ($query) { return true; } } public function update_user_data($post_image) { $data = array("name" => $this->input->post("name"), "zipcode" => $this->input->post("zipcode"), "contact" => $this->input->post("contact"), "address" => $this->input->post("address"), "gender" => $this->input->post("gender"), "status" => $this->input->post("status"), "dob" => $this->input->post("dob"), "image" => $post_image, "register_date" => date("Y-m-d H:i:s")); $this->db->where("id", $this->input->post("id")); $d = $this->db->update("users", $data); } public function get_siteconfiguration($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("site_config"); return $query->result_array(); } $query = $this->db->get_where("site_config", array("id" => $id)); return $query->row_array(); } public function update_siteconfiguration($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("site_config"); return $query->result_array(); } $query = $this->db->get_where("site_config", array("id" => $id)); return $query->row_array(); } public function update_siteconfiguration_data($post_image) { $data = array("site_title" => $this->input->post("site_title"), "site_name" => $this->input->post("site_name"), "logo_img" => $post_image); $this->db->where("id", $this->input->post("id")); return $this->db->update("site_config", $data); } public function get_mobile_data() { $query = $this->db->get("site_config"); return $query->row_array(); } public function update_mobile_data() { $data = array("mobile" => $this->input->post("mobile")); return $this->db->update("site_config", $data); } public function create_slider($post_image) { $data = array("title" => $this->input->post("title"), "image" => $post_image, "description" => $this->input->post("description"), "status" => $this->input->post("status")); return $this->db->insert("sliders_img", $data); } public function get_sliders($id = false) { if ($id === FALSE) { $query = $this->db->get("sliders_img"); return $query->result_array(); } $query = $this->db->get_where("sliders_img", array("id" => $id)); return $query->row_array(); } public function get_slider_data($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("sliders_img"); return $query->result_array(); } $query = $this->db->get_where("sliders_img", array("id" => $id)); return $query->row_array(); } public function update_slider_data($post_image) { $data = array("title" => $this->input->post("title"), "image" => $post_image, "description" => $this->input->post("description"), "status" => $this->input->post("status")); $this->db->where("id", $this->input->post("id")); return $this->db->update("sliders_img", $data); } public function getChart() { return $this->db->get("charts")->result_array(); } public function getChartDetails($name) { return $this->db->where("name", $name)->get("charts")->result_array(); } public function update_chart_data() { $snum = $this->input->post("snum"); $enum = $this->input->post("enum"); $data = array("name" => $this->input->post("name"), "date" => $this->input->post("date"), "starting_num" => !empty($snum) ? $snum : NULL, "result_num" => $this->input->post("num"), "end_num" => !empty($enum) ? $enum : NULL); $this->db->where("name", $this->input->post("name") and "date", $this->input->post("date")); return $this->db->update("charts", $data); } public function add_chart_data() { $snum = $this->input->post("snum"); $enum = $this->input->post("enum"); $data = array("name" => $this->input->post("chart"), "date" => $this->input->post("date"), "starting_num" => !empty($snum) ? $snum : NULL, "result_num" => $this->input->post("num"), "end_num" => !empty($enum) ? $enum : NULL); return $this->db->insert("charts", $data); } public function getUserDetails() { return $this->db->get("users")->result_array(); } public function getMatkaDetails() { return $this->db->get("matka")->result_array(); } public function get_total_users() { return $this->db->where("is_deleted", 0)->get("user_profile")->result_array(); } public function create_matka($team_image) { $snum = $this->input->post("snum"); $enum = $this->input->post("enum"); $name = $this->input->post("name"); $query = $this->db->get_where("matka", array("name" => $name)); $count = $query->num_rows(); if ($count === 0) { $data = array("name" => $this->input->post("name"), "start_time" => $this->input->post("stime"), "end_time" => $this->input->post("etime"), "starting_num" => !empty($snum) ? $snum : NULL, "number" => $this->input->post("num"), "end_num" => !empty($enum) ? $enum : NULL, "bid_start_time" => $this->input->post("fstime"), "bid_end_time" => $this->input->post("fetime")); $data1 = array("name" => $this->input->post("name"), "date" => date("Y-m-d"), "starting_num" => $this->input->post("snum"), "result_num" => $this->input->post("num"), "end_num" => $this->input->post("enum")); $this->session->set_flashdata("success", "Your matka has been created."); $this->db->insert("matka", $data); $this->db->insert("charts", $data1); $ref = "list"; } else { $ref = "add"; $this->session->set_flashdata("fail", "Name already Exist ."); } return $ref; } public function listmatka($teamId = FALSE, $limit = FALSE, $offset = FALSE) { if ($limit) { $this->db->limit($limit, $offset); } if ($teamId === FALSE) { $this->db->select("*,IF(is_homepage_game = 1, CONCAT(starting_num, ' X ', end_num),number) AS result"); $this->db->order_by("matka.id", "DESC"); $query = $this->db->get("matka"); return $query->result_array(); } $this->db->select("matka.*,tblNotice.rate as market_rate"); $this->db->where("matka.id", $teamId)->from("matka"); $this->db->join("tblNotice", "tblNotice.id = matka.id", "left"); return $query = $this->db->get()->row_array(); } public function memberlistteams($id) { $this->db->order_by("matka.id", "DESC"); return $query->result_array(); } public function update_team_data() { $c = 0; $snum = $this->input->post("snum"); $enum = $this->input->post("enum"); $num = $this->input->post("num"); $id = $this->input->post("id"); $name = $this->input->post("name"); $date = $this->input->post("udate"); $market_rate = $this->input->post("market_rate") ?? 0; if (isset($market_rate) && $market_rate > 0) { $this->db->where("id", $id)->update("tblNotice", array("rate" => $market_rate)); } $data = array("name" => $name, "starting_num" => !empty($snum) ? $snum : NULL, "number" => $this->input->post("num"), "end_num" => !empty($enum) ? $enum : NULL, "bid_start_time" => $this->input->post("fstime"), "bid_end_time" => $this->input->post("fetime"), "start_time" => $this->input->post("fstime"), "end_time" => $this->input->post("fetime"), "sat_start_time" => $this->input->post("fstime"), "sat_end_time" => $this->input->post("fetime")); $this->db->where("id", $id); $this->db->update("matka", $data); return $this->update_chart($id, $name, $snum, $num, $enum, $date); } public function update_chart($id, $name, $snum = null, $num, $enum = null, $date = null) { $dt = $date == null ? date("Y-m-d") : $date; $data1 = array("name" => $name, "cid" => $id, "date" => $dt, "starting_num" => !empty($snum) ? $snum : NULL, "result_num" => $num, "end_num" => !empty($enum) ? $enum : NULL); $where = array("cid" => $id, "date" => $dt); $data2 = $this->db->select("COUNT(id) as counter")->where($where)->get("charts")->row(); if ($data2->counter > 0) { $this->db->where($where); $this->db->update("charts", $data1); } else { $this->db->insert("charts", $data1); } return true; } public function get_admin_data() { $id = $this->session->userdata("user_id"); if ($id === FALSE) { $query = $this->db->get("users"); return $query->result_array(); } $query = $this->db->get_where("users", array("id" => $id)); return $query->row_array(); } public function change_password($new_password) { $data = array("password" => md5($new_password)); $this->db->where("id", $this->session->userdata("user_id")); return $this->db->update("users", $data); } public function match_old_password($password) { $id = $this->session->userdata("user_id"); if ($id === FALSE) { $query = $this->db->get("users"); return $query->result_array(); } $query = $this->db->get_where("users", array("password" => $password)); return $query->row_array(); } public function email_exists() { $email = $this->input->post("email"); $query = $this->db->query("SELECT email, password FROM users WHERE email='{$email}'"); if ($row = $query->row()) { return TRUE; } else { return FALSE; } } public function temp_reset_password($temp_pass) { $data = array("email" => $this->input->post("email"), "reset_pass" => $temp_pass); $email = $data["email"]; if ($data) { $this->db->where("email", $email); $this->db->update("users", $data); return TRUE; } else { return FALSE; } } public function is_temp_pass_valid($temp_pass) { $this->db->where("reset_pass", $temp_pass); $query = $this->db->get("users"); if ($query->num_rows() == 1) { return TRUE; } else { return FALSE; } } public function deletepackage($id) { $data = array("status" => 2); $this->db->where("id", $id); return $this->db->update("package", $data); } public function add_wallet_4($id, $wa, $wallet = '') { if ($wallet != '') { if ($wallet == "wallet_points") { $query = $this->db->query("Update tblwallet set wallet_points=wallet_points+'{$wa}' where user_id='{$id}'"); } else { $query = $this->db->query("Update tblwallet set main_wallet_points=main_wallet_points+'{$wa}' where user_id='{$id}'"); } } else { $query = $this->db->query("Update tblwallet set main_wallet_points=main_wallet_points+'{$wa}' where user_id='{$id}'"); } if ($query) { return true; } } } ?>
Did this file decode correctly?
Original Code
<?php
class Administrator_Model extends CI_Model { public function __construct() { $this->load->database(); } public function adminLogin($email, $encrypt_password) { $this->db->where("\x65\x6d\141\x69\154", $email); $this->db->where("\160\141\163\163\x77\157\x72\x64", $encrypt_password); $result = $this->db->get("\x75\163\x65\162\163"); if ($result->num_rows() == 1) { return $result->row(0); } else { return false; } } public function app_setting() { $query = $this->db->get("\141\160\160\x5f\x73\145\164\164\x69\x6e\x67"); $app_data = $query->row(); return $app_data; } public function withdrawal_slot() { $query = $this->db->get("\164\151\155\145\163\154\x6f\x74\x73"); $app_data = $query->row(); return $app_data; } public function stastics($type = '') { if ($type == '') { $stats = 0; } if ($type == "\141\x64\144\137\160\157\151\156\164") { $stats = $this->db->select("\x53\125\x4d\x28\162\x65\161\x75\x65\x73\x74\x5f\x70\x6f\151\156\x74\163\x29\40\x61\163\40\160\x6f\x69\x6e\x74\x73")->where(array("\164\171\160\145" => "\101\x64\x64", "\x72\x65\161\x75\145\163\164\x5f\x73\164\141\x74\x75\x73" => "\x61\x70\160\162\x6f\166\145\144"))->get("\x74\142\x6c\122\x65\x71\165\145\x73\x74")->row()->points; } if ($type == "\167\151\x74\150\x64\162\141\167\x6c\137\160\157\x69\x6e\164") { $stats = $this->db->select("\x53\125\115\50\x72\145\x71\x75\x65\x73\164\x5f\160\157\151\156\x74\x73\x29\40\141\163\40\160\x6f\x69\x6e\x74\163")->where(array("\x74\x79\x70\x65" => "\127\151\164\150\144\x72\141\167\x61\154", "\x72\145\161\x75\145\163\164\137\163\x74\x61\164\x75\x73" => "\x61\x70\160\x72\x6f\x76\145\144"))->get("\x74\142\154\x52\145\x71\x75\x65\163\x74")->row()->points * -1; } if ($stats == '') { $stats = 0; } return $stats; } public function games() { return $this->db->order_by("\147\141\155\x65\137\x69\x64", DESC)->get("\164\142\x6c\x67\x61\x6d\145")->result(); } public function gamedata($from = '', $to = '', $type = '') { if ($from == '') { $from = date("\x64\57\x6d\57\131"); } else { $fr = explode("\55", $from); $from = $fr[2] . "\57" . $fr[1] . "\x2f" . $fr[0]; } if ($to == '') { $to = date("\x64\x2f\x6d\x2f\131"); } else { $t = explode("\55", $to); $to = $t[2] . "\x2f" . $t[1] . "\x2f" . $t[0]; } $this->db->order_by("\x69\x64", "\104\105\123\x43"); $this->db->where("\x64\x61\x74\145\40\x3e\75", $from); $this->db->where("\x64\x61\x74\x65\40\74\x3d", $to); if ($type == "\x69\163\137\146\143\137\x67\x61\x6d\145") { $this->db->where_in("\x6d\141\164\x6b\141\x5f\151\144", array(121, 122)); } else { $this->db->where_not_in("\155\x61\164\153\141\x5f\x69\x64", array(121, 122)); } return $this->db->get("\x74\x62\154\147\141\x6d\145\x64\141\x74\x61")->result(); } public function gamebyid($id) { $this->db->where("\x69\x64", $id); return $this->db->get("\147\141\x6d\145\x73")->row(); } public function userbyid($id) { $this->db->where("\x69\x64", $id); return $this->db->get("\x75\163\145\x72\137\160\x72\x6f\146\x69\x6c\x65")->row(); } public function matkabyid($id) { $this->db->where("\x69\x64", $id); return $this->db->get("\155\141\x74\x6b\x61")->row(); } public function update_appsetting() { $app = array("\x6d\x65\x73\x73\141\x67\x65" => $this->input->post("\155\145\x73\163\141\147\x65"), "\x68\157\x6d\145\137\x74\x65\x78\164" => $this->input->post("\150\x6f\155\145\164\x65\x78\x74"), "\167\x69\x74\x68\x64\162\x61\x77\x5f\x74\x65\170\x74" => $this->input->post("\167\x69\x74\150\x64\162\x61\167\x74\145\170\x74"), "\167\x69\x74\150\144\x72\141\x77\137\x6e\157" => $this->input->post("\x77\x69\x74\x68\144\x72\x61\x77\156\165\155\x62\x65\162"), "\167\150\x61\164\x73\x61\x70\160\x5f\156\157" => $this->input->post("\x77\150\141\x74\x73\141\x70\x70\137\156\157"), "\x75\x70\x69" => $this->input->post("\165\x70\151"), "\x75\160\151\137\156\141\155\145" => $this->input->post("\x75\160\151\137\x6e\141\x6d\145"), "\x6d\151\x6e\x5f\141\155\x6f\165\156\x74" => $this->input->post("\x6d\151\x6e\137\141\155\x6f\x75\x6e\164"), "\x77\x5f\x61\155\157\165\x6e\x74" => $this->input->post("\x77\x5f\141\155\157\x75\x6e\x74"), "\x68\x6f\x77\x5f\164\x6f\x5f\160\154\141\x79" => $this->input->post("\x68\x6f\x77\x5f\x74\x6f\137\160\x6c\141\x79"), "\141\x64\144\137\x70\x6f\x69\x6e\164\137\x74\x65\x78\164" => $this->input->post("\x61\144\x64\x5f\x70\x6f\x69\x6e\164\137\x74\145\170\x74"), "\141\x64\x64\137\164\x72\141\156\163\x66\145\162\137\x74\145\170\x74" => $this->input->post("\141\144\x64\137\164\162\x61\x6e\163\x66\x65\162\x5f\x74\145\170\164"), "\x77\x69\164\x68\144\x72\141\x77\x5f\156\x6f\164\x65" => $this->input->post("\167\151\x74\150\x64\162\x61\167\137\x6e\157\164\145"), "\162\x65\146\x65\162\x5f\x61\x6d\x6f\165\x6e\x74" => $this->input->post("\162\145\x66\x65\162\137\x61\x6d\157\x75\x6e\x74"), "\165\x70\151\137\144\145\x73\x63" => $this->input->post("\165\x70\151\137\x64\145\x73\143"), "\x74\145\x6c\x65\x67\162\x61\x6d\x5f\x69\x64" => $this->input->post("\x74\145\154\145\x67\x72\141\155\137\x69\144"), "\164\x72\x61\x6e\163\146\x65\x72\x5f\x66\x65\x65" => $this->input->post("\164\x72\141\x6e\x73\146\x65\162\137\146\x65\x65"), "\x77\x61\154\x6c\145\x74\x5f\164\157\137\x77\141\154\154\x65\x74\137\164\162\x61\156\x73\146\145\162\137\x66\145\145" => $this->input->post("\167\141\x6c\154\145\164\x5f\x74\157\137\167\x61\154\154\x65\164\137\164\162\x61\156\x73\x66\x65\162\137\146\x65\x65")); $timeslot = array("\x73\x74\141\x72\164\137\x74\x69\155\x65" => $this->input->post("\163\164\141\x72\164\137\164\151\x6d\x65"), "\145\156\x64\x5f\x74\x69\155\x65" => $this->input->post("\145\156\144\137\x74\x69\155\145")); $this->db->where("\151\x64", 1)->update("\x74\151\x6d\x65\x73\x6c\x6f\164\x73", $timeslot); $this->db->where("\151\144", 1); return $this->db->update("\x61\x70\x70\x5f\x73\145\x74\x74\x69\x6e\x67", $app); } public function get_posts($slug = FALSE) { if ($slug === FALSE) { $query = $this->db->order_by("\x69\144", "\104\105\123\x43"); $query = $this->db->get("\160\x6f\163\164\163"); return $query->result_array(); } $query = $this->db->get_where("\160\157\163\164\163", array("\x73\x6c\x75\147" => $slug)); return $query->row_array(); } public function deletegamedata($id) { $this->db->where("\151\144", $id); return $this->db->delete("\x74\142\154\x67\x61\155\145\x64\x61\164\x61"); } public function del_request($id) { $this->db->where("\x72\x65\x71\165\x65\163\x74\x5f\151\x64", $id); return $this->db->delete("\x74\142\154\x52\145\x71\x75\x65\163\164"); } public function create_post() { $slug = url_title($this->input->post("\164\151\164\x6c\145"), "\x64\141\163\x68", TRUE); $data = array("\x74\151\164\x6c\x65" => $this->input->post("\x74\x69\x74\x6c\145"), "\x73\154\165\x67" => $slug, "\142\157\144\x79" => $this->input->post("\x62\x6f\144\171"), "\143\x61\164\145\x67\157\162\x79\137\151\144" => $this->input->post("\x63\x61\164\145\147\x6f\162\171\137\151\144")); return $this->db->insert("\x70\157\163\x74\x73", $data); } public function delete($id, $table) { $this->db->where("\151\144", $id); $this->db->delete($table); return true; } public function get_categories() { $this->db->order_by("\151\x64", "\104\105\123\103"); $query = $this->db->get("\143\141\164\145\147\x6f\162\x69\145\163"); return $query->result_array(); } public function add_user($post_image, $password) { $data = array("\x6e\141\155\145" => $this->input->post("\156\x61\x6d\x65"), "\145\155\141\151\x6c" => $this->input->post("\x65\x6d\141\x69\x6c"), "\x70\141\163\163\x77\157\x72\144" => $password, "\165\163\145\162\156\141\155\x65" => $this->input->post("\165\163\x65\x72\156\x61\x6d\x65"), "\172\x69\x70\143\157\x64\x65" => $this->input->post("\x7a\x69\160\x63\x6f\144\145"), "\x63\157\x6e\x74\141\x63\164" => $this->input->post("\x63\x6f\x6e\164\141\143\x74"), "\x61\x64\x64\162\x65\163\163" => $this->input->post("\x61\x64\x64\x72\145\x73\163"), "\x67\145\x6e\144\x65\162" => $this->input->post("\x67\145\x6e\144\x65\x72"), "\162\157\x6c\145\x5f\x69\144" => "\x32", "\163\164\141\164\165\163" => $this->input->post("\x73\164\x61\164\165\x73"), "\x64\x6f\x62" => $this->input->post("\x64\x6f\142"), "\x69\x6d\141\147\145" => $post_image, "\x70\141\163\x73\167\x6f\162\144" => $password, "\x72\145\147\151\x73\164\x65\162\137\144\141\164\x65" => date("\x59\x2d\155\55\x64\40\x48\x3a\151\72\x73")); return $this->db->insert("\x75\163\145\162\163", $data); } public function get_users($username = FALSE, $limit = FALSE, $offset = FALSE) { if ($limit) { $this->db->limit($limit, $offset); } if ($username === FALSE) { $this->db->order_by("\165\x73\x65\162\x73\x2e\x69\144", "\x44\105\x53\x43"); $query = $this->db->get("\x75\x73\145\x72\x73"); return $query->result_array(); } $query = $this->db->get_where("\x75\163\145\162\163", array("\x75\x73\x65\162\156\141\155\x65" => $username)); return $query->row_array(); } public function enable($id, $table) { $data = array("\x73\x74\141\x74\165\x73" => 0); $this->db->where("\x69\x64", $id); return $this->db->update($table, $data); } public function disable($id, $table) { $data = array("\163\x74\x61\x74\165\163" => 1); $this->db->where("\151\x64", $id); return $this->db->update($table, $data); } public function get_user($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("\x75\x73\x65\x72\163"); return $query->result_array(); } $query = $this->db->get_where("\x75\163\145\x72\163", array("\151\144" => $id)); return $query->row_array(); } public function get_user_profile() { $query = $this->db->join("\164\x62\154\167\x61\x6c\x6c\145\164", "\165\163\x65\162\x5f\x70\x72\157\x66\x69\x6c\145\x2e\x69\144\75\164\142\154\167\x61\x6c\154\145\x74\x2e\x75\163\x65\x72\x5f\151\144")->where("\151\x73\x5f\144\145\154\145\x74\145\144", 0)->order_by("\164\x62\154\167\141\x6c\x6c\x65\164\x2e\165\163\x65\162\x5f\x69\144", "\x44\x45\x53\x43")->get("\165\163\145\x72\137\x70\162\x6f\x66\x69\x6c\145"); return $query->result_array(); } public function deleteuser($id) { $data = array("\151\x73\137\144\x65\x6c\145\164\x65\144" => 1, "\x6d\157\x62\x69\x6c\x65\x6e\x6f" => "\60"); $this->db->where("\151\x64", $id); return $this->db->set("\x64\145\x6c\145\x74\x65\144\x5f\155\x6f\142\151\154\x65\156\157", "\155\x6f\x62\151\x6c\x65\156\157", false)->update("\x75\163\x65\162\x5f\160\x72\157\x66\151\x6c\x65", $data); } public function change_status($id, $set_status = 0) { $data = array("\x6c\157\x67\x69\x6e\137\x73\164\141\x74\165\163" => $set_status); $this->db->where("\x69\x64", $id); return $this->db->update("\165\x73\x65\162\x5f\x70\162\x6f\146\x69\x6c\145", $data); } public function getGameName($id) { $q = "\123\x45\114\x45\103\124\40\156\x61\x6d\x65\40\106\122\x4f\x4d\40\164\142\154\147\141\x6d\x65\x20\x57\110\105\x52\x45\40\x67\x61\155\145\x5f\151\x64\75\47{$id}\x27"; $query = $this->db->query($q)->row_array(); return $query["\x6e\141\x6d\x65"]; } public function get_games($mid) { $q = "\x53\105\114\105\x43\x54\x20\164\142\x6c\147\x61\x6d\x65\x64\141\164\x61\56\147\x61\x6d\x65\137\x69\x64\x2c\156\x61\155\x65\x20\x46\122\x4f\x4d\40\164\142\154\x67\141\x6d\x65\144\141\x74\141\x20\x4c\x45\x46\124\x20\x4a\x4f\x49\x4e\x20\164\x62\154\147\x61\155\x65\40\117\x4e\40\x74\142\154\147\141\155\x65\144\141\164\x61\56\x67\x61\155\x65\137\x69\x64\x3d\x74\142\x6c\x67\141\155\145\x2e\x67\141\155\x65\x5f\151\144\x20\12\11\11\40\40\x20\40\127\110\x45\122\105\x20\x74\142\x6c\147\141\x6d\145\x64\141\164\x61\x2e\155\141\x74\x6b\141\137\151\x64\75\x27{$mid}\x27\x20\107\x52\117\x55\x50\40\x42\x59\40\x67\x61\x6d\145\137\151\144"; $query = $this->db->query($q); return $query->result_array(); } public function get_point_lists($mid, $from = '', $to = '') { $limit = 0; $d = date("\131\55\x6d\x2d\144"); if ($from == '') { $from = date("\131\55\155\x2d\144"); } else { $fr = explode("\55", $from); $from = date("\131\55\x6d\x2d\144", strtotime($from)); } if ($to == '') { $to = date("\x59\55\x6d\x2d\144"); } else { $to = date("\x59\x2d\155\x2d\144", strtotime($to)); } $this->db->select("\164\142\x6c\x67\x61\155\x65\144\x61\x74\141\x2e\x67\141\155\x65\137\x69\x64\54\x20\x74\x62\x6c\147\x61\x6d\145\144\x61\x74\x61\x2e\x67\x61\x6d\x65\137\156\x61\155\x65\x2c\164\x62\x6c\x67\141\x6d\x65\x64\x61\x74\141\56\x64\x61\x74\145\54\40\164\x62\x6c\x67\141\x6d\145\x64\141\x74\141\56\x62\145\164\x5f\x74\x79\x70\x65\54\40\164\x62\154\147\x61\x6d\145\144\141\x74\141\56\144\x69\147\151\164\163\x2c\xa\11\x9\40\x20\x74\x62\x6c\147\141\155\x65\x64\141\x74\x61\56\x70\157\151\156\x74\x73\x2c\40\165\163\145\x72\137\x70\x72\157\x66\151\154\x65\56\x6d\x6f\142\151\154\x65\x6e\157\x2c\x20\x74\x62\x6c\x67\x61\155\x65\x64\141\164\141\x2e\x62\x73\x5f\147\141\x6d\x65\x5f\156\141\x6d\x65"); $this->db->from("\164\142\x6c\147\141\155\x65\144\141\x74\141"); $this->db->join("\165\x73\145\162\137\160\162\x6f\146\x69\154\x65", "\x75\x73\145\x72\137\x70\162\x6f\x66\151\x6c\145\56\151\144\x20\75\x20\164\x62\x6c\x67\141\x6d\x65\144\141\164\x61\x2e\165\x73\145\x72\x5f\x69\144", "\154\x65\146\x74"); $this->db->join("\164\x62\154\x67\x61\155\145", "\164\x62\154\x67\x61\155\x65\56\x67\141\155\x65\x5f\151\x64\40\75\40\x74\x62\154\x67\141\x6d\145\144\x61\x74\141\56\147\x61\x6d\145\x5f\x69\x64", "\154\145\x66\164"); $this->db->where("\164\x62\x6c\147\141\x6d\x65\x64\x61\x74\x61\x2e\x6d\141\x74\153\x61\x5f\151\x64", $mid); $this->db->where("\x74\x62\154\x67\x61\x6d\145\x64\x61\164\x61\56\x69\x64\x20\76", $limit); $this->db->where("\104\101\x54\x45\x28\164\x62\x6c\147\x61\155\x65\x64\x61\x74\x61\56\164\151\x6d\x65\x29\x20\x42\105\124\127\x45\x45\x4e\x20\x27{$from}\47\40\101\116\104\40\47{$to}\47"); $this->db->order_by("\164\x62\154\x67\x61\x6d\145\144\141\x74\141\x2e\144\x69\x67\x69\x74\x73", "\x61\163\143"); return $query = $this->db->get()->result_array(); $q = "\123\105\114\x45\x43\124\x20\147\x61\x6d\145\137\151\144\54\144\x61\164\x65\54\x62\x65\164\137\164\x79\160\x65\54\144\x69\147\x69\164\x73\54\164\142\154\147\x61\x6d\145\144\x61\x74\141\56\160\157\x69\156\x74\163\x2c\x75\x73\145\162\137\x70\x72\x6f\x66\151\154\x65\x2e\155\157\142\x69\x6c\x65\156\x6f\x20\106\x52\x4f\115\x20\x74\x62\154\x67\x61\x6d\145\144\x61\x74\x61\40\114\x45\x46\x54\40\112\117\x49\116\x20\165\163\145\162\x5f\x70\162\157\x66\151\154\x65\x20\117\x4e\x20\x75\163\145\x72\x5f\160\x72\157\146\x69\154\x65\x2e\151\x64\75\x74\142\x6c\147\x61\x6d\145\x64\141\164\x61\x2e\x75\x73\145\x72\x5f\151\144\x20\x57\x48\105\122\105\x20\164\142\154\x67\141\x6d\x65\144\141\x74\141\x2e\x6d\141\x74\x6b\x61\137\151\144\75\x27{$mid}\x27\40\x61\156\x64\40\x74\x62\154\147\x61\155\145\144\141\x74\141\x2e\151\144\x3e" . $limit . "\40\141\x6e\x64\40\x64\141\x74\x65\x20\x42\105\x54\127\105\105\116\40\x27{$from}\47\x20\101\x4e\104\x20\x27{$to}\x27\40\117\x52\104\105\122\x20\102\131\40\144\x61\164\x65\x20\x44\x45\x53\103"; $query = $this->db->query($q); $tbl = $query->result_array(); $t = array(); foreach ($tbl as $tb) { $gid = $tb["\147\141\x6d\145\x5f\151\144"]; $bet_type = $tb["\x62\145\x74\x5f\x74\171\x70\x65"]; $digits = $tb["\144\151\147\x69\164\163"]; $mobileno = $tb["\x6d\x6f\x62\x69\154\x65\156\x6f"]; $bs_game_name = $tb["\x62\x73\x5f\147\x61\155\145\x5f\x6e\x61\x6d\145"]; if ($gid == 12 || $gid == 13) { $bet = "\x2d\55"; $digit = $bet_type . "\x2d" . $digits; } else { $bet = $bet_type; $digit = $digits; } if (!isset($t[$tb["\x64\x61\x74\145"]][$gid][$bet][$digit])) { $t[$tb["\144\x61\164\x65"]][$gid][$bet][$digit][$mobileno] = 0; } $t[$tb["\144\x61\x74\x65"]][$gid][$bet][$digit][$mobileno] += $tb["\x70\157\x69\156\x74\163"]; } $d = array(); $i = 0; if (isset($t)) { foreach ($t as $k => $tx) { foreach ($tx as $k1 => $txt) { foreach ($txt as $k2 => $txts) { foreach ($txts as $k3 => $txtx) { foreach ($txtx as $k4 => $mob) { $d[$i][] = $this->getGameName($k1); $d[$i][] = $k2; $d[$i][] = $k; $d[$i][] = $k3; $d[$i][] = $k4; $d[$i][] = $mob; $i++; } } } } } } return $d; } public function get_user_games($id, $mid) { $q = "\123\105\x4c\x45\x43\x54\40\x44\111\123\124\111\x4e\x43\124\40\165\163\145\x72\137\160\x72\157\146\151\154\x65\56\x69\144\54\x20\165\163\x65\162\x5f\x70\x72\157\x66\151\154\145\56\165\163\x65\x72\x6e\x61\155\x65\x20\x46\x52\117\115\40\x74\142\x6c\x67\x61\x6d\145\144\141\x74\141\x20\x4c\x45\x46\124\40\x4a\x4f\111\x4e\40\x75\163\x65\x72\137\160\162\157\x66\x69\x6c\145\40\x4f\116\x20\x74\142\x6c\x67\x61\155\x65\x64\141\x74\141\56\x75\x73\145\x72\x5f\x69\x64\75\165\163\x65\162\137\160\x72\157\x66\151\x6c\x65\56\x69\144\40\127\x48\105\122\x45\x20\x74\x62\x6c\147\141\x6d\145\144\x61\x74\141\56\x67\x61\155\x65\x5f\151\x64\75\x27{$id}\47\x20\x61\x6e\x64\40\x74\142\x6c\147\x61\155\x65\144\x61\x74\x61\x2e\155\x61\164\x6b\x61\x5f\151\x64\75\x27{$mid}\47"; $query = $this->db->query($q); return $query->result_array(); } public function get_history($user_id, $matka_id, $game_id, $from = '', $to = '') { if ($from == '') { $from = date("\x64\x2f\x6d\x2f\131"); } if ($to == '') { $to = date("\144\57\155\57\x59"); } $sel = "\x53\105\x4c\x45\x43\124\40\x44\x49\123\x54\111\116\103\x54\x20\164\142\x6c\x67\x61\155\145\x2e\x6e\x61\x6d\x65\x2c\165\x73\145\162\137\x70\x72\x6f\146\x69\154\145\x2e\165\x73\145\162\156\x61\155\x65\x2c\x20\x74\142\154\x67\141\x6d\145\144\x61\164\141\56\160\157\151\156\x74\x73\x2c\x20\x74\x62\x6c\147\x61\x6d\x65\144\x61\x74\x61\56\x64\x69\147\x69\x74\163\54\x20\144\x61\x74\145\54\40\x74\x62\x6c\x67\141\155\145\x64\x61\x74\141\56\x74\151\155\145\x2c\142\145\164\x5f\x74\171\x70\145\x2c\164\142\154\147\x61\155\145\144\141\164\141\56\x75\x73\x65\x72\x5f\x69\x64\54\40\x74\x62\154\x67\141\x6d\x65\x64\x61\x74\141\x2e\x6d\x61\164\x6b\141\137\151\x64\54\164\142\x6c\147\x61\x6d\x65\x64\x61\x74\141\56\x67\141\x6d\145\x5f\151\x64\54\x20\x74\x62\154\147\141\x6d\x65\144\x61\x74\x61\x2e\151\x64\x20\x66\162\x6f\155\x20\x74\142\x6c\147\x61\x6d\x65\54\x20\165\163\x65\162\x5f\x70\x72\x6f\146\x69\x6c\145\x2c\164\x62\154\x67\141\155\145\x64\x61\x74\x61\40\x77\150\x65\x72\x65\40\164\142\154\147\141\155\x65\56\147\141\155\x65\137\151\144\x3d\x27{$game_id}\x27\x20\x61\x6e\144\40\x74\x62\154\147\141\x6d\145\144\x61\164\x61\x2e\147\141\155\145\x5f\151\x64\x3d\47{$game_id}\x27\x20\x61\156\x64\40\165\x73\x65\162\x5f\x69\x64\x3d\165\x73\x65\162\137\x70\x72\x6f\x66\x69\x6c\x65\x2e\x69\144\x20\141\x6e\144\40\x75\163\x65\162\137\151\144\x3d\x27{$user_id}\x27\40\x61\x6e\144\x20\x6d\x61\x74\153\x61\x5f\x69\144\75\x27{$matka_id}\47\40\141\x6e\144\40\x64\141\164\145\x20\102\x45\x54\127\105\105\116\40\47{$from}\47\40\101\x4e\104\40\47{$to}\x27\x20\x6f\x72\x64\x65\162\x20\x62\171\40\164\x62\154\x67\141\x6d\x65\x64\141\164\x61\56\x69\144"; $query = $this->db->query($sel); $aa = $query->result_array(); return $aa ? $aa : false; } public function get_bid_history($user_id) { $dt = date("\144\57\155\x2f\x59"); $sel = "\x53\x45\114\105\103\124\40\164\x62\x6c\147\141\155\x65\144\141\164\x61\x2e\x2a\54\40\x6d\x61\164\x6b\x61\x2e\156\x61\155\x65\40\x61\x73\40\x6d\141\x74\153\x61\x5f\156\x61\155\x65\54\164\142\154\x67\141\x6d\x65\x2e\x6e\141\155\145\x20\x61\163\40\147\x61\x6d\x65\137\156\x61\x6d\145\x20\x46\x52\117\115\40\x60\x74\142\x6c\x67\x61\155\x65\x64\x61\x74\141\140\x20\x4a\x4f\x49\116\x20\x6d\141\164\153\x61\x20\117\116\40\x74\x62\x6c\x67\x61\155\x65\144\141\164\x61\56\x6d\x61\x74\x6b\141\x5f\x69\144\75\155\141\164\153\x61\56\x69\x64\40\x4a\117\111\x4e\x20\x74\142\x6c\147\x61\155\145\x20\117\116\40\164\142\154\x67\x61\x6d\145\144\x61\x74\141\x2e\147\x61\155\145\x5f\151\x64\x3d\x74\142\x6c\x67\x61\155\x65\x2e\x67\141\x6d\145\137\x69\x64\x20\167\150\145\x72\145\x20\165\163\145\x72\x5f\151\x64\75\x27{$user_id}\x27\40\46\x26\x20\x64\x61\x74\x65\x3d\47{$dt}\x27\x20\x4f\122\x44\105\x52\x20\102\131\x20\x74\142\x6c\x67\141\x6d\x65\x64\x61\164\141\56\x69\144\40\x44\x45\123\103"; $query = $this->db->query($sel); $aa = $query->result_array(); return $aa ? $aa : false; } public function add_wallet($no = '') { if ($no == '') { return NULL; } $query = $this->db->query("\x53\105\114\x45\x43\x54\x20\52\40\x46\122\x4f\x4d\40\165\163\x65\162\x5f\x70\162\x6f\x66\151\x6c\145\40\x77\150\x65\162\145\x20\x6d\x6f\x62\x69\x6c\145\156\157\x3d\x27{$no}\x27"); return $query->result_array(); } public function add_wallet2($id, $wa) { $query = $this->db->query("\x55\x70\x64\141\x74\x65\x20\164\142\154\x77\x61\154\x6c\x65\164\x20\163\145\x74\x20\x6d\141\151\156\137\x77\x61\154\154\x65\164\137\160\157\151\x6e\164\163\x3d\155\x61\x69\156\x5f\x77\x61\x6c\154\145\164\137\x70\x6f\x69\156\x74\x73\53\x27{$wa}\47\x20\x77\x68\x65\x72\x65\40\165\163\145\162\x5f\151\x64\75\x27{$id}\x27"); if ($query) { return true; } } public function update_point_to_winning($id, $wa) { $query = $this->db->query("\x55\160\x64\141\x74\145\40\x74\142\x6c\167\141\x6c\x6c\145\x74\40\x73\145\x74\x20\x77\x61\x6c\x6c\145\x74\137\160\157\x69\x6e\x74\x73\75\x77\x61\154\x6c\x65\x74\137\x70\x6f\x69\x6e\x74\x73\53\x27{$wa}\47\40\167\150\145\x72\x65\x20\x75\163\x65\x72\137\x69\x64\75\x27{$id}\x27"); if ($query) { return true; } } public function add_wallet3($id, $wa) { $query = $this->db->query("\x49\156\163\145\x72\164\x20\151\156\x74\x6f\x20\164\x62\x6c\167\141\154\x6c\x65\164\50\155\x61\151\156\x5f\x77\x61\154\154\145\x74\x5f\160\x6f\x69\156\x74\x73\54\x75\x73\x65\x72\x5f\151\144\x29\40\166\x61\x6c\x75\x65\163\x28\x27{$wa}\47\x2c\47{$id}\x27\x29"); if ($query) { return true; } } public function add_point_to_winning($id, $wa) { $query = $this->db->query("\x49\156\163\145\162\164\x20\151\x6e\x74\157\x20\164\x62\154\167\141\x6c\154\145\164\50\x77\141\x6c\154\145\x74\137\x70\x6f\151\156\x74\163\54\x75\x73\145\162\x5f\151\x64\x29\x20\x76\x61\x6c\x75\x65\163\x28\x27{$wa}\x27\54\47{$id}\47\51"); if ($query) { return true; } } public function check_wallet($id) { $query = $this->db->query("\163\145\x6c\145\143\164\40\52\x20\146\162\157\155\x20\x74\x62\154\167\141\154\x6c\145\164\40\x77\150\145\x72\x65\x20\x75\x73\145\x72\x5f\x69\144\x3d\x20\x27{$id}\47"); return $query->result_array(); } public function check_wallet_amt($id) { $query = $this->db->query("\x73\x65\x6c\145\x63\164\x20\x77\x61\x6c\154\145\164\x5f\x70\157\151\x6e\164\163\40\141\163\x20\x61\x6d\164\x20\146\x72\157\x6d\x20\x74\142\154\167\141\x6c\154\x65\164\40\x77\150\x65\162\145\40\165\x73\x65\162\x5f\151\x64\75\x20\47{$id}\47"); return $query->row_array()["\141\x6d\x74"]; } public function ch_amt($amt, $id) { $wallet = $this->check_wallet_amt($id); $am = $wallet - $amt; return (int) $am; } public function notify($notification) { if ($notification == '') { return false; } $query = $this->db->insert("\x74\142\154\116\157\x74\151\146\x69\x63\x61\x74\x69\157\156", array("\x6e\x6f\x74\151\x66\x69\143\141\164\151\x6f\156" => $notification)); if ($query) { return true; } return false; } public function add_point_req_by_admin($points, $user_id) { $type = $points > 0 ? "\101\144\x64" : "\127\151\x74\150\x64\x72\141\x77\141\x6c"; $insert_query = array("\x72\x65\x71\165\x65\163\164\x5f\160\x6f\x69\156\x74\163" => $points, "\165\x73\145\162\x5f\x69\144" => $user_id, "\x74\171\x70\145" => $type, "\x72\145\161\165\x65\163\164\137\163\164\x61\x74\165\163" => "\141\160\x70\x72\157\x76\x65\144"); $query = $this->db->insert("\x74\142\154\122\145\x71\165\145\x73\164", $insert_query); return $query; } public function add_point_req() { $query = $this->db->where(array("\x74\x79\160\145" => "\101\144\144"))->order_by("\162\145\x71\165\x65\x73\164\137\x69\144", "\x44\x45\123\x43")->limit(10000)->get("\164\x62\x6c\x52\x65\161\165\x65\163\x74"); return $query->result_array(); } public function delete_point_req($req_id) { $this->db->where("\162\x65\161\x75\x65\x73\164\x5f\151\144", $req_id); $this->db->delete("\164\142\154\x52\145\161\165\145\x73\x74"); return true; } public function add_point_req2($id) { $query = $this->db->query("\x53\105\114\105\103\x54\x20\52\40\x46\122\x4f\115\40\140\x74\142\x6c\122\145\x71\x75\x65\163\x74\x60\40\167\x68\x65\x72\x65\40\162\145\161\165\x65\163\164\137\x69\x64\75\47{$id}\47\x20\141\x6e\x64\40\164\x79\x70\x65\40\x3d\x20\x27\x41\x64\x64\47\x20\x61\156\x64\x20\162\145\161\165\145\163\x74\137\163\164\141\x74\x75\163\75\47\x70\145\x6e\144\x69\156\147\47"); if ($query->num_rows() == 0) { return redirect("\x61\x64\x6d\x69\156\57\141\144\x64\137\160\x6f\151\156\x74\137\162\x65\161"); } else { $query2 = $this->db->query("\125\x50\x44\101\x54\x45\x20\140\x74\x62\154\x52\x65\x71\165\145\163\x74\140\x20\x73\x65\164\40\x72\x65\161\x75\x65\163\x74\137\163\x74\x61\x74\165\x73\x3d\x27\x61\160\x70\162\x6f\x76\x65\x64\47\x20\x77\x68\x65\162\x65\x20\x72\x65\161\x75\145\x73\x74\x5f\x69\x64\x3d\47{$id}\x27\x20\141\156\x64\40\162\145\161\x75\145\x73\x74\x5f\163\x74\141\x74\x75\x73\75\x27\160\x65\156\x64\x69\156\x67\x27"); return $query->result_array(); } } public function add_point_req3($id, $points) { $pints = $this->check_wallet($id); if ($pints) { $query = $this->add_wallet2($id, $points); } else { $query = $this->add_wallet3($id, $points); } if ($query) { return true; } } public function withdraw_point_req() { $query = $this->db->where(array("\x74\171\x70\145" => "\x57\151\164\x68\144\162\141\167\141\154"))->order_by("\x72\x65\x71\165\x65\x73\164\137\151\x64", "\x44\x45\123\103")->limit(5000)->get("\x74\142\x6c\x52\145\161\165\x65\163\164"); return $query->result_array(); } public function delete_withdraw_point_req($req_id) { $this->db->where("\162\x65\x71\165\145\x73\x74\137\x69\144", $req_id); $this->db->delete("\164\x62\154\122\145\161\x75\x65\x73\x74"); return true; } public function transfer_money_history() { $query = $this->db->order_by("\143\x72\x65\x61\x74\145\x5f\x61\164", "\x44\x45\x53\x43")->get("\164\142\x6c\x74\162\141\x6e\x73\x66\x65\x72\x5f\162\145\x71\x75\145\163\x74"); return $query->result_array(); } public function refer_history() { $query = $this->db->order_by("\x63\162\x65\141\x74\145\x64\137\x61\164", "\104\105\x53\103")->get("\162\145\146\145\162\x5f\x68\151\163\x74\x6f\x72\x79"); return $query->result_array(); } public function withdraw_point_req2($id) { $query = $this->db->get_where("\x74\x62\154\x52\145\161\165\x65\163\164", array("\162\x65\161\165\x65\x73\164\x5f\x73\x74\x61\164\x75\163" => "\x70\145\x6e\144\151\156\147", "\x72\145\161\x75\145\x73\164\137\151\x64" => $id)); $aa = $query->row_array(); $amt = 0; if (isset($aa)) { $amt = -$aa["\x72\145\x71\165\145\163\164\137\x70\x6f\x69\156\x74\x73"]; } if ($this->ch_amt($amt, $aa["\165\163\x65\162\137\151\144"]) >= 0) { $query2 = $this->db->update("\164\x62\154\122\145\x71\x75\145\x73\164", array("\162\145\161\x75\x65\x73\x74\x5f\163\x74\x61\164\x75\163" => "\141\160\160\x72\157\x76\145\144"), array("\x72\x65\x71\165\x65\163\x74\137\x69\144" => $id)); } return $aa; } public function withdraw_point_req3($id, $points) { if ($this->ch_amt($points, $id) >= 0) { $query = $this->db->query("\11\125\120\104\x41\124\105\40\x74\142\154\x77\141\154\154\x65\x74\x20\163\x65\x74\40\167\x61\154\154\145\164\137\x70\157\x69\x6e\x74\x73\75\x77\x61\x6c\154\x65\x74\137\160\157\151\156\x74\x73\x2d\47{$points}\47\x20\167\x68\x65\162\145\40\x75\163\x65\x72\137\x69\144\x3d\47{$id}\47\x20"); } if ($query) { return true; } } public function starline() { $query = $this->db->query("\11\123\x45\114\x45\103\124\40\x2a\x20\x46\x52\117\115\x20\x60\x74\142\154\123\164\141\162\x6c\x69\x6e\145\x60"); return $query->result_array(); } public function starline_update($id) { $query = $this->db->query("\11\123\105\114\x45\103\x54\40\x2a\x20\106\x52\117\x4d\40\140\164\142\x6c\x53\164\141\x72\154\x69\156\145\x60\40\x77\x68\x65\162\x65\x20\x69\144\75\47{$id}\47\x20"); return $query->result_array(); } public function starline_update2($id) { $snum = trim($this->input->post("\163\x6e\x75\155")); $stime = trim($this->input->post("\x73\164\x69\155\145")); $snums = explode("\x2d", $snum); $data = array("\163\137\x67\141\x6d\x65\x5f\156\x75\x6d\x62\145\x72" => $snum, "\163\x5f\147\141\x6d\145\x5f\164\151\155\x65" => $stime); $query = $this->db->update("\x74\x62\x6c\123\x74\141\162\154\x69\x6e\x65", $data, array("\x69\x64" => $id)); $this->update_chart($id, "\112\x61\x6e\156\x61\164\x20\123\x74\x61\x72\154\151\156\145", $snums[0], $snums[1]); if ($query) { return true; } } public function update_user_data($post_image) { $data = array("\x6e\141\x6d\145" => $this->input->post("\x6e\x61\x6d\145"), "\x7a\x69\160\x63\x6f\x64\x65" => $this->input->post("\x7a\x69\x70\x63\x6f\144\145"), "\x63\157\x6e\164\141\x63\x74" => $this->input->post("\143\x6f\x6e\x74\x61\x63\x74"), "\x61\x64\144\x72\145\x73\163" => $this->input->post("\141\x64\x64\162\145\163\x73"), "\x67\x65\156\x64\145\162" => $this->input->post("\147\145\156\x64\x65\x72"), "\163\x74\x61\164\x75\x73" => $this->input->post("\163\164\x61\x74\x75\163"), "\144\157\142" => $this->input->post("\144\x6f\x62"), "\x69\155\x61\147\145" => $post_image, "\x72\145\x67\x69\163\164\x65\162\137\x64\141\164\145" => date("\131\55\x6d\x2d\x64\40\110\72\151\x3a\163")); $this->db->where("\x69\144", $this->input->post("\x69\x64")); $d = $this->db->update("\x75\163\145\162\163", $data); } public function get_siteconfiguration($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("\x73\x69\x74\145\137\x63\x6f\156\146\x69\147"); return $query->result_array(); } $query = $this->db->get_where("\163\x69\x74\145\137\x63\x6f\156\x66\x69\147", array("\x69\x64" => $id)); return $query->row_array(); } public function update_siteconfiguration($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("\x73\151\164\x65\137\x63\157\156\x66\151\147"); return $query->result_array(); } $query = $this->db->get_where("\x73\x69\x74\145\137\143\x6f\156\146\151\x67", array("\151\x64" => $id)); return $query->row_array(); } public function update_siteconfiguration_data($post_image) { $data = array("\x73\x69\164\x65\x5f\164\151\x74\x6c\145" => $this->input->post("\163\x69\x74\x65\x5f\164\151\164\154\145"), "\x73\x69\x74\145\x5f\x6e\141\x6d\145" => $this->input->post("\x73\151\x74\x65\137\156\141\155\x65"), "\x6c\x6f\147\157\x5f\x69\155\147" => $post_image); $this->db->where("\151\144", $this->input->post("\151\144")); return $this->db->update("\163\151\164\145\137\143\157\156\146\151\147", $data); } public function get_mobile_data() { $query = $this->db->get("\163\x69\x74\x65\x5f\143\x6f\x6e\x66\151\x67"); return $query->row_array(); } public function update_mobile_data() { $data = array("\x6d\x6f\142\x69\x6c\145" => $this->input->post("\x6d\x6f\x62\151\154\x65")); return $this->db->update("\163\x69\164\145\137\x63\157\x6e\x66\x69\x67", $data); } public function create_slider($post_image) { $data = array("\x74\x69\164\x6c\145" => $this->input->post("\x74\x69\x74\x6c\145"), "\151\x6d\x61\x67\x65" => $post_image, "\x64\145\x73\143\162\151\160\x74\x69\x6f\156" => $this->input->post("\x64\145\x73\x63\162\x69\x70\164\x69\157\x6e"), "\163\164\141\164\165\163" => $this->input->post("\163\x74\141\x74\165\x73")); return $this->db->insert("\163\x6c\x69\x64\x65\x72\163\137\x69\x6d\147", $data); } public function get_sliders($id = false) { if ($id === FALSE) { $query = $this->db->get("\x73\154\151\144\145\x72\x73\x5f\151\x6d\147"); return $query->result_array(); } $query = $this->db->get_where("\x73\154\151\x64\x65\162\x73\137\x69\x6d\147", array("\x69\x64" => $id)); return $query->row_array(); } public function get_slider_data($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("\x73\154\151\x64\x65\x72\x73\137\x69\x6d\x67"); return $query->result_array(); } $query = $this->db->get_where("\163\154\151\x64\x65\162\163\x5f\x69\155\x67", array("\x69\x64" => $id)); return $query->row_array(); } public function update_slider_data($post_image) { $data = array("\164\151\x74\154\x65" => $this->input->post("\164\151\164\x6c\x65"), "\x69\155\141\147\145" => $post_image, "\144\145\163\143\162\151\x70\x74\x69\x6f\156" => $this->input->post("\144\x65\x73\143\x72\x69\160\164\151\157\x6e"), "\x73\x74\x61\x74\x75\163" => $this->input->post("\163\x74\141\x74\165\x73")); $this->db->where("\151\144", $this->input->post("\x69\144")); return $this->db->update("\163\154\x69\x64\x65\x72\x73\x5f\x69\x6d\147", $data); } public function getChart() { return $this->db->get("\143\x68\x61\162\x74\x73")->result_array(); } public function getChartDetails($name) { return $this->db->where("\156\141\155\145", $name)->get("\143\150\x61\x72\164\x73")->result_array(); } public function update_chart_data() { $snum = $this->input->post("\163\156\x75\x6d"); $enum = $this->input->post("\x65\156\165\x6d"); $data = array("\156\141\x6d\x65" => $this->input->post("\x6e\x61\x6d\145"), "\x64\x61\x74\x65" => $this->input->post("\144\141\x74\145"), "\x73\164\x61\x72\164\x69\156\x67\137\x6e\165\x6d" => !empty($snum) ? $snum : NULL, "\x72\x65\163\x75\154\x74\x5f\156\x75\x6d" => $this->input->post("\x6e\165\155"), "\x65\156\144\137\x6e\165\x6d" => !empty($enum) ? $enum : NULL); $this->db->where("\156\x61\x6d\x65", $this->input->post("\x6e\141\155\145") and "\144\x61\x74\x65", $this->input->post("\x64\141\164\x65")); return $this->db->update("\143\x68\x61\162\x74\163", $data); } public function add_chart_data() { $snum = $this->input->post("\x73\x6e\165\x6d"); $enum = $this->input->post("\145\x6e\x75\155"); $data = array("\156\141\x6d\x65" => $this->input->post("\143\150\141\x72\164"), "\144\141\x74\x65" => $this->input->post("\144\141\x74\145"), "\x73\x74\x61\162\164\x69\156\x67\137\156\x75\155" => !empty($snum) ? $snum : NULL, "\162\x65\163\x75\x6c\164\137\x6e\x75\x6d" => $this->input->post("\x6e\x75\x6d"), "\x65\x6e\144\137\x6e\165\155" => !empty($enum) ? $enum : NULL); return $this->db->insert("\143\x68\141\162\164\163", $data); } public function getUserDetails() { return $this->db->get("\165\163\x65\162\163")->result_array(); } public function getMatkaDetails() { return $this->db->get("\x6d\141\x74\153\141")->result_array(); } public function get_total_users() { return $this->db->where("\x69\163\137\144\145\x6c\x65\164\145\144", 0)->get("\165\163\145\162\137\x70\x72\x6f\x66\151\x6c\145")->result_array(); } public function create_matka($team_image) { $snum = $this->input->post("\x73\156\165\x6d"); $enum = $this->input->post("\145\x6e\165\155"); $name = $this->input->post("\156\141\155\145"); $query = $this->db->get_where("\x6d\141\x74\153\x61", array("\x6e\x61\x6d\145" => $name)); $count = $query->num_rows(); if ($count === 0) { $data = array("\156\x61\x6d\145" => $this->input->post("\x6e\x61\x6d\145"), "\x73\164\x61\162\164\137\x74\x69\155\145" => $this->input->post("\163\164\151\x6d\x65"), "\145\156\x64\137\x74\x69\x6d\x65" => $this->input->post("\145\x74\x69\155\145"), "\163\x74\141\x72\164\151\x6e\147\137\156\x75\155" => !empty($snum) ? $snum : NULL, "\x6e\x75\x6d\x62\x65\x72" => $this->input->post("\x6e\x75\155"), "\145\x6e\x64\137\x6e\165\155" => !empty($enum) ? $enum : NULL, "\142\x69\144\x5f\x73\x74\x61\x72\164\137\x74\151\155\145" => $this->input->post("\x66\x73\x74\x69\x6d\x65"), "\142\151\144\x5f\x65\x6e\x64\137\164\x69\155\x65" => $this->input->post("\146\145\x74\151\155\x65")); $data1 = array("\x6e\x61\x6d\145" => $this->input->post("\x6e\141\155\x65"), "\144\x61\164\145" => date("\131\x2d\155\55\x64"), "\163\164\141\162\164\x69\156\x67\137\156\x75\x6d" => $this->input->post("\163\x6e\x75\x6d"), "\162\x65\163\x75\x6c\x74\x5f\156\x75\x6d" => $this->input->post("\x6e\x75\155"), "\x65\x6e\144\137\x6e\165\155" => $this->input->post("\145\x6e\165\x6d")); $this->session->set_flashdata("\x73\x75\x63\x63\145\163\163", "\x59\157\165\x72\40\155\x61\x74\x6b\x61\40\x68\x61\163\40\142\145\145\x6e\40\143\x72\145\141\164\x65\144\56"); $this->db->insert("\x6d\x61\x74\x6b\x61", $data); $this->db->insert("\x63\150\141\x72\x74\163", $data1); $ref = "\154\x69\x73\164"; } else { $ref = "\141\x64\x64"; $this->session->set_flashdata("\146\x61\151\154", "\x4e\141\x6d\145\40\141\x6c\162\x65\141\144\x79\40\105\x78\x69\x73\164\x20\x2e"); } return $ref; } public function listmatka($teamId = FALSE, $limit = FALSE, $offset = FALSE) { if ($limit) { $this->db->limit($limit, $offset); } if ($teamId === FALSE) { $this->db->select("\52\54\x49\x46\x28\151\163\137\150\x6f\x6d\145\x70\x61\x67\145\137\x67\x61\155\x65\40\75\x20\61\54\x20\x43\117\x4e\103\101\x54\50\163\164\x61\x72\164\151\x6e\x67\137\156\165\155\54\x20\x27\40\130\x20\47\54\x20\x65\x6e\x64\x5f\x6e\165\155\x29\54\156\x75\x6d\142\145\162\51\x20\x41\123\40\x72\145\x73\x75\x6c\164"); $this->db->order_by("\155\x61\x74\153\141\56\151\144", "\104\105\x53\103"); $query = $this->db->get("\155\141\x74\153\141"); return $query->result_array(); } $this->db->select("\155\141\164\153\x61\x2e\x2a\54\164\x62\154\116\157\x74\151\x63\x65\56\x72\141\x74\145\40\141\x73\x20\155\x61\162\153\145\164\137\162\141\164\x65"); $this->db->where("\155\x61\164\153\141\56\151\x64", $teamId)->from("\x6d\141\x74\x6b\x61"); $this->db->join("\164\x62\154\x4e\157\x74\x69\x63\145", "\x74\142\x6c\116\157\x74\x69\x63\x65\56\151\x64\40\75\40\155\x61\164\153\x61\x2e\x69\x64", "\x6c\x65\146\x74"); return $query = $this->db->get()->row_array(); } public function memberlistteams($id) { $this->db->order_by("\x6d\141\164\x6b\x61\x2e\x69\x64", "\104\105\x53\103"); return $query->result_array(); } public function update_team_data() { $c = 0; $snum = $this->input->post("\163\156\x75\155"); $enum = $this->input->post("\x65\x6e\165\x6d"); $num = $this->input->post("\156\165\x6d"); $id = $this->input->post("\x69\x64"); $name = $this->input->post("\156\x61\155\x65"); $date = $this->input->post("\165\144\141\x74\145"); $market_rate = $this->input->post("\155\141\x72\153\x65\x74\x5f\x72\x61\x74\x65") ?? 0; if (isset($market_rate) && $market_rate > 0) { $this->db->where("\151\x64", $id)->update("\x74\142\x6c\x4e\157\164\151\x63\x65", array("\x72\141\x74\145" => $market_rate)); } $data = array("\x6e\141\x6d\145" => $name, "\x73\x74\141\162\x74\x69\x6e\x67\137\x6e\x75\155" => !empty($snum) ? $snum : NULL, "\156\165\155\x62\x65\162" => $this->input->post("\x6e\x75\x6d"), "\145\156\x64\x5f\156\165\155" => !empty($enum) ? $enum : NULL, "\142\x69\144\x5f\163\164\141\162\164\x5f\164\151\155\145" => $this->input->post("\x66\x73\x74\151\x6d\x65"), "\142\x69\144\137\145\x6e\144\x5f\x74\x69\155\145" => $this->input->post("\146\x65\164\151\x6d\145"), "\x73\x74\x61\162\164\x5f\164\x69\155\145" => $this->input->post("\146\x73\x74\151\155\145"), "\x65\x6e\x64\137\164\x69\x6d\x65" => $this->input->post("\146\x65\x74\x69\155\x65"), "\163\x61\164\137\x73\164\x61\x72\164\137\164\151\x6d\x65" => $this->input->post("\x66\x73\x74\x69\x6d\145"), "\x73\141\164\x5f\x65\x6e\x64\137\x74\x69\155\145" => $this->input->post("\146\x65\164\151\x6d\x65")); $this->db->where("\151\x64", $id); $this->db->update("\155\x61\164\x6b\141", $data); return $this->update_chart($id, $name, $snum, $num, $enum, $date); } public function update_chart($id, $name, $snum = null, $num, $enum = null, $date = null) { $dt = $date == null ? date("\131\x2d\155\x2d\144") : $date; $data1 = array("\x6e\141\155\145" => $name, "\x63\x69\x64" => $id, "\x64\141\x74\145" => $dt, "\x73\x74\x61\x72\164\151\156\x67\x5f\156\x75\x6d" => !empty($snum) ? $snum : NULL, "\162\145\163\x75\x6c\164\x5f\x6e\165\155" => $num, "\x65\x6e\144\137\x6e\x75\155" => !empty($enum) ? $enum : NULL); $where = array("\x63\151\x64" => $id, "\144\x61\x74\x65" => $dt); $data2 = $this->db->select("\103\x4f\x55\x4e\x54\50\x69\144\51\40\x61\x73\x20\x63\x6f\165\156\164\145\162")->where($where)->get("\x63\150\141\x72\x74\x73")->row(); if ($data2->counter > 0) { $this->db->where($where); $this->db->update("\x63\150\141\x72\164\x73", $data1); } else { $this->db->insert("\x63\x68\x61\x72\164\163", $data1); } return true; } public function get_admin_data() { $id = $this->session->userdata("\165\x73\145\162\x5f\151\x64"); if ($id === FALSE) { $query = $this->db->get("\165\x73\x65\162\x73"); return $query->result_array(); } $query = $this->db->get_where("\x75\x73\x65\x72\x73", array("\x69\x64" => $id)); return $query->row_array(); } public function change_password($new_password) { $data = array("\160\141\x73\x73\167\157\x72\x64" => md5($new_password)); $this->db->where("\151\144", $this->session->userdata("\x75\x73\x65\x72\x5f\151\144")); return $this->db->update("\x75\x73\x65\x72\x73", $data); } public function match_old_password($password) { $id = $this->session->userdata("\x75\163\145\x72\137\151\144"); if ($id === FALSE) { $query = $this->db->get("\165\163\x65\x72\163"); return $query->result_array(); } $query = $this->db->get_where("\165\163\x65\162\x73", array("\x70\x61\x73\163\x77\157\x72\144" => $password)); return $query->row_array(); } public function email_exists() { $email = $this->input->post("\x65\155\x61\151\154"); $query = $this->db->query("\x53\105\x4c\105\103\x54\x20\x65\x6d\x61\151\x6c\54\x20\160\141\x73\163\167\157\162\x64\40\106\x52\117\x4d\40\165\163\x65\162\x73\40\x57\x48\x45\122\x45\40\x65\x6d\141\x69\x6c\75\x27{$email}\47"); if ($row = $query->row()) { return TRUE; } else { return FALSE; } } public function temp_reset_password($temp_pass) { $data = array("\145\155\141\x69\154" => $this->input->post("\x65\155\141\151\154"), "\162\145\163\145\x74\x5f\160\141\x73\163" => $temp_pass); $email = $data["\145\x6d\x61\151\x6c"]; if ($data) { $this->db->where("\x65\155\141\x69\x6c", $email); $this->db->update("\165\x73\145\x72\x73", $data); return TRUE; } else { return FALSE; } } public function is_temp_pass_valid($temp_pass) { $this->db->where("\162\x65\x73\145\164\137\x70\x61\x73\x73", $temp_pass); $query = $this->db->get("\x75\163\x65\x72\x73"); if ($query->num_rows() == 1) { return TRUE; } else { return FALSE; } } public function deletepackage($id) { $data = array("\x73\x74\141\164\x75\x73" => 2); $this->db->where("\x69\144", $id); return $this->db->update("\160\x61\x63\153\141\x67\x65", $data); } public function add_wallet_4($id, $wa, $wallet = '') { if ($wallet != '') { if ($wallet == "\167\x61\154\154\x65\164\x5f\160\x6f\151\156\164\163") { $query = $this->db->query("\125\160\x64\141\164\x65\x20\x74\x62\154\x77\x61\x6c\154\145\x74\40\x73\x65\164\40\x77\141\154\x6c\145\164\x5f\160\157\x69\x6e\164\x73\75\x77\x61\x6c\x6c\x65\164\137\160\157\151\x6e\164\163\53\47{$wa}\47\40\x77\150\x65\162\145\40\165\x73\x65\x72\x5f\151\x64\75\x27{$id}\47"); } else { $query = $this->db->query("\125\x70\x64\141\x74\x65\40\x74\142\154\167\141\154\154\145\164\40\163\x65\x74\x20\x6d\x61\151\156\137\x77\141\154\x6c\145\x74\137\x70\157\151\156\x74\163\x3d\155\141\x69\156\x5f\x77\141\x6c\x6c\145\164\137\160\x6f\151\x6e\x74\163\53\x27{$wa}\x27\x20\167\x68\145\x72\145\x20\x75\163\145\162\137\x69\144\75\47{$id}\x27"); } } else { $query = $this->db->query("\125\x70\144\141\164\145\x20\164\x62\x6c\167\141\x6c\154\x65\x74\x20\163\145\x74\40\155\141\151\x6e\137\167\141\154\154\145\164\x5f\160\x6f\151\x6e\x74\x73\x3d\155\141\151\156\x5f\x77\141\154\x6c\x65\x74\137\160\157\x69\156\164\163\53\x27{$wa}\x27\40\x77\150\145\162\145\40\165\163\145\162\x5f\x69\x64\75\x27{$id}\47"); } if ($query) { return true; } } } ?>
Function Calls
None |
Stats
MD5 | 5b6485fb050df5efd8c6c6d78a923da1 |
Eval Count | 0 |
Decode Time | 107 ms |