-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
68 lines (57 loc) · 1.34 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
<?php
include('strings.php');
// LOG IN
if(isset($_POST['user'])){
//from from
$usr = substr($_POST['user'], 0, 16);
$key = substr($_POST['pass'], 0, 16);
//from db
require('database_conect.php');
$stmt = $conn->prepare('SELECT user,pass,tipo FROM usrs WHERE user = :usr AND pass = :key');
$stmt->execute(array(':usr' => $usr, ':key' => $key));
$rowUsr = $stmt->fetch(PDO::FETCH_OBJ);
//comparing
if(@$rowUsr->user == $usr){
session_destroy();
session_start();
$_SESSION['user'] = $rowUsr->user;
$_SESSION['tipo'] = $rowUsr->tipo;
switch ($_SESSION['tipo']) {
case 'bank':
header('Location: bank_dash.php');
break;
case 'conf':
header('Location: conf_dash.php');
break;
case 'root':
header('Location: root_dash.php');
}
} else $erro_login = true;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
require('libraries.php');
?>
<title><?= $SYSTEMNAME ?> - Inicio</title>
</head>
<body>
<?php
require('navbar_main.php');
require('genbill_platform_public_view.php');
?>
<div id="confirmSaveBill"></div>
<script type="text/javascript">
$(function(){
$("#menu-home").addClass('active');
});
<?php
require('genbill_platform_public_crtl.js');
?>
</script>
</body>
</html>