par
xzena » 25 sept. 2011, 21:11
ah oui merci voilà mon code :
c'est pas trop long ha
Code : Tout sélectionner
<?php
include('connexion.php');
$pharam_id = $_POST['ville'].$_POST['secteur'].$_SESSION['pharam_id'];
$pharam_id2 = $_SESSION['pharam_id'];
$pharam_id1 = $pharam_id2 + 1;
$c_ordrepharmacien = $_POST['c_ordrepharmacien'];
$c_ordrepharmacien1 = $_SESSION['c_ordrepharmacien'];
$c_ordrepharmacien2 = $c_ordrepharmacien1 + 1 ;
if(isset($_POST['submit'])){
$profil=$_POST['profil'];
if(!empty($_POST['nom']) && !empty($_POST['prenom']) && !empty($_POST['ville']) && !empty($_POST['secteur']) && !empty($_POST['profil'])) {
$pharam_id = $_POST['ville'].$_POST['secteur'].$_SESSION['pharam_id'];
$city = $ville[$_POST['ville']];
$resp = mysql_query("SELECT secteur FROM secteur where id_sec = '".$_POST['secteur']."'");
$row = mysql_fetch_assoc($resp);
$secteur = $row['secteur'];
$q="select distinct(ville) from secteur where code_ville='".$_POST['ville']."' ";
$r=mysql_query($q);
$rq=mysql_fetch_array($r);
$q1="select distinct(secteur) from secteur where code_secteur='".$_POST['secteur']."' ";
$r1=mysql_query($q1);
$rq1=mysql_fetch_array($r1);
$profil=$_POST['profil'];
if ( $profil == "medecin" ) {
mysql_query('insert into partenaire (
pharam_id, nom, prenom,
titre, client, activite,
exercice, specialite, potentialite,
prescripteur, adress_electronique, region,
ville, code_postal, secteur,
sous_secteur, tel, fixe,
fax, commentaire,
adress, c_ordremedecin, profil) values(
"'.addslashes($pharam_id2).'","'.addslashes($_POST['nom']).'","'.addslashes($_POST['prenom']).'",
"'.addslashes($_POST['titre']).'","'.addslashes($_POST['client']).'","'.addslashes($_POST['activite']).'",
"'.addslashes($_POST['exercice']).'","'.addslashes($_POST['specialite']).'","'.addslashes($_POST['potentialite']).'",
"'.addslashes($_POST['prescripteur']).'","'.addslashes($_POST['adress_electronique']).'","'.addslashes($_POST['region']).'",
"'.addslashes($rq[0]).'","'.addslashes($_POST['code_postal']).'","'.addslashes($rq1[0]).'","'.addslashes($_POST['sous_secteur']).'",
"'.addslashes($_POST['tel']).'","'.addslashes($_POST['fixe']).'","'.addslashes($_POST['fax']).'",
"'.addslashes($_POST['commentaire']).'","'.addslashes($_POST['adress']).'",
"'.addslashes($pharam_id).'","'.addslashes($profil).'" )')or die(mysql_error());?>
<?php $str = mysql_query("select max(pharam_id) as id from partenaire")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$pharam_id1 = $row['id'];
$p=$_POST['ville'].$_POST['secteur'].$pharam_id1 ;
echo '<style="color:green;font-size:12" ><font color="bleu">Le Medecin Num '.$p.' a ete Bien Enregistree</font></h2>';
echo '<a href="medecin.php"></a>';
}
/*ELSE*/
elseif($profil == "pharmacien") {
$id= "pharam".$c_ordrepharmacien2 ;
$str = mysql_query("select max(id_pharmacien) as id from pharmacien")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$c_ordrepharmacien2 = $row['id'];
mysql_query ('insert into pharmacien ( nom, prenom,
titre, client, activite,
exercice, specialite, potentialite,
prescripteur, adress_electronique, region,
ville, code_postal, secteur,
sous_secteur, tel, fixe,
fax, commentaire,
adress, profil, c_ordrepharmacien ) values(
"'.addslashes($_POST['nom']).'","'.addslashes($_POST['prenom']).'",
"'.addslashes($_POST['titre']).'","'.addslashes($_POST['client']).'","'.addslashes($_POST['activite']).'",
"'.addslashes($_POST['exercice']).'","'.addslashes($_POST['specialite']).'","'.addslashes($_POST['potentialite']).'",
"'.addslashes($_POST['prescripteur']).'","'.addslashes($_POST['adress_electronique']).'","'.addslashes($_POST['region']).'",
"'.addslashes($rq[0]).'","'.addslashes($_POST['code_postal']).'","'.addslashes($rq1[0]).'","'.addslashes($_POST['sous_secteur']).'",
"'.addslashes($_POST['tel']).'","'.addslashes($_POST['fixe']).'","'.addslashes($_POST['fax']).'",
"'.addslashes($_POST['commentaire']).'","'.addslashes($_POST['adress']).'",
"'.addslashes($profil).'","'.addslashes($c_ordrepharmacien2).'" ) ' ) or die(mysql_error());
?>
<?php $str = mysql_query("select max(id_pharmacien) as id from pharmacien")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$c_ordrepharmacien2 = "pharam".$row['id'];
$str = mysql_query("select max(id_pharmacien) as id from pharmacien")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$c_ordrepharmacien2=0;
$c_ordrepharmacien2 = $row['id']; $c_ordrepharmacien2 += 1; echo "pharam".$c_ordrepharmacien2 ;
$_POST['c_ordrepharmacien'] = $c_ordrepharmacien2;
mysql_query('insert into pharmacien(c_ordrepharmacien) values
"'.addslashes($_POST['id_pharmacien']).'" )' );
echo '<style="color:green;font-size:12" ><font color="bleu">Le Pharmacien Num pharam '.$c_ordrepharmacien2.' a ete Bien Enregistree</font></h2>';
}
}else{
$pharam_id1 = $pharam_id2;
echo '<h3 style="color:red">Les champs * sont obligatoires </h3>';
}
//}else{
}
?>
<?php
session_start();
?>
<form name="form2" id="form2">
<div align="left">
<p align="left" class="style19">
<font color="green">
</font><span
class="style20">GESTION MEDECINS</span>
</p>
<p align="left" class="style19"> </p>
</div>
</form>
<p> </p>
<form name="form1" action="" method="post" onSubmit="return controlform();">
<p>
<label>
<div align="center">
<span class="style14">
<input type="radio" name="profil" value="medecin">
<strong>Medecin </strong></span></label>
<div align="center"><br>
</div>
<label>
<div align="center">
<input type="radio" name="profil" value="pharmacien">
<span class="style14"><strong>Pharmacien</strong></span>
<label>
<table width="200" border="0">
<tr>
<td align="center" style="color: black; background: #CCCCCC;"><?php $str = mysql_query("select max(id_pharmacien) as id from pharmacien")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$c_ordrepharmacien2=0;
$c_ordrepharmacien2 = $row['id']; $c_ordrepharmacien2 += 1; echo "pharam".$c_ordrepharmacien2 ;
$_POST['c_ordrepharmacien'] = $c_ordrepharmacien2;
mysql_query('insert into pharmacien(c_ordrepharmacien) values
"'.addslashes($c_ordrepharmacien2).'" ' );
?></td>
</tr>
</table>
</label>
</div>
</label>
<div align="center"><br>
<span class="style21">Localisation </span></div>
<table width="1022" border="0">
<tr>
<th width="85" height="28" valign="middle" scope="row"><div
align="right" class="Style5">
<div align="left" class="style14">
Région <span style="color: red;">*</span> : </div>
</div></th>
<td width="132">
<select name="region" id="region"
onChange="showMed(this.value)">
<option value="selectionner">selectionner</option>
<?php
$respo = mysql_query("SELECT DISTINCT(region) FROM secteur ");
while($affiche_respo= mysql_fetch_array($respo)){
$id_sec = $affiche_respo['id_sec'];
if(strlen($id_sec) != 2){
$id_sec = '0'.$id_sec;
}
echo '<option value="'.$affiche_respo['region'].'">'.$affiche_respo['region'].' </option>';
}
?>
</select> </td>
<td width="10">
<th width="98" height="28" valign="middle" scope="col"><div
align="right" class="Style5">
<div align="left" class="style14">
<div align="right">
Ville <span style="color: red;">*</span>: </div>
</div>
</div></th>
<th width="136" scope="col">
<div id="med-select-div">
<select name="ville" id="ville">
<option value="selectionner">selectionner</option>
<?php
$respo = mysql_query("SELECT * FROM secteur ORDER BY code_ville ASC ");
while($affiche_respo= mysql_fetch_array($respo)){
$id_sec = $affiche_respo['id_sec'];
if(strlen($id_sec) != 2){
$id_sec = '0'.$id_sec;
}
echo '<option value="'.$affiche_respo['code_ville'].'">'.$affiche_respo['ville'].' '.$affiche_respo['code_ville'].'</option>';
}
?>
</select>
</div></th>
<td width="10">
<th width="98" height="38" valign="middle" scope="row"><div
align="right" class="Style5">
<div align="right" class="Style5">
<div align="left" class="style14">
<div align="right">
secteur <span style="color: red;">*</span>: </div>
</div>
</div>
</div></th>
<td width="118"><select name="secteur" id="secteur">
<option value="selectionner">selectionner</option>
<?php
$respo = mysql_query("SELECT * FROM secteur ORDER BY secteur ASC");
while($affiche_respo= mysql_fetch_array($respo)){
$id_sec = $affiche_respo['id_sec'];
echo '<option value="'.$affiche_respo['code_secteur'].'">'.$affiche_respo['secteur'].' '.$affiche_respo['code_secteur'].'</option>';
}
?>
</select> </td>
<th width="123" height="28" valign="middle" scope="col"><div
align="right" class="Style5">
<div align="left" class="style14">Sous Secteur :</div>
</div></th>
<th width="196" scope="col">
<div align="left">
<select name="sous_secteur" id="sous_secteur">
<option value="selectionner">selectionner</option>
<?php
$respo = mysql_query("SELECT * FROM secteur ORDER BY secteur ASC");
while($affiche_respo= mysql_fetch_array($respo)){
$id_sec = $affiche_respo['id_sec'];
echo '<option value="'.$affiche_respo['sous_secteur'].'">'.$affiche_respo['sous_secteur'].' '.$affiche_respo['sous_secteur'].'</option>';
}
?>
</select>
</div></th>
</tr>
</table>
<table width="935" align="center" cellpadding="3">
<?php $str = mysql_query("select max(pharam_id) as id from partenaire")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$pharam_id1 = $row['id'];
$pharam_id1 += 1;
while(strlen($pharam_id1) != 3){
$pharam_id1 = '0'.$pharam_id1;
}?>
<tr align="center">
<td width="293" height="329" valign="top">
<div align="left">
<span class="style21">Identification </span>
<table width="287" align="right" cellpadding="3">
<tr>
<th width="123" height="33" scope="col"><div align="right"
class="Style5">
<div align="left" class="style14">
<u>Code Medecin</u> <span style="color: red;">*</span>: </div>
</div></th>
<th width="144" scope="col">
<div align="left"
style="color: black; background: #CCCCCC; text-align: center;">
<p><?php echo $pharam_id1;
$_SESSION['pharam_id'] = $pharam_id1;
?></p>
</div></th>
</tr>
<tr>
<th height="36" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Titre :</div>
</div></th>
<td><label></label> <label> <select name="titre">
<option selected="selected" value="Selectionnez">Selectionnez
:</option>
<option>Docteur</option>
<option>Professeur</option>
<option>Resident</option>
<option>Maitre</option>
<option>Interne</option>
</select> </label></td>
<tr>
<th height="46" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">
<p>Adresse:</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Tel fixe :</p>
</div>
</div></th>
<td><p>
<textarea name="adress"></textarea>
</p>
<p> </p>
<p>
<label> <input name="fixe" type="text" id="fixe" /> </label>
</p></td>
</tr>
<tr>
<th height="43" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Prescripteur :</div>
</div></th>
<td><select name="prescripteur" id="prescripteur">
<option selected="selected" value="selectionnez">Selectionnez
:</option>
<option value="fort">Fort: 1</option>
<option value="moyen">Moyen: 2</option>
<option value="moyen">Faible: 3</option>
</select></td>
</tr>
<tr>
<th height="52" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Potentialité :</div>
</div></th>
<td><select name="potentialite" id="potentialite">
<option selected="selected" value="">Selectionnez :</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select></td>
</tr>
</table>
</div>
<p align="center"> </p></td>
<td width="622" valign="middle">
<div align="center">
<table width="523" align="center" cellpadding="3">
<tr>
<th width="83" height="36" valign="top" scope="row"><div
align="right" class="Style5">
<div align="left" class="style14">
Nom <span style="color: red;">*</span>: </div>
</div></th>
<td width="163" valign="top"><input name="nom" type="text"
id="nom" /></td>
<th width="79" height="36" valign="top" scope="row"><div
align="right" class="Style5">
<div align="left" class="style14">
Prénom <span style="color: red;">*</span>: </div>
</div></th>
<td width="162" valign="top"><input name="prenom" type="text"
id="prenom" /></td>
</tr>
<tr>
<th height="28" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Spécialité :</div>
</div></th>
<td><select name="specialite" id="specialite">
<option selected="selected" value="">Selectionnez :</option>
<option value="generaliste">Generaliste</option>
<option value="gynecologue">Gynecologue</option>
<option value="chirurgien">Chirurgien</option>
<option value="kinesitherapeute">Kinesitherapeute</option>
<option value="dermatologue">Dermatologue</option>
<option value="neurochirurgien">Neurochirurgien</option>
<option value="endocrinologue">Endocrinologue</option>
<option value="gastro_enterologue ">Gastro-enterologue</option>
<option value="urgentiste ">Urgentiste</option>
<option value="pediatre">Pediatre</option>
<option value="pneumologue ">Pneumologue</option>
<option value="podologue">Podologue</option>
<option value="rhumatologue ">Rhumatologue</option>
<option value="traumatologue ">Traumatologue</option>
<option value="Urologue">Urologue</option>
<option value="orthopediste">Orthopediste</option>
<option value="cardiologue">Cardiologue</option>
<option value="Urologue">Ophtalmologue</option>
<option value="orl">ORL</option>
<option value="psychiatre">Psychiatre</option>
<option value="medecindesport">Medecin de sport</option>
</select></td>
<th width="123" height="43" scope="row"><div align="right"
class="Style5">
<div align="left" class="style14">Exercice :</div>
</div></th>
<td width="144"><select name="exercice">
<option selected="selected" value="">Selectionnez :</option>
<option>SIAAP</option>
<option>Cabinet Prive</option>
<option>Hopital</option>
<option>Polyclinique</option>
</select></td>
</tr>
<tr>
<th height="38" scope="row"><div align="right" class="Style5">
<div align="right" class="Style5">
<div align="left" class="style14">Code postal</div>
</div>
</div></th>
<td><input name="code_postal" type="text" id="code_postal" />
</td>
<th height="38" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Email :</div>
</div></th>
<td><input name="adress_electronique" type="text"
id="adress_electronique" /></td>
</tr>
<tr>
<th height="38" scope="row"><div align="right" class="Style5">
<div align="right" class="Style5">
<div align="left" class="style14">Tel fax :</div>
</div>
</div></th>
<td><input name="fax" type="text" id="fax" /> </td>
<th height="38" scope="row"><div align="right" class="Style5">
<div align="right" class="Style5">
<div align="left" class="style14">Tel Gsm :</div>
</div>
</div></th>
<td><input name="tel" type="text" id="tel" /> </td>
</tr>
<tr>
<th height="53" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Client :</div>
</div></th>
<td><label> <input name="client" type="radio" value="actif" /> <span
class="style22">Actif</span> </label>
<p>
<label> <input name="client" type="radio" value="nonactif" />
<span class="style22">Non Actif</span> </label>
</p></td>
<th height="34" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Activité :</div>
</div></th>
<td><label> <input type="checkbox" name="activite" value="pub" />
<span class="style22">Publique</span> <input type="checkbox"
name="activite" value="priv" /> <span class="style22">Privé</span>
</label></td>
</tr>
<tr>
<th height="46" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Commentaire:</div>
</div></th>
<td><label> <textarea name="commentaire"></textarea> </label></td>
<tr> </tr>
</table>
</div></td>
</tr>
</table>
<p> </p>
<table width="843" height="52" border="0" align="center">
<tr>
<td width="241" align="center" valign="top"><div align="right"></div> </td>
<td width="592" valign="top">
<div align="left">
<input name="submit" class="Style1" value="Enregistrer"
style="width: 25%" type="submit" /> <input type="reset"
id="submit" value="vider" class="Style1" style="width: 25%" />
</div></td>
</table>
<?php
session_destroy();
header('location:medecin.php');
?>
</form>
</body>
</html>
ah oui merci voilà mon code :
c'est pas trop long ha :mrgreen:
[code]<?php
include('connexion.php');
$pharam_id = $_POST['ville'].$_POST['secteur'].$_SESSION['pharam_id'];
$pharam_id2 = $_SESSION['pharam_id'];
$pharam_id1 = $pharam_id2 + 1;
$c_ordrepharmacien = $_POST['c_ordrepharmacien'];
$c_ordrepharmacien1 = $_SESSION['c_ordrepharmacien'];
$c_ordrepharmacien2 = $c_ordrepharmacien1 + 1 ;
if(isset($_POST['submit'])){
$profil=$_POST['profil'];
if(!empty($_POST['nom']) && !empty($_POST['prenom']) && !empty($_POST['ville']) && !empty($_POST['secteur']) && !empty($_POST['profil'])) {
$pharam_id = $_POST['ville'].$_POST['secteur'].$_SESSION['pharam_id'];
$city = $ville[$_POST['ville']];
$resp = mysql_query("SELECT secteur FROM secteur where id_sec = '".$_POST['secteur']."'");
$row = mysql_fetch_assoc($resp);
$secteur = $row['secteur'];
$q="select distinct(ville) from secteur where code_ville='".$_POST['ville']."' ";
$r=mysql_query($q);
$rq=mysql_fetch_array($r);
$q1="select distinct(secteur) from secteur where code_secteur='".$_POST['secteur']."' ";
$r1=mysql_query($q1);
$rq1=mysql_fetch_array($r1);
$profil=$_POST['profil'];
if ( $profil == "medecin" ) {
mysql_query('insert into partenaire (
pharam_id, nom, prenom,
titre, client, activite,
exercice, specialite, potentialite,
prescripteur, adress_electronique, region,
ville, code_postal, secteur,
sous_secteur, tel, fixe,
fax, commentaire,
adress, c_ordremedecin, profil) values(
"'.addslashes($pharam_id2).'","'.addslashes($_POST['nom']).'","'.addslashes($_POST['prenom']).'",
"'.addslashes($_POST['titre']).'","'.addslashes($_POST['client']).'","'.addslashes($_POST['activite']).'",
"'.addslashes($_POST['exercice']).'","'.addslashes($_POST['specialite']).'","'.addslashes($_POST['potentialite']).'",
"'.addslashes($_POST['prescripteur']).'","'.addslashes($_POST['adress_electronique']).'","'.addslashes($_POST['region']).'",
"'.addslashes($rq[0]).'","'.addslashes($_POST['code_postal']).'","'.addslashes($rq1[0]).'","'.addslashes($_POST['sous_secteur']).'",
"'.addslashes($_POST['tel']).'","'.addslashes($_POST['fixe']).'","'.addslashes($_POST['fax']).'",
"'.addslashes($_POST['commentaire']).'","'.addslashes($_POST['adress']).'",
"'.addslashes($pharam_id).'","'.addslashes($profil).'" )')or die(mysql_error());?>
<?php $str = mysql_query("select max(pharam_id) as id from partenaire")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$pharam_id1 = $row['id'];
$p=$_POST['ville'].$_POST['secteur'].$pharam_id1 ;
echo '<style="color:green;font-size:12" ><font color="bleu">Le Medecin Num '.$p.' a ete Bien Enregistree</font></h2>';
echo '<a href="medecin.php"></a>';
}
/*ELSE*/
elseif($profil == "pharmacien") {
$id= "pharam".$c_ordrepharmacien2 ;
$str = mysql_query("select max(id_pharmacien) as id from pharmacien")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$c_ordrepharmacien2 = $row['id'];
mysql_query ('insert into pharmacien ( nom, prenom,
titre, client, activite,
exercice, specialite, potentialite,
prescripteur, adress_electronique, region,
ville, code_postal, secteur,
sous_secteur, tel, fixe,
fax, commentaire,
adress, profil, c_ordrepharmacien ) values(
"'.addslashes($_POST['nom']).'","'.addslashes($_POST['prenom']).'",
"'.addslashes($_POST['titre']).'","'.addslashes($_POST['client']).'","'.addslashes($_POST['activite']).'",
"'.addslashes($_POST['exercice']).'","'.addslashes($_POST['specialite']).'","'.addslashes($_POST['potentialite']).'",
"'.addslashes($_POST['prescripteur']).'","'.addslashes($_POST['adress_electronique']).'","'.addslashes($_POST['region']).'",
"'.addslashes($rq[0]).'","'.addslashes($_POST['code_postal']).'","'.addslashes($rq1[0]).'","'.addslashes($_POST['sous_secteur']).'",
"'.addslashes($_POST['tel']).'","'.addslashes($_POST['fixe']).'","'.addslashes($_POST['fax']).'",
"'.addslashes($_POST['commentaire']).'","'.addslashes($_POST['adress']).'",
"'.addslashes($profil).'","'.addslashes($c_ordrepharmacien2).'" ) ' ) or die(mysql_error());
?>
<?php $str = mysql_query("select max(id_pharmacien) as id from pharmacien")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$c_ordrepharmacien2 = "pharam".$row['id'];
$str = mysql_query("select max(id_pharmacien) as id from pharmacien")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$c_ordrepharmacien2=0;
$c_ordrepharmacien2 = $row['id']; $c_ordrepharmacien2 += 1; echo "pharam".$c_ordrepharmacien2 ;
$_POST['c_ordrepharmacien'] = $c_ordrepharmacien2;
mysql_query('insert into pharmacien(c_ordrepharmacien) values
"'.addslashes($_POST['id_pharmacien']).'" )' );
echo '<style="color:green;font-size:12" ><font color="bleu">Le Pharmacien Num pharam '.$c_ordrepharmacien2.' a ete Bien Enregistree</font></h2>';
}
}else{
$pharam_id1 = $pharam_id2;
echo '<h3 style="color:red">Les champs * sont obligatoires </h3>';
}
//}else{
}
?>
<?php
session_start();
?>
<form name="form2" id="form2">
<div align="left">
<p align="left" class="style19">
<font color="green">
</font><span
class="style20">GESTION MEDECINS</span>
</p>
<p align="left" class="style19"> </p>
</div>
</form>
<p> </p>
<form name="form1" action="" method="post" onSubmit="return controlform();">
<p>
<label>
<div align="center">
<span class="style14">
<input type="radio" name="profil" value="medecin">
<strong>Medecin </strong></span></label>
<div align="center"><br>
</div>
<label>
<div align="center">
<input type="radio" name="profil" value="pharmacien">
<span class="style14"><strong>Pharmacien</strong></span>
<label>
<table width="200" border="0">
<tr>
<td align="center" style="color: black; background: #CCCCCC;"><?php $str = mysql_query("select max(id_pharmacien) as id from pharmacien")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$c_ordrepharmacien2=0;
$c_ordrepharmacien2 = $row['id']; $c_ordrepharmacien2 += 1; echo "pharam".$c_ordrepharmacien2 ;
$_POST['c_ordrepharmacien'] = $c_ordrepharmacien2;
mysql_query('insert into pharmacien(c_ordrepharmacien) values
"'.addslashes($c_ordrepharmacien2).'" ' );
?></td>
</tr>
</table>
</label>
</div>
</label>
<div align="center"><br>
<span class="style21">Localisation </span></div>
<table width="1022" border="0">
<tr>
<th width="85" height="28" valign="middle" scope="row"><div
align="right" class="Style5">
<div align="left" class="style14">
Région <span style="color: red;">*</span> : </div>
</div></th>
<td width="132">
<select name="region" id="region"
onChange="showMed(this.value)">
<option value="selectionner">selectionner</option>
<?php
$respo = mysql_query("SELECT DISTINCT(region) FROM secteur ");
while($affiche_respo= mysql_fetch_array($respo)){
$id_sec = $affiche_respo['id_sec'];
if(strlen($id_sec) != 2){
$id_sec = '0'.$id_sec;
}
echo '<option value="'.$affiche_respo['region'].'">'.$affiche_respo['region'].' </option>';
}
?>
</select> </td>
<td width="10">
<th width="98" height="28" valign="middle" scope="col"><div
align="right" class="Style5">
<div align="left" class="style14">
<div align="right">
Ville <span style="color: red;">*</span>: </div>
</div>
</div></th>
<th width="136" scope="col">
<div id="med-select-div">
<select name="ville" id="ville">
<option value="selectionner">selectionner</option>
<?php
$respo = mysql_query("SELECT * FROM secteur ORDER BY code_ville ASC ");
while($affiche_respo= mysql_fetch_array($respo)){
$id_sec = $affiche_respo['id_sec'];
if(strlen($id_sec) != 2){
$id_sec = '0'.$id_sec;
}
echo '<option value="'.$affiche_respo['code_ville'].'">'.$affiche_respo['ville'].' '.$affiche_respo['code_ville'].'</option>';
}
?>
</select>
</div></th>
<td width="10">
<th width="98" height="38" valign="middle" scope="row"><div
align="right" class="Style5">
<div align="right" class="Style5">
<div align="left" class="style14">
<div align="right">
secteur <span style="color: red;">*</span>: </div>
</div>
</div>
</div></th>
<td width="118"><select name="secteur" id="secteur">
<option value="selectionner">selectionner</option>
<?php
$respo = mysql_query("SELECT * FROM secteur ORDER BY secteur ASC");
while($affiche_respo= mysql_fetch_array($respo)){
$id_sec = $affiche_respo['id_sec'];
echo '<option value="'.$affiche_respo['code_secteur'].'">'.$affiche_respo['secteur'].' '.$affiche_respo['code_secteur'].'</option>';
}
?>
</select> </td>
<th width="123" height="28" valign="middle" scope="col"><div
align="right" class="Style5">
<div align="left" class="style14">Sous Secteur :</div>
</div></th>
<th width="196" scope="col">
<div align="left">
<select name="sous_secteur" id="sous_secteur">
<option value="selectionner">selectionner</option>
<?php
$respo = mysql_query("SELECT * FROM secteur ORDER BY secteur ASC");
while($affiche_respo= mysql_fetch_array($respo)){
$id_sec = $affiche_respo['id_sec'];
echo '<option value="'.$affiche_respo['sous_secteur'].'">'.$affiche_respo['sous_secteur'].' '.$affiche_respo['sous_secteur'].'</option>';
}
?>
</select>
</div></th>
</tr>
</table>
<table width="935" align="center" cellpadding="3">
<?php $str = mysql_query("select max(pharam_id) as id from partenaire")or die(mysql_error());
$row = mysql_fetch_assoc($str);
$pharam_id1 = $row['id'];
$pharam_id1 += 1;
while(strlen($pharam_id1) != 3){
$pharam_id1 = '0'.$pharam_id1;
}?>
<tr align="center">
<td width="293" height="329" valign="top">
<div align="left">
<span class="style21">Identification </span>
<table width="287" align="right" cellpadding="3">
<tr>
<th width="123" height="33" scope="col"><div align="right"
class="Style5">
<div align="left" class="style14">
<u>Code Medecin</u> <span style="color: red;">*</span>: </div>
</div></th>
<th width="144" scope="col">
<div align="left"
style="color: black; background: #CCCCCC; text-align: center;">
<p><?php echo $pharam_id1;
$_SESSION['pharam_id'] = $pharam_id1;
?></p>
</div></th>
</tr>
<tr>
<th height="36" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Titre :</div>
</div></th>
<td><label></label> <label> <select name="titre">
<option selected="selected" value="Selectionnez">Selectionnez
:</option>
<option>Docteur</option>
<option>Professeur</option>
<option>Resident</option>
<option>Maitre</option>
<option>Interne</option>
</select> </label></td>
<tr>
<th height="46" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">
<p>Adresse:</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Tel fixe :</p>
</div>
</div></th>
<td><p>
<textarea name="adress"></textarea>
</p>
<p> </p>
<p>
<label> <input name="fixe" type="text" id="fixe" /> </label>
</p></td>
</tr>
<tr>
<th height="43" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Prescripteur :</div>
</div></th>
<td><select name="prescripteur" id="prescripteur">
<option selected="selected" value="selectionnez">Selectionnez
:</option>
<option value="fort">Fort: 1</option>
<option value="moyen">Moyen: 2</option>
<option value="moyen">Faible: 3</option>
</select></td>
</tr>
<tr>
<th height="52" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Potentialité :</div>
</div></th>
<td><select name="potentialite" id="potentialite">
<option selected="selected" value="">Selectionnez :</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select></td>
</tr>
</table>
</div>
<p align="center"> </p></td>
<td width="622" valign="middle">
<div align="center">
<table width="523" align="center" cellpadding="3">
<tr>
<th width="83" height="36" valign="top" scope="row"><div
align="right" class="Style5">
<div align="left" class="style14">
Nom <span style="color: red;">*</span>: </div>
</div></th>
<td width="163" valign="top"><input name="nom" type="text"
id="nom" /></td>
<th width="79" height="36" valign="top" scope="row"><div
align="right" class="Style5">
<div align="left" class="style14">
Prénom <span style="color: red;">*</span>: </div>
</div></th>
<td width="162" valign="top"><input name="prenom" type="text"
id="prenom" /></td>
</tr>
<tr>
<th height="28" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Spécialité :</div>
</div></th>
<td><select name="specialite" id="specialite">
<option selected="selected" value="">Selectionnez :</option>
<option value="generaliste">Generaliste</option>
<option value="gynecologue">Gynecologue</option>
<option value="chirurgien">Chirurgien</option>
<option value="kinesitherapeute">Kinesitherapeute</option>
<option value="dermatologue">Dermatologue</option>
<option value="neurochirurgien">Neurochirurgien</option>
<option value="endocrinologue">Endocrinologue</option>
<option value="gastro_enterologue ">Gastro-enterologue</option>
<option value="urgentiste ">Urgentiste</option>
<option value="pediatre">Pediatre</option>
<option value="pneumologue ">Pneumologue</option>
<option value="podologue">Podologue</option>
<option value="rhumatologue ">Rhumatologue</option>
<option value="traumatologue ">Traumatologue</option>
<option value="Urologue">Urologue</option>
<option value="orthopediste">Orthopediste</option>
<option value="cardiologue">Cardiologue</option>
<option value="Urologue">Ophtalmologue</option>
<option value="orl">ORL</option>
<option value="psychiatre">Psychiatre</option>
<option value="medecindesport">Medecin de sport</option>
</select></td>
<th width="123" height="43" scope="row"><div align="right"
class="Style5">
<div align="left" class="style14">Exercice :</div>
</div></th>
<td width="144"><select name="exercice">
<option selected="selected" value="">Selectionnez :</option>
<option>SIAAP</option>
<option>Cabinet Prive</option>
<option>Hopital</option>
<option>Polyclinique</option>
</select></td>
</tr>
<tr>
<th height="38" scope="row"><div align="right" class="Style5">
<div align="right" class="Style5">
<div align="left" class="style14">Code postal</div>
</div>
</div></th>
<td><input name="code_postal" type="text" id="code_postal" />
</td>
<th height="38" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Email :</div>
</div></th>
<td><input name="adress_electronique" type="text"
id="adress_electronique" /></td>
</tr>
<tr>
<th height="38" scope="row"><div align="right" class="Style5">
<div align="right" class="Style5">
<div align="left" class="style14">Tel fax :</div>
</div>
</div></th>
<td><input name="fax" type="text" id="fax" /> </td>
<th height="38" scope="row"><div align="right" class="Style5">
<div align="right" class="Style5">
<div align="left" class="style14">Tel Gsm :</div>
</div>
</div></th>
<td><input name="tel" type="text" id="tel" /> </td>
</tr>
<tr>
<th height="53" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Client :</div>
</div></th>
<td><label> <input name="client" type="radio" value="actif" /> <span
class="style22">Actif</span> </label>
<p>
<label> <input name="client" type="radio" value="nonactif" />
<span class="style22">Non Actif</span> </label>
</p></td>
<th height="34" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Activité :</div>
</div></th>
<td><label> <input type="checkbox" name="activite" value="pub" />
<span class="style22">Publique</span> <input type="checkbox"
name="activite" value="priv" /> <span class="style22">Privé</span>
</label></td>
</tr>
<tr>
<th height="46" scope="row"><div align="right" class="Style5">
<div align="left" class="style14">Commentaire:</div>
</div></th>
<td><label> <textarea name="commentaire"></textarea> </label></td>
<tr> </tr>
</table>
</div></td>
</tr>
</table>
<p> </p>
<table width="843" height="52" border="0" align="center">
<tr>
<td width="241" align="center" valign="top"><div align="right"></div> </td>
<td width="592" valign="top">
<div align="left">
<input name="submit" class="Style1" value="Enregistrer"
style="width: 25%" type="submit" /> <input type="reset"
id="submit" value="vider" class="Style1" style="width: 25%" />
</div></td>
</table>
<?php
session_destroy();
header('location:medecin.php');
?>
</form>
</body>
</html>[/code]