コード例 #1
0
ファイル: tracking.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";
$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);
        }
コード例 #2
0
ファイル: channels.php プロジェクト: a0099654/ATMS
<?php

require_once "config.php";
require_once "data/channel.DAO.php";
require_once "data/world.DAO.php";
$channelDAO = new channelDAO();
$worldDAO = new worldDAO();
if (isset($_POST["worldID"]) && !empty($_POST["worldID"]) && isset($_POST["channelNumber"]) && !empty($_POST["channelNumber"])) {
    $channelDAO->insertChannel($_POST["worldID"], $_POST["channelNumber"]);
}
$worldContainer = $worldDAO->getAllWorlds();
?>

<!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">World</th>
            <th style="width:90%">ChannelNumber</th>
            </thead>