Location: PHPKode > scripts > Taxation laws validator > taxation-laws-validator/index.php
<?php

require_once("code_fiscal.class.php");


$res = "";

if (sizeof($_POST)>0) {
    $code = $_POST["code"];
	$tva = $_POST["tva"];
	$fiscal = new codefiscal;
	if (!$fiscal->is_valid($code,$err)) {
		$res .= "<li><font color=red>Code fiscal incorrect : $err</font><br>";
	} else {
		$res .= "<li><font color=green>Code fiscal correct</font><br>";
		if ($fiscal->is_assujete()) {
			$newtva = $fiscal->fix_tva($tva);
		    $res .= "<li><font color=green>Vous bénéficier d'un avantage fiscal - Tva : $newtva </font><br>";
		} else {
			$newtva = $fiscal->fix_tva($tva);
			$res .= "<li><font color=red>Vous n'avez pas d'avantage fiscal - Majoration 25% activée - TVA : $newtva </font><br>";
		}
	}
}


$res .= "<form method=post action=?>

Veuillez entrer votre code fiscal : <input name=code size=40 value=\"$code\">  <input name=tva size=10 value=\"$tva\"> <input type=submit>

</form>";

echo $res;


?>
Return current item: Taxation laws validator