forked from Jmurrietasmith/EqManage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirect-checkout.php
86 lines (62 loc) · 2.37 KB
/
direct-checkout.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
<?php
include('serverconnect.php');
?>
<?php
session_start();
if(!isset($_SESSION['loggedin'])){
header('Location: index.php');
exit();
}
?>
<!DOCTYPE html>
<html>
<?php
include('header.php')
?>
<body class="loggedin">
<?php
include("navbar.php");
?>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<!--<nav class="navtop">
<div>
<h1>Website Title</h1>
<a href="profile.php"><i class="fas fa-user-circle"></i>Profile</a>
<a href="logout.php"><i class="fas fa-sign-out-alt"></i>Logout</a>
</div>
</nav>-->
<div class="content">
<div>
<h2>Confirmation</h2>
<p>
<?php
$user = "";
$equipment = "";
$user = $_SESSION['name'];
$equipment = $_POST['Equipments'];
$equipment_id = $_GET['selected'];
echo $equipment_id;
$selected_equipment = mysqli_query($db,"select * from equipment where id=$equipment_id ");
while ($row = mysqli_fetch_array($selected_equipment)){
$equipment_name = $row['equipment'];
echo $equipment_name;
}
echo '<h3 style="text-align: center"><b>Equipment Selected: ',"$equipment_name",'</b></h3>';
echo '<textarea type="text" id="purpose" name="purpose" placeholder="Purpose/Location/Date to be returned" style="margin: 0 auto; margin-left: 30%; margin-right: 30%; width: 40%; height: 20%;padding: 10px 15px; border: 1px solid #ccc;
border-radius: 4px; margin-top: 10px"></textarea>';
echo "<h1 style='text-align: center'><b>$equipment_name</b></h1>";
?>
<form method="post" action="checkout-process.php">
<p><?php echo $equipment_name; ?> </p>
<textarea type="text" id="purpose" name="purpose" placeholder="Purpose/Location/Date to be returned" style="margin: 0 auto; margin-left: 30%; margin-right: 30%; width: 40%; height: 20%;padding: 10px 15px; border: 1px solid #ccc;
border-radius: 4px; margin-top: 10px"></textarea>
<input type="hidden" name="name" value="<?php echo $user; ?>">
<input type="hidden" name="equipment" value="<?php echo $equipment_name; ?>">
<input name="confirm" type="submit" value="Confirm" style="width: 100%; margin-top: 20px">
</form>
</div>
</div>
</div>
</body>
</html>