宿舍管理系统
此项目是一个使用Apache服务器和MySQL 5.62的宿舍管理系统项目。 系统分为两个模块,管理模块和用户模块。使用的网络浏览器有Mozilla、谷歌浏览器、IE8、OPERA。使用用户界面设计有HTML,AJAX,JQUERY,JAVASCRIPT。安装步骤:1.在本地系统上下载并解压缩文件,2.将此文件放入xampp / htdocs /中,3.数据库配置。下载附件能够更加详细的了解。
应用介绍
此项目是一个使用Apache服务器和MySQL 5.62的宿舍管理系统项目。 系统分为两个模块,管理模块和用户模块。使用的网络浏览器有Mozilla、谷歌浏览器、IE8、OPERA。本人只展示了一部分php代码,如想详细了解请点击下方链接下载附件。
<?php
session_start();
include('includes/config.php');
include('includes/checklogin.php');
check_login();
//code for registration
if(isset($_POST['submit']))
{
$roomno=$_POST['room'];
$seater=$_POST['seater'];
$feespm=$_POST['fpm'];
$foodstatus=$_POST['foodstatus'];
$stayfrom=$_POST['stayf'];
$duration=$_POST['duration'];
$course=$_POST['course'];
$regno=$_POST['regno'];
$fname=$_POST['fname'];
$mname=$_POST['mname'];
$lname=$_POST['lname'];
$gender=$_POST['gender'];
$contactno=$_POST['contact'];
$emailid=$_POST['email'];
$emcntno=$_POST['econtact'];
$gurname=$_POST['gname'];
$gurrelation=$_POST['grelation'];
$gurcntno=$_POST['gcontact'];
$caddress=$_POST['address'];
$ccity=$_POST['city'];
$cstate=$_POST['state'];
$cpincode=$_POST['pincode'];
$paddress=$_POST['paddress'];
$pcity=$_POST['pcity'];
$pstate=$_POST['pstate'];
$ppincode=$_POST['ppincode'];
$query="insert into registration(roomno,seater,feespm,foodstatus,stayfrom,duration,course,regno,firstName,middleName,lastName,gender,contactno,emailid,egycontactno,guardianName,guardianRelation,guardianContactno,corresAddress,corresCIty,corresState,corresPincode,pmntAddress,pmntCity,pmnatetState,pmntPincode) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt = $mysqli->prepare($query);
$rc=$stmt->bind_param('iiiisisissssisississsisssi',$roomno,$seater,$feespm,$foodstatus,$stayfrom,$duration,$course,$regno,$fname,$mname,$lname,$gender,$contactno,$emailid,$emcntno,$gurname,$gurrelation,$gurcntno,$caddress,$ccity,$cstate,$cpincode,$paddress,$pcity,$pstate,$ppincode);
$stmt->execute();
echo"<script>alert('Student Succssfully register');</script>";
}
?>
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="theme-color" content="#3e454c">
<title>Student Hostel Registration</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">>
<link rel="stylesheet" href="css/bootstrap-social.css">
<link rel="stylesheet" href="css/bootstrap-select.css">
<link rel="stylesheet" href="css/fileinput.min.css">
<link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="js/jquery-1.11.3-jquery.min.js"></script>
<script type="text/javascript" src="js/validation.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script>
function getSeater(val) {
$.ajax({
type: "POST",
url: "get_seater.php",
data:'roomid='+val,
success: function(data){
//alert(data);
$('#seater').val(data);
}
});
$.ajax({
type: "POST",
url: "get_seater.php",
data:'rid='+val,
success: function(data){
//alert(data);
$('#fpm').val(data);
}
});
}
</script>
</head>
<body>
<?php include('includes/header.php');?>
<div class="ts-main-content">
<?php include('includes/sidebar.php');?>
<div class="content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h2 class="page-title">Registration </h2>
<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">Fill all Info</div>
<div class="panel-body">
<form method="post" action="" class="form-horizontal">
<?php
$uid=$_SESSION['login'];
$stmt=$mysqli->prepare("SELECT emailid FROM registration WHERE emailid=? ");
$stmt->bind_param('s',$uid);
$stmt->execute();
$stmt -> bind_result($email);
$rs=$stmt->fetch();
$stmt->close();
if($rs)
{ ?>
<h3 style="color: red" align="left">Hostel already booked by you</h3>
<?php }
else{
echo "";
}
?>
<div class="form-group">
<label class="col-sm-4 control-label"><h4 style="color: green" align="left">Room Related info </h4> </label>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Room no. </label>
<div class="col-sm-8">
<select name="room" id="room"class="form-control" onChange="getSeater(this.value);" onBlur="checkAvailability()" required>
<option value="">Select Room</option>
<?php $query ="SELECT * FROM rooms";
$stmt2 = $mysqli->prepare($query);
$stmt2->execute();
$res=$stmt2->get_result();
while($row=$res->fetch_object())
{
?>
<option value="<?php echo $row->room_no;?>"> <?php echo $row->room_no;?></option>
<?php } ?>
</select>
<span id="room-availability-status" style="font-size:12px;"></span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Seater</label>
<div class="col-sm-8">
<input type="text" name="seater" id="seater" class="form-control" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Fees Per Month</label>
<div class="col-sm-8">
<input type="text" name="fpm" id="fpm" class="form-control" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Food Status</label>
<div class="col-sm-8">
<input type="radio" value="0" name="foodstatus" checked="checked"> Without Food
<input type="radio" value="1" name="foodstatus"> With Food(Rs 2000.00 Per Month Extra)
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Stay From</label>
<div class="col-sm-8">
<input type="date" name="stayf" id="stayf" class="form-control" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Duration</label>
<div class="col-sm-8">
<select name="duration" id="duration" class="form-control">
<option value="">Select Duration in Month</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Total Amount</label>
<div class="col-sm-8">
<input type="text" name="ta" id="ta" class="result form-control" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><h4 style="color: green" align="left">Personal info </h4> </label>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">course </label>
<div class="col-sm-8">
<select name="course" id="course" class="form-control" required>
<option value="">Select Course</option>
<?php $query ="SELECT * FROM courses";
$stmt2 = $mysqli->prepare($query);
$stmt2->execute();
$res=$stmt2->get_result();
while($row=$res->fetch_object())
{
?>
<option value="<?php echo $row->course_fn;?>"><?php echo $row->course_fn;?> (<?php echo $row->course_sn;?>)</option>
<?php } ?>
</select> </div>
</div>
<?php
$aid=$_SESSION['id'];
$ret="select * from userregistration where id=?";
$stmt= $mysqli->prepare($ret) ;
$stmt->bind_param('i',$aid);
$stmt->execute() ;//ok
$res=$stmt->get_result();
//$cnt=1;
while($row=$res->fetch_object())
{
?>
<div class="form-group">
<label class="col-sm-2 control-label">Registration No : </label>
<div class="col-sm-8">
<input type="text" name="regno" id="regno" class="form-control" value="<?php echo $row->regNo;?>" readonly >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">First Name : </label>
<div class="col-sm-8">
<input type="text" name="fname" id="fname" class="form-control" value="<?php echo $row->firstName;?>" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Middle Name : </label>
<div class="col-sm-8">
<input type="text" name="mname" id="mname" class="form-control" value="<?php echo $row->middleName;?>" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Last Name : </label>
<div class="col-sm-8">
<input type="text" name="lname" id="lname" class="form-control" value="<?php echo $row->lastName;?>" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Gender : </label>
<div class="col-sm-8">
<input type="text" name="gender" value="<?php echo $row->gender;?>" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Contact No : </label>
<div class="col-sm-8">
<input type="text" name="contact" id="contact" value="<?php echo $row->contactNo;?>" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Email id : </label>
<div class="col-sm-8">
<input type="email" name="email" id="email" class="form-control" value="<?php echo $row->email;?>" readonly>
</div>
</div>
<?php } ?>
<div class="form-group">
<label class="col-sm-2 control-label">Emergency Contact: </label>
<div class="col-sm-8">
<input type="text" name="econtact" id="econtact" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Guardian Name : </label>
<div class="col-sm-8">
<input type="text" name="gname" id="gname" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Guardian Relation : </label>
<div class="col-sm-8">
<input type="text" name="grelation" id="grelation" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Guardian Contact no : </label>
<div class="col-sm-8">
<input type="text" name="gcontact" id="gcontact" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><h4 style="color: green" align="left">Correspondense Address </h4> </label>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Address : </label>
<div class="col-sm-8">
<textarea rows="5" name="address" id="address" class="form-control" required="required"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">City : </label>
<div class="col-sm-8">
<input type="text" name="city" id="city" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">State </label>
<div class="col-sm-8">
<select name="state" id="state"class="form-control" required>
<option value="">Select State</option>
<?php $query ="SELECT * FROM states";
$stmt2 = $mysqli->prepare($query);
$stmt2->execute();
$res=$stmt2->get_result();
while($row=$res->fetch_object())
{
?>
<option value="<?php echo $row->State;?>"><?php echo $row->State;?></option>
<?php } ?>
</select> </div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Pincode : </label>
<div class="col-sm-8">
<input type="text" name="pincode" id="pincode" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><h4 style="color: green" align="left">Permanent Address </h4> </label>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">Permanent Address same as Correspondense address : </label>
<div class="col-sm-4">
<input type="checkbox" name="adcheck" value="1"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Address : </label>
<div class="col-sm-8">
<textarea rows="5" name="paddress" id="paddress" class="form-control" required="required"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">City : </label>
<div class="col-sm-8">
<input type="text" name="pcity" id="pcity" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">State </label>
<div class="col-sm-8">
<select name="pstate" id="pstate"class="form-control" required>
<option value="">Select State</option>
<?php $query ="SELECT * FROM states";
$stmt2 = $mysqli->prepare($query);
$stmt2->execute();
$res=$stmt2->get_result();
while($row=$res->fetch_object())
{
?>
<option value="<?php echo $row->State;?>"><?php echo $row->State;?></option>
<?php } ?>
</select> </div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Pincode : </label>
<div class="col-sm-8">
<input type="text" name="ppincode" id="ppincode" class="form-control" required="required">
</div>
</div>
<div class="col-sm-6 col-sm-offset-4">
<button class="btn btn-default" type="submit">Cancel</button>
<input type="submit" name="submit" Value="Register" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/dataTables.bootstrap.min.js"></script>
<script src="js/Chart.min.js"></script>
<script src="js/fileinput.js"></script>
<script src="js/chartData.js"></script>
<script src="js/main.js"></script>
</body>
<script type="text/javascript">
$(document).ready(function(){
$('input[type="checkbox"]').click(function(){
if($(this).prop("checked") == true){
$('#paddress').val( $('#address').val() );
$('#pcity').val( $('#city').val() );
$('#pstate').val( $('#state').val() );
$('#ppincode').val( $('#pincode').val() );
}
});
});
</script>
<script>
function checkAvailability() {
$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'roomno='+$("#room").val(),
type: "POST",
success:function(data){
$("#room-availability-status").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#duration').keyup(function(){
var fetch_dbid = $(this).val();
$.ajax({
type:'POST',
url :"ins-amt.php?action=userid",
data :{userinfo:fetch_dbid},
success:function(data){
$('.result').val(data);
}
});
})});
</script>
</html>
©版权声明:本文内容由互联网用户自发贡献,版权归原创作者所有,本站不拥有所有权,也不承担相关法律责任。如果您发现本站中有涉嫌抄袭的内容,欢迎发送邮件至: www_apollocode_net@163.com 进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。
转载请注明出处: apollocode » 宿舍管理系统
文件列表(部分)
名称 | 大小 | 修改日期 |
---|---|---|
Hostel management System Project | 0.00 KB | 2019-06-10 |
hostel | 0.00 KB | 2019-06-26 |
access-log.php | 3.24 KB | 2019-06-32 |
admin | 0.00 KB | 2019-06-26 |
access-log.php | 3.23 KB | 2019-06-26 |
add-courses.php | 3.70 KB | 2016-04-22 |
admin-profile.php | 7.52 KB | 2016-06-06 |
check_availability.php | 0.91 KB | 2016-06-06 |
create-room.php | 4.21 KB | 2016-06-36 |
css | 0.00 KB | 2019-06-26 |
awesome-bootstrap-checkbox.css | 6.58 KB | 2016-04-22 |
bootstrap-select.css | 6.49 KB | 2016-04-22 |
bootstrap-social.css | 33.04 KB | 2016-04-22 |
bootstrap.min.css | 122.06 KB | 2016-04-22 |
css | 0.00 KB | 2019-06-26 |
vars.css | 0.17 KB | 2016-04-22 |
dataTables.bootstrap.min.css | 4.15 KB | 2016-04-22 |
datatables.min.css | 123.58 KB | 2016-04-22 |
fileinput.min.css | 3.29 KB | 2016-04-22 |
font-awesome.min.css | 26.08 KB | 2016-04-22 |
jquery.dataTables.min.css | 13.30 KB | 2016-04-24 |
less | 0.00 KB | 2019-06-26 |
components.less | 8.12 KB | 2016-04-24 |
vars.less | 1.03 KB | 2016-04-24 |
style.css | 12.74 KB | 2016-06-54 |
style.less | 4.68 KB | 2016-04-24 |
dashboard.php | 4.89 KB | 2019-06-06 |
edit-course.php | 4.00 KB | 2016-04-24 |
edit-room.php | 3.95 KB | 2016-04-24 |
fonts | 0.00 KB | 2019-06-26 |
fontawesome-webfont.eot | 67.26 KB | 2016-04-24 |
fontawesome-webfont.svg | 347.64 KB | 2016-04-24 |
发表评论 取消回复