OverLord Shell
<?php session_start();
include("db/conn.php");
include_once("headerdash.inc.php");
include("sidebar.php");
//if(!isset($_SESSION['id']) || !isset($_SESSION['company_name'])){session_destroy();header("location:login.php");}
if(!in_array($_SESSION['loggedin_user'],array('admin','company'))){
header("location:404.php");
}else
$companyid = (!empty($_SESSION['company_id'])) ? $_SESSION['company_id'] : null;
$pagename=substr(basename($_SERVER['PHP_SELF']),0,-4);
$webpagetitle="Product";
unset($_SESSION['product_id']);
$cont=0;
$listrow=getData("busdir_mst_all_company","company_id",$companyid,"","and deleted='n'");
$cntlist=getData("busdir_mst_all_company","company_id",$companyid,"count(*) as ab","and deleted='n'");
//print_r($listrow);
//echo $row_cnt = $listrow->num_rows;
$cont=count($listrow);
//echo $cntlist['ab'];
//echo $cont;
//print_r($_SESSION);?>
<?php
$listq="SELECT * FROM `busdir_mst_all_company` WHERE company_id=$companyid and deleted='n' ";
if($_SESSION['loggedin_user']=='company')$listq.=" AND company_id=".$_SESSION['company_id'];
$listr=$connection->query($listq);
$asd= $listr->num_rows;
$listrowx=$listr->fetch_assoc();
if($asd==0){
?>
<a href="<?php echo $pagename?>add.php" class="btn btn-primary pull-right"style=" margin-right: 4%; margin-top: 1%;margin-bottom: 1%;">Add New<i class="fa fa-plus mlm"></i></a>
<?php
}else
{ ?>
<script>
window.setTimeout(function(){
// Move to a new location or you can do something else
window.location.href = "compdash.php?id=<?php echo base64_encode($listrowx['my_company_id'])?>";
});
</script>
<?php } /* if($_SESSION['plans']==3){?>
<a href="<?php echo $pagename?>add.php" class="btn btn-primary pull-right"style=" margin-right: 4%; margin-top: 1%;margin-bottom: 1%;">Add New<i class="fa fa-plus mlm"></i></a>
<?php } else{
if($cont==0){?>
<a href="<?php echo $pagename?>add.php" class="btn btn-primary pull-right"style=" margin-right: 4%; margin-top: 1%;margin-bottom: 1%;">Add New<i class="fa fa-plus mlm"></i></a>
<?php }else{?>
<a href="plansadd.php?msg=upgrade" class="btn btn-primary pull-right"style=" margin-right: 4%; margin-top: 1%;margin-bottom: 1%;">Add New<i class="fa fa-plus mlm"></i></a>
<?php } }?><?php */?>
<!--BEGIN CONTENT-->
<div class="page-content">
<div class="row">
<div class="col-md-8">
<h2>Redirecting to Your Business Profile...</h2><br/>
<div class="row">
<div class="col-md-4">
<!-- <form>
<button type="submit" name="id" id="edit" value="<?php //echo base64_encode($editrow['my_company_id'])?>" formaction="contactdocs.php" class="btn btn-info btn-sm" style="float: left; margin-top: -2%;">My Documents<i class="fa fa-eye mlm"></i></button></form> -->
</div>
<div class="col-md-4">
<form>
<!-- <button type="submit" name="id" id="edit" value="<?php //echo base64_encode($editrow['my_company_id'])?>" formaction="contactpayment.php" class="btn btn-info btn-sm" style="float: left; margin-top: -2%;">My Membership Payments<i class="fa fa-eye mlm"></i></button></form> -->
</div>
<div class="col-md-3">
</div>
</div>
</div>
<div class="col-md-8" style="width: 72.666667%;">
<div class="panel">
<div class="panel-body">
<?php if($_GET['msg']!='add_success1'){?>
<?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 }?>
<?php /*?> <?php if($_GET['msg']=='add_success1'){?>Login Successfully<?php }?><?php */?>
</div>
<?php }}?>
<div class="table-responsive">
<table class="table table-hover" id="dataTables-listing">
<thead>
<th>Company Name</th>
<th>Country</th>
<th>Website</th>
<th>No Of Products</th>
<th class="text-center">View</th>
<th class="text-center">Enable / Disable</th>
<?php if($cntlist['ab']!=1){ ?>
<th class="text-center">Delete</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php
while($listrow=$listr->fetch_assoc()){
if($listrow==''){
?> <tr> <td colspan=8></td> </tr> <?php }else {?>
<tr>
<td><?php echo $listrow['company_name']?></td>
<td><?php echo $listrow['company_country']?></td>
<td><?php echo $listrow['company_website']?></td>
<?php $my_comp= $listrow['my_company_id'];
//echo "SELECT * FROM `busdir_product` WHERE `my_company_id`='".$my_comp."' and active='y' and deleted='n'";
$sqlcat=$connection->query("SELECT * FROM `busdir_product` WHERE `my_company_id`='".$my_comp."' and active='y' and deleted='n'");
$row_cnt = $sqlcat->num_rows;
?>
<td><a href="userproduct.php?id=<?php echo base64_encode($listrow['my_company_id'])?>" ><?php echo $row_cnt ?> </a></td>
<?php if(in_array($_SESSION['loggedin_user'],array('admin','company'))){?>
<td class="text-center"><form><button type="submit" name="id" value="<?php echo base64_encode($listrow['my_company_id'])?>" formaction="compdash.php" class="btn btn-primary btn-sm">View<i class=" mlm"></i></button></form></td>
<?php /*?><td class="text-center"><form><button type="submit" name="id" value="<?php echo base64_encode($listrow['product_id'])?>" formaction="<?php echo $pagename?>edit.php" class="btn btn-primary btn-sm">View<i class="fa fa-pencil mlm"></i></button></form></td><?php */?>
<td class="text-center"><button type="button" value="<?php echo $listrow['my_company_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">
<?php /*?> <?php
$sql=$connection->query("SELECT t2.product_id FROM busdir_mst_all_company AS t1 JOIN busdir_product AS t2 ON t1.my_company_id = t2.my_company_id where and t1.company_id=$companyid and t1.my_company_id=".$id );
//echo $sql;exit;
$connection->close();
if($sql){
?><?php */?> <?php if($cntlist['ab']!=1){ ?>
<button type="button" value="<?php echo $listrow['my_company_id']?>" class="recyclebtn btn btn-sm btn-warning ">Delete<i class="fa fa-trash-o mlm"></i></button></td>
<?php }
?>
<?php }?>
</tr>
<?php }?>
<?php }$listr->free()?>
</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/dataTables/jquery.dataTables.min.js"></script>
<script src="js/dataTables/dataTables.bootstrap.min.js"></script>
<script src="js/validate.js"></script>
<script>
//$('#dataTables-listing').dataTable();
$('#dataTables-listing').dataTable( {
"bSort": false
} );
</script>
<script>
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