403Webshell
Server IP : 127.0.0.1  /  Your IP : 192.168.99.1
Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9
System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64
User : Administrator ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  D:/wamp/www/simbada_2018/application/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/wamp/www/simbada_2018/application/helpers/format_helper_.php
<?php  if  (  !  defined('BASEPATH'))  exit('No  direct  script  access  allowed');

if  (  !  function_exists('get_title'))
{
  function  get_title($modul_name  =  '')
  {
    $title  =  APP_NAME;
    if  ($modul_name)  $title  .=  '  -  '.$modul_name;
    return  $title;
  }
}

if  (  !  function_exists('get_footer'))
{
  function  get_footer()
  {
    $footer  =  APP_FRAMEWORK." - ".APP_FULL_NAME;
    return  $footer;
  }
}

if  (  !  function_exists('get_copyright'))
{
  function  get_copyright()
  {
    $footer  =  APP_COMPANY."@".date('Y');
    return  $footer;
  }
}

if  (  !  function_exists('bulan_list'))
{
  function  bulan_list($kosong  =  0)
  {
    $CI  =&  get_instance();
    $CI->lang->load('calendar');

    if($kosong)  $result[0]  =  'Semua  bulan';
    $result['01']  =  $CI->lang->line('cal_january');
    $result['02']  =  $CI->lang->line('cal_february');
    $result['03']  =  $CI->lang->line('cal_march');
    $result['04']  =  $CI->lang->line('cal_april');
    $result['05']  =  $CI->lang->line('cal_may');
    $result['06']  =  $CI->lang->line('cal_june');
    $result['07']  =  $CI->lang->line('cal_july');
    $result['08']  =  $CI->lang->line('cal_august');
    $result['09']  =  $CI->lang->line('cal_september');
    $result['10']  =  $CI->lang->line('cal_october');
    $result['11']  =  $CI->lang->line('cal_november');
    $result['12']  =  $CI->lang->line('cal_december');

    return  $result;
  }
}

if  (  !  function_exists('bln_list'))
{
  function  bln_list($kosong  =  0)
  {
    $CI  =&  get_instance();
    $CI->lang->load('calendar');

    if($kosong)  $result[0]  =  'Semua  bulan';
    $result['01']  =  $CI->lang->line('cal_jan');
    $result['02']  =  $CI->lang->line('cal_feb');
    $result['03']  =  $CI->lang->line('cal_mar');
    $result['04']  =  $CI->lang->line('cal_apr');
    $result['05']  =  $CI->lang->line('cal_may');
    $result['06']  =  $CI->lang->line('cal_jun');
    $result['07']  =  $CI->lang->line('cal_jul');
    $result['08']  =  $CI->lang->line('cal_aug');
    $result['09']  =  $CI->lang->line('cal_sep');
    $result['10']  =  $CI->lang->line('cal_oct');
    $result['11']  =  $CI->lang->line('cal_nov');
    $result['12']  =  $CI->lang->line('cal_dec');

    return  $result;
  }
}

if  (  !  function_exists('nama_bulan'))
{
  function  nama_bulan($bulan)
  {
    $array_bulan  =  bulan_list();
    if(strlen($bulan)  ==  1)  $bulan  =  '0'.$bulan;
    return  $array_bulan[$bulan];
  }
}

if  (  !  function_exists('nama_bln'))
{
  function  nama_bln($bulan)
  {
    $array_bulan  =  bln_list();
    if(strlen($bulan)  ==  1)  $bulan  =  '0'.$bulan;
    return  $array_bulan[$bulan];
  }
}

if  (  !  function_exists('to_rupiah'))
{
  function  to_rupiah($value)
  {
    if($value  <  0)
    {
      return  '(  Rp  '.number_format(abs($value),  0,  ',',  '.').'  )';
    }
    else
    {
      return  'Rp  '.number_format($value,  0,  ',',  '.').'  ';
    }
  }
}

if  (  !  function_exists('format_rupiah'))
{
  function  format_rupiah($value)
  {
    if($value  <  0)
    {
      return  '(  '.number_format(abs($value),  2,  ',',  '.').'  )';
    }
    else
    {
      return  '  '.number_format($value,  2,  ',',  '.').'  ';
    }
  }
}

if  (  !  function_exists('prepare_numeric'))
{
  function  prepare_numeric($value,  $default  =  null)
  {
    if(isset($value)  &&  $value  !=  '')
      return  floatval(str_replace('.','',$value))  *  1;
    return  $default;
  }
}

if  (  !  function_exists('format_date'))
{
  function  format_date($date,  $style='d/m/Y')
  {
    if  (isset($date))
      return  date($style,  strtotime(  $date  )  );
    return  '';
  }
}

if  (  !  function_exists('prepare_date'))
{
  function  prepare_date($date)
  {
    if  (isset($date)  &&  $date  !=  '')
      return  implode(  "-",  array_reverse(  explode("/",  $date  )  )  );
    return  null;
  }
}

if  (  !  function_exists('get_where_str'))
{
  function  get_where_str($param,  $fieldmap)
  {
    $wh  =  array();
    foreach($param  as  $key  =>  $value){
      if  (array_key_exists($key,  $fieldmap))
      {
        $fld  =  "";
        $datatype  =  isset($value['search_datatype'])  ?  $value['search_datatype']  :  null;
        $op  =  $value['search_op'];
        if  ($datatype  ===  'date')
        {
          $fld  =  $fieldmap[  $key  ];
          $str  =  isset($value['search_str'])  ?  strtoupper(prepare_date($value['search_str']))  :  null;
          $str2  =  isset($value['search_str2'])  ?  strtoupper(prepare_date($value['search_str2']))  :  null;
        }
        else
        {
          $fld  =  "UPPER(".$fieldmap[  $key  ].")";
          $str  =  isset($value['search_str'])  ?  strtoupper($value['search_str'])  :  null;
          $str2  =  isset($value['search_str2'])  ?  strtoupper($value['search_str2'])  :  null;
        }

        if  ($datatype  ===  'numeric')
        {
          switch($op)
          {
            case  "eq"  :  $fld  .=  "  =  ";  $str  =  $str;  $wh[  $fld  ]  =  (double)$str;  break;
            case  "ne"  :  $fld  .=  "  !=  ";  $str  =  $str;  $wh[  $fld  ]  =  (double)$str;  break;
            case  "lt"  :  $fld  .=  "  <  ";  $str  =  $str;  $wh[  $fld  ]  =  (double)$str;  break;
            case  "le"  :  $fld  .=  "  <=  ";  $str  =  $str;  $wh[  $fld  ]  =  (double)$str;  break;
            case  "gt"  :  $fld  .=  "  >  ";  $str  =  $str;  $wh[  $fld  ]  =  (double)$str;  break;
            case  "ge"  :  $fld  .=  "  <=  ";  $str  =  $str;  $wh[  $fld  ]  =  (double)$str;  break;
            case  "in"  :  $fld  .=  "  >=  ";  $fld1  =  $fieldmap[  $key  ]."  <=  ";  $wh[  $fld  ]  =  (double)$str;  $wh[  $fld1  ]  =  (double)$str2;  break;
            default  :  ;
          }
        }
        else  if  ($datatype  ===  'date')
        {
          switch($op)
          {
            case  "eq"  :  $fld  .=  "  =  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "ne"  :  $fld  .=  "  !=  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "lt"  :  $fld  .=  "  <  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "le"  :  $fld  .=  "  <=  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "gt"  :  $fld  .=  "  >  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "ge"  :  $fld  .=  "  <=  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "in"  :  $fld  .=  "  >=  ";  $fld1  =  $fieldmap[  $key  ]."  <=  ";  $wh[  $fld  ]  =  $str;  $wh[  $fld1  ]  =  $str2;  break;
            default  :  ;
          }
        }
        else
        {
          switch($op)
          {
            case  "eq"  :  $fld  .=  "  =  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "ne"  :  $fld  .=  "  !=  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "lt"  :  $fld  .=  "  <  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "le"  :  $fld  .=  "  <=  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "gt"  :  $fld  .=  "  >  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "ge"  :  $fld  .=  "  <=  ";  $str  =  $str;  $wh[  $fld  ]  =  $str;  break;
            case  "bw"  :  $fld  .=  "  LIKE  ";  $str  =  $str."%";  $wh[  $fld  ]  =  $str;  break;
            case  "bn"  :  $fld  .=  "  NOT  LIKE  ";  $str  =  $str."%";  $wh[  $fld  ]  =  $str;  break;
            case  "in"  :  $fld  .=  "  >=  ";  $fld1  =  "UPPER(".$fieldmap[  $key  ].")  <=  ";  $wh[  $fld  ]  =  $str;  $wh[  $fld1  ]  =  $str2;  break;
            case  "ew"  :  $fld  .=  "  LIKE  ";  $str  =  "%".$str;  $wh[  $fld  ]  =  $str;  break;
            case  "en"  :  $fld  .=  "  NOT  LIKE  ";  $str  =  "%".$str;  $wh[  $fld  ]  =  $str;  break;
            case  "cn"  :  $fld  .=  "  LIKE  ";  $str  =  "%".$str."%";  $wh[  $fld  ]  =  $str;  break;
            case  "nc"  :  $fld  .=  "  NOT  LIKE  ";  $str  =  "%".$str."%";  $wh[  $fld  ]  =  $str;  break;
            case  "nu"  :  $str  =  "  NULL  ";  $wh[  $fld  ]  =  $str;  break;
            case  "nn"  :  $str  =  "  NOT  NULL  ";  $wh[  $fld  ]  =  $str;  break;
            default  :  ;
          }
        }
      }
    }
    return  $wh;
  }
}

if  (  !  function_exists('build_or_where'))
{
  function  build_or_where($param)
  {
    $str  =  '';
    $prefix  =  '  OR  ';
    foreach  ($param  as  $k  =>  $v)
    {
      if  ($str  !==  '')  $str  .=  $prefix;

      $str  .=  "(".$k."  '".$v."')";
    }
    return  "(".$str.")";
  }
}

if  (  !  function_exists('get_order_by_str'))
{
  function  get_order_by_str($param,  $fieldmap)
  {
    $ob  =  '';
    if  (array_key_exists($param,  $fieldmap))
    {
      $ob  =  $fieldmap[  $param  ];
    }
    return  $ob;
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit