<?php
$number = "64037";
$d=date("d");
if ($d=="01") {
$jobs = "256";
} else if ($d=="02") {
$jobs = "512";
} else if ($d=="03") {
$jobs = "768";
} else if ($d=="04") {
$jobs = "1024";
} else if ($d=="05") {
$jobs = "1280";
} else if ($d=="06") {
$jobs = "1536";
} else if ($d=="07") {
$jobs = "1792";
} else if ($d=="08") {
$jobs = "2048";
} else if ($d=="09") {
$jobs = "2304";
} else if ($d=="10") {
$jobs = "2560";
} else if ($d=="11") {
$jobs = "2816";
} else if ($d=="12") {
$jobs = "3072";
} else if ($d=="13") {
$jobs = "3328";
} else if ($d=="14") {
$jobs = "3584";
} else if ($d=="15") {
$jobs = "3840";
} else if ($d=="16") {
$jobs = "4096";
} else if ($d=="17") {
$jobs = "4352";
} else if ($d=="18") {
$jobs = "4608";
} else if ($d=="19") {
$jobs = "4864";
} else if ($d=="20") {
$jobs = "5120";
} else if ($d=="21") {
$jobs = "5376";
} else if ($d=="22") {
$jobs = "5632";
} else if ($d=="23") {
$jobs = "5888";
} else if ($d=="24") {
$jobs = "6144";
} else if ($d=="25") {
$jobs = "6400";
} else if ($d=="26") {
$jobs = "6656";
} else if ($d=="27") {
$jobs = "6912";
} else if ($d=="28") {
$jobs = "7168";
} else if ($d=="29") {
$jobs = "7424";
} else if ($d=="30") {
$jobs = "7680";
} else if ($d=="31") {
$jobs = "7936";
}
$sum = $number + $jobs;
echo $sum;
?>
<html>
<head>
<style type="text/css">
div.cont {
position: relative;
background-image: url(counter.gif);
width:160px;
height:110px;
vertical-align:text-bottom;
}
div.cont div.ans
{
position: absolute;
bottom: 0px;
margin-bottom:15px;
margin-left:7px;
color:black;
font-family: Verdana, Tahoma, Sans-Serif;
font-size: 15pt;
line-height: normal;
}
</style>
<?php
$now = time();
$start = mktime(0, 0, 0, 19, 10, 2010);
$carbonsaving =((($start - $now) * 0.0058774) + 130000);
$format = round($carbonsaving, 2);
// in this example
// $now = a unix timestamp of this very second
// $start is the date that you want the counter to start from sent over //as a unix timestamp
// $carbonsaving is the calculation that you want to perform to get //your base figure
// i.e. total saving = ((date now - start date)* growth rate) + base rate
// this gives us the starting saving all that needs to be done is increment it with javascript
?>
<script type="text/javascript">
// we need to import our server side variable into javascript to let it increment live
var car = <?php print($format); ?>;
var rou
function incs()
{
car = car + 0.01;
rou = Math.round(car*100)/100
document.getElementById("carb").innerHTML=rou;
}
// what function incs does is take car and adds 0.01 to it
//rou rounds the figure to 2 dp
//the document.getElementById("carb") can refer to a <p> tag //<span> or whatever and just says with .innerHTML=rou; that the //value between the results of rou
//hope this helps
//Nicholas King
//ecotricity
</script>
</head>
<!-- body onload setInterval tells the page to load our javascript function and repeat it by every x microseconds, so this repeats every 2 seconds //-->
<body onload="setInterval('incs()', 2000)">
<div class="cont">
<div class="ans">
<span id="carb">Calculating...</span>
</div>
</div>
</body>
</html>
echo $sum;
echo "<b><center>";
echo $sum;
echo "</b></center>";
echo "<div style='font-size:18px; font-weight:bold; color:#F00; text-align:center;'>";
echo $sum;
echo "</div>";
Time to create page: 0.057 seconds