Signed-off-by: gaoyuheng <gaoyuheng@yuheng.hl.cn>

This commit is contained in:
2025-04-04 21:54:50 +08:00
parent 094c3ea04d
commit a4f8ba4440
157 changed files with 7732 additions and 0 deletions

176
admin/student/add_order.php Normal file
View File

@@ -0,0 +1,176 @@
<?php
/**
* Created by PhpStorm.
* User: 唐佩良
* Date: 2018/4/14
* Time: 18:39
*/
include_once("../../common/init.php");
check_loginuser();
$tb_name = "orders";
$cars_id = intval($_GET['carsid']);
if(!$cars_id){
goBakMsg("缺少参数carsid");
exit();
}
$rs1 = db_get_row("select * from cars where id={$cars_id}");
$row1 = db_get_row("select * from yajin where studentid='". $_SESSION["stuname"] ."'");
if (!$row1["id"]) {
goBakMsg("没有交押金!");
die;
}else{
if ($row1["price"]<300) {
goBakMsg("押金不够!");
die;
}
}
if(!empty($_POST['submit'])){
$data = array();
$data["status"] = "'借出'";
$data["studentid"] = "'".$_SESSION["stuname"]."'";
$data["carsid"] = "'".$_POST["carsid"]."'";
$data["carstitle"] = "'".$_POST["carstitle"]."'";
$data["endtime"] = "'".$_POST["endtime"]."'";
$data["begintime"] = "'".$_POST["begintime"]."'";
$data["price"] = "'".$_POST["price"]."'";
$res = db_add($tb_name,$data);
if($res > 0){
db_query("update cars set status='借出' where id=".$_POST["carsid"]);
urlMsg("操作成功",'orders.php');
exit();
}
else{
goBakMsg("借车失败");
}
}
?>
<?php include_once("base.php");?>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17" rowspan="2" valign="top" bgcolor="#FFFFFF"></td>
<td valign="top">
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF"><td height="31"><div class="title">添加订单</div></td></tr>
</table>
</td>
<td width="16" rowspan="2" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td valign="top" bgcolor="#F7F8F9">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="4" height="10"></td></tr>
<tr>
<td width="1%">&nbsp;</td>
<td width="96%">
<table width="100%">
<tr>
<td colspan="2">
<form name="add" method="post" action="">
<input type="hidden" name="carsid" value="<?php echo $rs1["id"];?>" />
<input type="hidden" name="carstitle" value="<?php echo $rs1["title"];?>" />
<input type="hidden" name="submit" value="1" />
<input id="price2" type="hidden" name="price" value="0" />
<table width="100%" class="cont">
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right">车牌号:</td>
<td width="200"><?php echo $rs1["title"];?></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right">学号:</td>
<td width="200"><?php echo $_SESSION["stuname"] ?></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right">提车日期:</td>
<td width="200"><script language="javascript" type="text/javascript" src="../../My97DatePicker/WdatePicker.js"></script>
<input name="begintime" id="datepicker1" onchange="dateChange()" onClick="WdatePicker()" style="width:350px;" class="text" value="<?php echo $rs["begintime"];?>" required></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right">还车日期:</td>
<td width="200"><script language="javascript" type="text/javascript" src="../../My97DatePicker/WdatePicker.js"></script>
<input name="endtime" id="datepicker2" onchange="dateChange()" onClick="WdatePicker()" style="width:350px;" class="text" value="<?php echo $rs["endtime"];?>" required></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right">预计金额:</td>
<td width="200" id="price"></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right"><input class="btn" type="submit" value="提交" onclick='return check()' /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
<td width="1%">&nbsp;</td>
</tr>
<tr><td height="20"></td></tr>
</table>
</td>
</tr>
</table>
<script>
function dateChange() {
var start = $("#datepicker1").val();
var end = $("#datepicker2").val();
if(start && end){
var time = getTime2Time(end,start);
if(time == 0){
time = 1;
}
var sum = time * 1;
$("#price").text(sum);
$("#price2").val(sum);
}else{
$("#price").text('0');
$("#price2").val('0');
}
}
function check() {
var start = $("#datepicker1").val();
var end = $("#datepicker2").val();
if(start && end){
dateChange();
return true
}
alert('请选择时间');
return false;
}
function getTime2Time(time1, time2)
{
time1 = Date.parse(time1)/1000;
time2 = Date.parse(time2)/1000;
var time_ = time1 - time2;
return (time_/(3600*24));
}
</script>
</body>
</html>

View File

@@ -0,0 +1,81 @@
<?php
include_once("../../common/init.php");
check_loginuser();
$order_id = intval($_GET['order_id']);
if(!$order_id){
goBakMsg("缺少参数order_id");
exit();
}
$cars_id = intval($_GET['carsid']);
if(!$cars_id){
goBakMsg("缺少参数carsid");
exit();
}
$order = db_get_row("select * from `orders` where id={$order_id}");
$cars = db_get_row("select * from `cars` where id={$cars_id}");
?>
<?php include_once("base.php");?>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17" rowspan="2" valign="top" bgcolor="#FFFFFF"></td>
<td valign="top">
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF"><td height="31"><div class="title">添加订单</div></td></tr>
</table>
</td>
<td width="16" rowspan="2" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td valign="top" bgcolor="#F7F8F9">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="4" height="10"></td></tr>
<tr>
<td width="1%">&nbsp;</td>
<td width="96%">
<table width="100%">
<tr>
<td colspan="2">
<form name="add" method="post" action="baoxiu_order.php">
<input type="hidden" name="carsid" value="<?php echo $cars_id;?>" />
<input type="hidden" name="order_id" value="<?php echo $order_id;?>" />
<table width="100%" class="cont">
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right">车牌号:</td>
<td width="200"><?php echo $cars["title"];?></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right">报修原因:</td>
<td width="200"><textarea name="content"></textarea></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right"><input class="btn" type="submit" value="提交" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
<td width="1%">&nbsp;</td>
</tr>
<tr><td height="20"></td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,65 @@
<?php
/**
* Created by PhpStorm.
* User: 唐佩良
* Date: 2018/4/15
* Time: 0:57
*/
include_once("../../common/init.php");
check_loginuser();
$tb_name = "orders";
$order_id = intval($_POST['order_id']);
if(!$order_id){
goBakMsg("缺少参数order_id");
exit();
}
$cars_id = intval($_POST['carsid']);
if(!$cars_id){
goBakMsg("缺少参数carsid");
exit();
}
$order = db_get_row("select * from {$tb_name} where id={$order_id}");
//把车设为维修
db_query("update cars set status='维修' where id={$cars_id}");
//扣除押金
$date_now = date('Y-m-d');
$date = diffBetweenTwoDays($order['begintime'],$date_now);
if($date == 0){
$date = 1;
}
$price = 1 * $date;
db_query("update yajin set price=price-".$price." where studentid='{$_SESSION['stuname']}'");
//把订单设为已归还
db_query("update {$tb_name} set status='已归还',`price`={$price},`endtime`='{$date_now}' where `id`='{$order_id}'");
//添加维修信息
$insert_arr = array(
'carsid' => $cars_id,
'content' => "'".addslashes($_POST['content'])."'"
);
db_add('baoxiu',$insert_arr);
function diffBetweenTwoDays ($day1, $day2)
{
$second1 = strtotime($day1);
$second2 = strtotime($day2);
if ($second1 < $second2) {
$tmp = $second2;
$second2 = $second1;
$second1 = $tmp;
}
return ($second1 - $second2) / 86400;
}
?>
<body>
<h3>报修成功<br>本次借车:<?php echo $date?>天<br>开始借车时间:<?php echo $order['begintime']?><br>还车时间:<?php echo date('Y-m-d')?><br>共扣除金额:<?php echo $price?>元</h3>
</body>
</html>

7
admin/student/base.php Normal file
View File

@@ -0,0 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../style/skin.css" />
<script type="text/javascript" src="../style/jquery.js"></script>
</head>

19
admin/student/index.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
include_once("../../common/init.php");
check_loginuser();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $CONFIG["webname"];?></title>
</head>
<frameset rows="88,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="top.php" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
<frameset cols="187,*" frameborder="no" border="0" framespacing="0">
<frame src="left.php" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
<frame src="main.php" name="main" id="main" title="main" />
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>

67
admin/student/left.php Normal file
View File

@@ -0,0 +1,67 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1">
<title>无标题文档</title>
<link href="../skin/index/css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../skin/index/js/jquery.js"></script>
<script type="text/javascript">
$(function(){
//导航切换
$(".menuson li").click(function(){
$(".menuson li.active").removeClass("active")
$(this).addClass("active");
});
$('.title').click(function(){
var $ul = $(this).next('ul');
$('dd').find('ul').slideUp();
if($ul.is(':visible')){
$(this).next('ul').slideUp();
}else{
$(this).next('ul').slideDown();
}
});
})
</script>
</head>
<body style="background:#f0f9fd;">
<div class="lefttop"><span></span>系统管理</div>
<dl class="leftmenu">
<dd>
<div class="title">
<span></span>管理信息
</div>
<ul class="menuson">
<li><cite></cite><a href='password.php' target='main'>修改资料</a><i></i></li>
</ul>
</dd>
<dd><div class="title">
<span></span>缴纳押金
</div>
<ul class="menuson">
<li><cite></cite><a href='main.php' target='main'>我的押金</a><i></i></li>
<li><cite></cite><a href='yajin_add.php' target='main'>缴纳押金</a><i></i></li>
</ul>
</dd>
<dd><div class="title">
<span></span>租赁信息
</div>
<ul class="menuson">
<li><cite></cite><a href='stu_jieche.php' target='main'>车辆租赁</a><i></i></li>
<li><cite></cite><a href='orders.php' target='main'>租赁信息</a><i></i></li>
<li><cite></cite><a href='map.php' target='main'>车辆地图</a><i></i></li>
</ul>
</dd>
</dl>
</body>
</html>

48
admin/student/main.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
include_once("../../common/init.php");
check_loginuser();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $CONFIG["webname"];?></title>
<link href="../skin/index/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../skin/index/js/jquery.js"></script>
</head>
<body>
<div class="place">
<span>位置:</span>
<ul class="placeul">
<li><a href="#">后台首页</a></li>
</ul>
</div>
<div class="mainindex">
<div class="welinfo">
欢迎来到用户中心,
<?php
$row = db_get_row("select * from yajin where userid='". $_SESSION["studentid"] ."'");
if ($row["id"]) {
if($row["price"]<300)
{
echo("您的押金为: ".$row["price"]." 元,请充值!!");
}
else
{
echo("您的押金为: ".$row["price"]." 元!!");
}
}
else{echo("请先缴纳300元押金谢谢!!");}
?>
</div>
<div class="xline"></div>
</div>
</body>
</html>

57
admin/student/map.php Normal file
View File

@@ -0,0 +1,57 @@
<?php
include_once("../../common/init.php");
check_loginuser();
$tb_name = "cars";
$page = $_REQUEST["page"]?$_REQUEST["page"]:1;
$list = db_get_all("select * from $tb_name where `status`='正常' order by id desc");
?>
<?php include_once("base.php");?>
<style>
.map_box{height: 600px;}
</style>
<body>
<h2 style="text-align: center;margin: 15px">点击车辆可以直接租赁</h2>
<div id="mapBox" class="map_box"></div>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.6&key=ea1a7b8b8265fda0230e7235809a6037"></script>
<script>
var list = <?php echo json_encode($list)?>;
console.log(list)
var map = new AMap.Map('mapBox', {
resizeEnable: true,
mapStyle: 'amap://styles/c94e78bbbdccdee5a21c45f18da575b1'//样式URL
});
map.plugin('AMap.Geolocation', function() {
geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位默认无穷大
buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量默认Pixel(10, 20)
zoomToAccuracy: true, //定位成功后调整地图视野范围使定位位置及精度范围视野内可见默认false
buttonPosition:'RB'
});
map.addControl(geolocation);
geolocation.getCurrentPosition();
});
for (var i=0;i<list.length;i++){
if(list[i].lat > 0 && list[i].lng >0){
var marker = new AMap.Marker({
icon: "http://webapi.amap.com/theme/v1.3/markers/n/mark_r.png",
position: [list[i].lat,list[i].lng], //基点位置
draggable: true, //是否可拖动
});
marker.setMap(map);
marker.setLabel({//label默认蓝框白底左上角显示样式className为amap-marker-label
offset: new AMap.Pixel(-40, -25),//修改label相对于maker的位置
content: "车牌号:"+list[i].title
});
marker.carinfo = list[i];
AMap.event.addListener(marker, 'click', function (e) {
window.location.href = "add_order.php?carsid="+e.target.carinfo.id;
});
}
}
</script>
</body>
</html>

105
admin/student/orders.php Normal file
View File

@@ -0,0 +1,105 @@
<?php
include_once("../../common/init.php");
check_loginuser();
$categoryA = db_get_all("select * from category order by id desc");
$tb_name = "orders";
$where_sql = " 1=1 ";
if ($_REQUEST["title"]) {
$where_sql .= " and carstitle like '%". $_REQUEST["title"] ."%' ";
}
if ($_REQUEST["status"]) {
$where_sql .= " and status ='". $_REQUEST["status"] ."'";
}
$page = $_REQUEST["page"]?$_REQUEST["page"]:1;
//echo "select * from $tb_name where $where_sql and studentid='".$_SESSION["stuname"]."' order by id desc";
//die;
$list = db_get_page("select * from $tb_name where $where_sql and studentid='".$_SESSION["stuname"]."' order by id desc", $page,11);
if ($page*1>$list["page"]*1){
$page = $list["page"];
}
$Page = new PageWeb($list["total"],$list["page_size"], "title=".$_REQUEST["title"]."&status=".$_REQUEST["status"], $page);
$page_show = $Page->show();
?>
<?php include_once("base.php");?>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17" rowspan="2" valign="top" bgcolor="#FFFFFF"></td>
<td valign="top">
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF"><td height="31"><div class="title">订单管理</div></td></tr>
</table>
</td>
<td width="16" rowspan="2" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td valign="top" bgcolor="#F7F8F9">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="4" height="10"></td></tr>
<tr><td width="1%">&nbsp;</td><td width="96%">
<table width="100%" class="cont">
<tr>
<td width="1%"></td>
<td>
<form id="pagerForm" action="?" method="post">
<input type="hidden" name="pageNum" value="<?php echo $page; ?>"/>
<select name="status">
<option value="">选择状态</option>
<option value="借出" <?php if($_REQUEST["status"]=="借出"){echo "selected";}?>>借出</option>
<option value="已归还" <?php if($_REQUEST["status"]=="已归还"){echo "selected";}?>>已归还</option>
</select>
<input type="text" name="title" class="text" placeholder="车牌号" value="<?php echo $_REQUEST["title"]; ?>"/>
<button type="submit" id="chaxun" class="btn">查询</button>
</form></td></tr></table>
</td><td width="1%">&nbsp;</td></tr>
<tr>
<td width="1%">&nbsp;</td>
<td width="96%">
<table width="100%">
<td colspan="2">
<table width="100%" class="cont tr_color">
<tr>
<th width="82">编号</th>
<th>车牌号</th>
<th>提车时间</th>
<th>还车时间</th>
<th>金额</th>
<th width="120">操作</th>
</tr>
<?php
foreach($list["data"] as $row) {
?>
<tr align="center" class="d">
<td align="center"><?php echo $row['id'];?></td>
<td><?php echo $row['carstitle'];?></td>
<td><?php echo $row['begintime'];?></td>
<td><?php echo $row['endtime'];?></td>
<td><?php echo $row['price'];?></td>
<td align="center">
<?php if($row['status']=="借出"){?>
<a href="over_order.php?order_id=<?php echo $row['id'];?>&carsid=<?php echo $row['carsid'];?>">使用中</a>
<a href="baoxiu_edit.php?order_id=<?php echo $row['id'];?>&carsid=<?php echo $row['carsid'];?>">报修</a>
<?php }else{echo "已归还";}?>
</td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td align="center"><?php echo $page_show;?></td>
</tr>
</table>
</td>
<td width="1%">&nbsp;</td>
</tr>
<tr><td height="20"></td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,59 @@
<?php
/**
* Created by PhpStorm.
* User: 唐佩良
* Date: 2018/4/14
* Time: 18:39
*/
include_once("../../common/init.php");
check_loginuser();
$tb_name = "orders";
$order_id = intval($_GET['order_id']);
if(!$order_id){
goBakMsg("缺少参数order_id");
exit();
}
$cars_id = intval($_GET['carsid']);
if(!$cars_id){
goBakMsg("缺少参数carsid");
exit();
}
$order = db_get_row("select * from {$tb_name} where id={$order_id}");
//把车设为正常
db_query("update cars set status='正常' where id={$cars_id}");
//扣除押金
$date_now = date('Y-m-d');
$date = diffBetweenTwoDays($order['begintime'],$date_now);
if($date == 0){
$date = 1;
}
$price = 1 * $date;
db_query("update yajin set price=price-".$price." where studentid='{$_SESSION['stuname']}'");
//把订单设为已归还
db_query("update {$tb_name} set status='已归还',`price`={$price},`endtime`='{$date_now}' where `id`='{$order_id}'");
function diffBetweenTwoDays ($day1, $day2)
{
$second1 = strtotime($day1);
$second2 = strtotime($day2);
if ($second1 < $second2) {
$tmp = $second2;
$second2 = $second1;
$second1 = $tmp;
}
return ($second1 - $second2) / 86400;
}
?>
<body>
<h3>还车成功<br>本次借车:<?php echo $date?>天<br>开始借车时间:<?php echo $order['begintime']?><br>还车时间:<?php echo date('Y-m-d')?><br>共扣除金额:<?php echo $price?>元</h3>
</body>
</html>

157
admin/student/password.php Normal file
View File

@@ -0,0 +1,157 @@
<?php
include_once("../../common/init.php");
check_loginuser();
$rs = db_get_row("select * from user where id=".$_SESSION["studentid"]);
if ($_POST){
$data = array();
if($_POST["password"]){
$data["password"] = "'".md5($_POST["password"])."'";}
$data["stuname"] = "'".$_POST["stuname"]."'";
$data["sex"] = "'".$_POST["sex"]."'";
$data["tel"] = "'".$_POST["tel"]."'";
$data["banji"] = "'".$_POST["banji"]."'";
if(!empty($_FILES['img']['name'])){
$file = $_FILES['img'];//得到传输的数据
//得到文件名称
$name = $file['name'];
$type = strtolower(substr($name,strrpos($name,'.')+1)); //得到文件类型,并且都转化成小写
$allow_type = array('jpg','jpeg','gif','png'); //定义允许上传的类型
//判断文件类型是否被允许上传
if(!in_array($type, $allow_type)){
//如果不被允许,则直接停止程序运行
}
//判断是否是通过HTTP POST上传的
$upload_path = ROOT_PATH.'/Public/Upload/'; //上传文件的存放路径
//开始移动文件到相应的文件夹
$mu=mt_rand(1,10000000);
if(move_uploaded_file($file['tmp_name'],$upload_path.$mu.".".$type)){
$fileName =$mu.".".$type;
}else{
//echo "Failed!";
}
$data["img"] = "'".$fileName."'";
}
db_mdf("user",$data,$_SESSION["studentid"]);
goBakMsg("修改成功");
}
?>
<?php include_once("base.php");?>
<script>
function check()
{
if (document.form1.stuname.value=='')
{
alert('姓名不能为空');
document.form1.stuname.focus();
return false
}
if (document.form1.tel.value=='')
{
alert('电话不能为空');
document.form1.tel.focus();
return false
}
}
</script>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17" rowspan="2" valign="top" bgcolor="#FFFFFF"></td>
<td valign="top">
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF"><td height="31"><div class="title">修改资料</div></td></tr>
</table>
</td>
<td width="16" rowspan="2" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td valign="top" bgcolor="#F7F8F9">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="4" height="10"></td></tr>
<tr>
<td width="1%">&nbsp;</td>
<td width="96%">
<table width="100%">
<tr>
<td colspan="2">
<form name="form1" method="post" action="?" enctype="multipart/form-data" onSubmit="return check();">
<table width="100%" class="cont">
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right"><span class="red">*</span> 学号:</td>
<td width="200"><input class="text" name="studentid" type="text" maxlength="18" value="<?php echo $rs["studentid"];?>" readonly></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td align="right">密码:</td>
<td><input name="password" type="password" class="text" size="30" maxlength="20">
</td>
<td><?php echo "不修改请留空"; ?></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right"><span class="red">*</span> 姓名:</td>
<td width="200"><input class="text" name="stuname" type="text" maxlength="18" value="<?php echo $rs["stuname"];?>"></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right"><span class="red">*</span> 手机:</td>
<td width="200"><input class="text" name="tel" type="text" maxlength="18" value="<?php echo $rs["tel"];?>"></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right"> 班级:</td>
<td width="200"><input class="text" name="banji" type="text" value="<?php echo $rs["banji"];?>"></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right"><span class="red">*</span> 性别:</td>
<td width="200">
<select name="sex">
<option value="男" <?php if($rs["sex"]=="男"){echo "selected";}?>>男</option>
<option value="女" <?php if($rs["sex"]=="女"){echo "selected";}?>>女</option>
</select></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td width="2%">&nbsp;</td>
<td width="120" align="right"> 头像上传:</td>
<td width="200"><input type="file" name="img" class="text" id="img"><?php if(!empty($rs['img'])){?><img src="<?php echo __PUBLIC__;?>/Upload/<?php echo $rs["img"];?>" height="50" width="50"/><?php }?></td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right"><input class="btn" type="submit" value="提交" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
<td width="1%">&nbsp;</td>
</tr>
<tr><td height="20"></td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,173 @@
<?php
include_once("../../common/init.php");
check_loginuser();
$categoryA = db_get_all("select * from category order by id desc");
$category_list = array();
foreach ($categoryA as $k=>$v){
$category_list[$v['id']] = $v['title'];
}
$tb_name = "cars";
$where_sql = " status='正常' ";
if ($_REQUEST["title"]) {
$where_sql .= " and title like '%". $_REQUEST["title"] ."%' ";
}
if ($_REQUEST["categoryid"]) {
$where_sql .= " and categoryid =". $_REQUEST["categoryid"] ." ";
}
$page = $_REQUEST["page"]?$_REQUEST["page"]:1;
$list = db_get_page("select * from $tb_name where $where_sql order by id desc", $page,11);
if ($page*1>$list["page"]*1){
$page = $list["page"];
}
$Page = new PageWeb($list["total"],$list["page_size"], "title=".$_REQUEST["title"]."&categoryid=".$_REQUEST["categoryid"], $page);
$page_show = $Page->show();
?>
<?php include_once("base.php");?>
<link href="https://cdn.bootcss.com/element-ui/2.3.7/theme-chalk/index.css" rel="stylesheet">
<style>
.map_box{height: 500px;}
</style>
<body>
<div id="app">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17" rowspan="2" valign="top" bgcolor="#FFFFFF"></td>
<td valign="top">
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF"><td height="31"><div class="title">车辆管理</div></td></tr>
</table>
</td>
<td width="16" rowspan="2" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td valign="top" bgcolor="#F7F8F9">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="4" height="10"></td></tr>
<tr><td width="1%">&nbsp;</td><td width="96%">
<table width="100%" class="cont">
<tr>
<td width="1%"></td>
<td>
<form id="pagerForm" action="?" method="post">
<input type="hidden" name="pageNum" value="<?php echo $page; ?>"/>
<select name="categoryid">
<option value="">-- 请选择 --</option>
<?php
foreach($categoryA as $row) {
?>
<option value="<?php echo $row["id"];?>" <?php if($_REQUEST["categoryid"]==$row["id"]){echo ' selected="selected" ';}?>><?php echo $row["title"];?></option>
<?php } ?>
</select> <input type="text" name="title" class="text" placeholder="车牌号" value="<?php echo $_REQUEST["title"]; ?>"/>
<button type="submit" id="chaxun" class="btn">查询</button>
</form></td></tr></table>
</td><td width="1%">&nbsp;</td></tr>
<tr>
<td width="1%">&nbsp;</td>
<td width="96%">
<table width="100%">
<td colspan="2">
<table width="100%" class="cont tr_color">
<tr>
<th width="82">编号</th>
<th>车牌号</th>
<th>车龄</th>
<th>颜色</th>
<th>品牌</th>
<th>状态</th>
<th width="120">操作</th>
</tr>
<?php
foreach($list["data"] as $row) {
?>
<tr align="center" class="d">
<td align="center"><?php echo $row['id'];?></td>
<td><?php echo $row['title'];?></td>
<td><?php echo $row['ages'];?></td>
<td><?php echo $row['colors'];?></td>
<td><?php echo $category_list[$row['categoryid']];?></td>
<td><?php echo $row['status'];?></td>
<td align="center">
<a href="javascript:;" @click="showPosition(<?php echo $row['lat']?:0?>,<?php echo $row['lng']?:0?>,'<?php echo $row['title']?:''?>')">位置</a>
<a href="add_order.php?carsid=<?php echo $row['id'];?>">下单</a>
</td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td align="center"><?php echo $page_show;?></td>
</tr>
</table>
</td>
<td width="1%">&nbsp;</td>
</tr>
<tr><td height="20"></td></tr>
</table>
</td>
</tr>
</table>
<el-dialog title="停放位置查看"
fullscreen
:visible.sync="dialogVisible">
<div id="mapBox" class="map_box"></div>
</el-dialog>
</div>
<script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.3.7/index.js"></script>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.6&key=ea1a7b8b8265fda0230e7235809a6037"></script>
<script>
new Vue({
el:'#app',
data:{
dialogVisible:false,
},
methods:{
showPosition:function (lat,lng,no) {
if(lat>0 && lng>0){
this.dialogVisible = true;
this.$nextTick(function () {
var map = new AMap.Map('mapBox', {
zoom: 17,
resizeEnable: true,
mapStyle: 'amap://styles/c94e78bbbdccdee5a21c45f18da575b1',//样式URL
center: [lat,lng]
});
map.plugin('AMap.Geolocation', function() {
geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位默认无穷大
buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量默认Pixel(10, 20)
zoomToAccuracy: true, //定位成功后调整地图视野范围使定位位置及精度范围视野内可见默认false
buttonPosition:'RB'
});
map.addControl(geolocation);
});
var marker = new AMap.Marker({
icon: "http://webapi.amap.com/theme/v1.3/markers/n/mark_r.png",
position: [lat,lng], //基点位置
draggable: true, //是否可拖动
});
marker.setMap(map);
marker.setLabel({//label默认蓝框白底左上角显示样式className为amap-marker-label
offset: new AMap.Pixel(-40, -25),//修改label相对于maker的位置
content: "车牌号:"+no
});
});
}else{
this.$message({
message: '该车辆未的位置管理员还未设定',
type: 'warning'
});
}
},
}
})
</script>
</body>
</html>

43
admin/student/top.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
include_once("../../common/init.php");
check_loginuser();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="../skin/index/css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../skin/index/js/jquery.js"></script>
<script type="text/javascript">
$(function(){
//顶部导航切换
$(".nav li a").click(function(){
$(".nav li a.selected").removeClass("selected")
$(this).addClass("selected");
})
})
</script>
</head>
<body style="background:#f0f9fd">
<div class="topleft">
<a><?php echo $CONFIG["webname"];?></a>
</div>
<div class="topright">
<ul>
<li></li>
<li><a href="password.php" target='main'>修改资料</a></li>
<li><a href="../logincheck.php?type=logout" target="_top">注销退出</a></li>
</ul>
<div class="user">
<span><?php echo $_SESSION['stuname'];?></span>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,80 @@
<?php
include_once("../../common/init.php");
check_loginuser();
if ($_POST){
$data = array();
$row = db_get_row("select * from yajin where userid='". $_SESSION["studentid"] ."'");
if ($row["id"]) {
if($_POST["price"]+$row["price"]<300){
goBakMsg("押金不能少于300元");
die;}else{db_query("update yajin set price=price+".$_POST["price"]." where id=".$row["id"]);}
}
else{if($_POST["price"]<300){goBakMsg("押金不能少于300元");die;}}
$data["price"] = "'".$_POST["price"]."'";
$data["studentid"] = "'".$_SESSION['stuname']."'";
$data["userid"] = "'".$_SESSION['studentid']."'";
if ($row["id"]) {
} else {
db_add("yajin",$data);
}
urlMsg("提交成功", "main.php");
die;
}
?>
<?php include_once("base.php");?>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17" rowspan="2" valign="top" bgcolor="#FFFFFF"></td>
<td valign="top">
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF"><td height="31"><div class="title">缴纳押金</div></td></tr>
</table>
</td>
<td width="16" rowspan="2" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td valign="top" bgcolor="#F7F8F9">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="4" height="10"></td></tr>
<tr>
<td width="1%">&nbsp;</td>
<td width="96%">
<table width="100%">
<tr>
<td colspan="2">
<form name="add" method="post" action="?" enctype="multipart/form-data">
<table width="100%" class="cont">
<tr>
<td width="2%">&nbsp;</td>
<td align="right">添加金额:</td>
<td>
<input name="price" type="text" class="text" required>
</td>
<td></td>
<td width="2%">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right"><input type="submit" class="btn" id="submitBtn" value="提交" ></td>
<td>&nbsp;</td>
<td></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
<td width="1%">&nbsp;</td>
</tr>
<tr><td height="20"></td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>