WebShell: t.me/oghbnz
<?php require("header.php"); ?>
<?php require("sub_header.php");
$ongoing_id=$_GET['ongoing_id'];
$city_id=$_GET['city_id'];
if($_GET['did']){
$did=$_GET['did'];
$ongoing_id=$_GET['ongoing_id'];
$city_id=$_GET['city_id'];
$conn->query("DELETE FROM ongoing_location WHERE id='".$did."'");
?>
<script type="text/javascript">
window.location ="ongoing_location.php?ongoing_id=<?php echo $ongoing_id; ?>&city_id=<?php echo $city_id; ?>&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">
<i class="icon-th-large"></i>
<a href="ongoing_project_details_list.php?ongoing_id=<?php echo $ongoing_id; ?>&city_id=<?php echo $city_id; ?>" style="float: left;margin-top: 5px;margin-left:5px" class="btn btn-success"><< Back</a>
<h3>Manage Location Plan</h3>
<a href="ongoing_location_settings.php?ongoing_id=<?php echo $ongoing_id; ?>&city_id=<?php echo $city_id; ?>" style="float: right;margin-top: 5px;margin-right:5px" class="btn btn-success">Add Plan</a>
</div> <!-- /widget-header -->
<div class="widget-content">
<?php if($_GET['msg']=='update'){?>
<h3 style="color: green" style="padding-left: 182px;" align="center">Location Plan Uploded Successfully!</h3>
<?php } ?>
<?php if($_GET['msg']=='del'){?>
<h3 style="color: green" style="padding-left: 182px;" align="center">Location Plan Deleated Successfully!</h3>
<?php } ?>
<section id="tables">
<table class="table table-bordered table-striped table-highlight">
<thead>
<tr>
<th>No</th>
<!-- <th>Title</th> -->
<th>Image</th>
<th>Action</th>
</tr>
</thead>
<?php require("db_conn.php");
@$page=$_GET['page'];
if($page == "" || $page == "1" ){
$page1=0;
}else{
$page1=($page*6)-6;
}
$pages=6;
//$r_index=0;
$records1 =$conn->query("SELECT * FROM ongoing_location WHERE ongoing_id= '$ongoing_id'");
$row1 = $records1->rowCount();
if($_GET['page'] != ""){
$no=(($page-1)*6)+1;
}else{
$no=1;
}
$records = $conn->query("SELECT * FROM ongoing_location WHERE ongoing_id= '$ongoing_id' ORDER BY id DESC LIMIT $page1, $pages");
while($row=$records->fetch(PDO::FETCH_ASSOC)){ ?>
<tbody>
<tr>
<td><?php echo $no; ?></td>
<!-- <td><?php echo $row['title']; ?></td> -->
<td><?php $f=$row['image']; echo "<img height='300' width='250' src='../images/ongoing_projects_images/".$f."'>"; ?></td>
<td><section id="buttons">
<a href="ongoing_location_settings.php?id=<?php echo $row['id'];?>&ongoing_id=<?php echo $ongoing_id; ?>&city_id=<?php echo $city_id; ?>" class="btn btn-success">Edit</a> <br><br>
<a href="javascript:void(0);" onclick="conform_del('<?php echo $row['id'];?>','<?php echo $row['ongoing_id']; ?>','<?php echo $city_id; ?>')" class="btn btn-danger">Delete</a></section></td>
</tr>
</tbody>
<?php $no++;
}
?>
</table>
<section id="paginations">
<div class="pagination">
<ul>
<?php
$a=ceil($row1/$pages);
for($b=1; $b<=$a; $b++){
?>
<li class="active">
<a href="ongoing_location.php?ongoing_id=<?php echo $ongoing_id; ?>&city_id=<?php echo $city_id; ?>&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,ongoing_id,city_id){
if(confirm('Are you sure you want to delete?')){
document.location.href='?did='+id+'&ongoing_id='+ongoing_id+'&city_id='+city_id;
}
}
</script>