File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/livable-cities/Conf2017admin/complaint.php
<?php
include("web_include_files/conn.php");
session_start();
if($_SESSION['email']==""){
header("location:login.php");
}
$refer_code = $_REQUEST['id'];
if($_REQUEST['id']){
echo $_REQUEST['status'];
$status=$_REQUEST['status'];
if($status=='0'){
$row = mysql_query("update tbl_enquiry SET fld_status='1' where fld_id='".$refer_code."'");
}
else{
$row = mysql_query("update tbl_enquiry SET fld_status='0' where fld_id='".$refer_code."'");
}
if($row){
echo "<script>alert('Status Changed Successfully')</script>";
header("Refresh:4; url=complaint.php");;
}
}
if(isset($_REQUEST['delid'])){
$id = $_REQUEST['delid'];
$sql1 = mysql_query("delete from tbl_enquiry where fld_id='".$id."'") or die(mysql_error());
echo "<script>alert('data Deleted Successfully')</script>";
header("Refresh:3; url=complaint.php");;
}
?>
<!-- header logo: style can be found in header-->
<?php include("web_include_files/css_links.php");?>
<script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$('.delete_data').click(function(){
var id = $(this).attr("id");
$.ajax({
url:"ajax_regist_user.php",
method:"post",
data:{compl:id},
success:function(data){
alert(data);
$(".blog").css({display: "block"});
setTimeout(function() {
window.location.href = "complaint.php"
}, 4000);
}
});
});
});
</script>
<header class="header">
<?php include("web_include_files/header.php");?>
</header>
<div class="wrapper row-offcanvas row-offcanvas-left">
<!-- Left side column. contains the logo and sidebar -->
<?php include("web_include_files/navigation.php"); ?>
<aside class="right-side">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="header-data">
<h1>Complain List</h1>
<p></p>
</div>
</div>
<div class="col-lg-12 blog" style="display:none;">
<div class='alert alert-danger alert-dismissible'><a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<strong>Success!</strong>Enquiry Deleted successfully</div>
</div>
<div class="col-md-6 col-xs-6">
</div>
</div>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">
<i class="fa fa-fw fa-table"></i>Complaint User Details
</h3>
<span class="pull-right">
<i class="fa fa-fw fa-chevron-up clickable"></i>
<i class="fa fa-fw fa-times removepanel clickable"></i>
</span>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="sample_1">
<thead>
<tr class="filters">
<th width="5">SNO.</th>
<th>Complaint Id</th>
<th>Name</th>
<th>Email</th>
<th>Mobile No</th>
<th>Address</th>
<th>Net Id</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$x=1;
$query = mysql_query("select * from tbl_enquiry Order by fld_id desc");
while($sql = mysql_fetch_array($query)){
?>
<tr>
<td><?php echo $x;?></td>
<td><?php echo $sql['fld_complaintid'];?></td>
<td><?php echo $sql['fld_name'];?></td>
<td><?php echo $sql['fld_email'];?></td>
<td><?php echo $sql['fld_mobile'];?></td>
<td><?php echo $sql['fld_address'];?></td>
<td><?php echo $sql['fld_netid'];?></td>
<td>
<?php
if($sql['fld_status']=='0'){
echo "<a href='complaint.php?id=$sql[fld_id]&status=0'><button class='btn btn-danger'>New Enquiry</button></a>";
}
else if($sql['fld_status']=='1'){
echo "<a href='complaint.php?id=$sql[fld_id]&status=1'><button class='btn btn-success'>Completed</button></a>";
}
?>
</td>
<td>
<a href="complaint.php?delid=<?php echo $sql['fld_id'];?>" ><i class='fa fa-fw fa-times text-danger actions_icon' title='Delete User'></i>
</a>
</td>
</tr>
<?php $x++;} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- First Basic Table Ends Here-->
<!-- Second Data Table Starts Here-->
</section>
<!-- /.content -->
<div id="basic_modal" class="modal fade animated" role="dialog">
<div class="modal-dialog">
<form role="form" method="post" action="view_clients.php" enctype="multipart/form-data">
<div class="modal-content" id="employee_detail">
</div>
</form>
</div>
</div>
</aside>
<!-- /.right-side -->
</div>
<!-- ./wrapper -->
<!-- global js -->
<script src="js/app.js" type="text/javascript"></script>
<!-- end of global js -->
<!-- begining of page level js -->
<script type="text/javascript" src="vendors/datatables/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="vendors/datatables/js/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="js/custom_js/datatables_custom.js"></script>
<!-- end of page level js -->
</body>
</html>