Location: PHPKode > projects > VIRTUAL.ID > PHP PFE/page_fiscal.php
<?
session_start();

error_reporting(0);
$_SESSION['listner_fiscal']=1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Administration En Ligne</title>
<style type="text/css">
<!--
.Style1 {
	font-size: 24px;
	font-weight: bold;
	color: #006699;
}
.Style4 {font-size: 14}
.Style7 {
	font-size: 12px;
	color: #000000;
}
.Style8 {
	font-size: 16px;
	color: #CC0000;
}
.Style9 {font-size: 14px}
.Style12 {font-size: 14px; color: #333333; }
.Style14 {font-size: 18px; color: #333333; }
a:link {
	color: #333333;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #333333;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.Style17 {
	font-size: 18px;
	font-weight: bold;
	color: #FFFFFF;
}
.Style19 {
	font-size: 12px;
	font-weight: bold;
}
.Style21 {font-size: 12px; font-weight: bold; color: #990000; }
.Style22 {
	font-size: 14px;
	font-weight: bold;
	color: #990000;
}
.Style27 {font-size: 14px; font-weight: bold; color: #000000; }
.Style28 {color: #FFFFFF; font-weight: bold; font-size: 16px; }
.Style29 {
	font-size: 16px;
	font-weight: bold;
	color: #000000;
}
.Style30 {
	font-size: 16px;
	color: #000000;
}
-->
</style>
</head>
<?php

 if (isset($_POST['password'])) 
{		
$pwd=$_POST["password"];

if($pwd==$_SESSION['u_password'])
{
$_SESSION['page_fiscal']=1;
$_SESSION['listner_fiscal']=1;
}
else
$_SESSION['page_fiscal']=2;


}


?>


<body>
<table width="1007" height="273" border="0" align="center">
  <tr>
    <td height="155"><div align="center"><img src="img\entete.jpg" width="841" height="136" /></div></td>
  </tr>
  <tr>
    <td><table width="810" border="0" align="center">
      <tr>
        <td><div align="center"><span class="Style1">Consultation du dossier fiscal</span></div></td>
      </tr>
      <tr>
	  
        <td width="804"><div align="center" class="Style1">
		
		  <p class="Style8"><span class="Style10">

              <?php
		  if($_SESSION['listner_fiscal']==1)
		  {
		  ?>
              <span class="Style14">Bienvenue <?php if(isset($_SESSION['name_user']))
echo $_SESSION['name_user']." ".$_SESSION['second_name_user']."!"; ?></span></p>
		  <p><span class="Style12"><a href="index.php">D&eacute;connexion</a> --- <a href="Page_services.php">Retour &agrave; la page pr&eacute;c&eacute;dente</a> </span></p>
		  <?php
		  }
		 ?>
          </p>
<p>
		    <p>
		      <?php
		
		if($_SESSION['page_fiscal']==0 || $_SESSION['page_fiscal']==2)
		{
		?>
		        <form id="form1" name="form1" method="post" action="">
            <label><span class="Style4"><span class="Style7"><br />
            <span class="Style9">Retapper votre mot de passe:</span>              </span>
            <input type="password" name="password" />
            </span> </label>
            <label>
            <input type="submit" name="Submit" value="Valider" />
            </label>
          </form>
		  <p>
		  </p>
		  </div>    
          <div align="center" class="Style22">
            <?php
		  if($_SESSION['page_fiscal']==2)
		  echo "Mot de passe incorrect!";
		  ?></div></td>
      </tr>
      <tr>
        <td><div align="center">
		
		
		<table align="center" border="0" bordercolorlight="#000033" style="border-style:inherit"><tr><td bgcolor="#8DA8D8"><div align="center"><span class="Style17">Procédure de calcul des impôts sur le revenu</span></div></td>
		</tr>
		  <tr>
		    <td height="17" bgcolor="#CCCCCC"><span class="Style19">-R&eacute;duction 90Dt Pour le 1er enfant, et 15Dt de moins pour l'enfant suivant. </span>		      </td>
		    </tr>
		  <tr>
		    <td height="17" bgcolor="#CCCCCC"><span class="Style19">-200Dt de plus pour chaque local.</span></td>
		    </tr>
		  <tr>
		    <td height="17" bgcolor="#CCCCCC"><span class="Style19">-15% de revenu, si  revenu &lt;5000Dt et 20% si revenu &gt;5000Dt. </span></td>
		    </tr>
		  <tr>
		    <td height="17" bgcolor="#CCCCCC"><div align="center"><span class="Style21">(cette formule est juste pour les tests)</span></div></td>
		    </tr>
		</table>
		
		  <?php
		  }
		  ?>
		
		<?php
		if($_SESSION['page_fiscal']==1)
		{
		//connexion a l'annuaire
		$ds=ldap_connect("localhost:10389");// or die ("Connection a l'annuaire impossible");
		ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
		$r=ldap_bind($ds,"uid=".$_SESSION['u_user'].",dc=marop,dc=tn",$_SESSION['u_password']);
		
	
		
		//code de recherche
		$dn = "dc=marop,dc=tn";
		$filtre="(|(sn=*)(cn=*))";
		$restriction = array();
		$sr=ldap_search($ds, $dn, $filtre, $restriction);
		$info = ldap_get_entries($ds, $sr);
		
		?>
		
		<table align="center" border="0" bordercolorlight="#000033" style="border-style:inherit">
		
		<tr><td width="225" bgcolor="#78A2ED"><div align="center" class="Style28">Infos</div></td>
		<td width="140" bgcolor="#78A2ED"><div align="center" class="Style28">Montant</div></td>
		</tr>
		
		
		<tr><td bgcolor="#CCCCCC"><span class="Style27">Vous avez <?php echo $info[0]["gidnumber"][0]; ?> enfant(s)</span></td>
		<td bgcolor="#CCCCCC"><span class="Style27">
		- 
		    <?php
		
		if($info[0]["gidnumber"][0]=="0")
		{
		echo "0";
		$result_enfant=0;
		}
		
		else if($info[0]["gidnumber"][0]=="1")
		{
		echo "90";
		$result_enfant=90;
		}
		else if($info[0]["gidnumber"][0]=="2")
		{
		echo "165";
		$result_enfant=165;
		}
		else if($info[0]["gidnumber"][0]=="3")
		{
		echo "215";
		$result_enfant=215;
		}
		else if($info[0]["gidnumber"][0]=="4")
		{
		echo "250";
		$result_enfant=250;
		}
		 ?>
		Dt</span></td></tr>
		<tr>
		  <td bgcolor="#CCCCCC"><span class="Style27">Nombre de locaux vaut <?php echo $info[0]["departmentnumber"][0]; ?></span></td>
		  <td bgcolor="#CCCCCC"><span class="Style27">+
		<?php
		$resultat_local=$info[0]["departmentnumber"][0]*200;
		echo $resultat_local;
		?>
		Dt</span></td>
		</tr>
		<tr><td bgcolor="#CCCCCC"><span class="Style27">Votre revenu annuel est <?php 
		
		$rev=($info[0]["personaltitle"][0])*12; 
		echo $rev;
		?>Dt</span>
		
		</td><td bgcolor="#CCCCCC"><span class="Style27">+
		<?php
		if($rev<5000)
		$rev_a=($rev*15)/100;
		
		else if($rev>5000)
		$rev_a=($rev*20)/100;
		
		echo $rev_a;
		?>
		Dt</span>
		
		</td></tr>
		
		<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
		<tr><td bgcolor="#CCCCCC">
		  <div align="right" class="Style29">Total des impôts: </div></td>
		<td bgcolor="#CCCCCC"><span class="Style30">
		  <?php 
		echo ($rev_a+$resultat_local)-$result_enfant;
		?>
		Dt</span></td>
		</tr>
		</table>
		
		
		<?php
		}
		?>
		
		</div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><div align="center"><img src="img\bas.jpg" width="841" height="79" /></div></td>
  </tr>
</table>
</body>
</html>
Return current item: VIRTUAL.ID