<?php
include 'config.php';
connect();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Uitslagen toevoegen</title>
</head>
<body>
<?php
############################################
# CREATE TABLE `uitslagen` ( #
# `id` INT NOT NULL , #
# `datum` VARCHAR( 255 ) NOT NULL , #
# `speel` VARCHAR( 255 ) NOT NULL , #
# `uitslag` VARCHAR( 255 ) NOT NULL , #
# PRIMARY KEY ( `id` ) #
# ) TYPE = MYISAM ; #
############################################
if($_SERVER['REQUEST_METHOD'] == "POST")
{
if(empty($_POST['thuis']) or
empty($_POST['uit']) or
empty($_POST['scorethuis']) or
empty($_POST['scoreuit'])) {
echo 'Je hebt niet alles ingevuld!'; }
else
{
$datum = "".$_POST['dag']." - ".$_POST['maand']." - ".$_POST['jaar']."";
$wievswie = "".$_POST['thuis']." - ".$_POST['uit']."";
$score = "".$_POST['scorethuis']." - ".$_POST['scoreuit']."";
mysql_query("INSERT INTO uitslagen (datum, speel, uitslag) VALUES ('".$datum."','".$wievswie."','".$score."')") or
die(mysql_error()); }
}
?>
<form name="uitslagen" method="post" action="">
<table style="border: 1px solid black;">
<tr>
<td>Datum: </td>
<td>
<select name="dag">
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
<option value='25'>25</option>
<option value='26'>26</option>
<option value='27'>27</option>
<option value='28'>28</option>
<option value='29'>29</option>
<option value='30'>30</option>
<option value='31'>31</option>
</select>
<select name="maand">
<option value='Januari'>Januari</option>
<option value='Februari'>Februari</option>
<option value='Maart'>Maart</option>
<option value='April'>April</option>
<option value='Mei'>Mei</option>
<option value='Juni'>Juni</option>
<option value='Juli'>Juli</option>
<option value='Augustus'>Augustus</option>
<option value='September'>September</option>
<option value='Oktober'>Oktober</option>
<option value='November'>November</option>
<option value='December'>December</option>
</select>
<select name="jaar">
<option value='2005'>2005</option>
<option value='2006'>2006</option>
<option value='2007'>2007</option>
</select>
</td>
</tr>
<tr>
<td>Wie tegen wie: </td>
<td>
<table border="0">
<tr>
<td>Thuis: </td><td><input type="text" name="thuis" /></td>
</tr>
<tr>
<td>Uit: </td><td><input type="text" name="uit" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>Uitslag: </td>
<td>
<table border="0">
<tr>
<td>Thuis: </td><td><input type="text" name="scorethuis" size="4" /></td>
</tr>
<tr>
<td>Uit: </td><td><input type="text" name="scoreuit" size="4"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Post deze uitslag!" /></td>
</tr>
</table>
</form>
</body>
</html>