Ejemplo n.º 1
0
switch ($_GET["function"]) {
    case "Authenticate":
        $sql = "SELECT id, password, passType, admin FROM users WHERE email='" . addslashes($_GET["email"]) . "' AND password='******'";
        $result = mysql_fetch_assoc(mysql_query($sql));
        break;
    case "CanIParkHere":
        $result = CanIParkHere($_GET["latLng"], $_GET["pass"]);
        break;
    case "GetExceptionsByLot":
        $result = GetExceptionsByLot($_GET["lot"]);
        break;
    case "GetLots":
        $result = GetLots($_GET["sort"]);
        break;
    case "GetPassTypes":
        $result = GetPassTypes($_GET["sort"]);
        break;
    case "GetRulesByLot":
        $result = GetRulesByLot($_GET["lot"]);
        break;
    case "GetSchemes":
        $result = GetSchemes($_GET["id"]);
        break;
    case "GetSettingsForUser":
        $result = GetSettingsForUser($_GET["id"]);
        break;
    case "WhereCanIPark":
        $result = WhereCanIPark($_GET["pass"]);
        break;
    case "WhereDidIPark":
        $result = WhereDidIPark($_GET["id"]);
Ejemplo n.º 2
0
        } else {
            ui_alert("Failed to create pass: <strong>" . $_POST["pass_name"] . "</strong>");
        }
        break;
    case "delete":
        $result = @DeletePassTypes($_POST["delete_passes"]);
        if ($result) {
            ui_info("Deleted Passes: <strong>" . count($_POST["delete_passes"]) . "</strong>");
        } else {
            ui_alert("Failed to delete passes: <strong>" . count($_POST["delete_passes"]) . "</strong>");
        }
        break;
    default:
        break;
}
$passes = GetPassTypes("name");
?>

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#update_form").validate();
		$("#delete_form").validate();

		$("#update_id").bind("change keypress", function() {
			if($("#update_id").val() == 0) $("#update_form :submit").val("Create Pass");
			else $("#update_form :submit").val("Rename Pass");
		});
	});
</script>