-
Notifications
You must be signed in to change notification settings - Fork 1
/
college.php
292 lines (223 loc) · 11.1 KB
/
college.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:type" content="website" />
<meta property="og:site_name" content="College Walla" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
<link rel="stylesheet" href="css/style.css" type="text/css">
<link rel="stylesheet" href="css/college.css" type="text/css">
<link rel="stylesheet" href="css/compare.css" type="text/css">
<link rel="stylesheet" href="css/college.css" type="text/css">
<link rel="stylesheet" href="css/query.css" type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" charset="utf-8"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<!-- <base href="http://localhost/college_walla/" target="_self"> -->
</head>
<body>
<!-- header call -->
<?php include '_file/_header.php'; ?>
<!-- header call -->
<!-- give rating -->
<!-- <div class="rating-system">
<div class="give-rating">
<div class="rate-please">
<h3>Please Rate This college</h3>
</div>
<div class="college-rate">
<div class="rate-all placement">
<h4>Placement:</h4>
<div class="placemnt-rating">
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star"></span>
<span class="fa fa-star"></span>
</div>
</div>
<div class="rate-all campus">
<h4>Campus Life:</h4>
<div class="placemnt-rating">
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star"></span>
<span class="fa fa-star"></span>
</div>
</div>
<div class="rate-all calture">
<h4>College Calture:</h4>
<div class="placemnt-rating">
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star"></span>
<span class="fa fa-star"></span>
</div>
</div>
<div class="rate-all best-branch">
<h4>Best Branch:</h4>
<div class="placemnt-rating">
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star"></span>
<span class="fa fa-star"></span>
</div>
</div>
</div>
</div>
</div> -->
<!-- give rating end here -->
<?php
$slug_url = $_GET['pid'];
echo $slug_url;
$college_sql = "SELECT * FROM `college-details` WHERE `slug_url` = '/$slug_url'";
$college_result = mysqli_query($connect, $college_sql);
$college_row = mysqli_num_rows($college_result);
if ($college_row > 0) {
while ($college_assoc = mysqli_fetch_assoc($college_result)) {
$title = $college_assoc['college-name'];
$postid = $college_assoc['college-id'];
echo '
<title>' . $college_assoc['college-name'] . '</title>
<div class="container">
<div class="college-content">
<div class="background-container">
<div class="college-image">
<img class="img-college " src="img/' . $college_assoc['college_img'] . '" alt="college-name">
</div>
</div>
<div class="college-rate-name"> </div>
<div class="rate-name">
<div class="college-name">
<h1> ' . $college_assoc['college-name'] . '</h1>
</div>
<div class="college-rate">
<div class="rate-2">
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star"></span>
</div>
<div class="review-number">
<span>41/50</span>
</div>
<div class="rate-btn">
<a href=""><i class="fa fa-edit"></i></a>
</div>
</div>
<div class="share-post">
<a href="#"><i class="fab fa-facebook"></i></a>
<a href="#"><i class="fab fa-whatsapp"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-linkedin-in"></i></a>
<a href="#"><i class="fas fa-share-alt"></i></a>
</div>
</div>
<div class="college-contetn">
' . $college_assoc['college-content'] . '
</div>
</div>';
?>
<div class="college-query">
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// $postid = $_GET['pid'];
$query_title = $_POST['query_title'];
$query_title = str_replace("<", "<", "$query_title");
$query_title = str_replace(">", ">", "$query_title");
$query_explain = $_POST['query_explain'];
$query_explain = str_replace("<", "<", "$query_explain");
$query_explain = str_replace(">", ">", "$query_explain");
$send_login_user_id = $_POST['login_user_id'];
// adding new
$query_title = $_POST['query_title'];
$slug_url = strtolower($query_title);
$slug_url = '/' . str_replace(" ", "-", $slug_url);
$slug_url = str_replace("?", "", $slug_url);
$query_send = "INSERT INTO `query` ( `query_post_id`, `query_title`, `query_content`, `login_user_id`,`slug_url`) VALUES ('$postid', '$query_title', '$query_explain', '$send_login_user_id', '$slug_url') ";//somoe thing new was added
$query_send_result = mysqli_query($connect, $query_send);
if (!$query_send_result) {
echo 'Sorry Your query not submited';
} else {
echo 'Your query submited';
}
}
?>
<?php
if (isset($_SESSION['logdin']) && $_SESSION['logdin'] == true) {
echo '<div class="query-name">
<h2>PUT YOUR QUERY</h2>
</div>
<div class="post-query">
<form class="form" action="" method="POST">
<label for="query">What is your query?</label>
<input type="text" placeholder="How is this college?" name="query_title"required>
<input input type="hidden" type="text" name="login_user_id"required value="' . $_SESSION['login_user_id'] . '">
<div class="text-input">
<label for="explain">Explain Your Query</label>
<textarea id="explain" placeholder="Explain your Query for answer purposes..." name="query_explain" required></textarea>
</div>
<input class="submit" type="submit" value="Submit">
</form>
</div>';
} else {
echo ' <div class="alert login" id="warning">
<div class="left">
<i class="fas fa-exclamation-triangle"></i>
<p>please <span>login</span> first to post your query. </p>
</div>
</div>';
}
?>
<?php
echo '<div class="query">
<h2>All QUERIES</h2>
</div>';
// this is my college id
// echo $postid;
$query_sql = "SELECT * FROM `query` WHERE `query_post_id`='$postid' ORDER BY query_id DESC";
$query_result = mysqli_query($connect, $query_sql);
$query_row = mysqli_num_rows($query_result);
if ($query_row > 0) {
while ($query_assoc = mysqli_fetch_assoc($query_result)) {
echo '
<a class="post-query-show post-query-a" href="query?qid=' . $query_assoc['query_id'] . '">
<div class="post-query-show-box">
<div class="queries">
<div class="profile-query">
<img src="img/profile-2.jpg" alt="profile">
</div>
<div class="query-show">
<div class="query-title-explain">
<div class="query-title">
<h2>' . $query_assoc['query_title'] . '</h2>
</div>
<div class="query-explain">
<span>' . $query_assoc['query_content'] . '</span>
</div>
</div>
</div>
</div>
</div>
</a>
';
}
}
// echo ' <div class="know-more">
// <h4>Read More...</h4>
// </div>
// </div>
// </div>';
}
}
?>
<script src="js/header.js"></script>
<script src="js/footer.js"></script>
</body>
</html>