View file iblog/admin/tables/slider_tbl.php

File size: 2.52Kb
<?php 
include "../../lib/functions_class.php"; 
include "../../lib/pagination.php";

$orderby = $_POST['orderby'];
$searchkey = $_POST['searchkey'];



	/*Pagination Property*/
	$adjacents = 2;
	$targetpage = "slider_tbl.php";
	$limit = $_POST['rowlimit'];		
	$page = $_POST['page'];
	$total_pages = $DB->totalslider($searchkey);

	if($page) {
		$start = ($page - 1) * $limit; 			
	}else{
		$start = 0;		
	}	
	
	$pagination_out = pagination($tbl_name,$adjacents,$total_pages,$targetpage,$limit,$page,$start);
/*Pagination Property*/
	
?>
<div class="row">
	<div class="table-responsive">
		<table class="table table-striped jambo_table bulk_action">
			<thead>
				<tr class="headings">
					<th class="column-title">Preview Banner </th>
					<th class="column-title">Title </th>
					<th class="column-title">Banner Order </th>
					<th style="width:20%;"><span class="nobr">Action</span></th>
				</tr>
			</thead>

			<tbody>
				<?php 
					$i=1;
					$fetch = $DB->output_slider($start,$limit,$orderby,$searchkey);
					$rowcount = count($fetch);
					if($rowcount != 0){
					foreach($fetch as $row){?>
						<tr class="even pointer">
							<td> <img src="../uploads/slider/<?php echo $row['slider_pic'];?>" height="20%"> </td>
							<td> <?php echo $row['title'];?> </td>
							<td> 
								<select class="form-control" id="setorder" name="setorder" style="width:110px;margin-right:5px;">
									<option value="">Order</option>
									<?php for($i=1;$i<=$rowcount;$i++){?>
										<option value="<?php echo $i.",".$row['id'];?>" 
										<?php if($row['banner_order'] == $i){echo "selected";}?>><?php echo $i;?></option>
									<?php } ?>
								</select>
							</td>
							<td class=" last">
								<a href="../<?php echo $row['page_name'];?>" target="_new"><span class="label label-primary fa fa-eye"> View</span></a>
								<a href="add_edit_slider.php?id=<?php echo $row['id'];?>"><span class="label label-success fa fa-edit"> Edit</span></a>
								<a href="javascript:;" onclick="deldialog('<?php echo $row['id'];?>','<?php echo $row['slider_pic'];?>');"><span class="label label-danger fa fa-trash"> Delete</span></a>
							</td>
						</tr>
				<?php } } else {?>
						<tr>
							<td colspan="7"> <center>No Data Found</center> </td>
						</tr>
				<?php } ?>
			</tbody>
		</table>
	</div>
</div>
<?php echo $pagination_out;?>

<script>
	//Change Order
	$("*#setorder").on('change',function(){
		var getval = $(this).val();
		changeorder(getval);
	});
</script>