Location: PHPKode > projects > Prolawyer > etude/liste_soldes.php
<?
session_start();
$phpsessid=session_id();
require("./title.php");
            ?>
      </head>

<? 
body();
require("./entete.php"); 
if(!$_POST["min_solde"]) $_POST["min_solde"]=300;
?>

<//table entourant la page//>
<table width=95% align=center><tr><td>

<h1><?echo $liste_soldes_h1?></h1>
<br>
<form method=post action"./liste_soldes.php">
<table><tr><td colspan=8><?echo $liste_soldes_deficit?>&nbsp;
<input size=4 name=min_solde value=<?echo $_POST["min_solde"]?>> <?echo $currency?> </td></tr>
<tr><td colspan=8><?echo "$liste_soldes_rechercher :"?></td></tr>
<tr>
<?
//module pour rechercher les types de dossiers
$restrict="typedossier like 'rien'";
$select=split("\n", $option_gen["dossiers_type"]);
foreach($select as $option){
list($abrev, $nom)=split(",", $option);
$test="";
$checked="";
$test=$_POST["$abrev"];
if($test=="on"){
$checked="checked";
$restrict=$restrict." or typedossier like '$abrev'";
}
if(trim($option)!="")echo "<td>$nom :</td><td width=40><input type=checkbox $checked name=$abrev></td>";
}
$checked="";
if($_POST["others"]=="on"){
$checked="checked";
$restrict=$restrict." or typedossier like ''";
}
echo "<td>$liste_soldes_autres</td><td><input type=checkbox $checked name=others></td></tr>";

?>
<tr><td colspan=8><?echo $liste_soldes_y_compris?> :&nbsp;<input type=checkbox name=archives <?if($_POST["archives"]) echo "checked"?>></td></tr>
</table>
<button type=submit><?echo $liste_soldes_soumettre?></button>
</form>
<br><br>
<table width=100% align=center>
<tr><th width=30><?echo $liste_soldes_numero?></th><th width=120><?echo $liste_soldes_nom?></th><th width=100><?echo $liste_soldes_nature?></th><th align=right><?echo $liste_soldes_manque?></th><th align=right><?echo $liste_soldes_attente?></th></td>

<?
require ("./connection_data.php");

//soldes de d├ępart
$total_manque=0;
$total_demande=0;

//affichage de chaque ligne de dossier.

$requete_complete="select nodossier, sum(encaissement) as 's_encaissement', sum(avfrais) as 's_avfrais', sum(demande) as 's_demande', sum(time_to_sec(tempsop)) as 's_temps_consacre' from {$_SESSION["session_opdb"]} group by 'nodossier' order by 'nodossier'";
$calcul_recette=mysql_query("$requete_complete");
$dossier_en_cours=-1;
$temps_dossier=0;
while($row=mysql_fetch_array($calcul_recette, MYSQL_ASSOC)){
		foreach($row as $nom_col =>$val_col){
			$$nom_col=$val_col;
		}
		$dossier_en_cours=$row["nodossier"];
		$requete_2="select adresses.titre, adresses.nom, adresses.prenom, adresses.fonction, adresses.adresse, adresses.zip, adresses.ville, noarchive, naturemandat, prixhoraire from adresses, {$_SESSION["session_avdb"]} where (nodossier like '$dossier_en_cours' AND adresses.id={$_SESSION["session_avdb"]}.noadresse and ($restrict))";
		$recherche_prix=mysql_query("$requete_2");
		while($ligne=mysql_fetch_array($recherche_prix, MYSQL_ASSOC)){
			foreach($ligne as $nom_col =>$val_col){
			$$nom_col=$val_col;
			}
			$prixseconde=$prixhoraire/3600;
			//le gain est TVA comprise
			$gain=round($s_temps_consacre*$prixseconde*20*(100 + $option_gen["tx_tva"])/100)/20;
			$num_a_encaisser=$gain - $s_encaissement + $s_avfrais;
			$gainactuel=number_format($gain, 2, '.', '\'');
			$a_encaisser=number_format(($num_a_encaisser), 2, '.', '\'');
			$attente=number_format($s_demande, 2, '.', '\'');
			if($num_a_encaisser>$min_solde and ($archives or !$ligne["noarchive"])){
				$total_manque=$total_manque + $num_a_encaisser;
				$total_demande=$total_demande + $s_demande;
				echo "<tr><td>";
				echo form("operations.php", "$nodossier", "", "", "", "nodossier", "$nodossier", "secteur", "encaissements");
				echo "</td><td width=400>", $titre;
				if($titre)echo " ";
				echo "$prenom <b>$nom</b> $fonction $adresse $zip $ville",
				"</td><td width=100>",
				$ligne["naturemandat"],
				"&nbsp;</td><td align=right>";
				if($num_a_encaisser) echo "<font color=ff4040>$a_encaisser</font>"; 
				echo "&nbsp;</td><td align=right>";
				if($s_demande) echo "<font color=ffa0a0>$attente";
				echo "&nbsp;</td></tr><tr><td>&nbsp;</td></tr>";
			}
		}
	}
$affiche_total_manque=number_format($total_manque, 2, '.', '\'');
$affiche_total_demande=number_format($total_demande, 2, '.', '\'');
echo "<tr><td colspan=3><b>$afficher_operations_total</b></td><td align=right><b>$affiche_total_manque&nbsp;</b></td><td align=right><b>$affiche_total_demande&nbsp;</b></td></tr>";
?>
</table>

<//table finissant la page//>
</td></tr></table>

      </body>
   </html>
Return current item: Prolawyer