-
Notifications
You must be signed in to change notification settings - Fork 0
/
listfollow.php
196 lines (153 loc) · 6.86 KB
/
listfollow.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<title>Liste of following And followers</title>
<style>
body{
height : 1000px;
}
.container{
margin-left : 237px;
width : 70%;
border-right : solid 1.5px;
border-left : solid 1.5px;
position : static;
top : 60px;
}
.menu {
overflow: hidden;
background-color: #6EC6C6;
height: 60px;
position:fixed;
top : 0;
width : 100%;
z-index: 1;
}
.main{
padding-top : 60px;
position : relative;
}
.title{
background-color : white;
border : solid 1px;
position : fixed;
z-index : 10;
margin-left : -15px;
width : 100%;
}
.following{
width : 35%;
}
.followers{
width : 35%;
}
.col-md-8 {
-ms-flex: 0 0 25%;
flex: 0 0 25%;
max-width: 100%;
margin-top : 48px;
position : absolute ;
top: 0 ;
left: 30%;
}
</style>
</head>
<body>
<div class="menu">
<?php include("Search.php");
?>
<?php
$sql = "SELECT user.id_user ,user.nom , user.prenom ,user.photo FROM followers JOIN user ON user.id_user=followers.id_follower AND followers.id_user=$id_user";
$sql2 = "SELECT user.id_user ,user.nom , user.prenom ,user.photo FROM followers JOIN user ON user.id_user=followers.id_user AND id_follower=$id_user";
$res = mysqli_query($link,$sql) or die(mysqli_error($link));
$res2 = mysqli_query($link,$sql2) or die(mysqli_error($link));
?>
</div>
<div class="main">
<div class="container">
<div class="row" style="position:relative;">
<?php if($_GET['list']=="following"){?>
<div class="col-sm-7" style="background-color:white; position:absolute; left:30%;">
<h1 class="title following"> Following</h1>
<div class="col-md-3" id="foll">
<div class="card" style="margin-left: 0px;left: 63px; width:300px;">
<div class="card-body">
<div class="users">
<?php if(mysqli_num_rows($res)>0){
while($nb = mysqli_fetch_assoc($res) ){
?>
<div class="row" >
<div class="mr-2">
<img class="rounded-circle" width="45" src="<?php echo $nb['photo'] ;?>" alt="">
</div>
<div class ="col-md-8"> <h6> <?php echo $nb['prenom'].$nb['nom']; ?> </h6> </div>
<?php ?>
<div class="col-md-4">
<input type="submit" formmethod="post" name="follow"
<?php if(get_follows($link,$id_user,$nb['id_user'])==true) :?>
class="down follow" value ="following"
<?php else : ?>
class="up follow" value ="follow"
<?php endif ?>
data-content="<?php echo $nb['id_user']?>"
>
</div>
</div> <br> <br>
<?php
}
}
}
?>
</div>
</div>
</div>
</div>
</div>
<?php if($_GET['list']=="followers"){?>
<div class="col-sm-8" style="background-color:white; position:absolute; left:30%;">
<h1 class = "title followers" > Followers</h1>
<div class="col-md-3" id="foll">
<div class="card" style="margin-left: 0px;left: 63px; width:300px;">
<div class="card-body">
<div class="users">
<?php if(mysqli_num_rows($res2)>0){
while($nb2 = mysqli_fetch_assoc($res2) ){
?>
<div class="row" >
<div class="mr-2">
<img class="rounded-circle" width="45" src="<?php echo $nb2['photo'] ;?>" alt="">
</div>
<div class ="col-md-8"> <h6> <?php echo $nb2['prenom'].$nb2['nom']; ?> </h6> </div>
<?php ?>
<div class="col-md-4">
<input type="submit" formmethod="post" name="follow"
<?php if(get_follows($link,$id_user,$nb2['id_user'])==true) :?>
class="down follow" value ="following"
<?php else : ?>
class="up follow" value ="follow"
<?php endif ?>
data-content="<?php echo $nb2['id_user']?>"
>
</div>
</div> <br> <br>
<?php
}
}
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="script2.js"></script>
</body>
</html>