<?php

include "MapDAO.php";
include "Map.php";
$mdao = new MapDAO();
$m = $mdao->selectById($_GET['id']);
?>
<html>
	<head>
		<title></title>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/tileconsts.js"></script>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/helpers.js"></script>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/sprite.js"></script>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/hero.js"></script>
<?php 
echo "<script type='text/javascript'>var map = stringToMap('{$m->getTiles()}');</script>";
?>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/init.js"></script>
	</head>
<body>
	<audio id="s_shot" src="sounds/Gun_Silencer.wav" autobuffer="autobuffer"></audio>
	<audio id="s_shell" src="sounds/41607shell.wav" autobuffer="autobuffer"></audio>
	<div id="debug">
	</div>
	

	<div id="hudbox">
		<span class="hud" id="levelname"><?php 
echo "\"" . $m->getName() . "\"";
?>
Пример #2
0
<?php

require_once "config.php";
require_once "data/channel.DAO.php";
require_once "data/world.DAO.php";
require_once "data/map.DAO.php";
require_once "data/tracking.DAO.php";
$channelDAO = new channelDAO();
$worldDAO = new worldDAO();
$mapDAO = new MapDAO();
$trackingDAO = new trackingDAO();
$trackingContainer = $trackingDAO->getAllTrackings();
if (isset($_POST["updateTracking"])) {
    unset($_POST["updateTracking"]);
    foreach ($_POST as $k => $value) {
        if (!isset($trackingContainer[$k])) {
            $splitKey = explode("-", $k);
            $worldID = $splitKey[0];
            $channelNumber = $splitKey[1];
            $mapID = $splitKey[2];
            $trackingDAO->insertTracking($worldID, $channelNumber, $mapID);
        }
    }
    foreach ($trackingContainer as $k => $value) {
        if (!isset($_POST[$k])) {
            $splitKey = explode("-", $k);
            $worldID = $splitKey[0];
            $channelNumber = $splitKey[1];
            $mapID = $splitKey[2];
            $trackingDAO->removeTracking($worldID, $channelNumber, $mapID);
        }
Пример #3
0
<?php

session_start();
require_once '../bean/MapBean.php';
require_once '../dao/MapDAO.php';
$mapBean = new MapBean();
$mapDAO = new MapDAO();
$op = $_POST["op"];
switch ($op) {
    case 1:
        $listaDistrito = $mapDAO->obtenerDistrito();
        echo json_encode($listaDistrito);
        break;
    case 2:
        $listaDistrito = $mapDAO->obtenerMapDistrito();
        echo json_encode($listaDistrito);
        break;
    case 3:
        $distrito = $_POST["distrito"];
        $mapBean->setDistrito($distrito);
        $listaDistrito = $mapDAO->obtenerAsigDistrito($mapBean);
        echo json_encode($listaDistrito);
        break;
    case 4:
        $idMap = $_POST["idMap"];
        $mapBean->setIdMap($idMap);
        $listaDistrito = $mapDAO->obtenerMapId($mapBean);
        echo json_encode($listaDistrito);
        break;
    case 5:
        $listaDistrito = $mapDAO->obtenerTodos();
<?php

include "MapDAO.php";
include "Map.php";
$mdao = new MapDAO();
$all = $mdao->selectAll();
?>
<html>
	<head>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/tileconsts.js"></script>
		<script type="text/javascript" src="http://localhost/Untitled-html5-tile-based-platformer/js/helpers.js"></script>
		<script type="text/javascript">
			window.onload = function(){
				var thumbs = $(".thumb");
				for(i in thumbs){
					var canvas = thumbs[i];
					var map = stringToMap(thumbs[i].innerHTML);
					drawMap(map, thumbs[i].getContext('2d'), 4, tileimages);
				}	
			}
		</script>
		<style type="text/css">
			.mapentry{
				margin-bottom: 30px;
			}
			.thumb{
				border:solid black 1px;
			}
		</style>
	</head>
<?php

include "MapDAO.php";
include "Map.php";
$mdao = new MapDAO();
$m = new Map();
$m->setTiles($_POST['tiles']);
$m->setName($_POST['name']);
$mdao->insert($m);