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

$maestro_id = $_POST["MaestroID"];
$player_id = $_POST["PlayerID"];
$start_time = $_POST["StartTime"];
$subject_name = $_POST["SubjectName"];
// echo $maestro_id." / ".$player_id." / ".$start_time." / ".$subject_name;

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


update_start_time($maestro_id, $player_id, $start_time, $subject_name);

send_result_success();
exit;



function update_start_time($maestro_id, $player_id, $start_time, $subject_name) {
	global $db_conn;

	$query = "
		UPDATE license_time
		SET StartTime = ?, SubjectName = ?
		WHERE MaestroID = ? AND PlayerID = ?
	";
	$stmt = $db_conn->prepare($query);
	$stmt->bind_param('isii', $start_time, $subject_name, $maestro_id, $player_id);
	$stmt->execute();
}

?>