-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.php
80 lines (66 loc) · 1.98 KB
/
user.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>View User</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div>
<ul class="nav justify-content-center">
<li class="nav-item">
<a class="nav-link" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="user.php">Users</a>
</li>
</ul>
</div>
<br>
<br>
<form action="user.php">
<div class="container">
<label>Enter UserID to view Details:</label>
<input type="text" placeholder=" Enter User ID" name="userid">
<input type="submit">
</div>
</form>
<br>
<br>
</body>
</html>
<?php
error_reporting(0);
include 'db.php';
$userid = $_GET["userid"];
$sql = "SELECT * FROM credit WHERE ID='$userid'";
$result = $conn->query($sql);
$row = mysqli_fetch_assoc($result);
$userid = $row['ID'];
$name = $row["Name"];
$email = $row["Email"];
$credit = $row["currentCredit"];
echo "<div class=col-md-12>";
echo " <div class=container col-md-6>
<h4>User Id: $userid</h4>
<h4>Name: $name</h4>
<h4>Email: $email</h4>
<h4>Current credit: $credit</h4>
</div>";
echo "<br><br>
<div class=container>
<h2>Transfer credits:</h2>
<form action='transfer.php' method='get'>
<table>
<td><label>Sender Id: </label></td>
<td><input type='text' value='$userid' name='senderID' readonly></input></td><br>
<td><label>Reciever Id: </label></td>
<td><input type='text' name='receiverID'></input></td>
<td><label>Credit: </label></td>
<td><input type='text' name='credit'></input></td>
<td><input value='Transfer' type='submit'></td>
<table>
</form>
</div>";
echo "</div>";
?>