Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php class Administrator_Model extends CI_Model { public function __construct() { ..
Decoded Output download
<?php
class Administrator_Model extends CI_Model {
public function __construct() {
$this->load->database();
}
public function adminLogin($email, $encrypt_password) {
$this->db->where("email", $email);
$this->db->where("password", $encrypt_password);
$result = $this->db->get("users");
if ($result->num_rows() == 1) {
return $result->row(0);
} else {
return false;
}
}
public function app_setting() {
$query = $this->db->get("app_setting");
$app_data = $query->row();
return $app_data;
}
public function withdrawal_slot() {
$query = $this->db->get("timeslots");
$app_data = $query->row();
return $app_data;
}
public function stastics($type = '') {
if ($type == '') {
$stats = 0;
}
if ($type == "add_point") {
$stats = $this->db->select("SUM(request_points) as points")->where(array("type" => "Add", "request_status" => "approved"))->get("tblRequest")->row()->points;
}
if ($type == "withdrawl_point") {
$stats = $this->db->select("SUM(request_points) as points")->where(array("type" => "Withdrawal", "request_status" => "approved"))->get("tblRequest")->row()->points * -1;
}
if ($stats == '') {
$stats = 0;
}
return $stats;
}
public function games() {
return $this->db->select("*")->where("is_deleted", 0)->from("tblgame")->order_by("game_id", "DESC")->get()->result();
}
public function gamedata($from = '', $to = '', $type = '') {
$fc_game_id = $this->db->select("id")->where(array("is_homepage_game" => "1", "is_fc_game" => "1"))->get("matka")->result();
$fc_id = count($fc_game_id) > 0 ? array_column($fc_game_id, "id") : array();
$this->db->select(",id,user_id,matka_id,bs_game_name,game_name,points,bet_type,time,digits,status");
$this->db->order_by("id", "DESC");
$this->db->where("date(time) BETWEEN '{$from}' AND '{$to}' ");
if (!empty($fc_id) && $type == "is_fc_game") {
$this->db->where_in("matka_id", $fc_id);
} else {
$this->db->where_not_in("matka_id", $fc_id);
}
return $this->db->get("tblgamedata")->result();
}
public function gamebyid($id) {
$this->db->where("id", $id);
return $this->db->get("games")->row();
}
public function userbyid($id) {
$this->db->where("id", $id);
return $this->db->get("user_profile")->row();
}
public function matkabyid($id) {
$this->db->where("id", $id);
return $this->db->get("matka")->row();
}
public function update_appsetting() {
$app = array("message" => mb_convert_encoding($this->input->post("message"), "HTML-ENTITIES", "UTF-8"), "home_text" => mb_convert_encoding($this->input->post("hometext"), "HTML-ENTITIES", "UTF-8"), "withdraw_text" => mb_convert_encoding($this->input->post("withdrawtext"), "HTML-ENTITIES", "UTF-8"), "withdraw_no" => $this->input->post("withdrawnumber"), "whatsapp_no" => $this->input->post("whatsapp_no"), "upi" => $this->input->post("upi"), "upi_name" => $this->input->post("upi_name"), "min_amount" => $this->input->post("min_amount"), "w_amount" => $this->input->post("w_amount"), "how_to_play" => $this->input->post("how_to_play"), "add_point_text" => mb_convert_encoding($this->input->post("add_point_text"), "HTML-ENTITIES", "UTF-8"), "add_transfer_text" => mb_convert_encoding($this->input->post("add_transfer_text"), "HTML-ENTITIES", "UTF-8"), "withdraw_note" => mb_convert_encoding($this->input->post("withdraw_note"), "HTML-ENTITIES", "UTF-8"), "refer_amount" => $this->input->post("refer_amount"), "upi_desc" => $this->input->post("upi_desc"), "telegram_id" => $this->input->post("telegram_id"), "transfer_fee" => $this->input->post("transfer_fee"), "fund_mode" => $this->input->post("fund_mode"), "running_home_text" => mb_convert_encoding($this->input->post("running_home_text"), "HTML-ENTITIES", "UTF-8"), "max_bid_amount" => $this->input->post("max_bid_amount"), "max_withdraw" => $this->input->post("max_withdraw"), "withdraw_alert_message" => mb_convert_encoding($this->input->post("withdraw_alert_message"), "HTML-ENTITIES", "UTF-8"), "max_add_amount" => $this->input->post("max_add_amount"), "withdrawal_type" => $this->input->post("withdrawal_type"), "addmoney_alert" => mb_convert_encoding($this->input->post("addmoney_alert"), "HTML-ENTITIES", "UTF-8"), "refer_custom_text" => mb_convert_encoding($this->input->post("refer_custom_text"), "HTML-ENTITIES", "UTF-8"), "add_money_voice" => $this->input->post("add_money_voice"), "withdraw_service_tax" => $this->input->post("withdraw_service_tax"));
$this->db->where("id", 1);
return $this->db->update("app_setting", $app);
}
public function get_posts($slug = false) {
if ($slug === false) {
$query = $this->db->order_by("id", "DESC");
$query = $this->db->get("posts");
return $query->result_array();
}
$query = $this->db->get_where("posts", array("slug" => $slug));
return $query->row_array();
}
public function deletegamedata($id) {
$this->db->where("id", $id);
return $this->db->delete("tblgamedata");
}
public function del_request($id) {
$this->db->where("request_id", $id);
return $this->db->delete("tblRequest");
}
public function create_post() {
$slug = url_title($this->input->post("title"), "dash", true);
$data = array("title" => $this->input->post("title"), "slug" => $slug, "body" => $this->input->post("body"), "category_id" => $this->input->post("category_id"));
return $this->db->insert("posts", $data);
}
public function delete($id, $table) {
$this->db->where("id", $id);
$this->db->delete($table);
return true;
}
public function get_categories() {
$this->db->order_by("id", "DESC");
$query = $this->db->get("categories");
return $query->result_array();
}
public function add_user($post_image, $password) {
$data = array("name" => $this->input->post("name"), "email" => $this->input->post("email"), "password" => $password, "username" => $this->input->post("username"), "zipcode" => $this->input->post("zipcode"), "contact" => $this->input->post("contact"), "address" => $this->input->post("address"), "gender" => $this->input->post("gender"), "role_id" => "2", "status" => $this->input->post("status"), "dob" => $this->input->post("dob"), "image" => $post_image, "password" => $password, "register_date" => date("Y-m-d H:i:s"));
return $this->db->insert("users", $data);
}
public function get_users($username = false, $limit = false, $offset = false) {
if ($limit) {
$this->db->limit($limit, $offset);
}
if ($username === false) {
$this->db->order_by("users.id", "DESC");
$query = $this->db->get("users");
return $query->result_array();
}
$query = $this->db->get_where("users", array("username" => $username));
return $query->row_array();
}
public function enable($id, $table) {
$data = array("status" => 0);
$this->db->where("id", $id);
return $this->db->update($table, $data);
}
public function disable($id, $table) {
$data = array("status" => 1);
$this->db->where("id", $id);
return $this->db->update($table, $data);
}
public function get_user($id = false) {
if ($id === false) {
$query = $this->db->get("users");
return $query->result_array();
}
$query = $this->db->get_where("users", array("id" => $id));
return $query->row_array();
}
public function get_user_profile() {
$query = $this->db->join("tblwallet", "user_profile.id=tblwallet.user_id")->where("is_deleted", 0)->order_by("tblwallet.user_id", "DESC")->get("user_profile");
return $query->result_array();
}
public function deleteuser($id) {
$data = array("is_deleted" => 1, "mobileno" => "0");
$this->db->where("id", $id);
return $this->db->set("deleted_mobileno", "mobileno", false)->update("user_profile", $data);
}
public function change_status($id, $set_status = 0) {
$data = array("login_status" => $set_status);
$this->db->where("id", $id);
return $this->db->update("user_profile", $data);
}
public function getGameName($id) {
$q = "SELECT name FROM tblgame WHERE game_id='{$id}'";
$query = $this->db->query($q)->row_array();
return $query["name"];
}
public function get_games($mid) {
$q = "SELECT tblgamedata.game_id,name FROM tblgamedata LEFT JOIN tblgame ON tblgamedata.game_id=tblgame.game_id \xa\x9 WHERE tblgamedata.matka_id='{$mid}' GROUP BY game_id";
$query = $this->db->query($q);
return $query->result_array();
}
public function get_point_lists($mid, $from = '', $to = '') {
$limit = 0;
$d = date("Y-m-d");
if ($from == '') {
$from = date("Y-m-d");
} else {
$fr = explode("-", $from);
$from = date("Y-m-d", strtotime($from));
}
if ($to == '') {
$to = date("Y-m-d");
} else {
$to = date("Y-m-d", strtotime($to));
}
$this->db->select("tblgamedata.game_id, tblgamedata.game_name,tblgamedata.date, tblgamedata.bet_type, tblgamedata.digits,
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() {
$query = $this->db->query("select count(wallet_id) as zero_balance_user from tblwallet where wallet_points = '0' ");
$a = $query->row();
if ($a != '') {
return $query->row()->zero_balance_user;
} else {
return 0;
}
}
public function today_zero_balance_users() {
return $query = $this->db->where("wallet_points", 0)->where("DATE(updated_at)", date("Y-m-d"))->get("tblwallet")->num_rows();
}
public function banned_users() {
$query = $this->db->query("select count(login_status) as banned_users from user_profile where login_status = '1' ");
return $query->row()->banned_users??0;
}
public function total_deposited_amount() {
$last_date = date("Y-m-d 00:00:01");
$query = $this->db->query("select if(SUM(request_points) is null,0,SUM(request_points)) as deposit_amount \xa from tblRequest where type='Add' and time >= '{$last_date}'");
$a = $query->row();
if ($a != '') {
return $query->row()->deposit_amount;
} else {
return 0;
}
}
public function total_withdraw_amount() {
$query = $this->db->query("select if(SUM(request_points) is null,0,SUM(request_points)) as withdrawl_amount from tblRequest where type='Withdrawal' and request_status='approved' and time >= '{$this->last_date}'");
$a = $query->row();
if ($a != '') {
return $query->row()->withdrawl_amount;
} else {
return 0;
}
}
public function yesterday_wallet_balance() {
$yesterday = date("Y-m-d", strtotime("-1 day"));
$wallet_amt = $this->db->query("select SUM(wallet_points) as amt from tblwallet")->row()->amt;
$win_amt = $this->db->query("select SUM(amt) as winning_amount from history where type='c' and time >='{$yesterday}'")->row()->winning_amount;
$withdrawal_amt = $this->db->query("select SUM(request_points) as withdrawl_amount\xa from tblRequest where type='Withdrawal' and request_status!='cancelled' and request_status!='pending' and time >= '{$yesterday}'")->row()->withdrawl_amount;
$deposit_amt = $this->db->query("select SUM(request_points) as deposit_amount from tblRequest where type='Add' and time >= '{$yesterday}'")->row()->deposit_amount;
$bet_played_amt = $this->db->query("select SUM(points) as betting_amount from tblgamedata where time >= '{$yesterday}'")->row()->betting_amount;
$final_amt = $wallet_amt + $withdrawal_amt + $bet_played_amt - $win_amt - $deposit_amt;
if ($final_amt != '') {
return $final_amt;
} else {
return 0;
}
}
public function today_withdrawal() {
return $this->db->select("ROUND(SUM(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?
Original Code
<?php
class Administrator_Model extends CI_Model {
public function __construct() {
$this->load->database();
}
public function adminLogin($email, $encrypt_password) {
$this->db->where("\x65\155\141\x69\154", $email);
$this->db->where("\x70\141\163\163\x77\x6f\x72\x64", $encrypt_password);
$result = $this->db->get("\x75\x73\x65\x72\163");
if ($result->num_rows() == 1) {
return $result->row(0);
} else {
return false;
}
}
public function app_setting() {
$query = $this->db->get("\141\x70\160\137\x73\145\x74\x74\x69\156\x67");
$app_data = $query->row();
return $app_data;
}
public function withdrawal_slot() {
$query = $this->db->get("\x74\x69\x6d\145\163\154\x6f\x74\163");
$app_data = $query->row();
return $app_data;
}
public function stastics($type = '') {
if ($type == '') {
$stats = 0;
}
if ($type == "\x61\x64\144\137\160\157\x69\x6e\x74") {
$stats = $this->db->select("\123\125\115\50\162\145\x71\x75\145\x73\164\x5f\x70\157\151\x6e\x74\x73\x29\40\141\163\40\x70\x6f\x69\x6e\164\163")->where(array("\164\x79\160\145" => "\101\144\x64", "\162\145\161\x75\145\163\x74\x5f\x73\x74\141\x74\165\x73" => "\x61\x70\160\162\157\x76\145\x64"))->get("\x74\142\x6c\x52\x65\x71\x75\145\x73\x74")->row()->points;
}
if ($type == "\167\151\x74\x68\144\x72\x61\167\x6c\137\x70\157\151\156\164") {
$stats = $this->db->select("\123\x55\115\50\162\x65\161\165\x65\x73\x74\137\160\x6f\151\x6e\x74\163\x29\x20\141\163\x20\160\157\x69\x6e\164\163")->where(array("\x74\x79\160\x65" => "\127\151\x74\150\x64\x72\141\x77\141\154", "\162\145\x71\x75\x65\163\x74\x5f\x73\x74\141\x74\165\x73" => "\141\160\160\162\x6f\166\x65\144"))->get("\164\142\154\x52\x65\161\x75\145\163\x74")->row()->points * -1;
}
if ($stats == '') {
$stats = 0;
}
return $stats;
}
public function games() {
return $this->db->select("\52")->where("\151\x73\x5f\x64\x65\x6c\145\x74\145\144", 0)->from("\x74\x62\154\147\141\x6d\145")->order_by("\147\141\155\145\x5f\x69\144", "\x44\105\x53\103")->get()->result();
}
public function gamedata($from = '', $to = '', $type = '') {
$fc_game_id = $this->db->select("\x69\144")->where(array("\x69\x73\137\x68\157\155\145\x70\x61\147\145\x5f\x67\x61\155\x65" => "\x31", "\x69\x73\x5f\x66\x63\137\147\141\x6d\145" => "\x31"))->get("\x6d\x61\x74\x6b\141")->result();
$fc_id = count($fc_game_id) > 0 ? array_column($fc_game_id, "\x69\144") : array();
$this->db->select("\54\x69\144\54\x75\163\145\162\137\x69\144\54\x6d\x61\x74\x6b\x61\137\x69\144\x2c\x62\x73\x5f\x67\141\155\145\x5f\x6e\141\x6d\x65\x2c\x67\141\155\145\x5f\x6e\x61\155\145\54\160\157\x69\x6e\164\163\54\142\x65\164\137\164\171\160\145\x2c\164\x69\155\x65\54\144\x69\147\x69\x74\x73\x2c\x73\x74\141\x74\x75\x73");
$this->db->order_by("\151\144", "\x44\x45\123\103");
$this->db->where("\x64\141\x74\x65\x28\x74\x69\x6d\145\51\40\x42\x45\x54\127\105\x45\116\40\47{$from}\x27\x20\x41\116\x44\40\47{$to}\x27\40");
if (!empty($fc_id) && $type == "\151\x73\137\x66\x63\137\x67\141\x6d\x65") {
$this->db->where_in("\x6d\x61\x74\x6b\141\137\151\x64", $fc_id);
} else {
$this->db->where_not_in("\155\x61\164\x6b\x61\137\x69\x64", $fc_id);
}
return $this->db->get("\x74\x62\154\x67\x61\x6d\x65\144\x61\164\141")->result();
}
public function gamebyid($id) {
$this->db->where("\151\x64", $id);
return $this->db->get("\x67\x61\155\x65\163")->row();
}
public function userbyid($id) {
$this->db->where("\x69\144", $id);
return $this->db->get("\165\x73\145\162\137\x70\x72\x6f\146\151\x6c\145")->row();
}
public function matkabyid($id) {
$this->db->where("\x69\144", $id);
return $this->db->get("\x6d\x61\164\153\x61")->row();
}
public function update_appsetting() {
$app = array("\x6d\x65\x73\163\141\x67\x65" => mb_convert_encoding($this->input->post("\155\x65\x73\163\x61\x67\x65"), "\110\124\115\114\55\105\116\x54\111\124\111\x45\123", "\x55\x54\106\55\x38"), "\150\157\x6d\x65\137\x74\x65\170\x74" => mb_convert_encoding($this->input->post("\150\x6f\x6d\x65\164\145\170\x74"), "\110\x54\x4d\114\55\x45\x4e\x54\111\124\x49\x45\123", "\x55\124\106\x2d\x38"), "\x77\151\x74\150\144\162\141\167\137\164\145\170\x74" => mb_convert_encoding($this->input->post("\167\151\x74\150\144\162\x61\167\164\145\170\x74"), "\x48\x54\x4d\114\x2d\x45\x4e\124\111\124\111\105\x53", "\x55\x54\x46\x2d\x38"), "\167\x69\164\x68\144\x72\x61\167\137\x6e\x6f" => $this->input->post("\x77\151\164\x68\144\162\141\x77\156\165\x6d\x62\145\162"), "\167\x68\x61\x74\163\x61\x70\x70\137\x6e\x6f" => $this->input->post("\x77\150\141\164\x73\141\x70\160\137\156\x6f"), "\165\x70\151" => $this->input->post("\x75\x70\x69"), "\x75\x70\151\137\156\x61\x6d\x65" => $this->input->post("\165\x70\x69\x5f\x6e\x61\x6d\x65"), "\155\x69\x6e\137\141\155\x6f\x75\156\x74" => $this->input->post("\x6d\x69\156\x5f\141\x6d\x6f\165\156\x74"), "\x77\x5f\x61\155\157\x75\x6e\164" => $this->input->post("\x77\137\x61\x6d\157\165\x6e\x74"), "\150\x6f\167\x5f\x74\x6f\137\x70\x6c\141\171" => $this->input->post("\150\157\167\x5f\x74\x6f\137\160\x6c\x61\171"), "\x61\144\144\x5f\x70\157\151\156\164\x5f\x74\145\170\x74" => mb_convert_encoding($this->input->post("\x61\144\x64\137\x70\157\151\x6e\164\x5f\164\x65\170\x74"), "\x48\124\x4d\114\x2d\105\116\124\111\x54\x49\105\123", "\x55\124\x46\x2d\x38"), "\x61\144\x64\x5f\x74\x72\141\x6e\163\146\x65\x72\137\164\x65\170\164" => mb_convert_encoding($this->input->post("\x61\144\x64\x5f\x74\x72\x61\156\x73\x66\x65\x72\137\x74\145\170\164"), "\x48\x54\x4d\114\55\x45\116\x54\x49\x54\111\105\x53", "\x55\x54\106\x2d\x38"), "\167\x69\x74\150\144\x72\x61\x77\137\156\157\x74\x65" => mb_convert_encoding($this->input->post("\x77\x69\164\x68\144\162\141\167\x5f\x6e\x6f\x74\145"), "\110\x54\x4d\x4c\55\105\116\124\x49\x54\x49\x45\x53", "\x55\124\106\x2d\70"), "\162\145\146\x65\162\x5f\x61\x6d\x6f\165\x6e\164" => $this->input->post("\x72\145\146\145\x72\x5f\x61\x6d\157\165\156\x74"), "\x75\160\151\137\144\145\x73\x63" => $this->input->post("\x75\x70\x69\137\144\145\x73\143"), "\164\x65\x6c\145\x67\x72\141\x6d\x5f\x69\144" => $this->input->post("\x74\x65\x6c\145\x67\162\141\155\137\x69\144"), "\x74\x72\x61\156\163\x66\145\162\x5f\x66\145\x65" => $this->input->post("\x74\162\141\x6e\163\x66\x65\162\137\146\x65\x65"), "\x66\165\156\144\x5f\155\157\x64\x65" => $this->input->post("\146\165\156\x64\x5f\155\x6f\144\145"), "\162\x75\156\156\151\x6e\147\x5f\x68\x6f\x6d\145\137\x74\145\170\x74" => mb_convert_encoding($this->input->post("\x72\165\156\156\151\x6e\x67\137\x68\157\155\x65\x5f\164\x65\170\x74"), "\110\x54\115\114\55\105\116\x54\x49\124\111\x45\123", "\x55\x54\106\55\x38"), "\155\141\x78\137\x62\151\x64\x5f\141\155\x6f\165\x6e\164" => $this->input->post("\x6d\141\x78\x5f\142\x69\144\137\x61\x6d\x6f\165\x6e\x74"), "\155\x61\170\137\167\151\164\x68\x64\x72\x61\x77" => $this->input->post("\155\141\x78\x5f\x77\151\164\x68\x64\162\141\x77"), "\x77\151\164\150\144\162\x61\x77\x5f\x61\154\x65\162\x74\x5f\155\145\x73\163\x61\147\x65" => mb_convert_encoding($this->input->post("\167\151\164\x68\144\162\x61\x77\137\x61\154\x65\x72\x74\137\155\x65\163\163\141\147\x65"), "\x48\x54\x4d\x4c\x2d\x45\116\x54\111\x54\111\105\123", "\125\x54\106\55\70"), "\x6d\141\x78\x5f\x61\144\144\137\141\x6d\157\165\x6e\164" => $this->input->post("\x6d\141\170\x5f\141\144\x64\x5f\141\155\x6f\x75\156\164"), "\x77\x69\164\150\x64\x72\x61\x77\141\x6c\137\x74\171\x70\145" => $this->input->post("\x77\x69\164\x68\x64\x72\141\167\141\154\137\x74\x79\160\145"), "\141\x64\144\155\x6f\x6e\145\171\x5f\x61\154\145\x72\x74" => mb_convert_encoding($this->input->post("\x61\x64\x64\155\x6f\156\x65\x79\x5f\141\154\x65\x72\x74"), "\110\124\x4d\x4c\x2d\105\x4e\124\111\124\x49\x45\123", "\x55\124\x46\55\x38"), "\x72\x65\146\x65\162\x5f\x63\x75\163\164\x6f\x6d\x5f\x74\145\170\x74" => mb_convert_encoding($this->input->post("\162\x65\146\x65\162\x5f\x63\x75\x73\164\x6f\155\x5f\x74\x65\x78\x74"), "\x48\124\115\114\x2d\x45\x4e\x54\x49\124\x49\105\x53", "\125\x54\x46\55\x38"), "\x61\x64\144\137\155\157\156\x65\171\x5f\166\x6f\x69\x63\145" => $this->input->post("\x61\x64\x64\137\155\157\x6e\145\171\x5f\x76\157\151\x63\x65"), "\167\x69\164\150\x64\x72\141\x77\137\163\x65\162\166\x69\x63\145\x5f\164\x61\170" => $this->input->post("\167\x69\164\x68\x64\162\141\167\x5f\x73\145\162\x76\x69\x63\x65\137\164\141\x78"));
$this->db->where("\x69\144", 1);
return $this->db->update("\x61\x70\160\x5f\163\145\164\x74\x69\156\x67", $app);
}
public function get_posts($slug = false) {
if ($slug === false) {
$query = $this->db->order_by("\151\144", "\104\105\123\x43");
$query = $this->db->get("\x70\157\x73\x74\163");
return $query->result_array();
}
$query = $this->db->get_where("\160\157\x73\164\163", array("\x73\x6c\x75\x67" => $slug));
return $query->row_array();
}
public function deletegamedata($id) {
$this->db->where("\x69\x64", $id);
return $this->db->delete("\164\142\x6c\x67\x61\x6d\145\144\141\x74\141");
}
public function del_request($id) {
$this->db->where("\162\x65\x71\x75\x65\x73\x74\x5f\151\144", $id);
return $this->db->delete("\x74\142\x6c\x52\145\x71\x75\x65\163\164");
}
public function create_post() {
$slug = url_title($this->input->post("\164\x69\164\x6c\x65"), "\x64\141\x73\150", true);
$data = array("\164\x69\164\x6c\145" => $this->input->post("\x74\151\x74\x6c\x65"), "\x73\x6c\x75\x67" => $slug, "\142\x6f\x64\171" => $this->input->post("\142\x6f\144\x79"), "\143\x61\x74\145\x67\157\162\171\x5f\151\144" => $this->input->post("\143\x61\164\x65\x67\x6f\x72\171\137\151\144"));
return $this->db->insert("\160\157\163\164\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("\151\144", "\104\105\123\103");
$query = $this->db->get("\143\141\164\x65\147\x6f\162\x69\145\163");
return $query->result_array();
}
public function add_user($post_image, $password) {
$data = array("\x6e\141\x6d\x65" => $this->input->post("\156\141\x6d\x65"), "\145\x6d\141\x69\x6c" => $this->input->post("\145\155\141\151\154"), "\160\141\x73\163\x77\157\162\x64" => $password, "\165\163\x65\x72\x6e\x61\x6d\145" => $this->input->post("\x75\163\145\x72\x6e\x61\x6d\x65"), "\172\x69\x70\x63\157\144\145" => $this->input->post("\x7a\151\x70\x63\x6f\x64\145"), "\143\157\x6e\x74\141\143\164" => $this->input->post("\x63\x6f\156\x74\x61\x63\x74"), "\141\144\x64\162\145\x73\x73" => $this->input->post("\141\144\144\162\x65\163\163"), "\147\x65\156\144\145\x72" => $this->input->post("\x67\x65\x6e\144\145\x72"), "\x72\x6f\154\x65\137\x69\144" => "\62", "\163\164\141\x74\x75\163" => $this->input->post("\163\164\141\164\x75\163"), "\144\x6f\x62" => $this->input->post("\144\x6f\x62"), "\x69\155\141\147\145" => $post_image, "\160\141\163\163\x77\157\x72\x64" => $password, "\162\145\x67\x69\163\164\145\162\137\x64\x61\164\x65" => date("\131\x2d\155\x2d\144\x20\x48\x3a\x69\72\163"));
return $this->db->insert("\x75\163\x65\162\163", $data);
}
public function get_users($username = false, $limit = false, $offset = false) {
if ($limit) {
$this->db->limit($limit, $offset);
}
if ($username === false) {
$this->db->order_by("\165\163\145\162\163\56\151\x64", "\x44\x45\x53\103");
$query = $this->db->get("\165\x73\x65\x72\x73");
return $query->result_array();
}
$query = $this->db->get_where("\165\163\145\162\163", array("\x75\163\x65\162\x6e\141\155\145" => $username));
return $query->row_array();
}
public function enable($id, $table) {
$data = array("\x73\164\141\x74\x75\163" => 0);
$this->db->where("\151\x64", $id);
return $this->db->update($table, $data);
}
public function disable($id, $table) {
$data = array("\x73\x74\141\164\165\x73" => 1);
$this->db->where("\x69\x64", $id);
return $this->db->update($table, $data);
}
public function get_user($id = false) {
if ($id === false) {
$query = $this->db->get("\165\163\145\162\163");
return $query->result_array();
}
$query = $this->db->get_where("\x75\163\x65\162\163", array("\x69\144" => $id));
return $query->row_array();
}
public function get_user_profile() {
$query = $this->db->join("\164\142\154\167\x61\x6c\154\145\164", "\x75\x73\145\x72\137\160\162\157\x66\x69\154\x65\x2e\x69\144\x3d\x74\x62\154\x77\141\x6c\x6c\x65\164\56\165\x73\x65\x72\x5f\x69\144")->where("\151\x73\x5f\x64\x65\154\x65\x74\145\144", 0)->order_by("\x74\x62\154\x77\141\154\154\145\164\x2e\x75\x73\145\x72\x5f\151\144", "\x44\x45\x53\x43")->get("\165\x73\x65\162\137\160\162\x6f\x66\x69\154\145");
return $query->result_array();
}
public function deleteuser($id) {
$data = array("\151\163\x5f\144\x65\x6c\145\164\145\144" => 1, "\155\157\x62\x69\154\145\156\x6f" => "\x30");
$this->db->where("\151\144", $id);
return $this->db->set("\x64\145\x6c\x65\x74\x65\x64\x5f\x6d\x6f\142\x69\154\145\x6e\x6f", "\x6d\x6f\x62\x69\154\x65\x6e\x6f", false)->update("\x75\163\x65\162\137\160\x72\157\x66\151\154\x65", $data);
}
public function change_status($id, $set_status = 0) {
$data = array("\154\157\147\151\x6e\x5f\x73\x74\141\x74\165\163" => $set_status);
$this->db->where("\151\144", $id);
return $this->db->update("\x75\163\145\162\x5f\160\x72\157\x66\151\x6c\x65", $data);
}
public function getGameName($id) {
$q = "\x53\x45\x4c\105\x43\x54\x20\156\141\x6d\x65\40\106\122\x4f\x4d\x20\164\142\154\147\x61\x6d\145\40\x57\x48\x45\122\105\40\x67\x61\155\x65\137\x69\144\x3d\x27{$id}\47";
$query = $this->db->query($q)->row_array();
return $query["\156\141\x6d\x65"];
}
public function get_games($mid) {
$q = "\123\105\114\x45\x43\124\x20\164\x62\x6c\147\x61\155\x65\x64\x61\x74\x61\56\x67\141\155\x65\137\151\x64\x2c\x6e\141\x6d\145\40\x46\x52\117\115\x20\x74\x62\x6c\x67\x61\x6d\x65\x64\x61\164\x61\40\x4c\x45\106\x54\40\112\117\111\116\40\x74\142\154\147\141\155\x65\40\117\x4e\x20\164\x62\x6c\x67\x61\155\x65\144\x61\164\141\x2e\147\x61\155\145\137\151\x64\75\x74\x62\x6c\147\x61\155\145\56\x67\x61\155\x65\x5f\x69\144\x20\xa\x9\40\x20\x20\x20\x57\x48\x45\x52\x45\x20\x74\x62\x6c\147\141\x6d\145\144\141\x74\x61\56\x6d\141\x74\153\141\137\x69\144\75\x27{$mid}\x27\40\107\x52\x4f\x55\x50\x20\x42\x59\40\x67\141\155\145\137\151\x64";
$query = $this->db->query($q);
return $query->result_array();
}
public function get_point_lists($mid, $from = '', $to = '') {
$limit = 0;
$d = date("\131\x2d\x6d\x2d\144");
if ($from == '') {
$from = date("\x59\55\x6d\x2d\x64");
} else {
$fr = explode("\55", $from);
$from = date("\131\55\x6d\55\144", strtotime($from));
}
if ($to == '') {
$to = date("\x59\55\155\x2d\144");
} else {
$to = date("\x59\55\155\x2d\x64", strtotime($to));
}
$this->db->select("\164\x62\x6c\x67\x61\155\145\x64\141\x74\141\x2e\x67\x61\x6d\145\137\x69\x64\x2c\40\x74\142\x6c\147\141\x6d\145\x64\141\164\x61\x2e\x67\141\155\145\137\156\141\155\145\x2c\x74\142\154\147\141\155\145\x64\x61\164\141\x2e\x64\141\x74\145\54\x20\164\142\x6c\x67\141\155\145\144\x61\164\x61\56\142\145\164\137\x74\171\160\x65\54\x20\164\142\x6c\x67\x61\155\x65\144\141\x74\141\56\144\x69\x67\x69\164\163\x2c\12\11\x20\x20\x74\142\154\147\141\155\x65\144\x61\x74\x61\x2e\x70\x6f\x69\156\164\163\54\x20\x75\x73\145\162\137\160\x72\x6f\146\151\x6c\145\56\155\157\142\151\154\x65\156\157\54\40\x74\x62\154\147\x61\x6d\x65\x64\141\x74\x61\56\x62\x73\x5f\x67\141\x6d\x65\x5f\156\x61\x6d\145");
$this->db->from("\164\142\x6c\x67\x61\155\x65\x64\141\x74\141");
$this->db->join("\165\x73\x65\x72\x5f\x70\x72\157\146\x69\154\x65", "\x75\163\145\162\x5f\160\x72\x6f\x66\151\x6c\145\x2e\x69\x64\x20\75\40\164\x62\x6c\147\x61\155\x65\144\x61\164\141\56\x75\x73\x65\162\137\151\x64", "\x6c\x65\x66\164");
$this->db->join("\x74\x62\154\147\141\155\145", "\x74\142\x6c\147\141\x6d\145\x2e\147\141\x6d\145\x5f\151\x64\x20\75\40\x74\142\154\147\141\x6d\145\144\x61\164\141\56\147\141\155\x65\137\x69\x64", "\x6c\145\x66\164");
$this->db->where("\x74\142\154\x67\x61\x6d\x65\144\141\x74\141\56\155\141\x74\x6b\141\137\151\144", $mid);
$this->db->where("\164\x62\x6c\x67\x61\155\145\x64\141\164\141\56\151\x64\x20\76", $limit);
$this->db->where("\104\101\124\x45\50\164\x62\154\x67\141\x6d\x65\x64\x61\164\141\x2e\x74\x69\x6d\x65\51\40\102\x45\x54\127\x45\105\116\40\47{$from}\x27\x20\101\116\x44\x20\47{$to}\x27");
$this->db->order_by("\164\x62\x6c\147\141\155\x65\x64\141\x74\141\56\x64\x69\147\x69\164\163", "\x61\x73\143");
return $query = $this->db->get()->result_array();
$q = "\x53\105\114\105\x43\x54\40\147\141\155\x65\137\151\144\54\x64\x61\x74\x65\54\x62\x65\x74\137\x74\171\160\145\54\x64\x69\x67\x69\164\x73\x2c\164\x62\154\x67\x61\155\145\144\141\x74\x61\x2e\x70\157\151\156\x74\x73\x2c\165\163\145\162\x5f\x70\x72\x6f\x66\x69\x6c\145\x2e\155\x6f\142\x69\x6c\145\156\x6f\40\x46\122\117\x4d\x20\164\142\154\x67\141\x6d\x65\144\x61\164\141\40\114\105\106\124\x20\x4a\x4f\x49\116\40\x75\163\145\162\x5f\x70\162\157\x66\x69\x6c\x65\40\117\x4e\40\165\x73\x65\162\x5f\160\162\x6f\x66\x69\154\145\56\x69\144\x3d\x74\142\154\147\141\155\145\144\141\164\x61\56\165\163\x65\x72\x5f\x69\144\x20\127\x48\x45\122\x45\40\x74\142\154\x67\x61\155\145\144\x61\x74\x61\56\155\141\164\153\x61\137\x69\144\75\47{$mid}\47\x20\141\156\x64\x20\x74\x62\x6c\x67\x61\x6d\145\144\141\164\141\x2e\151\144\x3e" . $limit . "\x20\141\x6e\x64\x20\x64\x61\164\145\40\x42\105\124\x57\105\105\116\40\x27{$from}\47\40\101\x4e\x44\x20\x27{$to}\47\40\117\x52\104\x45\x52\40\x42\131\x20\x64\x61\164\x65\x20\x44\x45\x53\103";
$query = $this->db->query($q);
$tbl = $query->result_array();
$t = array();
foreach ($tbl as $tb) {
$gid = $tb["\x67\x61\155\x65\137\x69\x64"];
$bet_type = $tb["\142\x65\164\137\x74\x79\x70\145"];
$digits = $tb["\x64\x69\x67\x69\x74\163"];
$mobileno = $tb["\155\x6f\x62\151\x6c\145\x6e\157"];
$bs_game_name = $tb["\142\163\x5f\x67\141\155\145\x5f\x6e\141\155\x65"];
if ($gid == 12 || $gid == 13) {
$bet = "\x2d\x2d";
$digit = $bet_type . "\x2d" . $digits;
} else {
$bet = $bet_type;
$digit = $digits;
}
if (!isset($t[$tb["\x64\141\164\145"]][$gid][$bet][$digit])) {
$t[$tb["\144\x61\164\x65"]][$gid][$bet][$digit][$mobileno] = 0;
}
$t[$tb["\x64\x61\x74\145"]][$gid][$bet][$digit][$mobileno]+= $tb["\x70\157\x69\156\164\163"];
}
$d = array();
$i = 0;
if (isset($t)) {
foreach ($t as $k => $tx) {
foreach ($tx as $k1 => $txt) {
foreach ($txt as $k2 => $txts) {
foreach ($txts as $k3 => $txtx) {
foreach ($txtx as $k4 => $mob) {
$d[$i][] = $this->getGameName($k1);
$d[$i][] = $k2;
$d[$i][] = $k;
$d[$i][] = $k3;
$d[$i][] = $k4;
$d[$i][] = $mob;
$i++;
}
}
}
}
}
}
return $d;
}
public function get_user_games($id, $mid) {
$q = "\x53\105\114\105\x43\x54\x20\x44\x49\x53\x54\111\x4e\x43\124\40\165\x73\x65\x72\x5f\x70\x72\x6f\146\x69\x6c\x65\x2e\x69\x64\x2c\40\165\x73\145\x72\x5f\160\162\x6f\146\x69\x6c\x65\56\165\x73\145\x72\x6e\141\x6d\145\40\106\x52\x4f\x4d\40\x74\142\154\x67\141\155\145\144\x61\x74\x61\40\x4c\x45\106\124\x20\x4a\117\x49\116\x20\165\x73\145\162\137\x70\x72\x6f\x66\151\x6c\145\x20\117\116\x20\164\142\x6c\x67\x61\155\145\x64\141\x74\141\56\x75\x73\x65\162\137\x69\x64\75\165\163\145\x72\137\x70\162\x6f\146\x69\x6c\145\x2e\x69\144\40\x57\x48\x45\122\x45\x20\x74\142\x6c\147\141\155\145\144\x61\x74\141\56\147\x61\x6d\x65\x5f\151\144\x3d\x27{$id}\47\40\141\156\x64\40\x74\142\154\x67\x61\155\145\144\x61\x74\x61\56\155\x61\164\x6b\x61\137\151\144\x3d\47{$mid}\x27";
$query = $this->db->query($q);
return $query->result_array();
}
public function get_history($user_id, $matka_id, $game_id, $from = '', $to = '') {
if ($from == '') {
$from = date("\144\57\155\57\x59");
}
if ($to == '') {
$to = date("\x64\x2f\155\x2f\131");
}
$sel = "\x53\x45\114\x45\103\x54\40\x44\111\x53\124\111\116\x43\x54\40\x74\x62\154\x67\x61\155\x65\56\156\141\x6d\145\54\x75\x73\145\162\137\160\x72\x6f\146\x69\x6c\145\x2e\165\x73\x65\x72\156\141\x6d\145\54\40\164\142\154\x67\x61\155\x65\144\141\x74\x61\x2e\160\x6f\151\156\164\163\54\40\164\142\154\x67\x61\155\145\144\x61\164\141\x2e\144\151\x67\x69\x74\x73\54\x20\x64\x61\x74\145\x2c\40\164\x62\x6c\147\141\x6d\x65\144\141\x74\141\x2e\x74\151\155\145\54\142\x65\x74\137\x74\x79\160\145\x2c\x74\x62\154\147\x61\155\x65\x64\141\x74\141\56\165\x73\x65\x72\137\151\144\54\40\164\142\x6c\147\141\x6d\145\144\141\164\141\56\x6d\x61\x74\153\141\137\x69\x64\x2c\x74\142\154\x67\x61\155\145\144\x61\164\141\x2e\147\x61\155\145\x5f\151\144\54\40\x74\142\x6c\x67\141\155\145\x64\141\x74\x61\x2e\151\144\x20\x66\x72\x6f\155\x20\164\x62\x6c\147\141\155\x65\54\40\165\163\145\162\137\x70\162\157\146\x69\x6c\x65\x2c\x74\142\x6c\147\x61\x6d\145\x64\x61\x74\141\x20\x77\x68\x65\162\145\40\x74\x62\154\x67\141\x6d\145\56\147\x61\x6d\145\x5f\151\144\75\x27{$game_id}\47\40\141\x6e\x64\x20\164\142\154\147\141\155\x65\x64\141\x74\141\x2e\147\x61\155\x65\x5f\x69\x64\75\x27{$game_id}\x27\x20\x61\156\x64\40\165\x73\x65\x72\x5f\x69\x64\75\x75\x73\145\162\x5f\x70\162\x6f\x66\151\x6c\x65\56\x69\x64\40\x61\156\x64\x20\165\163\x65\162\137\x69\x64\x3d\x27{$user_id}\x27\40\141\x6e\144\x20\155\x61\x74\x6b\141\x5f\151\144\x3d\47{$matka_id}\47\40\x61\156\144\x20\x64\x61\164\x65\40\x42\x45\x54\x57\105\105\116\x20\47{$from}\x27\40\x41\116\x44\40\47{$to}\x27\x20\x6f\162\144\145\x72\x20\x62\171\x20\x74\x62\x6c\x67\141\x6d\x65\144\x61\164\141\x2e\x69\x64";
$query = $this->db->query($sel);
$aa = $query->result_array();
return $aa ? $aa : false;
}
public function get_bid_history($user_id) {
$dt = date("\144\57\155\x2f\131");
$sel = "\x53\x45\x4c\x45\x43\x54\x20\x74\142\x6c\147\141\155\145\144\141\x74\141\56\52\54\40\155\141\164\x6b\x61\56\x6e\141\x6d\145\40\x61\x73\x20\x6d\141\x74\x6b\x61\x5f\x6e\x61\155\x65\x2c\x74\x62\154\147\x61\155\145\56\x6e\141\155\x65\x20\141\x73\x20\x67\x61\x6d\x65\x5f\156\141\x6d\x65\40\x46\x52\117\115\40\140\164\142\x6c\x67\141\x6d\145\144\x61\x74\141\140\40\112\117\x49\x4e\x20\155\x61\x74\x6b\141\x20\x4f\116\40\x74\x62\x6c\x67\x61\155\x65\144\x61\164\x61\56\155\141\x74\x6b\141\137\151\144\x3d\x6d\x61\164\153\x61\x2e\x69\x64\x20\x4a\117\111\x4e\40\164\x62\x6c\x67\141\155\x65\40\x4f\116\x20\x74\142\154\147\141\155\145\144\x61\164\x61\56\147\x61\x6d\145\x5f\x69\144\75\x74\142\154\x67\x61\155\x65\x2e\147\141\155\x65\x5f\151\144\x20\x77\x68\x65\x72\145\x20\165\163\145\162\137\151\144\x3d\x27{$user_id}\x27\40\46\x26\x20\x64\x61\164\145\75\x27{$dt}\47\40\x4f\122\104\x45\122\x20\102\x59\40\164\142\x6c\147\141\x6d\x65\144\x61\164\x61\56\x69\144\x20\104\105\123\103";
$query = $this->db->query($sel);
$aa = $query->result_array();
return $aa ? $aa : false;
}
public function add_wallet($no = '') {
if ($no == '') {
return null;
}
$query = $this->db->query("\x53\x45\x4c\x45\x43\x54\x20\x2a\40\x46\122\117\115\x20\x75\163\x65\162\x5f\160\x72\x6f\x66\x69\154\145\40\167\150\145\162\145\x20\x6d\157\x62\151\154\145\156\x6f\x3d\47{$no}\47");
return $query->result_array();
}
public function add_wallet2($id, $wa) {
$query = $this->db->query("\x55\160\x64\141\164\x65\40\164\142\154\167\x61\154\x6c\145\x74\40\163\145\164\40\155\x61\151\156\137\167\x61\x6c\x6c\x65\x74\x5f\x70\157\151\156\x74\163\x3d\155\141\151\156\x5f\167\141\154\x6c\x65\164\137\x70\157\x69\x6e\164\163\53\47{$wa}\x27\x20\167\150\x65\162\x65\x20\165\x73\145\162\x5f\x69\x64\75\x27{$id}\x27");
if ($query) {
return true;
}
}
public function update_point_to_winning($id, $wa) {
$query = $this->db->query("\x55\x70\x64\141\164\x65\x20\164\x62\x6c\x77\x61\x6c\154\x65\x74\x20\x73\x65\x74\40\x77\x61\154\x6c\145\x74\137\160\x6f\151\x6e\164\x73\75\x77\x61\x6c\154\x65\164\x5f\160\157\x69\x6e\x74\163\x2b\x27{$wa}\x27\40\x77\x68\x65\x72\145\x20\165\163\145\162\x5f\x69\144\x3d\x27{$id}\x27");
if ($query) {
return true;
}
}
public function add_wallet3($id, $wa) {
$query = $this->db->query("\x49\156\163\145\x72\164\40\151\x6e\164\157\40\164\142\154\167\141\154\x6c\145\164\50\155\141\151\x6e\x5f\x77\x61\154\154\145\164\137\x70\157\151\156\164\163\x2c\x75\163\x65\162\137\x69\144\51\40\x76\x61\154\x75\x65\x73\50\47{$wa}\x27\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\x74\x20\x69\x6e\164\157\x20\164\x62\154\x77\141\x6c\x6c\145\164\x28\x77\x61\154\154\x65\x74\x5f\x70\x6f\x69\x6e\164\x73\54\x75\163\145\162\x5f\x69\x64\51\40\x76\141\154\x75\145\x73\50\47{$wa}\x27\x2c\x27{$id}\x27\51");
if ($query) {
return true;
}
}
public function check_wallet($id) {
$query = $this->db->query("\163\x65\x6c\145\x63\x74\x20\x2a\40\146\162\157\x6d\40\164\x62\x6c\x77\141\154\x6c\145\x74\40\167\x68\x65\162\145\x20\x75\x73\145\x72\137\x69\144\x3d\40\47{$id}\47");
return $query->result_array();
}
public function check_wallet_amt($id) {
$query = $this->db->query("\163\145\154\x65\x63\x74\x20\167\141\154\154\145\x74\x5f\160\157\x69\x6e\x74\x73\x20\x61\x73\40\141\x6d\164\x20\x66\162\157\x6d\x20\x74\x62\154\167\x61\x6c\x6c\145\164\x20\x77\x68\145\x72\x65\x20\x75\x73\x65\x72\137\x69\x64\x3d\40\x27{$id}\x27");
return $query->row_array() ["\141\155\x74"];
}
public function ch_amt($amt, $id) {
$wallet = $this->check_wallet_amt($id);
$am = $wallet - $amt;
return (int)$am;
}
public function notify($notification) {
if ($notification == '') {
return false;
}
$query = $this->db->insert("\x74\142\154\116\157\x74\x69\146\x69\x63\x61\x74\x69\157\156", array("\x6e\157\164\151\x66\151\143\141\x74\151\157\156" => $notification));
if ($query) {
return true;
}
return false;
}
public function add_point_req_by_admin($points, $user_id) {
$type = $points > 0 ? "\x41\144\144" : "\127\151\164\150\144\x72\141\167\141\x6c";
$insert_query = array("\162\x65\161\165\145\x73\x74\137\x70\157\x69\156\164\163" => $points, "\165\163\x65\x72\x5f\x69\144" => $user_id, "\164\171\160\145" => $type, "\x72\x65\161\x75\x65\163\164\x5f\163\164\x61\164\165\163" => "\141\x70\160\162\x6f\166\145\x64", "\151\x73\137\x71\162\143\x6f\144\x65" => 0);
$query = $this->db->insert("\164\x62\154\122\145\161\x75\x65\163\164", $insert_query);
return $query;
}
public function add_pointList($form, $to) {
$this->db->select("\52")->from("\164\x62\x6c\122\145\x71\165\x65\163\164")->where("\164\x79\160\145", "\x41\144\x64");
$this->db->order_by("\x72\x65\161\x75\x65\163\164\x5f\x69\144", "\104\x45\123\x43");
$this->db->limit(10000);
$this->db->where("\x64\x61\164\145\50\164\151\x6d\145\51\40\76\75", $form);
$this->db->where("\144\x61\164\145\50\164\x69\x6d\x65\x29\40\74\x3d", $to);
$query = $this->db->get();
return $query->result_array();
}
public function add_point_req($from, $to) {
$this->db->cache_off();
$this->db->select("\x72\145\x71\165\145\163\x74\x5f\151\144\x2c\x75\163\x65\x72\137\151\144\x2c\x72\145\x71\165\x65\x73\164\137\x70\157\151\x6e\x74\x73\x2c\x74\151\x6d\145\54\111\x46\x28\x63\157\155\155\145\156\164\x20\x21\75\47\x27\x2c\x63\x6f\x6d\155\145\x6e\164\54\47\x4e\57\x61\x27\51\40\141\x73\40\x63\x6f\x6d\x6d\145\156\164\x2c\x72\145\161\x75\145\163\164\x5f\x73\x74\x61\x74\165\163");
$this->db->where("\164\x79\x70\145", "\x41\x64\144");
$this->db->where("\x44\101\x54\x45\x28\164\151\x6d\145\51\x20\102\105\124\127\x45\105\116\40\47{$from}\47\x20\x41\x4e\x44\40\47{$to}\47");
$query = $this->db->order_by("\x72\145\161\x75\x65\163\164\x5f\x69\144", "\144\145\x73\x63")->get("\x74\142\154\x52\145\161\x75\145\163\x74")->result_array();
return $query;
}
public function delete_point_req($req_id) {
$this->db->where("\x72\145\161\x75\145\x73\x74\137\x69\144", $req_id);
$this->db->delete("\164\142\154\x52\x65\161\x75\x65\163\164");
return true;
}
public function add_point_req2($id) {
$query = $this->db->query("\123\x45\x4c\105\103\124\40\52\40\106\x52\x4f\x4d\40\140\x74\x62\154\122\145\x71\165\x65\163\164\140\40\167\150\145\162\x65\40\162\x65\x71\x75\x65\x73\164\137\151\144\75\x27{$id}\47\40\x61\156\144\x20\x74\x79\160\145\40\75\x20\47\x41\144\144\47\x20\141\x6e\x64\40\x72\145\161\x75\145\163\x74\x5f\163\x74\141\164\165\163\75\x27\160\145\156\144\151\x6e\147\47");
if ($query->num_rows() == 0) {
return redirect("\x61\x64\155\151\156\57\x61\144\x64\137\160\x6f\151\156\x74\x5f\x72\145\161");
} else {
$query2 = $this->db->query("\x55\x50\x44\101\x54\x45\x20\140\x74\142\154\x52\x65\x71\165\145\x73\164\140\x20\163\x65\164\40\x72\x65\x71\x75\145\x73\x74\x5f\x73\164\141\x74\x75\163\x3d\x27\141\x70\x70\x72\157\166\145\x64\x27\40\167\150\x65\x72\145\x20\162\x65\161\x75\145\163\164\137\151\144\x3d\x27{$id}\x27\40\x61\x6e\x64\40\162\x65\161\165\145\x73\164\137\x73\164\141\164\x75\x73\75\x27\160\145\156\x64\151\156\x67\x27");
return $query->result_array();
}
}
public function add_point_req3($id, $points) {
$pints = $this->check_wallet($id);
if ($pints) {
$query = $this->add_wallet2($id, $points);
} else {
$query = $this->add_wallet3($id, $points);
}
if ($query) {
return true;
}
}
public function withdraw_point_req($from, $to) {
$this->db->select("\162\x65\161\165\x65\x73\x74\137\151\144\x2c\165\163\x65\x72\x5f\151\144\x2c\162\145\x71\165\x65\x73\164\137\x70\157\x69\x6e\164\x73\54\x74\151\155\145\54\162\x65\161\x75\145\x73\x74\x5f\x73\164\141\x74\165\x73\54\163\x65\x72\x76\151\x63\145\137\143\x68\x61\162\147\145");
$this->db->where("\x44\101\124\105\x28\x74\151\x6d\x65\x29\x20\102\105\124\127\x45\105\116\x20\x27{$from}\47\40\x41\116\x44\40\47{$to}\47");
$query = $this->db->where(array("\x74\171\160\x65" => "\x57\x69\x74\150\144\162\141\167\x61\x6c"))->order_by("\162\x65\x71\165\x65\163\164\x5f\x69\144", "\104\x45\123\x43")->get("\164\x62\x6c\122\145\161\x75\x65\x73\164");
return $query->result_array();
}
public function withdraw_point($form, $to) {
$this->db->select("\52");
$this->db->from("\x74\142\154\x52\145\161\x75\x65\x73\x74");
$this->db->where("\164\x79\x70\145", "\x57\x69\164\x68\x64\162\x61\167\x61\x6c");
$this->db->order_by("\162\145\x71\x75\x65\x73\x74\x5f\x69\x64", "\x44\105\x53\103");
$this->db->limit(5000);
$this->db->where("\x64\141\164\145\x28\164\151\155\x65\51\40\76\75\47{$form}\47");
$this->db->where("\144\x61\164\145\50\164\x69\155\145\51\74\x3d\x27{$to}\47");
$query = $this->db->get();
return $query->result_array();
}
public function withdraw_point_list($request) {
$cdate = date("\x59\x2d\155\55\144");
$min_date = date("\131\55\x6d\55\x64", strtotime("\55\x34\x20\144\141\171\163"));
$max_date = date("\x59\55\x6d\x2d\144", strtotime("\53\61\40\x64\141\171\x73"));
$nextDate = date("\131\x2d\155\x2d\x64", strtotime("\53\x31\x20\144\x61\171", strtotime(date("\131\x2d\x6d\55\x64"))));
$ctime = date("\110\72\151\72\x73", strtotime("\x2b\x33\60\x20\x6d\x69\x6e", strtotime(date("\x48\x3a\x69\72\163"))));
$sport_id = "\61";
$search_text = isset($request["\163\x65\x61\x72\x63\x68"]) && !empty($request["\163\x65\x61\162\143\150"]) ? $request["\x73\x65\x61\x72\x63\x68"] : '';
$limit = isset($request["\154\x65\x6e\x67\164\150"]) && !empty($request["\154\145\x6e\147\x74\150"]) ? $request["\x6c\x65\156\x67\x74\150"] : 50;
$offset = isset($request["\160\141\x67\x65"]) && !empty($request["\160\x61\147\145"]) ? ($request["\160\141\147\145"] - 1) * $limit : 0;
$this->db->start_cache();
if (!empty($search_text)) {
$this->db->where("\164\x62\154\122\145\x71\x75\145\163\x74\56\162\x65\x71\165\x65\163\x74\x5f\x69\144\40\114\x49\113\x45\x20\x27\x25" . $search_text . "\45\47");
}
$query = $this->db->where(array("\164\171\160\145" => "\x57\x69\164\150\x64\162\x61\167\x61\x6c"))->order_by("\162\x65\161\165\145\x73\x74\137\151\144", "\x44\x45\x53\103")->limit($limit, $offset)->get("\164\142\x6c\122\x65\x71\x75\145\163\x74");
$res = $query->result_array();
foreach ($res as $row) {
$user_id = $row["\165\163\145\162\x5f\x69\144"];
$r = $this->db->select("\x6e\x61\x6d\x65\54\x6d\157\x62\x69\x6c\145\156\157")->from("\x75\x73\x65\x72\137\160\x72\157\x66\x69\154\x65")->where("\x69\x64", $user_id)->get()->row();
print_r($r);
}
$this->db->stop_cache();
$total = $this->db->select("\164\142\154\x52\145\x71\165\x65\x73\x74\x2e\x72\x65\161\165\x65\163\164\x5f\151\x64")->where("\164\x79\x70\145", "\x57\x69\164\x68\144\x72\x61\x77\141\x6c")->count_all_results();
$this->db->flush_cache();
$rdata["\x6c\x69\x73\x74"] = $res;
$rdata["\164\157\x74\x61\x6c\x50\141\x67\x65"] = ceil($total / $limit);
$rdata["\164\x6f\164\141\154\103\157\x75\x6e\164"] = $total;
return $rdata;
}
public function delete_withdraw_point_req($req_id) {
$row = $this->db->select("\165\163\145\162\x5f\x69\144\x2c\x53\x55\x4d\50\x72\145\161\165\145\163\164\x5f\160\x6f\151\x6e\164\163\x2b\x73\x65\162\x76\x69\143\x65\137\x63\150\141\x72\147\145\51\141\x73\x20\160\157\151\x6e\164")->where("\x72\x65\x71\165\145\163\164\x5f\151\x64", $req_id)->get("\x74\x62\x6c\122\145\161\165\145\x73\164")->row() ??NULL;
if (isset($row)) {
$this->db->set("\167\141\154\x6c\145\164\x5f\x70\x6f\151\156\164\163", "\167\x61\154\x6c\x65\x74\137\x70\x6f\x69\156\164\163\x20\53\x20" . (double)$row->point, FALSE);
$this->db->where("\x75\x73\145\x72\137\151\144", $row->user_id)->update("\164\x62\x6c\x77\141\154\154\145\x74");
if ($this->db->affected_rows() > 0) {
$this->db->where("\162\145\161\x75\x65\x73\164\x5f\151\x64", $req_id)->delete("\164\142\x6c\122\145\161\165\x65\163\164");
}
}
return true;
}
public function transfer_money_history() {
$query = $this->db->order_by("\143\162\145\x61\164\145\x5f\x61\x74", "\104\105\x53\x43")->get("\164\x62\154\164\x72\x61\x6e\x73\146\145\x72\137\x72\145\161\165\145\x73\x74");
return $query->result_array();
}
public function refer_history() {
$query = $this->db->order_by("\x63\x72\145\x61\x74\x65\x64\137\x61\164", "\x44\x45\x53\103")->get("\162\x65\146\x65\162\x5f\x68\x69\x73\x74\x6f\x72\171");
return $query->result_array();
}
public function withdraw_point_req2($id) {
$query = $this->db->get_where("\164\x62\x6c\x52\x65\x71\x75\x65\x73\x74", array("\x72\x65\161\x75\x65\x73\x74\137\163\164\x61\164\x75\x73" => "\160\x65\x6e\144\x69\x6e\147", "\162\x65\161\165\145\x73\164\137\151\x64" => $id));
$aa = $query->row_array();
$amt = 0;
if (isset($aa)) {
$amt = - $aa["\x72\145\x71\x75\x65\163\164\x5f\160\157\x69\156\164\163"];
}
if ($this->ch_amt($amt, $aa["\165\163\x65\162\137\151\144"]) >= 0) {
$query2 = $this->db->update("\164\142\154\x52\x65\161\x75\x65\x73\164", array("\162\x65\161\165\145\163\x74\137\x73\164\x61\164\165\163" => "\141\160\160\x72\x6f\x76\x65\144"), array("\x72\145\x71\165\145\163\164\x5f\151\144" => $id));
}
return $aa;
}
public function withdraw_point_req3($id, $points) {
if ($this->ch_amt($points, $id) >= 0) {
$query = $this->db->query("\125\120\104\x41\x54\105\x20\164\142\x6c\x77\x61\x6c\154\145\x74\x20\x73\x65\x74\40\x77\x61\x6c\154\x65\164\137\x70\157\x69\156\164\x73\75\167\141\x6c\x6c\145\x74\137\160\157\151\x6e\164\x73\x2d\47{$points}\47\x20\x77\150\145\x72\x65\40\x75\163\145\162\x5f\x69\x64\x3d\47{$id}\x27\40");
}
if ($query) {
return true;
}
}
public function starline() {
$query = $this->db->query("\11\123\105\x4c\x45\x43\124\40\x2a\x20\x46\x52\117\x4d\x20\x60\x74\x62\154\x53\x74\x61\162\x6c\x69\x6e\145\140");
return $query->result_array();
}
public function starline_update($id) {
$query = $this->db->query("\x53\105\114\x45\x43\x54\x20\52\40\106\122\117\115\40\x60\x74\x62\x6c\x53\164\x61\x72\x6c\x69\x6e\145\140\40\x77\150\145\162\x65\40\x69\144\x3d\x27{$id}\x27\40");
return $query->result_array();
}
public function starline_update2($id) {
$snum = trim($this->input->post("\163\156\x75\155"));
$stime = trim($this->input->post("\x73\x74\151\155\x65"));
$snums = explode("\x2d", $snum);
$data = array("\163\x5f\147\141\155\145\x5f\156\x75\155\x62\x65\162" => $snum, "\163\x5f\x67\x61\x6d\x65\x5f\x74\x69\155\x65" => $stime);
$query = $this->db->update("\164\x62\154\x53\x74\141\x72\x6c\151\x6e\x65", $data, array("\x69\x64" => $id));
$this->update_chart($id, "\x4a\x61\x6e\156\x61\x74\x20\x53\x74\141\162\x6c\x69\156\145", $snums[0], $snums[1]);
if ($query) {
return true;
}
}
public function update_user_data($post_image) {
$data = array("\156\x61\155\x65" => $this->input->post("\156\141\x6d\x65"), "\x7a\x69\x70\143\x6f\x64\145" => $this->input->post("\172\151\160\x63\x6f\144\x65"), "\x63\x6f\156\164\x61\143\x74" => $this->input->post("\143\157\156\164\x61\x63\164"), "\x61\144\144\x72\145\163\x73" => $this->input->post("\x61\144\144\162\145\163\163"), "\x67\x65\156\x64\145\162" => $this->input->post("\x67\145\x6e\x64\x65\x72"), "\x73\164\141\164\x75\163" => $this->input->post("\x73\164\x61\x74\165\x73"), "\144\x6f\x62" => $this->input->post("\x64\157\142"), "\151\155\141\x67\x65" => $post_image, "\x72\145\147\x69\x73\164\145\162\x5f\144\x61\164\145" => date("\x59\55\x6d\55\144\x20\x48\72\x69\72\163"));
$this->db->where("\x69\x64", $this->input->post("\x69\x64"));
$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\x65\137\143\157\x6e\146\x69\x67");
return $query->result_array();
}
$query = $this->db->get_where("\163\x69\164\145\x5f\x63\x6f\x6e\146\x69\x67", array("\151\144" => $id));
return $query->row_array();
}
public function update_siteconfiguration($id = false) {
if ($id === false) {
$query = $this->db->get("\163\151\x74\x65\x5f\x63\x6f\x6e\x66\x69\x67");
return $query->result_array();
}
$query = $this->db->get_where("\x73\x69\x74\x65\x5f\143\x6f\156\146\x69\147", array("\x69\144" => $id));
return $query->row_array();
}
public function update_siteconfiguration_data($post_image) {
$data = array("\163\151\164\x65\137\164\x69\x74\x6c\x65" => $this->input->post("\x73\x69\164\x65\x5f\x74\x69\x74\154\145"), "\x73\151\x74\x65\x5f\156\x61\x6d\x65" => $this->input->post("\163\x69\x74\x65\x5f\156\141\155\145"), "\154\157\x67\157\x5f\x69\x6d\147" => $post_image);
$this->db->where("\x69\144", $this->input->post("\151\144"));
return $this->db->update("\163\151\x74\145\137\x63\x6f\x6e\146\151\147", $data);
}
public function get_mobile_data() {
$query = $this->db->get("\163\x69\164\145\137\143\157\156\146\x69\147");
return $query->row_array();
}
public function update_mobile_data() {
$data = array("\155\x6f\x62\151\x6c\x65" => $this->input->post("\x6d\x6f\x62\x69\x6c\145"));
return $this->db->update("\x73\151\164\x65\x5f\143\157\x6e\x66\151\x67", $data);
}
public function create_slider($post_image) {
$data = array("\164\x69\164\x6c\145" => $this->input->post("\164\151\164\154\145"), "\x69\155\x61\147\145" => $post_image, "\144\x65\163\x63\x72\151\x70\164\x69\x6f\156" => $this->input->post("\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e"), "\x73\x74\141\164\x75\163" => $this->input->post("\163\x74\141\x74\165\x73"));
return $this->db->insert("\163\x6c\x69\x64\x65\162\163\137\151\155\x67", $data);
}
public function get_sliders($id = false) {
if ($id === false) {
$query = $this->db->get("\163\x6c\151\x64\x65\x72\163\137\151\x6d\147");
return $query->result_array();
}
$query = $this->db->get_where("\x73\154\x69\144\145\162\163\x5f\x69\x6d\147", array("\151\144" => $id));
return $query->row_array();
}
public function get_slider_data($id = false) {
if ($id === false) {
$query = $this->db->get("\163\x6c\151\144\145\162\163\137\x69\155\147");
return $query->result_array();
}
$query = $this->db->get_where("\163\154\151\x64\x65\x72\x73\137\x69\x6d\147", array("\151\144" => $id));
return $query->row_array();
}
public function update_slider_data($post_image) {
$data = array("\x74\151\164\154\145" => $this->input->post("\x74\x69\164\154\145"), "\151\155\141\x67\145" => $post_image, "\x64\x65\163\143\162\151\x70\x74\151\157\x6e" => $this->input->post("\x64\x65\163\x63\x72\x69\160\x74\151\x6f\156"), "\x73\164\141\x74\165\x73" => $this->input->post("\x73\x74\x61\164\165\x73"));
$this->db->where("\151\144", $this->input->post("\151\x64"));
return $this->db->update("\163\x6c\x69\x64\x65\x72\x73\137\151\x6d\x67", $data);
}
public function getChart() {
return $this->db->get("\143\x68\141\x72\164\x73")->result_array();
}
public function getChartDetails($name) {
return $this->db->where("\156\141\x6d\x65", $name)->get("\143\150\141\162\164\163")->result_array();
}
public function update_chart_data() {
$snum = $this->input->post("\163\x6e\165\x6d");
$enum = $this->input->post("\145\x6e\165\155");
$data = array("\156\141\155\145" => $this->input->post("\x6e\x61\155\145"), "\x64\141\164\x65" => $this->input->post("\144\141\164\x65"), "\163\164\x61\162\164\151\156\x67\x5f\156\x75\x6d" => !empty($snum) ? $snum : null, "\x72\x65\163\x75\x6c\164\x5f\x6e\x75\155" => $this->input->post("\x6e\165\155"), "\x65\156\144\x5f\x6e\x75\x6d" => !empty($enum) ? $enum : null);
$this->db->where("\x6e\x61\155\145", $this->input->post("\x6e\x61\x6d\x65") and "\x64\x61\164\145", $this->input->post("\x64\x61\x74\145"));
return $this->db->update("\143\150\141\162\164\163", $data);
}
public function add_chart_data() {
$snum = $this->input->post("\163\156\165\155");
$enum = $this->input->post("\145\156\165\x6d");
$data = array("\x6e\141\x6d\x65" => $this->input->post("\143\x68\141\162\164"), "\x64\141\x74\145" => $this->input->post("\x64\141\164\x65"), "\163\164\x61\162\164\151\156\147\x5f\156\165\x6d" => !empty($snum) ? $snum : null, "\162\x65\163\x75\x6c\x74\x5f\x6e\165\x6d" => $this->input->post("\x6e\x75\x6d"), "\x65\156\x64\x5f\x6e\165\x6d" => !empty($enum) ? $enum : null);
return $this->db->insert("\x63\150\141\x72\164\163", $data);
}
public function getUserDetails() {
return $this->db->get("\x75\x73\145\x72\x73")->result_array();
}
public function getMatkaDetails() {
return $this->db->get("\155\141\164\153\141")->result_array();
}
public function get_total_users() {
return $this->db->where("\151\x73\x5f\x64\145\x6c\145\x74\x65\x64\x20\75\x21", "\61")->get("\x75\163\145\162\137\x70\x72\157\x66\x69\154\145")->num_rows();
}
public function create_matka($team_image) {
$snum = $this->input->post("\x73\156\165\155");
$enum = $this->input->post("\x65\156\165\155");
$name = $this->input->post("\x6e\141\x6d\145");
$query = $this->db->get_where("\x6d\x61\164\153\141", array("\156\141\155\x65" => $name));
$count = $query->num_rows();
if ($count === 0) {
$data = array("\x6e\x61\155\145" => $this->input->post("\x6e\141\155\145"), "\163\x74\141\162\x74\137\164\151\155\145" => $this->input->post("\x73\x74\x69\x6d\x65"), "\145\156\x64\137\164\x69\x6d\x65" => $this->input->post("\x65\x74\x69\155\145"), "\x73\164\x61\x72\164\x69\156\x67\137\x6e\x75\155" => !empty($snum) ? $snum : null, "\x6e\165\x6d\142\145\x72" => $this->input->post("\156\x75\x6d"), "\145\156\144\x5f\156\x75\x6d" => !empty($enum) ? $enum : null, "\142\x69\144\137\163\x74\x61\x72\164\137\164\x69\x6d\145" => $this->input->post("\146\x73\x74\151\155\145"), "\x62\x69\144\x5f\x65\156\144\137\x74\x69\x6d\145" => $this->input->post("\x66\x65\164\151\x6d\145"));
$data1 = array("\x6e\141\155\x65" => $this->input->post("\156\x61\155\x65"), "\x64\x61\164\145" => date("\131\x2d\155\x2d\x64"), "\x73\x74\x61\x72\164\151\156\147\137\x6e\x75\x6d" => $this->input->post("\x73\156\x75\x6d"), "\162\145\163\x75\154\164\137\x6e\165\155" => $this->input->post("\x6e\x75\155"), "\x65\156\144\x5f\x6e\x75\155" => $this->input->post("\145\156\x75\x6d"));
$this->session->set_flashdata("\x73\165\143\x63\145\x73\163", "\131\x6f\165\x72\40\x6d\x61\164\x6b\141\40\150\x61\163\40\142\x65\x65\x6e\40\143\x72\145\141\x74\145\x64\x2e");
$this->db->insert("\x6d\141\x74\x6b\x61", $data);
$this->db->insert("\143\150\x61\x72\x74\163", $data1);
$ref = "\154\151\163\164";
} else {
$ref = "\x61\x64\144";
$this->session->set_flashdata("\x66\141\x69\x6c", "\116\x61\155\x65\x20\x61\154\162\x65\141\x64\x79\40\x45\x78\151\163\164\x20\56");
}
return $ref;
}
public function listmatka($teamId = false, $limit = false, $offset = false) {
if ($limit) {
$this->db->limit($limit, $offset);
}
if ($teamId === false) {
$this->db->select("\52\54\111\x46\x28\x69\x73\x5f\150\157\x6d\x65\x70\141\147\145\x5f\x67\x61\155\x65\40\75\40\61\x2c\x20\103\x4f\x4e\103\x41\x54\50\163\164\x61\162\x74\151\x6e\147\x5f\x6e\165\155\54\x20\47\x20\x58\x20\47\x2c\x20\145\156\x64\137\x6e\165\155\x29\x2c\x6e\165\x6d\142\x65\162\51\x20\101\123\x20\162\145\x73\x75\154\x74");
$this->db->order_by("\155\141\x74\x6b\x61\56\x6d\141\x74\x6b\x61\137\157\162\x64\x65\x72", "\101\x53\103");
$query = $this->db->get("\155\x61\x74\153\x61");
return $query->result_array();
}
$this->db->select("\x6d\141\x74\x6b\x61\56\52\54\164\x62\x6c\116\x6f\x74\x69\143\145\x2e\162\x61\164\145\40\141\163\40\x6d\x61\162\x6b\x65\x74\x5f\162\x61\164\x65");
$this->db->where("\155\x61\164\x6b\x61\56\151\x64", $teamId)->from("\x6d\x61\x74\x6b\141");
$this->db->join("\164\142\154\116\157\x74\x69\143\145", "\164\x62\154\x4e\157\164\x69\143\x65\56\151\144\x20\x3d\x20\155\141\x74\153\x61\x2e\x69\144", "\154\145\146\164");
return $query = $this->db->get()->row_array();
}
public function memberlistteams($id) {
$this->db->order_by("\x6d\x61\164\153\x61\x2e\151\x64", "\104\x45\x53\103");
return $query->result_array();
}
public function update_team_data() {
$c = 0;
$snum = $this->input->post("\163\156\165\x6d") ??NULL;
$enum = $this->input->post("\145\x6e\x75\155") ??NULL;
$num = $this->input->post("\156\165\x6d") ??NULL;
$id = $this->input->post("\151\144");
$name = $this->input->post("\156\141\x6d\x65");
$date = $this->input->post("\x75\x64\x61\164\x65");
$data = array("\x6e\141\x6d\x65" => $name, "\163\x74\141\x72\x74\151\x6e\x67\x5f\156\x75\x6d" => !empty($snum) ? $snum : null, "\156\x75\x6d\x62\145\x72" => !empty($num) ? $num : null, "\145\156\x64\137\156\165\x6d" => !empty($enum) ? $enum : null, "\x62\151\144\x5f\163\164\141\x72\164\x5f\x74\x69\x6d\145" => $this->input->post("\x66\163\164\151\x6d\x65"), "\x62\x69\x64\137\x65\x6e\x64\x5f\x74\x69\x6d\145" => $this->input->post("\146\145\164\151\x6d\x65"), "\163\x74\141\x72\164\137\164\151\155\145" => $this->input->post("\x66\x73\x74\x69\155\145"), "\145\x6e\x64\137\164\x69\155\x65" => $this->input->post("\x66\145\x74\151\155\x65"), "\x73\x61\x74\137\x73\x74\x61\x72\x74\137\164\x69\x6d\x65" => $this->input->post("\146\x73\x74\151\x6d\x65"), "\155\141\164\x6b\141\137\162\141\164\145" => $this->input->post("\155\x61\164\x6b\141\137\x72\x61\x74\145"), "\x73\x61\x74\137\x65\x6e\x64\137\164\x69\x6d\x65" => $this->input->post("\146\145\164\151\155\145"));
$this->db->where("\151\x64", $id);
$this->db->update("\x6d\x61\x74\x6b\141", $data);
$home_page_game = $this->db->select("\x69\163\x5f\150\x6f\x6d\145\x70\141\147\145\137\x67\141\155\145")->where("\151\144", $id)->get("\155\141\x74\x6b\141")->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("\x59\55\155\55\x64") : $date;
$data1 = array("\156\x61\x6d\145" => $name, "\143\x69\144" => $id, "\x64\x61\164\145" => $dt, "\x73\x74\x61\162\164\x69\x6e\147\x5f\156\x75\155" => !empty($snum) ? $snum : null, "\162\145\163\x75\x6c\164\137\156\x75\x6d" => $num, "\x65\156\x64\137\156\x75\x6d" => !empty($enum) ? $enum : null);
$where = array("\143\x69\x64" => $id, "\x64\x61\x74\145" => $dt);
$data2 = $this->db->select("\x43\117\125\x4e\124\50\151\x64\51\40\141\163\40\x63\x6f\165\156\164\x65\162")->where($where)->get("\143\150\x61\162\164\163")->row();
if ($data2->counter > 0) {
$this->db->where($where);
$this->db->update("\x63\x68\141\162\x74\x73", $data1);
} else {
$this->db->insert("\143\x68\141\x72\x74\163", $data1);
}
if (!empty($snum) && !empty($enum)) {
$message = $snum . "\x20\130\40" . $enum;
} elseif (!empty($snum) && empty($enum)) {
$message = $snum;
} elseif (empty($snum) && !empty($enum)) {
$message = $enum;
} else {
$message = $num;
}
@sendPushNotification("\157\156\154\151\x6e\x65\137\164\145\x65\162\137\142\141\x7a\x61\162", $name, $message, 2);
return true;
}
public function get_admin_data() {
$id = $this->session->userdata("\165\163\x65\162\137\151\144");
if ($id === false) {
$query = $this->db->get("\x75\x73\145\162\x73");
return $query->result_array();
}
$query = $this->db->get_where("\x75\x73\x65\162\x73", array("\151\x64" => $id));
return $query->row_array();
}
public function change_password($new_password) {
$data = array("\160\141\x73\x73\167\x6f\x72\144" => md5($new_password));
$this->db->where("\x69\144", $this->session->userdata("\165\163\x65\x72\137\x69\x64"));
return $this->db->update("\165\163\x65\x72\163", $data);
}
public function match_old_password($password) {
$id = $this->session->userdata("\165\x73\145\x72\137\x69\x64");
if ($id === false) {
$query = $this->db->get("\x75\163\x65\x72\x73");
return $query->result_array();
}
$query = $this->db->get_where("\x75\x73\x65\x72\x73", array("\x70\x61\163\163\x77\x6f\162\144" => $password));
return $query->row_array();
}
public function email_exists() {
$email = $this->input->post("\145\x6d\x61\x69\154");
$query = $this->db->query("\x53\x45\x4c\x45\103\124\40\145\x6d\141\x69\154\54\x20\160\x61\163\x73\167\157\x72\144\40\x46\x52\117\x4d\40\x75\x73\x65\x72\x73\40\127\110\105\x52\105\40\x65\155\x61\151\x6c\75\47{$email}\x27");
if ($row = $query->row()) {
return true;
} else {
return false;
}
}
public function temp_reset_password($temp_pass) {
$data = array("\x65\155\141\151\x6c" => $this->input->post("\145\155\x61\x69\154"), "\162\145\163\145\x74\x5f\x70\x61\163\x73" => $temp_pass);
$email = $data["\145\x6d\x61\x69\154"];
if ($data) {
$this->db->where("\x65\x6d\x61\x69\154", $email);
$this->db->update("\x75\163\x65\162\163", $data);
return true;
} else {
return false;
}
}
public function is_temp_pass_valid($temp_pass) {
$this->db->where("\x72\x65\163\x65\164\137\160\141\x73\x73", $temp_pass);
$query = $this->db->get("\x75\163\145\162\x73");
if ($query->num_rows() == 1) {
return true;
} else {
return false;
}
}
public function deletepackage($id) {
$data = array("\163\x74\141\x74\165\x73" => 2);
$this->db->where("\x69\144", $id);
return $this->db->update("\160\141\x63\153\x61\x67\x65", $data);
}
public function add_wallet_4($id, $wa, $wallet = '') {
if ($wallet != '') {
if ($wallet == "\x77\141\x6c\154\145\x74\x5f\160\x6f\x69\156\x74\163") {
$query = $this->db->query("\x55\160\144\141\x74\x65\x20\164\142\x6c\x77\x61\x6c\x6c\x65\164\40\x73\x65\164\x20\167\141\x6c\x6c\x65\164\137\x70\157\151\x6e\x74\163\75\167\141\x6c\x6c\145\164\x5f\160\157\x69\156\164\163\53\47{$wa}\x27\40\x77\150\x65\x72\145\x20\x75\x73\x65\x72\x5f\x69\x64\75\x27{$id}\x27");
} else {
$query = $this->db->query("\x55\160\144\141\x74\145\x20\164\x62\x6c\x77\141\154\154\145\164\40\x73\145\164\x20\155\141\151\x6e\x5f\167\x61\x6c\154\145\164\137\160\x6f\x69\x6e\x74\163\75\x6d\x61\x69\x6e\x5f\167\x61\154\154\x65\x74\x5f\160\157\x69\x6e\x74\163\x2b\x27{$wa}\47\x20\x77\150\145\162\145\x20\x75\x73\145\162\137\151\144\x3d\47{$id}\x27");
}
} else {
$query = $this->db->query("\125\x70\x64\x61\x74\145\40\x74\142\x6c\x77\x61\154\x6c\x65\x74\x20\163\x65\x74\40\155\141\151\156\137\167\141\154\x6c\x65\164\x5f\160\157\x69\156\x74\x73\75\x6d\141\151\x6e\137\167\141\x6c\154\145\x74\137\160\157\151\x6e\x74\x73\x2b\47{$wa}\47\40\167\150\145\162\x65\40\165\163\145\x72\x5f\151\144\x3d\47{$id}\x27");
}
if ($query) {
return true;
}
}
public function add_MarketData($data) {
$data = $this->db->insert("\155\141\164\x6b\x61", $data);
return $data;
}
public function inactiveUserList() {
$now = date("\x59\x2d\x6d\55\x64");
$date = date("\x59\x2d\155\x2d\144", strtotime("\55\62\40\x6d\157\156\x74\150\x73"));
$request_data = $this->db->select("\x75\x73\x65\162\x5f\x69\x64")->where("\x64\141\164\145\x28\x74\151\155\x65\51\x3e\x3d", $date)->group_by("\x75\163\x65\x72\137\x69\x64")->order_by("\165\163\x65\162\137\x69\x64", "\x44\x45\x53\103")->get("\164\x62\154\122\x65\161\x75\x65\163\x74")->result();
$request_id = count($request_data) > 0 ? array_column($request_data, "\165\163\145\x72\137\x69\x64") : array();
$game_data = $this->db->select("\x75\x73\145\162\137\x69\144")->where("\144\141\x74\145\x28\x74\x69\x6d\145\x29\x3e\x3d", $date)->group_by("\165\x73\145\x72\137\x69\x64")->order_by("\x75\163\x65\x72\137\x69\x64", "\x44\x45\x53\103")->get("\164\142\x6c\x67\141\155\145\144\141\x74\x61")->result();
$game_id = count($game_data) > 0 ? array_column($game_data, "\165\163\x65\x72\x5f\151\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\141\155\145\54\x75\56\165\x73\145\162\156\141\x6d\x65\54\x75\56\x6d\x6f\x62\151\154\145\x6e\157\x2c\165\x2e\x65\155\x61\x69\154\54\x75\x2e\x61\144\144\162\x65\163\163\54\x75\56\160\141\163\x73\167\x6f\162\144\54\x74\56\x77\141\154\154\145\x74\x5f\x70\x6f\x69\x6e\164\x73\54\164\56\155\x61\151\x6e\137\x77\141\x6c\x6c\x65\164\137\x70\x6f\151\156\x74\x73")->from("\x75\163\x65\x72\x5f\160\162\x6f\146\151\154\145\x20\x75")->join("\x74\x62\x6c\x77\141\154\154\145\x74\40\x74", "\x75\56\x69\x64\75\x74\x2e\165\163\x65\162\137\151\144")->get()->result();
return $user_data;
}
public function change_status_userlist($id, $set_status = 0) {
$data = array("\154\x6f\x67\x69\x6e\137\x73\x74\x61\x74\x75\x73" => $set_status);
$this->db->where("\x69\x64", $id);
return $this->db->update("\x75\163\145\162\137\160\162\x6f\x66\x69\154\145", $data);
}
public function deleteuserlist($id) {
$data = array("\x69\x73\x5f\144\x65\154\x65\x74\145\144" => 1, "\155\157\142\151\x6c\x65\156\157" => "\60");
$this->db->where("\x69\144", $id);
return $this->db->set("\144\145\154\145\164\145\x64\137\155\x6f\x62\151\x6c\145\156\x6f", "\x6d\x6f\x62\x69\154\145\x6e\157", false)->update("\165\x73\x65\162\137\x70\162\x6f\x66\151\154\x65", $data);
}
public function user_registered($date) {
$query = $this->db->query("\x53\x45\114\105\x43\124\x20\52\40\x46\x52\x4f\x4d\40\140\165\x73\145\162\x5f\160\x72\157\146\x69\154\145\x60\x20\x57\110\x45\122\105\x20\104\x41\124\x45\x28\x60\164\x69\155\x65\140\51\x20\75\x20\47{$date}\x27\40\141\x6e\144\40\x69\163\137\144\145\154\145\x74\x65\144\40\41\x3d\47\61\47");
return $query->num_rows();
}
public function this_week_user_registered() {
$d = strtotime("\x74\x6f\144\141\x79");
$start_week = strtotime("\x6c\141\163\164\x20\x73\165\x6e\144\x61\x79\x20\155\x69\144\156\x69\147\150\164", $d);
$end_week = strtotime("\156\x65\170\x74\40\x73\x61\x74\165\162\x64\x61\171", $d);
$start = date("\x59\55\155\x2d\x64", $start_week);
$end = date("\131\55\x6d\55\x64", $end_week);
$query = $this->db->query("\x53\105\114\x45\103\124\x20\x2a\x20\x46\x52\117\x4d\40\x60\165\x73\x65\x72\137\x70\162\157\146\151\154\145\x60\x20\127\x48\x45\122\x45\x20\104\101\x54\105\x28\x60\164\151\155\145\140\x29\40\x3e\75\40\47{$start}\x27\40\x41\116\x44\40\104\x41\124\x45\x28\140\x74\151\x6d\145\x60\51\x20\x3c\75\40\x27{$end}\x27\x20\x61\156\144\x20\x69\163\x5f\144\145\154\x65\164\x65\x64\x20\x21\75\x27\61\47");
return $query->num_rows();
}
public function last_week_user_registered() {
$previous_week = strtotime("\x2d\61\40\167\x65\x65\153\x20\53\x31\40\144\141\x79");
$start_week = strtotime("\154\141\x73\x74\40\x73\x75\x6e\144\x61\171\x20\x6d\x69\x64\x6e\151\147\x68\164", $previous_week);
$end_week = strtotime("\x6e\x65\170\164\40\163\x61\164\x75\x72\x64\141\171", $start_week);
$start_week = date("\x59\55\x6d\55\x64", $start_week);
$end_week = date("\x59\55\x6d\55\x64", $end_week);
$query = $this->db->query("\123\x45\x4c\105\103\x54\x20\x2a\40\106\122\117\115\40\140\x75\163\x65\162\137\160\162\157\x66\x69\x6c\x65\140\40\x57\110\105\x52\105\40\104\x41\124\x45\x28\x60\x74\x69\155\x65\x60\51\40\x3e\x3d\x20\x27{$start_week}\x27\40\101\116\x44\x20\104\101\124\105\50\x60\x74\151\155\145\x60\51\x20\x3c\x3d\x20\47{$end_week}\47\40\141\x6e\144\x20\151\163\x5f\144\x65\x6c\145\164\145\144\x20\41\x3d\x27\61\x27");
return $query->num_rows();
}
public function current_month_user_registered() {
$first = date("\131\x2d\x6d\55\60\x31");
$last = date("\131\x2d\155\x2d\144");
$query = $this->db->query("\x53\105\x4c\x45\103\124\40\x2a\x20\x46\122\x4f\x4d\x20\x60\x75\x73\x65\x72\137\x70\x72\157\146\x69\154\x65\x60\x20\127\x48\x45\x52\x45\x20\x44\x41\124\105\50\x60\x74\x69\x6d\x65\140\x29\x20\76\x3d\x20\47{$first}\x27\x20\101\x4e\x44\x20\x44\101\x54\105\x28\x60\164\151\155\145\140\x29\x20\x3c\x3d\x20\x27{$last}\x27\40\141\x6e\x64\40\x69\x73\x5f\x64\145\154\x65\x74\145\144\x20\x21\x3d\47\x31\47");
return $query->num_rows();
}
public function last_month_user_registered() {
$first = date("\131\x2d\155\55\144", strtotime("\x66\x69\x72\x73\x74\40\x64\141\x79\x20\157\146\40\x70\x72\145\166\x69\x6f\165\x73\x20\x6d\157\x6e\164\x68"));
$last = date("\131\55\155\55\144", strtotime("\x6c\141\x73\x74\x20\x64\x61\171\40\157\x66\40\160\x72\145\x76\x69\157\165\163\40\155\157\x6e\x74\x68"));
$query = $this->db->query("\123\105\x4c\105\x43\x54\40\x2a\x20\x46\x52\x4f\115\x20\140\165\163\145\162\x5f\160\x72\157\x66\151\154\145\x60\40\x57\110\x45\122\x45\40\104\101\x54\105\50\140\164\x69\155\x65\140\51\40\x3e\x3d\40\47{$first}\47\40\101\x4e\104\40\x44\x41\x54\x45\50\x60\164\x69\155\x65\x60\x29\x20\x3c\75\40\x27{$last}\x27\x20\141\x6e\144\x20\151\x73\137\144\145\x6c\145\164\x65\144\x20\41\x3d\47\x31\47");
return $query->num_rows();
}
public function logged_in_users() {
$query = $this->db->query("\x73\x65\x6c\x65\x63\x74\40\x63\x6f\x75\x6e\x74\x28\151\163\x5f\154\157\x67\151\x6e\51\40\x61\x73\x20\154\x6f\157\147\x65\144\151\156\x75\x73\145\x72\163\40\x66\162\157\x6d\40\165\163\145\x72\x5f\x70\x72\157\146\x69\154\145\40\x77\x68\x65\162\145\x20\x69\x73\x5f\154\x6f\147\151\156\40\75\x20\47\61\x27\x20");
return $a = $query->row()->loogedinusers??0;
}
public function zero_balance_users() {
$query = $this->db->query("\163\x65\154\145\x63\164\x20\143\x6f\165\156\164\x28\167\x61\x6c\154\145\164\137\x69\x64\x29\40\141\163\40\172\x65\x72\157\137\x62\141\154\141\156\143\x65\137\165\163\145\162\40\146\x72\157\x6d\x20\164\142\154\x77\141\x6c\154\145\164\40\x77\150\x65\162\x65\40\x77\x61\154\x6c\145\x74\137\x70\157\x69\156\164\163\40\75\x20\47\60\47\40");
$a = $query->row();
if ($a != '') {
return $query->row()->zero_balance_user;
} else {
return 0;
}
}
public function today_zero_balance_users() {
return $query = $this->db->where("\167\x61\154\x6c\145\x74\x5f\x70\x6f\x69\x6e\164\163", 0)->where("\104\101\124\x45\x28\165\160\144\141\x74\145\144\137\141\x74\x29", date("\x59\x2d\155\x2d\144"))->get("\164\142\154\x77\141\x6c\x6c\x65\164")->num_rows();
}
public function banned_users() {
$query = $this->db->query("\x73\145\154\145\143\x74\40\143\x6f\x75\x6e\164\50\x6c\x6f\147\x69\x6e\x5f\163\x74\141\164\165\x73\x29\40\141\163\x20\x62\141\x6e\x6e\145\x64\x5f\x75\x73\x65\x72\163\x20\146\x72\157\x6d\x20\165\x73\x65\x72\137\160\x72\157\146\151\x6c\x65\x20\167\x68\145\x72\145\40\154\x6f\147\151\x6e\137\163\x74\141\x74\165\163\x20\x3d\40\x27\61\47\40");
return $query->row()->banned_users??0;
}
public function total_deposited_amount() {
$last_date = date("\131\55\155\55\x64\x20\60\x30\72\x30\60\72\x30\61");
$query = $this->db->query("\x73\145\x6c\145\143\164\40\151\x66\50\123\x55\115\x28\162\145\x71\x75\x65\x73\x74\137\160\x6f\151\x6e\x74\163\x29\x20\151\163\40\x6e\x75\x6c\154\54\x30\x2c\x53\125\115\50\162\145\161\x75\x65\163\x74\x5f\160\157\x69\156\164\x73\x29\51\40\x61\163\x20\x64\x65\x70\x6f\163\x69\x74\137\x61\155\157\165\x6e\x74\40\xa\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\146\162\x6f\x6d\x20\164\142\154\122\145\161\165\x65\x73\x74\40\x77\x68\x65\162\x65\40\164\x79\160\145\75\47\x41\144\x64\47\x20\141\156\144\40\x74\151\x6d\x65\40\76\75\40\x27{$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("\163\145\x6c\x65\x63\164\x20\151\146\50\123\x55\x4d\x28\162\x65\x71\x75\x65\x73\164\x5f\x70\157\x69\156\164\x73\51\x20\x69\163\x20\156\165\x6c\154\x2c\x30\x2c\123\125\115\x28\162\x65\161\165\x65\163\x74\x5f\160\157\151\x6e\164\163\x29\51\x20\141\163\x20\167\x69\x74\x68\144\x72\141\167\x6c\137\x61\155\x6f\x75\x6e\x74\40\146\x72\x6f\155\40\164\x62\x6c\122\x65\x71\x75\145\163\x74\40\x77\x68\145\x72\145\40\x74\171\160\145\x3d\x27\x57\151\x74\x68\x64\x72\141\167\x61\x6c\47\40\141\156\x64\40\162\145\x71\x75\145\163\x74\x5f\x73\164\141\164\x75\x73\75\x27\141\160\x70\162\157\x76\145\144\x27\40\141\156\x64\x20\164\151\x6d\x65\40\x3e\x3d\40\47{$this->last_date}\x27");
$a = $query->row();
if ($a != '') {
return $query->row()->withdrawl_amount;
} else {
return 0;
}
}
public function yesterday_wallet_balance() {
$yesterday = date("\131\55\155\55\x64", strtotime("\55\61\x20\144\141\171"));
$wallet_amt = $this->db->query("\163\x65\154\x65\x63\x74\x20\x53\x55\x4d\x28\x77\x61\154\154\x65\164\137\160\157\x69\156\164\163\x29\x20\x61\x73\40\141\x6d\x74\x20\146\162\157\155\x20\x74\142\154\167\x61\x6c\x6c\x65\x74")->row()->amt;
$win_amt = $this->db->query("\163\145\154\145\x63\x74\40\x53\125\x4d\50\141\155\x74\x29\x20\x61\x73\x20\167\x69\x6e\x6e\x69\x6e\147\x5f\141\x6d\x6f\165\156\164\x20\146\x72\x6f\x6d\40\150\x69\x73\x74\157\162\171\x20\x77\x68\x65\x72\145\x20\164\x79\160\x65\75\x27\x63\x27\40\141\156\x64\x20\164\x69\x6d\145\40\x3e\75\x27{$yesterday}\47")->row()->winning_amount;
$withdrawal_amt = $this->db->query("\163\145\x6c\145\x63\x74\x20\123\125\x4d\x28\162\145\x71\165\145\x73\x74\137\160\x6f\x69\x6e\164\163\x29\40\x61\x73\40\167\151\x74\x68\x64\x72\x61\167\x6c\x5f\x61\155\x6f\x75\156\164\xa\x20\x20\40\40\40\40\40\40\x66\x72\x6f\155\40\x74\142\x6c\x52\145\161\x75\x65\x73\164\40\x77\150\145\162\x65\x20\164\x79\160\x65\75\x27\x57\x69\164\x68\x64\x72\141\x77\141\x6c\x27\x20\141\156\144\x20\x72\145\161\x75\145\163\164\x5f\163\x74\141\164\165\x73\x21\x3d\47\143\x61\156\143\x65\x6c\154\x65\144\x27\40\141\x6e\x64\x20\162\x65\x71\165\x65\163\x74\x5f\x73\164\x61\164\165\163\41\x3d\x27\x70\x65\x6e\x64\x69\156\x67\47\x20\141\x6e\x64\x20\164\x69\155\x65\40\76\75\x20\x27{$yesterday}\47")->row()->withdrawl_amount;
$deposit_amt = $this->db->query("\x73\x65\154\x65\143\x74\40\x53\125\115\x28\x72\x65\x71\x75\x65\163\x74\137\x70\157\x69\x6e\x74\163\x29\x20\141\163\40\144\145\160\157\x73\151\164\x5f\141\155\157\x75\x6e\164\40\146\162\157\x6d\40\x74\x62\154\x52\x65\161\165\145\x73\x74\x20\167\150\x65\162\145\x20\164\171\160\145\x3d\47\x41\144\144\47\x20\x61\156\x64\x20\164\151\155\x65\x20\x3e\75\x20\47{$yesterday}\47")->row()->deposit_amount;
$bet_played_amt = $this->db->query("\x73\145\154\145\143\x74\40\123\x55\x4d\50\x70\x6f\x69\156\x74\163\x29\x20\x61\x73\x20\x62\x65\x74\x74\x69\x6e\x67\137\x61\x6d\157\165\156\164\40\146\x72\x6f\155\x20\x74\142\154\147\x61\x6d\145\144\x61\x74\x61\40\x77\150\x65\162\x65\40\164\x69\x6d\145\x20\76\75\x20\x27{$yesterday}\x27")->row()->betting_amount;
$final_amt = $wallet_amt + $withdrawal_amt + $bet_played_amt - $win_amt - $deposit_amt;
if ($final_amt != '') {
return $final_amt;
} else {
return 0;
}
}
public function today_withdrawal() {
return $this->db->select("\x52\x4f\125\x4e\x44\x28\123\x55\x4d\50\101\102\x53\x28\162\x65\161\x75\x65\x73\x74\x5f\160\x6f\151\x6e\x74\x73\x29\x29\x2c\62\51\40\141\x73\x20\160\x6f\x69\156\x74")->where(array("\x72\145\161\x75\145\x73\x74\x5f\163\164\x61\x74\x75\163" => "\141\160\x70\162\157\166\145\144", "\164\x79\160\x65" => "\127\151\x74\150\144\162\141\x77\x61\x6c", "\x44\x41\x54\x45\50\164\151\x6d\145\51" => date("\131\55\155\55\144")))->get("\164\142\154\122\x65\x71\165\x65\163\164")->row()->point??0;
}
public function today_deposit() {
return $this->db->select("\123\x55\x4d\x28\x72\145\x71\165\x65\x73\x74\137\160\157\151\x6e\x74\163\x29\40\141\x73\40\x70\157\151\156\x74")->where(array("\x72\x65\161\165\x65\163\164\137\x73\x74\x61\x74\165\163" => "\141\x70\160\x72\157\166\145\x64", "\x74\171\x70\145" => "\101\x64\144", "\x44\x41\124\105\x28\x74\151\155\145\x29" => date("\x59\x2d\x6d\55\x64")))->where("\151\x73\137\x63\x61\163\150\142\x61\143\153\x20\111\x53\40\116\125\114\x4c")->get("\x74\x62\154\x52\145\x71\x75\145\x73\164")->row()->point??0;
}
public function today_bid_amount() {
return $query = $this->db->select("\123\x55\115\x28\141\155\x74\x29\x20\141\163\40\160\157\151\x6e\x74")->where(array("\x74\171\160\145" => "\144", "\104\x41\124\105\50\x74\151\155\145\x29" => date("\131\55\155\x2d\144")))->get("\150\x69\163\x74\157\162\171")->row()->point??0;
}
public function total_amount_wallet($type = '') {
return $this->db->select("\x53\125\115\x28{$type}\51\40\x61\163\40\141\155\x74")->get("\x74\x62\154\167\141\x6c\154\145\x74")->row()->amt??0;
}
public function count_active_users() {
$query = $this->db->query("\163\x65\154\145\143\x74\40\143\x6f\x75\x6e\164\x28\x6c\x6f\x67\151\x6e\137\163\164\x61\164\x75\x73\x29\x20\141\x73\x20\x61\143\x74\151\166\x65\x5f\x75\163\x65\162\163\x20\x66\162\157\x6d\40\165\x73\x65\x72\x5f\x70\162\157\x66\151\154\x65\40\x77\150\x65\162\145\40\151\x73\137\144\x65\154\145\x74\145\144\x20\41\x3d\x27\61\x27\40");
$a = $query->row();
if ($a != '') {
return $query->row()->active_users;
} else {
return 0;
}
}
public function today_paid_amount() {
return $this->db->select("\123\x55\115\x28\141\x6d\164\x29\x20\x61\x73\x20\x70\x6f\x69\156\x74")->where(array("\164\x79\160\145" => "\143", "\x44\x41\x54\105\50\x74\x69\155\x65\51" => date("\131\x2d\x6d\x2d\144")))->get("\x68\151\163\164\157\162\x79")->row()->point??0;
}
public function today_deposit_manually() {
$now = date("\x59\55\x6d\55\x64");
return $data = $this->db->select("\x53\x55\115\x28\162\x65\x71\x75\x65\163\x74\x5f\x70\157\x69\156\164\163\x29\x61\x73\x20\x61\x6d\x6f\165\x6e\x74")->where(array("\144\x61\x74\x65\x28\x74\x69\x6d\145\51" => $now, "\x69\x73\x5f\161\x72\143\x6f\144\145" => 0, "\x74\x79\x70\x65" => "\101\x64\144", "\x72\x65\161\165\x65\163\x74\x5f\163\164\x61\x74\165\163" => "\141\160\160\162\157\x76\145\144"))->get("\x74\142\x6c\x52\x65\x71\165\145\163\164")->row()->amount??0;
}
public function today_withdrwal_manually() {
$now = date("\x59\55\x6d\55\144");
return $data = $this->db->select("\123\x55\115\50\101\102\x53\x28\x72\145\x71\x75\145\163\164\137\160\157\151\x6e\164\x73\x29\51\141\x73\40\141\x6d\x6f\165\x6e\164")->where(array("\144\x61\x74\x65\x28\x74\x69\x6d\x65\51" => $now, "\151\163\x5f\161\162\x63\157\144\x65" => 0, "\164\x79\x70\x65" => "\x57\x69\164\150\x64\x72\141\x77\141\x6c", "\162\x65\161\165\145\163\x74\x5f\x73\164\x61\164\165\163" => "\x61\160\x70\x72\x6f\166\145\144"))->get("\164\x62\x6c\x52\x65\161\x75\145\x73\x74")->row()->amount??0;
}
public function change_status_market($id, $set_status = "\x61\x63\164\x69\166\145") {
$data = array("\x73\164\141\164\x75\163" => $set_status);
$this->db->where("\x69\144", $id);
return $this->db->update("\155\x61\164\153\141", $data);
}
public function rate_range($id) {
return $this->db->select("\162\x61\164\x65\x5f\x72\141\x6e\x67\145")->where("\x69\x64", $id)->get("\164\142\154\116\157\164\x69\x63\145")->row();
}
public function update_game_rate($rate, $id) {
$data = array("\x70\x6f\151\x6e\164\163" => $rate);
$this->db->where("\147\x61\x6d\x65\x5f\x69\144", $id);
$this->db->update("\x74\142\x6c\147\141\x6d\145", $data);
return true;
}
} ?>
Function Calls
None |
Stats
MD5 | b4bc9ce551540dfd4dc53959dc00c71d |
Eval Count | 0 |
Decode Time | 103 ms |