<?php
#################################################################################
##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                 ##
## --------------------------------------------------------------------------- ##
##  Filename       : editServerSet.tpl                                         ##
##  Type           : Admin Panel Frontend                                      ##
## --------------------------------------------------------------------------- ##
##  Developed by   : ronix (Original)                                          ##
##  Refactored by  : Shadow                                                    ##
##  Redesign by    : Shadow                                                    ##
## --------------------------------------------------------------------------- ##
##  Contact        : cata7007@gmail.com                                        ##
##  Project        : TravianZ                                                  ##
##  GitHub         : https://github.com/Shadowss/TravianZ                      ##
## --------------------------------------------------------------------------- ##
##  License        : TravianZ Project                                          ##
##  Copyright      : TravianZ (c) 2010-2025. All rights reserved.              ##
## --------------------------------------------------------------------------- ##
#################################################################################
if (!isset($_SESSION)) {
 session_start();
}
if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN);
?>
<style>
.config-wrap{max-width:1100px;margin:0 auto;font-family:system-ui,-apple-system,Segoe UI,Roboto}
.config-title{text-align:center;font-size:20px;font-weight:800;margin:8px 0 12px;color:#ffffff}
.config-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px;overflow:hidden;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.config-head{display:flex;justify-content:space-between;align-items:center;padding:7px 10px;background:#0f172a;color:#fff;font-weight:600;font-size:13px;line-height:1}
.edit-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:4px;transition:.15s}
.edit-btn:hover{background:rgba(255,255,255,.12)}
.edit-btn svg{width:14px;height:14px;transition:.15s}
.edit-btn:hover svg{stroke:#fff;transform:scale(1.05)}
.config-table{width:100%;border-collapse:collapse}
.config-table tr{border-top:1px solid #f1f5f9}
.config-table tr:first-child{border-top:0}
.config-table td{padding:5px 8px;vertical-align:middle;font-size:13px;line-height:1.25}
.config-table td.b{background:#f8fafc;font-weight:700;color:#334155;text-transform:uppercase;font-size:11px;letter-spacing:.3px;padding:4px 8px}
.config-table td:first-child{color:#475569;width:60%}
.config-table td:last-child{color:#0f172a;font-weight:500}
.badge.green{background:#dcfce7;color:#166534}
.badge.red{background:#fee2e2;color:#991b1b}
.badge.blue{background:#dbeafe;color:#1e40af}
.badge.gray{background:#f1f5f9;color:#475569}
.config-table input.fm, .config-table select{padding:4px 6px;border:1px solid #cbd5e1;border-radius:4px;font-size:13px}
.tooltip{cursor:help;margin-left:4px}
.config-actions{display:flex;justify-content:space-between;align-items:center;margin-top:12px}
.btn-back,.btn-save{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:6px;font-weight:600;font-size:13px;text-decoration:none;cursor:pointer;transition:.15s;border:1px solid transparent}
.btn-back{background:#f1f5f9;color:#0f172a;border-color:#e5e7eb}
.btn-back:hover{background:#e2e8f0}
.btn-save{background:#0f172a;color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.btn-save:hover{background:#1e293b;transform:translateY(-1px)}
.btn-save:active{transform:translateY(0)}
.btn-save svg{width:14px;height:14px}
</style>

<script LANGUAGE="JavaScript">
function refresh(tz) {
	document.getElementById('tz').innerHTML=tz;
}
</script>

<div class="config-wrap">
    <div class="config-title"><?php echo SERV_CONFIG ?></div>
    
    <form action="../GameEngine/Admin/Mods/editServerSet.php" method="POST">
        <?php echo csrf_field(); ?>
        <input type="hidden" name="id" id="id" value="<?php echo $_SESSION['id']; ?>">
        
        <div class="config-card">
            <div class="config-head">
                <span><?php echo EDIT_SERV_SETT ?></span>
            </div>
            <table class="config-table">
                <tbody>
                <tr>
                    <td class="b"><?php echo CONF_SERV_NAME ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_NAME_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="servername" value="<?php echo SERVER_NAME;?>" style="width: 70%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_STARTED ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_STARTED_TOOLTIP ?></span></em></td>
                    <td><?php echo "Date:".START_DATE." Time:".START_TIME;?></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_TIMEZONE ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_TIMEZONE_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="tzone" onChange="refresh(this.value)">
                        <?php
                            /**
                             * Lista completa de fusuri orare, generata din PHP.
                             *
                             * Inainte erau 12 optiuni scrise de mana, cate una de
                             * continent, asa ca fusuri uzuale (Europe/Paris,
                             * Europe/Berlin, Europe/Madrid...) nici nu apareau.
                             * DateTimeZone::listIdentifiers() intoarce lista IANA
                             * a instalarii, deci ramane corecta si dupa
                             * actualizarile de date despre ora de vara.
                             *
                             * Sunt grupate pe regiune si arata si decalajul curent,
                             * ca sa fie usor de gasit.
                             */
                            $tzCurrent = defined('TIMEZONE') ? TIMEZONE : date_default_timezone_get();
                            $tzAll     = DateTimeZone::listIdentifiers();
                            $tzGroups  = array();
                            $tzNow     = new DateTime('now', new DateTimeZone('UTC'));

                            foreach ($tzAll as $tzId) {
                                $tzParts  = explode('/', $tzId, 2);
                                $tzRegion = $tzParts[0];

                                try {
                                    $tzOffset = (new DateTimeZone($tzId))->getOffset($tzNow);
                                } catch (Exception $e) {
                                    continue;
                                }

                                $tzSign  = $tzOffset < 0 ? '-' : '+';
                                $tzAbs   = abs($tzOffset);
                                $tzLabel = sprintf('%s (UTC%s%02d:%02d)',
                                    str_replace('_', ' ', $tzId),
                                    $tzSign, intdiv($tzAbs, 3600), intdiv($tzAbs % 3600, 60));

                                $tzGroups[$tzRegion][$tzId] = $tzLabel;
                            }

                            // daca valoarea din config nu mai e un fus valid, o
                            // aratam oricum, ca adminul sa vada ce e setat acum
                            if (!in_array($tzCurrent, $tzAll, true)) {
                                echo '<option value="' . htmlspecialchars($tzCurrent, ENT_QUOTES, 'UTF-8') . '" selected>'
                                   . htmlspecialchars($tzCurrent, ENT_QUOTES, 'UTF-8') . ' (?)</option>';
                            }

                            foreach ($tzGroups as $tzRegion => $tzList) {
                                echo '<optgroup label="' . htmlspecialchars($tzRegion, ENT_QUOTES, 'UTF-8') . '">';

                                foreach ($tzList as $tzId => $tzLabel) {
                                    echo '<option value="' . htmlspecialchars($tzId, ENT_QUOTES, 'UTF-8') . '"'
                                       . ($tzCurrent === $tzId ? ' selected' : '') . '>'
                                       . htmlspecialchars($tzLabel, ENT_QUOTES, 'UTF-8') . '</option>';
                                }

                                echo '</optgroup>';
                            }
                        ?>
                        </select>
                        <span id="tz" name="tz" style="margin-left:8px;color:#64748b;"><?php echo TIMEZONE;?></span>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_LANG ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_LANG_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="lang">
                            <option value="en" <?php if ((defined('SERVER_LANG') ? SERVER_LANG : LANG)=="en") echo "selected";?>><?php echo ADM_ENGLISH; ?></option>
                            <option value="fr" <?php if ((defined('SERVER_LANG') ? SERVER_LANG : LANG)=="fr") echo "selected";?>><?php echo ADM_FRENCH; ?></option>
                            <option value="it" <?php if ((defined('SERVER_LANG') ? SERVER_LANG : LANG)=="it") echo "selected";?>><?php echo ADM_ITALIAN; ?></option>
                            <option value="es" <?php if ((defined('SERVER_LANG') ? SERVER_LANG : LANG)=="es") echo "selected";?>><?php echo ADM_SPANISH; ?></option>
                            <option value="ro" <?php if ((defined('SERVER_LANG') ? SERVER_LANG : LANG)=="ro") echo "selected";?>><?php echo ADM_ROMANIAN; ?></option>
                            <option value="zh" <?php if ((defined('SERVER_LANG') ? SERVER_LANG : LANG)=="zh") echo "selected";?>><?php echo ADM_CHINESE; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_SERVSPEED ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_SERVSPEED_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="speed" value="<?php echo SPEED;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_TROOPSPEED ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_TROOPSPEED_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="incspeed" value="<?php echo INCREASE_SPEED;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_EVASIONSPEED ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_EVASIONSPEED_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="evasionspeed" value="<?php echo EVASION_SPEED;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_STORMULTIPLER ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_STORMULTIPLER_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="storage_multiplier" value="<?php echo STORAGE_MULTIPLIER;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_TRADCAPACITY ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_TRADCAPACITY_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="tradercap" value="<?php echo TRADER_CAPACITY;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_CRANCAPACITY ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_CRANCAPACITY_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="crannycap" value="<?php echo CRANNY_CAPACITY;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_TRAPCAPACITY ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_TRAPCAPACITY_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="trappercap" value="<?php echo TRAPPER_CAPACITY;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_NATUNITSMULTIPLIER ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_NATUNITSMULTIPLIER_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="natars_units" value="<?php echo NATARS_UNITS;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_NATARS_SPAWN_TIME ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_NATARS_SPAWN_TIME_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="natars_spawn_time" value="<?php echo NATARS_SPAWN_TIME;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_NATARS_WW_SPAWN_TIME ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_NATARS_WW_SPAWN_TIME_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="natars_ww_spawn_time" value="<?php echo NATARS_WW_SPAWN_TIME;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_USRNM_MIN ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_REGRULES_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="usrnm_min" value="<?php echo defined('USRNM_MIN_LENGTH') ? USRNM_MIN_LENGTH : 3;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_USRNM_MAX ?></td>
                    <td><input class="fm" name="usrnm_max" value="<?php echo defined('USRNM_MAX_LENGTH') ? USRNM_MAX_LENGTH : 15;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_PW_MIN ?></td>
                    <td><input class="fm" name="pw_min" value="<?php echo defined('PW_MIN_LENGTH') ? PW_MIN_LENGTH : 4;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_USRNM_SPECIAL ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_USRNM_SPECIAL_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="usrnm_special">
                            <option value="true" <?php if (!defined('USRNM_SPECIAL') || USRNM_SPECIAL) echo "selected"; ?>>True</option>
                            <option value="false" <?php if (defined('USRNM_SPECIAL') && !USRNM_SPECIAL) echo "selected"; ?>>False</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_NATARS_WW_BUILDING_PLAN_SPAWN_TIME ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_NATARS_WW_BUILDING_PLAN_SPAWN_TIME_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="natars_ww_building_plan_spawn_time" value="<?php echo NATARS_WW_BUILDING_PLAN_SPAWN_TIME;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_NATARS_WW_START_DELAY ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_NATARS_WW_START_DELAY_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="natars_ww_start_delay" value="<?php echo NATARS_WW_START_DELAY;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_MAPSIZE ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_MAPSIZE_TOOLTIP ?></span></em></td>
                    <td><?php echo WORLD_MAX;?>x<?php echo WORLD_MAX;?></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_VILLEXPSPEED ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_VILLEXPSPEED_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="village_expand">
                            <option value="1" <?php if (CP=="1") echo "selected";?>><?php echo ADM_SLOW; ?></option>
                            <option value="0" <?php if (CP=="0") echo "selected";?>><?php echo ADM_FAST; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_BEGINPROTECT ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_BEGINPROTECT_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="beginner">
                            <option value="7200" <?php if (PROTECTION=="7200") echo "selected";?>><?php echo ADM_2_HOURS; ?></option>
                            <option value="10800" <?php if (PROTECTION=="10800") echo "selected";?>><?php echo ADM_3_HOURS; ?></option>
                            <option value="18000" <?php if (PROTECTION=="18000") echo "selected";?>><?php echo ADM_5_HOURS; ?></option>
                            <option value="28800" <?php if (PROTECTION=="28800") echo "selected";?>><?php echo ADM_8_HOURS; ?></option>
                            <option value="36000" <?php if (PROTECTION=="36000") echo "selected";?>><?php echo ADM_10_HOURS; ?></option>
                            <option value="43200" <?php if (PROTECTION=="43200") echo "selected";?>><?php echo ADM_12_HOURS; ?></option>
                            <option value="86400" <?php if (PROTECTION=="86400") echo "selected";?>><?php echo ADM_24_HOURS_1_DAY; ?></option>
                            <option value="172800" <?php if (PROTECTION=="172800") echo "selected";?>><?php echo ADM_48_HOURS_2_DAYS; ?></option>
                            <option value="259200" <?php if (PROTECTION=="259200") echo "selected";?>><?php echo ADM_72_HOURS_3_DAYS; ?></option>
                            <option value="432000" <?php if (PROTECTION=="432000") echo "selected";?>><?php echo ADM_120_HOURS_5_DAYS; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_REGOPEN ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_REGOPEN_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="reg_open">
                            <option value="True" <?php if(REG_OPEN==true) echo "selected";?>><?php echo ADM_TRUE; ?></option>
                            <option value="False" <?php if(REG_OPEN==false) echo "selected";?>><?php echo ADM_FALSE; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_ACTIVMAIL ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_ACTIVMAIL_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="activate">
                            <option value="true" <?php if (AUTH_EMAIL==true) echo "selected";?>><?php echo ADM_YES; ?></option>
                            <option value="false" <?php if (AUTH_EMAIL==false) echo "selected";?>><?php echo ADM_NO; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_QUEST ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_QUEST_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="quest">
                            <option value="true" <?php if(QUEST == true) echo "selected";?>><?php echo ADM_YES; ?></option>
                            <option value="false" <?php if(QUEST == false) echo "selected";?>><?php echo ADM_NO; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_QTYPE ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_QTYPE_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="qtype">
                            <option value="25" <?php if(QTYPE == 25) echo "selected";?>><?php echo ADM_TRAVIAN_OFFICIAL; ?></option>
                            <option value="37" <?php if(QTYPE == 37) echo "selected";?>><?php echo ADM_TRAVIANZ_EXTENDED; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_DLR ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_DLR_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="demolish">
                            <option value="5" <?php if(DEMOLISH_LEVEL_REQ == "5") echo "selected";?>>5</option>
                            <option value="10" <?php if(DEMOLISH_LEVEL_REQ == "10") echo "selected";?>><?php echo ADM_10_DEFAULT; ?></option>
                            <option value="15" <?php if(DEMOLISH_LEVEL_REQ == "15") echo "selected";?>>15</option>
                            <option value="20" <?php if(DEMOLISH_LEVEL_REQ == "20") echo "selected";?>>20</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_WWSTATS ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_WWSTATS_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="ww">
                            <option value="True" <?php if(WW == true) echo "selected";?>><?php echo ADM_TRUE; ?></option>
                            <option value="False" <?php if(WW == false) echo "selected";?>><?php echo ADM_FALSE; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_NTRTIME ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_NTRTIME_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="nature_regtime">
                            <option value="28800" <?php if(NATURE_REGTIME == 28800) echo "selected";?>><?php echo ADM_8_HOURS; ?></option>
                            <option value="36000" <?php if(NATURE_REGTIME == 36000) echo "selected";?>><?php echo ADM_10_HOURS; ?></option>
                            <option value="43200" <?php if(NATURE_REGTIME == 43200) echo "selected";?>><?php echo ADM_12_HOURS; ?></option>
                            <option value="57600" <?php if(NATURE_REGTIME == 57600) echo "selected";?>><?php echo ADM_16_HOURS; ?></option>
                            <option value="72000" <?php if(NATURE_REGTIME == 72000) echo "selected";?>><?php echo ADM_20_HOURS; ?></option>
                            <option value="86400" <?php if(NATURE_REGTIME == 86400) echo "selected";?>><?php echo ADM_24_HOURS_1_DAY; ?></option>
                            <option value="172800" <?php if(NATURE_REGTIME == 172800) echo "selected";?>><?php echo ADM_48_HOURS_2_DAYS; ?></option>
                            <option value="259200" <?php if(NATURE_REGTIME == 259200) echo "selected";?>><?php echo ADM_72_HOURS_3_DAYS; ?></option>
                            <option value="432000" <?php if(NATURE_REGTIME == 432000) echo "selected";?>><?php echo ADM_120_HOURS_5_DAYS; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_OASIS_WOOD_PROD_MULT ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_OASIS_WOOD_PROD_MULT_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="oasis_wood_multiplier" value="<?php echo OASIS_WOOD_MULTIPLIER;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_OASIS_CLAY_PROD_MULT ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_OASIS_CLAY_PROD_MULT_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="oasis_clay_multiplier" value="<?php echo OASIS_CLAY_MULTIPLIER;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_OASIS_IRON_PROD_MULT ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_OASIS_IRON_PROD_MULT_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="oasis_iron_multiplier" value="<?php echo OASIS_IRON_MULTIPLIER;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_OASIS_CROP_PROD_MULT ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_OASIS_CROP_PROD_MULT_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="oasis_crop_multiplier" value="<?php echo OASIS_CROP_MULTIPLIER;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_MEDALINTERVAL ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_MEDALINTERVAL_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="medalinterval">
                            <option value="0" <?php if(MEDALINTERVAL==0) echo "selected";?>><?php echo ADM_NONE; ?></option>
                            <option value="(3600*24)" <?php if(MEDALINTERVAL==86400) echo "selected";?>><?php echo ADM_1_DAY; ?></option>
                            <option value="(3600*24*2)" <?php if(MEDALINTERVAL==172800) echo "selected";?>><?php echo ADM_2_DAYS; ?></option>
                            <option value="(3600*24*3)" <?php if(MEDALINTERVAL==259200) echo "selected";?>><?php echo ADM_3_DAYS; ?></option>
                            <option value="(3600*24*4)" <?php if(MEDALINTERVAL==345600) echo "selected";?>><?php echo ADM_4_DAYS; ?></option>
                            <option value="(3600*24*5)" <?php if(MEDALINTERVAL==432000) echo "selected";?>><?php echo ADM_5_DAYS; ?></option>
                            <option value="(3600*24*6)" <?php if(MEDALINTERVAL==518400) echo "selected";?>><?php echo ADM_6_DAYS; ?></option>
                            <option value="(3600*24*7)" <?php if(MEDALINTERVAL==604800) echo "selected";?>><?php echo ADM_7_DAYS; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_TOURNTHRES ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_TOURNTHRES_TOOLTIP ?></span></em></td>
                    <td><input class="fm" name="ts_threshold" value="<?php echo TS_THRESHOLD;?>" style="width: 20%;"></td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_GWORKSHOP ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_GWORKSHOP_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="great_wks">
                            <option value="True" <?php if(GREAT_WKS==true) echo "selected";?>><?php echo ADM_TRUE; ?></option>
                            <option value="False" <?php if(GREAT_WKS==false) echo "selected";?>><?php echo ADM_FALSE; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_NATARSTAT ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_NATARSTAT_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="show_natars">
                            <option value="True" <?php if(SHOW_NATARS==true) echo "selected";?>><?php echo ADM_TRUE; ?></option>
                            <option value="False" <?php if(SHOW_NATARS==false) echo "selected";?>><?php echo ADM_FALSE; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_PEACESYST ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_PEACESYST_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="peace">
                            <option value="0" <?php if(PEACE==0) echo "selected";?>><?php echo ADM_NONE_2; ?></option>
                            <option value="1" <?php if(PEACE==1) echo "selected";?>><?php echo ADM_NORMAL; ?></option>
                            <option value="2" <?php if(PEACE==2) echo "selected";?>><?php echo ADM_CHRISTMAS; ?></option>
                            <option value="3" <?php if(PEACE==3) echo "selected";?>><?php echo ADM_NEW_YEAR; ?></option>
                            <option value="4" <?php if(PEACE==4) echo "selected";?>><?php echo ADM_EASTER; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b">Server graphic pack <em class="tooltip">?<span class="classic">The graphic pack every player sees by default. Packs are read from the gpack/ folder &mdash; a folder counts as a pack when it contains travian.css. Changing this switches the whole server's look.</span></em></td>
                    <td>
                        <select name="gp_locate">
                        <?php
                            $gpCurrent = defined('GP_LOCATE') ? GP_LOCATE : 'gpack/travian_default/';
                            $gpList    = function_exists('tz_available_gpacks') ? tz_available_gpacks() : array();

                            if (!$gpList) {
                                $gpList = array($gpCurrent => $gpCurrent);
                            }

                            // pachetul din config poate lipsi de pe disc: il aratam oricum,
                            // ca adminul sa vada ce e setat acum
                            if (!isset($gpList[$gpCurrent])) {
                                $gpList[$gpCurrent] = $gpCurrent . ' (?)';
                            }

                            foreach ($gpList as $gpPath => $gpLabel) {
                                echo '<option value="' . htmlspecialchars($gpPath, ENT_QUOTES, 'UTF-8') . '"'
                                   . ($gpCurrent === $gpPath ? ' selected' : '') . '>'
                                   . htmlspecialchars($gpLabel, ENT_QUOTES, 'UTF-8') . '</option>';
                            }
                        ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_GRAPHICPACK ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_GRAPHICPACK_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="gpack">
                            <option value="true" <?php if(GP_ENABLE==true) echo "selected";?>><?php echo ADM_YES; ?></option>
                            <option value="false" <?php if(GP_ENABLE==false) echo "selected";?>><?php echo ADM_NO; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo CONF_SERV_ERRORREPORT ?> <em class="tooltip">?<span class="classic"><?php echo CONF_SERV_ERRORREPORT_TOOLTIP ?></span></em></td>
                    <td>
                        <select name="error">
                            <option value="error_reporting (E_ALL ^ E_NOTICE);" <?php if(ERROR_REPORT=="error_reporting (E_ALL ^ E_NOTICE);") echo "selected";?>><?php echo ADM_YES; ?></option>
                            <option value="error_reporting (0);" <?php if(ERROR_REPORT=="error_reporting (0);") echo "selected";?>><?php echo ADM_NO; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="b"><?php echo ADM_HERO_BASE_REGENERATION; ?><em class="tooltip">?<span class="classic"><?php echo ADM_HIT_POINTS_THE_HERO_RECOVERS_PER_DAY_ON_TOP; ?></span></em></td>
                    <td>
                        <input type="number" name="hero_base_regen" min="0" max="100" style="width:90px"
                               value="<?php echo defined('HERO_BASE_REGEN') ? (int) HERO_BASE_REGEN : 10; ?>"><?php echo ADM_HP_DAY; ?></td>
                </tr>
                <tr>
                    <td class="b"><?php echo ADM_HERO_EXCHANGE_RATES; ?><em class="tooltip">?<span class="classic"><?php echo ADM_EXCHANGE_OFFICE_IN_THE_AUCTION_HOUSE_KEEP_TH; ?></span></em></td>
                    <td><?php echo ADM_1_GOLD; ?><input type="number" name="hero_silver_per_gold" min="1" max="10000" style="width:80px"
                               value="<?php echo defined('HERO_SILVER_PER_GOLD') ? (int) HERO_SILVER_PER_GOLD : 10; ?>"><?php echo ADM_SILVER_2; ?><input type="number" name="hero_silver_to_gold" min="1" max="10000" style="width:80px"
                               value="<?php echo defined('HERO_SILVER_TO_GOLD') ? (int) HERO_SILVER_TO_GOLD : 25; ?>"><?php echo ADM_SILVER_1_GOLD; ?></td>
                </tr>
                <tr>
                    <td class="b"><?php echo ADM_HERO_RESOURCE_PRODUCTION; ?><em class="tooltip">?<span class="classic"><?php echo ADM_HOURLY_RESOURCES_PER_POINT_INVESTED_IN_THE_H; ?></span></em></td>
                    <td>
                        <input type="number" name="hero_res_all" min="0" max="10000" style="width:80px"
                               value="<?php echo defined('HERO_RES_PER_POINT_ALL') ? (int) HERO_RES_PER_POINT_ALL : 3; ?>"><?php echo ADM_OF_EACH; ?><input type="number" name="hero_res_one" min="0" max="10000" style="width:80px"
                               value="<?php echo defined('HERO_RES_PER_POINT_ONE') ? (int) HERO_RES_PER_POINT_ONE : 10; ?>"><?php echo ADM_OF_ONE_TYPE; ?></td>
                </tr>
				<tr>
                    <td class="b"><?php echo ADM_PROTECTED_PLAYERS; ?><em class="tooltip">?<span class="classic"><?php echo ADM_PROTECTED_PLAYERS_TIP; ?></span></em></td>
                    <td><input class="fm" name="protected_players" value="<?php echo defined('PROTECTED_PLAYERS') ? htmlspecialchars(PROTECTED_PLAYERS, ENT_QUOTES, 'UTF-8') : ''; ?>" style="width: 70%;" placeholder="Shadow,Multihunter"></td>
                </tr>
                </tbody>
            </table>
        </div>
	<div class="config-actions">
		<a href="../Admin/admin.php?p=config" class="btn-back">
        ‹ <?php echo EDIT_BACK ?>
		</a>
    <button type="submit" class="btn-save">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
            <path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/>
            <polyline points="17 21 17 13 7 13 7 21"/>
        </svg><?php echo ADM_SAVE; ?></button>
</div>
    </form>
</div>