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() { ..

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->select("*")->where("is_deleted", 0)->from("tblgame")->order_by("game_id", "DESC")->get()->result(); 
    } 
    public function gamedata($from = '', $to = '', $type = '') { 
        $fc_game_id = $this->db->select("id")->where(array("is_homepage_game" => "1", "is_fc_game" => "1"))->get("matka")->result(); 
        $fc_id = count($fc_game_id) > 0 ? array_column($fc_game_id, "id") : array(); 
        $this->db->select(",id,user_id,matka_id,bs_game_name,game_name,points,bet_type,time,digits,status"); 
        $this->db->order_by("id", "DESC"); 
        $this->db->where("date(time) BETWEEN '{$from}' AND '{$to}' "); 
        if (!empty($fc_id) && $type == "is_fc_game") { 
            $this->db->where_in("matka_id", $fc_id); 
        } else { 
            $this->db->where_not_in("matka_id", $fc_id); 
        } 
        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" => mb_convert_encoding($this->input->post("message"), "HTML-ENTITIES", "UTF-8"), "home_text" => mb_convert_encoding($this->input->post("hometext"), "HTML-ENTITIES", "UTF-8"), "withdraw_text" => mb_convert_encoding($this->input->post("withdrawtext"), "HTML-ENTITIES", "UTF-8"), "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" => mb_convert_encoding($this->input->post("add_point_text"), "HTML-ENTITIES", "UTF-8"), "add_transfer_text" => mb_convert_encoding($this->input->post("add_transfer_text"), "HTML-ENTITIES", "UTF-8"), "withdraw_note" => mb_convert_encoding($this->input->post("withdraw_note"), "HTML-ENTITIES", "UTF-8"), "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"), "fund_mode" => $this->input->post("fund_mode"), "running_home_text" => mb_convert_encoding($this->input->post("running_home_text"), "HTML-ENTITIES", "UTF-8"), "max_bid_amount" => $this->input->post("max_bid_amount"), "max_withdraw" => $this->input->post("max_withdraw"), "withdraw_alert_message" => mb_convert_encoding($this->input->post("withdraw_alert_message"), "HTML-ENTITIES", "UTF-8"), "max_add_amount" => $this->input->post("max_add_amount"), "withdrawal_type" => $this->input->post("withdrawal_type"), "addmoney_alert" => mb_convert_encoding($this->input->post("addmoney_alert"), "HTML-ENTITIES", "UTF-8"), "refer_custom_text" => mb_convert_encoding($this->input->post("refer_custom_text"), "HTML-ENTITIES", "UTF-8"), "add_money_voice" => $this->input->post("add_money_voice"), "withdraw_service_tax" => $this->input->post("withdraw_service_tax")); 
        $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,
	  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", "is_qrcode" => 0); 
        $query = $this->db->insert("tblRequest", $insert_query); 
        return $query; 
    } 
    public function add_pointList($form, $to) { 
        $this->db->select("*")->from("tblRequest")->where("type", "Add"); 
        $this->db->order_by("request_id", "DESC"); 
        $this->db->limit(10000); 
        $this->db->where("date(time) >=", $form); 
        $this->db->where("date(time) <=", $to); 
        $query = $this->db->get(); 
        return $query->result_array(); 
    } 
    public function add_point_req($from, $to) { 
        $this->db->cache_off(); 
        $this->db->select("request_id,user_id,request_points,time,IF(comment !='',comment,'N/a') as comment,request_status"); 
        $this->db->where("type", "Add"); 
        $this->db->where("DATE(time) BETWEEN '{$from}' AND '{$to}'"); 
        $query = $this->db->order_by("request_id", "desc")->get("tblRequest")->result_array(); 
        return $query; 
    } 
    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($from, $to) { 
        $this->db->select("request_id,user_id,request_points,time,request_status,service_charge"); 
        $this->db->where("DATE(time) BETWEEN '{$from}' AND '{$to}'"); 
        $query = $this->db->where(array("type" => "Withdrawal"))->order_by("request_id", "DESC")->get("tblRequest"); 
        return $query->result_array(); 
    } 
    public function withdraw_point($form, $to) { 
        $this->db->select("*"); 
        $this->db->from("tblRequest"); 
        $this->db->where("type", "Withdrawal"); 
        $this->db->order_by("request_id", "DESC"); 
        $this->db->limit(5000); 
        $this->db->where("date(time) >='{$form}'"); 
        $this->db->where("date(time)<='{$to}'"); 
        $query = $this->db->get(); 
        return $query->result_array(); 
    } 
    public function withdraw_point_list($request) { 
        $cdate = date("Y-m-d"); 
        $min_date = date("Y-m-d", strtotime("-4 days")); 
        $max_date = date("Y-m-d", strtotime("+1 days")); 
        $nextDate = date("Y-m-d", strtotime("+1 day", strtotime(date("Y-m-d")))); 
        $ctime = date("H:i:s", strtotime("+30 min", strtotime(date("H:i:s")))); 
        $sport_id = "1"; 
        $search_text = isset($request["search"]) && !empty($request["search"]) ? $request["search"] : ''; 
        $limit = isset($request["length"]) && !empty($request["length"]) ? $request["length"] : 50; 
        $offset = isset($request["page"]) && !empty($request["page"]) ? ($request["page"] - 1) * $limit : 0; 
        $this->db->start_cache(); 
        if (!empty($search_text)) { 
            $this->db->where("tblRequest.request_id LIKE '%" . $search_text . "%'"); 
        } 
        $query = $this->db->where(array("type" => "Withdrawal"))->order_by("request_id", "DESC")->limit($limit, $offset)->get("tblRequest"); 
        $res = $query->result_array(); 
        foreach ($res as $row) { 
            $user_id = $row["user_id"]; 
            $r = $this->db->select("name,mobileno")->from("user_profile")->where("id", $user_id)->get()->row(); 
            print_r($r); 
        } 
        $this->db->stop_cache(); 
        $total = $this->db->select("tblRequest.request_id")->where("type", "Withdrawal")->count_all_results(); 
        $this->db->flush_cache(); 
        $rdata["list"] = $res; 
        $rdata["totalPage"] = ceil($total / $limit); 
        $rdata["totalCount"] = $total; 
        return $rdata; 
    } 
    public function delete_withdraw_point_req($req_id) { 
        $row = $this->db->select("user_id,SUM(request_points+service_charge)as point")->where("request_id", $req_id)->get("tblRequest")->row() ??NULL; 
        if (isset($row)) { 
            $this->db->set("wallet_points", "wallet_points + " . (double)$row->point, FALSE); 
            $this->db->where("user_id", $row->user_id)->update("tblwallet"); 
            if ($this->db->affected_rows() > 0) { 
                $this->db->where("request_id", $req_id)->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("\x9SELECT * 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 =!", "1")->get("user_profile")->num_rows(); 
    } 
    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.matka_order", "ASC"); 
            $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") ??NULL; 
        $enum = $this->input->post("enum") ??NULL; 
        $num = $this->input->post("num") ??NULL; 
        $id = $this->input->post("id"); 
        $name = $this->input->post("name"); 
        $date = $this->input->post("udate"); 
        $data = array("name" => $name, "starting_num" => !empty($snum) ? $snum : null, "number" => !empty($num) ? $num : null, "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"), "matka_rate" => $this->input->post("matka_rate"), "sat_end_time" => $this->input->post("fetime")); 
        $this->db->where("id", $id); 
        $this->db->update("matka", $data); 
        $home_page_game = $this->db->select("is_homepage_game")->where("id", $id)->get("matka")->row()->is_homepage_game??0; 
        if ($home_page_game == 1) { 
            if (!empty($snum) && !empty($enum)) { 
                $this->update_chart($id, $name, $snum, $num, $enum, $date); 
            } 
        } else { 
            if (!empty($num)) { 
                $this->update_chart($id, $name, $snum, $num, $enum, $date); 
            } 
        } 
        return; 
    } 
    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); 
        } 
        if (!empty($snum) && !empty($enum)) { 
            $message = $snum . " X " . $enum; 
        } elseif (!empty($snum) && empty($enum)) { 
            $message = $snum; 
        } elseif (empty($snum) && !empty($enum)) { 
            $message = $enum; 
        } else { 
            $message = $num; 
        } 
        @sendPushNotification("online_teer_bazar", $name, $message, 2); 
        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; 
        } 
    } 
    public function add_MarketData($data) { 
        $data = $this->db->insert("matka", $data); 
        return $data; 
    } 
    public function inactiveUserList() { 
        $now = date("Y-m-d"); 
        $date = date("Y-m-d", strtotime("-2 months")); 
        $request_data = $this->db->select("user_id")->where("date(time)>=", $date)->group_by("user_id")->order_by("user_id", "DESC")->get("tblRequest")->result(); 
        $request_id = count($request_data) > 0 ? array_column($request_data, "user_id") : array(); 
        $game_data = $this->db->select("user_id")->where("date(time)>=", $date)->group_by("user_id")->order_by("user_id", "DESC")->get("tblgamedata")->result(); 
        $game_id = count($game_data) > 0 ? array_column($game_data, "user_id") : array(); 
        $inactive_user = array_unique(array_merge($request_id, $game_id)); 
        if (!empty($inactive_user)) { 
            $this->db->where_not_in("id", $inactive_user); 
        } 
        $user_data = $this->db->select("u.name,u.username,u.mobileno,u.email,u.address,u.password,t.wallet_points,t.main_wallet_points")->from("user_profile u")->join("tblwallet t", "u.id=t.user_id")->get()->result(); 
        return $user_data; 
    } 
    public function change_status_userlist($id, $set_status = 0) { 
        $data = array("login_status" => $set_status); 
        $this->db->where("id", $id); 
        return $this->db->update("user_profile", $data); 
    } 
    public function deleteuserlist($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 user_registered($date) { 
        $query = $this->db->query("SELECT * FROM `user_profile` WHERE DATE(`time`) = '{$date}' and is_deleted !='1'"); 
        return $query->num_rows(); 
    } 
    public function this_week_user_registered() { 
        $d = strtotime("today"); 
        $start_week = strtotime("last sunday midnight", $d); 
        $end_week = strtotime("next saturday", $d); 
        $start = date("Y-m-d", $start_week); 
        $end = date("Y-m-d", $end_week); 
        $query = $this->db->query("SELECT * FROM `user_profile` WHERE DATE(`time`) >= '{$start}' AND DATE(`time`) <= '{$end}' and is_deleted !='1'"); 
        return $query->num_rows(); 
    } 
    public function last_week_user_registered() { 
        $previous_week = strtotime("-1 week +1 day"); 
        $start_week = strtotime("last sunday midnight", $previous_week); 
        $end_week = strtotime("next saturday", $start_week); 
        $start_week = date("Y-m-d", $start_week); 
        $end_week = date("Y-m-d", $end_week); 
        $query = $this->db->query("SELECT * FROM `user_profile` WHERE DATE(`time`) >= '{$start_week}' AND DATE(`time`) <= '{$end_week}' and is_deleted !='1'"); 
        return $query->num_rows(); 
    } 
    public function current_month_user_registered() { 
        $first = date("Y-m-01"); 
        $last = date("Y-m-d"); 
        $query = $this->db->query("SELECT * FROM `user_profile` WHERE DATE(`time`) >= '{$first}' AND DATE(`time`) <= '{$last}' and is_deleted !='1'"); 
        return $query->num_rows(); 
    } 
    public function last_month_user_registered() { 
        $first = date("Y-m-d", strtotime("first day of previous month")); 
        $last = date("Y-m-d", strtotime("last day of previous month")); 
        $query = $this->db->query("SELECT * FROM `user_profile` WHERE DATE(`time`) >= '{$first}' AND DATE(`time`) <= '{$last}' and is_deleted !='1'"); 
        return $query->num_rows(); 
    } 
    public function logged_in_users() { 
        $query = $this->db->query("select count(is_login) as loogedinusers from user_profile where is_login = '1' "); 
        return $a = $query->row()->loogedinusers??0; 
    } 
    public function zero_balance_users() { 
        $query = $this->db->query("select count(wallet_id) as zero_balance_user from tblwallet where wallet_points = '0' "); 
        $a = $query->row(); 
        if ($a != '') { 
            return $query->row()->zero_balance_user; 
        } else { 
            return 0; 
        } 
    } 
    public function today_zero_balance_users() { 
        return $query = $this->db->where("wallet_points", 0)->where("DATE(updated_at)", date("Y-m-d"))->get("tblwallet")->num_rows(); 
    } 
    public function banned_users() { 
        $query = $this->db->query("select count(login_status) as banned_users from user_profile where login_status = '1' "); 
        return $query->row()->banned_users??0; 
    } 
    public function total_deposited_amount() { 
        $last_date = date("Y-m-d 00:00:01"); 
        $query = $this->db->query("select if(SUM(request_points) is null,0,SUM(request_points)) as deposit_amount 
            from tblRequest where type='Add' and time >= '{$last_date}'"); 
        $a = $query->row(); 
        if ($a != '') { 
            return $query->row()->deposit_amount; 
        } else { 
            return 0; 
        } 
    } 
    public function total_withdraw_amount() { 
        $query = $this->db->query("select if(SUM(request_points) is null,0,SUM(request_points)) as withdrawl_amount from tblRequest where type='Withdrawal' and request_status='approved' and time >= '{$this->last_date}'"); 
        $a = $query->row(); 
        if ($a != '') { 
            return $query->row()->withdrawl_amount; 
        } else { 
            return 0; 
        } 
    } 
    public function yesterday_wallet_balance() { 
        $yesterday = date("Y-m-d", strtotime("-1 day")); 
        $wallet_amt = $this->db->query("select SUM(wallet_points) as amt from tblwallet")->row()->amt; 
        $win_amt = $this->db->query("select SUM(amt) as winning_amount from history where type='c' and time >='{$yesterday}'")->row()->winning_amount; 
        $withdrawal_amt = $this->db->query("select SUM(request_points) as withdrawl_amount
        from tblRequest where type='Withdrawal' and request_status!='cancelled' and request_status!='pending' and time >= '{$yesterday}'")->row()->withdrawl_amount; 
        $deposit_amt = $this->db->query("select SUM(request_points) as deposit_amount from tblRequest where type='Add' and time >= '{$yesterday}'")->row()->deposit_amount; 
        $bet_played_amt = $this->db->query("select SUM(points) as betting_amount from tblgamedata where time >= '{$yesterday}'")->row()->betting_amount; 
        $final_amt = $wallet_amt + $withdrawal_amt + $bet_played_amt - $win_amt - $deposit_amt; 
        if ($final_amt != '') { 
            return $final_amt; 
        } else { 
            return 0; 
        } 
    } 
    public function today_withdrawal() { 
        return $this->db->select("ROUND(SUM(request_points),2) as point")->where(array("request_status" => "approved", "type" => "Withdrawal", "DATE(time)" => date("Y-m-d")))->get("tblRequest")->row()->point??0; 
    } 
    public function today_deposit() { 
        return $this->db->select("SUM(request_points) as point")->where(array("request_status" => "approved", "type" => "Add", "DATE(time)" => date("Y-m-d")))->where("is_cashback IS NULL")->get("tblRequest")->row()->point??0; 
    } 
    public function today_bid_amount() { 
        return $query = $this->db->select("SUM(amt) as point")->where(array("type" => "d", "DATE(time)" => date("Y-m-d")))->get("history")->row()->point??0; 
    } 
    public function total_amount_wallet($type = '') { 
        return $this->db->select("SUM({$type}) as amt")->get("tblwallet")->row()->amt??0; 
    } 
    public function count_active_users() { 
        $query = $this->db->query("select count(login_status) as active_users from user_profile where is_deleted !='1' "); 
        $a = $query->row(); 
        if ($a != '') { 
            return $query->row()->active_users; 
        } else { 
            return 0; 
        } 
    } 
    public function today_paid_amount() { 
        return $this->db->select("SUM(amt) as point")->where(array("type" => "c", "DATE(time)" => date("Y-m-d")))->get("history")->row()->point??0; 
    } 
    public function today_deposit_manually() { 
        $now = date("Y-m-d"); 
        return $data = $this->db->select("SUM(request_points)as amount")->where(array("date(time)" => $now, "is_qrcode" => 0, "type" => "Add", "request_status" => "approved"))->get("tblRequest")->row()->amount??0; 
    } 
    public function today_withdrwal_manually() { 
        $now = date("Y-m-d"); 
        return $data = $this->db->select("SUM(request_points)as amount")->where(array("date(time)" => $now, "is_qrcode" => 0, "type" => "Withdrawal", "request_status" => "approved"))->get("tblRequest")->row()->amount??0; 
    } 
    public function change_status_market($id, $set_status = "active") { 
        $data = array("status" => $set_status); 
        $this->db->where("id", $id); 
        return $this->db->update("matka", $data); 
    } 
    public function rate_range($id) { 
        return $this->db->select("rate_range")->where("id", $id)->get("tblNotice")->row(); 
    } 
    public function update_game_rate($rate, $id) { 
        $data = array("points" => $rate); 
        $this->db->where("game_id", $id); 
        $this->db->update("tblgame", $data); 
        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\x61\x69\x6c", $email);
        $this->db->where("\x70\141\163\163\167\157\162\x64", $encrypt_password);
        $result = $this->db->get("\165\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\137\x73\145\x74\164\x69\156\147");
        $app_data = $query->row();
        return $app_data;
    }
    public function withdrawal_slot() {
        $query = $this->db->get("\x74\151\155\145\x73\154\157\164\x73");
        $app_data = $query->row();
        return $app_data;
    }
    public function stastics($type = '') {
        if ($type == '') {
            $stats = 0;
        }
        if ($type == "\141\144\x64\x5f\x70\157\x69\x6e\164") {
            $stats = $this->db->select("\x53\125\115\x28\x72\x65\x71\x75\x65\163\x74\137\x70\x6f\x69\156\x74\163\x29\40\141\x73\x20\x70\x6f\x69\156\x74\163")->where(array("\164\x79\160\145" => "\101\144\x64", "\x72\x65\161\165\145\x73\164\137\x73\x74\x61\164\165\163" => "\141\160\160\x72\x6f\166\145\144"))->get("\164\x62\x6c\122\145\x71\x75\x65\163\164")->row()->points;
        }
        if ($type == "\x77\151\x74\150\144\x72\141\x77\x6c\x5f\160\157\151\x6e\164") {
            $stats = $this->db->select("\123\125\115\x28\x72\x65\161\x75\145\163\164\137\x70\x6f\151\156\x74\163\x29\x20\x61\x73\x20\160\x6f\151\x6e\164\x73")->where(array("\x74\171\160\145" => "\127\151\164\x68\x64\162\141\167\141\x6c", "\x72\x65\x71\x75\145\x73\164\x5f\x73\x74\141\x74\x75\x73" => "\x61\x70\x70\162\157\166\x65\x64"))->get("\x74\142\x6c\x52\x65\x71\165\145\163\x74")->row()->points * -1;
        }
        if ($stats == '') {
            $stats = 0;
        }
        return $stats;
    }
    public function games() {
        return $this->db->select("\x2a")->where("\x69\163\137\144\145\154\145\x74\x65\144", 0)->from("\x74\142\x6c\x67\x61\x6d\145")->order_by("\x67\141\155\145\137\x69\144", "\104\x45\123\x43")->get()->result();
    }
    public function gamedata($from = '', $to = '', $type = '') {
        $fc_game_id = $this->db->select("\151\x64")->where(array("\151\163\137\x68\157\155\x65\160\141\147\145\x5f\147\141\155\145" => "\x31", "\151\163\137\146\143\x5f\x67\x61\x6d\145" => "\61"))->get("\x6d\x61\164\153\141")->result();
        $fc_id = count($fc_game_id) > 0 ? array_column($fc_game_id, "\151\144") : array();
        $this->db->select("\x2c\x69\144\54\x75\163\145\162\x5f\x69\x64\54\155\x61\164\x6b\141\x5f\151\144\x2c\142\163\137\147\x61\155\145\137\x6e\141\155\145\54\x67\141\155\x65\137\x6e\141\155\145\x2c\x70\157\151\156\x74\163\x2c\142\x65\164\137\164\x79\x70\x65\x2c\164\x69\x6d\145\x2c\144\151\147\x69\164\x73\x2c\x73\x74\x61\164\x75\163");
        $this->db->order_by("\151\144", "\104\x45\123\103");
        $this->db->where("\x64\141\x74\x65\x28\164\151\x6d\x65\x29\40\x42\x45\x54\127\105\x45\116\40\47{$from}\47\x20\x41\116\x44\40\47{$to}\x27\40");
        if (!empty($fc_id) && $type == "\x69\x73\137\x66\143\x5f\x67\141\155\145") {
            $this->db->where_in("\x6d\141\164\153\x61\137\151\144", $fc_id);
        } else {
            $this->db->where_not_in("\155\141\x74\153\141\137\x69\144", $fc_id);
        }
        return $this->db->get("\x74\x62\154\147\141\155\x65\x64\141\x74\141")->result();
    }
    public function gamebyid($id) {
        $this->db->where("\x69\x64", $id);
        return $this->db->get("\147\x61\155\145\x73")->row();
    }
    public function userbyid($id) {
        $this->db->where("\151\x64", $id);
        return $this->db->get("\165\163\x65\162\137\x70\162\x6f\x66\x69\x6c\145")->row();
    }
    public function matkabyid($id) {
        $this->db->where("\151\144", $id);
        return $this->db->get("\x6d\x61\x74\153\141")->row();
    }
    public function update_appsetting() {
        $app = array("\155\x65\163\163\x61\x67\145" => mb_convert_encoding($this->input->post("\x6d\x65\163\163\x61\147\145"), "\110\124\x4d\114\55\x45\x4e\x54\111\x54\x49\x45\123", "\125\x54\x46\55\x38"), "\150\157\155\145\137\164\x65\x78\164" => mb_convert_encoding($this->input->post("\150\x6f\155\x65\164\x65\x78\x74"), "\110\x54\x4d\114\55\x45\x4e\x54\111\124\111\x45\123", "\125\x54\106\55\70"), "\167\x69\164\150\144\162\x61\167\137\x74\x65\x78\164" => mb_convert_encoding($this->input->post("\x77\x69\x74\x68\144\162\141\167\x74\145\x78\164"), "\110\x54\x4d\114\55\x45\116\x54\x49\x54\111\x45\123", "\x55\x54\x46\55\x38"), "\x77\151\x74\150\x64\x72\141\167\137\x6e\157" => $this->input->post("\x77\x69\164\x68\144\x72\x61\x77\x6e\165\x6d\x62\145\x72"), "\167\150\x61\164\163\141\160\x70\x5f\156\x6f" => $this->input->post("\x77\150\x61\164\163\141\160\160\137\156\x6f"), "\x75\160\151" => $this->input->post("\165\x70\x69"), "\165\160\x69\x5f\x6e\141\155\x65" => $this->input->post("\x75\160\x69\137\x6e\141\155\145"), "\155\x69\x6e\137\141\155\157\x75\156\164" => $this->input->post("\x6d\151\x6e\137\141\155\157\x75\156\x74"), "\x77\137\x61\155\x6f\x75\156\x74" => $this->input->post("\x77\x5f\141\x6d\157\165\156\x74"), "\150\x6f\167\x5f\x74\157\137\160\154\141\x79" => $this->input->post("\x68\157\x77\x5f\x74\157\x5f\160\154\x61\171"), "\x61\x64\144\x5f\160\x6f\151\x6e\164\x5f\164\145\x78\164" => mb_convert_encoding($this->input->post("\141\x64\x64\x5f\160\157\151\156\x74\x5f\x74\145\170\x74"), "\x48\124\115\114\x2d\x45\116\x54\111\124\x49\105\x53", "\125\124\106\x2d\70"), "\141\144\x64\x5f\164\162\x61\x6e\x73\x66\145\x72\137\164\x65\x78\x74" => mb_convert_encoding($this->input->post("\x61\x64\x64\x5f\164\162\x61\156\163\146\x65\162\x5f\x74\x65\x78\x74"), "\x48\124\115\114\55\105\116\124\x49\124\111\105\123", "\x55\124\x46\55\x38"), "\x77\151\164\x68\144\x72\x61\167\137\x6e\157\x74\x65" => mb_convert_encoding($this->input->post("\x77\151\x74\x68\x64\162\141\x77\137\156\157\164\x65"), "\x48\124\x4d\x4c\x2d\x45\116\x54\111\124\x49\x45\123", "\x55\x54\106\x2d\x38"), "\162\145\x66\145\x72\137\x61\x6d\x6f\x75\x6e\x74" => $this->input->post("\x72\145\x66\145\x72\x5f\141\x6d\157\165\x6e\x74"), "\165\160\151\137\x64\145\163\143" => $this->input->post("\165\x70\x69\137\x64\145\x73\143"), "\x74\x65\154\145\147\162\141\x6d\x5f\151\x64" => $this->input->post("\164\x65\154\145\x67\162\141\x6d\137\151\x64"), "\164\162\x61\x6e\x73\x66\145\162\x5f\x66\145\145" => $this->input->post("\164\x72\141\x6e\163\x66\145\x72\137\146\x65\x65"), "\x66\x75\x6e\x64\137\155\157\x64\x65" => $this->input->post("\146\165\x6e\144\137\x6d\x6f\144\x65"), "\162\x75\x6e\156\151\156\147\137\x68\157\155\145\x5f\x74\145\x78\164" => mb_convert_encoding($this->input->post("\x72\165\156\156\x69\156\147\x5f\x68\x6f\x6d\145\137\x74\x65\170\x74"), "\x48\124\115\x4c\x2d\105\x4e\x54\111\124\x49\105\123", "\125\x54\x46\55\70"), "\155\x61\x78\137\142\151\144\137\141\x6d\x6f\165\x6e\164" => $this->input->post("\155\x61\170\x5f\x62\151\144\137\x61\155\157\165\156\x74"), "\155\141\170\x5f\x77\151\x74\x68\144\162\141\x77" => $this->input->post("\155\141\x78\137\167\x69\164\x68\144\x72\141\x77"), "\x77\151\x74\150\144\x72\141\167\137\x61\154\145\x72\x74\x5f\x6d\145\163\x73\x61\147\x65" => mb_convert_encoding($this->input->post("\167\151\164\150\x64\x72\141\x77\137\x61\x6c\145\x72\164\x5f\155\145\163\163\141\x67\x65"), "\110\x54\115\114\55\105\116\x54\111\x54\111\x45\123", "\125\x54\106\x2d\70"), "\155\x61\x78\137\141\x64\x64\137\x61\155\x6f\x75\x6e\x74" => $this->input->post("\155\141\x78\137\x61\x64\144\x5f\x61\x6d\x6f\x75\x6e\164"), "\167\x69\164\x68\x64\x72\x61\x77\x61\154\x5f\164\x79\160\x65" => $this->input->post("\x77\151\x74\x68\x64\x72\x61\167\x61\154\x5f\x74\171\160\145"), "\141\x64\144\155\157\156\145\171\x5f\x61\x6c\x65\162\x74" => mb_convert_encoding($this->input->post("\141\144\144\x6d\157\x6e\145\x79\x5f\141\154\145\162\x74"), "\110\124\115\114\x2d\x45\116\124\111\x54\x49\x45\x53", "\125\x54\x46\55\70"), "\162\145\x66\x65\162\x5f\143\165\163\164\x6f\155\x5f\x74\x65\170\164" => mb_convert_encoding($this->input->post("\162\x65\146\145\x72\137\x63\x75\x73\164\x6f\155\137\164\145\170\x74"), "\x48\124\x4d\x4c\55\x45\116\124\111\124\x49\105\x53", "\x55\124\x46\55\70"), "\x61\144\144\137\155\x6f\156\145\x79\137\166\x6f\x69\143\145" => $this->input->post("\x61\x64\x64\137\x6d\x6f\156\x65\x79\x5f\166\x6f\151\143\145"), "\167\151\x74\x68\144\162\141\x77\x5f\x73\x65\162\x76\151\143\x65\x5f\164\x61\x78" => $this->input->post("\x77\151\164\x68\x64\162\141\167\137\x73\x65\162\x76\151\143\x65\137\x74\x61\x78"));
        $this->db->where("\x69\144", 1);
        return $this->db->update("\141\x70\160\x5f\x73\x65\164\164\151\x6e\x67", $app);
    }
    public function get_posts($slug = false) {
        if ($slug === false) {
            $query = $this->db->order_by("\x69\x64", "\x44\x45\x53\x43");
            $query = $this->db->get("\160\x6f\x73\164\x73");
            return $query->result_array();
        }
        $query = $this->db->get_where("\160\157\163\x74\x73", array("\x73\x6c\x75\x67" => $slug));
        return $query->row_array();
    }
    public function deletegamedata($id) {
        $this->db->where("\151\144", $id);
        return $this->db->delete("\164\x62\x6c\x67\x61\x6d\145\144\x61\164\141");
    }
    public function del_request($id) {
        $this->db->where("\162\x65\x71\165\x65\163\164\137\x69\144", $id);
        return $this->db->delete("\x74\x62\x6c\x52\145\x71\x75\145\x73\164");
    }
    public function create_post() {
        $slug = url_title($this->input->post("\x74\151\164\154\x65"), "\x64\x61\163\150", true);
        $data = array("\164\151\x74\154\145" => $this->input->post("\164\151\164\154\x65"), "\163\154\x75\147" => $slug, "\x62\157\x64\171" => $this->input->post("\x62\x6f\144\x79"), "\143\x61\x74\145\x67\x6f\162\x79\x5f\x69\x64" => $this->input->post("\x63\141\164\x65\x67\x6f\162\171\137\151\x64"));
        return $this->db->insert("\160\157\x73\164\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", "\x44\x45\x53\103");
        $query = $this->db->get("\x63\141\x74\145\147\157\x72\151\145\163");
        return $query->result_array();
    }
    public function add_user($post_image, $password) {
        $data = array("\x6e\141\x6d\145" => $this->input->post("\x6e\x61\x6d\145"), "\145\155\141\151\154" => $this->input->post("\x65\155\x61\151\154"), "\x70\141\163\163\x77\157\162\x64" => $password, "\x75\163\145\x72\x6e\x61\x6d\145" => $this->input->post("\165\163\x65\162\x6e\141\x6d\145"), "\172\151\160\143\157\x64\145" => $this->input->post("\x7a\x69\x70\143\157\x64\145"), "\143\x6f\156\x74\x61\143\x74" => $this->input->post("\x63\x6f\156\164\x61\x63\164"), "\141\144\x64\162\145\x73\x73" => $this->input->post("\141\x64\x64\x72\x65\163\163"), "\147\145\x6e\x64\145\162" => $this->input->post("\147\x65\156\x64\145\x72"), "\162\157\154\145\137\x69\144" => "\62", "\x73\x74\141\x74\165\163" => $this->input->post("\x73\x74\141\164\165\x73"), "\x64\x6f\x62" => $this->input->post("\x64\x6f\x62"), "\151\x6d\x61\147\x65" => $post_image, "\x70\x61\163\163\167\157\x72\x64" => $password, "\162\145\x67\151\163\164\145\x72\137\x64\141\x74\145" => date("\x59\x2d\x6d\55\144\x20\110\x3a\x69\x3a\163"));
        return $this->db->insert("\165\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("\x75\163\x65\162\x73\56\x69\x64", "\104\x45\123\x43");
            $query = $this->db->get("\x75\163\145\x72\x73");
            return $query->result_array();
        }
        $query = $this->db->get_where("\165\163\145\162\x73", array("\x75\163\145\162\156\141\x6d\x65" => $username));
        return $query->row_array();
    }
    public function enable($id, $table) {
        $data = array("\x73\x74\141\164\165\x73" => 0);
        $this->db->where("\x69\x64", $id);
        return $this->db->update($table, $data);
    }
    public function disable($id, $table) {
        $data = array("\163\x74\141\164\165\x73" => 1);
        $this->db->where("\x69\x64", $id);
        return $this->db->update($table, $data);
    }
    public function get_user($id = false) {
        if ($id === false) {
            $query = $this->db->get("\x75\163\x65\162\x73");
            return $query->result_array();
        }
        $query = $this->db->get_where("\x75\x73\145\162\163", array("\151\144" => $id));
        return $query->row_array();
    }
    public function get_user_profile() {
        $query = $this->db->join("\x74\x62\154\167\x61\154\x6c\x65\x74", "\x75\x73\145\x72\137\160\162\157\146\151\154\x65\56\151\144\x3d\164\142\154\167\141\154\154\x65\x74\x2e\x75\x73\x65\162\x5f\x69\144")->where("\151\x73\x5f\144\x65\x6c\145\x74\145\x64", 0)->order_by("\x74\142\154\167\141\154\154\145\x74\56\165\163\145\162\137\x69\144", "\104\105\x53\x43")->get("\x75\163\x65\x72\137\x70\x72\157\146\x69\154\x65");
        return $query->result_array();
    }
    public function deleteuser($id) {
        $data = array("\151\x73\137\x64\x65\x6c\x65\164\x65\144" => 1, "\155\x6f\x62\x69\154\145\x6e\157" => "\x30");
        $this->db->where("\x69\x64", $id);
        return $this->db->set("\x64\145\154\145\x74\145\144\x5f\x6d\x6f\x62\x69\154\145\x6e\157", "\x6d\x6f\142\151\154\x65\x6e\157", false)->update("\165\x73\145\x72\137\x70\x72\157\x66\151\x6c\x65", $data);
    }
    public function change_status($id, $set_status = 0) {
        $data = array("\154\157\147\x69\x6e\x5f\163\164\141\164\x75\x73" => $set_status);
        $this->db->where("\151\144", $id);
        return $this->db->update("\x75\x73\x65\x72\137\160\162\157\146\x69\x6c\x65", $data);
    }
    public function getGameName($id) {
        $q = "\123\105\x4c\105\x43\124\40\156\141\155\x65\x20\x46\122\x4f\x4d\x20\x74\x62\x6c\147\x61\x6d\145\x20\x57\110\x45\122\105\x20\147\x61\x6d\145\137\x69\144\x3d\47{$id}\47";
        $query = $this->db->query($q)->row_array();
        return $query["\156\141\155\145"];
    }
    public function get_games($mid) {
        $q = "\x53\x45\114\x45\103\124\x20\164\142\154\147\x61\x6d\145\x64\141\x74\x61\56\x67\141\155\x65\137\x69\144\54\156\x61\x6d\145\40\x46\122\x4f\x4d\x20\164\x62\154\147\141\155\x65\x64\141\x74\x61\x20\114\x45\106\x54\40\112\x4f\x49\116\40\x74\142\x6c\x67\x61\155\x65\x20\x4f\116\40\164\142\x6c\147\x61\x6d\145\144\141\164\141\56\x67\x61\155\145\x5f\151\x64\x3d\x74\142\154\147\141\155\145\x2e\147\141\155\145\x5f\x69\x64\x20\12\11\x20\x20\x20\40\127\110\x45\x52\105\x20\x74\x62\x6c\x67\141\x6d\x65\x64\141\164\x61\56\155\141\x74\x6b\141\137\x69\144\75\x27{$mid}\x27\x20\x47\122\x4f\125\x50\x20\x42\131\40\147\x61\155\x65\137\x69\x64";
        $query = $this->db->query($q);
        return $query->result_array();
    }
    public function get_point_lists($mid, $from = '', $to = '') {
        $limit = 0;
        $d = date("\x59\55\155\55\x64");
        if ($from == '') {
            $from = date("\131\55\155\55\144");
        } else {
            $fr = explode("\55", $from);
            $from = date("\131\x2d\155\x2d\144", strtotime($from));
        }
        if ($to == '') {
            $to = date("\131\x2d\x6d\55\144");
        } else {
            $to = date("\131\55\x6d\55\144", strtotime($to));
        }
        $this->db->select("\164\x62\154\x67\141\x6d\145\x64\141\x74\x61\x2e\147\x61\x6d\x65\137\x69\x64\54\40\164\x62\154\x67\x61\x6d\145\x64\141\164\x61\x2e\147\141\x6d\145\x5f\156\x61\155\145\x2c\x74\x62\154\x67\x61\155\145\x64\x61\164\x61\x2e\x64\141\x74\x65\x2c\x20\x74\142\154\x67\141\155\145\x64\141\x74\141\x2e\142\145\x74\x5f\x74\171\160\145\54\x20\x74\142\x6c\x67\x61\x6d\x65\144\141\164\141\56\x64\x69\x67\151\164\x73\54\12\11\40\x20\164\142\x6c\x67\x61\155\x65\x64\141\164\141\56\160\x6f\151\156\164\x73\54\40\165\x73\145\162\x5f\x70\x72\157\x66\151\154\x65\x2e\155\x6f\x62\x69\x6c\145\156\x6f\x2c\x20\x74\142\154\147\141\155\x65\144\x61\x74\141\x2e\142\x73\x5f\147\141\x6d\x65\137\x6e\141\x6d\145");
        $this->db->from("\164\x62\x6c\147\141\155\x65\144\x61\164\x61");
        $this->db->join("\165\x73\145\162\x5f\160\x72\157\x66\x69\154\x65", "\165\x73\145\x72\x5f\160\x72\x6f\x66\151\154\x65\x2e\x69\144\40\75\x20\164\x62\154\x67\141\x6d\145\x64\x61\164\x61\56\x75\x73\x65\x72\x5f\151\144", "\x6c\145\x66\164");
        $this->db->join("\x74\142\154\x67\141\x6d\145", "\x74\x62\x6c\x67\141\155\145\56\x67\x61\x6d\x65\x5f\x69\x64\x20\75\40\x74\142\154\x67\141\x6d\145\x64\x61\164\141\56\147\x61\x6d\145\x5f\151\x64", "\154\x65\146\x74");
        $this->db->where("\164\x62\x6c\147\x61\155\145\144\x61\x74\141\x2e\155\141\x74\153\x61\137\x69\144", $mid);
        $this->db->where("\x74\142\x6c\x67\x61\x6d\x65\x64\x61\x74\141\x2e\x69\144\40\76", $limit);
        $this->db->where("\x44\101\124\x45\50\x74\142\x6c\x67\141\x6d\x65\x64\141\164\141\56\x74\151\x6d\x65\x29\40\102\x45\x54\x57\105\x45\x4e\x20\x27{$from}\x27\x20\101\116\x44\x20\47{$to}\x27");
        $this->db->order_by("\164\142\154\147\141\155\145\144\141\x74\141\x2e\x64\x69\x67\151\x74\x73", "\x61\163\x63");
        return $query = $this->db->get()->result_array();
        $q = "\x53\105\114\x45\103\124\x20\147\x61\155\145\137\151\x64\54\x64\141\164\x65\54\142\145\164\137\x74\171\x70\145\54\144\151\147\x69\x74\x73\54\164\x62\x6c\x67\141\155\x65\x64\x61\x74\x61\x2e\160\x6f\x69\156\x74\x73\54\165\x73\145\162\x5f\x70\162\157\146\151\154\145\x2e\x6d\157\142\151\154\x65\x6e\157\x20\106\122\x4f\x4d\40\164\142\154\x67\141\x6d\x65\x64\141\x74\x61\40\114\x45\106\x54\x20\112\117\x49\x4e\40\165\x73\x65\x72\137\x70\162\x6f\146\151\154\145\40\117\116\40\165\x73\145\x72\x5f\160\162\x6f\146\151\154\145\56\151\144\x3d\164\142\154\x67\141\x6d\x65\144\141\x74\x61\56\165\x73\145\162\x5f\151\144\40\127\110\105\122\105\x20\164\x62\x6c\147\141\155\145\144\x61\164\141\x2e\155\141\164\153\x61\x5f\151\x64\75\47{$mid}\x27\40\141\x6e\x64\x20\x74\142\154\147\141\x6d\145\144\141\x74\x61\56\x69\x64\76" . $limit . "\x20\x61\156\x64\40\x64\141\x74\145\x20\102\x45\124\127\105\105\x4e\40\47{$from}\x27\x20\101\116\x44\x20\x27{$to}\47\x20\x4f\x52\x44\x45\x52\40\x42\131\x20\x64\x61\164\x65\40\104\x45\123\103";
        $query = $this->db->query($q);
        $tbl = $query->result_array();
        $t = array();
        foreach ($tbl as $tb) {
            $gid = $tb["\147\141\x6d\x65\137\x69\144"];
            $bet_type = $tb["\x62\x65\x74\x5f\164\171\160\x65"];
            $digits = $tb["\144\151\147\151\x74\x73"];
            $mobileno = $tb["\155\x6f\x62\151\154\145\156\x6f"];
            $bs_game_name = $tb["\x62\163\137\x67\x61\x6d\x65\137\x6e\x61\155\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\141\164\x65"]][$gid][$bet][$digit])) {
                $t[$tb["\x64\141\164\145"]][$gid][$bet][$digit][$mobileno] = 0;
            }
            $t[$tb["\144\x61\x74\x65"]][$gid][$bet][$digit][$mobileno]+= $tb["\160\157\x69\x6e\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 = "\x53\x45\114\105\x43\x54\x20\x44\x49\x53\x54\111\116\x43\124\x20\165\x73\145\x72\x5f\160\162\x6f\146\151\x6c\145\56\151\144\54\40\165\x73\x65\x72\x5f\160\162\157\146\x69\154\145\x2e\x75\163\x65\162\156\x61\155\145\40\106\x52\x4f\x4d\x20\164\x62\x6c\x67\x61\155\145\144\x61\164\x61\40\x4c\x45\x46\124\40\112\117\111\116\x20\165\163\x65\x72\x5f\160\x72\x6f\x66\x69\x6c\145\40\x4f\x4e\40\x74\142\x6c\x67\x61\155\x65\144\141\x74\141\x2e\x75\163\145\162\137\x69\144\x3d\165\163\x65\x72\137\x70\162\x6f\x66\151\x6c\x65\x2e\151\144\40\x57\x48\105\x52\x45\40\164\142\154\x67\141\x6d\145\x64\x61\x74\141\56\147\x61\x6d\145\x5f\151\144\x3d\47{$id}\x27\x20\141\156\x64\40\x74\x62\x6c\x67\141\155\x65\144\x61\x74\x61\56\155\x61\164\x6b\x61\137\151\144\75\47{$mid}\x27";
        $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\x2f\x6d\x2f\131");
        }
        if ($to == '') {
            $to = date("\x64\57\155\x2f\x59");
        }
        $sel = "\x53\105\114\105\103\124\x20\104\x49\123\124\x49\x4e\x43\x54\x20\x74\142\154\147\x61\155\145\x2e\x6e\141\x6d\145\x2c\x75\x73\x65\x72\137\160\x72\157\x66\x69\x6c\145\56\165\x73\x65\162\x6e\x61\x6d\145\x2c\40\x74\x62\154\147\141\155\145\144\141\164\x61\56\160\x6f\151\x6e\x74\x73\54\x20\x74\x62\x6c\147\141\155\145\x64\x61\164\141\56\x64\x69\147\151\x74\163\x2c\40\x64\x61\164\x65\54\x20\x74\142\x6c\x67\x61\155\145\144\141\x74\141\56\164\x69\x6d\145\x2c\142\x65\164\x5f\x74\171\160\145\x2c\x74\x62\154\147\141\155\145\144\141\x74\141\56\165\163\145\162\137\151\x64\x2c\40\164\x62\154\147\x61\x6d\x65\x64\x61\x74\141\56\x6d\x61\x74\x6b\141\x5f\x69\144\54\164\x62\154\147\141\x6d\145\x64\141\164\x61\56\x67\x61\x6d\x65\137\x69\x64\54\40\x74\142\154\x67\x61\155\145\144\x61\x74\141\56\151\x64\40\146\162\157\155\40\x74\142\154\x67\141\x6d\x65\54\40\165\163\145\162\137\x70\162\x6f\146\x69\x6c\145\54\164\142\154\147\x61\x6d\x65\144\x61\x74\141\40\x77\150\145\x72\145\40\x74\x62\154\147\x61\155\145\x2e\x67\141\x6d\x65\137\x69\x64\75\x27{$game_id}\x27\x20\x61\x6e\x64\40\x74\x62\x6c\147\141\x6d\145\144\x61\x74\141\56\x67\141\x6d\145\137\151\x64\x3d\x27{$game_id}\x27\x20\x61\156\x64\40\165\x73\x65\162\137\151\x64\x3d\165\163\145\162\137\160\162\x6f\x66\151\154\145\x2e\151\x64\40\141\156\x64\40\165\x73\145\x72\137\151\144\x3d\47{$user_id}\x27\40\141\x6e\x64\x20\155\141\164\x6b\x61\137\151\144\x3d\x27{$matka_id}\47\40\141\x6e\x64\40\x64\141\x74\145\x20\x42\105\x54\x57\x45\105\116\40\x27{$from}\47\x20\x41\116\104\x20\x27{$to}\x27\x20\157\162\144\x65\x72\x20\x62\x79\40\164\142\154\147\141\155\x65\144\x61\x74\141\x2e\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\x2f\155\57\131");
        $sel = "\123\105\114\x45\x43\x54\40\164\x62\154\147\141\x6d\x65\x64\141\x74\x61\56\x2a\54\40\155\x61\164\x6b\141\x2e\x6e\x61\x6d\145\40\x61\163\x20\x6d\x61\x74\153\x61\137\156\141\x6d\x65\54\x74\142\x6c\147\x61\x6d\x65\x2e\x6e\x61\x6d\x65\x20\141\x73\40\x67\141\x6d\x65\137\156\141\155\x65\x20\106\122\x4f\x4d\x20\x60\164\x62\154\x67\x61\155\145\144\x61\x74\x61\x60\x20\x4a\x4f\111\x4e\x20\x6d\141\x74\x6b\x61\40\x4f\116\40\x74\x62\x6c\147\x61\x6d\145\144\141\164\141\x2e\155\x61\x74\x6b\141\x5f\151\x64\75\x6d\x61\x74\x6b\x61\x2e\151\x64\x20\x4a\117\x49\x4e\40\164\x62\154\147\x61\x6d\145\40\117\x4e\40\164\142\x6c\x67\x61\x6d\x65\x64\x61\164\141\56\x67\141\x6d\x65\x5f\151\x64\x3d\164\x62\154\147\141\x6d\x65\x2e\147\141\x6d\145\x5f\x69\x64\40\x77\x68\145\x72\145\x20\165\x73\x65\x72\137\x69\x64\x3d\47{$user_id}\x27\40\x26\46\40\x64\x61\164\145\75\47{$dt}\x27\x20\x4f\x52\104\105\x52\x20\102\x59\x20\x74\x62\x6c\x67\x61\155\145\144\x61\164\141\56\151\x64\40\x44\105\x53\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\105\x4c\x45\103\x54\x20\52\40\106\122\117\x4d\40\165\x73\x65\162\137\x70\162\x6f\146\151\154\x65\40\x77\150\x65\162\145\40\x6d\x6f\142\x69\154\x65\156\x6f\x3d\47{$no}\47");
        return $query->result_array();
    }
    public function add_wallet2($id, $wa) {
        $query = $this->db->query("\x55\160\x64\141\164\x65\40\164\142\154\167\x61\154\154\145\164\x20\163\x65\x74\x20\x6d\141\x69\156\x5f\167\x61\154\x6c\145\164\137\160\157\x69\x6e\164\x73\75\155\141\151\x6e\x5f\x77\141\x6c\x6c\x65\164\x5f\x70\157\x69\x6e\x74\x73\53\47{$wa}\47\x20\x77\x68\x65\x72\145\x20\x75\163\x65\162\137\x69\x64\x3d\47{$id}\47");
        if ($query) {
            return true;
        }
    }
    public function update_point_to_winning($id, $wa) {
        $query = $this->db->query("\125\160\144\141\164\x65\40\x74\x62\154\x77\141\x6c\x6c\145\x74\x20\x73\x65\164\40\167\141\x6c\154\145\164\137\x70\157\x69\156\x74\x73\x3d\x77\x61\x6c\x6c\145\164\137\160\157\x69\x6e\x74\x73\53\47{$wa}\47\x20\x77\x68\x65\162\145\x20\x75\x73\145\162\x5f\151\144\x3d\47{$id}\47");
        if ($query) {
            return true;
        }
    }
    public function add_wallet3($id, $wa) {
        $query = $this->db->query("\x49\x6e\163\145\162\x74\40\151\x6e\164\x6f\x20\x74\142\154\167\141\x6c\x6c\145\164\50\x6d\141\151\x6e\137\167\x61\x6c\x6c\x65\164\x5f\x70\157\x69\x6e\x74\163\x2c\165\163\x65\162\x5f\151\x64\x29\40\x76\x61\154\x75\x65\163\50\x27{$wa}\47\x2c\47{$id}\x27\51");
        if ($query) {
            return true;
        }
    }
    public function add_point_to_winning($id, $wa) {
        $query = $this->db->query("\111\x6e\x73\x65\x72\x74\40\x69\x6e\164\x6f\x20\x74\142\154\x77\x61\x6c\154\x65\x74\x28\167\141\x6c\154\x65\x74\137\160\x6f\x69\156\x74\163\54\x75\163\x65\162\137\x69\144\51\40\x76\x61\154\165\x65\163\x28\47{$wa}\x27\x2c\x27{$id}\47\x29");
        if ($query) {
            return true;
        }
    }
    public function check_wallet($id) {
        $query = $this->db->query("\x73\145\x6c\x65\x63\x74\40\52\x20\x66\162\157\155\x20\164\x62\154\167\141\x6c\x6c\145\164\40\x77\x68\x65\x72\x65\40\x75\x73\145\x72\137\x69\x64\x3d\x20\47{$id}\x27");
        return $query->result_array();
    }
    public function check_wallet_amt($id) {
        $query = $this->db->query("\x73\145\154\145\143\x74\40\x77\141\x6c\x6c\145\164\137\x70\157\x69\156\164\x73\x20\141\163\x20\x61\x6d\x74\40\x66\162\x6f\155\x20\164\x62\154\x77\141\154\x6c\x65\x74\x20\x77\x68\x65\x72\x65\x20\x75\163\x65\x72\137\x69\144\75\40\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("\164\x62\x6c\x4e\157\164\x69\146\x69\x63\x61\164\x69\x6f\156", array("\156\x6f\x74\x69\x66\151\x63\141\164\x69\157\x6e" => $notification));
        if ($query) {
            return true;
        }
        return false;
    }
    public function add_point_req_by_admin($points, $user_id) {
        $type = $points > 0 ? "\x41\144\x64" : "\x57\x69\x74\x68\x64\x72\141\167\141\154";
        $insert_query = array("\x72\145\x71\x75\x65\163\x74\x5f\x70\x6f\x69\x6e\x74\163" => $points, "\165\x73\x65\x72\137\x69\x64" => $user_id, "\164\x79\160\x65" => $type, "\x72\x65\x71\165\145\x73\164\x5f\163\x74\x61\x74\165\x73" => "\x61\160\160\162\x6f\x76\x65\x64", "\151\163\x5f\161\162\x63\x6f\x64\x65" => 0);
        $query = $this->db->insert("\164\x62\x6c\x52\145\x71\165\x65\163\164", $insert_query);
        return $query;
    }
    public function add_pointList($form, $to) {
        $this->db->select("\x2a")->from("\x74\x62\x6c\122\x65\161\x75\x65\x73\164")->where("\164\171\160\145", "\101\x64\144");
        $this->db->order_by("\x72\145\x71\165\145\163\164\137\151\x64", "\104\105\x53\x43");
        $this->db->limit(10000);
        $this->db->where("\144\x61\x74\145\x28\164\151\155\145\51\x20\x3e\75", $form);
        $this->db->where("\x64\x61\x74\x65\x28\164\x69\x6d\x65\51\40\x3c\75", $to);
        $query = $this->db->get();
        return $query->result_array();
    }
    public function add_point_req($from, $to) {
        $this->db->cache_off();
        $this->db->select("\x72\x65\x71\x75\145\163\x74\137\151\144\x2c\165\x73\145\162\137\151\144\x2c\x72\x65\x71\x75\x65\163\164\x5f\160\157\151\156\164\163\x2c\x74\151\x6d\145\54\x49\106\x28\x63\x6f\155\x6d\x65\156\x74\x20\41\x3d\x27\x27\54\x63\x6f\x6d\155\145\156\x74\54\47\x4e\57\x61\47\51\x20\141\x73\x20\x63\157\155\x6d\x65\156\x74\x2c\162\145\161\165\x65\x73\x74\x5f\x73\164\x61\x74\165\x73");
        $this->db->where("\x74\171\x70\145", "\x41\144\x64");
        $this->db->where("\104\x41\x54\105\x28\x74\x69\x6d\x65\51\40\102\105\124\127\x45\x45\116\x20\x27{$from}\47\40\x41\116\104\40\47{$to}\x27");
        $query = $this->db->order_by("\x72\145\x71\165\x65\x73\x74\137\151\x64", "\x64\x65\x73\143")->get("\x74\142\154\x52\145\161\165\145\163\164")->result_array();
        return $query;
    }
    public function delete_point_req($req_id) {
        $this->db->where("\162\145\x71\x75\145\163\x74\x5f\x69\144", $req_id);
        $this->db->delete("\164\142\154\122\145\161\x75\x65\163\164");
        return true;
    }
    public function add_point_req2($id) {
        $query = $this->db->query("\123\105\x4c\105\x43\x54\40\52\x20\106\122\117\115\40\x60\164\142\x6c\x52\145\x71\x75\x65\163\x74\140\x20\x77\x68\x65\162\145\x20\x72\x65\x71\165\145\x73\164\137\x69\144\75\x27{$id}\47\x20\141\x6e\144\40\164\x79\160\x65\40\75\40\x27\101\x64\144\x27\40\x61\x6e\144\x20\x72\145\x71\x75\x65\x73\164\x5f\x73\164\x61\164\x75\163\75\47\160\x65\156\x64\151\x6e\147\x27");
        if ($query->num_rows() == 0) {
            return redirect("\x61\x64\x6d\x69\x6e\x2f\141\x64\x64\137\160\157\x69\x6e\164\x5f\162\x65\161");
        } else {
            $query2 = $this->db->query("\125\x50\x44\101\x54\105\x20\140\x74\142\x6c\x52\145\x71\x75\145\163\164\x60\x20\163\x65\164\40\162\145\x71\165\145\163\164\x5f\x73\164\141\x74\x75\x73\75\47\x61\x70\160\162\157\x76\x65\144\47\x20\x77\150\145\x72\x65\40\162\145\161\x75\145\x73\x74\137\x69\144\75\x27{$id}\x27\x20\141\156\144\40\x72\x65\161\x75\145\x73\164\x5f\163\x74\x61\x74\165\163\x3d\47\x70\145\x6e\x64\151\x6e\147\47");
            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($from, $to) {
        $this->db->select("\x72\145\161\x75\x65\163\x74\137\x69\144\54\x75\163\x65\x72\137\x69\144\54\x72\x65\161\165\x65\163\x74\137\x70\157\151\156\164\163\54\164\x69\155\145\x2c\x72\x65\x71\165\145\163\164\137\163\x74\x61\164\165\163\54\x73\145\x72\166\151\x63\145\137\x63\150\141\162\x67\x65");
        $this->db->where("\x44\x41\x54\x45\50\164\151\155\145\51\x20\x42\x45\124\x57\105\x45\x4e\x20\47{$from}\x27\40\x41\x4e\104\x20\47{$to}\x27");
        $query = $this->db->where(array("\164\171\x70\x65" => "\x57\151\164\x68\x64\162\x61\x77\x61\154"))->order_by("\x72\145\161\165\145\163\164\x5f\151\144", "\104\x45\123\103")->get("\164\142\x6c\x52\x65\161\x75\x65\x73\164");
        return $query->result_array();
    }
    public function withdraw_point($form, $to) {
        $this->db->select("\52");
        $this->db->from("\x74\x62\x6c\122\x65\161\165\145\163\164");
        $this->db->where("\164\x79\160\x65", "\x57\151\x74\150\144\x72\141\167\141\154");
        $this->db->order_by("\162\x65\x71\165\145\163\164\x5f\x69\x64", "\x44\105\x53\103");
        $this->db->limit(5000);
        $this->db->where("\144\x61\x74\145\50\164\x69\155\145\51\40\76\x3d\x27{$form}\x27");
        $this->db->where("\144\141\164\145\x28\x74\x69\155\x65\x29\x3c\75\47{$to}\x27");
        $query = $this->db->get();
        return $query->result_array();
    }
    public function withdraw_point_list($request) {
        $cdate = date("\131\x2d\x6d\x2d\x64");
        $min_date = date("\131\55\x6d\x2d\x64", strtotime("\55\x34\40\x64\141\x79\163"));
        $max_date = date("\131\55\155\x2d\144", strtotime("\x2b\x31\x20\x64\x61\x79\163"));
        $nextDate = date("\131\55\x6d\55\144", strtotime("\53\x31\x20\144\141\171", strtotime(date("\x59\x2d\x6d\55\144"))));
        $ctime = date("\110\x3a\x69\72\163", strtotime("\x2b\x33\60\x20\x6d\151\x6e", strtotime(date("\110\72\x69\x3a\x73"))));
        $sport_id = "\x31";
        $search_text = isset($request["\163\145\141\162\x63\x68"]) && !empty($request["\x73\145\x61\162\143\150"]) ? $request["\x73\x65\141\162\143\150"] : '';
        $limit = isset($request["\x6c\x65\x6e\147\164\150"]) && !empty($request["\x6c\x65\156\x67\x74\150"]) ? $request["\x6c\x65\156\147\x74\x68"] : 50;
        $offset = isset($request["\x70\141\147\x65"]) && !empty($request["\x70\x61\147\145"]) ? ($request["\x70\x61\147\x65"] - 1) * $limit : 0;
        $this->db->start_cache();
        if (!empty($search_text)) {
            $this->db->where("\x74\x62\154\122\145\161\x75\145\x73\164\x2e\162\145\x71\165\145\163\164\137\151\x64\x20\x4c\x49\x4b\105\40\x27\x25" . $search_text . "\45\x27");
        }
        $query = $this->db->where(array("\x74\171\x70\145" => "\127\151\164\x68\x64\162\x61\167\x61\154"))->order_by("\162\x65\x71\165\x65\163\x74\137\x69\x64", "\104\x45\x53\103")->limit($limit, $offset)->get("\164\142\x6c\122\145\161\165\145\x73\x74");
        $res = $query->result_array();
        foreach ($res as $row) {
            $user_id = $row["\165\163\145\162\x5f\x69\x64"];
            $r = $this->db->select("\x6e\x61\x6d\145\x2c\x6d\x6f\x62\151\x6c\145\x6e\x6f")->from("\x75\163\x65\162\x5f\x70\162\157\146\151\154\145")->where("\151\144", $user_id)->get()->row();
            print_r($r);
        }
        $this->db->stop_cache();
        $total = $this->db->select("\164\x62\154\x52\145\x71\x75\145\x73\x74\x2e\x72\145\x71\165\x65\x73\x74\x5f\x69\144")->where("\164\171\160\x65", "\127\x69\164\x68\144\162\x61\x77\x61\x6c")->count_all_results();
        $this->db->flush_cache();
        $rdata["\154\x69\x73\164"] = $res;
        $rdata["\x74\x6f\x74\141\x6c\120\x61\147\x65"] = ceil($total / $limit);
        $rdata["\x74\157\x74\x61\x6c\x43\157\165\x6e\x74"] = $total;
        return $rdata;
    }
    public function delete_withdraw_point_req($req_id) {
        $row = $this->db->select("\x75\x73\x65\x72\x5f\x69\x64\54\x53\x55\115\x28\x72\x65\161\165\x65\x73\164\x5f\x70\x6f\151\156\164\163\x2b\163\145\162\x76\151\143\145\x5f\x63\150\141\162\x67\x65\x29\141\x73\x20\160\x6f\151\x6e\x74")->where("\162\145\x71\165\x65\163\x74\x5f\151\144", $req_id)->get("\x74\142\x6c\x52\145\x71\x75\145\163\164")->row() ??NULL;
        if (isset($row)) {
            $this->db->set("\167\141\154\x6c\145\164\x5f\160\x6f\x69\156\x74\x73", "\167\x61\154\x6c\x65\x74\137\160\x6f\151\x6e\x74\163\x20\53\x20" . (double)$row->point, FALSE);
            $this->db->where("\165\x73\145\162\137\151\x64", $row->user_id)->update("\164\x62\154\167\141\154\x6c\x65\164");
            if ($this->db->affected_rows() > 0) {
                $this->db->where("\162\145\x71\x75\145\x73\164\x5f\x69\x64", $req_id)->delete("\x74\142\x6c\122\x65\x71\x75\145\x73\x74");
            }
        }
        return true;
    }
    public function transfer_money_history() {
        $query = $this->db->order_by("\x63\x72\145\141\164\145\x5f\141\x74", "\x44\x45\123\x43")->get("\x74\x62\x6c\164\162\x61\156\x73\146\145\x72\137\162\x65\x71\x75\x65\163\164");
        return $query->result_array();
    }
    public function refer_history() {
        $query = $this->db->order_by("\x63\162\x65\x61\164\145\144\137\141\x74", "\x44\105\123\103")->get("\162\145\x66\x65\x72\137\x68\151\x73\164\157\x72\171");
        return $query->result_array();
    }
    public function withdraw_point_req2($id) {
        $query = $this->db->get_where("\x74\142\x6c\122\x65\161\165\x65\x73\x74", array("\162\x65\x71\x75\145\x73\164\137\x73\164\x61\x74\x75\163" => "\160\x65\x6e\x64\151\x6e\x67", "\x72\145\x71\x75\145\163\x74\137\151\x64" => $id));
        $aa = $query->row_array();
        $amt = 0;
        if (isset($aa)) {
            $amt = - $aa["\x72\145\x71\165\145\163\164\137\160\x6f\x69\x6e\x74\163"];
        }
        if ($this->ch_amt($amt, $aa["\165\163\145\x72\x5f\151\144"]) >= 0) {
            $query2 = $this->db->update("\164\142\x6c\122\x65\161\x75\145\163\164", array("\162\145\161\x75\x65\x73\x74\137\163\x74\x61\x74\165\x73" => "\x61\160\160\162\x6f\166\145\144"), array("\x72\145\161\165\145\163\x74\x5f\151\x64" => $id));
        }
        return $aa;
    }
    public function withdraw_point_req3($id, $points) {
        if ($this->ch_amt($points, $id) >= 0) {
            $query = $this->db->query("\125\x50\x44\x41\x54\105\x20\x74\x62\x6c\167\141\x6c\x6c\x65\x74\x20\163\x65\x74\x20\x77\x61\x6c\154\x65\x74\x5f\160\x6f\x69\156\x74\x73\75\167\x61\x6c\154\145\x74\137\160\x6f\151\156\164\163\55\x27{$points}\x27\x20\167\150\x65\162\x65\40\x75\163\x65\162\137\151\x64\x3d\x27{$id}\47\x20");
        }
        if ($query) {
            return true;
        }
    }
    public function starline() {
        $query = $this->db->query("\x9\x53\x45\114\105\103\x54\x20\52\40\106\122\117\115\x20\140\164\142\154\123\164\x61\162\154\151\x6e\x65\x60");
        return $query->result_array();
    }
    public function starline_update($id) {
        $query = $this->db->query("\123\105\x4c\105\x43\124\40\52\40\x46\122\x4f\115\x20\x60\164\142\x6c\x53\x74\141\162\154\151\156\145\140\x20\167\x68\x65\162\145\40\x69\x64\75\x27{$id}\47\x20");
        return $query->result_array();
    }
    public function starline_update2($id) {
        $snum = trim($this->input->post("\163\156\x75\155"));
        $stime = trim($this->input->post("\x73\164\x69\x6d\145"));
        $snums = explode("\x2d", $snum);
        $data = array("\163\x5f\x67\141\155\x65\x5f\x6e\x75\x6d\142\145\x72" => $snum, "\x73\137\x67\141\155\x65\137\164\x69\x6d\x65" => $stime);
        $query = $this->db->update("\164\142\154\123\x74\x61\162\x6c\x69\x6e\x65", $data, array("\x69\144" => $id));
        $this->update_chart($id, "\x4a\x61\156\x6e\141\164\40\123\164\x61\x72\154\151\x6e\x65", $snums[0], $snums[1]);
        if ($query) {
            return true;
        }
    }
    public function update_user_data($post_image) {
        $data = array("\x6e\x61\155\x65" => $this->input->post("\x6e\x61\155\145"), "\172\x69\x70\x63\x6f\144\x65" => $this->input->post("\x7a\151\x70\x63\157\144\x65"), "\143\x6f\x6e\164\141\143\x74" => $this->input->post("\x63\x6f\156\164\141\x63\164"), "\x61\x64\x64\162\145\163\163" => $this->input->post("\141\144\144\162\145\x73\163"), "\x67\x65\156\x64\145\x72" => $this->input->post("\147\x65\156\x64\145\x72"), "\x73\x74\141\164\165\163" => $this->input->post("\163\164\141\x74\x75\163"), "\x64\157\142" => $this->input->post("\144\157\x62"), "\151\155\x61\x67\x65" => $post_image, "\162\145\147\x69\163\164\x65\x72\x5f\144\x61\164\x65" => date("\131\x2d\x6d\x2d\x64\40\110\72\x69\x3a\x73"));
        $this->db->where("\x69\144", $this->input->post("\151\144"));
        $d = $this->db->update("\165\163\145\162\163", $data);
    }
    public function get_siteconfiguration($id = false) {
        if ($id === false) {
            $query = $this->db->get("\x73\x69\x74\x65\137\x63\157\156\x66\x69\x67");
            return $query->result_array();
        }
        $query = $this->db->get_where("\163\x69\164\145\137\143\157\x6e\146\151\147", array("\x69\x64" => $id));
        return $query->row_array();
    }
    public function update_siteconfiguration($id = false) {
        if ($id === false) {
            $query = $this->db->get("\x73\x69\x74\145\x5f\143\x6f\x6e\146\151\147");
            return $query->result_array();
        }
        $query = $this->db->get_where("\163\x69\x74\145\x5f\x63\157\156\146\151\x67", array("\x69\x64" => $id));
        return $query->row_array();
    }
    public function update_siteconfiguration_data($post_image) {
        $data = array("\163\151\x74\145\137\x74\x69\164\154\x65" => $this->input->post("\163\151\x74\145\137\x74\x69\x74\154\145"), "\163\151\x74\x65\x5f\156\141\155\x65" => $this->input->post("\163\x69\164\145\x5f\x6e\141\155\145"), "\x6c\157\x67\157\x5f\151\155\147" => $post_image);
        $this->db->where("\x69\144", $this->input->post("\151\x64"));
        return $this->db->update("\163\151\164\145\x5f\x63\157\156\x66\151\x67", $data);
    }
    public function get_mobile_data() {
        $query = $this->db->get("\x73\151\x74\x65\137\143\157\x6e\146\x69\x67");
        return $query->row_array();
    }
    public function update_mobile_data() {
        $data = array("\x6d\157\142\x69\154\x65" => $this->input->post("\x6d\157\x62\151\154\145"));
        return $this->db->update("\163\151\164\145\137\143\x6f\156\146\151\147", $data);
    }
    public function create_slider($post_image) {
        $data = array("\x74\x69\164\154\x65" => $this->input->post("\x74\x69\164\x6c\x65"), "\x69\155\x61\x67\x65" => $post_image, "\144\x65\x73\143\x72\151\x70\164\151\157\156" => $this->input->post("\x64\x65\163\143\x72\x69\x70\164\x69\157\x6e"), "\163\164\x61\x74\x75\163" => $this->input->post("\x73\164\x61\x74\x75\x73"));
        return $this->db->insert("\163\154\151\x64\x65\x72\163\137\x69\155\147", $data);
    }
    public function get_sliders($id = false) {
        if ($id === false) {
            $query = $this->db->get("\x73\x6c\x69\144\x65\x72\x73\137\151\155\x67");
            return $query->result_array();
        }
        $query = $this->db->get_where("\163\x6c\x69\144\x65\162\163\137\151\155\147", array("\x69\144" => $id));
        return $query->row_array();
    }
    public function get_slider_data($id = false) {
        if ($id === false) {
            $query = $this->db->get("\x73\154\x69\144\x65\x72\x73\137\x69\155\147");
            return $query->result_array();
        }
        $query = $this->db->get_where("\x73\x6c\151\144\145\x72\x73\137\x69\x6d\147", array("\151\144" => $id));
        return $query->row_array();
    }
    public function update_slider_data($post_image) {
        $data = array("\x74\151\x74\154\x65" => $this->input->post("\x74\x69\164\x6c\x65"), "\151\155\x61\147\x65" => $post_image, "\x64\145\x73\x63\162\151\160\164\x69\157\x6e" => $this->input->post("\144\145\163\143\x72\x69\160\x74\x69\x6f\156"), "\x73\164\141\164\x75\163" => $this->input->post("\x73\x74\141\164\165\163"));
        $this->db->where("\x69\144", $this->input->post("\151\x64"));
        return $this->db->update("\x73\154\x69\x64\x65\162\x73\137\x69\155\147", $data);
    }
    public function getChart() {
        return $this->db->get("\143\150\141\x72\164\163")->result_array();
    }
    public function getChartDetails($name) {
        return $this->db->where("\156\x61\x6d\x65", $name)->get("\143\150\x61\162\x74\163")->result_array();
    }
    public function update_chart_data() {
        $snum = $this->input->post("\163\156\165\x6d");
        $enum = $this->input->post("\x65\156\165\155");
        $data = array("\x6e\x61\x6d\145" => $this->input->post("\x6e\x61\155\145"), "\x64\141\164\x65" => $this->input->post("\x64\x61\x74\x65"), "\163\164\141\162\x74\151\x6e\147\137\x6e\x75\155" => !empty($snum) ? $snum : null, "\x72\145\x73\165\154\x74\x5f\x6e\x75\x6d" => $this->input->post("\x6e\x75\155"), "\x65\x6e\x64\137\156\x75\x6d" => !empty($enum) ? $enum : null);
        $this->db->where("\x6e\x61\x6d\x65", $this->input->post("\156\x61\155\145") and "\144\141\164\145", $this->input->post("\144\x61\164\x65"));
        return $this->db->update("\x63\150\x61\162\164\163", $data);
    }
    public function add_chart_data() {
        $snum = $this->input->post("\163\x6e\x75\155");
        $enum = $this->input->post("\x65\x6e\165\155");
        $data = array("\156\x61\x6d\145" => $this->input->post("\143\150\x61\162\164"), "\x64\x61\164\145" => $this->input->post("\x64\x61\164\145"), "\163\164\141\x72\x74\151\x6e\147\x5f\156\165\155" => !empty($snum) ? $snum : null, "\x72\145\163\165\x6c\x74\137\156\x75\155" => $this->input->post("\156\x75\x6d"), "\145\x6e\x64\137\x6e\x75\x6d" => !empty($enum) ? $enum : null);
        return $this->db->insert("\x63\150\x61\162\x74\163", $data);
    }
    public function getUserDetails() {
        return $this->db->get("\165\163\x65\162\163")->result_array();
    }
    public function getMatkaDetails() {
        return $this->db->get("\155\x61\164\x6b\x61")->result_array();
    }
    public function get_total_users() {
        return $this->db->where("\151\163\137\144\145\154\145\x74\145\144\x20\75\x21", "\x31")->get("\x75\x73\x65\x72\x5f\160\162\x6f\146\151\x6c\x65")->num_rows();
    }
    public function create_matka($team_image) {
        $snum = $this->input->post("\163\156\165\155");
        $enum = $this->input->post("\x65\x6e\165\155");
        $name = $this->input->post("\x6e\141\x6d\x65");
        $query = $this->db->get_where("\x6d\x61\164\153\x61", array("\x6e\141\155\x65" => $name));
        $count = $query->num_rows();
        if ($count === 0) {
            $data = array("\156\x61\155\x65" => $this->input->post("\156\141\155\x65"), "\163\164\141\x72\x74\137\164\x69\155\x65" => $this->input->post("\x73\164\x69\155\x65"), "\x65\x6e\144\x5f\164\x69\155\x65" => $this->input->post("\145\164\151\x6d\x65"), "\x73\164\x61\x72\x74\x69\156\x67\x5f\x6e\165\155" => !empty($snum) ? $snum : null, "\156\165\155\142\x65\x72" => $this->input->post("\x6e\165\155"), "\145\x6e\x64\137\x6e\x75\155" => !empty($enum) ? $enum : null, "\x62\x69\x64\x5f\x73\x74\x61\x72\x74\x5f\x74\151\x6d\145" => $this->input->post("\146\163\x74\151\x6d\145"), "\142\151\x64\137\x65\x6e\x64\137\x74\x69\x6d\145" => $this->input->post("\x66\x65\x74\151\155\145"));
            $data1 = array("\x6e\x61\x6d\145" => $this->input->post("\156\x61\x6d\x65"), "\144\141\164\145" => date("\x59\55\x6d\x2d\x64"), "\x73\x74\x61\x72\x74\151\156\x67\x5f\x6e\x75\x6d" => $this->input->post("\163\156\165\x6d"), "\162\x65\163\165\154\x74\137\156\x75\155" => $this->input->post("\156\x75\x6d"), "\145\156\x64\x5f\156\x75\155" => $this->input->post("\145\x6e\x75\155"));
            $this->session->set_flashdata("\163\x75\143\143\x65\x73\x73", "\131\x6f\x75\x72\x20\x6d\141\x74\153\141\x20\150\141\163\x20\142\145\145\156\40\x63\x72\x65\141\x74\x65\x64\x2e");
            $this->db->insert("\x6d\141\x74\x6b\141", $data);
            $this->db->insert("\x63\x68\141\162\164\x73", $data1);
            $ref = "\154\x69\163\x74";
        } else {
            $ref = "\141\x64\144";
            $this->session->set_flashdata("\146\x61\x69\x6c", "\116\x61\155\145\x20\x61\154\162\x65\x61\x64\171\40\x45\x78\151\163\x74\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("\x2a\54\x49\x46\50\x69\163\137\150\x6f\155\x65\160\x61\147\x65\137\x67\x61\155\145\x20\75\40\x31\54\40\x43\117\116\103\x41\124\x28\163\164\x61\x72\164\151\156\x67\x5f\x6e\x75\x6d\54\x20\47\x20\x58\40\x27\x2c\40\145\x6e\144\137\x6e\165\x6d\x29\54\x6e\x75\x6d\x62\145\162\51\40\x41\x53\x20\162\x65\163\165\154\x74");
            $this->db->order_by("\155\141\x74\x6b\141\56\x6d\x61\164\153\x61\137\x6f\162\144\x65\x72", "\101\123\x43");
            $query = $this->db->get("\x6d\x61\164\153\x61");
            return $query->result_array();
        }
        $this->db->select("\155\x61\164\x6b\x61\56\x2a\x2c\164\x62\154\x4e\157\164\x69\143\x65\56\162\141\x74\x65\x20\141\x73\x20\155\141\162\x6b\x65\x74\x5f\162\x61\x74\x65");
        $this->db->where("\155\141\x74\153\x61\56\x69\x64", $teamId)->from("\155\x61\164\x6b\x61");
        $this->db->join("\x74\142\154\116\157\x74\151\143\x65", "\164\x62\154\x4e\157\164\x69\x63\x65\x2e\x69\x64\40\75\40\155\141\164\153\x61\x2e\x69\144", "\154\x65\146\x74");
        return $query = $this->db->get()->row_array();
    }
    public function memberlistteams($id) {
        $this->db->order_by("\155\141\164\x6b\x61\56\151\144", "\x44\x45\123\x43");
        return $query->result_array();
    }
    public function update_team_data() {
        $c = 0;
        $snum = $this->input->post("\x73\x6e\165\155") ??NULL;
        $enum = $this->input->post("\x65\x6e\165\155") ??NULL;
        $num = $this->input->post("\156\165\155") ??NULL;
        $id = $this->input->post("\x69\x64");
        $name = $this->input->post("\x6e\141\x6d\x65");
        $date = $this->input->post("\x75\x64\141\x74\x65");
        $data = array("\x6e\141\x6d\145" => $name, "\x73\164\141\162\x74\x69\156\147\x5f\156\x75\x6d" => !empty($snum) ? $snum : null, "\156\165\155\142\x65\162" => !empty($num) ? $num : null, "\145\156\x64\x5f\156\165\155" => !empty($enum) ? $enum : null, "\142\151\144\137\163\x74\141\x72\x74\x5f\164\x69\x6d\x65" => $this->input->post("\146\163\x74\x69\x6d\x65"), "\x62\x69\x64\137\x65\x6e\144\x5f\164\151\155\145" => $this->input->post("\x66\x65\x74\x69\155\x65"), "\x73\x74\141\x72\164\x5f\164\x69\155\x65" => $this->input->post("\146\163\x74\x69\x6d\x65"), "\145\156\144\137\x74\151\155\x65" => $this->input->post("\146\145\x74\x69\x6d\145"), "\x73\141\x74\137\163\164\141\x72\x74\x5f\x74\151\x6d\x65" => $this->input->post("\x66\163\x74\x69\155\145"), "\x6d\141\164\153\x61\x5f\162\x61\x74\145" => $this->input->post("\155\x61\164\153\141\x5f\x72\141\x74\145"), "\x73\x61\164\x5f\145\x6e\144\x5f\164\x69\x6d\145" => $this->input->post("\x66\145\x74\151\155\145"));
        $this->db->where("\x69\144", $id);
        $this->db->update("\x6d\x61\x74\x6b\141", $data);
        $home_page_game = $this->db->select("\151\x73\x5f\150\157\155\145\160\141\147\x65\x5f\x67\141\155\145")->where("\151\x64", $id)->get("\x6d\141\164\153\x61")->row()->is_homepage_game??0;
        if ($home_page_game == 1) {
            if (!empty($snum) && !empty($enum)) {
                $this->update_chart($id, $name, $snum, $num, $enum, $date);
            }
        } else {
            if (!empty($num)) {
                $this->update_chart($id, $name, $snum, $num, $enum, $date);
            }
        }
        return;
    }
    public function update_chart($id, $name, $snum = null, $num, $enum = null, $date = null) {
        $dt = $date == null ? date("\131\55\155\x2d\144") : $date;
        $data1 = array("\156\141\155\x65" => $name, "\143\151\x64" => $id, "\x64\141\164\145" => $dt, "\x73\x74\x61\162\x74\151\156\x67\x5f\x6e\x75\155" => !empty($snum) ? $snum : null, "\162\145\163\165\154\164\x5f\x6e\x75\155" => $num, "\145\156\144\x5f\156\165\155" => !empty($enum) ? $enum : null);
        $where = array("\143\151\144" => $id, "\x64\x61\164\145" => $dt);
        $data2 = $this->db->select("\103\x4f\x55\116\124\x28\x69\144\x29\40\141\x73\x20\143\157\x75\x6e\x74\x65\x72")->where($where)->get("\x63\x68\x61\162\x74\x73")->row();
        if ($data2->counter > 0) {
            $this->db->where($where);
            $this->db->update("\x63\150\x61\x72\164\x73", $data1);
        } else {
            $this->db->insert("\x63\150\x61\x72\164\x73", $data1);
        }
        if (!empty($snum) && !empty($enum)) {
            $message = $snum . "\x20\130\40" . $enum;
        } elseif (!empty($snum) && empty($enum)) {
            $message = $snum;
        } elseif (empty($snum) && !empty($enum)) {
            $message = $enum;
        } else {
            $message = $num;
        }
        @sendPushNotification("\x6f\x6e\x6c\x69\156\x65\x5f\x74\x65\145\x72\137\x62\141\172\141\x72", $name, $message, 2);
        return true;
    }
    public function get_admin_data() {
        $id = $this->session->userdata("\165\163\145\x72\x5f\x69\144");
        if ($id === false) {
            $query = $this->db->get("\x75\163\x65\x72\163");
            return $query->result_array();
        }
        $query = $this->db->get_where("\x75\163\x65\162\163", array("\151\x64" => $id));
        return $query->row_array();
    }
    public function change_password($new_password) {
        $data = array("\x70\x61\x73\163\x77\x6f\162\144" => md5($new_password));
        $this->db->where("\151\x64", $this->session->userdata("\165\x73\x65\162\137\151\144"));
        return $this->db->update("\165\163\145\x72\163", $data);
    }
    public function match_old_password($password) {
        $id = $this->session->userdata("\x75\163\x65\162\137\x69\144");
        if ($id === false) {
            $query = $this->db->get("\165\163\x65\x72\x73");
            return $query->result_array();
        }
        $query = $this->db->get_where("\x75\163\145\x72\x73", array("\x70\x61\163\163\x77\x6f\x72\x64" => $password));
        return $query->row_array();
    }
    public function email_exists() {
        $email = $this->input->post("\145\x6d\141\x69\154");
        $query = $this->db->query("\x53\105\x4c\x45\103\x54\x20\x65\x6d\x61\x69\154\x2c\40\x70\x61\x73\163\167\x6f\x72\x64\40\106\122\x4f\115\x20\x75\x73\145\162\163\x20\x57\110\x45\x52\105\x20\145\155\x61\x69\154\75\47{$email}\x27");
        if ($row = $query->row()) {
            return true;
        } else {
            return false;
        }
    }
    public function temp_reset_password($temp_pass) {
        $data = array("\x65\x6d\x61\x69\154" => $this->input->post("\145\155\141\151\x6c"), "\x72\145\163\x65\164\x5f\x70\141\x73\163" => $temp_pass);
        $email = $data["\145\x6d\x61\151\x6c"];
        if ($data) {
            $this->db->where("\145\x6d\141\151\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("\x72\x65\163\145\164\137\x70\141\x73\x73", $temp_pass);
        $query = $this->db->get("\165\163\x65\162\163");
        if ($query->num_rows() == 1) {
            return true;
        } else {
            return false;
        }
    }
    public function deletepackage($id) {
        $data = array("\163\164\141\x74\x75\x73" => 2);
        $this->db->where("\x69\x64", $id);
        return $this->db->update("\x70\x61\143\x6b\141\147\145", $data);
    }
    public function add_wallet_4($id, $wa, $wallet = '') {
        if ($wallet != '') {
            if ($wallet == "\167\x61\x6c\x6c\145\x74\x5f\x70\x6f\151\x6e\x74\163") {
                $query = $this->db->query("\125\160\x64\x61\x74\x65\x20\164\142\154\167\141\x6c\x6c\145\164\40\x73\145\164\x20\x77\141\154\154\145\x74\x5f\160\157\151\156\164\x73\x3d\x77\141\154\154\145\x74\137\x70\157\x69\156\x74\163\53\47{$wa}\47\40\167\150\145\162\145\40\x75\x73\x65\162\x5f\x69\144\x3d\47{$id}\47");
            } else {
                $query = $this->db->query("\x55\160\x64\x61\164\145\x20\x74\142\154\x77\141\154\x6c\145\x74\40\163\145\x74\x20\x6d\x61\x69\156\137\167\141\154\x6c\145\x74\x5f\x70\x6f\x69\156\x74\x73\75\155\x61\x69\x6e\137\x77\x61\154\154\x65\x74\137\160\x6f\x69\156\x74\x73\x2b\47{$wa}\47\x20\x77\150\x65\162\x65\x20\165\x73\145\162\x5f\x69\x64\x3d\47{$id}\x27");
            }
        } else {
            $query = $this->db->query("\x55\160\x64\x61\x74\x65\40\x74\x62\154\x77\x61\154\154\145\x74\40\163\x65\164\x20\155\x61\x69\156\x5f\x77\141\x6c\154\x65\x74\137\160\x6f\151\156\x74\x73\75\155\141\151\x6e\137\167\141\x6c\154\145\164\x5f\x70\x6f\151\x6e\164\x73\53\47{$wa}\47\x20\167\x68\x65\x72\x65\40\x75\163\145\x72\x5f\x69\x64\x3d\x27{$id}\x27");
        }
        if ($query) {
            return true;
        }
    }
    public function add_MarketData($data) {
        $data = $this->db->insert("\155\141\x74\153\x61", $data);
        return $data;
    }
    public function inactiveUserList() {
        $now = date("\x59\x2d\x6d\55\x64");
        $date = date("\x59\x2d\x6d\55\x64", strtotime("\55\62\40\x6d\x6f\x6e\164\150\163"));
        $request_data = $this->db->select("\165\163\x65\162\x5f\x69\144")->where("\144\141\164\x65\x28\x74\151\x6d\x65\51\76\x3d", $date)->group_by("\x75\x73\x65\162\137\x69\144")->order_by("\165\x73\x65\x72\x5f\151\144", "\x44\105\x53\x43")->get("\x74\x62\154\122\145\161\165\x65\163\164")->result();
        $request_id = count($request_data) > 0 ? array_column($request_data, "\x75\x73\x65\162\x5f\151\x64") : array();
        $game_data = $this->db->select("\x75\x73\145\162\137\x69\x64")->where("\x64\141\164\145\50\164\x69\x6d\145\x29\76\x3d", $date)->group_by("\x75\163\145\x72\x5f\151\144")->order_by("\165\163\145\162\x5f\151\144", "\104\105\x53\x43")->get("\164\x62\154\x67\x61\155\145\144\141\x74\141")->result();
        $game_id = count($game_data) > 0 ? array_column($game_data, "\165\x73\145\x72\137\151\x64") : array();
        $inactive_user = array_unique(array_merge($request_id, $game_id));
        if (!empty($inactive_user)) {
            $this->db->where_not_in("\x69\144", $inactive_user);
        }
        $user_data = $this->db->select("\x75\56\x6e\x61\155\x65\x2c\x75\56\x75\163\x65\x72\156\x61\x6d\x65\x2c\x75\56\x6d\157\142\x69\x6c\x65\156\157\x2c\165\56\145\155\x61\x69\x6c\54\x75\x2e\x61\144\x64\162\145\x73\x73\x2c\165\56\160\141\163\x73\167\157\x72\144\54\164\x2e\x77\141\x6c\154\145\164\x5f\x70\157\x69\x6e\164\163\x2c\164\56\155\141\x69\156\137\167\x61\154\154\145\x74\x5f\160\157\151\x6e\x74\x73")->from("\165\163\145\162\137\160\x72\x6f\x66\x69\x6c\145\x20\165")->join("\164\x62\154\167\141\154\x6c\145\164\40\164", "\165\56\x69\144\75\x74\x2e\165\163\x65\x72\x5f\x69\x64")->get()->result();
        return $user_data;
    }
    public function change_status_userlist($id, $set_status = 0) {
        $data = array("\x6c\157\x67\151\156\x5f\163\164\141\164\x75\x73" => $set_status);
        $this->db->where("\151\144", $id);
        return $this->db->update("\x75\x73\x65\162\137\x70\x72\x6f\x66\x69\154\x65", $data);
    }
    public function deleteuserlist($id) {
        $data = array("\x69\x73\x5f\x64\x65\154\145\x74\145\x64" => 1, "\x6d\x6f\142\151\154\x65\156\x6f" => "\x30");
        $this->db->where("\151\x64", $id);
        return $this->db->set("\144\145\154\145\x74\x65\144\x5f\x6d\x6f\x62\151\x6c\x65\x6e\x6f", "\x6d\x6f\x62\x69\154\145\x6e\157", false)->update("\x75\163\145\x72\137\160\162\x6f\146\151\x6c\145", $data);
    }
    public function user_registered($date) {
        $query = $this->db->query("\x53\x45\x4c\105\103\x54\40\x2a\x20\x46\122\x4f\115\40\x60\165\x73\x65\162\137\160\162\157\146\151\154\x65\140\x20\x57\x48\x45\x52\x45\40\104\x41\x54\105\x28\x60\164\151\x6d\x65\x60\x29\40\75\x20\x27{$date}\x27\40\141\156\144\x20\151\163\x5f\144\x65\x6c\x65\x74\145\x64\40\41\x3d\47\x31\x27");
        return $query->num_rows();
    }
    public function this_week_user_registered() {
        $d = strtotime("\x74\x6f\x64\141\x79");
        $start_week = strtotime("\154\141\x73\164\x20\x73\165\156\x64\x61\171\x20\x6d\x69\x64\x6e\x69\x67\x68\x74", $d);
        $end_week = strtotime("\156\x65\170\164\x20\x73\141\x74\165\x72\144\x61\x79", $d);
        $start = date("\131\x2d\x6d\55\x64", $start_week);
        $end = date("\131\x2d\155\x2d\x64", $end_week);
        $query = $this->db->query("\x53\x45\114\105\x43\x54\x20\52\40\x46\x52\117\x4d\40\140\165\x73\x65\162\x5f\x70\x72\x6f\x66\151\154\x65\140\40\x57\x48\x45\x52\x45\x20\x44\101\x54\x45\x28\x60\164\151\155\x65\x60\x29\x20\x3e\75\40\x27{$start}\x27\40\x41\116\x44\40\104\101\124\x45\50\x60\x74\151\x6d\145\x60\51\x20\74\75\x20\47{$end}\47\40\x61\156\144\x20\151\163\x5f\144\145\154\x65\x74\145\x64\x20\41\75\x27\61\47");
        return $query->num_rows();
    }
    public function last_week_user_registered() {
        $previous_week = strtotime("\55\x31\x20\x77\145\x65\x6b\40\53\x31\x20\x64\141\x79");
        $start_week = strtotime("\154\141\163\164\40\163\x75\x6e\144\x61\171\x20\155\x69\x64\x6e\151\147\x68\x74", $previous_week);
        $end_week = strtotime("\156\x65\x78\164\40\163\141\x74\x75\162\x64\x61\171", $start_week);
        $start_week = date("\131\x2d\x6d\55\x64", $start_week);
        $end_week = date("\x59\55\x6d\55\x64", $end_week);
        $query = $this->db->query("\123\x45\x4c\105\103\124\x20\52\x20\106\x52\x4f\x4d\40\x60\165\x73\x65\x72\x5f\x70\x72\x6f\x66\151\x6c\x65\x60\40\127\110\105\122\x45\40\x44\x41\x54\x45\50\x60\164\x69\x6d\145\140\x29\40\76\75\40\x27{$start_week}\x27\40\x41\116\104\40\x44\x41\x54\x45\50\x60\x74\x69\155\x65\140\51\40\74\75\40\x27{$end_week}\x27\40\x61\x6e\144\40\151\x73\x5f\x64\145\154\145\164\x65\x64\40\x21\75\47\61\x27");
        return $query->num_rows();
    }
    public function current_month_user_registered() {
        $first = date("\131\55\155\55\x30\x31");
        $last = date("\x59\55\x6d\55\x64");
        $query = $this->db->query("\123\x45\x4c\105\103\x54\x20\52\x20\x46\122\x4f\x4d\x20\140\165\x73\145\162\x5f\x70\162\x6f\146\151\x6c\x65\140\x20\127\x48\105\122\105\40\104\x41\124\x45\50\x60\x74\151\155\x65\x60\x29\x20\x3e\75\x20\47{$first}\47\x20\101\x4e\x44\x20\x44\101\x54\105\50\140\164\151\x6d\x65\x60\x29\x20\x3c\75\x20\47{$last}\x27\x20\x61\x6e\x64\40\x69\163\137\144\x65\x6c\x65\164\145\144\x20\41\75\x27\x31\47");
        return $query->num_rows();
    }
    public function last_month_user_registered() {
        $first = date("\x59\55\155\55\x64", strtotime("\x66\151\x72\x73\164\40\144\x61\171\40\157\x66\40\160\x72\145\x76\151\x6f\x75\163\x20\x6d\157\156\x74\150"));
        $last = date("\131\55\155\55\144", strtotime("\154\141\163\164\40\144\141\x79\40\x6f\146\40\x70\162\145\166\151\157\165\x73\40\x6d\x6f\156\x74\x68"));
        $query = $this->db->query("\123\105\114\x45\103\x54\x20\x2a\40\106\x52\117\x4d\40\x60\x75\x73\145\x72\x5f\x70\x72\157\146\151\154\145\x60\40\127\x48\105\x52\x45\40\104\101\124\105\x28\140\164\x69\x6d\x65\x60\x29\x20\76\75\x20\x27{$first}\47\40\x41\x4e\x44\40\104\101\124\105\50\x60\x74\151\155\x65\x60\51\40\74\x3d\40\x27{$last}\x27\40\x61\x6e\x64\x20\x69\x73\137\144\145\154\145\x74\x65\x64\x20\41\75\47\61\x27");
        return $query->num_rows();
    }
    public function logged_in_users() {
        $query = $this->db->query("\x73\145\154\x65\x63\x74\40\x63\x6f\x75\x6e\x74\50\151\163\137\x6c\x6f\x67\151\x6e\x29\x20\141\x73\40\154\157\157\147\145\144\151\156\x75\163\x65\162\x73\40\x66\x72\157\x6d\x20\165\163\x65\162\x5f\160\162\157\146\x69\x6c\x65\x20\x77\150\x65\x72\145\40\x69\x73\x5f\154\157\147\x69\x6e\40\75\x20\x27\61\47\x20");
        return $a = $query->row()->loogedinusers??0;
    }
    public function zero_balance_users() {
        $query = $this->db->query("\x73\145\154\x65\x63\x74\40\143\157\165\x6e\164\50\x77\x61\154\154\x65\164\x5f\151\x64\x29\x20\141\163\40\x7a\x65\162\x6f\x5f\x62\141\154\x61\156\x63\x65\x5f\x75\163\145\x72\x20\x66\x72\x6f\155\x20\164\142\154\167\x61\154\x6c\145\x74\x20\167\150\145\162\145\40\x77\x61\154\x6c\145\x74\137\160\157\x69\x6e\x74\163\40\75\40\47\60\x27\40");
        $a = $query->row();
        if ($a != '') {
            return $query->row()->zero_balance_user;
        } else {
            return 0;
        }
    }
    public function today_zero_balance_users() {
        return $query = $this->db->where("\167\141\154\154\x65\164\137\160\x6f\151\156\164\x73", 0)->where("\x44\x41\124\x45\x28\x75\x70\x64\x61\x74\x65\x64\x5f\141\x74\51", date("\131\55\x6d\55\144"))->get("\x74\142\154\x77\141\154\x6c\145\x74")->num_rows();
    }
    public function banned_users() {
        $query = $this->db->query("\163\145\154\x65\x63\x74\x20\143\157\165\x6e\x74\50\154\157\147\x69\x6e\137\163\x74\x61\164\165\x73\51\x20\141\x73\40\x62\x61\x6e\156\x65\144\137\x75\x73\x65\x72\163\40\146\162\x6f\155\40\165\163\145\x72\137\x70\x72\157\x66\x69\154\x65\x20\x77\x68\145\x72\145\40\154\x6f\147\151\156\x5f\163\x74\141\164\x75\163\x20\75\x20\47\61\47\40");
        return $query->row()->banned_users??0;
    }
    public function total_deposited_amount() {
        $last_date = date("\131\55\155\55\144\x20\60\x30\x3a\x30\x30\x3a\x30\61");
        $query = $this->db->query("\x73\x65\x6c\x65\x63\164\x20\x69\146\50\x53\125\115\x28\162\145\x71\165\x65\163\x74\137\x70\157\151\x6e\x74\163\51\x20\151\163\40\x6e\x75\154\x6c\54\x30\54\x53\125\x4d\50\x72\x65\x71\x75\145\163\164\x5f\x70\157\x69\156\x74\x73\x29\x29\x20\141\x73\40\x64\145\x70\157\x73\x69\x74\x5f\x61\155\157\165\x6e\x74\40\12\40\40\40\x20\40\x20\40\x20\x20\40\x20\x20\x66\162\x6f\x6d\x20\x74\x62\x6c\122\145\x71\165\x65\163\164\x20\x77\150\x65\162\x65\x20\164\171\x70\x65\75\x27\x41\x64\144\47\x20\x61\156\x64\x20\x74\151\x6d\145\40\x3e\x3d\40\47{$last_date}\x27");
        $a = $query->row();
        if ($a != '') {
            return $query->row()->deposit_amount;
        } else {
            return 0;
        }
    }
    public function total_withdraw_amount() {
        $query = $this->db->query("\163\x65\154\x65\x63\x74\x20\x69\x66\x28\x53\x55\x4d\x28\x72\145\x71\x75\x65\x73\164\x5f\160\x6f\x69\156\164\163\51\x20\x69\x73\40\156\165\x6c\x6c\x2c\60\54\123\x55\115\50\162\145\x71\165\145\163\x74\x5f\160\x6f\151\x6e\164\x73\x29\51\40\141\x73\x20\x77\151\164\x68\144\x72\x61\x77\154\x5f\141\x6d\x6f\x75\x6e\x74\x20\x66\x72\x6f\x6d\40\x74\x62\154\x52\x65\x71\x75\x65\x73\164\x20\167\150\x65\x72\145\40\164\x79\x70\x65\75\47\127\x69\x74\x68\144\x72\141\167\x61\x6c\x27\x20\x61\156\x64\x20\162\x65\161\165\x65\x73\164\137\163\x74\x61\x74\x75\x73\75\47\141\160\160\162\x6f\166\145\144\x27\x20\141\x6e\x64\40\x74\x69\x6d\x65\x20\x3e\75\x20\x27{$this->last_date}\47");
        $a = $query->row();
        if ($a != '') {
            return $query->row()->withdrawl_amount;
        } else {
            return 0;
        }
    }
    public function yesterday_wallet_balance() {
        $yesterday = date("\x59\55\x6d\55\x64", strtotime("\55\x31\x20\144\141\x79"));
        $wallet_amt = $this->db->query("\x73\145\x6c\x65\143\164\40\123\x55\x4d\x28\167\x61\154\x6c\145\164\137\160\157\151\x6e\x74\x73\51\x20\x61\x73\x20\141\155\164\40\x66\x72\x6f\155\40\164\142\x6c\x77\141\154\154\x65\164")->row()->amt;
        $win_amt = $this->db->query("\163\x65\154\145\143\x74\x20\123\125\115\x28\x61\155\164\x29\x20\141\x73\x20\x77\x69\x6e\156\151\156\x67\x5f\141\x6d\x6f\x75\x6e\x74\x20\146\162\157\155\40\150\151\163\164\157\162\x79\40\x77\x68\x65\x72\x65\x20\164\171\160\x65\x3d\47\143\47\x20\141\156\144\x20\x74\151\155\x65\x20\x3e\x3d\x27{$yesterday}\x27")->row()->winning_amount;
        $withdrawal_amt = $this->db->query("\163\x65\x6c\145\x63\164\x20\x53\125\115\x28\162\145\161\165\x65\x73\x74\x5f\160\157\x69\x6e\164\163\x29\40\141\163\x20\167\x69\164\x68\x64\x72\x61\167\x6c\x5f\x61\x6d\x6f\165\x6e\x74\12\x20\40\40\40\40\x20\40\40\x66\162\157\155\40\164\x62\x6c\x52\145\161\165\145\x73\164\40\167\150\145\162\x65\40\164\x79\160\x65\75\x27\127\151\x74\150\x64\162\141\x77\x61\154\47\x20\141\156\144\x20\162\x65\161\x75\x65\163\x74\137\x73\x74\141\164\x75\x73\41\x3d\x27\143\x61\x6e\143\x65\154\154\145\x64\47\40\141\156\x64\40\162\145\161\x75\x65\x73\x74\137\163\x74\141\x74\x75\x73\41\x3d\47\x70\x65\156\x64\x69\156\147\47\x20\x61\156\144\x20\164\x69\155\145\x20\76\75\40\x27{$yesterday}\47")->row()->withdrawl_amount;
        $deposit_amt = $this->db->query("\163\x65\x6c\145\x63\164\40\x53\x55\115\50\x72\145\x71\x75\x65\x73\164\137\x70\157\151\156\x74\x73\51\x20\141\163\x20\144\x65\160\x6f\163\x69\164\x5f\141\x6d\157\x75\156\x74\40\x66\162\157\155\40\x74\x62\x6c\x52\x65\161\x75\x65\163\x74\40\167\150\145\x72\145\x20\164\171\x70\145\x3d\47\101\144\144\47\40\x61\x6e\x64\40\x74\151\155\145\x20\76\x3d\x20\47{$yesterday}\47")->row()->deposit_amount;
        $bet_played_amt = $this->db->query("\163\x65\x6c\x65\143\x74\40\x53\125\x4d\50\x70\x6f\151\156\164\x73\51\x20\x61\163\40\142\x65\164\x74\x69\x6e\147\x5f\x61\x6d\x6f\165\156\x74\x20\146\x72\157\155\x20\164\142\154\147\141\x6d\145\144\x61\164\x61\x20\x77\150\145\x72\x65\40\164\x69\x6d\145\40\x3e\75\x20\47{$yesterday}\47")->row()->betting_amount;
        $final_amt = $wallet_amt + $withdrawal_amt + $bet_played_amt - $win_amt - $deposit_amt;
        if ($final_amt != '') {
            return $final_amt;
        } else {
            return 0;
        }
    }
    public function today_withdrawal() {
        return $this->db->select("\122\x4f\x55\116\104\x28\x53\125\x4d\50\162\145\x71\165\145\163\164\137\x70\x6f\x69\x6e\x74\x73\51\54\x32\51\40\x61\x73\x20\160\x6f\x69\156\164")->where(array("\x72\145\x71\x75\145\x73\x74\137\163\164\x61\164\x75\163" => "\141\160\x70\162\x6f\166\x65\x64", "\x74\x79\160\145" => "\127\x69\x74\x68\x64\162\141\167\x61\154", "\104\x41\x54\x45\50\164\151\x6d\145\x29" => date("\x59\55\155\x2d\144")))->get("\164\x62\154\122\x65\161\x75\x65\x73\x74")->row()->point??0;
    }
    public function today_deposit() {
        return $this->db->select("\x53\x55\115\50\x72\x65\x71\165\145\x73\x74\137\160\157\151\x6e\164\163\51\40\141\163\x20\x70\x6f\x69\x6e\164")->where(array("\162\x65\x71\165\x65\163\164\137\x73\164\x61\x74\165\x73" => "\x61\160\x70\x72\157\166\x65\144", "\x74\x79\160\x65" => "\x41\x64\144", "\x44\101\x54\x45\x28\x74\x69\x6d\x65\51" => date("\131\x2d\155\55\144")))->where("\x69\163\x5f\143\141\x73\x68\x62\141\x63\153\x20\111\123\x20\116\125\114\x4c")->get("\x74\142\x6c\122\x65\161\165\x65\x73\164")->row()->point??0;
    }
    public function today_bid_amount() {
        return $query = $this->db->select("\123\x55\x4d\x28\141\155\x74\x29\x20\141\163\x20\x70\x6f\151\x6e\164")->where(array("\x74\x79\160\x65" => "\x64", "\104\x41\x54\105\50\x74\151\x6d\x65\x29" => date("\x59\x2d\x6d\55\x64")))->get("\150\x69\x73\164\x6f\162\x79")->row()->point??0;
    }
    public function total_amount_wallet($type = '') {
        return $this->db->select("\123\125\x4d\x28{$type}\x29\x20\x61\x73\x20\x61\x6d\164")->get("\164\x62\154\x77\x61\x6c\154\x65\x74")->row()->amt??0;
    }
    public function count_active_users() {
        $query = $this->db->query("\163\x65\x6c\x65\x63\x74\x20\x63\157\x75\x6e\x74\50\x6c\157\147\151\x6e\x5f\x73\x74\141\x74\x75\x73\51\x20\x61\x73\x20\141\143\164\151\x76\x65\x5f\x75\x73\x65\x72\x73\x20\x66\162\x6f\155\x20\x75\163\145\x72\137\160\x72\157\x66\151\154\145\x20\167\x68\x65\162\145\40\x69\x73\137\x64\x65\x6c\145\164\145\x64\40\41\75\47\61\47\40");
        $a = $query->row();
        if ($a != '') {
            return $query->row()->active_users;
        } else {
            return 0;
        }
    }
    public function today_paid_amount() {
        return $this->db->select("\123\x55\x4d\50\x61\155\164\51\40\x61\163\x20\160\x6f\151\156\x74")->where(array("\164\x79\160\x65" => "\x63", "\x44\101\x54\105\50\164\x69\155\x65\51" => date("\x59\x2d\155\x2d\x64")))->get("\150\151\x73\164\157\162\x79")->row()->point??0;
    }
    public function today_deposit_manually() {
        $now = date("\x59\x2d\x6d\55\x64");
        return $data = $this->db->select("\123\x55\x4d\50\162\x65\x71\165\145\163\x74\x5f\160\x6f\151\156\x74\163\x29\141\163\x20\x61\155\x6f\x75\x6e\164")->where(array("\x64\x61\164\x65\50\164\x69\155\145\51" => $now, "\151\163\137\161\162\143\x6f\144\145" => 0, "\164\x79\x70\x65" => "\x41\144\x64", "\x72\x65\161\x75\145\163\164\x5f\163\x74\x61\x74\165\x73" => "\141\160\x70\162\x6f\166\145\x64"))->get("\x74\142\154\122\x65\x71\x75\x65\163\164")->row()->amount??0;
    }
    public function today_withdrwal_manually() {
        $now = date("\131\55\x6d\x2d\x64");
        return $data = $this->db->select("\123\x55\x4d\x28\x72\x65\161\x75\145\163\x74\137\160\x6f\151\x6e\x74\x73\51\141\163\40\141\155\x6f\165\156\164")->where(array("\144\141\164\x65\50\164\x69\x6d\145\x29" => $now, "\x69\x73\x5f\x71\x72\x63\x6f\x64\145" => 0, "\x74\171\160\145" => "\x57\151\164\x68\144\162\141\167\141\154", "\162\x65\161\x75\x65\x73\x74\137\x73\164\x61\164\165\x73" => "\x61\x70\160\162\157\166\x65\144"))->get("\x74\x62\x6c\x52\145\x71\x75\x65\x73\164")->row()->amount??0;
    }
    public function change_status_market($id, $set_status = "\141\143\x74\x69\x76\x65") {
        $data = array("\163\164\141\164\165\x73" => $set_status);
        $this->db->where("\151\144", $id);
        return $this->db->update("\155\x61\x74\x6b\x61", $data);
    }
    public function rate_range($id) {
        return $this->db->select("\x72\x61\x74\145\x5f\x72\x61\156\147\145")->where("\151\144", $id)->get("\164\x62\154\x4e\157\x74\x69\143\145")->row();
    }
    public function update_game_rate($rate, $id) {
        $data = array("\x70\157\x69\156\164\163" => $rate);
        $this->db->where("\x67\141\155\145\x5f\x69\144", $id);
        $this->db->update("\164\142\x6c\147\x61\155\145", $data);
        return true;
    }
} ?>

Function Calls

None

Variables

None

Stats

MD5 6f16c422b486fd4967ed159cf218f80b
Eval Count 0
Decode Time 196 ms