[insert_php] if (!($mylink = mysql_connect(“localhost”,”sawocom_heater”,”heater123456!”)))
{
print “

;could not connect to database\n”;
exit;
}
mysql_select_db(“sawocom_heater”);
[/insert_php]
 
[insert_php] define(‘EZPHP_INCLUDED_POST_TYPES’, ‘page’);

if(isset($_POST[‘search’]))
{
$khx = $_POST[‘kh’];

$rad2= $_POST[‘rad’];
if ($rad2 == “posong”)
{
$l = $_POST[‘length’];
$w = $_POST[‘width’];
$h = $_POST[‘height’];
$xtotal = ($l * $w * $h);

if (isset($_POST[‘c1’]))
{
$x1 = $xtotal + 1.2;
}
else
{
$x1 = $xtotal;
}
if (isset($_POST[‘c2’]))
{
$x2 = $x1 + 1.2;
}
else
{
$x2 = $x1;
}
if (isset($_POST[‘c3’]))
{
$x3 = $x2 + 0.5;
}
else
{
$x3 = $x2;
}

$xaa = $x3 ;
}

$xtc = $_POST[‘tc’];
$rad1= $_POST[‘rad’];
if ($rad1 == “posong1”)
{
$xa = $_POST[‘t1’];

if (isset($_POST[‘c1’]))
{
$x1 = $xa + 1.2;
}
else
{
$x1 = $xa;
}
if (isset($_POST[‘c2’]))
{
$x2 = $x1 + 1.2;
}
else
{
$x2 = $x1;
}
if (isset($_POST[‘c3’]))
{
$x3 = $x2 + 0.5;
}
else
{
$x3 = $x2;
}

$xaa = $x3;
}
echo “
“;
echo “”;

$q = mysql_query(“SELECT MAX(roommax) from heaters_all where controls = ‘$xtc'”);
$rx=mysql_fetch_array($q);
$a = $rx[‘MAX(roommax)’];

if ($a < $xaa ) { if ( $xtc == 1 ) { $ec = "Separate Control"; } if ( $xtc == 2 ) { $ec = "Built-in Control"; } echo "The Highest value you can input in $ec is $a"; } else { if ($xaa == 0 ) { $Altostratus = "SELECT * FROM heaters_all group by alpha "; $all_prod = array(); $r = mysql_query("$Altostratus"); while($row=mysql_fetch_array($r)){ array_push($all_prod,$row['alpha']); } foreach ($all_prod as $value) { $query1= "SELECT * FROM heaters_all where alpha = '$value' "; $r3 = mysql_query("$query1"); $row3=mysql_fetch_array($r3); $piclaz = $row3['claz']; $ae = $row3['heater']; $pic = $row3['link']; echo '[mk_divider style="thin_solid" divider_width="one_half" align="left"]'; echo " 
“;
echo $ae;
echo “
“;
echo ““;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

$sql_get = “Select * from heaters_all where alpha = ‘$value’ “;
$r2 = mysql_query(“$sql_get”);

while($sql_row=mysql_fetch_array($r2)){
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

}
echo ‘

‘;
echo “
Heater Model Name Power Room Min Room Max
“.$sql_row[‘model’].” “.$sql_row[‘modelname’].” “.$sql_row[‘power’].” “.$sql_row[‘roommin’].” “.$sql_row[‘roommax’].”

“;
}

}

else
{

echo “Your sauna room volume is “,$xaa, ” m³”;
echo “\n”;
echo “Below is the list of recommended heaters for your sauna room.”;
echo “”;
echo “”;
if ($khx == ‘1’ or $khx == ‘2’) {
$aa1= “SELECT * FROM heaters_all where(controls = ‘$xtc’ or allxa = ‘$xtc’) and (‘$xaa’ between roommin and roommax) and (mount = ‘$khx’) group by alpha “;
$r = mysql_query(“$aa1”);
}
if ($khx == ‘3’) {
$aa= “SELECT * FROM heaters_all where(controls = ‘$xtc’ or allxa = ‘$xtc’) and (‘$xaa’ between roommin and roommax) group by alpha “;
$r = mysql_query(“$aa”);
}
while($row=mysql_fetch_array($r))
{
$m = $row[‘heater’];
x_model($m,$xtc,$xaa,$khx);
echo “”;
}
}
}

}

function x_model($c,$xtc,$xaa,$khx)
{
$Altostratus1 = “SELECT * FROM heaters_all where (heater = ‘$c’) and (controls = ‘$xtc’ or allxa = ‘$xtc’) and (‘$xaa’ between roommin and roommax) and (mount = ‘$khx’) group by alpha , modelname”;
$Altostratus = “SELECT * FROM heaters_all where (heater = ‘$c’) and (controls = ‘$xtc’ or allxa = ‘$xtc’) and (‘$xaa’ between roommin and roommax) group by alpha , modelname”;
if ($khx == ‘1’ or $khx == ‘2’) {

$r = mysql_query(“$Altostratus1”);
}
if ($khx == ‘3’) {

$r = mysql_query(“$Altostratus”);

}

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

if($r)
{
while($row=mysql_fetch_array($r))
{
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
$ae = $row[‘heater’];
$pic = $row[‘link’];
$piclaz = $row[‘claz’];
}

echo ‘

‘;
echo ” 
“;
echo $ae;
echo “
“;
echo ““;
}
}
?>
Heater Model Name Power Room Min Room Max
“.$row[‘model’].” “.$row[‘modelname’].” “.$row[‘power’].” “.$row[‘roommin’].” “.$row[‘roommax’].”
[/insert_php]