Jump to content

Network Issues / Outages Notifier on Any Page!


Recommended Posts

Every time that there is a network issue, I am sure many of you have clients who right away open up support tickets without reading the network issues page in whmcs.

Then when you ask why haven't they read the network issues, they say they didn't know there was a network issue page. Or even the good ol' "Why wasn't I told there was a network issue".

 

So I have created (with a little help from a friend) a simple code (called the Network Issues / Outages Notifier) that will allow you to post a little message stating there are / is a network issue(s) / outage(s). (The idea behind this came from the announcements anywhere code)

 

Anyways, here's the code if anyone is interested:

 

The below code, create a paragraph with the class of "breadcrumb" anywhere you put it. (I usually put it in the header).

{if $loggedin}
{php}
// Make a MySQL Connection
$query = "SELECT status, COUNT(description) FROM tblnetworkissues GROUP BY status"; 

$result = mysql_query($query) or die(mysql_error());

$i = 0;

// Print out result
while($row = mysql_fetch_array($result))
{

	// Define
	$description = $row["COUNT(description)"];
	$status = $row["status"];

	// Don't want Resolved to show.
	if (strtolower($status) !== "resolved") {
		//echo ("<p class=\"breadcrumb2\" align=\"center\">There is <b>(<font color=\"red\">$description</font>)</b> Network Issues Open.</p>");
		$i += $description;;
	}
}

if ($i > 0)
{
	$areis = $i == 1 ? "is" : "are";
	$s = $i == 1 ? "" : "s";

	echo ("<p class=\"breadcrumb2\" align=\"center\">*NEW* There {$areis} <b>(<font color=\"red\">{$i}</font>)</b> Network Issue{$s} Open.</p>");
}
{/php}{/if}

 

This code below, just posts the number such as "(1)", that can be implemented anywhere. (I suggest right next to where it says "Network Issues" if you have a navigation menu.

{if $loggedin}{php}

// Make a MySQL Connection
$query = "SELECT status, COUNT(description) FROM tblnetworkissues GROUP BY status"; 

$result = mysql_query($query) or die(mysql_error());

$i = 0;

// Print out result
while($row = mysql_fetch_array($result))
{

	// Define
	$description = $row["COUNT(description)"];
	$status = $row["status"];

	// Don't want Resolved to show.
	if (strtolower($status) !== "resolved") {
		//echo ("($description)");
		$i += $description;;
	}
}

if ($i > 0)
{
	$areis = $i == 1 ? "is" : "are";
	$s = $i == 1 ? "" : "s";

	echo ("({$i})");
}
{/php}{/if}

 

*Note* If you are implimenting this in another page other than a whmcs page, do not forget to put

include("support/dbconnect.php");
include("support/includes/functions.php");

Right after the {php} (change "support" to your whmcs folder) =]

 

Images of both are below:

 

networkissues.png

 

Hopefully by implementing this, it will lower the amount of tickets you get =]

 

If anyone has any modifications to this feel free to post here or let me know.

 

Thanks!.

Edited by My365Host
added about external pages.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated