Example #1
0
    saveChallenge($data);
}
if ($type == "saveChallengeText") {
    saveChallengeText($data);
}
if ($type == "loadLeague") {
    loadLeague($data);
}
if ($type == "searchLeague") {
    searchLeague($data);
}
if ($type == "updateLeagueName") {
    updateLeagueName($data);
}
if ($type == "searchTeam") {
    searchTeam($data);
}
function loadLeague($data)
{
    $state = $data["state"];
    $county = $data["county"];
    $city = $data["city"];
    $league = $state . '_' . $county;
    $array = array();
    $sql = "SELECT id as id FROM `league` where name = '{$league}'  ";
    $retval = mysql_query($sql);
    $exist = false;
    if (!$retval) {
        die('Could not enter data: ' . mysql_error());
    } else {
        while ($row = mysql_fetch_assoc($retval)) {
		isset($_POST['rgpart4']) &&
		isset($_POST['rgpart5']) &&
		isset($_POST['rgpart6'])){
			updateTeam($_POST['rgeventid'],
						$_POST['rgteamid'],
						$_POST['rgcaptainid'],
						$_POST['rgpart1'],
						$_POST['rgpart2'],
						$_POST['rgpart3'],
						$_POST['rgpart4'],
						$_POST['rgpart5'],
						$_POST['rgpart6']);
	}

	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'],