
PK 
<center>
<?php
if($_GET[saction]=="del" && $_GET[video_id]!=""){
$q = "select * from videos where video_id = '$_GET[video_id]'";
$q = mysql_query($q) or die(mysql_error());
if($r=mysql_fetch_array($q)){
//@unlink("../site_data/gallery_images/$r[image_file]");
//@unlink("../site_data/gallery_images/th_$r[image_file]");
$q1="delete from videos where video_id = '$_GET[video_id]'";
mysql_query($q1) or die(mysql_error());
$msg="Record Deleted Successfully.";
}
}
?>
</center>
<!-- BEGIN PAGE LEVEL STYLES -->
<link rel="stylesheet" type="text/css" href="assets/global/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="assets/global/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.css"/>
<link rel="stylesheet" type="text/css" href="assets/global/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
<link rel="stylesheet" type="text/css" href="assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css"/>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN CONTAINER -->
<!-- BEGIN CONTENT -->
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">Videos<small></small></h3>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row">
<!-- BEGIN SAMPLE TABLE PORTLET-->
<div class="portlet">
<div class="portlet-body">
<!-- Select Gallery
<select style="width:200px; display:inline;" class="form-control" id="gallery_id" name="gallery_id" onchange="window.location.href='main.php?paction=<?php echo $_GET[paction]?>&gallery_id='+this.value">
<option value="">Show All</option>
<?php
/*$q="select * from gallery order by titl";
$q=mysql_query($q) or die(mysql_error());
while($r=mysql_fetch_array($q)){
if($r[gallery_id]==$_GET[gallery_id]){
$sel="selected='selected'";
}else{
$sel="";
}
?>
<option value="<?php echo $r[gallery_id]?>" <?php echo $sel?>><?php echo $r[titl]?></option>
<?php
}*/
?>
</select> -->
<div class="table-scrollable">
<table class="table table-striped table-bordered table-advance table-hover">
<thead>
<tr>
<th width="5%" nowrap>Sr No</th>
<th>Title</th>
<th>Album</th>
<th>Image</th>
<th style="text-align:center" width="150">Actions</th>
</tr>
</thead>
<tbody>
<?php
if($_GET[per_page]){
$noprd=$_GET[per_page];
}else{
$noprd=15;
}
$cpage=$_REQUEST['page'];
if ($cpage == 0){
$cpage=1;
$cnt=1;
}else{
$cnt=($cpage * $noprd) - $noprd + 1;
}
$frm=($cpage * $noprd) - $noprd;
$whr=1;
if($_GET[gallery_id]!=""){
$whr.=" and gallery_id='$_GET[gallery_id]' ";
}
$orderby=" order by video_id";
$query = "select * from videos where $whr ";// where cate_id='$_GET[cate_id]' and status=1 ";
$sql=$query;
$query.=" $orderby LIMIT $frm, $noprd";
//echo "$query<br />";
$query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($query)){
$q=" select * from gallery_vid where gallery_id='$row[gallery_id]'";
$q = mysql_query($q) or die (mysql_error());
if($rr = mysql_fetch_array($q)){
$gallery=$rr[titl];
}else{
$gallery="";
}
$jutjub = new YouTube("$row[video]");
?>
<tr>
<td align="center"><?=$cnt?></td>
<td><?php echo $row[titl];?></td>
<td><?php echo $gallery;?></td>
<td><?php echo $jutjub->ShowImg("default",120,$vd_a[url])?></td>
<td align="right">
<a href="main.php?paction=add_videos&video_id=<?php echo $row[video_id]?>" class="btn default btn-xs purple"><i class="fa fa-edit"></i> Edit </a>
<a href="javascript:del('main.php?paction=<?php echo $_GET[paction]?>&saction=del&video_id=<?php echo $row[video_id]?>');" class="btn default btn-xs black">
<i class="fa fa-trash-o"></i> Delete </a>
</td>
</tr>
<?php
$cnt++;
}
?>
</tbody>
</table>
</div>
<!-- Pagging -->
<div class="pagging">
<div class="right">
<?php
include('ps_pagination.php');
$pager = new PS_Pagination($conn, $sql, $noprd, 6, "paction=$_GET[paction]&gallery_id=$_GET[gallery_id]");
$pager->setDebug(false);
$pager->total_rows=$result;
$rs = $pager->paginate();
//echo $pager->renderFullNav();
echo $pager->renderFirst();
echo $pager->renderPrev("Back");
echo $pager->renderNav('<span>', '</span>');
echo $pager->renderNext("Next");
echo $pager->renderLast();
?>
</div>
</div>
<!-- End Pagging -->
</div>
</div>
<!-- END SAMPLE TABLE PORTLET-->
</div>
<!-- END PAGE CONTENT-->
</div>
<!-- END CONTENT -->
<!-- END CONTAINER -->


PK 99