Initial commit: 교육 프로젝트 배포
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
require_once '../../bbs/db_conn.php';
|
||||
|
||||
// PDO 연결 생성
|
||||
$pdo = db_conn();
|
||||
|
||||
try {
|
||||
$group_code = $_POST['group_code'] ?? '';
|
||||
$group_name = $_POST['group_name'] ?? '';
|
||||
$is_active = ($_POST['is_active'] ?? '') === '1' ? '1' : '0';
|
||||
$comment = $_POST['comment'] ?? '';
|
||||
$desc01 = $_POST['desc01'] ?? '';
|
||||
|
||||
if (empty($group_code) || empty($group_name)) {
|
||||
echo json_encode(['success' => false, 'message' => '?꾩닔 ?꾨뱶媛 ?꾨씫?섏뿀?듬땲??']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt = $pdo->prepare("REPLACE INTO edu_code_group (group_code, group_name, is_active, comment, desc01, updated_at) VALUES (?, ?, ?, ?, ?, NOW())");
|
||||
$result = $stmt->execute([$group_code, $group_name, $is_active, $comment, $desc01]);
|
||||
|
||||
echo json_encode(['success' => (bool)$result]);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user