Example #1
0
 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);
     }
 }
Example #2
0
    /**
     * Get all dancers for dropdown
     */
    public function getDancersForDropdown()
    {
        $q = <<<EOF
SELECT * FROM `account` WHERE id NOT IN 
    (SELECT user_a FROM pair UNION SELECT user_b FROM pair) AND
`admin` = 0 ORDER by username;
EOF;
        return q::query($q)->fetch();
    }