-
Notifications
You must be signed in to change notification settings - Fork 10
/
standard_page_top.php
119 lines (110 loc) · 5.32 KB
/
standard_page_top.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
<?php
require_once( 'common.php' ); // This is REQUIRED even when duplicate because of confirm.php (at the very least)
require_once( 'user.php' ); // This is REQUIRED even when duplicate because of confirm.php (at the very least)
global $util;
//$util::logDebug( 'standard_page_top: Start' );
if( is_null( $user ) ){
$util::logWarn( "standard_page_top: \$user was not already defined by {$_SERVER['PHP_SELF']}" );
$user = new USER();
}
$PAGENAME = strtolower( substr( basename( $_SERVER['PHP_SELF'] ), 0, strlen(basename( $_SERVER['PHP_SELF'] ))-4 ) );
?>
<!DOCTYPE html>
<html lang='en'>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<title>3M-50 Thermostat Tracking</title>
<link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />
<link rel='stylesheet' type='text/css' href='../common/css/reset.css' >
<link rel='stylesheet' type='text/css' href='../common/bootstrap/css/bootstrap.min.css' />
<link rel='stylesheet' type='text/css' href='resources/thermo.css' />
<link rel='stylesheet' type='text/css' href='../common/css/cards.css' >
<script type='application/javascript' src='../common/js/jquery-3.3.1.min.js'></script>
<script type='application/javascript' src='../common/bootstrap/js/bootstrap.min.js'></script>
<script type='application/javascript' src='../common/js/common.js'></script>
<!-- QQQ Really ought to not waste time loading these things if they are not used on this specific page -->
<!-- QQQ Should add a set of flags in each source file for which libs are needed and load them conditionally -->
<!-- <link rel='stylesheet' type='text/css' href='../common/js/jquery.dataTables.min.css' > -->
<!-- <script type='application/javascript' src='../common/js/jquery.dataTables.min.js'></script> -->
<!-- <link rel='stylesheet' type='text/css' href='../common/js/jquery.dataTables.scroller.min.css' > -->
<!-- <script type='application/javascript' src='../common/js/jquery.dataTables.scroller.min.js'></script> -->
</head>
<body>
<div style='background: linear-gradient(#007700, #77DD77); height: 50px; top: 0px; position: absolute; width: 100%;'>
<span style='float: left; position: relative; top: 25%;'>
<div style='display: inline-block; top: 4px; position: relative;'>
<a href='foo'>Some global page</a>
<?php
if( $user->isSiteAdmin() ){
// Don't even show the button unless the user is the admin
?>
<a href='admin'>Site Admin</a>
<?php
}
?>
<a href='about'><span class='glyphicon glyphicon-info-sign'></span> About</a>
</div>
</span>
<span style='float: right; position: relative; top: -4px;'>
<?php
if( $user->isLoggedIn() ){
?>
<div style='display: inline-block; top: 18px; position: relative;'>
Welcome <?php print( $user->getName() ); ?>
<select onchange='location = $(this).find( "option:selected" ).data( "action" );' onfocus='this.selectedIndex = 0;'>
<option style='height: 32px; position: relative; top: 40%; text-indent: 32px;'>Choose Action</option>
<option data-action='profile' title='View Profile' style='height: 32px; position: relative; top: 40%; text-indent: 32px;'>View Profile</option>
<option data-action='logout' title='Logout' style='height: 32px; position: relative; top: 40%; text-indent: 32px;'><span class='glyphicon glyphicon-log-out'></span> Logout</option>
<select>
</div>
<?php
}
else{
if( isset( $error ) ){
?>
<div id='error' style='display: inline-block; top: -7px; position: relative; color: red;'>
<?php echo $error; ?>!
</div>
<?php
}
?>
<div style='display: inline-block; top: -7px; position: relative;'>
<form class='form_signin' method='post' id='login-form' action='index'>
<input type='text' class='form_signin_input' name='txt_uname' placeholder='Username' required />
<input type='password' class='form_signin_input' name='txt_password' placeholder='Your Password' />
<button type='submit' name='btn-login' class='btn btn-default'>SIGN IN</button>
</form>
</div>
<div style='display: inline-block; width: 200px; top: 9px; position: relative;'>
<div style='display: block; float: left;'>
No account? <a href='sign-up'>Sign Up!</a>
</div>
<div style='display: block; float: left;'>
Forgot ID/PW? <a href='recover'>Recover</a>
</div>
</div>
<?php
}
?>
</span>
</div>
<?php
if( $user->isLoggedIn() ){
?>
<div style='background: linear-gradient(#007700, #77DD77); height: 50px; top: 50px; position: absolute; width: 100%;'>
<span style='float: left; position: relative; top: 25%;'>
<div style='display: inline-block; top: 4px; position: relative;'>
<a href='dashboard'><span class='glyphicon glyphicon-home'></span> Dashboard</a>
<a href='electric'>Electric Use</a>
<a href='daily_detail'>Daily Detail</a>
<a href='history'>History</a>
<a href='compare'>Compare</a>
<a href='schedule'>Schedule</a>
<a href='profile'><img class='sprite sprite_wheels' src='images/img_trans.gif' width='1' height='1' alt='icon: about'/> Profile</a>
</div>
</span>
</div>
<?php
}
?>
<div id='bigbox'>