-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathview_record.php
More file actions
117 lines (101 loc) · 2.84 KB
/
view_record.php
File metadata and controls
117 lines (101 loc) · 2.84 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
<?php
session_start();
if(isset($_SESSION['usr_id']) == "") {
header("Location: login.php");
}
include_once 'dbconnect.php';
$login_id = $_SESSION['usr_id'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" >
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Home</a>
</div>
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav navbar-right">
<?php if (isset($_SESSION['usr_id'])) { ?>
<li><p class="navbar-text">Signed in as <?php echo $_SESSION['usr_name']; ?></p></li>
<li><a href="logout.php">Log Out</a></li>
<?php } else { ?>
<li><a href="login.php">Login</a></li>
<li><a href="register.php">Sign Up</a></li>
<?php } ?>
</ul>
</div>
</div>
</nav>
<!-- side bar -->
<div class="col-lg-2">
<ul class="navbar-default nav" style="height:650px">
<li><a href="index.php">Add Records</a></li>
<li class="active"><a href="view_record.php"> View Records</a></li>
</ul>
</div>
<div class="col-md-4">
<?php
$sql = "SELECT id, expensetype, amount FROM expense WHERE users_id = ".$login_id." ORDER BY id ASC";
$result = mysqli_query($con, $sql);
if ($result && $myrow = mysqli_fetch_array($result))
{
?>
<table class="table table-hover">
<thead>
<tr>
<th>Sr No.</th>
<th>Expense Type</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php
$sr = 1;
do
{
?>
<tr>
<td><?php echo $sr;?></td>
<td><?php echo $myrow['expensetype'];?></td>
<td><?php echo $myrow['amount'];?></td>
</tr>
<?php
$sr++;
}
while($myrow = mysqli_fetch_array($result));
?>
</tbody>
</table>
<?php
}
else
{
?>
<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<strong>No Records Found.</strong>
</div>
<?php
}
?>
<form method="post" action="excel.php" >
<input type="submit" name="export_excel" class="btn btn-success" value="Export to Excel" />
</form>
</div>
<!-- side bar ends -->
<script src="js/jquery-1.10.2.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>