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 ApiNew_one extends CI_Controller { public $conn; public function __..
Decoded Output download
<?php
class ApiNew_one extends CI_Controller {
public $conn;
public function __construct() {
include APPPATH . "config/database.php";
parent::__construct();
$hostname = $db["default"]["hostname"];
$username = $db["default"]["username"];
$password = $db["default"]["password"];
$database = $db["default"]["database"];
$this->conn = mysqli_connect($hostname, $username, $password, $database) or die("Error in connection.");
$this->load->database();
header("Content-Type: application/json");
$this->load->library("form_validation");
$this->load->helper("sms_helper");
}
public function getIndex() {
$data = array();
$res = $this->db->query("select * from app_setting");
$data["responce"] = true;
$data["data"] = $res->result();
echo json_encode($data);
}
public function getLoginStatus() {
$data = array();
$uid = $this->input->post("user_id");
$login_stat = $this->db->select("login_status")->where("id", $uid)->get("user_profile")->row();
$data["responce"] = true;
$data["login_status"] = $login_stat->login_status;
echo json_encode($data);
}
public function getMobileData() {
$data = array();
$res = $this->db->query("select * from site_config");
$data["responce"] = true;
$data["data"] = $res->result();
echo json_encode($data);
}
public function password_details() {
$data = array();
$res = $this->db->get("forgotpassword")->result();
echo json_encode($res);
}
public function get_sliders() {
$q = $this->db->query("SELECT * FROM `sliders_img`");
$status = "success";
$data = $q->result();
$obj = array("status" => $status, "data" => $data);
echo json_encode($obj);
}
public function sign_up() {
$data = array();
$_POST = $_REQUEST;
$this->load->model("user_model");
$this->form_validation->set_rules("key", "KEY", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$key = $this->input->post("key");
$date = date("d/m/y");
if ($key == 1) {
$q = $this->db->query("select * from user_profile where mobileno='" . $this->input->post("mobile") . "' ");
if ($q->num_rows() > 0) {
$data["responce"] = false;
$data["error"] = "Mobile Number Already Registered";
} else {
$reffered_code = '';
$ref_code = $this->input->post("refer_code");
$check_ref_code = $this->db->where("user_reference_code", $ref_code)->where("login_status", 0)->get("user_profile");
if ($ref_code != '' && $check_ref_code->num_rows() > 0) {
$reffered_code = $ref_code;
}
$array = array("username" => $this->input->post("username"), "name" => $this->input->post("name"), "mobileno" => $this->input->post("mobile"), "mid" => $this->input->post("mpin"), "password" => $this->input->post("password"), "login_status" => 0, "reffered_code" => $reffered_code);
$array["user_reference_code"] = $this->user_model->isExistingUserRef();
$this->db->insert("user_profile", $array);
$user_id = $this->db->insert_id();
$this->db->insert("tblwallet", array("user_id" => (int)$user_id, "wallet_points" => 0, "main_wallet_points" => 0));
$data["responce"] = true;
$data["message"] = "User Register Sucessfully..";
}
} else {
if ($key == 2) {
$this->load->model("common_model");
$this->common_model->data_update("user_profile", array("address" => $this->input->post("address"), "city" => $this->input->post("city"), "pincode" => $this->input->post("pin")), array("id" => $this->input->post("user_id")));
$data["responce"] = true;
$data["message"] = "Address Updated successfully..";
} else {
if ($key == 3) {
$this->load->model("common_model");
$this->common_model->data_update("user_profile", array("accountno" => $this->input->post("accountno"), "bank_name" => $this->input->post("bankname"), "ifsc_code" => $this->input->post("ifsc"), "account_holder_name" => $this->input->post("accountholder")), array("id" => $this->input->post("user_id")));
$data["responce"] = true;
$data["message"] = "Bank Details Updated successfully..";
} else {
if ($key == 4) {
$this->load->model("common_model");
$q = $this->common_model->data_update("user_profile", array("tez_no" => $this->input->post("tez"), "paytm_no" => $this->input->post("paytm"), "phonepay_no" => $this->input->post("phonepay")), array("id" => $this->input->post("user_id")));
if ($q) {
$data["responce"] = true;
$data["message"] = "Pyment Details Updated successfully..";
} else {
$data["responce"] = false;
$data["error"] = "Something went wrong";
}
} else {
if ($key == 5) {
$this->load->model("common_model");
$this->common_model->data_update("user_profile", array("email" => $this->input->post("email"), "dob" => $this->input->post("dob")), array("id" => $this->input->post("user_id")));
$data["responce"] = true;
$data["message"] = " Details Updated successfully..";
}
}
}
}
}
}
echo json_encode($data);
}
public function getMatkas() {
$q = $this->db->query("select * from matka where status='active' ORDER BY matka_order");
echo json_encode($q->result());
}
public function getStarline() {
$q = "select * from tblStarline where s_game_time !=''";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$i = 0;
while ($row = $result->fetch_assoc()) {
$data[$i]["id"] = $row["id"];
$data[$i]["s_game_time"] = $row["s_game_time"];
if (strtotime(date("Y-m-d")) == strtotime(date("Y-m-d", strtotime($row["updated_at"])))) {
$data[$i]["s_game_number"] = $row["s_game_number"];
} else {
$data[$i]["s_game_number"] = "***";
}
$i++;
}
} else {
$data = "0";
}
echo json_encode($data);
}
public function get_matka_with_id() {
$q = $this->db->query("select * from matka where id='" . $this->input->post("id") . "'");
$status = "success";
$data = $q->row();
$obj = array("status" => $status, "data" => $data);
echo json_encode($obj);
}
public function how_to_play() {
$hto = "Value1 is here .....";
$hto2 = "https://www.youtube.com/";
$x["data"] = $hto;
$x["link"] = $hto2;
$obj = array($x);
echo json_encode($obj);
}
public function login_old() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("mobileno", "Mobile No", "trim|required");
$this->form_validation->set_rules("password", "Password", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$q = $this->db->query("select * from user_profile where (mobileno='" . $this->input->post("mobileno") . "' ) Limit 1");
if ($q->num_rows() > 0) {
$row = $q->row();
$db_pass = $row->password;
$pass = $this->input->post("password");
if ($pass == $db_pass) {
if ($row->is_blocked == "1") {
$data["responce"] = false;
$data["error"] = "Account Blocked.";
} else {
if ($row->login_status == "2") {
$data["responce"] = false;
$data["error"] = "Your account currently inactive.Please Contact Admin";
} else {
$data["responce"] = true;
$user_id = $row->id;
$temp = array();
$temp["id"] = $row->id;
$temp["name"] = $row->name;
$temp["username"] = $row->username;
$temp["mobileno"] = $row->mobileno;
$temp["password"] = $row->password;
$temp["email"] = $row->email;
$temp["address"] = $row->address;
$temp["city"] = $row->city;
$temp["pincode"] = $row->pincode;
$temp["password"] = $row->password;
$temp["accountno"] = $row->accountno;
$temp["bank_name"] = $row->bank_name;
$temp["ifsc_code"] = $row->ifsc_code;
$temp["account_holder_name"] = $row->account_holder_name;
$temp["paytm_no"] = $row->paytm_no;
$temp["tez_no"] = $row->tez_no;
$temp["phonepay_no"] = $row->phonepay_no;
$temp["dob"] = $row->dob;
$temp["refer_code"] = $row->user_reference_code;
$temp["refered_from_code"] = $row->reffered_code;
$qw = $this->db->query("select * FROM `tblwallet` where user_id='" . $user_id . "' Limit 1");
$wrow = $qw->row();
$temp["wallet"] = $wrow->wallet_points;
$data["data"] = $temp;
}
}
} else {
$data["responce"] = false;
$data["error"] = "Wrong Password";
}
} else {
$data["responce"] = false;
$data["error"] = "Mobile Number does not exist";
}
}
echo json_encode($data);
}
public function login() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("mobileno", "Mobile No", "trim|required");
$this->form_validation->set_rules("password", "Password", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$mobile = $this->input->post("mobileno");
$password = $this->input->post("password");
$this->db->select("up.id,name,username,mobileno,password,email,address,city,pincode,accountno,bank_name,ifsc_code,is_blocked,login_status,\xa account_holder_name,paytm_no,tez_no,phonepay_no,dob,user_reference_code as refer_code,reffered_code as refered_from_code,wallet_points as wallet,kyc_status,is_capped");
$details = $this->db->where("up.mobileno", $mobile)->join("tblwallet tw", "tw.user_id= up.id")->get("user_profile up");
if ($details->num_rows() > 0) {
$row = $details->row();
$db_pass = $row->password;
if ($password == $db_pass) {
if ($row->is_blocked == "1") {
$data["responce"] = false;
$data["error"] = "Account Blocked.";
} else {
if ($row->login_status == "2") {
$data["responce"] = false;
$data["error"] = "Your account currently inactive.Please Contact Admin";
} else {
$data["responce"] = true;
$data["data"] = $row;
}
}
} else {
$data["responce"] = false;
$data["error"] = "Wrong Password";
}
} else {
$data["responce"] = false;
$data["error"] = "Mobile Number does not exist";
}
}
echo json_encode($data);
}
public function setAsLogin() {
$email = $_POST["email"];
$q1 = "update user_profile set login_status='1' where email='{$email}'";
if (mysqli_query($this->conn, $q1)) {
echo json_encode(array("status" => "success"));
}
}
public function setAsLogout() {
$email = $_POST["email"];
$q1 = "update user_profile set login_status='0' where email='{$email}'";
if (mysqli_query($this->conn, $q1)) {
echo json_encode(array("status" => "success"));
}
}
public function getNotice() {
$q = $this->db->query("Select * from tblNotice ORDER BY `tblNotice`.`id` ASC");
$status = "success";
$data = $q->result();
$obj = array("status" => $status, "data" => $data);
echo json_encode($obj);
}
public function getWalletAmount() {
$q = $this->db->query("SELECT * FROM tblwallet where user_id='" . $this->input->post("user_id") . "' LIMIT 1");
echo json_encode($q->result());
}
public function test() {
$m = 21;
$q1 = "select * from tblStarline where id = '{$m}'";
$result = mysqli_query($this->conn, $q1) or die("some err");
$row = mysqli_fetch_assoc($result);
$st = $et = "s_game_time";
$time = $row[$st];
echo strtotime(date("h:i A")) . "<hr>" . time();
}
public function insert_data_new() {
$status = '';
$result = mysqli_query($this->conn, "SELECT MAX(id) as c FROM tblgamedata") or die("some err");
if ($row = mysqli_fetch_assoc($result)) {
$maxid = $row["c"]++;
}
$jsonArr = $_POST["data"];
$group_value = $_POST["group_value"];
$datetime = $_POST["datetime"];
$total_point = $_POST["total_point"];
$is_homepage = $_POST["is_homepage"];
$digit_array = $_POST["digit_array"]??'';
$bs_matka_id = $_POST["bs_matka_id"]??'';
$bs_game_name = $_POST["bs_game_name"]??'';
if (empty($jsonArr)) {
$status = "failed1";
} else {
$json = json_decode($jsonArr);
foreach ($json as $js) {
$ponts = $i = $e = 0;
$points = json_decode($js->points);
$digits = json_decode($js->digits);
$bettype = json_decode($js->bettype);
$u = $js->user_id;
$m = $js->matka_id;
$game_name = json_decode($js->game_name);
$wallet_type = $js->wallet_type;
$dx = date("d/m/Y");
$gm = $js->game_id;
if ($gm == 16) {
$gm = 2;
}
$q1 = "select * from matka where id = '{$m}'";
$st = date("D") === "Sat" ? "sat_start_time" : (date("D") === "Sun" ? "start_time" : "bid_start_time");
$et = date("D") === "Sat" ? "sat_end_time" : (date("D") === "Sun" ? "end_time" : "bid_end_time");
$dd = mysqli_query($this->conn, $q1) or die("some err1");
if ($row1 = mysqli_fetch_assoc($dd)) {
$a_time = strtotime(date("h:i A"));
$time1 = $bettype[$i] == 0 ? $row1[$st] : $row1[$et];
$time = date("h:i A", strtotime($time1));
if ($a_time <= strtotime($time)) {
$q2 = "select * from tblwallet where user_id = '{$u}'";
$dd1 = mysqli_query($this->conn, $q2) or die("some err2");
$row2 = mysqli_fetch_assoc($dd1);
if (count($row2) > 0) {
if ($wallet_type == "main_wallet_points") {
$wallet_amt = $row2["main_wallet_points"];
$capped_amount = $row2["capped_main_amount"];
} else {
$wallet_amt = $row2["wallet_points"];
$capped_amount = $row2["capped_amount"];
}
$app_setting = $this->db->query("select * from app_setting")->row();
if ($wallet_amt - $capped_amount >= array_sum($points)) {
foreach ($points as $pa) {
$p = $points[$i];
$wallet_amt = $wallet_amt - $p;
if ($wallet_amt >= 0) {
$ponts+= $p;
$d = (string)$digits[$i];
$bt = $bettype[$i] == 0 ? "open" : "close";
$gn = $game_name[$i];
$q = "insert into tblgamedata (user_id,matka_id,points,digits,date,bet_type,game_id,game_name,wallet_type,group_value,digit_array,datetime,total_point,bs_game_name,bs_matka_id)
values('{$u}', '{$m}', '{$p}', '{$d}', '{$dx}', '{$bt}','{$gm}','{$gn}','{$wallet_type}','{$group_value}','{$digit_array}','{$datetime}','{$total_point}','{$bs_game_name}','{$bs_matka_id}')";
$dd = mysqli_query($this->conn, $q) or die("some err3");
$maxid++;
$qs = "insert into history (user_id,matka_id,amt,digits,bid_id,date,type,game_id) values('{$u}', '{$m}', '{$p}', '{$d}','{$maxid}', '{$dx}', 'd','{$gm}')";
$dds = mysqli_query($this->conn, $qs) or die("some err4");
$i++;
}
}
} else {
$status = "capped_amount_error";
}
}
} else {
$status = "timeout";
}
}
if ($ponts > 0) {
if (count($row2) > 0) {
if ($wallet_type == "main_wallet_points") {
$main_wallet_pt = $row2["main_wallet_points"];
if ($ponts <= $main_wallet_pt) {
$remain_bid_amt = $ponts - $main_wallet_pt;
$q = "update tblwallet set main_wallet_points = main_wallet_points- {$ponts} where user_id = '{$u}'";
$dd = mysqli_query($this->conn, $q) or die("some err5");
}
} else {
$wallet_points_pt = $row2["wallet_points"];
if ($ponts <= $wallet_points_pt) {
$q1 = "update tblwallet set wallet_points = wallet_points-{$ponts} where user_id = '{$u}'";
$dd = mysqli_query($this->conn, $q1) or die("some err5");
}
}
} else {
$q = "insert into tblwallet (wallet_points, user_id) VALUES (0, '{$u}')";
$dd = mysqli_query($this->conn, $q) or die("some err5");
}
}
}
if ($dds === true && $status != "timeout" && $status != "capped_amount_error") {
$status = "success";
$dt = array("status" => $status);
echo json_encode($dt);
return false;
} elseif ($status == "capped_amount_error") {
$status = "Amount (" . $capped_amount . ") is capped. Contact admin";
$dt = array("status" => $status);
echo json_encode($dt);
return false;
} elseif ($status == null) {
$status = "failed";
}
}
$dt = array("status" => $status);
echo json_encode($dt);
}
public function checkBidAmount_marketWise_old() {
$status = '';
$result = mysqli_query($this->conn, "SELECT MAX(id) as c FROM tblgamedata") or die("some err");
if ($row = mysqli_fetch_assoc($result)) {
$maxid = $row["c"]++;
}
$jsonArr = $_POST["data"];
$dds = FALSE;
if (empty($jsonArr)) {
$status = "failed1";
} else {
$array = json_decode($jsonArr, true);
$user_id = $array[0]["user_id"];
$matka_id = $array[0]["matka_id"];
$game_id = $array[0]["game_id"];
$game_date = $array[0]["game_date"];
$digits = json_decode($array[0]["digits"], true);
$points = json_decode($array[0]["points"], true);
$mix_bid = $this->db->select("max_bid_amount as max_bid")->get("app_setting")->row()->max_bid??0;
$response = true;
$status = '';
foreach ($digits as $index => $digit) {
foreach ($points as $key => $point) {
if ($index == $key) {
$this->db->select("IF(SUM(points) > 0, SUM(points) + {$point}, {$point}) AS total_value")->where(array("user_id" => $user_id, "date" => $game_date, "matka_id" => $matka_id));
$this->db->where("digits", $digit);
$query = $this->db->get("tblgamedata")->row()->total_value??0;
if ($query > $mix_bid) {
$response = false;
$status = "Limit exceed in digit {$digit}";
}
}
}
}
$dt = array("response" => $response, "status" => $status);
echo json_encode($dt);
}
}
public function checkBidAmount_marketWise() {
$status = '';
$jsonArr = $_POST["data"]??null;
if (empty($jsonArr)) {
echo json_encode(array("response" => false, "status" => "failed1"));
return;
}
$array = json_decode($jsonArr, true);
$user_id = $array[0]["user_id"];
$matka_id = $array[0]["matka_id"];
$game_id = $array[0]["game_id"];
$game_date = $array[0]["game_date"];
$digits = json_decode($array[0]["digits"], true);
$points = json_decode($array[0]["points"], true);
$mix_bid = $this->db->select("max_bid_amount as max_bid")->get("app_setting")->row()->max_bid??0;
$this->db->select("digits, SUM(points) as total_points");
$this->db->where(array("user_id" => $user_id, "date" => $game_date, "matka_id" => $matka_id));
$this->db->group_by("digits");
$existing_bids = $this->db->get("tblgamedata")->result_array();
$existing_bids_map = array();
foreach ($existing_bids as $bid) {
$existing_bids_map[$bid["digits"]] = $bid["total_points"];
}
$response = true;
$status = '';
foreach ($digits as $index => $digit) {
$current_points = $points[$index]??0;
$current_total = ($existing_bids_map[$digit]??0) + $current_points;
if ($current_total > $mix_bid) {
$response = false;
$status = "Limit exceed in digit {$digit}";
break;
}
}
echo json_encode(array("response" => $response, "status" => $status));
}
public function insert_data() {
$status = '';
$result = mysqli_query($this->conn, "SELECT MAX(id) as c FROM tblgamedata") or die("some err");
if ($row = mysqli_fetch_assoc($result)) {
$maxid = $row["c"]++;
}
$jsonArr = $_POST["data"];
if (empty($jsonArr)) {
$status = "failed1";
} else {
$bid_allowed = true;
$json = json_decode($jsonArr);
foreach ($json as $js) {
$ponts = $i = $e = 0;
$points = json_decode($js->points);
$digits = json_decode($js->digits);
$bettype = json_decode($js->bettype);
$u = $js->user_id;
$m = $js->matka_id;
$dx = date("d/m/Y");
$gm = $js->game_id;
$wallet_type = $js->wallet_type;
if ($gm == 16 || $gm == 17) {
$gm = 2;
}
if ($m <= 20) {
$q1 = "select * from matka where id = '{$m}'";
$st = date("D") === "Sat" ? "sat_start_time" : (date("D") === "Sun" ? "start_time" : "bid_start_time");
$et = date("D") === "Sat" ? "sat_end_time" : (date("D") === "Sun" ? "end_time" : "bid_end_time");
} else {
$q1 = "select * from tblStarline where id = '{$m}'";
$st = $et = "s_game_time";
}
$dd = mysqli_query($this->conn, $q1) or die("some err1");
if ($row1 = mysqli_fetch_assoc($dd)) {
$stime = $row1[$st];
$etime = $row1[$et];
$today = date("d/m/Y");
if ($dx == $today) {
$a_time = strtotime(date("Y-m-d H:i:s"));
$act_time = strtotime(date("Y-m-d H:i:s", strtotime($bettype[$i] == 0 ? $stime : $etime)));
$diff_time = $act_time - $a_time;
if ($diff_time < 0) {
$bid_allowed = false;
}
} else {
$a_time1 = date("Y-m-d H:i:s", strtotime($dx));
$a_time = strtotime($a_time1);
}
$a_time = strtotime(date("h:i A"));
$time1 = $bettype[$i] == 0 ? $row1[$st] : $row1[$et];
$time = date("h:i A", strtotime($time1));
if ($bid_allowed) {
if ($a_time <= strtotime($time)) {
$q2 = "select * from tblwallet where user_id = '{$u}'";
$dd1 = mysqli_query($this->conn, $q2) or die("some err2");
$row2 = mysqli_fetch_assoc($dd1);
if (count($row2) > 0) {
if ($wallet_type == "wallet_points") {
$wallet_amt = $row2["wallet_points"];
} else {
$wallet_amt = $row2["main_wallet_points"];
$wallet_type = "main_wallet_points";
}
foreach ($points as $pa) {
$p = $points[$i];
$wallet_amt = $wallet_amt - $p;
if ($wallet_amt >= 0) {
$ponts+= $p;
$d = (string)$digits[$i];
$bt = $bettype[$i] == 0 ? "open" : "close";
$q = "insert into tblgamedata (user_id,matka_id,points,digits,date,bet_type,game_id,wallet_type) values('{$u}', '{$m}', '{$p}', '{$d}', '{$dx}', '{$bt}','{$gm}','{$wallet_type}')";
$dd = mysqli_query($this->conn, $q) or die("some err3");
$maxid++;
$qs = "insert into history (user_id,matka_id,amt,digits,bid_id,date,type,game_id) values('{$u}', '{$m}', '{$p}', '{$d}','{$maxid}', '{$dx}', 'd','{$gm}')";
$dds = mysqli_query($this->conn, $qs) or die("some err4");
$i++;
}
}
}
} else {
$status = "timeout";
}
} else {
$status = "timeout";
}
}
if ($ponts > 0) {
if (count($row2) > 0) {
if ($wallet_type == "wallet_points") {
$q = "update tblwallet set wallet_points = wallet_points-{$ponts} where user_id = '{$u}'";
} else {
$q = "update tblwallet set main_wallet_points = main_wallet_points-{$ponts} where user_id = '{$u}'";
}
} else {
if ($wallet_type == "wallet_points") {
$q = "insert into tblwallet (wallet_points, user_id) VALUES (0, '{$u}')";
} else {
$q = "insert into tblwallet (main_wallet_points, user_id) VALUES (0, '{$u}')";
}
}
$dd = mysqli_query($this->conn, $q) or die("some err5");
}
}
if ($dds === true && $status != "timeout") {
$status = "success";
$dt = array("status" => $status);
echo json_encode($dt);
return false;
} elseif ($status == null) {
$status = "failed";
}
}
$dt = array("status" => $status);
echo json_encode($dt);
}
public function getMobile() {
$q = "select mobile from site_config";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$data = $result->fetch_assoc();
$data["count"] = 22;
$data["starline"] = "https://www.binplus.in";
$data["chart1"] = "https://serveradda.com/billing";
$data["chart2"] = "https://www.google.com";
} else {
$data["mobile"] = "XXXXXXXXXXXX";
$data["count"] = 22;
$data["starline"] = "https://www.binplus.in";
$data["chart1"] = "https://serveradda.com/billing";
$data["chart2"] = "https://www.google.com";
}
echo json_encode($data);
}
public function insert_sangam_data() {
$result = mysqli_query($this->conn, "SELECT MAX(id) as c FROM tblgamedata") or die("some err");
$a_time = strtotime(date("h:i A"));
if ($row = mysqli_fetch_assoc($result)) {
$maxid = $row["c"]++;
}
$jsonArr = $_POST["data"];
if (empty($jsonArr)) {
$status = "failed1";
} else {
$json = json_decode($jsonArr);
foreach ($json as $js) {
$ponts = $i = $e = 0;
$points = json_decode($js->points);
$digits = json_decode($js->digits);
$bettype = json_decode($js->bettype);
$u = $js->user_id;
$m = $js->matka_id;
$dx = date("d/m/Y");
$gm = $js->game_id;
$q1 = "select * from matka where id = '{$m}'";
$dd = mysqli_query($this->conn, $q1) or die("some err1");
$st = date("D") === "Sat" ? "sat_start_time" : (date("D") === "Sun" ? "start_time" : "bid_start_time");
$et = date("D") === "Sat" ? "sat_end_time" : (date("D") === "Sun" ? "end_time" : "bid_end_time");
if ($row1 = mysqli_fetch_assoc($dd)) {
$time1 = $bettype[$i] == 0 ? $row1[$st] : $row1[$et];
$time = date("h:i A", strtotime($time1));
if ($a_time <= strtotime($time) || strtotime(date("Y-m-d")) < strtotime($dx)) {
$q2 = "select * from tblwallet where user_id = '{$u}'";
$dd1 = mysqli_query($this->conn, $q2) or die("some err2");
$row2 = mysqli_fetch_assoc($dd1);
if (count($row2) > 0) {
$wallet_amt = $row2["wallet_points"];
foreach ($points as $pa) {
$p = $points[$i];
$wallet_amt = $wallet_amt - $p;
if ($wallet_amt >= 0) {
$ponts+= $p;
$d = (string)$digits[$i];
$bt = (string)$bettype[$i];
$q = "insert into tblgamedata (user_id,matka_id,points,digits,date,bet_type,game_id) values('{$u}', '{$m}', '{$p}', '{$d}', '{$dx}', '{$bt}','{$gm}')";
$dd = mysqli_query($this->conn, $q) or die("some err3");
$maxid++;
$qs = "insert into history (user_id,matka_id,amt,digits,bid_id,date,type,game_id) values('{$u}', '{$m}', '{$p}', '{$d}','{$maxid}', {$dx}, 'd','{$gm}')";
$dds = mysqli_query($this->conn, $qs) or die("some err4");
$i++;
}
}
}
} else {
$status = "timeout";
}
}
if ($ponts > 0) {
if (count($row2) > 0) {
$q = "update tblwallet set wallet_points = wallet_points-{$ponts} where user_id = '{$u}'";
} else {
$q = "insert into tblwallet (wallet_points, user_id) VALUES (0, '{$u}')";
}
$dd = mysqli_query($this->conn, $q) or die("some err5");
}
}
if ($dds === true && $status != "timeout") {
$status = "success";
$dt = array("status" => $status);
echo json_encode($dt);
return false;
} elseif ($status == null) {
$status = "failed";
} elseif ($status == "timeout") {
$status = "timeout";
}
}
$dt = array("status" => $status);
echo json_encode($dt);
}
public function get_history() {
$data = array();
$user_id = $this->input->post("user_id");
$page = $this->input->post("page") ??1;
$date_from = $this->input->post("date_from") ??date("d/m/Y");
$date_to = $this->input->post("date_to") ??date("d/m/Y");
$key = explode("/", $date_from);
$key_to = explode("/", $date_to);
$date_from = $key[2] . "-" . $key[1] . "-" . $key[0];
$date_to = $key_to[2] . "-" . $key_to[1] . "-" . $key_to[0];
$limit = 10;
$offset = ($page - 1) * $limit;
$data["responce"] = true;
$this->db->select("tblgamedata.*, trim(matka.name)as name");
$this->db->from("tblgamedata");
$this->db->join("matka", "matka.id = tblgamedata.matka_id");
$this->db->where("user_id", $user_id);
$this->db->where("matka_id < ", 100);
$this->db->where("DATE(time) BETWEEN '{$date_from}' AND '{$date_to}'");
$this->db->limit($limit, $offset);
$this->db->order_by("id", "DESC");
$q = $this->db->get();
$data["data"] = $total = $q->result();
$this->db->select("tblgamedata.*, trim(matka.name)as name");
$this->db->from("tblgamedata");
$this->db->join("matka", "matka.id = tblgamedata.matka_id");
$this->db->where("user_id", $user_id);
$this->db->where("matka_id < ", 100);
$this->db->where("DATE(time) BETWEEN '{$date_from}' AND '{$date_to}'");
$this->db->order_by("id", "DESC");
$q1 = $this->db->get();
$data["total_data"] = $q1->num_rows();
echo json_encode($data);
}
public function getBidHistory() {
$us_id = $_POST["us_id"];
$matka_id = $_POST["matka_id"];
$play_for = date("Y-m-d");
$play_on = '';
if ($matka_id < 21) {
$odd_even = "tblgamedata.id,tblgamedata.user_id,tblgamedata.matka_id,tblgamedata.points,tblgamedata.bet_type,tblgamedata.date,tblgamedata.time,tblgamedata.digits,tblgamedata.game_id,tblgamedata.status,tblgamedata.wallet_type,matka.name ";
$q = "select " . $odd_even . " from tblgamedata JOIN matka ON matka.id=tblgamedata.matka_id where tblgamedata.user_id={$us_id} and tblgamedata.matka_id={$matka_id} ORDER BY time DESC";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$x["play_for"] = $row["time"];
$x["play_on"] = $row["time"];
$newDate = date("l", strtotime($x["play_on"]));
$x["day"] = $newDate;
$r = array_merge($row, $x);
$data[] = $r;
}
} else {
$data[] = null;
}
} else {
$d = "select tblgamedata.id,tblgamedata.user_id,tblgamedata.matka_id,tblgamedata.points,tblgamedata.bet_type,tblgamedata.date,tblgamedata.time,tblgamedata.digits,tblgamedata.game_id,tblgamedata.wallet_type,tblgamedata.status,tblStarline.s_game_time from tblgamedata,tblStarline where tblgamedata.user_id={$us_id} AND tblgamedata.matka_id=tblStarline.id AND matka_id>'15' ORDER BY time DESC";
$result1 = mysqli_query($this->conn, $d);
if ($result1->num_rows > 0) {
while ($row1 = $result1->fetch_assoc()) {
$x["play_for"] = $row1["time"];
$x["play_on"] = $row1["time"];
$newDate = date("l", strtotime($x["play_on"]));
$x["day"] = $newDate;
$r = array_merge($row1, $x);
$data[] = $r;
}
} else {
$data[] = null;
}
}
echo json_encode($data);
}
public function insert_withdraw_request_old() {
$user_id = $_POST["user_id"];
$points = - $_POST["points"];
$date = $_POST["date"];
$request_status = $_POST["request_status"];
$req_limit = $_POST["req_limit"];
$type = "Withdrawal";
$app_setting = $this->db->get("timeslots")->row();
$start_time = date("H:i", strtotime($app_setting->start_time));
$end_time = date("H:i", strtotime($app_setting->end_time));
$time = date("H:i");
if ($time > $start_time && $time < $end_time) {
$d = "select * from tblRequest where user_id={$user_id} and type='Withdrawal'";
$result1 = mysqli_query($this->conn, $d);
if ($result1->num_rows > 0) {
while ($row = $result1->fetch_assoc()) {
$newDate = date("d-m-Y", strtotime($row["time"]));
$row1[] = $newDate;
}
$limit_exceed = false;
if (in_array($date, $row1)) {
$req_count = count($row1);
if ($req_count > $req_limit) {
$limit_exceed = true;
}
}
if ($limit_exceed) {
$status = "failed";
$data = "Daily Withdraw limit Exceeded";
} else {
$q = "insert into tblRequest (request_points,user_id,request_status,type)
\x9 values('{$points}', '{$user_id}', '{$request_status}','{$type}')";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "success";
$data = "Request Successfull..";
} else {
$status = "failed";
$data = "Something Went Wrong";
}
}
} else {
$q = "insert into tblRequest (request_points,user_id,request_status,type) values('{$points}', '{$user_id}', '{$request_status}','{$type}')";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "success";
$data = "Request Successfull..";
} else {
$status = "failed";
$data = "Something Went Wrong";
}
}
} else {
$status = "failed";
$data = "Withdrawal timeout";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function insert_withdraw_request() {
$app_setting = $this->db->select("w_amount,max_withdraw")->get("app_setting")->row();
$min_value = $app_setting->w_amount;
$max_value = $app_setting->max_withdraw;
$this->form_validation->set_rules("user_id", "User ID", "required|integer");
$this->form_validation->set_rules("points", "Amount", "trim|required|numeric");
$this->form_validation->set_rules("date", "Date", "required");
$this->form_validation->set_rules("request_status", "Request Status", "required");
$this->form_validation->set_rules("req_limit", "Request Limit", "required|integer");
if ($this->form_validation->run() == false) {
$status = "failed";
$data = strip_tags($this->form_validation->error_string());
} else {
$points = $this->input->post("points");
if ($points < $min_value || $points > $max_value) {
$status = "failed";
$data = "Per Day Withdrawal Limit Minimum {$min_value} to {$max_value} Extra amount Withdrawal please Contact Support Team";
} else {
$user_id = $this->input->post("user_id");
$date = $this->input->post("date");
$request_status = $this->input->post("request_status");
$req_limit = $this->input->post("req_limit");
$type = "Withdrawal";
$trans_date = date("Y-m-d", strtotime($request_status));
$app_setting = $this->db->get("timeslots")->row();
$start_time = date("H:i", strtotime($app_setting->start_time));
$end_time = date("H:i", strtotime($app_setting->end_time));
$time = date("H:i");
$points = - $this->input->post("points");
if ($time > $start_time && $time < $end_time) {
$limit_exceed = $this->db->where(array("user_id" => $user_id, "type" => "Withdrawal", "DATE(time)" => $trans_date))->get("tblRequest")->num_rows();
if ($limit_exceed > $req_limit) {
$status = "failed";
$data = "Daily Withdraw limit Exceeded";
} else {
$data = array("request_points" => $points, "user_id" => $user_id, "request_status" => $request_status, "type" => $type);
$inserted = $this->db->insert("tblRequest", $data);
if ($inserted) {
$status = "success";
$data = "Request Successful";
} else {
$status = "failed";
$data = "Something Went Wrong";
}
}
} else {
$status = "failed";
$data = "Withdrawal timeout";
}
}
}
$response = array("status" => $status, "message" => $data);
echo json_encode($response);
}
public function generate_otp() {
$mobile = $this->input->post("mobile");
$otp = $this->input->post("otp");
$q = $this->db->query("select * from user_profile where (mobileno='" . $mobile . "') Limit 1");
if ($q->num_rows() > 0) {
$status = "success";
$msg = "Your OnlineTeerPlay One Time Password (OTP) is {$otp}. Don't share it with anyone. We don't call/email you to verify OTP. OTP is valid for 15 mins.";
@send_sms($mobile, $otp);
$data = "Code sent to your registered mobile number";
} else {
$status = "failed";
$data = "Mobile number not registered.";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function mobile_verification() {
$mobile = $this->input->post("mobile");
$otp = $this->input->post("otp");
$q = $this->db->query("select * from user_profile where (mobileno='" . $mobile . "') Limit 1");
if ($q->num_rows() > 0) {
$status = "failed";
$data = "Mobile number already registered
try another number";
} else {
$msg = "Your OnlineTeerPlay One Time Password (OTP) is {$otp}. Don't share it with anyone. We don't call/email you to verify OTP. OTP is valid for 15 mins.";
send_sms($mobile, $otp);
$status = "success";
$data = "verification";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function forgot_password() {
$this->load->model("common_model");
$dd = $this->common_model->data_update("user_profile", array("password" => $this->input->post("password")), array("mobileno" => $this->input->post("mobile")));
if ($dd) {
$status = "success";
$data = "Password updated successfully.";
} else {
$status = "failed";
$data = "Something went wrong";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function create_mpin() {
$user_id = $_POST["user_id"];
$mpin = $_POST["mpin"];
$q = "update user_profile set mid='" . $mpin . "' where id='" . $user_id . "'";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "success";
$data = "MPIN gnerated successfully..";
} else {
$status = "failed";
$data = "Something went wrong";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function generate_login_otp() {
$mobile = $_POST["mobile"];
$pass = $_POST["password"];
$otp = $_POST["otp"];
$q = "select * from user_profile where mobileno='{$mobile}'";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$db_pass = $row["password"];
if ($pass == $db_pass) {
$status = "success";
$msg = "Your login OTP is " . $otp . " for OnlineTeerPlay";
$id = $row["id"];
$u_otp = "update user_profile set otp='{$otp}' where id='{$id}'";
$dd = $this->conn->query($u_otp);
if ($dd === true) {
$status = "success";
$data = "OTP sent to your registered mobile number";
} else {
$status = "failed";
$data = "Something went wrong";
}
} else {
$status = "failed";
$data = "Password is incorrect";
}
} else {
$status = "failed";
$data = "Mobile Number not registered.";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function get_starline() {
$q = "select * from tblStarline where s_game_time !=''";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$i = 0;
while ($row = $result->fetch_assoc()) {
$data[$i]["id"] = $row["id"];
$data[$i]["s_game_time"] = $row["s_game_time"];
$data[$i]["s_game_end_time"] = $row["s_game_end_time"];
if (strtotime(date("Y-m-d")) == strtotime(date("Y-m-d", strtotime($row["updated_at"])))) {
$data[$i]["s_game_number"] = $row["s_game_number"];
} else {
$data[$i]["s_game_number"] = "***";
}
$i++;
}
} else {
$data = "0";
}
echo json_encode($data);
}
public function getSpMotor() {
$s = $_POST["arr"];
$a = str_split($s);
$arr = implode($a, ",");
$numArray = explode(",", $arr);
$arr = array_map("intval", $numArray);
$data = array(array(137, 128, 146, 236, 245, 290), array(380, 470, 489, 560, 678, 579), array(129, 138, 147, 156, 237, 246), array(345, 390, 480, 570, 589, 679), array(120, 139, 148, 157, 238, 247), array(256, 346, 490, 580, 670, 689), array(130, 149, 158, 167, 239, 248), array(257, 347, 356, 590, 680, 789), array(140, 159, 168, 230, 249, 258), array(267, 348, 357, 456, 690, 780), array(123, 150, 169, 178, 240, 259), array(268, 349, 358, 367, 457, 790), array(124, 160, 179, 250, 269, 278), array(340, 359, 368, 458, 467, 890), array(125, 134, 170, 189, 260, 279), array(350, 369, 378, 459, 468, 567), array(126, 135, 180, 234, 270, 289), array(360, 379, 450, 469, 478, 568), array(127, 136, 145, 190, 235, 280), array(370, 389, 460, 479, 569, 578));
$a = 0;
$b = 0;
$a = 0;
$k = 0;
$t = 0;
$m = array();
$final = array();
for ($i = 0;$i < count($data);$i++) {
for ($j = 0;$j < count($data[$i]);$j++) {
$k = 0;
$b = 0;
$num = $data[$i][$j];
while ($num != 0) {
$d = $num % 10;
$b++;
if ($b < 4) {
if (!in_array($d, $arr, false)) {
$k = 1;
break;
}
}
$num = (int)$num / 10;
}
if ($k == 0) {
$m[$a++] = $data[$i][$j];
}
}
}
for ($i = 0;$i < count($m);$i++) {
$b = 0;
$c = 0;
$num = $m[$i];
while ($num != 0) {
$d = $num % 10;
$arr2[$b++] = $d;
$num = (int)$num / 10;
}
$final[$t++] = $m[$i];
}
echo json_encode(array("status" => "success", "data" => $final));
}
public function get_dpmotor() {
$s = $_POST["arr"];
$a = str_split($s);
$arr = implode($a, ",");
$numArray = explode(",", $arr);
$arr = array_map("intval", $numArray);
$data = array(118, 226, 244, 299, 334, 488, 550, 668, 677, 100, 119, 155, 227, 335, 344, 399, 588, 669, 110, 200, 228, 255, 336, 499, 660, 688, 778, 166, 229, 300, 337, 355, 445, 599, 779, 788, 112, 220, 266, 338, 400, 446, 455, 699, 770, 113, 122, 177, 339, 366, 447, 500, 799, 889, 600, 114, 277, 330, 448, 466, 556, 880, 899, 115, 133, 188, 223, 377, 449, 557, 566, 700, 116, 224, 233, 288, 440, 477, 558, 800, 990, 117, 144, 199, 225, 388, 559, 577, 667, 900);
$a = 0;
$b = 0;
$a = 0;
$k = 0;
$t = 0;
$m = array();
$final = array();
for ($i = 0;$i < count($data);$i++) {
$k = 0;
$b = 0;
$num = $data[$i];
while ($num != 0) {
$d = $num % 10;
$b++;
if ($b < 4) {
if (!in_array($d, $arr, false)) {
$k = 1;
break;
}
}
$num = (int)$num / 10;
}
if ($k == 0) {
$m[$a++] = $data[$i];
}
}
for ($i = 0;$i < count($m);$i++) {
$b = 0;
$c = 0;
$num = $m[$i];
while ($num != 0) {
$d = $num % 10;
$arr2[$b++] = $d;
$num = (int)$num / 10;
}
for ($j = 0;$j < 2;$j++) {
if ($arr2[$j] <= $arr2[$j + 1]) {
$c = 1;
break;
}
}
if ($c == 1) {
$final[$t++] = $m[$i];
}
}
echo json_encode(array("status" => "success", "data" => $final));
}
public function get_matkas() {
$row_dt = '';
$matka = array();
$q = "select * from matka where status='active' and id < '100' ORDER BY matka_order";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$i = 0;
$curr_time = strtotime(date("H:i:s"));
while ($row = $result->fetch_assoc()) {
if (date("D") === "Sat") {
$bid_start_time = $row["sat_start_time"];
$bid_end_time = $row["sat_end_time"];
}
if (date("D") === "Sun") {
$bid_start_time = $row["start_time"];
$bid_end_time = $row["end_time"];
} else {
$bid_start_time = $row["bid_start_time"];
$bid_end_time = $row["bid_end_time"];
}
$type = $curr_time >= strtotime($bid_start_time) && $curr_time <= strtotime($bid_end_time) ? "live" : "old";
$data[$i] = $row;
$data[$i]["bid_start_time"] = $bid_start_time;
$data[$i]["bid_end_time"] = $bid_end_time;
$data[$i]["type"] = $type;
$i++;
}
} else {
$data = "0";
}
echo json_encode($data);
}
public function matka_with_id() {
$us_id = $_POST["id"];
$q = "select * from matka where id={$us_id} ";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$status = "success";
$data = $row;
}
} else {
$status = "success";
$data[] = "0";
}
$obj = array("status" => $status, "data" => $data);
echo json_encode($obj);
}
public function starline_data() {
$q = $this->db->query("select * from tblStarline where id='" . $this->input->post("id") . "'");
if ($q->num_rows() > 0) {
echo json_encode($q->row());
} else {
echo json_encode("0");
}
}
public function add_request() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
$this->form_validation->set_rules("points", "Points", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$points = $this->input->post("points");
$request_status = $this->input->post("request_status");
$type = $this->input->post("type");
$q = $this->db->insert("tblRequest", array("user_id" => $user_id, "request_points" => $points, "request_status" => $request_status, "type" => $type));
if ($q) {
if ($type == "Withdrawal") {
$remainAmount = $this->input->post("wallet");
$qupdate = $this->db->query("update tblwallet set wallet_points='" . $remainAmount . "' where user_id='" . $user_id . "'");
}
$data["responce"] = true;
$data["message"] = "Request Added..";
} else {
$data["responce"] = false;
$data["error"] = "Something Went Wrong";
}
}
echo json_encode($data);
}
public function withdraw_request() {
$user_id = $_POST["user_id"];
$points = $_POST["points"];
$request_status = $_POST["request_status"];
$q = "insert into tblWithdrawRequest (withdraw_points,user_id,withdraw_status) values('{$points}', '{$user_id}', '{$request_status}');";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "success";
$dt = array("status" => $status);
echo json_encode($dt);
} else {
$status = "failed";
$dt = array("status" => $status);
echo json_encode($dt);
}
}
public function request_history() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$data["responce"] = true;
$q = $this->db->select("*,CONCAT(type,' ',IF(payment_type = 1,'Offline',IF(payment_type = 2,'Online',IF(payment_type=3,'Cashback','')))) as type")->where("user_id", $user_id)->order_by("time", "desc")->get("tblRequest");
$data["data"] = $q->result();
}
echo json_encode($data);
}
public function withdraw_history() {
$us_id = $_POST["user_id"];
$q = "select * from tblWithdrawRequest where user_id={$us_id} ORDER BY time DESC";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$status = "success";
$data[] = $row;
}
} else {
$status = "failed";
$data = "No Withdraw History";
}
$obj = array("status" => $status, "data" => $data);
echo json_encode($obj);
}
public function notifications() {
$email = $_POST["mobile"];
$ds = "SELECT * FROM user_profile where mobileno='{$email}'";
$results = mysqli_query($this->conn, $ds);
if ($results->num_rows > 0) {
while ($row2 = $results->fetch_assoc()) {
$data_time = $row2["time"];
}
$d = "SELECT * FROM tblNotification where time>='{$data_time}' ORDER BY notification_id DESC";
$result1 = mysqli_query($this->conn, $d);
if ($result1->num_rows > 0) {
while ($row1 = $result1->fetch_assoc()) {
$data[] = $row1;
}
$status = "success";
} else {
$data = "There is no new notification";
$status = "failed";
}
} else {
$status = "failed";
$data = "Mobile Number Does not found.";
}
$obj = array("status" => $status, "data" => $data);
echo json_encode($obj);
}
public function transaction() {
$us_id = $_POST["us_id"];
$q = "select * from history where user_id='{$us_id}' ORDER BY time DESC";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$data[] = $row;
}
$status = "success";
} else {
$status = "failed";
$data = "No History for you";
}
$obj = array("status" => $status, "msg" => $data);
echo json_encode($obj);
}
public function mpin_login() {
global $conn;
$mpin = $_POST["mpin"];
$mobile = $_POST["mobile"];
$q = "select * from user_profile where mid='{$mpin}' and mobileno='{$mobile}'";
$result = mysqli_query($this->conn, $q);
if (mysqli_num_rows($result) == 1) {
$row = mysqli_fetch_assoc($result);
$status = "success";
$data["id"] = $row["id"];
$data["name"] = $row["name"];
$data["username"] = $row["username"];
$data["mobileno"] = $row["mobileno"];
$data["password"] = $row["password"];
$data["email"] = $row["email"];
$data["dob"] = $row["dob"];
$data["address"] = $row["address"];
$data["city"] = $row["city"];
$data["pincode"] = $row["pincode"];
$data["password"] = $row["password"];
$data["accountno"] = $row["accountno"];
$data["bank_name"] = $row["bank_name"];
$data["ifsc_code"] = $row["ifsc_code"];
$data["account_holder_name"] = $row["account_holder_name"];
$data["paytm_no"] = $row["paytm_no"];
$data["tez_no"] = $row["tez_no"];
$data["phonepay_no"] = $row["phonepay_no"];
$qw = "select * from tblwallet where user_id='" . $row["id"] . "'";
$resw = mysqli_query($this->conn, $qw);
$roww = mysqli_fetch_assoc($resw);
$data["wallet"] = $roww["wallet_points"];
} else {
$status = "failed";
$data = "Invalid MPIN";
}
$obj = array("status" => $status, "data" => $data);
echo json_encode($obj);
}
public function request_points_old() {
$this->form_validation->set_rules("user_id", "User ID", "required|trim|numeric");
$this->form_validation->set_rules("points", "Points", "required|trim|numeric");
$this->form_validation->set_rules("upi_name", "UPI Name", "required|trim");
$this->form_validation->set_rules("request_status", "Request Status", "required|trim");
$this->form_validation->set_rules("txn_id", "Transaction ID", "required|trim");
$this->form_validation->set_rules("type", "Type", "required|trim");
$this->form_validation->set_rules("wallet", "Wallet", "trim");
$this->form_validation->set_rules("refer_code", "Refer Code", "trim");
$this->form_validation->set_rules("package_id", "Package ID", "trim");
if ($this->form_validation->run() == false) {
$status = "failed";
$dt = array("status" => $status, "message" => validation_errors());
echo json_encode($dt);
return;
} else {
$user_id = $_POST["user_id"];
$points = $_POST["points"];
$request_status = $upi_name == "PHONE_PE" ? "pending" : $this->input->post("request_status");
$txn_id = $_POST["txn_id"];
$type = $_POST["type"];
$wallet = $_POST["wallet"];
$first_deposit = $this->db->select("is_first_time_deposit")->where("user_id", $user_id)->get("tblwallet")->row()->is_first_time_deposit??0;
if ($first_deposit == 1) {
$ref_code = $_POST["refer_code"];
$check_ref_code = $this->db->where("user_reference_code", $ref_code)->where("login_status", 0)->get("user_profile");
if ($ref_code != '' && $check_ref_code->num_rows() > 0) {
$reffered_code = $ref_code;
$referee_data = $check_ref_code->row();
$refree_id = $referee_data->id;
$wa = 10 / 100 * $points;
if ($_POST["upi_name"] != "PHONE_PE") {
$query = $this->db->query("Update tblwallet set main_wallet_points=main_wallet_points+'{$wa}' where user_id='{$refree_id}'");
$array_refer = array("refered_user" => $user_id, "refered_by_user" => $refree_id, "amount_credited_refered_by_user" => $wa);
$this->db->insert("refer_history", $array_refer);
}
}
}
$data = array("request_points" => $points, "user_id" => $user_id, "request_status" => $request_status, "type" => $type, "txn_id" => $txn_id, "payment_type" => 2);
$this->db->insert("tblRequest", $data);
$pre_wallet = $this->db->where("user_id", $user_id)->get("tblwallet")->row()->main_wallet_points??0;
$total = $pre_wallet + $points;
if ($_POST["upi_name"] != "PHONE_PE") {
$u_otp = "update tblwallet set main_wallet_points='{$total}',is_first_time_deposit='0' where user_id='{$user_id}'";
$udd = $this->conn->query($u_otp);
}
$dd = $this->conn->query($q);
$pack_id = $_POST["package_id"];
if ($pack_id != '') {
$cashback = $this->db->where("id", $pack_id)->where("status", 1)->get("package")->row()->cashback;
$q1 = "insert into tblRequest (request_points,user_id,request_status,type,txn_id,remark,payment_type)\xa\x9\x9 \x9values('{$cashback}', '{$user_id}', '{$request_status}','{$type}','{$txn_id}','Casback Added on adding Rs {$points}','3');";
if ($_POST["upi_name"] != "PHONE_PE") {
$u_otp1 = "update tblwallet set main_wallet_points=main_wallet_points+'{$cashback}' where user_id='{$user_id}'";
}
$dd1 = $this->conn->query($q1);
$udd1 = $this->conn->query($u_otp1);
} else {
$cashback = $this->db->where("amount", $points)->where("status", 1)->get("package")->row()->cashback;
if ($cashback != '') {
$q1 = "insert into tblRequest (request_points,user_id,request_status,type,txn_id,remark,payment_type) \xa \x9 \x9\x9values('{$cashback}', '{$user_id}', '{$request_status}','{$type}','{$txn_id}','Casback Added on adding Rs {$points}','3');";
if ($_POST["upi_name"] != "PHONE_PE") {
$u_otp1 = "update tblwallet set main_wallet_points=main_wallet_points+'{$cashback}' where user_id='{$user_id}'";
}
$dd1 = $this->conn->query($q1);
$udd1 = $this->conn->query($u_otp1);
}
}
if ($dd === true) {
$status = "success";
$dt = array("status" => $status);
echo json_encode($dt);
} else {
$status = "failed";
$dt = array("status" => $status);
echo json_encode($dt);
}
}
}
public function request_points() {
$this->form_validation->set_rules("user_id", "User ID", "required|trim|numeric");
$this->form_validation->set_rules("points", "Points", "required|trim|numeric");
$this->form_validation->set_rules("upi_name", "UPI Name", "required|trim");
$this->form_validation->set_rules("request_status", "Request Status", "required|trim");
$this->form_validation->set_rules("txn_id", "Transaction ID", "required|trim|is_unique[tblRequest.txn_id]");
$this->form_validation->set_rules("type", "Type", "required|trim");
$this->form_validation->set_rules("wallet", "Wallet", "trim");
$this->form_validation->set_rules("refer_code", "Refer Code", "trim");
$this->form_validation->set_rules("package_id", "Package ID", "trim");
if ($this->form_validation->run() == false) {
$status = "failed";
$dt = array("status" => $status, "message" => validation_errors());
echo json_encode($dt);
return;
} else {
$user_id = $_POST["user_id"];
$points = $_POST["points"];
$request_status = $upi_name == "PHONE_PE" ? "pending" : $this->input->post("request_status");
$txn_id = $_POST["txn_id"];
$type = $_POST["type"];
$wallet = $_POST["wallet"];
$pack_id = $_POST["package_id"]??0;
$first_deposit = $this->db->select("is_first_time_deposit")->where("user_id", $user_id)->get("tblwallet")->row()->is_first_time_deposit??0;
if ($first_deposit == 1) {
$ref_code = $_POST["refer_code"];
$check_ref_code = $this->db->where("user_reference_code", $ref_code)->where("login_status", 0)->get("user_profile");
if ($ref_code != '' && $check_ref_code->num_rows() > 0) {
$reffered_code = $ref_code;
$referee_data = $check_ref_code->row();
$refree_id = $referee_data->id;
$wa = 10 / 100 * $points;
if ($_POST["upi_name"] != "PHONE_PE") {
$query = $this->db->query("Update tblwallet set main_wallet_points=main_wallet_points+'{$wa}' where user_id='{$refree_id}'");
$array_refer = array("refered_user" => $user_id, "refered_by_user" => $refree_id, "amount_credited_refered_by_user" => $wa);
$this->db->insert("refer_history", $array_refer);
}
}
}
$data = array("request_points" => $points, "user_id" => $user_id, "request_status" => $request_status, "type" => $type, "txn_id" => $txn_id, "payment_type" => 2, "pack_id" => $pack_id);
$last_id = $this->db->insert("tblRequest", $data);
$pre_wallet = $this->db->where("user_id", $user_id)->get("tblwallet")->row()->main_wallet_points??0;
$total = $pre_wallet + $points;
if ($_POST["upi_name"] != "PHONE_PE") {
$u_otp = "update tblwallet set main_wallet_points='{$total}',is_first_time_deposit='0' where user_id='{$user_id}'";
$udd = $this->conn->query($u_otp);
}
if ($request_status != "pending") {
if ($pack_id != '') {
$cashback = $this->db->where("id", $pack_id)->where("status", "1")->get("package")->row()->cashback??"0";
} else {
$cashback = $this->db->where("amount", $points)->where("status", "1")->get("package")->row()->cashback??"0";
}
if ($cashback != '' && $cashback > 0) {
$cashaback_data = array("request_points" => $cashback, "user_id" => $user_id, "request_status" => $request_status, "type" => $type, "txn_id" => $txn_id, "remark" => "Cashback Added on adding Rs {$points}", "payment_type" => "3");
$this->db->insert("tblRequest", $cashaback_data);
if ($_POST["upi_name"] != "PHONE_PE") {
$this->db->set("main_wallet_points", "main_wallet_points + {$cashback}", false)->where("user_id", $user_id)->update("tblwallet");
}
}
}
if ($last_id === true) {
$status = "success";
$dt = array("status" => $status);
echo json_encode($dt);
} else {
$status = "failed";
$dt = array("status" => $status);
echo json_encode($dt);
}
}
}
public function get_time_slots() {
$data = array();
$q = "select * from timeslots";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$row_data[] = $row;
}
$q1 = "select * from app_setting";
$result1 = mysqli_query($this->conn, $q1);
$row1 = $result1->fetch_assoc();
$data["responce"] = true;
$data["data"] = $row_data;
$data["min_amount"] = $row1["w_amount"];
$data["withdraw_limit"] = $row1["withdraw_limit"];
$data["w_saturday"] = $row1["w_saturday"];
$data["w_sunday"] = $row1["w_sunday"];
} else {
$data["responce"] = false;
$data["message"] = "No time slots available";
}
echo json_encode($data);
}
public function forgot_mpin() {
$mpin = $_POST["mpin"];
$mobile = $_POST["mobile"];
$q = "update user_profile set mid='{$mpin}' where mobileno='{$mobile}'";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "success";
$data = "MPIN updated successfully.";
} else {
$status = "failed";
$data = "Something went wrong";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function text_chat() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
$this->form_validation->set_rules("message", "Message", "required");
if ($this->form_validation->run() == false) {
$data["response"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$message = $this->input->post("message");
$from = $this->input->post("from");
$type = "text";
$q = $this->db->insert("chat", array("user_id" => $user_id, "message" => $message, "from" => $from, "type" => $type));
if ($q) {
$data["response"] = true;
$data["message"] = "Message Sent.";
} else {
$data["response"] = false;
$data["error"] = "Message Not Sent";
}
}
echo json_encode($data);
}
public function image_chat() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
if ($this->form_validation->run() == false) {
$data["response"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$from = $this->input->post("from");
$type = "image";
if (isset($_FILES["image"]) && $_FILES["image"]["size"] > 0) {
$config["upload_path"] = "./img/chats/";
$config["allowed_types"] = "gif|jpg|png|jpeg";
$config["encrypt_name"] = true;
$this->load->library("upload", $config);
if (!$this->upload->do_upload("image")) {
$data["responce"] = false;
$data["error"] = "Error! : " . $this->upload->display_errors();
} else {
$img_data = $this->upload->data();
$img_name = $img_data["file_name"];
$this->load->model("Common_model");
$q = $this->db->insert("chat", array("user_id" => $user_id, "message" => $img_data["file_name"], "from" => $from, "type" => $type));
if ($q) {
$data["response"] = true;
$data["data"] = $img_name;
$data["message"] = "Message Sent.";
} else {
$data["response"] = false;
$data["error"] = "Message Not Sent";
}
}
}
}
echo json_encode($data);
}
public function get_chat() {
$data = array();
$user_id = $this->input->post("user_id");
$q = $this->db->where("user_id", $user_id)->get("chat");
$data["data"] = $q->result();
echo json_encode($data);
}
public function update_token() {
$data = array();
$this->form_validation->set_rules("user_id", "User ID", "trim|required");
$this->form_validation->set_rules("token", "Token ID", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$token = $this->input->post("token");
$q = $this->db->where("id", $user_id)->update("user_profile", array("token" => $token));
if ($q) {
$data["responce"] = true;
$data["message"] = "Token Updated!";
} else {
$data["responce"] = false;
$data["error"] = "Token Updation Failed";
}
}
echo json_encode($data);
}
public function change_password() {
$user_id = $this->input->post("user_id");
$old_pw = $this->input->post("old_pass");
$new_pw = $this->input->post("new_pass");
$org_pw = $this->db->select("password")->where("id", $user_id)->get("user_profile")->row();
if ($old_pw == $org_pw->password) {
$this->load->model("common_model");
$dd = $this->common_model->data_update("user_profile", array("password" => $new_pw), array("id" => $this->input->post("user_id")));
if ($dd) {
$status = "success";
$data = "Password updated successfully.";
} else {
$status = "failed";
$data = "Something went wrong";
}
} else {
$status = "failed";
$data = "Old Password does not matched";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function transfer_to_winning_wallet() {
$user_id = $this->input->post("user_id");
if ($user_id != '') {
$amount = $this->input->post("amount");
if ($amount > 0) {
$check_amt = $this->db->select("main_wallet_points")->where("user_id", $user_id)->get("tblwallet")->row();
if ($check_amt->main_wallet_points >= $amount) {
$deduction = $amount * 0.2;
$transfer_amt = $amount - $deduction;
$history = array("user_id" => $user_id, "request_amount" => $amount, "commission" => $deduction);
$this->db->insert("main_to_win_transfer", $history);
$query = $this->db->query("Update tblwallet set main_wallet_points=main_wallet_points-'{$amount}',wallet_points=wallet_points+'{$transfer_amt}' where user_id='{$user_id}'");
if ($query) {
$status = "success";
$data = "Amount transferred successfully.";
} else {
$status = "failed";
$data = "Something went wrong";
}
} else {
$status = "failed";
$data = "You don't have enough points to transfer to winning wallet.";
}
} else {
$status = "failed";
$data = "Amount should greater than 0.";
}
} else {
$status = "failed";
$data = "Invalid User";
}
$obj = array("status" => $status, "message" => $data);
echo json_encode($obj);
}
public function refer_history() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$data["responce"] = true;
$q = $this->db->query("select * from refer_history where refered_by_user='" . $user_id . "' ORDER BY id DESC");
$array = $q->result();
foreach ($array as $a) {
$uname = $this->db->select("username,mobileno")->where("id", $a->refered_user)->get("user_profile")->row();
$arr[] = array("amount_credit" => $a->amount_credited_refered_by_user, "user_who_refered" => "Points added first time by " . $uname->username . "(" . $uname->mobileno . ")");
}
$data["data"] = $arr;
}
echo json_encode($data);
}
public function raise_ticket() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
if ($this->form_validation->run() == false) {
$data["response"] = false;
$data["error"] = "Invalid User.";
} else {
$user_id = $this->input->post("user_id");
$trans_id = $this->input->post("transaction_id");
$amt = $this->input->post("amount");
if (isset($_FILES["image"]) && $_FILES["image"]["size"] > 0) {
$config["upload_path"] = "./img/raise_tickets/";
$config["allowed_types"] = "gif|jpg|png|jpeg|pdf";
$config["encrypt_name"] = true;
$this->load->library("upload", $config);
if (!$this->upload->do_upload("image")) {
$data["responce"] = false;
$data["error"] = "Error! : " . $this->upload->display_errors();
} else {
$img_data = $this->upload->data();
$img_name = $img_data["file_name"];
$this->load->model("Common_model");
$q = $this->db->insert("raise_tickets", array("user_id" => $user_id, "screenshot" => $img_data["file_name"], "trans_id" => $trans_id, "amount" => $amt));
if ($q) {
$data["response"] = true;
$data["message"] = "Ticket Raised Successfully.";
} else {
$data["response"] = false;
$data["error"] = "Something Went Wrong.";
}
}
}
}
echo json_encode($data);
}
public function check_block_user() {
$user_id = $this->input->post("user_id");
if ($user_id != '') {
$q = $this->db->select("is_blocked")->where("id", $user_id)->get("user_profile")->row();
$status = "success";
$data = $q;
} else {
$status = "failed";
$message = "Invalid User Id";
$data = '';
}
$obj = array("status" => $status, "message" => $message, "data" => $data);
echo json_encode($obj);
}
public function get_packages() {
$q = $this->db->where("status", 1)->get("package")->result();
$status = "success";
$data = $q;
$obj = array("status" => $status, "data" => $data);
echo json_encode($obj);
}
public function fund_transfer_history() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$data["responce"] = true;
$q = $this->db->query("select request_amount,commission,created_at as date from main_to_win_transfer where user_id='" . $user_id . "' ORDER BY created_at DESC");
$data["data"] = $q->result();
}
echo json_encode($data);
}
public function AddFund_qrdetails() {
$data = array();
$_POST = $_REQUEST;
$app_setting = $this->db->select("min_amount,max_amount")->get("app_setting")->row();
$min_value = $app_setting->min_amount;
$max_value = $app_setting->max_amount;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
$this->form_validation->set_rules("utr_no", "Utr Number", "trim|required|is_unique[tblRequest.utr_no]");
$this->form_validation->set_rules("points", "Amount", "trim|required|numeric|greater_than_equal_to[" . $min_value . "]|less_than_equal_to[" . $max_value . "]");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$utr = $this->input->post("utr_no") ??NULL;
$amt = $this->input->post("points");
$dd = date("YmdHis");
$base = $this->input->post("qr_image");
$value = time();
$QrImage = "Qrimg" . $dd . ".jpg";
$filename = "img/Qrimage/" . $QrImage;
$binary = base64_decode($base);
$status = file_put_contents($filename, $binary);
$array = $this->db->insert("tblRequest", array("request_points" => $amt, "utr_no" => $utr, "user_id" => $user_id, "request_status" => "pending", "type" => "Add", "qr_screenshot" => $QrImage, "payment_type" => 1));
$data["responce"] = isset($array) ? true : false;
$data["data"] = isset($array) ? "Records Saved" : "Something went wrong";
}
echo json_encode($data);
}
public function AddFund_qrdetails_old() {
$data = array();
$_POST = $_REQUEST;
$app_setting = $this->db->select("min_amount,max_amount")->get("app_setting")->row();
$min_value = $app_setting->min_amount;
$max_value = $app_setting->max_amount;
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
$this->form_validation->set_rules("utr_no", "Utr Number", "trim");
$this->form_validation->set_rules("points", "Amount", "trim|required|numeric|greater_than_equal_to[" . $min_value . "]|less_than_equal_to[" . $max_value . "]");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$utr = $this->input->post("utr_no") ??NULL;
$amt = $this->input->post("points");
$dd = date("YmdHis");
$base = $this->input->post("qr_image");
$value = time();
$QrImage = "Qrimg" . $dd . ".jpg";
$filename = "img/Qrimage/" . $QrImage;
$binary = base64_decode($base);
$status = file_put_contents($filename, $binary);
$array = $this->db->insert("tblRequest", array("request_points" => $amt, "user_id" => $user_id, "request_status" => "pending", "type" => "Add", "qr_screenshot" => $QrImage, "payment_type" => 1));
$data["responce"] = isset($array) ? true : false;
$data["data"] = isset($array) ? "Records Saved" : "Something went wrong";
}
echo json_encode($data);
}
public function get_homepage_matka() {
$row_dt = '';
$matka = array();
$q = "select *,IF(is_homepage_game = 1, CONCAT(starting_num, ' X ', end_num),CONCAT(starting_num, 'X', number, 'X', end_num)) AS result\xa from matka where status='active' and is_homepage_game=1 ORDER BY matka_order";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$i = 0;
$curr_time = strtotime(date("H:i:s"));
while ($row = $result->fetch_assoc()) {
if (date("D") === "Sat") {
$bid_start_time = $row["sat_start_time"];
$bid_end_time = $row["sat_end_time"];
}
if (date("D") === "Sun") {
$bid_start_time = $row["start_time"];
$bid_end_time = $row["end_time"];
} else {
$bid_start_time = $row["start_time"];
$bid_end_time = $row["end_time"];
}
$type = $curr_time >= strtotime($bid_start_time) && $curr_time <= strtotime($bid_end_time) ? "live" : "old";
$data[$i] = $row;
$data[$i]["bid_start_time"] = $bid_start_time;
$data[$i]["bid_end_time"] = $bid_end_time;
$data[$i]["type"] = $type;
$i++;
}
} else {
$data = "0";
}
echo json_encode($data);
}
public function get_bothsidefc() {
$list1 = $_POST["left_array"];
$list2 = $_POST["right_array"];
$amount = $_POST["amount"];
$value = json_decode($list1);
$value2 = json_decode($list2);
$nList = array();
foreach ($value as $item1) {
foreach ($value2 as $item2) {
$nList[] = $item1 . "-" . $item2;
$nList[] = $item2 . "-" . $item1;
}
}
$data["response"] = true;
$data["data"] = $nList;
$data["amount"] = count($nList) * $amount;
echo json_encode($data);
}
public function get_samefc() {
$digits = $_POST["list"];
$amount = $_POST["amount"];
$value = json_decode($digits);
$combinations = array();
foreach ($value as $digit1) {
foreach ($value as $digit2) {
$combination = $digit1 . "-" . $digit2;
$combinations[] = $combination;
}
}
$response = array("response" => true, "data" => $combinations, "total_amount" => count($combinations) * $amount);
echo json_encode($response);
}
public function get_history_fc_game() {
$data = array();
$user_id = $this->input->post("user_id");
$page = $this->input->post("page") ??1;
$f_date = $this->input->post("from_date") ??date("d/m/Y");
$t_date = $this->input->post("to_date") ??date("d/m/Y");
$from = explode("/", $f_date);
$to = explode("/", $t_date);
$from_date = $from[2] . "-" . $from[1] . "-" . $from[0];
$to_date = $to[2] . "-" . $to[1] . "-" . $to[0];
$page_limit = 10;
$offset = ($page - 1) * $page_limit;
$data["responce"] = true;
$this->db->select("matka.name,t.*,DATE_FORMAT(t.time, '%d/%m/%Y %h:%i %p') as time");
$this->db->from("tblgamedata t");
$this->db->join("matka", "matka.id = t.matka_id");
$this->db->where("user_id", $user_id);
$this->db->where("is_fc_game", 1);
$this->db->where("DATE(t.time) BETWEEN '{$from_date}' AND '{$to_date}'");
$this->db->order_by("id", "DESC");
$q = $this->db->get();
$data["data"] = $q->result();
echo json_encode($data);
}
public function get_history_bs_game() {
$data = array();
$user_id = $this->input->post("user_id");
$f_date = $this->input->post("from_date") ??date("d/m/Y");
$t_date = $this->input->post("to_date") ??date("d/m/Y");
$from = explode("/", $f_date);
$to = explode("/", $t_date);
$from_date = $from[2] . "-" . $from[1] . "-" . $from[0];
$to_date = $to[2] . "-" . $to[1] . "-" . $to[0];
$data["responce"] = true;
$this->db->select("matka.name,t.*,DATE_FORMAT(t.time, '%d/%m/%Y %h:%i %p') as time");
$this->db->from("tblgamedata t");
$this->db->join("matka", "matka.id = t.matka_id");
$this->db->where("user_id", $user_id);
$this->db->where("is_bs_game", 1);
$this->db->where("DATE(t.time) BETWEEN '{$from_date}' AND '{$to_date}'");
$this->db->order_by("t.id", "DESC");
$q = $this->db->get();
$data["data"] = $q->result();
echo json_encode($data);
}
public function get_common_data() {
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$current_time = date("H:i:s");
$app = $this->db->select("app_start_time,app_end_time,app_message")->get("app_setting")->row();
$this->db->select("is_capped,kyc_status");
$details = $this->db->where("up.id", $user_id)->join("tblwallet tw", "tw.user_id= up.id")->get("user_profile up");
if ($details->num_rows() > 0) {
$row = $details->row();
$kyc_message = $row->kyc_status == 0 ? "KYC is pending" : ($row->kyc_status == 1 ? "KYC is under review 24 hours" : "KYC Completed");
$set = array("is_app_running" => $current_time > $app->app_start_time && $app->app_end_time < $current_time ? 1 : 0, "app_message" => $app->app_message);
$message = array("is_capped" => $row->is_capped, "wallet_message" => "Contact to admin", "kyc_status" => $row->kyc_status, "kyc_message" => $kyc_message);
$data["responce"] = true;
$data["app_setting"] = $set;
$data["user_details"] = $message;
} else {
$data["responce"] = false;
$data["error"] = "User details not found..";
}
}
echo json_encode($data);
}
public function get_state() {
$app = $this->db->select("id,name")->get("state")->result();
$data["responce"] = true;
$data["data"] = $app;
echo json_encode($data);
}
public function upload_kyc_data() {
$this->form_validation->set_rules("user_id", "User Id", "trim|required");
$this->form_validation->set_rules("name", "Name", "trim|required");
$this->form_validation->set_rules("whatsapp_no", "whatsapp_no", "trim|required");
$this->form_validation->set_rules("state", "state", "trim|required");
$this->form_validation->set_rules("image", "image", "trim|required");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("user_id");
$name = $this->input->post("name");
$whatsapp_no = $this->input->post("whatsapp_no");
$state = $this->input->post("state");
$image = $this->input->post("image");
$documents = $this->input->post("documents");
$details = $this->db->where("up.id", $user_id)->get("user_profile up");
if ($details->num_rows() > 0) {
$kyc_status = $details->row()->kyc_status??0;
if ($kyc_status == 0) {
$insert = array("user_id" => $user_id, "name" => $name, "whatsapp_no" => $whatsapp_no, "state" => $state);
$time = date("YmdHis");
$UserImage = "UserImage" . $time . ".jpg";
$profile = "uploads/documents/" . $UserImage;
$binary = base64_decode($image);
$img_status = file_put_contents($profile, $binary);
$insert["profile"] = $profile;
if ($documents != '') {
$User_docs = "documents" . $time . ".jpg";
$docs_file = "uploads/documents/" . $User_docs;
$binary_back = base64_decode($documents);
$docs_status = file_put_contents($docs_file, $binary_back);
$insert["document"] = $docs_file;
}
$this->db->insert("kyc_docs", $insert);
$last_id = $this->db->insert_id();
if ($last_id) {
$this->db->where("id", $user_id)->update("user_profile", array("kyc_status" => 1));
$data["responce"] = true;
$data["message"] = "Kyc data submit successful..";
} else {
$data["responce"] = false;
$data["message"] = "Something went wrong";
}
} else {
if ($kyc_status == 1) {
$data["responce"] = false;
$data["message"] = "Now Kyc under review..";
} else {
$data["responce"] = false;
$data["message"] = "Kyc already complete..";
}
}
} else {
$data["responce"] = false;
$data["error"] = "User details not found..";
}
}
echo json_encode($data);
}
public function check_game_digit_balance() {
$this->form_validation->set_rules("matka_id", "Matka Id", "trim|required|numeric");
$this->form_validation->set_rules("digit", "Digit", "trim|required|numeric");
$this->form_validation->set_rules("points", "Points", "trim|required|numeric");
$this->form_validation->set_rules("user_id", "User ID", "trim|required|numeric");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$matka_id = $this->input->post("matka_id");
$digit = $this->input->post("digit");
$points = $this->input->post("points");
$user_id = $this->input->post("user_id");
$this->db->cache_off();
$bid_limit = $this->db->select("max_bid_amount")->get("app_setting")->row()->max_bid_amount??0;
$where = array("matka_id" => $matka_id, "digits" => $digit, "date" => date("d/m/Y"), "user_id" => $user_id);
$total_value = $this->db->select("SUM(points) as total_value")->where($where)->group_by(array("matka_id", "digits"))->get("tblgamedata")->row()->total_value??0;
$total_values = $total_value + $points;
$remain_balance = $bid_limit - $total_values;
$update_bal = $bid_limit < $total_values ? $bid_limit - $total_value : 0;
if ($bid_limit < $total_values) {
$data["responce"] = false;
$data["error"] = "Max Amount is {$bid_limit}. You can add only {$update_bal}.";
} else {
$data["responce"] = true;
$data["error"] = "Max Amount is {$bid_limit}. You can add more {$remain_balance}.";
}
}
echo json_encode($data);
}
public function chart_history() {
$data = array();
$_POST = $_REQUEST;
$this->load->library("form_validation");
$this->form_validation->set_rules("matka_id", "Matka Id", "trim|required");
$matka_id = $this->input->post("matka_id");
$from_date = $this->input->post("from_date") ??date("Y-m-d");
$to_date = $this->input->post("to_date") ??date("Y-m-d");
if ($this->form_validation->run() == false) {
$data["responce"] = false;
$data["error"] = strip_tags($this->form_validation->error_string());
} else {
$data["responce"] = true;
$q = $this->db->query("select * from charts where cid='{$matka_id}' and DATE(date) BETWEEN '{$from_date}' AND '{$to_date}' ORDER BY date DESC");
$data["data"] = $q->result();
}
echo json_encode($data);
}
public function generate_otp_for_withdrawal() {
$this->form_validation->set_rules("mobile", "Mobile Number", "trim|required|integer");
if ($this->form_validation->run() == false) {
$status = "failed";
$data = strip_tags($this->form_validation->error_string());
$otp = '';
} else {
$app_setting = $this->db->get("timeslots")->row();
$start_time = date("H:i", strtotime($app_setting->start_time));
$end_time = date("H:i", strtotime($app_setting->end_time));
$time = date("H:i");
if ($time > $start_time && $time < $end_time) {
$mobile = $this->input->post("mobile");
$q = $this->db->query("select * from user_profile where (mobileno='" . $mobile . "') Limit 1");
if ($q->num_rows() > 0) {
$status = "success";
$otp = mt_rand(100000, 999999);
$time = date("Y-m-d H:i:s", strtotime("+2 minute"));
$data = array("user_id" => $mobile, "otp" => $otp, "created_at" => $time, "type" => "withdraw");
$count = $this->db->where("user_id", $mobile)->get("tblOtp")->num_rows();
if ($count == 0) {
$this->db->insert("tblOtp", $data);
} else {
$this->db->where("user_id", $mobile)->update("tblOtp", $data);
}
$msg_status = $this->db->select("otp_status")->get("app_setting")->row()->otp_status??0;
if ($msg_status == 1) {
$this->load->model("sms_model");
$this->sms_model->send_msg($mobile, $otp);
}
$data = "Code sent to your registered mobile number";
$otp = $otp;
} else {
$status = "failed";
$data = "Mobile number not registered.";
$otp = '';
}
} else {
$status = "failed";
$data = "Withdrawal Timeout.";
$otp = '';
}
}
$obj = array("status" => $status, "message" => $data, "otp" => $otp);
echo json_encode($obj);
}
public function verify_withdrawal_otp() {
$this->form_validation->set_rules("mobile", "Mobile", "trim|required|integer");
$this->form_validation->set_rules("otp", "OTP", "trim|required|integer");
if ($this->form_validation->run() == false) {
$data["status"] = "failed";
$data["message"] = strip_tags($this->form_validation->error_string());
} else {
$mobile = $this->input->post("mobile");
$otp = $this->input->post("otp");
$check_details = $this->db->where(array("user_id" => $mobile, "otp" => $otp))->order_by("id", "desc")->LIMIT(1)->get("tblOtp");
$user_details = $check_details->row();
if ($check_details->num_rows() > 0) {
$store_time = $user_details->created_at;
$current_time = date("Y-m-d H:i:s");
if ($current_time > $store_time) {
$data["status"] = "failed";
$data["message"] = "Otp expire try again";
} else {
$data["status"] = "success";
$data["message"] = "Otp verify...";
}
} else {
$data["status"] = "failed";
$data["message"] = "Enter Correct details...";
}
}
echo json_encode($data);
}
} ?>
Did this file decode correctly?
Original Code
<?php
class ApiNew_one extends CI_Controller {
public $conn;
public function __construct() {
include APPPATH . "\x63\x6f\x6e\x66\151\x67\57\x64\141\164\x61\x62\x61\x73\145\x2e\160\150\160";
parent::__construct();
$hostname = $db["\x64\x65\146\141\x75\x6c\x74"]["\x68\x6f\x73\x74\156\141\155\145"];
$username = $db["\144\x65\146\x61\x75\x6c\x74"]["\x75\x73\145\x72\156\x61\x6d\x65"];
$password = $db["\x64\x65\x66\141\x75\x6c\164"]["\160\x61\163\163\x77\x6f\162\144"];
$database = $db["\x64\145\146\x61\165\154\164"]["\x64\141\x74\141\142\141\x73\145"];
$this->conn = mysqli_connect($hostname, $username, $password, $database) or die("\105\x72\162\157\x72\x20\151\x6e\x20\143\157\156\156\145\x63\164\x69\157\x6e\56");
$this->load->database();
header("\103\157\x6e\164\x65\156\164\x2d\x54\x79\160\x65\x3a\x20\141\x70\160\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\152\163\x6f\x6e");
$this->load->library("\x66\157\x72\155\137\x76\x61\154\x69\x64\x61\164\151\x6f\x6e");
$this->load->helper("\163\155\x73\137\150\145\x6c\160\x65\x72");
}
public function getIndex() {
$data = array();
$res = $this->db->query("\x73\145\x6c\x65\143\164\x20\x2a\40\146\162\157\155\40\141\160\160\x5f\x73\x65\x74\164\x69\156\147");
$data["\162\145\163\160\x6f\156\143\x65"] = true;
$data["\144\x61\164\141"] = $res->result();
echo json_encode($data);
}
public function getLoginStatus() {
$data = array();
$uid = $this->input->post("\x75\x73\x65\x72\137\x69\144");
$login_stat = $this->db->select("\x6c\157\147\x69\x6e\137\x73\x74\x61\164\165\x73")->where("\x69\144", $uid)->get("\x75\x73\145\x72\x5f\x70\x72\x6f\x66\x69\154\145")->row();
$data["\162\145\163\x70\x6f\156\143\145"] = true;
$data["\154\157\x67\x69\156\137\163\164\x61\x74\165\163"] = $login_stat->login_status;
echo json_encode($data);
}
public function getMobileData() {
$data = array();
$res = $this->db->query("\x73\x65\x6c\145\143\164\x20\x2a\x20\146\x72\x6f\x6d\40\163\x69\164\x65\137\x63\x6f\x6e\x66\151\147");
$data["\x72\x65\x73\x70\157\156\143\145"] = true;
$data["\144\x61\164\x61"] = $res->result();
echo json_encode($data);
}
public function password_details() {
$data = array();
$res = $this->db->get("\146\157\x72\147\157\164\x70\141\x73\163\x77\x6f\162\x64")->result();
echo json_encode($res);
}
public function get_sliders() {
$q = $this->db->query("\123\105\114\x45\x43\x54\40\x2a\40\106\122\117\x4d\40\140\x73\x6c\151\x64\145\162\x73\137\x69\155\x67\140");
$status = "\163\165\x63\x63\x65\163\x73";
$data = $q->result();
$obj = array("\163\x74\141\164\165\163" => $status, "\144\x61\x74\141" => $data);
echo json_encode($obj);
}
public function sign_up() {
$data = array();
$_POST = $_REQUEST;
$this->load->model("\165\163\x65\x72\137\155\x6f\144\x65\154");
$this->form_validation->set_rules("\153\x65\x79", "\113\105\x59", "\164\162\x69\155\x7c\x72\x65\x71\165\x69\x72\x65\144");
if ($this->form_validation->run() == false) {
$data["\x72\x65\163\x70\157\x6e\x63\x65"] = false;
$data["\145\x72\162\157\162"] = strip_tags($this->form_validation->error_string());
} else {
$key = $this->input->post("\x6b\x65\x79");
$date = date("\x64\57\x6d\57\x79");
if ($key == 1) {
$q = $this->db->query("\163\x65\154\x65\143\164\40\52\40\x66\x72\157\155\x20\x75\163\x65\x72\137\x70\162\157\x66\x69\154\x65\40\x77\150\145\162\x65\40\x6d\x6f\142\x69\x6c\x65\x6e\x6f\75\47" . $this->input->post("\155\x6f\x62\x69\154\145") . "\47\40");
if ($q->num_rows() > 0) {
$data["\x72\x65\163\x70\x6f\156\143\x65"] = false;
$data["\145\x72\162\x6f\162"] = "\115\157\142\x69\154\x65\40\116\165\155\x62\x65\x72\40\x41\x6c\162\x65\x61\x64\171\x20\x52\145\147\151\163\164\145\162\x65\144";
} else {
$reffered_code = '';
$ref_code = $this->input->post("\x72\x65\146\x65\x72\x5f\143\157\144\x65");
$check_ref_code = $this->db->where("\x75\163\x65\x72\x5f\x72\145\146\145\x72\145\x6e\143\145\x5f\x63\157\x64\x65", $ref_code)->where("\x6c\x6f\147\x69\x6e\137\x73\164\141\x74\x75\163", 0)->get("\165\163\x65\x72\x5f\x70\162\157\x66\151\154\x65");
if ($ref_code != '' && $check_ref_code->num_rows() > 0) {
$reffered_code = $ref_code;
}
$array = array("\x75\x73\145\x72\x6e\x61\x6d\x65" => $this->input->post("\x75\163\145\162\156\x61\155\x65"), "\156\x61\155\145" => $this->input->post("\x6e\141\155\x65"), "\x6d\157\142\x69\154\x65\156\x6f" => $this->input->post("\x6d\x6f\142\x69\154\x65"), "\x6d\x69\x64" => $this->input->post("\155\x70\151\x6e"), "\160\x61\x73\x73\x77\x6f\162\144" => $this->input->post("\160\141\x73\163\167\x6f\x72\x64"), "\x6c\x6f\x67\151\x6e\x5f\163\x74\141\x74\165\163" => 0, "\162\145\146\146\145\x72\x65\144\137\143\157\x64\x65" => $reffered_code);
$array["\x75\163\145\x72\137\x72\x65\x66\x65\x72\x65\x6e\x63\145\x5f\x63\x6f\x64\x65"] = $this->user_model->isExistingUserRef();
$this->db->insert("\165\x73\x65\x72\137\x70\162\157\x66\151\154\x65", $array);
$user_id = $this->db->insert_id();
$this->db->insert("\164\142\154\167\x61\154\x6c\145\x74", array("\x75\163\145\x72\x5f\x69\x64" => (int)$user_id, "\x77\141\154\154\x65\x74\137\x70\x6f\x69\156\164\163" => 0, "\x6d\x61\151\x6e\x5f\167\141\154\x6c\x65\164\x5f\x70\157\151\156\164\x73" => 0));
$data["\162\x65\163\x70\157\x6e\x63\x65"] = true;
$data["\x6d\x65\x73\163\141\x67\x65"] = "\125\163\145\x72\40\x52\145\x67\x69\x73\x74\x65\162\40\123\x75\x63\x65\x73\163\x66\x75\x6c\x6c\171\x2e\56";
}
} else {
if ($key == 2) {
$this->load->model("\x63\157\155\x6d\157\x6e\137\x6d\157\144\145\x6c");
$this->common_model->data_update("\x75\163\145\x72\x5f\160\162\157\146\x69\x6c\x65", array("\141\x64\144\x72\145\x73\163" => $this->input->post("\141\x64\144\x72\145\x73\x73"), "\x63\151\164\171" => $this->input->post("\x63\x69\164\x79"), "\160\x69\156\x63\x6f\x64\x65" => $this->input->post("\x70\151\x6e")), array("\x69\x64" => $this->input->post("\165\x73\x65\162\137\151\144")));
$data["\162\x65\163\160\x6f\x6e\x63\x65"] = true;
$data["\155\x65\163\163\x61\147\145"] = "\x41\144\144\162\x65\163\x73\x20\x55\160\x64\141\x74\145\x64\40\163\x75\x63\x63\145\x73\163\146\165\x6c\154\171\x2e\x2e";
} else {
if ($key == 3) {
$this->load->model("\x63\157\155\155\x6f\156\137\x6d\157\x64\x65\154");
$this->common_model->data_update("\x75\x73\145\x72\x5f\160\162\157\146\151\x6c\145", array("\x61\x63\x63\157\165\156\164\156\157" => $this->input->post("\x61\x63\143\x6f\165\156\x74\156\157"), "\142\x61\156\153\137\156\x61\155\145" => $this->input->post("\x62\141\156\153\156\x61\x6d\145"), "\x69\146\163\143\x5f\x63\157\x64\145" => $this->input->post("\151\146\163\x63"), "\x61\x63\x63\x6f\165\x6e\x74\x5f\150\x6f\x6c\144\145\162\x5f\156\141\x6d\145" => $this->input->post("\141\143\143\x6f\165\156\164\x68\157\154\x64\145\x72")), array("\151\x64" => $this->input->post("\165\x73\145\x72\137\151\144")));
$data["\x72\145\163\160\157\156\x63\145"] = true;
$data["\x6d\x65\163\163\141\x67\x65"] = "\102\x61\156\153\40\x44\x65\x74\141\151\x6c\163\x20\x55\x70\144\x61\164\x65\x64\40\x73\165\143\143\x65\163\x73\146\165\x6c\x6c\x79\56\56";
} else {
if ($key == 4) {
$this->load->model("\x63\x6f\155\x6d\157\x6e\x5f\155\x6f\x64\x65\x6c");
$q = $this->common_model->data_update("\165\x73\x65\162\x5f\160\x72\x6f\146\151\154\145", array("\x74\x65\x7a\x5f\156\157" => $this->input->post("\x74\145\172"), "\160\x61\171\x74\x6d\x5f\156\157" => $this->input->post("\x70\141\x79\x74\155"), "\x70\150\x6f\156\x65\x70\x61\171\x5f\x6e\157" => $this->input->post("\160\150\x6f\x6e\145\x70\141\x79")), array("\x69\144" => $this->input->post("\x75\163\145\x72\137\151\144")));
if ($q) {
$data["\162\x65\x73\160\157\156\x63\145"] = true;
$data["\155\145\163\163\x61\x67\x65"] = "\x50\x79\x6d\145\156\164\x20\104\x65\x74\141\151\154\163\40\125\x70\x64\141\164\145\x64\x20\x73\x75\143\x63\145\163\163\146\x75\x6c\154\171\x2e\56";
} else {
$data["\162\145\163\160\x6f\x6e\143\145"] = false;
$data["\145\x72\x72\157\x72"] = "\x53\157\155\145\164\x68\x69\156\147\x20\167\145\156\164\40\x77\162\x6f\156\x67";
}
} else {
if ($key == 5) {
$this->load->model("\143\x6f\155\155\157\156\137\x6d\157\x64\145\x6c");
$this->common_model->data_update("\165\163\x65\x72\137\160\162\157\146\151\154\x65", array("\145\x6d\141\x69\154" => $this->input->post("\x65\155\x61\151\154"), "\x64\x6f\x62" => $this->input->post("\144\157\142")), array("\151\x64" => $this->input->post("\x75\x73\145\162\x5f\151\x64")));
$data["\x72\145\163\x70\157\x6e\143\145"] = true;
$data["\x6d\x65\163\163\141\x67\145"] = "\40\x44\145\x74\x61\151\x6c\163\x20\125\160\x64\x61\164\145\x64\40\163\165\x63\143\145\x73\163\x66\x75\154\154\x79\56\56";
}
}
}
}
}
}
echo json_encode($data);
}
public function getMatkas() {
$q = $this->db->query("\163\x65\x6c\x65\143\164\40\52\x20\x66\x72\157\x6d\x20\x6d\141\164\x6b\141\x20\x77\150\x65\x72\145\x20\163\164\141\x74\x75\x73\75\x27\x61\143\x74\x69\x76\145\x27\x20\x4f\x52\104\105\x52\x20\x42\131\40\155\x61\164\x6b\141\137\x6f\x72\x64\145\x72");
echo json_encode($q->result());
}
public function getStarline() {
$q = "\x73\145\154\145\143\164\x20\x2a\40\146\x72\157\155\x20\x74\x62\x6c\x53\164\x61\x72\154\151\x6e\x65\x20\x77\x68\x65\x72\145\x20\163\137\147\x61\155\x65\x5f\164\151\x6d\145\x20\41\x3d\x27\47";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$i = 0;
while ($row = $result->fetch_assoc()) {
$data[$i]["\151\144"] = $row["\151\144"];
$data[$i]["\163\137\147\x61\x6d\x65\x5f\x74\151\155\x65"] = $row["\163\x5f\147\x61\155\145\137\164\x69\155\x65"];
if (strtotime(date("\x59\x2d\x6d\55\144")) == strtotime(date("\x59\55\155\x2d\144", strtotime($row["\165\160\144\141\x74\x65\x64\x5f\141\x74"])))) {
$data[$i]["\x73\x5f\147\x61\x6d\145\137\156\165\155\142\145\162"] = $row["\x73\x5f\x67\x61\x6d\x65\137\156\x75\x6d\142\x65\162"];
} else {
$data[$i]["\163\137\x67\141\x6d\145\137\x6e\165\x6d\x62\145\x72"] = "\x2a\52\x2a";
}
$i++;
}
} else {
$data = "\60";
}
echo json_encode($data);
}
public function get_matka_with_id() {
$q = $this->db->query("\163\x65\x6c\x65\143\x74\x20\52\x20\146\162\157\155\40\x20\x6d\x61\164\x6b\141\40\167\x68\x65\x72\x65\x20\x69\144\x3d\47" . $this->input->post("\151\x64") . "\x27");
$status = "\x73\x75\x63\143\145\x73\x73";
$data = $q->row();
$obj = array("\x73\x74\x61\x74\x75\x73" => $status, "\144\141\164\141" => $data);
echo json_encode($obj);
}
public function how_to_play() {
$hto = "\x56\x61\x6c\165\145\61\x20\151\x73\x20\x68\x65\x72\x65\x20\x2e\x2e\x2e\x2e\x2e";
$hto2 = "\150\164\x74\x70\x73\x3a\x2f\x2f\167\x77\167\x2e\x79\x6f\165\164\165\142\145\56\143\x6f\155\x2f";
$x["\x64\x61\164\x61"] = $hto;
$x["\154\x69\156\x6b"] = $hto2;
$obj = array($x);
echo json_encode($obj);
}
public function login_old() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\155\x6f\142\151\x6c\x65\x6e\157", "\x4d\x6f\142\151\154\145\40\x4e\157", "\x74\162\151\155\x7c\162\145\x71\165\151\x72\x65\144");
$this->form_validation->set_rules("\x70\141\163\x73\x77\x6f\162\x64", "\120\x61\163\163\x77\157\162\144", "\x74\162\x69\155\x7c\x72\145\x71\165\151\162\x65\144");
if ($this->form_validation->run() == false) {
$data["\162\145\163\160\x6f\156\143\x65"] = false;
$data["\145\162\162\157\162"] = strip_tags($this->form_validation->error_string());
} else {
$q = $this->db->query("\163\145\x6c\145\143\164\40\52\40\146\162\x6f\155\x20\165\163\145\162\x5f\x70\162\x6f\146\151\154\x65\40\167\150\x65\x72\145\40\x28\x6d\157\x62\151\x6c\x65\156\x6f\x3d\x27" . $this->input->post("\x6d\157\x62\151\x6c\145\156\157") . "\x27\40\x29\40\40\114\151\x6d\151\x74\40\x31");
if ($q->num_rows() > 0) {
$row = $q->row();
$db_pass = $row->password;
$pass = $this->input->post("\160\x61\163\163\x77\x6f\x72\x64");
if ($pass == $db_pass) {
if ($row->is_blocked == "\61") {
$data["\x72\x65\163\160\x6f\x6e\x63\145"] = false;
$data["\145\162\162\157\x72"] = "\101\143\x63\x6f\165\x6e\164\40\102\x6c\157\x63\153\x65\x64\x2e";
} else {
if ($row->login_status == "\x32") {
$data["\162\x65\x73\160\x6f\156\143\x65"] = false;
$data["\145\162\162\x6f\162"] = "\x59\157\x75\162\x20\141\x63\143\157\x75\156\164\40\x63\x75\x72\x72\145\156\164\154\x79\x20\x69\x6e\141\x63\164\x69\166\145\56\120\154\145\x61\x73\145\x20\x43\x6f\x6e\x74\x61\x63\x74\x20\x41\144\155\151\x6e";
} else {
$data["\x72\x65\163\x70\157\156\143\145"] = true;
$user_id = $row->id;
$temp = array();
$temp["\x69\x64"] = $row->id;
$temp["\156\x61\155\x65"] = $row->name;
$temp["\165\163\x65\x72\156\x61\x6d\145"] = $row->username;
$temp["\x6d\x6f\142\151\x6c\145\156\157"] = $row->mobileno;
$temp["\160\141\x73\x73\x77\x6f\x72\144"] = $row->password;
$temp["\145\x6d\141\x69\154"] = $row->email;
$temp["\141\144\x64\162\x65\163\163"] = $row->address;
$temp["\x63\151\x74\171"] = $row->city;
$temp["\x70\151\156\x63\157\144\145"] = $row->pincode;
$temp["\x70\141\163\x73\167\157\162\144"] = $row->password;
$temp["\141\143\143\x6f\165\x6e\x74\x6e\157"] = $row->accountno;
$temp["\x62\141\156\153\137\x6e\x61\155\145"] = $row->bank_name;
$temp["\151\146\163\x63\x5f\143\x6f\x64\x65"] = $row->ifsc_code;
$temp["\x61\143\143\x6f\x75\x6e\164\137\x68\x6f\x6c\x64\x65\x72\x5f\x6e\x61\x6d\145"] = $row->account_holder_name;
$temp["\x70\141\171\x74\155\137\x6e\x6f"] = $row->paytm_no;
$temp["\x74\145\172\x5f\156\157"] = $row->tez_no;
$temp["\160\x68\157\x6e\x65\x70\x61\171\137\x6e\x6f"] = $row->phonepay_no;
$temp["\x64\x6f\x62"] = $row->dob;
$temp["\x72\145\146\145\162\x5f\x63\157\144\x65"] = $row->user_reference_code;
$temp["\x72\145\x66\145\162\145\x64\x5f\146\162\157\x6d\137\x63\x6f\144\x65"] = $row->reffered_code;
$qw = $this->db->query("\x73\x65\154\145\143\x74\40\52\x20\106\122\117\115\40\x60\x74\x62\x6c\167\x61\154\154\145\164\x60\40\167\x68\145\162\x65\40\x75\163\145\162\x5f\151\144\75\47" . $user_id . "\x27\40\x4c\151\x6d\151\164\x20\x31");
$wrow = $qw->row();
$temp["\167\141\154\154\145\164"] = $wrow->wallet_points;
$data["\x64\x61\x74\x61"] = $temp;
}
}
} else {
$data["\x72\x65\163\160\x6f\156\x63\145"] = false;
$data["\x65\162\162\157\162"] = "\x57\162\157\x6e\147\x20\120\x61\163\163\x77\157\x72\144";
}
} else {
$data["\x72\x65\163\160\157\x6e\143\x65"] = false;
$data["\145\162\162\157\x72"] = "\115\157\x62\151\154\145\x20\116\165\x6d\142\x65\162\x20\144\x6f\145\163\x20\156\x6f\x74\40\145\170\x69\x73\x74";
}
}
echo json_encode($data);
}
public function login() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\155\x6f\x62\151\154\x65\x6e\157", "\115\157\x62\x69\x6c\145\x20\116\157", "\x74\x72\151\x6d\x7c\x72\x65\161\165\x69\162\145\144");
$this->form_validation->set_rules("\160\x61\163\x73\167\157\x72\x64", "\x50\141\x73\163\167\157\162\x64", "\x74\162\151\x6d\174\162\x65\x71\x75\151\x72\145\x64");
if ($this->form_validation->run() == false) {
$data["\162\145\x73\x70\x6f\x6e\x63\x65"] = false;
$data["\x65\x72\162\157\162"] = strip_tags($this->form_validation->error_string());
} else {
$mobile = $this->input->post("\155\x6f\142\x69\154\x65\156\157");
$password = $this->input->post("\160\x61\163\x73\x77\157\x72\x64");
$this->db->select("\x75\x70\x2e\151\x64\x2c\x6e\141\155\x65\54\165\x73\145\162\x6e\x61\x6d\x65\x2c\155\x6f\142\151\x6c\145\156\157\54\160\x61\x73\163\167\x6f\x72\144\x2c\x65\155\x61\151\154\x2c\x61\x64\144\x72\x65\163\x73\54\x63\x69\164\x79\x2c\160\x69\x6e\x63\157\x64\145\x2c\141\143\143\x6f\x75\x6e\164\x6e\157\x2c\142\141\x6e\153\137\156\x61\x6d\145\54\151\x66\x73\x63\137\x63\x6f\x64\x65\54\x69\x73\137\142\x6c\157\143\153\x65\x64\54\x6c\157\147\151\156\137\163\164\x61\164\x75\163\54\xa\40\40\x20\x20\x20\40\40\40\40\x20\x20\40\x61\143\143\x6f\x75\156\x74\x5f\x68\x6f\154\144\x65\x72\137\x6e\141\x6d\x65\x2c\160\141\x79\x74\x6d\x5f\x6e\x6f\x2c\164\145\172\x5f\x6e\157\54\160\x68\x6f\x6e\x65\160\x61\x79\137\156\x6f\54\x64\x6f\x62\54\165\x73\x65\x72\137\x72\145\x66\x65\x72\x65\x6e\x63\x65\x5f\143\157\x64\x65\40\141\163\x20\162\x65\146\145\x72\x5f\143\x6f\144\145\54\162\145\x66\x66\145\x72\x65\144\x5f\143\x6f\x64\145\40\141\x73\40\162\145\x66\145\x72\x65\144\x5f\x66\162\x6f\x6d\137\x63\157\144\x65\54\x77\x61\154\154\x65\164\137\x70\x6f\x69\x6e\164\163\40\141\163\40\167\141\x6c\154\145\x74\x2c\x6b\171\143\137\163\164\x61\164\x75\x73\x2c\x69\163\137\143\x61\x70\x70\145\x64");
$details = $this->db->where("\165\x70\56\x6d\x6f\x62\151\x6c\x65\156\157", $mobile)->join("\x74\142\x6c\167\x61\x6c\154\x65\x74\40\x74\167", "\164\167\x2e\165\163\145\162\x5f\151\x64\75\40\x75\x70\56\x69\x64")->get("\165\163\145\162\x5f\160\162\157\x66\151\x6c\x65\40\x75\160");
if ($details->num_rows() > 0) {
$row = $details->row();
$db_pass = $row->password;
if ($password == $db_pass) {
if ($row->is_blocked == "\x31") {
$data["\162\x65\x73\160\x6f\x6e\x63\145"] = false;
$data["\145\162\162\157\x72"] = "\x41\x63\143\157\x75\156\164\x20\102\x6c\x6f\143\x6b\145\x64\56";
} else {
if ($row->login_status == "\x32") {
$data["\x72\x65\x73\x70\157\156\143\145"] = false;
$data["\145\x72\x72\157\162"] = "\131\157\165\x72\40\141\x63\143\x6f\x75\156\164\x20\143\165\x72\x72\145\x6e\x74\154\171\40\151\156\141\x63\x74\151\x76\145\x2e\120\x6c\145\141\x73\x65\40\x43\x6f\x6e\164\141\143\164\40\x41\x64\x6d\151\156";
} else {
$data["\162\x65\x73\x70\157\156\143\x65"] = true;
$data["\x64\141\x74\141"] = $row;
}
}
} else {
$data["\162\145\x73\x70\157\156\143\145"] = false;
$data["\145\x72\162\157\x72"] = "\x57\162\157\x6e\147\40\x50\x61\x73\x73\x77\x6f\162\144";
}
} else {
$data["\x72\145\x73\x70\157\156\x63\145"] = false;
$data["\x65\162\x72\157\162"] = "\x4d\157\x62\x69\154\x65\40\116\x75\x6d\x62\145\162\x20\144\x6f\x65\x73\x20\156\157\164\x20\x65\x78\151\x73\164";
}
}
echo json_encode($data);
}
public function setAsLogin() {
$email = $_POST["\145\x6d\x61\151\154"];
$q1 = "\x75\160\x64\141\x74\145\x20\165\x73\x65\x72\137\160\x72\x6f\146\x69\154\145\x20\163\x65\x74\x20\154\157\147\151\x6e\x5f\163\164\x61\164\165\163\75\x27\61\x27\40\167\150\145\162\145\x20\145\x6d\x61\151\154\x3d\47{$email}\47";
if (mysqli_query($this->conn, $q1)) {
echo json_encode(array("\163\x74\141\x74\165\x73" => "\x73\x75\x63\x63\x65\163\163"));
}
}
public function setAsLogout() {
$email = $_POST["\145\155\141\x69\x6c"];
$q1 = "\165\x70\x64\141\164\x65\40\x75\163\x65\162\137\160\x72\x6f\x66\x69\154\x65\x20\x73\145\164\40\154\x6f\x67\151\156\x5f\163\x74\141\164\x75\x73\x3d\x27\x30\47\40\x77\x68\145\x72\145\40\x65\x6d\x61\x69\x6c\x3d\x27{$email}\x27";
if (mysqli_query($this->conn, $q1)) {
echo json_encode(array("\x73\164\x61\164\165\x73" => "\163\165\x63\143\145\x73\x73"));
}
}
public function getNotice() {
$q = $this->db->query("\123\x65\154\145\143\164\40\x2a\40\x66\162\157\x6d\x20\x74\142\154\x4e\x6f\164\151\x63\x65\x20\x4f\x52\x44\105\x52\40\102\131\40\x60\164\142\x6c\x4e\157\164\151\143\x65\x60\x2e\x60\151\x64\x60\40\x41\x53\x43");
$status = "\163\x75\x63\x63\145\x73\x73";
$data = $q->result();
$obj = array("\x73\164\141\x74\165\x73" => $status, "\144\141\x74\141" => $data);
echo json_encode($obj);
}
public function getWalletAmount() {
$q = $this->db->query("\x53\x45\114\105\x43\x54\40\x2a\x20\106\122\x4f\x4d\x20\164\x62\x6c\x77\141\154\154\x65\x74\x20\167\150\145\162\x65\x20\x75\x73\x65\x72\137\x69\144\x3d\x27" . $this->input->post("\x75\163\145\x72\137\151\144") . "\47\40\114\111\x4d\111\124\40\61");
echo json_encode($q->result());
}
public function test() {
$m = 21;
$q1 = "\163\x65\154\x65\x63\x74\x20\52\40\x66\x72\x6f\x6d\x20\x74\x62\154\x53\x74\141\162\x6c\x69\156\145\40\167\150\x65\162\145\40\x69\x64\40\x3d\x20\47{$m}\x27";
$result = mysqli_query($this->conn, $q1) or die("\163\157\x6d\145\x20\145\x72\162");
$row = mysqli_fetch_assoc($result);
$st = $et = "\x73\137\x67\x61\155\x65\x5f\x74\151\155\x65";
$time = $row[$st];
echo strtotime(date("\x68\x3a\x69\40\x41")) . "\x3c\x68\162\76" . time();
}
public function insert_data_new() {
$status = '';
$result = mysqli_query($this->conn, "\123\x45\114\x45\x43\124\40\115\101\x58\50\151\x64\x29\x20\x61\x73\x20\143\40\106\122\x4f\x4d\40\164\x62\x6c\x67\x61\x6d\x65\x64\x61\164\141") or die("\163\x6f\155\x65\40\145\162\x72");
if ($row = mysqli_fetch_assoc($result)) {
$maxid = $row["\143"]++;
}
$jsonArr = $_POST["\144\x61\x74\x61"];
$group_value = $_POST["\147\162\x6f\165\160\137\x76\x61\154\x75\x65"];
$datetime = $_POST["\x64\x61\164\x65\164\x69\155\145"];
$total_point = $_POST["\x74\157\x74\141\154\137\x70\157\151\x6e\164"];
$is_homepage = $_POST["\x69\x73\x5f\150\157\x6d\x65\160\x61\147\x65"];
$digit_array = $_POST["\144\151\x67\151\x74\137\x61\x72\162\141\x79"]??'';
$bs_matka_id = $_POST["\142\163\137\x6d\x61\x74\x6b\141\137\x69\144"]??'';
$bs_game_name = $_POST["\142\x73\137\147\x61\155\x65\x5f\x6e\141\x6d\145"]??'';
if (empty($jsonArr)) {
$status = "\146\x61\x69\154\x65\x64\x31";
} else {
$json = json_decode($jsonArr);
foreach ($json as $js) {
$ponts = $i = $e = 0;
$points = json_decode($js->points);
$digits = json_decode($js->digits);
$bettype = json_decode($js->bettype);
$u = $js->user_id;
$m = $js->matka_id;
$game_name = json_decode($js->game_name);
$wallet_type = $js->wallet_type;
$dx = date("\x64\x2f\x6d\x2f\131");
$gm = $js->game_id;
if ($gm == 16) {
$gm = 2;
}
$q1 = "\x73\x65\x6c\145\x63\164\x20\x2a\40\146\x72\x6f\155\40\155\x61\164\153\x61\40\167\x68\x65\162\x65\40\x69\144\40\x3d\40\x27{$m}\47";
$st = date("\104") === "\123\141\x74" ? "\163\141\164\x5f\163\164\x61\162\x74\137\164\151\x6d\145" : (date("\x44") === "\x53\165\x6e" ? "\163\x74\x61\162\164\x5f\x74\x69\x6d\x65" : "\142\x69\144\137\x73\x74\x61\162\x74\137\164\x69\155\x65");
$et = date("\104") === "\123\141\x74" ? "\x73\141\x74\137\x65\156\x64\137\164\x69\155\x65" : (date("\104") === "\x53\165\156" ? "\x65\x6e\x64\x5f\x74\151\155\145" : "\x62\151\x64\x5f\x65\x6e\144\137\x74\151\x6d\x65");
$dd = mysqli_query($this->conn, $q1) or die("\x73\157\155\x65\40\145\x72\162\x31");
if ($row1 = mysqli_fetch_assoc($dd)) {
$a_time = strtotime(date("\x68\x3a\x69\40\x41"));
$time1 = $bettype[$i] == 0 ? $row1[$st] : $row1[$et];
$time = date("\x68\x3a\151\x20\x41", strtotime($time1));
if ($a_time <= strtotime($time)) {
$q2 = "\163\x65\154\x65\143\x74\x20\x2a\40\x66\x72\157\155\40\x74\142\x6c\167\141\x6c\x6c\145\164\40\x77\x68\x65\162\145\x20\x75\x73\145\x72\x5f\151\144\x20\x3d\40\47{$u}\47";
$dd1 = mysqli_query($this->conn, $q2) or die("\x73\x6f\155\x65\x20\145\x72\162\x32");
$row2 = mysqli_fetch_assoc($dd1);
if (count($row2) > 0) {
if ($wallet_type == "\x6d\141\151\x6e\x5f\167\141\154\154\x65\164\137\160\x6f\151\x6e\164\163") {
$wallet_amt = $row2["\155\141\151\156\x5f\x77\x61\154\154\145\x74\x5f\x70\157\x69\x6e\x74\x73"];
$capped_amount = $row2["\x63\x61\x70\160\x65\x64\x5f\155\x61\151\156\137\141\x6d\157\165\x6e\x74"];
} else {
$wallet_amt = $row2["\x77\x61\x6c\154\x65\x74\x5f\160\157\151\156\x74\163"];
$capped_amount = $row2["\x63\x61\x70\160\145\x64\137\x61\x6d\x6f\165\156\x74"];
}
$app_setting = $this->db->query("\x73\x65\x6c\x65\x63\164\40\x2a\40\x66\x72\157\x6d\40\x61\160\160\137\x73\x65\x74\164\x69\156\147")->row();
if ($wallet_amt - $capped_amount >= array_sum($points)) {
foreach ($points as $pa) {
$p = $points[$i];
$wallet_amt = $wallet_amt - $p;
if ($wallet_amt >= 0) {
$ponts+= $p;
$d = (string)$digits[$i];
$bt = $bettype[$i] == 0 ? "\x6f\160\145\x6e" : "\x63\154\x6f\163\145";
$gn = $game_name[$i];
$q = "\x69\x6e\x73\x65\162\x74\x20\x69\x6e\x74\x6f\40\164\142\154\147\141\155\145\x64\141\x74\x61\x20\50\x75\163\145\x72\137\x69\144\x2c\x6d\141\x74\153\141\137\151\x64\x2c\160\157\x69\x6e\164\163\54\144\151\147\151\164\163\x2c\x64\141\x74\x65\x2c\142\x65\164\x5f\x74\x79\x70\145\54\147\x61\x6d\x65\137\151\x64\x2c\x67\x61\x6d\145\x5f\x6e\x61\x6d\145\54\x77\x61\x6c\154\x65\164\137\x74\x79\160\x65\54\x67\162\157\x75\160\x5f\166\x61\x6c\165\x65\x2c\x64\151\x67\151\x74\137\x61\162\x72\141\171\x2c\x64\141\164\145\x74\x69\x6d\145\54\x74\x6f\x74\141\x6c\x5f\x70\x6f\151\x6e\164\54\142\163\137\147\x61\155\x65\x5f\x6e\141\155\145\54\142\163\x5f\155\x61\x74\x6b\141\x5f\x69\x64\51\x20\12\x20\40\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x76\141\154\x75\x65\x73\50\47{$u}\x27\x2c\x20\x27{$m}\47\54\x20\47{$p}\47\x2c\x20\47{$d}\x27\x2c\x20\47{$dx}\x27\54\x20\x27{$bt}\x27\54\x27{$gm}\x27\x2c\47{$gn}\x27\x2c\47{$wallet_type}\x27\x2c\x27{$group_value}\47\x2c\47{$digit_array}\x27\54\47{$datetime}\47\54\47{$total_point}\x27\54\x27{$bs_game_name}\47\54\x27{$bs_matka_id}\x27\x29";
$dd = mysqli_query($this->conn, $q) or die("\x73\157\155\x65\x20\145\x72\162\63");
$maxid++;
$qs = "\151\156\163\x65\x72\x74\40\x69\156\x74\157\x20\150\x69\163\164\x6f\162\171\x20\x28\165\163\x65\162\137\151\144\x2c\155\x61\164\153\141\137\151\x64\54\141\x6d\x74\x2c\144\x69\147\151\164\x73\x2c\142\151\144\137\x69\x64\x2c\x64\x61\x74\145\54\164\x79\160\x65\54\147\x61\x6d\x65\137\151\x64\x29\40\x76\x61\154\165\145\x73\50\47{$u}\47\x2c\x20\x27{$m}\x27\x2c\x20\x27{$p}\x27\54\40\x27{$d}\x27\54\47{$maxid}\x27\54\x20\47{$dx}\47\x2c\x20\x27\x64\47\x2c\47{$gm}\x27\x29";
$dds = mysqli_query($this->conn, $qs) or die("\163\x6f\155\x65\x20\145\162\x72\x34");
$i++;
}
}
} else {
$status = "\x63\x61\x70\x70\x65\144\137\141\x6d\157\x75\x6e\x74\137\x65\162\x72\157\162";
}
}
} else {
$status = "\164\151\155\x65\157\165\164";
}
}
if ($ponts > 0) {
if (count($row2) > 0) {
if ($wallet_type == "\155\x61\151\156\137\x77\141\154\154\145\x74\x5f\160\157\151\x6e\164\163") {
$main_wallet_pt = $row2["\x6d\x61\151\156\x5f\167\141\154\x6c\x65\x74\x5f\x70\x6f\x69\x6e\x74\x73"];
if ($ponts <= $main_wallet_pt) {
$remain_bid_amt = $ponts - $main_wallet_pt;
$q = "\165\x70\x64\141\164\x65\x20\x74\x62\x6c\167\141\154\x6c\x65\x74\40\163\x65\x74\40\155\141\151\x6e\x5f\x77\141\154\154\x65\x74\x5f\x70\x6f\x69\x6e\164\x73\x20\75\40\x6d\x61\151\x6e\137\x77\x61\x6c\x6c\x65\x74\137\x70\x6f\151\x6e\x74\x73\55\40{$ponts}\40\40\167\x68\x65\162\x65\x20\165\x73\x65\x72\137\x69\144\x20\75\40\x27{$u}\47";
$dd = mysqli_query($this->conn, $q) or die("\163\157\x6d\x65\40\145\x72\x72\x35");
}
} else {
$wallet_points_pt = $row2["\167\141\x6c\x6c\145\164\137\160\x6f\x69\156\164\163"];
if ($ponts <= $wallet_points_pt) {
$q1 = "\165\160\144\141\164\145\40\164\142\x6c\167\x61\154\154\x65\164\40\163\145\x74\40\x77\141\x6c\x6c\x65\x74\137\x70\157\151\x6e\x74\163\x20\75\x20\x77\141\x6c\154\x65\164\137\x70\157\151\x6e\x74\x73\x2d{$ponts}\40\x77\150\145\162\x65\x20\165\163\x65\162\x5f\x69\x64\x20\75\40\47{$u}\47";
$dd = mysqli_query($this->conn, $q1) or die("\x73\x6f\x6d\145\40\x65\x72\162\x35");
}
}
} else {
$q = "\x69\x6e\x73\145\162\164\x20\x69\156\x74\x6f\40\x74\142\x6c\167\x61\x6c\154\x65\164\40\x28\x77\x61\x6c\x6c\145\x74\x5f\x70\x6f\151\x6e\164\x73\x2c\x20\x75\163\145\162\137\x69\144\x29\x20\x56\x41\x4c\125\x45\x53\40\x28\x30\54\x20\x27{$u}\47\51";
$dd = mysqli_query($this->conn, $q) or die("\163\157\x6d\x65\x20\x65\x72\162\x35");
}
}
}
if ($dds === true && $status != "\164\x69\x6d\x65\157\x75\x74" && $status != "\x63\x61\160\160\145\x64\x5f\141\155\x6f\165\156\164\x5f\145\x72\162\x6f\x72") {
$status = "\x73\x75\x63\143\145\163\x73";
$dt = array("\x73\164\x61\x74\x75\x73" => $status);
echo json_encode($dt);
return false;
} elseif ($status == "\x63\141\160\x70\x65\144\x5f\x61\155\x6f\165\156\x74\x5f\145\162\162\157\162") {
$status = "\101\155\157\x75\x6e\x74\x20\50" . $capped_amount . "\x29\x20\151\x73\x20\x63\x61\160\160\145\x64\x2e\x20\103\x6f\x6e\164\x61\x63\164\40\x61\144\155\151\156";
$dt = array("\x73\x74\x61\164\x75\163" => $status);
echo json_encode($dt);
return false;
} elseif ($status == null) {
$status = "\x66\141\151\x6c\145\x64";
}
}
$dt = array("\x73\x74\141\x74\165\163" => $status);
echo json_encode($dt);
}
public function checkBidAmount_marketWise_old() {
$status = '';
$result = mysqli_query($this->conn, "\x53\x45\114\x45\x43\x54\40\x4d\101\x58\50\x69\x64\x29\x20\x61\x73\40\x63\x20\106\x52\x4f\x4d\40\164\142\x6c\x67\x61\x6d\145\x64\141\164\x61") or die("\163\x6f\155\x65\40\145\162\x72");
if ($row = mysqli_fetch_assoc($result)) {
$maxid = $row["\x63"]++;
}
$jsonArr = $_POST["\x64\x61\164\141"];
$dds = FALSE;
if (empty($jsonArr)) {
$status = "\146\x61\x69\154\145\x64\61";
} else {
$array = json_decode($jsonArr, true);
$user_id = $array[0]["\165\x73\145\162\137\151\144"];
$matka_id = $array[0]["\155\141\164\x6b\141\x5f\x69\144"];
$game_id = $array[0]["\147\141\155\x65\x5f\151\x64"];
$game_date = $array[0]["\x67\141\x6d\145\137\144\141\164\x65"];
$digits = json_decode($array[0]["\x64\x69\147\151\x74\163"], true);
$points = json_decode($array[0]["\160\x6f\151\156\164\163"], true);
$mix_bid = $this->db->select("\155\x61\x78\137\142\x69\x64\x5f\141\x6d\157\x75\156\x74\x20\141\x73\x20\x6d\x61\x78\137\x62\151\144")->get("\x61\x70\160\x5f\x73\145\x74\164\151\x6e\x67")->row()->max_bid??0;
$response = true;
$status = '';
foreach ($digits as $index => $digit) {
foreach ($points as $key => $point) {
if ($index == $key) {
$this->db->select("\x49\x46\x28\123\x55\115\x28\x70\157\151\x6e\164\163\x29\40\x3e\40\60\54\40\x53\x55\x4d\x28\160\x6f\151\x6e\x74\163\51\x20\53\40{$point}\54\40{$point}\x29\x20\101\x53\x20\164\157\164\141\154\x5f\166\141\154\x75\145")->where(array("\x75\x73\145\x72\x5f\x69\144" => $user_id, "\x64\141\164\x65" => $game_date, "\x6d\x61\164\153\x61\x5f\x69\144" => $matka_id));
$this->db->where("\144\x69\x67\151\x74\163", $digit);
$query = $this->db->get("\x74\x62\154\147\x61\155\x65\144\x61\x74\141")->row()->total_value??0;
if ($query > $mix_bid) {
$response = false;
$status = "\114\x69\155\x69\164\x20\145\x78\143\x65\x65\144\x20\151\x6e\40\144\x69\147\x69\164\40{$digit}";
}
}
}
}
$dt = array("\x72\145\163\x70\x6f\156\163\145" => $response, "\x73\x74\141\x74\165\x73" => $status);
echo json_encode($dt);
}
}
public function checkBidAmount_marketWise() {
$status = '';
$jsonArr = $_POST["\144\141\x74\141"]??null;
if (empty($jsonArr)) {
echo json_encode(array("\162\x65\x73\160\x6f\x6e\x73\145" => false, "\163\x74\141\164\x75\163" => "\146\141\x69\154\x65\x64\61"));
return;
}
$array = json_decode($jsonArr, true);
$user_id = $array[0]["\x75\163\x65\x72\137\x69\144"];
$matka_id = $array[0]["\x6d\141\164\153\x61\x5f\151\144"];
$game_id = $array[0]["\x67\141\155\145\137\x69\144"];
$game_date = $array[0]["\147\x61\x6d\x65\x5f\144\141\x74\145"];
$digits = json_decode($array[0]["\x64\x69\x67\151\164\163"], true);
$points = json_decode($array[0]["\x70\157\x69\156\164\163"], true);
$mix_bid = $this->db->select("\x6d\141\x78\x5f\142\151\x64\137\x61\x6d\x6f\x75\156\x74\x20\x61\x73\40\x6d\x61\170\x5f\x62\151\x64")->get("\x61\160\x70\137\x73\145\164\x74\x69\156\147")->row()->max_bid??0;
$this->db->select("\144\x69\147\151\x74\163\54\x20\x53\125\115\50\x70\x6f\x69\x6e\164\163\x29\x20\x61\163\40\x74\x6f\164\141\x6c\x5f\x70\x6f\151\x6e\164\163");
$this->db->where(array("\165\x73\145\162\137\151\x64" => $user_id, "\144\x61\x74\x65" => $game_date, "\155\141\164\x6b\x61\137\151\144" => $matka_id));
$this->db->group_by("\x64\x69\147\x69\x74\x73");
$existing_bids = $this->db->get("\x74\x62\x6c\x67\x61\155\x65\x64\141\164\x61")->result_array();
$existing_bids_map = array();
foreach ($existing_bids as $bid) {
$existing_bids_map[$bid["\x64\151\x67\151\x74\x73"]] = $bid["\164\x6f\164\141\154\x5f\x70\x6f\x69\x6e\x74\163"];
}
$response = true;
$status = '';
foreach ($digits as $index => $digit) {
$current_points = $points[$index]??0;
$current_total = ($existing_bids_map[$digit]??0) + $current_points;
if ($current_total > $mix_bid) {
$response = false;
$status = "\x4c\x69\155\x69\x74\40\145\x78\143\145\145\x64\40\151\x6e\x20\144\x69\147\151\164\x20{$digit}";
break;
}
}
echo json_encode(array("\x72\145\x73\x70\157\156\x73\x65" => $response, "\x73\164\x61\x74\x75\x73" => $status));
}
public function insert_data() {
$status = '';
$result = mysqli_query($this->conn, "\123\105\x4c\105\103\x54\x20\115\101\130\50\151\144\51\x20\x61\x73\x20\143\x20\x46\122\x4f\x4d\x20\164\142\x6c\x67\141\155\x65\x64\x61\164\141") or die("\163\157\155\145\x20\x65\x72\162");
if ($row = mysqli_fetch_assoc($result)) {
$maxid = $row["\x63"]++;
}
$jsonArr = $_POST["\144\141\x74\141"];
if (empty($jsonArr)) {
$status = "\146\x61\151\x6c\145\x64\61";
} else {
$bid_allowed = true;
$json = json_decode($jsonArr);
foreach ($json as $js) {
$ponts = $i = $e = 0;
$points = json_decode($js->points);
$digits = json_decode($js->digits);
$bettype = json_decode($js->bettype);
$u = $js->user_id;
$m = $js->matka_id;
$dx = date("\x64\x2f\x6d\x2f\131");
$gm = $js->game_id;
$wallet_type = $js->wallet_type;
if ($gm == 16 || $gm == 17) {
$gm = 2;
}
if ($m <= 20) {
$q1 = "\163\x65\154\145\x63\164\x20\52\40\146\x72\x6f\x6d\40\155\x61\x74\x6b\x61\40\167\x68\x65\162\x65\x20\151\144\x20\x3d\40\47{$m}\x27";
$st = date("\104") === "\123\141\x74" ? "\x73\141\164\x5f\x73\x74\x61\x72\x74\x5f\x74\x69\x6d\145" : (date("\x44") === "\123\x75\156" ? "\163\x74\x61\162\x74\x5f\x74\x69\155\x65" : "\142\x69\144\x5f\163\164\x61\162\164\137\164\151\x6d\x65");
$et = date("\104") === "\x53\141\164" ? "\163\141\x74\x5f\145\156\x64\137\164\x69\x6d\145" : (date("\x44") === "\123\165\156" ? "\x65\156\144\137\x74\x69\155\x65" : "\142\151\x64\137\145\x6e\144\x5f\164\x69\155\x65");
} else {
$q1 = "\x73\145\x6c\x65\143\x74\x20\52\40\146\162\x6f\x6d\40\x74\142\x6c\x53\164\x61\x72\154\151\x6e\145\40\167\x68\x65\x72\x65\40\151\144\40\75\40\47{$m}\x27";
$st = $et = "\x73\137\x67\x61\x6d\x65\137\x74\x69\x6d\145";
}
$dd = mysqli_query($this->conn, $q1) or die("\163\157\x6d\x65\40\145\x72\162\x31");
if ($row1 = mysqli_fetch_assoc($dd)) {
$stime = $row1[$st];
$etime = $row1[$et];
$today = date("\x64\x2f\155\x2f\x59");
if ($dx == $today) {
$a_time = strtotime(date("\131\55\155\55\144\x20\110\72\151\x3a\163"));
$act_time = strtotime(date("\131\55\x6d\x2d\x64\x20\x48\72\151\72\x73", strtotime($bettype[$i] == 0 ? $stime : $etime)));
$diff_time = $act_time - $a_time;
if ($diff_time < 0) {
$bid_allowed = false;
}
} else {
$a_time1 = date("\x59\x2d\155\x2d\144\40\110\72\151\x3a\x73", strtotime($dx));
$a_time = strtotime($a_time1);
}
$a_time = strtotime(date("\x68\x3a\x69\x20\x41"));
$time1 = $bettype[$i] == 0 ? $row1[$st] : $row1[$et];
$time = date("\x68\x3a\151\40\101", strtotime($time1));
if ($bid_allowed) {
if ($a_time <= strtotime($time)) {
$q2 = "\x73\145\x6c\145\x63\x74\x20\52\x20\146\162\157\155\x20\164\x62\x6c\x77\141\x6c\154\145\164\x20\x77\x68\145\162\145\x20\165\163\145\x72\x5f\x69\x64\x20\75\x20\x27{$u}\x27";
$dd1 = mysqli_query($this->conn, $q2) or die("\163\x6f\x6d\x65\x20\x65\x72\162\x32");
$row2 = mysqli_fetch_assoc($dd1);
if (count($row2) > 0) {
if ($wallet_type == "\167\141\154\x6c\x65\x74\x5f\x70\157\x69\156\x74\x73") {
$wallet_amt = $row2["\x77\141\x6c\x6c\x65\164\137\x70\157\151\156\x74\163"];
} else {
$wallet_amt = $row2["\x6d\x61\x69\x6e\137\x77\x61\x6c\x6c\x65\x74\137\160\157\x69\156\164\x73"];
$wallet_type = "\x6d\141\151\156\x5f\167\141\154\154\x65\x74\137\x70\157\x69\156\x74\163";
}
foreach ($points as $pa) {
$p = $points[$i];
$wallet_amt = $wallet_amt - $p;
if ($wallet_amt >= 0) {
$ponts+= $p;
$d = (string)$digits[$i];
$bt = $bettype[$i] == 0 ? "\x6f\160\x65\x6e" : "\x63\154\157\x73\145";
$q = "\151\156\x73\x65\162\x74\40\151\x6e\164\x6f\40\164\x62\154\x67\x61\x6d\x65\x64\x61\x74\x61\40\50\x75\163\145\162\x5f\x69\x64\x2c\x6d\141\x74\153\141\137\151\x64\54\160\157\151\156\x74\163\x2c\x64\x69\147\x69\164\163\x2c\x64\x61\x74\145\54\x62\x65\164\x5f\x74\x79\160\x65\x2c\147\141\155\145\137\151\x64\54\167\x61\x6c\x6c\145\164\137\164\171\160\x65\x29\40\x76\141\x6c\x75\x65\x73\x28\47{$u}\x27\x2c\40\x27{$m}\x27\54\40\x27{$p}\47\54\x20\47{$d}\47\x2c\x20\x27{$dx}\47\54\40\x27{$bt}\47\54\47{$gm}\47\x2c\47{$wallet_type}\47\51";
$dd = mysqli_query($this->conn, $q) or die("\x73\157\x6d\x65\x20\145\162\x72\63");
$maxid++;
$qs = "\151\x6e\163\x65\x72\164\x20\151\156\164\x6f\40\x68\x69\x73\x74\157\162\171\x20\50\165\x73\x65\x72\137\x69\x64\54\x6d\x61\164\153\141\x5f\151\144\54\141\155\164\x2c\x64\151\147\x69\164\163\54\142\x69\144\137\151\x64\x2c\144\141\164\x65\x2c\164\171\160\x65\x2c\x67\141\x6d\x65\137\151\144\x29\40\x76\141\x6c\x75\x65\x73\50\x27{$u}\x27\x2c\40\47{$m}\47\x2c\x20\47{$p}\47\x2c\x20\x27{$d}\47\x2c\47{$maxid}\47\54\x20\47{$dx}\47\54\40\47\x64\x27\x2c\x27{$gm}\x27\51";
$dds = mysqli_query($this->conn, $qs) or die("\163\x6f\x6d\145\x20\145\162\x72\64");
$i++;
}
}
}
} else {
$status = "\164\x69\x6d\145\157\165\x74";
}
} else {
$status = "\x74\151\155\145\x6f\x75\x74";
}
}
if ($ponts > 0) {
if (count($row2) > 0) {
if ($wallet_type == "\167\x61\x6c\154\x65\x74\137\x70\x6f\151\x6e\x74\x73") {
$q = "\x75\x70\144\141\164\145\x20\164\142\154\x77\x61\154\154\x65\x74\x20\163\145\164\x20\x77\141\x6c\x6c\145\x74\x5f\x70\157\x69\156\x74\163\40\75\x20\x77\141\154\x6c\x65\164\137\160\157\151\156\164\x73\55{$ponts}\40\167\150\145\x72\x65\x20\x75\x73\x65\x72\137\x69\144\40\x3d\x20\x27{$u}\x27";
} else {
$q = "\165\160\144\141\x74\145\40\x74\142\154\167\x61\x6c\x6c\x65\x74\x20\163\145\x74\40\155\141\x69\x6e\137\x77\x61\x6c\x6c\x65\164\137\160\x6f\151\x6e\164\163\x20\75\40\155\141\151\156\x5f\167\x61\x6c\x6c\145\x74\x5f\160\x6f\151\x6e\x74\x73\x2d{$ponts}\x20\x77\x68\x65\162\x65\x20\165\163\x65\162\137\x69\144\40\x3d\x20\47{$u}\47";
}
} else {
if ($wallet_type == "\x77\141\x6c\x6c\x65\164\x5f\x70\x6f\151\156\164\x73") {
$q = "\151\156\x73\145\162\164\40\151\156\x74\x6f\40\x74\x62\x6c\x77\141\154\154\145\x74\x20\50\x77\141\154\x6c\x65\164\137\160\157\x69\x6e\x74\163\x2c\40\x75\x73\145\162\x5f\x69\x64\x29\40\x56\x41\114\x55\x45\x53\40\x28\60\54\x20\x27{$u}\x27\x29";
} else {
$q = "\151\156\x73\145\x72\x74\40\151\156\164\x6f\x20\x74\142\154\x77\x61\154\x6c\145\x74\40\x28\155\x61\x69\x6e\x5f\167\x61\154\x6c\x65\x74\137\160\x6f\x69\156\164\163\54\40\x75\x73\145\x72\137\x69\x64\51\40\x56\x41\114\x55\105\123\x20\x28\60\x2c\x20\x27{$u}\47\51";
}
}
$dd = mysqli_query($this->conn, $q) or die("\163\157\155\x65\40\145\x72\x72\x35");
}
}
if ($dds === true && $status != "\x74\151\x6d\x65\157\165\164") {
$status = "\x73\x75\143\143\145\x73\163";
$dt = array("\x73\x74\141\x74\165\163" => $status);
echo json_encode($dt);
return false;
} elseif ($status == null) {
$status = "\146\x61\x69\x6c\x65\144";
}
}
$dt = array("\163\x74\x61\x74\165\x73" => $status);
echo json_encode($dt);
}
public function getMobile() {
$q = "\x73\145\x6c\x65\143\164\40\x6d\157\x62\x69\x6c\x65\x20\146\x72\x6f\155\40\x73\x69\x74\145\x5f\x63\157\156\146\x69\x67";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$data = $result->fetch_assoc();
$data["\143\x6f\165\156\x74"] = 22;
$data["\x73\164\141\162\x6c\151\x6e\145"] = "\150\164\164\x70\163\72\x2f\57\167\167\167\56\x62\151\156\160\154\165\x73\56\151\156";
$data["\143\x68\x61\162\164\x31"] = "\150\164\x74\160\x73\72\57\x2f\163\145\x72\x76\x65\162\x61\x64\x64\x61\56\143\157\155\57\142\151\154\154\x69\156\147";
$data["\x63\x68\141\162\164\x32"] = "\150\164\164\160\163\72\57\x2f\167\167\167\x2e\x67\x6f\x6f\147\154\x65\56\x63\x6f\x6d";
} else {
$data["\155\157\x62\x69\x6c\x65"] = "\130\130\x58\130\x58\x58\x58\130\130\x58\130\130";
$data["\143\157\x75\x6e\164"] = 22;
$data["\163\164\x61\x72\154\151\156\x65"] = "\x68\164\164\x70\x73\72\57\57\167\167\167\x2e\x62\x69\156\x70\x6c\165\x73\56\151\x6e";
$data["\x63\150\141\162\x74\x31"] = "\x68\x74\x74\x70\163\x3a\57\x2f\x73\145\x72\166\x65\162\141\x64\x64\x61\x2e\143\157\x6d\57\x62\151\x6c\154\x69\x6e\x67";
$data["\x63\150\x61\x72\x74\62"] = "\x68\164\164\160\163\x3a\x2f\57\167\x77\x77\56\x67\x6f\157\147\x6c\x65\x2e\143\157\155";
}
echo json_encode($data);
}
public function insert_sangam_data() {
$result = mysqli_query($this->conn, "\x53\105\114\x45\103\x54\x20\x4d\101\130\x28\151\144\51\40\x61\163\40\143\40\106\122\117\x4d\40\164\142\154\147\x61\155\x65\x64\141\164\x61") or die("\163\x6f\x6d\x65\40\x65\x72\162");
$a_time = strtotime(date("\x68\72\x69\40\101"));
if ($row = mysqli_fetch_assoc($result)) {
$maxid = $row["\x63"]++;
}
$jsonArr = $_POST["\x64\141\x74\x61"];
if (empty($jsonArr)) {
$status = "\146\141\151\x6c\x65\144\x31";
} else {
$json = json_decode($jsonArr);
foreach ($json as $js) {
$ponts = $i = $e = 0;
$points = json_decode($js->points);
$digits = json_decode($js->digits);
$bettype = json_decode($js->bettype);
$u = $js->user_id;
$m = $js->matka_id;
$dx = date("\144\x2f\x6d\x2f\x59");
$gm = $js->game_id;
$q1 = "\163\145\154\x65\x63\164\x20\52\40\146\162\157\155\x20\x6d\x61\164\153\x61\x20\x77\x68\x65\162\145\x20\x69\x64\40\75\40\x27{$m}\x27";
$dd = mysqli_query($this->conn, $q1) or die("\x73\x6f\x6d\x65\x20\145\x72\x72\61");
$st = date("\104") === "\123\141\164" ? "\163\x61\164\x5f\x73\164\141\162\164\137\164\151\x6d\x65" : (date("\x44") === "\x53\165\156" ? "\163\x74\x61\x72\x74\x5f\164\x69\x6d\145" : "\142\151\144\x5f\163\164\x61\162\x74\137\x74\x69\x6d\145");
$et = date("\x44") === "\x53\x61\x74" ? "\x73\x61\164\137\145\156\144\x5f\x74\151\x6d\x65" : (date("\x44") === "\123\165\x6e" ? "\x65\156\x64\x5f\164\x69\x6d\145" : "\x62\151\x64\137\145\x6e\144\137\x74\151\x6d\145");
if ($row1 = mysqli_fetch_assoc($dd)) {
$time1 = $bettype[$i] == 0 ? $row1[$st] : $row1[$et];
$time = date("\150\72\151\x20\x41", strtotime($time1));
if ($a_time <= strtotime($time) || strtotime(date("\x59\x2d\155\x2d\x64")) < strtotime($dx)) {
$q2 = "\163\x65\x6c\x65\x63\x74\x20\52\x20\x66\x72\157\x6d\x20\164\x62\154\167\x61\154\x6c\145\x74\x20\x77\x68\145\x72\x65\40\165\163\145\x72\x5f\151\144\x20\75\40\47{$u}\47";
$dd1 = mysqli_query($this->conn, $q2) or die("\x73\x6f\x6d\145\x20\x65\162\162\x32");
$row2 = mysqli_fetch_assoc($dd1);
if (count($row2) > 0) {
$wallet_amt = $row2["\x77\141\154\x6c\145\164\137\160\157\x69\x6e\164\x73"];
foreach ($points as $pa) {
$p = $points[$i];
$wallet_amt = $wallet_amt - $p;
if ($wallet_amt >= 0) {
$ponts+= $p;
$d = (string)$digits[$i];
$bt = (string)$bettype[$i];
$q = "\151\156\163\145\162\x74\x20\x69\x6e\164\x6f\x20\164\x62\x6c\x67\141\155\x65\144\141\164\141\x20\x28\x75\163\x65\162\x5f\x69\x64\x2c\x6d\141\164\153\141\x5f\x69\144\x2c\x70\x6f\151\156\164\x73\x2c\x64\151\x67\x69\164\163\54\x64\x61\164\x65\x2c\142\x65\x74\x5f\x74\x79\160\x65\54\147\x61\155\x65\x5f\151\x64\x29\40\166\x61\154\x75\145\x73\50\47{$u}\47\x2c\x20\47{$m}\47\54\40\47{$p}\47\54\x20\47{$d}\47\x2c\x20\x27{$dx}\47\54\x20\x27{$bt}\x27\54\47{$gm}\x27\x29";
$dd = mysqli_query($this->conn, $q) or die("\163\x6f\x6d\x65\x20\x65\x72\x72\63");
$maxid++;
$qs = "\151\x6e\163\145\162\164\40\151\x6e\164\157\x20\x68\151\163\x74\x6f\162\x79\40\50\165\163\145\162\x5f\151\x64\x2c\155\141\x74\x6b\x61\x5f\x69\144\x2c\x61\x6d\x74\54\144\x69\147\151\x74\x73\x2c\x62\151\x64\x5f\151\144\54\x64\141\164\145\54\164\171\160\x65\x2c\x67\141\155\145\137\x69\x64\x29\40\166\141\154\165\145\x73\x28\x27{$u}\x27\54\40\47{$m}\x27\x2c\40\x27{$p}\x27\x2c\x20\x27{$d}\x27\x2c\x27{$maxid}\x27\54\40{$dx}\54\40\47\144\x27\54\47{$gm}\x27\51";
$dds = mysqli_query($this->conn, $qs) or die("\x73\157\155\145\x20\x65\162\x72\64");
$i++;
}
}
}
} else {
$status = "\x74\x69\x6d\145\x6f\x75\x74";
}
}
if ($ponts > 0) {
if (count($row2) > 0) {
$q = "\x75\x70\144\x61\164\x65\40\164\142\154\x77\x61\154\154\145\164\40\x73\145\x74\40\x77\x61\154\x6c\145\x74\137\160\x6f\151\156\x74\163\40\x3d\x20\167\x61\154\154\145\164\137\x70\x6f\x69\156\x74\163\55{$ponts}\40\167\x68\x65\x72\x65\40\x75\x73\x65\162\x5f\151\x64\40\x3d\40\47{$u}\x27";
} else {
$q = "\x69\156\163\145\x72\164\x20\151\x6e\164\x6f\x20\164\142\154\x77\141\x6c\x6c\145\x74\40\50\167\x61\154\154\x65\x74\137\x70\157\151\156\164\x73\54\x20\x75\x73\x65\x72\x5f\x69\144\51\x20\126\x41\x4c\125\105\x53\40\x28\60\54\x20\x27{$u}\x27\51";
}
$dd = mysqli_query($this->conn, $q) or die("\163\157\x6d\x65\40\145\162\x72\x35");
}
}
if ($dds === true && $status != "\x74\151\x6d\145\x6f\x75\164") {
$status = "\x73\165\143\143\145\163\163";
$dt = array("\163\x74\141\x74\x75\x73" => $status);
echo json_encode($dt);
return false;
} elseif ($status == null) {
$status = "\x66\x61\x69\x6c\x65\x64";
} elseif ($status == "\164\151\x6d\x65\157\165\164") {
$status = "\x74\x69\155\145\157\165\x74";
}
}
$dt = array("\163\164\141\164\x75\x73" => $status);
echo json_encode($dt);
}
public function get_history() {
$data = array();
$user_id = $this->input->post("\165\163\x65\x72\x5f\151\x64");
$page = $this->input->post("\160\141\x67\x65") ??1;
$date_from = $this->input->post("\144\x61\164\145\x5f\x66\162\x6f\x6d") ??date("\x64\57\x6d\57\x59");
$date_to = $this->input->post("\x64\141\x74\x65\137\x74\157") ??date("\x64\x2f\x6d\x2f\131");
$key = explode("\x2f", $date_from);
$key_to = explode("\57", $date_to);
$date_from = $key[2] . "\55" . $key[1] . "\55" . $key[0];
$date_to = $key_to[2] . "\x2d" . $key_to[1] . "\x2d" . $key_to[0];
$limit = 10;
$offset = ($page - 1) * $limit;
$data["\x72\x65\x73\x70\157\156\143\x65"] = true;
$this->db->select("\164\x62\154\x67\x61\155\145\144\x61\x74\141\56\x2a\x2c\40\x74\x72\151\155\x28\155\x61\164\x6b\x61\56\156\141\155\145\x29\x61\x73\40\156\x61\155\145");
$this->db->from("\x74\142\x6c\147\141\x6d\145\x64\141\x74\x61");
$this->db->join("\x6d\x61\164\x6b\141", "\155\141\x74\153\141\x2e\151\144\x20\75\x20\x74\142\x6c\147\x61\x6d\x65\144\x61\x74\x61\x2e\x6d\x61\164\x6b\x61\x5f\x69\x64");
$this->db->where("\165\163\x65\x72\x5f\x69\x64", $user_id);
$this->db->where("\x6d\141\x74\x6b\141\x5f\151\144\x20\74\40", 100);
$this->db->where("\104\101\124\x45\50\x74\151\155\x65\x29\40\102\105\124\x57\x45\x45\116\40\47{$date_from}\x27\x20\x41\116\x44\40\x27{$date_to}\47");
$this->db->limit($limit, $offset);
$this->db->order_by("\x69\144", "\104\x45\x53\x43");
$q = $this->db->get();
$data["\144\x61\164\141"] = $total = $q->result();
$this->db->select("\164\142\154\x67\141\155\145\144\x61\x74\x61\56\x2a\54\x20\164\x72\151\155\50\x6d\141\x74\x6b\141\56\x6e\x61\155\x65\51\141\163\x20\156\141\155\145");
$this->db->from("\164\142\x6c\147\x61\x6d\x65\x64\141\164\141");
$this->db->join("\x6d\141\164\153\141", "\x6d\141\164\153\141\56\x69\x64\40\75\x20\x74\142\x6c\147\141\x6d\145\144\x61\x74\x61\56\155\141\164\153\141\137\151\144");
$this->db->where("\x75\x73\x65\162\137\151\144", $user_id);
$this->db->where("\x6d\x61\164\153\x61\x5f\x69\x64\40\74\40", 100);
$this->db->where("\x44\101\x54\105\x28\164\x69\x6d\x65\51\40\x42\105\x54\127\x45\105\x4e\40\47{$date_from}\x27\40\x41\116\104\40\47{$date_to}\x27");
$this->db->order_by("\151\144", "\104\105\123\103");
$q1 = $this->db->get();
$data["\x74\x6f\x74\x61\x6c\137\144\x61\x74\x61"] = $q1->num_rows();
echo json_encode($data);
}
public function getBidHistory() {
$us_id = $_POST["\165\x73\x5f\151\x64"];
$matka_id = $_POST["\x6d\x61\x74\x6b\141\137\x69\x64"];
$play_for = date("\131\x2d\155\x2d\x64");
$play_on = '';
if ($matka_id < 21) {
$odd_even = "\x74\x62\x6c\x67\x61\x6d\x65\x64\x61\164\141\x2e\x69\x64\54\164\x62\154\x67\141\x6d\x65\144\141\164\x61\56\165\x73\145\x72\x5f\151\144\x2c\164\x62\x6c\x67\141\155\145\x64\x61\x74\x61\x2e\x6d\x61\x74\x6b\141\x5f\x69\144\54\164\142\154\x67\141\155\x65\x64\141\x74\x61\56\x70\x6f\x69\x6e\164\x73\54\x74\142\154\147\141\155\x65\144\x61\x74\x61\56\142\145\164\137\164\171\x70\145\x2c\164\142\154\x67\x61\x6d\x65\x64\x61\x74\141\x2e\x64\x61\x74\145\x2c\164\x62\154\147\141\x6d\x65\144\141\x74\x61\56\164\x69\155\x65\54\164\142\154\x67\x61\x6d\x65\x64\141\x74\141\56\144\x69\147\151\164\163\x2c\x74\x62\x6c\147\141\155\x65\144\x61\164\141\x2e\x67\x61\155\x65\137\x69\x64\x2c\x74\142\154\147\141\x6d\145\144\141\x74\x61\56\x73\164\141\x74\x75\163\54\164\142\x6c\147\141\x6d\x65\144\x61\164\141\x2e\167\141\154\154\145\x74\137\x74\171\160\x65\x2c\x6d\141\164\x6b\141\x2e\156\x61\x6d\145\40";
$q = "\x73\145\x6c\x65\143\x74\x20" . $odd_even . "\x20\x66\x72\157\155\x20\40\x74\x62\x6c\x67\141\155\x65\144\x61\164\141\40\x4a\117\111\116\40\x6d\141\x74\x6b\141\40\x4f\116\40\x6d\x61\x74\153\141\56\151\x64\x3d\x74\142\154\147\x61\x6d\x65\144\141\x74\141\56\155\141\164\x6b\x61\x5f\151\144\40\x77\x68\x65\x72\145\x20\x74\142\x6c\x67\141\155\x65\144\141\164\141\56\x75\x73\145\x72\x5f\151\144\75{$us_id}\x20\141\x6e\144\x20\x74\x62\x6c\147\141\x6d\145\144\141\x74\x61\x2e\x6d\141\x74\x6b\141\x5f\x69\144\75{$matka_id}\x20\117\122\x44\x45\122\40\x42\131\40\164\x69\155\x65\40\104\105\x53\x43";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$x["\160\154\141\171\137\146\x6f\x72"] = $row["\x74\151\x6d\145"];
$x["\x70\154\x61\x79\x5f\157\x6e"] = $row["\x74\x69\155\145"];
$newDate = date("\x6c", strtotime($x["\160\x6c\x61\171\137\x6f\156"]));
$x["\x64\x61\171"] = $newDate;
$r = array_merge($row, $x);
$data[] = $r;
}
} else {
$data[] = null;
}
} else {
$d = "\x73\145\154\x65\x63\x74\x20\x74\142\x6c\x67\x61\155\x65\144\x61\164\141\x2e\151\x64\54\x74\x62\x6c\147\x61\155\x65\x64\141\x74\x61\x2e\165\163\145\162\x5f\151\x64\54\x74\142\x6c\x67\141\155\x65\144\x61\164\x61\56\x6d\141\164\x6b\141\x5f\151\144\54\x74\142\x6c\147\x61\x6d\145\x64\141\164\141\x2e\160\157\x69\x6e\x74\163\x2c\x74\x62\x6c\147\x61\155\145\144\x61\164\141\x2e\x62\145\x74\137\164\x79\160\145\54\x74\x62\x6c\x67\141\x6d\x65\x64\x61\x74\x61\56\x64\x61\x74\x65\54\x74\142\154\147\x61\x6d\145\144\x61\164\x61\56\164\x69\155\145\x2c\164\x62\x6c\147\x61\x6d\x65\144\141\x74\141\56\144\x69\x67\x69\164\163\54\164\x62\154\x67\x61\x6d\145\x64\141\x74\141\56\x67\141\155\x65\137\151\144\54\x74\x62\154\147\141\155\x65\144\x61\164\141\56\167\141\x6c\x6c\x65\x74\137\x74\171\x70\x65\54\x74\142\x6c\x67\x61\x6d\145\x64\141\x74\x61\x2e\x73\164\141\x74\165\x73\x2c\x74\142\x6c\123\164\141\162\x6c\x69\156\x65\56\163\x5f\147\141\155\x65\137\164\151\155\145\40\146\162\x6f\x6d\x20\x74\142\x6c\x67\x61\x6d\145\x64\141\x74\141\54\164\142\x6c\x53\164\x61\162\x6c\x69\156\145\40\167\x68\x65\162\145\x20\x20\x74\x62\154\147\141\155\145\x64\x61\x74\x61\x2e\x75\163\x65\162\x5f\151\x64\x3d{$us_id}\40\x41\116\104\40\164\x62\154\x67\x61\155\145\x64\x61\164\141\56\155\x61\164\x6b\x61\137\x69\144\75\164\x62\x6c\123\x74\141\162\x6c\x69\156\145\56\x69\x64\40\101\x4e\104\40\x6d\141\x74\153\x61\137\x69\144\x3e\x27\61\x35\x27\40\117\122\x44\x45\122\x20\102\x59\x20\x74\x69\x6d\x65\40\x44\105\x53\103";
$result1 = mysqli_query($this->conn, $d);
if ($result1->num_rows > 0) {
while ($row1 = $result1->fetch_assoc()) {
$x["\160\154\x61\171\x5f\x66\x6f\x72"] = $row1["\x74\151\155\x65"];
$x["\x70\x6c\x61\x79\137\x6f\156"] = $row1["\164\x69\155\145"];
$newDate = date("\x6c", strtotime($x["\x70\154\141\x79\137\157\x6e"]));
$x["\x64\141\171"] = $newDate;
$r = array_merge($row1, $x);
$data[] = $r;
}
} else {
$data[] = null;
}
}
echo json_encode($data);
}
public function insert_withdraw_request_old() {
$user_id = $_POST["\165\x73\x65\x72\x5f\151\x64"];
$points = - $_POST["\160\x6f\x69\x6e\x74\x73"];
$date = $_POST["\144\x61\164\x65"];
$request_status = $_POST["\162\145\x71\x75\145\x73\164\x5f\163\x74\x61\164\165\x73"];
$req_limit = $_POST["\x72\145\x71\137\x6c\151\155\x69\x74"];
$type = "\127\151\x74\x68\x64\162\x61\167\141\154";
$app_setting = $this->db->get("\x74\x69\155\x65\163\154\157\164\163")->row();
$start_time = date("\x48\x3a\151", strtotime($app_setting->start_time));
$end_time = date("\x48\x3a\x69", strtotime($app_setting->end_time));
$time = date("\x48\x3a\151");
if ($time > $start_time && $time < $end_time) {
$d = "\x73\145\x6c\145\143\164\40\52\x20\x66\162\x6f\155\x20\x74\x62\x6c\122\x65\x71\x75\145\x73\164\x20\x77\x68\145\x72\x65\40\x75\163\x65\162\137\151\144\75{$user_id}\40\141\x6e\x64\x20\x74\171\x70\x65\x3d\47\x57\x69\x74\x68\144\x72\x61\167\x61\154\47";
$result1 = mysqli_query($this->conn, $d);
if ($result1->num_rows > 0) {
while ($row = $result1->fetch_assoc()) {
$newDate = date("\x64\55\155\x2d\131", strtotime($row["\164\x69\155\145"]));
$row1[] = $newDate;
}
$limit_exceed = false;
if (in_array($date, $row1)) {
$req_count = count($row1);
if ($req_count > $req_limit) {
$limit_exceed = true;
}
}
if ($limit_exceed) {
$status = "\x66\x61\151\154\145\144";
$data = "\104\x61\x69\154\x79\40\127\151\164\150\x64\162\141\x77\40\154\151\x6d\151\x74\40\105\x78\x63\145\145\x64\x65\x64";
} else {
$q = "\151\x6e\x73\x65\162\x74\40\151\x6e\x74\157\40\164\142\154\122\x65\x71\165\145\163\x74\x20\x28\162\x65\161\165\145\163\164\137\160\x6f\151\x6e\164\x73\54\165\163\145\162\x5f\x69\144\x2c\162\145\161\165\145\163\164\137\163\164\x61\x74\165\163\54\164\171\160\x65\51\12\11\11\11\x9\11\x76\141\154\165\x65\163\x28\47{$points}\x27\54\x20\x27{$user_id}\x27\x2c\x20\47{$request_status}\47\x2c\47{$type}\47\51";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "\x73\x75\x63\x63\x65\163\163";
$data = "\x52\145\x71\165\x65\x73\x74\x20\x53\165\143\x63\145\x73\163\146\x75\154\x6c\x2e\x2e";
} else {
$status = "\146\x61\151\x6c\x65\x64";
$data = "\x53\x6f\155\145\164\x68\x69\156\x67\x20\127\145\156\164\40\x57\162\x6f\x6e\147";
}
}
} else {
$q = "\151\x6e\163\x65\162\164\40\151\x6e\164\x6f\40\164\x62\154\x52\145\x71\165\x65\x73\x74\x20\50\x72\145\x71\x75\145\x73\164\137\x70\x6f\x69\156\x74\163\54\x75\163\x65\x72\x5f\151\x64\x2c\162\x65\x71\165\145\163\164\x5f\163\164\141\164\x75\x73\54\164\171\160\x65\x29\x20\x76\141\x6c\165\x65\163\x28\x27{$points}\47\x2c\x20\x27{$user_id}\x27\x2c\40\47{$request_status}\x27\x2c\47{$type}\x27\51";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "\163\165\x63\143\145\163\x73";
$data = "\x52\x65\x71\x75\145\163\164\40\123\x75\x63\x63\145\x73\x73\x66\x75\154\x6c\x2e\56";
} else {
$status = "\146\141\x69\154\x65\144";
$data = "\x53\157\x6d\145\x74\150\x69\156\x67\x20\x57\145\x6e\x74\x20\x57\162\x6f\x6e\147";
}
}
} else {
$status = "\x66\x61\151\154\x65\144";
$data = "\127\x69\x74\150\x64\162\141\x77\141\154\x20\x74\x69\155\x65\157\165\164";
}
$obj = array("\x73\164\x61\164\165\163" => $status, "\x6d\x65\163\163\x61\x67\145" => $data);
echo json_encode($obj);
}
public function insert_withdraw_request() {
$app_setting = $this->db->select("\x77\x5f\x61\x6d\157\x75\156\x74\x2c\155\x61\x78\137\167\151\x74\x68\x64\x72\x61\167")->get("\x61\160\160\x5f\163\x65\164\164\151\156\147")->row();
$min_value = $app_setting->w_amount;
$max_value = $app_setting->max_withdraw;
$this->form_validation->set_rules("\x75\x73\x65\162\137\151\x64", "\125\x73\145\162\40\111\x44", "\x72\x65\x71\165\151\x72\145\144\x7c\x69\156\164\x65\147\145\162");
$this->form_validation->set_rules("\160\x6f\x69\156\x74\x73", "\x41\x6d\x6f\x75\x6e\x74", "\x74\x72\151\x6d\x7c\x72\145\161\x75\x69\x72\145\144\x7c\156\165\155\145\x72\x69\x63");
$this->form_validation->set_rules("\x64\x61\x74\x65", "\x44\141\164\x65", "\162\145\x71\165\x69\x72\145\x64");
$this->form_validation->set_rules("\162\x65\161\165\145\163\164\x5f\163\164\141\164\x75\x73", "\122\x65\x71\165\x65\163\164\x20\123\x74\x61\x74\165\163", "\162\145\161\x75\151\162\145\x64");
$this->form_validation->set_rules("\162\145\161\137\154\151\x6d\x69\x74", "\x52\x65\161\165\145\163\164\x20\114\x69\x6d\151\164", "\x72\145\x71\165\x69\x72\x65\144\174\x69\156\164\x65\147\145\162");
if ($this->form_validation->run() == false) {
$status = "\x66\x61\x69\x6c\145\x64";
$data = strip_tags($this->form_validation->error_string());
} else {
$points = $this->input->post("\x70\157\x69\156\x74\163");
if ($points < $min_value || $points > $max_value) {
$status = "\146\x61\x69\154\x65\144";
$data = "\120\145\x72\x20\x44\141\x79\x20\127\x69\x74\150\x64\162\x61\167\141\x6c\x20\114\151\155\151\164\x20\115\x69\156\x69\155\165\x6d\40{$min_value}\x20\164\x6f\40{$max_value}\x20\x45\x78\x74\162\x61\40\x61\x6d\157\165\x6e\164\40\x57\151\164\150\144\x72\x61\x77\141\x6c\40\160\154\145\141\163\x65\40\x43\x6f\x6e\x74\141\143\164\40\123\165\160\160\157\x72\x74\40\124\x65\141\x6d";
} else {
$user_id = $this->input->post("\x75\x73\x65\162\137\x69\x64");
$date = $this->input->post("\x64\141\x74\x65");
$request_status = $this->input->post("\x72\145\x71\165\x65\x73\x74\x5f\163\164\x61\164\x75\163");
$req_limit = $this->input->post("\x72\x65\161\x5f\x6c\151\x6d\x69\164");
$type = "\x57\x69\x74\150\x64\x72\x61\x77\x61\154";
$trans_date = date("\131\55\x6d\55\144", strtotime($request_status));
$app_setting = $this->db->get("\x74\x69\x6d\145\163\x6c\157\x74\163")->row();
$start_time = date("\110\72\x69", strtotime($app_setting->start_time));
$end_time = date("\110\x3a\x69", strtotime($app_setting->end_time));
$time = date("\x48\x3a\151");
$points = - $this->input->post("\x70\x6f\x69\x6e\x74\x73");
if ($time > $start_time && $time < $end_time) {
$limit_exceed = $this->db->where(array("\x75\163\x65\x72\137\151\x64" => $user_id, "\164\x79\160\145" => "\127\151\x74\150\x64\x72\141\x77\141\x6c", "\x44\101\x54\105\x28\x74\151\x6d\145\x29" => $trans_date))->get("\164\x62\154\122\145\161\x75\x65\163\x74")->num_rows();
if ($limit_exceed > $req_limit) {
$status = "\x66\x61\x69\154\x65\144";
$data = "\x44\141\x69\154\171\x20\127\151\x74\150\x64\x72\x61\x77\x20\x6c\x69\155\x69\164\x20\105\x78\x63\x65\145\x64\145\144";
} else {
$data = array("\162\145\161\x75\x65\163\x74\137\x70\x6f\x69\x6e\164\x73" => $points, "\165\x73\145\x72\x5f\x69\x64" => $user_id, "\x72\145\161\x75\x65\163\x74\x5f\163\x74\x61\x74\x75\x73" => $request_status, "\164\171\160\x65" => $type);
$inserted = $this->db->insert("\164\x62\x6c\x52\x65\x71\x75\x65\163\x74", $data);
if ($inserted) {
$status = "\163\165\143\143\145\x73\163";
$data = "\x52\145\x71\x75\145\163\x74\40\123\x75\143\143\145\163\x73\146\x75\154";
} else {
$status = "\146\141\x69\x6c\x65\144";
$data = "\x53\x6f\x6d\x65\x74\x68\x69\156\147\40\127\x65\156\x74\40\127\162\157\156\x67";
}
}
} else {
$status = "\146\141\x69\154\x65\144";
$data = "\127\151\164\x68\144\162\141\x77\x61\x6c\x20\164\x69\155\x65\157\165\x74";
}
}
}
$response = array("\x73\164\x61\x74\165\163" => $status, "\x6d\x65\x73\163\141\x67\145" => $data);
echo json_encode($response);
}
public function generate_otp() {
$mobile = $this->input->post("\155\157\x62\x69\x6c\145");
$otp = $this->input->post("\157\164\x70");
$q = $this->db->query("\163\x65\x6c\145\x63\x74\x20\52\40\x66\x72\157\x6d\x20\x75\x73\145\x72\x5f\x70\x72\157\146\x69\154\x65\40\x77\150\145\162\145\x20\50\155\x6f\x62\151\154\x65\x6e\x6f\75\47" . $mobile . "\x27\51\x20\x4c\151\155\151\x74\x20\x31");
if ($q->num_rows() > 0) {
$status = "\163\165\x63\143\145\x73\163";
$msg = "\x59\157\165\x72\x20\117\x6e\154\x69\x6e\x65\x54\x65\x65\162\x50\154\x61\171\x20\117\x6e\145\40\124\x69\x6d\x65\x20\120\x61\x73\163\167\157\x72\x64\x20\50\x4f\x54\120\51\40\x69\x73\x20{$otp}\x2e\x20\x44\x6f\x6e\47\164\x20\163\x68\x61\x72\145\40\x69\164\40\167\151\x74\150\x20\141\x6e\x79\157\x6e\x65\x2e\x20\x57\x65\40\144\x6f\x6e\x27\164\x20\x63\x61\154\154\57\x65\155\x61\x69\x6c\40\171\x6f\x75\x20\164\157\40\x76\x65\x72\x69\146\x79\40\117\124\x50\x2e\x20\117\124\120\x20\x69\x73\40\166\x61\154\x69\x64\x20\x66\x6f\162\x20\61\x35\40\155\151\x6e\x73\x2e";
@send_sms($mobile, $otp);
$data = "\x43\x6f\144\x65\x20\163\145\x6e\164\x20\164\x6f\x20\x79\157\x75\162\x20\162\145\x67\x69\163\x74\x65\x72\x65\x64\x20\x6d\x6f\142\151\x6c\x65\40\x6e\x75\x6d\x62\145\162";
} else {
$status = "\146\x61\x69\x6c\x65\x64";
$data = "\115\x6f\142\151\154\145\x20\x6e\x75\155\142\x65\162\40\x6e\x6f\x74\x20\x72\x65\x67\151\x73\164\145\x72\145\144\x2e";
}
$obj = array("\x73\164\141\x74\165\163" => $status, "\x6d\x65\x73\x73\141\147\x65" => $data);
echo json_encode($obj);
}
public function mobile_verification() {
$mobile = $this->input->post("\155\157\142\x69\x6c\145");
$otp = $this->input->post("\157\164\160");
$q = $this->db->query("\x73\145\154\145\143\x74\40\52\x20\146\162\157\x6d\x20\165\x73\x65\162\x5f\160\162\x6f\x66\151\154\145\40\167\150\x65\162\145\40\x28\155\157\x62\x69\x6c\145\x6e\x6f\75\47" . $mobile . "\47\x29\x20\114\151\155\x69\x74\40\61");
if ($q->num_rows() > 0) {
$status = "\146\141\151\154\145\144";
$data = "\115\x6f\x62\x69\x6c\145\40\156\x75\155\x62\x65\x72\40\141\154\162\x65\x61\x64\x79\x20\162\x65\x67\151\163\x74\145\x72\x65\144\12\40\164\x72\171\40\141\156\x6f\x74\x68\145\162\x20\156\x75\x6d\x62\x65\162";
} else {
$msg = "\x59\x6f\165\162\40\x4f\156\154\x69\x6e\145\x54\x65\145\x72\120\154\x61\x79\x20\117\156\x65\40\x54\151\x6d\145\40\120\x61\163\x73\167\157\x72\x64\x20\50\x4f\x54\x50\51\40\151\x73\x20{$otp}\x2e\x20\104\x6f\x6e\47\x74\40\163\x68\x61\x72\x65\40\x69\x74\40\x77\x69\164\x68\x20\141\x6e\x79\157\x6e\x65\x2e\40\x57\x65\x20\144\157\156\47\x74\40\x63\141\x6c\154\57\145\x6d\x61\151\x6c\40\171\x6f\x75\40\164\157\40\166\x65\162\151\x66\171\40\117\124\x50\x2e\x20\117\x54\120\x20\151\x73\40\x76\141\154\151\144\40\x66\157\x72\x20\61\65\40\x6d\x69\156\x73\x2e";
send_sms($mobile, $otp);
$status = "\x73\165\x63\x63\x65\163\x73";
$data = "\x76\145\162\151\146\151\x63\x61\x74\x69\157\x6e";
}
$obj = array("\x73\x74\141\164\x75\163" => $status, "\x6d\145\163\x73\x61\x67\x65" => $data);
echo json_encode($obj);
}
public function forgot_password() {
$this->load->model("\x63\x6f\x6d\x6d\x6f\x6e\137\x6d\157\x64\x65\154");
$dd = $this->common_model->data_update("\165\163\x65\162\137\160\x72\157\146\151\x6c\x65", array("\x70\141\x73\x73\167\x6f\162\144" => $this->input->post("\x70\x61\x73\x73\167\x6f\162\144")), array("\155\157\142\151\x6c\145\x6e\x6f" => $this->input->post("\x6d\x6f\x62\151\x6c\145")));
if ($dd) {
$status = "\163\x75\x63\x63\145\163\163";
$data = "\x50\x61\163\163\167\157\x72\x64\x20\165\160\144\x61\164\145\x64\40\163\165\143\x63\x65\163\163\x66\x75\x6c\154\171\x2e";
} else {
$status = "\146\141\151\154\145\144";
$data = "\123\157\155\x65\x74\150\x69\x6e\x67\40\167\145\x6e\x74\x20\x77\x72\x6f\156\x67";
}
$obj = array("\x73\x74\141\x74\165\163" => $status, "\155\x65\x73\163\x61\147\x65" => $data);
echo json_encode($obj);
}
public function create_mpin() {
$user_id = $_POST["\x75\163\145\162\x5f\x69\144"];
$mpin = $_POST["\155\160\151\x6e"];
$q = "\165\160\144\141\x74\x65\40\x75\x73\145\x72\137\x70\x72\x6f\x66\x69\154\x65\x20\163\145\164\x20\155\x69\144\75\47" . $mpin . "\x27\40\x77\150\145\162\145\x20\151\x64\75\x27" . $user_id . "\47";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "\x73\x75\143\143\x65\163\x73";
$data = "\115\x50\x49\116\40\x67\156\x65\162\x61\164\x65\144\40\x73\165\143\143\145\x73\163\x66\165\154\154\x79\x2e\x2e";
} else {
$status = "\x66\x61\x69\x6c\x65\144";
$data = "\123\157\155\145\x74\x68\x69\156\147\40\x77\145\x6e\x74\40\x77\162\x6f\156\x67";
}
$obj = array("\163\164\141\x74\x75\x73" => $status, "\x6d\145\163\x73\x61\147\145" => $data);
echo json_encode($obj);
}
public function generate_login_otp() {
$mobile = $_POST["\155\157\142\x69\154\145"];
$pass = $_POST["\160\x61\163\x73\x77\x6f\x72\144"];
$otp = $_POST["\x6f\164\160"];
$q = "\163\145\x6c\x65\143\x74\x20\52\40\146\162\x6f\x6d\40\165\163\145\162\137\160\x72\157\x66\x69\154\145\40\x77\150\145\x72\145\40\155\x6f\142\x69\x6c\145\x6e\x6f\x3d\x27{$mobile}\x27";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$db_pass = $row["\160\141\x73\x73\167\x6f\162\x64"];
if ($pass == $db_pass) {
$status = "\163\x75\143\x63\145\163\x73";
$msg = "\131\157\165\162\x20\x6c\157\147\151\x6e\40\117\124\120\x20\x69\x73\40" . $otp . "\x20\146\157\162\x20\117\x6e\x6c\x69\156\145\124\145\145\x72\120\154\141\171";
$id = $row["\151\x64"];
$u_otp = "\x75\160\144\x61\x74\x65\40\165\x73\145\162\x5f\160\x72\x6f\x66\151\x6c\x65\x20\163\145\x74\x20\157\164\x70\75\47{$otp}\x27\x20\x77\150\x65\162\x65\x20\151\144\x3d\47{$id}\x27";
$dd = $this->conn->query($u_otp);
if ($dd === true) {
$status = "\163\165\143\143\145\163\163";
$data = "\x4f\124\x50\x20\x73\x65\x6e\164\x20\164\157\x20\x79\157\x75\x72\40\162\x65\147\151\x73\x74\x65\162\145\x64\x20\155\x6f\x62\151\x6c\x65\x20\156\165\x6d\142\x65\162";
} else {
$status = "\x66\x61\x69\x6c\145\x64";
$data = "\123\x6f\x6d\x65\x74\x68\x69\x6e\x67\40\x77\x65\x6e\x74\x20\x77\162\157\x6e\147";
}
} else {
$status = "\146\x61\x69\x6c\145\144";
$data = "\120\x61\163\x73\x77\157\x72\144\x20\151\x73\x20\x69\x6e\x63\x6f\162\162\x65\143\164";
}
} else {
$status = "\146\x61\151\x6c\x65\144";
$data = "\115\157\142\x69\154\145\x20\116\x75\x6d\142\145\162\40\x6e\157\x74\40\162\x65\x67\151\x73\x74\x65\x72\x65\x64\56";
}
$obj = array("\163\x74\141\164\165\x73" => $status, "\155\145\163\x73\141\147\145" => $data);
echo json_encode($obj);
}
public function get_starline() {
$q = "\163\x65\x6c\x65\x63\164\40\x2a\x20\146\x72\x6f\155\x20\164\142\154\123\164\x61\x72\x6c\151\x6e\145\40\167\x68\x65\x72\145\40\163\137\x67\x61\x6d\145\x5f\164\x69\155\x65\x20\41\75\47\47";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$i = 0;
while ($row = $result->fetch_assoc()) {
$data[$i]["\x69\x64"] = $row["\x69\144"];
$data[$i]["\163\137\147\x61\x6d\145\137\164\151\155\145"] = $row["\163\137\147\x61\155\145\x5f\x74\x69\155\x65"];
$data[$i]["\x73\137\x67\x61\155\145\137\x65\156\144\x5f\x74\x69\x6d\145"] = $row["\163\x5f\x67\141\155\145\x5f\145\156\x64\x5f\x74\151\x6d\x65"];
if (strtotime(date("\131\x2d\x6d\55\x64")) == strtotime(date("\131\x2d\x6d\55\144", strtotime($row["\165\160\x64\141\164\x65\144\x5f\141\x74"])))) {
$data[$i]["\163\x5f\x67\141\x6d\x65\x5f\156\x75\155\142\x65\x72"] = $row["\163\x5f\x67\x61\x6d\x65\x5f\156\165\x6d\142\x65\162"];
} else {
$data[$i]["\x73\x5f\147\141\155\x65\137\x6e\x75\x6d\x62\x65\162"] = "\52\x2a\52";
}
$i++;
}
} else {
$data = "\60";
}
echo json_encode($data);
}
public function getSpMotor() {
$s = $_POST["\x61\162\x72"];
$a = str_split($s);
$arr = implode($a, "\54");
$numArray = explode("\x2c", $arr);
$arr = array_map("\151\156\164\166\141\154", $numArray);
$data = array(array(137, 128, 146, 236, 245, 290), array(380, 470, 489, 560, 678, 579), array(129, 138, 147, 156, 237, 246), array(345, 390, 480, 570, 589, 679), array(120, 139, 148, 157, 238, 247), array(256, 346, 490, 580, 670, 689), array(130, 149, 158, 167, 239, 248), array(257, 347, 356, 590, 680, 789), array(140, 159, 168, 230, 249, 258), array(267, 348, 357, 456, 690, 780), array(123, 150, 169, 178, 240, 259), array(268, 349, 358, 367, 457, 790), array(124, 160, 179, 250, 269, 278), array(340, 359, 368, 458, 467, 890), array(125, 134, 170, 189, 260, 279), array(350, 369, 378, 459, 468, 567), array(126, 135, 180, 234, 270, 289), array(360, 379, 450, 469, 478, 568), array(127, 136, 145, 190, 235, 280), array(370, 389, 460, 479, 569, 578));
$a = 0;
$b = 0;
$a = 0;
$k = 0;
$t = 0;
$m = array();
$final = array();
for ($i = 0;$i < count($data);$i++) {
for ($j = 0;$j < count($data[$i]);$j++) {
$k = 0;
$b = 0;
$num = $data[$i][$j];
while ($num != 0) {
$d = $num % 10;
$b++;
if ($b < 4) {
if (!in_array($d, $arr, false)) {
$k = 1;
break;
}
}
$num = (int)$num / 10;
}
if ($k == 0) {
$m[$a++] = $data[$i][$j];
}
}
}
for ($i = 0;$i < count($m);$i++) {
$b = 0;
$c = 0;
$num = $m[$i];
while ($num != 0) {
$d = $num % 10;
$arr2[$b++] = $d;
$num = (int)$num / 10;
}
$final[$t++] = $m[$i];
}
echo json_encode(array("\x73\x74\141\x74\x75\163" => "\163\165\x63\x63\145\x73\x73", "\144\x61\164\141" => $final));
}
public function get_dpmotor() {
$s = $_POST["\141\162\x72"];
$a = str_split($s);
$arr = implode($a, "\x2c");
$numArray = explode("\x2c", $arr);
$arr = array_map("\151\156\x74\x76\x61\154", $numArray);
$data = array(118, 226, 244, 299, 334, 488, 550, 668, 677, 100, 119, 155, 227, 335, 344, 399, 588, 669, 110, 200, 228, 255, 336, 499, 660, 688, 778, 166, 229, 300, 337, 355, 445, 599, 779, 788, 112, 220, 266, 338, 400, 446, 455, 699, 770, 113, 122, 177, 339, 366, 447, 500, 799, 889, 600, 114, 277, 330, 448, 466, 556, 880, 899, 115, 133, 188, 223, 377, 449, 557, 566, 700, 116, 224, 233, 288, 440, 477, 558, 800, 990, 117, 144, 199, 225, 388, 559, 577, 667, 900);
$a = 0;
$b = 0;
$a = 0;
$k = 0;
$t = 0;
$m = array();
$final = array();
for ($i = 0;$i < count($data);$i++) {
$k = 0;
$b = 0;
$num = $data[$i];
while ($num != 0) {
$d = $num % 10;
$b++;
if ($b < 4) {
if (!in_array($d, $arr, false)) {
$k = 1;
break;
}
}
$num = (int)$num / 10;
}
if ($k == 0) {
$m[$a++] = $data[$i];
}
}
for ($i = 0;$i < count($m);$i++) {
$b = 0;
$c = 0;
$num = $m[$i];
while ($num != 0) {
$d = $num % 10;
$arr2[$b++] = $d;
$num = (int)$num / 10;
}
for ($j = 0;$j < 2;$j++) {
if ($arr2[$j] <= $arr2[$j + 1]) {
$c = 1;
break;
}
}
if ($c == 1) {
$final[$t++] = $m[$i];
}
}
echo json_encode(array("\x73\164\141\164\x75\163" => "\x73\165\x63\143\x65\163\163", "\144\141\x74\x61" => $final));
}
public function get_matkas() {
$row_dt = '';
$matka = array();
$q = "\163\145\154\x65\143\164\40\52\40\x66\162\157\x6d\40\155\141\x74\153\141\40\167\150\145\162\145\x20\163\164\x61\x74\x75\163\75\47\x61\143\x74\x69\166\x65\x27\40\x61\156\144\40\151\144\x20\74\x20\x27\61\x30\60\x27\x20\x4f\x52\104\x45\x52\x20\102\x59\x20\155\141\x74\x6b\141\x5f\157\162\x64\x65\x72";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$i = 0;
$curr_time = strtotime(date("\110\72\x69\72\x73"));
while ($row = $result->fetch_assoc()) {
if (date("\x44") === "\x53\x61\x74") {
$bid_start_time = $row["\163\141\164\137\x73\x74\x61\x72\x74\137\164\x69\x6d\x65"];
$bid_end_time = $row["\163\x61\164\137\145\156\x64\137\164\151\x6d\x65"];
}
if (date("\x44") === "\x53\x75\x6e") {
$bid_start_time = $row["\163\x74\x61\x72\164\137\164\151\x6d\145"];
$bid_end_time = $row["\145\x6e\144\x5f\x74\151\x6d\145"];
} else {
$bid_start_time = $row["\x62\x69\144\137\163\x74\x61\x72\164\137\x74\151\155\145"];
$bid_end_time = $row["\142\x69\144\137\145\x6e\x64\137\x74\151\x6d\x65"];
}
$type = $curr_time >= strtotime($bid_start_time) && $curr_time <= strtotime($bid_end_time) ? "\154\x69\166\x65" : "\157\x6c\x64";
$data[$i] = $row;
$data[$i]["\142\151\144\137\x73\164\x61\162\x74\137\164\151\155\x65"] = $bid_start_time;
$data[$i]["\x62\151\x64\x5f\145\x6e\x64\137\x74\151\155\x65"] = $bid_end_time;
$data[$i]["\x74\x79\160\x65"] = $type;
$i++;
}
} else {
$data = "\x30";
}
echo json_encode($data);
}
public function matka_with_id() {
$us_id = $_POST["\151\x64"];
$q = "\163\145\154\x65\143\164\x20\x2a\x20\x66\162\157\x6d\x20\40\155\141\x74\153\x61\40\x77\150\145\162\145\x20\x69\x64\x3d{$us_id}\40";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$status = "\163\165\x63\143\x65\x73\163";
$data = $row;
}
} else {
$status = "\x73\x75\143\x63\145\x73\163";
$data[] = "\x30";
}
$obj = array("\x73\164\x61\x74\x75\163" => $status, "\144\x61\x74\x61" => $data);
echo json_encode($obj);
}
public function starline_data() {
$q = $this->db->query("\x73\145\154\x65\143\x74\40\52\x20\146\162\x6f\x6d\40\x74\142\154\x53\164\141\x72\154\151\156\145\x20\x77\x68\145\x72\145\x20\151\x64\75\x27" . $this->input->post("\151\144") . "\47");
if ($q->num_rows() > 0) {
echo json_encode($q->row());
} else {
echo json_encode("\x30");
}
}
public function add_request() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\165\163\x65\162\x5f\151\x64", "\125\x73\x65\x72\x20\111\144", "\164\162\x69\x6d\x7c\x72\x65\x71\165\x69\x72\x65\144");
$this->form_validation->set_rules("\160\x6f\x69\x6e\x74\163", "\x50\157\x69\x6e\x74\x73", "\x74\x72\x69\x6d\x7c\x72\145\x71\x75\x69\162\145\144");
if ($this->form_validation->run() == false) {
$data["\162\145\163\x70\157\156\143\x65"] = false;
$data["\145\162\x72\x6f\162"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\165\163\145\x72\x5f\151\x64");
$points = $this->input->post("\x70\x6f\151\x6e\x74\163");
$request_status = $this->input->post("\x72\x65\161\x75\145\x73\164\137\x73\164\x61\x74\x75\x73");
$type = $this->input->post("\x74\x79\160\145");
$q = $this->db->insert("\164\x62\x6c\122\x65\161\x75\x65\x73\x74", array("\x75\x73\x65\x72\137\x69\x64" => $user_id, "\x72\x65\x71\165\x65\x73\164\137\160\x6f\151\156\164\x73" => $points, "\162\x65\161\x75\145\x73\x74\x5f\163\x74\141\164\x75\163" => $request_status, "\x74\171\x70\145" => $type));
if ($q) {
if ($type == "\127\x69\164\150\x64\162\x61\167\141\x6c") {
$remainAmount = $this->input->post("\x77\141\x6c\x6c\x65\x74");
$qupdate = $this->db->query("\165\x70\144\141\164\145\x20\164\x62\x6c\x77\141\x6c\x6c\145\164\40\x73\145\x74\40\x77\x61\x6c\154\145\x74\x5f\160\157\151\x6e\x74\x73\75\x27" . $remainAmount . "\47\40\x77\150\145\x72\x65\x20\165\163\x65\x72\137\151\x64\75\47" . $user_id . "\x27");
}
$data["\x72\x65\163\x70\157\156\x63\x65"] = true;
$data["\x6d\x65\x73\163\x61\147\145"] = "\122\x65\x71\x75\x65\163\164\x20\101\x64\x64\145\144\x2e\x2e";
} else {
$data["\x72\x65\x73\x70\x6f\x6e\143\145"] = false;
$data["\145\x72\x72\x6f\162"] = "\123\157\x6d\145\164\150\151\156\x67\40\x57\145\x6e\x74\40\x57\162\157\x6e\147";
}
}
echo json_encode($data);
}
public function withdraw_request() {
$user_id = $_POST["\165\x73\x65\x72\137\151\x64"];
$points = $_POST["\160\x6f\151\x6e\164\163"];
$request_status = $_POST["\162\x65\x71\165\x65\163\164\x5f\x73\164\141\164\165\x73"];
$q = "\x69\156\x73\145\162\164\40\151\156\164\157\x20\164\x62\x6c\x57\151\164\x68\x64\x72\141\167\122\145\x71\x75\145\163\164\x20\x28\167\x69\164\150\144\162\141\x77\x5f\x70\x6f\151\x6e\x74\163\54\165\x73\x65\162\x5f\x69\144\54\167\151\164\150\x64\162\x61\x77\x5f\x73\164\141\x74\x75\x73\x29\x20\x76\x61\x6c\165\x65\x73\x28\47{$points}\47\x2c\40\47{$user_id}\47\x2c\x20\x27{$request_status}\47\x29\x3b";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "\163\x75\143\x63\x65\x73\x73";
$dt = array("\x73\164\x61\x74\165\163" => $status);
echo json_encode($dt);
} else {
$status = "\x66\x61\151\154\145\x64";
$dt = array("\163\164\x61\164\165\163" => $status);
echo json_encode($dt);
}
}
public function request_history() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\165\x73\145\x72\x5f\x69\144", "\125\x73\145\x72\40\111\144", "\164\162\151\155\174\162\145\161\x75\x69\162\x65\x64");
if ($this->form_validation->run() == false) {
$data["\x72\145\163\160\x6f\x6e\143\x65"] = false;
$data["\x65\162\x72\x6f\162"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\x75\x73\x65\162\x5f\151\x64");
$data["\x72\145\163\160\x6f\x6e\x63\x65"] = true;
$q = $this->db->select("\52\54\x43\117\116\x43\101\x54\50\x74\171\x70\145\54\x27\x20\47\x2c\x49\x46\x28\160\x61\171\x6d\x65\x6e\x74\137\x74\171\x70\x65\40\75\40\61\54\47\x4f\x66\146\154\151\156\145\x27\54\x49\x46\x28\160\141\x79\155\145\x6e\164\x5f\x74\x79\x70\145\x20\x3d\40\x32\x2c\x27\x4f\x6e\x6c\x69\x6e\145\x27\54\x49\x46\50\x70\x61\171\155\x65\x6e\x74\x5f\x74\x79\160\145\x3d\x33\x2c\x27\x43\x61\x73\x68\x62\141\x63\x6b\47\54\x27\x27\x29\51\51\51\x20\141\x73\x20\164\171\160\145")->where("\x75\163\145\x72\x5f\151\x64", $user_id)->order_by("\164\x69\x6d\x65", "\x64\x65\163\x63")->get("\164\142\x6c\x52\x65\161\165\145\x73\164");
$data["\x64\141\164\141"] = $q->result();
}
echo json_encode($data);
}
public function withdraw_history() {
$us_id = $_POST["\x75\x73\145\x72\137\151\144"];
$q = "\x73\x65\x6c\x65\x63\x74\40\x2a\x20\x66\162\157\155\x20\x74\x62\x6c\x57\151\x74\150\144\162\x61\x77\122\145\161\x75\145\x73\164\x20\167\x68\145\162\145\40\x75\x73\145\162\x5f\x69\144\x3d{$us_id}\x20\x4f\122\x44\105\122\x20\102\x59\x20\164\x69\155\x65\40\x44\105\x53\x43";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$status = "\x73\165\143\143\145\x73\163";
$data[] = $row;
}
} else {
$status = "\x66\x61\151\x6c\x65\144";
$data = "\x4e\x6f\x20\x57\151\164\150\x64\162\x61\167\x20\110\151\x73\x74\157\x72\171";
}
$obj = array("\x73\164\x61\x74\165\163" => $status, "\x64\x61\x74\x61" => $data);
echo json_encode($obj);
}
public function notifications() {
$email = $_POST["\155\x6f\x62\151\154\x65"];
$ds = "\123\105\114\105\103\x54\x20\52\x20\x46\x52\x4f\115\40\165\163\x65\162\x5f\x70\x72\157\x66\151\x6c\x65\x20\167\x68\x65\162\x65\40\155\157\x62\151\x6c\x65\x6e\157\x3d\x27{$email}\47";
$results = mysqli_query($this->conn, $ds);
if ($results->num_rows > 0) {
while ($row2 = $results->fetch_assoc()) {
$data_time = $row2["\x74\151\x6d\x65"];
}
$d = "\x53\x45\114\105\x43\124\x20\x2a\40\x46\122\x4f\115\x20\x74\x62\154\x4e\x6f\x74\151\x66\x69\x63\x61\x74\151\x6f\x6e\x20\x77\150\x65\x72\145\x20\164\151\155\145\x3e\75\x27{$data_time}\x27\40\x4f\x52\104\105\x52\40\102\x59\40\x6e\x6f\x74\151\x66\151\143\141\x74\151\x6f\x6e\x5f\151\x64\40\104\105\x53\103";
$result1 = mysqli_query($this->conn, $d);
if ($result1->num_rows > 0) {
while ($row1 = $result1->fetch_assoc()) {
$data[] = $row1;
}
$status = "\163\165\143\x63\145\x73\163";
} else {
$data = "\x54\150\x65\162\145\x20\x69\x73\40\x6e\x6f\x20\156\x65\167\40\156\x6f\164\x69\146\x69\x63\141\164\151\157\x6e";
$status = "\146\x61\x69\x6c\145\144";
}
} else {
$status = "\x66\x61\x69\x6c\x65\144";
$data = "\x4d\x6f\142\x69\154\145\40\x4e\x75\x6d\x62\145\162\x20\x44\157\x65\x73\x20\156\x6f\164\x20\x66\157\165\156\144\x2e";
}
$obj = array("\163\164\x61\x74\165\x73" => $status, "\x64\x61\164\x61" => $data);
echo json_encode($obj);
}
public function transaction() {
$us_id = $_POST["\x75\163\137\x69\x64"];
$q = "\x73\145\x6c\145\x63\x74\40\x2a\x20\x66\x72\x6f\x6d\40\40\150\151\x73\164\157\x72\x79\40\167\150\x65\162\x65\40\x75\x73\x65\162\x5f\151\144\75\x27{$us_id}\47\40\117\122\104\105\122\40\x42\x59\40\x74\151\155\145\x20\x44\105\x53\x43";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$data[] = $row;
}
$status = "\x73\165\x63\143\145\x73\163";
} else {
$status = "\x66\141\151\x6c\x65\144";
$data = "\116\157\40\x48\151\x73\x74\157\x72\171\x20\146\157\x72\x20\x79\x6f\x75";
}
$obj = array("\x73\164\x61\x74\165\x73" => $status, "\155\163\x67" => $data);
echo json_encode($obj);
}
public function mpin_login() {
global $conn;
$mpin = $_POST["\x6d\160\x69\x6e"];
$mobile = $_POST["\x6d\x6f\142\151\154\145"];
$q = "\x73\x65\x6c\145\143\164\x20\52\x20\x66\x72\x6f\x6d\40\165\163\145\x72\x5f\160\x72\157\146\151\154\x65\x20\x77\150\x65\x72\145\40\155\151\144\75\47{$mpin}\x27\40\x61\x6e\144\40\155\x6f\x62\151\x6c\x65\156\157\75\47{$mobile}\47";
$result = mysqli_query($this->conn, $q);
if (mysqli_num_rows($result) == 1) {
$row = mysqli_fetch_assoc($result);
$status = "\x73\x75\143\x63\x65\x73\163";
$data["\151\x64"] = $row["\151\x64"];
$data["\156\141\155\x65"] = $row["\x6e\x61\155\145"];
$data["\165\163\x65\x72\x6e\x61\x6d\145"] = $row["\x75\x73\x65\162\156\x61\x6d\x65"];
$data["\x6d\157\x62\151\154\145\156\x6f"] = $row["\x6d\157\x62\x69\x6c\145\156\157"];
$data["\160\x61\x73\x73\167\x6f\x72\144"] = $row["\x70\x61\163\x73\167\157\x72\144"];
$data["\x65\x6d\141\x69\154"] = $row["\x65\155\141\x69\154"];
$data["\x64\x6f\x62"] = $row["\144\x6f\x62"];
$data["\141\x64\144\x72\145\x73\x73"] = $row["\141\x64\144\x72\145\163\163"];
$data["\x63\151\164\171"] = $row["\143\x69\164\171"];
$data["\x70\x69\156\143\157\x64\145"] = $row["\160\151\156\143\x6f\144\x65"];
$data["\160\141\x73\163\167\x6f\x72\144"] = $row["\x70\x61\163\x73\x77\x6f\x72\x64"];
$data["\x61\143\x63\157\165\x6e\x74\156\x6f"] = $row["\x61\143\143\x6f\x75\156\164\x6e\x6f"];
$data["\142\x61\x6e\153\x5f\x6e\141\x6d\x65"] = $row["\x62\141\x6e\x6b\137\x6e\141\155\x65"];
$data["\x69\146\163\143\x5f\143\x6f\144\x65"] = $row["\x69\146\x73\143\x5f\x63\x6f\x64\145"];
$data["\141\143\143\x6f\165\156\x74\x5f\x68\157\154\x64\145\x72\x5f\156\x61\x6d\x65"] = $row["\141\143\143\x6f\165\156\164\137\150\x6f\154\144\145\x72\x5f\156\141\x6d\x65"];
$data["\160\x61\171\164\x6d\137\x6e\x6f"] = $row["\x70\141\x79\164\x6d\137\156\157"];
$data["\x74\145\172\137\x6e\157"] = $row["\x74\145\172\137\x6e\157"];
$data["\x70\150\157\x6e\145\160\x61\171\137\156\157"] = $row["\160\x68\157\156\x65\x70\x61\x79\137\x6e\x6f"];
$qw = "\163\145\154\x65\143\x74\40\52\40\146\162\x6f\x6d\x20\x74\x62\x6c\167\x61\x6c\x6c\145\164\40\x77\150\145\162\x65\x20\165\x73\x65\x72\x5f\x69\144\x3d\x27" . $row["\151\144"] . "\47";
$resw = mysqli_query($this->conn, $qw);
$roww = mysqli_fetch_assoc($resw);
$data["\x77\x61\154\x6c\145\x74"] = $roww["\167\141\154\x6c\x65\x74\137\x70\157\x69\x6e\x74\x73"];
} else {
$status = "\x66\x61\x69\x6c\x65\144";
$data = "\x49\156\166\141\x6c\x69\x64\40\x4d\x50\111\x4e";
}
$obj = array("\163\x74\x61\x74\165\x73" => $status, "\144\141\x74\x61" => $data);
echo json_encode($obj);
}
public function request_points_old() {
$this->form_validation->set_rules("\x75\163\145\162\137\151\x64", "\125\163\x65\162\40\111\x44", "\162\x65\x71\165\x69\x72\145\x64\174\x74\x72\x69\155\174\156\165\x6d\x65\x72\x69\x63");
$this->form_validation->set_rules("\x70\x6f\151\156\164\163", "\120\157\x69\x6e\x74\x73", "\x72\x65\x71\165\151\x72\x65\144\x7c\164\162\151\x6d\174\x6e\x75\x6d\x65\x72\x69\x63");
$this->form_validation->set_rules("\165\160\x69\137\x6e\x61\155\145", "\x55\120\111\x20\116\141\x6d\145", "\162\x65\x71\x75\151\x72\145\x64\174\x74\x72\x69\155");
$this->form_validation->set_rules("\x72\x65\161\x75\145\x73\x74\137\x73\164\x61\164\165\x73", "\122\x65\161\165\x65\163\x74\x20\123\x74\141\x74\x75\163", "\x72\145\161\x75\x69\x72\x65\144\174\x74\x72\151\155");
$this->form_validation->set_rules("\x74\170\156\137\x69\x64", "\x54\x72\141\156\x73\141\x63\164\151\x6f\x6e\40\x49\x44", "\x72\145\x71\165\x69\x72\x65\144\174\164\x72\x69\x6d");
$this->form_validation->set_rules("\164\171\160\145", "\124\x79\x70\145", "\162\x65\x71\x75\x69\x72\145\144\174\164\162\x69\x6d");
$this->form_validation->set_rules("\x77\x61\x6c\154\145\164", "\127\141\x6c\154\145\164", "\164\162\x69\155");
$this->form_validation->set_rules("\162\x65\x66\145\162\x5f\143\157\144\145", "\x52\x65\x66\x65\162\x20\x43\x6f\x64\x65", "\x74\x72\x69\x6d");
$this->form_validation->set_rules("\160\141\x63\x6b\x61\x67\145\x5f\x69\x64", "\x50\x61\143\x6b\141\x67\145\40\111\x44", "\x74\162\151\x6d");
if ($this->form_validation->run() == false) {
$status = "\x66\x61\151\154\145\144";
$dt = array("\x73\164\x61\x74\x75\x73" => $status, "\x6d\145\163\163\141\x67\145" => validation_errors());
echo json_encode($dt);
return;
} else {
$user_id = $_POST["\165\x73\145\162\137\x69\x64"];
$points = $_POST["\x70\157\151\156\164\x73"];
$request_status = $upi_name == "\x50\x48\x4f\x4e\x45\x5f\x50\x45" ? "\160\x65\156\x64\x69\x6e\x67" : $this->input->post("\162\145\x71\165\145\163\x74\x5f\163\x74\141\x74\165\163");
$txn_id = $_POST["\164\x78\x6e\x5f\x69\144"];
$type = $_POST["\164\x79\x70\145"];
$wallet = $_POST["\x77\x61\154\x6c\145\164"];
$first_deposit = $this->db->select("\151\163\x5f\x66\x69\x72\x73\x74\137\164\151\x6d\145\x5f\x64\145\x70\x6f\163\151\164")->where("\x75\163\145\162\x5f\x69\x64", $user_id)->get("\x74\x62\x6c\167\141\x6c\154\145\x74")->row()->is_first_time_deposit??0;
if ($first_deposit == 1) {
$ref_code = $_POST["\x72\x65\x66\x65\162\137\x63\157\144\145"];
$check_ref_code = $this->db->where("\165\x73\x65\x72\137\162\x65\x66\145\x72\145\x6e\143\145\137\x63\x6f\144\x65", $ref_code)->where("\x6c\157\x67\x69\156\x5f\x73\x74\141\x74\165\163", 0)->get("\x75\163\145\162\x5f\x70\162\x6f\x66\151\154\x65");
if ($ref_code != '' && $check_ref_code->num_rows() > 0) {
$reffered_code = $ref_code;
$referee_data = $check_ref_code->row();
$refree_id = $referee_data->id;
$wa = 10 / 100 * $points;
if ($_POST["\165\160\151\137\x6e\x61\155\x65"] != "\x50\110\x4f\x4e\105\137\120\105") {
$query = $this->db->query("\x55\x70\144\x61\x74\145\40\x74\x62\154\167\141\x6c\154\145\164\x20\x73\x65\164\40\155\141\x69\x6e\137\167\x61\x6c\154\145\x74\137\x70\157\x69\x6e\164\x73\x3d\155\141\151\x6e\137\x77\x61\154\154\145\x74\x5f\x70\x6f\151\156\x74\163\x2b\x27{$wa}\47\x20\x77\x68\x65\162\x65\x20\x75\163\x65\x72\137\151\x64\75\x27{$refree_id}\x27");
$array_refer = array("\x72\145\x66\x65\x72\x65\144\137\x75\x73\145\162" => $user_id, "\x72\x65\x66\145\x72\x65\x64\137\142\x79\x5f\x75\x73\x65\x72" => $refree_id, "\x61\x6d\x6f\165\x6e\164\x5f\143\162\x65\144\151\164\145\144\137\162\145\x66\145\x72\145\x64\x5f\142\x79\137\165\x73\145\x72" => $wa);
$this->db->insert("\x72\145\x66\x65\x72\137\150\151\x73\164\x6f\162\x79", $array_refer);
}
}
}
$data = array("\162\145\x71\165\145\x73\164\x5f\160\x6f\x69\156\164\x73" => $points, "\x75\x73\x65\162\x5f\x69\x64" => $user_id, "\x72\145\x71\165\145\163\x74\x5f\x73\x74\141\164\165\163" => $request_status, "\164\x79\x70\x65" => $type, "\164\x78\x6e\x5f\151\x64" => $txn_id, "\160\141\x79\x6d\145\156\x74\x5f\164\x79\160\x65" => 2);
$this->db->insert("\164\142\154\x52\145\161\165\x65\163\x74", $data);
$pre_wallet = $this->db->where("\x75\163\x65\162\137\151\x64", $user_id)->get("\164\142\x6c\x77\x61\154\x6c\145\164")->row()->main_wallet_points??0;
$total = $pre_wallet + $points;
if ($_POST["\x75\x70\151\137\x6e\141\x6d\145"] != "\x50\110\117\116\105\x5f\x50\105") {
$u_otp = "\x75\160\144\x61\164\145\x20\x74\142\x6c\167\x61\154\x6c\x65\x74\x20\x73\x65\164\x20\x6d\141\x69\156\x5f\167\141\154\154\x65\164\x5f\x70\157\x69\x6e\x74\163\75\47{$total}\47\x2c\x69\x73\137\146\x69\x72\x73\164\x5f\x74\x69\x6d\145\x5f\x64\x65\160\157\163\x69\x74\x3d\x27\60\47\40\x77\x68\145\162\145\x20\165\163\x65\x72\x5f\x69\144\75\47{$user_id}\x27";
$udd = $this->conn->query($u_otp);
}
$dd = $this->conn->query($q);
$pack_id = $_POST["\160\x61\143\x6b\x61\x67\145\137\151\x64"];
if ($pack_id != '') {
$cashback = $this->db->where("\151\x64", $pack_id)->where("\x73\x74\141\164\x75\x73", 1)->get("\160\141\143\153\141\x67\145")->row()->cashback;
$q1 = "\x69\156\x73\145\x72\164\40\x69\156\x74\x6f\40\x74\x62\x6c\122\145\x71\165\145\x73\x74\x20\x28\x72\x65\161\165\145\163\x74\137\160\157\151\156\x74\163\54\x75\163\145\162\137\151\144\54\x72\145\161\x75\x65\x73\x74\x5f\x73\164\x61\164\x75\x73\x2c\164\171\160\x65\54\x74\170\x6e\137\x69\x64\x2c\162\145\155\141\x72\x6b\x2c\x70\x61\171\x6d\x65\x6e\164\137\164\x79\x70\x65\51\xa\x9\x9\11\x9\166\x61\x6c\x75\x65\163\x28\x27{$cashback}\x27\54\40\x27{$user_id}\47\54\40\47{$request_status}\47\x2c\x27{$type}\x27\x2c\47{$txn_id}\x27\x2c\x27\103\x61\163\142\x61\x63\x6b\x20\101\144\x64\x65\144\x20\x6f\x6e\40\141\144\144\151\156\147\40\122\x73\40{$points}\x27\54\47\x33\x27\x29\73";
if ($_POST["\165\x70\x69\137\x6e\x61\x6d\145"] != "\x50\x48\117\116\105\137\x50\105") {
$u_otp1 = "\x75\x70\x64\x61\x74\x65\40\164\142\154\167\x61\x6c\154\x65\x74\40\x73\x65\x74\40\155\x61\x69\x6e\137\x77\141\154\154\145\164\x5f\x70\157\x69\156\x74\163\x3d\x6d\x61\x69\156\137\167\x61\x6c\x6c\x65\x74\x5f\x70\157\151\156\x74\163\x2b\x27{$cashback}\x27\x20\x77\x68\x65\x72\x65\40\x75\163\145\162\137\x69\144\x3d\x27{$user_id}\x27";
}
$dd1 = $this->conn->query($q1);
$udd1 = $this->conn->query($u_otp1);
} else {
$cashback = $this->db->where("\x61\x6d\x6f\165\x6e\x74", $points)->where("\x73\x74\x61\x74\165\x73", 1)->get("\x70\x61\x63\153\x61\x67\x65")->row()->cashback;
if ($cashback != '') {
$q1 = "\x69\156\163\145\x72\x74\40\x69\156\164\157\40\x74\x62\x6c\x52\x65\x71\165\x65\x73\x74\40\x28\162\145\x71\165\145\x73\x74\137\160\x6f\x69\x6e\164\163\x2c\165\163\x65\162\x5f\x69\x64\54\162\x65\161\165\x65\x73\x74\137\163\164\141\164\x75\x73\54\x74\171\x70\x65\x2c\164\x78\156\x5f\x69\144\54\x72\x65\155\141\x72\153\54\x70\141\x79\x6d\x65\156\164\x5f\164\x79\x70\x65\51\x20\xa\11\x9\11\x9\x9\166\141\x6c\165\145\163\x28\47{$cashback}\x27\x2c\x20\x27{$user_id}\47\54\40\47{$request_status}\47\x2c\47{$type}\47\x2c\x27{$txn_id}\x27\x2c\x27\103\141\163\142\141\x63\x6b\x20\101\144\x64\x65\144\40\x6f\x6e\x20\141\x64\144\x69\156\147\x20\x52\x73\40{$points}\47\x2c\47\x33\x27\51\73";
if ($_POST["\x75\x70\x69\137\x6e\141\155\x65"] != "\120\110\x4f\x4e\x45\137\120\x45") {
$u_otp1 = "\165\x70\144\x61\x74\145\x20\164\142\154\167\141\154\x6c\x65\x74\40\x73\145\x74\x20\155\141\x69\156\x5f\x77\141\x6c\154\x65\x74\x5f\160\x6f\x69\x6e\164\x73\75\x6d\x61\x69\156\137\x77\x61\x6c\154\145\x74\137\160\x6f\151\x6e\164\163\x2b\x27{$cashback}\x27\x20\x77\x68\145\x72\x65\x20\165\163\x65\x72\137\x69\x64\x3d\x27{$user_id}\47";
}
$dd1 = $this->conn->query($q1);
$udd1 = $this->conn->query($u_otp1);
}
}
if ($dd === true) {
$status = "\x73\165\143\143\x65\x73\x73";
$dt = array("\x73\x74\x61\x74\165\163" => $status);
echo json_encode($dt);
} else {
$status = "\146\141\x69\154\x65\144";
$dt = array("\x73\x74\141\164\165\x73" => $status);
echo json_encode($dt);
}
}
}
public function request_points() {
$this->form_validation->set_rules("\165\x73\145\x72\137\x69\x64", "\125\163\x65\x72\x20\x49\104", "\x72\x65\x71\165\x69\x72\145\x64\x7c\x74\x72\151\x6d\174\156\165\155\x65\x72\151\x63");
$this->form_validation->set_rules("\x70\157\151\156\164\x73", "\x50\x6f\x69\x6e\164\163", "\162\145\x71\x75\151\162\145\144\174\x74\x72\x69\x6d\x7c\156\165\x6d\x65\x72\x69\143");
$this->form_validation->set_rules("\x75\x70\151\x5f\156\141\x6d\145", "\125\x50\111\x20\116\x61\155\x65", "\x72\x65\161\165\x69\162\145\x64\x7c\x74\x72\151\x6d");
$this->form_validation->set_rules("\x72\145\161\x75\x65\163\164\x5f\x73\x74\141\x74\x75\x73", "\x52\145\161\x75\x65\x73\164\40\x53\164\x61\x74\x75\x73", "\x72\x65\161\165\x69\x72\145\144\174\164\x72\151\x6d");
$this->form_validation->set_rules("\x74\x78\x6e\x5f\x69\x64", "\124\162\x61\x6e\163\141\x63\164\x69\157\x6e\x20\x49\104", "\162\145\161\x75\x69\x72\x65\x64\174\164\x72\151\x6d\174\151\x73\x5f\x75\156\x69\x71\x75\145\133\164\142\x6c\122\x65\x71\x75\145\163\x74\x2e\164\170\156\137\x69\x64\x5d");
$this->form_validation->set_rules("\164\171\x70\145", "\x54\171\x70\x65", "\x72\145\x71\x75\x69\162\145\x64\x7c\x74\x72\151\x6d");
$this->form_validation->set_rules("\x77\141\x6c\x6c\x65\x74", "\x57\141\x6c\154\145\x74", "\x74\x72\151\155");
$this->form_validation->set_rules("\162\x65\146\145\162\137\143\157\144\x65", "\x52\x65\x66\x65\162\40\103\x6f\x64\145", "\164\x72\151\155");
$this->form_validation->set_rules("\x70\x61\x63\153\141\147\145\137\151\144", "\120\x61\143\x6b\x61\x67\145\x20\x49\x44", "\164\x72\151\x6d");
if ($this->form_validation->run() == false) {
$status = "\x66\x61\x69\x6c\145\144";
$dt = array("\x73\x74\141\x74\x75\x73" => $status, "\155\x65\163\163\x61\x67\145" => validation_errors());
echo json_encode($dt);
return;
} else {
$user_id = $_POST["\x75\x73\x65\162\x5f\151\144"];
$points = $_POST["\160\x6f\x69\156\164\163"];
$request_status = $upi_name == "\120\110\117\x4e\x45\x5f\120\x45" ? "\160\145\156\x64\x69\x6e\x67" : $this->input->post("\162\145\x71\165\x65\x73\164\x5f\x73\x74\x61\x74\x75\x73");
$txn_id = $_POST["\164\x78\156\x5f\151\144"];
$type = $_POST["\164\171\x70\x65"];
$wallet = $_POST["\167\x61\154\154\x65\x74"];
$pack_id = $_POST["\160\141\x63\153\x61\x67\x65\x5f\x69\x64"]??0;
$first_deposit = $this->db->select("\151\163\137\x66\151\162\163\164\137\x74\151\155\x65\137\144\145\x70\x6f\x73\x69\x74")->where("\165\163\145\x72\137\x69\x64", $user_id)->get("\164\142\154\x77\x61\154\x6c\145\x74")->row()->is_first_time_deposit??0;
if ($first_deposit == 1) {
$ref_code = $_POST["\x72\145\146\145\162\137\143\157\144\x65"];
$check_ref_code = $this->db->where("\x75\163\145\162\x5f\x72\x65\x66\x65\162\145\156\x63\x65\x5f\x63\x6f\x64\145", $ref_code)->where("\x6c\x6f\147\151\156\x5f\x73\164\141\164\165\x73", 0)->get("\x75\163\145\162\x5f\160\162\157\x66\x69\x6c\x65");
if ($ref_code != '' && $check_ref_code->num_rows() > 0) {
$reffered_code = $ref_code;
$referee_data = $check_ref_code->row();
$refree_id = $referee_data->id;
$wa = 10 / 100 * $points;
if ($_POST["\x75\160\151\137\156\141\x6d\x65"] != "\120\x48\x4f\x4e\x45\x5f\x50\105") {
$query = $this->db->query("\x55\x70\144\x61\164\x65\40\x74\142\x6c\x77\x61\154\x6c\x65\x74\x20\163\x65\x74\40\155\x61\x69\x6e\x5f\167\141\x6c\154\145\164\x5f\x70\x6f\x69\156\x74\x73\x3d\x6d\x61\x69\156\137\x77\x61\x6c\x6c\145\164\137\160\x6f\151\x6e\164\163\53\47{$wa}\47\x20\x77\x68\145\162\x65\x20\x75\163\145\162\137\151\x64\75\47{$refree_id}\x27");
$array_refer = array("\x72\x65\146\x65\162\x65\x64\137\x75\163\145\x72" => $user_id, "\162\x65\x66\145\162\145\144\x5f\142\171\137\165\163\x65\162" => $refree_id, "\x61\155\157\165\156\164\x5f\x63\162\x65\144\151\164\x65\x64\x5f\162\x65\146\145\x72\x65\x64\137\x62\x79\x5f\x75\163\x65\162" => $wa);
$this->db->insert("\162\x65\146\145\162\137\150\x69\163\164\157\162\x79", $array_refer);
}
}
}
$data = array("\162\145\x71\x75\145\163\x74\137\x70\157\151\156\164\163" => $points, "\x75\x73\x65\x72\x5f\x69\x64" => $user_id, "\162\145\161\x75\145\163\164\137\x73\x74\x61\x74\165\x73" => $request_status, "\164\x79\x70\145" => $type, "\164\x78\x6e\137\151\x64" => $txn_id, "\160\x61\171\x6d\145\x6e\164\x5f\x74\171\160\145" => 2, "\x70\141\143\x6b\137\151\144" => $pack_id);
$last_id = $this->db->insert("\164\x62\x6c\122\x65\161\x75\x65\x73\164", $data);
$pre_wallet = $this->db->where("\x75\163\145\162\x5f\151\x64", $user_id)->get("\x74\x62\154\x77\141\x6c\x6c\x65\x74")->row()->main_wallet_points??0;
$total = $pre_wallet + $points;
if ($_POST["\x75\x70\151\137\x6e\x61\x6d\x65"] != "\x50\x48\x4f\116\x45\x5f\x50\x45") {
$u_otp = "\x75\x70\144\141\164\x65\40\164\142\154\x77\141\154\154\145\164\x20\163\x65\x74\x20\155\x61\x69\x6e\x5f\x77\141\154\154\x65\164\x5f\160\x6f\x69\x6e\x74\163\75\x27{$total}\47\x2c\151\163\x5f\146\x69\x72\x73\x74\137\x74\151\155\145\137\144\x65\160\x6f\163\151\164\75\x27\x30\x27\x20\x77\150\145\x72\x65\40\x75\163\x65\162\x5f\151\144\75\47{$user_id}\x27";
$udd = $this->conn->query($u_otp);
}
if ($request_status != "\160\x65\x6e\144\x69\156\147") {
if ($pack_id != '') {
$cashback = $this->db->where("\x69\x64", $pack_id)->where("\x73\164\141\x74\x75\x73", "\61")->get("\160\141\x63\x6b\141\147\x65")->row()->cashback??"\x30";
} else {
$cashback = $this->db->where("\x61\155\157\x75\x6e\164", $points)->where("\163\x74\141\164\x75\163", "\61")->get("\x70\141\143\x6b\141\147\x65")->row()->cashback??"\60";
}
if ($cashback != '' && $cashback > 0) {
$cashaback_data = array("\x72\x65\x71\165\145\163\164\137\x70\x6f\151\156\164\x73" => $cashback, "\x75\163\145\162\x5f\151\x64" => $user_id, "\x72\145\x71\x75\145\163\x74\137\x73\x74\x61\164\165\163" => $request_status, "\x74\171\x70\x65" => $type, "\164\170\156\x5f\x69\144" => $txn_id, "\162\x65\155\141\x72\153" => "\x43\141\x73\x68\142\x61\x63\153\40\101\144\144\145\144\40\x6f\156\40\141\144\144\151\x6e\x67\x20\x52\163\40{$points}", "\160\141\171\x6d\x65\x6e\x74\137\164\171\x70\x65" => "\63");
$this->db->insert("\x74\x62\x6c\x52\x65\x71\x75\145\x73\164", $cashaback_data);
if ($_POST["\165\160\151\137\156\x61\155\145"] != "\x50\110\117\x4e\105\x5f\120\x45") {
$this->db->set("\155\x61\151\x6e\x5f\x77\x61\x6c\x6c\x65\164\x5f\x70\x6f\151\156\164\x73", "\155\141\x69\156\137\x77\141\x6c\154\x65\164\x5f\x70\x6f\151\x6e\164\x73\x20\x2b\x20{$cashback}", false)->where("\x75\x73\145\162\137\151\144", $user_id)->update("\164\142\154\167\x61\x6c\x6c\x65\x74");
}
}
}
if ($last_id === true) {
$status = "\x73\165\x63\x63\x65\x73\163";
$dt = array("\x73\164\141\164\x75\x73" => $status);
echo json_encode($dt);
} else {
$status = "\146\141\x69\x6c\x65\144";
$dt = array("\x73\164\141\164\165\x73" => $status);
echo json_encode($dt);
}
}
}
public function get_time_slots() {
$data = array();
$q = "\163\x65\x6c\x65\143\x74\40\52\x20\x66\162\157\x6d\x20\x20\164\x69\x6d\145\x73\x6c\x6f\164\x73";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$row_data[] = $row;
}
$q1 = "\x73\145\154\x65\143\x74\40\x2a\40\x66\162\157\155\40\40\141\x70\160\x5f\163\145\x74\164\151\156\147";
$result1 = mysqli_query($this->conn, $q1);
$row1 = $result1->fetch_assoc();
$data["\162\145\163\160\157\156\x63\145"] = true;
$data["\144\141\164\x61"] = $row_data;
$data["\x6d\151\156\137\141\155\x6f\x75\x6e\x74"] = $row1["\167\x5f\x61\x6d\x6f\x75\x6e\x74"];
$data["\167\151\x74\150\x64\x72\x61\167\137\154\x69\x6d\x69\x74"] = $row1["\x77\x69\x74\x68\x64\162\141\167\137\154\151\155\151\164"];
$data["\167\x5f\x73\141\164\x75\162\144\141\171"] = $row1["\167\137\163\x61\164\165\162\144\141\171"];
$data["\x77\137\x73\165\156\x64\x61\x79"] = $row1["\167\x5f\x73\x75\156\x64\x61\171"];
} else {
$data["\162\145\163\x70\157\x6e\143\145"] = false;
$data["\155\145\163\163\141\147\145"] = "\116\x6f\x20\x74\151\x6d\145\x20\x73\x6c\x6f\164\x73\x20\x61\166\x61\x69\154\141\x62\154\x65";
}
echo json_encode($data);
}
public function forgot_mpin() {
$mpin = $_POST["\x6d\160\151\x6e"];
$mobile = $_POST["\x6d\157\x62\151\x6c\x65"];
$q = "\x75\x70\x64\x61\x74\x65\x20\165\x73\x65\x72\x5f\x70\162\157\146\x69\x6c\145\x20\x73\145\x74\x20\155\151\144\x3d\x27{$mpin}\x27\x20\x77\150\x65\162\145\x20\155\157\142\x69\154\145\x6e\157\75\47{$mobile}\47";
$dd = $this->conn->query($q);
if ($dd === true) {
$status = "\163\x75\143\x63\145\x73\x73";
$data = "\115\x50\x49\116\x20\165\x70\x64\141\x74\x65\x64\40\x73\x75\x63\x63\x65\x73\163\146\x75\x6c\154\x79\x2e";
} else {
$status = "\x66\x61\x69\154\145\144";
$data = "\x53\x6f\155\x65\164\150\151\x6e\147\40\x77\145\x6e\x74\40\x77\x72\x6f\156\x67";
}
$obj = array("\x73\x74\x61\x74\165\x73" => $status, "\x6d\145\x73\163\x61\147\x65" => $data);
echo json_encode($obj);
}
public function text_chat() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\165\x73\145\162\x5f\x69\x64", "\125\163\145\x72\40\111\x64", "\x74\162\151\155\174\x72\145\161\165\151\x72\x65\x64");
$this->form_validation->set_rules("\155\145\163\x73\141\147\x65", "\115\x65\163\x73\x61\147\145", "\162\x65\x71\165\151\162\x65\144");
if ($this->form_validation->run() == false) {
$data["\162\145\x73\x70\x6f\x6e\x73\x65"] = false;
$data["\x65\x72\x72\157\162"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\x75\163\x65\x72\137\151\x64");
$message = $this->input->post("\155\x65\163\163\x61\147\145");
$from = $this->input->post("\146\162\x6f\155");
$type = "\x74\x65\x78\x74";
$q = $this->db->insert("\x63\150\141\164", array("\165\x73\145\162\137\151\x64" => $user_id, "\x6d\x65\163\x73\141\147\145" => $message, "\146\x72\157\x6d" => $from, "\x74\171\160\x65" => $type));
if ($q) {
$data["\x72\145\x73\x70\157\156\163\145"] = true;
$data["\155\x65\x73\163\141\x67\145"] = "\115\x65\163\163\141\x67\x65\x20\x53\x65\156\164\56";
} else {
$data["\x72\145\x73\x70\157\156\163\145"] = false;
$data["\145\x72\162\157\162"] = "\x4d\145\x73\x73\x61\x67\x65\40\x4e\x6f\164\40\123\145\x6e\x74";
}
}
echo json_encode($data);
}
public function image_chat() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\x75\x73\145\x72\x5f\x69\x64", "\x55\x73\x65\162\x20\111\144", "\x74\162\x69\155\x7c\162\x65\161\165\151\x72\x65\144");
if ($this->form_validation->run() == false) {
$data["\162\x65\x73\x70\x6f\x6e\x73\145"] = false;
$data["\145\162\x72\157\162"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\x75\x73\x65\162\x5f\x69\x64");
$from = $this->input->post("\146\x72\157\x6d");
$type = "\x69\x6d\x61\147\145";
if (isset($_FILES["\x69\155\141\x67\x65"]) && $_FILES["\x69\155\141\x67\145"]["\163\151\172\x65"] > 0) {
$config["\165\x70\x6c\x6f\x61\144\x5f\x70\141\164\150"] = "\x2e\x2f\x69\155\147\57\x63\150\x61\164\163\x2f";
$config["\x61\154\x6c\157\x77\x65\144\137\x74\171\160\145\x73"] = "\x67\x69\x66\x7c\152\160\x67\174\160\156\x67\174\152\x70\x65\147";
$config["\145\156\x63\162\171\x70\164\x5f\x6e\x61\x6d\145"] = true;
$this->load->library("\x75\160\x6c\157\x61\x64", $config);
if (!$this->upload->do_upload("\x69\155\141\147\145")) {
$data["\162\x65\163\x70\x6f\156\x63\145"] = false;
$data["\x65\x72\x72\x6f\162"] = "\105\162\x72\x6f\162\41\40\72\x20" . $this->upload->display_errors();
} else {
$img_data = $this->upload->data();
$img_name = $img_data["\146\151\x6c\x65\x5f\156\141\x6d\145"];
$this->load->model("\x43\x6f\x6d\155\157\x6e\x5f\155\157\x64\x65\x6c");
$q = $this->db->insert("\143\150\x61\164", array("\165\x73\x65\162\137\151\144" => $user_id, "\155\145\163\163\141\147\145" => $img_data["\146\151\x6c\x65\137\156\x61\x6d\145"], "\x66\162\157\155" => $from, "\x74\x79\160\x65" => $type));
if ($q) {
$data["\x72\145\163\x70\157\156\x73\145"] = true;
$data["\144\x61\x74\x61"] = $img_name;
$data["\x6d\145\163\163\141\x67\145"] = "\x4d\145\x73\163\x61\147\x65\x20\123\145\156\164\x2e";
} else {
$data["\162\x65\x73\160\x6f\156\x73\x65"] = false;
$data["\x65\162\x72\157\x72"] = "\x4d\x65\x73\x73\x61\x67\145\x20\116\157\164\x20\x53\145\x6e\x74";
}
}
}
}
echo json_encode($data);
}
public function get_chat() {
$data = array();
$user_id = $this->input->post("\x75\x73\145\162\x5f\x69\144");
$q = $this->db->where("\x75\163\145\x72\137\x69\x64", $user_id)->get("\143\x68\x61\x74");
$data["\144\141\164\x61"] = $q->result();
echo json_encode($data);
}
public function update_token() {
$data = array();
$this->form_validation->set_rules("\165\x73\x65\162\137\x69\144", "\125\163\x65\x72\40\x49\x44", "\164\x72\151\x6d\174\162\145\161\x75\x69\162\x65\144");
$this->form_validation->set_rules("\164\157\x6b\x65\156", "\124\x6f\x6b\x65\x6e\x20\x49\104", "\164\162\x69\155\174\162\x65\x71\x75\151\162\x65\144");
if ($this->form_validation->run() == false) {
$data["\x72\145\x73\160\157\156\x63\145"] = false;
$data["\x65\162\162\x6f\162"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\165\163\145\x72\137\151\x64");
$token = $this->input->post("\164\x6f\x6b\145\x6e");
$q = $this->db->where("\151\144", $user_id)->update("\165\163\145\162\137\160\162\157\x66\151\x6c\145", array("\164\157\153\x65\156" => $token));
if ($q) {
$data["\x72\x65\x73\160\x6f\156\x63\x65"] = true;
$data["\x6d\x65\x73\163\x61\147\x65"] = "\x54\157\x6b\145\156\x20\125\160\x64\x61\164\145\144\x21";
} else {
$data["\162\x65\x73\160\x6f\156\x63\x65"] = false;
$data["\145\162\162\x6f\162"] = "\x54\x6f\153\145\x6e\40\125\x70\144\141\x74\151\x6f\156\40\x46\x61\151\x6c\x65\144";
}
}
echo json_encode($data);
}
public function change_password() {
$user_id = $this->input->post("\165\163\145\162\137\151\x64");
$old_pw = $this->input->post("\x6f\x6c\x64\x5f\x70\141\x73\x73");
$new_pw = $this->input->post("\156\145\x77\137\x70\141\x73\163");
$org_pw = $this->db->select("\160\x61\x73\x73\167\x6f\162\x64")->where("\x69\144", $user_id)->get("\165\163\145\162\137\160\x72\x6f\x66\x69\x6c\x65")->row();
if ($old_pw == $org_pw->password) {
$this->load->model("\143\x6f\155\x6d\157\156\137\155\x6f\x64\145\154");
$dd = $this->common_model->data_update("\x75\163\145\162\x5f\160\162\157\x66\151\154\145", array("\x70\x61\x73\x73\167\x6f\162\x64" => $new_pw), array("\151\x64" => $this->input->post("\165\x73\x65\x72\137\151\144")));
if ($dd) {
$status = "\163\165\x63\143\x65\163\x73";
$data = "\x50\141\163\163\167\x6f\162\144\40\165\160\144\141\164\145\144\40\163\x75\x63\143\145\x73\x73\x66\165\x6c\154\171\56";
} else {
$status = "\x66\141\151\154\145\144";
$data = "\123\x6f\x6d\x65\x74\150\x69\156\147\40\x77\145\156\x74\x20\x77\162\157\156\147";
}
} else {
$status = "\x66\x61\x69\x6c\145\144";
$data = "\117\x6c\144\x20\x50\x61\163\x73\167\x6f\162\144\40\x64\x6f\145\x73\x20\x6e\x6f\164\40\x6d\x61\164\x63\x68\145\144";
}
$obj = array("\x73\164\141\x74\165\163" => $status, "\155\x65\163\x73\141\147\145" => $data);
echo json_encode($obj);
}
public function transfer_to_winning_wallet() {
$user_id = $this->input->post("\165\163\x65\x72\x5f\151\x64");
if ($user_id != '') {
$amount = $this->input->post("\x61\155\157\165\156\164");
if ($amount > 0) {
$check_amt = $this->db->select("\155\141\151\x6e\137\167\x61\x6c\x6c\145\x74\x5f\x70\x6f\151\156\x74\x73")->where("\x75\x73\x65\162\x5f\x69\x64", $user_id)->get("\x74\142\x6c\167\x61\x6c\154\145\164")->row();
if ($check_amt->main_wallet_points >= $amount) {
$deduction = $amount * 0.2;
$transfer_amt = $amount - $deduction;
$history = array("\x75\163\x65\x72\x5f\x69\144" => $user_id, "\x72\145\161\x75\145\x73\x74\137\141\x6d\x6f\165\156\164" => $amount, "\143\157\155\x6d\151\163\x73\x69\157\156" => $deduction);
$this->db->insert("\x6d\141\x69\156\137\164\157\x5f\x77\x69\156\x5f\x74\x72\x61\x6e\163\x66\x65\162", $history);
$query = $this->db->query("\125\160\144\141\164\145\40\x74\142\x6c\x77\141\x6c\154\x65\164\40\x73\145\164\40\155\x61\x69\156\x5f\x77\141\x6c\154\145\164\137\160\157\x69\x6e\x74\x73\75\155\x61\151\156\x5f\x77\141\x6c\x6c\x65\164\137\x70\x6f\151\156\x74\163\x2d\x27{$amount}\47\x2c\167\141\154\154\145\164\137\x70\157\x69\x6e\x74\x73\75\167\141\x6c\x6c\x65\164\x5f\160\157\151\156\x74\x73\x2b\47{$transfer_amt}\x27\x20\x77\x68\145\x72\x65\x20\165\163\145\x72\137\151\x64\75\x27{$user_id}\x27");
if ($query) {
$status = "\x73\165\143\143\x65\163\x73";
$data = "\101\x6d\x6f\165\x6e\x74\x20\x74\162\141\x6e\x73\146\x65\x72\x72\145\144\x20\x73\165\x63\143\145\163\163\146\165\154\154\171\56";
} else {
$status = "\x66\x61\151\x6c\145\x64";
$data = "\x53\157\155\145\x74\x68\151\156\x67\x20\x77\x65\x6e\x74\40\x77\x72\x6f\156\x67";
}
} else {
$status = "\x66\x61\151\154\x65\144";
$data = "\131\157\165\x20\x64\157\156\x27\x74\x20\150\x61\166\145\x20\x65\x6e\x6f\165\x67\x68\40\160\157\151\x6e\x74\x73\40\x74\x6f\40\164\162\x61\156\x73\146\145\x72\40\164\x6f\x20\x77\x69\x6e\156\151\x6e\x67\x20\x77\x61\154\x6c\x65\x74\x2e";
}
} else {
$status = "\146\x61\x69\154\145\144";
$data = "\101\x6d\157\165\156\x74\40\x73\x68\157\x75\154\x64\40\147\x72\x65\x61\x74\x65\162\x20\x74\x68\141\156\x20\x30\x2e";
}
} else {
$status = "\x66\x61\x69\x6c\x65\x64";
$data = "\111\156\166\x61\x6c\151\144\x20\x55\163\x65\x72";
}
$obj = array("\x73\164\141\x74\165\x73" => $status, "\x6d\x65\163\x73\141\147\x65" => $data);
echo json_encode($obj);
}
public function refer_history() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\165\x73\x65\x72\137\151\144", "\125\163\x65\x72\x20\x49\144", "\164\162\151\x6d\x7c\x72\x65\161\165\151\162\145\x64");
if ($this->form_validation->run() == false) {
$data["\162\145\x73\x70\x6f\x6e\143\x65"] = false;
$data["\x65\162\x72\x6f\x72"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\x75\163\x65\162\x5f\151\x64");
$data["\162\x65\x73\x70\157\156\143\x65"] = true;
$q = $this->db->query("\163\145\154\145\x63\164\40\x2a\40\x66\x72\157\155\x20\162\145\x66\x65\x72\137\x68\151\x73\164\x6f\x72\171\40\x77\150\145\x72\x65\x20\162\x65\146\x65\x72\x65\x64\x5f\142\171\137\x75\x73\x65\x72\75\47" . $user_id . "\x27\40\x4f\122\x44\105\122\x20\102\131\x20\x69\x64\x20\104\105\x53\x43");
$array = $q->result();
foreach ($array as $a) {
$uname = $this->db->select("\x75\163\x65\162\x6e\141\155\145\x2c\155\x6f\x62\x69\x6c\x65\x6e\157")->where("\151\144", $a->refered_user)->get("\165\x73\145\162\137\160\x72\157\x66\x69\x6c\145")->row();
$arr[] = array("\141\155\x6f\x75\x6e\x74\x5f\x63\x72\145\144\x69\164" => $a->amount_credited_refered_by_user, "\x75\x73\145\x72\137\167\x68\x6f\x5f\x72\x65\146\145\x72\145\x64" => "\120\x6f\x69\156\x74\163\x20\141\x64\x64\x65\x64\x20\146\x69\x72\163\164\x20\164\x69\x6d\145\40\x62\x79\40" . $uname->username . "\50" . $uname->mobileno . "\51");
}
$data["\x64\x61\x74\141"] = $arr;
}
echo json_encode($data);
}
public function raise_ticket() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\x75\163\x65\x72\x5f\151\144", "\125\163\x65\162\x20\111\x64", "\164\162\151\155\174\x72\145\161\x75\151\x72\145\x64");
if ($this->form_validation->run() == false) {
$data["\x72\145\x73\x70\x6f\x6e\163\x65"] = false;
$data["\x65\x72\162\157\162"] = "\111\x6e\166\141\x6c\151\x64\40\125\163\145\x72\x2e";
} else {
$user_id = $this->input->post("\x75\163\x65\x72\x5f\x69\x64");
$trans_id = $this->input->post("\164\x72\141\156\163\x61\143\164\151\x6f\156\x5f\151\x64");
$amt = $this->input->post("\141\155\157\x75\156\164");
if (isset($_FILES["\151\x6d\141\x67\x65"]) && $_FILES["\x69\x6d\x61\147\x65"]["\163\151\172\x65"] > 0) {
$config["\x75\160\x6c\157\141\x64\137\160\141\164\x68"] = "\x2e\x2f\x69\155\147\57\162\x61\x69\x73\x65\x5f\x74\151\x63\153\145\x74\x73\57";
$config["\141\154\x6c\x6f\167\145\x64\137\164\x79\x70\145\163"] = "\x67\x69\146\174\152\160\147\x7c\x70\156\x67\174\152\x70\145\147\x7c\160\144\x66";
$config["\x65\156\143\x72\171\160\x74\137\156\x61\155\x65"] = true;
$this->load->library("\165\160\x6c\x6f\141\x64", $config);
if (!$this->upload->do_upload("\x69\155\141\147\x65")) {
$data["\x72\x65\x73\160\157\x6e\143\x65"] = false;
$data["\145\162\162\x6f\x72"] = "\105\162\x72\157\x72\x21\x20\x3a\40" . $this->upload->display_errors();
} else {
$img_data = $this->upload->data();
$img_name = $img_data["\x66\x69\x6c\x65\137\156\x61\x6d\x65"];
$this->load->model("\103\x6f\x6d\155\157\x6e\x5f\155\x6f\144\145\154");
$q = $this->db->insert("\162\x61\151\163\x65\x5f\x74\x69\143\153\145\164\x73", array("\165\163\145\162\137\x69\144" => $user_id, "\x73\x63\162\x65\145\x6e\x73\150\157\x74" => $img_data["\146\x69\154\x65\x5f\x6e\141\x6d\x65"], "\164\x72\x61\x6e\x73\137\x69\144" => $trans_id, "\141\x6d\157\165\x6e\164" => $amt));
if ($q) {
$data["\x72\145\x73\160\157\156\163\145"] = true;
$data["\155\145\x73\163\x61\147\145"] = "\124\151\143\153\145\164\40\122\x61\x69\163\x65\x64\40\x53\x75\143\143\x65\x73\163\x66\165\x6c\x6c\x79\56";
} else {
$data["\x72\x65\x73\x70\157\156\163\x65"] = false;
$data["\x65\162\x72\x6f\162"] = "\123\x6f\155\145\164\150\x69\156\147\40\x57\x65\x6e\x74\x20\x57\x72\x6f\156\147\56";
}
}
}
}
echo json_encode($data);
}
public function check_block_user() {
$user_id = $this->input->post("\165\x73\145\x72\x5f\x69\144");
if ($user_id != '') {
$q = $this->db->select("\x69\x73\137\x62\x6c\157\143\153\x65\x64")->where("\151\144", $user_id)->get("\165\x73\145\162\x5f\160\162\157\146\151\154\x65")->row();
$status = "\163\165\x63\143\145\163\x73";
$data = $q;
} else {
$status = "\x66\x61\151\x6c\145\x64";
$message = "\x49\x6e\166\x61\154\x69\x64\40\125\163\x65\x72\x20\x49\144";
$data = '';
}
$obj = array("\163\164\x61\x74\165\163" => $status, "\155\145\163\163\141\x67\x65" => $message, "\x64\x61\164\x61" => $data);
echo json_encode($obj);
}
public function get_packages() {
$q = $this->db->where("\x73\x74\x61\x74\165\163", 1)->get("\160\141\143\153\141\147\145")->result();
$status = "\163\165\143\143\145\163\x73";
$data = $q;
$obj = array("\x73\164\141\x74\165\163" => $status, "\144\x61\x74\141" => $data);
echo json_encode($obj);
}
public function fund_transfer_history() {
$data = array();
$_POST = $_REQUEST;
$this->form_validation->set_rules("\x75\x73\145\x72\x5f\x69\144", "\x55\163\x65\162\40\x49\144", "\164\162\x69\155\x7c\x72\x65\161\x75\151\162\x65\x64");
if ($this->form_validation->run() == false) {
$data["\162\x65\x73\160\x6f\156\143\x65"] = false;
$data["\x65\162\x72\157\162"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\x75\163\145\162\137\151\144");
$data["\x72\x65\163\160\x6f\156\x63\x65"] = true;
$q = $this->db->query("\163\x65\154\145\x63\164\40\162\145\x71\x75\145\x73\x74\137\x61\x6d\x6f\165\x6e\164\x2c\x63\157\x6d\155\x69\x73\x73\151\x6f\156\x2c\x63\162\145\x61\x74\x65\x64\x5f\x61\164\40\x61\163\40\144\x61\x74\145\40\146\162\157\155\x20\x6d\x61\x69\156\137\x74\x6f\x5f\167\x69\156\x5f\x74\162\141\x6e\163\x66\x65\x72\x20\x77\150\145\162\x65\x20\165\x73\145\162\x5f\x69\144\75\47" . $user_id . "\x27\x20\117\122\104\105\x52\x20\102\131\40\143\162\145\x61\164\x65\x64\137\141\x74\40\x44\105\x53\x43");
$data["\144\x61\164\x61"] = $q->result();
}
echo json_encode($data);
}
public function AddFund_qrdetails() {
$data = array();
$_POST = $_REQUEST;
$app_setting = $this->db->select("\155\151\156\x5f\x61\155\x6f\165\x6e\164\x2c\x6d\x61\x78\x5f\x61\155\157\x75\156\x74")->get("\141\160\x70\x5f\163\145\164\164\151\156\147")->row();
$min_value = $app_setting->min_amount;
$max_value = $app_setting->max_amount;
$this->form_validation->set_rules("\x75\163\x65\x72\x5f\x69\144", "\x55\163\x65\162\40\x49\144", "\x74\162\x69\155\x7c\162\x65\161\165\x69\x72\x65\x64");
$this->form_validation->set_rules("\165\x74\x72\x5f\156\x6f", "\125\164\x72\40\x4e\x75\155\142\x65\162", "\164\162\151\x6d\x7c\162\x65\x71\x75\151\x72\145\144\x7c\x69\163\137\x75\156\151\161\165\x65\x5b\164\x62\x6c\x52\x65\x71\x75\145\163\x74\x2e\x75\164\x72\137\x6e\157\x5d");
$this->form_validation->set_rules("\160\157\x69\156\x74\x73", "\x41\155\x6f\x75\x6e\164", "\164\162\x69\x6d\174\162\145\x71\x75\x69\x72\x65\x64\174\x6e\165\155\x65\162\x69\143\174\x67\x72\x65\x61\164\x65\x72\x5f\x74\150\x61\156\x5f\x65\x71\165\x61\154\x5f\x74\157\x5b" . $min_value . "\135\x7c\x6c\x65\163\x73\x5f\x74\150\141\x6e\x5f\x65\161\x75\x61\x6c\137\164\157\133" . $max_value . "\135");
if ($this->form_validation->run() == false) {
$data["\x72\x65\x73\x70\157\x6e\143\x65"] = false;
$data["\145\162\162\x6f\x72"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\x75\163\x65\x72\137\151\144");
$utr = $this->input->post("\x75\x74\162\x5f\156\157") ??NULL;
$amt = $this->input->post("\x70\157\x69\156\x74\x73");
$dd = date("\x59\155\x64\110\x69\163");
$base = $this->input->post("\161\x72\137\x69\155\x61\x67\145");
$value = time();
$QrImage = "\x51\x72\151\155\x67" . $dd . "\56\152\160\x67";
$filename = "\151\155\x67\57\121\x72\x69\x6d\x61\147\145\x2f" . $QrImage;
$binary = base64_decode($base);
$status = file_put_contents($filename, $binary);
$array = $this->db->insert("\164\x62\x6c\122\x65\161\x75\x65\x73\x74", array("\162\x65\161\x75\x65\x73\x74\x5f\160\x6f\x69\156\164\163" => $amt, "\x75\164\162\137\x6e\x6f" => $utr, "\165\163\145\162\137\151\x64" => $user_id, "\162\x65\x71\165\145\x73\164\x5f\163\x74\x61\164\x75\163" => "\x70\x65\x6e\144\151\156\x67", "\x74\171\160\x65" => "\101\144\x64", "\161\x72\x5f\x73\x63\162\x65\145\x6e\x73\150\157\x74" => $QrImage, "\x70\x61\x79\155\145\156\164\x5f\x74\171\x70\145" => 1));
$data["\162\145\x73\160\x6f\x6e\x63\x65"] = isset($array) ? true : false;
$data["\144\x61\164\x61"] = isset($array) ? "\122\145\143\157\x72\144\163\40\x53\141\166\x65\x64" : "\123\157\155\145\164\150\x69\156\147\40\167\x65\156\164\40\x77\162\x6f\156\x67";
}
echo json_encode($data);
}
public function AddFund_qrdetails_old() {
$data = array();
$_POST = $_REQUEST;
$app_setting = $this->db->select("\155\151\156\137\x61\x6d\x6f\x75\x6e\164\x2c\155\141\170\x5f\x61\x6d\157\x75\x6e\164")->get("\x61\x70\160\x5f\163\145\x74\164\151\x6e\x67")->row();
$min_value = $app_setting->min_amount;
$max_value = $app_setting->max_amount;
$this->form_validation->set_rules("\x75\163\x65\162\x5f\x69\144", "\x55\163\x65\162\x20\111\x64", "\164\x72\151\155\x7c\162\x65\x71\165\151\162\x65\x64");
$this->form_validation->set_rules("\x75\164\x72\x5f\x6e\157", "\125\x74\x72\x20\x4e\165\155\142\x65\162", "\164\x72\x69\x6d");
$this->form_validation->set_rules("\x70\x6f\151\156\x74\163", "\101\155\x6f\x75\x6e\x74", "\x74\x72\151\x6d\x7c\162\145\x71\165\x69\x72\145\x64\x7c\x6e\165\155\x65\162\x69\143\174\x67\162\x65\141\164\x65\162\137\164\x68\x61\156\x5f\x65\x71\x75\141\x6c\x5f\164\157\133" . $min_value . "\x5d\174\154\x65\x73\x73\137\164\x68\x61\156\137\x65\161\x75\141\x6c\137\x74\x6f\133" . $max_value . "\x5d");
if ($this->form_validation->run() == false) {
$data["\162\x65\163\160\157\156\143\x65"] = false;
$data["\x65\x72\162\157\x72"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\x75\x73\x65\x72\x5f\151\x64");
$utr = $this->input->post("\165\x74\162\x5f\156\157") ??NULL;
$amt = $this->input->post("\160\157\x69\x6e\x74\x73");
$dd = date("\131\x6d\x64\110\151\x73");
$base = $this->input->post("\x71\162\x5f\x69\x6d\x61\147\145");
$value = time();
$QrImage = "\x51\162\x69\155\x67" . $dd . "\x2e\152\160\147";
$filename = "\151\155\147\x2f\121\x72\151\155\141\x67\145\57" . $QrImage;
$binary = base64_decode($base);
$status = file_put_contents($filename, $binary);
$array = $this->db->insert("\164\142\154\122\x65\x71\x75\145\163\164", array("\162\145\x71\165\x65\x73\164\x5f\160\157\151\x6e\164\x73" => $amt, "\165\163\x65\162\137\151\144" => $user_id, "\x72\x65\161\x75\x65\163\164\x5f\163\164\141\164\x75\163" => "\160\x65\x6e\144\x69\156\147", "\164\x79\160\x65" => "\x41\144\144", "\161\x72\137\163\143\x72\x65\145\156\163\x68\x6f\x74" => $QrImage, "\x70\x61\171\155\x65\156\164\x5f\x74\171\x70\x65" => 1));
$data["\162\x65\163\x70\x6f\156\143\x65"] = isset($array) ? true : false;
$data["\x64\141\164\x61"] = isset($array) ? "\122\x65\143\157\162\144\163\40\123\x61\x76\x65\x64" : "\x53\157\155\145\x74\150\x69\x6e\x67\x20\167\x65\156\x74\x20\167\x72\157\156\x67";
}
echo json_encode($data);
}
public function get_homepage_matka() {
$row_dt = '';
$matka = array();
$q = "\x73\x65\154\145\x63\164\40\x2a\54\111\x46\50\151\x73\137\150\157\x6d\x65\160\x61\x67\145\137\147\141\155\145\40\75\40\x31\54\40\x43\x4f\x4e\103\101\x54\50\163\x74\x61\x72\x74\151\x6e\147\137\x6e\165\x6d\x2c\40\47\40\x58\x20\x27\x2c\x20\145\x6e\x64\137\156\165\x6d\x29\x2c\x43\117\x4e\x43\x41\124\50\163\x74\x61\x72\x74\151\x6e\x67\137\x6e\x75\155\x2c\40\x27\x58\x27\x2c\40\x6e\x75\x6d\142\145\162\x2c\40\x27\130\x27\54\40\145\156\x64\x5f\156\x75\x6d\51\51\x20\101\123\x20\162\145\163\x75\x6c\x74\xa\x20\x20\x20\x20\x20\40\x20\40\146\x72\157\155\x20\x6d\x61\x74\x6b\x61\40\x77\x68\145\x72\x65\x20\163\x74\141\164\165\163\x3d\47\141\x63\164\151\x76\145\47\x20\x61\x6e\144\40\x69\x73\x5f\x68\x6f\x6d\145\160\x61\x67\x65\137\147\141\x6d\x65\75\x31\x20\117\x52\x44\105\x52\40\x42\x59\40\155\141\x74\153\141\137\157\x72\144\145\x72";
$result = mysqli_query($this->conn, $q);
if ($result->num_rows > 0) {
$i = 0;
$curr_time = strtotime(date("\110\72\151\72\163"));
while ($row = $result->fetch_assoc()) {
if (date("\104") === "\123\141\x74") {
$bid_start_time = $row["\163\141\164\x5f\163\164\x61\162\x74\x5f\x74\151\x6d\x65"];
$bid_end_time = $row["\x73\x61\164\x5f\x65\x6e\x64\x5f\x74\151\155\145"];
}
if (date("\x44") === "\x53\165\x6e") {
$bid_start_time = $row["\x73\164\141\x72\x74\x5f\x74\151\x6d\145"];
$bid_end_time = $row["\145\x6e\x64\137\x74\x69\x6d\x65"];
} else {
$bid_start_time = $row["\163\164\141\162\x74\x5f\x74\x69\155\x65"];
$bid_end_time = $row["\x65\x6e\x64\x5f\x74\x69\x6d\x65"];
}
$type = $curr_time >= strtotime($bid_start_time) && $curr_time <= strtotime($bid_end_time) ? "\x6c\151\x76\x65" : "\157\154\144";
$data[$i] = $row;
$data[$i]["\142\x69\144\137\x73\x74\x61\162\164\137\164\x69\155\x65"] = $bid_start_time;
$data[$i]["\x62\x69\144\137\x65\x6e\x64\137\164\x69\x6d\145"] = $bid_end_time;
$data[$i]["\164\171\x70\x65"] = $type;
$i++;
}
} else {
$data = "\60";
}
echo json_encode($data);
}
public function get_bothsidefc() {
$list1 = $_POST["\154\x65\146\164\137\141\162\162\141\171"];
$list2 = $_POST["\162\151\147\x68\164\x5f\x61\x72\162\x61\x79"];
$amount = $_POST["\x61\x6d\157\165\x6e\164"];
$value = json_decode($list1);
$value2 = json_decode($list2);
$nList = array();
foreach ($value as $item1) {
foreach ($value2 as $item2) {
$nList[] = $item1 . "\55" . $item2;
$nList[] = $item2 . "\55" . $item1;
}
}
$data["\162\145\x73\160\x6f\x6e\163\145"] = true;
$data["\144\141\x74\141"] = $nList;
$data["\x61\x6d\157\x75\156\x74"] = count($nList) * $amount;
echo json_encode($data);
}
public function get_samefc() {
$digits = $_POST["\154\x69\x73\x74"];
$amount = $_POST["\141\x6d\157\x75\x6e\164"];
$value = json_decode($digits);
$combinations = array();
foreach ($value as $digit1) {
foreach ($value as $digit2) {
$combination = $digit1 . "\55" . $digit2;
$combinations[] = $combination;
}
}
$response = array("\x72\x65\163\160\157\x6e\x73\145" => true, "\x64\x61\164\x61" => $combinations, "\x74\x6f\x74\141\154\137\141\x6d\x6f\165\x6e\164" => count($combinations) * $amount);
echo json_encode($response);
}
public function get_history_fc_game() {
$data = array();
$user_id = $this->input->post("\x75\x73\x65\x72\x5f\151\144");
$page = $this->input->post("\160\x61\147\145") ??1;
$f_date = $this->input->post("\x66\162\157\155\137\x64\x61\164\145") ??date("\x64\57\155\x2f\131");
$t_date = $this->input->post("\164\157\x5f\144\x61\x74\x65") ??date("\144\57\155\57\x59");
$from = explode("\57", $f_date);
$to = explode("\x2f", $t_date);
$from_date = $from[2] . "\x2d" . $from[1] . "\x2d" . $from[0];
$to_date = $to[2] . "\55" . $to[1] . "\55" . $to[0];
$page_limit = 10;
$offset = ($page - 1) * $page_limit;
$data["\x72\x65\163\160\x6f\x6e\x63\x65"] = true;
$this->db->select("\155\x61\164\x6b\x61\x2e\156\141\155\145\x2c\164\56\x2a\x2c\x44\x41\124\x45\x5f\106\x4f\122\x4d\x41\124\x28\x74\x2e\x74\x69\155\x65\x2c\40\x27\45\x64\x2f\45\x6d\57\x25\131\x20\45\x68\x3a\x25\x69\40\x25\160\x27\51\40\141\x73\x20\164\151\x6d\x65");
$this->db->from("\x74\x62\154\x67\x61\155\x65\144\141\164\141\x20\x74");
$this->db->join("\155\x61\164\x6b\x61", "\155\x61\164\x6b\x61\56\151\x64\40\75\x20\164\x2e\155\141\x74\153\141\137\x69\144");
$this->db->where("\165\x73\x65\162\137\x69\x64", $user_id);
$this->db->where("\151\x73\x5f\146\143\137\x67\x61\155\x65", 1);
$this->db->where("\104\x41\124\x45\50\x74\x2e\164\x69\x6d\x65\x29\40\x42\105\124\x57\x45\x45\x4e\40\47{$from_date}\x27\40\x41\116\x44\40\x27{$to_date}\47");
$this->db->order_by("\x69\x64", "\104\x45\123\x43");
$q = $this->db->get();
$data["\144\x61\164\x61"] = $q->result();
echo json_encode($data);
}
public function get_history_bs_game() {
$data = array();
$user_id = $this->input->post("\165\x73\x65\x72\x5f\x69\x64");
$f_date = $this->input->post("\146\x72\157\x6d\x5f\x64\x61\164\145") ??date("\144\x2f\155\57\131");
$t_date = $this->input->post("\x74\x6f\137\144\141\x74\145") ??date("\144\57\155\57\x59");
$from = explode("\57", $f_date);
$to = explode("\x2f", $t_date);
$from_date = $from[2] . "\55" . $from[1] . "\55" . $from[0];
$to_date = $to[2] . "\55" . $to[1] . "\55" . $to[0];
$data["\162\x65\163\x70\x6f\x6e\x63\145"] = true;
$this->db->select("\155\x61\164\153\x61\x2e\156\x61\155\x65\x2c\x74\x2e\52\54\x44\x41\124\105\137\x46\117\122\115\101\124\50\164\x2e\164\151\x6d\x65\x2c\40\x27\x25\144\x2f\x25\x6d\57\x25\131\40\x25\150\72\x25\x69\x20\45\x70\x27\x29\40\x61\x73\40\x74\x69\x6d\145");
$this->db->from("\164\142\x6c\x67\x61\155\145\x64\x61\x74\141\40\x74");
$this->db->join("\x6d\x61\164\x6b\x61", "\x6d\x61\x74\153\141\56\x69\144\x20\75\x20\x74\x2e\x6d\141\x74\153\141\x5f\151\144");
$this->db->where("\x75\163\145\x72\137\151\144", $user_id);
$this->db->where("\151\x73\x5f\x62\x73\x5f\147\141\x6d\x65", 1);
$this->db->where("\x44\x41\x54\105\x28\164\56\x74\151\x6d\x65\x29\40\x42\105\x54\x57\105\x45\x4e\40\47{$from_date}\47\40\101\116\104\x20\x27{$to_date}\47");
$this->db->order_by("\164\56\x69\144", "\104\105\x53\103");
$q = $this->db->get();
$data["\144\141\164\141"] = $q->result();
echo json_encode($data);
}
public function get_common_data() {
$this->form_validation->set_rules("\165\163\145\162\x5f\x69\144", "\125\x73\145\x72\x20\111\x64", "\x74\x72\x69\x6d\x7c\162\x65\x71\x75\x69\162\x65\144");
if ($this->form_validation->run() == false) {
$data["\162\145\x73\160\x6f\156\143\145"] = false;
$data["\x65\x72\162\157\x72"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\165\x73\x65\162\137\x69\144");
$current_time = date("\x48\x3a\151\x3a\163");
$app = $this->db->select("\141\x70\160\x5f\x73\x74\x61\x72\x74\x5f\x74\x69\x6d\x65\54\x61\160\160\137\145\156\x64\137\x74\151\x6d\x65\54\141\x70\x70\x5f\155\145\x73\163\x61\147\145")->get("\141\160\160\137\x73\x65\164\164\x69\156\x67")->row();
$this->db->select("\x69\x73\137\143\141\x70\x70\145\x64\x2c\x6b\x79\143\137\x73\164\x61\164\165\x73");
$details = $this->db->where("\165\160\56\151\144", $user_id)->join("\164\142\154\x77\141\154\154\x65\x74\40\x74\x77", "\164\x77\56\165\163\145\162\137\151\144\x3d\x20\x75\x70\x2e\151\144")->get("\165\x73\x65\x72\137\160\x72\x6f\x66\x69\154\145\40\x75\x70");
if ($details->num_rows() > 0) {
$row = $details->row();
$kyc_message = $row->kyc_status == 0 ? "\113\131\103\x20\151\163\40\160\x65\x6e\x64\151\x6e\147" : ($row->kyc_status == 1 ? "\113\x59\103\40\x69\x73\x20\x75\x6e\144\x65\162\40\162\145\166\x69\145\x77\40\62\64\40\150\157\165\162\x73" : "\x4b\x59\x43\40\x43\x6f\x6d\x70\154\145\164\x65\144");
$set = array("\x69\x73\137\x61\160\x70\137\x72\x75\156\x6e\x69\x6e\147" => $current_time > $app->app_start_time && $app->app_end_time < $current_time ? 1 : 0, "\x61\x70\160\x5f\155\x65\x73\x73\141\147\145" => $app->app_message);
$message = array("\151\x73\x5f\143\x61\x70\160\x65\144" => $row->is_capped, "\167\x61\154\x6c\x65\x74\x5f\155\x65\x73\163\141\147\x65" => "\x43\x6f\x6e\x74\x61\x63\x74\x20\164\x6f\x20\x61\x64\x6d\x69\x6e", "\x6b\171\x63\x5f\163\164\141\x74\165\163" => $row->kyc_status, "\x6b\x79\143\x5f\x6d\145\163\x73\x61\x67\x65" => $kyc_message);
$data["\162\145\163\160\x6f\156\x63\x65"] = true;
$data["\x61\x70\x70\137\163\145\164\x74\151\x6e\147"] = $set;
$data["\x75\x73\145\x72\137\x64\145\164\x61\151\x6c\163"] = $message;
} else {
$data["\162\145\163\x70\x6f\x6e\x63\x65"] = false;
$data["\x65\162\x72\157\162"] = "\x55\x73\x65\x72\40\144\x65\x74\141\151\x6c\163\40\156\157\x74\40\146\157\x75\156\x64\x2e\56";
}
}
echo json_encode($data);
}
public function get_state() {
$app = $this->db->select("\x69\x64\54\156\x61\155\145")->get("\163\164\x61\x74\145")->result();
$data["\x72\145\x73\160\x6f\x6e\x63\x65"] = true;
$data["\144\x61\164\141"] = $app;
echo json_encode($data);
}
public function upload_kyc_data() {
$this->form_validation->set_rules("\165\163\x65\162\137\151\144", "\x55\x73\145\162\40\x49\144", "\164\x72\x69\x6d\x7c\x72\145\x71\165\x69\162\145\x64");
$this->form_validation->set_rules("\x6e\141\x6d\145", "\116\x61\155\x65", "\164\x72\151\x6d\x7c\162\145\161\165\x69\162\x65\144");
$this->form_validation->set_rules("\x77\x68\141\164\x73\x61\160\160\137\156\157", "\167\150\141\x74\x73\x61\160\x70\x5f\x6e\x6f", "\164\162\x69\155\174\x72\x65\x71\165\151\x72\145\x64");
$this->form_validation->set_rules("\163\x74\x61\x74\145", "\163\x74\x61\x74\145", "\164\x72\151\155\x7c\162\145\161\x75\151\162\145\x64");
$this->form_validation->set_rules("\151\x6d\141\x67\x65", "\x69\155\141\x67\145", "\164\x72\151\x6d\174\162\145\161\x75\151\x72\145\144");
if ($this->form_validation->run() == false) {
$data["\x72\145\163\x70\x6f\x6e\x63\145"] = false;
$data["\x65\x72\x72\157\x72"] = strip_tags($this->form_validation->error_string());
} else {
$user_id = $this->input->post("\165\163\x65\162\x5f\151\x64");
$name = $this->input->post("\156\141\x6d\145");
$whatsapp_no = $this->input->post("\x77\x68\141\x74\x73\x61\160\160\137\x6e\x6f");
$state = $this->input->post("\x73\164\141\x74\145");
$image = $this->input->post("\151\155\141\x67\145");
$documents = $this->input->post("\144\x6f\x63\x75\x6d\145\156\x74\163");
$details = $this->db->where("\x75\160\x2e\151\144", $user_id)->get("\x75\163\145\x72\x5f\160\x72\x6f\x66\151\154\x65\40\165\x70");
if ($details->num_rows() > 0) {
$kyc_status = $details->row()->kyc_status??0;
if ($kyc_status == 0) {
$insert = array("\x75\x73\x65\x72\137\151\144" => $user_id, "\156\141\x6d\x65" => $name, "\x77\x68\141\x74\163\x61\160\x70\137\156\157" => $whatsapp_no, "\163\x74\141\x74\x65" => $state);
$time = date("\131\x6d\144\110\x69\163");
$UserImage = "\x55\163\x65\162\x49\x6d\141\x67\x65" . $time . "\x2e\x6a\x70\147";
$profile = "\x75\160\x6c\x6f\x61\x64\x73\x2f\144\157\x63\x75\x6d\145\156\x74\x73\x2f" . $UserImage;
$binary = base64_decode($image);
$img_status = file_put_contents($profile, $binary);
$insert["\160\162\157\146\x69\x6c\x65"] = $profile;
if ($documents != '') {
$User_docs = "\x64\157\x63\x75\x6d\145\x6e\164\x73" . $time . "\56\x6a\x70\x67";
$docs_file = "\x75\160\154\157\141\x64\163\57\x64\x6f\x63\x75\x6d\x65\x6e\164\163\x2f" . $User_docs;
$binary_back = base64_decode($documents);
$docs_status = file_put_contents($docs_file, $binary_back);
$insert["\144\x6f\143\x75\155\x65\156\x74"] = $docs_file;
}
$this->db->insert("\x6b\x79\x63\x5f\144\157\143\163", $insert);
$last_id = $this->db->insert_id();
if ($last_id) {
$this->db->where("\151\144", $user_id)->update("\165\163\x65\162\x5f\160\162\157\x66\x69\x6c\x65", array("\153\171\x63\137\x73\x74\x61\164\165\163" => 1));
$data["\162\145\163\x70\157\156\143\x65"] = true;
$data["\155\145\x73\x73\x61\x67\x65"] = "\113\171\x63\x20\144\141\164\141\x20\163\x75\142\155\151\x74\x20\163\x75\x63\x63\x65\x73\x73\x66\165\x6c\x2e\56";
} else {
$data["\x72\145\x73\160\157\156\x63\x65"] = false;
$data["\155\x65\x73\163\x61\x67\145"] = "\x53\x6f\155\145\x74\150\151\x6e\147\x20\167\145\x6e\164\x20\167\x72\157\x6e\147";
}
} else {
if ($kyc_status == 1) {
$data["\162\x65\163\160\157\x6e\143\x65"] = false;
$data["\155\145\163\x73\141\x67\x65"] = "\x4e\157\167\40\x4b\171\143\x20\x75\x6e\x64\x65\162\x20\162\145\x76\x69\145\x77\x2e\56";
} else {
$data["\162\145\163\160\x6f\x6e\x63\145"] = false;
$data["\x6d\145\163\163\141\147\x65"] = "\x4b\x79\143\40\141\154\162\x65\x61\144\x79\x20\143\157\155\x70\x6c\145\164\x65\56\56";
}
}
} else {
$data["\x72\x65\x73\160\x6f\x6e\143\145"] = false;
$data["\145\162\x72\x6f\x72"] = "\x55\x73\x65\162\x20\x64\x65\164\x61\x69\x6c\163\x20\156\x6f\x74\40\146\157\165\x6e\x64\56\x2e";
}
}
echo json_encode($data);
}
public function check_game_digit_balance() {
$this->form_validation->set_rules("\155\141\164\x6b\x61\137\x69\144", "\x4d\x61\x74\153\141\x20\111\x64", "\164\x72\x69\x6d\x7c\162\145\x71\x75\x69\x72\x65\x64\x7c\x6e\x75\x6d\x65\162\x69\x63");
$this->form_validation->set_rules("\144\x69\x67\151\x74", "\104\x69\147\x69\x74", "\164\162\x69\x6d\174\x72\x65\x71\165\x69\162\145\x64\174\x6e\165\155\x65\162\151\143");
$this->form_validation->set_rules("\x70\157\x69\156\x74\163", "\x50\157\x69\156\x74\x73", "\164\x72\151\155\174\x72\x65\161\165\x69\x72\x65\x64\174\156\x75\x6d\x65\x72\x69\x63");
$this->form_validation->set_rules("\165\163\x65\162\x5f\x69\x64", "\x55\163\145\162\x20\x49\x44", "\x74\x72\151\155\174\x72\x65\161\165\x69\162\145\x64\174\156\x75\155\x65\162\151\x63");
if ($this->form_validation->run() == false) {
$data["\x72\x65\x73\160\x6f\x6e\x63\x65"] = false;
$data["\145\162\162\157\162"] = strip_tags($this->form_validation->error_string());
} else {
$matka_id = $this->input->post("\155\x61\x74\153\x61\137\x69\x64");
$digit = $this->input->post("\144\151\147\151\x74");
$points = $this->input->post("\160\157\151\x6e\x74\x73");
$user_id = $this->input->post("\165\163\145\162\137\151\144");
$this->db->cache_off();
$bid_limit = $this->db->select("\x6d\141\170\x5f\142\151\x64\137\141\x6d\x6f\165\x6e\x74")->get("\141\160\160\137\x73\145\x74\x74\x69\x6e\x67")->row()->max_bid_amount??0;
$where = array("\155\141\164\x6b\x61\x5f\x69\x64" => $matka_id, "\x64\x69\x67\x69\x74\x73" => $digit, "\x64\141\x74\x65" => date("\144\x2f\155\x2f\x59"), "\x75\163\x65\x72\137\151\144" => $user_id);
$total_value = $this->db->select("\123\x55\x4d\x28\x70\157\x69\x6e\x74\x73\x29\x20\141\163\x20\x74\157\x74\141\154\x5f\166\x61\x6c\165\145")->where($where)->group_by(array("\x6d\141\x74\153\x61\137\151\144", "\x64\x69\x67\x69\x74\163"))->get("\164\142\154\147\141\x6d\x65\x64\x61\164\x61")->row()->total_value??0;
$total_values = $total_value + $points;
$remain_balance = $bid_limit - $total_values;
$update_bal = $bid_limit < $total_values ? $bid_limit - $total_value : 0;
if ($bid_limit < $total_values) {
$data["\162\x65\163\160\157\156\143\145"] = false;
$data["\145\x72\162\x6f\x72"] = "\x4d\x61\170\x20\101\155\157\x75\x6e\x74\40\151\x73\40{$bid_limit}\x2e\x20\x59\157\165\x20\x63\141\x6e\40\141\144\x64\x20\157\x6e\x6c\171\x20{$update_bal}\56";
} else {
$data["\162\145\163\x70\x6f\156\143\x65"] = true;
$data["\x65\x72\162\x6f\x72"] = "\115\141\170\x20\x41\155\157\x75\x6e\164\40\151\x73\40{$bid_limit}\x2e\x20\x59\157\165\40\x63\141\x6e\x20\141\144\144\x20\x6d\157\162\145\40{$remain_balance}\x2e";
}
}
echo json_encode($data);
}
public function chart_history() {
$data = array();
$_POST = $_REQUEST;
$this->load->library("\146\157\x72\155\137\166\x61\154\151\x64\x61\164\x69\157\x6e");
$this->form_validation->set_rules("\155\141\x74\153\141\x5f\x69\144", "\x4d\x61\164\x6b\141\40\111\x64", "\164\x72\x69\x6d\174\x72\145\161\x75\151\162\x65\x64");
$matka_id = $this->input->post("\x6d\141\164\153\141\137\151\x64");
$from_date = $this->input->post("\146\162\157\155\137\x64\x61\164\x65") ??date("\x59\x2d\x6d\55\x64");
$to_date = $this->input->post("\164\x6f\137\144\141\x74\x65") ??date("\x59\55\155\55\x64");
if ($this->form_validation->run() == false) {
$data["\x72\145\x73\x70\x6f\156\x63\x65"] = false;
$data["\x65\162\x72\x6f\x72"] = strip_tags($this->form_validation->error_string());
} else {
$data["\x72\145\163\160\x6f\x6e\143\x65"] = true;
$q = $this->db->query("\x73\145\154\x65\143\x74\x20\x2a\x20\x66\x72\157\x6d\40\x63\150\141\162\164\163\x20\x77\x68\x65\x72\145\x20\143\x69\144\75\x27{$matka_id}\47\40\141\x6e\144\40\104\x41\124\x45\x28\144\x61\164\145\x29\40\102\105\x54\127\x45\x45\x4e\40\47{$from_date}\x27\x20\101\116\104\40\47{$to_date}\x27\40\x4f\122\x44\x45\122\40\102\131\x20\144\x61\x74\x65\x20\x44\x45\123\103");
$data["\144\141\164\141"] = $q->result();
}
echo json_encode($data);
}
public function generate_otp_for_withdrawal() {
$this->form_validation->set_rules("\x6d\157\142\x69\x6c\x65", "\115\x6f\142\151\154\x65\40\116\165\155\x62\145\x72", "\164\x72\x69\x6d\x7c\x72\x65\x71\165\x69\162\x65\x64\174\x69\x6e\x74\145\147\x65\x72");
if ($this->form_validation->run() == false) {
$status = "\x66\141\x69\x6c\145\144";
$data = strip_tags($this->form_validation->error_string());
$otp = '';
} else {
$app_setting = $this->db->get("\164\151\155\x65\x73\x6c\157\164\163")->row();
$start_time = date("\x48\72\151", strtotime($app_setting->start_time));
$end_time = date("\110\x3a\x69", strtotime($app_setting->end_time));
$time = date("\x48\72\x69");
if ($time > $start_time && $time < $end_time) {
$mobile = $this->input->post("\x6d\x6f\142\151\x6c\x65");
$q = $this->db->query("\163\145\x6c\145\143\164\40\x2a\40\x66\162\x6f\155\x20\x75\163\x65\x72\x5f\160\162\x6f\146\x69\154\x65\x20\167\150\x65\162\x65\40\x28\155\157\142\x69\154\x65\156\157\75\x27" . $mobile . "\47\x29\40\x4c\151\155\151\164\40\61");
if ($q->num_rows() > 0) {
$status = "\x73\165\x63\x63\145\x73\163";
$otp = mt_rand(100000, 999999);
$time = date("\x59\x2d\x6d\x2d\x64\x20\x48\72\151\72\163", strtotime("\53\x32\x20\155\x69\x6e\x75\164\145"));
$data = array("\165\x73\x65\x72\137\151\x64" => $mobile, "\157\164\160" => $otp, "\143\x72\145\141\164\145\144\x5f\141\x74" => $time, "\x74\x79\160\x65" => "\167\151\x74\x68\144\x72\141\x77");
$count = $this->db->where("\165\x73\145\x72\x5f\151\144", $mobile)->get("\164\142\x6c\117\x74\x70")->num_rows();
if ($count == 0) {
$this->db->insert("\x74\x62\154\117\x74\160", $data);
} else {
$this->db->where("\x75\x73\x65\x72\137\151\144", $mobile)->update("\x74\x62\x6c\117\164\x70", $data);
}
$msg_status = $this->db->select("\x6f\164\x70\x5f\x73\x74\x61\x74\165\163")->get("\141\x70\160\137\x73\x65\164\164\151\x6e\147")->row()->otp_status??0;
if ($msg_status == 1) {
$this->load->model("\163\x6d\163\x5f\x6d\x6f\x64\x65\154");
$this->sms_model->send_msg($mobile, $otp);
}
$data = "\x43\157\144\145\40\163\145\156\x74\40\x74\x6f\x20\x79\157\x75\162\40\162\145\147\x69\x73\x74\145\x72\145\144\x20\155\x6f\x62\x69\x6c\x65\x20\x6e\165\x6d\142\145\162";
$otp = $otp;
} else {
$status = "\146\x61\x69\x6c\x65\144";
$data = "\x4d\157\142\x69\154\x65\x20\x6e\165\155\142\145\162\x20\x6e\157\164\40\162\145\147\151\163\164\145\x72\x65\x64\56";
$otp = '';
}
} else {
$status = "\146\x61\151\x6c\x65\x64";
$data = "\127\x69\164\150\144\x72\x61\x77\x61\x6c\40\x54\x69\155\x65\x6f\165\164\56";
$otp = '';
}
}
$obj = array("\x73\164\x61\x74\x75\163" => $status, "\x6d\x65\x73\163\141\147\145" => $data, "\157\x74\x70" => $otp);
echo json_encode($obj);
}
public function verify_withdrawal_otp() {
$this->form_validation->set_rules("\155\x6f\x62\x69\x6c\x65", "\115\157\x62\x69\154\x65", "\x74\162\151\x6d\174\x72\x65\161\x75\151\x72\x65\144\x7c\x69\x6e\164\145\x67\145\162");
$this->form_validation->set_rules("\157\x74\x70", "\x4f\x54\120", "\x74\x72\x69\155\174\x72\145\161\x75\151\162\x65\x64\x7c\151\156\x74\x65\147\145\x72");
if ($this->form_validation->run() == false) {
$data["\163\x74\141\164\165\163"] = "\146\141\151\154\x65\144";
$data["\155\x65\163\163\x61\147\145"] = strip_tags($this->form_validation->error_string());
} else {
$mobile = $this->input->post("\155\157\142\x69\x6c\x65");
$otp = $this->input->post("\x6f\164\160");
$check_details = $this->db->where(array("\x75\163\145\162\137\x69\x64" => $mobile, "\x6f\164\160" => $otp))->order_by("\x69\x64", "\144\145\x73\x63")->LIMIT(1)->get("\164\x62\154\x4f\164\x70");
$user_details = $check_details->row();
if ($check_details->num_rows() > 0) {
$store_time = $user_details->created_at;
$current_time = date("\131\x2d\x6d\55\x64\x20\x48\72\151\x3a\x73");
if ($current_time > $store_time) {
$data["\x73\x74\x61\x74\165\163"] = "\x66\141\151\154\145\144";
$data["\155\x65\163\x73\x61\x67\145"] = "\x4f\x74\160\40\x65\170\160\151\162\x65\x20\164\x72\x79\40\x61\147\x61\x69\x6e";
} else {
$data["\x73\164\141\x74\165\x73"] = "\163\165\x63\143\x65\163\163";
$data["\155\145\163\163\141\x67\145"] = "\117\x74\160\40\x76\145\162\x69\146\x79\56\56\56";
}
} else {
$data["\x73\164\x61\164\x75\163"] = "\x66\141\x69\x6c\x65\144";
$data["\155\145\163\163\x61\147\x65"] = "\x45\x6e\x74\x65\162\40\103\x6f\x72\162\145\143\164\40\x64\145\164\x61\x69\154\163\x2e\56\x2e";
}
}
echo json_encode($data);
}
} ?>
Function Calls
None |
Stats
MD5 | b6d59de09250773c8076454f2878d195 |
Eval Count | 0 |
Decode Time | 152 ms |