示例#1
0
 /**
  * Get all pairs as an array excluding pair with user
  * @return array $ary array of pairs
  */
 public function getFormHalveAry()
 {
     $eDb = new eDb();
     $halve = $eDb->getAllHalveNotInHele(session::getUserId());
     $ary = [];
     $ary[0] = 'Ingen halv valgt';
     foreach ($halve as $halv) {
         $ary[$halv['id']] = $halv['name'];
     }
     return $ary;
 }
示例#2
0
文件: module.php 项目: diversen/event
 public function indexAction()
 {
     if (!$this->checkAccess()) {
         return;
     }
     $eDb = new eDb();
     if (isset($_GET['all'])) {
         $rows = q::select('account')->filter('admin = ', 0)->order('username')->fetch();
         $this->displayAll($rows);
     }
     if (isset($_GET['par'])) {
         $rows = $eDb->getAllPairsFromPairs();
         $this->displayPairs($rows);
     }
     if (isset($_GET['par_loose'])) {
         $rows = $eDb->getAllPairsNotInHalve();
         $this->displayPairs($rows);
     }
     if (isset($_GET['halv'])) {
         $q = "SELECT * FROM halv WHERE confirmed = 1";
         $rows = q::query($q)->fetch();
         $this->displayHalve($rows);
     }
     if (isset($_GET['halv_loose'])) {
         $rows = $eDb->getAllHalveNotInHele(session::getUserId());
         // $rows = q::query($q)->fetch();
         $this->displayHalve($rows);
     }
     if (isset($_GET['hel'])) {
         $q = "SELECT * FROM hel WHERE confirmed = 1";
         $rows = q::query($q)->fetch();
         $this->displayHele($rows);
     }
     if (isset($_GET['reg_minus'])) {
         echo $this->message("Brugere som er importeret, men som endnu ikke har foretaget en opdatering på sitet.");
         $q = "SELECT * from account WHERE id NOT IN (select user_id from dancer) AND admin = 0 ORDER by username";
         $rows = q::query($q)->fetch();
         $this->displayAll($rows);
     }
     if (isset($_GET['uden'])) {
         echo $this->message("Brugere som er importeret og har foretaget en opdatering på sitet, men som endnu ikke har en verificeret partner.");
         $q = "SELECT * from account WHERE `admin` = 0 AND id NOT IN (SELECT user_a from pair UNION SELECT user_b from pair) AND id IN (SELECT user_id FROM dancer)";
         $rows = q::query($q)->fetch();
         $this->displayAll($rows);
     }
 }