-
Notifications
You must be signed in to change notification settings - Fork 3
/
account.php
109 lines (92 loc) · 2.74 KB
/
account.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
<!DOCTYPE html>
<html>
<head>
<title>Dues against you.</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>
<body>
<br/><br/>
<div class="container">
<div class="col-lg-1" align="right"><button onclick="location.href = 'home.php';" class="btn btn-primary">Home</button></div>
<div class="col-lg-11">
<!--
<form name="contact-form" action="" method="post" id="contact-form">
<div class="form-group">
<label for="id">ENTER ID TO update</label>
<input type="text" class="form-control" name="id" placeholder="id" required>
<br/>
<label for="id">ENTER final value</label>
<input type="text" class="form-control" name="finalvalue" placeholder="finalvalue" required>
<br/>
<button type="submit" class="btn btn-primary" name="update" value="Submit" id="submit_form">UPDATE</button>
</div>
</form>
-->
</div>
</div>
<div class="container">
<h3 style="text-align: center;">Records</h3>
<?php
session_start();
require_once("config.php");
$user=$_SESSION["USER"];
$sql = "SELECT r.id,s.sname,s.semester,s.contact,r.forw,r.rupees,r.rollno FROM recordsh as r,students as s WHERE r.rollno=s.rollno AND r.fromw='$user'";
$result1 = $conn->query($sql);
if ($result1->num_rows > 0)
{
echo "<table class='table table-hover'>";
echo "<th>UNIQUE ID</th>";
echo "<th>NAME</th>";
echo "<th>Roll Number</th>";
echo "<th>Semester</th>";
echo "<th>For What</th>";
echo "<th>rupees</th>";
echo "<th>Contact</th>";
echo "<th>Delete</th>";
echo "<th>Update</th>";
while($row = $result1->fetch_assoc())
{
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['sname']."</td>";
echo "<td>".$row['rollno']."</td>";
echo "<td>".$row['semester']."</td>";
echo "<td>".$row['forw']."</td>";
echo "<td>".$row['rupees']."</td>";
echo "<td>".$row['contact']."</td>";
echo "<td><a href='delete.php?id=".$row['id']."'>delete</a></td>";
echo "<td><a href='update.php?id=".$row['id']."'>update</a></td>";
echo "</tr>";
}
echo "</table>";
}
else
{
$result="No dues";
}
?>
</div>
<!--
require_once("config.php");
if(isset($_POST["update"])){
$uniqueid=$_POST["id"];
$finalvalue=$_POST["finalvalue"];
if ($result1->num_rows > 0) {
$sql = "UPDATE recordsh
SET rupees = '$finalvalue'
WHERE id = '$uniqueid'; ";
$result1 = $conn->query($sql);
header("Refresh:0");
}
else
{
$result1="please check id";
}
}
-->
</body>
</html>