| .. | |||||
| ciblog_helper.php | |||||
| dateindo_helper.php | |||||
| index.html |
| Server IP : 103.169.32.36 / Your IP : 216.73.217.13 Web Server : Apache System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : apache ( 48) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/dpmptsp/public_html/newsigniter/application/helpers/ |
Upload File : |
<?php
function is_login()
{
$CI =& get_instance();
$CI->load->library('ion_auth');
if (!$CI->ion_auth->logged_in()){
$CI->session->set_flashdata('error', 'Silahkan login terlebih dahulu.');
redirect('auth/login');
}else if(!$CI->ion_auth->is_admin()){
$CI->session->set_flashdata('error', 'Oops, Terjadi suatu kesalahan.');
redirect('auth/login');
}
}
function slugify($text)
{
// replace non letter or digits by -
$text = preg_replace('~[^\pL\d]+~u', '-', $text);
// transliterate
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
// remove unwanted characters
$text = preg_replace('~[^-\w]+~', '', $text);
// trim
$text = trim($text, '-');
// remove duplicate -
$text = preg_replace('~-+~', '-', $text);
// lowercase
$text = strtolower($text);
if (empty($text)) {
return 'n-a';
}
return $text;
}
// function getDropDownList($table, $columns){
// $CI =& get_instance();
// $query = $CI->db->select($columns)->from($table)->get();
// if($query->num_rows() >= 1){
// $option1 = ['' => '- Pilih -'];
// $option2 = array_column($query->result_array(), $columns[1], $columns[0]);
// $options = $option1 + $option2;
// return $options;
// }
// return $options = ['' => '- Pilih -'];
// }| .. | |||||
| ciblog_helper.php | |||||
| dateindo_helper.php | |||||
| index.html |