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(array("matka_id" => 121, "matka_id" => 122)); } else { $this->db->where(array("matka_id !=" => 121, "matka_id !=" => 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 
\x9\x9    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,
\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("\x9SELECT * 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\155\141\151\x6c", $email); $this->db->where("\x70\141\x73\163\167\157\x72\x64", $encrypt_password); $result = $this->db->get("\165\x73\x65\162\x73"); if ($result->num_rows() == 1) { return $result->row(0); } else { return false; } } public function app_setting() { $query = $this->db->get("\141\x70\160\137\x73\145\164\164\x69\156\x67"); $app_data = $query->row(); return $app_data; } public function withdrawal_slot() { $query = $this->db->get("\164\x69\155\x65\x73\x6c\x6f\164\163"); $app_data = $query->row(); return $app_data; } public function stastics($type = '') { if ($type == '') { $stats = 0; } if ($type == "\x61\x64\x64\137\x70\x6f\151\156\x74") { $stats = $this->db->select("\x53\125\x4d\50\x72\x65\x71\165\145\x73\164\x5f\160\x6f\x69\x6e\x74\x73\51\x20\141\x73\40\x70\x6f\x69\x6e\x74\163")->where(array("\x74\x79\160\x65" => "\101\x64\x64", "\x72\x65\x71\165\145\163\164\137\163\164\141\x74\x75\x73" => "\141\x70\x70\162\x6f\166\145\144"))->get("\x74\x62\x6c\x52\145\161\x75\145\163\x74")->row()->points; } if ($type == "\x77\151\x74\x68\144\162\141\x77\x6c\x5f\x70\x6f\151\156\164") { $stats = $this->db->select("\x53\125\x4d\x28\x72\x65\161\165\x65\x73\x74\137\x70\157\x69\x6e\x74\163\51\x20\x61\163\40\160\157\151\x6e\164\x73")->where(array("\x74\x79\160\145" => "\127\151\164\x68\144\162\x61\x77\141\x6c", "\162\145\x71\165\145\x73\x74\137\163\164\141\x74\x75\163" => "\x61\160\x70\162\157\x76\x65\144"))->get("\164\142\154\x52\x65\161\x75\145\x73\164")->row()->points * -1; } if ($stats == '') { $stats = 0; } return $stats; } public function games() { return $this->db->order_by("\147\141\155\145\x5f\x69\x64", DESC)->get("\164\142\154\x67\x61\x6d\x65")->result(); } public function gamedata($from = '', $to = '', $type = '') { if ($from == '') { $from = date("\x64\x2f\155\x2f\x59"); } else { $fr = explode("\x2d", $from); $from = $fr[2] . "\57" . $fr[1] . "\x2f" . $fr[0]; } if ($to == '') { $to = date("\144\57\x6d\57\x59"); } else { $t = explode("\55", $to); $to = $t[2] . "\x2f" . $t[1] . "\x2f" . $t[0]; } $this->db->order_by("\151\x64", "\104\105\x53\103"); $this->db->where("\144\x61\x74\x65\40\x3e\x3d", $from); $this->db->where("\144\x61\164\x65\40\x3c\x3d", $to); if ($type == "\151\163\x5f\146\143\x5f\x67\141\155\x65") { $this->db->where(array("\x6d\x61\x74\x6b\141\137\151\144" => 121, "\x6d\x61\x74\x6b\x61\x5f\151\144" => 122)); } else { $this->db->where(array("\x6d\x61\164\x6b\x61\x5f\151\x64\x20\41\75" => 121, "\x6d\x61\164\153\141\137\151\144\x20\x21\75" => 122)); } return $this->db->get("\164\x62\x6c\147\x61\155\x65\144\141\164\x61")->result(); } public function gamebyid($id) { $this->db->where("\151\144", $id); return $this->db->get("\147\141\x6d\x65\163")->row(); } public function userbyid($id) { $this->db->where("\151\144", $id); return $this->db->get("\x75\x73\145\162\137\x70\162\157\146\x69\154\x65")->row(); } public function matkabyid($id) { $this->db->where("\x69\144", $id); return $this->db->get("\x6d\141\164\153\x61")->row(); } public function update_appsetting() { $app = array("\x6d\145\163\163\141\x67\x65" => $this->input->post("\155\x65\x73\x73\x61\x67\x65"), "\150\x6f\155\x65\x5f\164\x65\x78\x74" => $this->input->post("\150\157\155\145\164\145\170\164"), "\167\x69\164\x68\144\x72\141\x77\x5f\x74\145\170\164" => $this->input->post("\167\x69\x74\x68\x64\x72\141\167\164\145\x78\164"), "\167\x69\x74\x68\144\162\141\x77\x5f\x6e\157" => $this->input->post("\x77\151\x74\x68\x64\162\x61\x77\x6e\165\155\142\x65\x72"), "\x77\x68\141\164\163\141\x70\x70\x5f\x6e\x6f" => $this->input->post("\167\x68\x61\x74\163\x61\160\x70\137\x6e\x6f"), "\x75\x70\151" => $this->input->post("\165\160\151"), "\x75\x70\x69\x5f\156\141\155\x65" => $this->input->post("\x75\160\151\137\156\x61\155\145"), "\x6d\151\156\x5f\x61\155\x6f\x75\x6e\x74" => $this->input->post("\x6d\x69\x6e\137\141\155\157\x75\156\x74"), "\167\x5f\x61\x6d\157\x75\156\164" => $this->input->post("\167\137\x61\x6d\x6f\x75\x6e\x74"), "\150\x6f\167\137\x74\157\x5f\x70\x6c\x61\171" => $this->input->post("\150\157\x77\137\x74\157\137\160\x6c\141\x79"), "\141\144\144\137\x70\x6f\151\x6e\164\x5f\x74\145\x78\164" => $this->input->post("\x61\144\x64\x5f\x70\x6f\x69\x6e\x74\137\164\145\x78\164"), "\x61\x64\144\137\x74\162\141\156\163\x66\145\162\x5f\x74\x65\x78\164" => $this->input->post("\x61\x64\144\x5f\164\x72\x61\x6e\163\146\x65\162\137\164\145\x78\x74"), "\167\x69\x74\x68\x64\x72\x61\x77\137\156\157\164\x65" => $this->input->post("\167\151\x74\x68\x64\x72\x61\167\137\x6e\x6f\164\x65"), "\x72\x65\x66\145\x72\137\x61\155\157\x75\x6e\x74" => $this->input->post("\x72\145\x66\x65\162\x5f\x61\x6d\157\165\x6e\x74"), "\x75\160\151\x5f\x64\145\x73\143" => $this->input->post("\165\x70\151\137\144\x65\x73\143"), "\x74\x65\x6c\145\147\162\x61\155\137\x69\144" => $this->input->post("\164\x65\x6c\145\147\162\x61\155\x5f\x69\x64"), "\164\x72\141\156\x73\146\145\162\137\x66\x65\x65" => $this->input->post("\x74\x72\x61\156\163\x66\x65\162\137\x66\x65\x65"), "\167\141\x6c\154\145\x74\x5f\x74\x6f\137\167\x61\154\154\145\x74\x5f\164\162\141\156\x73\146\145\x72\137\x66\x65\x65" => $this->input->post("\167\141\154\154\x65\164\x5f\164\x6f\137\x77\141\x6c\154\145\164\x5f\164\162\x61\156\163\x66\145\162\137\146\145\x65")); $timeslot = array("\163\164\x61\162\164\x5f\x74\x69\x6d\x65" => $this->input->post("\x73\164\141\162\x74\137\x74\x69\x6d\x65"), "\x65\x6e\x64\137\164\x69\x6d\x65" => $this->input->post("\145\x6e\x64\137\164\x69\155\145")); $this->db->where("\151\x64", 1)->update("\x74\151\155\145\163\x6c\157\x74\x73", $timeslot); $this->db->where("\x69\144", 1); return $this->db->update("\x61\x70\160\137\x73\145\164\x74\x69\x6e\147", $app); } public function get_posts($slug = FALSE) { if ($slug === FALSE) { $query = $this->db->order_by("\151\144", "\x44\105\x53\x43"); $query = $this->db->get("\x70\157\x73\164\163"); return $query->result_array(); } $query = $this->db->get_where("\x70\x6f\x73\164\x73", array("\163\154\x75\147" => $slug)); return $query->row_array(); } public function deletegamedata($id) { $this->db->where("\x69\x64", $id); return $this->db->delete("\164\x62\x6c\x67\141\x6d\145\x64\141\x74\x61"); } public function del_request($id) { $this->db->where("\x72\x65\161\165\x65\x73\x74\137\x69\144", $id); return $this->db->delete("\x74\142\x6c\122\145\x71\x75\x65\163\164"); } public function create_post() { $slug = url_title($this->input->post("\164\x69\x74\x6c\x65"), "\144\x61\163\150", TRUE); $data = array("\164\x69\164\x6c\145" => $this->input->post("\x74\151\164\154\145"), "\163\x6c\165\x67" => $slug, "\x62\157\144\x79" => $this->input->post("\x62\x6f\144\171"), "\x63\x61\164\145\x67\x6f\x72\171\x5f\x69\x64" => $this->input->post("\143\x61\164\x65\x67\x6f\x72\171\x5f\151\144")); return $this->db->insert("\160\x6f\163\x74\163", $data); } public function delete($id, $table) { $this->db->where("\151\x64", $id); $this->db->delete($table); return true; } public function get_categories() { $this->db->order_by("\x69\x64", "\104\105\x53\x43"); $query = $this->db->get("\143\x61\x74\x65\x67\157\x72\x69\145\x73"); return $query->result_array(); } public function add_user($post_image, $password) { $data = array("\x6e\x61\x6d\145" => $this->input->post("\156\x61\155\145"), "\x65\155\x61\x69\154" => $this->input->post("\145\155\141\x69\x6c"), "\x70\141\163\x73\x77\x6f\162\x64" => $password, "\x75\x73\x65\x72\x6e\x61\x6d\x65" => $this->input->post("\x75\163\x65\x72\x6e\x61\x6d\145"), "\x7a\151\x70\143\157\144\145" => $this->input->post("\172\x69\x70\x63\x6f\144\145"), "\143\157\x6e\x74\x61\143\x74" => $this->input->post("\143\x6f\156\x74\141\143\x74"), "\x61\144\144\162\145\x73\x73" => $this->input->post("\141\x64\x64\162\145\x73\163"), "\x67\x65\x6e\144\x65\x72" => $this->input->post("\147\x65\x6e\x64\x65\162"), "\162\157\x6c\145\x5f\x69\144" => "\x32", "\x73\164\x61\x74\165\163" => $this->input->post("\163\x74\x61\164\165\x73"), "\x64\157\x62" => $this->input->post("\144\157\x62"), "\151\x6d\141\x67\x65" => $post_image, "\160\x61\x73\163\167\x6f\x72\x64" => $password, "\x72\x65\147\151\163\164\145\162\137\x64\141\x74\145" => date("\131\x2d\155\55\144\40\110\72\x69\72\x73")); return $this->db->insert("\165\163\x65\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("\x75\163\145\162\x73\56\x69\x64", "\104\105\123\x43"); $query = $this->db->get("\165\163\x65\x72\x73"); return $query->result_array(); } $query = $this->db->get_where("\x75\163\x65\162\163", array("\x75\x73\145\x72\x6e\x61\155\145" => $username)); return $query->row_array(); } public function enable($id, $table) { $data = array("\x73\x74\x61\164\x75\163" => 0); $this->db->where("\x69\x64", $id); return $this->db->update($table, $data); } public function disable($id, $table) { $data = array("\x73\x74\x61\x74\x75\x73" => 1); $this->db->where("\151\144", $id); return $this->db->update($table, $data); } public function get_user($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("\x75\x73\145\162\163"); return $query->result_array(); } $query = $this->db->get_where("\165\x73\x65\162\x73", array("\x69\x64" => $id)); return $query->row_array(); } public function get_user_profile() { $query = $this->db->join("\164\x62\154\167\141\154\154\145\164", "\165\163\x65\x72\x5f\x70\x72\x6f\x66\x69\154\x65\x2e\151\x64\75\x74\142\154\167\141\154\154\145\x74\56\x75\163\x65\162\137\x69\x64")->where("\151\x73\x5f\144\145\x6c\x65\164\x65\144", 0)->order_by("\164\142\154\x77\x61\154\154\145\164\x2e\165\x73\145\162\x5f\x69\x64", DESC)->get("\165\163\x65\162\137\160\162\x6f\146\x69\x6c\x65"); return $query->result_array(); } public function deleteuser($id) { $data = array("\x69\x73\x5f\144\x65\154\145\164\x65\144" => 1, "\x6d\x6f\142\151\154\x65\156\x6f" => "\x30"); $this->db->where("\151\x64", $id); return $this->db->set("\144\x65\x6c\x65\x74\145\x64\x5f\155\x6f\142\x69\x6c\145\156\x6f", "\x6d\x6f\x62\151\154\145\156\157", false)->update("\165\163\x65\162\x5f\x70\x72\x6f\146\151\154\145", $data); } public function change_status($id, $set_status = 0) { $data = array("\x6c\x6f\147\151\156\137\163\x74\x61\x74\x75\x73" => $set_status); $this->db->where("\x69\144", $id); return $this->db->update("\165\163\145\162\x5f\160\x72\157\146\151\x6c\145", $data); } public function getGameName($id) { $q = "\x53\x45\x4c\x45\103\x54\x20\156\x61\x6d\145\x20\x46\x52\117\115\x20\164\x62\x6c\x67\141\155\145\40\x57\110\x45\x52\105\40\147\x61\155\145\x5f\151\144\x3d\x27{$id}\x27"; $query = $this->db->query($q)->row_array(); return $query["\156\x61\155\145"]; } public function get_games($mid) { $q = "\x53\x45\x4c\105\103\124\40\164\142\154\x67\141\x6d\x65\x64\141\164\141\56\147\x61\155\x65\137\x69\144\x2c\156\141\x6d\x65\40\106\x52\117\115\x20\164\x62\154\x67\141\x6d\145\144\141\x74\141\40\114\x45\x46\x54\x20\112\117\111\x4e\x20\164\142\x6c\147\141\x6d\145\40\117\116\40\x74\x62\x6c\x67\x61\155\145\x64\x61\164\141\x2e\147\x61\155\x65\x5f\151\144\x3d\x74\x62\x6c\147\141\x6d\145\x2e\x67\141\x6d\x65\x5f\x69\x64\40\12\x9\x9\40\x20\40\x20\x57\x48\x45\x52\x45\40\x74\142\x6c\147\141\x6d\x65\144\x61\x74\141\56\x6d\141\x74\153\x61\137\x69\144\x3d\47{$mid}\x27\x20\x47\122\x4f\125\x50\40\x42\x59\40\x67\x61\x6d\145\137\x69\x64"; $query = $this->db->query($q); return $query->result_array(); } public function get_point_lists($mid, $from = '', $to = '') { $limit = 0; $d = date("\131\x2d\x6d\x2d\144"); if ($from == '') { $from = date("\131\x2d\155\x2d\144"); } else { $fr = explode("\x2d", $from); $from = date("\x59\55\155\x2d\x64", strtotime($from)); } if ($to == '') { $to = date("\x59\x2d\155\x2d\144"); } else { $to = date("\131\x2d\155\x2d\x64", strtotime($to)); } $this->db->select("\x74\x62\154\x67\141\x6d\x65\x64\141\x74\x61\x2e\147\141\155\x65\137\x69\x64\54\40\x74\x62\154\x67\141\x6d\145\144\x61\164\141\56\x67\141\x6d\145\137\156\x61\x6d\x65\x2c\x74\x62\154\147\141\155\x65\144\141\164\x61\56\144\141\x74\x65\54\x20\x74\142\154\x67\141\x6d\145\x64\141\164\141\x2e\x62\145\x74\137\x74\x79\x70\x65\x2c\x20\164\x62\x6c\147\141\x6d\145\144\141\x74\x61\x2e\x64\151\147\x69\164\x73\x2c\12\x9\11\x20\x20\164\142\x6c\147\x61\155\x65\x64\141\164\141\x2e\x70\x6f\x69\x6e\x74\x73\x2c\40\165\163\145\x72\137\x70\x72\157\146\x69\x6c\x65\56\155\157\142\151\154\145\156\157\54\x20\164\142\154\x67\x61\x6d\145\144\x61\164\141\x2e\142\163\137\147\141\155\x65\137\156\141\155\x65"); $this->db->from("\x74\x62\x6c\147\141\155\145\144\141\164\x61"); $this->db->join("\165\x73\x65\x72\137\160\162\157\x66\x69\x6c\145", "\165\163\x65\162\137\160\162\x6f\146\151\154\145\56\x69\x64\40\75\x20\164\x62\154\x67\x61\x6d\145\x64\141\x74\x61\56\165\x73\145\162\137\151\x64", "\x6c\145\x66\164"); $this->db->join("\x74\142\x6c\x67\141\155\145", "\x74\142\154\147\x61\x6d\145\x2e\x67\x61\x6d\x65\137\x69\144\40\75\40\164\142\x6c\147\x61\155\x65\x64\x61\164\141\56\x67\x61\x6d\x65\137\151\x64", "\x6c\145\x66\164"); $this->db->where("\x74\142\x6c\x67\141\x6d\145\144\x61\x74\141\56\155\141\x74\153\141\x5f\151\x64", $mid); $this->db->where("\x74\142\x6c\x67\x61\x6d\145\x64\x61\164\141\56\x69\144\40\76", $limit); $this->db->where("\104\x41\x54\x45\50\x74\142\x6c\147\x61\x6d\145\x64\x61\x74\x61\x2e\164\151\x6d\145\x29\40\102\x45\124\127\105\x45\116\x20\47{$from}\47\x20\x41\x4e\x44\x20\x27{$to}\47"); $this->db->order_by("\164\x62\x6c\x67\141\x6d\x65\144\141\164\141\56\x64\151\147\x69\164\163", "\141\163\143"); return $query = $this->db->get()->result_array(); $q = "\123\x45\114\x45\x43\x54\x20\x67\141\x6d\x65\137\151\x64\54\144\x61\x74\x65\54\142\x65\x74\137\164\x79\160\x65\54\144\x69\147\x69\164\163\x2c\164\x62\x6c\147\141\x6d\145\x64\x61\164\141\56\160\157\151\156\x74\x73\x2c\165\x73\145\x72\x5f\160\x72\x6f\x66\x69\x6c\145\56\x6d\x6f\142\151\154\x65\156\157\x20\x46\122\x4f\x4d\x20\x74\142\x6c\x67\141\155\x65\x64\x61\x74\x61\x20\114\105\x46\x54\40\112\117\x49\116\x20\x75\x73\x65\162\137\x70\x72\157\x66\151\x6c\x65\40\x4f\x4e\x20\165\x73\x65\x72\137\x70\162\157\x66\151\x6c\x65\x2e\151\144\75\164\x62\154\147\x61\x6d\x65\x64\x61\164\141\x2e\x75\x73\x65\162\137\151\x64\40\127\110\x45\x52\105\40\164\x62\x6c\147\x61\x6d\x65\144\141\164\x61\x2e\155\141\x74\x6b\141\137\151\x64\x3d\47{$mid}\x27\x20\x61\x6e\144\x20\x74\142\154\147\141\155\145\144\141\164\x61\x2e\x69\144\76" . $limit . "\x20\141\156\144\40\x64\141\164\x65\x20\x42\x45\x54\x57\105\x45\x4e\x20\47{$from}\47\x20\101\116\x44\x20\x27{$to}\47\x20\x4f\x52\104\105\122\x20\x42\x59\40\144\x61\x74\145\x20\104\105\x53\x43"; $query = $this->db->query($q); $tbl = $query->result_array(); $t = array(); foreach ($tbl as $tb) { $gid = $tb["\x67\141\155\145\137\x69\x64"]; $bet_type = $tb["\x62\x65\164\x5f\x74\x79\x70\x65"]; $digits = $tb["\x64\x69\x67\x69\164\163"]; $mobileno = $tb["\155\157\142\x69\154\x65\156\157"]; $bs_game_name = $tb["\142\x73\137\147\141\155\145\137\x6e\x61\x6d\145"]; if ($gid == 12 || $gid == 13) { $bet = "\55\55"; $digit = $bet_type . "\x2d" . $digits; } else { $bet = $bet_type; $digit = $digits; } if (!isset($t[$tb["\144\x61\164\145"]][$gid][$bet][$digit])) { $t[$tb["\x64\141\164\145"]][$gid][$bet][$digit][$mobileno] = 0; } $t[$tb["\x64\x61\164\x65"]][$gid][$bet][$digit][$mobileno] += $tb["\x70\x6f\x69\x6e\164\x73"]; } $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 = "\x53\105\114\105\103\x54\x20\104\x49\x53\124\x49\x4e\x43\124\40\x75\x73\145\x72\137\160\162\157\x66\151\154\x65\56\151\x64\x2c\40\x75\x73\x65\x72\x5f\160\x72\x6f\x66\151\x6c\145\56\165\163\x65\162\156\x61\x6d\x65\x20\x46\x52\117\x4d\x20\x74\x62\x6c\147\141\155\x65\144\141\164\141\40\x4c\x45\106\124\x20\x4a\117\111\116\x20\x75\x73\145\x72\137\x70\x72\x6f\146\151\154\145\x20\117\116\40\164\142\x6c\147\x61\155\145\x64\141\164\x61\56\x75\163\x65\162\x5f\151\144\75\x75\163\145\x72\137\160\x72\x6f\146\x69\x6c\145\56\151\x64\x20\127\110\105\122\105\40\x74\142\154\x67\x61\x6d\145\144\x61\164\141\x2e\x67\141\x6d\145\137\x69\x64\75\x27{$id}\x27\x20\141\156\144\x20\x74\x62\x6c\x67\x61\x6d\x65\x64\141\x74\141\56\x6d\x61\x74\153\141\137\x69\144\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("\144\57\155\57\131"); } if ($to == '') { $to = date("\x64\x2f\x6d\57\x59"); } $sel = "\123\105\114\105\x43\124\40\x44\111\x53\124\111\x4e\103\x54\x20\x74\142\x6c\x67\x61\155\x65\x2e\x6e\x61\x6d\145\54\x75\163\145\x72\137\x70\162\157\x66\151\x6c\x65\x2e\x75\x73\145\x72\156\141\x6d\145\x2c\40\x74\142\x6c\x67\x61\155\x65\x64\x61\164\141\x2e\160\x6f\151\156\164\163\x2c\40\164\142\x6c\147\141\155\x65\144\141\x74\x61\x2e\x64\151\147\151\x74\163\54\x20\144\141\164\x65\54\x20\164\x62\154\x67\x61\x6d\145\x64\141\x74\x61\x2e\x74\x69\155\x65\54\x62\145\164\x5f\x74\171\160\145\54\x74\x62\154\x67\141\x6d\145\144\x61\x74\141\56\x75\163\145\162\x5f\x69\144\x2c\40\164\x62\x6c\147\141\x6d\145\x64\x61\x74\x61\x2e\x6d\141\164\153\x61\137\151\x64\x2c\x74\142\x6c\x67\x61\155\145\x64\x61\164\x61\x2e\147\x61\155\x65\x5f\151\144\54\x20\x74\x62\x6c\147\x61\x6d\x65\x64\x61\164\x61\x2e\151\144\x20\x66\x72\x6f\x6d\x20\x74\142\x6c\147\x61\155\145\x2c\x20\165\x73\x65\162\137\160\x72\x6f\x66\x69\154\x65\x2c\164\142\154\147\x61\x6d\145\144\141\164\141\x20\167\150\x65\162\145\x20\164\x62\154\x67\141\155\145\x2e\147\141\x6d\x65\x5f\x69\x64\x3d\x27{$game_id}\x27\40\141\x6e\x64\40\164\x62\x6c\147\141\155\x65\x64\x61\164\x61\56\147\x61\155\x65\x5f\151\x64\75\47{$game_id}\x27\x20\141\x6e\x64\40\165\x73\x65\x72\x5f\x69\x64\75\165\x73\145\x72\x5f\160\x72\157\146\x69\x6c\x65\56\151\144\40\141\156\x64\40\x75\x73\x65\162\137\151\144\75\47{$user_id}\x27\x20\x61\156\x64\x20\x6d\141\x74\153\x61\137\151\x64\x3d\x27{$matka_id}\47\40\141\156\144\x20\x64\x61\164\145\40\x42\x45\124\127\x45\105\116\40\x27{$from}\x27\40\101\x4e\104\40\x27{$to}\47\40\157\162\144\145\162\40\x62\171\40\x74\142\x6c\147\141\x6d\145\144\141\x74\141\x2e\151\x64"; $query = $this->db->query($sel); $aa = $query->result_array(); return $aa ? $aa : false; } public function get_bid_history($user_id) { $dt = date("\x64\x2f\155\57\131"); $sel = "\x53\105\x4c\x45\x43\x54\x20\x74\x62\x6c\x67\141\x6d\x65\x64\141\164\141\x2e\52\54\40\x6d\141\x74\153\x61\56\x6e\x61\x6d\145\x20\x61\x73\x20\155\141\x74\x6b\141\137\156\x61\155\145\x2c\164\142\x6c\147\141\155\x65\56\156\141\x6d\145\40\x61\x73\40\147\141\x6d\x65\137\x6e\141\155\145\40\106\122\x4f\115\40\140\164\x62\154\x67\141\155\145\x64\x61\164\141\x60\x20\x4a\x4f\x49\x4e\40\155\141\164\153\x61\40\117\116\40\164\142\x6c\x67\141\155\x65\144\x61\164\141\x2e\155\141\x74\x6b\141\x5f\151\x64\x3d\155\x61\164\x6b\141\x2e\151\144\40\112\117\111\116\40\164\142\154\147\141\x6d\145\40\117\x4e\40\164\142\x6c\x67\x61\155\x65\x64\x61\164\x61\56\147\141\155\x65\x5f\x69\144\75\x74\x62\154\147\141\155\x65\x2e\147\x61\155\x65\137\151\144\40\x77\150\145\162\145\40\x75\163\x65\162\137\151\144\x3d\47{$user_id}\47\40\x26\46\40\144\x61\x74\145\75\x27{$dt}\x27\40\117\x52\104\x45\122\40\x42\x59\40\164\x62\154\147\x61\x6d\x65\144\141\x74\141\56\x69\144\x20\104\105\123\x43"; $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\x45\x4c\105\x43\x54\40\52\40\106\x52\x4f\x4d\x20\165\x73\x65\x72\137\x70\162\x6f\146\x69\x6c\x65\x20\x77\x68\145\162\145\40\155\x6f\142\151\x6c\x65\x6e\x6f\x3d\47{$no}\47"); return $query->result_array(); } public function add_wallet2($id, $wa) { $query = $this->db->query("\x55\x70\144\141\x74\145\x20\x74\142\154\167\141\154\x6c\145\164\40\163\145\x74\40\x6d\x61\x69\156\x5f\x77\141\154\154\145\x74\137\160\157\x69\x6e\164\x73\75\x6d\x61\151\156\137\x77\141\x6c\x6c\x65\164\137\160\157\x69\x6e\x74\x73\x2b\47{$wa}\x27\x20\167\x68\x65\x72\145\x20\165\163\145\x72\137\x69\144\x3d\47{$id}\x27"); if ($query) { return true; } } public function update_point_to_winning($id, $wa) { $query = $this->db->query("\125\160\144\141\x74\145\40\164\x62\154\167\141\x6c\154\x65\164\40\x73\145\x74\40\x77\x61\154\x6c\145\164\x5f\160\157\x69\x6e\164\163\75\x77\x61\x6c\x6c\145\164\x5f\160\157\151\156\164\163\53\47{$wa}\x27\40\x77\x68\145\162\x65\x20\x75\x73\145\162\137\x69\x64\x3d\47{$id}\x27"); if ($query) { return true; } } public function add_wallet3($id, $wa) { $query = $this->db->query("\111\x6e\x73\145\162\x74\x20\151\x6e\164\157\40\164\142\x6c\x77\141\x6c\x6c\x65\164\50\x6d\x61\151\156\x5f\167\141\x6c\x6c\x65\164\x5f\x70\157\x69\x6e\x74\163\x2c\x75\163\x65\x72\x5f\151\x64\51\x20\166\x61\154\165\145\163\50\x27{$wa}\x27\54\x27{$id}\x27\51"); if ($query) { return true; } } public function add_point_to_winning($id, $wa) { $query = $this->db->query("\x49\156\163\x65\x72\x74\40\x69\156\164\x6f\x20\164\x62\x6c\167\141\154\154\145\164\50\x77\141\154\x6c\145\x74\137\x70\x6f\x69\156\164\163\54\x75\163\145\162\x5f\151\x64\x29\x20\166\141\x6c\165\x65\x73\50\47{$wa}\x27\54\x27{$id}\x27\51"); if ($query) { return true; } } public function check_wallet($id) { $query = $this->db->query("\x73\x65\x6c\x65\143\164\40\x2a\x20\x66\x72\x6f\155\40\164\142\154\x77\141\154\154\145\164\x20\x77\x68\x65\x72\x65\x20\165\x73\x65\x72\x5f\x69\144\75\40\47{$id}\47"); return $query->result_array(); } public function check_wallet_amt($id) { $query = $this->db->query("\x73\x65\154\145\x63\164\40\167\141\x6c\x6c\x65\164\137\x70\157\x69\156\x74\163\40\x61\x73\40\x61\x6d\164\x20\146\x72\x6f\x6d\40\x74\x62\154\167\141\x6c\154\145\x74\x20\x77\150\x65\162\x65\40\x75\x73\145\x72\137\x69\x64\x3d\x20\47{$id}\x27"); return $query->row_array()["\141\155\164"]; } 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("\164\x62\154\x4e\x6f\x74\151\x66\151\x63\x61\164\x69\x6f\x6e", array("\156\x6f\x74\x69\146\151\143\141\x74\x69\x6f\x6e" => $notification)); if ($query) { return true; } return false; } public function add_point_req_by_admin($points, $user_id) { $type = $points > 0 ? "\101\x64\144" : "\127\x69\164\x68\x64\162\x61\x77\x61\x6c"; $insert_query = array("\x72\x65\161\x75\145\163\164\x5f\160\157\151\156\164\x73" => $points, "\x75\163\x65\162\x5f\x69\x64" => $user_id, "\164\171\x70\x65" => $type, "\x72\x65\x71\165\x65\163\164\137\x73\x74\141\x74\x75\x73" => "\x61\x70\x70\x72\157\x76\x65\x64"); $query = $this->db->insert("\164\x62\x6c\x52\x65\161\x75\145\163\x74", $insert_query); return $query; } public function add_point_req() { $query = $this->db->where(array("\164\x79\x70\145" => "\x41\x64\144"))->order_by("\x72\x65\x71\x75\145\163\164\137\x69\144", "\104\105\x53\103")->limit(10000)->get("\x74\142\154\122\145\161\165\x65\x73\164"); return $query->result_array(); } public function delete_point_req($req_id) { $this->db->where("\162\x65\161\165\x65\x73\x74\137\151\x64", $req_id); $this->db->delete("\x74\x62\x6c\x52\145\161\165\145\163\164"); return true; } public function add_point_req2($id) { $query = $this->db->query("\x53\105\114\x45\x43\x54\x20\52\40\x46\122\x4f\x4d\x20\140\x74\142\154\122\145\x71\x75\x65\163\164\x60\40\167\150\145\162\x65\40\x72\145\161\165\x65\163\x74\x5f\x69\144\75\47{$id}\47\x20\141\156\x64\x20\164\171\x70\145\40\75\x20\47\101\144\144\47\40\141\x6e\x64\40\162\145\161\x75\145\163\x74\x5f\163\x74\141\164\165\163\75\47\x70\x65\x6e\x64\x69\x6e\x67\x27"); if ($query->num_rows() == 0) { return redirect("\141\x64\155\x69\x6e\x2f\x61\144\144\137\160\x6f\151\156\164\x5f\162\145\x71"); } else { $query2 = $this->db->query("\x55\120\104\x41\124\x45\x20\x60\164\142\x6c\x52\x65\161\165\x65\163\164\x60\40\163\145\x74\x20\x72\145\161\x75\145\163\x74\137\x73\x74\x61\164\165\x73\75\47\141\x70\160\x72\x6f\x76\145\x64\47\40\167\x68\145\162\x65\40\x72\x65\161\x75\145\163\x74\137\x69\144\75\x27{$id}\47\x20\x61\156\144\40\x72\145\x71\165\145\x73\164\x5f\163\x74\141\164\165\x73\75\47\160\145\156\x64\151\x6e\147\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("\164\171\160\x65" => "\127\151\x74\150\144\x72\x61\x77\141\154"))->order_by("\x72\x65\161\165\x65\163\164\x5f\151\x64", "\x44\x45\x53\x43")->limit(5000)->get("\164\x62\154\x52\x65\161\165\145\x73\x74"); return $query->result_array(); } public function delete_withdraw_point_req($req_id) { $this->db->where("\x72\x65\161\165\145\x73\x74\137\151\x64", $req_id); $this->db->delete("\164\x62\x6c\122\x65\161\x75\145\163\164"); return true; } public function transfer_money_history() { $query = $this->db->order_by("\143\162\x65\141\164\145\137\x61\164", "\x44\x45\x53\103")->get("\x74\142\x6c\x74\162\x61\x6e\x73\146\x65\x72\x5f\x72\145\161\x75\145\163\x74"); return $query->result_array(); } public function refer_history() { $query = $this->db->order_by("\143\x72\145\141\x74\x65\144\x5f\141\164", "\104\x45\x53\x43")->get("\x72\x65\x66\x65\x72\137\x68\151\x73\x74\x6f\162\x79"); return $query->result_array(); } public function withdraw_point_req2($id) { $query = $this->db->get_where("\164\142\x6c\122\x65\x71\x75\x65\163\x74", array("\162\x65\x71\165\145\163\x74\x5f\163\x74\141\164\165\163" => "\x70\145\156\144\151\156\147", "\x72\145\161\x75\145\x73\x74\x5f\151\144" => $id)); $aa = $query->row_array(); $amt = 0; if (isset($aa)) { $amt = -$aa["\x72\145\161\x75\x65\x73\164\x5f\x70\x6f\151\x6e\x74\x73"]; } if ($this->ch_amt($amt, $aa["\x75\x73\x65\162\137\151\144"]) >= 0) { $query2 = $this->db->update("\x74\x62\154\x52\145\161\x75\x65\163\164", array("\162\145\x71\x75\145\163\x74\137\x73\164\141\164\165\163" => "\x61\x70\x70\x72\157\x76\x65\x64"), array("\x72\145\161\165\x65\163\x74\x5f\x69\x64" => $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\101\x54\105\40\x74\x62\154\x77\x61\x6c\154\145\x74\40\x73\145\x74\40\167\x61\154\154\x65\164\x5f\160\x6f\151\156\164\163\75\167\x61\154\154\x65\164\137\x70\157\151\x6e\x74\163\55\x27{$points}\47\x20\x77\x68\145\162\145\40\x75\x73\145\162\137\151\x64\x3d\x27{$id}\47\40"); } if ($query) { return true; } } public function starline() { $query = $this->db->query("\11\123\x45\114\105\103\x54\40\52\40\106\x52\x4f\x4d\40\x60\164\142\x6c\123\164\x61\162\x6c\151\156\145\x60"); return $query->result_array(); } public function starline_update($id) { $query = $this->db->query("\x9\123\x45\114\105\x43\124\40\x2a\40\x46\x52\117\115\x20\x60\x74\x62\x6c\x53\164\x61\x72\154\151\156\x65\x60\40\167\x68\145\x72\145\40\151\144\75\x27{$id}\x27\40"); return $query->result_array(); } public function starline_update2($id) { $snum = trim($this->input->post("\x73\156\165\155")); $stime = trim($this->input->post("\x73\164\151\155\x65")); $snums = explode("\55", $snum); $data = array("\163\x5f\x67\x61\155\x65\x5f\x6e\165\x6d\142\x65\x72" => $snum, "\x73\x5f\x67\141\155\145\137\164\x69\x6d\145" => $stime); $query = $this->db->update("\164\142\154\123\164\141\162\x6c\x69\x6e\145", $data, array("\151\x64" => $id)); $this->update_chart($id, "\112\x61\156\156\x61\164\x20\123\x74\x61\162\x6c\x69\156\x65", $snums[0], $snums[1]); if ($query) { return true; } } public function update_user_data($post_image) { $data = array("\x6e\141\x6d\x65" => $this->input->post("\x6e\x61\x6d\x65"), "\x7a\151\x70\143\157\x64\145" => $this->input->post("\x7a\x69\160\143\x6f\144\145"), "\x63\157\156\x74\x61\143\x74" => $this->input->post("\x63\157\156\x74\141\143\x74"), "\141\x64\144\x72\x65\163\x73" => $this->input->post("\x61\144\x64\x72\145\163\x73"), "\x67\x65\x6e\x64\x65\x72" => $this->input->post("\x67\145\x6e\x64\x65\x72"), "\163\164\x61\x74\x75\x73" => $this->input->post("\x73\164\141\x74\165\x73"), "\x64\x6f\x62" => $this->input->post("\144\x6f\142"), "\x69\x6d\x61\x67\145" => $post_image, "\162\145\147\151\x73\x74\x65\162\x5f\x64\x61\164\x65" => date("\131\55\155\x2d\144\40\110\x3a\151\72\x73")); $this->db->where("\x69\144", $this->input->post("\x69\144")); $d = $this->db->update("\165\163\x65\x72\163", $data); } public function get_siteconfiguration($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("\x73\x69\164\x65\137\x63\157\x6e\x66\x69\x67"); return $query->result_array(); } $query = $this->db->get_where("\x73\151\164\x65\137\143\x6f\156\146\x69\147", array("\151\144" => $id)); return $query->row_array(); } public function update_siteconfiguration($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("\x73\x69\164\145\x5f\143\157\156\146\x69\147"); return $query->result_array(); } $query = $this->db->get_where("\x73\x69\164\145\137\x63\x6f\x6e\x66\x69\147", array("\151\x64" => $id)); return $query->row_array(); } public function update_siteconfiguration_data($post_image) { $data = array("\x73\151\x74\x65\137\x74\151\x74\x6c\145" => $this->input->post("\x73\151\164\145\x5f\x74\x69\164\x6c\x65"), "\163\151\x74\145\x5f\156\141\x6d\145" => $this->input->post("\163\x69\164\x65\x5f\x6e\141\x6d\x65"), "\x6c\157\147\x6f\x5f\x69\x6d\x67" => $post_image); $this->db->where("\x69\x64", $this->input->post("\151\144")); return $this->db->update("\x73\x69\164\x65\137\x63\x6f\x6e\146\151\147", $data); } public function get_mobile_data() { $query = $this->db->get("\163\x69\164\145\137\143\x6f\156\x66\x69\x67"); return $query->row_array(); } public function update_mobile_data() { $data = array("\155\157\142\x69\154\x65" => $this->input->post("\155\157\142\x69\154\x65")); return $this->db->update("\163\151\164\145\x5f\x63\x6f\156\146\151\147", $data); } public function create_slider($post_image) { $data = array("\x74\151\x74\x6c\145" => $this->input->post("\164\151\x74\x6c\145"), "\x69\x6d\141\x67\145" => $post_image, "\x64\x65\163\x63\x72\151\160\164\151\x6f\156" => $this->input->post("\x64\145\x73\x63\x72\x69\160\x74\x69\x6f\156"), "\x73\x74\141\x74\x75\x73" => $this->input->post("\163\x74\x61\164\x75\x73")); return $this->db->insert("\x73\x6c\151\x64\145\162\163\137\x69\155\147", $data); } public function get_sliders($id = false) { if ($id === FALSE) { $query = $this->db->get("\x73\154\x69\x64\x65\162\x73\137\151\155\147"); return $query->result_array(); } $query = $this->db->get_where("\163\154\x69\144\145\x72\x73\x5f\151\155\147", array("\151\x64" => $id)); return $query->row_array(); } public function get_slider_data($id = FALSE) { if ($id === FALSE) { $query = $this->db->get("\x73\154\151\144\x65\162\x73\137\151\155\x67"); return $query->result_array(); } $query = $this->db->get_where("\x73\154\x69\144\x65\x72\x73\137\151\155\147", array("\x69\x64" => $id)); return $query->row_array(); } public function update_slider_data($post_image) { $data = array("\164\151\x74\x6c\145" => $this->input->post("\164\151\164\154\x65"), "\151\155\x61\x67\x65" => $post_image, "\144\x65\163\x63\162\151\160\x74\151\157\x6e" => $this->input->post("\144\145\163\143\162\151\160\x74\151\157\156"), "\x73\164\141\164\165\x73" => $this->input->post("\163\x74\x61\x74\x75\163")); $this->db->where("\151\144", $this->input->post("\151\144")); return $this->db->update("\x73\x6c\151\x64\145\x72\x73\x5f\151\155\x67", $data); } public function getChart() { return $this->db->get("\x63\x68\x61\x72\x74\x73")->result_array(); } public function getChartDetails($name) { return $this->db->where("\x6e\x61\155\x65", $name)->get("\x63\x68\x61\x72\164\x73")->result_array(); } public function update_chart_data() { $snum = $this->input->post("\x73\x6e\x75\155"); $enum = $this->input->post("\x65\156\x75\x6d"); $data = array("\x6e\x61\x6d\x65" => $this->input->post("\x6e\x61\x6d\x65"), "\x64\141\x74\x65" => $this->input->post("\144\x61\164\145"), "\x73\x74\x61\162\164\151\x6e\147\137\156\x75\x6d" => !empty($snum) ? $snum : NULL, "\162\x65\163\x75\x6c\x74\x5f\x6e\x75\155" => $this->input->post("\156\165\155"), "\x65\x6e\x64\137\156\165\x6d" => !empty($enum) ? $enum : NULL); $this->db->where("\156\x61\155\145", $this->input->post("\x6e\x61\x6d\x65") and "\144\141\x74\x65", $this->input->post("\x64\141\x74\x65")); return $this->db->update("\143\150\x61\x72\x74\163", $data); } public function add_chart_data() { $snum = $this->input->post("\163\156\165\155"); $enum = $this->input->post("\145\156\x75\155"); $data = array("\156\x61\155\x65" => $this->input->post("\x63\x68\x61\x72\x74"), "\x64\x61\164\x65" => $this->input->post("\x64\x61\164\x65"), "\x73\x74\141\162\x74\151\156\x67\x5f\x6e\x75\155" => !empty($snum) ? $snum : NULL, "\162\x65\163\165\x6c\x74\137\156\x75\x6d" => $this->input->post("\x6e\165\155"), "\145\x6e\144\137\156\165\155" => !empty($enum) ? $enum : NULL); return $this->db->insert("\143\150\x61\x72\164\163", $data); } public function getUserDetails() { return $this->db->get("\165\163\x65\x72\163")->result_array(); } public function getMatkaDetails() { return $this->db->get("\155\141\164\153\141")->result_array(); } public function get_total_users() { return $this->db->where("\x69\163\137\144\x65\154\145\x74\145\x64", 0)->get("\165\163\x65\x72\x5f\x70\x72\x6f\x66\x69\x6c\145")->result_array(); } public function create_matka($team_image) { $snum = $this->input->post("\x73\x6e\x75\x6d"); $enum = $this->input->post("\x65\156\x75\155"); $name = $this->input->post("\156\x61\155\x65"); $query = $this->db->get_where("\155\x61\x74\x6b\x61", array("\156\141\155\x65" => $name)); $count = $query->num_rows(); if ($count === 0) { $data = array("\156\141\155\145" => $this->input->post("\156\141\x6d\x65"), "\163\x74\141\162\x74\137\164\151\x6d\x65" => $this->input->post("\x73\x74\151\155\145"), "\x65\x6e\x64\x5f\164\151\x6d\x65" => $this->input->post("\x65\164\x69\x6d\145"), "\x73\x74\x61\162\x74\151\x6e\x67\137\156\165\155" => !empty($snum) ? $snum : NULL, "\x6e\165\155\142\145\162" => $this->input->post("\x6e\x75\x6d"), "\145\156\144\x5f\156\165\155" => !empty($enum) ? $enum : NULL, "\142\151\144\137\x73\x74\x61\x72\164\137\x74\151\x6d\x65" => $this->input->post("\x66\x73\x74\x69\155\145"), "\142\151\x64\x5f\145\x6e\x64\137\164\x69\x6d\x65" => $this->input->post("\x66\x65\164\x69\155\x65")); $data1 = array("\156\141\155\x65" => $this->input->post("\x6e\141\x6d\x65"), "\x64\x61\x74\x65" => date("\131\55\155\55\x64"), "\x73\164\x61\x72\x74\151\x6e\147\x5f\156\165\155" => $this->input->post("\x73\156\165\155"), "\x72\145\x73\x75\x6c\x74\137\x6e\x75\x6d" => $this->input->post("\x6e\x75\x6d"), "\145\156\x64\x5f\x6e\x75\155" => $this->input->post("\145\156\x75\x6d")); $this->session->set_flashdata("\163\x75\x63\143\x65\x73\x73", "\131\x6f\x75\162\x20\155\x61\x74\153\141\40\150\x61\x73\40\142\x65\x65\156\x20\143\x72\145\x61\x74\x65\x64\x2e"); $this->db->insert("\155\x61\164\x6b\x61", $data); $this->db->insert("\143\x68\x61\x72\x74\163", $data1); $ref = "\x6c\151\163\x74"; } else { $ref = "\141\x64\144"; $this->session->set_flashdata("\146\x61\151\x6c", "\x4e\x61\x6d\x65\40\141\154\x72\145\141\x64\x79\40\x45\x78\x69\163\164\40\56"); } return $ref; } public function listmatka($teamId = FALSE, $limit = FALSE, $offset = FALSE) { if ($limit) { $this->db->limit($limit, $offset); } if ($teamId === FALSE) { $this->db->select("\x2a\54\111\106\50\151\x73\137\x68\x6f\155\145\160\141\x67\x65\x5f\x67\x61\155\145\40\75\40\x31\x2c\x20\x43\x4f\116\103\101\x54\50\163\164\x61\x72\x74\151\156\x67\137\x6e\x75\155\54\x20\x27\x20\x58\x20\x27\54\x20\x65\156\144\137\x6e\x75\x6d\51\54\x6e\165\x6d\x62\145\x72\x29\x20\101\x53\x20\162\x65\x73\165\x6c\164"); $this->db->order_by("\155\x61\164\153\x61\x2e\x69\144", "\x44\105\x53\x43"); $query = $this->db->get("\155\x61\x74\153\x61"); return $query->result_array(); } $this->db->select("\x6d\141\164\153\x61\x2e\x2a\x2c\x74\142\x6c\x4e\157\164\x69\143\x65\x2e\x72\x61\x74\145\x20\141\163\40\x6d\x61\162\x6b\x65\164\x5f\x72\141\x74\145"); $this->db->where("\155\141\164\153\x61\56\x69\144", $teamId)->from("\155\141\164\153\x61"); $this->db->join("\x74\142\154\116\x6f\x74\x69\x63\145", "\164\142\x6c\x4e\157\164\151\143\145\56\x69\x64\x20\75\40\x6d\x61\x74\x6b\x61\56\151\144", "\x6c\145\x66\164"); return $query = $this->db->get()->row_array(); } public function memberlistteams($id) { $this->db->order_by("\x6d\141\x74\x6b\141\x2e\151\144", "\104\105\123\x43"); return $query->result_array(); } public function update_team_data() { $c = 0; $snum = $this->input->post("\x73\156\165\x6d"); $enum = $this->input->post("\x65\156\165\x6d"); $num = $this->input->post("\156\x75\155"); $id = $this->input->post("\x69\x64"); $name = $this->input->post("\x6e\x61\155\145"); $date = $this->input->post("\x75\144\x61\x74\145"); $market_rate = $this->input->post("\155\x61\x72\153\x65\x74\137\162\x61\164\x65") ?? 0; if (isset($market_rate) && $market_rate > 0) { $this->db->where("\151\144", $id)->update("\164\142\x6c\x4e\x6f\x74\151\143\145", array("\x72\x61\164\x65" => $market_rate)); } $data = array("\x6e\x61\x6d\145" => $name, "\x73\164\x61\162\x74\x69\156\x67\x5f\x6e\165\x6d" => !empty($snum) ? $snum : NULL, "\x6e\x75\x6d\x62\145\162" => $this->input->post("\x6e\165\155"), "\145\x6e\x64\x5f\156\165\x6d" => !empty($enum) ? $enum : NULL, "\142\151\144\x5f\x73\x74\141\x72\x74\x5f\164\x69\x6d\145" => $this->input->post("\x66\x73\164\151\x6d\x65"), "\142\x69\x64\x5f\145\x6e\144\x5f\x74\151\x6d\x65" => $this->input->post("\x66\145\164\151\155\145"), "\163\x74\141\x72\164\137\164\151\155\x65" => $this->input->post("\x66\163\164\x69\x6d\x65"), "\x65\x6e\x64\x5f\x74\x69\155\x65" => $this->input->post("\x66\x65\164\151\155\145"), "\163\141\x74\137\163\164\141\162\x74\137\x74\x69\155\145" => $this->input->post("\x66\163\x74\x69\155\x65"), "\163\x61\x74\137\x65\156\144\137\164\151\x6d\x65" => $this->input->post("\x66\145\164\x69\155\145")); $this->db->where("\x69\x64", $id); $this->db->update("\x6d\141\x74\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("\x59\55\x6d\55\144") : $date; $data1 = array("\156\141\x6d\x65" => $name, "\x63\151\144" => $id, "\144\x61\164\x65" => $dt, "\x73\164\141\x72\x74\151\156\x67\137\156\165\155" => !empty($snum) ? $snum : NULL, "\162\145\163\165\154\x74\x5f\x6e\165\155" => $num, "\x65\156\x64\137\x6e\x75\155" => !empty($enum) ? $enum : NULL); $where = array("\143\x69\x64" => $id, "\x64\x61\164\x65" => $dt); $data2 = $this->db->select("\103\117\x55\116\x54\x28\x69\x64\51\x20\141\163\x20\x63\157\x75\156\164\x65\x72")->where($where)->get("\x63\150\141\x72\164\x73")->row(); if ($data2->counter > 0) { $this->db->where($where); $this->db->update("\143\150\x61\x72\164\x73", $data1); } else { $this->db->insert("\x63\x68\141\x72\164\x73", $data1); } return true; } public function get_admin_data() { $id = $this->session->userdata("\x75\x73\x65\162\x5f\151\x64"); if ($id === FALSE) { $query = $this->db->get("\x75\x73\145\162\163"); return $query->result_array(); } $query = $this->db->get_where("\x75\163\145\162\x73", array("\151\144" => $id)); return $query->row_array(); } public function change_password($new_password) { $data = array("\160\x61\x73\x73\167\x6f\x72\144" => md5($new_password)); $this->db->where("\151\144", $this->session->userdata("\165\x73\145\162\x5f\151\144")); return $this->db->update("\x75\163\x65\162\x73", $data); } public function match_old_password($password) { $id = $this->session->userdata("\x75\163\145\x72\137\151\x64"); if ($id === FALSE) { $query = $this->db->get("\165\163\145\x72\x73"); return $query->result_array(); } $query = $this->db->get_where("\165\x73\145\x72\163", array("\160\141\x73\x73\x77\x6f\x72\x64" => $password)); return $query->row_array(); } public function email_exists() { $email = $this->input->post("\145\x6d\141\151\154"); $query = $this->db->query("\x53\105\x4c\x45\x43\124\40\145\x6d\141\x69\154\54\40\160\141\163\163\x77\157\162\144\40\x46\x52\117\x4d\x20\x75\x73\145\162\x73\x20\127\110\105\x52\x45\x20\x65\155\141\151\x6c\x3d\47{$email}\x27"); if ($row = $query->row()) { return TRUE; } else { return FALSE; } } public function temp_reset_password($temp_pass) { $data = array("\145\x6d\x61\x69\154" => $this->input->post("\x65\x6d\141\x69\x6c"), "\162\145\163\x65\x74\x5f\160\141\x73\163" => $temp_pass); $email = $data["\145\x6d\x61\151\154"]; if ($data) { $this->db->where("\x65\155\141\151\154", $email); $this->db->update("\x75\x73\145\162\163", $data); return TRUE; } else { return FALSE; } } public function is_temp_pass_valid($temp_pass) { $this->db->where("\x72\x65\x73\x65\x74\137\160\x61\163\x73", $temp_pass); $query = $this->db->get("\165\x73\x65\x72\x73"); if ($query->num_rows() == 1) { return TRUE; } else { return FALSE; } } public function deletepackage($id) { $data = array("\163\164\141\x74\165\x73" => 2); $this->db->where("\151\x64", $id); return $this->db->update("\x70\x61\143\153\141\147\145", $data); } public function add_wallet_4($id, $wa, $wallet = '') { if ($wallet != '') { if ($wallet == "\167\x61\x6c\154\145\x74\137\160\157\x69\x6e\164\163") { $query = $this->db->query("\x55\x70\x64\x61\164\x65\40\164\142\154\167\141\x6c\x6c\x65\164\x20\163\x65\x74\x20\x77\141\x6c\x6c\145\164\x5f\160\157\x69\156\164\x73\x3d\x77\141\154\154\x65\164\x5f\160\157\151\x6e\x74\163\x2b\x27{$wa}\47\x20\167\x68\145\162\145\40\165\x73\x65\162\137\151\144\75\x27{$id}\47"); } else { $query = $this->db->query("\x55\160\x64\141\164\145\40\164\x62\x6c\167\141\x6c\154\145\164\40\x73\145\164\x20\155\141\x69\156\x5f\167\141\154\x6c\145\x74\x5f\x70\157\x69\x6e\x74\x73\x3d\155\x61\x69\156\137\x77\141\x6c\154\145\164\x5f\x70\157\151\156\164\x73\x2b\x27{$wa}\47\40\x77\x68\x65\162\145\40\x75\x73\x65\162\x5f\x69\x64\75\47{$id}\x27"); } } else { $query = $this->db->query("\125\x70\144\141\164\145\40\164\142\154\x77\x61\x6c\154\x65\x74\x20\163\145\164\40\x6d\x61\151\156\x5f\x77\x61\x6c\154\145\164\x5f\x70\157\151\x6e\164\x73\75\155\x61\151\156\x5f\x77\141\x6c\154\145\164\x5f\160\157\151\x6e\164\163\x2b\47{$wa}\x27\x20\167\x68\x65\x72\x65\40\165\163\145\x72\137\151\144\75\x27{$id}\47"); } if ($query) { return true; } } }

Function Calls

None

Variables

None

Stats

MD5 423653641af51eb492d34bee139fc3b2
Eval Count 0
Decode Time 95 ms