Japanese English

PHP 難読化コードの復元・デコード

Wordpress 等でのPHPのマルウェア・ウィルス・改ざんコードをデコードして難読化をオンラインで解除し、
元の読みやすいコードに戻し解読できます。

※すべての難読化コードを解除できるわけではございませんのでご理解とご了承をお願いいたします。

下記のコードを難読化解除しました

<?php /* ________________________________________ | GarudaCBT | | https://github.com/garudacbt/cbt | |________________________________________| */ defined("\102\x41\123\x45\x50\x41\124\110") or exit("\x4e\157\40\144\x69\x72\145\x63\164\40\163\143\x72\151\x70\164\x20\141\x63\x63\145\x73\163\x20\x6...



難読化されたPHPコード

<?php
/*   ________________________________________
    |                 GarudaCBT              |
    |    https://github.com/garudacbt/cbt    |
    |________________________________________|
*/
 defined("\102\x41\123\x45\x50\x41\124\110") or exit("\x4e\157\40\144\x69\x72\145\x63\164\40\163\143\x72\151\x70\164\x20\141\x63\x63\145\x73\163\x20\x61\x6c\154\157\167\x65\x64"); class Users_model extends CI_Model { public function getDatausers($id = null) { goto nNTxS; VFWJg: if (!($id !== null)) { goto p2Pmz; } goto RAtap; KwAbO: $this->datatables->select("\x75\x73\x65\x72\x73\x2e\151\x64\54\40\x75\x73\145\x72\156\141\x6d\x65\54\40\146\151\162\163\x74\x5f\x6e\x61\155\145\54\x20\154\141\x73\164\x5f\x6e\x61\155\x65\x2c\x20\x65\x6d\141\x69\154\54\40\x46\x52\x4f\x4d\137\125\x4e\111\130\x54\x49\x4d\105\x28\143\162\x65\141\164\x65\x64\137\x6f\x6e\51\40\x61\163\x20\x63\x72\x65\x61\164\x65\144\137\157\156\54\x20\x6c\141\163\x74\x5f\154\157\147\151\x6e\54\40\x61\143\x74\151\x76\x65\x2c\x20\147\x72\157\165\160\163\56\156\141\155\145\40\x61\x73\40\154\145\x76\145\154"); goto lIUeF; YU4E2: $this->datatables->join("\x67\162\157\x75\x70\x73", "\x75\163\145\x72\163\137\x67\162\x6f\165\160\163\x2e\x67\162\157\x75\x70\137\151\x64\75\x67\162\x6f\x75\x70\x73\56\151\x64"); goto VFWJg; J3x5m: $this->datatables->join("\x75\x73\145\x72\163", "\x75\x73\x65\162\163\137\147\x72\157\165\x70\x73\56\x75\x73\145\x72\137\x69\x64\75\x75\163\x65\162\x73\56\151\x64"); goto YU4E2; nNTxS: $this->db->query("\123\x45\x54\x20\123\x51\114\x5f\x42\x49\107\x5f\123\105\x4c\105\x43\x54\123\x3d\61"); goto KwAbO; RAtap: $this->datatables->where("\x75\163\145\x72\163\56\151\144\40\41\75", $id); goto sBiHf; s127k: return $this->datatables->generate(); goto He3oa; lIUeF: $this->datatables->from("\x75\x73\x65\162\163\x5f\x67\x72\x6f\165\160\x73"); goto J3x5m; sBiHf: p2Pmz: goto s127k; He3oa: } public function getLevelGuru() { $query = $this->db->get("\x6c\145\166\145\x6c\137\147\165\x72\x75")->result(); return $query; } public function getDataadmin() { goto b7_p1; b7_p1: $this->db->query("\x53\x45\124\40\123\x51\114\137\x42\111\107\137\x53\x45\114\x45\103\x54\123\75\61"); goto tVwdN; nXuoq: $this->datatables->join("\165\x73\145\162\163", "\165\x73\x65\162\x73\137\x67\x72\x6f\x75\x70\163\x2e\x75\x73\x65\162\137\x69\x64\75\165\x73\x65\x72\163\56\x69\144"); goto MfeR_; tVwdN: $this->datatables->select("\x75\x73\x65\162\163\56\151\144\x2c\40\165\x73\145\x72\x6e\141\x6d\x65\54\40\x66\x69\x72\163\164\x5f\x6e\141\155\145\54\40\154\x61\163\164\x5f\x6e\x61\x6d\145\x2c\40\145\x6d\141\151\154\54\40\x46\x52\x4f\115\137\125\116\x49\130\124\111\115\105\50\143\162\x65\x61\x74\x65\144\x5f\157\156\51\40\141\163\40\x63\162\x65\x61\164\x65\x64\x5f\157\156\54\x20\154\x61\x73\164\137\x6c\x6f\x67\x69\156\x2c\40\141\x63\164\151\166\x65\x2c\x20\147\162\x6f\x75\160\x73\56\156\141\x6d\145\x20\x61\x73\40\154\x65\166\145\154"); goto BVDch; s2z58: return $this->datatables->generate(); goto aFsNt; MfeR_: $this->datatables->join("\147\162\x6f\165\x70\163", "\x75\163\145\162\x73\x5f\147\162\157\x75\160\163\56\147\x72\157\165\160\137\151\x64\75\x67\162\157\x75\x70\x73\x2e\151\x64"); goto BJTxB; BVDch: $this->datatables->from("\x75\x73\x65\162\163\137\x67\x72\157\x75\x70\163"); goto nXuoq; BJTxB: $this->datatables->where("\x67\162\x6f\x75\160\137\x69\x64\40\x3d", 1); goto s2z58; aFsNt: } public function getUserGuru($tp, $smt) { goto Aomk3; Aomk3: $this->db->query("\123\x45\x54\x20\123\121\x4c\x5f\x42\x49\x47\x5f\123\x45\x4c\x45\x43\124\123\75\61"); goto G9_91; G9_91: $this->datatables->select("\141\56\x69\x64\137\x67\x75\162\x75\x2c\40\141\56\x6e\141\155\x61\x5f\x67\x75\x72\165\54\40\x61\56\x75\163\145\162\156\141\155\145\54\40\x61\x2e\160\x61\x73\163\167\x6f\162\x64\54\x20\143\x2e\x6c\x65\166\145\x6c\x2c\x20\x65\x2e\151\x64\x2c\40" . "\50\x53\x45\114\105\x43\x54\x20\103\117\125\116\x54\x28\x69\x64\51\x20\x46\122\117\115\x20\x75\x73\x65\162\x73\x20\127\x48\x45\122\105\40\x65\x2e\x75\163\x65\162\x6e\x61\155\x65\x20\x3d\40\141\x2e\x75\163\x65\162\156\141\155\x65\51\40\101\x53\x20\141\x6b\164\151\146\54\x20" . "\50\x53\105\x4c\x45\103\x54\x20\x43\x4f\x55\116\124\x28\x6c\x6f\147\x69\x6e\x29\x20\x46\122\x4f\x4d\x20\x6c\x6f\147\151\x6e\x5f\x61\164\164\145\155\160\164\163\x20\127\110\x45\x52\105\x20\x6c\x6f\x67\151\x6e\137\141\x74\x74\145\x6d\160\x74\x73\56\x6c\x6f\x67\x69\156\40\75\40\x61\x2e\165\x73\145\x72\156\x61\155\145\51\40\x41\x53\x20\162\x65\163\x65\x74"); goto JJ2ho; VdhNz: $this->datatables->join("\x6c\145\166\145\x6c\137\x67\165\162\165\40\x63", "\142\x2e\x69\144\x5f\x6a\x61\x62\141\x74\141\156\x3d\x63\x2e\151\x64\x5f\x6c\145\166\x65\x6c", "\154\145\x66\x74"); goto nGc8e; JJ2ho: $this->datatables->from("\x6d\141\163\x74\145\162\137\147\165\162\x75\40\141"); goto OI2FJ; nGc8e: $this->datatables->join("\165\x73\145\162\163\40\145", "\x61\x2e\165\x73\145\x72\156\141\155\145\75\x65\x2e\165\163\x65\x72\156\x61\x6d\145", "\x6c\x65\146\x74"); goto e1JoX; e1JoX: return $this->datatables->generate(); goto a454c; OI2FJ: $this->datatables->join("\152\141\142\141\x74\141\x6e\137\x67\165\x72\165\x20\x62", "\x61\56\x69\144\137\147\x75\x72\x75\x3d\142\56\x69\144\x5f\147\165\x72\x75\x20\x41\x4e\104\x20\x62\x2e\151\x64\137\x74\x70\x3d" . $tp . "\40\101\116\104\40\x62\x2e\x69\144\137\x73\x6d\164\75" . $smt . '', "\x6c\x65\x66\x74"); goto VdhNz; a454c: } public function getDataGuru($id) { goto D2Qzl; mMEiS: $this->db->where("\x69\144\137\x67\x75\x72\x75", $id); goto bkxpo; D2Qzl: $this->db->select("\52"); goto Mpvtl; Mpvtl: $this->db->from("\155\x61\x73\164\145\x72\137\x67\165\162\165"); goto mMEiS; ZJQt8: return $query; goto zDVaE; bkxpo: $query = $this->db->get()->row(); goto ZJQt8; zDVaE: } public function getDetailGuru($id) { goto awZR6; eP6wc: $this->db->join("\x75\163\x65\x72\163\x20\x65", "\x61\x2e\165\163\145\162\x6e\141\155\145\75\x65\x2e\x75\163\x65\162\156\x61\x6d\x65", "\x6c\x65\x66\x74"); goto thPRK; WSS7s: $query = $this->db->get()->row(); goto OrQlt; fLlpu: $this->db->select("\x61\56\151\x64\x5f\x67\165\162\x75\54\40\141\x2e\x6e\141\x6d\141\137\147\165\x72\x75\54\40\x61\56\165\x73\145\162\x6e\141\155\145\54\x20\x61\56\160\141\163\163\x77\x6f\162\x64\54\x20\x61\56\x65\155\x61\151\154\54\x20\x63\56\154\145\x76\145\x6c\x2c\x20\145\x2e\x69\x64\54\40\50\123\105\x4c\x45\103\124\x20\x43\x4f\x55\116\x54\50\151\144\x29\x20\x46\122\117\115\40\x75\163\145\x72\x73\40\127\110\x45\122\105\x20\145\x2e\x75\x73\x65\x72\156\x61\155\145\x20\75\x20\141\x2e\165\x73\145\x72\x6e\141\155\x65\x29\40\101\123\40\x61\153\x74\x69\x66"); goto HWXRo; awZR6: $this->db->query("\123\x45\124\40\x53\x51\x4c\x5f\x42\x49\x47\137\x53\105\114\x45\103\124\123\75\x31"); goto fLlpu; OrQlt: return $query; goto A6fbe; HWXRo: $this->db->from("\155\x61\163\164\145\162\137\x67\165\162\x75\40\141"); goto Ju3KD; Ju3KD: $this->db->join("\152\x61\142\141\x74\x61\x6e\137\147\x75\162\x75\x20\142", "\x61\x2e\x69\x64\x5f\147\x75\162\x75\75\142\56\x69\x64\x5f\x67\x75\x72\165", "\154\x65\x66\164"); goto Z6kQP; Z6kQP: $this->db->join("\x6c\145\x76\145\x6c\x5f\x67\x75\x72\165\x20\143", "\142\x2e\x69\144\x5f\152\141\142\141\x74\141\x6e\75\x63\56\151\144\x5f\154\145\x76\145\x6c", "\x6c\145\x66\x74"); goto eP6wc; thPRK: $this->db->where("\x61\56\x69\144\137\x67\165\162\x75", $id); goto WSS7s; A6fbe: } public function getGuruByUsername($username) { goto ynttx; ynttx: $this->db->where("\165\x73\145\162\x6e\141\x6d\145", $username); goto vlVqo; pIODn: return $query; goto v5aaJ; vlVqo: $query = $this->db->get("\155\141\x73\x74\145\x72\137\x67\x75\162\x75")->row(); goto pIODn; v5aaJ: } public function getSiswaByUsername($username) { goto i0svr; i0svr: $this->db->where("\165\x73\x65\x72\156\x61\155\x65", $username); goto S_jXq; TNLYp: return $query; goto zzYOW; S_jXq: $query = $this->db->get("\155\x61\163\164\x65\162\137\163\x69\x73\167\x61")->row(); goto TNLYp; zzYOW: } public function getUsers($username) { goto Qw9jX; jO2Dt: return $query; goto KuLP9; g1uhn: $query = $this->db->get("\165\163\145\162\163")->row(); goto jO2Dt; Qw9jX: $this->db->where("\x75\163\145\162\156\141\x6d\145", $username); goto g1uhn; KuLP9: } public function getGroupSiswa() { goto WJ4O5; y_0zi: $this->db->join("\165\x73\145\162\163\x20\142", "\x61\56\165\x73\x65\162\137\151\144\x3d\142\x2e\x69\144", "\154\145\146\x74"); goto XF61r; XF61r: $this->db->where("\x67\x72\x6f\x75\160\137\151\144", 3); goto juN22; WJ4O5: $this->db->select("\x2a"); goto EOEmK; EOEmK: $this->db->from("\165\163\x65\x72\x73\x5f\147\162\157\x75\x70\x73\40\141"); goto y_0zi; boeZO: return $query; goto xyrhD; juN22: $query = $this->db->get()->result(); goto boeZO; xyrhD: } public function getKelas($tp, $smt) { goto ydQ2N; NZROm: return $query; goto QEjdU; c3J6p: $this->db->where("\151\144\137\x73\x6d\164", $smt); goto PVpc3; ydQ2N: $this->db->where("\151\144\137\164\x70", $tp); goto c3J6p; PVpc3: $query = $this->db->get("\155\141\163\x74\x65\162\x5f\153\145\x6c\141\163")->result(); goto NZROm; QEjdU: } public function getMapel() { $query = $this->db->get("\155\x61\163\164\145\162\137\155\x61\x70\x65\154")->result(); return $query; } public function getUserSiswaPage($id_tp, $id_smt, $offset, $limit, $search = null, $sort = null, $order = null) { goto DWbKo; GVge4: $this->db->join("\x6d\141\163\164\145\162\x5f\153\145\x6c\x61\163\40\x66", "\x66\x2e\151\144\137\x6b\145\154\141\163\x3d\x64\56\x69\144\137\153\145\154\x61\x73", "\x6c\x65\146\x74"); goto lNme7; VQDTK: $this->db->like("\141\56\156\x61\155\141", $search); goto h16vE; wW2Eu: FMILV: goto NT62E; WGCTx: $this->db->join("\x6b\145\x6c\x61\163\137\163\151\x73\x77\141\40\x64", "\x64\56\151\x64\137\x73\151\x73\x77\141\75\141\x2e\x69\x64\137\163\x69\163\167\141\40\x41\116\104\40\144\56\x69\144\137\164\160\x20\75\x20" . $id_tp . "\x20\x41\x4e\104\x20\144\56\x69\144\137\163\x6d\164\40\75\40" . $id_smt . '', "\154\145\x66\164"); goto GVge4; j8kZJ: $this->db->or_like("\x61\56\x6e\151\163\156", $search); goto wW2Eu; NT62E: return $this->db->get()->result(); goto PMH8A; ZbXWg: if (!($search != null)) { goto FMILV; } goto VQDTK; DWbKo: $this->db->select("\141\x2e\x69\x64\x5f\163\x69\163\167\141\54\40\141\56\156\x69\x73\54\40\141\x2e\x66\x6f\x74\157\54\40\141\x2e\156\141\155\x61\x2c\x20\141\56\x75\x73\x65\x72\x6e\141\155\145\54\x20\x61\56\160\141\x73\163\167\x6f\162\x64\54\40\x64\x2e\151\144\137\x6b\145\154\141\x73\x2c\x20" . "\146\x2e\x6e\141\x6d\x61\x5f\x6b\145\x6c\141\x73\x2c\40\50\123\x45\114\x45\103\124\40\103\x4f\125\x4e\124\x28\151\x64\51\40\x46\x52\x4f\115\x20\165\x73\145\x72\x73\x20\x57\110\105\122\105\40\x75\163\x65\x72\163\56\x75\x73\x65\x72\x6e\x61\155\x65\40\75\x20\x61\56\165\163\x65\162\x6e\141\x6d\x65\51\x20\x41\x53\x20\x61\x6b\x74\151\146\x2c\40" . "\50\x53\105\x4c\105\103\x54\40\103\117\x55\x4e\124\x28\x6c\157\x67\x69\x6e\x29\x20\106\122\x4f\115\40\x6c\x6f\147\151\156\x5f\x61\x74\x74\145\155\x70\164\163\40\x57\x48\105\122\x45\40\x6c\x6f\147\151\156\x5f\x61\x74\164\x65\155\x70\164\163\x2e\x6c\x6f\147\x69\156\40\75\x20\x61\56\x75\x73\x65\x72\156\x61\155\x65\51\40\x41\x53\x20\x72\x65\163\x65\164"); goto HOu2s; lNme7: $this->db->order_by("\111\x53\116\125\114\x4c\x28\x66\56\154\145\166\x65\x6c\137\151\x64\51\x2c\x20\146\x2e\x6c\x65\166\145\154\137\x69\144\40\x41\123\x43"); goto jY3PO; h16vE: $this->db->or_like("\x61\56\x6e\151\x73", $search); goto j8kZJ; VvZnx: $this->db->order_by("\141\56\x6e\141\155\x61", "\x41\x53\x43"); goto ZbXWg; jY3PO: $this->db->order_by("\x66\56\156\141\x6d\x61\x5f\x6b\x65\x6c\141\163", "\x41\x53\103"); goto VvZnx; HOu2s: $this->db->from("\x6d\141\163\164\145\x72\137\x73\151\163\167\x61\40\x61"); goto sdi3H; sdi3H: $this->db->limit($limit, $offset); goto WGCTx; PMH8A: } public function getUserSiswaTotalPage($search = null) { goto h5E8s; HYgqq: return $this->db->get()->num_rows(); goto CxgwD; UoDfa: $this->db->like("\156\x61\x6d\141", $search); goto G4HzD; h5E8s: $this->db->select("\x69\144\137\163\151\163\x77\x61"); goto mw_Wk; G4HzD: $this->db->or_like("\x6e\x69\x73", $search); goto STQZQ; STQZQ: $this->db->or_like("\x6e\151\x73\x6e", $search); goto JW4kt; JW4kt: ddoy9: goto HYgqq; GDy8B: if (!($search != null)) { goto ddoy9; } goto UoDfa; mw_Wk: $this->db->from("\x6d\x61\163\x74\145\162\x5f\x73\151\163\167\141"); goto GDy8B; CxgwD: } public function getUserSiswa($tp, $smt) { goto KqDBP; KqDBP: $this->db->query("\123\x45\x54\x20\123\x51\x4c\137\102\111\107\x5f\x53\x45\x4c\x45\103\x54\123\x3d\x31"); goto OtZrs; OtZrs: $this->datatables->select("\x61\56\x69\144\x5f\163\151\163\x77\141\54\x20\x61\x2e\156\151\x73\54\56\x61\56\156\141\155\141\x2c\x20\141\x2e\165\163\145\x72\x6e\x61\155\x65\x2c\40\x61\56\160\x61\x73\163\167\x6f\x72\x64\x2c\40\143\x2e\156\x61\x6d\x61\137\x6b\x65\154\141\163\54\40\144\x2e\151\x64\x2c\x20\x28\123\x45\x4c\105\x43\x54\x20\x43\117\125\x4e\124\50\x69\x64\51\40\106\122\x4f\115\40\165\x73\x65\x72\163\x20\127\110\x45\x52\105\40\144\x2e\165\x73\145\x72\x6e\141\x6d\x65\40\x3d\x20\x61\x2e\165\x73\x65\x72\156\x61\155\145\x29\40\101\123\40\x61\x6b\x74\x69\146"); goto WF1pb; gnagw: $this->datatables->join("\155\141\163\164\145\x72\137\153\x65\x6c\x61\x73\40\143", "\143\56\151\x64\x5f\153\145\154\141\163\x3d\142\56\151\x64\137\153\x65\154\x61\x73", "\154\145\146\164"); goto dw_LV; Pc4ZG: $this->datatables->join("\153\145\154\141\163\x5f\x73\151\163\167\141\x20\x62", "\x62\56\151\144\x5f\x73\x69\163\167\x61\x3d\141\56\x69\x64\x5f\x73\x69\163\x77\x61\x20\101\x4e\x44\x20\142\56\151\144\x5f\x74\x70\75" . $tp . "\x20\x41\x4e\x44\40\142\x2e\x69\144\137\x73\155\x74\x3d" . $smt . '', "\x6c\x65\x66\x74"); goto gnagw; PF5Hr: return $this->datatables->generate(); goto jG21C; WF1pb: $this->datatables->from("\x6d\x61\163\164\x65\162\137\x73\x69\163\167\x61\40\141"); goto Pc4ZG; dw_LV: $this->datatables->join("\165\x73\x65\x72\x73\40\144", "\x64\x2e\x75\163\145\162\x6e\x61\155\145\75\x61\x2e\165\x73\x65\162\x6e\x61\155\145", "\x6c\145\x66\x74"); goto PF5Hr; jG21C: } public function getDataSiswa($id) { goto b8eXh; ZrOMH: $this->db->from("\155\141\x73\x74\145\162\x5f\163\x69\163\x77\x61"); goto Ee3qV; Ee3qV: $this->db->where("\151\x64\137\163\x69\x73\x77\x61", $id); goto DHsjT; DHsjT: $query = $this->db->get()->row(); goto gGFSP; b8eXh: $this->db->select("\156\x69\163\x2c\40\x6e\151\163\156\x2c\40\x6e\141\x6d\x61\x2c\40\x75\x73\145\x72\x6e\x61\x6d\145\x2c\x20\160\141\163\163\167\x6f\x72\144"); goto ZrOMH; gGFSP: return $query; goto iUxAT; iUxAT: } public function getSiswaAktif() { goto T2KZg; PPFRV: return $this->db->get("\155\x61\x73\x74\145\x72\137\163\x69\x73\167\x61\x20\141")->result(); goto rZiE4; T2KZg: $this->db->select("\x61\56\x69\x64\x5f\163\x69\163\x77\x61\x2c\40\x61\x2e\x6e\x69\x73\x2c\40\x61\56\156\x69\x73\x6e\54\x20\x61\56\165\x73\x65\x72\156\x61\155\145\54\40\x61\x2e\160\141\x73\163\x77\157\162\144\x2c\40\141\56\x6e\141\x6d\141\x2c\x20\x63\56\151\x64\54\40\x28\x53\105\114\x45\x43\124\x20\x43\117\125\x4e\x54\x28\151\x64\x29\40\106\x52\x4f\x4d\x20\x75\163\x65\x72\163\40\x57\110\105\122\x45\x20\165\x73\145\x72\163\56\165\x73\x65\162\156\x61\x6d\145\x20\x3d\x20\141\56\165\x73\x65\x72\156\141\155\x65\x29\40\101\123\x20\141\x6b\x74\151\146"); goto LXq9s; LXq9s: $this->db->join("\165\x73\145\x72\x73\40\143", "\141\x2e\165\163\x65\x72\156\141\x6d\145\75\143\x2e\x75\163\x65\162\x6e\141\155\145", "\154\145\x66\164"); goto PPFRV; rZiE4: } public function getGuruAktif() { goto ALX_v; ALX_v: $this->db->select("\x61\x2e\x69\144\137\x67\x75\x72\165\54\40\x63\x2e\x69\144\x2c\x20\x28\123\x45\x4c\105\x43\124\x20\103\x4f\125\x4e\x54\x28\151\x64\51\40\106\x52\117\115\x20\165\163\145\162\163\x20\x57\110\105\x52\x45\x20\165\x73\x65\x72\x73\56\x75\163\x65\162\156\x61\x6d\145\40\75\x20\141\x2e\x75\163\145\162\156\x61\155\145\51\40\101\x53\40\141\x6b\164\151\x66"); goto Y9Wt2; Vox1x: return $this->db->get("\x6d\x61\163\x74\x65\162\x5f\x67\x75\162\165\x20\x61")->result(); goto BR4Ej; Y9Wt2: $this->db->join("\165\x73\145\162\163\40\143", "\x61\56\x75\x73\145\x72\x6e\141\155\145\75\x63\56\x75\x73\145\162\x6e\141\155\145", "\154\145\146\164"); goto Vox1x; BR4Ej: } }

デコード(難読化解除)されたコード

<?php

/*   ________________________________________
    |                 GarudaCBT              |
    |    https://github.com/garudacbt/cbt    |
    |________________________________________|
*/
defined("BASEPATH") or exit("No direct script access allowed");
class Users_model extends CI_Model
{
    public function getDatausers($id = null)
    {
        $this->db->query("SET SQL_BIG_SELECTS=1");
        $this->datatables->select("users.id, username, first_name, last_name, email, FROM_UNIXTIME(created_on) as created_on, last_login, active, groups.name as level");
        $this->datatables->from("users_groups");
        $this->datatables->join("users", "users_groups.user_id=users.id");
        $this->datatables->join("groups", "users_groups.group_id=groups.id");
        if (!($id !== null)) {
            goto p2Pmz;
        }
        $this->datatables->where("users.id !=", $id);
        p2Pmz:
        return $this->datatables->generate();
    }
    public function getLevelGuru()
    {
        $query = $this->db->get("level_guru")->result();
        return $query;
    }
    public function getDataadmin()
    {
        $this->db->query("SET SQL_BIG_SELECTS=1");
        $this->datatables->select("users.id, username, first_name, last_name, email, FROM_UNIXTIME(created_on) as created_on, last_login, active, groups.name as level");
        $this->datatables->from("users_groups");
        $this->datatables->join("users", "users_groups.user_id=users.id");
        $this->datatables->join("groups", "users_groups.group_id=groups.id");
        $this->datatables->where("group_id =", 1);
        return $this->datatables->generate();
    }
    public function getUserGuru($tp, $smt)
    {
        $this->db->query("SET SQL_BIG_SELECTS=1");
        $this->datatables->select("a.id_guru, a.nama_guru, a.username, a.password, c.level, e.id, (SELECT COUNT(id) FROM users WHERE e.username = a.username) AS aktif, (SELECT COUNT(login) FROM login_attempts WHERE login_attempts.login = a.username) AS reset");
        $this->datatables->from("master_guru a");
        $this->datatables->join("jabatan_guru b", "a.id_guru=b.id_guru AND b.id_tp=" . $tp . " AND b.id_smt=" . $smt . '', "left");
        $this->datatables->join("level_guru c", "b.id_jabatan=c.id_level", "left");
        $this->datatables->join("users e", "a.username=e.username", "left");
        return $this->datatables->generate();
    }
    public function getDataGuru($id)
    {
        $this->db->select("*");
        $this->db->from("master_guru");
        $this->db->where("id_guru", $id);
        $query = $this->db->get()->row();
        return $query;
    }
    public function getDetailGuru($id)
    {
        $this->db->query("SET SQL_BIG_SELECTS=1");
        $this->db->select("a.id_guru, a.nama_guru, a.username, a.password, a.email, c.level, e.id, (SELECT COUNT(id) FROM users WHERE e.username = a.username) AS aktif");
        $this->db->from("master_guru a");
        $this->db->join("jabatan_guru b", "a.id_guru=b.id_guru", "left");
        $this->db->join("level_guru c", "b.id_jabatan=c.id_level", "left");
        $this->db->join("users e", "a.username=e.username", "left");
        $this->db->where("a.id_guru", $id);
        $query = $this->db->get()->row();
        return $query;
    }
    public function getGuruByUsername($username)
    {
        $this->db->where("username", $username);
        $query = $this->db->get("master_guru")->row();
        return $query;
    }
    public function getSiswaByUsername($username)
    {
        $this->db->where("username", $username);
        $query = $this->db->get("master_siswa")->row();
        return $query;
    }
    public function getUsers($username)
    {
        $this->db->where("username", $username);
        $query = $this->db->get("users")->row();
        return $query;
    }
    public function getGroupSiswa()
    {
        $this->db->select("*");
        $this->db->from("users_groups a");
        $this->db->join("users b", "a.user_id=b.id", "left");
        $this->db->where("group_id", 3);
        $query = $this->db->get()->result();
        return $query;
    }
    public function getKelas($tp, $smt)
    {
        $this->db->where("id_tp", $tp);
        $this->db->where("id_smt", $smt);
        $query = $this->db->get("master_kelas")->result();
        return $query;
    }
    public function getMapel()
    {
        $query = $this->db->get("master_mapel")->result();
        return $query;
    }
    public function getUserSiswaPage($id_tp, $id_smt, $offset, $limit, $search = null, $sort = null, $order = null)
    {
        $this->db->select("a.id_siswa, a.nis, a.foto, a.nama, a.username, a.password, d.id_kelas, f.nama_kelas, (SELECT COUNT(id) FROM users WHERE users.username = a.username) AS aktif, (SELECT COUNT(login) FROM login_attempts WHERE login_attempts.login = a.username) AS reset");
        $this->db->from("master_siswa a");
        $this->db->limit($limit, $offset);
        $this->db->join("kelas_siswa d", "d.id_siswa=a.id_siswa AND d.id_tp = " . $id_tp . " AND d.id_smt = " . $id_smt . '', "left");
        $this->db->join("master_kelas f", "f.id_kelas=d.id_kelas", "left");
        $this->db->order_by("ISNULL(f.level_id), f.level_id ASC");
        $this->db->order_by("f.nama_kelas", "ASC");
        $this->db->order_by("a.nama", "ASC");
        if (!($search != null)) {
            goto FMILV;
        }
        $this->db->like("a.nama", $search);
        $this->db->or_like("a.nis", $search);
        $this->db->or_like("a.nisn", $search);
        FMILV:
        return $this->db->get()->result();
    }
    public function getUserSiswaTotalPage($search = null)
    {
        $this->db->select("id_siswa");
        $this->db->from("master_siswa");
        if (!($search != null)) {
            goto ddoy9;
        }
        $this->db->like("nama", $search);
        $this->db->or_like("nis", $search);
        $this->db->or_like("nisn", $search);
        ddoy9:
        return $this->db->get()->num_rows();
    }
    public function getUserSiswa($tp, $smt)
    {
        $this->db->query("SET SQL_BIG_SELECTS=1");
        $this->datatables->select("a.id_siswa, a.nis,.a.nama, a.username, a.password, c.nama_kelas, d.id, (SELECT COUNT(id) FROM users WHERE d.username = a.username) AS aktif");
        $this->datatables->from("master_siswa a");
        $this->datatables->join("kelas_siswa b", "b.id_siswa=a.id_siswa AND b.id_tp=" . $tp . " AND b.id_smt=" . $smt . '', "left");
        $this->datatables->join("master_kelas c", "c.id_kelas=b.id_kelas", "left");
        $this->datatables->join("users d", "d.username=a.username", "left");
        return $this->datatables->generate();
    }
    public function getDataSiswa($id)
    {
        $this->db->select("nis, nisn, nama, username, password");
        $this->db->from("master_siswa");
        $this->db->where("id_siswa", $id);
        $query = $this->db->get()->row();
        return $query;
    }
    public function getSiswaAktif()
    {
        $this->db->select("a.id_siswa, a.nis, a.nisn, a.username, a.password, a.nama, c.id, (SELECT COUNT(id) FROM users WHERE users.username = a.username) AS aktif");
        $this->db->join("users c", "a.username=c.username", "left");
        return $this->db->get("master_siswa a")->result();
    }
    public function getGuruAktif()
    {
        $this->db->select("a.id_guru, c.id, (SELECT COUNT(id) FROM users WHERE users.username = a.username) AS aktif");
        $this->db->join("users c", "a.username=c.username", "left");
        return $this->db->get("master_guru a")->result();
    }
}


■【無料】ワードプレス:マルウェアスキャン&セキュリティープラグイン [マルウェア・ウィルス検出と駆除]

■WordPress のマルウェア駆除、セキュリティー対策 カスタマイズや修正、引っ越し・復旧のご依頼承ります

(C)2019 ワードプレス ドクター All rights reserved.