加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gradeedit.php 2.70 KB
一键复制 编辑 原始数据 按行查看 历史
友人A 提交于 2023-04-09 10:12 . 已完成
<?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>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化