员工数据管理
资源传送门:https://download.csdn.net/download/cx12xc/88735874?spm=1001.2014.3001.5501
1、员工信息列表图:
用户点击添加弹出图:
1.1、员工信息列表首页样式展示:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script>
<title>员工信息管理</title>
</head>
<body>
<div class="container mt-3">
<h2 class="text-center">员工信息列表</h2>
<div class="container mt-3 d-flex justify-content-end">
<form action="" method="post">
姓名查找:<input type="search" name="search_input" placeholder="请输入搜索内容">
<button type="submit" class="btn btn-primary">搜索</button>
<a type="button" href="./index.php" class="btn btn-primary">返回</a>
</form>
</div>
<hr>
<table class="table table-hover">
<tr class="table-dark">
<th>ID</th>
<th>姓名</th>
<th>所属部门</th>
<th>基本工资</th>
<th>入职时间</th>
<th>操作</th>
</tr>
<?php if(empty($result)){?>
<tr><td><h1>查询的结果不存在!</h1></td></tr>
<?php }else {?>
<?php while($rows=mysqli_fetch_assoc($result)){ ?>
<tr class="table-info">
<?php ?>
<td><?php echo $rows['id']; ?></td>
<td><?php echo $rows['emp_name'];?></td>
<td><?php echo $rows['emp_dept_name'];?></td>
<td><?php echo $rows['emp_wages'];?></td>
<td><?php echo $rows['date']; ?></td>
<td><a href="./common/delete.php?id=<?php echo $rows['id']; ?>">删除</a>
/<a href="./common/edit.php?id=<?php echo $rows['id']?>">编辑</a>
<?php }}?>
</td>
</tr>
</table>
<div class="page d-flex justify-content-end">
<?php echo $page1; ?>
</div>
<div class="container mt-3 d-flex justify-content-end">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModal">
添加
</button>
</div>
<div class="container mt-3 d-flex justify-content-end">
<a href="../dept.php"><button type="button" class="btn btn-primary">
部门管理
</button></a>
</div>
</div>
<?php $sql = "SELECT `dept_id`,`dept_name` FROM `pre_dept`";
$dept_info = mysqli_query($conn,$sql);
?>
<!-- 模态框 添加 -->
<div class="modal" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<!-- 模态框头部 -->
<div class="modal-header">
<h4 class="modal-title">添加新员工</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<!-- 模态框内容 -->
<div class="modal-body">
<form action="./common/add.php" method="post">
<div class="col-md-8">
<div class="input-group has-validation">
<label class="form-label">请输入名称:</label>
<div class="input-group has-validation">
<input class="form-control" type="text" name="emp_name" placeholder="请输入员工姓名">
</div>
<!--选择所属部门-->
<div class="input-group has-validation">
<select name="emp_dept_id">
<option value="0">未选择</option>
<?php foreach($dept_info as $v): ?>
<option value="<?=$v['dept_id']?>"><?=$v['dept_name']?></option>
<?php endforeach; ?>
</select>
</div>
<!--填入基本工资-->
<div class="input-group has-validation">
<input class="form-control" type="text" name="emp_wages" placeholder="请输入基本工资">
</div>
<!--填入入职时间 -->
<span class="input-group-text">
<input style="background-color: #e9ecef;border: none;
outline: none;" type="date" name="input_date">
</span>
</div>
</div>
</div>
<!-- 模态框底部 -->
<div class="modal-footer">
<button type="submit" class="btn btn-primary">确认</button>
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">关闭</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
2、部门管理列表图:
2.1、部门管理首页样式代码展示:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script>
<title>部门管理</title>
</head>
<body>
<div class="container mt-3">
<h2 class="text-center">部门管理</h2>
<hr>
<table class="table table-hover">
<tr class="table-dark">
<th>ID</th>
<th>部门</th>
<th>操作</th>
</tr>
<?php if(empty($result)){?>
<tr><td><h1>查询的结果不存在!</h1></td></tr>
<?php }else {?>
<?php while($rows=mysqli_fetch_assoc($result)){ ?>
<tr class="table-info">
<?php ?>
<td><?php echo $rows['dept_id']; ?></td>
<td><?php echo $rows['dept_name'];?></td>
<td><a href="./common/deptDelete.php?dept_id=<?php echo $rows['dept_id']; ?>">删除</a>
/<a href="./common/deptEdit.php?dept_id=<?php echo $rows['dept_id']?>">编辑</a>
<?php }}?>
</td>
</tr>
</table>
<div class="page d-flex justify-content-end">
<?php echo $page1; ?>
</div>
<div class="container mt-3 d-flex justify-content-end">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModal">
添加
</button>
</div>
<div class="container mt-3 d-flex justify-content-end">
<a href="../index.php">
<button type="button" class="btn btn-primary">返回首页</button>
</a>
</div>
</div>
<!-- 模态框 添加 -->
<div class="modal" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<!-- 模态框头部 -->
<div class="modal-header">
<h4 class="modal-title">添加信息</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<!-- 模态框内容 -->
<div class="modal-body">
<form action="./common/deptAdd.php" method="post">
<div class="col-md-8">
<div class="input-group has-validation">
<label class="form-label">请输入新部门:</label>
<div class="input-group has-validation">
<input class="form-control" type="text" name="dept_name" placeholder="请输入部门">
</div>
</div>
</div>
</div>
<!-- 模态框底部 -->
<div class="modal-footer">
<button type="submit" class="btn btn-primary">确认</button>
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">关闭</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
后续会添加登录功能和其他页面设计样式,尽我所能完善用户要求。
欢迎各位大佬的到来,请多多指教。我是菜鸟,喜欢就好。