/
y.php
302 lines (194 loc) · 8.83 KB
/
y.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
<link rel="stylesheet" href="css/bootstrap.css">
<link rel='stylesheet' href="css/style.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style type="text/css">
#sidebar ul { background: whitesmoke; text-decoration: none; list-style-type: none; }
li { margin: 0 0 0 0px; text-decoration: none; }
#sidebar a {text-decoration: none; padding:15px; border-radius: 5px; margin:0px; float:right;}
#sidebar a:hover{background: #333;color: #eee}
#sidebar { width: 90px; position: fixed; left: 80%; top: 290px; margin: 0 0 0 110px; float: right; border-radius: 5px; }
</style>
<?php
require_once 'header.php';
?>
<div id='group'>
<?php
require_once 'include/db_connect.php';
require_once 'include/essential.php';
$hash=$_GET['group'];
$name= mysql_query("select * from groups where ghash='$hash' ");
while ($name1 = mysql_fetch_array($name)) {
$gname=$name1['groupname'];
}
?>
<div class="page-header" style="background:#4BC599;">
<h1 ><?php echo $gname;?> <small style="color:black;opacity: 0.6;"> | group</small></h1>
</div>
<h4 style="color:black;">Compose <small style="color:black;opacity: 0.6;"> | Message</small></h4>
<?php
require_once 'include/db_connect.php';
$co= mysql_query("SELECT COUNT(*) FROM gpost where seen='unread'");
while($row = mysql_fetch_array($co)){
$Totalcount= $row['COUNT(*)'];
}
$co1= mysql_query("SELECT COUNT(*) FROM gpost where seen='read'");
while($row = mysql_fetch_array($co1)){
$Totalcount1= $row['COUNT(*)'];
}
?>
<div role="tabpanel">
<div class="group">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<h3>Posting options</h3>
<li role="presentation" class="active"><a href="#textpost" aria-controls="home" role="tab" data-toggle="tab"><img src="img/file.png" width="20" height="20">Instant Message</a></li>
<li role="presentation"><a href="#imageposting" aria-controls="profile" role="tab" data-toggle="tab"><img src="img/camera.jpg" width="20" height="20">Image Upload</a></li>
<li role="presentation"><a href="#videoposting" aria-controls="messages" role="tab" data-toggle="tab"><img src="img/video.png" width="20" height="20">Video Upload</a></li>
</ul>
</div>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="textpost">
<div id="textpost" class="tab-pane fade in active">
<h3>Instant Message</h3>
<form action="ginsert.php" method="post" enctype="multipart/form-data">
<div class="panel panel-default">
<div class="panel-heading">Instant Message</div>
<div class="panel-body">
<textarea class="form-control" rows="3" placeholder="What's on your mind?" name="msg"></textarea>
<input type="hidden" value="message" name="status">
<input type="hidden" name="postid" value="<?php echo $pid1; ?>">
<input type="hidden" name="hash" value="<?php echo $hash;?>">
</div>
<div class="panel-footer clearfix">
<div class="pull-right">
<input type="submit" value="post" name="mpost" class="btn-primary">
</div>
</div>
</div>
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="imageposting">
<div id="imagepost" class="tab-pane fade in active">
<h3>Image</h3>
<form action="gimage.php" method="post" enctype="multipart/form-data">
<div class="panel panel-default">
<div class="panel-heading">Update Status</div>
<div class="panel-body">
<textarea class="form-control" rows="3" placeholder="What's on your mind?" name="msg"></textarea>
<input type="file" name="imagepost" >
<input type="hidden" value="image" name="status">
<input type="hidden" name="postid" value="<?php echo $pid1; ?>">
<input type="hidden" name="hash" value="<?php echo $hash;?>">
</div>
<div class="panel-footer clearfix">
<div class="pull-right">
<input type="submit" value="post" name="ipost" class="btn-primary">
</div>
</div>
</div>
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="videoposting">
<h3>Video</h3>
<form action="ginsert.php" method="post" enctype="multipart/form-data">
<div class="panel panel-default">
<div class="panel-heading">Update Status</div>
<div class="panel-body">
<textarea class="form-control" rows="3" placeholder="What's on your mind?" name="msg"></textarea>
<textarea class="form-control" rows="1" placeholder="Video url" name="url"></textarea>
<input type="hidden" value="video" name="status">
<input type="hidden" name="postid" value="<?php echo $pid1; ?>">
<input type="hidden" name="hash" value="<?php echo $hash;?>">
</div>
<div class="panel-footer clearfix">
<div class="pull-right">
<input type="submit" value="post" name="vpost" class="btn-primary">
</div>
</div>
</div>
</form>
</div>
<div role="tabpanel" class="tab-pane" id="read">read</div>
<div role="tabpanel" class="tab-pane" id="unread">unread.</div>
</div>
</div>
</div>
<div id="sidebar">
<div id='postbox'>
<ul class="nav nav-pills nav-stacked" style="float: right;">
<h3 style="color:black;"> messages</h3><hr>
<li role="presentation" class="active"><a href="#read" aria-controls="home" role="tab" data-toggle="tab"><img src="img/read.jpg" width="20" height="20">Read<span class="badge"><?php echo $Totalcount1; ?></span></a></li><br><br>
<li role="presentation"><a href="#unread" aria-controls="profile" role="tab" data-toggle="tab"><img src="img/unread.jpg" width="20" height="20">Unread<span class="badge"><?php echo $Totalcount; ?></span></a></li>
</ul>
</div>
</div>
<?php
require_once 'include/db_connect.php';
$pg= mysql_query("select * from gpost where ghash='$hash' ORDER BY id desc");
while ($row = mysql_fetch_array($pg))
{
$type=$row['status'];
if($type=='message')
{
$postn= getuser($row['user_id'], 'fname');
$ava1= getavatar($row['user_id'], 'avatar');
$ava="<img src='$ava1' height='30' width='30' class=>";
$tim=$row['time'];
$hash=$row['ghash'];
echo "<div class='post'><div class='panel panel-default'>
<div class='panel-heading'>".$ava.$postn."</div>
<div class='panel-body'>".$row['message']."
</div><div class='panel-footer'>Posted at  ".$tim."</div>
</div>
</div></div>";}
if($type=='image')
{
$postn= getuser($row['user_id'], 'fname');
$ava1= getavatar($row['user_id'], 'avatar');
$ava="<img src='$ava1' height='30' width='30'>";
$pim=$row['pimage'];
$pim1="<img src='$pim' class='img-responsive center-block'>";
echo "<div class='post'><div class='panel panel-default'>
<div class='panel-heading'>".$ava.$postn."</div>
<div class='panel-body'>".$row['message'].$pim1."
</div>
</div></div>";
}
if($type=='video')
{
$postn= getuser($row['user_id'], 'fname');
$ava1= getavatar($row['user_id'], 'avatar');
$ava="<img src='$ava1' height='30' width='30'>";
$url=$row['url'];
$vi=" <iframe src='$url'
frameborder='0' width='476' height='400'
allowfullscreen ></iframe >";
echo "<div class='post'><div class='panel panel-default'>
<div class='panel-heading'>".$ava.$postn."</div>
<div class='panel-body'>".$row['message'].$vi."
</div>
</div></div>";
}
if($type=='location')
{
$postn= getuser($row['user_id'], 'fname');
$ava1= getavatar($row['user_id'], 'avatar');
$ava="<img src='$ava1' height='30' width='30'>";
$pla=$row['place'];
echo "<div class='post'><div class='panel panel-default'>
<div class='panel-heading'>".$ava.$postn."</div>
<div class='panel-body'>".$row['message']."<br>".$pla."
</div>
</div></div>";
}
}
?>
<?php
require_once 'footer.php';
?>