-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_details.php
More file actions
72 lines (65 loc) · 3.24 KB
/
user_details.php
File metadata and controls
72 lines (65 loc) · 3.24 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
<?php
include('partials/navBar.php');
?>
<?php
//check whether id is set or not
if(isset($_GET['id']) and $_GET['pwd']){
$id=$_GET['id'];
//create sql query to get alll other details
$sql="SELECT * FROM tbl_users WHERE id=$id";
//execute the query
$res=mysqli_query($conn,$sql);
$count = mysqli_num_rows($res);
if($count==1){
//get the data
$rows=mysqli_fetch_assoc($res);
$name = $rows['name'];
$email = $rows['email'];
$balance = $rows['balance'];
$password = $rows['password'];
}
}else{
echo("<script>location.href = '".SITEURL."index.php';</script>");
}
?>
<section class="home" id="user-details">
<h1 class="home-heading heading"><span><?php echo $name;?></span></h1>
<div class="box-container">
<div class="box">
<table class="tbl">
<tr>
<td><h1><i class="fas fa-id-card"></i> Customer id:</h1></td>
<td><h1><span><?php echo $id;?></span></h1></td>
</tr>
<tr>
<td><h1><i class="fas fa-user"></i> Name:</h1></td>
<td><h1><span><?php echo $name;?></span></h1></td>
</tr>
<tr>
<td><h1><i class="fas fa-envelope-open"></i> Email:</h1></td>
<td><h1><span><?php echo $email;?></span></h1></td>
</tr>
<tr>
<td><h1><i class="fas fa-wallet"></i> Balance:</h1></td>
<td><h1><span><?php echo $balance;?></span></h1></td>
</tr>
</table>
</div>
<div class="btn-container btn-data">
<a href="<?php echo SITEURL;?>credit.php?id=<?php echo $id;?>"><button class="btn">Credit <i class="fas fa-plus-square"></i></button></a>
<a href="<?php echo SITEURL;?>debit.php?id=<?php echo $id;?>"><button class="btn">Debit <i class="fas fa-minus-square"></i></button></a>
<a href="<?php echo SITEURL;?>transfer.php?id=<?php echo $id;?>"><button class="btn">Transfer <i class="fas fa-paper-plane"></i></button></a>
<a href="<?php echo SITEURL;?>history.php?id=<?php echo $id;?>"><button class="btn">History <i class="fas fa-history"></i></button></a>
</div>
<div class="btn-container display-icon">
<a href="<?php echo SITEURL;?>credit.php?id=<?php echo $id;?>"><button class="btn"><i class="fas fa-plus-square"></i></button></a>
<a href="<?php echo SITEURL;?>debit.php?id=<?php echo $id;?>"><button class="btn"><i class="fas fa-minus-square"></i></button></a>
<a href="<?php echo SITEURL;?>transfer.php?id=<?php echo $id;?>"><button class="btn"><i class="fas fa-paper-plane"></i></button></a>
<a href="<?php echo SITEURL;?>history.php?id=<?php echo $id;?>"><button class="btn"><i class="fas fa-history"></i></button></a>
</div>
</div>
</section>
<?php
include('partials/footer.php')
?>
<!-- TODO: credit and debit section -->