コード例 #1
0
ファイル: maps.php プロジェクト: a0099654/ATMS
<?php

require_once "config.php";
require_once "data/map.DAO.php";
$mapDAO = new mapDAO();
if (isset($_POST["mapName"]) && !empty($_POST["mapName"])) {
    $mapDAO->insertMap($_POST["mapName"]);
}
$mapContainer = $mapDAO->getAllMaps();
?>

<!DOCTYPE html>
<html>
<head>
    <?php 
include 'partials/header.partial.php';
?>
</head>
<body>
<?php 
include 'partials/navbar.partial.php';
?>
<div class="container">
    <div class="col-sm-6 col-md-offset-3">
        <table class="table table-hover table-bordered">
            <thead>
            <th style="width:10%;text-align: center">MapID</th>
            <th style="width:90%">MapName</th>
            </thead>
            <?php 
foreach ($mapContainer as $map) {
コード例 #2
0
ファイル: index.php プロジェクト: a0099654/ATMS
<?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";
require_once "data/spawn.DAO.php";
$channelDAO = new channelDAO();
$worldDAO = new worldDAO();
$mapDAO = new mapDAO();
$trackingDAO = new trackingDAO();
$spawnDAO = new spawnDAO();
if ($_POST["spawnAction"] && !empty($_POST["spawnAction"])) {
    $splitKey = explode("-", $_POST["spawnAction"]);
    $worldID = $splitKey[0];
    $channelNumber = $splitKey[1];
    $mapID = $splitKey[2];
    $start = date('Y-m-d H:i:s');
    $spawnDAO->insertNewSpawn($worldID, $channelNumber, $mapID, $start, 5);
}
if ($_POST["stage1"] && !empty($_POST["stage1"])) {
    $spawnID = $_POST["stage1"];
    $spawn = $spawnDAO->getSpawnBySpawnID($spawnID);
    $spawn->setDefeat(date('Y-m-d H:i:s'));
    $spawn->setResult(1);
    $spawnDAO->updateSpawn($spawn);
}
if ($_POST["stage2"] && !empty($_POST["stage2"])) {
    $spawnID = $_POST["stage2"];
    $spawn = $spawnDAO->getSpawnBySpawnID($spawnID);