-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreply.php
407 lines (299 loc) · 10.6 KB
/
reply.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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<?php
include("dbconfig.php");
session_start();
?>
<?php
if(isset($_GET["id"]))
{
if($_SESSION["name"]=="")
{
header("location:reg.php");
}
}
?>
<?php
function timeAgo($time_ago){
$time_ago = strtotime($time_ago);
$cur_time = time();
$time_elapsed = $cur_time - $time_ago;
$seconds = $time_elapsed ;
$minutes = round($time_elapsed / 60 );
$hours = round($time_elapsed / 3600);
$days = round($time_elapsed / 86400 );
$weeks = round($time_elapsed / 604800);
$months = round($time_elapsed / 2600640 );
$years = round($time_elapsed / 31207680 );
// Seconds
if($seconds <= 60){
return "just now";
}
//Minutes
else if($minutes <=60){
if($minutes==1){
return "one minute ago";
}
else{
return "$minutes minutes ago";
}
}
//Hours
else if($hours <=24){
if($hours==1){
return "an hour ago";
}else{
return "$hours hrs ago";
}
}
//Days
else if($days <= 7){
if($days==1){
return "yesterday";
}else{
return "$days days ago";
}
}
//Weeks
else if($weeks <= 4.3){
if($weeks==1){
return "a week ago";
}else{
return "$weeks weeks ago";
}
}
//Months
else if($months <=12){
if($months==1){
return "a month ago";
}else{
return "$months months ago";
}
}
//Years
else{
if($years==1){
return "one year ago";
}else{
return "$years years ago";
}
}
}
?>
<!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">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<!-- http://draganzlatkovski.com/code-projects/toggle-jquery-side-bar-menu-in-bootstrap-free-template/ -->
<title>Dashboard Template for Bootstrap</title>
<!-- jQuery -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="components/bootstrap/dist/js/jquery.js"></script>
<!-- Bootstrap core CSS -->
<link href="components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="components/bootstrap/dist/css/simple-sidebar.css" rel="stylesheet">
<link rel="stylesheet" href="components/bootstrap/dist/css/postataskbox.css" />
<link rel="stylesheet" href="components/bootstrap/dist/css/projectdes.css" />
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#menu-toggle" id="menu-toggle"><span class="glyphicon glyphicon-list" aria-hidden="true"></span></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-comment" aria-hidden="true"></span> Notification(0) </a></li>
<li><a href="logout1.php"><span class="glyphicon glyphicon-off" aria-hidden="true"></span> Log Out</a></li>
</ul>
<form class="navbar-form navbar-right" action="" method="GET">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search..." id="query" name="search" value="">
<div class="input-group-btn">
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-search"></span></button>
</div>
</div>
</form>
</div>
</div>
</nav>
<!--
<div class="center"><button data-toggle="modal" data-target="#squarespaceModal" class="btn btn-primary center-block">Post Task</button></div>
-->
<div id="wrapper" class="toggled">
<div class="container-fluid">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<br>
</li>
<li class="sidebar-brand">
<a href="#" class="navbar-brand">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span><?php echo $userRow['name']; ?>
</a>
</li>
<li>
<a href="home.php"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home</a>
</li>
<!--
<li>
<a href="#"><span class="glyphicon glyphicon-comment" aria-hidden="true"></span> Notification</a>
</li>
-->
<li>
<a href="mytask.php"><span class="glyphicon glyphicon-tasks" aria-hidden="true"></span> My Task</a>
</li>
<li>
<a href="Blog.php"><span class="glyphicon glyphicon-tasks" aria-hidden="true"></span> Blog</a>
</li>
<li>
<li>
</ul>
</div>
<!-- /#sidebar-wrapper -->
</div>
<!-- /#page-content-wrapper -->
</div>
</div>
<!-- /#wrapper -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="col-lg-4">
<div class="list-group" style="margin-left:0px">
<a href="user.php" class="list-group-item active" style="background-color:black;">
All task</a>
<a href="ourskill.php" class="list-group-item">Profile
</a>
</a>
<a href="my_task.php" class="list-group-item">My task
</a>
<a href="" data-toggle="modal" data-target="#squarespaceModal" class="list-group-item">
Post Task
</a>
<a href="notification.php" class="list-group-item">
Notification(<?php echo $count; ?>)
</a>
<a href="changepass.php" class="list-group-item">Change Password
</a>
<a href="logout1.php" class="list-group-item">Log Out
</a>
</div>
</div>
<div class="col-lg-8">
<?php
if(isset($_POST["reply"]))
{
$comm=$_POST["comment"];
$p_id=$_POST["po_id"];
$c_id=$_POST["commenter_id"];
}
?>
<?php
$title = $_GET['s_title'];
//$p_id = $_GET['id'];
$sql1=mysqli_query($con,"select * from posts where post_id='$p_id'");
while($comnt1=mysqli_fetch_array($sql1)){
$uid=$comnt1["usr_id_p"];
}
$sql2=mysqli_query($con,"select * from registration where usr_id='$uid'");
while($comnt2=mysqli_fetch_array($sql2))
{
$im=$comnt2["image"];
}
echo "dfdf".$im;
?>
<div class="container">
<div class="col-sm-8">
<div class="panel panel-white post panel-shadow">
<div class="post-heading">
<div class="pull-left image">
<img src="user_images/<?php echo $im; ?>" class="img-circle avatar" alt="user profile image">
</div>
<div class="pull-left meta">
<div class="title h5">
<a href="#"><b></b></a>
</div>
</div>
</div>
<div class="post-description">
<?php
$title = $_GET['s_title'];
$p_id = $_GET['id'];
echo $comm;
?>
</div>
<form action="comment1.php" method="post">
<div class="post-footer">
<div class="input-group">
<textarea class="form-control" cols="100" rows="10" placeholder="Add a comment" type="text" name="comment"></textarea>
<input class="form-control" type="hidden" name="uid" value="<?php echo $_SESSION['id']; ?>">
<input class="form-control" type="hidden" name="pid" value="<?php echo $p_id;?>">
<input class="form-control" type="hidden" name="comme_id" value="<?php echo $c_id;?>">
<div class="btn-group" role="group" style="margin-top:5px">
<button type="submit" name="submit_comment" class="btn btn-primary btn-hover-green" >Post Your Comment</button>
</div>
</div>
</form>
<?php
$p_id = $_GET['id'];
$sql=mysqli_query($con,"select * from comments where post_id_c='$p_id'");
while($comnt=mysqli_fetch_array($sql)){
//fetching all posts
$time_ago = $comnt['comment_time'];
echo '
<ul class="comments-list">
<li class="comment">
<a class="pull-left" href="#">
<img class="avatar" src="http://bootdey.com/img/Content/user_1.jpg" alt="avatar">
</a>
<div class="comment-body">
<div class="comment-heading">
<h4 class="user"> '.$comnt['name'].'</h4>
<h5 class="time">'.timeAgo($time_ago).'</h5>
</div>
<p>'.$comnt['comment'].'</p>
</div>
</li>
</ul>
';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap Core JavaScript -->
<script src="components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Menu Toggle Script -->
<script>
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('.status').click(function() { $('.arrow').css("left", 0);});
$('.photos').click(function() { $('.arrow').css("left", 146);});
});
</script>
</body>
</html>