Location: PHPKode > projects > Prolawyer > etude/creer_dossier.php
<? session_start();

require("./title.php");
//if ($retour=="") $retour="operations";
//tab_affiche($_POST);
//si on a créé une nouvelle fiche, il faut l'insérer
if($_POST["new"]==on){
$test=0;
$maj="insert into adresses set ";
foreach($_POST as $nom => $val){
if($nom!="new" AND $nom!="cherche_pa" AND $nom !="nb_affiche"){
if($test>0) $maj=$maj.", ";
$maj=$maj.$nom." = '".$val."'";
$test++;
}
}
$maj=$maj.", np = '{$_SESSION["session_utilisateur"]}'";
$maj=$maj.", mp = '{$_SESSION["session_utilisateur"]}'";
$maj=$maj.", nple = '$date_modif'";
$maj=$maj.", mple = '$date_modif'";
require("./connection_data.php");
$insert_maj=mysql_query("$maj");
//echo $maj;
$_POST["noadresse"]=mysql_insert_id($connection["test"]);
}

?>
   </head>
<?
body();
require("./entete.php")?>
<table width=95% align=center><tr><td>
     <h1>
         <br>
<?


if(ereg("nopa", "{$_POST["action"]}")) echo $creer_dossier_h11_pa;
if(ereg("noca", "{$_POST["action"]}")) echo $creer_dossier_h11_ca;
elseif(ereg("noadresse", "{$_POST["action"]}")) echo $creer_dossier_h11;
elseif($_POST["cherche_pa"]=="on") echo $creer_dossier_h12_pa;
else echo $creer_dossier_h12;
?>

      </h1>

<?
echo "<form name=creer method=post action=creer_client.php>";
if($_POST["cherche_pa"]=="on") echo "<input type=\"hidden\" name=\"cherche_pa\" value=\"on\">";
if(isset($_POST["noadresse"])) echo "<input type=\"hidden\" name=\"noadresse\" value=\"{$_POST["noadresse"]}\">";
if(isset($_POST["action"])){
echo "<input type=\"hidden\" name=\"action\" value=\"{$_POST["action"]}\">";
if($_POST["action"]) echo "<input type=\"hidden\" name=\"nodossier\" value=\"{$_POST["nodossier"]}\">";
}

?>
<h2><?

if($_POST["action"]=="pa") echo $creer_dossier_h21_pa;
elseif($_POST["action"]=="client" || $_POST["cherche_pa"]!="on") echo $creer_dossier_h21;
elseif($_POST["cherche_pa"]=="on") echo $creer_dossier_h22_pa;
else echo $creer_dossier_h22;

?></h2>
<br><input type="text" name="vnom">&nbsp;<?echo $creer_dossier_nom?><br>

<br><input type="submit" value="<?echo $creer_dossier_recherche?>">
</form>

<?
//formulaire pour ne pas choisir de personne
if($_POST["cherche_pa"]=="on" ||$_POST["action"]=="pa"){
	echo "<form method=\"post\" action=\"./modifier_donnees.php\">";
	if($_POST["action"]=="pa"){
		echo "<input type=\"hidden\" name=\"nodossier\" value=\"{$_POST["nodossier"]}\">";
		echo "<input type=\"hidden\" name=\"action\" value=\"pa\">";
		echo "<input type=\"hidden\" name=\"nopa\" value=\"0\">";
	}
	else{
		echo "<input type=\"hidden\" name=\"noadresse\" value=\"{$_POST["noadresse"]}\">";
		echo "<input type=\"hidden\" name=\"new\" value=\"on\">";
	}
	echo button("$creer_dossier_pas_de_pa", "");
	echo "</form>";
}
elseif(ereg("noca", $_POST["action"]) || ereg("nopa", $_POST["action"]) || (ereg("noadresse", $_POST["action"]) AND $_POST["action"] != "noadresse")){
	if(ereg("noadresse", $_POST["action"])) $noadresse=$_POST["action"];
	if(ereg("noca", $_POST["action"])) $noca=$_POST["action"];
	if(ereg("nopa", $_POST["action"])) {
	$nopa=$_POST["action"];
	$noca="noca".ereg_replace("nopa", "", $_POST["action"]);
	}
	echo "<form method=\"post\" action=\"./modifier_donnees.php\">";
	echo "<input type=\"hidden\" name=\"nodossier\" value=\"{$_POST["nodossier"]}\">";
	//echo "<input type=\"hidden\" name=\"fiche\" value=\"0\">";
	echo "<input type=\"hidden\" name=\"action\" value=\"{$_POST["action"]}\">";
	if(ereg("nopa", $_POST["action"])){
	echo input_hidden("remove_pa", "", "on");
	echo input_hidden("nopa", "", $nopa);
	echo input_hidden("remove_ca", "", "on");
	echo input_hidden("noca", "", $noca);
}
	if(ereg("noca", $_POST["action"])){
	echo input_hidden("remove_ca", "", "on");
	echo input_hidden("noca", "", $noca);
}
	if(ereg("noadresse", $_POST["action"])){
	echo input_hidden("remove_adresse", "", "on");
	echo input_hidden("noadresse", "", $noadresse);
}
	if(ereg("noca", $_POST["action"])) echo button("$creer_dossier_pas_de_ca", "");
	if(ereg("nopa", $_POST["action"])) echo button("$creer_dossier_pas_de_pa", "");
	if(ereg("noadresse", $_POST["action"])) echo button("$creer_dossier_pas_de_client", "");
	echo "</form>";
}
?>

</td></tr></table>
</body>
</HTML>
Return current item: Prolawyer