Hello guys,
I am looking for a way to modify the Network Status page (serverstatus.tpl), specifically the Server Status section.
I would like to only show the status of servers where the clients are hosted on.
As such, if a client has an account in Server A, it will only the server status for Server A.
If a client has an account in Server A and Server B, it will show the server status for Server A and Server B only.
This is to prevent confusion especially when you have a lot of servers as the client may not even know which server they are hosted on.
I have been using a custom code in version 4.x of WHMCS but it doesn't seem to work on version 5.x:-
Any input from you guys will be greatly appreciated. :)
Thank you.
I am looking for a way to modify the Network Status page (serverstatus.tpl), specifically the Server Status section.
I would like to only show the status of servers where the clients are hosted on.
As such, if a client has an account in Server A, it will only the server status for Server A.
If a client has an account in Server A and Server B, it will show the server status for Server A and Server B only.
This is to prevent confusion especially when you have a lot of servers as the client may not even know which server they are hosted on.
I have been using a custom code in version 4.x of WHMCS but it doesn't seem to work on version 5.x:-
Code:
<table width="100%" border="0" align="center" cellpadding="10" cellspacing="0" class="data">
<tr>
<th>{$LANG.servername}</th>
<th>Hosting Account</th>
<th>HTTP</th>
<th>cPanel</th>
<th>FTP</th>
<th>POP3</th>
<th>SMTP</th>
</tr>
<tr>
{php}
$query1 = "SELECT * FROM tblservers ORDER BY name";
$result1 = mysql_query($query1);
while ($row1 = mysql_fetch_array($result1)) {
$serverid = $row1['id'];
$servername = $row1['name'];
$host = $row1['ipaddress'];
$hosteddomains="";
$query2 = "SELECT * FROM tblhosting WHERE userid='".$_SESSION["uid"]."' AND domainstatus='Active' AND server='".$serverid."'";
$result2 = mysql_query($query2);
while ($row2 = mysql_fetch_array($result2)) {
$hosteddomain = $row2['domain'];
$hosteddomains.=$hosteddomain."<br>";
}
if ($hosteddomains) {
$hosteddomains=substr($hosteddomains,0,-4);
if ($host) {
//HTTP
$port = 80;
$fp = fsockopen($host,$port,$errno,$errstr,10);
if(!$fp)
{
echo "<tr class=\"clientareatableactive\">";
echo "<td><b>".$servername."</b> </td>";
echo "<td>" .$hosteddomains."</td>";
echo "<td><img src=\"images/statusfailed.gif\"></td>";
}
else{
echo "<tr class=\"clientareatableactive\">";
echo "<td>".$servername." </td>";
echo "<td>" .$hosteddomains."</td>";
echo "<td><img src=\"images/statusok.gif\"></td>";
fclose($fp);
}
//cPanel
$port = 2082;
$fp = fsockopen($host,$port,$errno,$errstr,10);
if(!$fp)
{
echo "<td><img src=\"images/statusfailed.gif\"></td>";
}else{
echo "<td><img src=\"images/statusok.gif\"></td>";
fclose($fp);
}
//FTP
$port = 21;
$fp = fsockopen($host,$port,$errno,$errstr,10);
if(!$fp)
{
echo "<td><img src=\"images/statusfailed.gif\"></td>";
}else{
echo "<td><img src=\"images/statusok.gif\"></td>";
fclose($fp);
}
//POP3
$port = 110;
$fp = fsockopen($host,$port,$errno,$errstr,10);
if(!$fp)
{
echo "<td><img src=\"images/statusfailed.gif\"></td>";
}else{
echo "<td><img src=\"images/statusok.gif\"></td>";
fclose($fp);
}
//SMTP
$port = 25;
$fp = fsockopen($host,$port,$errno,$errstr,10);
if(!$fp)
{
echo "<td><img src=\"images/statusfailed.gif\"></td>";
}else{
echo "<td><img src=\"images/statusok.gif\"></td>";
fclose($fp);
}
$this->assign('serverid',$serverid);
$this->assign('servername',$servername);
{/php}
{php}
echo "</td></tr>";
} else {
echo "<tr class=\"clientareatableactive\">";
echo "<td>".$servername."</td>";
echo "<td>" .$hosteddomains."</td>";
echo "<td colspan=\"5\"><strong><font color=\"#AAAAAA\">Not Monitored Here</font></strong></td>";
}}}
{/php}
</table>
Thank you.