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

Decoded Output download

<?php 
 class Chart_Model extends CI_Model { public function __construct() { $this->load->database(); } public function getChartDetails($name) { return $this->db->where("name", $name)->order_by("date")->get("charts")->result_array(); } public function getChartDetailsById($id) { return $this->db->where("cid", $id)->order_by("date")->get("charts")->result_array(); } public function getChartDetailName($name, $date) { return $this->db->where(array("name" => $name, "date" => $date))->get("charts")->row_array(); } public function chartdate($chart) { $sdate = $chart[0]["date"]; $edate = end($chart)["date"]; return $this->getStart($sdate, $edate); } public function getWeek($sdate) { for ($i = 0; $i < 7; $i++) { $date = date("Y-m-d", strtotime("-" . $i . "days", strtotime($sdate))); $dayName = date("D", strtotime($date)); if ($dayName == "Mon") { $start = $date; break; } } for ($i = 0; $i < 7; $i++) { $date = date("Y-m-d", strtotime("+" . $i . "days", strtotime($sdate))); $dayName = date("D", strtotime($date)); if ($dayName == "Sat") { $end = $date; break; } } return array("s" => $start, "e" => $end); } public function date_compare($sdate, $edate) { $date1 = date_create($sdate); $date2 = date_create($edate); $diff = date_diff($date1, $date2); return $diff->format("%R%a"); } public function getStart($sdate, $edate) { ini_set("memory_limit", "256M"); set_time_limit(0); $week[0] = $this->getWeek($sdate); $date2 = $this->date_compare($week[0]["e"], $edate); $date = date("Y-m-d", strtotime("+2 days", strtotime($week[0]["e"]))); for ($i = 1; $i <= ceil($date2 / 7); $i++) { $week[$i] = $this->getWeek($date); $date = date("Y-m-d", strtotime("+2 days", strtotime($week[$i]["e"]))); } return $week; } public function getStarline() { $starline = $this->db->where("name", "Jannat Starline")->order_by("date")->get("charts")->result_array(); $a = array(); foreach ($starline as $s) { $date = $s["date"]; $cid = $s["cid"]; $start_num = $s["starting_num"]; $result_num = $s["result_num"]; $a[$date][$cid]["start_num"] = $start_num; $a[$date][$cid]["rest_num"] = $result_num; } return $a; } public function getTbl_Starline() { return $this->db->get("tblStarline")->result_array(); } } ?>

Did this file decode correctly?

Original Code

<?php
 class Chart_Model extends CI_Model { public function __construct() { $this->load->database(); } public function getChartDetails($name) { return $this->db->where("\x6e\141\155\145", $name)->order_by("\x64\141\164\x65")->get("\143\150\141\162\164\163")->result_array(); } public function getChartDetailsById($id) { return $this->db->where("\x63\x69\x64", $id)->order_by("\x64\x61\164\x65")->get("\143\x68\x61\x72\164\163")->result_array(); } public function getChartDetailName($name, $date) { return $this->db->where(array("\x6e\x61\155\x65" => $name, "\144\x61\x74\145" => $date))->get("\x63\150\141\x72\x74\163")->row_array(); } public function chartdate($chart) { $sdate = $chart[0]["\144\141\x74\x65"]; $edate = end($chart)["\x64\x61\x74\145"]; return $this->getStart($sdate, $edate); } public function getWeek($sdate) { for ($i = 0; $i < 7; $i++) { $date = date("\131\x2d\x6d\55\x64", strtotime("\x2d" . $i . "\144\141\x79\163", strtotime($sdate))); $dayName = date("\x44", strtotime($date)); if ($dayName == "\115\157\x6e") { $start = $date; break; } } for ($i = 0; $i < 7; $i++) { $date = date("\131\55\x6d\x2d\x64", strtotime("\53" . $i . "\144\x61\171\163", strtotime($sdate))); $dayName = date("\104", strtotime($date)); if ($dayName == "\x53\141\x74") { $end = $date; break; } } return array("\x73" => $start, "\145" => $end); } public function date_compare($sdate, $edate) { $date1 = date_create($sdate); $date2 = date_create($edate); $diff = date_diff($date1, $date2); return $diff->format("\45\x52\x25\x61"); } public function getStart($sdate, $edate) { ini_set("\155\x65\155\157\x72\171\137\154\151\x6d\x69\164", "\x32\x35\x36\115"); set_time_limit(0); $week[0] = $this->getWeek($sdate); $date2 = $this->date_compare($week[0]["\145"], $edate); $date = date("\131\55\x6d\x2d\144", strtotime("\x2b\62\x20\144\141\171\163", strtotime($week[0]["\x65"]))); for ($i = 1; $i <= ceil($date2 / 7); $i++) { $week[$i] = $this->getWeek($date); $date = date("\131\55\155\x2d\x64", strtotime("\x2b\62\40\144\x61\x79\163", strtotime($week[$i]["\145"]))); } return $week; } public function getStarline() { $starline = $this->db->where("\156\x61\155\145", "\x4a\141\x6e\x6e\141\x74\x20\123\164\141\x72\154\151\x6e\145")->order_by("\x64\141\x74\x65")->get("\143\150\x61\162\x74\163")->result_array(); $a = array(); foreach ($starline as $s) { $date = $s["\x64\x61\164\x65"]; $cid = $s["\143\151\144"]; $start_num = $s["\163\x74\x61\162\x74\151\x6e\x67\137\156\165\x6d"]; $result_num = $s["\x72\145\163\x75\154\x74\x5f\156\x75\x6d"]; $a[$date][$cid]["\x73\164\141\x72\164\x5f\156\165\155"] = $start_num; $a[$date][$cid]["\x72\x65\x73\164\137\x6e\165\155"] = $result_num; } return $a; } public function getTbl_Starline() { return $this->db->get("\x74\142\154\x53\164\141\x72\154\151\x6e\x65")->result_array(); } }

Function Calls

None

Variables

None

Stats

MD5 54722d193439cab1cb6b59f99e20bf07
Eval Count 0
Decode Time 41 ms