예제 #1
0
     $sold->user_id = $attendees->user_id;
     $sold->find();
     $soldlists = array();
     while ($sold->fetch()) {
         $g = new Lan_addons_groups();
         $g->get($sold->addon_id);
         $soldlists[] = $g->name;
         if (getCurrentUID() == $sold->user_id && 0 == strcmp($g->allowSeating, '1')) {
             $state = "hasticket";
         }
     }
     $attendees->tickets = $soldlists;
     $seat = new Lan_seats();
     $seat->lan_id = getCurrentLID();
     $seat->user_id = $attendees->user_id;
     $success = $seat->find();
     $success = false;
     while ($seat->fetch()) {
         $success = true;
         if (0 == strcmp($seat->seat_name, "") || $seat->seat_name == null) {
             $attendees->seat = $seat->id;
         } else {
             $attendees->seat = $seat->seat_name;
         }
     }
     if (!$success) {
         $attendees->seat = "";
     }
     $attendeeslist[] = clone $attendees;
 }
 $master->Smarty->assign("users", $attendeeslist);
예제 #2
0
파일: rpc.php 프로젝트: Kayomani/Obsidian
<?php

require_once 'core/core.php';
require_once 'libs/jsonwrapper/jsonwrapper.php';
if (isset($_GET["t"])) {
    switch ($_GET["t"]) {
        case "seatlist":
            if (isset($_GET["lan"])) {
                $seats = new Lan_seats();
                $seats->lan_id = $seats->escape($_GET["lan"]);
                $seats->find();
                $seatlist = array();
                while ($seats->fetch()) {
                    $seatlist[] = clone $seats;
                }
                echo json_encode($seatlist);
            }
            break;
        case "addseat":
            if (isset($_GET["lan"])) {
                //return;
                $seats = new Lan_seats();
                $seats->lan_id = $seats->escape($_GET["lan"]);
                $seats->x = 20;
                $seats->y = 20;
                $seats->seat_name = "";
                $seats->type = 0;
                $seats->insert();
            }
            break;
        case "getusers":
예제 #3
0
            } else {
                $lan = new Lan_events();
                $success = $lan->get(getCurrentLID());
                if ($success) {
                    $attendees = new Lan_attendees();
                    $attendees->lan_id = getCurrentLID();
                    $attendees->user_id = getCurrentUID();
                    if ($attendees->count() == 0) {
                        $master->Smarty->assign("message", "Oddly enough your already not signed up to this event!");
                        break;
                    } else {
                        $attendees->delete();
                        $master->Smarty->assign("message", "Removed your sign up!");
                        logMessage(getCurrentUID(), 0, "User is no longer attending LAN " . $lan->name . " [" . $lan->id . "]");
                        //check if they have any seats for this lan, if so remove them.
                        $seat = new Lan_seats();
                        $seat->user_id = getCurrentUID();
                        $seat->lan_id = getCurrentLID();
                        if ($seat->find()) {
                            $seat->delete();
                        }
                        break;
                    }
                } else {
                    $master->Smarty->assign("message", "Unknown LAN selected.");
                    break;
                }
            }
            break;
    }
}
예제 #4
0
파일: seats.php 프로젝트: Kayomani/Obsidian
            $allowSeating = false;
            $tickets = new Lan_addons_sold();
            $tickets->user_id = getCurrentUID();
            $tickets->lan_id = getCurrentLID();
            $ticktypes = new Lan_addons_groups();
            $tickets->joinAdd($ticktypes, "LEFT");
            $tickets->selectAs($ticktypes, 'type_%s');
            $tickets->find();
            $a = array();
            while ($tickets->fetch()) {
                if (0 == strcmp($tickets->type_allowSeating, '1')) {
                    $allowSeating = true;
                }
            }
            if ($allowSeating) {
                $master->Smarty->assign("state", "noseat");
            }
        } else {
            $master->Smarty->assign("state", "seated");
            $exseat->find();
            $exseat->fetch();
            $seatname = $exseat->seat_name;
            if (strlen($seatname) == 0) {
                $seatname = $exseat->id;
            }
            $master->Smarty->assign("seatid", $seatname);
        }
    }
} else {
    $master->AddError("Could not find LAN info!");
}