コード例 #1
0
function showAdminInfo($getPage_connection2)
{
    $nationInfo = getNationInfo($getPage_connection2, $_SESSION["nation_id"]);
    $continentInfo = getContinentInfo($getPage_connection2, $nationInfo["home"]);
    echo "        <div class=\"spacing-from-menu well well-lg standard-text\">\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">Control Panel        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseControlPanel\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseControlPanel\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    echo "                  <form action=\"index.php?page=admin\" method=\"post\">\n";
    echo "                    <input type=\"hidden\" name=\"page\" value=\"admin\" />\n";
    echo "                    <div class=\"form-group form-group-sm\">\n";
    echo "                      <button onclick=\"loadButton(this)\" value=\"custom_script\" name=\"action\" id=\"custom_script\" type=\"submit\" class=\"btn btn-md btn-primary\">Run Custom Script</button>\n";
    echo "                    </div>\n";
    echo "                    <div class=\"form-group form-group-sm\">\n";
    echo "                      <label class=\"control-label\" for=\"reset_world\">WARNING: ALL WORLD DATA WILL BE LOST!  ADMINISTRATOR PASSWORD WILL BE RESET TO DEFAULT!</label>\n";
    echo "                      <button onclick=\"loadButton(this)\" value=\"reset_world\" name=\"action\" id=\"reset_world\" type=\"submit\" class=\"btn btn-md btn-danger\">Reset World to Defaults</button>\n";
    echo "                    </div>\n";
    echo "                  </form>\n";
    echo "                </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "        </div>\n";
}
コード例 #2
0
function showPoliciesInfo($getPage_connection2)
{
    $nationInfo = getNationInfo($getPage_connection2, $_SESSION["nation_id"]);
    $continentInfo = getContinentInfo($getPage_connection2, $nationInfo["home"]);
    $productionInfo = getProductionInfo($getPage_connection2, $_SESSION["nation_id"]);
    $authorityReport = getAuthorityReport($nationInfo["authority"]);
    $economyReport = getEconomyReport($nationInfo["economy"]);
    $rankingInfo = getRankingInfo($getPage_connection2, $_SESSION["nation_id"]);
    echo "        <div class=\"spacing-from-menu well well-lg standard-text\">\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View basic govermental policies.\" class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">Government        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseGovernment\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseGovernment\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    echo "                <h3>" . $nationInfo["formal"] . "</h3>\n";
    echo "                <br />\n";
    if (strlen($nationInfo["flag"]) >= 1) {
        echo "                <img class=\"info_flag\" src=\"" . $nationInfo["flag"] . "\" alt=\"Flag of " . $nationInfo["name"] . "\" />\n";
    } else {
        echo "                <img class=\"info_flag\" src=\"images/blank.png\" alt=\"Flag of " . $nationInfo["name"] . "\" />\n";
    }
    // else
    echo "                <br />\n";
    echo "                <br />\n";
    echo "                <br />\n";
    echo "                Home Continent: " . $continentInfo["name"] . " (" . $nationInfo["home"] . ") \n";
    echo "                <br />\n";
    echo "                Authority: " . $nationInfo["authority"] . "/10\n";
    echo "                <br />\n";
    echo "                " . $authorityReport . "\n";
    echo "                <br />\n";
    echo "                Economy: " . $nationInfo["economy"] . "/10\n";
    echo "                <br />\n";
    echo "                " . $economyReport . "\n";
    echo "              </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Change basic govermental policies.\" class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">Change Policies        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseChange\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseChange\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    echo "                <label class=\"control-label\">Reform Government:</label> \n";
    echo "                  <form action=\"index.php?page=policies\" method=\"post\">\n";
    echo "                    <input type=\"hidden\" name=\"page\" value=\"policies\" />\n";
    if ($nationInfo["authorityChanged"] == 0) {
        echo "                    <div class=\"form-group form-group-sm\">\n";
        if ($nationInfo["authority"] > 0) {
            echo "                      <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Decrease authority.  This will mean less state control of society.\" value=\"aminus\" name=\"action\" id=\"authority_decrease\" type=\"submit\" class=\"btn btn-md btn-primary\"><span class=\"glyphicon glyphicon-minus\"></span></button>\n";
        }
        // if
        echo "                Authority\n";
        if ($nationInfo["authority"] < 10) {
            echo "                      <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Increase authority.  This will mean more state control of society.\" value=\"aplus\" name=\"action\" id=\"authority_increase\" type=\"submit\" class=\"btn btn-md btn-primary\"><span class=\"glyphicon glyphicon-plus\"></span></button>\n";
        }
        // if
        echo "                    </div>\n";
    } else {
        echo "                    Authority has already been reformed this turn. <br />\n";
    }
    // else
    if ($nationInfo["economyChanged"] == 0) {
        echo "                    <div class=\"form-group form-group-sm\">\n";
        if ($nationInfo["economy"] > 0) {
            echo "                      <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Decrease economic control.  This will mean less state intervention in the economy.\" value=\"eminus\" name=\"action\" id=\"economy_decrease\" type=\"submit\" class=\"btn btn-md btn-primary\"><span class=\"glyphicon glyphicon-minus\"></span></button>\n";
        }
        // if
        echo "                        Economy\n";
        if ($nationInfo["economy"] < 10) {
            echo "                      <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Increase economic control.  This will mean more state intervention in the economy.\" value=\"eplus\" name=\"action\" id=\"economy_increase\" type=\"submit\" class=\"btn btn-md btn-primary\"><span class=\"glyphicon glyphicon-plus\"></span></button>\n";
        }
        // if
        echo "                    </div>\n";
    } else {
        echo "                    Economy has already been reformed this turn. <br />\n";
    }
    // else
    echo "                    <div class=\"form-group form-group-sm\">\n";
    echo "                      <label class=\"control-label\" for=\"formal\">Formal Name:</label>\n";
    echo "                      <input name=\"formalname\" type=\"text\" class=\"form-control input-md\" id=\"formal\" placeholder=\"New Formal Name of Nation\" />\n";
    echo "                      <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Change long formal name of nation.  This will not affect the regular short name of your nation!\" value=\"formal\" name=\"action\" id=\"formal_change\" type=\"submit\" class=\"btn btn-md btn-primary\">Change Formal Name</button>\n";
    echo "                    </div>\n";
    echo "                  </form>\n";
    echo "                  <form action=\"index.php?page=policies&amp;action=flag\" method=\"post\" enctype=\"multipart/form-data\">\n";
    echo "                    <div class=\"form-group form-group-sm\">\n";
    echo "                      <label class=\"control-label\" for=\"fileToUpload\">Upload New Flag:</label>\n";
    echo "                      <br />\n";
    echo "                      <span data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Select an image file from your computer to be your new flag.\" class=\"btn btn-med btn-default btn-file\">\n";
    echo "                        Browse <input type=\"file\" name=\"fileToUpload\" id=\"fileToUpload\" />\n";
    echo "                      </span>\n";
    echo "                      <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Upload your new flag.\" value=\"flag\" name=\"action\" type=\"submit\" class=\"btn btn-md btn-primary\">Change Flag</button>\n";
    echo "                    </div>\n";
    echo "                  </form>\n";
    echo "                </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Change production expenditure and prioritization.\" class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">Production        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseProduction\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseProduction\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    echo "                <form action=\"index.php?page=policies\" method=\"post\">\n";
    echo "                  <div class=\"form-group form-group-sm\">\n";
    echo "                    <input type=\"hidden\" name=\"page\" value=\"policies\" />\n";
    echo "                    <label class=\"control-label\" for=\"slider1\">Production Spending Percentage:</label>\n";
    echo "                    <input data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Change the amount of production you spend for this turn.  Remember that production does not transfer over to the next turn!\" name=\"prod-percent\" id=\"slider1\" type=\"range\" min=\"0\" max=\"100\" step=\"5\" value=\"" . $productionInfo["spending"] . "\" class=\"\" />\n";
    echo "                    <br />\n";
    $productionInfo1 = getProductionInfo($getPage_connection2, $_SESSION["nation_id"]);
    if ($productionInfo1["id"] >= 1) {
        for ($k = 0; $k < count($productionInfo1["goods"]) + 1; $k++) {
            $new_index = $k + 1;
            $goodsInfo2 = getGoodsInfo($getPage_connection2, $new_index);
            if ($goodsInfo2["id"] >= 1) {
                echo "                    <label class=\"control-label\" for=\"slider_prod-" . $goodsInfo2["name"] . "\">Emphasize " . $goodsInfo2["name"] . ":</label>\n";
                echo "                    " . round($goodsInfo2["productionRequired"], 2, PHP_ROUND_HALF_UP) . " Production, " . round($goodsInfo2["foodRequired"], 2, PHP_ROUND_HALF_UP) . " Food";
                for ($t = 0; $t < count($goodsInfo2["resourceTypesRequired"]); $t++) {
                    if ($goodsInfo2["resourceTypesRequired"][$t] >= 1) {
                        echo ", ";
                        $resourceTypeInfo1 = getResourceTypeInfo($getPage_connection2, $goodsInfo2["resourceTypesRequired"][$t]);
                        echo $goodsInfo2["resourceQuantitiesRequired"][$t] . " " . $resourceTypeInfo1["name"];
                    }
                    // if
                }
                // for
                echo "\n";
                $productionType = $goodsInfo2["id"];
                if (strlen($productionType) >= 1) {
                    echo "                    <input data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Change prioritization of producing this good.\" name=\"prod[" . $k . "]\" id=\"slider_prod-" . $productionType . "\" type=\"range\" min=\"0\" max=\"3\" step=\"1\" value=\"" . $productionInfo1["goods"][$k] . "\" />\n";
                } else {
                    echo "                    <input data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Change prioritization of producing this good.\" name=\"prod[" . $k . "]\" id=\"slider_prod-" . $productionType . "\" type=\"range\" min=\"0\" max=\"3\" step=\"1\" value=\"0\" />\n";
                }
                // else
            }
            // if
        }
        // for
    }
    // if
    echo "                    <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Submit changes to production expenditure and prioritization.\" value=\"prod\" name=\"action\" id=\"prod_change\" type=\"submit\" class=\"btn btn-md btn-primary\">Set Production</button>\n";
    echo "                  </div>\n";
    echo "                </form>\n";
    echo "              </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View general information about nation.\" class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">General        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseGeneral\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseGeneral\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    echo "                Production: " . $nationInfo["production"] . ", #" . $rankingInfo["production"] . " in world\n";
    echo "                <br />\n";
    echo "                Money: " . $nationInfo["money"] . ", #" . $rankingInfo["money"] . " in world\n";
    echo "                <br />\n";
    echo "                Debt: " . $nationInfo["debt"] . "\n";
    echo "                <br />\n";
    if ($nationInfo["happiness"] >= 4) {
        echo "                Happiness: <img src=\"images/happiness/4.png\" alt=\"Very Happy\" />" . $nationInfo["happiness"] . ", #" . $rankingInfo["happiness"] . " in world\n";
    } else {
        if ($nationInfo["happiness"] >= 3) {
            echo "                Happiness: <img src=\"images/happiness/3.png\" alt=\"Happy\" />" . $nationInfo["happiness"] . ", #" . $rankingInfo["happiness"] . " in world\n";
        } else {
            if ($nationInfo["happiness"] >= 2) {
                echo "                Happiness: <img src=\"images/happiness/2.png\" alt=\"Neutral\" />" . $nationInfo["happiness"] . ", #" . $rankingInfo["happiness"] . " in world\n";
            } else {
                echo "                Happiness: <img src=\"images/happiness/1.png\" alt=\"Unhappy\" />" . $nationInfo["happiness"] . ", #" . $rankingInfo["happiness"] . " in world\n";
            }
        }
    }
    // else
    echo "                <br />\n";
    echo "                Food: " . round($nationInfo["food"], 2, PHP_ROUND_HALF_UP) . ", #" . $rankingInfo["food"] . " in world\n";
    echo "                <br />\n";
    echo "                Population: " . $nationInfo["population"] . ", #" . $rankingInfo["population"] . " in world\n";
    echo "              </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View goods inventory statistics of nation.\" class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">Goods        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseGoods\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseGoods\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    for ($zz = 0; $zz < count($nationInfo["goods"]); $zz++) {
        $goodsInfoK = getGoodsInfo($getPage_connection2, $zz + 1);
        echo "                " . $goodsInfoK["name"] . ": " . $nationInfo["goods"][$zz] . "\n";
        echo "                <br />\n";
    }
    // for
    echo "              </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View resources inventory statistics of nation.\" class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">Resources        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseResources\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseResources\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    for ($zz = 0; $zz < count($nationInfo["resources"]); $zz++) {
        $resourceTypeInfoK = getResourceTypeInfo($getPage_connection2, $zz + 1);
        echo "                " . $resourceTypeInfoK["name"] . ": " . $nationInfo["resources"][$zz] . "\n";
        echo "                <br />\n";
    }
    // for
    echo "              </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View organizations that nation is currently a member of.\" class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">Organizations        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseOrganizations\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseOrganizations\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    echo "                ";
    $belongstoOrgs = false;
    for ($z = 0; $z < count($nationInfo["organizations"]); $z++) {
        if ($z >= 1 && $nationInfo["organizations"][0] > 0) {
            echo ", ";
        }
        // if
        if ($nationInfo["organizations"][$z] >= 1) {
            $organizationInfo1 = getOrganizationInfo($getPage_connection2, $nationInfo["organizations"][$z]);
            echo "<a href=\"index.php?page=info&amp;section=orgs&amp;info_id=" . $organizationInfo1["id"] . "\">" . $organizationInfo1["name"] . "</a>";
            if (strlen($organizationInfo1["name"]) >= 1) {
                $belongsToOrgs = true;
            }
            // if
        }
        // if
    }
    // for
    echo "                \n";
    echo "              </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "        </div>\n";
}
コード例 #3
0
function showSearchInfo($getPage_connection2)
{
    $nationInfo = getNationInfo($getPage_connection2, $_SESSION["nation_id"]);
    $continentInfo = getContinentInfo($getPage_connection2, $nationInfo["home"]);
    echo "        <div class=\"spacing-from-menu well well-lg standard-text\">\n";
    echo "          <div class=\"panel panel-info\">\n";
    echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Search results based on query.\" class=\"panel-heading\">\n";
    echo "              <h3 class=\"panel-title\">Search Results        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseSearchResults\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "            </div>\n";
    echo "            <div id=\"collapseSearchResults\" class=\"panel-body collapse in\">\n";
    echo "              <div class=\"col-md-8 col-center\">\n";
    echo $_SESSION["results_output"];
    echo "              </div>\n";
    echo "            </div>\n";
    echo "          </div>\n";
    echo "        </div>\n";
}
コード例 #4
0
function showInfoInfo($getPage_connection2)
{
    echo "        <div class=\"spacing-from-menu well well-lg standard-text\">\n";
    if ($_SESSION["section"] == "nations") {
        $nationInfo = getNationInfo($getPage_connection2, $_SESSION["info_id"]);
        $continentInfo = getContinentInfo($getPage_connection2, $nationInfo["home"]);
        $authorityReport = getAuthorityReport($nationInfo["authority"]);
        $economyReport = getEconomyReport($nationInfo["economy"]);
        $rankingInfo = getRankingInfo($getPage_connection2, $_SESSION["info_id"]);
        echo "          <div class=\"panel panel-info\">\n";
        echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View basic govermental policies.\" class=\"panel-heading\">\n";
        echo "              <h3 class=\"panel-title\">Government        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseGovernment\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
        echo "            </div>\n";
        echo "            <div id=\"collapseGovernment\" class=\"panel-body collapse in\">\n";
        echo "              <div class=\"col-md-8 col-center\">\n";
        echo "                <h3>" . $nationInfo["formal"] . "</h3>\n";
        echo "                <br />\n";
        if (strlen($nationInfo["flag"]) >= 1) {
            echo "                <img class=\"info_flag\" src=\"" . $nationInfo["flag"] . "\" alt=\"Flag of " . $nationInfo["name"] . "\" />\n";
        } else {
            echo "                <img class=\"info_flag\" src=\"images/blank.png\" alt=\"Flag of " . $nationInfo["name"] . "\" />\n";
        }
        // else
        echo "                <br />\n";
        echo "                <br />\n";
        echo "                <br />\n";
        echo "                Home Continent: " . $continentInfo["name"] . " (" . $nationInfo["home"] . ") \n";
        echo "                <br />\n";
        echo "                Authority: " . $nationInfo["authority"] . "/10\n";
        echo "                <br />\n";
        echo "                " . $authorityReport . "\n";
        echo "                <br />\n";
        echo "                Economy: " . $nationInfo["economy"] . "/10\n";
        echo "                <br />\n";
        echo "                " . $economyReport . "\n";
        echo "              </div>\n";
        echo "            </div>\n";
        echo "          </div>\n";
        echo "          <div class=\"panel panel-info\">\n";
        echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View general information about nation.\" class=\"panel-heading\">\n";
        echo "              <h3 class=\"panel-title\">General        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseGeneral\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
        echo "            </div>\n";
        echo "            <div id=\"collapseGeneral\" class=\"panel-body collapse in\">\n";
        echo "              <div class=\"col-md-8 col-center\">\n";
        echo "                Production: " . $nationInfo["production"] . ", #" . $rankingInfo["production"] . " in world\n";
        echo "                <br />\n";
        echo "                Money: " . $nationInfo["money"] . ", #" . $rankingInfo["money"] . " in world\n";
        echo "                <br />\n";
        echo "                Debt: " . $nationInfo["debt"] . "\n";
        echo "                <br />\n";
        if ($nationInfo["happiness"] >= 4) {
            echo "                Happiness: <img src=\"images/happiness/4.png\" alt=\"Very Happy\" />" . $nationInfo["happiness"] . ", #" . $rankingInfo["happiness"] . " in world\n";
        } else {
            if ($nationInfo["happiness"] >= 3) {
                echo "                Happiness: <img src=\"images/happiness/3.png\" alt=\"Happy\" />" . $nationInfo["happiness"] . ", #" . $rankingInfo["happiness"] . " in world\n";
            } else {
                if ($nationInfo["happiness"] >= 2) {
                    echo "                Happiness: <img src=\"images/happiness/2.png\" alt=\"Neutral\" />" . $nationInfo["happiness"] . ", #" . $rankingInfo["happiness"] . " in world\n";
                } else {
                    echo "                Happiness: <img src=\"images/happiness/1.png\" alt=\"Unhappy\" />" . $nationInfo["happiness"] . ", #" . $rankingInfo["happiness"] . " in world\n";
                }
            }
        }
        // else
        echo "                <br />\n";
        echo "                Food: " . round($nationInfo["food"], 2, PHP_ROUND_HALF_UP) . ", #" . $rankingInfo["food"] . " in world\n";
        echo "                <br />\n";
        echo "                Population: " . $nationInfo["population"] . ", #" . $rankingInfo["population"] . " in world\n";
        echo "              </div>\n";
        echo "            </div>\n";
        echo "          </div>\n";
        echo "          <div class=\"panel panel-info\">\n";
        echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View organizations that nation is currently a member of.\" class=\"panel-heading\">\n";
        echo "              <h3 class=\"panel-title\">Organizations        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseOrganizations\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
        echo "            </div>\n";
        echo "            <div id=\"collapseOrganizations\" class=\"panel-body collapse in\">\n";
        echo "              <div class=\"col-md-8 col-center\">\n";
        echo "                ";
        $belongstoOrgs = false;
        for ($z = 0; $z < count($nationInfo["organizations"]); $z++) {
            if ($z >= 1 && $nationInfo["organizations"][0] > 0) {
                echo ", ";
            }
            // if
            if ($nationInfo["organizations"][$z] >= 1) {
                $organizationInfo1 = getOrganizationInfo($getPage_connection2, $nationInfo["organizations"][$z]);
                echo "<a href=\"index.php?page=info&amp;section=orgs&amp;info_id=" . $organizationInfo1["id"] . "\">" . $organizationInfo1["name"] . "</a>";
                if (strlen($organizationInfo1["name"]) >= 1) {
                    $belongsToOrgs = true;
                }
                // if
            }
            // if
        }
        // for
        echo "                \n";
        echo "              </div>\n";
        echo "            </div>\n";
        echo "          </div>\n";
    } else {
        $organizationInfo = getOrganizationInfo($getPage_connection2, $_SESSION["info_id"]);
        echo "          <div class=\"panel panel-info\">\n";
        echo "            <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"View general information about organization.\" class=\"panel-heading\">\n";
        echo "              <h3 class=\"panel-title\">General        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseGeneral\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
        echo "            </div>\n";
        echo "            <div id=\"collapseGeneral\" class=\"panel-body collapse in\">\n";
        echo "              <div class=\"col-md-8 col-center\">\n";
        echo "                <h3>" . $organizationInfo["name"] . "</h3>\n";
        echo "                <br />\n";
        echo "                Ranking: " . $organizationInfo["ranking"] . " \n";
        echo "                <br />\n";
        echo "                <br />\n";
        echo "                Managers: " . count($organizationInfo["managers"]) . "\n";
        echo "                <br />\n";
        for ($z = 0; $z < count($organizationInfo["managers"]); $z++) {
            if ($z >= 1) {
                echo ", ";
            }
            // if
            if ($organizationInfo["managers"][$z] >= 1) {
                $nationInfo1 = getNationInfo($getPage_connection2, $organizationInfo["managers"][$z]);
                echo "<a href=\"index.php?page=info&amp;section=nations&amp;info_id=" . $nationInfo1["id"] . "\">" . $nationInfo1["name"] . "</a>";
            }
            // if
        }
        // for
        echo "                <br />\n";
        echo "                Members: " . count($organizationInfo["members"]) . "\n";
        echo "                <br />\n";
        for ($za = 0; $z < count($organizationInfo["members"]); $za++) {
            if ($za >= 1) {
                echo ", ";
            }
            // if
            if ($organizationInfo["members"][$za] >= 1) {
                $nationInfo1 = getNationInfo($getPage_connection2, $organizationInfo["members"][$za]);
                echo "<a href=\"index.php?page=info&amp;section=nations&amp;info_id=" . $nationInfo1["id"] . "\">" . $nationInfo1["name"] . "</a>";
            }
            // if
        }
        // for
        echo "              </div>\n";
        echo "            </div>\n";
        echo "          </div>\n";
    }
    // else
    echo "        </div>\n";
}
コード例 #5
0
function showMapInfo($getPage_connection2)
{
    echo "          <div class=\"well well-lg info_well row\">\n";
    // Command Module
    $unitInfo = getUnitInfo($getPage_connection2, $_SESSION["continent_id"], $_SESSION["xpos"], $_SESSION["ypos"]);
    echo "            <div class=\"col-sm-4 info_panels\">\n";
    echo "              <div class=\"panel panel-danger\">\n";
    echo "                <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Command your units on the present tile.\" class=\"panel-heading\">\n";
    echo "                  <h3 class=\"panel-title\">Command        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseCommand\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "                </div>\n";
    echo "                <div id=\"collapseCommand\" class=\"panel-body standard-text collapse in\">\n";
    if ($unitInfo["id"] >= 1) {
        $unitTypeInfo = getUnitTypeInfo($getPage_connection2, $unitInfo["type"]);
        $currentPlayer = false;
        $nationInfoX = getNationInfo($getPage_connection2, $unitInfo["owner"]);
        if ($unitInfo["owner"] == $_SESSION["nation_id"]) {
            $currentPlayer = true;
        }
        // if
        echo "                  <ul class=\"list-group\">\n";
        echo "                    <li class=\"list-group-item\">\n";
        echo "                      " . $unitInfo["name"] . "\n";
        echo "                      <br />\n";
        echo "                      " . $unitTypeInfo["name"] . "\n";
        echo "                      <br />\n";
        echo "                      " . $unitInfo["health"] . " / " . $unitTypeInfo["health"] . " HP\n";
        echo "                      <br />\n";
        echo "                      Moves: " . ($unitTypeInfo["movement"] - $unitInfo["used"]) . " / " . $unitTypeInfo["movement"] . "\n";
        echo "                      <br />\n";
        echo "                      Level " . $unitInfo["level"] . "\n";
        echo "                      <br />\n";
        echo "                      Experience: " . $unitInfo["exp"] . "\n";
        echo "                      <br />\n";
        echo "                      Owned by <a href=\"index.php?page=info&amp;section=nations&amp;info_id=" . $nationInfoX["id"] . "\">" . $nationInfoX["name"] . "</a>\n";
        echo "                    </li>\n";
        if ($currentPlayer === true) {
            echo "                    <li class=\"list-group-item\">\n";
            echo "                      <div class=\"row\">\n";
            echo "                        Modify/Abilities\n                        <br />\n                        <br />\n";
            echo "                      </div>\n";
            echo "                      <div class=\"row\">\n";
            if ($unitInfo["level"] < 20) {
                echo "                        <div class=\"col-xs-3\">\n";
                echo "                          <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                echo "                            <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                echo "                            <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                echo "                            <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                echo "                            <input type=\"hidden\" name=\"actionid\" value=\"" . $unitInfo["id"] . "\" />\n";
                echo "                            <input type=\"hidden\" name=\"action\" value=\"unit-upgrade\" />\n";
                echo "                            <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
                echo "                            <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Upgrade unit.  &nbsp; Cost: " . $unitTypeInfo["baseCost"] * ($unitInfo["level"] + 1) . "\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_upgrade.png\" alt=\"Upgrade\" /></button>\n";
                echo "                          </form>\n";
                echo "                        </div>\n";
            }
            // if
            echo "                        <div class=\"col-xs-3\">\n";
            echo "                          <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
            echo "                            <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
            echo "                            <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
            echo "                            <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
            echo "                            <input type=\"hidden\" name=\"actionid\" value=\"" . $unitInfo["id"] . "\" />\n";
            echo "                            <input type=\"hidden\" name=\"action\" value=\"unit-remove\" />\n";
            echo "                            <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
            echo "                            <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Remove unit.\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_remove.png\" alt=\"Remove\" /></button>\n";
            echo "                          </form>\n";
            echo "                        </div>\n";
            echo "                        <div class=\"col-xs-3\">\n\n";
            echo "                          <span data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Rename unit.\">\n";
            $rand_modal = mt_rand(1, 100);
            echo "                          <button type=\"button\" data-toggle=\"modal\" data-target=\"#renameUnitModal" . $rand_modal . "\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_rename.png\" alt=\"Rename\" /></button>\n\n";
            echo "                          <!-- Modal -->\n";
            echo "                          <div id=\"renameUnitModal" . $rand_modal . "\" class=\"modal fade\" role=\"dialog\">\n";
            echo "                            <div class=\"modal-dialog\">\n";
            echo "                              <!-- Modal content-->\n";
            echo "                              <div class=\"modal-content\">\n";
            echo "                                <div class=\"modal-header\">\n";
            echo "                                  <button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>\n";
            echo "                                  <h4 class=\"modal-title\">Rename Unit</h4>\n";
            echo "                                </div>\n";
            echo "                                <div class=\"modal-body\">\n";
            echo "                                  <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
            echo "                            \t      <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
            echo "                                    <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
            echo "                                    <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
            echo "                                    <input type=\"hidden\" name=\"actionid\" value=\"" . $unitInfo["id"] . "\" />\n";
            echo "                                    <input type=\"hidden\" name=\"action\" value=\"unit-rename\" />\n";
            echo "                                    <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
            echo "                                    <div class=\"form-group form-group-sm\">\n";
            echo "                                      <input data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Your unit's new name.\" name=\"rename\" type=\"text\" class=\"form-control\" id=\"rename_unit\" placeholder=\"Bravo Regiment\" />\n";
            echo "                                    </div>\n";
            echo "                                    <div class=\"form-group form-group-sm\">\n";
            echo "                                      <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Rename unit.\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-md\">Rename</button>\n";
            echo "                                    </div>\n";
            echo "                                  </form>\n";
            echo "                                </div>\n";
            echo "                                <div class=\"modal-footer\">\n";
            echo "                                  <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n";
            echo "                                </div>\n";
            echo "                              </div>\n";
            echo "                            </div>\n";
            echo "                          </div>\n\n";
            echo "                          </span>\n";
            echo "                        </div>\n";
            echo "                      </div>\n";
            echo "                    </li>\n";
        }
        // if
        $directionsX = array(0 => -1, 1 => 0, 2 => 1, 3 => -1, 4 => 0, 5 => 1, 6 => -1, 7 => 0, 8 => 1);
        $directionsY = array(0 => -1, 1 => -1, 2 => -1, 3 => 0, 4 => 0, 5 => 0, 6 => 1, 7 => 1, 8 => 1);
        $directionsName = array(0 => "Northwest", 1 => "North", 2 => "Northeast", 3 => "West", 4 => "Hold", 5 => "East", 6 => "Southwest", 7 => "South", 8 => "Southeast");
        // unloading
        if ($currentPlayer === true) {
            $notTransport = false;
            $notUnload = false;
            // land units: can't move out of continent
            if ($unitInfo["transport"] >= 1) {
                $transportInfo = getTransportInfo($getPage_connection2, $unitInfo["transport"]);
                if ($transportInfo["id"] >= 1) {
                    if (count($transportInfo["list"]) >= 2) {
                        $unitInfoI = getUnitInfoByID($getPage_connection2, $transportInfo["list"][1]);
                        echo "                    <li class=\"list-group-item\">\n";
                        echo "                      <div class=\"row\">\n";
                        $carrying = count($transportInfo["list"]) - 1;
                        echo "                        Carrying " . $carrying . " of 4\n                        <br />\n                        <br />\n";
                        echo "                        Unload unit " . $unitInfoI["name"] . ": \n                        <br />\n                        <br />\n";
                    } else {
                        $notUnload = true;
                    }
                    // else
                } else {
                    $notTransport = true;
                }
                // else
            } else {
                $notTransport = true;
            }
            // else
            // if the unit is transport,
            if ($notTransport === false) {
                // if units can be unloaded
                if ($notUnload === false) {
                    $unitTypeInfoI = getUnitTypeInfo($getPage_connection2, $unitInfoI["type"]);
                    if ($unitInfoI["used"] < $unitTypeInfoI["movement"]) {
                        for ($hh = 0; $hh < count($directionsX); $hh++) {
                            $newcontinent = $_SESSION["continent_id"];
                            $newxpos = $_SESSION["xpos"] + $directionsX[$hh];
                            $newypos = $_SESSION["ypos"] + $directionsY[$hh];
                            $tileInfoQ = getTileInfo($getPage_connection2, $newcontinent, $newxpos, $newypos);
                            $grey = false;
                            $unload = false;
                            if ($tileInfoQ["terrain"] == 2) {
                                $unload = false;
                            } else {
                                $unload = true;
                            }
                            // else
                            if ($unload === true) {
                                if ($directionsName[$hh] == "Northwest") {
                                    if ($_SESSION["xpos"] > 1 && $_SESSION["ypos"] > 1) {
                                        $grey = false;
                                    } else {
                                        $grey = true;
                                    }
                                    // else
                                } else {
                                    if ($directionsName[$hh] == "North") {
                                        if ($_SESSION["ypos"] > 1) {
                                            $grey = false;
                                        } else {
                                            $grey = true;
                                        }
                                        // else
                                    } else {
                                        if ($directionsName[$hh] == "Northeast") {
                                            if ($_SESSION["xpos"] < 20 && $_SESSION["ypos"] > 1) {
                                                $grey = false;
                                            } else {
                                                $grey = true;
                                            }
                                            // else
                                        } else {
                                            if ($directionsName[$hh] == "West") {
                                                if ($_SESSION["xpos"] > 1) {
                                                    $grey = false;
                                                } else {
                                                    $grey = true;
                                                }
                                                // else
                                            } else {
                                                if ($directionsName[$hh] == "Hold") {
                                                    $grey = true;
                                                } else {
                                                    if ($directionsName[$hh] == "East") {
                                                        if ($_SESSION["xpos"] < 20) {
                                                            $grey = false;
                                                        } else {
                                                            $grey = true;
                                                        }
                                                        // else
                                                    } else {
                                                        if ($directionsName[$hh] == "Southwest") {
                                                            if ($_SESSION["xpos"] > 1 && $_SESSION["ypos"] < 20) {
                                                                $grey = false;
                                                            } else {
                                                                $grey = true;
                                                            }
                                                            // else
                                                        } else {
                                                            if ($directionsName[$hh] == "South") {
                                                                if ($_SESSION["ypos"] < 20) {
                                                                    $grey = false;
                                                                } else {
                                                                    $grey = true;
                                                                }
                                                                // else
                                                            } else {
                                                                if ($directionsName[$hh] == "Southeast") {
                                                                    if ($_SESSION["xpos"] < 20 && $_SESSION["ypos"] < 20) {
                                                                        $grey = false;
                                                                    } else {
                                                                        $grey = true;
                                                                    }
                                                                    // else
                                                                } else {
                                                                    $grey = true;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                // else
                            } else {
                                $grey = true;
                            }
                            // else
                            if ($hh == 0) {
                                echo "                      <div class=\"row\">\n";
                            } else {
                                if ($hh == 3 || $hh == 6) {
                                    echo "                      </div>\n                      <div class=\"row\">\n";
                                }
                            }
                            // else if
                            if ($grey === true) {
                                echo "                      <div class=\"col-xs-3\">\n";
                                echo "                        <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                                echo "                          <button disabled value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_greyed.png\" alt=\"\" /></button>\n";
                                echo "                        </form>\n";
                                echo "                      </div>\n";
                            } else {
                                echo "                      <div class=\"col-xs-3\">\n";
                                echo "                        <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                                echo "                          <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                                echo "                          <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                                echo "                          <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                                echo "                          <input type=\"hidden\" name=\"actionid\" value=\"" . $unitInfo["id"] . "\" />\n";
                                echo "                          <input type=\"hidden\" name=\"action\" value=\"unit-unload\" />\n";
                                echo "                          <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
                                echo "                          <input type=\"hidden\" name=\"newcontinent\" value=\"" . $newcontinent . "\" />\n";
                                echo "                          <input type=\"hidden\" name=\"newxpos\" value=\"" . $newxpos . "\" />\n";
                                echo "                          <input type=\"hidden\" name=\"newypos\" value=\"" . $newypos . "\" />\n";
                                echo "                          <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Unload unit.\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_unload_" . strtolower($directionsName[$hh]) . ".png\" alt=\"" . $directionsName[$hh] . " Unload\" /></button>\n";
                                echo "                        </form>\n";
                                echo "                      </div>\n";
                            }
                            // else
                            if ($hh == 8) {
                                echo "                      </div>\n";
                            }
                            // if
                        }
                        // for
                    } else {
                        echo "                        Unit can move no further this turn.\n";
                        echo "                      </div>\n";
                    }
                    // else
                }
                // if
                echo "                    </li>\n";
            }
            // if
        }
        // if
        // transport/move
        if ($currentPlayer === true) {
            echo "                    <li class=\"list-group-item\">\n";
            echo "                      <div class=\"row\">\n";
            echo "                        Move\n                        <br />\n                        <br />\n";
            echo "                      </div>\n";
            if ($unitInfo["used"] < $unitTypeInfo["movement"]) {
                // land units
                if ($unitTypeInfo["water"] == 0) {
                    for ($hh = 0; $hh < count($directionsX); $hh++) {
                        $newcontinent = $_SESSION["continent_id"];
                        $newxpos = $_SESSION["xpos"] + $directionsX[$hh];
                        $newypos = $_SESSION["ypos"] + $directionsY[$hh];
                        $tileInfoQ = getTileInfo($getPage_connection2, $newcontinent, $newxpos, $newypos);
                        $grey = false;
                        $load = false;
                        $transport = false;
                        $verb = "move";
                        if ($tileInfoQ["terrain"] == 2) {
                            $load = true;
                        } else {
                            $load = false;
                        }
                        // else
                        if ($load === true) {
                            $transport = false;
                            $unitInfoTemp1 = getUnitInfo($getPage_connection2, $newcontinent, $newxpos, $newypos);
                            if ($unitInfoTemp1["id"] >= 1) {
                                if ($unitInfoTemp1["type"] == 10 && $unitInfoTemp1["owner"] == $_SESSION["nation_id"]) {
                                    if ($unitInfoTemp1["transport"] >= 1) {
                                        $transportInfoTemp1 = getTransportInfo($getPage_connection2, $unitInfoTemp1["transport"]);
                                        if ($transportInfoTemp1["id"] >= 1) {
                                            if (count($transportInfoTemp1["list"]) >= 1 && count($transportInfoTemp1["list"]) < 5) {
                                                $transport = true;
                                            } else {
                                                $transport = false;
                                            }
                                            // else
                                        } else {
                                            $transport = false;
                                        }
                                        // else
                                    } else {
                                        $transport = false;
                                    }
                                    // else
                                } else {
                                    $transport = false;
                                }
                                // else
                            } else {
                                $transport = false;
                            }
                            // else
                            if ($transport === true) {
                                if ($directionsName[$hh] == "Northwest") {
                                    if ($_SESSION["xpos"] > 1 && $_SESSION["ypos"] > 1) {
                                        $grey = false;
                                        $verb = "transport";
                                    } else {
                                        $grey = true;
                                    }
                                    // else
                                } else {
                                    if ($directionsName[$hh] == "North") {
                                        if ($_SESSION["ypos"] > 1) {
                                            $grey = false;
                                            $verb = "transport";
                                        } else {
                                            $grey = true;
                                        }
                                        // else
                                    } else {
                                        if ($directionsName[$hh] == "Northeast") {
                                            if ($_SESSION["xpos"] < 20 && $_SESSION["ypos"] > 1) {
                                                $grey = false;
                                                $verb = "transport";
                                            } else {
                                                $grey = true;
                                            }
                                            // else
                                        } else {
                                            if ($directionsName[$hh] == "West") {
                                                if ($_SESSION["xpos"] > 1) {
                                                    $grey = false;
                                                    $verb = "transport";
                                                } else {
                                                    $grey = true;
                                                }
                                                // else
                                            } else {
                                                if ($directionsName[$hh] == "Hold") {
                                                    $grey = true;
                                                } else {
                                                    if ($directionsName[$hh] == "East") {
                                                        if ($_SESSION["xpos"] < 20) {
                                                            $grey = false;
                                                            $verb = "transport";
                                                        } else {
                                                            $grey = true;
                                                        }
                                                        // else
                                                    } else {
                                                        if ($directionsName[$hh] == "Southwest") {
                                                            if ($_SESSION["xpos"] > 1 && $_SESSION["ypos"] < 20) {
                                                                $grey = false;
                                                                $verb = "transport";
                                                            } else {
                                                                $grey = true;
                                                            }
                                                            // else
                                                        } else {
                                                            if ($directionsName[$hh] == "South") {
                                                                if ($_SESSION["ypos"] < 20) {
                                                                    $grey = false;
                                                                    $verb = "transport";
                                                                } else {
                                                                    $grey = true;
                                                                }
                                                                // else
                                                            } else {
                                                                if ($directionsName[$hh] == "Southeast") {
                                                                    if ($_SESSION["xpos"] < 20 && $_SESSION["ypos"] < 20) {
                                                                        $grey = false;
                                                                        $verb = "transport";
                                                                    } else {
                                                                        $grey = true;
                                                                    }
                                                                    // else
                                                                } else {
                                                                    $grey = true;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                // else
                            } else {
                                $grey = true;
                            }
                            // else
                        } else {
                            if ($directionsName[$hh] == "Northwest") {
                                if ($_SESSION["xpos"] > 1 && $_SESSION["ypos"] > 1) {
                                    $grey = false;
                                } else {
                                    $grey = true;
                                }
                                // else
                            } else {
                                if ($directionsName[$hh] == "North") {
                                    if ($_SESSION["ypos"] > 1) {
                                        $grey = false;
                                    } else {
                                        $grey = true;
                                    }
                                    // else
                                } else {
                                    if ($directionsName[$hh] == "Northeast") {
                                        if ($_SESSION["xpos"] < 20 && $_SESSION["ypos"] > 1) {
                                            $grey = false;
                                        } else {
                                            $grey = true;
                                        }
                                        // else
                                    } else {
                                        if ($directionsName[$hh] == "West") {
                                            if ($_SESSION["xpos"] > 1) {
                                                $grey = false;
                                            } else {
                                                $grey = true;
                                            }
                                            // else
                                        } else {
                                            if ($directionsName[$hh] == "Hold") {
                                                $grey = true;
                                            } else {
                                                if ($directionsName[$hh] == "East") {
                                                    if ($_SESSION["xpos"] < 20) {
                                                        $grey = false;
                                                    } else {
                                                        $grey = true;
                                                    }
                                                    // else
                                                } else {
                                                    if ($directionsName[$hh] == "Southwest") {
                                                        if ($_SESSION["xpos"] > 1 && $_SESSION["ypos"] < 20) {
                                                            $grey = false;
                                                        } else {
                                                            $grey = true;
                                                        }
                                                        // else
                                                    } else {
                                                        if ($directionsName[$hh] == "South") {
                                                            if ($_SESSION["ypos"] < 20) {
                                                                $grey = false;
                                                            } else {
                                                                $grey = true;
                                                            }
                                                            // else
                                                        } else {
                                                            if ($directionsName[$hh] == "Southeast") {
                                                                if ($_SESSION["xpos"] < 20 && $_SESSION["ypos"] < 20) {
                                                                    $grey = false;
                                                                } else {
                                                                    $grey = true;
                                                                }
                                                                // else
                                                            } else {
                                                                $grey = true;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            // else
                        }
                        // else
                        if ($hh == 0) {
                            echo "                      <div class=\"row\">\n";
                        } else {
                            if ($hh == 3 || $hh == 6) {
                                echo "                      </div>\n                      <div class=\"row\">\n";
                            }
                        }
                        // else if
                        if ($grey === true) {
                            echo "                      <div class=\"col-xs-3\">\n";
                            echo "                        <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                            echo "                          <button disabled value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_greyed.png\" alt=\"\" /></button>\n";
                            echo "                        </form>\n";
                            echo "                      </div>\n\n";
                        } else {
                            echo "                      <div class=\"col-xs-3\">\n";
                            echo "                        <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                            echo "                          <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"actionid\" value=\"" . $unitInfo["id"] . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"action\" value=\"unit-" . $verb . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
                            echo "                          <input type=\"hidden\" name=\"newcontinent\" value=\"" . $newcontinent . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"newxpos\" value=\"" . $newxpos . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"newypos\" value=\"" . $newypos . "\" />\n";
                            if ($verb == "transport") {
                                echo "                          <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Transport " . $directionsName[$hh] . ".\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_unload_" . strtolower($directionsName[$hh]) . ".png\" alt=\"" . $directionsName[$hh] . " Transport\" /></button>\n";
                            } else {
                                echo "                          <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Move " . $directionsName[$hh] . ".\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_" . strtolower($directionsName[$hh]) . ".png\" alt=\"" . $directionsName[$hh] . " Move\" /></button>\n";
                            }
                            // else
                            echo "                        </form>\n";
                            echo "                      </div>\n";
                        }
                        // else
                        if ($hh == 8) {
                            echo "                      </div>\n\n";
                        }
                        // if
                    }
                    // for
                    // water units
                } else {
                    for ($hh = 0; $hh < count($directionsX); $hh++) {
                        $newcontinent = $_SESSION["continent_id"];
                        $newxpos = $_SESSION["xpos"] + $directionsX[$hh];
                        $newypos = $_SESSION["ypos"] + $directionsY[$hh];
                        $tileInfoQ = getTileInfo($getPage_connection2, $newcontinent, $newxpos, $newypos);
                        $grey = false;
                        $isWater = false;
                        $coastBool = isItCoast($getPage_connection2, $tileInfoQ);
                        if ($coastBool === true) {
                            $coastCheck = true;
                        } else {
                            $coastCheck = false;
                        }
                        // else
                        if ($tileInfoQ["terrain"] == 2) {
                            $isWater = true;
                        } else {
                            $isWater = false;
                        }
                        // else
                        if ($isWater === true || $coastCheck === true) {
                            if ($directionsName[$hh] == "Northwest") {
                                if ($_SESSION["xpos"] > 1 && $_SESSION["ypos"] > 1) {
                                    $grey = false;
                                } else {
                                    if ($_SESSION["continent_id"] >= 2) {
                                        $newcontinent = $_SESSION["continent_id"] - 1;
                                    } else {
                                        $newcontinent = $_SESSION["continent_id"];
                                    }
                                    // else
                                    $grey = false;
                                }
                                // else
                            } else {
                                if ($directionsName[$hh] == "North") {
                                    if ($_SESSION["ypos"] > 1) {
                                        $grey = false;
                                    } else {
                                        if ($_SESSION["continent_id"] >= 2) {
                                            $newcontinent = $_SESSION["continent_id"] - 1;
                                        } else {
                                            $newcontinent = $_SESSION["continent_id"];
                                        }
                                        // else
                                        $grey = false;
                                    }
                                    // else
                                } else {
                                    if ($directionsName[$hh] == "Northeast") {
                                        if ($_SESSION["xpos"] < 20 && $_SESSION["ypos"] > 1) {
                                            $grey = false;
                                        } else {
                                            $nextContinent = getContinentInfo($getPage_connection2, $_SESSION["continent_id"] + 1);
                                            if ($nextContinent["id"] >= 1) {
                                                $newcontinent = $_SESSION["continent_id"] + 1;
                                            } else {
                                                $newcontinent = $_SESSION["continent_id"];
                                            }
                                            // else
                                            $grey = false;
                                        }
                                        // else
                                    } else {
                                        if ($directionsName[$hh] == "West") {
                                            if ($_SESSION["xpos"] > 1) {
                                                $grey = false;
                                            } else {
                                                if ($_SESSION["continent_id"] >= 2) {
                                                    $newcontinent = $_SESSION["continent_id"] - 1;
                                                } else {
                                                    $newcontinent = $_SESSION["continent_id"];
                                                }
                                                // else
                                                $grey = false;
                                            }
                                            // else
                                        } else {
                                            if ($directionsName[$hh] == "Hold") {
                                                $grey = true;
                                            } else {
                                                if ($directionsName[$hh] == "East") {
                                                    if ($_SESSION["xpos"] > 20) {
                                                        $grey = false;
                                                    } else {
                                                        $nextContinent = getContinentInfo($getPage_connection2, $_SESSION["continent_id"] + 1);
                                                        if ($nextContinent["id"] >= 1) {
                                                            $newcontinent = $_SESSION["continent_id"] + 1;
                                                        } else {
                                                            $newcontinent = $_SESSION["continent_id"];
                                                        }
                                                        // else
                                                        $grey = false;
                                                    }
                                                    // else
                                                } else {
                                                    if ($directionsName[$hh] == "Southwest") {
                                                        if ($_SESSION["xpos"] > 1 && $_SESSION["ypos"] < 20) {
                                                            $grey = false;
                                                        } else {
                                                            if ($_SESSION["continent_id"] >= 2) {
                                                                $newcontinent = $_SESSION["continent_id"] - 1;
                                                            } else {
                                                                $newcontinent = $_SESSION["continent_id"];
                                                            }
                                                            // else
                                                            $grey = false;
                                                        }
                                                        // else
                                                    } else {
                                                        if ($directionsName[$hh] == "South") {
                                                            if ($_SESSION["xpos"] > 20) {
                                                                $grey = false;
                                                            } else {
                                                                $nextContinent = getContinentInfo($getPage_connection2, $_SESSION["continent_id"] + 1);
                                                                if ($nextContinent["id"] >= 1) {
                                                                    $newcontinent = $_SESSION["continent_id"] + 1;
                                                                } else {
                                                                    $newcontinent = $_SESSION["continent_id"];
                                                                }
                                                                // else
                                                                $grey = false;
                                                            }
                                                            // else
                                                        } else {
                                                            if ($directionsName[$hh] == "Southeast") {
                                                                if ($_SESSION["xpos"] > 20 && $_SESSION["ypos"] < 20) {
                                                                    $grey = false;
                                                                } else {
                                                                    $nextContinent = getContinentInfo($getPage_connection2, $_SESSION["continent_id"] + 1);
                                                                    if ($nextContinent["id"] >= 1) {
                                                                        $newcontinent = $_SESSION["continent_id"] + 1;
                                                                    } else {
                                                                        $newcontinent = $_SESSION["continent_id"];
                                                                    }
                                                                    // else
                                                                    $grey = false;
                                                                }
                                                                // else
                                                            } else {
                                                                $grey = true;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            // else
                        } else {
                            $grey = true;
                        }
                        // else
                        if ($hh == 0) {
                            echo "                      <div class=\"row\">\n";
                        } else {
                            if ($hh == 3 || $hh == 6) {
                                echo "                    </div>\n                    <div class=\"row\">\n";
                            }
                        }
                        // else if
                        if ($grey === true) {
                            echo "                      <div class=\"col-xs-3\">\n";
                            echo "                        <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                            echo "                          <button disabled value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_greyed.png\" alt=\"\" /></button>\n";
                            echo "                        </form>\n";
                            echo "                      </div>\n\n";
                        } else {
                            echo "                      <div class=\"col-xs-3\">\n";
                            echo "                        <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                            echo "                          <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"actionid\" value=\"" . $unitInfo["id"] . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"action\" value=\"unit-move\" />\n";
                            echo "                          <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
                            echo "                          <input type=\"hidden\" name=\"newcontinent\" value=\"" . $newcontinent . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"newxpos\" value=\"" . $newxpos . "\" />\n";
                            echo "                          <input type=\"hidden\" name=\"newypos\" value=\"" . $newypos . "\" />\n";
                            echo "                          <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Move " . $directionsName[$hh] . ".\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_" . strtolower($directionsName[$hh]) . ".png\" alt=\"" . $directionsName[$hh] . " Move\" /></button>\n";
                            echo "                        </form>\n";
                            echo "                      </div>\n\n";
                        }
                        // else
                        if ($hh == 8) {
                            echo "                      </div>\n\n";
                        }
                        // if
                    }
                    // for
                }
                // else
            } else {
                echo "                      Unit can move no further this turn.\n";
            }
            // else
            echo "                    </li>\n";
            echo "                  </ul>\n";
        }
        // if
    }
    // if
    echo "                </div>\n";
    echo "              </div>\n";
    echo "            </div><!-- /.col-sm-4 -->\n\n";
    // Improve Module
    echo "            <div class=\"col-sm-4  info_panels\">\n";
    echo "              <div class=\"panel panel-success\">\n";
    echo "                <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Add and modify your improvements on the present tile.\" class=\"panel-heading\">\n";
    echo "                  <h3 class=\"panel-title\">Improve        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseImprove\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "                </div>\n";
    echo "                <div id=\"collapseImprove\" class=\"panel-body standard-text collapse in\">\n";
    for ($q = 0; $q < count($_SESSION["tileInfo"]["improvements"]); $q++) {
        $improvementInfo = getImprovementInfo($getPage_connection2, $_SESSION["tileInfo"]["improvements"][$q]);
        if ($improvementInfo["id"] >= 1) {
            echo "                  <ul class=\"list-group\">\n";
            $improvementTypeInfo = getImprovementTypeInfo($getPage_connection2, $improvementInfo["type"]);
            $currentPlayer = false;
            echo "                    <li class=\"list-group-item\">\n";
            echo "                      " . $improvementInfo["name"] . "\n";
            echo "                      <br />\n";
            echo "                      " . $improvementTypeInfo["name"] . "\n";
            echo "                      <br />\n";
            echo "                      Level " . $improvementInfo["level"] . "\n";
            echo "                      <br />\n";
            if ($improvementInfo["usingResources"][0] > 0) {
                echo "                        Using Resources: ";
                for ($u = 0; $u < count($improvementInfo["usingResources"]); $u++) {
                    if ($improvementInfo["usingResources"][$u] > 0) {
                        if ($u > 0) {
                            echo ", ";
                        }
                        // if
                        $resourceInfoQ = getResourceInfo($getPage_connection2, $improvementInfo["usingResources"][$u]);
                        $resourceTypeInfoQ = getResourceTypeInfo($getPage_connection2, $resourceInfoQ["type"]);
                        echo $resourceTypeInfoQ["name"];
                    }
                    // if
                }
                // for
            }
            // if
            echo "\n                      <br />\n";
            echo "                      Owned by ";
            for ($z = 0; $z < count($improvementInfo["owners"]); $z++) {
                $nationInfoY = getNationInfo($getPage_connection2, $improvementInfo["owners"][$z]);
                if ($z >= 1) {
                    echo ", <a href=\"index.php?page=info&amp;section=nations&amp;info_id=" . $nationInfoY["id"] . "\">" . $nationInfoY["name"] . "</a>";
                } else {
                    echo "<a href=\"index.php?page=info&amp;section=nations&amp;info_id=" . $nationInfoY["id"] . "\">" . $nationInfoY["name"] . "</a>";
                }
                // else
                if ($improvementInfo["owners"][$z] == $_SESSION["nation_id"]) {
                    $currentPlayer = true;
                }
                // if
            }
            // for
            echo "\n                      </li>\n";
            if ($currentPlayer === true) {
                echo "                    <li class=\"list-group-item\">\n";
                echo "                      <div class=\"row\">\n";
                echo "                        Modify/Abilities\n                        <br />\n                        <br />\n";
                echo "                      </div>\n";
                echo "                      <div class=\"row\">\n";
                if ($improvementInfo["level"] < 20) {
                    echo "                        <div class=\"col-xs-3\">\n";
                    echo "                          <form action=\"index.php?page=map&amp;overlay=terrain\" method=\"post\">\n";
                    echo "                            <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                    echo "                            <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                    echo "                            <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                    echo "                            <input type=\"hidden\" name=\"actionid\" value=\"" . $improvementInfo["id"] . "\" />\n";
                    echo "                            <input type=\"hidden\" name=\"action\" value=\"improvement-upgrade\" />\n";
                    echo "                            <input type=\"hidden\" name=\"overlay\" value=\"control\" />\n";
                    echo "                            <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Upgrade improvement.  &nbsp; Cost: " . $improvementTypeInfo["baseCost"] * ($improvementInfo["level"] + 1) . "\"\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_upgrade.png\" alt=\"Upgrade\" /></button>\n";
                    echo "                          </form>\n";
                    echo "                        </div>\n";
                }
                // if
                echo "                        <div class=\"col-xs-3\">\n";
                echo "                          <form action=\"index.php?page=map&amp;overlay=terrain\" method=\"post\">\n";
                echo "                            <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                echo "                            <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                echo "                            <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                echo "                            <input type=\"hidden\" name=\"actionid\" value=\"" . $improvementInfo["id"] . "\" />\n";
                echo "                            <input type=\"hidden\" name=\"action\" value=\"improvement-remove\" />\n";
                echo "                            <input type=\"hidden\" name=\"overlay\" value=\"control\" />\n";
                echo "                            <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Remove improvement.\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_remove.png\" alt=\"Remove\" /></button>\n";
                echo "                          </form>\n";
                echo "                        </div>\n";
                echo "                        <div class=\"col-xs-3\">\n\n";
                echo "                          <span data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Rename improvement.\">\n";
                $rand_modal = mt_rand(1, 100);
                echo "                          <button type=\"button\" data-toggle=\"modal\" data-target=\"#renameImprovementModal" . $rand_modal . "\" class=\"btn btn-primary btn-sm\"><img src=\"images/buttons/btn_rename.png\" alt=\"Rename\" /></button>\n\n";
                echo "                          <!-- Modal -->\n";
                echo "                          <div id=\"renameImprovementModal" . $rand_modal . "\" class=\"modal fade\" role=\"dialog\">\n";
                echo "                            <div class=\"modal-dialog\">\n";
                echo "                              <!-- Modal content-->\n";
                echo "                              <div class=\"modal-content\">\n";
                echo "                                <div class=\"modal-header\">\n";
                echo "                                  <button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>\n";
                echo "                                  <h4 class=\"modal-title\">Rename Improvement</h4>\n";
                echo "                                </div>\n";
                echo "                                <div class=\"modal-body\">\n";
                echo "                                  <form action=\"index.php?page=map&amp;overlay=control\" method=\"post\">\n";
                echo "                            \t      <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                echo "                                    <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                echo "                                    <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                echo "                                    <input type=\"hidden\" name=\"actionid\" value=\"" . $improvementInfo["id"] . "\" />\n";
                echo "                                    <input type=\"hidden\" name=\"action\" value=\"improvement-rename\" />\n";
                echo "                                    <input type=\"hidden\" name=\"overlay\" value=\"control\" />\n";
                echo "                                    <div class=\"form-group form-group-sm\">\n";
                echo "                                      <input data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Your improvement's new name.\" name=\"rename\" type=\"text\" class=\"form-control\" id=\"rename_improvement\" placeholder=\"Moscow\" />\n";
                echo "                                    </div>\n";
                echo "                                    <div class=\"form-group form-group-sm\">\n";
                echo "                                      <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Rename improvement.\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-md\">Rename</button>\n";
                echo "                                    </div>\n";
                echo "                                  </form>\n";
                echo "                                </div>\n";
                echo "                                <div class=\"modal-footer\">\n";
                echo "                                  <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n";
                echo "                                </div>\n";
                echo "                              </div>\n";
                echo "                            </div>\n";
                echo "                          </div>\n\n";
                echo "                          </span>\n";
                echo "                        </div>\n";
                echo "                      </div>\n";
                echo "                    </li>\n";
                // if it is a depot, allow construction of military units
                if ($improvementInfo["type"] == 5) {
                    echo "                    <li class=\"list-group-item\">\n";
                    echo "                      <div class=\"row\">\n";
                    echo "                        Train\n                        <br />\n                        <br />\n";
                    echo "                      </div>\n";
                    $nationInfoZ = getNationInfo($getPage_connection2, $_SESSION["nation_id"]);
                    $wrapCounter = 0;
                    if ($stmt = $getPage_connection2->prepare("SELECT id FROM units ORDER BY id ASC")) {
                        $stmt->execute();
                        $stmt->store_result();
                        $stmt->bind_result($r_result);
                        while ($stmt->fetch()) {
                            $next_unitTypes = $r_result;
                            $unitTypeInfo = getUnitTypeInfo($getPage_connection2, $next_unitTypes);
                            if ($unitTypeInfo["water"] == 1) {
                                $coastBool = isItCoast($getPage_connection2, $_SESSION["tileInfo"]);
                                if ($coastBool === true) {
                                    $coastCheck = true;
                                } else {
                                    $coastCheck = false;
                                }
                                // else
                            } else {
                                $coastCheck = true;
                            }
                            // else
                            if ($coastCheck === true) {
                                if ($unitTypeInfo["baseCost"] <= $nationInfoZ["money"]) {
                                    $notEnough = false;
                                    for ($zz = 0; $zz < count($unitTypeInfo["goodsRequired"]); $zz++) {
                                        if ($unitTypeInfo["goodsRequired"][$zz] > $nationInfoZ["goods"][$zz]) {
                                            $notEnough = true;
                                            break;
                                        }
                                        // if
                                    }
                                    // for
                                    if ($notEnough === false) {
                                        $wrapCounter++;
                                        if ($wrapCounter == 1) {
                                            echo "                      <div class=\"row\">\n";
                                        }
                                        // if
                                        echo "                        <div class=\"col-xs-3\">\n";
                                        echo "                          <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                                        echo "                            <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                                        echo "                            <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                                        echo "                            <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                                        echo "                            <input type=\"hidden\" name=\"actionid\" value=\"" . $unitTypeInfo["id"] . "\" />\n";
                                        echo "                            <input type=\"hidden\" name=\"action\" value=\"unit-build\" />\n";
                                        echo "                            <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
                                        echo "                            <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Train " . $unitTypeInfo["name"] . ".  &nbsp; Cost: " . round($unitTypeInfo["baseCost"], 2, PHP_ROUND_HALF_UP) . "\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"" . $unitTypeInfo["image"] . "\" alt=\"Train " . $unitTypeInfo["name"] . "\" /></button>\n";
                                        echo "                          </form>\n";
                                        echo "                        </div>\n";
                                        if ($wrapCounter == 3) {
                                            $wrapCounter = 0;
                                            echo "                      </div>\n";
                                        }
                                        // if
                                    }
                                    // if
                                }
                                // if
                            }
                            // if
                            if ($next_unitTypes < 1 && $wrapCounter != 0) {
                                echo "                    </div>\n";
                            }
                            // if
                        }
                        // while
                        $stmt->close();
                    } else {
                    }
                    // else
                    echo "                    </li>\n";
                }
                // if
            }
            // if
            echo "                  </ul>\n";
        }
        // if
    }
    // for
    $currentPlayer = false;
    if ($_SESSION["tileInfo"]["owner"] == $_SESSION["nation_id"]) {
        $currentPlayer = true;
    }
    // if
    if ($currentPlayer === true) {
        echo "                  <ul class=\"list-group\">\n";
        echo "                    <li class=\"list-group-item\">\n";
        echo "                      Build\n                      <br />\n                      <br />\n";
        $availableResources = array(0 => 0);
        $counter = 1;
        // loop tile's resources
        for ($q = 0; $q < count($_SESSION["tileInfo"]["resources"]); $q++) {
            $resourceIsUsed = false;
            $resourceInfo = getResourceInfo($getPage_connection2, $_SESSION["tileInfo"]["resources"][$q]);
            // only proceed if capacity exists above 0
            if ($resourceInfo["capacity"] >= 1) {
                $resourceTypeInfo = getResourceTypeInfo($getPage_connection2, $resourceInfo["type"]);
                // loop tile's improvements
                for ($a = 0; $a < count($_SESSION["tileInfo"]["improvements"]); $a++) {
                    $improvementInfo = getImprovementInfo($getPage_connection2, $_SESSION["tileInfo"]["improvements"][$a]);
                    // if tile improvement is currently using resource, check
                    for ($d = 0; $d < count($improvementInfo["usingResources"]); $d++) {
                        if ($improvementInfo["usingResources"][$d] == $resourceInfo["id"]) {
                            $resourceIsUsed = true;
                            break;
                        } else {
                            $resourceIsUsed = false;
                        }
                        // else
                    }
                    // for
                    if ($resourceIsUsed === true) {
                        break;
                    }
                    // if
                }
                // for
            } else {
                $resourceIsUsed = true;
            }
            // else
            // set available resources not used and with capacity left
            if ($resourceIsUsed === false) {
                $availableResources[$counter] = $resourceInfo;
                $counter++;
            }
            // if
        }
        // for
        // loop improvement types
        $wrapCounter = 0;
        if ($stmt = $getPage_connection2->prepare("SELECT id FROM improvements ORDER BY id ASC")) {
            $stmt->execute();
            $stmt->store_result();
            $stmt->bind_result($r_result);
            while ($stmt->fetch()) {
                $next_improvementTypes = $r_result;
                $improvementTypeInfo1 = getImprovementTypeInfo($getPage_connection2, $next_improvementTypes);
                $addToCounter = false;
                $terrainIsValid = false;
                // loop terrain requirements
                for ($b = 0; $b < count($improvementTypeInfo1["terrainTypeRequired"]); $b++) {
                    // if tile terrain type is valid, check
                    if ($improvementTypeInfo1["terrainTypeRequired"][$b] == $_SESSION["tileInfo"]["terrain"]) {
                        $terrainIsValid = true;
                        break;
                    } else {
                        $terrainIsValid = false;
                    }
                    // else
                }
                // for
                // if terrain is valid, check for resource requirements
                if ($terrainIsValid === true) {
                    // if no requirements just post it, otherwise proceed to loop
                    if ($improvementTypeInfo1["resourcesRequired"][0] == 0) {
                        if (count($_SESSION["tileInfo"]["improvements"]) < 5) {
                            // capital: only 1 can be built, check for home continent, if one is set then capital exists
                            if ($improvementTypeInfo1["id"] == 1) {
                                $nationInfoC = getNationInfo($getPage_connection2, $_SESSION["nation_id"]);
                                if ($nationInfoC["home"] == 0) {
                                    $wrapCounter++;
                                    if ($wrapCounter == 1) {
                                        echo "                      <div class=\"row\">\n";
                                    }
                                    // if
                                    echo "                        <div class=\"col-xs-3\">\n";
                                    echo "                          <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                                    echo "                            <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                                    echo "                            <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                                    echo "                            <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                                    echo "                            <input type=\"hidden\" name=\"actionid\" value=\"" . $next_improvementTypes . "\" />\n";
                                    echo "                            <input type=\"hidden\" name=\"action\" value=\"improvement-build\" />\n";
                                    echo "                            <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
                                    echo "                            <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Build " . $improvementTypeInfo1["name"] . ".  &nbsp; Cost: " . round($improvementTypeInfo1["baseCost"], 2, PHP_ROUND_HALF_UP) . "\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"" . $improvementTypeInfo1["image"] . "\" alt=\"Build " . $improvementTypeInfo1["name"] . "\" /></button>\n";
                                    echo "                          </form>\n";
                                    echo "                        </div>\n";
                                    if ($wrapCounter == 3) {
                                        $wrapCounter = 0;
                                        echo "                      </div>\n";
                                    }
                                    // if
                                }
                                // if
                            } else {
                                $wrapCounter++;
                                if ($wrapCounter == 1) {
                                    echo "                      <div class=\"row\">\n";
                                }
                                // if
                                echo "                        <div class=\"col-xs-3\">\n";
                                echo "                          <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                                echo "                            <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                                echo "                            <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                                echo "                            <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                                echo "                            <input type=\"hidden\" name=\"actionid\" value=\"" . $next_improvementTypes . "\" />\n";
                                echo "                            <input type=\"hidden\" name=\"action\" value=\"improvement-build\" />\n";
                                echo "                            <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
                                echo "                            <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Build " . $improvementTypeInfo1["name"] . ".  &nbsp; Cost: " . round($improvementTypeInfo1["baseCost"], 2, PHP_ROUND_HALF_UP) . "\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"" . $improvementTypeInfo1["image"] . "\" alt=\"Build " . $improvementTypeInfo1["name"] . "\" /></button>\n";
                                echo "                          </form>\n";
                                echo "                        </div>\n";
                                if ($wrapCounter == 3) {
                                    $wrapCounter = 0;
                                    echo "                      </div>\n";
                                }
                                // if
                            }
                            // else
                        }
                        // if
                    } else {
                        $checkResource = array(0 => false);
                        // loop resource requirements
                        for ($t = 0; $t < count($improvementTypeInfo1["resourcesRequired"]); $t++) {
                            // loop available resources
                            for ($z = 0; $z < count($availableResources); $z++) {
                                // if tile terrain type is valid, check
                                if ($improvementTypeInfo1["resourcesRequired"][$t] == $availableResources[$z]["type"]) {
                                    $checkResource[$t] = true;
                                    break;
                                } else {
                                }
                                // else
                            }
                            // for
                        }
                        // for
                        $illegal = false;
                        for ($a = 0; $a < count($improvementTypeInfo1["resourcesRequired"]); $a++) {
                            if (isset($checkResource[$a])) {
                                if ($checkResource[$a] === false) {
                                    $illegal = true;
                                    break;
                                }
                                // if
                            } else {
                                $illegal = true;
                                break;
                            }
                            // else
                        }
                        // for
                        if ($illegal === false) {
                            if (count($_SESSION["tileInfo"]["improvements"]) < 5) {
                                $wrapCounter++;
                                if ($wrapCounter == 1) {
                                    echo "                      <div class=\"row\">\n";
                                }
                                // if
                                echo "                        <div class=\"col-xs-3\">\n";
                                echo "                          <form action=\"index.php?page=map&amp;overlay=units\" method=\"post\">\n";
                                echo "                            <input type=\"hidden\" name=\"continent\" value=\"" . $_SESSION["continent_id"] . "\" />\n";
                                echo "                            <input type=\"hidden\" name=\"xpos\" value=\"" . $_SESSION["xpos"] . "\" />\n";
                                echo "                            <input type=\"hidden\" name=\"ypos\" value=\"" . $_SESSION["ypos"] . "\" />\n";
                                echo "                            <input type=\"hidden\" name=\"actionid\" value=\"" . $next_improvementTypes . "\" />\n";
                                echo "                            <input type=\"hidden\" name=\"action\" value=\"improvement-build\" />\n";
                                echo "                            <input type=\"hidden\" name=\"overlay\" value=\"units\" />\n";
                                echo "                            <button onclick=\"loadButton(this)\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Build " . $improvementTypeInfo1["name"] . ".  &nbsp; Cost: " . round($improvementTypeInfo1["baseCost"], 2, PHP_ROUND_HALF_UP) . "\" value=\"map\" name=\"page\" type=\"submit\" class=\"btn btn-primary btn-sm\"><img src=\"" . $improvementTypeInfo1["image"] . "\" alt=\"Build " . $improvementTypeInfo1["name"] . "\" /></button>\n";
                                echo "                          </form>\n";
                                echo "                        </div>\n";
                                if ($wrapCounter == 3) {
                                    $wrapCounter = 0;
                                    echo "                      </div>\n";
                                }
                                // if
                            }
                            // if
                        }
                        // if
                    }
                    // else
                }
                // if
                if ($next_improvementTypes < 1 && $wrapCounter != 0) {
                    echo "                      </div>\n";
                }
                // if
            }
            // while
            $stmt->close();
        } else {
        }
        // else
        echo "                    </li>\n";
        echo "                  </ul>\n";
    }
    // if
    echo "                </div>\n";
    echo "              </div>\n";
    echo "            </div><!-- /.col-sm-4 -->\n\n";
    // Info Module
    echo "            <div class=\"col-sm-4 info_panels\">\n";
    echo "              <div class=\"panel panel-info\">\n";
    echo "                <div data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Check out more information about the present tile.\" class=\"panel-heading\">\n";
    echo "                  <h3 class=\"panel-title\">Info        <button type=\"button\" class=\"btn btn-default btn-md collapsed\" data-toggle=\"collapse\" data-target=\"#collapseInfo\"><span class=\"glyphicon glyphicon-plus\"></span>/<span class=\"glyphicon glyphicon-minus\"></span></button></h3>\n";
    echo "                </div>\n";
    echo "                <div id=\"collapseInfo\" class=\"panel-body standard-text collapse in\">\n";
    $nationInfoN = getNationInfo($getPage_connection2, $_SESSION["tileInfo"]["owner"]);
    echo "                  <ul class=\"list-group\">\n";
    echo "                    <li class=\"list-group-item\">\n";
    echo "                      Continent: " . $_SESSION["continent_id"] . "\n";
    echo "                    </li>\n";
    echo "                    <li class=\"list-group-item\">\n";
    echo "                      Position: " . $_SESSION["xpos"] . ", " . $_SESSION["ypos"] . "\n";
    echo "                    </li>\n";
    echo "                    <li class=\"list-group-item\">\n";
    echo "                      Population: " . $_SESSION["tileInfo"]["population"] . "\n";
    echo "                    </li>\n";
    echo "                    <li class=\"list-group-item\">\n";
    echo "                      Improvement Slots: " . (count($_SESSION["tileInfo"]["improvements"]) - 1) . " / 4\n";
    echo "                    </li>\n";
    echo "                    <li class=\"list-group-item\">\n";
    if (isset($nationInfoN["name"])) {
        if (strlen($nationInfoN["name"]) >= 1) {
            echo "                      Owner: <a href=\"index.php?page=info&amp;section=nations&amp;info_id=" . $nationInfoN["id"] . "\">" . $nationInfoN["name"] . "</a>\n";
        } else {
            echo "                      Owner: None\n";
        }
        // else
    } else {
        echo "                      Owner: None\n";
    }
    // else
    echo "                    </li>\n";
    echo "                  </ul>\n";
    echo "                  <ul class=\"list-group\">\n";
    $hasResourceInfo = false;
    for ($q = 0; $q < count($_SESSION["tileInfo"]["resources"]); $q++) {
        $resourceInfo = getResourceInfo($getPage_connection2, $_SESSION["tileInfo"]["resources"][$q]);
        if ($resourceInfo["id"] >= 1) {
            if ($hasResourceInfo === false) {
                echo "                    Resources:\n";
                $hasResourceInfo = true;
            }
            // if
            $resourceTypeInfo = getResourceTypeInfo($getPage_connection2, $resourceInfo["type"]);
            echo "                    <li class=\"list-group-item\">\n";
            echo "                      " . $resourceTypeInfo["name"] . ", Capacity: " . $resourceInfo["capacity"] . "\n";
            echo "                    </li>\n";
        }
        // if
    }
    // for
    echo "                  </ul>\n";
    echo "                  <ul class=\"list-group\">\n";
    $hasClaimInfo = false;
    for ($q = 0; $q < count($_SESSION["tileInfo"]["claims"]); $q++) {
        $claimInfoV = getClaimInfo($getPage_connection2, $_SESSION["tileInfo"]["claims"][$q]);
        if ($claimInfoV["id"] >= 1) {
            if ($hasClaimInfo === false) {
                echo "                    Claims:\n";
                $hasClaimInfo = true;
            }
            // if
            $nationInfoV = getNationInfo($getPage_connection2, $claimInfoV["owner"]);
            echo "                    <li class=\"list-group-item\">\n";
            echo "                      " . $nationInfoV["name"] . " Claim: " . $claimInfoV["strength"] . "\n";
            echo "                    </li>\n";
        }
        // if
    }
    // for
    echo "                  </ul>\n";
    echo "                  <ul class=\"list-group\">\n";
    $hasImprovementInfo = false;
    for ($q = 0; $q < count($_SESSION["tileInfo"]["improvements"]); $q++) {
        $improvementInfoH = getImprovementInfo($getPage_connection2, $_SESSION["tileInfo"]["improvements"][$q]);
        if ($improvementInfoH["id"] >= 1) {
            if ($hasImprovementInfo === false) {
                echo "                    Improvements:\n";
                $hasImprovementInfo = true;
            }
            // if
            $improvementTypeInfoH = getImprovementTypeInfo($getPage_connection2, $improvementInfoH["type"]);
            echo "                    <li class=\"list-group-item\">\n";
            echo "                      " . $improvementTypeInfoH["name"] . ", Level: " . $improvementInfoH["level"] . "\n";
            echo "                    </li>\n";
        }
        // if
    }
    // for
    echo "                  </ul>\n";
    echo "                </div>\n";
    echo "              </div>\n";
    echo "            </div><!-- /.col-sm-4 -->\n";
    echo "          </div>\n";
    echo "        </div>\n";
}