function _showSimulator() { for ($i = 0; $i < 14; $i++) { if (isset($_REQUEST['deff' . $i]) && is_numeric($_REQUEST['deff' . $i]) && $_REQUEST['deff' . $i] >= 0) { $deff[$i] = $_REQUEST['deff' . $i]; } else { $deff[$i] = 0; } } for ($i = 0; $i < 9; $i++) { if (isset($_REQUEST['attack' . $i]) && is_numeric($_REQUEST['attack' . $i]) && $_REQUEST['attack' . $i] >= 0) { $attack[$i] = $_REQUEST['attack' . $i]; } else { $attack[$i] = 0; } } $kristall = param_num("kristall", 0); $metall = param_num("metall", 0); $Simu = new GNSimu(); $Simu->attacking = $attack; $Simu->deffending = $deff; $Simu->mexen = $metall; $Simu->kexen = $kristall; $ticks = param_num("ticks", 1); $fleets_loaded = $_SESSION['fleets_loaded']; if ($_POST['send']) { if ($fleets_loaded) { for ($i = 0; $i < count($fleets_loaded); $i++) { if ($fleets_loaded[$i] && $_POST["deleteattfleet_" . $fleets_loaded[$i]['uid'] . "_x"]) { #echo $fleets_loaded[$i]['nick']." löschen <br>"; $attack[0] -= $fleets_loaded[$i]['jaeger']; $attack[1] -= $fleets_loaded[$i]['bomber']; $attack[2] -= $fleets_loaded[$i]['fregatten']; $attack[3] -= $fleets_loaded[$i]['zerstoerer']; $attack[4] -= $fleets_loaded[$i]['kreuzer']; $attack[5] -= $fleets_loaded[$i]['schlachter']; $attack[6] -= $fleets_loaded[$i]['traeger']; $attack[7] -= $fleets_loaded[$i]['kleptoren']; $attack[8] -= $fleets_loaded[$i]['cancris']; for ($j = 0; $j < count($attack); $j++) { if ($attack[$j] < 0) { $attack[$j] = 0; } } #element löschen und rest verschieben for ($j = $i; $j < count($fleets_loaded) - 1; $j++) { $fleets_loaded[$j] = $fleets_loaded[$j + 1]; } unset($fleets_loaded[count($fleets_loaded) - 1]); $_SESSION['fleets_loaded'] = $fleets_loaded; break; } } } if ($_POST['resetatter'] && $this->userdata) { unset($_SESSION['fleets_loaded']); unset($fleets_loaded); for ($i = 0; $i < count($attack); $i++) { $attack[$i] = 0; } } if ($_POST['loadattfleet'] && $this->userdata) { $loadattfleet = $_POST['loadattfleet']; $userfleet = user_fleet_sum($loadattfleet); $user = getUserByID($loadattfleet); #user wrong or no fleet if (!$userfleet) { $this->_header("index.php", "Userid falsch oder keine Flotte"); } #wrong attfleet, no permission if (!$this->userdata['rights']['admin'] && !$this->userdata['rights']['attorga'] && $user['aid'] != $this->userdata['aid']) { $this->_header("index.php", "Keine Rechte zum Flotte laden"); } for ($i = 0; $i < count($fleets_loaded); $i++) { if ($fleets_loaded[$i] && $fleets_loaded[$i]['uid'] == $loadattfleet) { $isloaded = $i; break; } } #bash if ($_POST['attfleetselect'] == 1) { $userfleet['kleptoren'] = 0; $userfleet['cancris'] = 0; } #bash + cleps if ($_POST['attfleetselect'] == 2) { $userfleet['cancris'] = 0; } #cleponly if ($_POST['attfleetselect'] == 3) { $userfleet['jaeger'] = 0; $userfleet['bomber'] = 0; $userfleet['fregatten'] = 0; $userfleet['zerstoerer'] = 0; $userfleet['kreuzer'] = 0; $userfleet['schlachter'] = 0; $userfleet['traeger'] = 0; $userfleet['cancris'] = 0; } #clepdeff if ($_POST['attfleetselect'] == 4) { $userfleet['jaeger'] = 0; $userfleet['bomber'] = 0; $userfleet['fregatten'] = 0; $userfleet['zerstoerer'] = 0; $userfleet['kreuzer'] = 0; $userfleet['schlachter'] = 0; $userfleet['kleptoren'] = 0; $userfleet['cancris'] = 0; } #flotte schon geladen if (isset($isloaded)) { $fleets_loaded[$isloaded]['jaeger'] += $userfleet['jaeger']; $fleets_loaded[$isloaded]['bomber'] += $userfleet['bomber']; $fleets_loaded[$isloaded]['fregatten'] += $userfleet['fregatten']; $fleets_loaded[$isloaded]['zerstoerer'] += $userfleet['zerstoerer']; $fleets_loaded[$isloaded]['kreuzer'] += $userfleet['kreuzer']; $fleets_loaded[$isloaded]['schlachter'] += $userfleet['schlachter']; $fleets_loaded[$isloaded]['traeger'] += $userfleet['traeger']; $fleets_loaded[$isloaded]['kleptoren'] += $userfleet['kleptoren']; #neu laden } else { $userfleet['fleetdate'] = formatdate("d.m.y", $userfleet['fleetdate']); $fleets_loaded[] = $userfleet; } $attack[0] += $userfleet['jaeger']; $attack[1] += $userfleet['bomber']; $attack[2] += $userfleet['fregatten']; $attack[3] += $userfleet['zerstoerer']; $attack[4] += $userfleet['kreuzer']; $attack[5] += $userfleet['schlachter']; $attack[6] += $userfleet['traeger']; $attack[7] += $userfleet['kleptoren']; $attack[8] += $userfleet['cancris']; $_SESSION['fleets_loaded'] = $fleets_loaded; } # tick laden if ($_POST['loadtick_0'] || $_POST['loadtick_1'] || $_POST['loadtick_2'] || $_POST['loadtick_3'] || $_POST['loadtick_4'] || $_POST['loadtick_5'] || $_POST['loadtick_6']) { # 2 vorticks if ($_POST['loadtick_0']) { $tickload = 0; } if ($_POST['loadtick_1']) { $tickload = 1; } #5 hauptticks if ($_POST['loadtick_2']) { $tickload = 2; } if ($_POST['loadtick_3']) { $tickload = 3; } if ($_POST['loadtick_4']) { $tickload = 4; } if ($_POST['loadtick_5']) { $tickload = 5; } if ($_POST['loadtick_6']) { $tickload = 6; } #vorticks berechnen oder laden if ($_POST['vorticks'] || $tickload < 2) { $Simu->vorticks(0); if ($_POST['vorticks'] && $tickload != 0) { $Simu->vorticks(1); } } for ($i = 2; $i < $tickload; $i++) { $Simu->Compute(0); } if ($tickload > 1) { if ($ticks == $tickload - 1) { #den letzten tick laden $Simu->Compute(1); } else { #tick laden $Simu->Compute(0); } } $attack = $Simu->attacking; $deff = $Simu->deffending; } if ($_POST['calculate']) { if ($_POST['vorticks']) { $Simu->vorticks(0); $tick[1] = $Simu->attacking; $tick[0] = $Simu->Oldatt; $tick[3] = $Simu->deffending; $tick[2] = $Simu->Olddeff; $tick['metall'] = $Simu->stolenmexen; $tick['kristall'] = $Simu->stolenkexen; $tick['name'] = "Vortick 1"; $tick['nr'] = 0; $ticklist[] = $tick; $Simu->vorticks(1); $tick[1] = $Simu->attacking; $tick[0] = $Simu->Oldatt; $tick[3] = $Simu->deffending; $tick[2] = $Simu->Olddeff; $tick['metall'] = $Simu->stolenmexen; $tick['kristall'] = $Simu->stolenkexen; $tick['name'] = "Vortick 2"; $tick['nr'] = 1; $ticklist[] = $tick; } for ($i = 0; $i < $ticks - 1; $i++) { $Simu->Compute(0); $tick[1] = $Simu->attacking; $tick[0] = $Simu->Oldatt; $tick[3] = $Simu->deffending; $tick[2] = $Simu->Olddeff; $tick['metall'] = $Simu->stolenmexen; $tick['kristall'] = $Simu->stolenkexen; $tick['name'] = "Tick " . ($i + 1); $tick['nr'] = $i + 2; $ticklist[] = $tick; } $Simu->Compute(1); $tick[1] = $Simu->attacking; $tick[0] = $Simu->Oldatt; $tick[3] = $Simu->deffending; $tick[2] = $Simu->Olddeff; $tick['metall'] = $Simu->stolenmexen; $tick['kristall'] = $Simu->stolenkexen; $tick['name'] = "Tick " . $ticks; $tick['nr'] = $ticks + 1; $ticklist[] = $tick; $this->template->assign('ticklist', $ticklist); $this->template->assign('attlost', $Simu->geslostshipsatt); $this->template->assign('defflost', $Simu->geslostshipsdeff); $ress[0][0] = $Simu->getlostmetall[0]; $ress[1][0] = $Simu->getlostmetall[1]; $ress[0][1] = $Simu->getlostkristall[0]; $ress[1][1] = $Simu->getlostkristall[1]; $ress[0][2] = $ress[0][1] + $ress[0][0]; $ress[1][2] = $ress[1][1] + $ress[1][0]; for ($i = 0; $i < 2; $i++) { for ($j = 0; $j < 3; $j++) { $ress[$i][$j] = substr_replace(strrev(chunk_split(strrev($ress[$i][$j]), 3, '.')), '', 0, 1); } } $this->template->assign('ress', $ress); $this->template->assign('metallstolen', $Simu->gesstolenexenm); $this->template->assign('kristallstolen', $Simu->gesstolenexenk); } $this->template->assign('deffsel' . $ticks, 'selected'); if ($_POST['vorticks']) { $this->template->assign('vortickssel', 'checked'); } $this->template->assign('attfleetselect' . $_POST['attfleetselect'], 'selected'); } else { $this->template->assign('deffsel1', 'selected'); $this->template->assign('attfleetselect1', 'selected'); } $this->template->assign('metall', $metall); $this->template->assign('kristall', $kristall); $this->template->assign('deff', $deff); $this->template->assign('attack', $attack); $attfleets = array(); if ($this->userdata['rights']['attorga'] == 1) { $except = array(); #for ($i=0;$i<count($fleets_loaded);$i++) { # if ($fleets_loaded[$i]) $except[] = $fleets_loaded[$i]['id']; #} $attfleets = user_get_except($except); } else { $attfleets = user_get_except($except, $this->userdata['aid']); # if ($this->userdata['fleetupdate']) { # $attfleets[] = array("id" => $this->userdata['uid'],"wert" => $this->userdata['nick']." (".$this->userdata['gala'].":".$this->userdata['pos'].")"); # } # if (!$fleets_loaded[0] && $this->userdata['fleet']) { # $attfleets[] = array("id" => $this->userdata['uid'],"wert" => $this->userdata['nick']." (".$this->userdata['gala'].":".$this->userdata['pos'].")"); # } } for ($i = 0; $i < count($attfleets); $i++) { $attfleets[$i]['id'] = $attfleets[$i]['uid']; $attfleets[$i]['wert'] = $attfleets[$i]['nick'] . " (" . $attfleets[$i]['gala'] . ":" . $attfleets[$i]['pos'] . ")"; } $this->template->assign("fleets_loaded", $fleets_loaded); $this->template->assign("attfleets", $attfleets); $this->show('simulator_form', 'Kampfsimulator'); }
function _Comment_delete() { if (!$this->userdata['rights']['news']) { $this->_header("index.php"); } $data = $_SESSION['steps']; $nid = param_num("nid"); $cid = param_num("cid"); #information message, step 2 if ($data['deletecom']) { #save step unset($data['deletecom']); $_SESSION['steps'] = $data; $this->forms['information']['url'] = $this->backtracking->backlink(); $this->forms['information']['action'] = "comments"; $this->forms['information']['title'] = "Kommentar löschen"; $this->forms['information']['message'] = "Kommentar erfolgreich gelöscht"; $this->forms['information']['style'] = "green"; $this->show('message_information', "Kommentar löschen"); } if (!$cid) { $this->_header($this->backtracking->backlink()); } $return = getNewsComment($cid); if (!$return) { $this->_header($this->backtracking->backlink()); } $newsdata = getNews($nid); if (!$newsdata) { $this->_header($this->backtracking->backlink()); } #deletecom, send if ($_REQUEST['send']) { if ($_REQUEST['yes_x']) { addToLogfile("Kommentar bei <b>" . $newsdata['title'] . "</b> gelöscht", "News", $this->userdata['uid']); deleteNewsCom($return['cid']); #save step $data['deletecom'] = 1; $_SESSION['steps'] = $data; $this->_header("index.php?action=deletecom&nid=" . $nid . "&send"); } else { $this->_header($this->backtracking->backlink()); } } else { $this->forms['information']['url'] = "index.php?nid={$nid}&cid={$cid}"; $this->forms['information']['action'] = "deletecom"; $this->forms['information']['title'] = "Kommentar löschen"; $this->forms['information']['message'] = "Kommentar löschen ? <br><br>" . formatTextData($return['content']); $this->forms['information']['style'] = "black"; $this->show('message_question', "Kommentar löschen"); } }
/** \brief IRC bot löschen Löscht einen IRC Bot */ function Bot_delete() { if (!$this->userdata['rights']['bots']) { #no permission $this->_header("", "no permission"); } $data = $_SESSION['steps']; #information message, step 2 if ($data['deletebot']) { #save step unset($data['deletebot']); $_SESSION['steps'] = $data; $name = param_str("name"); $this->forms['information']['url'] = $this->backtracking->backlink(); $this->forms['information']['title'] = "IRC Bot löschen"; $this->forms['information']['message'] = "Bot '{$name}' erfolgreich gelöscht"; $this->forms['information']['style'] = "green"; $this->show('message_information', "IRC Bot löschen"); } $id = param_num("id"); if (!$id) { $this->_header(); } $bot = bot_get($id); if (!$bot) { $this->_header(); } #deletenews, send if ($_REQUEST['send']) { if ($_REQUEST['yes_x']) { addToLogfile("Bot <b>" . $bot['name'] . "</b> gelöscht", "Bots", $this->userdata['uid']); bot_delete($id); #save step $data['deletebot'] = 1; $_SESSION['steps'] = $data; $this->_header("admin.php?action=deletebot&name=" . $bot['name'] . "&send"); } else { $this->_header(); } } else { $this->forms['information']['url'] = "admin.php?id=" . $bot['botid']; $this->forms['information']['action'] = "deletebot"; $this->forms['information']['title'] = "IRC Bot löschen"; $this->forms['information']['message'] = "Bot '<b>" . $bot['name'] . "</b>' löschen ?"; $this->forms['information']['style'] = "red"; $this->show('message_question', "IRC Bot löschen"); } }
function incoming_fleetstatus() { if (!($fsid = param_num("id")) || !($status = fleetstatus_get($fsid))) { $this->_header(); } if ($status['uid']) { $this->_header("user.php?action=fleet&id=" . $status['uid'] . "&send"); } $page = param_num("page", 1); $form = new formContainer(); $form_params = array(); $form_params[] = array("value" => $this->session['id'], "name" => $this->session['name']); $form_params[] = array("value" => "fleetstatus", "name" => "action"); $form_params[] = array("value" => $page, "name" => "page"); $form_params[] = array("value" => 1, "name" => "send"); $form_params[] = array("value" => $fsid, "name" => "id"); if ($_SESSION['steps']['fleetstatus']) { $this->template->assign("message", $_SESSION['steps']['fleetstatus']); unset($_SESSION['steps']['fleetstatus']); } switch ($page) { // daten ändern case 1: $form->add(new formInput("eta", "Verbleibene Flugzeit (ETA)", "string", true, 255, true, "'^(?:(\\d+?):(\\d+?)|(\\d+?))\$'is")); $list = array(array("title" => "Flotte 1", "value" => 1), array("title" => "Flotte 2", "value" => 2)); $form->add(new formSelectBox("fleetnum", "Flotte", "numeric", $list, false)); $form->add(new formInput("orbit", "Zeit im Orbit", "string", true, 255, true, "'^(?:(\\d+?):(\\d+?)|(\\d+?))\$'is")); if ($_POST['send']) { $form->submit(); $eta = $form->getRegex("eta"); if (strlen($eta[1])) { $eta = $eta[1] * 60 + $eta[2]; } else { $eta = $eta[3]; } if ($eta < 0) { $eta = 0; } $time = $form->getRegex("orbit"); if (strlen($time[1])) { $orbittime = $time[1] * 60 + $time[2]; } else { $orbittime = $time[3]; } if ($orbittime < 0) { $orbittime = 0; } if ($eta == 0) { $orbittime = gnticktime($orbittime); } if (!$form->hasErrors()) { if ($form->get("fleetnum") != $status['fleetnum']) { fleetstatus_change_fleetnum($status['fsid'], $form->get("fleetnum")); } fleetstatus_update($fsid, array("arrival" => gnarrival($eta), "orbittime" => $orbittime)); $_SESSION['steps']['fleetstatus'] = "Taktikdaten geändert"; $this->_header("takscreen.php?action=fleetstatus&id={$fsid}&page={$page}&send"); } } else { if ($status['arrival']) { $eta = $status['arrival'] - time(); if ($eta <= 0) { if (isset($status['orbittime'])) { $orbittime = $status['orbittime'] * 60 + $eta; } $eta = 0; } else { $orbittime = $status['orbittime'] * 60; } $form->set("eta", $this->formattime($eta)); $form->set("orbit", $this->formattime($orbittime)); } if ($status['fleetnum']) { $form->select("fleetnum", $status['fleetnum']); } } break; // scan laden // scan laden case 2: $scan = getScan(array("gala" => $status['gala'], "pos" => $status['pos'])); if ($scan['hasunit'] || $scan['hasmili']) { $scantypes = array(); if ($scan['hasmili']) { $scantypes[] = "mili"; $list = array(array("title" => "Flotte 1", "value" => 1), array("title" => "Flotte 2", "value" => 2)); $form->add(new formSelectBox("fleet", "Flotte", "numeric", $list, false)); } if ($scan['hasunit']) { $scantypes[] = "unit"; } $form->add(new formRadio("scan", "Scan laden", "string", $scantypes)); if ($_POST['send']) { $form->submit(); if (!$form->hasErrors()) { if ($form->get("scan") == "unit") { // unit laden $updatefleetdata = fleet_get($scan['unit_fid']); $updatefleetdata['svs'] = $scan['unit_svs']; $updatefleetdata['prec'] = $scan['unit_prec']; $updatefleetdata['fleetnum'] = $status['fleetnum']; $message = "Einheitenscan"; } else { // mili laden $updatefleetdata = miliscan_fleet_get_bykoords($scan['gala'], $scan['pos'], $form->get("fleet")); $updatefleetdata['svs'] = $scan['mili_svs']; $updatefleetdata['prec'] = $scan['mili_prec']; $updatefleetdata['fleetnum'] = $form->get("fleet"); $message = "Militärscan Flotte " . $form->get("fleet"); } if ($form->get("fleetnum") != $updatefleetdata['fleetnum']) { fleetstatus_change_fleetnum($status['fsid'], $updatefleetdata["fleetnum"]); } fleetstatus_update_fleet($fsid, $updatefleetdata, $updatefleetdata['svs'], $updatefleetdata['prec']); $_SESSION['steps']['fleetstatus'] = $message . " wurde geladen"; $this->_header("takscreen.php?action=fleetstatus&id={$fsid}&page=2&send"); } } else { $form->select("scan", $scantypes[0]); if ($scan['hasmili']) { $form->select("fleet", $status['fleetnum']); } } $this->template->assign("scan", scan_format($scan)); } break; // manuelle flotteneingabe // manuelle flotteneingabe case 3: $checkfleet = array("jaeger" => "Jäger", "bomber" => "Bomber", "fregatten" => "Fregatten", "zerstoerer" => "Zerstörer", "kreuzer" => "Kreuzer", "schlachter" => "Schlachter", "traeger" => "Träger", "kleptoren" => "Kleptoren", "cancris" => "Cancris", "prec" => "Scangenauigkeit", "svs" => "Scanverstärker"); foreach ($checkfleet as $key => $value) { $form->add(new formInput($key, $value, "numeric")); } if ($_POST['send']) { $form->submit(); if (!$form->hasErrors()) { $updatefleetdata = array(); foreach ($checkfleet as $key => $value) { $updatefleetdata[$key] = $form->get($key); } fleetstatus_update_fleet($fsid, $updatefleetdata, $updatefleetdata['svs'], $updatefleetdata['prec']); $_SESSION['steps']['fleetstatus'] = "Flottendaten gespeichert"; $this->_header("takscreen.php?action=fleetstatus&id={$fsid}&page=3&send"); } } else { foreach ($checkfleet as $key => $value) { $form->set($key, $status[$key]); } } break; case 4: $form->add(new formInput("code", "Text", "string")); if ($_POST['send']) { $form->submit(); if (!$form->hasErrors()) { $result = parseWurstFleet($form->get("code")); if ($result !== false) { fleetstatus_update_fleet($fsid, $result, "0", "100"); $_SESSION['steps']['fleetstatus'] = "Flottendaten gespeichert"; $this->_header("takscreen.php?action=fleetstatus&id={$fsid}&page=4&send"); } else { $form->addError("Fehler beim Parsen"); $form->setError("code"); } } } } $form->registerVars($this->template); // baue manuelles flottenupdate formular if ($page == 3) { $formitems = array(); foreach ($checkfleet as $key => $value) { $formitems[] = array("value" => $form->smartyitems[$key]['value'], "title" => $form->smartyitems[$key]['title'], "name" => $key, "class" => $form->smartyitems[$key]['class']); } $this->template->assign("fleetupdateform", $formitems); } $this->template->assign(array("status" => $status, "page" => $page, "form_params" => $form_params)); $this->show('takscreen_fleetstatus', "Flottendaten"); }
function Attack_delete() { if ($_SESSION['steps']['deleteattack']) { unset($_SESSION['steps']['deleteattack']); $this->forms['information']['action'] = ""; $this->forms['information']['url'] = "attplan.php"; $this->forms['information']['title'] = "Plan gelöscht"; $this->forms['information']['message'] = "Plan wurde gelöscht"; $this->forms['information']['style'] = "green"; $this->show('message_information', "Angriffsplan löschen"); } $attid = param_num("id"); if (!$attid) { $this->_header(); } $attplan = attack_get($attid); if (empty($attplan)) { $this->_header(); } //rightcheck if ($this->userdata['uid'] != $attplan['owner'] && !$this->_checkUserRights("attorga")) { $this->_header(); } if ($_POST['send']) { if ($_POST['yes_x']) { attack_delete($attid); $_SESSION['steps']['deleteattack'] = 1; $this->_header("attplan.php?action=delete"); } $this->_header(); } else { $this->forms['information']['url'] = "attplan.php?id={$attid}"; $this->forms['information']['action'] = "delete"; $this->forms['information']['title'] = "Angriffsplan löschen"; $this->forms['information']['message'] = "\n <b>'" . $attplan['title'] . "'</b> komplett löschen ?"; $this->forms['information']['style'] = "red"; $this->show('message_question', "Angriffsplan löschen"); } }
function showUserDetails() { $id = param_num("id"); if (!$id) { $this->_header($this->backtracking->backlink()); } $return = getUserByID($id); if (!$return) { $this->_header($this->backtracking->backlink()); } $this->forms['userdetails']['registerdate'] = $return['registerdate']; $this->forms['userdetails']['nickname'] = $return['nick']; $this->forms['userdetails']['allyname'] = $return['name']; $this->forms['userdetails']['allytag'] = $return['tag']; if ($return['emailvisible']) { $this->forms['userdetails']['email'] = $return['email']; } $this->forms['userdetails']['koords'] = $return['gala'] . ":" . $return['pos']; if ($return['usertitle']) { $this->forms['userdetails']['usertitle'] = $return['usertitle']; } if ($return['phone']) { $this->forms['userdetails']['phone'] = $return['phone']; } $this->show('user_details', "Benutzerdetails"); }
function _listScans($option) { $gala = param_num("gala"); $pos = param_num("pos"); #scandetails if ($gala && $pos) { $this->scan_details($gala, $pos); } #scanlist $page = param_num("page", 1); $rows = 20; $link_options = array(); if ($option == "targets") { $scanlistfilter =& $_SESSION['targetlistfilter']; $this->template->assign("showtargets", 1); $this->template->assign("scantitle", "Ziele suchen"); #zielsuche if ($_REQUEST['subaction'] == 'newsearch' && $scanlistfilter) { unset($_SESSION['targetlistfilter']); unset($scanlistfilter); } /* if ($_REQUEST['subaction'] == "search") { $scanlistfilter['exen'] = param_num("exen"); $scanlistfilter['punkte'] = param_num("punkte"); } */ if (!$scanlistfilter || $_POST['subaction'] == "search") { $form = new formContainer(); $form->add(new formInput("exen", "Exenmindestanzahl", "numeric", true, 10, true)); $form->add(new formInput("macht", "Machtmindestwert", "numeric", true, 10, true)); $form->add(new formCheckbox("hideold", "Alte Scans nicht berücksichtigen", "numeric", array(1), false)); if ($_POST['send']) { $form->submit(); if (!$form->hasErrors()) { if ($form->get("macht")) { $scanlistfilter['macht'] = $form->get("macht"); } if ($form->get("exen")) { $scanlistfilter['exen'] = $form->get("exen"); } $scanlistfilter['sort'] = "exen"; $scanlistfilter['order'] = "desc"; $scanlistfilter['hassektor'] = "1"; $scanlistfilter['hideold'] = $form->get("hideold"); $scanlistfilter['except_galas'] = getGalaList(true); $this->_header("scans.php?action=targets&send"); } } else { $form->select("hideold", 1); } $form->registerVars($this->template); $this->show('scan_target_form', 'Ziele suchen'); } #sortierung if ($_REQUEST['sort'] && $_REQUEST['order'] && $scanlistfilter) { $sort = trim($_REQUEST['sort']); $order = trim($_REQUEST['order']); if ($sort != 'koords' && $sort != 'exen') { $sort = 'koords'; } if ($order != "asc" && $order != "desc") { $order = "asc"; } $scanlistfilter['sort'] = $sort; $scanlistfilter['order'] = $order; } $link_options[] = "action=targets"; $link2 = "?action=targets"; #normale Scananzeige, galaweise } else { $scanlistfilter =& $_SESSION['scanlistfilter']; $this->template->assign("scantitle", "Scans"); if (!$scanlistfilter) { $scanlistfilter['gala'] = 1; $scanlistfilter['sort'] = "koords"; $scanlistfilter['order'] = "asc"; $scanlistfilter['hideold'] = 1; } #alte einblenden/ausblenden if (isset($_REQUEST["hideold"]) && is_numeric($_REQUEST["hideold"])) { $scanlistfilter['hideold'] = $_REQUEST["hideold"]; } $hideold = $scanlistfilter["hideold"]; if ($hideold) { $title = "Alle Anzeigen"; $subtitle = "Zeigt alle Scans an"; $param = 0; } else { $title = "Alte Ausblenden"; $subtitle = "Scans die älter als 1 Tag sind werden nicht angezeigt"; $param = 1; } $this->template->assign("hideoldtitle", $title); $this->template->assign("hideoldparam", $param); $this->template->assign("hideoldsubtitle", $subtitle); #neue gala anzeigen if ($gala = param_num("gala")) { $scanlistfilter['gala'] = $gala; } else { $gala = $scanlistfilter["gala"]; } if ($this->userdata["gid"] == 1) { $hideblock = false; } else { $hideblock = true; } $next = getNextGala($gala, $hideold, $hideblock); $prev = getPrevGala($gala, $hideold, $hideblock); if ($next && $prev) { #gala suche anzeigen $this->template->assign("showform", 1); } #zeigen beide auf die selbe, -> die aktuelle if ($next == $prev && $next == $gala) { unset($prev); unset($next); } $this->template->assign("prev", $prev); $this->template->assign("next", $next); #sortierung if ($_REQUEST['sort'] && $_REQUEST['order'] && $scanlistfilter) { $sort = trim($_REQUEST['sort']); $order = trim($_REQUEST['order']); if ($sort != 'koords' && $sort != 'exen') { $sort = 'koords'; } if ($order != "asc" && $order != "desc") { $order = "asc"; } $scanlistfilter['sort'] = $sort; $scanlistfilter['order'] = $order; } $link_options[] = "gala=" . $scanlistfilter['gala']; } #mili & news ausklappen $expand = param_num("expand"); #scans holen $this->forms['scanlist'][$scanlistfilter['sort']][$scanlistfilter['order']] = '_active'; $scanlist = listScans($scanlistfilter, &$pages, &$page, $rows); for ($i = 0; $i < count($scanlist); $i++) { $scanlist[$i]['backlink'] = "&backlink=" . urlencode("scans.php?" . join("&", $link_options) . "#" . $scanlist[$i]['sid']); $scanlist[$i]['expand_backlink'] = "&backlink=" . urlencode("scans.php?" . join("&", $link_options) . "&expand=" . $scanlist[$i]['sid'] . "#" . $scanlist[$i]['sid']); #mili oder news ausklappen if ($scanlist[$i]['sid'] == $expand) { $scanlist[$i]['expand'] = 1; } if ($scanlist[$i]['uid']) { if ($scanlist[$i]['uid'] == $this->userdata['uid']) { $scanlist[$i]['atter_class'] = "green"; } else { $scanlist[$i]['atter_class'] = "red"; } } $scanlist[$i] = scan_format($scanlist[$i]); } $this->forms['scanlist']['pages'] = showPageBar($page, $pages, "scans.php" . $link2, "page", "menu"); $this->forms['scanlist']['gala'] = $scanlistfilter['gala']; $this->template->assign('scanlist', $scanlist); $this->template->assign('page', $page); $this->show('scan_list', 'Scans'); }