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 Game_model extends CI_Model { public function __construct() { $this->load->d..

Decoded Output download

<?php 
 class Game_model extends CI_Model { public function __construct() { $this->load->database(); } public function get_winner($id, $n) { $query = $this->db->query("UPDATE tblgamedata set points=points*2 , status='win' where id=3 and matka_id=5"); $query2 = $this->db->query("SELECT * from tblgamedata where matka_id='{$id}' and digits='{$n}'"); return $query2->result_array(); } public function gameData($data, $closed = 0, $type = '') { extract($data); $game_id = $game["game_id"]; $anum = $num; if ($type == "is_fc_game") { $fc_num = $snum . "-" . $enum; } if ($type == "is_bs_game") { $frgame = $srgame = 1; $count = $this->db->where(array("date" => $date, "matka_id" => $matka_id, "game_id" => $game_id, "status" => "pending", "bs_game_name" => "FR"))->get("tblgamedata")->num_rows(); if ($count > 0 && $snum != '') { $fr_num = $snum; $frgame = ''; } $counts = $this->db->where(array("date" => $date, "matka_id" => $matka_id, "game_id" => $game_id, "status" => "pending", "bs_game_name" => "SR"))->get("tblgamedata")->num_rows(); if ($counts > 0 && $enum != '') { $sr_num = $enum; $srgame = ''; } } echo " Updated Result: " . $num . "<br>"; if ($type == "is_bs_game") { if (isset($snum) && $srgame != '' && $snum != '' && $count > 0) { $query = "SELECT * from tblgamedata where matka_id='{$matka_id}' and game_id='{$game_id}' \xa	        and bs_game_name='FR' and date='{$date}' and status='pending'"; } if (isset($enum) && $frgame != '' && $enum != '' && $counts > 0) { $query = "SELECT * from tblgamedata where matka_id='{$matka_id}' and game_id='{$game_id}' and bs_game_name='SR'\xa    \x9        and date='{$date}' and status='pending'"; } } else { if ($closed) { $query = "SELECT * from tblgamedata where matka_id='{$matka_id}' and game_id='{$game_id}' and date='{$date}' and status='pending'"; } else { $query = "SELECT * from tblgamedata where matka_id='{$matka_id}' and game_id='{$game_id}' and bet_type='{$bet_type}' and date='{$date}' and status='pending'"; } } $wn = $this->db->query($query)->result_array(); $status = ''; foreach ($wn as $w) { $status = ''; if ($game["game_name"] == "jodi_digits" && $w["digits"] == $anum || $game["game_name"] == "direct_fc" && $w["digits"] == $fc_num || $game["game_name"] == "shillong_bs" && $w["digits"] == $fr_num || $game["game_name"] == "shillong_bs" && $w["digits"] == $sr_num || $game["game_name"] == "khanapara_bs" && $w["digits"] == $fr_num || $game["game_name"] == "khanapara_bs" && $w["digits"] == $sr_num) { $status = "win"; } else { $status = "loss"; } echo "<strong>" . $status . "</strong><br>"; if ($status != '') { $this->setGameData($w, $game, $status); } } return $status; } public function getPoint($game, $digit) { if ($game["game_name"] == "panel_group" || $game["game_name"] == "cycle_pana") { $pt = $this->getPointByGameName($this->noOfRound($digit)); } else { $pt = $game["points"]; } return $pt; } public function getPointByNo($digit) { $pt = $this->getPointByGameName($this->noOfRound($digit)); return $pt; } public function getPointByGameName($gameName) { $game = $this->db->where("game_name", $gameName)->get("tblgame")->row(); $pt = $game->points > 0 ? $game->points : 0; return $pt; } public function noOfRound($digit) { if ($digit > 0) { $d1 = $digit % 10; $d2 = (int) ($digit / 10) % 10; $d3 = (int) ($digit / 100) % 10; $out = ''; if ($d1 == $d2 && $d1 == $d3 && $d2 == $d3) { $out = "triple_pana"; } else { if ($d1 == $d2 || $d1 == $d3 || $d2 == $d3) { $out = "double_pana"; } else { if ($d1 != $d2 && $d1 != $d3 && $d2 != $d3) { $out = "single_pana"; } } } } else { $out = ''; } return $out; } public function setGameData($w, $data, $type = "win") { $it = $w["id"]; if ($type == "win") { $ut = $w["user_id"]; $pt = $data["game_name"] == "panel_group" || $game["game_name"] == "cycle_pana" ? $this->getPoint($data, $w["digits"]) : $data["points"]; $pt2 = $w["points"] * $pt; echo "<hr>" . $pt2 . " Points added.<hr>"; $ins = array("matka_id" => $w["matka_id"], "user_id" => $ut, "game_id" => $w["game_id"], "digits" => $w["digits"], "amt" => $pt2, "bid_id" => $it, "type" => "c", "date" => date("d/m/Y")); $this->db->insert("history", $ins); $this->db->query("UPDATE tblwallet set wallet_points=wallet_points+('{$pt2}') where user_id='{$ut}'"); $this->db->query("UPDATE tblgamedata set status='win' where id='{$it}'"); $data = "yes"; } else { $this->db->query("UPDATE tblgamedata set status='loss' where id='{$it}'"); $data = "no"; } echo $data; return $data; } public function getWinner($data, $udate = null, $closed = 0, $type = '') { extract($data); $date = $udate == null ? date("d/m/Y") : date("d/m/Y", strtotime($udate)); if ($type == "is_fc_game") { $closed = 1; $this->db->where("is_fc_game", 1); } if ($type == "is_bs_game") { $closed = 1; $game_id = $matka_id == 123 ? "25" : "24"; $this->db->where(array("is_bs_game" => 1, "game_id" => $game_id)); } $games = $this->db->where("is_deleted", 0)->get("tblgame")->result_array(); foreach ($games as $game) { if ($matka_id < 100) { echo "<h1>" . $game["game_name"] . "</h1>"; } $data["matka_id"] = $matka_id; $points = $this->db->get_where("tblNotice", array("id" => $matka_id))->row()->rate / 10; $game["points"] = $points; $data["game"] = $game; $data["date"] = $date; if ($game["is_close"] == 1 && $closed == 1) { echo "<br>no open or close"; if (strlen(""" . $data["num"] . """) > 1) { $this->gameData($data, 1, $type); } } else { $bets = array("open"); if ($closed == 1) { $bets = array("close"); } foreach ($bets as $bet) { echo "<br>" . $bet; $data["bet_type"] = $bet; $this->gameData($data); } } } return 1; } public function bioSum($snum, $enum = '') { $s = $this->sum($snum); $e = ''; if ($enum != '') { $e = $this->sum($enum); } return $s . $e; } public function sum($num) { $sum = 0; for ($i = 0; $i < strlen($num); $i++) { $sum += $num[$i]; } $sum = $sum % 10; return $sum; } } ?>

Did this file decode correctly?

Original Code

<?php
 class Game_model extends CI_Model { public function __construct() { $this->load->database(); } public function get_winner($id, $n) { $query = $this->db->query("\125\x50\104\x41\124\105\40\x74\x62\154\147\141\x6d\x65\x64\141\164\141\x20\x73\x65\x74\x20\x70\157\151\x6e\164\x73\75\x70\157\x69\156\x74\x73\x2a\62\40\x2c\40\163\x74\x61\x74\165\x73\75\x27\167\x69\156\x27\x20\167\150\x65\x72\145\x20\x69\x64\75\63\x20\141\x6e\144\40\x6d\141\164\x6b\x61\137\x69\x64\75\65"); $query2 = $this->db->query("\x53\x45\114\x45\103\x54\x20\x2a\x20\x66\x72\157\155\40\164\142\154\x67\141\x6d\x65\144\x61\164\x61\x20\x77\150\x65\x72\x65\x20\x6d\141\x74\x6b\x61\137\x69\144\75\x27{$id}\x27\x20\x61\x6e\x64\x20\144\x69\147\151\164\163\75\47{$n}\x27"); return $query2->result_array(); } public function gameData($data, $closed = 0, $type = '') { extract($data); $game_id = $game["\x67\141\155\145\x5f\151\144"]; $anum = $num; if ($type == "\151\163\137\x66\143\x5f\x67\x61\x6d\145") { $fc_num = $snum . "\55" . $enum; } if ($type == "\x69\x73\137\142\x73\137\147\141\x6d\x65") { $frgame = $srgame = 1; $count = $this->db->where(array("\144\x61\x74\145" => $date, "\x6d\141\164\x6b\x61\x5f\151\x64" => $matka_id, "\x67\141\x6d\145\x5f\151\144" => $game_id, "\x73\164\141\164\x75\163" => "\160\145\x6e\x64\151\x6e\147", "\x62\163\137\147\141\x6d\x65\137\156\x61\155\x65" => "\x46\122"))->get("\164\142\x6c\x67\141\155\x65\144\x61\x74\x61")->num_rows(); if ($count > 0 && $snum != '') { $fr_num = $snum; $frgame = ''; } $counts = $this->db->where(array("\144\141\x74\x65" => $date, "\155\141\164\153\141\137\x69\144" => $matka_id, "\147\x61\155\x65\x5f\151\x64" => $game_id, "\163\x74\x61\x74\165\x73" => "\x70\x65\x6e\144\151\x6e\x67", "\142\163\x5f\x67\x61\x6d\x65\x5f\x6e\x61\x6d\x65" => "\123\x52"))->get("\x74\x62\x6c\147\x61\155\x65\x64\141\x74\x61")->num_rows(); if ($counts > 0 && $enum != '') { $sr_num = $enum; $srgame = ''; } } echo "\40\125\x70\144\x61\164\145\x64\x20\x52\145\163\x75\x6c\164\x3a\40" . $num . "\x3c\142\162\76"; if ($type == "\x69\163\137\142\x73\x5f\x67\141\x6d\145") { if (isset($snum) && $srgame != '' && $snum != '' && $count > 0) { $query = "\x53\x45\x4c\x45\x43\124\x20\x2a\x20\x66\162\x6f\x6d\40\164\142\x6c\147\x61\x6d\x65\x64\x61\164\141\x20\167\150\x65\162\145\40\155\x61\164\153\x61\137\x69\x64\75\x27{$matka_id}\x27\x20\x61\156\x64\x20\x67\x61\x6d\x65\x5f\151\144\75\47{$game_id}\47\x20\xa\11\x20\40\x20\x20\x20\x20\x20\x20\141\156\144\40\x62\x73\x5f\147\141\x6d\145\x5f\x6e\141\x6d\x65\x3d\x27\106\122\x27\40\141\156\x64\40\144\141\x74\145\x3d\x27{$date}\x27\x20\141\x6e\x64\40\163\164\x61\164\165\163\75\x27\x70\x65\156\144\151\156\x67\47"; } if (isset($enum) && $frgame != '' && $enum != '' && $counts > 0) { $query = "\x53\105\x4c\x45\x43\124\40\x2a\40\x66\x72\x6f\x6d\x20\x74\x62\154\x67\x61\155\145\144\141\x74\141\x20\167\x68\145\x72\x65\40\155\141\164\153\141\x5f\151\x64\75\47{$matka_id}\x27\x20\141\156\144\x20\147\141\155\x65\x5f\x69\x64\x3d\47{$game_id}\x27\40\141\156\144\x20\142\163\137\x67\x61\155\145\137\x6e\141\x6d\x65\x3d\47\x53\122\x27\xa\40\40\x20\x20\x9\40\x20\x20\x20\x20\40\x20\40\x61\x6e\x64\x20\x64\141\x74\x65\x3d\47{$date}\x27\x20\x61\156\x64\40\x73\x74\141\x74\165\x73\x3d\x27\160\x65\x6e\144\x69\156\x67\x27"; } } else { if ($closed) { $query = "\x53\x45\114\x45\103\124\40\52\40\x66\162\157\155\40\x74\142\154\x67\x61\155\x65\144\141\164\141\x20\x77\x68\145\x72\x65\40\155\x61\164\x6b\x61\x5f\151\x64\75\x27{$matka_id}\47\x20\x61\x6e\144\40\147\141\155\145\x5f\151\144\75\47{$game_id}\x27\40\141\156\144\x20\144\141\x74\145\75\x27{$date}\47\40\141\156\x64\40\x73\x74\x61\164\165\x73\75\47\160\x65\156\x64\x69\x6e\147\x27"; } else { $query = "\x53\105\x4c\x45\103\124\x20\52\40\x66\x72\157\x6d\40\x74\x62\x6c\147\x61\155\145\x64\141\164\x61\40\x77\150\145\162\x65\40\x6d\x61\x74\153\x61\x5f\x69\144\75\47{$matka_id}\x27\x20\141\156\144\40\x67\141\x6d\x65\x5f\x69\144\x3d\x27{$game_id}\47\40\x61\156\144\x20\142\x65\x74\137\x74\171\x70\x65\75\x27{$bet_type}\47\x20\141\x6e\144\40\x64\x61\x74\x65\x3d\47{$date}\x27\x20\141\x6e\144\x20\x73\164\x61\x74\165\163\x3d\47\x70\145\x6e\x64\x69\156\x67\47"; } } $wn = $this->db->query($query)->result_array(); $status = ''; foreach ($wn as $w) { $status = ''; if ($game["\x67\141\155\x65\x5f\x6e\x61\155\145"] == "\152\157\x64\151\x5f\x64\151\147\x69\x74\x73" && $w["\144\151\147\151\164\163"] == $anum || $game["\147\x61\155\x65\x5f\x6e\141\155\145"] == "\x64\x69\162\145\x63\x74\x5f\x66\x63" && $w["\144\151\147\x69\x74\163"] == $fc_num || $game["\147\x61\155\x65\x5f\156\141\155\145"] == "\x73\x68\x69\x6c\x6c\x6f\x6e\x67\x5f\142\x73" && $w["\144\x69\147\151\x74\x73"] == $fr_num || $game["\x67\x61\x6d\x65\137\156\x61\x6d\x65"] == "\163\150\151\x6c\154\157\156\x67\x5f\142\x73" && $w["\x64\151\147\x69\x74\x73"] == $sr_num || $game["\x67\x61\155\145\x5f\156\x61\x6d\x65"] == "\x6b\x68\141\156\x61\x70\x61\x72\x61\137\142\163" && $w["\144\x69\147\151\x74\x73"] == $fr_num || $game["\x67\x61\155\145\137\x6e\x61\x6d\145"] == "\x6b\x68\x61\156\x61\x70\141\162\x61\137\142\163" && $w["\x64\151\147\x69\x74\163"] == $sr_num) { $status = "\167\151\x6e"; } else { $status = "\154\157\163\163"; } echo "\74\163\x74\162\157\x6e\147\76" . $status . "\x3c\x2f\163\164\162\x6f\x6e\147\x3e\x3c\142\x72\76"; if ($status != '') { $this->setGameData($w, $game, $status); } } return $status; } public function getPoint($game, $digit) { if ($game["\x67\141\155\145\137\156\141\155\x65"] == "\x70\141\156\145\x6c\137\147\162\157\165\x70" || $game["\147\x61\155\x65\137\x6e\x61\155\145"] == "\143\x79\143\x6c\145\x5f\160\x61\x6e\x61") { $pt = $this->getPointByGameName($this->noOfRound($digit)); } else { $pt = $game["\160\157\151\x6e\x74\163"]; } return $pt; } public function getPointByNo($digit) { $pt = $this->getPointByGameName($this->noOfRound($digit)); return $pt; } public function getPointByGameName($gameName) { $game = $this->db->where("\x67\x61\155\x65\137\x6e\141\155\x65", $gameName)->get("\x74\x62\154\x67\141\x6d\x65")->row(); $pt = $game->points > 0 ? $game->points : 0; return $pt; } public function noOfRound($digit) { if ($digit > 0) { $d1 = $digit % 10; $d2 = (int) ($digit / 10) % 10; $d3 = (int) ($digit / 100) % 10; $out = ''; if ($d1 == $d2 && $d1 == $d3 && $d2 == $d3) { $out = "\x74\x72\151\x70\154\145\137\160\141\156\141"; } else { if ($d1 == $d2 || $d1 == $d3 || $d2 == $d3) { $out = "\144\157\x75\142\x6c\x65\x5f\160\x61\x6e\x61"; } else { if ($d1 != $d2 && $d1 != $d3 && $d2 != $d3) { $out = "\163\x69\156\x67\x6c\x65\x5f\160\141\156\141"; } } } } else { $out = ''; } return $out; } public function setGameData($w, $data, $type = "\167\x69\x6e") { $it = $w["\x69\x64"]; if ($type == "\167\x69\x6e") { $ut = $w["\165\163\145\162\x5f\151\x64"]; $pt = $data["\x67\141\x6d\x65\x5f\156\141\155\145"] == "\160\x61\x6e\145\x6c\137\147\162\157\165\160" || $game["\x67\141\155\145\x5f\x6e\141\x6d\x65"] == "\x63\171\x63\x6c\145\x5f\x70\141\x6e\x61" ? $this->getPoint($data, $w["\x64\x69\x67\x69\164\163"]) : $data["\x70\157\x69\x6e\164\x73"]; $pt2 = $w["\x70\x6f\151\156\x74\163"] * $pt; echo "\x3c\x68\162\76" . $pt2 . "\x20\120\157\x69\x6e\x74\163\40\141\144\x64\x65\144\56\74\150\x72\76"; $ins = array("\155\x61\x74\153\141\x5f\x69\144" => $w["\x6d\x61\164\x6b\141\x5f\151\x64"], "\165\x73\x65\162\137\x69\144" => $ut, "\147\141\x6d\x65\x5f\151\144" => $w["\147\141\155\x65\x5f\151\144"], "\144\x69\147\x69\164\x73" => $w["\144\x69\147\x69\164\163"], "\x61\155\x74" => $pt2, "\142\x69\x64\137\151\144" => $it, "\164\x79\x70\145" => "\143", "\144\x61\164\145" => date("\x64\x2f\x6d\x2f\131")); $this->db->insert("\x68\151\163\x74\157\x72\171", $ins); $this->db->query("\125\120\x44\x41\124\105\x20\164\142\154\167\x61\154\x6c\145\164\40\x73\x65\x74\40\x77\x61\x6c\154\x65\x74\137\160\x6f\x69\156\164\163\75\x77\x61\x6c\x6c\145\x74\137\160\x6f\x69\156\164\x73\53\50\47{$pt2}\47\x29\x20\167\x68\145\x72\145\x20\165\x73\x65\x72\137\x69\144\x3d\47{$ut}\x27"); $this->db->query("\x55\x50\x44\101\x54\x45\40\x74\x62\154\147\141\x6d\145\144\x61\164\141\x20\163\145\164\x20\163\x74\141\x74\165\163\75\x27\167\x69\x6e\47\40\167\150\145\162\145\x20\x69\x64\x3d\47{$it}\x27"); $data = "\171\x65\x73"; } else { $this->db->query("\125\120\x44\101\x54\105\x20\x74\x62\154\x67\x61\155\x65\x64\x61\164\141\x20\x73\145\x74\40\x73\x74\x61\164\x75\x73\75\47\x6c\157\x73\x73\x27\x20\x77\x68\145\x72\145\40\x69\144\75\x27{$it}\47"); $data = "\x6e\x6f"; } echo $data; return $data; } public function getWinner($data, $udate = null, $closed = 0, $type = '') { extract($data); $date = $udate == null ? date("\144\57\155\57\131") : date("\x64\57\155\x2f\x59", strtotime($udate)); if ($type == "\151\x73\x5f\146\143\137\147\x61\x6d\145") { $closed = 1; $this->db->where("\151\x73\137\x66\143\x5f\147\141\155\x65", 1); } if ($type == "\151\163\137\142\x73\x5f\147\141\155\x65") { $closed = 1; $game_id = $matka_id == 123 ? "\62\65" : "\x32\64"; $this->db->where(array("\151\163\x5f\x62\x73\137\147\141\x6d\x65" => 1, "\147\x61\155\145\x5f\x69\144" => $game_id)); } $games = $this->db->where("\151\163\137\144\x65\154\145\x74\x65\x64", 0)->get("\164\x62\x6c\147\x61\x6d\x65")->result_array(); foreach ($games as $game) { if ($matka_id < 100) { echo "\x3c\x68\61\76" . $game["\x67\141\x6d\x65\137\156\141\x6d\x65"] . "\x3c\57\x68\61\x3e"; } $data["\x6d\x61\164\x6b\141\137\151\144"] = $matka_id; $points = $this->db->get_where("\x74\142\154\116\157\164\x69\x63\145", array("\x69\x64" => $matka_id))->row()->rate / 10; $game["\x70\157\x69\x6e\164\x73"] = $points; $data["\x67\x61\x6d\145"] = $game; $data["\144\x61\164\x65"] = $date; if ($game["\151\x73\x5f\143\x6c\x6f\x73\x65"] == 1 && $closed == 1) { echo "\x3c\142\x72\76\x6e\x6f\40\x6f\160\x65\156\x20\x6f\162\x20\x63\154\157\163\x65"; if (strlen("\42" . $data["\156\165\155"] . "\42") > 1) { $this->gameData($data, 1, $type); } } else { $bets = array("\157\x70\x65\x6e"); if ($closed == 1) { $bets = array("\x63\x6c\x6f\163\x65"); } foreach ($bets as $bet) { echo "\74\x62\162\76" . $bet; $data["\x62\x65\164\137\x74\x79\160\145"] = $bet; $this->gameData($data); } } } return 1; } public function bioSum($snum, $enum = '') { $s = $this->sum($snum); $e = ''; if ($enum != '') { $e = $this->sum($enum); } return $s . $e; } public function sum($num) { $sum = 0; for ($i = 0; $i < strlen($num); $i++) { $sum += $num[$i]; } $sum = $sum % 10; return $sum; } }

Function Calls

None

Variables

None

Stats

MD5 24fb0ac59ec98397d26bd7e6f10c8cf8
Eval Count 0
Decode Time 51 ms