rendered paste body<?include('config.php');ERROR_REPORTING('all');$ip=$_SERVER['REMOTE_ADDR'];$ip = substr($ip, 0, 9);{ if (empty($_POST)){ $out="<table><tr><th>Verblijf</th><th>Vanaf</th><th>Tot</th><th>Maand</th><th>Notitie</th></tr>"; $out .="<tr><td><form action=form.php method=post><input type=radio name=room1>Hokling"; $out .="<input type=radio name=room2>Mielgong"; $out .="<input type=radio name=room3>Jister</td>"; $out .="<td><input type=text name=from_day size=2></td>"; $out .="<td><input type=text name=till_day size=2></td>"; $out .="<td><input type=text name=month size=8></td>"; $out .="<td><input type=text name=note size=30></td></tr></table>"; $out .="<input type=submit name=henk></form>"; echo "".$out; } else { $_POST['from_day']=$_POST['from_day']-1; $_POST['till_day']=$_POST['till_day']+1; if ($_POST['room1']==true){ $note='note_1'; $status='status_1'; } if ($_POST['room2']==true){ $note='note_2'; $status='status_1'; } if ($_POST['room3']==true){ $note='note_3'; $status='status_1'; } if (!empty($_POST['note'])){ $text="UPDATE rooms SET $note = '$_POST[note]', $status='av' WHERE month = '$_POST[month]' AND day > $_POST[from_day] AND day < $_POST[till_day]"; mysql_query($text); } else { $text="UPDATE rooms SET $status = 'na' WHERE month = '$_POST[month]' AND day > $_POST[from_day] AND day < $_POST[till_day]"; mysql_query($text); } $out="<table><tr><th>Verblijf</th><th>Van</th><th>Tot</th><th>Maand</th></tr>"; $out .="<tr><td><form action=form.php method=post><input type=radio name=room1>Room 1"; $out .="<input type=radio name=room2>Room 2"; $out .="<input type=radio name=room3>Room 3</td>"; $out .="<td><input type=text name=from_day size=2></td>"; $out .="<td><input type=text name=till_day size=2></td>"; $out .="<td><input type=text name=month size=8></td>"; $out .="<td><input type=text name=note size=30></td></tr></table>"; $out .="<input type=submit name=henk></form>"; echo "".$out; }}?>