<html>
<head/>
<body>
<?php
if ($_POST[themes1]<>'') {
	$data = simplexml_load_file('xml/users.xml');	
	$data->weeks->numweeks = $_POST[numweeks];
	$data->weeks->themes1 = $_POST[themes1];
	$data->weeks->themes2 = $_POST[themes2];
	$data->weeks->themes3 = $_POST[themes3];
	$data->weeks->themes4 = $_POST[themes4];
	$dom = new DOMDocument('1.0');
	$dom->preserveWhiteSpace = false;
	$dom->formatOutput = true;
	$dom->loadXML($data->asXML());
	$dom->save('xml/users.xml');
	echo ("Themes updated<br/>");	
	}
else {
	$data = simplexml_load_file('xml/users.xml');	
	$numweeks = $data->weeks->numweeks;
	$themes1 = $data->weeks->themes1;
	$themes2 = $data->weeks->themes2;
	$themes3 = $data->weeks->themes3;
	$themes4 = $data->weeks->themes4;
	}
	
?>
<form action='weeksadmin.php' method=post>
Number of weeks:<input type=text name=numweeks value=<?php echo $numweeks?>></input><br/>
Group 1 Themes:<input type=text name=themes1 value=<?php echo $themes1?>></input><br/>
Group 2 Themes:<input type=text name=themes2 value=<?php echo $themes2?>></input><br/>
Group 3 Themes:<input type=text name=themes3 value=<?php echo $themes3?>></input><br/>
Group 4 Themes:<input type=text name=themes4 value=<?php echo $themes4?>></input><br/>
<input type=submit>
</form>