初始化

This commit is contained in:
2026-08-08 18:28:49 +08:00
parent 9bef4420e0
commit f082037a6e
854 changed files with 217171 additions and 11 deletions
+70
View File
@@ -0,0 +1,70 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-list"></i> 资产列表</h3>
<div class="box-tools">
<a href="<?php echo BASE_URL; ?>/General/assetAdd" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> 添加资产</a>
</div>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover table-striped">
<thead>
<tr>
<th>序号</th>
<th>资产编号</th>
<th>资产名称</th>
<th>类别</th>
<th>规格型号</th>
<th>数量</th>
<th>购置价格</th>
<th>使用部门</th>
<th>使用人</th>
<th>状态</th>
<th style="width:150px">操作</th>
</tr>
</thead>
<tbody>
<?php if (!empty($assets)): ?>
<?php foreach ($assets as $a): ?>
<tr>
<td><?php echo $a['id']; ?></td>
<td><?php echo htmlspecialchars($a['asset_no']); ?></td>
<td><?php echo htmlspecialchars($a['name']); ?></td>
<td><?php echo htmlspecialchars($a['category']); ?></td>
<td><?php echo htmlspecialchars($a['model']); ?></td>
<td><?php echo $a['quantity']; ?></td>
<td>&yen;<?php echo number_format($a['purchase_price'], 2); ?></td>
<td><?php echo htmlspecialchars($a['department']); ?></td>
<td><?php echo htmlspecialchars($a['user_name']); ?></td>
<td>
<?php
$statusLabels = ['normal'=>'正常','scrapped'=>'报废','repairing'=>'维修中','borrowed'=>'借用中'];
$statusColors = ['normal'=>'success','scrapped'=>'default','repairing'=>'warning','borrowed'=>'info'];
$st = $a['status'] ?? 'normal';
?>
<span class="label label-<?php echo $statusColors[$st] ?? 'default'; ?>">
<?php echo $statusLabels[$st] ?? $st; ?>
</span>
</td>
<td>
<a href="<?php echo BASE_URL; ?>/General/assetEdit?id=<?php echo $a['id']; ?>" class="btn btn-xs btn-info"><i class="fa fa-edit"></i> 编辑</a>
<form method="post" action="<?php echo BASE_URL; ?>/General/assetDelete" style="display:inline" onsubmit="return confirm('确定删除该资产吗?');">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken ?? ''); ?>">
<input type="hidden" name="id" value="<?php echo $a['id']; ?>">
<button type="submit" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> 删除</button>
</form>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="11" class="text-center text-muted">暂无资产数据</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+77
View File
@@ -0,0 +1,77 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-plus"></i> 添加资产</h3>
</div>
<form method="post">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<div class="box-body">
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>资产编号</label><input type="text" name="asset_no" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>资产名称 <span class="text-red">*</span></label><input type="text" name="name" class="form-control" required></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>类别</label><input type="text" name="category" class="form-control" placeholder="如:电子设备、办公家具"></div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group"><label>规格型号</label><input type="text" name="model" class="form-control"></div>
</div>
<div class="col-md-2">
<div class="form-group"><label>数量</label><input type="number" name="quantity" class="form-control" value="1"></div>
</div>
<div class="col-md-2">
<div class="form-group"><label>单位</label><input type="text" name="unit" class="form-control" value="台"></div>
</div>
<div class="col-md-2">
<div class="form-group"><label>购置价格</label><input type="number" name="purchase_price" class="form-control" value="0" step="0.01"></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>购置日期</label><input type="date" name="purchase_date" class="form-control" value="<?php echo date('Y-m-d'); ?>"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>供应商</label><input type="text" name="supplier" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>使用部门</label><input type="text" name="department" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>使用人</label><input type="text" name="user_name" class="form-control"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>存放位置</label><input type="text" name="location" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>状态</label>
<select name="status" class="form-control"><option value="normal">正常</option><option value="repairing">维修中</option><option value="borrowed">借用中</option></select>
</div>
</div>
<div class="col-md-4">
<div class="form-group"><label>保修到期</label><input type="date" name="warranty_expire" class="form-control"></div>
</div>
</div>
<div class="form-group"><label>备注</label><textarea name="remark" class="form-control" rows="2"></textarea></div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存</button>
<a href="<?php echo BASE_URL; ?>/General/asset" class="btn btn-default">返回</a>
</div>
</form>
</div>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+85
View File
@@ -0,0 +1,85 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-edit"></i> 编辑资产</h3>
</div>
<form method="post">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<div class="box-body">
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>资产编号</label><input type="text" name="asset_no" class="form-control" value="<?php echo htmlspecialchars($record['asset_no']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>资产名称 <span class="text-red">*</span></label><input type="text" name="name" class="form-control" value="<?php echo htmlspecialchars($record['name']); ?>" required></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>类别</label><input type="text" name="category" class="form-control" value="<?php echo htmlspecialchars($record['category']); ?>"></div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group"><label>规格型号</label><input type="text" name="model" class="form-control" value="<?php echo htmlspecialchars($record['model']); ?>"></div>
</div>
<div class="col-md-2">
<div class="form-group"><label>数量</label><input type="number" name="quantity" class="form-control" value="<?php echo $record['quantity']; ?>"></div>
</div>
<div class="col-md-2">
<div class="form-group"><label>单位</label><input type="text" name="unit" class="form-control" value="<?php echo htmlspecialchars($record['unit']); ?>"></div>
</div>
<div class="col-md-2">
<div class="form-group"><label>购置价格</label><input type="number" name="purchase_price" class="form-control" value="<?php echo $record['purchase_price']; ?>" step="0.01"></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>购置日期</label><input type="date" name="purchase_date" class="form-control" value="<?php echo htmlspecialchars($record['purchase_date']); ?>"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>供应商</label><input type="text" name="supplier" class="form-control" value="<?php echo htmlspecialchars($record['supplier']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>使用部门</label><input type="text" name="department" class="form-control" value="<?php echo htmlspecialchars($record['department']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>使用人</label><input type="text" name="user_name" class="form-control" value="<?php echo htmlspecialchars($record['user_name']); ?>"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>存放位置</label><input type="text" name="location" class="form-control" value="<?php echo htmlspecialchars($record['location']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>状态</label>
<select name="status" class="form-control">
<?php
$statuses = ['normal'=>'正常','scrapped'=>'报废','repairing'=>'维修中','borrowed'=>'借用中'];
foreach ($statuses as $k => $v):
$sel = ($record['status'] ?? '') === $k ? 'selected' : '';
?>
<option value="<?php echo $k; ?>" <?php echo $sel; ?>><?php echo $v; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group"><label>保修到期</label><input type="date" name="warranty_expire" class="form-control" value="<?php echo htmlspecialchars($record['warranty_expire']); ?>"></div>
</div>
</div>
<div class="form-group"><label>备注</label><textarea name="remark" class="form-control" rows="2"><?php echo htmlspecialchars($record['remark']); ?></textarea></div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存</button>
<a href="<?php echo BASE_URL; ?>/General/asset" class="btn btn-default">返回</a>
</div>
</form>
</div>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+74
View File
@@ -0,0 +1,74 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-list"></i> 文档列表</h3>
<div class="box-tools">
<a href="<?php echo BASE_URL; ?>/General/documentAdd" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> 添加文档</a>
</div>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover table-striped">
<thead>
<tr>
<th>序号</th>
<th>文档编号</th>
<th>标题</th>
<th>分类</th>
<th>版本</th>
<th>作者</th>
<th>部门</th>
<th>状态</th>
<th>创建时间</th>
<th style="width:150px">操作</th>
</tr>
</thead>
<tbody>
<?php if (!empty($documents)): ?>
<?php foreach ($documents as $d): ?>
<tr>
<td><?php echo $d['id']; ?></td>
<td><?php echo htmlspecialchars($d['doc_no']); ?></td>
<td>
<?php if (!empty($d['file_path'])): ?>
<a href="<?php echo BASE_URL . htmlspecialchars($d['file_path']); ?>" target="_blank"><?php echo htmlspecialchars($d['title']); ?></a>
<?php else: ?>
<?php echo htmlspecialchars($d['title']); ?>
<?php endif; ?>
</td>
<td><?php echo htmlspecialchars($d['category']); ?></td>
<td><?php echo htmlspecialchars($d['version']); ?></td>
<td><?php echo htmlspecialchars($d['author']); ?></td>
<td><?php echo htmlspecialchars($d['department']); ?></td>
<td>
<?php
$statusLabels = ['active'=>'启用','archived'=>'归档','obsolete'=>'作废'];
$statusColors = ['active'=>'success','archived'=>'info','obsolete'=>'default'];
$st = $d['status'] ?? 'active';
?>
<span class="label label-<?php echo $statusColors[$st] ?? 'default'; ?>">
<?php echo $statusLabels[$st] ?? $st; ?>
</span>
</td>
<td><?php echo htmlspecialchars($d['created_at']); ?></td>
<td>
<a href="<?php echo BASE_URL; ?>/General/documentEdit?id=<?php echo $d['id']; ?>" class="btn btn-xs btn-info"><i class="fa fa-edit"></i> 编辑</a>
<form method="post" action="<?php echo BASE_URL; ?>/General/documentDelete" style="display:inline" onsubmit="return confirm('确定删除该文档吗?');">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken ?? ''); ?>">
<input type="hidden" name="id" value="<?php echo $d['id']; ?>">
<button type="submit" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> 删除</button>
</form>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="10" class="text-center text-muted">暂无文档数据</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+60
View File
@@ -0,0 +1,60 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-plus"></i> 添加文档</h3>
</div>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<div class="box-body">
<div class="row">
<div class="col-md-6">
<div class="form-group"><label>文档标题 <span class="text-red">*</span></label><input type="text" name="title" class="form-control" required></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>文档编号</label><input type="text" name="doc_no" class="form-control"></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>版本号</label><input type="text" name="version" class="form-control" value="1.0"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>分类</label><input type="text" name="category" class="form-control" placeholder="如:技术文档、管理制度"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>作者</label><input type="text" name="author" class="form-control" value="<?php echo htmlspecialchars($user['emp_name']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>部门</label><input type="text" name="department" class="form-control"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group"><label>关键词</label><input type="text" name="keywords" class="form-control"></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>状态</label>
<select name="status" class="form-control"><option value="active">启用</option><option value="archived">归档</option></select>
</div>
</div>
<div class="col-md-3">
<div class="form-group"><label>上传文件</label><input type="file" name="doc_file" class="form-control"></div>
</div>
</div>
<div class="form-group"><label>描述</label><textarea name="description" class="form-control" rows="3"></textarea></div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存</button>
<a href="<?php echo BASE_URL; ?>/General/document" class="btn btn-default">返回</a>
</div>
</form>
</div>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+68
View File
@@ -0,0 +1,68 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-edit"></i> 编辑文档</h3>
</div>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<div class="box-body">
<div class="row">
<div class="col-md-6">
<div class="form-group"><label>文档标题 <span class="text-red">*</span></label><input type="text" name="title" class="form-control" value="<?php echo htmlspecialchars($record['title']); ?>" required></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>文档编号</label><input type="text" name="doc_no" class="form-control" value="<?php echo htmlspecialchars($record['doc_no']); ?>"></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>版本号</label><input type="text" name="version" class="form-control" value="<?php echo htmlspecialchars($record['version']); ?>"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>分类</label><input type="text" name="category" class="form-control" value="<?php echo htmlspecialchars($record['category']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>作者</label><input type="text" name="author" class="form-control" value="<?php echo htmlspecialchars($record['author']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>部门</label><input type="text" name="department" class="form-control" value="<?php echo htmlspecialchars($record['department']); ?>"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group"><label>关键词</label><input type="text" name="keywords" class="form-control" value="<?php echo htmlspecialchars($record['keywords']); ?>"></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>状态</label>
<select name="status" class="form-control">
<option value="active" <?php echo ($record['status'] ?? '') === 'active' ? 'selected' : ''; ?>>启用</option>
<option value="archived" <?php echo ($record['status'] ?? '') === 'archived' ? 'selected' : ''; ?>>归档</option>
<option value="obsolete" <?php echo ($record['status'] ?? '') === 'obsolete' ? 'selected' : ''; ?>>作废</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group"><label>上传新文件</label><input type="file" name="doc_file" class="form-control">
<?php if (!empty($record['file_name'])): ?>
<small class="text-muted">当前文件:<?php echo htmlspecialchars($record['file_name']); ?></small>
<?php endif; ?>
</div>
</div>
</div>
<div class="form-group"><label>描述</label><textarea name="description" class="form-control" rows="3"><?php echo htmlspecialchars($record['description']); ?></textarea></div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存</button>
<a href="<?php echo BASE_URL; ?>/General/document" class="btn btn-default">返回</a>
</div>
</form>
</div>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+68
View File
@@ -0,0 +1,68 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-list"></i> 员工列表</h3>
<div class="box-tools">
<a href="<?php echo BASE_URL; ?>/General/hrAdd" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> 添加员工</a>
</div>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover table-striped">
<thead>
<tr>
<th>序号</th>
<th>工号</th>
<th>姓名</th>
<th>性别</th>
<th>部门</th>
<th>职位</th>
<th>手机号</th>
<th>入职日期</th>
<th>状态</th>
<th style="width:150px">操作</th>
</tr>
</thead>
<tbody>
<?php if (!empty($employees)): ?>
<?php foreach ($employees as $e): ?>
<tr>
<td><?php echo $e['id']; ?></td>
<td><?php echo htmlspecialchars($e['emp_no']); ?></td>
<td><?php echo htmlspecialchars($e['name']); ?></td>
<td><?php echo htmlspecialchars($e['gender']); ?></td>
<td><?php echo htmlspecialchars($e['department']); ?></td>
<td><?php echo htmlspecialchars($e['position']); ?></td>
<td><?php echo htmlspecialchars($e['phone']); ?></td>
<td><?php echo htmlspecialchars($e['entry_date']); ?></td>
<td>
<?php
$statusLabels = ['active'=>'在职','resigned'=>'离职','suspended'=>'停职'];
$statusColors = ['active'=>'success','resigned'=>'default','suspended'=>'warning'];
$st = $e['status'] ?? 'active';
?>
<span class="label label-<?php echo $statusColors[$st] ?? 'default'; ?>">
<?php echo $statusLabels[$st] ?? $st; ?>
</span>
</td>
<td>
<a href="<?php echo BASE_URL; ?>/General/hrEdit?id=<?php echo $e['id']; ?>" class="btn btn-xs btn-info"><i class="fa fa-edit"></i> 编辑</a>
<form method="post" action="<?php echo BASE_URL; ?>/General/hrDelete" style="display:inline" onsubmit="return confirm('确定删除该员工吗?');">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken ?? ''); ?>">
<input type="hidden" name="id" value="<?php echo $e['id']; ?>">
<button type="submit" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> 删除</button>
</form>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="10" class="text-center text-muted">暂无员工数据</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+83
View File
@@ -0,0 +1,83 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-plus"></i> 添加员工</h3>
</div>
<form method="post">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<div class="box-body">
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>工号</label><input type="text" name="emp_no" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>姓名 <span class="text-red">*</span></label><input type="text" name="name" class="form-control" required></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>性别</label>
<select name="gender" class="form-control"><option value="">-- 请选择 --</option><option value="男">男</option><option value="女">女</option></select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>部门</label><input type="text" name="department" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>职位</label><input type="text" name="position" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>学历</label>
<select name="education" class="form-control"><option value="">-- 请选择 --</option><option value="初中">初中</option><option value="高中">高中</option><option value="大专">大专</option><option value="本科">本科</option><option value="硕士">硕士</option></select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>手机号</label><input type="text" name="phone" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>邮箱</label><input type="email" name="email" class="form-control"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>身份证号</label><input type="text" name="id_card" class="form-control"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>入职日期</label><input type="date" name="entry_date" class="form-control" value="<?php echo date('Y-m-d'); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>状态</label>
<select name="status" class="form-control"><option value="active">在职</option><option value="suspended">停职</option></select>
</div>
</div>
<div class="col-md-4">
<div class="form-group"><label>紧急联系人</label><input type="text" name="emergency_contact" class="form-control"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>紧急联系电话</label><input type="text" name="emergency_phone" class="form-control"></div>
</div>
<div class="col-md-8">
<div class="form-group"><label>住址</label><input type="text" name="address" class="form-control"></div>
</div>
</div>
<div class="form-group"><label>备注</label><textarea name="remark" class="form-control" rows="2"></textarea></div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存</button>
<a href="<?php echo BASE_URL; ?>/General/hr" class="btn btn-default">返回</a>
</div>
</form>
</div>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+96
View File
@@ -0,0 +1,96 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-edit"></i> 编辑员工</h3>
</div>
<form method="post">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<div class="box-body">
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>工号</label><input type="text" name="emp_no" class="form-control" value="<?php echo htmlspecialchars($record['emp_no']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>姓名 <span class="text-red">*</span></label><input type="text" name="name" class="form-control" value="<?php echo htmlspecialchars($record['name']); ?>" required></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>性别</label>
<select name="gender" class="form-control"><option value="">-- 请选择 --</option><option value="男" <?php echo ($record['gender'] ?? '') === '男' ? 'selected' : ''; ?>>男</option><option value="女" <?php echo ($record['gender'] ?? '') === '女' ? 'selected' : ''; ?>>女</option></select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>部门</label><input type="text" name="department" class="form-control" value="<?php echo htmlspecialchars($record['department']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>职位</label><input type="text" name="position" class="form-control" value="<?php echo htmlspecialchars($record['position']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>学历</label>
<select name="education" class="form-control">
<option value="">-- 请选择 --</option>
<?php $edus = ['初中','高中','大专','本科','硕士'];
foreach ($edus as $edu): $sel = ($record['education'] ?? '') === $edu ? 'selected' : ''; ?>
<option value="<?php echo $edu; ?>" <?php echo $sel; ?>><?php echo $edu; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>手机号</label><input type="text" name="phone" class="form-control" value="<?php echo htmlspecialchars($record['phone']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>邮箱</label><input type="email" name="email" class="form-control" value="<?php echo htmlspecialchars($record['email']); ?>"></div>
</div>
<div class="col-md-4">
<div class="form-group"><label>身份证号</label><input type="text" name="id_card" class="form-control" value="<?php echo htmlspecialchars($record['id_card']); ?>"></div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group"><label>入职日期</label><input type="date" name="entry_date" class="form-control" value="<?php echo htmlspecialchars($record['entry_date']); ?>"></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>离职日期</label><input type="date" name="leave_date" class="form-control" value="<?php echo htmlspecialchars($record['leave_date']); ?>"></div>
</div>
<div class="col-md-3">
<div class="form-group"><label>状态</label>
<select name="status" class="form-control">
<option value="active" <?php echo ($record['status'] ?? '') === 'active' ? 'selected' : ''; ?>>在职</option>
<option value="resigned" <?php echo ($record['status'] ?? '') === 'resigned' ? 'selected' : ''; ?>>离职</option>
<option value="suspended" <?php echo ($record['status'] ?? '') === 'suspended' ? 'selected' : ''; ?>>停职</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group"><label>紧急联系人</label><input type="text" name="emergency_contact" class="form-control" value="<?php echo htmlspecialchars($record['emergency_contact']); ?>"></div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"><label>紧急联系电话</label><input type="text" name="emergency_phone" class="form-control" value="<?php echo htmlspecialchars($record['emergency_phone']); ?>"></div>
</div>
<div class="col-md-8">
<div class="form-group"><label>住址</label><input type="text" name="address" class="form-control" value="<?php echo htmlspecialchars($record['address']); ?>"></div>
</div>
</div>
<div class="form-group"><label>备注</label><textarea name="remark" class="form-control" rows="2"><?php echo htmlspecialchars($record['remark']); ?></textarea></div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存</button>
<a href="<?php echo BASE_URL; ?>/General/hr" class="btn btn-default">返回</a>
</div>
</form>
</div>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
+68
View File
@@ -0,0 +1,68 @@
<?php
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="row">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-aqua">
<div class="inner">
<h3><?php echo $employeeCount ?? 0; ?></h3>
<p>员工总数</p>
</div>
<div class="icon"><i class="fa fa-users"></i></div>
<a href="<?php echo BASE_URL; ?>/General/hr" class="small-box-footer">进入管理 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-green">
<div class="inner">
<h3><?php echo isset($assetStats['cnt']) ? $assetStats['cnt'] : 0; ?></h3>
<p>资产总数</p>
</div>
<div class="icon"><i class="fa fa-laptop"></i></div>
<a href="<?php echo BASE_URL; ?>/General/asset" class="small-box-footer">进入管理 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-yellow">
<div class="inner">
<h3><?php echo $documentCount ?? 0; ?></h3>
<p>文档总数</p>
</div>
<div class="icon"><i class="fa fa-file-text"></i></div>
<a href="<?php echo BASE_URL; ?>/General/document" class="small-box-footer">进入管理 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
</div>
<?php if (isset($assetStats['total_value'])): ?>
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-info-circle"></i> 资产总价值</h3>
</div>
<div class="box-body text-center">
<h2 style="color:#3c8dbc; font-weight:bold;">&yen;<?php echo number_format($assetStats['total_value'], 2); ?></h2>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-rocket"></i> 快捷操作</h3>
</div>
<div class="box-body">
<a href="<?php echo BASE_URL; ?>/General/hrAdd" class="btn btn-primary"><i class="fa fa-user-plus"></i> 添加员工</a>
<a href="<?php echo BASE_URL; ?>/General/assetAdd" class="btn btn-success"><i class="fa fa-plus"></i> 添加资产</a>
<a href="<?php echo BASE_URL; ?>/General/documentAdd" class="btn btn-warning"><i class="fa fa-file"></i> 添加文档</a>
</div>
</div>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>