Hostel Management
Hostel Management
1. INTRODUCTION
1.1 PROBLEM DEFINITION
1.2 OBJECTIVES OF PROJECT
2. SYSTEM ENVIRONMENT
2.1 HARDWARE CONFIGURATION
2.2 SOFTWARE CONFIGURATION
3. SYSTEM ANALYSIS
3.1 EXISTING SYSTEM
3.2 PROPOSED SYSTEM
3.3 SOFTWARE TOOL USED
4. SYSTEM DESIGN
4.1 TABLE DESIGN
4.2 DATA FLOW DIAGRAM’S
5. SYSTEM IMPLEMENTATION
5.1 SCREEN SHOTS & CODING
6. SYSTEM TESTING
6.1 UNIT TESTING
6.2 INTEGRATION TESTING
7. CONCLUSION
1.INTRODUCTION
This software product the hostel management to improve their services for all the students of the
hostel. This also reduce the manual work of the persons in admin penal and the bundle of
registers that were search when to find the information of a previous student, because through
this system you can store the data of those students who had left the hostel . Through this you
can check the personal profile of all the current students within few minutes the data base of the
system will help you to check a particular one. The system will help you to check the mess bills
of every student and the student’s hostel dues. The students of the hostel will be recognized from
the ID number allocated at the room rental time. In the last this system will improve the
management work in the hostel.
To automate each and every activity of the manual system, which increases its throughput
To provide a quick response with very accurate information as and when required
To make the present manual system more interactive, speedy and user friendly
To avail any information, whatever and whenever needed
Reduce the cost of maintenance
2. SYSTEM ENVIRONMENT
Processor : Pentium
RAM : 512MB
Mouse
Keyboard
For the past few years the numbers of educational institutions are increasing rapidly. Thereby the
numbers of hostels are also increasing for the accommodation of the students studying in this
institution. And hence there is a lot of strain on the person who are running the hostel and
software’s are not usually used in this context. This particular project deals with the problems on
managing a hostel and avoids the problems which occur when carried manually Identification of
the drawbacks of the existing system leads to the designing of computerized system that will be
compatible to the existing system with the system which is more user friendly and more GUI
oriented. We can improve the efficiency of the system, thus overcome the following drawbacks
of the existing system.
PHP-
PHP is a server-side scripting language designed for web development but also used as a
general-purpose programming language. PHP is now installed on more than 244 million
websites and 2.1 million web servers. Originally created by Rasmus Lerdorf in 1995, the
reference implementation of PHP is now produced by The PHP Group. While PHP originally
stood for Personal Home Page, it now stands for PHP: Hypertext Preprocessor, a recursive
backronym.PHP code is interpreted by a web server with a PHP processor module, which
generates the resulting web page: PHP commands can be embedded directly into an HTML
source document rather than calling an external file to process data. It has also evolved to
include a command-line interface capability and can be used in standalone graphical
applications. PHP is free software released under the PHP License. PHP can be deployed on
most web servers and also as a standalone shell on almost every operating system and
platform, free of charge.
CSS
CSS Stands for "Cascading Style Sheet." Cascading style sheets are used to format the layout of
Web pages. They can be used to define text styles, table sizes, and other aspects of Web pages
that previously could only be defined in a page's HTML. The basic purpose of CSS is to separate
the content of a web document (written in any markup language)from its presentation (that is
written using Cascading Style Sheets). There are lots of benefits that one can extract through
CSS like improved content accessibility, better flexibility and moreover, CSS gives a level of
control over various presentation characteristics of the document. It also helps in reducing the
complexity and helps in saving overall presentation time. CSS gives the option of selecting
various style schemes and rules according to the requirements and it also allows the same HTML
document to be presented in more than one varying style.
JAVA SCRIPT
JavaScript is considered to be one of the most famous scripting languages of all time. JavaScript,
by definition, is a Scripting Language of the World Wide Web. The main usage of JavaScript is
to add various Web functionalities, Web form validations, browser detections, creation of
cookies and so on. JavaScript is one of the most popular scripting languages and that is why it is
supported by almost all web browsers available today like Firefox, We used the browser Opera
or Internet Explorer. JavaScript is considered to be one of the most powerful scripting languages
in use today. It is often used for the development of client-side web development. JavaScript is
used to make web pages more interactive and dynamic.
JavaScript is a light weight programming language and it is embedded directly into the HTML
code. JavaScript, as the name suggests, was influenced by many languages, especially Java.
The back end is designed using mysql which is used to design the databases
MYSQL
MySQL ("My S-Q-L", officially, but also called "My Sequel") is (as of July 2013) the world's
second most widely used open-source relational database management system (RDBMS). It is
named after co-founder Michael Widenius daughter, My. The SQL phrase stands for Structured
Query Language. The MySQL development project has made its source code available under the
terms of the GNU General Public License, as well as under a variety of proprietary agreements.
MySQL was owned and sponsored by a single for-profit firm, the Swedish company MySQL
AB, now owned by Oracle Corporation .MySQL is a popular choice of database for use in web
applications, and is central components of the widely used LAMP open source web application
software stack (and other 'AMP' stacks). LAMP is an acronym for "Linux, Apache, MySQL,
Perl/PHP/Python." Free-software-open source projects that require a full-featured database
management system often use MySQL. For commercial use, several paid editions are available,
and offer additional functionality.
4. SYSTEM DESIGN
1. LOGIN
Username Varchar
Password Varchar
2. STUDENT
Stid int
Courseid int
Name Varchar
Rollno Varchar
Dob date
Father_name Varchar
Mother_name Varchar
Gender Varchar
Address Text
Contact_no Varchar
Parents_no Varchar
Blood_group Varchar
Status Varchar
3. ROOM DETAILS
Room_id int
Block_id int
Room_no int
No_of_beds int
Description text
Status varchar
4. FEE DETAILS
Fee_str_id int
course_id int
Fee_type varchar
Cost float
Status varchar
5. COURSE DETAILS
course_id int
course_name varchar
No_of_year int
Status varchar
6. BLOCK DETAILS
block_id int
Block_name varchar
Gender varchar
Description float
Status varchar
4.2 DATA FLOW DIAGRAM’S
LEVEL 0
LEVEL1
LEVEL 2
5. SYSTEM IMPLEMENTATION
SCREENSHOTS
HOMEPAGE
DASHBOARD
REGISTRATION
VIEW ROOMS
ADD ROOMS
FEE STRUCTURE
ADD COURSE
VIEW COURSE
BLOCK
VIEW BLOCKS
FEES
STUDENT DETAILS
VIEW STUDENT
VIEW BILLING
MESS BILL
BILLING
ADD MESS CARD
VIEW ROOM ALLOT
VIEW FEES
VIEW MESS CARD
CODING
Index.php
<?php
include("databaseconnection.php");
if(isset($_SESSION['emp_id']))
{
header("Location: dashboard.php");
}
if(isset($_POST['empsubmit']))
$count = mysqli_num_rows($sqlquery);
if($count == 1)
{
$msg1="<p><font color='green'><strong>Logged in
successfully...</strong></font></p>";
$rs = mysqli_fetch_array($sqlquery);
$_SESSION[emp_id] = $rs[emp_id] ;
$_SESSION[emp_designation] = $rs[emp_type] ;
header("Location: dashboard.php");
}
else
{
}
include("header.php");
?>
<div id="templatemo_main">
</table>
</form>
</p>
</div>
<div class="cleaner">
</div>
</div>
<div class="cleaner"></div>
include("footer.php");
?>
Header.php
<?php
?>
<!DOCTYPE html>
<html >
<head>
function clearText(field)
</script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider({
effect:'random',
slices:10,
animSpeed:800,
pauseTime:1600,
directionNav:false,
controlNav:false, //1,2,3...
beforeChange: function(){},
afterChange: function(){},
});
});
</script>
<style type="text/css">
#wrap {
width: 100%;
height: 50px;
margin: 0;
z-index: 99;
position: relative;
background-color: #366b82;
.navbar {
height: 50px;
padding: 0;
margin: 0;
position: absolute;
.navbar li {
height: auto;
width: 137px;
float: left;
text-align: center;
list-style: none;
padding: 0;
margin: 0;
background-color: #366b82;
.navbar a {
padding: 18px 0;
text-decoration: none;
color: white;
display: block;
height: auto;
margin: 0;
padding: 0;
.navbar li:hover ul {
display: block;
.navbar li ul li a {
</style>
</head>
<body class="homepage">
<div id="templatemo_wrapper">
<div id="templatemo_header">
<div class="cleaner"></div>
</div>
<div id="wrap">
<ul class="navbar">
<li><a href="index.php">Home</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div>
?>
<html>
<body>
<div id="templatemo_footer_wrapper">
<div id="templatemo_footer">
</body>
</html>
Dashboard.php
<?php
include("header.php");
?>
<div id="templatemo_main">
<ul>
<li>
</a>
</li>
<li>
</a>
</li>
<li class="lmb">
</a>
</li>
<li>
</a>
</li>
<li>
</a>
</li>
<li class="lmb">
</a>
</li>
<li>
</a>
</li>
<li>
</a>
</li>
<li>
<a href="fees.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing
elit.">
</a>
</li>
<li>
</a>
</li>
<li>
</a>
</li>
<li>
</a>
</li>
<li>
</li>
<li class="lmb">
</a>
</li>
<li>
</a>
</li>
<li>
</a>
</li>
<li>
</a>
</li>
<li>
</a>
</li>
</ul>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div>
<?php
include("footer.php");
?>
Registration.php
<?php
include("databaseconnection.php");
?>
<script>
function validation()
if(document.form1.stud_type.value=="")
return false;
else if(document.form1.start_date.value=="")
return false;
else if(document.form1.end_date.value=="")
return false;
else if(document.form1.food_type.value=="")
return false;
return false;
//}
alert(d1[0]);
/*
return false;
*/
</script>
<?php
if(isset($_POST['submit']))
if(isset($_GET['editid']))
{
$sql="UPDATE registration SET
stid='$_POST[stid]',stud_type='$_POST[stud_type]',start_date='$_POST[start_date]',end_date='
$_POST[end_date]',room_id='$_POST[room_id]',course_id='$_POST[course_id]',food_type='$
_POST[food_type]',beverage_type='$_POST[beverage_type]',status='$_POST[status]' WHERE
reg_id='$_POST[reg_id]'";
if(!mysqli_query($con,$sql))
die('ERROR:'. mysqli_error($dbconnection));
else
$resi=1;
else
if(!$result)
else
{
echo "Inserted successfully...";
$_SESSION['insid'] = rand();
?>
<?php
include("header.php");
?>
<div id="templatemo_main">
<div class="post_box">
<h2>Room Registration</h2>
<p>
<?php
if(isset($_POST['submit']))
else
{
?>
<tr>
<?php
$rs=mysqli_fetch_array($result);
Course: $rs[course_name]<br>
DOB: $rs[dob]<br>
Gender: $rs[gender]<br>";
?>
</td></tr>
<tr>
<?php
$rsroom =mysqli_fetch_array($resultroom);
echo "Room No.: $rsroom[room_no]<br>";
$rsblock =mysqli_fetch_array($resultblock);
?>
</td></tr>
<tr><td><strong>Student type</strong></td>
<td><select name="stud_type">
<option value="">Select</option>
<option value="Hosteler">Hosteler</option>
</select>
</td>
</tr>
<tr><td><strong>End date</strong></td><td>
</td></tr>
<tr><td><strong>Food type</strong></td>
<td><select name="food_type">
<option value="">Select</option>
<option>Vegeterian</option>
<option>Non-vegeterian</option>
</select>
</td>
</tr>
<tr><td><strong>Beverage type</strong></td>
<td><select name="beverage_type">
<option value="">Select</option>
<option>Milk</option>
<option>Coffee</option>
<option>Tea</option>
<option>Juice</option>
</select>
</td>
</tr>
<?php
if(isset($_GET['editid']))
?>
<tr><td><strong>Status</strong></td>
<td><select name="status">
<option value="Enabled">Enabled</option>
<option value="Disabled">Disabled</option>
</select>
</td>
</tr>
<?php
}
else
?>
</table>
</form>
<?php
?>
</p>
<div class="cleaner"></div>
</div>
</div>
<?php
include("sidebar.php");
?>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Viewrooms.php
<?php
session_start();
include("header.php");
include("databaseconnection.php");
?>
<div id="templatemo_main">
<div class="post_box">
<p>
</tr>
<select name="blockid">
<option value="">Select</option>
<?php
$rsdel = mysqli_fetch_array($resultdelid);
while($rsblocks = mysqli_fetch_array($resultblocks))
if($_GET[blockid] ==$rsblocks[block_id] )
else
}
?>
</select>
</td></tr>
</table>
</form>
<hr />
</p>
<div class="cleaner"></div>
</div>
</div>
<div class="cleaner"></div>
</div>
<div id="templatemo_main">
<div id="gallery">
<ul>
<?php
$rsblocks1 = mysqli_fetch_array($resultblocks1);
echo $rsrooms['no_of_beds'];
echo "<br><br>
</li>";
?>
</ul>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
<?php
include("footer.php");
?>
Rooms.php
<?php
session_start();
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
if(document.form1.block.value=="")
{
alert("Block should not be Empty...");
return false;
}
else if(document.form1.roomno.value=="")
{
alert("Room Number should not be Empty...");
return false;
}
else if(document.form1.roomno.value>10000)
{
alert("Room Number is not valid...");
return false;
}
else if(document.form1.noofbeds.value=="")
{
alert("No of Beds should not be Empty...");
return false;
}
else if(document.form1.description.value=="")
{
alert("Description should be Text...");
return false;
}
else
{
return true;
}
}
</script>
<script>
function showroomno(str)
{
if (str=="")
{
document.getElementById("txtroomno").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtroomno").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajaxroomno.php?q="+str,true);
xmlhttp.send();
}
</script>
<?php
if(isset($_POST['submit']))
{
if(isset($_GET['editid']))
{
$sql="UPDATE room SET
block_id='$_POST[block]',room_no='$_POST[roomno]',no_of_beds='$_POST[noofbeds]',descr
iption='$_POST[discription]', status='$_POST[status]' WHERE room_id='$_GET[editid]'";
if(!mysqli_query($dbconnection,$sql))
{
die('ERRORUPDT:'. mysqli_error($dbconnection));
}
else
{
$res="<font color='purple'><strong>Record Updated
Successfully......</strong></font><br>";
$resi=1;
}
}
else
{
$sqlquery ="INSERT INTO room
(block_id,room_no,no_of_beds,description, status) VALUES
('$_POST[block]','$_POST[roomno]','$_POST[noofbeds]','$_POST[discription]','$_POST[status
]')";
if(!mysqli_query($dbconnection,$sqlquery))
{
//echo "Problem in SQL query". mysqli_error($dbconnection);
$res = "<strong>Room number already exist</strong>";
$resi =1;
}
else
{
$res="<font color='purple'><strong> One room inserted
successfully......</strong></font><br>";
$resi =1;
}
}
}
$_SESSION['insid'] = rand();
if(isset($_GET['editid']))
{
$resultrooms = mysqli_query($dbconnection,"SELECT * FROM room where room_id =
'$_GET[editid]' ");
$rsrooms = mysqli_fetch_array($resultrooms);
}
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>Add rooms</h2>
<form method="post" action="" name="form1" onsubmit="return validation()">
<input type="hidden" name="insid" value="<?php echo $_SESSION['insid'];?>" />
<table class="tftable" height="234" border="1">
<?php
if($resi == 1)
{
echo "<tr><td colspan=2>
$res
</td></tr>";
}
?>
<div class="cleaner"></div>
</div> <!-- end of main -->
</div> <!-- end of wrapper -->
<?php
include("footer.php");
?>
Feetype.php
<?php
session_start();
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
if(document.form1.feetype.value=="")
{
alert("Fees Type should not be empty..");
return false;
}
else if(document.form1.course.value=="")
{
alert("Course should be not be empty...");
return false;
}
else if(document.form1.cost.value=="")
{
alert("Cost should not be empty...");
return false;
}
else if(isNaN(document.form1.cost.value) == true)
{
alert("Cost should be numeric..");
document.form1.cost.value = "";
document.form1.cost.focus();
return false;
}
else
{
return true;
}
}
</script>
<?php
if(isset($_POST['submit']))
{
if(isset($_GET['editid']))
{
$sql="UPDATE fees_structure SET
fee_type='$_POST[feetype]',course_id='$_POST[course]',cost='$_POST[cost]',status='$_POST[
status]' WHERE fee_str_id='$_GET[editid]'";
if(!mysqli_query($dbconnection,$sql))
{
die('ERROR:'. mysqli_error($dbconnection));
}
else
{
$res="<font color='purple'><strong>Record Updated
Successfully......</strong></font><br>";
$resi=1;
}
}
else
{
$sqlquery1 = "SELECT * FROM fees_structure WHERE
(fee_type='$_POST[feetype]' OR fee_type='$_POST[feetype]') AND
course_id='$_POST[course]'";
$sqlqueryresult1 = mysqli_query($dbconnection,$sqlquery1);
echo mysqli_num_rows($sqlqueryresult1) ;
if(mysqli_num_rows($sqlqueryresult1) == 0)
{
$result=mysqli_query($dbconnection, "INSERT INTO
fees_structure(fee_type,course_id,cost,status)values('$_POST[feetype]','$_POST[course]','$_PO
ST[cost]','$_POST[status]')");
if(!$result)
{
echo "problem in sql statement";
}
else
{
$res = "successfully inserted";
$resi=1;
}
}
else
{
$res = "Fee type already exit ";
$resi=1;
}
}
}
$_SESSION['insid']==rand();
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>Fee type</h2>
<p>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Course.php
<?php
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
if(document.form1.coursename.value=="")
{
alert("Course Name should not be empty..");
return false;
}
else if(isNaN(document.form1.coursename.value) == false)
{
alert("Course Name should be character.");
document.form1.coursename.value = "";
document.form1.coursename.focus();
return false;
}
else if(document.form1.year.value=="")
{
alert("Number of Year should be numeric...");
return false;
}
else
{
return true;
}
}
</script>
<?php
if(isset($_POST['submit']))
{
$resultblocks = mysqli_query($dbconnection,"SELECT * FROM course where
course_name='$_POST[coursename]'");
$rsblocks = mysqli_fetch_array($resultblocks);
if($rsblocks)
{
$res ="<font color='red'>Course name already exist in database</font>";
$resi =1;
}
else
{
if(isset($_GET[editid]))
{
$sql="UPDATE course SET
course_name='$_POST[coursename]',no_of_year='$_POST[year]',status='$_POST[status]'
WHERE course_id='$_GET[editid]'";
if(!mysqli_query($dbconnection,$sql))
{
die('ERROR:'. mysqli_error($dbconnection));
}
else
{
$res="<font color='purple'><strong>Record Updated
Successfully......</strong></font><br>";
$resi=1;
}
}
else
{
$result = mysqli_query($dbconnection,"insert into
course(course_name,no_of_year,status)values('$_POST[coursename]',
'$_POST[year]','$_POST[status]')");
if(!result)
{
$res="Failed to insert record";
$resi=1;
}
else
{
$res="Inserted successfully...";
$resi=1;
}
}
}
}
$_SESSION['insid'] = rand();
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>Add course</h2>
<p>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Viewcourse.php
<script>
function ConfirmDelete()
{
var result=confirm("Are you sure want to delete this record?");
if(result==true)
{
return true;
}
else
{
return false;
}
}
</script>
<?php
include("databaseconnection.php");
$delrec=mysqli_query($dbconnection,"DELETE FROM 'course' where
course_id='$_GET[delid]'");
?>
<?php
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>View course</h2>
<p>
<table class="tftable" width="486" border="1">
<tr>
<td>Course name</td>
<td>No of year</td>
<td>Status</td>
<td>Action</td>
</tr>
<?php
$result = mysqli_query($dbconnection,"SELECT * from course");
while($rs = mysqli_fetch_array($result))
{
echo "<tr>
<td>$rs[course_name]</td>
<td>$rs[no_of_year]</td>
<td>$rs[status]</td>
<td>
<a href='course.php?editid=$rs[course_id]'>Edit</a> |
<a href='viewcourse.php?delid=$rs[course_id]'onclick='return
ConfirmDelete()'>Delete</a></td>
</tr>";
}
?>
</table></p>
<div class="cleaner"></div>
</div>
</div>
<div class="col_w280 float_r">
<?php
include("sidebar.php");
?>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Block.php
<?php
session_start();
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
if(document.form1.blockname.value=="")
{
alert("Block Name should not be empty..");
return false;
}
else if(document.form1.gender.value=="")
{
alert("Gender should not be empty..");
return false;
}
else if(document.form1.description.value=="")
{
alert("Description should not be empty..");
return false;
}
else
{
return true;
}
}
</script>
<?php
if(isset($_POST['submit']))
{
$resultblocks = mysqli_query($dbconnection,"SELECT * FROM blocks where
block_name='$_POST[blockname]'");
$rsblocks = mysqli_fetch_array($resultblocks);
if($rsblocks)
{
$res ="<font color='red'>Block name already exist in database</font>";
$resi =1;
}
else
{
if(isset($_GET[editid]))
{
$sql="UPDATE blocks SET
block_name='$_POST[blockname]',gender='$_POST[gender]',description='$_POST[description
]',status='$_POST[status]' WHERE block_id='$_GET[editid]'";
if(!mysqli_query($dbconnection,$sql))
{
die('ERROR:'. mysqli_error($dbconnection));
}
else
{
$res="<font color='purple'><strong>Record Updated
Successfully......</strong></font><br>";
$resi=1;
}
}
else
{
$result=mysqli_query($dbconnection,"INSERT INTO
blocks(
block_name,gender,description,status)values('$_POST[blockname]','$_POST[gender]','$
_POST[description]','$_POST[status]')");
if(!result)
{
$res="problem in sql statement</strong></font><br>";
$resi=1;
}
else
{
$res="<font color='purple'><strong>successfully
inserted</strong></font><br>";
$resi=1;
}
}
}
}
$_SESSION['insid']=rand();
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>Blocks</h2>
<p>
<form method="post" action="" name="form1"onsubmit="return validation()">
<input type="hidden" name="insid" value="<?php echo $_SESSION['insid'];?>"/>
<table class="tftable" border="1">
<?php
if($resi==1)
{
echo "<tr><td colspan=2>
$res
</td></tr>";
}
else
{
?>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Viewblocks.php
<script>
function ConfirmDelete()
{
var result=confirm("Are you sure want to delete this record?");
if(result==true)
{
return true;
}
else
{
return false;
}
}
</script>
<?php
include("databaseconnection.php");
$delrec=mysqli_query($dbconnection,"DELETE FROM blocks where
block_id='$_GET[delid]'");
?>
<?php
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>View blocks</h2>
<p>
<table class="tftable" width="853" border="1">
<tr>
<td width="93"><strong>Block name</strong></td>
<td width="264"><strong>Gender</strong></td>
<td width="204"><strong>Description</strong></td>
<td width="114"><strong>Status</strong></td>
<td width="144"><strong>Action</strong></td>
</tr>
<?php
$result = mysqli_query($dbconnection,"SELECT * FROM blocks");
while($rs = mysqli_fetch_array($result))
{
echo "<tr>
<td>$rs[block_name]</td>
<td>$rs[gender]</td>
<td>$rs[description]</td>
<td>$rs[status]</td>
<td>
<a href='block.php?editid=$rs[block_id]' >Edit</a>
|
<a href='viewblocks.php?delid=$rs[block_id]' onclick='return ConfirmDelete()'>Delete</a>
</td>
</tr>";
}
?>
</table></p>
<div class="cleaner"></div>
</div>
</div>
<div class="col_w280 float_r">
<?php
include("sidebar.php");
?>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Fee.php
<?php
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
if(document.form1.reg_id.value=="")
{
alert("Registation ID should be empty..");
return false;
}
else if(document.form1.fee_str_id.value=="")
{
alert("Fee Structure ID should be empty..");
return false;
}
else if(document.form1.total_fees.value=="")
{
alert("Total Fees should be numeric...");
return false;
}
else
{
return true;
}
}
</script>
<?php
if(isset($_POST['submit']))
{
$sql="UPDATE fees SET
reg_id='$_POST[reg_id]',fee_str_id='$_POST[fee_str_id]',paid_date='$_POST[paid_date]',invoi
ce_date='$_POST[invoice_date]',total_fees='$_POST[total_fees]',status='$_POST[status]'
WHERE fee_id";
if(!mysqli_query($con,$sql))
{
die('ERROR:'. mysqli_error($dbconnection));
}
else
{
$res="<font color='purple'><strong>Record Updated
Successfully......</strong></font><br>";
$resi=1;
}
$result = mysqli_query($dbconnection,"insert into
fees(reg_id,fee_str_id,paid_date,invoice_date,total_fees,status)values('$_POST[reg_id]',
'$_POST[fee_str_id]','$_POST[paid_date]','$_POST[invoice_date]','$_POST[total_fees]','
$_POST[status]')");
if(!result)
{
echo "Problem in SQL query";
}
else
{
echo "Inserted successfully...";
}
}
$_SESSION['insid'] = rand();
?>
<?php
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>Administrator Dashboard</h2>
<p>
<form method="post" action="" name="form1" onsubmit="return validation()">
<input type="hidden" name="insid" value="<?php echo $_SESSION[insid]; ?>" />
<table class="tftable" border="1">
<tr><td>Register id</td><td><input type="text" name="reg_id"></td></tr>
<tr><td>Fee structure id</td><td><input type="text" name="fee_str_id"></td></tr>
<tr><td>Paid date</td><td><input type="date" name="paid_date"></td></tr>
<tr><td>Invoice date</td><td><input type="date" name="invoice_date"></td></tr>
<tr><td>Total fees</td><td><input type="text" name="total_fees"></td></tr>
<tr><td>Status</td>
<td><select name="status">
<option>Enabled</option>
<option>Disabled</option>
</select>
</td>
</tr>
<tr><td colspan="2"><input type="submit" name="submit"></td></tr>
</table>
</form>
</p>
<div class="cleaner"></div>
</div>
</div>
<div class="col_w280 float_r">
<?php
include("sidebar.php");
?>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div> <!-- end of main -->
</div> <!-- end of wrapper -->
<?php
include("footer.php");
?>
Students.php
<?php
session_start();
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
if(document.form1.course.value=="")
{
alert("Course Name should not be empty..");
return false;
}
else if(document.form1.name.value=="")
{
alert("Name should be text..");
return false;
}
else if(isNaN(document.form1.name.value) == false)
{
alert("Name should be character.");
document.form1.name.value = "";
document.form1.name.focus();
return false;
}
else if(document.form1.rollno.value=="")
{
alert("Roll No should not be empty..");
return false;
}
else if(isNaN(document.form1.rollno.value) == true)
{
alert("Roll number should be numeric..");
document.form1.rollno.value = "";
document.form1.rollno.focus();
return false;
}
else if(document.form1.dob.value=="")
{
alert("Date of Birth should not be empty.");
return false;
}
else if(datestart > datebirth ) {
// datestart1990 dateend 1996 datebirth|| dateend < datebirth
alert("DOB Not allowed");
document.form1.dob.focus();
return false;
}
else if(dateend < datebirth) {
// datestart1990 dateend 1996 datebirth|| dateend < datebirth
alert("DOB Not allowed..");
document.form1.dob.focus();
return false;
}
else if(document.form1.fname.value=="")
{
alert("Father Name should not be empty.");
return false;
}
else if(document.form1.mname.value=="")
{
alert("Mother Name should not be empty...");
return false;
}
else if(document.form1.b1.value=="")
{
alert("Gender should not be empty...");
return false;
}
else if(document.form1.address.value=="")
{
alert("Address should not be empty...");
return false;
}
else if(document.form1.contactno.value=="")
{
alert("Contact no should not be empty..");
return false;
}
else if(isNaN(document.form1.contactno.value) == true)
{
alert("Contact number should be numeric..");
document.form1.contactno.value = "";
document.form1.contactno.focus();
return false;
}
else if(document.form1.contactno.value.length < 9)
{
alert("Contact number is not valid.");
return false;
}
/*
else if(document.form1.contactno.value.length > 11)
{
alert("Invalid contact number...");
return false;
}
*/
else if(document.form1.parentsno.value=="")
{
alert("Parents Contact no should be numeric..");
return false;
}
else if(isNaN(document.form1.parentsno.value) == true)
{
alert("Parents number should be numeric..");
document.form1.parentsno.value = "";
document.form1.parentsno.focus();
return false;
}
else if(document.form1.parentsno.value.length < 9)
{
alert("Contact number is not valid.");
return false;
}
else if(document.form1.parentsno.value.length > 11)
{
alert("Invalid contact number..");
return false;
}
else if(document.form1.contactno.value < 10 && document.form1.contactno.value > 11 )
{
alert("Invalid Contact Number..");
return false;
}
else if(document.form1.parentsno.value < 10 && document.form1.parentsno.value > 15 )
{
alert("Invalid Parent Contact Number..");
return false;
}
else if(document.form1.bloodgroup.value == "")
{
alert("Please select blood group..");
return false;
}
else if(document.form1.status.value == "")
{
alert("Please select status..");
return false;
}
else
{
return true;
}
}
</script>
<?php
if(isset($_POST['submit']))
{
if(isset($_GET[editid]))
{
if(!mysqli_query($dbconnection,$sql))
{
die('ERROR:'. mysqli_error($dbconnection));
}
if(mysqli_affected_rows($dbconnection) ==1)
{
$res="<font color='purple'><strong>Record Updated
Successfully......</strong></font><br>";
$resi=1;
}
else
{
$res="<font color='purple'><strong>No records to
update......</strong></font><br>";
$resi=1;
}
}
else
{
$result = mysqli_query($dbconnection,"insert into
student(courseid,name,rollno,dob,father_name,mother_name,gender,address,contact_no,parents_
no,blood_group,status)values(
'$_POST[course]','$_POST[name]','$_POST[rollno]','$_POST[dob]','$_POST[fname]','$_POST[
mname]','$_POST[b1]','$_POST[address]','$_POST[contactno]','$_POST[parentsno]','$_POST[b
loodgroup]','$_POST[status]')");
if(!$result)
{
//echo "Problem in SQL query". mysqli_error($dbconnection);
$res="<font color='#990099'><strong>Student Roll Number Already
Exists......</strong></font><br>";
$resi=1;
}
else
{
$res="<font color='purple'><strong>Student record inserted
successfully......</strong></font><br>";
$resi=1;
}
}
}
$_SESSION['insid'] = rand();
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>Student details</h2>
<p>
<?php
$tomorrow = mktime(0,0,0,date("m"),date("d"),date("Y")-18);
$dtdn = date("Y-m-d", $tomorrow);
?>
<input type="hidden" name="dtdn" value="<?php echo $dtdn; ?>" />
<div class="cleaner"></div>
</div> <!-- end of main -->
</div> <!-- end of wrapper -->
<?php
include("footer.php");
?>
Viewstudent.php
<?php
include("header.php");
?>
<script>
function ConfirmDelete()
{
var result=confirm("Are you sure want to delete this record?");
if(result==true)
{
return true;
}
else
{
return false;
}
}
</script>
<?php
include("databaseconnection.php");
$delrec=mysqli_query($dbconnection,"DELETE FROM student where stid='$_GET[delid]'");
?>
<div id="templatemo_main">
<?php
$result=mysqli_query($dbconnection,"SELECT * FROM student left join course ON
course.course_id = student.courseid");
while($rs=mysqli_fetch_array($result))
{
echo "<tr>
<td>$rs[name]</td>
<td>
Course: $rs[course_name]<br>
Roll No.: $rs[rollno]</td>
<td>DOB: $rs[dob]
<br> Gender: $rs[gender]
<br>Blood group: $rs[blood_group]
</td>
<td>Father's Name: $rs[father_name]
<br> Mother's name: $rs[mother_name]
</td>
<td>$rs[address]
<br>Contact No. $rs[contact_no]
<br>Parents No. $rs[parents_no]</td>
<td align='center'>Status: $rs[status]<br>
<a href='viewstudentdetails.php?studentid=$rs[stid]'>View</a><br>
<a href='viewstudent.php?delid=$rs[stid]'onclick='return ConfirmDelete()'>Delete</a>
</td>
</tr>";
}
?>
</table>
</div>
</div>
<?php
include("footer.php");
?>
Viewbilling.php
<?php
session_start();
include("header.php");
include("databaseconnection.php");
?>
<div id="templatemo_main">
<?php
$result = mysqli_query($dbconnection,"SELECT room.*, blocks.*, billing.*, registration.*,
student.*, room.block_id, student.courseid AS Expr1
FROM billing INNER JOIN
registration ON billing.reg_id = registration.reg_id INNER JOIN
student ON registration.stid = student.stid INNER JOIN
room ON registration.room_id = room.room_id INNER JOIN
blocks ON room.block_id = blocks.block_id INNER JOIN
course ON student.courseid = course.course_id");
while($rs = mysqli_fetch_array($result))
{
echo "<tr>
<td>$rs[billid]</td>
<td>$rs[paid_date]</td>
<td>$rs[name]</td>
<td>$rs[rollno]</td>
<td>$rs[block_name]</td>
<td>$rs[room_no]</td>
<td>$rs[bill_type]</td>
<td>$rs[paid_amt]</td>
</tr>";
}
?>
</table>
<br>
<centeR><button onclick="myFunction()">Print this report</button></centeR>
<script>
function myFunction()
{
window.print();
}
</script>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Messbill.php
<?php
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
if(document.form1.reg_id.value=="")
{
alert("Registation ID should be empty..");
return false;
}
else if(document.form1.fee_str_id.value=="")
{
alert("Fee Structure ID should be empty..");
return false;
}
else if(document.form1.messbill.value=="")
{
alert("Mess Bill should be numeric...");
return false;
}
else
{
return true;
}
}
</script>
<?php
if(isset($_POST['submit']))
{
$sql="UPDATE messbill SET
bill_id='$_POST[billid]',payment_id='$_POST[paymentid]',bill_type='$_POST[billtype]',paid_a
mt='$_POST[paidamt]',paid_date='$_POST[paiddate]',status='$_POST[status]' WHERE
bill_id='$_POST[bill_id]'";
if(!mysqli_query($con,$sql))
{
die('ERROR:'. mysqli_error($dbconnection));
}
else
{
$res="<font color='purple'><strong>Record Updated
Successfully......</strong></font><br>";
$resi=1;
}
$result = mysqli_query($dbconnection,"insert into
mess_bill(mess_bill_id,reg_id,fee_str_id,date,mess_bill,status)values('$_POST[mbid]',
'$_POST[regid]','$_POST[feestrid]','$_POST[date]','$_POST[messbill]','$_POST[status]'
)");
if(!result)
{
echo "Problem in SQL query";
}
else
{
echo "Inserted successfully...";
}
$_SESSION['insid'] = rand();
?>
<?php
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>Administrator Dashboard</h2>
<p>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Billing.php
<?php
session_start();
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
var paidamt = parseFloat(document.form1.paidamt.value);
var remainingfee = parseFloat(document.form1.remainingfee.value);
if(document.form1.billtype.value=="Select")
{
alert("Bill type is not selected..");
return false;
}
else if(document.form1.paidamt.value=="")
{
alert("Paid amount should not be empty..");
return false;
}
else if(document.form1.paidamt.value<=0)
{
alert("Paid amount Not valid...");
document.form1.paidamt.value ="";
document.form1.paidamt.focus();
return false;
}
else if(paidamt > remainingfee)
{
alert("Paid amount greater than Remaining amount..");
document.form1.paidamt.value ="";
document.form1.paidamt.focus();
return false;
}
else if(document.form1.paiddate.value=="")
{
alert("Paid date should not be empty..");
return false;
}
else
{
return true;
}
}
</script>
<?php
if(isset($_POST['submit']))
{
if(isset($_GET['editid']))
{
$sql="UPDATE billing SET
bill_id='$_POST[billid]',payment_id='$_POST[paymentid]',bill_type='$_POST[billtype]',paid_a
mt='$_POST[paidamt]',paid_date='$_POST[paiddate]',status='$_POST[status]' WHERE
bill_id='$_POST[bill_id]'";
if(!mysqli_query($con,$sql))
{
die('ERROR:'. mysqli_error($dbconnection));
}
else
{
$res="<font color='purple'><strong>Record Updated
Successfully......</strong></font><br>";
$resi=1;
}
}
else
{
$result = mysqli_query($dbconnection,"insert into
billing(reg_id,bill_type,paid_amt,paid_date,status)
values('$_GET[regid]','$_POST[billtype]','$_POST[paidamt]','$_POST[paiddate]','Enable
d')");
if(!result)
{
echo "Problem in SQL query";
}
else
{
$msg ="<h1 align='center'>Payment record inserted
successfully...</h1>";
$msgi = 1;
}
}
}
$_SESSION['insid'] = rand();
?>
<?php
include("header.php");
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<div class="post_box">
<h2>Fees payment Form</h2>
<p>
<form method="post" action="" name="form1" onsubmit="return validation()">
<?php
$result=mysqli_query($dbconnection,"SELECT * FROM fees where reg_id");
?>
<table class="tftable" width="922" border="1">
<tr align="center" bgcolor="#FFFFCC">
<td height="23"><strong>Particulars</strong></td>
<td><strong>Invoice Date</strong></td>
<td><strong>Cost</strong></td>
</tr>
<?php
$totalfee=0;
while($rs=mysqli_fetch_array($result))
{
echo "<tr>
<td> Establishment Fee</td>
<td align='center'>$rs[invoice_date]</td>
<td align='center'> Rs. $rs[total_fees] </td>
</tr>";
$totalfee = $totalfee + $rs['total_fees'];
}
<br />
<hr />
<h2>Payment details </h2>
</table>
<br />
<?php
if($msg == 1)
{
echo $msg;
?>
<?php
}
else
{
?>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Messcard.php
<?php
session_start();
include("databaseconnection.php");
?>
<script type="application/javascript">
function validation()
{
var dateOne = new Date(document.form1.start_date.value); //Year, Month, Date
var dateTwo = new Date(document.form1.enddate.value); //Year, Month, Date
if(document.form1.messcardtype.value=="")
{
alert("Messcard Type should not be empty..");
return false;
}
else if(document.form1.start_date.value=="")
{
alert("Start date should not be empty..");
return false;
}
else if(document.form1.enddate.value=="")
{
alert("End date should not be empty..");
return false;
}
else if(dateOne > dateTwo)
{
alert("Start date and End date not valid..");
return false;
}
else
{
return true;
}
}
</script>
<?php
if(isset($_POST['submit']))
{
$result = mysqli_query($dbconnection,"insert into
messcard(reg_id,messcard_type,start_date,enddate,status)values('$_GET[regid]','$_POST[messc
ardtype]','$_POST[start_date]','$_POST[enddate]','Enabled')");
if(!$result)
{
echo "Problem in SQL query". mysqli_error();
}
else
{
$res = "Inserted successfully...";
$resi = 1;
}
}
include("header.php");
$_SESSION['insid'] = rand();
?>
<div id="templatemo_main">
<div class="col_w900 col_w900_last">
<div class="col_w580 float_l">
<a href="dashboard.php" >back</a>
<div class="post_box">
<h2>Add Mess card</h2>
<p>
<?php
if($resi == 1)
{
echo "<h1>Record inserted successfully..</h1>";
}
else
{
?>
<div class="cleaner"></div>
</div> <!-- end of main -->
<?php
include("footer.php");
?>
Viewroomallot.php
<?php
session_start();
include("databaseconnection.php");
$_SESSION['insid'] = rand();
?>
<?php
include("header.php");
?>
<div id="templatemo_main">
<div class="post_box">
<h2>View Room allotment</h2>
<p>
<script>
function ConfirmDelete()
if(result==true)
return true;
else
return false;
</script>
<?php
?>
<tr>
</tr>
<?php
while($rs=mysqli_fetch_array($result))
$rs1=mysqli_fetch_array($result1);
echo "<tr>
<td>$rs1[block_name]</td>
<td>$rs[course_name]</td>
<td><a href='viewroomallot.php?delid=$rs[allotment_id]'onclick='return
ConfirmDelete()'>Delete</a></td>
</tr>";
?>
</table>
</p>
<div class="cleaner"></div>
</div>
</div>
<?php
include("sidebar.php");
?>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
<?php
include("footer.php");
?>
Viewfees.php
<?php
session_start();
include("header.php");
include("databaseconnection.php");
?>
<div id="templatemo_main">
<script>
function ConfirmDelete()
if(result==true)
return true;
else
return false;
</script>
<tr bgcolor="#FFFFCC">
<td>Invoice No.</td>
<td>Invoice date</td>
<td>Name</td>
<td>Roll No.</td>
<td>Course</td>
<td>Block name</td>
<td>Room No.</td>
<td>Student type</td>
<td>Start date</td>
<td>Last date</td>
<td>Total fees</td>
</tr>
<?php
while($rs=mysqli_fetch_array($result))
echo "<tr>
<td>$rs[fee_id]</td>
<td>$rs[invoice_date]</td>
<td>$rs[name]</td>
<td>$rs[rollno]</td>
<td>$rs[course_name]</td>
<td>$rs[block_name]</td>
<td>$rs[room_no]</td>
<td>$rs[stud_type]</td>
<td>$rs[start_date]</td>
<td>$rs[end_date]</td>
<td>$rs[total_fees]</td>
</tr>";
?>
</table>
<br>
<script>
function myFunction()
window.print();
</script>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
<?php
include("footer.php");
?>
Viewmesscard.php
<?php
session_start();
include("header.php");
include("databaseconnection.php");
?>
<div id="templatemo_main">
<script>
function ConfirmDelete()
if(result==true)
{
return true;
else
return false;
</script>
<?php
?>
<tr align="center">
<td><strong>Registration ID</strong></td>
<td><strong>Messcard type</strong></td>
<td><strong>Start date</strong></td>
<td><strong>End date</strong></td>
<td><strong>Action</strong></td>
</tr>
<?php
while($rs=mysqli_fetch_array($result))
echo "<tr>
<td>$rs[reg_id]</td>
<td>$rs[messcard_type]</td>
<td>$rs[start_date]</td>
<td>$rs[enddate]</td>
</tr>";
?>
</table>
<div class="cleaner"></div>
<?php
include("footer.php");
?>
6. SYSTEM TESTING
The software units in a system are modules and routines that are assembled and integrated to
perform a specific function. Unit testing focuses first on modules, independently of one another,
to locate errors. This enables, to detect errors in coding and logic that are contained within each
module. This testing includes entering data and ascertaining if the value matches to the type and
size supported by java. The various controls are tested to ensure that each performs its action as
required.
Data can be lost across any interface, one module can have an adverse effect on another, sub
functions when combined, may not produce the desired major functions. Integration testing is a
systematic testing to discover errors associated within the interface. The objective is to take unit
tested modules and build a program structure. All the modules are combined and tested as a
whole. Here the Server module and Client module options are integrated and tested. This testing
provides the assurance that the application is well integrated functional unit with smooth
transition of data.
7. CONCLUSION
To conclude the description about the project: The project developed using PHP and MySQL is
based on the requirement specification of the user and the analysis of the existing system, with
flexibility for future enhancement.