OverLord Shell
<?php session_start();
include("db/conn.php");
include_once("headerdash.inc.php");
//include_once("banner.inc.php");
include("sidebar.php");
$pagename=substr(basename($_SERVER['PHP_SELF']),0,-4);
$webpagetitle="News";
if(!isset($_SESSION['company_id']) || !isset($_SESSION['company_name'])){session_destroy();header("location:login.php");}
$_SESSION['company_id'] = (empty($_SESSION['company_id'])) ? base64_decode($_GET['id']) : $_SESSION['company_id'];
$arrinfo = getData('busdir_mst_news','company_id',$_SESSION['company_id'],null,null);?>
<!--BEGIN CONTENT-->
<div class="page-content">
<div class="row ">
<div class=" col-md-8">
<div class="panel">
<div class="panel-body"
style="margin-right: -12%;
margin-left: -2%;">
<fieldset><legend><h3 style="color: #eb2c33; padding-bottom: 3%;"><?php
echo $webpagetitle ?></h3>
<a href="<?php echo $pagename?>add.php" class="btn btn-primary pull-right" style="margin-right: 1%; margin-top: -6%;"">Add New<i class="fa fa-plus mlm"></i></a></legend>
<?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-hover" id="dataTables-listing">
<thead>
<tr style="width: 93px;">
<th>#</th>
<th class="text-center">photo</th>
<th>Description</th>
<th>Date & Time</th>
<th class="text-center">Edit</th>
<th class="text-center">Enable / Disable</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$listq="SELECT * from busdir_mst_news where (active='y' or company_id='".$_SESSION['company_id']."' )order by createdon desc";
$listr=$connection->query($listq);
while($listrow=$listr->fetch_assoc()){
if($listrow==''){
?>
<tr> <td colspan=8></td> </tr> <?php }else {?>
<tr>
<td><?php echo $i;?></td>
<td class="text-center"><a href="uploads/news/<?php echo $listrow['photo']?>" class="btn btn-info btn-sm fancybox">View<i class="fa fa-eye mlm"></i></a></td>
<?php $srt=$listrow['about'];?>
<?php /*?> <td><?php echo substr($srt, 0, 20)."";?></td><?php */?>
<td class=""><a href="<?php echo $pagename?>_view.php?id=<?php echo base64_encode($listrow['news_id'])?>" class="btn btn-warning btn-sm fancyboxajax">View<i class="fa fa-eye mlm"></i></a></td>
<td><?php echo date('d-M-Y H:i ',strtotime($listrow['createdon']))?></td>
<td class="text-center"><form><button type="submit" name="id" value="<?php echo base64_encode($listrow['news_id'])?>" formaction="<?php echo $pagename?>edit.php?id=<?php echo base64_encode($listrow['news_id'])?>" class="btn btn-primary btn-sm" <?php if($listrow['company_id']!=$_SESSION['company_id']){echo "disabled";}?>>Edit<i class="fa fa-pencil mlm"></i></button></form></td>
<td class="text-center"><button type="button" value="<?php echo $listrow['news_id']?>" class="btn btn-sm btn-<?php if($listrow['active']!='n')echo "danger";else echo "success"?> delbtn" <?php if($listrow['company_id']!=$_SESSION['company_id']){echo "disabled";}?>><?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>
</tr>
<?php }?>
<?php $i++; }$listr->free()?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<!--END CONTENT-->
<link type="text/css" rel="stylesheet" href="css/dataTables/dataTables.bootstrap.min.css">
<script src="js/dataTables/jquery.dataTables.min.js"></script>
<script src="js/dataTables/dataTables.bootstrap.min.js"></script>
<link href="css/jquery.fancybox.css" rel="stylesheet">
<script src="js/jquery.fancybox.pack.js"></script>
<script src="js/validate.js"></script>
<script>
$('#dataTables-listing').dataTable( {
"bSort": false
} );
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']?>');}}
}
$('.fancybox').fancybox();
$('.fancyboxajax').fancybox({ 'type':'ajax' });
</script>
<?php $connection->close();include("footer.inc.php")?>
xRyukZ - Copyright 2k19