1 Star 0 Fork 3

MyWZJ/基于php的学生成绩管理系统(后台)

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
subjectadd.php 2.56 KB
一键复制 编辑 原始数据 按行查看 历史
友人A 提交于 2023-04-09 10:12 . 已完成
<?php
include_once('config/config.php');
if ($_POST) {
$name = $_POST['name'];
$credit = $_POST['credit'];
$sql = "SELECT name FROM `stu_subject` WHERE `name` = '$name'";
$findData = find($sql);
if($findData){
ShowMsg('该学科已存在,请重新输入');
}
$data = [
'name' => $name,
'credit'=>$credit,
];
$res = add('subject', $data);
if($res)
{
ShowMsg('新增科目成功','subjectlist.php');
}else{
ShowMsg('新增科目失败');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include_once('common/meta.php') ?>
</head>
<!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
<!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
<!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<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="departmentlist.php">SubjectList</a> <span class="divider">/</span></li>
<li class="active">SubjectAdd</li>
</ul>
<div class="container-fluid">
<div class="row-fluid">
<div class="btn-toolbar">
<button class="btn btn-primary" onClick="location='subjectlist.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>
<input type="text" name="name" required class="input-xxlarge" placeholder="请输入科目名称">
<label>学分</label>
<input type="text" name="credit" required 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 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mywzj/phpstudent.git
git@gitee.com:mywzj/phpstudent.git
mywzj
phpstudent
基于php的学生成绩管理系统(后台)
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385