WebShell: t.me/oghbnz


Current Path : /home/sreemitragroup/public_html/admin/
Upload File :
Current File : /home/sreemitragroup/public_html/admin/media_gallery_settings.php

<?php require("header.php"); ?>



<?php require("sub_header.php"); 







if($_GET['did']){



	$did=$_GET['did'];



$conn->query("DELETE FROM media_gallery WHERE id='".$did."'");



$conn->query("DELETE FROM media WHERE i_id='".$did."'");  ?>





<script type="text/javascript">



	window.location ="media_gallery_settings.php?msg=del";



</script>



<?php } ?>











<div class="main">



	<div class="container"> 



		<div class="row"> 



			<div class="span12"> 



				<div class="widget stacked"> 







					<div class="widget-header" align="center">



      					<h3>media Gallery Setting's</h3>



      					<a href="media_gallery.php" style="float: right;margin-top: 5px;margin-right:5px" class="btn btn-success">Add New media Gallery</a>



      				</div> <!-- /widget-header -->







						<div class="widget-content">



							<?php if($_GET['msg']=='update'){ ?>



							<h3 style="color: green" style="padding-left: 182px;" align="center">Media Gallery Updated Successfully!</h3>



							<?php } ?>



							<?php if($_GET['msg']=='del'){ ?>



							<h3 style="color: green" style="padding-left: 182px;" align="center">Media Gallery Deleated Successfully!</h3>



							<?php } ?>







							<section id="tables">







							<table  class="table table-bordered table-striped table-highlight">



								<thead>



									<tr>



									<th>No</th>	



									<th>Media Name</th>



									<th>Media Image</th>



									<th>Action</th>



									</tr>



								</thead>



												<?php require("db_conn.php"); 



													@$page=$_GET['page'];







													if($page == "" || $page == "1" ){



														$page1=0;



													}else{



														$page1=($page*20)-20;



													}







													$pages=20;



													//$r_index=0;



													$records1 =$conn->query("SELECT * FROM media_gallery");



													$row1 = $records1->rowCount();



													if($_GET['page'] != ""){



													$no=(($page-1)*20)+1;



													}else{



														$no=1;



													}



													$records = $conn->query("SELECT * FROM media_gallery ORDER BY id DESC LIMIT $page1,$pages");



													while($row=$records->fetch(PDO::FETCH_ASSOC)){  ?>



									<tbody>



										<tr>



										<td><?php echo $no; ?></td>



											<?php $records1=$conn->query("SELECT * FROM media_gallery ");



											$row2=$records1->fetch(PDO::FETCH_ASSOC); ?>



										<td><?php echo $row['heading']; ?></td>



										<td><?php $f=$row['image'];	echo "<img height='300' width='250' src='../images/media/".$f."'>";  ?></td>



										<td><section id="buttons">



										<a href="media_gallery.php?id=<?php echo $row['id']; ?>" class="btn btn-success">Edit</a> &nbsp; &nbsp;



										<a href="javascript:void(0);"  onclick="conform_del('<?php echo $row['id'];?>')" class="btn btn-danger">Delete</a> &nbsp; &nbsp;



										<a href="media.php?i_id=<?php echo $row['id']; ?>" class="btn btn-success">Add/Alter medias in <?php echo $row['heading']; ?></a></section></td>



										</tr>



									</tbody>



										<?php $no++;



										}



										?>







							</table>



							</section>



										<section id="paginations">



				<div class="pagination">



		  			<ul>



						<?php







						$a=ceil($row1/$pages);







						for($b=1; $b<=$a; $b++){



													?>







						 <li class="active">



							<a href="media_gallery_settings.php?page=<?php echo $b." "; ?>">



							<?php echo $b." "; ?></a>



						</li>



								



						<?php } ?>







					</ul>



				</div>



			</section>







					</div> <!-- /widget-content -->



				</div> <!-- /widget stacked -->



			</div> <!-- /span12 -->



		</div> <!-- /row -->



	</div> <!-- /container -->



</div> <!-- /main -->























<?php include_once("foter.php"); ?>











<script type="text/javascript">







function conform_del(id){







    if(confirm('Deleting Gallery Will Result In Deleate All The medias In The Gallery, Do You Wish To Continue...?')){



    	document.location.href='?did='+id;



    }



}







</script>