Files
MES/app/views/Admin/asdBatchDelete.php
2026-08-08 18:28:49 +08:00

102 lines
4.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* 批量删除测试数据
*/
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($title); ?> - MES系统</title>
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/admin.css">
</head>
<body>
<?php include APP_PATH . 'app/views/layouts/admin_header.php'; ?>
<div class="content-wrapper">
<section class="content-header">
<h1><i class="fa fa-trash"></i> <?php echo htmlspecialchars($title); ?></h1>
</section>
<section class="content">
<?php if (!empty($error)): ?>
<div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
<?php endif; ?>
<?php if (!empty($success)): ?>
<div class="alert alert-success"><?php echo htmlspecialchars($success); ?></div>
<?php endif; ?>
<!-- 按设备删除 -->
<div class="box">
<div class="box-header">
<h3 class="box-title"><i class="fa fa-laptop"></i> 按设备编码删除</h3>
</div>
<div class="box-body">
<form method="post" action="" class="confirm-form" data-confirm="确定删除该设备的所有测试数据?此操作不可恢复!">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<input type="hidden" name="action" value="by_device">
<div class="form-group">
<label>设备编码</label>
<select name="device_code" class="form-control">
<option value="">请选择设备</option>
<?php foreach ($devices as $dev): ?>
<option value="<?php echo htmlspecialchars($dev['device_code']); ?>">
<?php echo htmlspecialchars($dev['device_code'] . ' - ' . ($dev['device_name'] ?? '')); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<button type="submit" class="btn btn-danger">
<i class="fa fa-trash"></i> 按设备删除
</button>
</form>
</div>
</div>
<!-- 按ID批量删除 -->
<div class="box">
<div class="box-header">
<h3 class="box-title"><i class="fa fa-list-ol"></i> 按记录ID批量删除</h3>
</div>
<div class="box-body">
<form method="post" action="" class="confirm-form" data-confirm="确定删除这些记录?此操作不可恢复!">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<input type="hidden" name="action" value="by_ids">
<div class="form-group">
<label>记录ID列表(多个ID用逗号分隔,如:1,2,3</label>
<input type="text" name="ids" class="form-control" placeholder="例如:1,2,3">
</div>
<button type="submit" class="btn btn-danger">
<i class="fa fa-trash"></i> 按ID删除
</button>
</form>
</div>
</div>
<!-- 清空全部 -->
<div class="box box-danger">
<div class="box-header">
<h3 class="box-title"><i class="fa fa-exclamation-triangle"></i> 危险操作</h3>
</div>
<div class="box-body">
<form method="post" action="" class="confirm-form" data-confirm="确定清空全部测试数据?此操作不可恢复!请确认您已备份数据。">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<input type="hidden" name="action" value="clear_all">
<button type="submit" class="btn btn-danger btn-lg">
<i class="fa fa-bomb"></i> 清空全部测试数据
</button>
</form>
</div>
</div>
<a href="<?php echo BASE_URL; ?>/Admin/asdTestData" class="btn btn-default">
<i class="fa fa-arrow-left"></i> 返回测试数据列表
</a>
</section>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
</body>
</html>