public function __construct() { $connect = new DB('connect_param.php'); $welcome = $connect->query('SELECT * FROM welcome', []); $this->welcome = $welcome; }
public static function oath($email, $password) { $p = DB::query()->select('password', 'id')->from('user')->where('email', '=', $email)->and_where('`check-e`', '=', 1)->execute()->current(); if ($p === false) { return false; } $data = unserialize($p['password']); $user = new Users(); if ($user->hash_check($password, $data['hash'], $data['salt'])) { STD::set_cookie('rememberme', $p['id']); return true; } return false; }
//include dirname(__DIR__)."/vendor/autoload.php"; //NAMESPACE APP $app = new app(); $constante = new constante(); $date_format = new date_format(); $fonction = new fonction(); $DB = new DB(); $ssh2 = new ssh2(); //NAMESPACE API $push_cls = new push(); //NAMESPACE ASC $salarie_cls = new salarie(); $presta_cls = new prestation(); //NAMESPACE CONFIG $mod_cls = new modules(); if (isset($_SESSION['account']['connect']) && $_SESSION['account']['connect'] == 1) { $user = $DB->query("SELECT * FROM users WHERE pseudo = :pseudo", array("pseudo" => $_SESSION['account']['pseudo'])); } //Import des Informations de configuration $mod_salarie = $mod_cls->active_salarie(); $mod_prestation = $mod_cls->active_prestation(); $mod_billetterie = $mod_cls->active_billetterie(); $mod_remboursement = $mod_cls->active_remboursement(); $mod_residente = $mod_cls->active_non_residente(); $conf_salarie = $mod_cls->salarie(); $conf_presta = $mod_cls->prestation(); $conf_billetterie = $mod_cls->billetterie(); $conf_remboursement = $mod_cls->remboursement(); //COMPOSER require dirname(__DIR__) . "/vendor/autoload.php"; use Ifsnop\Mysqldump as IMysqldump;
public function __construct() { $connect = new DB('connect_param.php'); $train = $connect->query('SELECT * FROM train', []); $this->train = $train; }
/** * возращает значение сохраненной переменой * @param $name string название переменной * @return mixed false если не существует поля $name */ public static function get_var($name) { $val = DB::query()->select('value')->from(DB::$var)->where('var_name', '=', $name)->execute()->current('value'); if ($val) { return unserialize($val); } else { return false; } }
<?php use App\DB; define('EXT', '.php'); define('DOCROOT', realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR); define('APPPATH', realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR); require_once APPPATH . 'autoload' . EXT; $file = DOCROOT . 'install/sql.sql'; $all = file_get_contents($file); $sql = preg_split('/;/', $all); foreach ($sql as $item) { if ($item != '') { $res = DB::query($item)->execute()->_error; if ($res == '') { echo "<pre>Таблица создана успешна</pre>"; } else { echo "<pre>{$res}</pre>"; } } }
public function __construct() { $connect = new DB('connect_param.php'); $gallery = $connect->query('SELECT * FROM gallery', []); $this->gallery = $gallery; }