-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.php
157 lines (144 loc) · 5.58 KB
/
index2.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
session_start();
//Ucitavamo mysql klasu
require 'inc/loader.php';
include("inc/funkcije.php");
if($_SESSION['login']!=true) {
$workdata = $request->post;
$DB = new db();
foreach($workdata AS $name => $value){
$workdata[$name] = $DB->c($value);
}
$user = $workdata['username'];
$pass = md5($workdata['password']);
//echo $user."<br />".$pass;
$SQL = "SELECT * FROM korisnik WHERE user = '".$user."' AND pass = '".$pass."' LIMIT 0,1";
$DB -> query ($SQL);
//$row = $DB->fetch_assoc();
//$user2 = $row['user'];
//$pass2 = $row['pass'];
//echo '<br /><br />'.$user2."<br />".$pass2;
$num = $DB->num_rows(); // Broji koliko ima rezultata ako je 1 onda postoji korisnik sa tom sifrom
if($num != 1){
$DB -> close();
header("Location: index.php?message=Wrong username and password combination.");
// Belezimo greske u fajl
//$log->File("login.log");
//$log->write("Error login user: ".$_POST['username']."");
echo "Error";
}
else {
// Belezimo uspesno logovanje
//$log->File("login.log");
//$log->write("Login OK for user ".$_POST['username']."");
//Postavljamo sesije
while($row = $DB->fetch_assoc()){
$_SESSION['sidko'] = $row['idko'];
$_SESSION['sime'] = $row['ime'];
$_SESSION['suser'] = $row['user'];
$_SESSION['smail'] = $row['mail'];
$_SESSION['sfunkcija'] = $row['tip'];
$_SESSION['login'] = true;
}
$DB -> close();
header("Location: index2.php");
}
}else{
?>
<?php require 'inc/views/template_head_start.php'; ?>
<!-- Page JS Plugins CSS -->
<link rel="stylesheet" href="<?php echo $one->assets_folder; ?>/js/plugins/slick/slick.min.css">
<link rel="stylesheet" href="<?php echo $one->assets_folder; ?>/js/plugins/slick/slick-theme.min.css">
<?php require 'inc/views/template_head_end.php'; ?>
<?php require 'inc/views/base_head.php'; ?>
<!-- Page Header -->
<div class="content bg-image overflow-hidden" style="background-image: url('<?php echo $one->assets_folder; ?>/img/photos/photo15@2x.jpg');">
<div class="push-50-t push-15">
<h1 class="h2 text-white animated zoomIn">Dashboard</h1>
<h2 class="h5 text-white-op animated zoomIn">Welcome Syrenna</h2>
</div>
</div>
<!-- END Page Header -->
<!-- Background Colored Tiles -->
<div class="content">
<div class="row">
<div class="col-sm-6 col-lg-4">
<a class="block block-link-hover1 text-center" href="shows.php">
<div class="block-content block-content-full bg-info">
<i class="si si-list fa-5x text-white"></i>
</div>
<div class="block-content block-content-full block-content-mini">
<strong>Live Shows</strong> list
</div>
</a>
</div>
<div class="col-sm-6 col-lg-4">
<a class="block block-link-hover1 text-center" href="shows_add.php">
<div class="block-content block-content-full bg-primary">
<i class="si si-plus fa-5x text-white"></i>
</div>
<div class="block-content block-content-full block-content-mini">
<strong>Add</strong> Show
</div>
</a>
</div>
<div class="col-sm-6 col-lg-4">
<a class="block block-link-hover1 text-center" href="gallery2.php">
<div class="block-content block-content-full bg-modern-dark">
<i class="si si-grid fa-5x text-white"></i>
</div>
<div class="block-content block-content-full block-content-mini">
<strong>Gallery</strong> list
</div>
</a>
</div>
<div class="col-sm-6 col-lg-4">
<a class="block block-link-hover1 text-center" href="gallery2_add.php">
<div class="block-content block-content-full bg-danger">
<i class="si si-plus fa-5x text-white"></i>
</div>
<div class="block-content block-content-full block-content-mini">
<strong>Add</strong> Photo
</div>
</a>
</div>
<div class="col-sm-6 col-lg-4">
<a class="block block-link-hover1 text-center" href="change_pass.php">
<div class="block-content block-content-full bg-modern">
<i class="si si-lock fa-5x text-white"></i>
</div>
<div class="block-content block-content-full block-content-mini">
<strong>Change</strong> Password
</div>
</a>
</div>
<div class="col-sm-6 col-lg-4">
<a class="block block-link-hover1 text-center" href="backup.php">
<div class="block-content block-content-full bg-success">
<i class="si si-refresh fa-5x text-white"></i>
</div>
<div class="block-content block-content-full block-content-mini">
<strong>Backup</strong> Database
</div>
</a>
</div>
</div>
</div>
<!-- END Background Colored Tiles -->
<?php require 'inc/views/base_footer.php'; ?>
<?php require 'inc/views/template_footer_start.php'; ?>
<!-- Page Plugins -->
<script src="<?php echo $one->assets_folder; ?>/js/plugins/slick/slick.min.js"></script>
<script src="<?php echo $one->assets_folder; ?>/js/plugins/chartjs/Chart.min.js"></script>
<!-- Page JS Code -->
<script src="<?php echo $one->assets_folder; ?>/js/pages/base_pages_dashboard.js"></script>
<script>
$(function(){
// Init page helpers (Slick Slider plugin)
App.initHelpers('slick');
});
</script>
<?php require 'inc/views/template_footer_end.php'; ?>
<?php
}
?>