Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**************************************************
- * File: statuscenter.php
- * Author: Tankey 'Reno' - Delta Commanders
- * Version: 1.3 STABLE -- build: 132
- * Website: http://www.deltacommanders.com
- * License: Creative Commons Attribution-NonCommerical ShareAlike 3.0
- * http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
- **************************************************/
- // Include the MyBB Framework files to let this page work properly
- define("IN_MYBB", 1);
- require_once "./global.php";
- $title = "Status Center";
- add_breadcrumb($lang->sub_statuscenter, "statuscenter");
- global $headerinclude, $header, $theme, $footer;
- // Generate the page load time - header settings
- $time = microtime();
- $time = explode(' ', $time);
- $time = $time[1] + $time[0];
- $start = $time;
- // Get the user ID for further reference.
- $user_check = $mybb->user['uid'];
- $user = get_user($user_check);
- // List of all Admin Functions used in the file's home screen.
- if(($mybb->user['usergroup'] == 8) || ($mybb->user['usergroup'] == 4))
- {
- $admin_end_user_notif = '<br /><b><center>Admin Functions:</b> <a href="http://deltacommanders.com/forum/hier.php?submit_notification=true&user='.$user_check.'" title="Submit new notification as \''.$user['username'].'\'">1. Submit new notification</a></center><center><a href="http://deltacommanders.com/forum/hier.php?show_subscribers=true" title="Display all Subscribers">2. Display Subscribers</a></center>';
- $admin_end_user_update = '<br /><b><center>Admin Functions:</b> <a href="http://deltacommanders.com/forum/hier.php?submit_update=true&status='.$_GET['status'].'&id='.$_GET['id'].'&user='.$user_check.'" title="Submit new update as \''.$user['username'].'\'">1. Submit new update</a></center>';
- }
- // Header of the home page.
- $template = '
- <html>
- <head>
- <title>'.$title.'</title>
- {$headerinclude}
- <link rel="stylesheet" type="text/css" href="http://www.deltacommanders.com/forum/css/status_center.css">
- </head>
- <body>
- {$header}
- ';
- // Information section holder
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td class="thead" colspan="2">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['status_info'].'.gif" id="status_info_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Delta Commanders - Status Center</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['status_info'].'" id="status_info_e">
- <tr>
- <td class="row1" width="90%" valign="top" rowspan="5"><span class="smalltext">The information on this page is an overview of all by Delta Commanders known outages, disruptions and maintenances (both current and recently resolved). To submit a still unknown failure you can contact us on <a href="mailto:admin@deltacommanders.com" title="admin@deltacommanders.com">admin@deltacommanders.com</a>.<br /><br />To stay updated about the statusses of Delta Commanders you can use our RSS function to receive new updates when available.<br />We already like to notify you already about the <b>SMS-alert function</b> which will be included soon to get real-time updates!</span></td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Resolved"></span> Resolved</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Disruption"></span> Disruption</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Outage"></span> Outage</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Information"></span> Information</td>
- </tr>
- </tbody>
- </table>
- <br />
- <br />';
- // End of Information section holder
- // Outstanding Notifications section holder
- $template .= '
- <table border="0" cellspacing="1" cellpadding="3" width="100%">
- <tr>
- <td width="50%" valign="top">
- <table border="0" cellspacing="1" cellpadding="3" width="100%">
- <thead>
- <tr>
- <td colspan="2" class="thead">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['status_current'].'.gif" id="status_current_img" class="expander" alt="[-]" title="[-]" /></div>
- <font size="2.4"><b>Outstanding Notifications</b></font>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['status_current'].'" id="status_current_e">';
- $get_items_current = $db->query("SELECT *
- FROM `".TABLE_PREFIX."statuscenter_items`
- WHERE `item_status` IN (1,2)
- ORDER BY `latest_update` DESC");
- $count_items_current = $db->num_rows($get_items_current);
- if($count_items_current > 0)
- {
- while ($itemlvl = $db->fetch_array($get_items_current))
- {
- $item_id = intval($itemlvl['id']);
- $item_summary = $itemlvl['item_summary'];
- $item_prefix_raw = intval($itemlvl['item_prefix']);
- $item_add_query = $db->query("SELECT
- `update_parent`,
- `update_date` AS `latest_update`,
- update_status
- FROM `".TABLE_PREFIX."statuscenter_updates`
- WHERE update_parent = ".$item_id."
- ORDER BY `update_date` DESC LIMIT 1");
- $item_additional = $db->fetch_array($item_add_query);
- $item_status_raw = intval($item_additional['update_status']);
- $item_date_raw = intval($itemlvl['item_date']);
- $item_update_raw = intval($item_additional['latest_update']);
- if($item_status_raw == 1)
- {
- $item_status = "Outage";
- }
- elseif($item_status_raw == 2)
- {
- $item_status = "Disruption";
- }
- elseif($item_status_raw == 3)
- {
- $item_status = "Resolved";
- }
- elseif($item_status_raw == 4)
- {
- $item_status = "Information";
- }
- else
- {
- $item_status = "";
- }
- if($item_prefix_raw == 1)
- {
- $item_prefix = "[Forum]";
- }
- elseif($item_prefix_raw == 2)
- {
- $item_prefix = "[Website]";
- }
- elseif($item_prefix_raw == 3)
- {
- $item_prefix = "[Gameserver]";
- }
- elseif($item_prefix_raw == 4)
- {
- $item_prefix = "[Voiceserver]";
- }
- elseif($item_prefix_raw == 5)
- {
- $item_prefix = "[Update]";
- }
- elseif($item_prefix_raw == 6)
- {
- $item_prefix = "[Release]";
- }
- else
- {
- $item_prefix = "";
- }
- $item_created = date('d-m-Y',$item_date_raw);
- $item_updated = date('d-m-Y H:i',$item_update_raw);
- $template .= '<tr>
- <td>
- <a href="?showupdates=true&status='.$item_status.'&id='.$item_id.'" class="issue '.$item_status.'" title="Show details">
- <span class="status"></span>
- <span class="created">'.$item_created.':</span>
- <span class="title">'.$item_prefix.' '.$item_summary.'</span>
- <span class="updated"><span>Latest update:</span><br />'.$item_updated.'</span>
- <span class="description"><span>Status:</span> '.$item_status.'</span>
- </a>
- </td>
- </tr>';
- }
- }
- else
- {
- $template .= '<tr align="center"><td><b>--> There are no outstanding notifications at the moment. <--</b></td></tr>';
- }
- $template .= '</tbody></table></td>';
- // End of Outstanding Notifications
- // Latest Updates section holder
- $template .= '
- <td valign="top" width="50%">
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
- <thead>
- <tr>
- <td colspan="2" class="thead">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['status_updates'].'.gif" id="status_updates_img" class="expander" alt="[-]" title="[-]" /></div>
- <font size="2.4"><b>Latest Updates</b></font>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['status_updates'].'" id="status_updates_e">';
- $get_items_updates = $db->query("SELECT *
- FROM `".TABLE_PREFIX."statuscenter_items`
- WHERE `item_status` = 4
- ORDER BY `latest_update` DESC
- LIMIT 3");
- $count_items_updates = $db->num_rows($get_items_updates);
- if($count_items_updates > 0)
- {
- while ($itemlvl = $db->fetch_array($get_items_updates))
- {
- $item_id = intval($itemlvl['id']);
- $item_summary = $itemlvl['item_summary'];
- $item_prefix_raw = intval($itemlvl['item_prefix']);
- $item_add_query = $db->query("SELECT
- `update_parent`,
- `update_date` AS `latest_update`,
- update_status
- FROM `".TABLE_PREFIX."statuscenter_updates`
- WHERE update_parent = ".$item_id."
- ORDER BY `update_date` DESC LIMIT 1");
- $item_additional = $db->fetch_array($item_add_query);
- $item_status_raw = intval($item_additional['update_status']);
- $item_date_raw = intval($itemlvl['item_date']);
- $item_update_raw = intval($item_additional['latest_update']);
- if($item_status_raw == 1)
- {
- $item_status = "Outage";
- }
- elseif($item_status_raw == 2)
- {
- $item_status = "Disruption";
- }
- elseif($item_status_raw == 3)
- {
- $item_status = "Resolved";
- }
- elseif($item_status_raw == 4)
- {
- $item_status = "Information";
- }
- else
- {
- $item_status = "";
- }
- if($item_prefix_raw == 1)
- {
- $item_prefix = "[Forum]";
- }
- elseif($item_prefix_raw == 2)
- {
- $item_prefix = "[Website]";
- }
- elseif($item_prefix_raw == 3)
- {
- $item_prefix = "[Gameserver]";
- }
- elseif($item_prefix_raw == 4)
- {
- $item_prefix = "[Voiceserver]";
- }
- elseif($item_prefix_raw == 5)
- {
- $item_prefix = "[Update]";
- }
- elseif($item_prefix_raw == 6)
- {
- $item_prefix = "[Release]";
- }
- else
- {
- $item_prefix = "";
- }
- $item_created = date('d-m-Y',$item_date_raw);
- $item_updated = date('d-m-Y H:i',$item_update_raw);
- $template .= '<tr>
- <td>
- <a href="?showupdates=true&status='.$item_status.'&id='.$item_id.'" class="issue '.$item_status.'" title="Show details">
- <span class="status"></span>
- <span class="created">'.$item_created.':</span>
- <span class="title">'.$item_prefix.' '.$item_summary.'</span>
- <span class="updated"><span>Latest update:</span><br />'.$item_updated.'</span>
- <span class="description"><span>Status:</span> '.$item_status.'</span>
- </a>
- </td>
- </tr>';
- }
- }
- else
- {
- $template .= '<tr align="center"><td><b>--> There is no information to be displayed. <--</b></td></tr>';
- }
- $template .= '</tbody></table></td></tr></table>';
- // End of Latest Updates
- // Recently Solved Notifications section holder
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td colspan="2" class="thead">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['status_recently'].'.gif" id="status_recently_img" class="expander" alt="[-]" title="[-]" /></div>
- <font size="2.4"><b>Recently Resolved Notifications <font size="0.5">(7 days log)</font> -- <a href="?displaylogs=true" title="View all logs">*View all logs*</a></font>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['status_recently'].'" id="status_recently_e">';
- $get_items_recently = $db->query("SELECT u.*, uf.update_date
- FROM `".TABLE_PREFIX."statuscenter_items` AS u
- LEFT JOIN `".TABLE_PREFIX."statuscenter_updates` AS uf
- ON u.id = uf.update_parent
- WHERE u.`item_status` = 3
- AND uf.update_status = 3
- AND FROM_UNIXTIME(u.`latest_update`) >= DATE_SUB(CURRENT_TIMESTAMP,INTERVAL 7 DAY)
- ORDER BY uf.`update_date` DESC
- LIMIT 15");
- $count_items_recently = $db->num_rows($get_items_recently);
- if($count_items_recently > 0)
- {
- while ($itemlvl = $db->fetch_array($get_items_recently))
- {
- $item_id = intval($itemlvl['id']);
- $item_summary = $itemlvl['item_summary'];
- $item_prefix_raw = intval($itemlvl['item_prefix']);
- $item_add_query = $db->query("SELECT
- `update_parent`,
- `update_date` AS `latest_update`,
- update_status
- FROM `".TABLE_PREFIX."statuscenter_updates`
- WHERE update_parent = ".$item_id."
- ORDER BY `update_date` DESC LIMIT 1");
- $item_additional = $db->fetch_array($item_add_query);
- $item_status_raw = intval($item_additional['update_status']);
- $item_date_raw = intval($itemlvl['item_date']);
- $item_update_raw = intval($item_additional['latest_update']);
- if($item_status_raw == 1)
- {
- $item_status = "Outage";
- }
- elseif($item_status_raw == 2)
- {
- $item_status = "Disruption";
- }
- elseif($item_status_raw == 3)
- {
- $item_status = "Resolved";
- }
- elseif($item_status_raw == 4)
- {
- $item_status = "Information";
- }
- else
- {
- $item_status = "";
- }
- if($item_prefix_raw == 1)
- {
- $item_prefix = "[Forum]";
- }
- elseif($item_prefix_raw == 2)
- {
- $item_prefix = "[Website]";
- }
- elseif($item_prefix_raw == 3)
- {
- $item_prefix = "[Gameserver]";
- }
- elseif($item_prefix_raw == 4)
- {
- $item_prefix = "[Voiceserver]";
- }
- elseif($item_prefix_raw == 5)
- {
- $item_prefix = "[Update]";
- }
- elseif($item_prefix_raw == 6)
- {
- $item_prefix = "[Release]";
- }
- else
- {
- $item_prefix = "";
- }
- $item_created = date('d-m-Y',$item_date_raw);
- $item_updated = date('d-m-Y H:i',$item_update_raw);
- $template .= '<tr>
- <td>
- <a href="?showupdates=true&status='.$item_status.'&id='.$item_id.'" class="issue '.$item_status.'" title="Show details">
- <span class="status"></span>
- <span class="created">'.$item_created.':</span>
- <span class="title">'.$item_prefix.' '.$item_summary.'</span>
- <span class="updated"><span>Latest update:</span><br />'.$item_updated.'</span>
- <span class="description"><span>Status:</span> '.$item_status.'</span>
- </a>
- </td>
- </tr>';
- }
- }
- else
- {
- $template .= '<tr align="center"><td><b>--> There is no information to be displayed. <--</b></td></tr>';
- }
- if($mybb->user['uid'])
- {
- $get_signup_user = $db->query("SELECT email FROM `".TABLE_PREFIX."statuscenter_signup` WHERE `uid` = $user_check");
- $count_signup_user = $db->num_rows($get_signup_user);
- if ($count_signup_user == 0)
- {
- $user_end_notif = '<br /><b><center>User Functions:</b> <a href="http://deltacommanders.com/forum/hier.php?email_subscription=true&action=subscribe" title="Subscribe as \''.$user['username'].'\'" onclick="return confirm(\'Are you sure you want to subscribe for new notifications?\');">1. Subscribe for notifications (Email)</a></center>';
- }
- elseif ($count_signup_user > 0)
- {
- $user_end_notif = '<br /><b><center>User Functions:</b> <a href="http://deltacommanders.com/forum/hier.php?email_subscription=true&action=unsubscribe" title="Unsubscribe as \''.$user['username'].'\'" onclick="return confirm(\'Are you sure you want to unsubscribe for new notifications?\');">1. Unsubscribe for notifications (Email)</a></center>';
- }
- }
- $template .= '</tbody></table>
- '.$admin_end_user_notif.'
- '.$user_end_notif;
- // End of Recently Solved Notifications
- // Check if user used signup for email
- if(isset($_GET['email_subscription'], $_GET['action']))
- {
- if($_GET['email_subscription'] == "true")
- {
- $get_signup_user_b = $db->query("SELECT email FROM `".TABLE_PREFIX."statuscenter_signup` WHERE `uid` = $user_check");
- $count_signup_user_b = $db->num_rows($get_signup_user_b);
- if (($count_signup_user == 0) && ($_GET['action'] == "subscribe"))
- {
- $get_email_from_main = $db->query("SELECT email FROM `".TABLE_PREFIX."users` WHERE `uid` = $user_check");
- $get_email = $get_email_from_main->fetch_assoc();
- $email = $get_email['email'];
- $user_check = $mybb->user['uid'];
- $db->insert_query('statuscenter_signup', array(
- 'uid' => (int) $user_check,
- 'email' => $email
- ));
- $page = 'hier.php';
- header('Location: '.$page, true, 303);
- exit;
- }
- elseif (($count_signup_user > 0) && ($_GET['action'] == "unsubscribe"))
- {
- $user_check = $mybb->user['uid'];
- $db->query("DELETE FROM `".TABLE_PREFIX."statuscenter_signup` WHERE `uid` = $user_check");
- $db->query("OPTIMIZE TABLE `".TABLE_PREFIX."statuscenter_signup`");
- $page = 'hier.php';
- header('Location: '.$page, true, 303);
- exit;
- }
- }
- }
- // End :)
- // The form for submitting a new notification
- if(isset($_POST['submit_notif']))
- {
- $notification_title = nl2br(str_replace("'", "\'", $_POST["item_title"]));
- $notification_summary = nl2br(str_replace("'", "\'", $_POST["item_summary"]));
- $notification_prefix = $_POST["item_prefix"];
- $notification_status = $_POST["item_status"];
- $notification_byuid = $user_check;
- $notification_time = time();
- $db->insert_query('statuscenter_items', array(
- 'item_summary' => $notification_title,
- 'item_prefix' => (int) $notification_prefix,
- 'item_status' => (int) $notification_status,
- 'item_date' => (int) $notification_time,
- 'latest_update' => (int) $notification_time,
- 'by_uid' => (int) $notification_byuid
- ));
- $get_parent_id = $db->query("SELECT id FROM `".TABLE_PREFIX."statuscenter_items` WHERE `item_date` = '$notification_time'");
- $pid = $get_parent_id->fetch_assoc();
- $notification_parent = $pid['id'];
- $db->insert_query('statuscenter_updates', array(
- 'update_summary' => $notification_summary,
- 'update_parent' => (int) $notification_parent,
- 'update_status' => (int) $notification_status,
- 'update_date' => (int) $notification_time,
- 'update_first' => (int) 1,
- 'by_uid' => (int) $notification_byuid
- ));
- $get_subscribers = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_signup`");
- while ($sublvl = $db->fetch_array($get_subscribers))
- {
- $sub_id = intval($sublvl['uid']);
- $sub_raw = get_user($sub_id);
- $sub_username = $sub_raw['username'];
- $sub_mail = $sublvl['email'];
- if($notification_status == 1)
- {
- $item_status = "Outage";
- }
- elseif($notification_status == 2)
- {
- $item_status = "Disruption";
- }
- elseif($notification_status == 3)
- {
- $item_status = "Resolved";
- }
- elseif($notification_status == 4)
- {
- $item_status = "Information";
- }
- else
- {
- $item_status = "";
- }
- if($notification_prefix == 1)
- {
- $item_prefix = "[Forum]";
- }
- elseif($notification_prefix == 2)
- {
- $item_prefix = "[Website]";
- }
- elseif($notification_prefix == 3)
- {
- $item_prefix = "[Gameserver]";
- }
- elseif($notification_prefix == 4)
- {
- $item_prefix = "[Voiceserver]";
- }
- elseif($notification_prefix == 5)
- {
- $item_prefix = "[Update]";
- }
- elseif($notification_prefix == 6)
- {
- $item_prefix = "[Release]";
- }
- else
- {
- $item_prefix = "";
- }
- //Mail includings
- $subject = $item_prefix . " " . $notification_title;
- $message = 'Dear '.$sub_username.',';
- $message .= '<br />';
- $message .= '<br />';
- $message .= 'You have subscribed to the Status Center System by Delta Commanders and therefore you receive this message.';
- $message .= '<br />';
- $message .= 'If you don\'t want to receive any mails from our system anymore, then you can unsubscribe <a href="http://deltacommanders.com/forum/hier.php?email_subscription=true&action=unsubscribe">here</a>.';
- $message .= '<br />';
- $message .= '<br />';
- $message .= '------------------> <strong>'.$subject.'</strong> *'.$item_status.'* <------------------';
- $message .= '<br />';
- $message .= '<br />';
- $message .= stripslashes($notification_summary);
- $message .= '<br />';
- $message .= '<br />';
- $message .= '--------------------------------------------------------------------';
- $message .= '<br />';
- $message .= '<br />';
- $message .= 'Thanks for your subscription. You can view the full message on our website: <a href="http://www.deltacommanders.com/forum/hier.php?showupdates=true&status='.$item_status.'&id='.$notification_parent.'">http://www.deltacommanders.com/forum/hier.php?showupdates=true&status='.$item_status.'&id='.$notification_parent.'</a>';
- $message .= '<br />';
- $message .= 'If you want to check out all updates and notifications please go to <a href="http://www.deltacommanders.com/forum/hier.php">http://www.deltacommanders.com/forum/hier.php</a>';
- $message .= '<br />';
- $message .= '<br />';
- $message .= 'If you have any questions left about this issue, please do not hesitate to contact us so we can give additional support to fit your needs.';
- $message .= '<br />';
- $message .= '<br />';
- $message .= 'Kindest regards,';
- $message .= '<br />';
- $message .= 'Delta Commanders Staff';
- $headers .= "From: Status Center - Delta Commanders <support@deltacommanders.com>\r\n";
- $headers .= "Reply-To: support@deltacommanders.com\r\n";
- $headers .= "MIME-Version: 1.0\r\n";
- $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
- $headers .= "X-Priority: 1\r\n";
- $headers .= "Priority: Urgent\r\n";
- $headers .= "Importance: High\r\n";
- $headers .= "X-MSMail-Priority: High\r\n";
- mail($sub_mail, $subject, $message, $headers);
- }
- $page = 'hier.php';
- header('Location: '.$page, true, 303);
- exit;
- }
- if(isset($_POST['submit_update']))
- {
- $update_summary = nl2br(str_replace("'", "\'", $_POST["update_summary"]));
- $update_status = $_POST["update_status"];
- $update_parent = $_POST["parent_id"];
- $update_time = time();
- $update_byuid = $user_check;
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_updates`
- SET `update_latest` = '0'
- WHERE `update_parent` = $update_parent'");
- $db->insert_query('statuscenter_updates', array(
- 'update_summary' => $update_summary,
- 'update_parent' => (int) $update_parent,
- 'update_status' => (int) $update_status,
- 'update_date' => (int) $update_time,
- 'by_uid' => (int) $update_byuid
- ));
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_items`
- SET `latest_update` = '$update_time'
- WHERE `id` = '$update_parent'");
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_items`
- SET `item_status` = '$update_status'
- WHERE `id` = '$update_parent'");
- $get_parent_info = $db->query("SELECT id,item_summary, item_prefix FROM `".TABLE_PREFIX."statuscenter_items` WHERE `id` = '$update_parent'");
- $iid = $get_parent_info->fetch_assoc();
- $parent_name = $iid['item_summary'];
- $parent_prefix = $iid['item_prefix'];
- $parent_status = $iid['item_status'];
- $parent_id = $iid['id'];
- $get_subscribers = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_signup`");
- while ($sublvl = $db->fetch_array($get_subscribers))
- {
- $sub_id = intval($sublvl['uid']);
- $sub_raw = get_user($sub_id);
- $sub_username = $sub_raw['username'];
- $sub_mail = $sublvl['email'];
- if($update_status == 1)
- {
- $item_status = "Outage";
- }
- elseif($update_status == 2)
- {
- $item_status = "Disruption";
- }
- elseif($update_status == 3)
- {
- $item_status = "Resolved";
- }
- elseif($update_status == 4)
- {
- $item_status = "Information";
- }
- else
- {
- $item_status = "";
- }
- if($parent_status == 1)
- {
- $item_status_p = "Outage";
- }
- elseif($parent_status == 2)
- {
- $item_status_p = "Disruption";
- }
- elseif($parent_status == 3)
- {
- $item_status_p = "Resolved";
- }
- elseif($parent_status == 4)
- {
- $item_status_p = "Information";
- }
- else
- {
- $item_status_p = "";
- }
- if($parent_prefix == 1)
- {
- $item_prefix = "[Forum]";
- }
- elseif($parent_prefix == 2)
- {
- $item_prefix = "[Website]";
- }
- elseif($parent_prefix == 3)
- {
- $item_prefix = "[Gameserver]";
- }
- elseif($parent_prefix == 4)
- {
- $item_prefix = "[Voiceserver]";
- }
- elseif($parent_prefix == 5)
- {
- $item_prefix = "[Update]";
- }
- elseif($parent_prefix == 6)
- {
- $item_prefix = "[Release]";
- }
- else
- {
- $item_prefix = "";
- }
- //Mail includings
- $subject = $item_prefix.' '.$parent_name;
- $message = 'Dear '.$sub_username.',';
- $message .= '<br />';
- $message .= '<br />';
- $message .= 'You have subscribed to the Status Center System by Delta Commanders and therefore you receive this message.';
- $message .= '<br />';
- $message .= 'If you don\'t want to receive any mails from our system anymore, then you can unsubscribe <a href="http://deltacommanders.com/forum/hier.php?email_subscription=true&action=unsubscribe">here</a>.';
- $message .= '<br />';
- $message .= '<br />';
- $message .= '------------------> <strong>'.$subject.'</strong> (update) *'.$item_status.'* <------------------';
- $message .= '<br />';
- $message .= '<br />';
- $message .= stripslashes($update_summary);
- $message .= '<br />';
- $message .= '<br />';
- $message .= '--------------------------------------------------------------------';
- $message .= '<br />';
- $message .= '<br />';
- $message .= 'Thanks for your subscription. You can view the full message on our website: <a href="http://www.deltacommanders.com/forum/hier.php?showupdates=true&status='.$item_status_p.'&id='.$parent_id.'">http://www.deltacommanders.com/forum/hier.php?showupdates=true&status='.$item_status_p.'&id='.$parent_id.'</a>';
- $message .= '<br />';
- $message .= 'If you want to check out all updates and notifications please go to <a href="http://www.deltacommanders.com/forum/hier.php">http://www.deltacommanders.com/forum/hier.php</a>';
- $message .= '<br />';
- $message .= '<br />';
- $message .= 'If you have any questions left about this issue, please do not hesitate to contact us so we can give additional support to fit your needs.';
- $message .= '<br />';
- $message .= '<br />';
- $message .= 'Kindest regards,';
- $message .= '<br />';
- $message .= 'Delta Commanders Staff';
- $headers .= "From: Status Center - Delta Commanders <support@deltacommanders.com>\r\n";
- $headers .= "Reply-To: support@deltacommanders.com\r\n";
- $headers .= "MIME-Version: 1.0\r\n";
- $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
- $headers .= "X-Priority: 1\r\n";
- $headers .= "Priority: Urgent\r\n";
- $headers .= "Importance: High\r\n";
- $headers .= "X-MSMail-Priority: High\r\n";
- mail($sub_mail, $subject, $message, $headers);
- }
- $page = 'hier.php';
- header('Location: '.$page, true, 303);
- exit;
- }
- // Submit editted update
- if(isset($_POST['submit_editted_update']))
- {
- $updated_title = str_replace("'", "\'", $_POST["item_title"]);
- $updated_summary = nl2br(str_replace("'", "\'", $_POST["item_summary"]));
- $update_status = $_POST["item_status"];
- $update_prefix = $_POST["item_prefix"];
- $update_updated_on = time();
- $update_updated_by = $mybb->user['uid'];
- $update_id = $_POST["updated_id"];
- $get_inf_query = $db->query("SELECT update_parent, update_latest FROM `".TABLE_PREFIX."statuscenter_updates` WHERE `id` = $update_id");
- $get_inf = $get_inf_query->fetch_assoc();
- $parent_id = $get_inf["update_parent"];
- $is_latest_updated = $get_inf["update_latest"];
- if($is_latest_updated == "1")
- {
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_items`
- SET `item_status` = '$update_status'
- WHERE `id` = '$parent_id'");
- }
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_items`
- SET `item_summary` = '$updated_title'
- WHERE `id` = '$parent_id'");
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_items`
- SET `item_prefix` = '$update_prefix'
- WHERE `id` = '$parent_id'");
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_items`
- SET `by_uid` = '$update_updated_by'
- WHERE `id` = '$parent_id'");
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_updates`
- SET `update_summary` = '$updated_summary'
- WHERE `id` = '$update_id'");
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_updates`
- SET `update_status` = '$update_status'
- WHERE `id` = '$update_id'");
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_updates`
- SET `updated_by` = '$update_updated_by'
- WHERE `id` = '$update_id'");
- $db->query("UPDATE `".TABLE_PREFIX."statuscenter_updates`
- SET `updated_on` = '$update_updated_on'
- WHERE `id` = '$update_id'");
- }
- // Display all logs of the database
- if(isset($_GET['displaylogs']))
- {
- if($_GET['displaylogs'] == "true")
- {
- $template = '
- <html>
- <head>
- <title>'.$title.'</title>
- {$headerinclude}
- <link rel="stylesheet" type="text/css" href="http://www.deltacommanders.com/forum/css/status_center.css">
- </head>
- <body>
- {$header}';
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td class="thead" colspan="3">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['status_info'].'.gif" id="status_info_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Delta Commanders - Status Center</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['status_info'].'" id="status_info_e">
- <tr>
- <td class="row1" width="10%" rowspan="5"><a href="http://www.deltacommanders.com/forum/hier.php" title="Go back"><img src="http://www.deltacommanders.com/forum/images/back.png" align="left">Back to overview</a></td>
- <td class="row1" width="80%" valign="top" rowspan="5"><span class="smalltext">Welcome at the log section.<br />All old logs will be stored here for further references to previous errors and updates. Nothing will be pruned, nothing will be modified.</span></td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Resolved"></span> Resolved</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Disruption"></span> Disruption</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Outage"></span> Outage</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Information"></span> Information</td>
- </tr>
- </tbody>
- </table>
- <br />
- <br />';
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td class="thead" colspan="2">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['display_all'].'.gif" id="display_all_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Display all logs</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['display_all'].'" id="display_all_e">
- <tr>
- <td>
- <div align="center"><b>Filter: <a href="?displaylogs=true&filter=all" title="Show all notifications">All</a> | <a href="?displaylogs=true&filter=updates" title="Show updates only">Updates</a> | <a href="?displaylogs=true&filter=resolved" title="Show resolved notifications only">Resolved</a></div>
- </td>
- </tr>';
- if($_GET['filter'] == "all")
- {
- $get_items_displayall = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_items` WHERE `item_status` IN (3,4) ORDER BY `latest_update` DESC");
- }
- elseif($_GET['filter'] == "updates")
- {
- $get_items_displayall = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_items` WHERE `item_status` = 4 ORDER BY `latest_update` DESC");
- }
- elseif($_GET['filter'] == "resolved")
- {
- $get_items_displayall = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_items` WHERE `item_status` = 3 ORDER BY `latest_update` DESC");
- }
- else
- {
- $get_items_displayall = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_items` WHERE `item_status` IN (3,4) ORDER BY `latest_update` DESC");
- }
- $count_items_displayall = $db->num_rows($get_items_displayall);
- if($count_items_displayall > 0)
- {
- while ($itemlvl = $db->fetch_array($get_items_displayall))
- {
- $item_id = intval($itemlvl['id']);
- $item_summary = $itemlvl['item_summary'];
- $item_prefix_raw = intval($itemlvl['item_prefix']);
- $item_add_query = $db->query("SELECT
- `update_parent`,
- `update_date` AS `latest_update`,
- update_status
- FROM `".TABLE_PREFIX."statuscenter_updates`
- WHERE update_parent = ".$item_id."
- ORDER BY `update_date` DESC LIMIT 1");
- $item_additional = $db->fetch_array($item_add_query);
- $item_status_raw = intval($item_additional['update_status']);
- $item_date_raw = intval($itemlvl['item_date']);
- $item_update_raw = intval($item_additional['latest_update']);
- if($item_status_raw == 1)
- {
- $item_status = "Outage";
- }
- elseif($item_status_raw == 2)
- {
- $item_status = "Disruption";
- }
- elseif($item_status_raw == 3)
- {
- $item_status = "Resolved";
- }
- elseif($item_status_raw == 4)
- {
- $item_status = "Information";
- }
- else
- {
- $item_status = "";
- }
- if($item_prefix_raw == 1)
- {
- $item_prefix = "[Forum]";
- }
- elseif($item_prefix_raw == 2)
- {
- $item_prefix = "[Website]";
- }
- elseif($item_prefix_raw == 3)
- {
- $item_prefix = "[Gameserver]";
- }
- elseif($item_prefix_raw == 4)
- {
- $item_prefix = "[Voiceserver]";
- }
- elseif($item_prefix_raw == 5)
- {
- $item_prefix = "[Update]";
- }
- elseif($item_prefix_raw == 6)
- {
- $item_prefix = "[Release]";
- }
- else
- {
- $item_prefix = "";
- }
- $item_created = date('d-m-Y',$item_date_raw);
- $item_updated = date('d-m-Y H:i',$item_update_raw);
- $template .= '<tr>
- <td>
- <a href="?showupdates=true&status='.$item_status.'&id='.$item_id.'" class="issue '.$item_status.'" title="Show details">
- <span class="status"></span>
- <span class="created">'.$item_created.':</span>
- <span class="title">'.$item_prefix.' '.$item_summary.'</span>
- <span class="updated"><span>Latest update:</span><br />'.$item_updated.'</span>
- <span class="description"><span>Status:</span> '.$item_status.'</span>
- </a>
- </td>
- </tr>';
- }
- }
- else
- {
- $template .= '<tr align="center"><td><b>--> There is no information to be displayed. <--</b></td></tr>';
- }
- $template .= '</tbody></table><br /><a href="http://www.deltacommanders.com/forum/hier.php" title="Go back" style="padding: 140px;"><-- Go back</a>';
- }
- else
- {
- false;
- }
- }
- // End of displaying all logs of the database
- // Check if client clicked on a url to display additional info - if so, this section will get it working
- elseif(isset($_GET['showupdates'], $_GET['status'], $_GET['id']))
- {
- if($_GET['showupdates'] == "true")
- {
- $template = '
- <html>
- <head>
- <title>'.$title.'</title>
- {$headerinclude}
- <link rel="stylesheet" type="text/css" href="http://www.deltacommanders.com/forum/css/status_center.css">
- </head>
- <body>
- {$header}';
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td class="thead" colspan="3">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['status_info'].'.gif" id="status_info_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Delta Commanders - Status Center</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['status_info'].'" id="status_info_e">
- <tr>
- <td class="row1" width="10%" rowspan="5"><a href="http://www.deltacommanders.com/forum/hier.php" title="Go back"><img src="http://www.deltacommanders.com/forum/images/back.png" align="left">Back to overview</a></td>
- <td class="row1" width="80%" valign="top" rowspan="5"><span class="smalltext">On this page you see the additional information & updates about this issue. If the status of the issue is changed, whithout us knowing so, you can report the new status to <a href="mailto:admin@deltacommanders.com">admin@deltacommanders.com</a><br /><br />We try to keep this update as accurate as possible so you\'re able to use this center as main location for problems.<br />Thanks in advance!</span></td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Resolved"></span> Resolved</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Disruption"></span> Disruption</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Outage"></span> Outage</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Information"></span> Information</td>
- </tr>
- </tbody>
- </table>
- <br />
- <br />';
- $parent_id = intval($_GET['id']);
- $show_item_sum_raw = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_items` WHERE `id` = $parent_id");
- $show_item_sum = $show_item_sum_raw->fetch_assoc();
- if($show_item_sum['item_prefix'] == 1)
- {
- $item_prefix = "[Forum]";
- }
- elseif($show_item_sum['item_prefix'] == 2)
- {
- $item_prefix = "[Website]";
- }
- elseif($show_item_sum['item_prefix'] == 3)
- {
- $item_prefix = "[Gameserver]";
- }
- elseif($show_item_sum['item_prefix'] == 4)
- {
- $item_prefix = "[Voiceserver]";
- }
- elseif($show_item_sum['item_prefix'] == 5)
- {
- $item_prefix = "[Update]";
- }
- elseif($show_item_sum['item_prefix'] == 6)
- {
- $item_prefix = "[Release]";
- }
- else
- {
- $item_prefix = "";
- }
- if($show_item_sum['item_status'] == 1)
- {
- $item_status = "Outage";
- }
- elseif($show_item_sum['item_status'] == 2)
- {
- $item_status = "Disruption";
- }
- elseif($show_item_sum['item_status'] == 3)
- {
- $item_status = "Resolved";
- }
- elseif($show_item_sum['item_status'] == 4)
- {
- $item_status = "Information";
- }
- else
- {
- $item_status = "";
- }
- $view_item_created = date('d-m-Y, H:i',$show_item_sum['item_date']);
- $template .= '<table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td colspan="3">
- <div class="'.$item_status.'">
- <span class="status"></span><h2>'.$item_prefix.' '.$show_item_sum['item_summary'].'</h2>
- <span class="headtime">Created on: <span style="font-weight: bold;">'.$view_item_created.'</span></span>
- </div>
- <br />
- </td>
- </tr>
- <tr align="center">
- <td class="tcat" width="15%"><strong><div class="time">Date / Time</div></strong></td>
- <td class="tcat" width="1%" style="font-weight: bold;">#</td>
- <td class="tcat" width="84%"><strong>Description</strong></td>
- </tr>
- </thead>
- <tbody>';
- // Get information out of the database
- $get_info_item_updates = $db->query("SELECT *
- FROM `".TABLE_PREFIX."statuscenter_items` AS u
- RIGHT JOIN `".TABLE_PREFIX."statuscenter_updates` AS uf
- ON u.id = uf.update_parent
- WHERE u.`id` = $parent_id
- ORDER BY uf.`id`
- DESC");
- $count_info_item_updates = $db->num_rows($get_info_item_updates);
- if($count_info_item_updates > 0) // Count the rows - if more then one show details - otherwise show error message (it should not show the error message though..)
- {
- while ($g_info = $db->fetch_array($get_info_item_updates))
- {
- $show_item_id = intval($g_info['pid']);
- $show_item_sum = $g_info['item_summary'];
- $show_item_prefix = $g_info['item_prefix'];
- $show_item_status = intval($g_info['item_status']);
- $show_item_date = intval($g_info['item_date']);
- $show_update_id = intval($g_info['id']);
- $show_update_sum = $g_info['update_summary'];
- $show_update_parent = intval($g_info['update_parent']);
- $show_update_status = intval($g_info['update_status']);
- $show_update_date = intval($g_info['update_date']);
- $view_update_created_date = date('d-m-Y,',$show_update_date);
- $view_update_created_time = date('H:i',$show_update_date);
- $is_updated_on_raw = intval($g_info['updated_on']);
- if ($is_updated_on_raw != "0")
- {
- $is_updated_by = intval($g_info['updated_by']);
- $is_updated_on = date('D, j M Y H:i:s',$is_updated_on_raw);
- $sub_name = get_user($is_updated_by);
- $sub_username = $sub_name['username'];
- $is_edited = '<br /><font size="1.8pt">Last edited on '.$is_updated_on.', by '.$sub_username.'</span>.';
- }
- if($show_update_status == 1)
- {
- $view_update_status = "Outage";
- }
- elseif($show_update_status == 2)
- {
- $view_update_status = "Disruption";
- }
- elseif($show_update_status == 3)
- {
- $view_update_status = "Resolved";
- }
- elseif($show_update_status == 4)
- {
- $view_update_status = "Information";
- }
- else
- {
- $view_update_status = "";
- }
- if(($mybb->user['usergroup'] == 8) || ($mybb->user['usergroup'] == 4))
- {
- $admin_edit_update = '<br /><a href="http://deltacommanders.com/forum/hier.php?edit_update=true&status='.$view_update_status.'&id='.$show_update_id.'&user='.$user_check.'" title="Edit this update"><img src="http://docs.gimp.org/en/images/dialogs/stock-edit-16.png" style="float: right; padding-right: 15px;"></a>';
- }
- $template .= '<tr>
- <td align="center" valign="top" style="border-bottom-style:solid; border-bottom-width:1px; padding-bottom: 25px">'.$view_update_created_date.'<br /><b>'.$view_update_created_time.'</b></td>
- <td align="center" valign="top" style="border-bottom-style:solid; border-bottom-width:1px; padding-bottom: 25px"><span class="status '.$view_update_status.'" style="text-align: center;"></span></td>
- <td valign="top" style="border-bottom-style:solid; border-bottom-width:1px; padding-bottom: 30px"><div class="description">'.$show_update_sum.' '.$admin_edit_update.' '.$is_edited.'</div></td>
- </tr>';
- }
- }
- else
- {
- $template .= '<tr>
- <td align="center" valign="top" style="border-bottom-style:solid; border-bottom-width:1px; padding-bottom: 25px" colspan="3"><b>--> There is no information to be displayed. <--</b></td>
- </tr>';
- }
- $template .= '</tbody></table>'.$admin_end_user_update;
- }
- }
- elseif(isset($_GET['submit_notification'], $_GET['user']) && (($mybb->user['usergroup'] == 8) || ($mybb->user['usergroup'] == 4)))
- {
- if(($_GET['submit_notification'] == "true") && ($_GET['user'] == $user_check))
- {
- $template = '
- <html>
- <head>
- <title>'.$title.'</title>
- {$headerinclude}
- <link rel="stylesheet" type="text/css" href="http://www.deltacommanders.com/forum/css/status_center.css">
- <script type="text/javascript" src="http://www.deltacommanders.com/forum/jscripts/statuscenter.js"></script>
- </head>
- <body>
- {$header}';
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td class="thead" colspan="3">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['submit_notification'].'.gif" id="submit_notification_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Delta Commanders - Status Center</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['submit_notification'].'" id="submit_notification_e">
- <tr>
- <td class="row1" width="10%" rowspan="5"><a href="http://www.deltacommanders.com/forum/hier.php" title="Go back"><img src="http://www.deltacommanders.com/forum/images/back.png" align="left">Back to overview</a></td>
- <td class="row1" width="80%" valign="top" rowspan="5"><span class="smalltext">Submit new notification to global. <b>Everything entered here will be visible to everyone, so watch out what you post here!</b><br /><br />This is mainly used for updates and other important notifications.</span></td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Resolved"></span> Resolved</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Disruption"></span> Disruption</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Outage"></span> Outage</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Information"></span> Information</td>
- </tr>
- </tbody>
- </table>
- <br />
- <br />';
- $template .= '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="submit_notification" onsubmit="return validateForm(this);">
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="50%">
- <thead>
- <tr>
- <td class="thead" colspan="6">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['submit_new_notification_e'].'.gif" id="submit_new_notification_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Status Center - Submit a new notification/update</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['submit_new_notification'].'" id="submit_new_notification_e">
- <tr align="center">
- <td class="trow1" align="center"><span class="smalltext"><strong>Notification Title:</strong></span></td>
- <td class="trow1"><input type="text" name="item_title" /></td>
- </tr>
- <tr align="center">
- <td class="trow2" align="center"><span class="smalltext"><strong>Notification Summary:</strong></span></td>
- <td class="trow2"><textarea name="item_summary" rows="4" cols="40"/></textarea></td>
- </tr>
- <tr align="center">
- <td class="trow1" align="center"><span class="smalltext"><strong>Notification Status:</strong></span></td>
- <td class="trow1"><select id="item_status" name="item_status"><option value="0" selected="selected">Choose</option><option value="1">Outage</option><option value="2">Disruption</option><option value="3" disabled="disabled">Resolved</option><option value="4">Update</option></td>
- </tr>
- <tr align="center">
- <td class="trow2" align="center"><span class="smalltext"><strong>Notification Prefix:</strong></span></td>
- <td class="trow2"><select id="item_prefix" name="item_prefix"><option value="0" selected="selected">Choose</option><option value="1">[Forum]</option><option value="2">[Website]</option><option value="3">[Gameserver]</option><option value="4">[Voiceserver]</option><option value="5">[Update]</option><option value="6">[Release]</option></td>
- </tr>
- <tr align="center">
- <td class="trow1" align="center"><span class="smalltext"><strong>Current Time:</strong></span></td>
- <td class="trow1"><span id="curTime"></span></td>
- </tr>
- <tr align="center">
- <td class="trow2" align="center"><span class="smalltext"><strong>Submit by:</strong></span></td>
- <td class="trow2">'.$user['username'].' - (uid: '.$user['uid'].')</td>
- </tr>
- <tr align="center">
- <td class="trow2" colspan="2"><input type="submit" name="submit_notif" value="Submit"></td>
- </tr>
- </tbody>
- </table>
- </form>';
- }
- }
- elseif(isset($_GET['submit_update'], $_GET['status'], $_GET['id'], $_GET['user']))
- {
- if(($_GET['submit_update'] == "true") && ($_GET['user'] == $user_check))
- {
- $template = '
- <html>
- <head>
- <title>'.$title.'</title>
- {$headerinclude}
- <link rel="stylesheet" type="text/css" href="http://www.deltacommanders.com/forum/css/status_center.css">
- <script type="text/javascript" src="http://www.deltacommanders.com/forum/jscripts/statuscenter.js"></script>
- </head>
- <body>
- {$header}';
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td class="thead" colspan="3">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['status_info'].'.gif" id="status_info_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Delta Commanders - Status Center</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['status_info'].'" id="status_info_e">
- <tr>
- <td class="row1" width="10%" rowspan="5"><a href="http://www.deltacommanders.com/forum/hier.php" title="Go back"><img src="http://www.deltacommanders.com/forum/images/back.png" align="left">Back to overview</a></td>
- <td class="row1" width="80%" valign="top" rowspan="5"><span class="smalltext">On this page you see the additional information & updates about this issue. If the status of the issue is changed, whithout us knowing so, you can report the new status to <a href="mailto:admin@deltacommanders.com">admin@deltacommanders.com</a><br /><br />We try to keep this update as accurate as possible so you\'re able to use this center as main location for problems.<br />Thanks in advance!</span></td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Resolved"></span> Resolved</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Disruption"></span> Disruption</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Outage"></span> Outage</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Information"></span> Information</td>
- </tr>
- </tbody>
- </table>
- <br />
- <br />';
- $get_parent_id = $_GET['id'];
- $get_parent_name = $db->query("SELECT `item_summary`, `item_prefix` FROM `".TABLE_PREFIX."statuscenter_items` WHERE `id` = '$get_parent_id'");
- $nid = $get_parent_name->fetch_assoc();
- $parent_name = $nid['item_summary'];
- $parent_prefix_raw = $nid['item_prefix'];
- if($parent_prefix_raw == 1)
- {
- $parent_prefix = "[Forum]";
- }
- elseif($parent_prefix_raw == 2)
- {
- $parent_prefix = "[Website]";
- }
- elseif($parent_prefix_raw == 3)
- {
- $parent_prefix = "[Gameserver]";
- }
- elseif($parent_prefix_raw == 4)
- {
- $parent_prefix = "[Voiceserver]";
- }
- elseif($parent_prefix_raw == 5)
- {
- $parent_prefix = "[Update]";
- }
- elseif($parent_prefix_raw == 6)
- {
- $parent_prefix = "[Release]";
- }
- else
- {
- $parent_prefix = "";
- }
- $template .= '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="submit_update" onsubmit="return CheckForm(this);">
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="50%">
- <thead>
- <tr>
- <td class="thead" colspan="2">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['submit_update_e'].'.gif" id="submit_update_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Status Center - Submit an Update</center></strong>
- </td>
- </tr>
- <tr align="center">
- <td class="trow1" colspan="2">Update from Notification:<br /><b>'.$parent_prefix.' '.$parent_name.' <font size="1">(id: '.$_GET['id'].')</font></b></td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['submit_update'].'" id="submit_update_e">
- <tr align="center">
- <td class="trow2" align="center"><span class="smalltext"><strong>Update Summary:</strong></span></td>
- <td class="trow2"><textarea name="update_summary" rows="4" cols="50"/></textarea></td>
- </tr>
- <tr align="center">
- <td class="trow1" align="center"><span class="smalltext"><strong>Update Status:</strong></span></td>
- <td class="trow1"><select id="update_status" name="update_status"><option value="0" selected="selected">Choose</option><option value="1">Outage</option><option value="2">Disruption</option><option value="3">Resolved</option><option value="4">Update</option></td>
- </tr>
- <tr align="center">
- <td class="trow2" align="center"><span class="smalltext"><strong>Current Time:</strong></span></td>
- <td class="trow2"><span id="curTime"></span></td>
- </tr>
- <tr align="center">
- <td class="trow1" align="center"><span class="smalltext"><strong>Submit by:</strong></span></td>
- <td class="trow1">'.$user['username'].' - (uid: '.$user['uid'].')</td>
- </tr>
- <tr align="center">
- <input type="hidden" name="parent_id" value="'.$_GET['id'].'">
- <td class="trow1" colspan="2"><input type="submit" name="submit_update" value="Submit"></td>
- </tr>
- </tbody>
- </table>
- </form>';
- }
- }
- // Check if user used signup for email
- elseif(isset($_GET['email_subscription'], $_GET['action']))
- {
- if($_GET['email_subscription'] == "true")
- {
- $get_signup_user_b = $db->query("SELECT email FROM `".TABLE_PREFIX."statuscenter_signup` WHERE `uid` = $user_check");
- $count_signup_user_b = $db->num_rows($get_signup_user_b);
- if (($count_signup_user == 0) && ($_GET['action'] == "subscribe"))
- {
- $get_email_from_main = $db->query("SELECT email FROM `".TABLE_PREFIX."users` WHERE `uid` = $user_check");
- $get_email = $get_email_from_main->fetch_assoc();
- $email = $get_email['email'];
- $user_check = $mybb->user['uid'];
- $db->insert_query('statuscenter_signup', array(
- 'uid' => (int) $user_check,
- 'email' => $email
- ));
- $page = 'hier.php';
- header('Location: '.$page, true, 303);
- exit;
- }
- elseif (($count_signup_user > 0) && ($_GET['action'] == "unsubscribe"))
- {
- $user_check = $mybb->user['uid'];
- $db->query("DELETE FROM `".TABLE_PREFIX."statuscenter_signup` WHERE `uid` = $user_check");
- $db->query("OPTIMIZE TABLE `".TABLE_PREFIX."statuscenter_signup`");
- $page = 'hier.php';
- header('Location: '.$page, true, 303);
- exit;
- }
- }
- }
- elseif(isset($_GET['show_subscribers']))
- {
- if(($_GET['show_subscribers'] == "true") && (($mybb->user['usergroup'] == 8) || ($mybb->user['usergroup'] == 4)))
- {
- $template = '
- <html>
- <head>
- <title>'.$title.'</title>
- {$headerinclude}
- <link rel="stylesheet" type="text/css" href="http://www.deltacommanders.com/forum/css/status_center.css">
- </head>
- <body>
- {$header}';
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td class="thead" colspan="3">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['subscribers'].'.gif" id="subscribers_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Delta Commanders - Status Center</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['subscribers'].'" id="subscribers_e">
- <tr>
- <td class="row1" width="10%" rowspan="5"><a href="http://www.deltacommanders.com/forum/hier.php" title="Go back"><img src="http://www.deltacommanders.com/forum/images/back.png" align="left">Back to overview</a></td>
- <td class="row1" width="80%" valign="top" rowspan="5"><span class="smalltext">Welcome to the subscribers section, Admin!<br />On this page you can see all users who have registered to the mail-update function.<br /><br />You can manually delete users from the list, if necessary.</span></td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Resolved"></span> Resolved</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Disruption"></span> Disruption</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Outage"></span> Outage</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Information"></span> Information</td>
- </tr>
- </tbody>
- </table>
- <br />';
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" width="50%" align="center">
- <thead>
- <tr>
- <td class="thead" colspan="3">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['subscribers_list_e'].'.gif" id="subscribers_list_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Users subscribed to the mail-updates function.</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['subscribers_list'].'" id="subscribers_list_e">
- <tr align="center">
- <td class="tcat" width="48%"><span class="smalltext"><strong>Username</strong></span></td>
- <td class="tcat" width="48%"><span class="smalltext"><strong>Email</strong></span></td>
- <td class="tcat" width="4%"><span class="smalltext"><strong>#</strong></span></td>
- </tr>';
- $get_sub_data = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_signup` ORDER BY id DESC");
- $count_sub_data = $db->num_rows($get_sub_data);
- if($count_sub_data > 0)
- {
- $get_sub_data = $db->query("SELECT * FROM `".TABLE_PREFIX."statuscenter_signup` ORDER BY id DESC");
- while ($s_info = $db->fetch_array($get_sub_data))
- {
- $s_id = intval($s_info['id']);
- $sub_id = intval($s_info['uid']);
- $sub_name = get_user($sub_id);
- $sub_username = $sub_name['username'];
- $sub_email = $s_info['email'];
- if($mybb->user['usergroup'] == 8 || $mybb->user['usergroup'] == 4)
- {
- $add_admin_func = "";
- if(isset($_GET['prune']))
- {
- $db->delete_query('statuscenter_signup', 'id='.$s_id) or die(mysql_error());
- $page = 'hier.php?show_subscribers=true';
- header('Location: '.$page, true, 303);
- exit;
- }
- }
- $template .= '
- <tr align="center">
- <td class="trow1" width="48%"><a href="http://deltacommanders.com/forum/user-'.$sub_id.'.html" title="Visit \''.$sub_username.'\'s\' profile page">'.$sub_username.'</a></td>
- <td class="trow2" width="48%">'.$sub_email.'</td>
- <td class="trow1" width="4%"><a href="hier.php?show_subscribers=true&prune='.$s_id.'" title="Delete subscriber" onclick="return confirm(\'Are you sure you want to delete '.$sub_username.' from the subscriberslist? The user will NOT be notified about this action!\');"><img src="http://cdn2.iconfinder.com/data/icons/aspneticons_v1.0_Nov2006/trash_(delete)_16x16.gif" /></a></td>
- </tr>';
- }
- }
- else
- {
- $template .= '
- <tr align="center">
- <td class="trow1" colspan="2">There is no information to be displayed.</td>
- </tr>';
- }
- $template .= '
- </tbody>
- </table>
- <br />';
- }
- }
- elseif(isset($_GET['edit_update'], $_GET['status'], $_GET['id'], $_GET['user']))
- {
- if(($_GET['edit_update'] == "true") && ($_GET['user'] == $user_check) && (($mybb->user['usergroup'] == 8) || ($mybb->user['usergroup'] == 4)))
- {
- $update_id = $_GET['id'];
- $get_update_data = $db->query("SELECT update_summary, update_status, update_date, update_parent FROM `".TABLE_PREFIX."statuscenter_updates` WHERE id = $update_id");
- $up_inf = $get_update_data->fetch_assoc();
- $update_parent = $up_inf['update_parent'];
- $update_summary = $up_inf['update_summary'];
- $update_status = $up_inf['update_status'];
- $update_date_raw = $up_inf['update_date'];
- $update_summary = str_replace("<br />","",$update_summary);
- $update_date = date('D, j M Y H:i:s O',$update_date_raw);
- $get_update_title = $db->query("SELECT item_summary, item_prefix FROM `".TABLE_PREFIX."statuscenter_items` WHERE id = $update_parent");
- $up_title = $get_update_title->fetch_assoc();
- $update_title = $up_title['item_summary'];
- $update_prefix = $up_title['item_prefix'];
- // Update status
- if($update_status == "1")
- {
- $status_0 = '<option value="0" disabled="disabled">Choose</option>';
- $status_1 = '<option value="1" selected="selected">Outage</option>';
- $status_2 = '<option value="2">Disruption</option>';
- $status_3 = '<option value="3">Resolved</option>';
- $status_4 = '<option value="4">Information</option>';
- }
- elseif($update_status == "2")
- {
- $status_0 = '<option value="0" disabled="disabled">Choose</option>';
- $status_1 = '<option value="1">Outage</option>';
- $status_2 = '<option value="2" selected="selected">Disruption</option>';
- $status_3 = '<option value="3">Resolved</option>';
- $status_4 = '<option value="4">Information</option>';
- }
- elseif($update_status == "3")
- {
- $status_0 = '<option value="0" disabled="disabled">Choose</option>';
- $status_1 = '<option value="1">Outage</option>';
- $status_2 = '<option value="2">Disruption</option>';
- $status_3 = '<option value="3" selected="selected">Resolved</option>';
- $status_4 = '<option value="4">Information</option>';
- }
- elseif($update_status == "4")
- {
- $status_0 = '<option value="0" disabled="disabled">Choose</option>';
- $status_1 = '<option value="1">Outage</option>';
- $status_2 = '<option value="2">Disruption</option>';
- $status_3 = '<option value="3">Resolved</option>';
- $status_4 = '<option value="4" selected="selected">Information</option>';
- }
- else
- {
- $status_0 = '<option value="0" disabled="disabled" selected="selected">Choose</option>';
- $status_1 = '<option value="1">Outage</option>';
- $status_2 = '<option value="2">Disruption</option>';
- $status_3 = '<option value="3">Resolved</option>';
- $status_4 = '<option value="4">Information</option>';
- }
- // Update prefixes
- if($update_prefix == "1")
- {
- $prefix_0 = '<option value="0" disabled="disabled">Choose</option>';
- $prefix_1 = '<option value="1" selected="selected">[Forum]</option>';
- $prefix_2 = '<option value="2">[Website]</option>';
- $prefix_3 = '<option value="3">[Gameserver]</option>';
- $prefix_4 = '<option value="4">[Voiceserver]</option>';
- $prefix_5 = '<option value="5">[Update]</option>';
- $prefix_6 = '<option value="6">[Release]</option>';
- }
- elseif($update_prefix == "2")
- {
- $prefix_0 = '<option value="0" disabled="disabled">Choose</option>';
- $prefix_1 = '<option value="1">[Forum]</option>';
- $prefix_2 = '<option value="2" selected="selected">[Website]</option>';
- $prefix_3 = '<option value="3">[Gameserver]</option>';
- $prefix_4 = '<option value="4">[Voiceserver]</option>';
- $prefix_5 = '<option value="5">[Update]</option>';
- $prefix_6 = '<option value="6">[Release]</option>';
- }
- elseif($update_prefix == "3")
- {
- $prefix_0 = '<option value="0" disabled="disabled">Choose</option>';
- $prefix_1 = '<option value="1">[Forum]</option>';
- $prefix_2 = '<option value="2">[Website]</option>';
- $prefix_3 = '<option value="3" selected="selected">[Gameserver]</option>';
- $prefix_4 = '<option value="4">[Voiceserver]</option>';
- $prefix_5 = '<option value="5">[Update]</option>';
- $prefix_6 = '<option value="6">[Release]</option>';
- }
- elseif($update_prefix == "4")
- {
- $prefix_0 = '<option value="0" disabled="disabled">Choose</option>';
- $prefix_1 = '<option value="1">[Forum]</option>';
- $prefix_2 = '<option value="2">[Website]</option>';
- $prefix_3 = '<option value="3">[Gameserver]</option>';
- $prefix_4 = '<option value="4" selected="selected">[Voiceserver]</option>';
- $prefix_5 = '<option value="5">[Update]</option>';
- $prefix_6 = '<option value="6">[Release]</option>';
- }
- elseif($update_prefix == "5")
- {
- $prefix_0 = '<option value="0" disabled="disabled">Choose</option>';
- $prefix_1 = '<option value="1">[Forum]</option>';
- $prefix_2 = '<option value="2">[Website]</option>';
- $prefix_3 = '<option value="3">[Gameserver]</option>';
- $prefix_4 = '<option value="4">[Voiceserver]</option>';
- $prefix_5 = '<option value="5" selected="selected">[Update]</option>';
- $prefix_6 = '<option value="6">[Release]</option>';
- }
- elseif($update_prefix == "6")
- {
- $prefix_0 = '<option value="0" disabled="disabled">Choose</option>';
- $prefix_1 = '<option value="1">[Forum]</option>';
- $prefix_2 = '<option value="2">[Website]</option>';
- $prefix_3 = '<option value="3">[Gameserver]</option>';
- $prefix_4 = '<option value="4">[Voiceserver]</option>';
- $prefix_5 = '<option value="5">[Update]</option>';
- $prefix_6 = '<option value="6" selected="selected">[Release]</option>';
- }
- else
- {
- $prefix_0 = '<option value="0" disabled="disabled" selected="selected">Choose</option>';
- $prefix_1 = '<option value="1">[Forum]</option>';
- $prefix_2 = '<option value="2">[Website]</option>';
- $prefix_3 = '<option value="3">[Gameserver]</option>';
- $prefix_4 = '<option value="4">[Voiceserver]</option>';
- $prefix_5 = '<option value="5">[Update]</option>';
- $prefix_6 = '<option value="6">[Release]</option>';
- }
- $template = '
- <html>
- <head>
- <title>'.$title.'</title>
- {$headerinclude}
- <link rel="stylesheet" type="text/css" href="http://www.deltacommanders.com/forum/css/status_center.css">
- <script type="text/javascript" src="http://www.deltacommanders.com/forum/jscripts/statuscenter.js"></script>
- </head>
- <body>
- {$header}';
- $template .= '
- <br />
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="80%">
- <thead>
- <tr>
- <td class="thead" colspan="3">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['edit_update'].'.gif" id="edit_update_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Delta Commanders - Status Center</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['edit_update'].'" id="edit_update_e">
- <tr>
- <td class="row1" width="10%" rowspan="5"><a href="http://www.deltacommanders.com/forum/hier.php" title="Go back"><img src="http://www.deltacommanders.com/forum/images/back.png" align="left">Back to overview</a></td>
- <td class="row1" width="80%" valign="top" rowspan="5"><span class="smalltext">Submit new notification to global. <b>Everything entered here will be visible to everyone, so watch out what you post here!</b><br /><br />This is mainly used for updates and other important notifications.</span></td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Resolved"></span> Resolved</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Disruption"></span> Disruption</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Outage"></span> Outage</td>
- </tr>
- <tr>
- <td class="row1" width="10%" style="padding: 0px;"><span class="status Information"></span> Information</td>
- </tr>
- </tbody>
- </table>
- <br />
- <br />';
- $template .= '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="edit_update">
- <table border="0" cellspacing="1" cellpadding="3" align="center" width="50%">
- <thead>
- <tr>
- <td class="thead" colspan="6">
- <div class="expcolimage"><img src="'.$theme['imgdir'].'/collapse'.$collapsedimg['editted_update_e'].'.gif" id="editted_update_img" class="expander" alt="[-]" title="[-]" /></div>
- <strong><center>Status Center - Submit a new notification/update</center></strong>
- </td>
- </tr>
- </thead>
- <tbody style="'.$collapsed['editted_update'].'" id="editted_update_e">
- <tr align="center">
- <td class="trow1" align="center"><span class="smalltext"><strong>Notification Info:</strong></span></td>
- <td class="trow1"><select id="item_prefix" name="item_prefix">'.$prefix_0.''.$prefix_1.''.$prefix_2.''.$prefix_3.''.$prefix_4.''.$prefix_5.''.$prefix_6.'</select> <input type="text" name="item_title" value="'.$update_title.'" style="width: 150px;" /></td>
- </tr>
- <tr align="center">
- <td class="trow2" align="center"><span class="smalltext"><strong>Notification Summary:</strong></span></td>
- <td class="trow2"><textarea name="item_summary" rows="4" cols="40" />'.$update_summary.'</textarea></td>
- </tr>
- <tr align="center">
- <td class="trow1" align="center"><span class="smalltext"><strong>Notification Status:</strong></span></td>
- <td class="trow1"><select id="item_status" name="item_status">'.$status_0.''.$status_1.''.$status_2.''.$status_3.''.$status_4.'</select></td>
- </tr>
- <tr align="center">
- <td class="trow2" align="center"><span class="smalltext"><strong>Previous update time:</strong></span></td>
- <td class="trow2">'.$update_date.'</td>
- </tr>
- <tr align="center">
- <td class="trow1" align="center"><span class="smalltext"><strong>Current Time:</strong></span></td>
- <td class="trow1"><span id="curTime"></span></td>
- </tr>
- <tr align="center">
- <td class="trow2" align="center"><span class="smalltext"><strong>Submit by:</strong></span></td>
- <td class="trow2">'.$user['username'].' - (uid: '.$user['uid'].')</td>
- </tr>
- <tr align="center">
- <input type="hidden" name="updated_id" value="'.$_GET['id'].'">
- <td class="trow2" colspan="2"><input type="submit" name="submit_editted_update" value="Submit"></td>
- </tr>
- </tbody>
- </table>
- </form>';
- }
- }
- // End :)
- // Generate the page load time - footer settings settings
- $time = microtime();
- $time = explode(' ', $time);
- $time = $time[1] + $time[0];
- $finish = $time;
- $total_time = round(($finish - $start), 5);
- $template .= '<br /><center>Page generated in '.$total_time.' seconds.</center>
- {$footer}
- </body>
- </html>';
- // Last shizzle - convert template variables into php thing
- $template=str_replace("\'", "'", addslashes($template));
- add_breadcrumb($pages['name']);
- eval("\$page=\"".$template."\";");
- output_page($page);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement