0% found this document useful (0 votes)
5 views

Hostel Management

The document outlines the development of a 'Hostel Management System' software aimed at automating and improving the management of hostel activities, addressing the inefficiencies of manual record-keeping. It includes acknowledgments, problem definitions, objectives, system environments, analysis, design, implementation details, and coding examples. The proposed system enhances data handling, reduces errors, and provides a user-friendly interface for hostel administrators.

Uploaded by

tech4fresherss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Hostel Management

The document outlines the development of a 'Hostel Management System' software aimed at automating and improving the management of hostel activities, addressing the inefficiencies of manual record-keeping. It includes acknowledgments, problem definitions, objectives, system environments, analysis, design, implementation details, and coding examples. The proposed system enhances data handling, reduces errors, and provides a user-friendly interface for hostel administrators.

Uploaded by

tech4fresherss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 118

The satisfaction that accompanies that the successful completion of any task would

be incomplete without the mention of people whose ceaseless cooperation made it


possible, whose constant guidance and encouragement crown all efforts with
success.
We are grateful to our project guide DR. S.P. KANNOJIA for
the guidance, inspiration and constructive suggestions that helps me in the
preparation of this project.

I am also grateful to my respected mentor, Dr. Puneet Misra


and Dr. Rajesh Kumar Goutam for helping me with the project finalization process
showing confidence in me.
Last but not the least I wish to avail myself of this opportunity,
express a sense of gratitude and love to my friends and my beloved parents for
their manual support, strength and help.

Thanking you all,


Ranjeet kumar gautam
BCA-VI SEM
14001106040
“HOSTEL MANAGEMENT SYSTEM” is software developed for
managing various activities in the hostel. 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 users friendly and more GUI
oriented.
I) ACKNOWLEDEGEMENT
II) ABSTRACT

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

1.1 PROBLEM DEFINITION


This system is designed in favor of the hostel management which helps them to save the records
of the students about their rooms and other things. It helps them from the manual work from
which it is very difficult to find the record of the students and the mess bills of the students, and
the information of about the those ones who had left the hostel. All the hostels at present are
managed manually by the hostel office. The Registration form verification to the different data
processing is done manually. Thus there are a lot of repetitions which can be easily avoided. 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. We can improve the efficiency of
the system, thus overcome the drawbacks of the existing system. We design this system of the
hostel management especially for the college hostel, through this they cannot require so efficient
person to handle and calculate the things. This system automatically calculates all the bills and
issued the notifications for those students who are against some rules.

1.2 OBJECTIVES OF PROJECT

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

2.1 HARDWARE CONFIGURATION

Processor : Pentium

RAM : 512MB

Hard Disk : 40GB

Monitor : 15” Color Monitor

Mouse

Keyboard

2.2 SOFTWARE CONFIGURATION

Operating System : Windows 7


Language : PHP
Database : MYSQL
3. SYSTEM ANALYSIS

3.1 EXISTING SYSTEM

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.

· More human error.


· More strength and strain of manual labor needed
· Repetition of the same procedures.
· Low security
· Data redundancy
· Difficult to handle
· Difficult to update data
· Record keeping is difficult
· Backup data can be easily generated

3.2 PROPOSED SYSTEM


The drawback of the existing system is that it is very difficult to retrieve data from records. It is
difficult to handle the whole system manually and it is less accurate and to keep the data in
records for future reference because it may get destroyed. Moreover it is very difficult to
retrieve data. Redundancy of data may occur and this may lead to the inconsistency. The manual
system is so time-consuming. The proposed system is very easy to operate. Speed and accuracy
are the main advantages of proposed system. There is no redundancy of data. The data are stored
in the computer secondary memories like hard disk, etc. it can be easily receive and used at any
time. The proposed system will easily handle all the data and the work done by the existing
systems. The proposed systems eliminate the drawbacks of the existing system to a great extent
and it provides tight security to data.
3.3 SOFTWARE TOOL USED
The whole Project is divided in two parts the front end and the back end.

3.3.1 Front end

The front end is designed using of Php, css, Java script.

 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.

3.3.2 BACK END-

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

4.1 TABLE DESIGN


The following are the tables that are involved in the proposed system

1. LOGIN

FIELD NAME DATA TYPE

Username Varchar

Password Varchar
2. STUDENT

FIELD NAME DATA TYPE

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

FIELD NAME DATA TYPE

Room_id int

Block_id int

Room_no int

No_of_beds int

Description text

Status varchar

4. FEE DETAILS

FIELD NAME DATA TYPE

Fee_str_id int

course_id int

Fee_type varchar

Cost float

Status varchar
5. COURSE DETAILS

FIELD NAME DATA TYPE

course_id int

course_name varchar

No_of_year int

Status varchar

6. BLOCK DETAILS

FIELD NAME DATA TYPE

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']))

$sqlquery = mysqli_query($dbconnection,"SELECT * FROM employee WHERE


login_id='$_POST[login]' and password='$_POST[emppassword]' and status='Enabled'");

$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
{

$msg1="<p><font color='red'><strong>Failed to login...</strong></font></p>";


}

}
include("header.php");

?>
<div id="templatemo_main">

<div class="col_w900 col_w900_last">

<div class="col_w420 lp_box float_l">

<div class="col_w420 float_r">


<h2> LOG-IN </h2>

<form method="post" action="">

<table class="tftable" width="355" height="138" border="0">

<tr><td>Login Id</td><td><input name="login" type="text" size="40"


class="input_field" /></td></tr>

<tr><td>Password</td><td><input name="emppassword" type="password" size="40"


class="input_field" /></td></tr>

<tr><td colspan=2 align="center"><input name="empsubmit" type="submit"


value="Login"/></td></tr>

</table>

</form>
</p>

</div>

<div class="cleaner">

</div>
</div>

<div class="cleaner"></div>

</div> <!-- end of main -->

</div> <!-- end of wrapper -->


<?php

include("footer.php");

?>
Header.php
<?php

?>

<!DOCTYPE html>

<html >

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Hostel Management System</title>

<link href="templatemo_style.css" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript">

function clearText(field)

if (field.defaultValue == field.value) field.value = '';

else if (field.value == '') field.value = field.defaultValue;

</script>

<link rel="stylesheet" href="css/nivo-slider.css" type="text/css" media="screen" />

<script src="js/jquery.min.js" type="text/javascript"></script>

<script src="script/jquery.nivo.slider.js" type="text/javascript"></script>

<script type="text/javascript">

$(window).load(function() {

$('#slider').nivoSlider({

effect:'random',
slices:10,

animSpeed:800,

pauseTime:1600,

startSlide:1, //Set starting Slide (0 index)

directionNav:false,

directionNavHide:false, //Only show on hover

controlNav:false, //1,2,3...

controlNavThumbs:false, //Use thumbnails for Control Nav

pauseOnHover:true, //Stop animation while hovering

manualAdvance:false, //Force manual transitions

captionOpacity:0.6, //Universal caption opacity

beforeChange: function(){},

afterChange: function(){},

slideshowEnd: function(){} //Triggers after all slides have been shown

});

});

</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;

border-right: 1px solid #54879d;

.navbar li {

height: auto;

width: 137px;

float: left;

text-align: center;

list-style: none;

font: normal bold 12px/1.2em Arial, Verdana, Helvetica;

padding: 0;

margin: 0;

background-color: #366b82;

.navbar a {

padding: 18px 0;

border-left: 1px solid #54879d;


border-right: 1px solid #1f5065;

text-decoration: none;

color: white;

display: block;

.navbar li:hover, a:hover {background-color: #54879d;}

.navbar li ul { display: none;

height: auto;

margin: 0;

padding: 0;

.navbar li:hover ul {

display: block;

.navbar li ul li {background-color: #54879d;}

.navbar li ul li a {

border-left: 1px solid#1f5065;

border-right: 1px solid #1f5065;


border-top: 1px solid #74a3b7;

border-bottom: 1px solid #1f5065;

.navbar li ul li a:hover {background-color: #366b82;}

</style>

</head>

<body class="homepage">

<div id="templatemo_wrapper">

<div id="templatemo_header">

<div id="site_title"><h1><a href="index.php">Hostel Management System</a>


</h1></div>

<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>

<!-- end of templatemo_menu -->


Footer.php
<?php

?>

<html>

<body>

<div id="templatemo_footer_wrapper">

<div id="templatemo_footer">

</div> <!-- end of footer wrapper -->

</div> <!-- end of footer -->

</body>

</html>

Dashboard.php
<?php

include("header.php");

?>

<div id="templatemo_main">

<div class="col_w900 col_w900_last">

<h2><center><font color="#CC33CC" name="caliberi" >


<strong><i>...........WELCOME.........</i></strong></center></h2>
<div id="gallery">

<ul>

<li>

<a href="registration.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/index.jpg" alt="Image 2" />

</a>

</li>

<li>

<a href="viewrooms.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/images (11).jpg" alt="Image 3" />

</a>

</li>

<li class="lmb">

<a href="rooms.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing


elit.">

<img src="images/geehasuki/images.png" alt="Image 5" />

</a>

</li>

<li>

<a href="feetype.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing


elit.">

<img src="images/geehasuki/images (16).jpg" alt="Image 7" />

</a>
</li>

<li>

<a href="course.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing


elit.">

<img src="images/geehasuki/images (12).jpg" alt="Image 8" />

</a>

</li>

<li class="lmb">

<a href="viewcourse.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/images (13).jpg" alt="Image 10" />

</a>

</li>

<li>

<a href="block.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing


elit.">

<img src="images/geehasuki/images (31).jpg" alt="Image 9" />

</a>

</li>

<li>

<a href="viewblocks.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/images (30).jpg" alt="Image 14" />

</a>

</li>

<li>
<a href="fees.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing
elit.">

<img src="images/geehasuki/images (15).jpg" alt="Image 11" />

</a>

</li>

<li>

<a href="students.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing


elit.">

<img src="images/geehasuki/images (25).jpg" alt="Image 12" />

</a>

</li>

<li>

<a href="viewstudent.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/images (18).jpg" alt="Image 13" />

</a>

</li>

<li>

<a href="viewbilling.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/images (20).jpg" alt="Image 12" />

</a>

</li>

<li>

<a href="messbill.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing


elit.">

<img src="images/geehasuki/images (22).jpg" alt="Image 13" />


</a>

</li>

<li class="lmb">

<a href="billing.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing


elit.">

<img src="images/geehasuki/images (21).jpg" alt="Image 10" />

</a>

</li>

<li>

<a href="messcard.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/messcard.jpg" alt="Image 11" />

</a>

</li>

<li>

<a href="viewroomallot.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/images (35).jpg" alt="Image 12" />

</a>

</li>

<li>

<a href="viewfees.php" title="Lorem ipsum dolor sit amet, consectetur adipiscing


elit.">

<img src="images/geehasuki/download (3).jpg" alt="Image 13" />

</a>

</li>
<li>

<a href="viewmesscard.php" title="Lorem ipsum dolor sit amet, consectetur


adipiscing elit.">

<img src="images/geehasuki/mess.jpg" alt="Image 14" />

</a>

</li>

</ul>

<div class="cleaner"></div>

</div>

<div class="cleaner"></div>

</div>

<div class="cleaner"></div>

</div>

</div> <!-- end of wrapper -->

<?php

include("footer.php");

?>

Registration.php
<?php

include("databaseconnection.php");

?>

<script>
function validation()

if(document.form1.stud_type.value=="")

alert("Student Type should not be empty..");

return false;

else if(document.form1.start_date.value=="")

alert("Join date should not be empty..");

return false;

else if(document.form1.end_date.value=="")

alert("End date should not be empty..");

return false;

else if(document.form1.food_type.value=="")

alert("Food Type should not be empty..");

return false;

var dateOne = new Date(document.form1.start_date.value); //Year, Month, Date

var dateTwo = new Date(document.form1.end_date.value); //Year, Month, Date

if (dateOne > dateTwo)


{

alert("Start Date should be greather than End Date..");

return false;

//if (d1 > d2) {

// alert ("do something");

//}

//var firstValue = document.form1.end_date.value.split('-');

//var secondValue = document.form1.start_date.value.split('-');

alert(d1[0]);

/*

if(document.form1.end_date.value > document.form1.start_date.value )

alert("date is not valid");

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

$res="<font color='purple'><strong>Record Updated


Successfully......</strong></font><br>";

$resi=1;

else

$result = mysqli_query($dbconnection,"insert into


registration(stid,room_id,stud_type,start_date,end_date,food_type,beverage_type,status)values('$
_POST[stud_id]','$_POST[room_id]','$_POST[stud_type]','$_POST[start_date]','$_POST[end_d
ate]','$_POST[food_type]','$_POST[beverage_type]','$_POST[status]')");

if(!$result)

echo "Problem in SQL query". mysqli_error();

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>Room Registration</h2>

<p>

<?php

if(isset($_POST['submit']))

echo "<h1>Room registration record submitted successfully...</h1>";

else

{
?>

<form method="post" action="" name="form1" onsubmit="return validation()">

<input type="hidden" name="insid" value="<?php echo $_SESSION['insid']; ?>" />

<input type="hidden" name="stud_id" value="<?php echo $_GET['studentid']; ?>">

<input type="hidden" name="room_id" value="<?php echo $_GET['roomid']; ?>">

<table class="tftable" width="540" height="404" border="1">

<tr>

<td width="87"><strong>Student details</strong></td><td width="215">

<?php

$result=mysqli_query($dbconnection,"SELECT * FROM student left join course ON


course.course_id = student.courseid where stid");

$rs=mysqli_fetch_array($result);

echo "Name: $rs[name]<br>

Course: $rs[course_name]<br>

Roll No.: $rs[rollno]<br>

DOB: $rs[dob]<br>

Gender: $rs[gender]<br>";

?>

</td></tr>

<tr>

<td width="87"><strong>Room details</strong></td><td width="215">

<?php

$resultroom=mysqli_query($dbconnection,"SELECT * FROM room where room_id");

$rsroom =mysqli_fetch_array($resultroom);
echo "Room No.: $rsroom[room_no]<br>";

echo "No. of Beds: $rsroom[no_of_beds]<br>";

$resultblock= mysqli_query($dbconnection,"SELECT * FROM blocks where block_id");

$rsblock =mysqli_fetch_array($resultblock);

echo "Block Name: $rsblock[block_name]<br>";

?>

</td></tr>

<tr><td><strong>Student type</strong></td>

<td><select name="stud_type">

<option value="">Select</option>

<option value="Hosteler">Hosteler</option>

<option value="Day Scholar">Day Scholar</option>

</select>

</td>

</tr>

<tr><td><strong>Join date</strong></td><td><input type="date" name="start_date"


></td></tr>

<tr><td><strong>End date</strong></td><td>

<input type="date" name="end_date">

</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

echo "<input type='hidden' name='status' value='Enabled'>";

?>

<tr><td colspan="2" align="center"><input type="submit" name="submit"></td></tr>

</table>

</form>

<?php

?>

</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");

?>

Viewrooms.php
<?php

session_start();

include("header.php");

include("databaseconnection.php");

?>

<div id="templatemo_main">

<div class="col_w900 col_w900_last">

<a href="dashboard.php" >back</a>

<div class="post_box">

<p>

<form method="get" action="">

<table class="tftable" height="104" border="1" align="center">


<tr>

<td height="28" colspan="2" align="center">Select Block</td>

</tr>

<tr><td width="123" height="38">Block</td><td width="219">

<select name="blockid">

<option value="">Select</option>

<?php

$resultdelid = mysqli_query($dbconnection,"DELETE FROM room where


room_id='$_GET[delid]'");

$rsdel = mysqli_fetch_array($resultdelid);

$resultblocks = mysqli_query($dbconnection,"SELECT * FROM blocks where


status='Enabled'");

while($rsblocks = mysqli_fetch_array($resultblocks))

if($_GET[blockid] ==$rsblocks[block_id] )

echo "<option value='$rsblocks[block_id]' selected>$rsblocks[block_name]</option>";

else

echo "<option value='$rsblocks[block_id]'>$rsblocks[block_name]</option>";

}
?>

</select>

</td></tr>

<tr><td height="28" colspan="2" align="center"><input type="submit" name="submit"


/></td></tr>

</table>

</form>

<hr />

</p>

<div class="cleaner"></div>

</div>

</div>

<div class="cleaner"></div>

</div>

<div id="templatemo_main">

<div class="col_w900 col_w900_last">

<div id="gallery">

<ul>

<?php

$resultrooms = mysqli_query($dbconnection,"SELECT * FROM room where status = 'Enabled'


AND block_id='$_GET[blockid]'");
while($rsrooms = mysqli_fetch_array($resultrooms))

$resultblocks1 = mysqli_query($dbconnection,"SELECT * FROM blocks where


block_id='$rsrooms[block_id]' AND status = 'Enabled'");

$rsblocks1 = mysqli_fetch_array($resultblocks1);

echo "<li><center><a href='rooms.php?editid=$rsrooms[room_id]'>Edit</a> | <a


href='viewrooms.php?delid=$rsrooms[room_id]'>Delete</a></center><hr>

<center><strong><font size='3'>Room No. :


$rsrooms[room_no]</font></strong></center><br>

<strong>&nbsp;&nbsp;Block name: </strong> $rsblocks1[block_name]<br>

<strong>&nbsp;&nbsp;No. of Beds: </strong>";

echo $rsrooms['no_of_beds'];

echo "<br><br>

</li>";

?>

</ul>

<div class="cleaner"></div>

</div>

<div class="cleaner"></div>

</div>

<div class="cleaner"></div>

</div> <!-- end of main -->


</div> <!-- end of wrapper -->

<?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>";
}
?>

<tr><td width="123">Block</td><td width="219">


<select name="block" onchange="showroomno(this.value)" >
<option value="">Select</option>
<?php
$resultblocks = mysqli_query($dbconnection,"SELECT * FROM blocks where
status='Enabled'");
while($rsblocks = mysqli_fetch_array($resultblocks))
{
if($rsblocks[block_id] == $rsrooms[block_id] )
{
echo "<option value='$rsblocks[block_id]'
selected>$rsblocks[block_name]</option>";
}
else
{
echo "<option value='$rsblocks[block_id]'>$rsblocks[block_name]</option>";
}
}
?>
</select>
</td></tr>
<tr><td>Room no</td><td><div id="txtroomno"><input type="text" name="roomno"
value="<?php echo $rsblocks['room_no'] ;?>" /></div></td></tr>
<tr><td>No of beds</td><td><select name="noofbeds">
<option value="">Select</option>
<?php
$arr = array("1","2","3");
foreach($arr as $value)
{
if( $value ==$rsrooms[no_of_beds])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select>
</td></tr>
<tr><td>Discription</td><td><textarea name="discription"><?php echo $rsblocks['description']
;?></textarea></td></tr>
<tr><td>Status</td><td>
<select name="status">
<?php
$arr = array("Enabled","Disabled");
foreach($arr as $value)
{
if($value == $sqlfetch[status])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select>
</td>
</tr>
<tr><td colspan="2" align="center"><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");
?>

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();

$sqlquery = "SELECT * FROM fees_structure WHERE fee_str_id";


$sqlqueryresult = mysqli_query($dbconnection,$sqlquery);
$sqlfetch = mysqli_fetch_array($sqlqueryresult);

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>

<form method="post" action="" name="form1" onsubmit="return validation()">


<input type="hidden" name="insid" value="<?php echo $_SESSION['insid'];?>"/>
<table class="tftable" width="406" height="181" border="2">
<?php
if($resi== 1)
{
echo "<tr><td colspan='2'>
$res
</td></tr>";
}
?>
<tr><td>Fee type</td><td>
<select name="feetype">
<?php
$arr = array("Select","Establishment Fee","Mess Advance","Others");
foreach($arr as $value)
{
if($value == $sqlfetch[fee_type])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select>
</td></tr>
<tr><td>Course</td><td>
<select name="course">
<option value="">Select</option>
<?php
$resultcourse = mysqli_query($dbconnection,"SELECT * FROM course where status =
'Enabled' ");
while($rscourse = mysqli_fetch_array($resultcourse))
{
if($rscourse[course_id] == $sqlfetch[course_id])
{
echo "<option value='$rscourse[course_id]' selected>$rscourse[course_name]</option>";
}
else
{
echo "<option value='$rscourse[course_id]'>$rscourse[course_name]</option>";
}
}
?>
</select></td>
</tr>
<tr><td>Cost</td><td><input type="text" name="cost" value="<?php echo $sqlfetch['cost'] ;
?>" /></td></tr>
<tr><td>Status</td><td><select name="status">
<?php
$arr = array("Enabled","Disabled");
foreach($arr as $value)
{
if($value == $sqlfetch[status])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select>
</td></tr>
<tr><td colspan="2" align="center"><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");
?>

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();

$resultcourse = mysqli_query($dbconnection,"SELECT * FROM course where course_id");


$rscourse = mysqli_fetch_array($resultcourse);

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>

<form method="post" action="" name="form1" onsubmit="return validation()">


<input type="hidden" name="insid" value="<?php echo $_SESSION['insid']; ?>" />
<table class="tftable" width="428" height="142" border="1">
<?php
if($resi==1)
{
echo "<tr><td colspan=2>
$res
</td></tr>";
}
else
{
?>
<tr><td><strong>Course Name</strong></td><td><input type="text" name="coursename"
value="<?php echo $rscourse['course_name']; ?>"></td></tr>
<tr><td><strong>No of Year</strong></td><td><input type="text" name="year" value="<?php
echo $rscourse['no_of_year']; ?>"></td></tr>
<tr><td><strong>Status</strong></td>
<td><select name="status">
<?php
$arr = array("Enabled","Disabled");
foreach($arr as $value)
{
if($value == $rscourse[status])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select>
</td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit" value="Add
course"></td></tr>
<?php
}
?>
</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");
?>

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 -->

</div> <!-- end of wrapper -->

<?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;
}
}
}
}

$resultblocks = mysqli_query($dbconnection,"SELECT * FROM blocks where block_id");


$rsblocks = mysqli_fetch_array($resultblocks);

$_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
{
?>

<tr><td>Block name</td><td> <input type="text" name="blockname" value="<?php echo


$rsblocks[1]; ?>" /></td></tr>
<tr><td>Gender</td><td>
<select name="gender">
<?php
$arr = array("Select","Male","Female");
foreach($arr as $value)
{
if($value == $rsblocks[gender])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select>
</td></tr>
<tr><td>Description</td><td><textarea name="description"><?php echo $rsblocks[3];
?></textarea></td></tr>
<tr><td>Status</td>
<td>
<select name="status">
<?php
$arr = array("Enabled","Disabled");
foreach($arr as $value)
{
if($value == $rsblocks[status])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select>
</td>
</tr>
<tr><td colspan="2"><input type="submit" name="submit" /></td></tr>
<?php
}
?>
</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");
?>

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 -->

</div> <!-- end of wrapper -->

<?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()
{

var datestart = new Date(document.form1.dtst.value); //Year, Month, Date


var dateend = new Date(document.form1.dtdn.value); //Year, Month, Dat
var datebirth = new Date(document.form1.dob.value); //Year, Month, Date

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]))
{

$sql="UPDATE student SET


courseid='$_POST[course]',name='$_POST[name]',rollno='$_POST[rollno]',dob='$_POST[dob]'
,father_name='$_POST[fname]',mother_name='$_POST[mname]',gender='$_POST[b1]',address
='$_POST[address]',contact_no='$_POST[contactno]',parents_no='$_POST[parentsno]',blood_g
roup='$_POST[bloodgroup]',status='$_POST[status]' WHERE stid='$_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;
}
}
}

$sqlquery = "SELECT * FROM student WHERE stid";


$sqlqueryresult = mysqli_query($dbconnection,$sqlquery);
$sqlfetch = mysqli_fetch_array($sqlqueryresult);

$_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>

<form method="post" action="" name="form1" onsubmit="return validation()">


<input type="hidden" name="insid" value="<?php echo $_SESSION[insid]; ?>" />
<table class="tftable" width="407" border="1" >
<?php
if($resi== 1)
{
echo "<tr><td colspan='2'>
$res
</td></tr>";
}
?>
<tr><td>Course</td><td>
<select name="course">
<option value="">Select</option>
<?php
$resultcourse = mysqli_query($dbconnection,"SELECT * FROM course where status =
'Enabled' ");
while($rscourse = mysqli_fetch_array($resultcourse))
{
if($rscourse[course_id] == $sqlfetch[courseid])
{
echo "<option value='$rscourse[course_id]' selected>$rscourse[course_name]</option>";
}
else
{
echo "<option value='$rscourse[course_id]'>$rscourse[course_name]</option>";
}
}
?>
</select></td>
</tr>
<tr><td>Name</td><td><input type="text" name="name" value="<?php echo
ucfirst($sqlfetch['name']); ?>" /></td></tr>
<tr><td>Roll no</td><td><input type="text" name="rollno" value="<?php echo
$sqlfetch['rollno']; ?>" /></td></tr>
<tr><td>Date of Birth</td><td>
<?php
$tomorrow = mktime(0,0,0,date("m"),date("d"),date("Y")-24);
$dtst = date("Y-m-d", $tomorrow);
?>
<input type="hidden" name="dtst" value="<?php echo $dtst; ?>" />

<?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; ?>" />

<input type="date" name="dob" value="<?php echo $sqlfetch['dob']; ?>" /></td></tr>


<tr><td>Father's Name</td><td><input type="text" name="fname" value="<?php echo
$sqlfetch['father_name']; ?>" /></td></tr>
<tr><td>Mother's Name</td><td><input type="text" name="mname" value="<?php echo
$sqlfetch['mother_name']; ?>" /></td></tr>
<tr><td>Gender</td><td>
<input type="radio" name="b1" value="Male"
<?php
if($sqlfetch['gender'] == "Male")
{
echo "checked";
}
?>
/>Male
<input type="radio" name="b1" value="Female"
<?php
if($sqlfetch['gender'] == "Female")
{
echo "checked";
}
?>/>Female
</td></tr>
<tr><td>Address</td><td><textarea name="address"><?php echo $sqlfetch['address'];
?></textarea></td></tr>
<tr><td>Contact No</td><td>
<input type="text" name="contactno" value="<?php echo $sqlfetch['contact_no']; ?>"
maxlength="10" /></td></tr>
<tr><td>Parents No</td><td><input type="text" name="parentsno" value="<?php echo
$sqlfetch['parents_no']; ?>" maxlength="10" /></td></tr>
<tr><td>Blood group</td><td>
<select name="bloodgroup">
<option value="">Select</option>
<?php
$arr = array("A+","O- ","A- ","B+","B-","AB+","AB-","O+");
foreach($arr as $value)
{
if($value == $sqlfetch[blood_group])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select></td></tr>
<tr><td>Status</td><td>
<select name="status" >
<?php
$arr = array("Enabled","Disabled");
foreach($arr as $value)
{
if($value == $sqlfetch[status])
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select>
</td></tr>
<tr><td colspan="2">
<input type="submit" name="submit" value="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");
?>

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">

<div class="col_w900 col_w900_last">


<a href="dashboard.php" >back</a>
<h2>View students</h2>
<table class="tftable" width="915" border="1">
<tr>
<td width="143"><div align="center"><strong>Name</strong></div></td>
<td width="114"><div align="center"><strong>Course details</strong></div></td>
<td width="138"><div align="center"><strong>Profile</strong></div></td>
<td width="183"><div align="center"><strong>Parents</strong></div></td>
<td width="195"><div align="center"><strong>Contact Info</strong></div></td>
<td width="102"><div align="center"><strong>Action</strong></div></td>
</tr>

<?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">

<div class="col_w900 col_w900_last">


<a href="dashboard.php" >back</a>
<h2 align="center">Mess Bill Report</h2>
<table class="tftable" width="851" border="1">
<tr bgcolor="#FFFFCC">
<td><strong>Bill ID</strong></td>
<td><strong>Paid date</strong></td>
<td><strong>Student name</strong></td>
<td><strong>Roll No.</strong></td>
<td><strong>Block</strong></td>
<td><strong>Room No.</strong></td>
<td><strong>Payment type</strong></td>
<td><strong>Paid Amount</strong></td>
</tr>

<?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 -->

</div> <!-- end of wrapper -->

<?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>

<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>Mess Bill id </td><td><input type="text" name="mbid"></td></tr>
<tr><td>Register id </td><td><input type="text" name="regid"></td></tr>
<tr><td>Fees Structure id </td><td><input type="text" name="feestrid"></td></tr>
<tr><td>Date</td><td><input type="date" name="date"></td></tr>
<tr><td>Mess Bill </td><td><input type="text" name="messbill"></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");
?>

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()">

<h2>Invoice details </h2>

<?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>&nbsp; Establishment Fee</td>
<td align='center'>$rs[invoice_date]</td>
<td align='center'>&nbsp; Rs. $rs[total_fees] </td>
</tr>";
$totalfee = $totalfee + $rs['total_fees'];
}

$result=mysqli_query($dbconnection,"SELECT * FROM mess_bill where reg_id");


while($rs=mysqli_fetch_array($result))
{
echo "<tr>
<td>&nbsp; Mess Advance</td>
<td align='center'>$rs[date]</td>
<td align='center'>&nbsp; Rs. $rs[mess_bill] </td>
</tr>";
$totalfee = $totalfee + $rs['mess_bill'];
}

echo "<tr bgcolor='#99FFFF'>


<td colspan='2' align='center'>&nbsp; <strong>Total Invoice : </strong></td>
<td align='center'>&nbsp;<strong> Rs. $totalfee </strong></td>
</tr>";
?>
</table>

<br />
<hr />
<h2>Payment details </h2>

<table class="tftable" width="922" border="1">


<tr align="center" bgcolor="#FFFFCC">
<td height="23"><strong>Payment type</strong></td>
<td><strong>Date</strong></td>
<td><strong>Paid Amount</strong></td>
</tr>
<?php
$paidfee = 0;
$result=mysqli_query($dbconnection,"SELECT * FROM billing where reg_id");
while($rs=mysqli_fetch_array($result))
{
echo "<tr>
<td>&nbsp; $rs[bill_type]</td>
<td align='center'>$rs[paid_date]</td>
<td align='center'>&nbsp; Rs. $rs[paid_amt] </td>
</tr>";
$paidfee = $paidfee + $rs['paid_amt'];
}

echo "<tr bgcolor='#99FFFF'>


<td colspan='2' align='center'>&nbsp; <strong>Total Paid amount: </strong></td>
<td align='center'>&nbsp;<strong> Rs. $paidfee </strong></td>
</tr>";
$remainingfee = $totalfee - $paidfee;
echo "<tr bgcolor='#99FFFF'>
<td colspan='2' align='center'>&nbsp; <strong>Remaining Fee: </strong></td>
<td align='center'>&nbsp;<strong> Rs. $remainingfee </strong></td>
</tr>";
?>

</table>
<br />
<?php
if($msg == 1)
{
echo $msg;
?>

<?php
}
else
{
?>

<input type="hidden" name="remainingfee" value="<?php echo $remainingfee; ?>" />


<input type="hidden" name="insid" value="<?php echo $_SESSION[insid]; ?>" />
<table class="tftable" width="555" border="1" align="center">
<tr>
<td><strong>Payment type</strong></td>
<td><select name="billtype">
<option value="Select">Select</option>
<option value="Cash">Cash</option>
<option value="Credit card">Credit card</option>
<option value="Debit card">Debit card</option>
</select>
</td></tr>
<tr><td><strong>Paid Amount </strong></td><td><input type="text"
name="paidamt"></td></tr>
<tr><td><strong>Paid Date </strong></td><td><input type="date"
name="paiddate"></td></tr>
<tr><td colspan="2" align="center"><input name="submit" type="submit" value="Make
payment"></td></tr>
<?php
}
?>
</table>
</form>
<strong><a href='viewstudentdetails.php?studentid=<?php echo $_GET['studentid'];
?>'>Back</a></strong>
</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");
?>

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();

$resultstinfo = mysqli_query($dbconnection,"SELECT registration.*, student.*, student.stid


AS Expr1 FROM student INNER JOIN registration ON student.stid = registration.stid
WHERE student.stid ");
$rsstinfo =mysqli_fetch_array($resultstinfo);

?>
<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
{
?>

<form method="post" action="" name="form1" onsubmit="return validation()">


<input type="hidden" name="insid" value="<?php echo $_SESSION[insid]; ?>" />
<table class="tftable" width="475" border="1">
<tr>
<td>&nbsp;Name</td>
<td>&nbsp;<?php echo $rsstinfo['name']; ?></td>
</tr>
<tr><td width="87">&nbsp;Roll No. </td><td width="215">&nbsp;<?php echo
$rsstinfo['rollno']; ?> </td></tr>
<tr><td>&nbsp; Food type</td><td><?php echo $rsstinfo['food_type']; ?></td></tr>
<tr><td width="87">&nbsp;Beverage type. </td><td><?php echo $rsstinfo['beverage_type'];
?></td></tr>
<tr><td width="87">&nbsp;Messcard type. </td><td>
<select name="messcardtype">
<option value="Temporary">Temporary</option>
<option value="Permenent">Permenent</option>
</select>
</td></tr>
<tr><td>&nbsp; Start date</td><td><input type="date" name="start_date"></td></tr>
<tr><td>&nbsp; End date</td><td><input type="date" name="enddate"></td></tr>
<tr><td>&nbsp; Status</td><td>
<select name="status">
<option value="Enabled">Enabled</option>
<option value="Disabled">Disabled</option>
</select>
</td>
</tr>
<tr><td colspan="2"><input type="submit" name="submit"></td></tr>
</table>
</form>
<?php
}
?>
</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");
?>

Viewroomallot.php
<?php

session_start();

include("databaseconnection.php");

$_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>View Room allotment</h2>

<p>

<script>

function ConfirmDelete()

var result=confirm("Are you sure want to delete this record?");

if(result==true)

return true;

else

return false;

</script>

<?php

$delrec=mysqli_query($dbconnection,"DELETE FROM block_allotment where


allotment_id='$_GET[delid]'");

?>

<table class="tftable" width="577" border="1">

<tr>

<td width="125" align="center"><strong>Block</strong></td>


<td width="154" align="center"><strong>Course</strong></td>

<!-- <td width="146" align="center"><strong>Status</strong></td> -->

<td width="124" align="center"><strong>Action</strong></td>

</tr>

<?php

$result=mysqli_query($dbconnection,"SELECT block_allotment.*, course.*

FROM block_allotment LEFT OUTER JOIN

course ON block_allotment.course_id = course.course_id");

while($rs=mysqli_fetch_array($result))

$result1=mysqli_query($dbconnection,"SELECT * FROM blocks where block_id =


'$rs[block_id]'");

$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>

<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");

?>

Viewfees.php
<?php

session_start();

include("header.php");

include("databaseconnection.php");

?>
<div id="templatemo_main">

<div class="col_w900 col_w900_last">

<a href="dashboard.php" >back</a>

<h2 align="center">Fee Report</h2>

<script>

function ConfirmDelete()

var result=confirm("Are you sure want to delete this record?");

if(result==true)

return true;

else

return false;

</script>

<table class="tftable" width="919" border="1">

<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

$result=mysqli_query($dbconnection,"SELECT fees.*, registration.*, student.*,


student.courseid AS Expr1, course.*, room.*, blocks.*

FROM student INNER JOIN

registration ON student.stid = registration.stid INNER JOIN

course ON student.courseid = course.course_id INNER JOIN

room ON registration.room_id = room.room_id INNER JOIN

blocks ON room.block_id = blocks.block_id RIGHT OUTER JOIN

fees ON registration.reg_id = fees.reg_id");

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>

<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 -->

</div> <!-- end of wrapper -->

<?php

include("footer.php");

?>

Viewmesscard.php
<?php

session_start();

include("header.php");

include("databaseconnection.php");

?>

<div id="templatemo_main">

<div class="col_w900 col_w900_last">

<a href="dashboard.php" >back</a>

<script>

function ConfirmDelete()

var result=confirm("Are you sure want to delete this record?");

if(result==true)
{

return true;

else

return false;

</script>

<?php

$delrec=mysqli_query($dbconnection,"DELETE FROM messcard where


messcard_id='$_GET[delid]'");

?>

<h1>View Mess card</h1>

<table class="tftable" width="584" border="1">

<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

$result=mysqli_query($dbconnection,"SELECT * FROM messcard");

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>

<td align='center'><a href='viewmesscard.php?delid=$rs[messcardid]'onclick='return


ConfirmDelete()'>Delete</a></td>

</tr>";

?>

</table>

<div class="cleaner"></div>

</div> <!-- end of main -->

</div> <!-- end of wrapper -->

<?php

include("footer.php");

?>
6. SYSTEM TESTING

6.1 UNIT 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.

6.2 INTEGRATION TESTING

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.

The expanded functionality of today’s software requires an appropriate approach


towards software development. This hostel management software is designed for people who
want to manage various activities in the hostel. 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.

You might also like