コード例 #1
0
ファイル: takscreen.class.php プロジェクト: Bobsel/gn-tic
 function Incoming_list()
 {
     $filter =& $_SESSION['incfilter'];
     if (!$filter) {
         $filter['sort'] = "koords";
         $filter['order'] = "asc";
     }
     if ($_REQUEST['sort'] && $_REQUEST['order']) {
         $filter['sort'] = $_REQUEST['sort'];
         $filter['order'] = $_REQUEST['order'];
     }
     $filter['page'] = param_num("page", 1);
     $allylist = getAllyList();
     $formlist = array();
     $formlist[] = array("title" => "Allianz", "value" => 0);
     foreach ($allylist as $ally) {
         $formlist[] = array("title" => "[" . $ally['tag'] . "] " . $ally['name'], "value" => $ally['aid']);
     }
     $form = new formContainer();
     $form->add(new formSelectBox("ally", "Allianz", "numeric", $formlist, false));
     $form->add(new formCheckBox("safe", "Safestatus", "numeric", 1, false));
     $form->add(new formCheckBox("undertime", "unter der Deffzeit", "numeric", 1, false));
     if ($_POST['send']) {
         $form->submit(array("ally", "safe", "undertime"));
         $ally = $form->get("ally");
         $filter['undertime'] = $form->get("undertime");
         $filter['safe'] = $form->get("safe");
         if ($ally && !getAlly($ally)) {
             unset($ally);
         }
         if ($ally) {
             $galalist = getGalaListByAlly($ally, true);
         } else {
             $galalist = getGalaList(true);
         }
         if ($filter['ally'] != $ally) {
             $gala = 0;
         } else {
             $gala = $_POST['gala'];
         }
         $galaitems = array(array("title" => "Galaxie", "value" => 0));
         $selectedgala = 0;
         foreach ($galalist as $item) {
             $galaitem = array("title" => $item, "value" => $item);
             if ($item == $gala) {
                 $galaitem['selected'] = "selected";
                 $selectedgala = $gala;
             }
             $galaitems[] = $galaitem;
         }
         $filter['gala'] = $selectedgala;
         $filter['ally'] = $ally;
     } else {
         if ($filter['ally']) {
             $form->select("ally", $filter['ally']);
             $galalist = getGalaListByAlly($filter['ally'], true);
         } else {
             $galalist = getGalaList(true);
         }
         if ($filter['undertime']) {
             $form->select("undertime", 1);
         }
         if ($filter['safe']) {
             $form->select("safe", 1);
         }
         $galaitems = array(array("title" => "Galaxie", "value" => 0));
         $selectedgala = 0;
         foreach ($galalist as $item) {
             $galaitem = array("title" => $item, "value" => $item);
             if ($filter['gala'] == $item) {
                 $galaitem['selected'] = "selected";
                 $selectedgala = $filter['gala'];
             }
             $galaitems[] = $galaitem;
         }
         $filter['gala'] = $selectedgala;
     }
     $this->template->assign("galalist", $galaitems);
     $sort[$filter['sort']][$filter['order']] = '_active';
     $list = inc_list($filter, &$pages, &$filter['page'], 10, $this->userdata);
     for ($i = 0; $i < count($list); $i++) {
         $canrecallall = 0;
         $_incs = inc_list_byuser($list[$i]['gala'], $list[$i]['pos']);
         foreach ($_incs as $inc) {
             if ($inc['arrival']) {
                 if ($inc['unixeta'] < 0) {
                     $inc['orbit'] = true;
                     $inc['orbittime'] = $this->formattime($inc['unixeta'] + $inc['orbittime'] * 60, true);
                     $inc['eta'] = 0;
                 } else {
                     $inc['eta'] = $this->formattime($inc['unixeta'], true);
                     $inc['orbittime'] = $this->formattime($inc['orbittime'] * 60, true);
                 }
             } else {
                 $inc['eta'] = "n/a";
             }
             if (strlen($inc['nick']) > 20) {
                 $inc['nick'] = substr($nick['nick'], 0, 20) . "..";
             }
             $inc['canrecall'] = 1;
             if ($inc['status'] == 1) {
                 // atter
                 $list[$i]['atterlist'][] = $inc;
             } else {
                 // deffer
                 if (!$inc['uid'] || $inc['aid'] == $this->userdata['aid']) {
                     $inc['canedit'] = 1;
                 }
                 $list[$i]['defferlist'][] = $inc;
             }
             $list[$i]['canrecallall'] = $canrecallall;
             $list[$i]['cansetsave'] = 1;
             $list[$i]['backlink'] = urlencode("takscreen.php#" . $list[$i]['uid']);
         }
         /*      $list[$i]['atterlist'] = atter_list($list[$i]['incid']);
               $list[$i]['defferlist'] = deffer_list($list[$i]['incid']);
               for($j=0;$j < count($list[$i]['atterlist']);$j++){
                 $atter = &$list[$i]['atterlist'][$j];
         
                 if ($atter['unixeta'] < 0) {
                   $atter['orbit'] = $atter['unixeta']+75*60;
                   if ($atter['orbit'] < 0) $atter['orbit'] = 0;
                   $atter['orbit'] = $this->formattime($atter['orbit'],true);
                   $atter['unixeta'] = 0;
                 }
                 $atter['eta'] = $this->formattime($atter['unixeta'],true);
                 if(strlen($atter['inickname']) > 20){
                   $atter['inickname'] = substr($atter['inickname'],0,20)."..";
                 }
         #        if ($atter['ogala'] == $this->userdata['gala']) {
                   $canrecallall=1;
         #        }
               }
               for($j=0;$j < count($list[$i]['defferlist']);$j++){
                 $deffer = &$list[$i]['defferlist'][$j];
                 if ($deffer['unixeta'] < 0) {
                   $deffer['orbit'] = $deffer['unixeta']+$deffer['ticks']*15*60;
                   if ($deffer['orbit'] < 0) $deffer['orbit'] = 0;
                   $deffer['orbit'] = $this->formattime($deffer['orbit'],true);
                   $deffer['unixeta'] = 0;
                 }
                 $deffer['eta'] = $this->formattime($deffer['unixeta'],true);
                 if($deffer['isextern']) {
                   $deffer['nick'] = $deffer['enickname'];
                   $deffer['gala'] = $deffer['egala'];
                   $deffer['pos'] = $deffer['epos'];
                 }
                 if($deffer['aid'] == $this->userdata['aid']) {
                   $deffer['canupdatefleet'] = 1;
                 }
                 if(strlen($deffer['nick']) > 15){
                   $deffer['nick'] = substr($deffer['nick'],0,15)."..";
                 }
         
         #        if ($deffer['uid'] == $this->userdata['uid'] ||
         #        $deffer['ogala'] == $this->userdata['gala']) {
                   $deffer['canrecall'] = 1;
         #        }
               }
         #      if ($list[$i]['gala'] == $this->userdata['gala']) {
         #      }
               $list[$i]['backlink'] = urlencode("takscreen.php#".$list[$i]['incid']);
               */
     }
     $form->registerVars($this->template);
     $this->template->assign("pages", showPageBar($filter['page'], $pages, "takscreen.php?", "page", "menu"));
     $this->template->assign("allylist", $allylist);
     $this->template->assign("sort", $sort);
     $this->template->assign("list", $list);
     $this->show('takscreen_index', "Taktikschirm");
 }
コード例 #2
0
ファイル: scans.class.php プロジェクト: Bobsel/gn-tic
 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');
 }