OverLord Shell

Path : G:/PleskVhosts/jaincensus.com/macciaweb.ultraliant.com/businessforum/
File Upload :
Current File : G:/PleskVhosts/jaincensus.com/macciaweb.ultraliant.com/businessforum/userproduct_photo.php

  <?php 
/*
@Purpose: Add product List
@Author: Rajahree
@CreatedOn: 12 April 2016
@ModifiedOn: 12 April 2016
*/
error_reporting(0);
session_start();

include("db/conn.php");
include_once("headerdash.inc.php");
//include_once("banner.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");}


$pagename=substr(basename($_SERVER['PHP_SELF']),0,-4);
$webpagetitle="Product Photos";

if(isset($_GET['id']))
{
	$id = base64_decode($_GET['id']);
}
$_SESSION['product_id'] = (!empty($id))? base64_decode($_GET['id']):$_SESSION['product_id'];
$arrinfo = getData('busdir_product_photo','product_id',$_SESSION['product_id'],'count(*) as cnt',' and active="y" and deleted="n"');

?>
			<?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-top: 1%; margin-right: 2%;">Add New<i class="fa fa-plus mlm"></i></a>
            <?php }?>
            <a href="userproduct.php" class="btn btn-info pull-right mrm" style="margin-top: 1%;><i class="fa fa-angle-left mrm"></i>Go Back</a>
            
        <!--BEGIN CONTENT-->
        <div class="page-content">
            <div class="row">
               
                 <div class="col-md-8" style="width: 72.666667%;">
                    <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">&times;</button>
                                <?php if($_GET['msg']=='add_success'){?>Added Successfully!!!<?php }?>
                                <?php if($_GET['msg']=='update_success'){?>Updated Successfully!!!<?php }?>
                                <?php if($_GET['msg']=='delete_success'){?>Record deleted Successfully<?php }?>
                                <?php if($_GET['msg']=='default_success'){?>Record status changed Successfully<?php }?>
                            </div>
                            <?php }?>
                            <div class="table-responsive">
                                <table class="table table-striped table-hover" id="dataTables-listing">
                                    <thead>
                                        <tr>
                                            <th>Photo Name</th>
                                             <?php if(in_array($_SESSION['loggedin_user'],array('admin','company'))){?>
                                            <th class="text-center">View</th>
                                 
                                           <?php /*?> <th class="text-center">Edit</th><?php */?>
                                            <th class="text-center">Enable/Disable</th>
                                             <?php if($arrinfo['cnt']!=1){?>  <th class="text-center">Delete</th><?php } ?>
                                            <?php }?>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php
										//echo "SELECT photo_path FROM `busdir_product_photo` WHERE product_id = ".$_SESSION['product_id']." AND deleted = 'n'";exit;
                                      $listq="SELECT * FROM `busdir_product_photo` WHERE product_id = ".$_SESSION['product_id']." AND deleted = 'n'";
									// echo $listq;exit;
                                        $listr=$connection->query($listq);
                                        while($listrow=$listr->fetch_assoc()){
                                        ?>
                                   
                                        <tr>
                                            <td><?php echo $listrow['photo_path']?></td>
                                            <td class="text-center"><a href="uploads/products/<?php echo $listrow['photo_path'];?>" class="btn btn-info btn-sm fancybox">View<i class="fa fa-eye mlm"></i></a></td>
                                            
                                            
                                           
                                            <?php if(in_array($_SESSION['loggedin_user'],array('admin','company'))){?>
                                        
                                            <?php /*?><td class="text-center"><form><button type="submit" name="id" value="<?php echo base64_encode($listrow['photo_id'])?>" formaction="<?php echo $pagename?>edit.php" class="btn btn-primary btn-sm">Edit<i class="fa fa-pencil mlm"></i></button></form></td>
        <?php */?>                              <?php if($listrow['mycatlog']!='y'){?>
                                            <td class="text-center"><button type="button" value="<?php echo $listrow['photo_id']?>" class="btn btn-sm btn-<?php if($listrow['active']!='n')echo "danger";else echo "success"?> delbtn"><?php if($listrow['active']=='n')echo 'Enable<i class="fa fa-check mlm"></i>';else echo 'Disable<i class="fa fa-close mlm"></i>'?></button></td>
                                             <?php }else{?><td class="text-center"><button type="button" class="btn btn-sm btn-success Disable<i class="fa fa-close mlm"></i>Default</button></td>

											 <?php }?>
                                              <?php if($listrow['mycatlog']!='y'){?>
                                               <?php if($arrinfo['cnt']!=1){?> <td class="text-center"><button type="button" value="<?php echo $listrow['photo_id']?>" class="recyclebtn btn btn-sm btn-warning ">Delete<i class="fa fa-trash-o mlm"></i></button></td><?php }?>
											<?php }else{?><td class="text-center"><button type="button" class="btn btn-sm btn-success Disable<i class="fa fa-close mlm"></i>Default</button></td>

											 <?php }?>
											<?php }?>
                                        </tr>
                                        <?php }$listr->free()?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--END CONTENT-->
<link type="text/css" rel="stylesheet" href="css/jquery.fancybox.css">
<script src="js/jquery.fancybox.pack.js"></script>

<script type="text/javascript">
	$(document).ready(function() {
		$(".fancybox").fancybox();
	});

</script>
<link type="text/css" rel="stylesheet" href="css/jquery.fancybox.css">
<script src="js/jquery.fancybox.pack.js"></script>
<link type="text/css" rel="stylesheet" href="css/dataTables/dataTables.bootstrap.min.css">

<script src="js/dataTables/dataTables.bootstrap.min.js"></script>
<script src="js/validate.js"></script>

<script>$('#dataTables-listing').dataTable();
$(document).ready(function () {
	if($('#msg').text() != "")
	{
		setTimeout(function () {
			$('#msg').hide();
			}, 5000);
			var query = window.location.search.substring(1)
			
			if(query.length) {
			if(window.history != undefined && window.history.pushState != undefined) {
			window.history.pushState({}, document.title, window.location.pathname);
			}
		}
	}
});
$('.fancybox').fancybox();
</script>

<?php include("footer.inc.php")?>

xRyukZ - Copyright 2k19