<?php 

include ('include/functions.php');

$user = new Admin();



if (!$user->get_session())

{

header("location:login.php");

}



if($_REQUEST['getmeout'] == 'ok'){

	$user->logout();

}



if(isset($_POST['delete'])){

	extract($_POST);

	$get = $set->delete_Slider($actioncheck);

}



?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Admin</title>

<link rel="stylesheet" type="text/css" href="css/style.css" />

<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400' rel='stylesheet' type='text/css'>

<script src="http://code.jquery.com/jquery-latest.min.js"></script>

<script type="text/javascript" src="js/liveedit.js"></script>

<script type="text/javascript" src="js/livesearch.js"></script>

<script type="text/javascript" src="js/checkbox.js"></script>

<script type="text/javascript">

	function showhide(id) {

       var e = document.getElementById(id);

       if(e.style.display == 'block')

       e.style.display = 'none';

       else

       e.style.display = 'block';

    }

</script>

</head>



<body>

<!-- Admin Main Area -->

<div id="adminmain" >  



<? include ('include/header.php'); ?>



<div class="left">

<?  include ('include/menu.php');  ?>

</div>







<div  id='content'>

<div class="dashbox-main-div">





    <h2><span>View Slider</span>

     <p><a href="index.php">Home</a> > Slider</p>

     <div style="clear:both"></div>

     </h2>



	<?php if($_REQUEST['msg'] != "" and $_REQUEST['msg']=='success') { echo '<p class="success">Request Successfully Complete</p>'; } ?>

	 <?php if($_REQUEST['msg'] != "" and $_REQUEST['msg']=='error') { echo '<p class="error">Request Unsuccessful!! Please Try Again.</p>'; } ?>



<div class="col-100 bg_color_white border_top_gray border_radius_5" >



<form action="" method="post">

<h2>Manage Slider

	 <a href="slider.php" class="fright green_button">Add Slider</a>

	<input type="submit" name="delete" value="Delete" class="red_button fright"

	 onclick="return confirm('Are you sure you want to delete selected Video ?')" />



	<div style="clear:both"></div>

</h2>



	



<div style="clear:both"></div>



<table width="100%" style="padding:0; margin:0">

<tr>

	<td align="center">#</td>

	<td><strong>Slider Text</strong></td>

	<td><strong>Slider Image</strong></td>	

	<td><strong>Action</strong></td>

</tr>

<?

if(!isset($_GET['page'])){

	$_GET['page'] =1;

}	



if(isset($_GET['page']))

{

       $page=$_GET['page'];

       $start=($page-1)*$limit;

}



$selectevent = mysql_query("SELECT * FROM slider ORDER BY id DESC LIMIT $start, $limit ");

	while($userevent=mysql_fetch_array($selectevent)):

	extract($userevent);

?>

<tr>

	<td align="center"><label><input type="checkbox" name="actioncheck[]" class="case" value="<?=$slider_id?>" /></label></td>

	<td><?=$slider_txt_top?> <?=$slider_txt_bottom?></td>	

	<td><a href="../upload/slider/<?=$slider_img?>" target="_blank">

	<img src="../upload/slider/<?=$slider_img?>" width="80">

	</a>

	</td>	

	<td width="150">

	<a href="slider.php?edit=<?=$slider_id?>" class="green_button">Edit Slider</a>

	</td>

</tr>

<? endwhile;

$rows=mysql_num_rows(mysql_query("select * from Slider"));

$total=ceil($rows/$limit);

?>

</table>



<br>







<div class="bodyfooter fright">

<div class="fleft">

<?

if($page>1)

{

       echo "<a href='?page=".($page-1)."' class='button fleft'>PREVIOUS</a>";

}

else{

	 echo "<a href='javascript:void(0);' class='disable fleft'>PREVIOUS</a>";

}

?>

</div>

<div class="fleft">

<?

echo "<ul class='page'>";

               for($i=1;$i<=$total;$i++)

               {

                       if($i==$page) { echo "<li class='current'>".$i."</li>"; }

                       

                       else { echo "<li><a href='?page=".$i."'>".$i."</a></li>  "; }

               }

echo "</ul>";

?>

</div>

<div class="fleft">

<?

if($page!=$total)

{

       echo "<a href='?page=".($page+1)."' class='button fright'>NEXT</a>";

}

else

{

       echo "<a href='javascript:void(0);' class='disable fright'>NEXT</a>";

} 

?>

</div>





</div>



<div style="clear:both"></div>

<br>



</div> 







<Div style="clear:both"></div>

<?  include ('include/footer.php'); ?>





</form>

</div>



</div>



</body>

</html>