-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
129 lines (107 loc) · 4.79 KB
/
index.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
session_start();
if($_SESSION){
header("Location: painel");
}
require_once('painel/functions.php');
require_once('proj_esc_func\connection.php');
$conn = new Connection();
$conn = $conn->connect();
//SETANDO AS CONFIGURAÇÕES DA PAGINA INICIAL
$query = "select * from config";
$stmt = $conn->query($query);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$titulo = $row['title_site'];
define("BASE", 'http://localhost/sistema');
define("THEME", 'http://localhost/sistema');
define("THEME_PATH", __DIR__);
define("THEME_LINK", BASE);
$configBase = BASE;
$configSiteName = "SEPO";
$configThemePath = THEME_PATH;
$configThemeLink = THEME_LINK;
$configUrl = explode("/", strip_tags(filter_input(INPUT_GET, "url", FILTER_DEFAULT)));
$configUrl[0] = (!empty($configUrl[0]) ? $configUrl[0] : "home");
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $titulo; ?></title>
<meta name="viewport" charset="utf-8" content="width=device-width, initial-scale=1.0">
<script src="<?=$configBase?>/js/jquery.js"></script>
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.7.0/mapbox-gl.js'></script>
<script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
<link rel="stylesheet" href="https://site-assets.fontawesome.com/releases/v6.4.2/css/all.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css"/>
<link rel="shortcut icon" href="<?=$configBase?>/img/sistema/favicon.ico">
<link href="css/index.css" rel="stylesheet" type="text/css"/>
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.7.0/mapbox-gl.css' rel='stylesheet'/>
</head>
<body>
<?php include 'nav.php'; ?>
<div class="main">
<?php
//QUERY STRING
if (file_exists("{$configThemePath}/{$configUrl[0]}.php") && !is_dir("{$configThemePath}/{$configUrl[0]}.php")) {
//theme root
require "{$configThemePath}/{$configUrl[0]}.php";
}elseif (!empty($configUrl[1]) && file_exists("{$configThemePath}/{$configUrl[0]}/{$configUrl[1]}.php") && !is_dir("{$configThemePath}/{$configUrl[0]}/{$configUrl[1]}.php")) {
//theme folder
require "{$configThemePath}/{$configUrl[0]}/{$configUrl[1]}.php";
} else {
//theme 404
if (file_exists("{$configThemePath}/404.php") && !is_dir("{$configThemePath}/404.php")) {
require "{$configThemePath}/404.php";
} else {
echo "<div class='container'><div class='trigger trigger-error icon-error radius'>Desculpe, mas a página não existe!</div></div>";
}
}
?>
</div>
<?php include 'form_login.php' ?>
<?php include 'footer.php' ?>
</body>
<script src="<?=$configBase?>/js/jquery.waypoints.min.js" type="text/javascript"></script>
<script src="<?=$configBase?>/js/animate.js" type="text/javascript"></script>
<script>
var flag = 0;
$(document).ready(function() {
$('#btn-login').click(function(e) {
flag = 1;
$('#login').toggle(300);
$("#user").focus();
e.stopPropagation();
$('body').click(function(e){
if($(e.target).attr('data-type')!='modal-login' && flag == 1){
$('#login').toggle(400);
flag = 0;
e.stopPropagation();
}
});
});
});
$(document).ready(function() {
$('#close-login').click(function(e) {
$('#login').toggle(400);
e.stopPropagation();
});
});
</script>
<?php
if(isset($_GET['login']) && $_GET['login'] == 'erro'){
?>
<script>
$('#show-login').ready(function(e) {
$('#login').toggle(300);
e.stopPropagation();
});
</script>
<?php
}
?>
</html>