Exemplo n.º 1
0
    case "update":
        $passID = @UpdatePassType($_POST["update_id"], $_POST["pass_name"]);
        if ($passID > 0 && $_POST["update_id"] == 0) {
            ui_info("Created Pass: <strong>" . $_POST["pass_name"] . "</strong>");
        } elseif ($passID > 0 && $_POST["update_id"] != 0) {
            ui_info("Renamed Pass: <strong>" . $_POST["update_id"] . "</strong> to <strong>" . $_POST["pass_name"] . "</strong>");
        } elseif ($passID == 0 && $_POST["update_id"] != 0) {
            ui_alert("Failed to rename pass: <strong>" . $_POST["update_id"] . "</strong> to <strong>" . $_POST["pass_name"] . "</strong>");
        } 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();
Exemplo n.º 2
0
<?php

# List all exceptions, sorted by date.
require_once "./_logic.php";
$exceptions = GetExceptionsByLot();
?>

<div id="accordion">
<?php 
if (!empty($exceptions)) {
    foreach ($exceptions as $exception_group) {
        // If the lot has exceptions construct a header
        echo "\t<h1><a href=\"#\">" . $exception_group["name"] . "</a></h1>\n";
        echo "\t<div>\n";
        ui_info("<strong>" . $exception_group["description"] . "</strong>");
        foreach ($exception_group["exceptions"] as $exception) {
            // Print each exception
            echo "<p class=\"ui-state-default ui-corner-all ui-helper-clearfix\" style=\"padding:0px;\">";
            echo "<span class=\"ui-icon ui-icon-calendar\" style=\"position:relative; float:left; margin:1.3em 1em;\"></span>";
            echo date("F d, Y H:i", strtotime($exception["start"])) . "<br/>\n";
            echo date("F d, Y H:i", strtotime($exception["end"])) . "<br/>\n";
            echo $exception["allowed"] == 0 ? "<span style=\"color: #FF0000;\">Disallow</span>" : "<span style=\"color: #00FF00;\">Allow</span>";
            echo "</p>";
            foreach ($exception["passTypes"] as $pass) {
                echo $pass["name"] . "<br/>\n";
            }
        }
        echo "\t</div>\n";
    }
} else {
    echo "<h1><a href=\"#\">Order</a></h1>\n";
Exemplo n.º 3
0
<?php

# List all rules, sorted by lot or permit type.
require_once "./_logic.php";
@($lots = GetRulesByLot($_GET["lot"]));
?>

<div id="accordion">
<?php 
if (is_array($lots)) {
    foreach ($lots as $lot) {
        echo "\t<h1><a href=\"#\">" . $lot["name"] . "</a></h1>";
        echo "\t<div>";
        ui_info("<strong>" . $lot["description"] . "</strong>");
        foreach ($lot["dateRange"] as $date_range) {
            echo "<p class=\"ui-state-default ui-corner-all ui-helper-clearfix\" style=\"padding:0px;\">";
            echo "<span class=\"ui-icon ui-icon-calendar\" style=\"position:relative; float:left; margin:.1em .5em;\">&nbsp;</span>";
            echo date("F d, Y", strtotime($date_range["startDate"])) . " - " . date("F d, Y", strtotime($date_range["endDate"])) . "</p>\n";
            foreach ($date_range["timeRange"] as $time_range) {
                echo date("H:i", strtotime($time_range["startTime"])) . " - " . date("H:i", strtotime($time_range["endTime"])) . "<br/>\n";
                foreach ($time_range["dow"] as $dow) {
                    $days = explode(",", $dow["days"]);
                    if (is_array($days)) {
                        foreach ($days as $day) {
                            echo $dotw[$day] . " ";
                        }
                    }
                    echo "<br/>";
                    if (is_array($dow["passTypes"])) {
                        echo "<ul>\n";
                        foreach ($dow["passTypes"] as $pass) {
Exemplo n.º 4
0
<?php

# Create/Delete color schemes used by parking lots.
switch ($_POST["action"]) {
    case "update":
        $result = @UpdateScheme($_POST["update_id"], $_POST["update_name"], $_POST["update_line_color"], $_POST["update_line_width"], $_POST["update_line_opacity"], $_POST["update_fill_color"], $_POST["update_fill_opacity"]);
        if ($result != null) {
            ui_info("Updated Color Scheme: <strong>" . $_POST["update_name"] . "</strong>");
        } else {
            ui_alert("Updated Color Scheme: <strong>" . $_POST["update_name"] . "</strong>");
        }
        break;
    case "delete":
        $result = @DeleteSchemes($_POST["delete_scheme"]);
        if ($result > 0) {
            ui_info("Schemes Deleted: <strong>" . $result . "</strong>");
        } else {
            ui_alert("Schemes Deleted: <strong>" . $result . "</strong>");
        }
        break;
    default:
        break;
}
$schemes = GetSchemes();
?>
<style type="text/css">
	#red, #green, #blue {
		float: left;
		clear: left;
		width: 300px;
		margin: 15px;
Exemplo n.º 5
0
# Create/delete parking lots/areas.
require "./auth.php";
require_once "./_logic.php";
switch ($_POST["action"]) {
    case "update":
        $result = @UpdateLot($_POST["lot_list"], $_POST["lot_name"], $_POST["lot_description"], $_POST["lot_coords"], $_POST["lot_scheme"]);
        if ($result > 0) {
            ui_info("Updated Lot: <strong>" . $_POST["lot_name"] . "</strong>");
        } else {
            ui_alert("Failed to Update Lot: <strong>" . $_POST["lot_name"] . "</strong>");
        }
        break;
    case "delete":
        $result = @DeleteLots($_POST["delete_lots"]);
        if ($result) {
            ui_info("Deleted Lots: <strong>" . count($_POST["delete_lots"]) . "</strong>");
        } else {
            ui_alert("Failed to Delete Lots: <strong>" . count($_POST["delete_lots"]) . "</strong>");
        }
        break;
    default:
        break;
}
$lots = GetLots("name");
$schemes = GetSchemes();
?>

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js"></script>
<script type="text/javascript" src="./js/maps.js"></script>
<script type="text/javascript">
	var json_lots = jQuery.parseJSON('<?php 
Exemplo n.º 6
0
        // Empty field
        ui_alert("All fields required.");
        break;
    case 3:
        // Password mismatch
        ui_alert("Password mismatch.");
        break;
    case 4:
        // MySQL Error
        ui_alert("Could not connect: " . mysql_error());
    case 5:
        // E-Mail already registered
        ui_alert(stripslashes($_POST["email"]) . " is already registered by " . stripslashes($row["fullName"]) . ".");
        break;
    default:
        ui_info("All fields required.");
        break;
}
?>

<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(){
		$("#register").validate();
	});
</script>

<div id="tabs">
	<ul>
		<li><a href="#register_tab">New User</a></li>
	</ul>
Exemplo n.º 7
0
        } else {
            ui_alert("Failed to Promote User: <strong>" . $_POST["promote_user"] . "</strong>");
        }
        break;
    case "demote":
        $sql = "UPDATE users SET admin=0 WHERE id IN (" . implode(", ", $_POST["demote_user"]) . ")";
        if (mysql_query($sql)) {
            ui_info("Demoted User: <strong>" . count($_POST["demote_user"]) . "</strong>");
        } else {
            ui_alert("Failed to Demote User: <strong>" . count($_POST["demote_user"]) . "</strong>");
        }
        break;
    case "delete":
        $sql = "DELETE from users WHERE email='" . $_POST["delete_user"] . "'";
        if (mysql_query($sql)) {
            ui_info("Deleted User: <strong>" . $_POST["delete_user"] . "</strong>");
        } else {
            ui_alert("Failed to Delete User: <strong>" . $_POST["delete_user"] . "</strong>");
        }
        break;
    default:
        break;
}
$admins = GetAdmins();
?>

<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() {
	$("#promote_form").validate();
	$("#demote_form").validate();