// formler
$takarea = $langd * $bredd;
$volym = $takarea * $hojd;
// Ersätt "," med "." eftersom folk kommer använda "," före decimaler
$langd = str_replace(",", ".", $langd);
$bredd = str_replace(",", ".", $bredd);
$hojd = str_replace(",", ".", $hojd);
$hz250 = str_replace(",", ".", $hz250);
$hz500 = str_replace(",", ".", $hz500);
$hz1000 = str_replace(",", ".", $hz1000);
$hz2000 = str_replace(",", ".", $hz2000);
$hz4000 = str_replace(",", ".", $hz4000);
$onskad_efterklangstid = str_replace(",", ".", $onskad_efterklangstid);
if($uppmatt=="ja") {
$medelhz = ($hz250 + $hz500 + $hz1000 + $hz2000 + $hz4000) / 5;
} elseif($uppmatt=="nej") {
$medelhz = $hz1000;
}
// Absoflex absorptionskooffecient medelvärde
$aak = 0.916;
if($onskad_efterklangstid and $medelhz) {
// sabines formel för uträkning av efterklangstid
$absorption = (0.16 * $volym / ($onskad_efterklangstid * $aak)) - (0.16 * $volym / ($medelhz * $aak));
$rumsabsorption = 0.16 * $volym / $medelhz;
$bullersankning = LOG10(($absorption + $rumsabsorption) / $rumsabsorption) * 10;
$efterklangstid = 0.16 * $volym * $absorption;
}
if ($takarea) {
$takintackning = round($absorption / $takarea * 100, 1);
}
if ($absorption) {
$efterklangstid_efter = 0.16 * $volym / ($rumsabsorptiont + ($absorption * $aak));
}
?>
Uppgifter om lokalen
if ($uppmatt=="ja" and $hz250 and $hz500 and $hz1000 and $hz2000 and $hz4000) { ?>
Uppmätt efterklangstid (sekunder)
} elseif($uppmatt=="nej" and $hz1000 and $onskad_efterklangstid) {?>
Ej uppmätt efterklangstid
} if($uppmatt=="ja" and $hojd and $langd and $bredd and $uppmatt) { ?>
} elseif($uppmatt=="nej" and $hojd and $langd and $bredd and $uppmatt) { ?>
} else { ?>
checked}?>>
Jag har efterklangstiden uppmätt. checked}?>>
Jag har inte efterklangstiden uppmätt.
} ?>
if ($submit and $hojd and $langd and $bredd and $uppmatt) {
if ($edit) { ?>
} elseif($langd and $bredd and $hojd) { ?>
Börja om
} } else { ?>
} ?>
if ($submit) {
if(!$langd) {
print("Du måste fylla i rummets längd. ");
}
if(!$bredd) {
print("Du måste fylla i rummets bredd. ");
}
if(!$hojd) {
print("Du måste fylla i rummets höjd. ");
}
if ($uppmatt=="ja" and $hz250 and $hz500 and $hz1000 and $hz2000 and $hz4000) { ?>
Resultat för uppmätt efterklangstid
Tillförd mängd absorption:
0 m²
Bullersänkning i efterklangsfältet:
0 dB
Takintäckning:
%
Efterklangstid efter åtgärd:
0 sekunder
Tillförd mängd absorbenter. Alternativa format
Format:
Antal:
1200x600x50
$antal1 = round($absorption/0.91, 0);
print($antal1); ?> st
1200x1000x50
$antal2 = round($absorption/1.43, 0);
print($antal2); ?> st
Summa produktpris enligt prislista (ca.) *
Palett:
0 kr
Sonett:
0 kr
Soft:
0 kr
Sport:
0 kr
* Moms och frakt tillkommer.
} elseif ($uppmatt=="nej" and $langd and $bredd and $hojd and !$medelhz and !$onskad_efterklangstid) { ?>
Ej uppmätt efterklangstid
Uppskattad efterklangstid i sekunder (1000 Hz)
Önskad efterklangstid efter Åtgärd (sek.)
} elseif ($uppmatt=="nej" and $onskad_efterklangstid and !$hz1000) { ?>
Ej uppmätt efterklangstid
Uppskattad efterklangstid i sekunder (1000 Hz)
Önskad efterklangstid efter Åtgärd (sek.)
Du måste fylla i uppskattad efterklangstid.
} elseif ($uppmatt=="nej" and !$onskad_efterklangstid and $hz1000) { ?>
Ej uppmätt efterklangstid
Uppskattad efterklangstid i sekunder (1000 Hz)
Önskad efterklangstid efter Åtgärd (sek.)
Du måste fylla i önskad efterklangstid.
} elseif ($uppmatt=="nej" and $onskad_efterklangstid) { ?>
Resultat för ej uppmätt efterklangstid
Tillförd mängd absorption:
0 m²
Bullersänkning i efterklangsfältet:
0 dB
Takintäckning:
%
Efterklangstid efter åtgärd:
0 sekunder
Tillförd mängd absorbenter. Alternativa format
Format:
Antal:
1200x600x50
$antal1 = round($absorption/0.91, 0);
print($antal1); ?> st
1200x1000x50
$antal2 = round($absorption/1.43, 0);
print($antal2); ?> st
Summa produktpris enligt prislista (ca.) *
Palett:
0 kr
Sonett:
0 kr
Soft:
0 kr
Sport:
0 kr
* Moms och frakt tillkommer.
} elseif ($uppmatt=="ja" and $langd and $bredd and $hojd) { ?>
Uppmätt efterklangstid
Önskad efterklangstid: sekunder
} elseif (!$uppmatt) { ?>
Du måste välja om efterklangstiden är uppmätt eller ej.
} } ?>