-
Notifications
You must be signed in to change notification settings - Fork 0
/
show-list.php
1193 lines (574 loc) · 19.3 KB
/
show-list.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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
<?php
include "header.php";
?>
<html prefix="og: http://ogp.me/ns#">
<head>
<meta property="og:title" content="Amar Ela" />
<meta property="og:description" content="Bishnupriya Manipuri online music store under KAAKAI newspaper." />
<meta property="og:image" content="img/logo/songs_logo.png" />
<meta property="fb:app_id" content="1407103222879429"/>
<meta property="fb:admins" content=" 100002233601582"/>
<?php
if(isset($_GET['album_id']))
{
$album_id = $_GET['album_id'];
$result = Database::getInstance()->query("SELECT * FROM album_details WHERE id='$album_id'");
while($row = mysql_fetch_array($result))
{
$album_name = $row['album_name'];
}
echo "<title>". $album_name ." | Amar Ela</title>";
}
else
{
echo "<title>Amar Ela | Song List</title>";
}
?>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="Keywords" content="amar ela, Bishnupriya Manipuri Online Song, Bishnupriya, songs, Vishnupriya, Ela, manipuri ela, BM ela, Amar Thator Ela, songs.kaakai.in">
<meta name="Description" content="Site of online Bishnupriya Manipuri music store under KAAKAI newspaper.">
</head>
<?php
if(isset($_GET['album_id']))
{
$album_id = textSafety($_GET['album_id']);
$result = Database::getInstance()->query("SELECT * FROM album_details WHERE id='$album_id'");
$row = mysql_fetch_array($result, MYSQLI_ASSOC);
if(! $row)
{
$url="index.php";
header("Refresh:0;URL=$url");
exit(0);
}
}
else
{
$url="index.php";
header("Refresh:0;URL=$url");
exit(0);
}
$detect = new Mobile_Detect;
$mobile_browser = false;
if ($detect->isMobile() && !$detect->isTablet())
{
$mobile_browser = true;
}
$empty_name = false;
$empty_email = false;
$invalid_email = false;
$empty_comment_box = false;
$comment_awaiting = false;
if(isset($_GET['code']) && isset($_GET['error']) && $_GET['error']== "1")
{
$empty_name = true;
}
if(isset($_GET['code']) && isset($_GET['error']) && $_GET['error']== "2")
{
$empty_email = true;
}
if(isset($_GET['code']) && isset($_GET['error']) && $_GET['error']== "3")
{
$invalid_email = true;
}
if(isset($_GET['code']) && isset($_GET['error']) && $_GET['error']== "4")
{
$empty_comment_box = true;
}
if(isset($_GET['error']) && $_GET['error']==0 && isset($_GET['msg']) && $_GET['msg']=='wait')
{
$comment_awaiting = true;
}
if(isset($_GET['comment_box']))
{
$comment_box = $_GET['comment_box'];
}
if(isset($_GET['name']))
{
$name = $_GET['name'];
}
if(isset($_GET['email']))
{
$email = $_GET['email'];
}
?>
<!DOCTYPE html>
<html lang="en">
<body>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$('#search').keyup(function() {
searchTable($(this).val());
});
});
function goBack()
{
window.history.back()
}
</script>
<script type="text/javascript">
function resetMarks(id){
$('#confirm_popup').removeClass("hide");
$("#confirm_popup").show();
//$("#confirm_popup").css('top',$(window).scrollTop()+90);
$.get( "ajax/search-user.php?user_id="+id, function( data ) {
$('#confirm_content').html(data);
});
$('#confirm_no').click(function(){
$("#confirm_popup").hide();
return false;
});
}
function songDetails(id){
$.get( "ajax/song-details.php?id="+id, function( data ) {
$('#songDetails').html(data);
});
}
function userDetails(id){
$.get( "ajax/user-details.php?id="+id, function( data ) {
$('#userDetails').html(data);
});
}
</script>
<style>
img.pg_thumb,
img#pg_large,
.pg_title h1,
.pg_content .pg_description div
{
margin-top:20px;
}
.pg_title h2{
*font-size:14px;
*width:500px;
overflow:hidden;
background:transparent url(bg.png) repeat top left;
padding:5px 5px;
color:#fff;
font-weight:bold;
}
.pg_title h4{
*font-size:14px;
*width:500px;
overflow:hidden;
background:transparent url(bg.png) repeat top left;
padding:5px 5px;
color:#fff;
font-weight:bold;
}
.pg_title h5{
*font-size:14px;
*width:500px;
overflow:hidden;
background:transparent url(bg.png) repeat top left;
padding:5px 5px;
color:#fff;
font-weight:bold;
}
.pg_description p{
color:#000;
*font-size:22px;
margin-bottom:10px;
background:transparent url(bg2.png) repeat top left;
padding:5px;
}
.pg_description{
color:#000;
*font-size:22px;
margin-bottom:10px;
background:transparent url(bg2.png) repeat top left;
padding:5px;
}
img.pg_thumb{
*top:90px;
*left:805px;
padding:10px;
background:transparent url(bg.png) repeat top left;
*cursor:pointer;
}
</style>
<br/><br/><br/><br/>
<div id="confirm_popup" class="hide">
<div id="confirm_content"></div>
<br/><br/>
<input id='confirm_no' type='button' class="btn btn-primary" value='Close' />
</div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=1407103222879429";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<?php
if(isset($_GET['album_id']))
{
$album_id = $_GET['album_id'];
/* Check whether previous comments are available r not. */
$commment_available = false;
$result = Database::getInstance()->query("SELECT * FROM comment_details where album_id=$album_id && status=1");
$row = mysql_fetch_array($result, MYSQLI_ASSOC);
if($row)
{
$commment_available = true;
}
?>
<div class="container">
<div class="row">
<div class="span6">
<?php
$result = Database::getInstance()->query("SELECT * FROM album_details WHERE id='$album_id'");
while($row = mysql_fetch_array($result))
{
echo "<img class='pg_thumb' src='album-image/$row[file_name]' alt='$row[album_name]' width='400' border='5' height='600' />";
//echo "<img class='pg_thumb' src='display-image.php?id=$row[id]&tableName=album_details' border='5' alt='not available' width='400' height='600' />";
}
?>
<?php
$result = Database::getInstance()->query("SELECT * FROM album_details WHERE id='$album_id'");
while($row = mysql_fetch_array($result))
{
echo "<div class='pg_title'><h2>";
echo $row['album_name'];
echo "</h2></div>";
}
$result = Database::getInstance()->query("SELECT * FROM album_details WHERE id='$album_id'");
while($row = mysql_fetch_array($result))
{
echo "<div class='pg_description'>";
echo "<p><b>Album Tags: </b><br/><i>". $row['album_description'] . "</i></p></div>";
}
if(!$mobile_browser)
{
if($commment_available)
{
?>
<br/>
<a href='#disqus_comment'>Please leave comment</a>
<br/>
<a name="comment"></a>
<div class="row">
<div class="span6">
<div class='pg_title'><h4>Comments:</h4></div>
</div>
</div>
<div class="row">
<div class="span6">
<div class='pg_description'>
<?php
$result = Database::getInstance()->query("SELECT * FROM comment_details where album_id=$album_id && status=1");
while($row = mysql_fetch_array($result))
{
echo
"<div class='row'>
<div class='span1'>";
if($row['name'] == "Admin")
{
echo "<b><font color='blue'>Admin :</font></b>";
}
else
{
echo "<b>$row[name] :</b>";
}
echo "</div>
<div class='span5'>
$row[comment]
</div>
</div><br/>";
}
?>
</div>
</div>
</div>
<?php
}
?>
</div>
<div class="span6"><br/>
<?php
$result1 = Database::getInstance()->query("SELECT * FROM song_details WHERE album_id='$album_id'");
$rowCount = mysql_num_rows($result1);
if(empty($rowCount) || $rowCount=="")
{
echo "<a class='btn btn-large' href='#' onclick='goBack()'>Album is empty. Go to previous page</a>";
}
else
{
echo "<input style='' type='text' placeholder='search here . . .' id='search'>";
?>
<div class="fb-like" data-href="https://www.facebook.com/bm.amarela" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
<?php
echo "<table class='table table-striped' id='searchTable'>
<tr>
<th>Song Name</th>
<th>Artist</th>
<th>Contr. Artist</th>
<th>Year</th>
<th>Genre</th>
<th>Added By <br/><font size='2px'> (Details)</font></th>
</tr>";
while($row1 = mysql_fetch_array($result1))
{
echo "<tr><tbody><td><a href='$row1[song_link]' target='_blank'>" . $row1['song_name'] . "</a></td>";
echo "<td>" . $row1['song_artist'] . "</td>";
echo "<td>" . $row1['song_contributing_artist'] . "</td>";
echo "<td>" . $row1['song_year'] . "</td>";
echo "<td>" . $row1['song_genre'] . "</td>";
$added_by = $row1['added_by'];
$user_result = Database::getInstance()->query("SELECT * FROM user_details WHERE name='$added_by'");
while($user_sql = mysql_fetch_array($user_result))
{
$user_id = $user_sql['id'];
}
echo "<td><a href='#' onclick='resetMarks($user_id)'>" . $row1['added_by'] . "</td></tbody></tr>";
}
echo "</table>";
echo "<a class='btn btn-large' href='index.php'>Go to previous page</a>";
}
?>
<br/><br/>
<?php
if($commment_available)
{
$result = Database::getInstance()->query("SELECT * FROM ad_details WHERE ad_place='Right side of show list' && status=1");
$row = mysql_fetch_array($result, MYSQLI_ASSOC);
if($row)
{
?>
<div id="ad-right">
<div style="text-align:right;"><font size=1>Advertisement</font></div>
<?php
$result = Database::getInstance()->query("SELECT * FROM ad_details WHERE ad_place='Right side of show list' && status=1 order by rand() LIMIT 1");
while($row = mysql_fetch_array($result))
{
echo "<a href='$row[ad_link]' target='_blank'><img src='advertise-image/$row[file_name]' alt='$row[ad_title]' style='height:400px; width:710px' /></a>";
}
?>
</div>
<?php
}
}
?>
</div>
<?php
}
else
{
?>
<br/>
<div class="fb-like" data-href="https://www.facebook.com/bm.amarela" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
<div class="span2"><br/>
<?php
$result1 = Database::getInstance()->query("SELECT * FROM song_details WHERE album_id='$album_id'");
$rowCount = mysql_num_rows($result1);
if(empty($rowCount) || $rowCount=="")
{
echo "<a class='btn btn-large' href='#' onclick='goBack()'>Album is empty. Go to previous page</a>";
}
else
{
echo "<input style='' type='text' placeholder='search here . . .' id='search'>";
echo "<table class='table table-striped' id='searchTable'>
<tr>
<th>Song Name</th>
<th>Added By <br/><font size='2px'> (Details)</font></th>
<th>Song Details</th>
</tr>";
while($row1 = mysql_fetch_array($result1))
{
echo "<tr><tbody><td><a href='$row1[song_link]' target='_blank'>" . $row1['song_name'] . "</a></td>";
$added_by = $row1['added_by'];
$user_result = Database::getInstance()->query("SELECT * FROM user_details WHERE name='$added_by'");
while($user_sql = mysql_fetch_array($user_result))
{
$user_id = $user_sql['id'];
}
echo "<td><a href='#user_desc' onclick='userDetails($user_id)'>" . $row1['added_by'] . "</td>";
echo "<td><a href='#song_desc' onclick='songDetails($row1[id])'>Know me</a></td></tbody></tr>";
}
echo "</table>";
echo "<a name='song_desc'></a>";
echo "<div class='pg_title'><h5><div id='songDetails'></div></h5></div>";
echo "<a name='user_desc'></a>";
echo "<div class='pg_description'><p><div id='userDetails'></div></p></div>";
}
/* Advertisement: under song list in of each and every page for mobile */
$result = Database::getInstance()->query("SELECT * FROM ad_details WHERE ad_place='Right side of show list' && status=1");
$row = mysql_fetch_array($result, MYSQLI_ASSOC);
if($row)
{
?>
<div id="ad-right">
<div style="text-align:right;"><font size=2>Advertisement</font></div>
<?php
$result = Database::getInstance()->query("SELECT * FROM ad_details WHERE ad_place='Right side of show list' && status=1 order by rand() LIMIT 1");
while($row = mysql_fetch_array($result))
{
echo "<a href='$row[ad_link]' target='_blank'><img src='advertise-image/$row[file_name]' alt='$row[ad_title]' style='height:250px; width:710px' /></a>";
}
?>
</div>
<?php
}
?>
</div>
<br/><br/>
<?php
if($commment_available)
{
?>
<a name="comment"></a>
<div class="row">
<div class="span6">
<div class='pg_title'><h4>Comments:</h4></div>
</div>
</div>
<div class="row">
<div class="span6">
<div class='pg_description'>
<?php
$result = Database::getInstance()->query("SELECT * FROM comment_details where album_id=$album_id && status=1");
while($row = mysql_fetch_array($result))
{
echo
"<div class='row'>
<div class='span1'>";
if($row['name'] == 'Admin')
{
echo "<b><font color='blue'>Admin :</font></b>";
}
else
{
echo "<b>$row[name] :</b>";
}
?>
</div>
<div class='span5'>
<?php echo $row['comment']; ?>
</div>
</div><br/>
<?php
}
?>
</div>
</div>
</div>
<?php
}
}
?>
</div>
</div>
<?php
}
?>
<a name="disqus_comment"></a>
<div class="container">
<div class="row">
<div class="span6">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'amarelakaakain'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
<div class="span6">
<?php
/* Advertisement: right side of discuss box only for desktop */
if(!$mobile_browser && !$commment_available)
{
$result = Database::getInstance()->query("SELECT * FROM ad_details WHERE ad_place='Right side of disqus box' && status=1");
$row = mysql_fetch_array($result, MYSQLI_ASSOC);
if($row)
{
?>
<div id="ad-right">
<div style="text-align:right;"><font size=1>Advertisement</font></div>
<?php
$result = Database::getInstance()->query("SELECT * FROM ad_details WHERE ad_place='Right side of disqus box' && status=1 order by rand() LIMIT 1");
while($row = mysql_fetch_array($result))
{
echo "<a href='$row[ad_link]' target='_blank'><img src='advertise-image/$row[file_name]' alt='$row[ad_title]' style='height:350px; width:600px' /></a>";
}
?>
</div>
<?php
}
}
?>
</div>
</div>
</div>
<br/>
<?php
$result = Database::getInstance()->query("SELECT * FROM ad_details WHERE ad_place='footer' && status=1");
$row = mysql_fetch_array($result, MYSQLI_ASSOC);
if($row)
{
?>
<div class="container">
<div class="row">
<div class="span12">
<div id="ad-right">
<div style="text-align:right;"><font size=1>Advertisement</font></div>
<?php
$result = Database::getInstance()->query("SELECT * FROM ad_details WHERE ad_place='footer' && status=1 order by rand() LIMIT 1");
while($row = mysql_fetch_array($result))
{
echo "<a href='$row[ad_link]' target='_blank'><img src='advertise-image/$row[file_name]' alt='$row[ad_title]' style='height:170px; width:1200px' /></a>";
}
?>
</div>
</div>
</div>
</div>
<?php
}
?>
</body>
</html>
<script>
function validateText()
{
var x=document.forms["comment_form"]["name"].value;
if (x==null || x=="")
{
alert("Name must be filled out");
return false;
}
var x=document.forms["comment_form"]["comment_box"].value;
if (x==null || x=="")
{
alert("Comment box should not be empty");
return false;
}
var x=document.forms["comment_form"]["email"].value;
if (x==null || x=="")
{
alert("Email id must be filled out");
return false;
}
else
{
var x=document.forms["comment_form"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Please enter a valid email-id");
return false;
}
}
}
</script>
<?php include "footer.php"; ?>