Add: admin pages
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// header('Content-Type: application/json');
|
||||
|
||||
include "send_error_code.php";
|
||||
|
||||
$active_stage_list = $_POST['active_stage'];
|
||||
$cnt = count($active_stage_list);
|
||||
|
||||
include "./connect_db.php";
|
||||
|
||||
$query = "UPDATE afterschool_activated_stage SET Activated = 0";
|
||||
$result = $db_conn->query($query);
|
||||
|
||||
for($i = 0; $i < $cnt; $i++) {
|
||||
$array_item = $active_stage_list[$i];
|
||||
|
||||
$query = "UPDATE afterschool_activated_stage SET Activated = 1 WHERE StageName = ?";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param('s', $array_item);
|
||||
$stmt->execute();
|
||||
|
||||
if($stmt->affected_rows > 0) {
|
||||
echo($array_item." : activated<br/>");
|
||||
} else {
|
||||
echo $array_item." : db error<br/>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// header('Content-Type: application/json');
|
||||
|
||||
$name = $_POST["name"];
|
||||
|
||||
$birthday = $_POST["birthday"];
|
||||
if(!is_numeric($birthday)) {
|
||||
echo '생년월일이 숫자가 아닙니다.';
|
||||
return;
|
||||
} else if(strlen($birthday) != 6) {
|
||||
echo '6자리 숫자값을 정확히 입력하세요 : YYMMDD (예 : 120131)';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
include "./connect_db.php";
|
||||
|
||||
$query = "INSERT INTO afterschool_user(UserID, Name, Birthday) values (null,?,?)";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param('ss', $name, $birthday);
|
||||
$stmt->execute();
|
||||
|
||||
if($stmt->affected_rows > 0) {
|
||||
echo("succeed");
|
||||
} else {
|
||||
echo "fail";
|
||||
}
|
||||
|
||||
$db_conn->close();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
// header('Content-Type: application/json');
|
||||
|
||||
include "./connect_db.php";
|
||||
|
||||
$query = "DELETE FROM afterschool_record WHERE UserID=31;";
|
||||
$result = $db_conn->query($query);
|
||||
|
||||
$db_conn->close();
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user