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 \xa WHERE tblgamedata.matka_id='{$mid}' GROUP BY game_id";
$query = $this->db->query($q);
return $query->result_array();
}
public function get_point_lists($mid, $from = '', $to = '') {
$limit = 0;
$d = date("Y-m-d");
if ($from == '') {
$from = date("Y-m-d");
} else {
$fr = explode("-", $from);
$from = date("Y-m-d", strtotime($from));
}
if ($to == '') {
$to = date("Y-m-d");
} else {
$to = date("Y-m-d", strtotime($to));
}
$this->db->select("tblgamedata.game_id, tblgamedata.game_name,tblgamedata.date, tblgamedata.bet_type, tblgamedata.digits,\xa 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(" SELECT * FROM `tblStarline`");
return $query->result_array();
}
public function starline_update($id) {
$query = $this->db->query("SELECT * FROM `tblStarline` where id='{$id}' ");
return $query->result_array();
}
public function starline_update2($id) {
$snum = trim($this->input->post("snum"));
$stime = trim($this->input->post("stime"));
$snums = explode("-", $snum);
$data = array("s_game_number" => $snum, "s_game_time" => $stime);
$query = $this->db->update("tblStarline", $data, array("id" => $id));
$this->update_chart($id, "Jannat Starline", $snums[0], $snums[1]);
if ($query) {
return true;
}
}
public function update_user_data($post_image) {
$data = array("name" => $this->input->post("name"), "zipcode" => $this->input->post("zipcode"), "contact" => $this->input->post("contact"), "address" => $this->input->post("address"), "gender" => $this->input->post("gender"), "status" => $this->input->post("status"), "dob" => $this->input->post("dob"), "image" => $post_image, "register_date" => date("Y-m-d H:i:s"));
$this->db->where("id", $this->input->post("id"));
$d = $this->db->update("users", $data);
}
public function get_siteconfiguration($id = false) {
if ($id === false) {
$query = $this->db->get("site_config");
return $query->result_array();
}
$query = $this->db->get_where("site_config", array("id" => $id));
return $query->row_array();
}
public function update_siteconfiguration($id = false) {
if ($id === false) {
$query = $this->db->get("site_config");
return $query->result_array();
}
$query = $this->db->get_where("site_config", array("id" => $id));
return $query->row_array();
}
public function update_siteconfiguration_data($post_image) {
$data = array("site_title" => $this->input->post("site_title"), "site_name" => $this->input->post("site_name"), "logo_img" => $post_image);
$this->db->where("id", $this->input->post("id"));
return $this->db->update("site_config", $data);
}
public function get_mobile_data() {
$query = $this->db->get("site_config");
return $query->row_array();
}
public function update_mobile_data() {
$data = array("mobile" => $this->input->post("mobile"));
return $this->db->update("site_config", $data);
}
public function create_slider($post_image) {
$data = array("title" => $this->input->post("title"), "image" => $post_image, "description" => $this->input->post("description"), "status" => $this->input->post("status"));
return $this->db->insert("sliders_img", $data);
}
public function get_sliders($id = false) {
if ($id === false) {
$query = $this->db->get("sliders_img");
return $query->result_array();
}
$query = $this->db->get_where("sliders_img", array("id" => $id));
return $query->row_array();
}
public function get_slider_data($id = false) {
if ($id === false) {
$query = $this->db->get("sliders_img");
return $query->result_array();
}
$query = $this->db->get_where("sliders_img", array("id" => $id));
return $query->row_array();
}
public function update_slider_data($post_image) {
$data = array("title" => $this->input->post("title"), "image" => $post_image, "description" => $this->input->post("description"), "status" => $this->input->post("status"));
$this->db->where("id", $this->input->post("id"));
return $this->db->update("sliders_img", $data);
}
public function getChart() {
return $this->db->get("charts")->result_array();
}
public function getChartDetails($name) {
return $this->db->where("name", $name)->get("charts")->result_array();
}
public function update_chart_data() {
$snum = $this->input->post("snum");
$enum = $this->input->post("enum");
$data = array("name" => $this->input->post("name"), "date" => $this->input->post("date"), "starting_num" => !empty($snum) ? $snum : null, "result_num" => $this->input->post("num"), "end_num" => !empty($enum) ? $enum : null);
$this->db->where("name", $this->input->post("name") and "date", $this->input->post("date"));
return $this->db->update("charts", $data);
}
public function add_chart_data() {
$snum = $this->input->post("snum");
$enum = $this->input->post("enum");
$data = array("name" => $this->input->post("chart"), "date" => $this->input->post("date"), "starting_num" => !empty($snum) ? $snum : null, "result_num" => $this->input->post("num"), "end_num" => !empty($enum) ? $enum : null);
return $this->db->insert("charts", $data);
}
public function getUserDetails() {
return $this->db->get("users")->result_array();
}
public function getMatkaDetails() {
return $this->db->get("matka")->result_array();
}
public function get_total_users() {
return $this->db->where("is_deleted =!", "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() {
$this->db->select("COUNT(DISTINCT CASE WHEN wallet_points = 0 AND main_wallet_points = 0 THEN user_id END) AS zero_balance_user");
return $query = $this->db->get("tblwallet")->row()->zero_balance_user;
}
public function today_zero_balance_users() {
$this->db->select("COUNT(DISTINCT CASE WHEN wallet_points = 0 AND main_wallet_points = 0 THEN user_id END) AS zero_user");
$this->db->where("DATE(updated_at)", date("Y-m-d"));
$this->db->where("updated_at IS NOT NULL");
return $query = $this->db->get("tblwallet")->row()->zero_user;
}
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->select("ROUND(SUM(wallet_points + main_wallet_points)) as amt")->get("tblwallet")->row()->amt??0;
$win_amt = $this->db->select("SUM(amt) as winning_amount")->where(array("type" => "c", "DATE(time) >=" => $yesterday))->get("history")->row()->winning_amount??0;
$this->db->select_sum("ROUND(ABS(request_points))", "withdrawl_amount")->where(array("type" => "Withdrawal", "request_status" => "approved"))->where("DATE(time) >=", $yesterday);
$withdrawal_amt = $this->db->get("tblRequest")->row()->withdrawl_amount??0;
$this->db->select_sum("request_points", "deposit_amount")->where(array("type" => "Add", "request_status" => "approved", "DATE(time) >=" => $yesterday));
$deposit_amt = $this->db->get("tblRequest")->row()->deposit_amount??0;
$this->db->select_sum("points", "betting_amount")->where("DATE(time) >=", $yesterday);
$bet_played_amt = $this->db->get("tblgamedata")->row()->betting_amount??0;
$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(ABS(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(ABS(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?
How would you describe this file?
Thank you for your feedback! This will help us detect malicious PHP files more accurately in the future.
Function Calls
None
Variables
None
Stats
| MD5 | e4dd3598593c3a94 |
|---|---|
| Eval Count | 0 |
| Decode Time | 164 ms |
Original Code
<?php
class Administrator_Model extends CI_Model {
public function __construct() {
$this->load->database();
}
public function adminLogin($email, $encrypt_password) {
$this->db->where("\145\x6d\x61\151\x6c", $email);
$this->db->where("\160\141\x73\x73\x77\157\162\144", $encrypt_password);
$result = $this->db->get("\x75\163\145\162\163");
if ($result->num_rows() == 1) {
return $result->row(0);
} else {
return false;
}
}
public function app_setting() {
$query = $this->db->get("\141\x70\x70\x5f\x73\145\x74\x74\151\x6e\x67");
$app_data = $query->row();
return $app_data;
}
public function withdrawal_slot() {
$query = $this->db->get("\x74\x69\x6d\145\163\154\x6f\164\163");
$app_data = $query->row();
return $app_data;
}
public function stastics($type = '') {
if ($type == '') {
$stats = 0;
}
if ($type == "\x61\144\x64\137\160\x6f\151\156\x74") {
$stats = $this->db->select("\123\x55\115\x28\x72\145\x71\165\x65\x73\x74\x5f\160\x6f\x69\156\164\x73\51\x20\141\163\x20\x70\157\x69\156\x74\x73")->where(array("\x74\x79\x70\145" => "\x41\x64\144", "\x72\x65\161\165\145\163\164\137\x73\164\x61\x74\x75\163" => "\x61\x70\160\162\x6f\166\x65\x64"))->get("\x74\x62\154\122\145\x71\165\145\163\x74")->row()->points;
}
if ($type == "\167\x69\x74\x68\x64\162\x61\167\x6c\x5f\x70\x6f\x69\156\x74") {
$stats = $this->db->select("\x53\x55\115\50\x72\145\161\x75\x65\163\164\x5f\160\157\x69\x6e\x74\x73\51\x20\x61\x73\40\160\157\x69\x6e\x74\x73")->where(array("\x74\171\160\x65" => "\127\151\164\150\144\162\141\x77\x61\x6c", "\162\145\x71\x75\x65\163\164\137\x73\x74\x61\164\165\163" => "\141\160\x70\162\x6f\x76\145\x64"))->get("\x74\x62\x6c\122\145\161\165\145\x73\164")->row()->points * -1;
}
if ($stats == '') {
$stats = 0;
}
return $stats;
}
public function games() {
return $this->db->select("\x2a")->where("\151\163\x5f\144\145\x6c\145\x74\145\x64", 0)->from("\x74\142\154\147\x61\x6d\145")->order_by("\147\x61\x6d\145\x5f\151\144", "\x44\x45\123\103")->get()->result();
}
public function gamedata($from = '', $to = '', $type = '') {
$fc_game_id = $this->db->select("\151\144")->where(array("\151\163\x5f\150\157\155\x65\x70\x61\x67\x65\137\x67\x61\x6d\x65" => "\x31", "\x69\163\137\x66\x63\137\x67\x61\155\145" => "\61"))->get("\155\x61\164\x6b\x61")->result();
$fc_id = count($fc_game_id) > 0 ? array_column($fc_game_id, "\x69\x64") : array();
$this->db->select("\x2c\151\144\54\165\x73\x65\x72\x5f\x69\144\x2c\155\x61\x74\153\x61\137\151\144\54\142\163\x5f\x67\x61\x6d\x65\x5f\156\141\x6d\x65\x2c\x67\x61\155\145\137\156\141\x6d\145\54\160\x6f\151\156\164\x73\x2c\142\145\164\x5f\x74\171\160\x65\54\164\151\155\x65\54\x64\x69\147\151\x74\x73\x2c\163\164\141\164\x75\163");
$this->db->order_by("\151\144", "\x44\x45\123\x43");
$this->db->where("\144\141\164\x65\x28\164\x69\155\x65\x29\x20\102\105\x54\127\105\105\116\x20\x27{$from}\47\40\x41\116\x44\x20\x27{$to}\x27\x20");
if (!empty($fc_id) && $type == "\x69\x73\x5f\x66\x63\x5f\x67\x61\155\145") {
$this->db->where_in("\155\x61\x74\153\141\137\151\144", $fc_id);
} else {
$this->db->where_not_in("\155\141\x74\x6b\141\137\151\144", $fc_id);
}
return $this->db->get("\164\x62\154\x67\141\155\145\x64\x61\164\141")->result();
}
public function gamebyid($id) {
$this->db->where("\x69\144", $id);
return $this->db->get("\147\x61\155\x65\x73")->row();
}
public function userbyid($id) {
$this->db->where("\151\144", $id);
return $this->db->get("\x75\x73\x65\162\x5f\160\x72\x6f\x66\x69\154\x65")->row();
}
public function matkabyid($id) {
$this->db->where("\x69\x64", $id);
return $this->db->get("\x6d\x61\x74\x6b\x61")->row();
}
public function update_appsetting() {
$app = array("\x6d\x65\163\163\x61\147\145" => mb_convert_encoding($this->input->post("\155\x65\x73\163\x61\x67\x65"), "\x48\x54\x4d\x4c\x2d\x45\x4e\124\x49\x54\x49\x45\123", "\125\124\x46\55\70"), "\150\157\x6d\145\137\x74\x65\x78\164" => mb_convert_encoding($this->input->post("\x68\157\x6d\x65\x74\145\170\164"), "\110\x54\115\x4c\x2d\x45\x4e\124\x49\x54\111\105\x53", "\125\x54\x46\x2d\x38"), "\x77\x69\164\x68\144\x72\141\167\x5f\x74\145\170\164" => mb_convert_encoding($this->input->post("\x77\x69\164\x68\144\162\141\167\164\x65\x78\x74"), "\x48\124\115\114\55\x45\x4e\x54\x49\124\111\x45\123", "\125\x54\x46\55\x38"), "\x77\x69\x74\150\x64\x72\x61\167\137\156\157" => $this->input->post("\167\151\164\150\x64\162\x61\167\156\165\x6d\142\x65\x72"), "\167\x68\141\x74\x73\141\160\160\x5f\156\157" => $this->input->post("\x77\150\141\x74\x73\141\160\x70\x5f\x6e\x6f"), "\x75\x70\151" => $this->input->post("\x75\x70\151"), "\165\x70\151\x5f\156\141\x6d\145" => $this->input->post("\165\x70\x69\x5f\156\141\155\145"), "\155\151\x6e\137\x61\x6d\157\165\156\164" => $this->input->post("\x6d\x69\x6e\137\141\155\157\x75\156\x74"), "\167\x5f\141\x6d\157\165\x6e\164" => $this->input->post("\167\x5f\141\155\x6f\x75\156\x74"), "\150\x6f\167\x5f\x74\x6f\x5f\x70\154\141\171" => $this->input->post("\150\x6f\167\x5f\x74\157\x5f\160\x6c\x61\x79"), "\x61\144\144\x5f\x70\x6f\x69\156\164\x5f\164\145\x78\x74" => mb_convert_encoding($this->input->post("\141\x64\x64\x5f\160\157\x69\x6e\x74\137\164\x65\170\164"), "\x48\x54\115\114\x2d\x45\116\124\x49\x54\x49\105\123", "\x55\x54\x46\55\x38"), "\141\144\144\x5f\x74\x72\141\x6e\163\x66\145\x72\x5f\x74\x65\170\164" => mb_convert_encoding($this->input->post("\x61\x64\144\137\164\162\141\x6e\x73\x66\x65\x72\x5f\164\x65\170\x74"), "\x48\124\x4d\x4c\x2d\x45\116\x54\111\x54\111\105\123", "\x55\124\x46\x2d\70"), "\x77\151\x74\x68\x64\x72\x61\x77\x5f\156\157\164\145" => mb_convert_encoding($this->input->post("\167\x69\164\150\144\x72\x61\167\x5f\x6e\x6f\x74\145"), "\x48\x54\115\114\x2d\x45\116\x54\x49\x54\x49\105\123", "\x55\124\106\x2d\70"), "\162\x65\x66\145\162\x5f\141\155\x6f\165\x6e\x74" => $this->input->post("\162\x65\x66\145\x72\x5f\141\x6d\157\x75\156\x74"), "\x75\160\x69\137\144\145\163\143" => $this->input->post("\x75\x70\x69\137\x64\145\163\x63"), "\x74\145\154\x65\147\x72\141\x6d\x5f\x69\144" => $this->input->post("\x74\145\x6c\x65\x67\162\x61\155\137\151\144"), "\x74\162\x61\156\163\x66\x65\x72\137\146\x65\145" => $this->input->post("\x74\162\x61\156\x73\x66\x65\x72\137\146\x65\x65"), "\x66\x75\156\x64\x5f\155\x6f\144\145" => $this->input->post("\x66\x75\156\x64\x5f\x6d\157\x64\x65"), "\x72\x75\x6e\x6e\151\x6e\x67\137\x68\157\x6d\145\137\x74\145\170\164" => mb_convert_encoding($this->input->post("\x72\x75\x6e\156\x69\156\147\137\150\x6f\155\145\137\164\x65\170\164"), "\x48\x54\115\114\55\105\x4e\124\x49\124\x49\105\x53", "\x55\x54\x46\55\x38"), "\x6d\141\x78\x5f\142\x69\144\137\x61\x6d\157\x75\156\164" => $this->input->post("\155\141\x78\137\x62\x69\x64\x5f\x61\x6d\157\x75\x6e\164"), "\155\x61\170\x5f\x77\x69\x74\x68\x64\162\141\167" => $this->input->post("\155\x61\170\x5f\x77\x69\164\150\144\x72\x61\167"), "\167\151\164\150\x64\162\141\x77\x5f\141\x6c\145\162\164\x5f\x6d\145\163\163\141\147\x65" => mb_convert_encoding($this->input->post("\167\151\x74\x68\x64\162\141\167\x5f\x61\154\145\162\164\x5f\x6d\x65\x73\x73\x61\147\x65"), "\x48\x54\x4d\x4c\x2d\105\x4e\x54\x49\x54\x49\x45\123", "\x55\x54\x46\x2d\x38"), "\x6d\141\170\137\141\144\144\137\x61\155\x6f\x75\156\x74" => $this->input->post("\155\141\x78\137\x61\x64\x64\137\141\x6d\157\x75\x6e\164"), "\x77\151\x74\150\144\x72\141\x77\141\154\x5f\x74\x79\x70\145" => $this->input->post("\167\x69\x74\150\x64\x72\141\167\141\154\137\x74\171\x70\x65"), "\141\x64\144\x6d\157\156\x65\171\137\141\x6c\x65\x72\164" => mb_convert_encoding($this->input->post("\x61\x64\x64\x6d\x6f\x6e\145\171\137\x61\x6c\x65\162\x74"), "\110\x54\x4d\x4c\55\x45\116\124\111\124\111\105\123", "\x55\x54\106\55\70"), "\162\145\x66\x65\162\137\x63\x75\x73\164\x6f\155\137\164\145\170\x74" => mb_convert_encoding($this->input->post("\162\x65\x66\145\162\x5f\143\165\x73\x74\x6f\155\137\x74\x65\170\x74"), "\x48\124\x4d\114\x2d\105\x4e\x54\x49\x54\x49\x45\x53", "\x55\x54\106\x2d\x38"), "\141\144\144\x5f\155\157\x6e\x65\x79\137\166\x6f\151\143\145" => $this->input->post("\141\x64\x64\137\155\157\156\145\171\137\166\x6f\x69\143\x65"), "\x77\x69\x74\x68\x64\162\x61\x77\137\x73\x65\x72\x76\x69\x63\145\137\164\x61\170" => $this->input->post("\x77\x69\164\150\144\x72\141\167\137\163\145\x72\x76\x69\x63\x65\137\164\141\170"));
$this->db->where("\151\x64", 1);
return $this->db->update("\141\x70\160\137\163\145\x74\164\x69\156\x67", $app);
}
public function get_posts($slug = false) {
if ($slug === false) {
$query = $this->db->order_by("\x69\x64", "\x44\105\123\x43");
$query = $this->db->get("\160\x6f\163\164\x73");
return $query->result_array();
}
$query = $this->db->get_where("\x70\x6f\163\164\x73", array("\163\154\165\147" => $slug));
return $query->row_array();
}
public function deletegamedata($id) {
$this->db->where("\x69\x64", $id);
return $this->db->delete("\164\x62\x6c\147\141\x6d\x65\144\x61\164\141");
}
public function del_request($id) {
$this->db->where("\162\145\161\x75\145\x73\164\x5f\151\144", $id);
return $this->db->delete("\x74\142\x6c\122\x65\161\x75\x65\163\164");
}
public function create_post() {
$slug = url_title($this->input->post("\164\151\164\x6c\x65"), "\x64\141\x73\x68", true);
$data = array("\164\x69\164\154\145" => $this->input->post("\x74\151\x74\x6c\x65"), "\163\154\165\147" => $slug, "\142\x6f\x64\x79" => $this->input->post("\x62\157\144\x79"), "\143\x61\x74\x65\x67\x6f\162\x79\x5f\151\x64" => $this->input->post("\143\141\164\145\147\x6f\x72\x79\137\x69\x64"));
return $this->db->insert("\x70\x6f\163\x74\163", $data);
}
public function delete($id, $table) {
$this->db->where("\x69\x64", $id);
$this->db->delete($table);
return true;
}
public function get_categories() {
$this->db->order_by("\x69\144", "\104\105\123\x43");
$query = $this->db->get("\143\141\x74\x65\x67\157\162\151\x65\163");
return $query->result_array();
}
public function add_user($post_image, $password) {
$data = array("\x6e\141\x6d\145" => $this->input->post("\x6e\x61\155\x65"), "\x65\155\141\x69\154" => $this->input->post("\145\155\141\x69\154"), "\x70\141\x73\163\x77\x6f\x72\x64" => $password, "\165\163\145\x72\x6e\141\155\145" => $this->input->post("\165\163\145\162\156\x61\155\145"), "\172\x69\160\x63\157\144\x65" => $this->input->post("\172\x69\x70\143\x6f\x64\145"), "\x63\157\156\164\x61\143\x74" => $this->input->post("\143\157\x6e\164\x61\143\x74"), "\x61\x64\144\x72\x65\x73\x73" => $this->input->post("\141\x64\144\x72\x65\x73\163"), "\x67\145\x6e\144\145\162" => $this->input->post("\147\145\x6e\x64\145\x72"), "\x72\157\154\x65\x5f\x69\144" => "\x32", "\x73\x74\141\x74\x75\163" => $this->input->post("\163\164\141\x74\x75\163"), "\144\157\142" => $this->input->post("\144\x6f\x62"), "\x69\x6d\x61\147\x65" => $post_image, "\160\x61\x73\163\x77\157\x72\144" => $password, "\x72\145\x67\151\163\164\x65\x72\137\x64\141\x74\x65" => date("\131\55\x6d\55\144\x20\110\x3a\x69\72\163"));
return $this->db->insert("\165\x73\145\x72\163", $data);
}
public function get_users($username = false, $limit = false, $offset = false) {
if ($limit) {
$this->db->limit($limit, $offset);
}
if ($username === false) {
$this->db->order_by("\165\163\x65\x72\163\56\151\144", "\104\105\x53\x43");
$query = $this->db->get("\x75\x73\145\162\x73");
return $query->result_array();
}
$query = $this->db->get_where("\165\x73\145\x72\163", array("\x75\x73\145\162\x6e\x61\155\145" => $username));
return $query->row_array();
}
public function enable($id, $table) {
$data = array("\x73\x74\x61\x74\x75\x73" => 0);
$this->db->where("\151\x64", $id);
return $this->db->update($table, $data);
}
public function disable($id, $table) {
$data = array("\x73\164\x61\164\x75\x73" => 1);
$this->db->where("\151\144", $id);
return $this->db->update($table, $data);
}
public function get_user($id = false) {
if ($id === false) {
$query = $this->db->get("\x75\x73\x65\x72\x73");
return $query->result_array();
}
$query = $this->db->get_where("\165\163\145\x72\163", array("\x69\x64" => $id));
return $query->row_array();
}
public function get_user_profile() {
$query = $this->db->join("\x74\x62\154\x77\x61\x6c\154\x65\164", "\165\x73\145\162\x5f\x70\162\x6f\x66\x69\x6c\x65\56\x69\x64\75\x74\142\x6c\x77\x61\x6c\x6c\145\x74\56\x75\x73\145\162\x5f\151\x64")->where("\x69\163\x5f\144\145\x6c\145\x74\x65\144", 0)->order_by("\164\142\x6c\x77\141\154\154\x65\164\56\165\x73\145\162\x5f\151\x64", "\104\105\x53\103")->get("\165\x73\x65\162\x5f\160\x72\157\x66\x69\154\145");
return $query->result_array();
}
public function deleteuser($id) {
$data = array("\151\x73\137\144\145\x6c\x65\x74\145\144" => 1, "\x6d\157\x62\x69\x6c\x65\156\157" => "\x30");
$this->db->where("\151\144", $id);
return $this->db->set("\x64\145\154\145\x74\x65\144\x5f\x6d\x6f\x62\x69\154\145\156\x6f", "\155\157\x62\151\x6c\x65\156\157", false)->update("\165\x73\145\162\137\160\162\157\x66\151\x6c\145", $data);
}
public function change_status($id, $set_status = 0) {
$data = array("\154\157\147\x69\156\137\x73\x74\x61\164\x75\163" => $set_status);
$this->db->where("\151\144", $id);
return $this->db->update("\165\163\x65\162\x5f\160\162\157\x66\x69\154\145", $data);
}
public function getGameName($id) {
$q = "\x53\105\114\105\103\124\40\156\x61\x6d\x65\x20\106\x52\x4f\115\x20\164\x62\154\147\141\x6d\x65\x20\127\110\105\122\x45\40\147\141\x6d\145\x5f\151\144\75\x27{$id}\x27";
$query = $this->db->query($q)->row_array();
return $query["\x6e\141\155\x65"];
}
public function get_games($mid) {
$q = "\123\x45\x4c\105\103\x54\x20\x74\142\154\x67\x61\x6d\145\x64\141\164\x61\x2e\147\x61\x6d\145\137\x69\144\54\x6e\141\x6d\145\x20\106\x52\x4f\x4d\40\x74\142\x6c\147\x61\155\x65\144\x61\164\x61\40\114\x45\106\124\x20\x4a\x4f\111\116\40\x74\x62\x6c\147\x61\x6d\145\40\x4f\x4e\x20\x74\142\154\147\141\155\145\144\x61\x74\x61\x2e\x67\x61\155\145\137\151\x64\x3d\164\142\x6c\147\141\155\145\x2e\x67\x61\x6d\145\137\x69\x64\x20\xa\11\x20\40\x20\x20\127\x48\x45\122\x45\40\164\x62\x6c\x67\141\x6d\145\144\141\164\x61\x2e\x6d\141\x74\x6b\141\x5f\151\x64\x3d\47{$mid}\x27\40\x47\x52\117\125\x50\40\x42\x59\x20\x67\x61\155\145\x5f\151\144";
$query = $this->db->query($q);
return $query->result_array();
}
public function get_point_lists($mid, $from = '', $to = '') {
$limit = 0;
$d = date("\x59\55\155\x2d\x64");
if ($from == '') {
$from = date("\x59\x2d\155\55\144");
} else {
$fr = explode("\55", $from);
$from = date("\x59\55\155\55\x64", strtotime($from));
}
if ($to == '') {
$to = date("\131\55\155\x2d\x64");
} else {
$to = date("\x59\x2d\155\x2d\x64", strtotime($to));
}
$this->db->select("\x74\x62\x6c\147\x61\x6d\145\144\x61\x74\141\56\x67\x61\x6d\x65\137\x69\144\x2c\40\x74\x62\x6c\147\141\x6d\145\x64\141\164\x61\x2e\x67\141\x6d\x65\x5f\x6e\141\155\145\54\x74\142\x6c\147\141\x6d\x65\x64\x61\x74\x61\56\144\141\164\145\x2c\40\164\x62\154\147\x61\155\145\x64\x61\x74\x61\x2e\142\145\164\x5f\164\x79\160\x65\54\x20\x74\x62\x6c\x67\x61\x6d\145\x64\141\x74\x61\x2e\x64\x69\x67\x69\x74\163\x2c\xa\11\x20\x20\164\x62\154\147\141\155\x65\x64\x61\164\x61\56\x70\157\151\156\x74\163\x2c\40\165\163\145\x72\x5f\x70\x72\x6f\146\x69\154\x65\x2e\x6d\x6f\142\x69\x6c\x65\156\x6f\x2c\40\x74\142\x6c\x67\x61\x6d\145\x64\141\x74\141\x2e\142\x73\x5f\x67\141\x6d\145\x5f\x6e\x61\155\145");
$this->db->from("\164\142\x6c\147\x61\x6d\145\144\x61\x74\141");
$this->db->join("\x75\163\145\162\x5f\x70\x72\x6f\x66\x69\x6c\145", "\165\163\145\x72\x5f\160\162\157\x66\151\154\x65\56\x69\144\40\x3d\x20\164\x62\x6c\147\141\x6d\x65\144\x61\164\141\56\x75\x73\145\162\137\x69\x64", "\154\x65\x66\x74");
$this->db->join("\x74\142\154\147\x61\x6d\x65", "\x74\142\154\x67\x61\155\145\56\147\x61\x6d\x65\x5f\x69\144\x20\x3d\x20\x74\x62\x6c\147\141\155\x65\144\x61\x74\x61\x2e\x67\141\x6d\x65\137\x69\x64", "\154\145\146\164");
$this->db->where("\164\x62\x6c\147\141\x6d\145\x64\141\x74\141\56\155\141\164\153\x61\137\x69\x64", $mid);
$this->db->where("\x74\x62\x6c\x67\141\155\145\x64\x61\x74\x61\x2e\151\x64\40\76", $limit);
$this->db->where("\104\x41\x54\x45\x28\164\142\x6c\x67\141\155\x65\144\x61\164\x61\56\x74\x69\x6d\145\x29\x20\102\105\124\x57\105\105\116\x20\47{$from}\47\40\x41\116\104\40\47{$to}\47");
$this->db->order_by("\164\142\x6c\x67\x61\x6d\x65\x64\x61\164\141\56\x64\x69\147\x69\164\x73", "\141\163\143");
return $query = $this->db->get()->result_array();
$q = "\123\105\114\x45\103\124\x20\147\x61\x6d\145\137\x69\x64\x2c\144\x61\164\145\x2c\x62\145\164\x5f\164\171\160\x65\x2c\144\x69\147\151\x74\163\54\x74\142\x6c\x67\x61\155\x65\144\141\164\x61\56\160\x6f\x69\156\x74\x73\54\x75\x73\x65\x72\x5f\160\162\157\146\151\x6c\145\x2e\x6d\157\142\x69\x6c\x65\156\157\x20\x46\x52\x4f\115\x20\x74\142\x6c\147\x61\155\145\144\141\164\x61\40\114\x45\x46\124\40\112\x4f\x49\116\40\165\x73\145\x72\137\x70\x72\157\146\151\154\145\40\x4f\116\x20\x75\x73\x65\x72\x5f\160\162\x6f\x66\x69\154\145\x2e\x69\x64\x3d\x74\x62\154\x67\x61\155\145\x64\141\x74\141\x2e\x75\x73\145\x72\137\151\x64\x20\x57\x48\105\x52\x45\40\164\x62\x6c\147\x61\x6d\x65\x64\141\164\141\x2e\155\141\x74\153\141\137\x69\144\x3d\x27{$mid}\x27\x20\x61\x6e\144\40\x74\142\x6c\x67\x61\x6d\x65\144\x61\164\141\56\x69\144\76" . $limit . "\x20\x61\x6e\144\40\x64\141\x74\x65\40\x42\105\124\x57\105\x45\x4e\40\47{$from}\x27\40\101\x4e\x44\x20\x27{$to}\47\40\117\122\x44\105\122\40\x42\x59\x20\144\141\164\145\x20\x44\105\123\103";
$query = $this->db->query($q);
$tbl = $query->result_array();
$t = array();
foreach ($tbl as $tb) {
$gid = $tb["\x67\141\x6d\145\137\x69\144"];
$bet_type = $tb["\x62\x65\x74\137\x74\x79\160\145"];
$digits = $tb["\x64\x69\147\151\164\x73"];
$mobileno = $tb["\155\x6f\142\151\x6c\145\156\x6f"];
$bs_game_name = $tb["\142\163\137\147\141\x6d\x65\x5f\x6e\141\155\145"];
if ($gid == 12 || $gid == 13) {
$bet = "\55\x2d";
$digit = $bet_type . "\x2d" . $digits;
} else {
$bet = $bet_type;
$digit = $digits;
}
if (!isset($t[$tb["\144\141\x74\x65"]][$gid][$bet][$digit])) {
$t[$tb["\144\141\x74\145"]][$gid][$bet][$digit][$mobileno] = 0;
}
$t[$tb["\x64\141\x74\x65"]][$gid][$bet][$digit][$mobileno]+= $tb["\x70\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 = "\123\x45\114\105\x43\x54\x20\104\111\x53\124\x49\116\103\x54\40\x75\163\x65\162\x5f\x70\162\x6f\x66\x69\x6c\145\56\151\144\x2c\x20\x75\163\x65\162\137\x70\162\157\x66\x69\x6c\145\56\165\x73\145\162\156\x61\155\x65\40\106\x52\117\x4d\40\x74\142\x6c\x67\141\155\x65\144\141\x74\141\40\x4c\x45\x46\124\x20\112\x4f\111\116\x20\x75\x73\145\162\137\160\162\x6f\x66\x69\154\145\x20\117\x4e\40\164\x62\x6c\147\x61\x6d\145\x64\x61\x74\x61\56\x75\163\145\162\137\151\x64\75\x75\x73\x65\x72\137\160\162\x6f\x66\151\x6c\x65\56\151\144\40\x57\110\x45\x52\105\40\x74\142\154\x67\141\x6d\145\x64\141\164\x61\56\147\x61\x6d\145\x5f\151\x64\75\x27{$id}\x27\40\x61\156\144\40\164\142\154\x67\x61\155\145\144\x61\164\x61\x2e\155\141\164\153\141\137\x69\x64\x3d\47{$mid}\47";
$query = $this->db->query($q);
return $query->result_array();
}
public function get_history($user_id, $matka_id, $game_id, $from = '', $to = '') {
if ($from == '') {
$from = date("\144\x2f\x6d\57\131");
}
if ($to == '') {
$to = date("\144\x2f\155\57\x59");
}
$sel = "\123\x45\114\x45\x43\x54\40\104\x49\x53\124\111\x4e\x43\x54\x20\164\x62\154\x67\141\155\x65\56\x6e\141\155\145\54\x75\163\x65\162\137\160\x72\x6f\x66\151\x6c\x65\x2e\x75\x73\145\162\x6e\141\155\x65\x2c\40\x74\x62\x6c\147\x61\155\x65\x64\141\164\141\56\x70\157\x69\x6e\164\x73\54\x20\x74\x62\154\147\x61\155\x65\x64\141\164\x61\56\x64\x69\147\151\x74\163\54\x20\144\x61\x74\x65\54\x20\164\x62\x6c\147\x61\155\145\x64\141\164\x61\x2e\x74\x69\155\145\54\x62\145\x74\x5f\164\x79\x70\145\54\164\x62\154\147\141\155\x65\x64\141\164\141\x2e\x75\163\145\162\137\151\x64\54\40\x74\142\x6c\147\x61\155\x65\144\x61\164\141\56\155\141\x74\153\141\x5f\151\x64\54\164\x62\154\x67\141\155\145\x64\141\164\141\56\147\x61\x6d\x65\137\x69\x64\x2c\40\164\x62\154\147\x61\x6d\x65\x64\x61\x74\x61\56\x69\x64\40\146\x72\x6f\x6d\40\164\142\154\x67\141\x6d\145\54\x20\x75\x73\145\162\x5f\160\x72\157\x66\151\x6c\x65\x2c\164\142\x6c\147\x61\155\x65\144\141\164\141\40\x77\150\145\x72\145\x20\x74\x62\154\x67\141\x6d\145\56\x67\x61\x6d\x65\x5f\x69\144\x3d\47{$game_id}\x27\x20\x61\156\144\x20\x74\x62\154\147\x61\155\145\144\x61\164\x61\56\147\x61\155\x65\137\x69\x64\75\x27{$game_id}\47\x20\x61\156\x64\x20\x75\163\x65\162\x5f\151\x64\x3d\165\163\145\162\137\160\162\157\x66\151\154\145\x2e\x69\x64\40\x61\x6e\x64\x20\165\163\x65\x72\137\x69\x64\x3d\x27{$user_id}\47\40\x61\156\x64\x20\155\141\164\153\141\137\x69\144\75\47{$matka_id}\x27\40\141\156\144\40\144\x61\x74\x65\x20\102\105\x54\127\105\105\x4e\x20\x27{$from}\47\40\x41\x4e\104\x20\47{$to}\x27\40\x6f\x72\144\145\x72\x20\x62\171\40\164\142\154\147\x61\x6d\x65\144\141\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("\x64\x2f\x6d\57\x59");
$sel = "\x53\x45\114\x45\x43\124\40\164\x62\x6c\x67\x61\155\145\x64\141\x74\x61\56\x2a\x2c\40\x6d\141\x74\x6b\141\56\x6e\x61\x6d\145\x20\x61\x73\40\155\141\x74\x6b\x61\137\x6e\141\x6d\145\54\164\x62\x6c\147\x61\x6d\145\x2e\x6e\141\x6d\x65\40\x61\163\40\147\x61\155\x65\x5f\x6e\141\x6d\145\x20\106\122\x4f\x4d\x20\140\164\142\x6c\147\x61\155\145\x64\141\x74\x61\140\40\x4a\x4f\x49\116\40\155\x61\164\x6b\x61\40\x4f\x4e\40\x74\142\154\147\x61\155\x65\x64\141\x74\x61\56\x6d\141\164\153\141\137\151\144\x3d\155\141\164\153\141\56\151\x64\x20\112\x4f\111\116\x20\164\142\x6c\147\141\155\x65\40\117\116\x20\x74\x62\154\147\141\x6d\x65\x64\141\164\141\56\x67\x61\155\x65\137\x69\x64\x3d\x74\142\154\147\x61\x6d\145\x2e\147\x61\x6d\x65\137\x69\144\x20\x77\x68\x65\162\145\40\165\163\x65\162\x5f\x69\144\x3d\x27{$user_id}\x27\x20\x26\46\x20\144\x61\x74\145\75\x27{$dt}\x27\40\117\122\x44\105\122\40\102\x59\40\x74\142\x6c\x67\141\155\x65\x64\141\164\141\x2e\x69\144\40\x44\x45\123\103";
$query = $this->db->query($sel);
$aa = $query->result_array();
return $aa ? $aa : false;
}
public function add_wallet($no = '') {
if ($no == '') {
return null;
}
$query = $this->db->query("\123\x45\114\105\x43\124\40\x2a\40\x46\x52\117\x4d\40\x75\163\x65\162\137\160\x72\157\146\151\x6c\145\x20\x77\150\x65\162\145\40\155\157\142\x69\x6c\x65\x6e\x6f\75\x27{$no}\x27");
return $query->result_array();
}
public function add_wallet2($id, $wa) {
$query = $this->db->query("\125\x70\144\x61\x74\145\x20\x74\142\154\x77\141\154\x6c\x65\x74\40\163\145\164\40\155\141\151\156\x5f\x77\141\x6c\154\145\x74\137\x70\x6f\151\x6e\164\x73\75\x6d\141\151\156\x5f\167\141\x6c\154\145\x74\x5f\x70\x6f\x69\x6e\164\x73\x2b\x27{$wa}\x27\x20\167\x68\145\x72\145\40\165\163\x65\x72\137\x69\x64\x3d\x27{$id}\x27");
if ($query) {
return true;
}
}
public function update_point_to_winning($id, $wa) {
$query = $this->db->query("\x55\160\144\x61\x74\x65\40\164\x62\x6c\167\x61\x6c\x6c\145\x74\x20\x73\145\x74\40\167\x61\154\x6c\145\164\137\x70\157\151\156\x74\x73\x3d\167\141\x6c\154\x65\164\x5f\160\x6f\151\x6e\x74\163\53\47{$wa}\x27\x20\x77\150\145\x72\x65\40\x75\163\x65\162\137\x69\x64\75\x27{$id}\x27");
if ($query) {
return true;
}
}
public function add_wallet3($id, $wa) {
$query = $this->db->query("\111\x6e\x73\145\x72\164\x20\151\x6e\164\x6f\40\164\142\154\167\x61\154\x6c\x65\164\50\155\141\x69\156\137\x77\141\154\x6c\145\x74\x5f\160\x6f\151\156\164\163\x2c\165\163\x65\x72\x5f\151\x64\51\x20\x76\141\x6c\165\x65\x73\50\47{$wa}\47\x2c\x27{$id}\x27\51");
if ($query) {
return true;
}
}
public function add_point_to_winning($id, $wa) {
$query = $this->db->query("\111\156\x73\145\x72\164\40\x69\x6e\164\157\x20\x74\142\154\x77\141\154\x6c\145\x74\x28\x77\141\x6c\154\145\x74\x5f\160\x6f\151\x6e\164\x73\54\x75\163\x65\162\x5f\x69\144\51\40\x76\x61\x6c\165\x65\x73\x28\x27{$wa}\x27\54\47{$id}\x27\51");
if ($query) {
return true;
}
}
public function check_wallet($id) {
$query = $this->db->query("\x73\145\154\145\x63\164\x20\52\40\146\162\x6f\x6d\40\164\x62\154\x77\141\x6c\154\145\164\x20\x77\x68\x65\162\x65\40\165\163\145\x72\x5f\151\x64\75\x20\47{$id}\x27");
return $query->result_array();
}
public function check_wallet_amt($id) {
$query = $this->db->query("\163\x65\x6c\x65\143\x74\40\x77\141\x6c\154\x65\164\137\160\157\x69\x6e\x74\163\40\141\x73\40\x61\155\x74\x20\x66\x72\x6f\x6d\x20\164\x62\x6c\167\x61\154\x6c\145\x74\40\x77\x68\x65\x72\x65\x20\x75\x73\145\162\x5f\151\x64\75\40\x27{$id}\x27");
return $query->row_array() ["\x61\155\164"];
}
public function ch_amt($amt, $id) {
$wallet = $this->check_wallet_amt($id);
$am = $wallet - $amt;
return (int)$am;
}
public function notify($notification) {
if ($notification == '') {
return false;
}
$query = $this->db->insert("\164\142\154\116\x6f\x74\151\x66\x69\x63\x61\164\151\157\x6e", array("\156\x6f\164\x69\x66\151\x63\141\x74\151\x6f\x6e" => $notification));
if ($query) {
return true;
}
return false;
}
public function add_point_req_by_admin($points, $user_id) {
$type = $points > 0 ? "\101\144\144" : "\127\x69\164\x68\x64\x72\141\x77\141\x6c";
$insert_query = array("\x72\145\161\165\145\x73\x74\x5f\160\x6f\x69\156\164\x73" => $points, "\x75\163\x65\162\x5f\x69\x64" => $user_id, "\x74\x79\x70\x65" => $type, "\162\145\x71\x75\145\x73\164\137\163\x74\x61\x74\x75\x73" => "\x61\160\x70\162\157\x76\x65\x64", "\x69\x73\137\x71\x72\x63\x6f\144\x65" => 0);
$query = $this->db->insert("\x74\142\x6c\122\x65\x71\x75\145\163\x74", $insert_query);
return $query;
}
public function add_pointList($form, $to) {
$this->db->select("\52")->from("\x74\142\x6c\122\x65\161\165\145\x73\x74")->where("\x74\171\160\145", "\101\x64\144");
$this->db->order_by("\x72\x65\x71\x75\x65\x73\x74\x5f\x69\x64", "\x44\105\x53\103");
$this->db->limit(10000);
$this->db->where("\144\141\164\x65\x28\x74\x69\155\145\51\x20\76\x3d", $form);
$this->db->where("\144\x61\x74\x65\50\x74\x69\x6d\x65\51\x20\x3c\x3d", $to);
$query = $this->db->get();
return $query->result_array();
}
public function add_point_req($from, $to) {
$this->db->cache_off();
$this->db->select("\162\x65\x71\x75\x65\163\164\x5f\x69\x64\x2c\165\x73\x65\162\x5f\x69\x64\x2c\x72\145\x71\165\145\x73\x74\137\160\157\151\x6e\164\x73\x2c\x74\x69\x6d\x65\54\x49\x46\50\143\x6f\x6d\x6d\145\156\x74\40\x21\75\x27\47\x2c\143\x6f\x6d\155\x65\156\x74\x2c\x27\116\x2f\141\47\x29\x20\141\163\x20\143\x6f\x6d\x6d\145\156\164\54\x72\145\x71\165\145\x73\x74\137\163\x74\x61\x74\x75\x73");
$this->db->where("\x74\x79\160\145", "\101\144\x64");
$this->db->where("\104\101\x54\x45\x28\x74\x69\155\x65\x29\40\102\105\124\x57\x45\x45\116\x20\47{$from}\47\40\101\116\x44\x20\x27{$to}\47");
$query = $this->db->order_by("\x72\145\161\165\x65\x73\x74\x5f\151\x64", "\144\x65\163\143")->get("\164\142\x6c\x52\145\161\165\145\x73\164")->result_array();
return $query;
}
public function delete_point_req($req_id) {
$this->db->where("\162\145\161\165\145\163\164\x5f\x69\144", $req_id);
$this->db->delete("\164\x62\x6c\122\x65\161\x75\145\x73\164");
return true;
}
public function add_point_req2($id) {
$query = $this->db->query("\x53\x45\114\x45\103\124\40\x2a\40\106\122\x4f\x4d\x20\x60\x74\142\x6c\122\x65\x71\165\x65\x73\x74\x60\40\167\x68\x65\x72\x65\x20\162\145\x71\x75\x65\x73\x74\x5f\x69\144\x3d\47{$id}\47\x20\x61\x6e\x64\x20\164\171\160\x65\x20\75\x20\x27\x41\144\x64\x27\40\141\156\x64\x20\x72\145\x71\x75\x65\x73\164\x5f\163\x74\141\x74\x75\163\75\x27\160\145\156\144\x69\156\147\x27");
if ($query->num_rows() == 0) {
return redirect("\141\144\155\151\x6e\x2f\x61\144\x64\x5f\160\157\x69\156\x74\137\x72\145\161");
} else {
$query2 = $this->db->query("\x55\120\104\x41\124\x45\40\140\x74\142\x6c\x52\x65\161\x75\145\163\164\x60\x20\163\145\x74\40\x72\x65\161\x75\145\x73\x74\x5f\163\164\141\164\x75\x73\x3d\47\141\x70\160\162\x6f\x76\x65\x64\x27\40\x77\150\145\x72\x65\40\x72\x65\161\x75\x65\163\x74\x5f\x69\x64\75\x27{$id}\47\x20\x61\x6e\x64\40\x72\145\x71\x75\x65\163\164\137\163\164\141\x74\x75\163\x3d\47\x70\x65\x6e\x64\x69\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\x71\165\145\163\x74\137\151\x64\x2c\x75\163\x65\162\x5f\x69\x64\x2c\162\145\161\x75\x65\x73\x74\137\160\x6f\151\156\x74\x73\54\164\151\155\145\54\x72\x65\x71\165\x65\163\x74\x5f\163\164\141\x74\x75\163\x2c\x73\145\x72\166\x69\143\145\x5f\x63\150\x61\x72\147\x65");
$this->db->where("\x44\x41\124\x45\x28\x74\151\x6d\x65\51\40\x42\105\x54\127\x45\105\116\x20\47{$from}\x27\x20\x41\116\x44\40\x27{$to}\47");
$query = $this->db->where(array("\164\x79\160\x65" => "\127\151\164\x68\144\162\x61\x77\x61\x6c"))->order_by("\162\145\161\165\145\x73\164\137\151\x64", "\104\x45\x53\x43")->get("\x74\142\154\x52\145\x71\x75\x65\163\164");
return $query->result_array();
}
public function withdraw_point($form, $to) {
$this->db->select("\x2a");
$this->db->from("\164\142\154\x52\145\x71\x75\145\163\x74");
$this->db->where("\164\x79\160\145", "\x57\x69\164\150\x64\x72\141\x77\x61\x6c");
$this->db->order_by("\162\145\x71\165\145\x73\x74\x5f\x69\144", "\x44\x45\123\x43");
$this->db->limit(5000);
$this->db->where("\x64\141\164\145\x28\164\x69\x6d\x65\x29\x20\x3e\75\x27{$form}\47");
$this->db->where("\x64\141\x74\145\x28\164\x69\x6d\x65\x29\74\75\47{$to}\47");
$query = $this->db->get();
return $query->result_array();
}
public function withdraw_point_list($request) {
$cdate = date("\x59\55\155\55\144");
$min_date = date("\131\x2d\x6d\x2d\x64", strtotime("\x2d\64\x20\144\141\x79\163"));
$max_date = date("\131\x2d\x6d\55\144", strtotime("\53\61\x20\144\141\171\x73"));
$nextDate = date("\x59\x2d\x6d\55\x64", strtotime("\x2b\x31\x20\x64\141\171", strtotime(date("\x59\55\x6d\x2d\144"))));
$ctime = date("\x48\x3a\x69\x3a\x73", strtotime("\53\x33\60\40\x6d\151\x6e", strtotime(date("\x48\x3a\x69\x3a\163"))));
$sport_id = "\61";
$search_text = isset($request["\x73\145\x61\x72\143\x68"]) && !empty($request["\163\145\141\x72\x63\150"]) ? $request["\x73\145\x61\x72\143\x68"] : '';
$limit = isset($request["\x6c\x65\156\147\164\x68"]) && !empty($request["\154\145\x6e\x67\164\150"]) ? $request["\x6c\x65\156\x67\164\x68"] : 50;
$offset = isset($request["\160\x61\147\x65"]) && !empty($request["\x70\141\147\x65"]) ? ($request["\160\141\147\145"] - 1) * $limit : 0;
$this->db->start_cache();
if (!empty($search_text)) {
$this->db->where("\164\x62\x6c\x52\x65\x71\165\145\x73\164\x2e\x72\x65\161\x75\x65\x73\164\x5f\151\144\40\x4c\x49\x4b\x45\40\x27\x25" . $search_text . "\x25\47");
}
$query = $this->db->where(array("\164\171\160\145" => "\x57\151\x74\x68\144\x72\x61\167\141\x6c"))->order_by("\x72\x65\x71\x75\145\163\164\137\151\144", "\x44\x45\123\x43")->limit($limit, $offset)->get("\x74\x62\154\x52\x65\x71\165\145\x73\164");
$res = $query->result_array();
foreach ($res as $row) {
$user_id = $row["\x75\163\145\162\137\x69\x64"];
$r = $this->db->select("\156\x61\155\145\x2c\x6d\x6f\142\x69\x6c\x65\x6e\157")->from("\x75\x73\x65\x72\137\160\162\x6f\x66\151\154\145")->where("\x69\144", $user_id)->get()->row();
print_r($r);
}
$this->db->stop_cache();
$total = $this->db->select("\x74\x62\x6c\x52\x65\x71\165\145\x73\x74\x2e\162\145\x71\x75\x65\x73\164\137\x69\x64")->where("\x74\x79\160\145", "\127\151\164\150\x64\162\141\167\x61\154")->count_all_results();
$this->db->flush_cache();
$rdata["\x6c\x69\x73\164"] = $res;
$rdata["\x74\157\164\x61\x6c\120\141\147\x65"] = ceil($total / $limit);
$rdata["\164\x6f\x74\x61\x6c\x43\x6f\x75\156\164"] = $total;
return $rdata;
}
public function delete_withdraw_point_req($req_id) {
$row = $this->db->select("\165\163\x65\162\x5f\151\144\54\x53\x55\115\x28\162\x65\x71\x75\145\163\164\x5f\x70\157\151\x6e\164\x73\53\x73\145\162\166\x69\x63\x65\x5f\x63\150\x61\162\147\145\51\x61\163\x20\160\157\x69\x6e\x74")->where("\x72\145\x71\x75\x65\163\x74\137\x69\144", $req_id)->get("\164\142\x6c\x52\x65\161\x75\145\x73\164")->row() ??NULL;
if (isset($row)) {
$this->db->set("\x77\x61\x6c\x6c\x65\x74\x5f\x70\x6f\x69\x6e\164\x73", "\167\141\x6c\154\145\164\x5f\x70\157\151\x6e\x74\163\40\53\40" . (double)$row->point, FALSE);
$this->db->where("\x75\163\x65\x72\x5f\151\144", $row->user_id)->update("\x74\x62\x6c\x77\x61\x6c\154\145\164");
if ($this->db->affected_rows() > 0) {
$this->db->where("\x72\145\x71\165\x65\163\x74\137\x69\x64", $req_id)->delete("\164\x62\154\122\145\161\165\145\163\x74");
}
}
return true;
}
public function transfer_money_history() {
$query = $this->db->order_by("\143\x72\x65\141\x74\x65\x5f\x61\x74", "\x44\x45\123\x43")->get("\x74\142\x6c\164\x72\141\x6e\163\146\145\x72\x5f\x72\x65\161\165\145\x73\164");
return $query->result_array();
}
public function refer_history() {
$query = $this->db->order_by("\x63\162\x65\141\x74\145\x64\137\x61\x74", "\x44\105\x53\x43")->get("\162\145\146\x65\x72\137\150\x69\163\164\157\162\171");
return $query->result_array();
}
public function withdraw_point_req2($id) {
$query = $this->db->get_where("\x74\142\x6c\x52\145\x71\165\x65\163\x74", array("\x72\145\161\165\145\163\164\137\x73\x74\x61\164\x75\x73" => "\160\145\x6e\144\151\156\147", "\x72\x65\161\x75\x65\163\164\137\x69\144" => $id));
$aa = $query->row_array();
$amt = 0;
if (isset($aa)) {
$amt = - $aa["\162\x65\161\x75\x65\x73\164\137\160\157\151\x6e\x74\163"];
}
if ($this->ch_amt($amt, $aa["\x75\x73\145\x72\137\151\x64"]) >= 0) {
$query2 = $this->db->update("\x74\142\154\122\x65\x71\x75\145\x73\x74", array("\162\145\x71\165\145\x73\164\x5f\163\164\141\x74\165\163" => "\x61\160\160\x72\x6f\x76\x65\144"), array("\x72\x65\161\165\x65\x73\x74\x5f\x69\x64" => $id));
}
return $aa;
}
public function withdraw_point_req3($id, $points) {
if ($this->ch_amt($points, $id) >= 0) {
$query = $this->db->query("\125\120\x44\x41\x54\105\40\x74\142\154\167\141\154\x6c\x65\164\40\163\145\164\x20\167\x61\x6c\154\145\164\x5f\x70\x6f\x69\x6e\x74\x73\x3d\167\x61\x6c\154\145\x74\x5f\160\157\x69\156\x74\x73\55\47{$points}\x27\x20\167\x68\145\162\145\x20\165\x73\145\162\137\151\x64\75\x27{$id}\x27\40");
}
if ($query) {
return true;
}
}
public function starline() {
$query = $this->db->query("\11\123\x45\x4c\105\103\x54\40\52\40\106\x52\117\x4d\40\x60\164\142\x6c\x53\164\141\162\154\x69\156\x65\x60");
return $query->result_array();
}
public function starline_update($id) {
$query = $this->db->query("\123\105\114\105\x43\124\40\x2a\x20\106\122\x4f\x4d\x20\140\x74\142\x6c\123\164\x61\x72\x6c\x69\156\x65\x60\40\x77\150\145\162\x65\x20\x69\144\75\47{$id}\47\40");
return $query->result_array();
}
public function starline_update2($id) {
$snum = trim($this->input->post("\163\156\165\x6d"));
$stime = trim($this->input->post("\163\164\151\155\x65"));
$snums = explode("\55", $snum);
$data = array("\163\x5f\147\x61\155\145\137\156\x75\x6d\142\145\162" => $snum, "\163\x5f\147\x61\155\145\137\164\151\x6d\145" => $stime);
$query = $this->db->update("\x74\142\x6c\x53\164\141\x72\x6c\151\156\145", $data, array("\151\144" => $id));
$this->update_chart($id, "\x4a\x61\156\x6e\141\164\x20\x53\x74\x61\x72\x6c\x69\156\x65", $snums[0], $snums[1]);
if ($query) {
return true;
}
}
public function update_user_data($post_image) {
$data = array("\156\x61\155\145" => $this->input->post("\x6e\x61\x6d\145"), "\172\151\x70\x63\x6f\144\x65" => $this->input->post("\172\x69\x70\x63\157\x64\x65"), "\x63\157\156\164\x61\x63\x74" => $this->input->post("\143\157\x6e\x74\x61\143\x74"), "\x61\x64\144\162\145\163\x73" => $this->input->post("\x61\x64\144\162\145\x73\163"), "\x67\x65\x6e\x64\x65\x72" => $this->input->post("\x67\145\x6e\x64\x65\162"), "\x73\x74\141\164\165\163" => $this->input->post("\163\x74\141\164\165\163"), "\144\x6f\x62" => $this->input->post("\x64\157\x62"), "\151\x6d\141\147\145" => $post_image, "\162\145\147\x69\x73\x74\x65\162\x5f\x64\141\164\x65" => date("\x59\55\x6d\55\144\40\x48\x3a\x69\72\163"));
$this->db->where("\151\144", $this->input->post("\151\144"));
$d = $this->db->update("\165\163\x65\x72\163", $data);
}
public function get_siteconfiguration($id = false) {
if ($id === false) {
$query = $this->db->get("\163\x69\164\145\137\x63\157\156\x66\x69\x67");
return $query->result_array();
}
$query = $this->db->get_where("\163\x69\164\x65\137\x63\157\x6e\x66\151\147", array("\151\x64" => $id));
return $query->row_array();
}
public function update_siteconfiguration($id = false) {
if ($id === false) {
$query = $this->db->get("\x73\151\x74\145\x5f\x63\x6f\156\x66\151\147");
return $query->result_array();
}
$query = $this->db->get_where("\163\x69\x74\x65\x5f\143\x6f\156\146\x69\147", array("\x69\x64" => $id));
return $query->row_array();
}
public function update_siteconfiguration_data($post_image) {
$data = array("\x73\151\x74\145\x5f\164\151\x74\x6c\x65" => $this->input->post("\163\x69\164\x65\137\x74\151\x74\154\x65"), "\163\x69\164\145\x5f\x6e\141\155\145" => $this->input->post("\x73\x69\164\145\x5f\x6e\x61\155\145"), "\154\x6f\147\157\137\x69\155\147" => $post_image);
$this->db->where("\151\x64", $this->input->post("\151\x64"));
return $this->db->update("\x73\x69\x74\145\x5f\x63\157\x6e\x66\x69\147", $data);
}
public function get_mobile_data() {
$query = $this->db->get("\x73\151\x74\145\137\x63\x6f\x6e\x66\x69\147");
return $query->row_array();
}
public function update_mobile_data() {
$data = array("\155\157\x62\x69\154\145" => $this->input->post("\x6d\x6f\142\x69\154\145"));
return $this->db->update("\x73\x69\164\145\137\x63\157\x6e\146\x69\147", $data);
}
public function create_slider($post_image) {
$data = array("\164\151\164\x6c\145" => $this->input->post("\164\151\164\154\x65"), "\x69\155\141\147\145" => $post_image, "\144\x65\163\143\x72\x69\x70\164\151\x6f\x6e" => $this->input->post("\144\x65\163\x63\x72\x69\160\x74\x69\157\x6e"), "\163\164\x61\x74\165\x73" => $this->input->post("\x73\x74\x61\164\165\x73"));
return $this->db->insert("\163\154\151\144\x65\x72\x73\137\151\x6d\147", $data);
}
public function get_sliders($id = false) {
if ($id === false) {
$query = $this->db->get("\x73\x6c\x69\x64\x65\x72\163\137\151\x6d\x67");
return $query->result_array();
}
$query = $this->db->get_where("\x73\154\151\x64\x65\162\163\137\x69\155\x67", array("\x69\x64" => $id));
return $query->row_array();
}
public function get_slider_data($id = false) {
if ($id === false) {
$query = $this->db->get("\163\x6c\x69\x64\145\x72\x73\137\x69\155\x67");
return $query->result_array();
}
$query = $this->db->get_where("\163\154\151\x64\x65\162\x73\x5f\151\x6d\x67", array("\x69\x64" => $id));
return $query->row_array();
}
public function update_slider_data($post_image) {
$data = array("\164\151\164\x6c\x65" => $this->input->post("\164\151\x74\154\x65"), "\151\155\x61\147\145" => $post_image, "\x64\x65\163\143\162\151\160\x74\x69\157\156" => $this->input->post("\x64\145\163\x63\162\x69\160\164\151\x6f\x6e"), "\163\164\141\x74\165\x73" => $this->input->post("\x73\x74\x61\x74\165\x73"));
$this->db->where("\151\x64", $this->input->post("\151\x64"));
return $this->db->update("\163\x6c\x69\144\x65\x72\163\x5f\x69\x6d\147", $data);
}
public function getChart() {
return $this->db->get("\x63\150\x61\x72\x74\163")->result_array();
}
public function getChartDetails($name) {
return $this->db->where("\x6e\141\155\145", $name)->get("\143\150\x61\x72\164\163")->result_array();
}
public function update_chart_data() {
$snum = $this->input->post("\163\x6e\x75\155");
$enum = $this->input->post("\x65\x6e\x75\x6d");
$data = array("\156\x61\155\x65" => $this->input->post("\x6e\141\x6d\x65"), "\144\141\x74\145" => $this->input->post("\144\x61\164\x65"), "\x73\164\x61\x72\x74\x69\x6e\x67\137\x6e\165\x6d" => !empty($snum) ? $snum : null, "\x72\x65\163\x75\154\x74\137\x6e\165\155" => $this->input->post("\156\x75\155"), "\x65\156\144\137\156\165\x6d" => !empty($enum) ? $enum : null);
$this->db->where("\x6e\141\155\x65", $this->input->post("\156\x61\x6d\x65") and "\144\141\x74\145", $this->input->post("\144\141\x74\x65"));
return $this->db->update("\143\150\x61\162\164\x73", $data);
}
public function add_chart_data() {
$snum = $this->input->post("\163\156\165\155");
$enum = $this->input->post("\145\156\x75\155");
$data = array("\156\141\155\x65" => $this->input->post("\x63\x68\x61\x72\x74"), "\144\x61\164\145" => $this->input->post("\x64\141\x74\145"), "\x73\164\x61\162\x74\151\x6e\147\x5f\x6e\x75\x6d" => !empty($snum) ? $snum : null, "\162\x65\163\165\154\x74\x5f\156\x75\155" => $this->input->post("\x6e\x75\155"), "\x65\156\144\x5f\x6e\x75\x6d" => !empty($enum) ? $enum : null);
return $this->db->insert("\x63\x68\x61\162\164\163", $data);
}
public function getUserDetails() {
return $this->db->get("\x75\163\145\162\163")->result_array();
}
public function getMatkaDetails() {
return $this->db->get("\155\x61\164\x6b\141")->result_array();
}
public function get_total_users() {
return $this->db->where("\x69\163\137\144\x65\x6c\x65\x74\x65\x64\x20\x3d\x21", "\61")->get("\x75\x73\145\x72\137\x70\162\157\x66\151\x6c\145")->num_rows();
}
public function create_matka($team_image) {
$snum = $this->input->post("\x73\156\x75\155");
$enum = $this->input->post("\145\x6e\x75\155");
$name = $this->input->post("\x6e\141\155\x65");
$query = $this->db->get_where("\155\141\164\153\x61", array("\156\x61\x6d\x65" => $name));
$count = $query->num_rows();
if ($count === 0) {
$data = array("\x6e\141\x6d\x65" => $this->input->post("\x6e\141\155\x65"), "\x73\164\x61\162\x74\137\x74\151\x6d\145" => $this->input->post("\x73\164\151\155\x65"), "\145\156\144\x5f\x74\x69\x6d\x65" => $this->input->post("\145\164\x69\155\145"), "\163\164\x61\x72\164\x69\x6e\147\x5f\156\165\x6d" => !empty($snum) ? $snum : null, "\156\x75\x6d\x62\145\162" => $this->input->post("\x6e\x75\x6d"), "\145\156\144\x5f\156\x75\x6d" => !empty($enum) ? $enum : null, "\x62\x69\144\x5f\163\x74\x61\x72\x74\x5f\x74\151\x6d\145" => $this->input->post("\146\x73\x74\151\155\145"), "\142\x69\x64\x5f\145\x6e\144\137\x74\x69\x6d\145" => $this->input->post("\x66\x65\164\x69\155\x65"));
$data1 = array("\x6e\x61\x6d\145" => $this->input->post("\156\x61\155\145"), "\x64\x61\164\145" => date("\x59\55\x6d\55\144"), "\x73\164\141\x72\164\151\x6e\x67\137\x6e\x75\155" => $this->input->post("\x73\156\x75\155"), "\162\145\x73\x75\x6c\x74\x5f\x6e\165\x6d" => $this->input->post("\x6e\165\x6d"), "\x65\x6e\x64\137\x6e\x75\155" => $this->input->post("\x65\x6e\x75\155"));
$this->session->set_flashdata("\x73\165\143\143\145\x73\163", "\131\x6f\x75\162\x20\155\141\x74\x6b\141\x20\150\x61\163\40\142\145\145\x6e\40\x63\x72\x65\141\x74\145\x64\56");
$this->db->insert("\155\141\164\153\x61", $data);
$this->db->insert("\x63\x68\x61\162\x74\x73", $data1);
$ref = "\x6c\x69\x73\164";
} else {
$ref = "\141\144\144";
$this->session->set_flashdata("\x66\x61\151\x6c", "\x4e\x61\155\145\x20\x61\154\162\x65\141\x64\x79\40\105\x78\x69\163\164\40\x2e");
}
return $ref;
}
public function listmatka($teamId = false, $limit = false, $offset = false) {
if ($limit) {
$this->db->limit($limit, $offset);
}
if ($teamId === false) {
$this->db->select("\52\x2c\111\106\50\x69\x73\137\150\157\x6d\145\160\141\x67\145\137\x67\141\x6d\145\40\x3d\x20\61\54\x20\x43\x4f\116\103\101\124\50\163\164\x61\x72\164\x69\x6e\147\x5f\x6e\165\155\54\x20\x27\40\130\40\47\x2c\40\x65\x6e\x64\137\156\x75\x6d\51\x2c\x6e\x75\x6d\x62\145\162\51\x20\101\123\40\162\145\163\x75\154\164");
$this->db->order_by("\155\141\x74\x6b\x61\x2e\x6d\141\164\153\x61\137\157\x72\x64\145\x72", "\101\x53\103");
$query = $this->db->get("\155\x61\x74\x6b\x61");
return $query->result_array();
}
$this->db->select("\x6d\141\164\153\x61\x2e\52\54\x74\x62\x6c\116\157\164\x69\x63\145\x2e\162\x61\164\x65\40\x61\x73\40\x6d\x61\162\x6b\x65\164\x5f\x72\x61\x74\x65");
$this->db->where("\x6d\x61\x74\153\141\56\151\144", $teamId)->from("\155\x61\164\153\141");
$this->db->join("\164\142\x6c\x4e\x6f\x74\x69\143\145", "\x74\x62\x6c\116\157\164\x69\x63\145\x2e\151\x64\40\75\x20\155\x61\x74\153\x61\56\151\144", "\x6c\145\146\x74");
return $query = $this->db->get()->row_array();
}
public function memberlistteams($id) {
$this->db->order_by("\x6d\x61\164\153\141\x2e\x69\x64", "\104\105\123\x43");
return $query->result_array();
}
public function update_team_data() {
$c = 0;
$snum = $this->input->post("\163\156\x75\155") ??NULL;
$enum = $this->input->post("\x65\156\x75\155") ??NULL;
$num = $this->input->post("\156\165\x6d") ??NULL;
$id = $this->input->post("\151\x64");
$name = $this->input->post("\x6e\141\155\x65");
$date = $this->input->post("\x75\144\x61\x74\x65");
$data = array("\156\141\x6d\x65" => $name, "\163\164\141\162\x74\151\x6e\147\137\156\165\x6d" => !empty($snum) ? $snum : null, "\x6e\165\155\x62\145\x72" => !empty($num) ? $num : null, "\145\x6e\144\x5f\156\165\155" => !empty($enum) ? $enum : null, "\142\151\144\137\x73\164\x61\162\x74\x5f\164\151\155\145" => $this->input->post("\146\163\164\151\x6d\145"), "\142\151\x64\x5f\145\x6e\x64\x5f\x74\151\155\x65" => $this->input->post("\146\145\x74\151\155\x65"), "\163\164\141\162\x74\137\x74\x69\155\x65" => $this->input->post("\146\x73\164\x69\155\145"), "\x65\x6e\144\x5f\x74\151\155\x65" => $this->input->post("\x66\x65\x74\151\x6d\x65"), "\163\x61\x74\x5f\x73\164\x61\x72\x74\137\x74\151\x6d\x65" => $this->input->post("\146\163\x74\151\155\x65"), "\x6d\x61\164\153\x61\137\x72\x61\164\x65" => $this->input->post("\155\141\x74\x6b\141\x5f\162\x61\x74\145"), "\163\141\x74\x5f\x65\156\144\137\x74\x69\155\x65" => $this->input->post("\x66\145\164\x69\x6d\145"));
$this->db->where("\151\x64", $id);
$this->db->update("\155\x61\x74\153\141", $data);
$home_page_game = $this->db->select("\x69\163\x5f\x68\x6f\x6d\145\160\x61\147\x65\x5f\x67\x61\155\x65")->where("\151\x64", $id)->get("\x6d\x61\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("\x6e\141\x6d\x65" => $name, "\x63\151\x64" => $id, "\x64\x61\164\x65" => $dt, "\x73\164\x61\162\164\151\156\x67\x5f\x6e\165\155" => !empty($snum) ? $snum : null, "\x72\x65\x73\x75\x6c\164\137\156\x75\155" => $num, "\x65\x6e\x64\137\156\x75\x6d" => !empty($enum) ? $enum : null);
$where = array("\x63\151\144" => $id, "\144\141\164\145" => $dt);
$data2 = $this->db->select("\103\117\125\x4e\124\50\x69\144\x29\40\141\x73\40\x63\x6f\165\156\x74\145\x72")->where($where)->get("\143\x68\141\x72\x74\163")->row();
if ($data2->counter > 0) {
$this->db->where($where);
$this->db->update("\143\x68\x61\x72\x74\x73", $data1);
} else {
$this->db->insert("\143\x68\x61\x72\164\x73", $data1);
}
if (!empty($snum) && !empty($enum)) {
$message = $snum . "\40\x58\40" . $enum;
} elseif (!empty($snum) && empty($enum)) {
$message = $snum;
} elseif (empty($snum) && !empty($enum)) {
$message = $enum;
} else {
$message = $num;
}
@sendPushNotification("\x6f\156\x6c\x69\156\x65\x5f\x74\x65\x65\162\137\142\x61\172\x61\x72", $name, $message, 2);
return true;
}
public function get_admin_data() {
$id = $this->session->userdata("\165\163\x65\x72\x5f\x69\144");
if ($id === false) {
$query = $this->db->get("\165\163\x65\x72\163");
return $query->result_array();
}
$query = $this->db->get_where("\165\163\x65\x72\163", array("\x69\x64" => $id));
return $query->row_array();
}
public function change_password($new_password) {
$data = array("\x70\141\163\x73\167\157\x72\144" => md5($new_password));
$this->db->where("\151\x64", $this->session->userdata("\165\163\x65\x72\137\x69\144"));
return $this->db->update("\x75\x73\145\162\x73", $data);
}
public function match_old_password($password) {
$id = $this->session->userdata("\x75\x73\x65\162\x5f\151\144");
if ($id === false) {
$query = $this->db->get("\165\x73\145\x72\163");
return $query->result_array();
}
$query = $this->db->get_where("\x75\163\x65\x72\x73", array("\x70\x61\x73\163\x77\x6f\162\x64" => $password));
return $query->row_array();
}
public function email_exists() {
$email = $this->input->post("\145\155\141\x69\154");
$query = $this->db->query("\123\x45\x4c\x45\x43\124\40\x65\155\x61\x69\154\x2c\40\x70\141\x73\x73\167\157\x72\144\x20\x46\x52\x4f\115\40\165\163\x65\x72\163\40\127\110\105\122\105\x20\145\x6d\x61\151\x6c\x3d\x27{$email}\x27");
if ($row = $query->row()) {
return true;
} else {
return false;
}
}
public function temp_reset_password($temp_pass) {
$data = array("\145\155\x61\151\x6c" => $this->input->post("\145\155\141\151\154"), "\x72\145\163\x65\164\137\160\x61\163\x73" => $temp_pass);
$email = $data["\145\155\141\151\x6c"];
if ($data) {
$this->db->where("\145\x6d\x61\151\154", $email);
$this->db->update("\x75\163\145\x72\x73", $data);
return true;
} else {
return false;
}
}
public function is_temp_pass_valid($temp_pass) {
$this->db->where("\x72\x65\163\x65\x74\x5f\160\141\x73\x73", $temp_pass);
$query = $this->db->get("\x75\x73\x65\x72\163");
if ($query->num_rows() == 1) {
return true;
} else {
return false;
}
}
public function deletepackage($id) {
$data = array("\x73\x74\141\164\165\163" => 2);
$this->db->where("\x69\x64", $id);
return $this->db->update("\x70\141\143\x6b\141\147\145", $data);
}
public function add_wallet_4($id, $wa, $wallet = '') {
if ($wallet != '') {
if ($wallet == "\x77\x61\154\154\145\x74\137\160\x6f\151\x6e\x74\x73") {
$query = $this->db->query("\x55\x70\144\x61\164\x65\40\164\142\154\x77\x61\154\154\145\x74\40\x73\x65\x74\x20\x77\141\x6c\154\x65\x74\137\x70\x6f\151\156\164\x73\x3d\x77\x61\x6c\x6c\x65\x74\137\x70\157\151\x6e\x74\x73\53\x27{$wa}\47\x20\x77\150\145\x72\145\x20\165\163\x65\x72\137\151\144\75\x27{$id}\x27");
} else {
$query = $this->db->query("\x55\x70\x64\x61\164\145\40\164\142\154\167\x61\154\x6c\x65\164\x20\163\x65\164\x20\x6d\141\x69\x6e\137\167\x61\154\154\x65\x74\x5f\x70\157\151\156\164\x73\x3d\155\141\x69\x6e\x5f\167\x61\154\x6c\145\x74\x5f\x70\157\x69\x6e\164\163\53\x27{$wa}\47\40\x77\150\145\162\x65\40\x75\163\x65\162\137\151\x64\x3d\47{$id}\47");
}
} else {
$query = $this->db->query("\125\x70\x64\x61\164\x65\40\x74\x62\154\167\141\x6c\x6c\145\x74\x20\x73\145\164\40\155\x61\x69\156\x5f\167\141\x6c\154\x65\x74\137\x70\157\151\x6e\164\163\x3d\155\x61\x69\x6e\x5f\167\141\154\x6c\x65\164\x5f\x70\157\x69\156\x74\163\x2b\x27{$wa}\x27\40\x77\x68\x65\x72\145\x20\x75\163\x65\162\137\151\x64\75\x27{$id}\x27");
}
if ($query) {
return true;
}
}
public function add_MarketData($data) {
$data = $this->db->insert("\x6d\141\164\x6b\x61", $data);
return $data;
}
public function inactiveUserList() {
$now = date("\x59\55\155\55\144");
$date = date("\131\55\x6d\x2d\144", strtotime("\55\x32\x20\x6d\157\x6e\x74\150\x73"));
$request_data = $this->db->select("\165\163\145\162\137\x69\144")->where("\144\x61\x74\145\x28\x74\151\x6d\x65\x29\76\75", $date)->group_by("\x75\163\145\162\137\x69\144")->order_by("\165\x73\145\162\x5f\151\x64", "\104\105\123\103")->get("\164\142\x6c\x52\145\x71\165\145\x73\164")->result();
$request_id = count($request_data) > 0 ? array_column($request_data, "\165\x73\145\x72\x5f\151\144") : array();
$game_data = $this->db->select("\x75\x73\x65\162\137\x69\x64")->where("\144\x61\164\x65\50\x74\151\x6d\145\x29\x3e\75", $date)->group_by("\165\163\145\162\x5f\x69\x64")->order_by("\x75\x73\145\162\x5f\151\144", "\x44\105\x53\x43")->get("\164\x62\154\147\141\x6d\x65\144\141\x74\x61")->result();
$game_id = count($game_data) > 0 ? array_column($game_data, "\x75\x73\x65\162\x5f\x69\x64") : array();
$inactive_user = array_unique(array_merge($request_id, $game_id));
if (!empty($inactive_user)) {
$this->db->where_not_in("\151\144", $inactive_user);
}
$user_data = $this->db->select("\165\56\156\x61\155\145\54\x75\56\165\163\145\x72\156\x61\x6d\x65\54\x75\56\155\157\142\x69\154\145\156\x6f\54\x75\x2e\x65\x6d\141\151\x6c\x2c\x75\x2e\141\x64\144\162\x65\163\163\x2c\165\56\160\141\163\x73\167\x6f\162\x64\x2c\164\56\x77\x61\x6c\x6c\x65\x74\137\x70\157\x69\x6e\164\163\x2c\164\56\x6d\x61\151\156\x5f\x77\x61\154\154\145\x74\x5f\160\157\x69\x6e\x74\x73")->from("\x75\163\145\x72\137\160\162\x6f\x66\151\154\x65\40\165")->join("\x74\142\x6c\x77\141\x6c\x6c\x65\x74\40\164", "\165\56\151\x64\x3d\164\56\x75\163\145\162\137\x69\144")->get()->result();
return $user_data;
}
public function change_status_userlist($id, $set_status = 0) {
$data = array("\x6c\157\147\151\x6e\x5f\163\x74\x61\164\165\163" => $set_status);
$this->db->where("\x69\144", $id);
return $this->db->update("\x75\x73\x65\162\137\160\x72\157\x66\x69\154\145", $data);
}
public function deleteuserlist($id) {
$data = array("\151\x73\x5f\x64\x65\x6c\x65\x74\x65\144" => 1, "\155\x6f\x62\x69\154\145\x6e\x6f" => "\x30");
$this->db->where("\151\x64", $id);
return $this->db->set("\144\x65\x6c\x65\164\145\x64\137\x6d\x6f\142\151\x6c\145\x6e\x6f", "\155\x6f\x62\151\154\145\x6e\157", false)->update("\165\x73\145\162\137\160\162\157\x66\151\x6c\x65", $data);
}
public function user_registered($date) {
$query = $this->db->query("\x53\x45\114\x45\x43\124\x20\52\40\x46\122\x4f\115\40\140\165\x73\145\162\x5f\x70\x72\x6f\x66\x69\154\x65\140\x20\127\110\105\x52\x45\x20\x44\x41\x54\105\50\x60\164\x69\155\x65\x60\51\x20\75\40\x27{$date}\x27\x20\141\x6e\x64\x20\x69\x73\x5f\144\145\154\145\164\145\144\x20\x21\75\47\61\47");
return $query->num_rows();
}
public function this_week_user_registered() {
$d = strtotime("\x74\x6f\144\x61\x79");
$start_week = strtotime("\154\x61\x73\x74\40\x73\x75\156\x64\x61\x79\x20\x6d\151\x64\x6e\x69\x67\x68\x74", $d);
$end_week = strtotime("\156\145\x78\164\40\x73\141\x74\165\x72\144\141\171", $d);
$start = date("\131\55\155\x2d\144", $start_week);
$end = date("\131\x2d\155\55\x64", $end_week);
$query = $this->db->query("\123\x45\x4c\105\x43\x54\x20\x2a\40\x46\x52\117\115\x20\x60\165\163\x65\162\137\x70\162\x6f\146\x69\154\145\x60\x20\x57\110\x45\122\105\x20\x44\x41\124\105\50\140\164\x69\x6d\x65\140\51\40\76\75\40\x27{$start}\x27\40\x41\x4e\104\40\104\x41\x54\x45\x28\140\x74\151\x6d\x65\x60\51\x20\x3c\75\40\x27{$end}\x27\40\x61\156\x64\x20\151\x73\137\144\x65\154\145\164\x65\x64\40\41\75\47\61\47");
return $query->num_rows();
}
public function last_week_user_registered() {
$previous_week = strtotime("\55\x31\40\167\145\x65\x6b\x20\x2b\61\40\x64\x61\x79");
$start_week = strtotime("\x6c\x61\x73\164\40\163\165\156\x64\141\x79\40\155\151\x64\x6e\151\x67\150\x74", $previous_week);
$end_week = strtotime("\156\x65\170\164\x20\163\x61\164\165\x72\144\141\171", $start_week);
$start_week = date("\131\55\155\55\144", $start_week);
$end_week = date("\131\x2d\155\55\144", $end_week);
$query = $this->db->query("\x53\x45\114\x45\103\x54\40\52\x20\106\x52\117\115\x20\x60\x75\x73\x65\x72\x5f\160\162\157\x66\x69\x6c\145\x60\x20\127\x48\105\x52\105\40\x44\x41\x54\x45\x28\x60\x74\x69\x6d\145\x60\51\40\x3e\x3d\40\x27{$start_week}\47\x20\x41\116\104\40\x44\101\124\x45\50\140\164\151\155\x65\x60\51\40\x3c\x3d\x20\x27{$end_week}\47\x20\x61\156\x64\x20\151\163\137\144\145\x6c\x65\164\x65\144\x20\x21\75\x27\61\47");
return $query->num_rows();
}
public function current_month_user_registered() {
$first = date("\131\55\155\x2d\60\x31");
$last = date("\131\x2d\155\x2d\x64");
$query = $this->db->query("\x53\105\114\x45\x43\x54\40\52\40\106\x52\x4f\115\40\140\165\x73\x65\x72\x5f\160\162\x6f\146\151\154\x65\140\40\127\x48\x45\x52\105\40\x44\x41\124\105\50\140\164\151\155\x65\140\51\40\x3e\75\x20\x27{$first}\x27\x20\x41\116\104\x20\104\x41\x54\x45\50\x60\x74\151\x6d\x65\140\51\40\x3c\x3d\40\x27{$last}\47\x20\141\x6e\x64\40\x69\163\x5f\x64\x65\154\145\164\x65\144\40\41\x3d\47\61\47");
return $query->num_rows();
}
public function last_month_user_registered() {
$first = date("\x59\x2d\155\x2d\144", strtotime("\146\151\x72\x73\164\40\144\x61\171\x20\x6f\146\x20\160\162\x65\166\151\x6f\x75\x73\x20\155\157\x6e\x74\150"));
$last = date("\131\x2d\x6d\x2d\144", strtotime("\154\x61\163\x74\40\144\141\171\40\157\146\x20\x70\162\x65\x76\151\x6f\x75\163\x20\x6d\x6f\156\x74\x68"));
$query = $this->db->query("\x53\105\x4c\x45\103\124\x20\x2a\40\106\122\117\115\x20\140\x75\163\145\x72\137\160\x72\x6f\146\x69\154\x65\140\40\127\x48\x45\x52\x45\x20\x44\x41\124\x45\x28\140\164\151\x6d\x65\140\x29\40\76\75\40\47{$first}\47\x20\x41\x4e\104\x20\x44\x41\x54\105\x28\x60\164\x69\155\145\x60\x29\x20\74\x3d\x20\x27{$last}\47\x20\x61\156\144\40\x69\163\x5f\x64\145\154\x65\x74\x65\x64\40\x21\x3d\x27\61\x27");
return $query->num_rows();
}
public function logged_in_users() {
$query = $this->db->query("\x73\x65\x6c\145\143\x74\x20\143\157\165\x6e\x74\x28\151\163\x5f\x6c\157\x67\x69\156\x29\x20\141\x73\40\154\x6f\x6f\147\145\x64\151\156\x75\163\x65\162\163\40\146\x72\x6f\x6d\x20\165\x73\x65\162\x5f\160\x72\157\x66\151\x6c\145\x20\167\150\x65\162\145\40\x69\x73\x5f\x6c\x6f\x67\x69\156\40\x3d\40\x27\x31\x27\40");
return $a = $query->row()->loogedinusers??0;
}
public function zero_balance_users() {
$this->db->select("\103\x4f\125\x4e\124\x28\104\x49\123\124\x49\x4e\x43\124\x20\x43\x41\123\105\x20\x57\110\105\116\x20\x77\141\154\154\145\x74\x5f\160\x6f\x69\156\x74\x73\40\x3d\x20\60\40\x41\x4e\x44\x20\x6d\141\x69\x6e\x5f\167\141\x6c\x6c\x65\164\x5f\x70\x6f\151\156\x74\x73\x20\75\x20\60\40\124\x48\105\116\40\165\163\x65\x72\137\151\144\x20\105\116\104\51\x20\101\123\40\x7a\x65\162\157\x5f\142\x61\154\141\156\x63\x65\x5f\165\x73\x65\162");
return $query = $this->db->get("\164\x62\154\x77\141\x6c\x6c\145\164")->row()->zero_balance_user;
}
public function today_zero_balance_users() {
$this->db->select("\103\x4f\125\116\124\50\x44\x49\x53\124\111\x4e\x43\x54\x20\103\x41\x53\105\40\127\110\105\x4e\x20\167\x61\154\154\145\164\x5f\x70\x6f\151\x6e\164\163\40\x3d\x20\60\40\101\x4e\104\x20\155\141\151\156\x5f\167\141\x6c\x6c\x65\x74\x5f\160\x6f\151\156\x74\163\40\75\40\60\x20\x54\110\x45\x4e\x20\165\x73\x65\162\137\x69\144\x20\x45\x4e\104\51\x20\101\123\x20\x7a\145\x72\x6f\137\165\x73\x65\162");
$this->db->where("\x44\x41\x54\x45\50\x75\x70\144\x61\x74\145\144\137\x61\x74\x29", date("\131\55\155\x2d\144"));
$this->db->where("\x75\x70\x64\141\164\x65\x64\137\x61\x74\x20\111\x53\40\x4e\x4f\124\x20\x4e\x55\114\x4c");
return $query = $this->db->get("\x74\x62\x6c\x77\x61\x6c\154\145\x74")->row()->zero_user;
}
public function banned_users() {
$query = $this->db->query("\x73\x65\154\x65\143\x74\x20\143\x6f\165\x6e\x74\50\154\157\x67\x69\x6e\137\163\x74\x61\x74\x75\163\x29\x20\x61\163\x20\142\x61\x6e\x6e\x65\144\x5f\165\x73\x65\162\163\40\146\x72\x6f\x6d\40\165\x73\145\x72\137\x70\x72\157\146\x69\x6c\x65\x20\x77\150\x65\x72\145\x20\154\x6f\147\x69\156\137\163\164\x61\x74\x75\163\40\75\40\47\61\47\x20");
return $query->row()->banned_users??0;
}
public function total_deposited_amount() {
$last_date = date("\x59\55\x6d\x2d\x64\x20\x30\x30\72\60\60\x3a\60\61");
$query = $this->db->query("\163\145\x6c\145\x63\x74\x20\x69\146\50\123\125\115\50\162\x65\x71\x75\145\163\x74\x5f\160\157\x69\156\x74\x73\x29\x20\x69\x73\x20\156\x75\154\x6c\54\60\54\x53\125\115\50\162\145\x71\165\145\163\164\x5f\160\157\x69\156\164\163\x29\x29\40\141\x73\40\144\145\160\157\163\151\164\x5f\141\x6d\x6f\165\x6e\164\x20\12\x20\40\40\40\40\x20\40\x20\40\40\x20\40\146\162\x6f\x6d\x20\x74\142\x6c\122\x65\161\x75\x65\163\x74\40\167\150\145\x72\145\x20\x74\x79\x70\x65\75\x27\101\144\144\47\x20\141\156\144\x20\x74\x69\x6d\145\40\x3e\75\x20\47{$last_date}\47");
$a = $query->row();
if ($a != '') {
return $query->row()->deposit_amount;
} else {
return 0;
}
}
public function total_withdraw_amount() {
$query = $this->db->query("\x73\145\x6c\x65\143\x74\x20\151\x66\x28\123\125\x4d\50\162\x65\161\x75\x65\163\164\137\x70\x6f\151\156\164\163\51\40\x69\x73\x20\x6e\165\x6c\154\x2c\60\54\x53\x55\115\50\x72\x65\161\x75\x65\163\x74\137\x70\157\x69\156\x74\x73\x29\x29\x20\x61\x73\x20\167\x69\x74\x68\x64\x72\x61\x77\154\137\x61\155\157\x75\x6e\x74\40\x66\x72\157\155\40\164\142\x6c\x52\x65\161\165\x65\163\164\40\x77\150\145\x72\x65\40\x74\x79\x70\x65\x3d\47\127\x69\x74\150\x64\x72\141\x77\x61\x6c\x27\40\x61\x6e\144\x20\x72\145\x71\x75\145\163\164\137\x73\164\x61\164\165\163\75\x27\141\x70\160\x72\x6f\x76\145\144\x27\x20\141\156\144\x20\164\151\x6d\x65\x20\76\x3d\40\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("\131\x2d\x6d\55\x64", strtotime("\55\61\40\144\x61\x79"));
$wallet_amt = $this->db->select("\122\117\x55\116\x44\x28\x53\x55\115\50\x77\x61\154\x6c\145\164\137\x70\157\151\156\x74\x73\40\x2b\x20\x6d\141\x69\156\x5f\x77\x61\x6c\x6c\145\x74\x5f\x70\x6f\151\156\x74\x73\51\x29\x20\141\163\x20\x61\x6d\x74")->get("\x74\x62\x6c\167\141\x6c\x6c\x65\164")->row()->amt??0;
$win_amt = $this->db->select("\x53\125\x4d\50\x61\155\164\x29\x20\x61\163\x20\167\151\x6e\x6e\x69\156\x67\x5f\x61\155\x6f\165\x6e\x74")->where(array("\164\x79\x70\145" => "\x63", "\104\101\124\105\50\x74\x69\x6d\x65\x29\40\76\x3d" => $yesterday))->get("\150\151\x73\x74\x6f\x72\x79")->row()->winning_amount??0;
$this->db->select_sum("\x52\117\x55\116\x44\x28\101\102\123\50\x72\145\x71\165\145\x73\164\137\x70\157\151\156\x74\163\51\x29", "\167\151\x74\x68\x64\x72\141\167\154\x5f\141\x6d\x6f\x75\x6e\164")->where(array("\x74\171\x70\x65" => "\127\151\164\150\144\162\141\167\141\154", "\x72\x65\x71\165\145\163\164\137\x73\164\141\x74\x75\163" => "\141\160\160\x72\x6f\x76\145\x64"))->where("\x44\101\124\x45\50\x74\x69\x6d\x65\51\40\76\75", $yesterday);
$withdrawal_amt = $this->db->get("\x74\142\154\x52\x65\161\165\145\x73\164")->row()->withdrawl_amount??0;
$this->db->select_sum("\162\x65\x71\x75\145\x73\164\x5f\x70\157\151\x6e\164\x73", "\144\145\x70\157\163\x69\x74\x5f\141\155\157\165\x6e\x74")->where(array("\x74\171\x70\145" => "\101\144\144", "\162\x65\x71\x75\x65\163\x74\137\163\x74\141\x74\x75\163" => "\x61\160\x70\x72\x6f\166\x65\x64", "\104\x41\x54\105\50\x74\151\155\x65\x29\40\x3e\x3d" => $yesterday));
$deposit_amt = $this->db->get("\164\142\154\x52\x65\x71\x75\145\163\164")->row()->deposit_amount??0;
$this->db->select_sum("\x70\157\151\x6e\164\163", "\142\145\x74\x74\x69\x6e\x67\x5f\x61\155\157\165\156\x74")->where("\x44\101\x54\105\x28\x74\151\155\145\x29\40\76\x3d", $yesterday);
$bet_played_amt = $this->db->get("\164\x62\154\x67\141\155\145\x64\141\164\141")->row()->betting_amount??0;
$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("\x52\x4f\125\x4e\104\50\x53\125\x4d\x28\x41\x42\123\x28\x72\145\161\165\x65\163\164\x5f\160\157\x69\x6e\x74\163\x29\51\x2c\x32\51\40\141\x73\x20\160\157\x69\x6e\164")->where(array("\x72\x65\161\x75\145\163\164\137\x73\x74\141\164\165\163" => "\x61\160\x70\162\157\x76\145\144", "\164\x79\x70\145" => "\x57\151\164\150\144\162\x61\167\x61\x6c", "\104\x41\x54\105\50\164\151\x6d\x65\x29" => date("\x59\55\155\55\144")))->get("\164\x62\154\122\145\161\x75\145\163\x74")->row()->point??0;
}
public function today_deposit() {
return $this->db->select("\x53\125\x4d\x28\162\x65\x71\165\145\163\164\137\x70\157\151\x6e\164\163\51\x20\x61\x73\x20\x70\x6f\151\x6e\164")->where(array("\162\x65\161\165\x65\x73\x74\x5f\x73\x74\x61\164\x75\163" => "\x61\x70\160\x72\x6f\x76\x65\x64", "\x74\171\x70\145" => "\101\x64\144", "\x44\101\124\x45\50\x74\x69\x6d\145\x29" => date("\131\x2d\155\x2d\144")))->where("\151\x73\x5f\143\x61\x73\150\x62\141\143\153\x20\x49\x53\40\x4e\x55\114\114")->get("\x74\142\154\x52\145\x71\165\145\163\x74")->row()->point??0;
}
public function today_bid_amount() {
return $query = $this->db->select("\123\125\115\x28\141\155\164\51\40\x61\163\x20\160\157\x69\x6e\164")->where(array("\164\x79\x70\x65" => "\144", "\x44\x41\x54\105\50\164\x69\x6d\x65\x29" => date("\x59\x2d\155\55\x64")))->get("\x68\x69\163\x74\x6f\x72\171")->row()->point??0;
}
public function total_amount_wallet($type = '') {
return $this->db->select("\x53\125\x4d\50{$type}\x29\40\141\x73\x20\x61\x6d\x74")->get("\x74\x62\x6c\167\141\x6c\154\145\x74")->row()->amt??0;
}
public function count_active_users() {
$query = $this->db->query("\x73\145\154\145\x63\164\x20\x63\x6f\165\x6e\x74\x28\x6c\x6f\147\x69\156\x5f\x73\x74\141\164\165\x73\51\x20\x61\163\x20\141\x63\x74\151\x76\x65\x5f\165\163\145\162\x73\x20\146\x72\x6f\155\40\165\163\x65\x72\137\160\162\x6f\146\151\154\x65\40\x77\150\x65\162\145\40\151\163\x5f\144\x65\154\145\164\145\144\x20\41\75\x27\61\47\x20");
$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\x28\141\x6d\164\x29\40\x61\163\40\160\x6f\151\156\164")->where(array("\164\171\160\145" => "\143", "\104\101\x54\105\50\x74\x69\155\145\x29" => date("\131\x2d\155\55\x64")))->get("\150\x69\163\164\x6f\162\171")->row()->point??0;
}
public function today_deposit_manually() {
$now = date("\x59\x2d\x6d\x2d\x64");
return $data = $this->db->select("\123\125\115\x28\x72\x65\161\165\x65\x73\164\x5f\160\157\151\x6e\x74\163\x29\141\163\x20\141\155\157\165\156\164")->where(array("\x64\x61\x74\x65\50\164\x69\x6d\x65\x29" => $now, "\x69\163\x5f\161\162\143\x6f\x64\x65" => 0, "\164\171\160\x65" => "\x41\144\x64", "\162\145\161\x75\145\x73\164\137\163\x74\141\x74\x75\x73" => "\141\x70\x70\x72\157\166\x65\144"))->get("\x74\x62\x6c\122\x65\161\165\x65\163\164")->row()->amount??0;
}
public function today_withdrwal_manually() {
$now = date("\131\55\x6d\55\x64");
return $data = $this->db->select("\123\x55\x4d\50\101\x42\x53\x28\162\145\x71\165\x65\x73\164\x5f\x70\x6f\151\x6e\164\x73\51\x29\x61\163\40\x61\x6d\157\x75\156\164")->where(array("\x64\x61\164\145\x28\x74\151\155\x65\51" => $now, "\151\163\x5f\x71\x72\143\x6f\144\x65" => 0, "\x74\x79\x70\x65" => "\x57\151\164\x68\144\162\x61\x77\141\154", "\x72\145\x71\165\x65\x73\x74\137\163\164\141\x74\x75\163" => "\x61\x70\160\x72\x6f\x76\x65\x64"))->get("\164\x62\154\122\x65\161\165\x65\x73\x74")->row()->amount??0;
}
public function change_status_market($id, $set_status = "\x61\143\164\x69\x76\145") {
$data = array("\x73\164\141\164\165\x73" => $set_status);
$this->db->where("\x69\144", $id);
return $this->db->update("\155\141\164\153\141", $data);
}
public function rate_range($id) {
return $this->db->select("\x72\x61\x74\x65\137\162\141\156\147\x65")->where("\151\144", $id)->get("\x74\x62\x6c\x4e\x6f\x74\151\143\x65")->row();
}
public function update_game_rate($rate, $id) {
$data = array("\x70\157\151\156\x74\163" => $rate);
$this->db->where("\x67\141\155\145\137\x69\x64", $id);
$this->db->update("\x74\x62\x6c\147\x61\155\x65", $data);
return true;
}
} ?>