Professional Documents
Culture Documents
A2 - 4 - Complaint Management System
A2 - 4 - Complaint Management System
A2 - 4 - Complaint Management System
BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE AND ENGINEERING
Submitted by
Mr. B. ANIL
(20B95A0501)
BHIMAVARAM
CERTIFICATE
This is to certify that this is a bonafide work on “Complaint Management System” and has
been submitted by Mr. G. SRI HARSHA (19B91A0560), in partial fulfillment of the
requirements for the award of the degree of Bachelor of Technology in Computer Science
and Engineering, during the academic year 2020-2021. The candidate worked right under my
Supervision and guidance.
S DESCRIPTION PAGE.NO.
.No.
MODULES 1
1.
4. DATABASE CONNECTIVITY 5
5. OUTPUT SCREENS 7
6. CODE 11
ABSTRACT
The project titled Complaint Management System is Complaint management software for
the purpose of monitoring and controlling the Complaints that are raised by the users.
Complaint Management System allows the user to register the complaint, monitoring the
status of complaint and the action taken on the complaint by the admin. This project on the
Complaintmanagement system gives us the complete information about the registering the
complaints and the daily actions taken on the raised complaints for the users need. In this
system the admin can add new states, categories and sub categories and manage them
easily. It is a user friendly software system. The admin has access to delete the user
accounts. The admin has access to tale action on the complaints raised by the users from
their user accounts and return the status of the complaints to the user accounts.
In this project we have developed a new approach in the complaint management system
which is able to transfer the facilities like login user, registration of new user, registering the
complaints, taking action on the complaints and returning the status of the complaints.
The user will find it easy in the automated system rather than using the manual writing
system. The system contains a database where all the information will be stored safely.
1
1. MODULES
1.1 ADMIN MODULE:
Registration
1. All fields are required for registration
2. Registration success
3. Update details of user into data base
Authentication
1. Email and password from registered data
2. If true goes to another page if wrong shows error.
3. Verifies the credentials with database and logs in if true
In this module user can manage their profiles and also can update them. In this module the
user has to enter the details of the user to update their profile.
In this module the user has to raise the complaint with the specific details. The user has to
enter all the details needed about the complaint.
This module gives the details of user raised complaints with complaint number, registration
date, last update date, status and action.
In this module admin can manage complaints. They are divided into three categories. They
are
2. Pending Complaints.
3. Closed Complaints.
The Admin can check and manage the all user login and logout details status of user login
and logout details with their timings.
2.1 PURPOSE
In this project, the admin can easily check the complaints and process the complaints and
return their status to the users by processing them. The main theme of the project is to save
the time for the registration and solving of the complaints. By this we can reduce the manual
work. The admin will maintain all the details of the users and their login and logout status
with their timings.
2.2 SCOPE
The scope of this project is to solve the problem of time complexity to the user and also to
the admin.
2.3 OBJECTIVE
The main objective of this project is to make the complaint registration easy,reduce the time
and to maintain the registered complaints.
In the existing complaint management system, it is difficult for both the admin and the user
that they should have to register the complaints manually and managing them is difficult. The
admin has to update the information manually. Thisexisting system wastes time, to reduce
this we implement this system. Here the user once register in this system the admin can check
the availability of the users and can able to check the login and logout details of the user
account.
Drawbacks:
The proposed system of this project contains the admin,user, complaint registration and
complaint status.Here many of the users can be assumed but the admin is unique. The admin
3
has to complete the process of the raised complaint by the user and return the status of
complaint to the user.
Advantages
Analysis focuses on producing a model of the system called the analysis model, which is
correct, complete, consistent and verifiable. Analysis model is composed mainly of three
individual models.
Functional model
Analysis object model
Analysis dynamic model
The functional model represents the use of case diagrams, the object model with class
diagram and the dynamic model with state chart and sequence diagrams.
Non-functional requirements are the limitations or constraints under which the system should
provide its services to users. Following are the nonfunctional requirements for library
management system.
2.8.1 RELIABLITY
This system is more reliable and effective because of the quality of service to the user .
2.8.2 COST
2.8.3 PERFORMANCE
4
This system is developed in the high-level languages front end using html and php back end
using mysql. It will give response to the end with in the least time.
2.8.4 SUPPORTABILITY
2.8.5 SECURITY
This system provides high secured data. Only admin can view, alter the user data. This avoids
the non-authorized users access the system.
3. DATABASE CONNECTIVITY
Name Type
Id Int(20)
Username Varchar(200)
Password Varchar(200)
Updationdate Varchar(200)
Name Type
id Int(20)
fullname Varchar(200)
password Varchar(200)
useremail Varchar(200)
contactno Int(30)
address Text
state Varchar(200)
country Varchar(200)
pincode Int(20)
userimage Varchar(200)
regdate Timestamp
updationdate Timestamp
status Int(10)
Name Type
Id Int(20)
Uid Int(20)
Username Varchar(200)
Logintime Timestamp
Logout Varchar(200)
Status Int(10)
Table 3.4: STATE DATA
Name Type
Id Int(20)
Statename Varchar(200)
Statedescription Text
postingdate Timestamp
updationdate Timestamp
6
Name Type
id Int(20)
categoryname Varchar(200)
categorydescription Text
creationdate Timestamp
updationdate Timestamp
Name Type
id Int(20)
categoryid Int(20)
subcategory Varchar(200)
creationdate Timestamp
updationdate Timestamp
Table 3.7: COMPLAINTREMARK DATA
Name Type
id Int(20)
complaintnumber Int(20)
status Varchar(200)
remark Text
remarkdate Timestamp
Table 3.7: COMPLAINTS DATA
Name Type
userid Int(20)
complaintnumber Int(20)
category Int(20)
subcategory Varchar(200)
complainttype Varchar(200)
state Varchar(200)
status Varchar(200)
complaintdetails Text
complaintfile Varchar(200)
regdate Timestamp
lastupdatedate Timestamp
7
4. OUTPUTSCREENS
Fig.4.3:UserLogin Page
1. CODE
Admin.php
<?php
session_start();
include('include/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
?>
<script language="javascript" type="text/javascript">
function f2()
{
window.close();
}ser
function f3()
{
window.print();
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>User Profile</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="anuj.css" rel="stylesheet" type="text/css">
</head>
<body>
<div style="margin-left:50px;">
<form name="updateticket" id="updateticket" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
$ret1=mysqli_query($con,"select * FROM users where id='".$_GET['uid']."'");
while($row=mysqli_fetch_array($ret1))
{
?>
<tr>
<td colspan="2"><b><?php echo $row['fullName'];?>'s profile</b></td>
</tr>
<tr>
<td > </td>
<td > </td>
</tr>
<tr height="50">
<td><b>Reg Date:</b></td>
<td><?php echo htmlentities($row['regDate']); ?></td>
</tr>
<tr height="50">
14
<td><b>User Email:</b></td>
<td><?php echo htmlentities($row['userEmail']); ?></td>
</tr>
<tr height="50">
<td><b>User Contact no:</b></td>
<td><?php echo htmlentities($row['contactNo']); ?></td>
</tr>
<tr height="50">
<td><b>Address:</b></td>
<td><?php echo htmlentities($row['address']); ?></td>
</tr>
<tr height="50">
<td><b>State:</b></td>
<td><?php echo htmlentities($row['State']); ?></td>
</tr>
<tr height="50">
<td><b>Country:</b></td>
<td><?php echo htmlentities($row['country']); ?></td>
</tr>
<tr height="50">
<td><b>Pincode:</b></td>
<td><?php echo htmlentities($row['pincode']); ?></td>
</tr>
<tr height="50">
<td><b>Last Updation:</b></td>
<td><?php echo htmlentities($row['updationDate']); ?></td>
</tr>
<tr height="50">
<td><b>Status:</b></td>
<td><?php if($row['status']==1)
{ echo "Active";
} else{
echo "Block";
}
?></td>
</tr>
<tr>
<td colspan="2">
<input name="Submit2" type="submit" class="txtbox4" value="Close this window " onClick="return
f2();" style="cursor: pointer;" /></td>
</tr>
<?php }
?>
</table>
</form>
</div>
</body>
</html>
<?php } ?>
Userlogs.php
<?php
session_start();
include('include/config.php');
15
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin| Users log</title>
<link type="text/css" href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
<link type="text/css" href="css/theme.css" rel="stylesheet">
<link type="text/css" href="images/icons/css/font-awesome.css" rel="stylesheet">
<link type="text/css" href='http://fonts.googleapis.com/css?
family=Open+Sans:400italic,600italic,400,600' rel='stylesheet'>
</head>
<body>
<?php include('include/header.php');?>
<div class="wrapper">
<div class="container">
<div class="row">
<?php include('include/sidebar.php');?>
<div class="span9">
<div class="content">
<div class="module">
<div class="module-head">
<h3>Manage Users</h3>
</div>
<div class="module-body table">
<table cellpadding="0"
cellspacing="0" border="0" class="datatable-1 table table-bordered table-striped display"
width="100%">
<thead>
<tr>
<th>#</th>
<th> User
Email</th>
<th>User IP
</th>
<th>Login
Time</th>
<th>Logout
Time </th>
<th>Status
</th>
</tr>
</thead>
<tbody>
16
if($st==1)
{
echo "Successfull";
}
else
{
echo "Failed";
}
?></td>
<?php $cnt=$cnt+1;
} ?>
</table>
</div>
</div>
</div><!--/.content-->
</div><!--/.span9-->
</div>
</div><!--/.container-->
</div><!--/.wrapper-->
<?php include('include/footer.php');?>
<script src="scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="scripts/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="scripts/flot/jquery.flot.js" type="text/javascript"></script>
<script src="scripts/datatables/jquery.dataTables.js"></script>
<script>
$(document).ready(function() {
$('.datatable-1').dataTable();
$('.dataTables_paginate').addClass("btn-group datatable-pagination");
$('.dataTables_paginate > a').wrapInner('<span />');
$('.dataTables_paginate > a:first-child').append('<i class="icon-chevron-left
shaded"></i>');
17
if(isset($_GET['del']))
{
mysqli_query($con,"delete from state where id = '".$_GET['id']."'");
$_SESSION['delmsg']="State deleted !!";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin| State</title>
<link type="text/css" href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
<link type="text/css" href="css/theme.css" rel="stylesheet">
<link type="text/css" href="images/icons/css/font-awesome.css" rel="stylesheet">
<link type="text/css" href='http://fonts.googleapis.com/css?
family=Open+Sans:400italic,600italic,400,600' rel='stylesheet'>
</head>
<body>
<?php include('include/header.php');?>
<div class="wrapper">
<div class="container">
<div class="row">
18
<?php include('include/sidebar.php');?>
<div class="span9">
<div class="content">
<div class="module">
<div class="module-head">
<h3>State</h3>
</div>
<div class="module-body">
<?php
if(isset($_POST['submit']))
{?>
<div class="alert alert-
success">
<button
type="button" class="close" data-dismiss="alert">×</button>
<strong>Well done!
</strong> <?php echo htmlentities($_SESSION['msg']);?><?php echo
htmlentities($_SESSION['msg']="");?>
</div>
<?php } ?>
<?php
if(isset($_GET['del']))
{?>
<div class="alert alert-
error">
<button
type="button" class="close" data-dismiss="alert">×</button>
<strong>Oh snap!</strong>
<?php echo htmlentities($_SESSION['delmsg']);?><?php echo
htmlentities($_SESSION['delmsg']="");?>
</div>
<?php } ?>
<br />
<div class="control-group">
<label
class="control-label" for="basicinput">Description</label>
<div
class="controls">
19
<div class="control-group">
<div
class="controls">
<div class="module">
<div class="module-head">
<h3>Manage States</h3>
</div>
<div class="module-body table">
<table cellpadding="0"
cellspacing="0" border="0" class="datatable-1 table table-bordered table-striped display"
width="100%">
<thead>
<tr>
<th>#</th>
<th>State</th>
<th>Description</th>
<th>Creation date</th>
<th>Last
Updated</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<td><?php
echo htmlentities($row['stateDescription']);?></td>
<td><?php
echo htmlentities($row['postingDate']);?></td>
<td><?php
echo htmlentities($row['updationDate']);?></td>
<td>
<a
href="edit-state.php?id=<?php echo $row['id']?>" ><i class="icon-edit"></i></a>
<a
href="state.php?id=<?php echo $row['id']?>&del=delete" onClick="return confirm('Are you sure you
want to delete?')"><i class="icon-remove-sign"></i></a></td>
</tr>
<?php $cnt=$cnt+1;
} ?>
</table>
</div>
</div>
</div><!--/.content-->
</div><!--/.span9-->
</div>
</div><!--/.container-->
</div><!--/.wrapper-->
<?php include('include/footer.php');?>
<script src="scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="scripts/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="scripts/flot/jquery.flot.js" type="text/javascript"></script>
<script src="scripts/datatables/jquery.dataTables.js"></script>
<script>
$(document).ready(function() {
$('.datatable-1').dataTable();
$('.dataTables_paginate').addClass("btn-group datatable-pagination");
$('.dataTables_paginate > a').wrapInner('<span />');
$('.dataTables_paginate > a:first-child').append('<i class="icon-chevron-left
shaded"></i>');
$('.dataTables_paginate > a:last-child').append('<i class="icon-chevron-right
shaded"></i>');
} );
</script>
</body>
<?php } ?>
Registration.php
<?php
include('includes/config.php');
error_reporting(0);
if(isset($_POST['submit']))
{
$fullname=$_POST['fullname'];
$email=$_POST['email'];
$password=md5($_POST['password']);
$contactno=$_POST['contactno'];
21
$status=1;
$query=mysqli_query($con,"insert into
users(fullName,userEmail,password,contactNo,status)
values('$fullname','$email','$password','$contactno','$status')");
$msg="Registration successfull. Now You can login !";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Dashboard">
<meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive,
Fluid, Retina">
<title>CMS | User Registration</title>
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/style-responsive.css" rel="stylesheet">
<script>
function userAvailability() {
$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'email='+$("#email").val(),
type: "POST",
success:function(data){
$("#user-availability-status1").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>
</head>
<body>
<div id="login-page">
<div class="container">
<h3 align="center" style="color:#fff"><a href="../index.html" style="color:#fff">Complaint
Managent System</a></h3>
<hr />
<form class="form-login" method="post">
<h2 class="form-login-heading">User Registration</h2>
<p style="padding-left: 1%; color: green">
<?php if($msg){
echo htmlentities($msg);
}?>
</p>
<div class="login-wrap">
22
$state=$_POST['state'];
$country=$_POST['country'];
$pincode=$_POST['pincode'];
$query=mysqli_query($con,"update users set
fullName='$fname',contactNo='$contactno',address='$address',State='$state',country='$country',pinco
de='$pincode' where userEmail='".$_SESSION['login']."'");
if($query)
{
$successmsg="Profile Successfully !!";
}
else
{
$errormsg="Profile not updated !!";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Dashboard">
<meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive,
Fluid, Retina">
<title>CMS | User Change Password</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<!--external css-->
<link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="assets/js/bootstrap-datepicker/css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="assets/js/bootstrap-
daterangepicker/daterangepicker.css" />
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/style-responsive.css" rel="stylesheet">
</head>
<body>
<section id="container" >
<?php include("includes/header.php");?>
<?php include("includes/sidebar.php");?>
<section id="main-content">
<section class="wrapper">
<h3><i class="fa fa-angle-right"></i> Profile info</h3>
<!-- BASIC FORM ELELEMNTS -->
<div class="row mt">
<div class="col-lg-12">
<div class="form-panel">
<?php if($successmsg)
{?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Well done!</b><?php echo htmlentities($successmsg);?></div>
<?php }?>
24
<?php if($errormsg)
{?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Oh snap!</b></b><?php echo htmlentities($errormsg);?></div>
<?php }?>
<?php $query=mysqli_query($con,"select * from users where userEmail='".$_SESSION['login']."'");
while($row=mysqli_fetch_array($query))
{
?>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Full Name</label>
<div class="col-sm-4">
<input type="text" name="fullname" required="required" value="<?php echo
htmlentities($row['fullName']);?>" class="form-control" >
</div>
<label class="col-sm-2 col-sm-2 control-label">User Email </label>
<div class="col-sm-4">
<input type="email" name="useremail" required="required" value="<?php echo
htmlentities($row['userEmail']);?>" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Contact</label>
<div class="col-sm-4">
<input type="text" name="contactno" required="required" value="<?php echo
htmlentities($row['contactNo']);?>" class="form-control">
</div>
<label class="col-sm-2 col-sm-2 control-label">Address </label>
<div class="col-sm-4">
<textarea name="address" required="required" class="form-control"><?php echo
htmlentities($row['address']);?></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">State</label>
<div class="col-sm-4">
<select name="state" required="required" class="form-control">
<option value="<?php echo htmlentities($row['State']);?>"><?php echo
htmlentities($st=$row['State']);?></option>
<?php $sql=mysqli_query($con,"select stateName from state ");
while ($rw=mysqli_fetch_array($sql)) {
if($rw['stateName']==$st)
{
25
continue;
}
else
{
?>
<option value="<?php echo htmlentities($rw['stateName']);?>"><?php echo
htmlentities($rw['stateName']);?></option>
<?php
}}
?>
</select>
</div>
<label class="col-sm-2 col-sm-2 control-label">Country </label>
<div class="col-sm-4">
<input type="text" name="country" required="required" value="<?php echo
htmlentities($row['country']);?>" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Pincode</label>
<div class="col-sm-4">
<input type="text" name="pincode" maxlength="6" required="required" value="<?php echo
htmlentities($row['pincode']);?>" class="form-control">
</div>
<label class="col-sm-2 col-sm-2 control-label">Reg Date </label>
<div class="col-sm-4">
<input type="text" name="regdate" required="required" value="<?php echo
htmlentities($row['regDate']);?>" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">User Photo</label>
<div class="col-sm-4">
<?php $userphoto=$row['userImage'];
if($userphoto==""):
?>
<img src="userimages/noimage.png" width="256" height="256" >
<a href="update-image.php">Change Photo</a>
<?php else:?>
<img src="userimages/<?php echo htmlentities($userphoto);?>" width="256" height="256">
<a href="update-image.php">Change Photo</a>
<?php endif;?>
</div>
</div>
<?php } ?>
<div class="form-group">
<div class="col-sm-10" style="padding-left:25% ">
<button type="submit" name="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
26
</div>
</section>
</section>
<?php include("includes/footer.php");?>
</section>
<!-- js placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script class="include" type="text/javascript" src="assets/js/jquery.dcjqaccordion.2.7.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="assets/js/jquery.nicescroll.js" type="text/javascript"></script>
<!--common script for all pages-->
<script src="assets/js/common-scripts.js"></script>
<!--script for this page-->
<script src="assets/js/jquery-ui-1.9.2.custom.min.js"></script>
<!--custom switch-->
<script src="assets/js/bootstrap-switch.js"></script>
<!--custom tagsinput-->
<script src="assets/js/jquery.tagsinput.js"></script>
<!--custom checkbox & radio-->
<script type="text/javascript" src="assets/js/bootstrap-datepicker/js/bootstrap-
datepicker.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-daterangepicker/date.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-
daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-inputmask/bootstrap-
inputmask.min.js"></script>
<script src="assets/js/form-component.js"></script>
<script>
//custom select box
$(function(){
$('select.styled').customSelect();
});
</script>
</body>
</html>
<?php } ?>
Registercomplaint.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['submit']))
{
$uid=$_SESSION['id'];
$category=$_POST['category'];
$subcat=$_POST['subcategory'];
27
$complaintype=$_POST['complaintype'];
$state=$_POST['state'];
$noc=$_POST['noc'];
$complaintdetials=$_POST['complaindetails'];
$compfile=$_FILES["compfile"]["name"];
move_uploaded_file($_FILES["compfile"]["tmp_name"],"complaintdocs/".$_FILES["compfile"]
["name"]);
$query=mysqli_query($con,"insert into
tblcomplaints(userId,category,subcategory,complaintType,state,noc,complaintDetails,complaintFile)
values('$uid','$category','$subcat','$complaintype','$state','$noc','$complaintdetials','$compfile')");
// code for show complaint number
$sql=mysqli_query($con,"select complaintNumber from tblcomplaints order by complaintNumber
desc limit 1");
while($row=mysqli_fetch_array($sql))
{
$cmpn=$row['complaintNumber'];
}
$complainno=$cmpn;
echo '<script> alert("Your complain has been successfully filled and your complaintno is "+"'.
$complainno.'")</script>';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Dashboard">
<meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive,
Fluid, Retina">
<title>CMS | User Register Complaint</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<!--external css-->
<link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="assets/js/bootstrap-datepicker/css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="assets/js/bootstrap-
daterangepicker/daterangepicker.css" />
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/style-responsive.css" rel="stylesheet">
<script>
function getCat(val) {
//alert('val');
$.ajax({
type: "POST",
url: "getsubcat.php",
data:'catid='+val,
success: function(data){
$("#subcategory").html(data);
}
});
}
28
</script>
</head>
<body>
<section id="container" >
<?php include("includes/header.php");?>
<?php include("includes/sidebar.php");?>
<section id="main-content">
<section class="wrapper">
<h3><i class="fa fa-angle-right"></i> Register Complaint</h3>
<!-- BASIC FORM ELELEMNTS -->
<div class="row mt">
<div class="col-lg-12">
<div class="form-panel">
<?php if($successmsg)
{?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Well done!</b><?php echo htmlentities($successmsg);?></div>
<?php }?>
<?php if($errormsg)
{?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Oh snap!</b></b><?php echo htmlentities($errormsg);?></div>
<?php }?>
<form class="form-horizontal style-form" method="post" name="complaint"
enctype="multipart/form-data" >
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Category</label>
<div class="col-sm-4">
<select name="category" id="category" class="form-control" onChange="getCat(this.value);"
required="">
<option value="">Select Category</option>
<?php $sql=mysqli_query($con,"select id,categoryName from category ");
while ($rw=mysqli_fetch_array($sql)) {
?>
<option value="<?php echo htmlentities($rw['id']);?>"><?php echo
htmlentities($rw['categoryName']);?></option>
<?php
}
?>
</select>
</div>
<label class="col-sm-2 col-sm-2 control-label">Sub Category </label>
<div class="col-sm-4">
<select name="subcategory" id="subcategory" class="form-control" >
<option value="">Select Subcategory</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Complaint Type</label>
<div class="col-sm-4">
29
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script class="include" type="text/javascript" src="assets/js/jquery.dcjqaccordion.2.7.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="assets/js/jquery.nicescroll.js" type="text/javascript"></script>
<!--common script for all pages-->
<script src="assets/js/common-scripts.js"></script>
<!--script for this page-->
<script src="assets/js/jquery-ui-1.9.2.custom.min.js"></script>
<!--custom switch-->
<script src="assets/js/bootstrap-switch.js"></script>
<!--custom tagsinput-->
<script src="assets/js/jquery.tagsinput.js"></script>
<!--custom checkbox & radio-->
<script type="text/javascript" src="assets/js/bootstrap-datepicker/js/bootstrap-
datepicker.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-daterangepicker/date.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-
daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-inputmask/bootstrap-
inputmask.min.js"></script>
<script src="assets/js/form-component.js"></script>
<script>
//custom select box
$(function(){
$('select.styled').customSelect();
});
</script>
</body>
</html>
<?php } ?>
Logout.php
<?php
session_start();
include("includes/config.php");
$_SESSION['login']=="";
date_default_timezone_set('Asia/Kolkata');
$ldate=date( 'd-m-Y h:i:s A', time () );
mysqli_query($con,"UPDATE userlog SET logout = '$ldate' WHERE username = '".
$_SESSION['login']."' ORDER BY id DESC LIMIT 1");
session_unset();
?>
<script language="javascript">
document.location="../index.html";
</script>