Jump to content

Table of data


Xtremer360

Recommended Posts

What I'm wanting to do is instead of March-July have it always display the last 5 months and for the Visits th have it display the number of hits to my main page for each month and display the number of logins for each month to my CMS script. Can someone point me in the right direction?

 

 

<?php
function get_visit_data_table()
{
	echo "<table class=\"visualize_dashboard\">";
	echo "<caption>Dashboard Chart Example</caption>";
	echo "<thead>";
	echo "<tr>";
	echo "<td></td>";
	echo "<th scope=\"col\">March</th>";
	echo "<th scope=\"col\">April</th>";
	echo "<th scope=\"col\">May</th>";
	echo "<th scope=\"col\">June</th>";
	echo "<th scope=\"col\">July</th>";
	echo "</tr>";
	echo "</thead>";
	echo "<tbody>";
	echo "<tr>";
	echo "<th scope=\"row\">Visits</th>";
	echo "<td>175</td>";
	echo "<td>145</td>";
	echo "<td>212</td>";
	echo "<td>175</td>";
	echo "<td>182</td>";
	echo "</tr>";
	echo "<tr>";
	echo "<th scope=\"row\">Logins</th>";
	echo "<td>94</td>";
	echo "<td>53</td>";
	echo "<td>124</td>";
	echo "<td>92</td>";
	echo "<td>105</td>";
	echo "</tr>";
	echo "</tbody>";
	echo "</table>";
    }       
?>

Link to comment
Share on other sites

current month:

$currentMonth = date("F");

current -1 month:

$lastMonth = date("F",strtotime("- 1 month"));

current -2 month:

$monthBeforeLast = date("F",strtotime("- 2 months"));

current -3 month

$aLongTimeAgo = date("F",strtotime("- 3 months"));

 

etc...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.