代码拉取完成,页面将自动刷新
同步操作将从 友人A/基于php的学生成绩管理系统(后台) 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?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>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。