} foreach ($_GET as $key => $value) { $_GET[$key] = misc::clean($value); } $alliance = new alliance(); $status = $alliance->get('id', $_SESSION[$shortTitle . 'User']['alliance']); switch ($_GET['action']) { case 'get': if ($_SESSION[$shortTitle . 'User']['alliance']) { if ($status == 'done') { $alliance->getAll(); } else { $message = $ui[$status]; } } else { $invitations = alliance::getInvitations('user', $_SESSION[$shortTitle . 'User']['id']); } break; case 'set': $nodes = node::getList($_SESSION[$shortTitle . 'User']['id']); $nodeList = ''; foreach ($nodes as $node) { $nodeList .= '<option value="' . $node->data['id'] . '">' . $node->data['name'] . '</option>'; } if ($status == 'done' && isset($_POST['nodeId'], $_POST['name'])) { if ($_POST['name'] != '') { if ($alliance->data['user'] == $_SESSION[$shortTitle . 'User']['id']) { $node = new node(); $status = $node->get('id', $_POST['nodeId']); if ($status == 'done') { if ($node->data['user'] == $_SESSION[$shortTitle . 'User']['id']) {
public function getAll() { $this->getMembers(); $this->invitations = alliance::getInvitations('alliance', $this->data['id']); $this->getWars(); }