Jump to content

Create a Page


Daniel

Recommended Posts

Hi,

 

I've found the wiki page on creating pages in WHMCS, but can't work out how to add my script to it.

The code is below..

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title></title>
	<link href="report.css" rel="stylesheet" type="text/css">
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
</head>
<body>
<?php

putenv("TZ=GMT");
require("includes/hyperspinRSSParser.class.php");

function removePort($name) {
       if(strpos($name, "HTTP port"))
               return substr($name,0,strpos($name, "HTTP port"));
       else
               return $name;
}


$rss_parser = new hyperspinRSSParser("http://www.hyperspin.com/publicreportrss2.0/",false);
$rss_parser->parse();


$currMonth = date('M');
$prevMonth = date('M', mktime(0, 0, 0, date("m")-1, date("d"),  date("Y")));

?>
<table>
	<tr class="tableHead">
		<td>Name</td>
		<td>Status</td>
		<td><?=$currMonth;?> Uptime</td>
		<td><?=$prevMonth;?> Uptime</td>
		<td>Total Uptime</td>
	</tr>
<?
foreach($rss_parser->uptimeInfo as $row)
{
?>
	<tr>
		<td><?=removePort($row['name']);?></td>
		<td class="<?=$row['status'];?>"><?=$row['status'];?></td>
		<td><?=$row['cm_uptime'];?>%</td>
		<td><?=$row['pm_uptime'];?>%</td>
		<td><?=$row['tot_uptime'];?>%</td>
	</tr>
<?
}
?>
</table>

</body>
</html>

 

How would I do this? I've tried replacing the php tags with {php} but it just shows a white page.

 

Any help would be appreciated.

 

Dan

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