Added admin module
This commit is contained in:
parent
22b90ea1f6
commit
fd88fff9d2
90 changed files with 13954 additions and 19 deletions
33
libraries/PDO.php
Normal file
33
libraries/PDO.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace PhangoApp\PDO;
|
||||
|
||||
class MySQL {
|
||||
|
||||
static public $host_db='';
|
||||
|
||||
static public $db='';
|
||||
|
||||
static public $login_db='';
|
||||
|
||||
static public $pass_db='';
|
||||
|
||||
//static public $conn=false;
|
||||
|
||||
static public function get_pdo_connection() {
|
||||
|
||||
if(MySQL::$host_db=='' || MySQL::$db=='') {
|
||||
|
||||
echo 'Cannot connect to the mysqldb';
|
||||
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
$conn=new \PDO('mysql:host='.MySQL::$host_db.';dbname='.MySQL::$db, MySQL::$login_db, MySQL::$pass_db);
|
||||
|
||||
return $conn;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -147,29 +147,38 @@ function filter_path($path_info) {
|
|||
|
||||
}
|
||||
|
||||
class Url {
|
||||
|
||||
function make_url($module, $script='', $file='', $args=[]) {
|
||||
|
||||
$url='/'.$module;
|
||||
|
||||
if($script!='') {
|
||||
static public function make_url($module, $script='', $file='', $args=[]) {
|
||||
|
||||
$url.='/'.$script;
|
||||
$url='/'.$module;
|
||||
|
||||
if($script!='') {
|
||||
|
||||
$url.='/'.$script;
|
||||
|
||||
}
|
||||
|
||||
if($file!='') {
|
||||
|
||||
$url.='/'.$file;
|
||||
|
||||
}
|
||||
|
||||
if(count($args)>0) {
|
||||
|
||||
$url.='/'.implode('/', $args);
|
||||
|
||||
}
|
||||
|
||||
return Config::$base_url.'/index.php'.$url;
|
||||
|
||||
}
|
||||
|
||||
if($file!='') {
|
||||
|
||||
static public function make_media_url($file) {
|
||||
|
||||
$url.='/'.$file;
|
||||
return Config::$base_url.'/'.$file;
|
||||
|
||||
}
|
||||
|
||||
if(count($args)>0) {
|
||||
|
||||
$url.='/'.implode('/', $args);
|
||||
|
||||
}
|
||||
|
||||
return Config::$base_url.'/index.php'.$url;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ class Utils {
|
|||
|
||||
//}
|
||||
|
||||
return "\n".\PhangoApp\PhaModels\CoreForms::HiddenForm($name_token, '', $_SESSION['csrf_token'])."\n";
|
||||
return "\n<input type=\"hidden\" name=\"".$name_token."\" value=\"".$_SESSION['csrf_token']."\"/>\n";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue