public function single_ticket($id) { if (isset($_GET['status']) && is_numeric($_GET['status'])) { if ($_GET['status'] <= 4 && $_GET['status'] >= 0) { $this->db->execute("UPDATE `tickets` SET `status`=? WHERE `id`=?", array(intval($_GET['status']), intval($_GET['id']))); $message .= $this->skin->success_box($this->lang->ticket_status_updated); } } if (isset($_POST['ticket-mail'])) { $to = new code_player(); if (!$to->get_player(intval($_POST['to']))) { $message .= $this->skin->error_box($this->lang->player_not_found); } else { if (!$_POST['body'] || !$_POST['subject']) { $message .= $this->skin->error_box($this->lang->fill_in_fields); } else { $this->core('mail_api'); $this->mail_api->send($_POST['to'], $this->player->id, $_POST['body'], $_POST['subject']); $message .= $this->skin->success_box($this->lang->mail_sent); } } } $ticket_query = $this->db->execute("SELECT `tickets`.*, `players`.`username` FROM `tickets` LEFT JOIN `players` ON `tickets`.`player_id`=`players`.`id` WHERE `tickets`.`id`=?", array(intval($id))); if ($ticket_query->numrows() == 0) { return $this->skin->error_page($this->lang->ticket_not_exist); } $ticket = $ticket_query->fetchrow(); $ticket['date'] = date("d/m/y H:i", $ticket['date']); $status_array[$ticket['status']] = " selected=\"selected\""; $ticket_display = $this->skin->single_ticket($ticket, "Uncategorized", $status_array, $message); return $ticket_display; }
/** * Groups together all the standard constructing functions. * * @param string $skin_name name of skin file to load - if left blank, loads skin_common (not recommended) * @param string $override skin override */ public function initiate($skin_name = "", $override = "") { $this->core("settings"); $this->core("cron"); $this->core("hooks"); $this->core("player"); $this->core("extra_lang"); $this->core("page_generation"); $this->skin =& $this->page_generation->make_skin($skin_name, $override); $allowed = $this->player->make_player(); if (!$allowed) { $this->page_generation->error_page($this->lang->page_not_exist); } }