OverLord Shell
<?php session_start();
include("db/conn.php");
include_once("header.inc.php");
include("sidebar.php");
if(!isset($_SESSION['company_id']) || !isset($_SESSION['company_name'])){session_destroy();header("location:login.php");}
if(!in_array($_SESSION['loggedin_user'],array('admin','company'))){
header("location:404.php");
}
$_SESSION['company_id'] = (empty($_SESSION['company_id'])) ? base64_decode($_GET['id']) : $_SESSION['company_id'];
$pagename=substr(basename($_SERVER['PHP_SELF']),0,-4);
$webpagetitle="Company Location";
?>
<?php if(in_array($_SESSION['loggedin_user'],array('admin','company'))){ ?>
<a href="<?php echo $pagename?>add.php" class="btn btn-primary pull-right" style="margin-right: 4%; margin-top: 1%;">Add New<i class="fa fa-plus mlm"></i></a>
<?php }?>
<?php if($_SESSION['loggedin_user'] == 'admin') {?>
<a href="company.php" class="btn btn-info mrm pull-right"><i class="fa fa-angle-left mrm"></i>Go Back</a>
<?php
}
?>
<!--BEGIN CONTENT-->
<div class="page-content">
<div class="row">
<div class="col-md-8">
<div class="panel">
<div class="panel-body">
<?php if(!empty($_GET['msg']) && strpos($_GET['msg'],'success')!=FALSE){?>
<div class="note note-success note-dismissable" id="msg">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php if($_GET['msg']=='add_success'){?>Record added Successfully!!!<?php }?>
<?php if($_GET['msg']=='update_success'){?>Record updated Successfully!!!<?php }?>
<?php if($_GET['msg']=='delete_success'){?>Record deleted Successfully!!!<?php }?>
</div>
<?php }?>
<div class="table-responsive">
<table class="table table-striped table-hover" id="dataTables-listing">
<thead>
<th>#</th>
<th>Address</th>
<th>State</th>
<th>City</th>
<th class="text-center">Edit</th>
<th class="text-center">Enable / Disable</th>
<th class="text-center">Delete</th>
</thead>
<tbody>
<?php
$i=1;
//$editrow = getData('busdir_mst_company_location','company_id',$_SESSION['company_id'],null,null);
// print_r($editrow);
// foreach($editrow as $row){
$sql="SELECT `location_id`,`company_address`,`company_state`,`company_district` FROM `busdir_mst_company_location` WHERE `company_id`=".$_SESSION['company_id'];
$getdata = $connection->query($sql);
while($row=$getdata->fetch_assoc()){
?>
<tr>
<th><?php echo $i;?></th>
<td><?php echo ucfirst($row['company_address']); ?></td>
<td><?php echo ucfirst($row['company_state']); ?></td>
<td><?php echo ucfirst($row['company_district']) ;?></td>
<td class="text-center">
<form>
<input type="hidden" name="id" value="<?php echo base64_encode($row['location_id']);?>" readonly>
<button type="submit" formaction="locationedit.php" class="btn btn-primary btn-sm">Edit<i class="fa fa-pencil mlm"></i></button>
</form>
</td>
<td class="text-center"><button type="button" value="<?php echo $row['location_id']?>" class="btn btn-sm btn-<?php if($listrow['active']!='n')echo "danger";else echo "success"?> delbtn"><?php if($listrow['active']=='n')echo 'Make Enable<i class="fa fa-check mlm"></i>';else echo 'Make Disable<i class="fa fa-close mlm"></i>'?></button></td>
<td class="text-center"><button type="button" value="<?php echo $row['location_id'];?>" class="btn btn-sm btn-warning recyclebtn">Delete<i class="fa fa-trash-o mlm"></i></button></td>
</tr>
<?php
$i++;}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!--END CONTENT-->
<link type="text/css" rel="stylesheet" href="css/dataTables/dataTables.bootstrap.min.css">
<script src="js/validate.js"></script>
<script src="js/dataTables/dataTables.bootstrap.min.js"></script>
<script>
$('#dataTables-listing').dataTable();
if($('#msg').html()!==''){
setTimeout(function(){$('#msg').hide();},5000);
if(location.search.substring(1).length){if(history!==undefined && history.pushState!==undefined){history.pushState({}, document.title, location.pathname+'<?php if(isset($_GET['id']))echo "?id=".$_GET['id']?>');}}
}
</script>
<?php $connection->close();include("footer.inc.php")?>
xRyukZ - Copyright 2k19