-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
40 lines (37 loc) · 1.07 KB
/
index.php
File metadata and controls
40 lines (37 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
include("libs/bootstrap.php");
$xtph = new XTemplate("views/index.html");
$m = (isset($_GET['m']))?$_GET['m']:'home';
$a = (isset($_GET['a']))?$_GET['a']:'home';
//Kiem tra su ton tai cua action $a trong module $mail
if(!isset($_SESSION['user_cus'])){
if($m!=''&&$a!=''){
if(file_exists("controlers/{$m}/{$a}.php")){
include("controlers/{$m}/{$a}.php");
}else{
$content = "404 Not found!";
}
$xtph->assign('content',$content);
$xtph->assign('name_users','hidden');
$xtph->assign('logout','hidden');
$xtph->assign('login','');
$xtph->assign('register','');
}
}else{
if($m!=''&&$a!=''){
if(file_exists("controlers/{$m}/{$a}.php")){
include("controlers/{$m}/{$a}.php");
}else{
$content = "404 Not found!";
}
$xtph->assign('content',$content);
$xtph->assign('name_users','');
$xtph->assign('logout','');
$xtph->assign('login','hidden');
$xtph->assign('register','hidden');
$xtph->assign('users',$_SESSION['user_cus']);
}
}
$xtph->assign("baseUrl",$baseUrl);
$xtph->parse('LAYOUT');
$xtph->out('LAYOUT');