代码拉取完成,页面将自动刷新
<?php
include_once('config/config.php');
if ($_GET['id']) {
$id = $_GET['id'];
$sql = "SELECT stu.id AS stuid,stu.name AS stuname,sub.id AS subid,sub.name AS subname,score FROM `stu_grade` AS g LEFT JOIN `stu_student` AS stu ON g.stuid = stu.id LEFT JOIN `stu_subject` AS sub ON g.subid = sub.id WHERE g.id = $id";
$Data = find($sql);
}
if ($_POST) {
$data = [
'score' => $_POST['score'],
];
$res = update('grade', $data, "`id` = '$id'");
if ($res) {
ShowMsg('修改成功', 'gradelist.php');
} else {
ShowMsg('修改失败');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include_once('common/meta.php') ?>
</head>
<style>
input[type="file"] {
display: none;
}
label[for="avatar"] {
width: 200px;
}
</style>
<body>
<!--<![endif]-->
<!-- 引用头部 -->
<?php include_once('common/header.php') ?>
<!-- 引用菜单 -->
<?php include_once('common/nav.php') ?>
<div class="content">
<div class="header">
<h1 class="page-title">新增成绩单</h1>
</div>
<ul class="breadcrumb">
<li><a href="index.php">Home</a> <span class="divider">/</span></li>
<li><a href="gradelist.php">GradeList</a> <span class="divider">/</span></li>
<li class="active">GradeAdd</li>
</ul>
<div class="container-fluid">
<div class="row-fluid">
<div class="btn-toolbar">
<button class="btn btn-primary" onClick="location='gradelist.php'"><i class="icon-list"></i>成绩列表</button>
<div class="btn-group">
</div>
</div>
<div class="well">
<div id="myTabContent" class="tab-content">
<div class="tab-pane active in" id="home">
<form method="post" enctype="multipart/form-data">
<label>学生姓名</label>
<select name="stuname" disabled id="">
<option value="<?php echo $Data['stuid'] ?>"><?php echo $Data['stuname'] ?></option>
</select>
<label>学科名称</label>
<select name="subname" disabled id="">
<option value="<?php echo $Data['subid'] ?>"><?php echo $Data['subname'] ?></option>
</select>
<label for="">分数</label>
<input type="number" name="score" value="<?php echo $Data['score'] ?>" class="input-xxlarge" placeholder="请输入分数">
<label></label>
<input class="btn btn-primary" type="submit" value="提交" />
</form>
</div>
</div>
</div>
<?php include_once('common/footer.php'); ?>
</div>
</div>
</div>
</body>
</html>
<?php include_once('common/script.php'); ?>
<script>
</script>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。