function Show_Overview()
{
    global $db;
    global $game;
    global $SHIP_TORSO, $SHIP_TORSO_DATA, $UNIT_DESCRIPTION, $UNIT_DATA, $UNIT_NAME, $NEXT_TICK, $ACTUAL_TICK;
    global $ship_components;
    if (isset($_GET['delete'])) {
        $_GET['template'] = (int) $_GET['template'];
        $db->query('UPDATE ship_templates SET removed=1 WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $_GET['template'] . '") LIMIT 1');
        redirect('a=ship_template');
    }
    if (isset($_GET['template'])) {
        $_GET['template'] = (int) $_GET['template'];
        $template = $db->queryrow('SELECT * FROM ship_templates WHERE (id="' . $_GET['template'] . '") AND (owner="' . $game->player['user_id'] . '") AND (removed=0) ORDER BY ship_torso ASC, name ASC');
    }
    $templatequery = $db->query('SELECT id,name,ship_torso FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (removed=0) ORDER BY ship_torso ASC, name ASC');
    $number = $db->num_rows();
    $game->out('
<table border=0 cellpadding=2 cellspacing=2 width=600 class="style_outer"><tr><td>
<span class="sub_caption2">' . (isset($template['name']) ? $template['name'] . ':' : constant($game->sprache("TEXT0")) . ':') . '</span><br>');
    $game->out('<table border=0 cellpadding=0 cellspacing=0 width="600" class="style_inner">
<tr><td valign=top width="500">');
    if (isset($template['id'])) {
        $game->out('
<table width="175" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign=top ><u>' . constant($game->sprache("TEXT72")) . '</u><br>
<b>' . $template['name'] . '</b><br><br></td>
</tr>
<tr>
<td valign=top><u>' . constant($game->sprache("TEXT32")) . '</u><br>
' . wordwrap(stripslashes(nl2br($template['description'])), 40, "<br>", 1) . '<br><br></td>
</tr>
<tr>
<td valign=top><u>' . constant($game->sprache("TEXT68")) . '</u><br><img src=' . FIXED_GFX_PATH . 'ship' . $game->player['user_race'] . '_' . $template['ship_torso'] . '.jpg></td>
</tr>
<tr>
<td valign=top><u>' . constant($game->sprache("TEXT26")) . '</u><br>');
        for ($t = 0; $t < 10; $t++) {
            if ($template['component_' . ($t + 1)] >= 0) {
                $game->out('-&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateInfoText($ship_components[$game->player['user_race']][$t][$template['component_' . ($t + 1)]]) . '\', CAPTION, \'' . $ship_components[$game->player['user_race']][$t][$template['component_' . ($t + 1)]]['name'] . '\', WIDTH, 400, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . ($game->planet['catresearch_' . ($t + 1)] <= $template['component_' . ($t + 1)] ? '<b><span style="color: red;">' . $ship_components[$game->player['user_race']][$t][$template['component_' . ($t + 1)]]['name'] . '</span>' : '<b><span style="color: green;">' . $ship_components[$game->player['user_race']][$t][$template['component_' . ($t + 1)]]['name'] . '</span>') . '</b></a><br>');
            } else {
                $game->out(constant($game->sprache("TEXT27")));
            }
        }
        $game->out('<br></td></tr></table></td><td width="50%">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign=top><u>' . constant($game->sprache("TEXT28")) . '</u><br>');
        $game->out('<u>' . constant($game->sprache("TEXT8")) . '</u> <b>' . $template['value_1'] . '</b> x<b>' . $template['rof'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT9")) . '</u> <b>' . $template['value_2'] . '</b> x<b>' . $template['rof2'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT10")) . '</u> <b>' . $template['value_3'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT85")) . '</u> <b>' . ($template['ship_torso'] < 4 ? 'N/A' : $template['max_torp']) . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT11")) . '</u> <b>' . $template['value_4'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT12")) . '</u> <b>' . $template['value_5'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT13")) . '</u> <b>' . $template['value_6'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT14")) . '</u> <b>' . $template['value_7'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT15")) . '</u> <b>' . $template['value_8'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT16")) . '</u> <b>' . $template['value_9'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT17")) . '</u> <b>' . $template['value_10'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT18")) . '</u> <b>' . $template['value_11'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT19")) . '</u> <b>' . $template['value_12'] . '</b><br>');
        $game->out('<u>' . constant($game->sprache("TEXT29")) . '</u> <b>' . $template['value_14'] . '/' . $template['value_13'] . '</b><br>');
        $game->out('<br></td></tr>
<tr>
<td valign=top><u>' . constant($game->sprache("TEXT30")) . '</u><br>
			<img src="' . $game->GFX_PATH . 'menu_metal_small.gif"><b id="price1">' . $template['resource_1'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif"><b id="price2">' . $template['resource_2'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif"><b id="price3">' . $template['resource_3'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_worker_small.gif"><b id="price4">' . $template['resource_4'] . '</b><br>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit5_small.gif"><b id="price10">' . $template['unit_5'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit6_small.gif"><b id="price11">' . $template['unit_6'] . '</b><br><br>
<u>' . constant($game->sprache("TEXT5")) . '</u><br><b id="price5">' . $template['buildtime'] * TICK_DURATION . '</b> ' . constant($game->sprache("TEXT6")) . '<br><br>
<u>' . constant($game->sprache("TEXT31")) . '</u><br>
<img src="' . $game->GFX_PATH . 'menu_unit1_small.gif"><b id="price6">' . $template['min_unit_1'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit2_small.gif"><b id="price7">' . $template['min_unit_2'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit3_small.gif"><b id="price8">' . $template['min_unit_3'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit4_small.gif"><b id="price9">' . $template['min_unit_4'] . '</b><br><br>

<u>' . constant($game->sprache("TEXT59")) . '</u><br>
<img src="' . $game->GFX_PATH . 'menu_unit1_small.gif"><b id="price6a">' . $template['max_unit_1'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit2_small.gif"><b id="price7a">' . $template['max_unit_2'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit3_small.gif"><b id="price8a">' . $template['max_unit_3'] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit4_small.gif"><b id="price9a">' . $template['max_unit_4'] . '</b>

</td>
</tr>
</table>');
    }
    $game->out('</td>


<td width="230" valign="top" align="center">
<span class="sub_caption2">' . constant($game->sprache("TEXT75")) . ' (' . $number . ' ' . ($number > 1 ? constant($game->sprache("TEXT83")) : constant($game->sprache("TEXT43"))) . ')</span>
<form action="' . parse_link('a=ship_template') . '" name="shipselect">
<input type="hidden" name="a" value="ship_template">

<select name="template" size="20" style="width: 200px;" onChange="document.shipselect.submit()">>');
    while (($tmplate = $db->fetchrow($templatequery)) == true) {
        $game->out('<option value="' . $tmplate['id'] . '" ' . ($tmplate['id'] == $_GET['template'] ? 'selected="selected"' : '') . '>' . $tmplate['name'] . ' (' . $SHIP_TORSO[$game->player['user_race']][$tmplate['ship_torso']][29] . ')</option>');
    }
    $game->out('
</select><br><br>

' . (isset($template['name']) ? '<input class="button_nosize" type="submit" name="delete" value="' . constant($game->sprache("TEXT76")) . ' ' . $template['name'] . '" onClick="return confirm(\'' . constant($game->sprache("TEXT77")) . '\')">' : '') . '
</form>
</td>
</tr></table>');
    $game->out('</td></tr><tr><td align="left">' . constant($game->sprache("TEXT78")) . '<br><b><font color=red>' . constant($game->sprache("TEXT79")) . '</font><br><font color=green>' . constant($game->sprache("TEXT80")) . '</font></b></td></tr></table><br><br>');
}
function Show_Main()
{
    global $db;
    global $game;
    global $ship_components;
    global $TECH_DATA, $TECH_DESCRIPTION, $TECH_NAME, $MAX_RESEARCH_LVL, $NEXT_TICK, $ACTUAL_TICK, $BUILDING_NAME;
    $pow_factor = 2;
    // Clickids:
    $game->register_click_id(12);
    $capital = $game->player['user_capital'] == $game->planet['planet_id'] ? 1 : 0;
    if ($game->player['pending_capital_choice']) {
        $capital = 0;
    }
    $schedulerquery = $db->query('SELECT * FROM scheduler_research WHERE planet_id="' . $game->planet['planet_id'] . '"');
    while ($scheduler = $db->fetchrow($schedulerquery)) {
        $game->out('<table border=0 cellpadding=1 cellspacing=1 width=300 class="style_outer"><tr><td>
<table border=0 cellpadding=2 cellspacing=2 width=300 class="style_inner"><tr><td>');
        if ($scheduler['research_id'] < 5) {
            $game->out(constant($game->sprache("TEXT20")) . ' <b>' . $TECH_NAME[$game->player['user_race']][$scheduler['research_id']] . '</b><br>');
            $timer = 'timer3';
        } else {
            $game->out(constant($game->sprache("TEXT20")) . ' <b>' . $ship_components[$game->player['user_race']][$scheduler['research_id'] - 5][$game->planet['catresearch_' . ($scheduler['research_id'] - 4)]]['name'] . '</b><br>');
            $timer = 'timer4';
        }
        $game->out(constant($game->sprache("TEXT21")) . '
<b id="' . $timer . '" title="time1_' . ($NEXT_TICK + TICK_DURATION * 60 * ($scheduler['research_finish'] - $ACTUAL_TICK)) . '_type1_1">&nbsp;</b><br>
<a href="' . parse_link_ex('a=researchlabs&a2=abort_research&id=' . $scheduler['research_id'], LINK_CLICKID) . '"><b>' . constant($game->sprache("TEXT22")) . '</b></a>
</td></tr></table></td></tr></table><br>');
        $game->set_autorefresh($NEXT_TICK + TICK_DURATION * 60 * ($scheduler['research_finish'] - $ACTUAL_TICK));
    }
    $game->out('' . constant($game->sprache("TEXT23")) . ' <b id="timer2" title="time1_' . $NEXT_TICK . '_type1_3">&nbsp;</b> ' . constant($game->sprache("TEXT24")) . '<br><br><br>');
    // Ship components research:
    $game->out('<span class="sub_caption">' . constant($game->sprache("TEXT25")) . ' ' . HelpPopup('research_catresearch') . ' :</span><br><br>');
    $game->out('<table border=0 cellpadding=2 cellspacing=2 width=90% class="style_outer">');
    $game->out('
<tr><td width=100%>
<table border=0 cellpadding=2 cellspacing=2 width=100% class="style_inner">
<tr>
<td width=18%><b>' . constant($game->sprache("TEXT26")) . '</b></td>
<td width=24%><b>' . constant($game->sprache("TEXT27")) . '</b></td>
<td width=30%><b>' . constant($game->sprache("TEXT0")) . '</b></td>
<td width=14%><b>' . constant($game->sprache("TEXT28")) . '</b></td>
<td width=14%>&nbsp;
</td></tr>
');
    // 30/05/12 - AC: Retrieve research times for all the categories at ONE time
    $cat_times = GetCatsResearchTimes();
    foreach ($ship_components[$game->player['user_race']] as $key => $components) {
        //if ($game->planet['catresearch_'.($key+1)]>=$components['num']) continue;
        if ($game->planet['catresearch_' . ($key + 1)] >= $game->planet['building_9'] && $game->planet['building_9'] < 9) {
            $components[$game->planet['catresearch_' . ($key + 1)]]['name'] = constant($game->sprache("TEXT29"));
            $build_text = '<span style="color: red">' . constant($game->sprache("TEXT30")) . '</span>';
        } elseif ($game->planet['resource_1'] >= GetCatResearchPrice($game->planet['catresearch_' . ($key + 1)], 0) && $game->planet['resource_2'] >= GetCatResearchPrice($game->planet['catresearch_' . ($key + 1)], 1) && $game->planet['resource_3'] >= GetCatResearchPrice($game->planet['catresearch_' . ($key + 1)], 2)) {
            $build_text = '<a href="' . parse_link_ex('a=researchlabs&a2=start_catresearch&id=' . $key, LINK_CLICKID) . '"><span style="color: green">' . constant($game->sprache("TEXT30")) . '</span></a>';
        } else {
            $build_text = '<span style="color: red">' . constant($game->sprache("TEXT30")) . '</span>';
        }
        // 03/04/08 - AC: Show "Completed" instead of remove completely the line
        if ($game->planet['catresearch_' . ($key + 1)] >= $components['num']) {
            $build_text = constant($game->sprache("TEXT39"));
        }
        /* 22/04/08 - AC: Translate HTML code into plain char */
        $trans = array("&#146;" => "'");
        $tmp = strtr(html_entity_decode($components[$game->planet['catresearch_' . ($key + 1)]]['name']), $trans);
        /* */
        if (strlen($tmp) > 18) {
            //$compname=substr($components[$game->planet['catresearch_'.($key+1)]]['name'], 0,16);
            $compname = substr($tmp, 0, 16);
            $compname = $compname . '...';
        } else {
            $compname = $components[$game->planet['catresearch_' . ($key + 1)]]['name'];
        }
        /* 22/04/08 - AC: Translate HTML code into plain char */
        $trans = array("&#146;" => "'");
        $tmp = strtr(html_entity_decode($components['name']), $trans);
        /* */
        if (strlen($tmp) > 13) {
            /*if($components['text_category'] !=null)
            {
            
            //$catname='<a href="javascript:void(0);" onmouseover="return overlib(\''.$components['text_category'].'\',CAPTION,\''.$components['name'].'\', '.OVERLIB_STANDARD.');" onmouseout="return nd();"><font color="#FFFFFF">'.substr($components['name'], 0,11);
            $catname='<a href="javascript:void(0);" onmouseover="return overlib(\''.$components['text_category'].'\',CAPTION,\''.$components['name'].'\', '.OVERLIB_STANDARD.');" onmouseout="return nd();"><font color="#FFFFFF">'.substr($tmp, 0,11);
            $catname=$catname.'...</font></a>';
            }else{*/
            //$catname='<a href="javascript:void(0);" onmouseover="return overlib(\'\',CAPTION,\''.$components['name'].'\', '.OVERLIB_STANDARD.');" onmouseout="return nd();"><font color="#FFFFFF">'.substr($components['name'], 0,11);
            $catname = '<a href="javascript:void(0);" onmouseover="return overlib(\'\',CAPTION,\'' . $components['name'] . '\', ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"><font color="#FFFFFF">' . substr($tmp, 0, 11);
            $catname = $catname . '...</font></a>';
            /*}*/
        } else {
            /*if($components['text_category'] !=null)
            {
            $catname='<a href="javascript:void(0);" onmouseover="return overlib(\''.$components['text_category'].'\',CAPTION,\''.$components['name'].'\', '.OVERLIB_STANDARD.');" onmouseout="return nd();"><font color="#FFFFFF">'.$components['name'].'</font></a>';
            }else{*/
            $catname = $components['name'];
            /*}*/
        }
        if ($game->planet['catresearch_' . ($key + 1)] >= $game->planet['building_9'] && $game->planet['building_9'] < 9) {
            // Wenn man nicht erst Forschungszentrum hochbauen muss
            $game->out('<tr><td><b>' . $catname . '</b></td><td><b><a href="javascript:void(0);" onmouseover="return overlib(\'' . constant($game->sprache("TEXT31")) . ' ' . $BUILDING_NAME[$game->player['user_race']]['8'] . ' ' . constant($game->sprache("TEXT32")) . '\', CAPTION, \'' . $components[$game->planet['catresearch_' . ($key + 1)]]['name'] . '\', WIDTH, 400, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $compname . '</a></b></td><td>');
        } else {
            $game->out('<tr><td><b>' . $catname . '</b></td><td><b><a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateInfoText($components[$game->planet['catresearch_' . ($key + 1)]]) . '\', CAPTION, \'' . $components[$game->planet['catresearch_' . ($key + 1)]]['name'] . '\', WIDTH, 400, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $compname . '</a></b></td><td>');
        }
        $game->out('<img src="' . $game->GFX_PATH . 'menu_metal_small.gif"> ' . GetCatResearchPrice($game->planet['catresearch_' . ($key + 1)], 0) . '&nbsp;&nbsp;
<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif">' . GetCatResearchPrice($game->planet['catresearch_' . ($key + 1)], 1) . '&nbsp;&nbsp;
<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif"> ' . GetCatResearchPrice($game->planet['catresearch_' . ($key + 1)], 2) . '&nbsp; </td><td>' . $cat_times[$key] . '</td><td>' . $build_text . '</td></tr>');
    }
    // while
    $game->out('</table></td></tr></table>');
    $game->out('<br><br>');
    $game->out('<span class="sub_caption">' . constant($game->sprache("TEXT33")) . ' ' . HelpPopup('research_localresearch') . ' :</span><br><br>');
    $game->out('<table border=0 cellpadding=2 cellspacing=2 width=90% class="style_outer">');
    $game->out('
<tr>
<td width=100%>
<table border=0 cellpadding=2 cellspacing=2 width=100% class="style_inner">
<tr><td width=25%><b>' . constant($game->sprache("TEXT34")) . '</b></td><td width=25%><b>' . constant($game->sprache("TEXT35")) . '</b></td><td width=25%><b>' . constant($game->sprache("TEXT36")) . '</b></td><td width=25%>&nbsp;</td></tr>');
    // Local research:
    for ($t = 0; $t < 5; $t++) {
        if ($t == 0 && $game->planet['building_9'] < 1 || $t == 1 && $game->planet['building_9'] < 1 || $t == 2 && $game->planet['building_9'] < 1 || $t == 3 && $game->planet['building_9'] < 1 || $t == 4 && ($game->planet['building_9'] < 3 || $game->planet['building_2'] < 5 || $game->planet['building_3'] < 5 || $game->planet['building_4'] < 5)) {
        } else {
            if ($game->planet['resource_1'] >= GetResearchPrice($t, 0) && $game->planet['resource_2'] >= GetResearchPrice($t, 1) && $game->planet['resource_3'] >= GetResearchPrice($t, 2)) {
                $build_text = '<a href="' . parse_link_ex('a=researchlabs&a2=start_research&id=' . $t, LINK_CLICKID) . '"><span style="color: green">' . constant($game->sprache("TEXT30")) . ' (~' . round(pow($game->planet['research_' . ($t + 1)] + 1, 1.5) - pow($game->planet['research_' . ($t + 1)], 1.5)) . ' ' . constant($game->sprache("TEXT37")) . ')</span></a>';
                if ($game->planet['research_' . ($t + 1)] > 0) {
                    $build_text = '<a href="' . parse_link_ex('a=researchlabs&a2=start_research&id=' . $t, LINK_CLICKID) . '"><span style="color: green">' . constant($game->sprache("TEXT38")) . ' ' . ($game->planet['research_' . ($t + 1)] + 1) . ' (~' . round(pow($game->planet['research_' . ($t + 1)] + 1, 1.5) - pow($game->planet['research_' . ($t + 1)], 1.5)) . ' ' . constant($game->sprache("TEXT37")) . ')</span></a>';
                }
                if ($game->planet['research_' . ($t + 1)] >= $MAX_RESEARCH_LVL[$capital][$t]) {
                    $build_text = constant($game->sprache("TEXT39"));
                }
            } else {
                $build_text = '<span style="color: red">' . constant($game->sprache("TEXT30")) . ' (~' . round(pow($game->planet['research_' . ($t + 1)] + 1, 1.5) - pow($game->planet['research_' . ($t + 1)], 1.5)) . ' ' . constant($game->sprache("TEXT30")) . ')</span>';
                if ($game->planet['research_' . ($t + 1)] > 0) {
                    $build_text = '<span style="color: red">' . constant($game->sprache("TEXT38")) . ' ' . ($game->planet['research_' . ($t + 1)] + 1) . ' (~' . round(pow($game->planet['research_' . ($t + 1)] + 1, 1.5) - pow($game->planet['research_' . ($t + 1)], 1.5)) . ' ' . constant($game->sprache("TEXT37")) . ')</span>';
                }
                if ($game->planet['research_' . ($t + 1)] >= $MAX_RESEARCH_LVL[$capital][$t]) {
                    $build_text = constant($game->sprache("TEXT39"));
                }
            }
            $game->out('<tr><td><b><a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateResearchInfoText($t) . '\', CAPTION, \'' . $TECH_NAME[$game->player['user_race']][$t] . '\', WIDTH, 400, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $TECH_NAME[$game->player['user_race']][$t] . '</b></td><td><img src="' . $game->GFX_PATH . 'menu_metal_small.gif">' . GetResearchPrice($t, 0) . '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif">' . GetResearchPrice($t, 1) . '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif">' . GetResearchPrice($t, 2) . '</td><td>&nbsp;' . GetResearchTime($t) . '</td><td>' . $build_text . '</td></tr>');
        }
    }
    $game->out('</td></tr></table></td></tr></table>');
}
Beispiel #3
0
function Show_Main()
{
    global $db;
    global $game;
    global $SHIP_TORSO, $SHIP_DESCRIPTION, $UNIT_DESCRIPTION, $UNIT_DATA, $UNIT_NAME, $SHIP_DATA, $PLANETS_DATA, $MAX_BUILDING_LVL, $NEXT_TICK, $ACTUAL_TICK;
    Show_Common_Menues();
    $class_selector_2 = filter_input(INPUT_POST, 'line2', FILTER_SANITIZE_NUMBER_INT);
    if (isset($class_selector_2) && $class_selector_2 >= 0 && $class_selector_2 < 2) {
        $db->query('UPDATE planets SET line_2_preset = ' . $class_selector_2 . ' WHERE planet_id = ' . $game->planet['planet_id']);
        $game->planet['line_2_preset'] = $class_selector_2;
    }
    $class_selector_3 = filter_input(INPUT_POST, 'line3', FILTER_SANITIZE_NUMBER_INT);
    if (isset($class_selector_3) && $class_selector_3 >= 0 && $class_selector_3 < 3) {
        $db->query('UPDATE planets SET line_3_preset = ' . $class_selector_3 . ' WHERE planet_id = ' . $game->planet['planet_id']);
        $game->planet['line_3_preset'] = $class_selector_3;
    }
    $class_selector_4 = filter_input(INPUT_POST, 'line4', FILTER_SANITIZE_NUMBER_INT);
    if (isset($class_selector_4) && $class_selector_4 >= 0 && $class_selector_4 < 4) {
        $db->query('UPDATE planets SET line_4_preset = ' . $class_selector_4 . ' WHERE planet_id = ' . $game->planet['planet_id']);
        $game->planet['line_4_preset'] = $class_selector_4;
    }
    $game->out('<fieldset><legend><span class="sub_caption2">' . constant($game->sprache("TEXT68")) . ' ' . constant($game->sprache("TEXT72")) . '</span></legend><br>');
    $schedulerquery = $db->query('SELECT * FROM scheduler_shipbuild WHERE (planet_id="' . $game->planet['planet_id'] . '") AND (start_build<=' . $ACTUAL_TICK . ') AND line_id = 0 ORDER BY start_build ASC');
    if ($db->num_rows() > 0) {
        $game->out('<table border=0 cellpadding=2 cellspacing=2 width="100%" class="style_inner"><caption><span class="sub_caption2">' . constant($game->sprache("TEXT30")) . '</span></caption>');
        $scheduler = $db->fetchrow($schedulerquery);
        $template = $db->queryrow('SELECT * FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $scheduler['ship_type'] . '")');
        $game->out('<tr><th>' . constant($game->sprache("TEXT31")) . '</th><th>' . constant($game->sprache("TEXT32")) . '</th><th>' . constant($game->sprache("TEXT34")) . '</th><th> Azione </th></tr><tr>');
        $game->out('<td width="25%" align="center"> <a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateInfoText($template) . '\', CAPTION, \'' . addslashes($template['name']) . '\', WIDTH, 500, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $template['name'] . '</a></td>');
        $game->out('<td width="25%" align="center"> <b id="timer2" title="time1_' . ($NEXT_TICK + TICK_DURATION * 60 * ($scheduler['finish_build'] - $ACTUAL_TICK)) . '_type1_1">&nbsp;</b></td>');
        $queue_query = $db->queryrowset('SELECT ship_type, finish_build FROM scheduler_shipbuild WHERE (planet_id="' . $game->planet['planet_id'] . '") AND (start_build>=' . $ACTUAL_TICK . ') AND line_id = 0 ORDER BY start_build ASC');
        $num_rows = $db->num_rows();
        if ($num_rows > 0) {
            $queue_text = '<table width=250 border=0 cellpadding=0 cellspacing=0>';
            foreach ($queue_query as $queue_finish_time) {
                $template = $db->queryrow('SELECT name FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $queue_finish_time['ship_type'] . '")');
                $queue_text .= '<tr><td>' . $template['name'] . '</td><td>' . date("d.M H:i", time() + $NEXT_TICK + ($queue_finish_time['finish_build'] - $ACTUAL_TICK) * TICK_DURATION * 60) . '</td></tr>';
            }
            $queue_text .= '</table>';
            $game->out('<td width="25%" align="center">&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . addslashes($queue_text) . '\', CAPTION, \'' . constant($game->sprache("TEXT76")) . '\', WIDTH, 250, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"> ' . constant($game->sprache("TEXT34")) . $num_rows . ' </a> </td>');
        } else {
            $game->out('<td width="25%" align="center"> ' . constant($game->sprache("TEXT34")) . '0 </td>');
        }
        $game->out('<td width="25%" align="center"><form name="abort" method="post" action="index.php?a=shipyard&a2=abort_build" onSubmit="return document.abort.submita.disabled = true;">
                <input type="hidden" name="correct_abort" value="1">
                <input type="hidden" name="line_correct_abort" value="0">
                <input type="submit" name="submita" class="button" style="width: 100px;" value ="' . constant($game->sprache("TEXT33")) . '">
                </form></td>');
        $game->out('</tr></table><br>');
    }
    $query_line_0 = 'SELECT * FROM ship_templates WHERE owner = ' . $game->player['user_id'] . ' AND removed = 0 AND ship_class = 0 ORDER BY ship_torso ASC, name ASC';
    $list_line_0 = $db->query($query_line_0);
    $n_tplt_0 = $db->num_rows($list_line_0);
    if ($n_tplt_0 > 0) {
        $elements_lines_0 = $db->fetchrowset($list_line_0);
        foreach ($elements_lines_0 as $id => $element_item) {
            $element_item['buildtime'] = $element_item['buildtime'] + round($element_item['buildtime'] * 0.3 * (0.9 - 0.1 * $game->planet['building_8']), 0);
            $maxnum = 0;
            if (!TemplateMetRequirements($element_item)) {
                $build_text = '&nbsp;&nbsp;<span style="color: red">' . constant($game->sprache("TEXT54")) . '</span>';
            } else {
                if ($maxnum = CanAffordTemplate($element_item, $game->player, $game->planet)) {
                    $build_text = '<input type="hidden" name="correct" value="1"><input type="submit" name="submit" class="button" style="width: 60px;" value ="' . constant($game->sprache("TEXT54")) . '">';
                } else {
                    $build_text = '&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateResourceRequestedText($element_item, $game->player, $game->planet) . '\', CAPTION, \'' . constant($game->sprache("TEXT67")) . '\', WIDTH, 170, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"><span style="color: yellow">' . constant($game->sprache("TEXT54")) . '</span></a>';
                }
            }
            $table0[] = '<tr height=15><td width=200><b><a href="' . parse_link('a=ship_template&view=compare&ship0=' . $element_item['id']) . '" onmouseover="return overlib(\'' . CreateInfoText($element_item) . '\', CAPTION, \'' . addslashes($element_item['name']) . '\', WIDTH, 500, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $element_item['name'] . '</a></b></td><td>' . Zeit($element_item['buildtime'] * TICK_DURATION) . '</td><td>' . '<form name="send' . $element_item['id'] . '" method="post" action="index.php?a=shipyard&a2=start_build&id=' . $element_item['id'] . '" onSubmit="return document.send' . $element_item['id'] . '.submit.disabled = true;"><input type="hidden" name="line_request" value=0><input type="text" name="count" size="4" class="field_nosize" value="' . $maxnum . '">&nbsp;&nbsp;&nbsp;' . $build_text . '</td></tr></form>';
        }
    } else {
    }
    $game->out('<table border=0 cellpadding=2 cellspacing=2 width="100%" class="style_inner"><tr><td width=200><span class="sub_caption2">' . constant($game->sprache("TEXT51")) . '</span></td><td width=175><span class="sub_caption2">' . constant($game->sprache("TEXT52")) . '</span></td><td width=120><span class="sub_caption2">' . constant($game->sprache("TEXT53")) . '</span></td></tr>');
    if (count($table0) > 0) {
        foreach ($table0 as $row) {
            $game->out($row);
        }
    }
    $game->out('</table>');
    $game->out('</fieldset><br><br>');
    if ($PLANETS_DATA[$game->planet['planet_type']][14] > 1) {
        if (is_null($game->planet['line_2_preset'])) {
            $game->planet['line_2_preset'] = 1;
        }
        $game->out('<fieldset><legend><span class="sub_caption2">' . constant($game->sprache("TEXT69")) . '</span></legend><br>');
        $game->out('<form name="select_line2_class" method="post" action="index.php?a=shipyard">');
        $game->out('<select name="line2" onchange="this.form.submit()">');
        $game->out('<option value=1 ' . ($game->planet['line_2_preset'] == 1 ? 'selected' : '') . '>' . constant($game->sprache("TEXT73")) . '</option>');
        $game->out('<option value=0 ' . ($game->planet['line_2_preset'] == 0 ? 'selected' : '') . '>' . constant($game->sprache("TEXT72")) . '</option>');
        $game->out('</select></form><br>');
        $schedulerquery = $db->query('SELECT * FROM scheduler_shipbuild WHERE (planet_id="' . $game->planet['planet_id'] . '") AND (start_build<=' . $ACTUAL_TICK . ') AND line_id = 1 ORDER BY start_build ASC');
        if ($db->num_rows() > 0) {
            $game->out('<table border=0 cellpadding=2 cellspacing=2 width="100%" class="style_inner"><caption><span class="sub_caption2">' . constant($game->sprache("TEXT30")) . '</span></caption>');
            $scheduler = $db->fetchrow($schedulerquery);
            $template = $db->queryrow('SELECT * FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $scheduler['ship_type'] . '")');
            $game->out('<tr><th>' . constant($game->sprache("TEXT31")) . '</th><th>' . constant($game->sprache("TEXT32")) . '</th><th>' . constant($game->sprache("TEXT34")) . '</th><th> Azione </th></tr><tr>');
            $game->out('<td width="25%" align="center"> <a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateInfoText($template) . '\', CAPTION, \'' . addslashes($template['name']) . '\', WIDTH, 500, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $template['name'] . '</a></td>');
            $game->out('<td width="25%" align="center"> <b id="timer3" title="time1_' . ($NEXT_TICK + TICK_DURATION * 60 * ($scheduler['finish_build'] - $ACTUAL_TICK)) . '_type1_1">&nbsp;</b></td>');
            $queue_query = $db->queryrowset('SELECT ship_type, finish_build FROM scheduler_shipbuild WHERE (planet_id="' . $game->planet['planet_id'] . '") AND (start_build>=' . $ACTUAL_TICK . ') AND line_id = 1 ORDER BY start_build ASC');
            $num_rows = $db->num_rows();
            if ($num_rows > 0) {
                $queue_text = '<table width=250 border=0 cellpadding=0 cellspacing=0>';
                foreach ($queue_query as $queue_finish_time) {
                    $template = $db->queryrow('SELECT name FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $queue_finish_time['ship_type'] . '")');
                    $queue_text .= '<tr><td>' . $template['name'] . '</td><td>' . date("d.M H:i", time() + $NEXT_TICK + ($queue_finish_time['finish_build'] - $ACTUAL_TICK) * TICK_DURATION * 60) . '</td></tr>';
                }
                $queue_text .= '</table>';
                $game->out('<td width="25%" align="center">&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . addslashes($queue_text) . '\', CAPTION, \'' . constant($game->sprache("TEXT76")) . '\', WIDTH, 250, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"> ' . constant($game->sprache("TEXT34")) . $num_rows . ' </a> </td>');
            } else {
                $game->out('<td width="25%" align="center"> ' . constant($game->sprache("TEXT34")) . '0 </td>');
            }
            $game->out('<td width="25%" align="center"><form name="abort" method="post" action="index.php?a=shipyard&a2=abort_build" onSubmit="return document.abort.submita.disabled = true;">
                <input type="hidden" name="correct_abort" value="1">
                <input type="hidden" name="line_correct_abort" value="1">
                <input type="submit" name="submita" class="button" style="width: 100px;" value ="' . constant($game->sprache("TEXT33")) . '">
                </form></td>');
            $game->out('</tr></table><br>');
        }
        $query_line_1 = 'SELECT * FROM ship_templates WHERE owner = ' . $game->player['user_id'] . ' AND removed = 0 AND ship_class = ' . $game->planet['line_2_preset'] . ' ORDER BY ship_torso ASC, name ASC';
        $list_line_1 = $db->query($query_line_1);
        $n_tplt_1 = $db->num_rows($list_line_1);
        if ($n_tplt_1 > 0) {
            $elements_lines_1 = $db->fetchrowset($list_line_1);
            foreach ($elements_lines_1 as $id => $element_item) {
                $element_item['buildtime'] = $element_item['buildtime'] + round($element_item['buildtime'] * 0.3 * (0.9 - 0.1 * $game->planet['building_8']), 0);
                $maxnum = 0;
                if (!TemplateMetRequirements($element_item)) {
                    $build_text = '&nbsp;&nbsp;<span style="color: red">' . constant($game->sprache("TEXT54")) . '</span>';
                } else {
                    if ($maxnum = CanAffordTemplate($element_item, $game->player, $game->planet)) {
                        $build_text = '<input type="hidden" name="correct" value="1"><input type="submit" name="submit" class="button" style="width: 60px;" value ="' . constant($game->sprache("TEXT54")) . '">';
                    } else {
                        $build_text = '&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateResourceRequestedText($element_item, $game->player, $game->planet) . '\', CAPTION, \'' . constant($game->sprache("TEXT67")) . '\', WIDTH, 170, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"><span style="color: yellow">' . constant($game->sprache("TEXT54")) . '</span></a>';
                    }
                }
                $table1[] = '<tr height=15><td width=200><b><a href="' . parse_link('a=ship_template&view=compare&ship0=' . $element_item['id']) . '" onmouseover="return overlib(\'' . CreateInfoText($element_item) . '\', CAPTION, \'' . addslashes($element_item['name']) . '\', WIDTH, 500, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $element_item['name'] . '</a></b></td><td>' . Zeit($element_item['buildtime'] * TICK_DURATION) . '</td><td>' . '<form name="send' . $element_item['id'] . '" method="post" action="index.php?a=shipyard&a2=start_build&id=' . $element_item['id'] . '" onSubmit="return document.send' . $element_item['id'] . '.submit.disabled = true;"><input type="hidden" name="line_request" value=1><input type="text" name="count" size="4" class="field_nosize" value="' . $maxnum . '">&nbsp;&nbsp;&nbsp;' . $build_text . '</td></tr></form>';
            }
        } else {
        }
        $game->out('<table border=0 cellpadding=2 cellspacing=2 width="100%" class="style_inner"><tr><td width=200><span class="sub_caption2">' . constant($game->sprache("TEXT51")) . '</span></td><td width=175><span class="sub_caption2">' . constant($game->sprache("TEXT52")) . '</span></td><td width=120><span class="sub_caption2">' . constant($game->sprache("TEXT53")) . '</span></td></tr>');
        if (count($table1) > 0) {
            foreach ($table1 as $row) {
                $game->out($row);
            }
        }
        $game->out('</table>');
        $game->out('</fieldset><br><br>');
    }
    if ($PLANETS_DATA[$game->planet['planet_type']][14] > 2) {
        if (is_null($game->planet['line_3_preset'])) {
            $game->planet['line_3_preset'] = 2;
        }
        $game->out('<fieldset><legend><span class="sub_caption2">' . constant($game->sprache("TEXT70")) . '</span></legend><br>');
        $game->out('<form name="select_line3_class" method="post" action="index.php?a=shipyard">');
        $game->out('<select name="line3" onchange="this.form.submit()">');
        $game->out('<option value=2 ' . ($game->planet['line_3_preset'] == 2 ? 'selected' : '') . '>' . constant($game->sprache("TEXT74")) . '</option>');
        $game->out('<option value=1 ' . ($game->planet['line_3_preset'] == 1 ? 'selected' : '') . '>' . constant($game->sprache("TEXT73")) . '</option>');
        $game->out('<option value=0 ' . ($game->planet['line_3_preset'] == 0 ? 'selected' : '') . '>' . constant($game->sprache("TEXT72")) . '</option>');
        $game->out('</select></form><br>');
        $schedulerquery = $db->query('SELECT * FROM scheduler_shipbuild WHERE (planet_id="' . $game->planet['planet_id'] . '") AND (start_build<=' . $ACTUAL_TICK . ') AND line_id = 2 ORDER BY start_build ASC');
        if ($db->num_rows() > 0) {
            $game->out('<table border=0 cellpadding=2 cellspacing=2 width="100%" class="style_inner"><caption><span class="sub_caption2">' . constant($game->sprache("TEXT30")) . '</span></caption>');
            $scheduler = $db->fetchrow($schedulerquery);
            $template = $db->queryrow('SELECT * FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $scheduler['ship_type'] . '")');
            $game->out('<tr><th>' . constant($game->sprache("TEXT31")) . '</th><th>' . constant($game->sprache("TEXT32")) . '</th><th>' . constant($game->sprache("TEXT34")) . '</th><th> Azione </th></tr><tr>');
            $game->out('<td width="25%" align="center"> <a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateInfoText($template) . '\', CAPTION, \'' . addslashes($template['name']) . '\', WIDTH, 500, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $template['name'] . '</a></td>');
            $game->out('<td width="25%" align="center"> <b id="timer4" title="time1_' . ($NEXT_TICK + TICK_DURATION * 60 * ($scheduler['finish_build'] - $ACTUAL_TICK)) . '_type1_1">&nbsp;</b></td>');
            $queue_query = $db->queryrowset('SELECT ship_type, finish_build FROM scheduler_shipbuild WHERE (planet_id="' . $game->planet['planet_id'] . '") AND (start_build>=' . $ACTUAL_TICK . ') AND line_id = 2 ORDER BY start_build ASC');
            $num_rows = $db->num_rows();
            if ($num_rows > 0) {
                $queue_text = '<table width=250 border=0 cellpadding=0 cellspacing=0>';
                foreach ($queue_query as $queue_finish_time) {
                    $template = $db->queryrow('SELECT name FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $queue_finish_time['ship_type'] . '")');
                    $queue_text .= '<tr><td>' . $template['name'] . '</td><td>' . date("d.M H:i", time() + $NEXT_TICK + ($queue_finish_time['finish_build'] - $ACTUAL_TICK) * TICK_DURATION * 60) . '</td></tr>';
                }
                $queue_text .= '</table>';
                $game->out('<td width="25%" align="center">&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . addslashes($queue_text) . '\', CAPTION, \'' . constant($game->sprache("TEXT76")) . '\', WIDTH, 250, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"> ' . constant($game->sprache("TEXT34")) . $num_rows . ' </a> </td>');
            } else {
                $game->out('<td width="25%" align="center"> ' . constant($game->sprache("TEXT34")) . '0 </td>');
            }
            $game->out('<td width="25%" align="center"><form name="abort" method="post" action="index.php?a=shipyard&a2=abort_build" onSubmit="return document.abort.submita.disabled = true;">
                <input type="hidden" name="correct_abort" value="1">
                <input type="hidden" name="line_correct_abort" value="2">
                <input type="submit" name="submita" class="button" style="width: 100px;" value ="' . constant($game->sprache("TEXT33")) . '">
                </form></td>');
            $game->out('</tr></table><br>');
        }
        $query_line_2 = 'SELECT * FROM ship_templates WHERE owner = ' . $game->player['user_id'] . ' AND removed = 0 AND ship_class = ' . $game->planet['line_3_preset'] . ' ORDER BY ship_torso ASC, name ASC';
        $list_line_2 = $db->query($query_line_2);
        $n_tplt_2 = $db->num_rows($list_line_2);
        if ($n_tplt_2 > 0) {
            $elements_lines_2 = $db->fetchrowset($list_line_2);
            foreach ($elements_lines_2 as $id => $element_item) {
                $element_item['buildtime'] = $element_item['buildtime'] + round($element_item['buildtime'] * 0.3 * (0.9 - 0.1 * $game->planet['building_8']), 0);
                $maxnum = 0;
                if (!TemplateMetRequirements($element_item)) {
                    $build_text = '&nbsp;&nbsp;<span style="color: red">' . constant($game->sprache("TEXT54")) . '</span>';
                } else {
                    if ($maxnum = CanAffordTemplate($element_item, $game->player, $game->planet)) {
                        $build_text = '<input type="hidden" name="correct" value="1"><input type="submit" name="submit" class="button" style="width: 60px;" value ="' . constant($game->sprache("TEXT54")) . '">';
                    } else {
                        $build_text = '&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateResourceRequestedText($element_item, $game->player, $game->planet) . '\', CAPTION, \'' . constant($game->sprache("TEXT67")) . '\', WIDTH, 170, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"><span style="color: yellow">' . constant($game->sprache("TEXT54")) . '</span></a>';
                    }
                }
                $table2[] = '<tr height=15><td width=200><b><a href="' . parse_link('a=ship_template&view=compare&ship0=' . $element_item['id']) . '" onmouseover="return overlib(\'' . CreateInfoText($element_item) . '\', CAPTION, \'' . addslashes($element_item['name']) . '\', WIDTH, 500, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $element_item['name'] . '</a></b></td><td>' . Zeit($element_item['buildtime'] * TICK_DURATION) . '</td><td>' . '<form name="send' . $element_item['id'] . '" method="post" action="index.php?a=shipyard&a2=start_build&id=' . $element_item['id'] . '" onSubmit="return document.send' . $element_item['id'] . '.submit.disabled = true;"><input type="hidden" name="line_request" value=2><input type="text" name="count" size="4" class="field_nosize" value="' . $maxnum . '">&nbsp;&nbsp;&nbsp;' . $build_text . '</td></tr></form>';
            }
        } else {
        }
        $game->out('<table border=0 cellpadding=2 cellspacing=2 width=100% class="style_inner"><tr><td width=200><span class="sub_caption2">' . constant($game->sprache("TEXT51")) . '</span></td><td width=175><span class="sub_caption2">' . constant($game->sprache("TEXT52")) . '</span></td><td width=120><span class="sub_caption2">' . constant($game->sprache("TEXT53")) . '</span></td></tr>');
        if (count($table2) > 0) {
            foreach ($table2 as $row) {
                $game->out($row);
            }
        }
        $game->out('</table>');
        $game->out('</fieldset><br><br>');
    }
    if ($PLANETS_DATA[$game->planet['planet_type']][14] > 3) {
        if (is_null($game->planet['line_4_preset'])) {
            $game->planet['line_4_preset'] = 3;
        }
        $game->out('<fieldset><legend><span class="sub_caption2">' . constant($game->sprache("TEXT71")) . '</span></legend><br>');
        $game->out('<form name="select_line4_class" method="post" action="index.php?a=shipyard">');
        $game->out('<select name="line4" onchange="this.form.submit()">');
        $game->out('<option value=3 ' . ($game->planet['line_4_preset'] == 3 ? 'selected' : '') . '>' . constant($game->sprache("TEXT75")) . '</option>');
        $game->out('<option value=2 ' . ($game->planet['line_4_preset'] == 2 ? 'selected' : '') . '>' . constant($game->sprache("TEXT74")) . '</option>');
        $game->out('<option value=1 ' . ($game->planet['line_4_preset'] == 1 ? 'selected' : '') . '>' . constant($game->sprache("TEXT73")) . '</option>');
        $game->out('<option value=0 ' . ($game->planet['line_4_preset'] == 0 ? 'selected' : '') . '>' . constant($game->sprache("TEXT72")) . '</option>');
        $game->out('</select></form><br>');
        $schedulerquery = $db->query('SELECT * FROM scheduler_shipbuild WHERE (planet_id="' . $game->planet['planet_id'] . '") AND (start_build<=' . $ACTUAL_TICK . ') AND line_id = 3 ORDER BY start_build ASC');
        if ($db->num_rows() > 0) {
            $game->out('<table border=0 cellpadding=2 cellspacing=2 width="100%" class="style_inner"><caption><span class="sub_caption2">' . constant($game->sprache("TEXT30")) . '</span></caption>');
            $scheduler = $db->fetchrow($schedulerquery);
            $template = $db->queryrow('SELECT * FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $scheduler['ship_type'] . '")');
            $game->out('<tr><th>' . constant($game->sprache("TEXT31")) . '</th><th>' . constant($game->sprache("TEXT32")) . '</th><th>' . constant($game->sprache("TEXT34")) . '</th><th> Azione </th></tr><tr>');
            $game->out('<td width="25%" align="center"> <a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateInfoText($template) . '\', CAPTION, \'' . addslashes($template['name']) . '\', WIDTH, 500, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $template['name'] . '</a></td>');
            $game->out('<td width="25%" align="center"> <b id="timer5" title="time1_' . ($NEXT_TICK + TICK_DURATION * 60 * ($scheduler['finish_build'] - $ACTUAL_TICK)) . '_type1_1">&nbsp;</b></td>');
            $queue_query = $db->queryrowset('SELECT ship_type, finish_build FROM scheduler_shipbuild WHERE (planet_id="' . $game->planet['planet_id'] . '") AND (start_build>=' . $ACTUAL_TICK . ') AND line_id = 3 ORDER BY start_build ASC');
            $num_rows = $db->num_rows();
            if ($num_rows > 0) {
                $queue_text = '<table width=250 border=0 cellpadding=0 cellspacing=0>';
                foreach ($queue_query as $queue_finish_time) {
                    $template = $db->queryrow('SELECT name FROM ship_templates WHERE (owner="' . $game->player['user_id'] . '") AND (id="' . $queue_finish_time['ship_type'] . '")');
                    $queue_text .= '<tr><td>' . $template['name'] . '</td><td>' . date("d.M H:i", time() + $NEXT_TICK + ($queue_finish_time['finish_build'] - $ACTUAL_TICK) * TICK_DURATION * 60) . '</td></tr>';
                }
                $queue_text .= '</table>';
                $game->out('<td width="25%" align="center">&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . addslashes($queue_text) . '\', CAPTION, \'' . constant($game->sprache("TEXT76")) . '\', WIDTH, 250, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"> ' . constant($game->sprache("TEXT34")) . $num_rows . ' </a> </td>');
            } else {
                $game->out('<td width="25%" align="center"> ' . constant($game->sprache("TEXT34")) . '0 </td>');
            }
            $game->out('<td width="25%" align="center"><form name="abort" method="post" action="index.php?a=shipyard&a2=abort_build" onSubmit="return document.abort.submita.disabled = true;">
                <input type="hidden" name="correct_abort" value="1">
                <input type="hidden" name="line_correct_abort" value="3">
                <input type="submit" name="submita" class="button" style="width: 100px;" value ="' . constant($game->sprache("TEXT33")) . '">
                </form></td>');
            $game->out('</tr></table><br>');
        }
        $query_line_3 = 'SELECT * FROM ship_templates WHERE owner = ' . $game->player['user_id'] . ' AND removed = 0 AND ship_class = ' . $game->planet['line_4_preset'] . ' ORDER BY ship_torso ASC, name ASC';
        $list_line_3 = $db->query($query_line_3);
        $n_tplt_3 = $db->num_rows($list_line_3);
        if ($n_tplt_3 > 0) {
            $elements_lines_3 = $db->fetchrowset($list_line_3);
            foreach ($elements_lines_3 as $id => $element_item) {
                $element_item['buildtime'] = $element_item['buildtime'] + round($element_item['buildtime'] * 0.3 * (0.9 - 0.1 * $game->planet['building_8']), 0);
                $maxnum = 0;
                if (!TemplateMetRequirements($element_item)) {
                    $build_text = '&nbsp;&nbsp;<span style="color: red">' . constant($game->sprache("TEXT54")) . '</span>';
                } else {
                    if ($maxnum = CanAffordTemplate($element_item, $game->player, $game->planet)) {
                        $build_text = '<input type="hidden" name="correct" value="1"><input type="submit" name="submit" class="button" style="width: 60px;" value ="' . constant($game->sprache("TEXT54")) . '">';
                    } else {
                        $build_text = '&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateResourceRequestedText($element_item, $game->player, $game->planet) . '\', CAPTION, \'' . constant($game->sprache("TEXT67")) . '\', WIDTH, 170, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();"><span style="color: yellow">' . constant($game->sprache("TEXT54")) . '</span></a>';
                    }
                }
                $table3[] = '<tr height=15><td width=200><b><a href="' . parse_link('a=ship_template&view=compare&ship0=' . $element_item['id']) . '" onmouseover="return overlib(\'' . CreateInfoText($element_item) . '\', CAPTION, \'' . addslashes($element_item['name']) . '\', WIDTH, 500, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $element_item['name'] . '</a></b></td><td>' . Zeit($element_item['buildtime'] * TICK_DURATION) . '</td><td>' . '<form name="send' . $element_item['id'] . '" method="post" action="index.php?a=shipyard&a2=start_build&id=' . $element_item['id'] . '" onSubmit="return document.send' . $element_item['id'] . '.submit.disabled = true;"><input type="hidden" name="line_request" value=3><input type="text" name="count" size="4" class="field_nosize" value="' . $maxnum . '">&nbsp;&nbsp;&nbsp;' . $build_text . '</td></tr></form>';
            }
        } else {
        }
        $game->out('<table border=0 cellpadding=2 cellspacing=2 width=100% class="style_inner"><tr><td width=200><span class="sub_caption2">' . constant($game->sprache("TEXT51")) . '</span></td><td width=175><span class="sub_caption2">' . constant($game->sprache("TEXT52")) . '</span></td><td width=120><span class="sub_caption2">' . constant($game->sprache("TEXT53")) . '</span></td></tr>');
        if (count($table3) > 0) {
            foreach ($table3 as $row) {
                $game->out($row);
            }
        }
        $game->out('</table>');
        $game->out('</fieldset><br><br>');
    }
}