Example #1
0
function include_build2_text()
{
    global $build_cost, $local_goods, $max_build, $building_count, $wood_cost, $building_output, $building_variables, $local_build, $barren, $output_building_percent, $building_percent, $buildings_due, $current, $sub_current1, $sub_current2, $sub_current3, $userid, $local_pop;
    include_once 'inc/functions/build.php';
    mysql_grab($userid, 'local', 'goods', 'build', 'stats', 'pop', 'army', 'user');
    build_cost();
    building_names();
    general_build();
    build_buildings();
    echo '<div class="center">' . "<br /><a href=main.php?cat=game&page=build>Return To Construction</a></div>";
}
Example #2
0
function include_raze_build2_text()
{
    global $local_goods, $local_army, $local_build, $barren, $userid, $local_pop, $collapse, $local_stats, $unit_var, $unit_names, $gold_unit, $army_due, $max_train, $raze, $connection, $build_cost, $local_goods, $max_build, $building_count, $building_output, $building_variables, $local_build, $barren, $output_building_percent, $building_percent, $buildings_due, $current, $sub_current1, $sub_current2, $sub_current3, $userid, $local_pop;
    include_once 'inc/functions/build.php';
    mysql_grab($userid, 'local', 'goods', 'build', 'stats', 'pop', 'army', 'user');
    build_cost();
    building_names();
    general_build();
    echo '<div id="textMedium">' . '<h2>' . "Demolision Report" . '</h2>';
    $yes = 'no';
    for ($i = 1; $i <= $building_count; $i++) {
        $current = $building_variables[$i];
        $collapse[$current] = floor($collapse[$current]);
        if ($collapse[$current] <= 0) {
            $collapse[$current] = 0;
        }
        if ($collapse[$current] >= "1") {
            $yes = "yes";
            if ($collapse[$current] > $local_build[$current]) {
                echo "<p>Wait... You do  not own {$collapse[$current]} acres of {$building_output[$i]}, so how can you demolish them?<br><br>";
                echo "<a href= main.php?cat=game&page=raze_build>Try Again</a></p></div>";
                include_game_down();
                exit;
            }
            echo "<p>{$collapse[$current]} {$building_output[$i]}</p>";
            $new['build'] = $local_build[$current] - $collapse[$current];
            $update['build'] = "UPDATE build SET {$current} ='{$new['build']}' WHERE id= {$userid}";
            $update['build'] = mysql_query($update['build'], $connection);
        }
    }
    if ($yes == "yes") {
        echo "<p>Have been demolished. Such a waste of crowns and logs...</p>";
    }
    if ($yes != "yes") {
        echo "<p>Sorry, what did you order demolished?</p>";
    }
    echo "<p><a href= main.php?cat=game&page=raze_build>Demolish More</a> :: ";
    echo "<a href=main.php?cat=game&page=build>Return To Construction</a></p>";
    echo "</div>";
}
Example #3
0
function include_raze_build_text()
{
    global  $Host, $build_cost, $local_goods, $max_build, $building_count,
            $building_output, $building_variables, $local_build, $barren,
            $output_building_percent, $building_percent, $buildings_due,
            $current, $sub_current1, $sub_current2, $sub_current3, $userid,
            $local_pop;

    include_once('inc/functions/build.php');
    mysql_grab($userid, 'local', 'goods', 'build', 'pop');
    build_cost();
    building_names();
    general_build();

    $advisorLinks =
        '<div class="tableLinkBig">' .
            '<a href="main.php?cat=game&amp;page=advisors&amp;show=build">Tribe Architect</a>' .
            ' :: ' .
            '<a href="main.php?cat=game&amp;page=build">Construction</a>' .
        '</div>';
    echo $advisorLinks;

    ECHO "<form action=\"main.php?cat=game&amp;page=raze_build2\" method=\"post\">";
    ECHO "<table class=\"big\" cellpadding=0 cellspacing=0>";
        ECHO "<tr class=\"header\"><th colspan=\"9\">";
        ECHO "Demolish Buildings";
        ECHO "</th></tr>";

        ECHO "<tr class=\"subheader\">";
            ECHO "<th>Type</th>";
            ECHO "<th class=\"right\">Owned</th>";
            ECHO "<th class=\"right\">Collapse</th>";
            ECHO "<th>&nbsp;</th>";
            ECHO "<th>Type</th>";
            ECHO "<th class=\"right\">Owned</th>";
            ECHO "<th class=\"right\">Collapse</th>";
        ECHO "</tr>";

    for ($i = 1; $i <= $building_count; $i++)
    {
        $current = $building_variables[$i];
        $i2 = $i + 1;
        $current2 = $building_variables[$i2];

        ECHO "<tr class=\"data\">";
            ECHO "<th width=\"20%\">$building_output[$i]</th>";
            ECHO "<td width=\"12%\" class=\"right\">";
            IF ($buildings_due[$building_variables[$i]] > 0) {
                ECHO "<span style=\"font-size: 0.8em;\">(".$buildings_due[$building_variables[$i]].")</span> ";
            }
            ECHO "<b>$local_build[$current]</b></td>";
            ECHO "<td width=\"13%\" class=\"right\"><input size=5 name=\"collapse[$current]\"></td>";
            ECHO "<td>&nbsp;</td>";
            ECHO "<th width=\"20%\">$building_output[$i2]</th>";
            ECHO "<td width=\"12%\" class=\"right\">";
            IF ($buildings_due[$building_variables[$i2]] > 0) {
                ECHO "<span style=\"font-size: 0.8em;\">(".$buildings_due[$building_variables[$i2]].")</span> ";
            }
            ECHO "<b>$local_build[$current2]</b></td>";
            ECHO "<td width=\"13%\" class=\"right\"><input size=5 name=\"collapse[$current2]\"></td>";
        ECHO "</tr>";
        $i = $i +1;
    }
    ECHO "</table>";
    ECHO '<div class="center" style="font-size: 0.8em;">' . "Total <strong>$local_build[land]</strong> acres.</div>";
    ECHO '<div class="center">' . '<input type="submit" value="Demolish Buildings"></div>';

    ECHO "</form>";
}
Example #4
0
function include_build_text()
{
    global  $Host, $build_cost, $local_goods, $max_build,
            $local_build,
            $wood_cost, $output_building_percent, $building_percent,
            $buildings_due, $current, $sub_current1, $sub_current2,
            $sub_current3, $userid, $local_pop;

    $objSrcUser = &$GLOBALS["objSrcUser"];

    include_once('inc/functions/build.php');
//     mysql_grab($userid, 'local', 'goods', 'build', 'pop'); 1 1 down...
    $local_goods = $objSrcUser->get_goods();
    $local_build = $objSrcUser->get_builds();
    $local_pop = $objSrcUser->get_pops();
    build_cost();
    building_names();
    general_build();

    // New object oriented code

    $arrBuildingVariables = getBuildingVariables($objSrcUser->get_stat(RACE));

    $arrBuildVar     = $arrBuildingVariables['variables'];
    $arrBuildOutput  = $arrBuildingVariables['output'];
    $arrBuildTooltip = $arrBuildingVariables['tooltips'];
    $iBuildings      = count($arrBuildVar);
    $iBarren         = $objSrcUser->get_barren();

    //==========================================================================
    // Stop people from avoiding the tribe page so they dont get updated
    //==========================================================================
    include_once('inc/functions/update_ranking.php');
    doUpdateRankings($objSrcUser);

    $arrSrcStats = $objSrcUser->get_stats();
    $arrBuild = $objSrcUser->get_builds();

    echo $topLinks =
        '<div class="center">' .
            '<b>Construction</b> | ' .
            '<a href="main.php?cat=game&amp;page=army">Military Training</a> | ' .
            '<a href="main.php?cat=game&amp;page=explore">Exploration</a>' .
        '</div>';

    $advisorText =
        '<div id="textBig">' .
        '<p>' .
            "<b>Your tribe architect</b> greets you: <br />" .
            "To let your civilization grow and prosper, you must build your land. " .
            "How you build your land is completely up to you, " .
            "but some buildings are necessary for your people to survive." .
        "</p>" .
        "<p>" .
            "It will cost you <b>" . number_format($build_cost) . " crowns</b>" .
            " and <b>" . number_format($wood_cost) . " logs</b> to build on " .
            "<b>1 barren acre</b>." .
        '</p>' .
        '<p align="center">' .
            "You have <b><span class=\"indicator\">$iBarren</span> barren " .
            "acre(s)</b> and you can afford to " .
            "build on <b class=\"indicator\">$max_build</b>" .
            " of them." .
        "</p>" .
        "</div>";
    echo $advisorText;

    $advisorLinks =
        '<br />' .
        '<div class="tableLinkBig">' .
            '<a href="main.php?cat=game&amp;page=advisors&amp;show=build">Tribe Architect</a>' .
            ' :: ' .
            '<a href="main.php?cat=game&amp;page=raze_build">Demolish Buildings</a>' .
        '</div>';
    echo $advisorLinks;

    $buildTable =
        '<form id="center" action="main.php?cat=game&amp;page=build2" method="post" style="margin-top: 0pt;">' .
        '<table class="big" cellpadding="0" cellspacing="0">' .
            '<tr class="header">' .
                '<th colspan="9">' .'Order Construction' . '</th>' .
            '</tr>' .
            '<tr class="subheader">' .
                '<th>' . 'Type' . '</th>' .
                '<th class="right">' . 'Owned' . '</th>' .
                '<th class="right">' . '%' . '</th>' .
                '<th class="right">' . 'Build' . '</th>' .
                '<th class="right">' . '&nbsp;' . '</th>' .
                '<th>' . 'Type' . '</th>' .
                '<th class="right">' . 'Owned' . '</th>' .
                '<th class="right">' . '%' . '</th>' .
                '<th class="right">' . 'Build' . '</th>' .
            '</tr>';

    for ($i = 1; $i <= $iBuildings; $i++)
    {
        $current = $arrBuildVar[$i];
        $i2 = $i + 1;
        $current2 = $arrBuildVar[$i2];

        $buildTable .=
            '<tr class="data">' .
                '<th width="20%"><label for="' . $i . '" title="' . $arrBuildTooltip[$i] . '">' . $arrBuildOutput[$i] . '</label></th>' .
                '<td width="12%">';

        if ($buildings_due[$arrBuildVar[$i]] > 0)
        {
            $buildTable .=
                '<span style="font-size: 0.8em;">(' .
                $buildings_due[$arrBuildVar[$i]] .
                ')</span>';
        }

        $buildTable .=
                ' <strong>' . $local_build[$current] . '</strong></td>' .
                '<td width="7%">' .
                getBuildInPercent($objSrcUser, $local_build[$current], 'yes') .
                "</td>" .
                "<td width=\"7%\"><input id=\"$i\" size=\"3\" maxlength=\"4\" name=\"built[$current]\" /></td>" .
                "<td>&nbsp;</td>" .
                '<th width=\"20%\"><label for="' . $i2 . '" title="' . $arrBuildTooltip[$i2] . '">' . $arrBuildOutput[$i2] . '</label></th>' .
                "<td width=\"12%\" class=\"right\">";

        if ($buildings_due[$arrBuildVar[$i2]] > 0)
        {
            $buildTable .=
                '<span style="font-size: 0.8em;">(' .
                $buildings_due[$arrBuildVar[$i2]] . ")</span>";
        }

        $buildTable .=
                "<strong> $local_build[$current2]</strong>" . "</td>" .
                "<td width=\"7%\" class=\"right\">" .
                getBuildInPercent($objSrcUser, $local_build[$current2], 'yes') .
                "</td>" .
                "<td width=\"7%\" class=\"right\">" .
                "<input id=\"$i2\" size=\"3\" maxlength=\"4\" name=\"built[$current2]\" />" . "</td>" .
            "</tr>";
        $i++;
    }

    $buildTable .=
        "</table>";
    echo $buildTable;

?>
        <span style="font-size: 0.8em;">Total <b><?=$local_build[LAND]; ?></b> acres.</span>
        <br /><br />
        <input type="submit" value="Order Construction" />
    </form>
<?

}