if ($user->get(GETSafe("uid"))) { $user->updateSteamData(); $user->update(); if (strlen($user->avatar) == 0) { $user->avatar = Config::$webPath . "images/other.png"; } $master->Smarty->assign("steamdata", $user->getSteamData()); $master->Smarty->assign("user", $user); //Find if attending this lan $attendance = new Lan_attendees(); $attendance->user_id = $user->user_id; $attendance->lan_id = getCurrentLID(); $master->Smarty->assign("attending", $attendance->count() != 0); //Get seat if ($attendance->count() != 0) { $seat = new lan_seats(); $seat->user_id = $user->user_id; $seat->lan_id = getCurrentLID(); $seat->find(); if ($seat->fetch()) { $master->Smarty->assign("seat", $seat); } } //Find if arrived $arrivals = new Lan_arrivals(); $arrivals->user_id = $user->user_id; $arrivals->lan_id = getCurrentLID(); $master->Smarty->assign("arrived", $arrivals->count() != 0); //List attended Lans $lans = array(); $attendance = new Lan_attendees();
logMessage(getCurrentUID(), 0, "User took seat " . $seat->seat_name . " at LAN " . $lan->name . " [" . $lan->id . "]"); } } } else { $master->AddWarning("Invalid seat!"); } } else { $master->AddWarning("Invalid seat"); } } else { $master->AddWarning("You have no tickets which allow you to take a seat!"); } break; } break; case 'unsit': $seat = new lan_seats(); $seat->lan_id = getCurrentLID(); $seat->user_id = getCurrentUID(); $seat->find(); if ($seat->fetch()) { $seat->user_id = 0; $seat->update(); $master->AddWarning("Removed your seat selection."); logMessage(getCurrentUID(), 0, "User removed reservation on seat " . $seat->seat_name . " at LAN " . $lan->name . " [" . $lan->id . "]"); } else { $master->AddWarning("There was a problem removing your seat selection."); } break; } }