forked from codepoetIn/POSNIC-1.02
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
182 lines (135 loc) · 5.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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php
session_start();
if(!include_once "config.php"){
header("location:install.php");
}
if (!defined('posnicEntry')) {
define('posnicEntry', true);
}
if(isset($_SESSION['username'])) {
if($_SESSION['usertype'] =='admin') // if session variable "username" does not exist.
header("location:dashboard.php"); // Re-direct to index.php
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>POSNIC - Login to Control Panel</title>
<!-- Stylesheets -->
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/cmxform.css">
<link rel="stylesheet" href="js/lib/validationEngine.jquery.css">
<!-- Scripts -->
<script src="js/lib/jquery.min.js" type="text/javascript"></script>
<script src="js/lib/jquery.validate.min.js" type="text/javascript"></script>
<script>
/*$.validator.setDefaults({
submitHandler: function() { alert("submitted!"); }
});*/
$(document).ready(function() {
// validate signup form on keyup and submit
$("#login-form").validate({
rules: {
username: {
required: true,
minlength: 3
},
password: {
required: true,
minlength: 3
}
},
messages: {
username: {
required: "Please enter a username",
minlength: "Your username must consist of at least 3 characters"
},
password: {
required: "Please provide a password",
minlength: "Your password must be at least 3 characters long"
}
}
});
});
</script>
<!-- Optimize for mobile devices -->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<!-- Only Index Page for Analytics -->
<?php include_once("analyticstracking.php") ?>
<!-- TOP BAR -->
<div id="top-bar">
<div class="page-full-width">
<!--<a href="#" class="round button dark ic-left-arrow image-left ">See shortcuts</a>-->
</div> <!-- end full-width -->
</div>
<!-- end top-bar -->
<!-- HEADER -->
<div id="header">
<div class="page-full-width cf">
<div id="login-intro" class="fl">
<h1>Login to Dashboard</h1>
<h5>Enter your credentials below</h5>
</div> <!-- login-intro -->
<!-- Change this image to your own company's logo -->
<!-- The logo will automatically be resized to 39px height. -->
<a href="#" id="company-branding" class="fr"><img src="<?php if(isset($_SESSION['logo'])) { echo "upload/".$_SESSION['logo'];}else{ echo "upload/posnic.png"; } ?>" alt="Point of Sale" /></a>
</div> <!-- end full-width -->
</div> <!-- end header -->
<!-- MAIN CONTENT -->
<div id="content">
<form action="checklogin.php" method="POST" id="login-form" class="cmxform" autocomplete="off">
<fieldset>
<p> <?php
if(isset($_REQUEST['msg']) && isset($_REQUEST['type']) ) {
if($_REQUEST['type'] == "error")
$msg = "<div class='error-box round'>".$_REQUEST['msg']."</div>";
else if($_REQUEST['type'] == "warning")
$msg = "<div class='warning-box round'>".$_REQUEST['msg']."</div>";
else if($_REQUEST['type'] == "confirmation")
$msg = "<div class='confirmation-box round'>".$_REQUEST['msg']."</div>";
else if($_REQUEST['type'] == "information")
$msg = "<div class='information-box round'>".$_REQUEST['msg']."</div>";
echo $msg;
}
?>
</p>
<p>
<label for="login-username">username</label>
<input type="text" id="login-username" class="round full-width-input" placeholder="admin" name="username" autofocus />
</p>
<p>
<label for="login-password">password</label>
<input type="password" id="login-password" name="password" placeholder="admin" class="round full-width-input" />
</p>
<a href="forget_pass.php" class="button ">Forgot your password?</a>
<!--<a href="dashboard.php" class="button round blue image-right ic-right-arrow">LOG IN</a>-->
<input type="submit" class="button round blue image-right ic-right-arrow" name="submit" value="LOG IN" />
</fieldset>
<br/><div class="information-box round">Just click on the "LOG IN" button to continue, no login information required.</div>
</form>
</div> <!-- end content -->
<!-- FOOTER -->
<div id="footer">
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=286371564842269";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="fb-root"></div>
<div class="fb-like" data-href="https://www.facebook.com/posnic.point.of.sale" data-width="450" data-show-faces="true" data-send="true"></div>
<div class="g-plusone" data-href="https://plus.google.com/u/0/107268519615804538483"></div>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script><p>Any Queries email to <a href="mailto:[email protected]?subject=Stock%20Management%20System">[email protected]</a>.</p>
</div> <!-- end footer -->
</body>
</html>