-
Notifications
You must be signed in to change notification settings - Fork 0
/
transferCredit.php
70 lines (59 loc) · 1.94 KB
/
transferCredit.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
<?php
session_start();
if(!isset($_SESSION['sourceUser']))
{
header('Location: showUsers.php');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Credit Management</title>
<link rel="stylesheet" href="css/bootstrap.css">
</head>
<body>
<div class="container">
<h1 class="text-center py-4">Transfer Credit</h1>
<form action="showDestinationUsers.php" method="POST">
<div class="form-group">
<label for="enterAmount">Enter the amount to be transferred: </label>
<input type="number" id="enterAmount" class="form-control" name="amount" min="1" required>
<div class="row py-3 justify-content-around">
<a href="showUsers.php" class="btn btn-danger">Go Back</a>
<input type="submit" class="btn btn-success">
</div>
</div>
</form>
<?php
if(isset($_GET['creditError']))
{
?>
<p class="text-danger text-center">The credit entered exceeds the user's credit! Please try a lower value.</p>
<?php
}
?>
<?php
if(isset($_GET['sameUser']))
{
?>
<p class="text-danger text-center">You have selected both the source & destination user as the same. Please try again!</p>
<?php
}
?>
<?php
if(isset($_GET['destinationNotFound']))
{
?>
<p class="text-danger text-center">Destination user not found. Please try again!</p>
<?php
}
?>
</div>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
</body>
</html>