asked on
<?
$vol = isset($_REQUEST['vol']) ? $_REQUEST['vol'] : "40";
$shape = $_REQUEST['shape'];
//$width = $_REQUEST['width'];
$city = isset($_REQUEST['city']) ? $_REQUEST['city'] : "mel";
$rating = $_REQUEST['rating'];
$temp_set = $_REQUEST['temp_set'];
$peak = $_REQUEST['peak'];
$hrs = $_REQUEST['hrs'];
$yearly_kw = isset($_REQUEST['yearly_kw']) ? $_REQUEST['yearly'] : 1.0;
//to retain values you need to read in the values before the form
// Pass On Volume & Volume Calc Variables
$vols=array("","","","","","","","","","","","","","");
switch(strval($vol))
{
case "20":
default:
$vols[0]=" selected='selected' ";
break;
case "25":
default:
$vols[1]=" selected='selected' ";
break;
case "30":
default:
$vols[2]=" selected='selected' ";
break;
case "35":
default:
$vols[3]=" selected='selected' ";
break;
case "40":
default:
$vols[4]=" selected='selected' ";
break;
case "45":
default:
$vols[5]=" selected='selected' ";
break;
case "50":
default:
$vols[6]=" selected='selected' ";
break;
case "55":
default:
$vols[7]=" selected='selected' ";
break;
case "60":
default:
$vols[8]=" selected='selected' ";
break;
case "65":
default:
$vols[9]=" selected='selected' ";
break;
case "70":
default:
$vols[10]=" selected='selected' ";
break;
case "75":
default:
$vols[11]=" selected='selected' ";
break;
case "80":
default:
$vols[12]=" selected='selected' ";
break;
case "85":
default:
$vols[13]=" selected='selected' ";
break;
case "90":
default:
$vols[14]=" selected='selected' ";
break;
}
}
$cities=array("","","","");
$temp_sets=array("","","","");
$ratings=array("","","","");
$peaks=array("","","","");
$hrss=array("","","","");
switch( strval($city) )
{
case "chr":
$cities[9]=" selected='selected' ";
break;
case "wel":
$cities[8]=" selected='selected' ";
break;
case "auc":
$cities[7]=" selected='selected' ";
break;
case "hob":
$cities[6]=" selected='selected' ";
break;
case "ade":
$cities[5]=" selected='selected' ";
break;
case "can":
$cities[4]=" selected='selected' ";
break;
case "per":
$cities[3]=" selected='selected' ";
break;
case "bri":
$cities[2]=" selected='selected' ";
break;
case "syd":
$cities[1]=" selected='selected' ";
break;
case "mel":
default:
$city="mel";
$cities[0]=" selected='selected' ";
break;
}
switch( strval($temp_set) )
{
case "30":
$temp_sets[3]=" selected='selected' ";
break;
case "28":
$temp_sets[2]=" selected='selected' ";
break;
case "26":
$temp_sets[1]=" selected='selected' ";
break;
case "24":
default:
$temp_set=24;
$temp_sets[0]=" selected='selected' ";
break;
}
switch( strval($rating) )
{
case "24":
$ratings[3]=" selected='selected' ";
break;
case "15":
$ratings[2]=" selected='selected' ";
break;
case "11":
$ratings[1]=" selected='selected' ";
break;
case "7.8":
$ratings[0]=" selected='selected' ";
break;
}
switch( strval($peak) )
{
case "peak":
$peaks[1]=" selected='selected' ";
break;
case "offpeak":
default:
$peaks=offpeak;
$peaks[0]=" selected='selected' ";
break;
}
switch( strval($hrs) )
{
case "15":
$hrss[3]=" selected='selected' ";
break;
case "12":
$hrss[2]=" selected='selected' ";
break;
case "9":
$hrss[1]=" selected='selected' ";
break;
case "6":
default:
# $hrss=6;
$hrss[0]=" selected='selected' ";
break;
}
?>
<script>
function toggle(id){
ul = "ul_" + id;
img = "img_" + id;
ulElement = document.getElementById(ul);
imgElement = document.getElementById(img);
if (ulElement){
if (ulElement.className == 'closed'){
ulElement.className = "open";
imgElement.src = "images/stories/bullets/up_1.png";
}
else{
ulElement.className = "closed";
imgElement.src = "images/stories/bullets/down_1.png";
}
}
}
</script>
<script>
function fnFormatField(id)
{
r = roundNumber(parseInt(id.value),2);
id.value = addCommas(r + '');
}
function addCommas(nStr)
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
function roundNumber(num, dec) {
var result = Math.round(num/Math.pow(10,dec))*Math.pow(10,dec);
return result;
}
function updatePage()
{
document.getElementById("theForm").submit();
}
</script>
<script>
imgout=new Image(9,9);
imgin=new Image(9,9);
/////////////////BEGIN USER EDITABLE///////////////////////////////
imgout.src="images/stories/icons/arrow_up.png";
imgin.src="images/stories/icons/arrow_down.png";
///////////////END USER EDITABLE///////////////////////////////////
//this switches expand collapse icons
function filter(imagename,objectsrc){
if (document.images){
document.images[imagename].src=eval(objectsrc+".src");
}
}
//show OR hide funtion depends on if element is shown or hidden
function shoh(id) {
if (document.getElementById) { // DOM3 = IE5, NS6
if (document.getElementById(id).style.display == "none"){
document.getElementById(id).style.display = 'block';
filter(("img"+id),'imgin');
} else {
filter(("img"+id),'imgout');
document.getElementById(id).style.display = 'none';
}
} else {
if (document.layers) {
if (document.id.display == "none"){
document.id.display = 'block';
filter(("img"+id),'imgin');
} else {
filter(("img"+id),'imgout');
document.id.display = 'none';
}
} else {
if (document.all.id.style.visibility == "none"){
document.all.id.style.display = 'block';
} else {
filter(("img"+id),'imgout');
document.all.id.style.display = 'none';
}
}
}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function KW_getVal(o){ //v1.2
var retVal="0";if (o.type=="select-one")
{retVal=(o.selectedIndex==-1)?0:o.options[o.selectedIndex].value;}
else if (o.length>1){for (var i=0;i<o.length;i++) if (o[i].checked) retVal=o[i].value;
} else if (o.type=="checkbox") {retVal=(o.checked)?o.value:0;} else {
retVal=Number(o.value)}return parseFloat(retVal);
}
function KW_calcForm() { //v1.2
var str="",a=KW_calcForm.arguments; for (var i=3;i<a.length;i++)
str+=(a[i].indexOf("#")==-1)?a[i]:KW_getVal(MM_findObj(a[i].substring(1)));
t=Math.round(a[1]*eval(str))/a[1];tS=t.toString();if(a[2]>0){tSp=tS.indexOf(".");
if(tSp==-1) tS+=".";tSp=tS.indexOf(".");while(tSp!=(tS.length-1-a[2])){tS+="0";
tSp=tS.indexOf(".");}} MM_findObj(a[0]).value=tS;
}
</script>
<script type="text/javascript">
function CheckKeyCode()
{
if( (event.keyCode == 189 || event.keyCode == 109) ||
(event.keyCode == 8 || event.keyCode == 32) ||
(event.keyCode >= 48 && event.keyCode <= 57) ||
(event.keyCode >= 96 && event.keyCode <= 105) ) {
return true; }
else {
return false;
}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
</script>
</head>
<body <? $rick=$_POST[rick]; if($rick != 'rick') echo ' onLoad="updatePage()" '; ?> >
<br>
<table style="border-collapse: collapse" bordercolor="#000000" cellspacing="0" cellpadding="3" border="0" class="style32">
</table>
<?php
$flashFile="./heat_calc/MSCombiDY2D.swf";
$dbname = 'poolexpress_com_au_-_02';
$dbname = 'charts_xml';
?>
<style type="text/css">
<!--
.style3 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#555 }
.style32 {font-size: 11px; font-family: Arial, Helvetica, sans-serif; color:#555 }
.city { font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight:bold; color:#555 }
.location { font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight:normal; color:#555 }
.main1 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #e6eff7; border-bottom-color:#e6eff7; text-align:center;}
.main1b { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight:bold; background-color: #e6eff7; border-bottom-color:#e6eff7; text-align:center;}
.row1 { font-family: Arial, Helvetica, sans-serif; font-size: 11px; background-color: #e6eff7; border-bottom-color:#e6eff7; text-align:center;}
.row1b { font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight:bold; background-color: #e6eff7; border-bottom-color:#e6eff7; text-align:center;}
.row2 { font-family: Arial, Helvetica, sans-serif; font-size: 11px; background-color: #d7e6f2; border-bottom-color:#d7e6f2; text-align:center;}
.row2b { font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight:bold; background-color: #d7e6f2; border-bottom-color:#d7e6f2; text-align:center;}
.row3 { font-family: Arial, Helvetica, sans-serif; font-size: 11px; background-color: #d7e6f2; border-color:#d7e6f2; text-align:center;}
.row3b { font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight:bold; background-color: #d7e6f2; border:solid; border-color:#d7e6f2 text-align:center; bor}
.dropdown1 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#555 }
.dropdown2 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color:#555 }
-->
</style>
<br>
<form action="index.php?option=com_content&view=article&id=37&Itemid=88" method="post" name="theForm" target="_self" id="theForm" >
<input type="hidden" name="rick" value="rick">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table border="0" cellpadding="0" cellspacing="0" style="margin-bottom:0px; padding-bottom:0px" width="100%">
<tbody>
<tr>
<td width="100%" valign="top" class="data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-tl_10.png" width="10" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-top.png" width="100%" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-tr_10.png" width="10" height="10"></td>
</tr>
<tr>
<td background="templates/rt_hivemind_j15/images/light/modules/style2/module-left.png"> </td>
<td width="100%"><table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-bottom:-0px; padding-bottom:-10px">
<tbody>
<tr>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/stories/bullets/bullet_y1.png" width="17" height="17"></td>
<td nowrap="nowrap" class="style32"><span class="dropdown1"><img src="s.gif" alt="" width="5" height="5" /></span></td>
<td nowrap="nowrap" class="style32"><span class="dropdown1">Your pool's volume : </span></td>
<td nowrap="nowrap" class="style32"><span class="dropdown1">
<select name="vol" class="dropdown2" id="vol" style="width:95px" onChange="updatePage()">
<option value="20" <?=$vols[0]?> >20,000 litres</option>
<option value="25" <?=$vols[1]?> >25,000 litres</option>
<option value="30" <?=$vols[2]?> >30,000 litres</option>
<option value="35" <?=$vols[3]?> >35,000 litres</option>
<option value="40" <?=$vols[4]?> >40,000 litres</option>
<option value="45" <?=$vols[5]?> >45,000 litres</option>
<option value="50" <?=$vols[6]?> >50,000 litres</option>
<option value="55" <?=$vols[7]?> >55,000 litres</option>
<option value="60" <?=$vols[8]?> >60,000 litres</option>
<option value="65" <?=$vols[9]?> >65,000 litres</option>
<option value="70" <?=$vols[10]?> >70,000 litres</option>
<option value="75" <?=$vols[11]?> >75,000 litres</option>
<option value="80" <?=$vols[12]?> >80,000 litres</option>
<option value="85" <?=$vols[13]?> >85,000 litres</option>
<option value="90" <?=$vols[14]?> >90,000 litres</option>
</select>
</span></td>
<td nowrap="nowrap" class="style32"> </td>
<td nowrap="nowrap" class="style32"><span class="dropdown1">- or - <img src="images/stories/icons/arrow_down.png" name="imgfirst" width="18" height="13" border="0" id="imgfirst" /> <a href="javascript:;" onClick="MM_openBrWindow('heat_calc/vol_calc.html','volcalc','width=515,height=385')" >calculate here</a></span></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table></td>
<td background="templates/rt_hivemind_j15/images/light/modules/style2/module-right.png"> </td>
</tr>
<tr>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-bl_10.png" width="10" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-bottom.png" width="100%" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-br_10.png" width="10" height="10"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><span class="dropdown1"><img src="s.gif" alt="" width="15" height="15" /></span></td>
</tr>
<tr>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-tl_10.png" width="10" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-top.png" width="100%" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-tr_10.png" width="10" height="10"></td>
</tr>
<tr>
<td background="templates/rt_hivemind_j15/images/light/modules/style2/module-left.png"> </td>
<td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/stories/bullets/bullet_y1.png" width="17" height="17"></td>
<td nowrap="nowrap" class="style32"><span class="dropdown1"><img src="s.gif" alt="" width="5" height="5" /></span></td>
<td width="100%" nowrap="nowrap" class="style32"><span class="dropdown1">Select your heating and running preferences : </span></td>
<td nowrap="nowrap" class="style32"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"><span class="dropdown1"><img src="s.gif" alt="" width="5" height="5" /></span></td>
</tr>
<tr>
<td><span class="dropdown1"><img src="s.gif" alt="" width="15" height="15" /></span></td>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="36"><img src="images/stories/icons/button1.png" width="16" height="16" /></td>
<td nowrap="nowrap" class="style32"> Your preferred temperature:</td>
</tr>
</table></td>
<td><select name="temp_set" class="dropdown2" id="temp_set" style="width:145px" onChange="updatePage()">
<option value="24" <?=$temp_sets[0]?><? if($temp_set=="24") { echo"selected='selected'"; } ?> >24 Degrees C</option>
<option value="26" <?=$temp_sets[1]?><? if($temp_set=="26") { echo"selected='selected'"; } ?> >26 Degrees C</option>
<option value="28" <?=$temp_sets[2]?><? if($temp_set=="28") { echo"selected='selected'"; } ?> >28 Degrees C</option>
<option value="30" <?=$temp_sets[3]?><? if($temp_set=="30") { echo"selected='selected'"; } ?> >30 Degrees C</option>
</select></td>
</tr>
<tr>
<td colspan="3"><span class="dropdown1"><img src="s.gif" alt="" width="3" height="3" /></span></td>
</tr>
<tr>
<td> </td>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/stories/icons/button1.png" width="16" height="16" /></td>
<td nowrap="nowrap" class="style32">Max running hours/day: </td>
</tr>
</table></td>
<td><select name="hrs" class="dropdown2" id="hrs" style="width:145px" onChange="updatePage()">
<option value="6" <?=$hrs[0]?> <?=$hrss[0]?> <? if($hrs=="6") { echo"selected='selected'"; } ?> >6 hrs per day</option>
<option value="9" <?=$hrs[1]?> <?=$hrss[1]?> <? if($hrs=="9") { echo"selected='selected'"; } ?>>9 hrs per day</option>
<option value="12" <?=$hrs[2]?> <?=$hrss[2]?> <? if($hrs=="12"||$hrs=="") { echo"selected='selected'"; } ?>>12 hrs per day</option>
<option value="15" <?=$hrs[2]?> <?=$hrss[3]?> <? if($hrs=="12"||$hrs=="") { echo"selected='selected'"; } ?>>15 hrs per day</option>
</select></td>
</tr>
<tr>
<td colspan="3"><span class="dropdown1"><img src="s.gif" alt="" width="10" height="10" /></span></td>
</tr>
<tr>
<td> </td>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/stories/icons/button1.png" width="16" height="16" /></td>
<td nowrap="nowrap" class="style32"> When to run heater & filter: </td>
</tr>
</table> </td>
<td><select name="peak" class="dropdown2" style="width:186px" id="peak" onChange="updatePage()">
<option value="offpeak" selected="selected" <?=$peaks[0]?> >Overnight - Off Peak Rates</option>
<option value="peak" <?=$peaks[1]?> >Daytime - Peak Rates</option>
</select></td>
</tr>
<tr>
<td colspan="3"><span class="dropdown1"><img src="s.gif" alt="" width="10" height="10" /></span></td>
</tr>
<tr>
<td> </td>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/stories/icons/button1.png" width="16" height="16" /></td>
<td nowrap="nowrap" class="style32">Select a heater model : </td>
</tr>
</table></td>
<td><select name="rating" class="dropdown2" style="width:145px" id="rating" onChange="updatePage()">
<option value="7.8"<?=$ratings[0]?> >PowerPac 2 - 7.8kW</option>
<option value="11" <?=$ratings[1]?> >PowerPac 3- 11kW</option>
<option value="15" <?=$ratings[2]?> >EdenPac 4 - 15kW</option>
<option value="24" <?=$ratings[3]?> >EdenPac 7 - 24kW</option>
</select></td>
</tr>
</table></td>
<td background="templates/rt_hivemind_j15/images/light/modules/style2/module-right.png"> </td>
</tr>
<tr>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-bl_10.png" width="10" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-bottom.png" width="100%" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-br_10.png" width="10" height="10"></td>
</tr>
</table> </td>
<td valign="top"><span class="dropdown1"><img src="s.gif" alt="" width="20" height="20" /></span></td>
<td valign="top"><table width="250" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-tl_10.png" width="10" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-top.png" width="100%" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-tr_10.png" width="10" height="10"></td>
</tr>
<tr>
<td background="templates/rt_hivemind_j15/images/light/modules/style2/module-left.png"> </td>
<td width="100%"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/stories/bullets/bullet_y1.png" width="17" height="17"></td>
<td nowrap="nowrap" class="style32"><span class="dropdown1"><img src="s.gif" alt="" width="5" height="5" /></span></td>
<td nowrap="nowrap"><span class="style32"><span class="dropdown1">Your Nearest City : </span></span></td>
<td nowrap="nowrap" class="style32"><select name="city" class="select1" id="city" onChange="this.form.submit();" >
<option value="mel" selected="selected" <?=$cities[0]?> >Melbourne</option>
<option value="syd" <?=$cities[1]?> >Sydney</option>
<option value="bri" <?=$cities[2]?> >Brisbane</option>
<option value="per" <?=$cities[3]?> >Perth</option>
<option value="can" <?=$cities[4]?> >Canberra</option>
<option value="ade" <?=$cities[5]?> >Adelaide</option>
<option value="hob" <?=$cities[6]?> >Hobart</option>
<option value="auc" <?=$cities[7]?> >Auckland</option>
<option value="wel" <?=$cities[8]?> >Wellington</option>
<option value="chr" <?=$cities[9]?> >Christchurch</option>
</select></td>
</tr>
</table>
</td>
<td background="templates/rt_hivemind_j15/images/light/modules/style2/module-right.png"> </td>
</tr>
<tr>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-bl_10.png" width="10" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-bottom.png" width="100%" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-br_10.png" width="10" height="10"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><span class="dropdown1"><img src="s.gif" alt="" width="15" height="15" /></span></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-tl_10.png" width="10" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-top.png" width="100%" height="10"></td>
<td><img src="templates/rt_hivemind_j15/images/light/modules/style2/module-tr_10.png" width="10" height="10"></td>
</tr>
<tr>
<td background="templates/rt_hivemind_j15/images/light/modules/style2/module-left.png"> </td>
<td width="100%"><?
// rightside pics
if ($city == 'syd') echo "<span class=\"city\">Sydney</span><span class=\"location\"> - 35.56<sup>o</sup>S, 151.2 <sup>o</sup>E, Alt. 20m</span> \n";
elseif ($city == 'mel') echo "<span class=\"city\">Melbourne</span><span class=\"location\"> - 37.49<sup>o</sup>S, 144.58<sup>o</sup>E, Alt. 32m</span> \n";
elseif ($city == 'bri') echo "<span class=\"city\">Brisbane</span><span class=\"location\"> - 27.42<sup>o</sup>S, 152.7<sup>o</sup>E, Alt. 10m</span> \n";
elseif ($city == 'per') echo "<span class=\"city\">Perth</span><span class=\"location\"> - 31.93<sup>o</sup>S, 115.97<sup>o</sup>E, Alt. 29m</span> \n";
elseif ($city == 'ade') echo "<span class=\"city\">Adelaide</span><span class=\"location\"> - 34.97<sup>o</sup>S, 138.53<sup>o</sup>E, Alt. 14m</span> \n";
elseif ($city == 'hob') echo "<span class=\"city\">Hobart</span><span class=\"location\"> - 42.83<sup>o</sup>S, 147.5<sup>o</sup>E, Alt. 51m</span> \n";
elseif ($city == 'can') echo "<span class=\"city\">Canberra</span><span class=\"location\"> -35.32<sup>o</sup>S, 149.2<sup>o</sup>E, Alt. 577m</span> \n";
elseif ($city == 'auc') echo "<span class=\"city\">Auckland</span><span class=\"location\"> - 37.0<sup>o</sup>S, 174.8<sup>o</sup>E, Alt. 6m</span> \n";
elseif ($city == 'wel') echo "<span class=\"city\">Wellington</span><span class=\"location\"> - 41.3<sup>o</sup>S, 174.8<sup>o</sup>E, Alt. 67m</span> \n";
elseif ($city == 'chr') echo "<span class=\"city\">Christchurch</span><span class=\"location\"> - 43.5<sup>o</sup>S, 172.6<sup>o</sup>E, Alt. 34m</span> \n"; ?>
<br />
<img width="9" src="s.gif" height="9" /></td>
<td background="templates/rt_hivemind_j15/images/light/modules/style2/module-right.png"> </td>
</tr>
<tr>
<td colspan="3"><table height="127px" width="100%" border="0" cellpadding="0" cellspacing="0" background="
<?
if ($city == 'syd') echo "..\images\stories\cities\sydney.jpg";
elseif ($city == 'mel') echo "..\images\stories\cities\melbourne.jpg";
elseif ($city == 'bri') echo "..\images\stories\cities\brisbane.jpg";
elseif ($city == 'per') echo "..\images\stories\cities\perth.jpg";
elseif ($city == 'ade') echo "..\images\stories\cities\adelaide.jpg";
elseif ($city == 'hob') echo "..\images\stories\cities\hobart.jpg";
elseif ($city == 'can') echo "..\images\stories\cities\canberra.jpg";
elseif ($city == 'auc') echo "..\images\stories\cities\auckland.jpg";
elseif ($city == 'wel') echo "..\images\stories\cities\wellington.jpg";
elseif ($city == 'chr') echo "..\images\stories\cities\christchurch.jpg";
?>">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="5"><span class="dropdown1"><img src="s.gif" alt="" width="11" height="11" /></span></td>
</tr>
<tr>
<td><span class="dropdown1"><img src="s.gif" alt="" width="11" height="11" /></span></td>
<td><img src="images/stories/bullets/bullet_y1.png" width="17" height="17"></td>
<td nowrap="nowrap" class="style32"><span class="dropdown1"><img src="s.gif" alt="" width="5" height="5" /></span></td>
<td nowrap="nowrap"><span class="style32"><span class="dropdown1">Results of the heat modeling: </span></span></td>
<td nowrap="nowrap" class="style32"> </td>
</tr>
<tr>
<td colspan="5"><span class="dropdown1"><img src="s.gif" alt="" width="11" height="11" /></span></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-bottom:4px; padding-bottom:-10px">
<tr>
<td>
<div><div><div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td valign="top"><img src="g.gif" width="100%" height="1"></td>
</tr>
<tr>
<td valign="top"><?PHP include "heat_connection.php"; ?>
<?php
//currently it is charting the default selections. If you do NOT want
//the default selections to be charted automatically, uncomment
//the if clause below
//if (isset($_REQUEST['button']))
{
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname) or die(mysql_error());
// Preperation of Data for Chart - temp_no_heat, daily energy_use, temp_with_heat
$query = "SELECT * FROM `heat_data` WHERE `city` = '" . mysql_real_escape_string($city)."' AND `hrs` = '".$hrs."' AND `peak` = '". mysql_real_escape_string($peak) ."' AND `rating` = '". mysql_real_escape_string($rating) ."' AND `vol` = '". mysql_real_escape_string($vol) ."' AND `temp_set` = '".$temp_set."'";
$result = mysql_query($query) or die(mysql_error());
if( mysql_num_rows($result) == 0)
{
// echo "No data available.";
}
else
{
$categories="";
$datasetA="";
$datasetB="";
$datasetC="";
while($row = mysql_fetch_assoc($result))
{
foreach ($row as $k => $v) { $$k = $v;} // EXTRACT VARIABLES // or use PHP function extract();
$categories .= "<category name='$month' hoverText='$month'/>";
$datasetA .= "<set value='$energy_use'/>";
$datasetB .= "<set value='$av_no_heat'/>";
$datasetC .= "<set value='$av_with_heat'/> ";
}
$categories = "<categories fontSize='10'>" . $categories . "</categories>";
$datasetA = "<dataset seriesname='kWhr per day' showValues='0' color='AFD8F8' parentYAxis='P' numberPrefix='' >" . $datasetA . "</dataset>";
$datasetB = "<dataset seriesname='Unheated °C' showValues='1' color='045695' anchorBorderColor='045695' parentYAxis='S' lineThickness='3' >" . $datasetB . "</dataset>";
$datasetC = "<dataset seriesname='Heated °C' showValues='1' color='FF8000' anchorBorderColor='FF8000' parentYAxis='S' lineThickness='3' >" . $datasetC . "</dataset>";
// Graph Display Variables and Adjustments
$xml = "<chart PYAxisName='' SYAxisName='' shownames='1' rotateNames='0' showvalues='0' showLegend='1' rotateNames='0' formatNumberScale='0' divLineDecimalPrecision='1' chartTopMargin='15' SYAxisMaxValue='40' SYAxisMinValue='-5' PYAxisMaxValue='63' numdivlines='7' chartTopMargin='' chartRightMargin='10' chartLeftMargin='10' numberSuffix='kW' sDecimals='1' >" . $categories . $datasetA . $datasetB . $datasetC . "</chart>";
// CHART DEGREES C DISPLAY VARIABLE SnumberSuffix='°C'
mysql_data_seek($result,0);
?>
<!-- INNER TABLE 2 START -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<?PHP
$x = 0;
while($row = mysql_fetch_assoc($result)) {
foreach ($row as $k => $v) { $$k = $v; }
$x++; ?>
<td ><!--INNER TABLE 1 START -->
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="style32" style="border-right:thin; border-right-color:#e2e2e2; border-right-style:solid;">
<tr bgcolor="#e2e2e2" valign="middle">
<? if ($x == 1) { echo "<td nowrap bgcolor=\"#e2e2e2\"> <span class=\"style5\"> Month</span></td>"; ?>
<? } ?>
<td width="38" height="25" nowrap ><div align="right"><span class="style3"><? echo $month ?> </span></div></td>
</tr>
<tr bgcolor="#CCCCCC" valign="middle">
<? if ($x == 1) { echo "<td nowrap bgcolor=\"#FFFFFF\" valign=\"middle\" style=\"border-right:thin; border-right-color:#e2e2e2; border-right-style:solid;\" style=\"border-left:thin; border-left-color:#e2e2e2; border-left-style:solid;\"> <span class=\"style5\"><img src=\"images/stories/bullets/arrow_10_g1t.png\">Avg. Temp - Unheated (<sup>o</sup>C) </span></td>"; } ?>
<td width="38" height="20" nowrap bgcolor="#FFFFFF"><div align="right"><span class="style3"><? echo "".number_format($av_no_heat, 1, '.', ',').""; ?> </span></div></td>
</tr>
<tr bgcolor="#CCCCCC" valign="middle">
<? if ($x == 1) { echo "<td nowrap bgcolor=\"#e2e2e2\" valign=\"middle\" style=\"border-right:thin; border-right-color:#e2e2e2; border-right-style:solid;\" style=\"border-left:thin; border-left-color:#e2e2e2; border-left-style:solid;\"> <span class=\"style5\"><img src=\"images/stories/bullets/arrow_10_g1t.png\">Energy Use (kW hr / day)</span></td>"; } ?>
<td width="38" height="20" nowrap bgcolor="#e2e2e2"><div align="right"><span class="style3">
<? if ($energy_use == 0) { echo $outputValue = "- "; } else echo "". number_format($energy_use, 2, '.', ',')." "; ?>
</span></div></td>
</tr>
<tr bgcolor="#CCCCCC" valign="middle">
<? if ($x == 1) { echo "<td nowrap bgcolor=\"#FFFFFF\" valign=\"middle\" style=\"border-right:thin; border-right-color:#e2e2e2; border-right-style:solid;\" style=\"border-left:thin; border-left-color:#e2e2e2; border-left-style:solid;\"> <span class=\"style5\"><img src=\"images/stories/bullets/arrow_10_g1t.png\">Monthly Running Cost</span></td>"; } ?>
<td width="38" height="20" nowrap bgcolor="#FFFFFF"><div align="right"><span class="style3">
<?
$output = "";
if ($energy_use == 0)
{ $outputValue = "-"; }
elseif ($peak=='peak')
{ $outputValue = "$". number_format($energy_use * 30.42 * 0.15, 0, '.', ','); }
elseif (($peak=='offpeak') and ($hrs=='6'))
{ $outputValue = "$". number_format($energy_use * 30.42 * 0.07, 0, '.', ','); }
elseif (($peak=='offpeak') and ($hrs=='9'))
{ $outputValue = "$". number_format($energy_use * 30.42 * 0.079, 0, '.', ','); }
elseif (($peak=='offpeak') and ($hrs=='12'))
{ $outputValue = "$". number_format($energy_use * 30.42 * 0.0967, 0, '.', ','); }
elseif (($peak=='offpeak') and ($hrs=='15'))
{ $outputValue = "$". number_format($energy_use * 30.42 * 0.1026, 0, '.', ','); }
print "$outputValue "; ?>
</span></div></td>
</tr>
<tr bgcolor="#CCCCCC" valign="middle" >
<? if ($x == 1) { echo "<td nowrap bgcolor=\"#e2e2e2\" valign=\"middle\" style=\"border-right:thin; border-right-color:#e2e2e2; border-right-style:solid;\" style=\"border-left:thin; border-left-color:#e2e2e2; border-left-style:solid;\"> <span class=\"style5\"><img src=\"images/stories/bullets/arrow_10_g1t.png\">Avg. Temp - Heated (<sup>o</sup>C)</span></td>"; } ?>
<td width="38" height="20" nowrap bgcolor="#e2e2e2"><div align="right"><span class="style3"> <? echo "<b>".number_format($av_with_heat, 1, '.', ',')."</b> "; ?></span> </div></td>
</tr>
</table>
<!-- INNER TABLE 1 END -->
<? $sum = $sum + $energy_use; }; ?>
</td>
</tr>
</table>
<!-- INNER TABLE 2 END --></td>
</tr>
<tr>
<td valign="top"><!-- INNER TABLE 2 END -->
<img src="g.gif" width="100%" height="1"></td>
</tr>
</table>
</div></div></div>
</td>
</tr>
</table >
</form>
</body>