新增了多个字体图标文件(SVG格式),包括品牌图标和常规图标。添加了相关的样式文件(LESS和SCSS)用于管理图标样式。更新了配置文件如.gitignore、composer.json和.htaccess等。新增了开发者相关的PHP文件如logout.php。添加了项目规则文档和字体相关的样式文件。
41 lines
1.0 KiB
PHP
41 lines
1.0 KiB
PHP
<?php
|
|
require_once '../config.php';
|
|
|
|
session_start();
|
|
// 检查管理员登录状态
|
|
if (!isset($_SESSION['admin'])) {
|
|
header('Location: login.php');
|
|
exit;
|
|
}
|
|
|
|
// 验证App ID
|
|
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
|
|
header('Location: index.php?error=无效的App ID');
|
|
exit;
|
|
}
|
|
$appId = $_GET['id'];
|
|
|
|
// 删除App
|
|
$deleteAppSql = "DELETE FROM apps WHERE id = ?";
|
|
$stmt = $conn->prepare($deleteAppSql);
|
|
$stmt->bind_param("i", $appId);
|
|
|
|
if ($stmt->execute() === TRUE) {
|
|
// 删除关联的图片
|
|
$deleteImagesSql = "DELETE FROM app_images WHERE app_id = ?";
|
|
$imgStmt = $conn->prepare($deleteImagesSql);
|
|
$imgStmt->bind_param("i", $appId);
|
|
$imgStmt->execute();
|
|
|
|
// 删除关联的版本
|
|
$deleteVersionsSql = "DELETE FROM app_versions WHERE app_id = ?";
|
|
$verStmt = $conn->prepare($deleteVersionsSql);
|
|
$verStmt->bind_param("i", $appId);
|
|
$verStmt->execute();
|
|
|
|
header('Location: index.php?success=App 删除成功');
|
|
} else {
|
|
header('Location: index.php?error=App 删除失败: '. $conn->error);
|
|
}
|
|
exit;
|
|
?>
|