-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.php
More file actions
150 lines (139 loc) · 3.52 KB
/
Copy pathcommon.php
File metadata and controls
150 lines (139 loc) · 3.52 KB
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
<?php
include 'connection.php';
session_start();
// echo $_SESSION['name'];
?>
<!DOCTYPE html>
<html>
<head>
<title>common</title>
<link rel="shortcut icon" type="image/x-icon" href="icon.jpg" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<style type="text/css">
#title{
background-color: black;
color: lightblue;
border-color: #eee;
text-align: left;
height: 50px;
}
#h2title{
padding-top: 5px;
padding-left: 20px;
}
h4{
margin-left: 290px;
padding-top: 15px;
}
#topbar{
/*margin-left: 270px;*/
margin-top: 20px;
background-color: #eee;
width: 100%;
height: 50px;
}
body{
background-color: lightblue;
}
.sidenav {
height: 100%;
width: 250px;
position: fixed;
z-index: 1;
top: 0px;
left: 0px;
background: #eee;
overflow-x: hidden;
padding: 8px 0;
margin-top: 50px;
}
.sidenav a , .dropdown-btn{
padding: 6px 20px 6px 16px;
text-decoration: none;
font-size: 25px;
color: #2196F3;
display: block;
}
.sidenav a:hover {
background-color: #064579;
color: white;
}
#username{
margin-left: 5px;
margin-right: 5px;
border: 0;
/*font-size: 30px;*/
/*padding: 2.5px;*/
padding-bottom: 20px;
padding-right: 10px;
padding-left: 10px;
font-weight: bold;
color: #2196F3;
background-color: white;
}
#username a:hover {
color: #2196F3;
}
#username a:link {
color: #ccc
}
#username a:visited {
color: #ccc
}
.dropdown-container {
display: none;
background-color: #ddd;
padding-left: 8px;
font-size: 10px;
}
/* Optional: Style the caret down icon */
.fa-caret-down {
float: right;
padding-right: 8px;
color: black;
}
</style>
</head>
<body>
<div id="title">
<h2 id="h2title">Daily Expense Tracker</h2>
</div>
<div class="sidenav">
<div id="username"><h3><?php echo $_SESSION['uname']; ?></h3><h6><?php echo $_SESSION['email'];?></h6></div>
<a href="dashboard.php">Home</a>
<a href="addexpense.php">Add Expenses</a>
<a class="dropdown-btn">View Expense
<i class="fa fa-caret-down"></i>
</a>
<div class="dropdown-container">
<a href="viewexpense.php">> Tabular</a>
<a href="BarGraph.php">> Bar Graph</a>
<a href="PieChart.php">> Pie Chart</a>
</div>
<a href="profile.php">Profile</a>
<a href="signup.php">Log Out</a>
</div>
<div id="topbar">
<h4>New Expense</h4>
</div>
<script>
/* Loop through all dropdown buttons to toggle between hiding and showing its dropdown content - This allows the user to have multiple dropdowns without any conflict */
var dropdown = document.getElementsByClassName("dropdown-btn");
var i;
for (i = 0; i < dropdown.length; i++) {
dropdown[i].addEventListener("click", function() {
this.classList.toggle("active");
var dropdownContent = this.nextElementSibling;
if (dropdownContent.style.display === "block") {
dropdownContent.style.display = "none";
} else {
dropdownContent.style.display = "block";
}
});
}
</script>
</body>
</html>