<?php
header("Content-Type: application/json");

include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";

$maestro_id = $_POST["maestro_id"];


$allow_edit_entercode = get_allow_edit_entercode($maestro_id);
/*
if($allow_edit_entercode !== null) {
	set_error_code("no_data");
	set_error_message("해당 정보가 없습니다.");
	send_result_fail();
	exit;
}
*/

set_data("AllowEditEnterCode", $allow_edit_entercode);
send_result_success();
exit;



function get_allow_edit_entercode($maestro_id) {
	global $db_conn;

	$query = "SELECT AllowEditEnterCode FROM maestro WHERE MaestroID=?";
	$stmt = $db_conn->prepare($query);
	$stmt->bind_param("i", $maestro_id);
	$stmt->execute();
	$stmt->bind_result($allow_edit_entercode);
	// while($stmt->fetch()) {
	// 	;
	// }
	$stmt->fetch();
	$stmt->close();

	return $allow_edit_entercode;
}

?>