<?php
if(isset($_POST['done']))
{
	require'../connections/conn.php';
	$d=$_POST['date'];
	$app=$_POST['app'];
	$p=$_POST['p'];
	$app_id=$_POST['app_id'];
	$up="update `appointment` set `date`='$d' where `app_id`=$app_id";
	$s=$conn->query($up);
	echo "<script type='text/javascript'>window.location.href ='detail.php?app_id=$app&&p_id=$p'</script>";
}
$app=$_GET['app'];
$p=$_GET['p'];
$app_id=$_GET['app_id'];
?>
<form action="" method="post">
	<input type="date" name="date" required>
	<input type="hidden" name="p" value="<?php echo $p;?>">
	<input type="hidden" name="app" value="<?php echo $app;?>">
	<input type="hidden" name="app_id" value="<?php echo $app_id;?>">
	<input type="submit" name="done" value="change">
</form>