form_filtre.php 3.21 KB
<!DOCTYPE html>
<html>
	<form method="post" action="main.php">
		<input type="submit" name="filt_c2" value="Filtre ON/OFF CH2" class="btn btn-outline-danger"/>
	</form>
	<?php 
		echo "Etat du filtre : ";
		if(strpos($filt_c2,"ON")){
			echo "ON";
			echo "<br/>";
			if(strpos($c2filts,"LP")!=false){
				echo "<form method='post' action='main.php?tab=CH2' oninput='limitesup.value=lim_sup.value;'>";
			}else if(strpos($c2filts,"HP")!=false){
				echo "<form method='post' action='main.php?tab=CH2' oninput='limiteinf.value=lim_inf.value;'>";
			}else{
				echo "<form method='post' action='main.php?tab=CH2' oninput='limitesup.value=lim_sup.value; limiteinf.value=lim_inf.value;'>";
			}
			echo '<fieldset>';
			echo "<label for='c2_filts'>Type du Filtre : </label>";
			echo "<select id='c2_filts' name='c2_filts'>";
			echo "<option value='LP' ";
			if(strpos($c2filts,"LP")!=false) echo "selected";
			echo ">Passe Bas</option>";
			echo "<option value='HP' ";
			if(strpos($c2filts,"HP")!=false) echo "selected";
			echo ">Passe Haut</option>";
			echo "<option value='BP' ";
			if(strpos($c2filts,"BP")!=false) echo "selected";
			echo ">Passe Bande</option>";
			echo "<option value='BR' ";
			if(strpos($c2filts,"BR")!=false) echo "selected";
			echo ">Coupe Bande</option>";
			echo "</select>";
			if(strpos($c2filts,"LP")!=false){
				$limite = strstr($c2filts,"UPPLIMIT");
				$lim_sup=floatval(substr($limite,9,-4));
				echo '<label for="lim_sup" class="form-range">Limite supérieure passe bas</label>';
				echo '<input type="range" id="lim_sup" name="lim_sup" class="form-range" min="5" max="245" step="5" value="'.$lim_sup.'" onchange="this.form.submit();">';
				echo '<br/>';
				echo 'Fréquence : <output for="out" name="limitesup">'.$lim_sup.'</output> MHz';
				echo '<br/>';
			}else if(strpos($c2filts,"HP")!=false){
				$limite = strstr($c2filts,"LOWLIMIT");
				$lim_inf=floatval(substr($limite,9,-4));
				echo '<label for="lim_inf" class="form-range">Limite inférieure</label>';
				echo '<input type="range" id="lim_inf" name="lim_inf" class="form-range" min="5" max="245" step="5" value="'.$lim_inf.'" onchange="this.form.submit();">';
				echo '<br/>';
				echo 'Fréquence : <output for="out" name="limiteinf">'.$lim_inf.'</output> MHz';
				echo '<br/>';
			}else{
				$limite = strstr($c2filts,"UPPLIMIT");
				$lim_sup=floatval(substr($limite,9,-4));
				$limite = strstr($c2filts,"LOWLIMIT");
				$lim_inf=floatval(substr($limite,9,-4));
				echo '<label for="lim_sup" class="form-range">Limite supérieure</label>';
				echo '<input type="range" id="lim_sup" name="lim_sup" class="form-range" min="5" max="245" step="5" value="'.$lim_sup.'" onchange="this.form.submit();">';
				echo '<br/>';
				echo 'Fréquence : <output for="out" name="limitesup">'.$lim_sup.'</output> MHz';
				echo '<br/>';
				echo '<label for="lim_inf" class="form-range">Limite inférieure</label>';
				echo '<input type="range" id="lim_inf" name="lim_inf" class="form-range" min="5" max="245" step="5" value="'.$lim_inf.'" onchange="this.form.submit();">';
				echo '<br/>';
				echo 'Fréquence : <output for="out" name="limiteinf">'.$lim_inf.'</output> MHz';
				echo '<br/>';
			}
			echo '</fieldset>';
			echo "</form>";
		}else{
			echo "OFF";
		}
	?>
</html>