-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.php
More file actions
94 lines (82 loc) · 3.57 KB
/
Copy pathrequest.php
File metadata and controls
94 lines (82 loc) · 3.57 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
include('header.php');
if (mysqli_connect_error()) {
echo "Connection error!" . mysqli_connect_error();
exit();
} else {
$email = $_SESSION['email'];
if (isset($_POST['withdraw'])) {
$user = $_POST['withdraw'];
$query2 = "DELETE FROM `connections` WHERE request_to='$user'";
mysqli_query($con, $query2);
}
$run = "SELECT * FROM `registration` WHERE email='$email'";
$result = mysqli_query($con, $run);
if ((mysqli_num_rows($result) > 0)) {
while (($row = mysqli_fetch_assoc($result))) {
$final = $row;
}
}
$from = $final['avatar'];
$request = "SELECT distinct(request_to) FROM `connections` WHERE request_from='$from' ORDER BY id DESC";
$res = mysqli_query($con, $request);
$num = mysqli_num_rows($res);
}
?>
<div class="container-fluid" style="margin-top:50px;">
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-8">
<div class="card-group">
<div class="card">
<div class="alert alert-primary" role="alert">
<h2 style="font-family:serif;">My Requests -</h2>
</div>
<div class="card-body" style="overflow-y:scroll;">
<?php
if ($num != null) {
while (($row = mysqli_fetch_assoc($res))) {
?>
<form method="POST">
<div class="msg">
<div class="row">
<div class="col-md-6">
<?php
$avatar = $row['request_to'];
$search = "SELECT * FROM `registration` WHERE avatar='$avatar'";
$do = mysqli_query($con, $search);
while (($row = mysqli_fetch_assoc($do))) {
$find = $row;
}
?>
<?php include('search_icon.php'); ?>
<input type="submit" style="border: none; background-color:white;" value="<?php echo $find['avatar']; ?>" name="user">
<small>(<?php echo $find['name'] ?>)</small>
</div>
<div class="col-md-3"></div>
<div class="col-md-3">
<button class="btn btn-primary" type="submit" value="<?php echo $find['avatar']; ?>" name="withdraw">Withdraw Request</button>
</div>
</div>
<hr>
</div>
</form>
<?php
}
} else {
?>
<h4>No Requests !</h4>
<?php
}
?>
</div>
</div>
</div>
</div>
<div class="col-md-2"></div>
</div>
</div>
<?php
include('footer.php');
?>