Add: sql - login, history_record
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>hello phaser!</title>
|
||||
<script src="//cdn.jsdelivr.net/phaser/2.5.0/phaser.min.js"></script>
|
||||
<script type="text/javascript" src="./../../../jquery/jquery-3.2.1.min.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
|
||||
function checkAll() {
|
||||
var chk = document.getElementsByName("active_stage[]");
|
||||
var cnt = chk.length;
|
||||
for(var i = 0; i < cnt; i++) {
|
||||
chk[i].checked = document.frm.chkAll.checked;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form name="frm" action="activate_stage.php" method="post">
|
||||
<input type="checkbox" name="chkAll" onClick="javascript:checkAll();" />전체 선택<br />
|
||||
|
||||
<br/><br/>
|
||||
<label type="label">한글</label><br/>
|
||||
<input type="checkbox" name="active_stage[]" value="korean_basic" />기본자리<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_left_upper" />왼손 윗글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_second_finger" />검지 글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_right_upper" />오른손 윗글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_left_lower" />왼손 밑글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_right_lower" />오른손 밑글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_left_upper_double" />쌍자음<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_right_upper_double" />쌍모음<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_word" />짧은 글<br />
|
||||
<input type="checkbox" name="active_stage[]" value="korean_sentence" />긴 글<br />
|
||||
|
||||
<br/><br/>
|
||||
<label type="label">영문</label><br/>
|
||||
<input type="checkbox" name="active_stage[]" value="english_basic" />기본자리<br />
|
||||
<input type="checkbox" name="active_stage[]" value="english_left_upper" />왼손 윗글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="english_second_finger" />검지 글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="english_right_upper" />오른손 윗글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="english_left_lower" />왼손 밑글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="english_right_lower" />오른손 밑글쇠<br />
|
||||
<input type="checkbox" name="active_stage[]" value="english_word" />짧은 글<br />
|
||||
<input type="checkbox" name="active_stage[]" value="english_sentence" />긴 글<br />
|
||||
|
||||
<br/><br/>
|
||||
<input type="button" value="업데이트" onClick="document.frm.submit();" />
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -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,23 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>hello phaser!</title>
|
||||
<script src="//cdn.jsdelivr.net/phaser/2.5.0/phaser.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form name="add_user" method="post" action="add_user.php">
|
||||
이름 : <input type="text" name="name" /><br />
|
||||
생년월일 : <input type="text" name="birthday" /><br />
|
||||
<input type="submit" value="추가">
|
||||
</form>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<form name="delete_test_user_data" method="get" action="delete_test_user_data.php">
|
||||
<input type="submit" value="test 유저 데이터 삭제">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -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