PK

ADDRLIN : /home/anibklip/ldhcgewc.org/cms/
FLL :
Current File : //home/anibklip/ldhcgewc.org/cms/view_slider.php

<center>
<?php
if($_GET[saction]=="del" && $_GET[image_id]!=""){
	$q = "select * from slider where image_id = '$_GET[image_id]'";
	$q = mysql_query($q) or die(mysql_error());
	if($r=mysql_fetch_array($q)){
		//echo $r[img];
		@unlink("../site_data/images/$r[img]");
		$q1="delete from slider where image_id = '$_GET[image_id]'";
		mysql_query($q1) or die(mysql_error());
		$msg="Record Deleted Successfully.";
	}
}

if(($_GET[sts]=="0" || $_GET[sts]=="1") && $_GET[image_id]!=""){
	$q1="update slider set status=$_GET[sts] where image_id = '$_GET[image_id]'";
	mysql_query($q1) or die(mysql_error());
	$msg="Record Status updated 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">View Slider Image<small></small></h3>
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li>
				<i class="fa fa-home"></i>
				<a href="main.php">Home</a>
				<i class="fa fa-angle-right"></i>
            </li>
        </ul>
        <!--<div class="page-toolbar">
            <div class="btn-group pull-right">
                <button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true">
                Actions <i class="fa fa-angle-down"></i>
                </button>
                <ul class="dropdown-menu pull-right" role="menu">
                    <li>
                        <a href="#">Action</a>
                    </li>
                    <li>
                        <a href="#">Another action</a>
                    </li>
                    <li>
                        <a href="#">Something else here</a>
                    </li>
                    <li class="divider">
                    </li>
                    <li>
                        <a href="#">Separated link</a>
                    </li>
                </ul>
            </div>
        </div>-->
    </div>
    <!-- END PAGE HEADER-->
    <!-- BEGIN PAGE CONTENT-->

    <div class="row">
        <!-- BEGIN SAMPLE TABLE PORTLET-->
        <div class="portlet">
            <div class="portlet-body">
                <?php if($msg){?><div class="alert alert-success display-show"><button class="close" data-close="alert"></button><?=$msg?></div><?php }?>

				<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>Image</th>
						<!-- <th>Status</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;
					if($_GET[sort]!=""){
						$orderby=" order by $_GET[sort]";
					}else{
						$orderby=" order by titl ";
					}
				
					$whr=1;
					//$whr.=" and country_id='$_GET[cid]' ";
					$query = "select * from slider 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)){
						?>
                        <tr>
                            <td align="center"><?=$cnt?></td>
                            <td><?php echo $row[titl];?><br /><?php echo $row[txt];?></td>
                            <td><img src="../site_data/images/<?php echo $row[img];?>" width="150" /></td>
                            <!-- <td width="30" align="center">
								<?php 
								if($row[status]){?>
									<a href="main.php?paction=<?php echo $_GET[paction]?>&image_id=<?php echo $row[image_id]?>&sts=0"><img src="active.png" /></a>
								<?php }else{?>
									<a href="main.php?paction=<?php echo $_GET[paction]?>&image_id=<?php echo $row[image_id]?>&sts=1"><img src="deactive.png" /></a>
								<?php }?>
							</td> -->
                            <td align="right">
                                <a href="main.php?paction=add_slider&image_id=<?php echo $row[image_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&image_id=<?php echo $row[image_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]&sort=$_GET[sort]");
                        $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