Signed-off-by: gaoyuheng <gaoyuheng@yuheng.hl.cn>
This commit is contained in:
111
admin/eacher/baoxiu_edit.php
Normal file
111
admin/eacher/baoxiu_edit.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
include_once("../../common/init.php");
|
||||
check_loginthe1();
|
||||
$tb_name = "baoxiu";
|
||||
$eacher = db_get_all("select * from eacher order by id asc ");
|
||||
$rs1 = db_get_row("select * from cars where id=". $_REQUEST["carsid"]);
|
||||
if ($_REQUEST["id"]) {
|
||||
$rs = db_get_row("select * from $tb_name where id=". $_REQUEST["id"]);
|
||||
}
|
||||
if ($_POST){
|
||||
$data = array();
|
||||
db_query("update cars set status='".$_POST["status"]."' where id=".$_POST["carsid"]);
|
||||
$data["carsid"] = "'".$_POST["carsid"]."'";
|
||||
$data["status"] = "'".$_POST["status1"]."'";
|
||||
$data["content"] = "'".$_POST["content"]."'";
|
||||
if ($_REQUEST["id"]) {
|
||||
db_mdf($tb_name,$data,$_REQUEST["id"]);
|
||||
} else {
|
||||
db_add($tb_name,$data);
|
||||
}
|
||||
goBakMsg("操作成功");
|
||||
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%"> </td>
|
||||
<td width="96%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<form name="add" method="post" action="?" onSubmit="return checkadd()">
|
||||
<input type="hidden" name="carsid" value="<?php echo $rs1["id"];?>" />
|
||||
<input type="hidden" name="carstitle" value="<?php echo $rs1["title"];?>" />
|
||||
<input type="hidden" name="id" value="<?php echo $rs["id"];?>" />
|
||||
<table width="100%" class="cont">
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">车牌号:</td>
|
||||
<td width="200"><?php echo $rs1["title"];?></td>
|
||||
<td></td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">车辆状态:</td>
|
||||
<td width="200">
|
||||
<select name="status">
|
||||
<option value="维修" <?php if($rs1["status"]=="维修"){echo "selected";}?>>维修</option>
|
||||
<option value="报废" <?php if($rs1["status"]=="报废"){echo "selected";}?>>报废</option>
|
||||
<option value="正常" <?php if($rs1["status"]=="正常"){echo "selected";}?>>正常</option>
|
||||
</select></td>
|
||||
<td></td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">报修状态:</td>
|
||||
<td width="200">
|
||||
<select name="status1">
|
||||
<option value="维修中" <?php if($rs["status"]=="维修中"){echo "selected";}?>>维修中</option>
|
||||
<option value="完成" <?php if($rs["status"]=="完成"){echo "selected";}?>>完成</option>
|
||||
</select></td>
|
||||
<td></td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">备注:</td>
|
||||
<td width="200"><textarea name="content"><?php echo $rs["content"];?></textarea></td>
|
||||
<td></td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="right"><input class="btn" type="submit" value="提交" /></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="1%"> </td>
|
||||
</tr>
|
||||
<tr><td height="20"></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
181
admin/eacher/baoxiu_list.php
Normal file
181
admin/eacher/baoxiu_list.php
Normal file
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
include_once("../../common/init.php");
|
||||
check_loginthe1();
|
||||
$tb_name = "baoxiu";
|
||||
$where_sql = " 1=1 ";
|
||||
|
||||
if ($_REQUEST["status"]) {
|
||||
$where_sql .= " and status ='". $_REQUEST["status"] ."'";
|
||||
}
|
||||
$page = $_REQUEST["page"]?$_REQUEST["page"]:1;
|
||||
|
||||
$list = db_get_page("select * from $tb_name where $where_sql and eacherid=".$_SESSION["eachersid"]." order by id desc", $page,11);
|
||||
if ($page*1>$list["page"]*1){
|
||||
$page = $list["page"];
|
||||
}
|
||||
$Page = new PageWeb($list["total"],$list["page_size"], "status=".$_REQUEST["status"], $page);
|
||||
$page_show = $Page->show();
|
||||
|
||||
//查询车辆位置
|
||||
$car_ids = array();
|
||||
foreach ($list['data'] as $k=>$v){
|
||||
$car_ids[] = $v['carsid'];
|
||||
}
|
||||
|
||||
$sql = "select `id`,`lat`,`lng`,`title` from `cars` where `id` in (".join(',',$car_ids).")";
|
||||
$res = db_get_all($sql);
|
||||
$cars_list = array();
|
||||
foreach ($res as $k=>$v){
|
||||
$cars_list[$v['id']] = $v;
|
||||
}
|
||||
|
||||
foreach ($list['data'] as $k=>$v){
|
||||
$car = $cars_list[$v['carsid']];
|
||||
$list['data'][$k]['lng'] = $car['lng'];
|
||||
$list['data'][$k]['lat'] = $car['lat'];
|
||||
$list['data'][$k]['title'] = $car['title'];
|
||||
}
|
||||
|
||||
?>
|
||||
<?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%"> </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>
|
||||
<button type="submit" id="chaxun" class="btn">查询</button>
|
||||
</form></td></tr></table>
|
||||
</td><td width="1%"> </td></tr>
|
||||
<tr>
|
||||
<td width="1%"> </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['title']?></td>
|
||||
<td><?php echo db_get_val("eacher",$row["eacherid"],"tname")?></td>
|
||||
<td><?php echo $row['addtime'];?></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="baoxiu_edit.php?id=<?php echo $row['id'];?>&carsid=<?php echo $row['carsid'];?>">修改</a>
|
||||
<a href="del.php?id=<?php echo $row['id'];?>&del=baoxiu" onClick="return confirm('真的要删除?不可恢复!');">删除</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%"> </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>
|
||||
7
admin/eacher/base.php
Normal file
7
admin/eacher/base.php
Normal 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>
|
||||
12
admin/eacher/del.php
Normal file
12
admin/eacher/del.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include_once("../../common/init.php");
|
||||
check_loginthe1();
|
||||
|
||||
if ($_REQUEST["del"]) {
|
||||
db_del($_REQUEST["del"],$_REQUEST["id"]);
|
||||
goBakMsg("删除成功");
|
||||
} else {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
19
admin/eacher/index.php
Normal file
19
admin/eacher/index.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
include_once("../../common/init.php");
|
||||
check_loginthe1();?>
|
||||
<!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>
|
||||
58
admin/eacher/left.php
Normal file
58
admin/eacher/left.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<!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(){
|
||||
//导航切换
|
||||
$(".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='baoxiu_list.php?status=维修中' target='main'>未完成维修</a><i></i></li>
|
||||
<li><cite></cite><a href='baoxiu_list.php?status=完成' target='main'>已完成维修</a><i></i></li>
|
||||
<li><cite></cite><a href='map.php' target='main'>待修理车辆地图</a><i></i></li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
</body>
|
||||
</html>
|
||||
33
admin/eacher/main.php
Normal file
33
admin/eacher/main.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
include_once("../../common/init.php");
|
||||
check_loginthe1();
|
||||
?>
|
||||
<!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><?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 echo $CONFIG["webname"];?>
|
||||
</div>
|
||||
|
||||
<div class="xline"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
55
admin/eacher/map.php
Normal file
55
admin/eacher/map.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
include_once("../../common/init.php");
|
||||
check_loginthe1();
|
||||
$list = db_get_all("select `b`.`id`,`c`.`id` as `carid`,`c`.`title`,`c`.`lat`,`c`.`lng` from `baoxiu` as `b` join `cars` as `c` on `b`.`carsid`=`c`.`id` where `b`.`status`='维修中' and `b`.`eacherid`={$_SESSION['eachersid']}");
|
||||
|
||||
?>
|
||||
<?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 = "baoxiu_edit.php?carsid="+e.target.carinfo.carid+"&id="+e.target.carinfo.id;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
160
admin/eacher/password.php
Normal file
160
admin/eacher/password.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
include_once("../../common/init.php");
|
||||
check_loginthe1();
|
||||
$rs = db_get_row("select * from eacher where id=".$_SESSION["eachersid"]);
|
||||
if ($_POST){
|
||||
$data = array();
|
||||
$data["tname"] = "'".$_POST["tname"]."'";
|
||||
$data["begintime"] = "'".$_POST["begintime"]."'";
|
||||
$data["desc1"] = "'".$_POST["desc1"]."'";
|
||||
$data["sex"] = "'".$_POST["sex"]."'";
|
||||
$data["tel"] = "'".$_POST["tel"]."'";
|
||||
if($_POST["password"]){
|
||||
$data["password"] = "'".md5($_POST["password"])."'";
|
||||
}
|
||||
|
||||
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("eacher",$data,$_SESSION["eachersid"]);
|
||||
goBakMsg("修改成功");
|
||||
}
|
||||
?>
|
||||
<?php include_once("base.php");?>
|
||||
<script>
|
||||
function check()
|
||||
{
|
||||
if (document.form1.password.value=='')
|
||||
{
|
||||
alert('密码不能为空');
|
||||
document.form1.password.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%"> </td>
|
||||
<td width="96%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<form name="form1" method="post" action="?" enctype="multipart/form-data">
|
||||
<table width="100%" class="cont">
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">用户名或编号:</td>
|
||||
<td width="200"><input name="username" type="text" class="text" size="30" maxlength="20" value="<?php echo $rs["username"];?>" readonly></td>
|
||||
<td> </td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td align="right">密码:</td>
|
||||
<td><input name="password" type="password" class="text" size="30" maxlength="20">
|
||||
</td>
|
||||
<td>不修改请留空</td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">姓名:</td>
|
||||
<td width="200"><input name="tname" type="text" class="text" size="30" maxlength="20" value="<?php echo $rs["tname"];?>" required></td>
|
||||
<td> </td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">性别:</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%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </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="datepicker" type="text" onClick="WdatePicker()" style="width:350px;" class="text" value="<?php echo $rs["begintime"];?>" required></td>
|
||||
<td> </td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </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%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">电话:</td>
|
||||
<td width="200"><input name="tel" type="text" class="text" size="30" maxlength="20" value="<?php echo $rs["tel"];?>" required></td>
|
||||
<td> </td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="2%"> </td>
|
||||
<td width="120" align="right">备注:</td>
|
||||
<td width="200"><textarea name="desc1" cols="30" class="text"><?php echo $rs["desc1"];?></textarea></td>
|
||||
<td> </td>
|
||||
<td width="2%"> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="right"><input class="btn" type="submit" value="提交" /></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="1%"> </td>
|
||||
</tr>
|
||||
<tr><td height="20"></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
43
admin/eacher/top.php
Normal file
43
admin/eacher/top.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
include_once("../../common/init.php");
|
||||
check_loginthe1();
|
||||
?>
|
||||
<!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['tsname'];?></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user