Example #1
0
    $action = $_POST['action'];
} else {
    if (isset($_GET['action']) && $_GET['action'] != "") {
        $action = $_GET['action'];
    } else {
        $action = "";
    }
}
// Incoming makieren
if (isset($_GET['need_planet']) && isset($_GET['need_galaxie'])) {
    LogAction($_GET['need_galaxie'] . ":" . $_GET['need_planet'] . " -> Unsafe", LOG_SETSAFE);
    tic_mysql_query("UPDATE `gn4flottenbewegungen` SET save='0' WHERE verteidiger_galaxie='" . $_GET['need_galaxie'] . "' AND verteidiger_planet='" . $_GET['need_planet'] . "'") or die(tic_mysql_error(__FILE__, __LINE__));
}
if (isset($_GET['needno_planet']) && isset($_GET['needno_galaxie'])) {
    LogAction($_GET['needno_galaxie'] . ":" . $_GET['needno_planet'] . " -> Safe", LOG_SETSAFE);
    tic_mysql_query("UPDATE `gn4flottenbewegungen` SET save='1' WHERE verteidiger_galaxie='" . $_GET['needno_galaxie'] . "' AND verteidiger_planet='" . $_GET['needno_planet'] . "'") or die(tic_mysql_error(__FILE__, __LINE__));
}
if (isset($irc_log)) {
    if ($irc_log) {
        include 'irc-scans.inc.php';
    }
}
// Funktion einbinden
if ($action != "") {
    include "./function." . $action . ".php";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" dir="ltr">
	<head>
		<title>TIC - <?php 
 }
 echo '</Table><br>';
 // Neuer Attplaner anlegen
 if ($Benutzer['rang'] >= $Rang_VizeAdmiral) {
     echo '<center> <table border="" cellspacing="0" cellpadding="0"><TR>';
     echo '<TD bgcolor="#6490BB">';
     echo '<form name="newattplaner" method="post" action="./main.php">';
     echo '<INPUT TYPE="hidden" NAME="action" VALUE="attplaneradmin">';
     echo '<INPUT TYPE="hidden" NAME="fkt"    VALUE="newattplaner">';
     echo '<INPUT TYPE="hidden" NAME="modul"  VALUE="attplaneradmin">';
     $SQL2 = "select * from gn4accounts where Attplaner = 0 and ticid = " . $Meta . " AND allianz=" . $Ally . " order by galaxie,planet;";
     if ($Benutzer['rang'] > $Rang_Techniker) {
         $SQL2 = "select * from gn4accounts order by galaxie, planet;";
     }
     //
     $SQL2_Result = tic_mysql_query($SQL2) or die(tic_mysql_error(__FILE__, __LINE__));
     $SQL2_Num = mysql_num_rows($SQL2_Result);
     echo '<b>Neuer ATT-Planer bestimmen: <select name="id">';
     for ($i2 = 0; $i2 < $SQL2_Num; $i2++) {
         echo '<option value="' . mysql_result($SQL2_Result, $i2, 'id') . '">';
         echo mysql_result($SQL2_Result, $i2, 'galaxie') . ':' . mysql_result($SQL2_Result, $i2, 'planet') . ' ' . mysql_result($SQL2_Result, $i2, 'name') . ' - ' . $RangName[mysql_result($SQL2_Result, $i2, 'rang')];
         echo '</option>';
     }
     echo '</select>';
     echo '</TD></TR>';
     echo '<TR><TD bgcolor="#6490BB"><center>';
     echo '<b>Berechtigung: <select name="attplaner">';
     for ($i2 = 1; $i2 < 4; $i2++) {
         echo '<option value="' . $i2 . '">' . $PlanerTyps[$i2] . '</option>';
     }
     echo '</select>';
Example #3
0
function GetAllianzName($id)
{
    global $SQL_DBConn;
    $SQL = 'SELECT * FROM `gn4accounts` WHERE id ="' . $id . '";';
    $SQL_Result = tic_mysql_query($SQL) or die(tic_mysql_error(__FILE__, __LINE__));
    $SQL_Num = mysql_num_rows($SQL_Result);
    if ($SQL_Num == 0) {
        return '';
    } else {
        $SQL = 'SELECT * FROM `gn4allianzen` WHERE ticid =' . mysql_result($SQL_Result, 0, "ticid") . ';';
        $SQL_Result = tic_mysql_query($SQL) or die(tic_mysql_error(__FILE__, __LINE__));
        $SQL_Num = mysql_num_rows($SQL_Result);
        if ($SQL_Num == 0) {
            return '';
        } else {
            return mysql_result($SQL_Result, 0, "tag");
        }
    }
}
Example #4
0
         $start = 0;
     }
     $SQL_Result = tic_mysql_query("SELECT name, accid, rang, allianz, zeit, aktion, ip FROM gn4log WHERE" . $SQL_where . " AND type='" . $_GET['type'] . "' ORDER BY id DESC LIMIT " . $start . "," . LOG_PER_PAGE) or die(tic_mysql_error(__FILE__, __LINE__));
     echo "<div style=\"font-size:9pt;font-weight:bold;\">T.I.C Log - " . $typetostring[$_GET['type']] . "</div><table class=\"datatable\" align=\"center\"><tr class=\"datatablehead\"><th>Zeit</th><th>Meta</th><th>Benutzer</th><th>Meldung</th><th>IP</th></tr>";
     $i = 0;
     while ($row = mysql_fetch_assoc($SQL_Result)) {
         echo "<tr class=\"fieldnormal" . $style[$i % 2] . "\">\n\t\t\t\t\t\t<td>" . $row['zeit'] . "</td>\n\t\t\t\t\t\t<td>" . (isset($AllianzInfo[$row['allianz']]['metaname']) ? $AllianzInfo[$row['allianz']]['metaname'] : "") . "</td><td>" . (isset($RangImage[$row['rang']]) ? "<img src=\"" . $RangImage[$row['rang']] . "\" alt=\"" . $RangName[$row['rang']] . "\" width=\"20\" height=\"20\" />" : $row['rang']) . "<a href=\"?modul=anzeigen&amp;id=" . $row['accid'] . "\">" . (isset($AllianzTag[$row['allianz']]) ? "[" . $AllianzTag[$row['allianz']] . "]" : "") . $row['name'] . "</a></td><td>" . $row['aktion'] . "</td><td>" . $row['ip'] . "</td></tr>";
         $i++;
     }
     if ($i == 0) {
         echo "<tr class=\"fieldnormallight\"><td colspan=\"4\">Es sind keine Logeinträge fr diesen Typ vorhanden.</td></tr>";
     }
     echo "<tr><td colspan=\"4\">Seite: " . constructPageIndex("?modul=log&amp;type=" . $_GET['type'], $start, $count[0], LOG_PER_PAGE) . "</td></tr>\n";
     echo "</table>[<a href=\"?modul=log\">Zurück</a>]";
 } else {
     $SQL_Result = tic_mysql_query("SELECT type, COUNT(type) FROM gn4log WHERE" . $SQL_where . " GROUP BY type") or die(tic_mysql_error(__FILE__, __LINE__));
     while ($row = mysql_fetch_row($SQL_Result)) {
         $count[$row[0]] = $row[1];
     }
     $i = 0;
     echo "<table cellpadding=\"5\" align=\"center\"><tr><th colspan=\"3\">T.I.C Log</th></tr>";
     foreach ($typetostring as $type => $string) {
         if ($i == 0) {
             echo "<tr>";
         }
         $i++;
         echo "<td><a href=\"?modul=log&amp;type=" . $type . "\"><img src=\"bilder/icons/folder.gif\" alt=\"\" border=\"0\" /> " . $string . "(" . (isset($count[$type]) ? $count[$type] : "0") . ")</a></td>";
         if ($i == 3) {
             echo "</tr>";
             $i = 0;
         }
<?php

if (!isset($_GET['fbid'])) {
    echo 'internal parameter-error #1';
    return;
}
if (!isset($_GET['incsave'])) {
    echo 'internal parameter-error #2';
    return;
}
$SQL_Result = tic_mysql_query("SELECT verteidiger_galaxie, verteidiger_planet FROM `gn4flottenbewegungen` WHERE id ='" . $_GET['fbid'] . "'") or die(tic_mysql_error(__FILE__, __LINE__));
if (!($row = mysql_fetch_row($SQL_Result))) {
    return;
}
if ($_GET['incsave'] == 1) {
    $newsave = 0;
    LogAction($row[0] . ":" . $row[1] . " -> Safe", LOG_SETSAFE);
} else {
    $newsave = 1;
    LogAction($row[0] . ":" . $row[1] . " -> Unsafe", LOG_SETSAFE);
}
tic_mysql_query("UPDATE `gn4flottenbewegungen` SET save='" . $newsave . "' WHERE id='" . $_GET['fbid'] . "'") or die(tic_mysql_error(__FILE__, __LINE__));
Example #6
0
<?php

$SQL_Result = tic_mysql_query('SELECT * FROM `gn4vars` ORDER BY id;');
for ($n = 0; $n < mysql_num_rows($SQL_Result); $n++) {
    $var = mysql_result($SQL_Result, $n, 'name');
    ${$var} = mysql_result($SQL_Result, $n, 'value');
}
$SQL_Result = tic_mysql_query("SELECT * FROM gn4meta WHERE id = '" . $Benutzer['ticid'] . "'") or die(tic_mysql_error(__FILE__, __LINE__));
$MetaInfo = mysql_fetch_assoc($SQL_Result);
// Allianzen
$SQL_Result = tic_mysql_query("SELECT a.*, b.name as metaname FROM `gn4allianzen` as a LEFT JOIN gn4meta as b ON(a.ticid = b.id) ORDER BY tag;", $SQL_DBConn) or $error_code = 4;
$SQL_Num = mysql_num_rows($SQL_Result);
if ($SQL_Num == 0) {
    $error_code = 12;
} else {
    for ($n = 0; $n < $SQL_Num; $n++) {
        $AllianzName[mysql_result($SQL_Result, $n, 'id')] = mysql_result($SQL_Result, $n, 'name');
        $AllianzTag[mysql_result($SQL_Result, $n, 'id')] = mysql_result($SQL_Result, $n, 'tag');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['name'] = mysql_result($SQL_Result, $n, 'name');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['tag'] = mysql_result($SQL_Result, $n, 'tag');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['meta'] = mysql_result($SQL_Result, $n, 'ticid');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['metaname'] = mysql_result($SQL_Result, $n, 'metaname');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['info_bnds'] = mysql_result($SQL_Result, $n, 'info_bnds');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['info_naps'] = mysql_result($SQL_Result, $n, 'info_naps');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['info_inoffizielle_naps'] = mysql_result($SQL_Result, $n, 'info_inoffizielle_naps');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['info_kriege'] = mysql_result($SQL_Result, $n, 'info_kriege');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['code'] = mysql_result($SQL_Result, $n, 'code');
        $AllianzInfo[mysql_result($SQL_Result, $n, 'id')]['blind'] = mysql_result($SQL_Result, $n, 'blind');
    }
}
$tick_abzug = intval(date('i') / $Ticks['lange']);
Example #7
0
                $planet_id = $data[$time - 604800]['planet' . ($y + 1)];
                $sql_insert[$time] = $data[$time - 604800];
            } else {
                $planet_id = 0;
            }
        }
        echo "<select style=\"font-size:8pt;\" name=\"nextnachtwache[" . $time . "][" . $y . "]\">";
        foreach ($gala_member as $planet => $name) {
            if (strlen($name) > 13) {
                $name = substr($name, 0, 10) . "...";
            }
            echo "<option value=\"" . $planet . "\"" . ($planet == $planet_id ? " selected=\"selected\"" : "") . ">" . ($planet != 0 ? $planet . ": " : "") . $name . "</option>";
        }
        echo "</select>";
        echo "</td>";
    }
    $time += $NW_intervall;
    echo "</tr>";
}
echo "  <tr class=\"datatablefoot\"><td colspan=\"8\"><input type=\"submit\" value=\"Speichern\" /></td></tr>\n          </table>\n          </form></td></tr></table>";
foreach ($sql_insert as $time => $data) {
    $sqlquery1 = array();
    $sqlquery2 = array();
    for ($i = 1; $i <= 7; $i++) {
        $sqlquery1[] = "planet" . $i;
        $sqlquery2[] = $data['planet' + $i];
    }
    tic_mysql_query("INSERT INTO gn4nachtwache (time, ticid, gala, " . implode(", ", $sqlquery1) . ") VALUES('" . injsafe($time) . "', '" . $Benutzer['ticid'] . "', '" . injsafe($selected_gala) . "', '" . implode("', '", $sqlquery2) . "')") or die(tic_mysql_error(__FILE__, __LINE__));
}
?>
<!-- ENDE: inc_NWshow -->
Example #8
0
<?php

if (!isset($_GET['auto'])) {
    if (!isset($NW_intervall)) {
        $NW_intervall = 120;
    }
    if (!isset($NW_start)) {
        $NW_start = 22 * 60;
    }
    if (!isset($NW_stop)) {
        $NW_stop = 12 * 60;
    }
    if ($NW_stop < $NW_start) {
        $NW_stop += 24 * 60;
    }
    $today = date("w");
    if (date("H") * 60 + date("i") < $NW_stop) {
        $today--;
    }
    if ($today < 1) {
        $today = 7 + $today;
    }
    $time = time() - ($today - 1) * 86400;
    tic_mysql_query("UPDATE gn4nachtwache SET done" . $today . "='1' WHERE ticid = '" . $Benutzer['ticid'] . "' AND gala='" . $Benutzer['galaxie'] . "' AND planet" . $today . " = '" . $Benutzer['planet'] . "' AND " . $time . " >= time AND " . ($time - $NW_intervall * 60) . " <= time") or die(tic_mysql_error(__FILE__, __LINE__));
    tic_mysql_query("DELETE FROM gn4nachtwache WHERE time < " . (time() - 1209600)) or die(tic_mysql_error(__FILE__, __LINE__));
}
Example #9
0
}
?>
            </select>
            </td>
            </tr>
            <tr class="datatablefoot">
             <td colspan="2" align="center"><input type="submit" value="Erstellen" /></td>
            </tr>
        </table>
    </form>

<?php 
echo '<table>';
echo '<tr class="datatablehead" align="center"><td>Benutzer Verwaltung</td></tr>';
$sql = "SELECT gn4allianzen.id, gn4allianzen.tag, gn4meta.name as meta FROM gn4allianzen LEFT JOIN gn4meta ON(gn4allianzen.ticid = gn4meta.id) ORDER BY gn4allianzen.tag;";
$SQL_result = tic_mysql_query($sql) or print tic_mysql_error();
$allianzahl = mysql_num_rows($SQL_result);
echo '<tr><td class="fieldnormallight"><table cellspacing="3">';
if ($allianzahl > 0) {
    for ($n = 0; $n < $allianzahl; $n++) {
        $allid = mysql_result($SQL_result, $n, 'id');
        echo '<tr>';
        echo '<td>' . mysql_result($SQL_result, $n, 'meta') . '</td>';
        echo '<td>' . mysql_result($SQL_result, $n, 'tag') . '</td>';
        $sql2 = "SELECT DISTINCT(galaxie) FROM gn4accounts WHERE allianz='" . $allid . "' ORDER BY galaxie DESC";
        $SQL_result2 = tic_mysql_query($sql2, $SQL_DBConn);
        $galanzahl = mysql_num_rows($SQL_result2);
        $galanum = mysql_num_rows($SQL_result2);
        if ($galanzahl != '') {
            for ($p = 0; $p < $galanzahl; $p++) {
                $SQL_result2 = tic_mysql_query($sql2, $SQL_DBConn);
Example #10
0
        } else {
            $out_online_names .= "&lt;i&gt;keiner&lt;/i&gt;&lt;br /&gt;";
        }
        $out_allis .= "\t\t<td align=\"center\" width=\"75\" onmouseover=\"return overlib('&lt;b&gt;" . $AllianzInfo[$alliid]['name'] . "&lt;/b&gt;');\" onmouseout=\"return nd();\">&nbsp;" . ($incs_offen > 0 ? "<span class=textincopen>" : "") . $AllianzInfo[$alliid]['tag'] . ($incs_offen > 0 ? "</span>" : "") . "&nbsp;</td>\n";
        $out_incs .= "\t\t<td align=\"center\" onmouseover=\"return overlib('" . $tt_incs . "');\" onmouseout=\"return nd();\">&nbsp;<a href=\"./main.php?modul=taktikbildschirm&amp;mode=1&amp;metanr=" . $metaid . "\"><span class=\"textinc" . ($incs_offen > 0 ? "open" : "none") . "\">" . $incs_offen . "</span> / <span class=\"textinc" . ($incs_overtime > 0 ? "overtime" : "none") . "\">" . $incs_overtime . "</span> / <span class=\"textinc" . ($incs_safe > 0 ? "safe" : "none") . "\">" . $incs_safe . "</span></a>&nbsp;</td>\n";
        $out_online .= "\t\t<td align=\"center\" onmouseover=\"return overlib('" . $out_online_names . "');\" onmouseout=\"return nd();\">&nbsp;" . mysql_num_rows($SQL_Result_alli_user_online) . " / " . mysql_result($SQL_Result_alli_user, 0, 'count(*)') . "&nbsp;</td>\n";
        mysql_free_result($SQL_Result_alli_user);
        mysql_free_result($SQL_Result_alli_user_online);
    }
    mysql_free_result($SQL_Result_Alli);
} else {
    $out_allis = "\t\t<th align=\"right\">&nbsp;Meta:&nbsp;</th>\n";
    $out_incs = "\t\t<th align=\"right\">&nbsp;Incomings:&nbsp;</th>\n";
    $out_online = "\t\t<th align=\"right\">&nbsp;Online:&nbsp;</th>\n";
    $SQL_Query = "SELECT name as value, id as ticid FROM `gn4meta` ORDER BY name;";
    $SQL_Result_Metas = tic_mysql_query($SQL_Query) or die(tic_mysql_error(__FILE__, __LINE__));
    $manzahl = mysql_num_rows($SQL_Result_Metas);
    $tsec = $Ticks['lange'] * 60;
    $time_now = (int) (time() / $tsec) * $tsec;
    for ($b = 0; $b < $manzahl; $b++) {
        $mname = mysql_result($SQL_Result_Metas, $b, 'value');
        $mticid = mysql_result($SQL_Result_Metas, $b, 'ticid');
        $incs_offen = 0;
        $incs_overtime = 0;
        $incs_safe = 0;
        $SQL_Query = "SELECT ankunft, save FROM gn4accounts as a LEFT JOIN gn4flottenbewegungen as b ON(a.galaxie = b.verteidiger_galaxie AND a.ticid = b.ticid) WHERE modus = 1 AND a.ticid = " . $mticid . " GROUP BY b.id;";
        $SQL_Result_alli_inc_fleets = tic_mysql_query($SQL_Query) or $error_code = 42;
        while ($inc = mysql_fetch_assoc($SQL_Result_alli_inc_fleets)) {
            if ($inc['save'] != 0) {
                if ($inc['ankunft'] - $time_now > $tsec * 12) {
                    $incs_offen++;
Example #11
0
function GetScans_irc($SQL_DBConn, $galaxie, $planet)
{
    global $irc_text, $irc_farbe, $irc_listfarbe, $farbe;
    $scan_type[0] = 'S';
    $scan_type[1] = 'E';
    $scan_type[2] = 'M';
    $scan_type[3] = 'G';
    $scan_type[4] = 'N';
    $datumx = date('d.m.Y');
    $SQL_Result = tic_mysql_query('SELECT * FROM `gn4scans` WHERE rg="' . $galaxie . '" AND rp="' . $planet . '" ORDER BY type;') or die(tic_mysql_error(__FILE__, __LINE__));
    //echo "Scan: ".'SELECT * FROM `gn4scans` WHERE rg="'.$galaxie.'" AND rp="'.$planet.'" ORDER BY type;<br />';
    $SQL_Num = mysql_num_rows($SQL_Result);
    if ($SQL_Num == 0) {
        return '[-]';
    } else {
        $tmp_result = '[';
        for ($n = 0; $n < $SQL_Num; $n++) {
            if ($datumx == substr(mysql_result($SQL_Result, $n, 'zeit'), -10)) {
                $fc1 = "";
                $fc2 = "";
            } else {
                $fc1 = $irc_text['farbe'] . "04";
                $fc2 = $irc_text['farbe'] . $irc_farbe['schwarz'] . $irc_listfarbe[$farbe];
            }
            $tmp_result = $tmp_result . $fc1 . $scan_type[mysql_result($SQL_Result, $n, 'type')] . $fc2;
        }
        $tmp_result = $tmp_result . ']';
        //    echo "Scan=>$tmp_result<br />";
        return $tmp_result;
    }
    return null;
}