}

	if(isset($_POST['key'])){
		echo json_encode(searchTeam($_POST['key']));
	}

	if(isset($_POST['rgeventid']) &&
						isset($_POST['rgcaptainid']) &&
						isset($_POST['rgpart1']) &&
						isset($_POST['rgpart2']) &&
						isset($_POST['rgpart3']) &&
						isset($_POST['rgpart4']) &&
						isset($_POST['rgpart5']) &&
						isset($_POST['rgpart6'])){
		echo createTeam($_POST['rgeventid'],
					$_POST['rgteamid'],
					$_POST['rgcaptainid'],
					$_POST['rgpart1'],
					$_POST['rgpart2'],
					$_POST['rgpart3'],
					$_POST['rgpart4'],
					$_POST['rgpart5'],
					$_POST['rgpart6']);
	}

	if(isset($_GET['eventid'])){
		echo json_encode(listEventTeams($_GET['eventid']));
	}
?>

Example #2
0
	include 'source.php';
	echo $header;
	session_start();
	if($_SESSION['user']!="manager")
		header("Location: index.php");
?>


</head>
<body>
<a href='/Sockmonkey'><div id='topbar'></div></a>
<div id='container'>
<?php
	echo $topBar;

	$arr=listEventTeams($_GET['eid']);
	$i=1;
	echo "<table border=\"1\">";
	echo "<tr><td></td><td>Event</td><td>".$_GET['eid']."</td></tr>";
	foreach ($arr as $key => $value) {
		 echo "<tr><td>$i</td><td>$key</td><td>$value</td></tr>";
		 $i++;
	}
	echo "</table>";

?>

<form id="searchBox" action="">
	<input type="search" id="search" placeholder="Enter the event ID" name="eid"/>
	<span id="SearchButton">Search<span>
</form>