OverLord Shell
<?php session_start();
include("db/conn.php");
include("headerdash.inc.php");
include("sidebar.php");
$actv=$_SESSION['plans'];
// send comm enquiry-> where log in user have cat or subcat which get comm enquiry
// recive comm enquiry ->where
$_SESSION['company_id'] = (empty($_SESSION['company_id'])) ? base64_decode($_GET['id']) : $_SESSION['company_id'];
$pagename=substr(basename($_SERVER['PHP_SELF']),0,-4);
$webpagetitle="General Enquiry";
?>
<?php if(in_array($_SESSION['loggedin_user'],array('admin','company'))){ ?>
<form>
<!--BEGIN CONTENT-->
<div class="page-content">
<div class="row">
<div class="col-md-8">
<div class="panel-body"
style="margin-right: -12%;
margin-left: -2%;">
<fieldset><legend> <h3 style="color: #eb2c33; padding-bottom: 3%;"><?php
echo $webpagetitle ?></h3>
<?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
}
?></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-striped table-hover" id="dataTables-listing">
<thead>
<tr> <th> # </th><th>Category Name </th>
<th>Subcategory Name </th>
<th>name</th>
<th>Mobile</th>
<th>Email</th>
<th>Date & time</th>
<th class="text-center">Message</th>
<!-- <th class="text-center">Product Link</th>-->
</tr>
</thead>
<tbody>
<?php
$listq="SELECT * FROM busdir_mst_product_enquiry where (enq_from='c' or enq_from='s') and comm_id IS NOT NULL and enq_from IS NOT NULL order by createdon desc
";$i=1;
$listr=$connection->query($listq);
while($listrow=$listr->fetch_assoc()){
if($listrow==''){
?>
<tr> <td colspan=8></td> </tr> <?php }else {?>
<?php
if($listrow['enq_from']=='c'){
// $qu="SELECT * FROM busdir_mst_category t1 INNER JOIN busdir_product t2 ON t1.catid=t2.catid where t1.catid='".$listrow['comm_id']."' ";
$qu="SELECT t1.categoryname,t1.catid FROM busdir_mst_category t1 INNER JOIN busdir_product t2 ON t1.catid=t2.catid where t1.catid='".$listrow['comm_id']."' and t2.company_id='".$_SESSION['company_id']."'";
}if($listrow['enq_from']=='s'){
//$qu="SELECT t1.*,t2.categoryname FROM `busdir_mst_subcategory` t1 INNER JOIN `busdir_mst_category` t2 ON t1.catid=t2.catid where t1.subcatid='".$listrow['comm_id']."' ";
$qu="SELECT t2.categoryname,t2.catid,t1.subcategoryname,t1.subcatid FROM `busdir_mst_subcategory` t1 INNER JOIN `busdir_mst_category` t2 ON t1.catid=t2.catid INNER JOIN busdir_product t3 ON t3.catid=t2.catid where t1.subcatid='".$listrow['comm_id']."' and t3.company_id='".$_SESSION['company_id']."'";
}
//echo "11";exit;
$listc=$connection->query($qu);
$listrowc=$listc->fetch_assoc();
if(count($listrowc)!=0){?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo $listrowc['categoryname']?></td>
<td><?php echo $listrowc['subcategoryname']?></td>
<td><?php echo $listrow['name']?></td>
<td> <?php echo $listrow['phone']?></td>
<td><?php echo $listrow['email']?></td>
<td><?php echo date('d-M-Y H:i a',strtotime($listrow['createdon']))?></td>
<td class="text-center"><a href="<?php echo $pagename?>_view.php?id=<?php echo base64_encode($listrow['enquiry_id'])?>" class="btn btn-warning btn-sm fancyboxajax">View<i class="fa fa-eye mlm"></i></a></td>
<!--<td class="text-center"><a href="product.php?id=<?php echo base64_encode($listrow['product_id'])?>" target="blank"class="btn btn-success btn-sm ">View<i class="fa fa-pencil-square-o mlm"></i></a></td>-->
</tr>
<?php }} ?>
<?php $i++;}$listr->free()?>
</tbody>
</table>
</div>
</fieldset>
</div></div></div>
</div>
</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
} );
$('#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']?>');}}
}
$('.fancyboxajax').fancybox({type:'ajax'});
</script>
<?php $connection->close();include("footer.inc.php")?>
xRyukZ - Copyright 2k19