Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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.
- */
- /**
- * Description of mainController
- *
- * @author fabi0
- */
- namespace Load;
- class mainController {
- protected function render($path, $data = array()) {
- $data = (object) $data;
- include "Views/" . $path . '.php';
- }
- protected function toAscii($str, $replace = array(), $delimiter = '-') {
- setlocale(LC_ALL, 'en_BG.UTF8');
- if (!empty($replace)) {
- $str = str_replace((array) $replace, ' ', $str);
- }
- //$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
- $clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $str);
- $clean = strtolower(trim($clean, '-'));
- $clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
- return $clean;
- }
- public static function alive($user_id) {
- $database = \Models\DB::getInstance();
- $sql = "UPDATE `users` SET `user_active` = :time WHERE `users`.`user_id` = :user_id;";
- $param = array(
- ':time' => array(
- 'param' => time(),
- 'type' => 2
- ),
- ':user_id' => array(
- 'param' => $user_id,
- 'type' => 2
- )
- );
- $database->query($sql, $param);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement