예제 #1
0
 /**
  \brief Galaxie hinzugügen
 
  Fügt eine Galaxie hinzu
 */
 function Galaxy_edit()
 {
     $page = param_num("page", 1);
     $data = $_SESSION['steps'];
     $id = param_num("id");
     if ($id) {
         $return = getGala($id);
     }
     if (!$return) {
         $this->_header("", "ungültige id");
     }
     #check rights
     $rank = $this->userdata['rights']['editgala']['rank'];
     if (!$rank || $rank > 1 && $return['aid'] != $this->userdata['aid'] || $rank > 2 && $return['gala'] != $this->userdata['gala']) {
         #no permission
         $this->_header("", "no permission");
     }
     #information message, step 2
     if ($data['editgala']) {
         #save step
         unset($data['editgala']);
         $_SESSION['steps'] = $data;
         $this->forms['information']['url'] = $this->backtracking->backlink();
         $this->forms['information']['title'] = "Galaxie bearbeiten";
         $this->forms['information']['message'] = "Galaxie <b>" . $return['gala'] . "</b> bearbeitet";
         $this->forms['information']['style'] = "green";
         $this->show('message_information', "Galaxie bearbeitet");
     }
     if ($rank > 1) {
         #allianz
         $this->template->assign("ally", $this->userdata['tag']);
     } else {
         $allylist = getAllyList();
     }
     $this->template->assign("rank", $rank);
     #formular send
     if ($_REQUEST['send']) {
         $gala = param_num("gala");
         $errors = false;
         #check if empty
         if (!$gala) {
             $errors[] = "Galaxie darf nicht leer sein!";
             $items['gala']['class'] = '_error';
         }
         if (!$errors && $return['gala'] != $gala && getGala($gala)) {
             $errors[] = "Galaxie existiert bereits!";
             $items['gala']['class'] = '_error';
         }
         if ($rank == 1) {
             $allyid = param_num("allyid", true);
             if ($allyid) {
                 for ($i = 0; $i < count($allylist); $i++) {
                     if ($allylist[$i]['aid'] == $allyid) {
                         $ally =& $allylist[$i];
                         $ally['selected'] = "selected";
                         break;
                     }
                 }
             }
             if (!$ally) {
                 $this->_header("", "Ungültige oder fehlende Allyid");
             }
         } else {
             $allyid = $this->userdata['aid'];
         }
         if (!$errors) {
             #save step
             $data['editgala'] = 1;
             $_SESSION['steps'] = $data;
             updateGala($id, $gala, $allyid);
             addToLogfile("Galaxie " . $gala . " bearbeitet", "Admin", $this->userdata['uid']);
             $this->_header("admin.php?action=editgala&id=" . $gala . "&send");
         } else {
             $items['gala']['value'] = $gala;
             $this->template->assign("errors", $errors);
         }
     } else {
         $items['gala']['value'] = $return['gala'];
         for ($i = 0; $i < count($allylist); $i++) {
             if ($allylist[$i]['aid'] == $return['aid']) {
                 $ally =& $allylist[$i];
                 $ally['selected'] = "selected";
                 break;
             }
         }
     }
     $this->template->assign("items", $items);
     $this->template->assign("id", $id);
     $this->template->assign("allylist", $allylist);
     $this->show('gala_edit', "Galaxie bearbeiten");
 }
예제 #2
0
 function _Member_list()
 {
     $page = param_num("page", 1);
     $rows = 12;
     $filter = $_SESSION['memberfilter'];
     if (!$filter) {
         $filter['sort'] = "koords";
         $filter['order'] = "asc";
         $filter['page'] = 1;
         $_SESSION['memberfilter'] = $filter;
     }
     if ($_REQUEST['sort'] && $_REQUEST['order']) {
         $filter['sort'] = $_REQUEST['sort'];
         $filter['order'] = $_REQUEST['order'];
         $_SESSION['memberfilter'] = $filter;
     }
     if ($_POST['send']) {
         if ($_POST['ally'] && is_numeric($_POST['ally']) && getAlly($_POST['ally'])) {
             $filter['ally'] = $_POST['ally'];
         } else {
             unset($filter['ally']);
         }
         $_SESSION['memberfilter'] = $filter;
     }
     $sort[$filter['sort']][$filter['order']] = '_active';
     $allylist = getAllyList();
     if ($filter['ally']) {
         for ($i = 0; $i < count($allylist); $i++) {
             if ($allylist[$i]['aid'] == $filter['ally']) {
                 $allylist[$i]['selected'] = "selected";
                 break;
             }
         }
     } else {
         $this->template->assign("ally0", "selected");
     }
     $userlist = listUser($filter, &$pages, &$page, $rows);
     $this->template->assign("pages", showPageBar($page, $pages, "index.php?action=members", "page", "menu"));
     $setback = "index.php?action=members&page=" . $page . "&" . $this->session['link'];
     $_SESSION['setback'] = $setback;
     $this->template->assign("sort", $sort);
     $this->template->assign('userlist', $userlist);
     $this->template->assign('allylist', $allylist);
     $this->show('member_list', 'Memberliste');
 }
예제 #3
0
 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");
 }