converting date time and using this calculate various values
Posted: Fri Oct 06, 2006 5:27 am
this has been breaking me up over the course of several days
story time:
i have gotten the mission to put the total prints made each month in a graph.
Now the graph is no problem but the way i get that data is. This is because
every day the total number of prints made is updated, meaning i get an extra
record per printer every day. The number of total prints made is not reset each month.
every date is recorded by means of this date format: 1-8-2006
i am searching for a way to get this data to show up right.
this cannot be done per server because i need the total of each server per month.
i need to select the month and then all the servers with total number of prints made so far need to show up.
picture of DB table:

i've tried a lot but this is what's usefull:
select page:
graph page:
thanks in advance
story time:
i have gotten the mission to put the total prints made each month in a graph.
Now the graph is no problem but the way i get that data is. This is because
every day the total number of prints made is updated, meaning i get an extra
record per printer every day. The number of total prints made is not reset each month.
every date is recorded by means of this date format: 1-8-2006
i am searching for a way to get this data to show up right.
this cannot be done per server because i need the total of each server per month.
i need to select the month and then all the servers with total number of prints made so far need to show up.
picture of DB table:

i've tried a lot but this is what's usefull:
select page:
Code: Select all
$rsa = $db->Execute("SELECT datum FROM @@@@@@_printer_stats GROUP BY datum ORDER BY datum DESC");
echo ('<form action="/index.php?pagename=printerstotaal" method="POST">
<select name="datum">
<option value= "0" selected> Selecteer datum:
');
while (!$rsa->EOF)
{
$s_datum = $rsa->Fields['datum']->value;
//$timestamp = strtotime($s_datum);
$correctdate = date("F", strtotime($s_datum));
echo "<option value=$correctdate> $correctdate";
$rsa->movenext();
}
echo ('</select>
<input type="image" name="submit" src="/gispen/submit.gif" width="75" height="17">
</form>');
if (isset($_POST['datum']))
{
$datum = $_POST['datum'];
echo " <img src=http://www.@@@@@@.net/@@@@@@/jpgraph_printers_Totaal.php?datum=".$datum.">";graph page:
Code: Select all
$rs = $objConn->Execute("SELECT datum, naam, totaal FROM @@@@@@_printer_stats
WHERE (naam = 'pr0150')");
while (!$rs->EOF)
{
$s_datum = $rs->Fields['datum']->value;
$s_naam = $rs->Fields['naam']->value;
$s_totaal[] = $rs->Fields['totaal']->value;
//settype($s_totaal, "string");
$DBasetime = strtotime($s_datum);
$correctdate = date("F", strtotime($DBasetime));thanks in advance

