Server IP : 103.119.228.120 / Your IP : 3.22.249.229 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/hendraso/public_html/Library/ |
Upload File : |
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ CLASS All extends Controller{ public static function load() { return new All; } //function getLang($cat) { function getLang() { global $lang; //$data = Database::build()->getAllDb("SELECT langVariable, langEn, langCn FROM `language` WHERE langCategoryPage = '{$cat}'"); $data = Database::build()->getAllDb("SELECT langVariable, langEn, langCn FROM `language`"); $arrData = array(); foreach($data as $k => $v) { $arrData[strtolower($v['langVariable'])] = !empty($v["lang".$lang]) ? $v["lang".$lang] : $v["langEn"]; } return $arrData; } function getSlider($limit = false, $cond = false) { global $lang; $cond = ($cond) ? " WHERE 1 AND {$cond}" : ""; $sql = "SELECT * FROM `slider` {$cond} ORDER BY slidSection ASC"; $data = $this->getDataInTable($sql, $limit); foreach($data as $k => $v) { $data[$k]['slidDescription'] = !empty($v['slidDescription'.$lang]) ? $v['slidDescription'.$lang] : $v['slidDescription']; } return $data; } function getAward($limit = false, $cond = false) { $cond = ($cond) ? " WHERE 1 AND {$cond}" : ""; $sql = "SELECT * FROM `award_list` {$cond}"; $data = $this->getDataInTable($sql, $limit); return $data; } function getGlobal($limit = false, $cond = false) { $sql = "SELECT * FROM `global_setting`"; $data = Database::build()->getAllDbOne($sql); return $data; } function getPageContent($cond = false, $detail = false){ global $lang; global $pathLang; $cond = ($cond) ? " WHERE 1 AND {$cond}" : ""; $sql = "SELECT * FROM `master_content` {$cond} ORDER BY mconSection ASC"; if(!$detail) { $data = $this->getDataInTable($sql); $arrData = array(); foreach($data as $k => $v) { $arrData[$v['mconSection']] = $v; $arrData[$v['mconSection']]['mconDescription'] = !empty($v['mconDescription'.$lang]) ? $v['mconDescription'.$lang] : $v['mconDescription']; $arrData[$v['mconSection']]['mconTitle'] = !empty($v['mconTitle'.$lang]) ? $v['mconTitle'.$lang] : $v['mconTitle']; $arrData[$v['mconSection']]['mconMenuName'] = !empty($v['mconMenuName'.$lang]) ? $v['mconMenuName'.$lang] : $v['mconMenuName']; $arrData[$v['mconSection']]['meta_title'] = !empty($v['mconMetaTitle'.$lang]) ? $v['mconMetaTitle'.$lang] : $v['mconMetaTitle']; $arrData[$v['mconSection']]['meta_description'] = !empty($v['mconMetaDescription'.$lang]) ? $v['mconMetaDescription'.$lang] : $v['mconMetaDescription']; } }else{ $arrData = Database::build()->getAllDbOne($sql); $arrData['meta_title'] = !empty($arrData['mconMetaTitle'.$lang]) ? $arrData['mconMetaTitle'.$lang] : $arrData['mconMetaTitle']; $arrData['meta_description'] = !empty($arrData['mconMetaDescription'.$lang]) ? $arrData['mconMetaDescription'.$lang] : $arrData['mconMetaDescription']; $arrData['mconDescription'] = !empty($arrData['mconDescription'.$lang]) ? $arrData['mconDescription'.$lang] : $arrData['mconDescription']; $arrData['mconTitle'] = !empty($arrData['mconTitle'.$lang]) ? $arrData['mconTitle'.$lang] : $arrData['mconTitle']; $arrData['mconMenuName'] = !empty($arrData['mconMenuName'.$lang]) ? $arrData['mconMenuName'.$lang] : $arrData['mconMenuName']; } return $arrData; } function getLawyer($cond = false, $field = false, $detail = false){ global $lang; global $pathLang; $cond = ($cond) ? " WHERE 1 AND lawyStatus = 1 AND {$cond}" : " WHERE 1 AND lawyStatus = 1"; $field = !empty($field) ? $field : "*"; $sql = "SELECT {$field} FROM `lawyers` {$cond} ORDER BY lawySection ASC"; if(!$detail) { $data = $this->getDataInTable($sql); $arrData = array(); foreach($data as $k => $v) { $v['url'] = $pathLang . "/" . Genfunction::load()->sanitize($v['lawyName']) . "-4" . $v['lawyId']; $v['lawyEducationBackground'] = !empty($v['lawyEducationBackground'.$lang]) ? $v['lawyEducationBackground'.$lang] : $v['lawyEducationBackground']; if(isset($v['lawyType'])) { $arrData[$v['lawyType']][] = $v; }else{ $arrData[] = $v; } } }else{ $arrData = Database::build()->getAllDbOne($sql); $arrData['lawyEducationBackground'] = !empty($arrData['lawyEducationBackground'.$lang]) ? $arrData['lawyEducationBackground'.$lang] : $arrData['lawyEducationBackground']; $arrData['meta_title'] = !empty($arrData['lawyMetaTitle'.$lang]) ? $arrData['lawyMetaTitle'.$lang] : $arrData['lawyMetaTitle']; $arrData['meta_description'] = !empty($arrData['lawyMetaDescription'.$lang]) ? $arrData['lawyMetaDescription'.$lang] : $arrData['lawyMetaDescription']; } return $arrData; } function getPractices($limit = false, $cond = false, $detail = false){ global $lang; global $pathLang; $where = " WHERE 1 AND lpraCreateTime <= CURDATE() AND lpraStatus = 1"; $where .= ($cond) ? " AND {$cond}" : ""; $sql = "SELECT * FROM `list_practices` {$where} ORDER BY lpraCreateTime DESC, lpraId DESC"; if(!$detail) { $data = $this->getDataInTable($sql, $limit); foreach($data as $k => $v) { $data[$k]['subject'] = $this->trunc(html_entity_decode($v['lpraDescription']), 20); $data[$k]['lpraTitle'] = !empty($v['lpraTitle'.$lang]) ? $v['lpraTitle'.$lang] : $v['lpraTitle']; $data[$k]['lpraDescription'] = !empty($v['lpraDescription'.$lang]) ? $v['lpraDescription'.$lang] : $v['lpraDescription']; $data[$k]['url'] = $pathLang . "/" . Genfunction::load()->sanitize($v['lpraTitle']) . "-3" . $v['lpraId']; } }else { $data = Database::build()->getAllDbOne($sql); if (!empty($data)) { $data['lpraTitle'] = !empty($data['lpraTitle'.$lang]) ? $data['lpraTitle'.$lang] : $data['lpraTitle']; $data['lpraDescription'] = !empty($data['lpraDescription'.$lang]) ? $data['lpraDescription'.$lang] : $data['lpraDescription']; $data['url'] = $pathLang . "/" . Genfunction::load()->sanitize($data['lpraTitle']) . "-3" . $data['lpraId']; $data['meta_title'] = !empty($data['lpraMetaTitle'.$lang]) ? $data['lpraMetaTitle'.$lang] : $data['lpraMetaTitle']; $data['meta_description'] = !empty($data['lpraMetaDescription'.$lang]) ? $data['lpraMetaDescription'.$lang] : $data['lpraMetaDescription']; } } return $data; } function getCareer($limit = false, $cond = false, $detail = false){ global $lang; global $pathLang; $where = " WHERE 1 AND careRelease <= CURDATE() AND careStatus = 1"; $where .= ($cond) ? " AND {$cond}" : ""; $sql = "SELECT * FROM `careers` LEFT JOIN job_position ON careJposId = jposId {$where} ORDER BY careRelease DESC, careId DESC"; if(!$detail) { $data = $this->getDataInTable($sql, $limit); foreach($data as $k => $v) { $data[$k]['url'] = $pathLang . "/" . Genfunction::load()->sanitize($v['careJobsTitle']) . "-2" . $v['careId']; $data[$k]['subject'] = $this->trunc(html_entity_decode($v['careQualification']), 20); $data[$k]['careJobsTitle'] = !empty($v['careJobsTitle'.$lang]) ? $v['careJobsTitle'.$lang] : $v['careJobsTitle']; $data[$k]['careQualification'] = !empty($v['careQualification'.$lang]) ? $v['careQualification'.$lang] : $v['careQualification']; $data[$k]['careResponsibility'] = !empty($v['careResponsibility'.$lang]) ? $v['careResponsibility'.$lang] : $v['careResponsibility']; } }else { $data = Database::build()->getAllDbOne($sql); if (!empty($data)) { $data['url'] = $pathLang . "/" . Genfunction::load()->sanitize($data['careJobsTitle']) . "-2" . $data['careId']; $data['careJobsTitle'] = !empty($data['careJobsTitle'.$lang]) ? $data['careJobsTitle'.$lang] : $data['careJobsTitle']; $data['careQualification'] = !empty($data['careQualification'.$lang]) ? $data['careQualification'.$lang] : $data['careQualification']; $data['careResponsibility'] = !empty($data['careResponsibility'.$lang]) ? $data['careResponsibility'.$lang] : $data['careResponsibility']; $data['meta_title'] = !empty($data['careMetaTitle'.$lang]) ? $data['careMetaTitle'.$lang] : $data['careMetaTitle']; $data['meta_description'] = !empty($data['careMetaDescription'.$lang]) ? $data['careMetaDescription'.$lang] : $data['careMetaDescription']; } } return $data; } function getNews($limit = false, $cond = false, $detail = false){ global $lang; global $pathLang; $lawyer = $this->getLawyer(false, "lawyId, lawyName, lawyEducationBackground, lawyEducationBackgroundCn"); $arrLawyer = array(); foreach($lawyer as $kLaw => $vLaw) { $arrLawyer[$vLaw['lawyId']] = $vLaw['lawyName']; } $cond = ($cond) ? " WHERE 1 AND newsReleaseDate <= CURDATE() AND newsStatus = 1 AND {$cond}" : ""; $sql = "SELECT * FROM `news` {$cond} ORDER BY newsReleaseDate DESC, newsId DESC"; if(!$detail) { $data = $this->getDataInTable($sql, $limit); foreach($data as $k => $v) { $data[$k]['url'] = $pathLang . "/" . Genfunction::load()->sanitize($v['newsTitle']) . "-1" . $v['newsId']; $data[$k]['subject'] = !empty($v['newsDescription'.$lang]) ? $this->trunc(html_entity_decode($v['newsDescription'.$lang]), 50) : $this->trunc(html_entity_decode($v['newsDescription']), 50); $data[$k]['creator'] = isset($arrLawyer[$v['newsLawyId']]) ? $arrLawyer[$v['newsLawyId']] : ""; $data[$k]['urlcreator'] = isset($arrLawyer[$v['newsLawyId']]) ? Config::load()->path() . "/#lawyers/" . Genfunction::load()->sanitize($arrLawyer[$v['newsLawyId']]) : ""; } }else { $data = Database::build()->getAllDbOne($sql); if (!empty($data)) { $data['url'] = $pathLang . "/" . Genfunction::load()->sanitize($data['newsTitle']) . "-1" . $data['newsId']; $data['creator'] = isset($arrLawyer[$data['newsLawyId']]) ? $arrLawyer[$data['newsLawyId']] : ""; $data['urlcreator'] = isset($arrLawyer[$data['newsLawyId']]) ? Config::load()->path() . "/#lawyers/" . Genfunction::load()->sanitize($arrLawyer[$data['newsLawyId']]) : ""; $data['newsDescription'] = !empty($data['newsDescription'.$lang]) ? $data['newsDescription'.$lang] : $data['newsDescription']; $data['newsTitleCn'] = !empty($data['newsTitleCn'.$lang]) ? $data['newsTitleCn'.$lang] : $data['newsTitleCn']; $data['meta_title'] = !empty($data['newsMetaTitle'.$lang]) ? $data['newsMetaTitle'.$lang] : $data['newsMetaTitle']; $data['meta_description'] = !empty($data['newsMetaDescription'.$lang]) ? $data['newsMetaDescription'.$lang] : $data['newsMetaDescription']; } } return $data; } function getContent($limit = false, $cond = false, $detail = false, $paging = false, $order = false) { global $lang; global $pathLang; $condition = " WHERE 1 AND mconReleaseDate <= CURDATE() AND mconStatus = 1 "; $condition .= ($cond) ? " AND " . $cond : ""; $condition .= !empty($_REQUEST['s']) ? " AND mconTitle LIKE '%".$_REQUEST['s']."%' OR mconShortDescription LIKE '%".$_REQUEST['s']."%'": ""; $order = (!empty($order)) ? "ORDER BY {$order}": ""; $sql = "SELECT * FROM `master_content` {$condition} {$order}"; $limit = !($limit) ? 2000 : $limit; if(!$paging) { if(!$detail) { $data = $this->getDataInTable($sql, $limit); foreach($data as $k => $v) { $data[$k]['url'] = $pathLang . "/" . Genfunction::load()->sanitize($v['mconTitle']) . "-1" . $v['mconId']; $data[$k]['mconDescription'] = !empty($v['mconDescription'.$lang]) ? $v['mconDescription'.$lang] : $v['mconDescription']; } }else { $data = Database::build()->getAllDbOne($sql); if (!empty($data)) { $data['url'] = $pathLang . "/" . Genfunction::load()->sanitize($data['mconTitle']) . "-1" . $data['mconId']; $data['mconDescription'] = !empty($data['mconDescription'.$lang]) ? $data['mconDescription'.$lang] : $data['mconDescription']; } } }else{ $data = $this->createPaging($limit, $sql); foreach($data['data'] as $k => $v) { $data['data'][$k]['url'] = $pathLang . "/" . Genfunction::load()->sanitize($v['mconTitle']) . "-1" . $v['mconId']; $data['data'][$k]['mconDescription'] = !empty($v['mconDescription'.$lang]) ? $v['mconDescription'.$lang] : $v['mconDescription']; } } return $data; } function getDataInTable($sql, $limit = false) { if($limit) { $limit = "LIMIT {$limit}"; } $data = Database::build()->getAllDb($sql . " " . $limit); return $data; } function createPaging($rowsPerPage, $query) { $query_total_el1 = str_replace("SELECT", "", $query); $query_total_el2 = explode(" FROM ", $query_total_el1); $query_total = "SELECT COUNT(1) as TOTAL FROM " . $query_total_el2[1]; $page = 0; // Menyimpan value 0 pada variable page $maxPages = 5; // Menyimpan value 5 pada variable maxPages $getRequest = $_REQUEST; $filter = !empty($getRequest['s']) ? "&s=".$getRequest['s'] : ""; $arrId = array(); $getRows = Database::build()->getAllDbOne($query_total); $totalRows = $getRows['TOTAL']; $totalData = $totalRows; // Menyimpan value dari variable totalRows $totalPages=intval($totalRows/$rowsPerPage) + ($totalRows%$rowsPerPage==0 ? 0 : 1); $status = ""; if(isset($getRequest['page']) && !empty($getRequest['page'])) { // Jika value page tidak kosong $page=intval($getRequest['page']); // Menyimpan value page dengan tipe data integer $halaman= intval($getRequest['page']); // Menyimpan value page dengan tipe data integer if($page<1){ // Jika value pada variable page kurang dari satu $page=1; // Menyimpan value 1 pada variable page } if($page>$totalPages){ // Jika value pada variable page lebih dari value pada variable totalPages $page=$totalPages; // Menyimpan value dari variable totalPages $status = "stop"; } $page-=1; // Perhitungan dari variable page = value pada variable page - 1 if($page<0){ // Jika value pada variable page kurang dari 0 $page=0; // Menyimpan value pada variable page } }else{ $halaman = 1; // Menyimpan value 1 pada variable halaman } $limit = " LIMIT " . $page * $rowsPerPage . ", " . $rowsPerPage; // Menyimpan variable dengan string $getData = Database::build()->getAllDb($query . $limit); $limitInfo = ($page * $rowsPerPage) + 1; // Value dari variable page di kali dengan value dari variable rowsPerPage ditambah 1 lalu di simpan pada variable limitInfo $offsetInfo = count($getData) + ($page * $rowsPerPage); // Value dari variable page dikali dengan value dari variable rowsPerPage di tambah dengan hasil perhitungan variable getData lalu disimpan pada variable offSetInfo /* CREATE PAGING */ if(!empty($getRequest['show'])){ $elmPage = Config::load()->path() . "/" . urlencode(urlencode($getRequest['show']))."/"; }elseif(!empty($getRequest['id'])){ $elmPage = Config::load()->path() . urlencode(urlencode($getRequest['id']))."/"; }else{ $elmPage = Config::load()->path(); } $start=((($halaman%$maxPages==0) ? ($halaman/$maxPages) : intval($halaman/$maxPages)+1)-1)*$maxPages+1; $end=((($start+$maxPages-1)<=$totalPages) ? ($start+$maxPages-1) : $totalPages); $paging = ""; // Deklarasi variable string kosong if($end > 1) { // Jika value pada variable end lebih dari 1 if($halaman>1){ // Jika value pada variable halaman lebih dari 1 $paging = '<li class="page-item first"><a href="'.$elmPage.'page=1'.$filter.'" class="page-link" aria-label="Previous" aria-hidden="true"><i class="fa fa-angle-double-left"></i></a></li>'; // Menyimpan value string di dalam variable } if($start>$maxPages){ // Jika value pada variable start lebih besar dari value pada variable maxPages $paging.='<li class="page-item prev"><a rel="'.($start-1).'" href="'.$elmPage.'page='.($start-1).$filter.'" class="page-link" title="Page '.($start-1).'"><i class="fa fa-angle-left"></i></a></li>'; // Menyimpan value string di dalam variable } for($i=$start;$i<=$end;$i++){ // Melakukan perulangan dimulai dari value variable start sama dengan variable i, dimana dilakukan sebanyak value variable i kurang dari sama dengan value pada variable end if($halaman==$i){ // Jika value pada variable halaman sama dengan value pada variable i $paging.='<li class="page-item active"><a href="#" class="page-link">'.$i.'</a></li>'; // Menyimpan value string di dalam variable } else{ // Jika syarat tidak terpenugi $paging.='<li class="page-item"><a href="'.$elmPage.'page='.$i.$filter.'" class="page-link" rel="'.$i.'" title="Page '.$i.'">'.$i.'</a></li>'; // Menyimpan value string di dalam variable } } if($end<$totalPages){ // Jika value pada variable end lebih kecil dari value pada variable totalPages $paging.='<li class="page-item next"><a rel="'.($end+1).'" href="'.$elmPage.'page='.($end+1).$filter.'" class="page-link" title="Page '.($end+1).'"><i class="fa fa-angle-right"></i></a></li>'; // Menyimpan value string di dalam variable } if($halaman<$totalPages){ // Jika value pada variable halaman lebih kecil dari value pada variable totalPages $paging .= '<li class="page-item last"><a href="'.$elmPage.'page='.$totalPages.$filter.'" class="page-link" aria-label="Next" aria-hidden="true"><i class="fa fa-angle-double-right"></i></a></li>'; // Menyimpan value string di dalam variable } //$paging.= '<div class="clearfix"></div></ul>'; } $dataPaging = $paging; /* ============ */ return array( "data" => $getData, 'paging' => $dataPaging, "pagelabel" => "Showing " . $limitInfo . " to " . $offsetInfo ." of " . $totalData ." entries", "totalProduct" => $totalData, "status" => $status ); } function trunc($phrase, $max_words) { $phrase_array = explode(' ',$phrase); if(count($phrase_array) > $max_words && $max_words > 0) $phrase = implode(' ',array_slice($phrase_array, 0, $max_words)).'...'; return $phrase; } }