IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

[Conception] un peu d aide suite un probleme sur un formulaire


Sujet :

PHP & Base de données

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    23
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations forums :
    Inscription : Mars 2007
    Messages : 23
    Par défaut [Conception] un peu d aide suite un probleme sur un formulaire
    Bonjour,

    j utilise :
    PHP 5.1.4
    Extensions chargées:
    bcmath, calendar, com_dotnet, ctype, date, ftp, hash, iconv, odbc, pcre, Reflection, session, libxml, standard, tokenizer, zlib, SimpleXML, dom, SPL, wddx, xml, xmlreader, xmlwriter, apache2handler, mbstring, mysql, mysqli, PDO, pdo_sqlite, SQLite, Zend Optimizer
    Apache/2.0.58 (Win32)
    5.0.22-community-nt
    base de donnee INNOB

    Mon problème :

    Je travaille sur un site de gestion d une association
    Mon probleme sur trouve sur ma page pour ajouter un adhérent.

    si pas de variable post existante :
    ma page affiche un formulaire pour saisir les info de l adhérent
    sinon
    ma page traite les variables post en verifaint leur pertinence.
    si probleme sur les variables :
    ma page ré-affiche denouveau le formulaire avec les infos contenue dans les variables post et indique a l utilisateur le probleme pour qu il soit resolu ce dernier revalide
    si plus de probleme :
    je lance une requete insert into avec les données

    je n ai pas d erreur quand je saisie du premier coup les formations de l adrerent dans le formilaire.
    par contre si je doit réafficher le formulaire pour faire une correction de ma saisie je me retrouve avec une erreur sur ma requete insert into ???

    affichage de ma requete avec les valeurs passée mes variables
    Erreur SQL
    INSERT INTO adherent (num_adh, nom_adh, prenom_adh, adr_adh, date_nais, fonction, adr_electr, situation, lib_grade, num_zone) VALUES ('','NOM','PRENOM', 'adresse', '2004-12-12','fonc','mail@mail.fr','célibataire',' A ',' 1 ')
    le message d erreur ???
    Cannot add or update a child row: a foreign key constraint fails (`projetweb_bdd/adherent`, CONSTRAINT `adherent_ibfk_1` FOREIGN KEY (`lib_grade`) REFERENCES `grade` (`lib_grade`))

    Merci de votre aide
    je donne mon code avec les deux formulaire que j include dans les script principale

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    23
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations forums :
    Inscription : Mars 2007
    Messages : 23
    Par défaut suite le code page principale
    mon code page principale :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
     
    // si les varibles poste ne sont pas vide 
    // teste leur validitées
    if(!empty($_POST)){
        /*
        // Debug
        //
        echo '<b>Variables</b> :<br />';
        echo '<pre>';
        print_r($_POST);
        echo '</pre>';
    	*/
     
     
    	$mtcotis = $HTTP_POST_VARS['numcotis'];
    	$mtcotis = trim($mtcotis);
    	$numcotis = $HTTP_POST_VARS['numcotis'];
    	$numcotis = trim($numcotis);
     
    	// creation de variable locale
    	// suppression de espace trim()
    	// verifie la saisie doit contenir que de l alpha
    	$nom = $HTTP_POST_VARS['nom'];
    	$nom = trim($nom); 
    	if(!ctype_alpha($nom)) {
    		$erreur .= "&bull; Le champs nom doit contenir uniquement des lettres<br/>";
    	}
     
    	// creation de variable locale
    	// suppression de espace trim()
    	// verifie la saisie doit contenir que de l alpha
    	$prenom = $HTTP_POST_VARS['prenom'];
    	$prenom = trim($prenom);
    	if(!ctype_alpha($prenom)) {
    		$erreur .= "&bull; Le champs PRENOM doit contenir unquement des lettres<br/>";
    	} 
     
    	// creation de variable locale
    	$situation = $HTTP_POST_VARS['situation'];
     
    	// creation des variables locales
    	// suppression de espace trim()
    	// verifie la saisie s agit il d une date valide checdate()
    	$date1 = $HTTP_POST_VARS['date1'];
    	$date1 = trim($date1);
    	$date1int = intval($date1);
    	$date2 = $HTTP_POST_VARS['date2'];
    	$date2 = trim($date2);
    	$date2int = intval($date2);
    	$date3 = $HTTP_POST_VARS['date3'];
    	$date3 = trim($date3);
    	$date3int = intval($date3);
    	if(checkdate($date2int,$date1int,$date3int)){
    		$datenais = $date3.'-'.$date2.'-'.$date1;
    	} else {
    		$erreur .= "&bull; La DATE DE NAISSANCE saisie n'existe pas<br/>";
    	}
     
    	// creation de variable locale
    	// suppression de espace trim()
    	$adresse = $HTTP_POST_VARS['adresse'];
    	$adresse = trim($adresse);
     
    	// pattern pour verifier que l email est ok
    	$pat_mail = "/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g";
    	// creation de variable locale
    	// suppression de espace trim()
    	// verifie la saisie suivant le pattern $pat_mail
    	$mail = $HTTP_POST_VARS['mail'];
    	$mail = trim($mail);
    	if(ereg($pat_mail, $mail))
    	{
    		$erreur .= "&bull; Le champs E-mail doit contenir chaine de caractéres du type : identifiant@domaine.fr ou .com...<br/>";
    	}
     
    	// creation de variable locale
    	$grade = $HTTP_POST_VARS['grade'];
     
    	// creation de variable locale
    	// suppression de espace trim()
    	// verifie la saisie. doit contenir que de l alpha
    	$fonction = $HTTP_POST_VARS['fonction'];
    	$fonction = trim($fonction);
    	if(!ctype_alpha($fonction)) {
    		$erreur .= "&bull; Le champs FONCTION doit contenir uniquement des lettres<br/>";
    	}
     
    	// creation de variable locale
    	$zone = $HTTP_POST_VARS['zone']; 
     
    	// creation de variable locale
    	$etab = $HTTP_POST_VARS['etab'];
     
    	// creation de variable locale
    	// suppression de espace trim()
    	// verifie la saisie. doit contenir que du numerique
    	$annee = $HTTP_POST_VARS['annee'];
    	$annee = trim($annee); 
    	if(!ctype_digit($annee)) {
    		$erreur .= "&bull; Le champs ANNEE D'AFFECTATION doit contenir 1 nombre de 4 chiffres<br/>";
    	}
     
    	// si la variable $erreur n est pas vide
    	if(!empty($erreur)){
     
    //--------------------------------------------------------------------------------------------------
    // SCRIPT PHP 
    //--------------------------------------------------------------------------------------------------
    include "page01adherent_ajouter_form_correction.php"; // AFFICHE FORMULAIRE DE CORRECTION
    //--------------------------------------------------------------------------------------------------
     
    		// message d erreur a l utilisateur suivant $erreur
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td class="texte" height="25" align="right">'.$erreur.'</td>';
    			echo '</tr>';
    		echo '</table>';
     
    	// sinon
    	} else {
    	// verifie que l insertion n existe pas deja dans la BDD
    	// recherche de doublon sur le nom le prenom et la date de naissance
    	$req_doublon = "SELECT * 
    					FROM adherent
    					WHERE nom_adh = '$nom'
    					AND prenom_adh = '$prenom'
    					AND date_nais = '$datenais'";
    	$res_doublon=mysql_query($req_doublon) or die ("Erreur SQL <br>".$req_doublon."<br>".mysql_error());
    	$res_doublon_tab=mysql_fetch_array($res_doublon);
     
    	// si il y a un resultat a la requete
    	if($res_doublon_tab) {
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td class="texte" height="25" align="right">Il existe déjà cet adhèrent LOUPE</td>';
    			echo '</tr>';
    		echo '</table>';
    	// sinon lance la requete inser into + info de la reussite de l ajout a l utilisateur
    	} else {
    		$req_ajout = "INSERT INTO adherent (num_adh, nom_adh, prenom_adh, adr_adh, date_nais, fonction, adr_electr, situation, lib_grade, num_zone) 
    		VALUES ('','$nom','$prenom', 'adresse', '$datenais','$fonction','$mail','$situation','$grade','$zone')";
    		$res_ajout=mysql_query($req_ajout) or die ("Erreur SQL <br>".$req_ajout."<br>".mysql_error());
     
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td class="texte" height="25" align="right">L\'adherent '.$nom.' '.$prenom.', est bien enregistré </td>';
    			echo '</tr>';
    		echo '</table>';
    	}
    }   
     
    // sinon affiche le formulaire d ajout
    } else {
    //--------------------------------------------------------------------------------------------------
    // SCRIPT PHP 
    //--------------------------------------------------------------------------------------------------
    include "page01adherent_ajouter_form.php"; // AFFICHE FORMULAIRE D AJOUT DE BASE
    //--------------------------------------------------------------------------------------------------
    }

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    23
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations forums :
    Inscription : Mars 2007
    Messages : 23
    Par défaut suite formulaire de base
    code formulaire de base d ajout :
    page01adherent_ajouter_form.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
     
    $req_grade = "SELECT * FROM grade";
    $res_grade=mysql_query($req_grade) or die ("Erreur SQL <br>".$req_grade."<br>".mysql_error());
    $res_grade_tab=mysql_fetch_array($res_grade);
     
    $req_zone = "SELECT * FROM zone";
    $res_zone=mysql_query($req_zone) or die ("Erreur SQL <br>".$req_zone."<br>".mysql_error());
    $res_zone_tab=mysql_fetch_array($res_zone);
     
    $req_etab = "SELECT * FROM etablissement";
    $res_etab=mysql_query($req_etab) or die ("Erreur SQL <br>".$req_etab."<br>".mysql_error());
    $res_etab_tab=mysql_fetch_array($res_etab);
     
    $req_anneecotis = "SELECT MAX(annee) as annee FROM evol_cotis";
    $res_anneecotis=mysql_query($req_anneecotis) or die ("Erreur SQL <br>".$req_anneecotis."<br>".mysql_error());
    $res_anneecotis_tab=mysql_fetch_array($res_anneecotis);
     
    echo '<td width="760">';
    echo '<form name="formajoutadh" method="post" onsubmit="return valider()" action="#">';
    	echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    	echo '<tr>';
    	echo '<td class="texte" height="10" align="center"><div id="errors"></div></td>';
    	echo '</tr>';
    	echo '</table>';
     
    	echo '<fieldset class="fieldset1"><legend class="texteGras">Cotisation</legend>';
    	echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    	echo '<tr>';
    	echo '<td width="150" class="texte" height="25"><label>&nbsp;&nbsp;Montant Cotisation :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" id="mtcotis" name="mtcotis" size="10" maxlength="8" class="boiteFormulaire" value="'.$res_anneecotis_tab['annee'].'" readonly/></td>';
    	echo '<td width="150" class="texte" height="25"><label>&nbsp;&nbsp;N° de Cotisation :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" id="numcotis" name="numcotis" size="5" maxlength="2" class="boiteFormulaire" value="1" realonly/></td>';
    	echo '</tr>';
    	echo '</table>';
    	echo '</fieldset>';
     
    	echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    	echo '<tr>';
    	echo '<td class="texte" height="25" align="right">&nbsp;&nbsp;&nbsp;&nbsp;</td>';
    	echo '</tr>';
    	echo '</table>';
     
    	echo '<fieldset class="fieldset1"><legend class="texteGras">Informations personnelles</legend>';
    	echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    	echo '<tr>';
    	echo '<td width="150" height="25"><label for="nom" id="1" class="texte">&nbsp;&nbsp;Nom :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="nom" id="nom" size="35" maxlength="30" class="boiteFormulaire"/></td>';
    	echo '<td width="150" height="25"><label for="prenom" id="2" class="texte">&nbsp;&nbsp;Prénom :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="prenom" id="prenom" size="35" maxlength="30" class="boiteFormulaire"/></td>';
    	echo '</tr>';
    	echo '<tr>';
    	echo '<td width="150" height="25"><label for="situation" id="3" class="texte">&nbsp;&nbsp;Situation :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<select name="situation" id="situation" size="1" class="boiteFormulaire">';
            										echo '<option value="-1">---</option>';
    												echo '<option value="célibataire">célibataire</option>';
    												echo '<option value="divorcé">divorcé</option>';
    												echo '<option value="Marié">Marié</option>';
    												echo '<option value="Veuf">Veuf</option>';
        									     	echo '</select></td>';
    	echo '<td width="150" height="25"><label for="date1" id="4" class="texte">&nbsp;&nbsp;Date de naissance :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="date1" id="date1" size="3" maxlength="2" class="boiteFormulaire"/>&nbsp;/
    													&nbsp;<input type="text" name="date2" id="date2" size="3" maxlength="2" class="boiteFormulaire"/>&nbsp;/
    													&nbsp;<input type="text" name="date3" id="date3" size="5" maxlength="4" class="boiteFormulaire"/>
    													</td>';
    	echo '</tr>';
    	echo '<tr>';
    	echo '<td width="150" height="25"><label for="adresse" id="5" class="texte">&nbsp;&nbsp;Adresse :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="adresse" id="adresse" size="35" maxlength="30" class="boiteFormulaire"/></td>';
    	echo '<td width="150" height="25"><label for="mail" id="6" class="texte">&nbsp;&nbsp;E-mail :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="mail" id="mail" size="35" maxlength="30" class="boiteFormulaire"/></td>';
    	echo '</tr>';
    	echo '</table>';
    	echo '</fieldset>';
     
    	echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    	echo '<tr>';
    	echo '<td class="texte" height="25" align="right">&nbsp;&nbsp;&nbsp;&nbsp;</td>';
    	echo '</tr>';
    	echo '</table>';
     
    	echo '<fieldset class="fieldset1"><legend class="texteGras">Informations professionnelles</legend>';
    	echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    	echo '<tr>';
    	echo '<td width="150" height="25"><label for="grade" id="7" class="texte">&nbsp;&nbsp;Grade :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<select name="grade" id="grade" size="1" class="boiteFormulaire">';
            										echo '<option value="-1">Sélectionner un Grade</option>';
    												while ($res_grade_tab) {
            										echo '<option value="'.$res_grade_tab['lib_grade'].'">'.$res_grade_tab['lib_grade'].'</option>';
            										$res_grade_tab=mysql_fetch_array($res_grade);
    												}
        									     	echo '</select></td>';
    	echo '<td width="150" height="25"><label for="fonction" id="8" class="texte">&nbsp;&nbsp;Fonction :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="fonction" id="fonction" size="35" maxlength="30" class="boiteFormulaire"/></td>';
    	echo '</tr>';
    	echo '<tr>';
    	echo '<td width="150" height="25"><label for="zone" id="9" class="texte">&nbsp;&nbsp;Zone :</label></td>';
    	echo '<td width="200" class="texte" height="25" colspan="3">&nbsp;<select name="zone" id="zone" size="1" class="boiteFormulaire">';
            										echo '<option value="-1">Sélectionner une Zone</option>';
    												while ($res_zone_tab) {
            										echo '<option value="'.$res_zone_tab['num_zone'].'">'.$res_zone_tab['num_zone'].' .|. '.$res_zone_tab['nom_zone'].'</option>';
            										$res_zone_tab=mysql_fetch_array($res_zone);
    												}
        									     	echo '</select></td>';
    	echo '</tr>';
    	echo '<tr>';
    	echo '<td width="150" height="25"><label for="etab" id="10" class="texte">&nbsp;&nbsp;Etablissement :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<select name="etab" id="etab" size="1" class="boiteFormulaire">';
            										echo '<option value="-1">Sélectionner une Zone</option>';
    												while ($res_etab_tab) {
            										echo '<option value="'.$res_etab_tab['num_etab'].'">'.$res_etab_tab['num_etab'].' .|. '.$res_etab_tab['nom_etab'].'</option>';
            										$res_etab_tab=mysql_fetch_array($res_etab);
    												}
        									     	echo '</select></td>';
    	echo '<td width="150" height="25"><label for="annee" id="11" class="texte">&nbsp;&nbsp;Année d\'Affectation :</label></td>';
    	echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="annee" id="annee" size="5" maxlength="4" class="boiteFormulaire"/></td>';
    	echo '</tr>';
    	echo '</table>';
    	echo '</fieldset>';
     
    	echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    	echo '<tr>';
    	echo '<td class="texte" height="25" align="right">&nbsp;&nbsp;&nbsp;&nbsp;</td>';
    	echo '</tr>';
    	echo '<tr>';
    	echo '<td class="texte" height="25" align="right"><input type="submit" name="ajouter" value="   Ajouter   " class="boiteFormulaire">&nbsp;<input type="reset" name="reset" value="   Effacer   " class="boiteFormulaire"></td>';
    	echo '</tr>';
    	echo '</table>';
     
    echo '</form></td>'

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    23
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations forums :
    Inscription : Mars 2007
    Messages : 23
    Par défaut suite le formulaire de correction
    code du formulaire de correction qui reprend les variable poste :
    page01adherent_ajouter_form_correction.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
     
    		$req_grade = "SELECT * FROM grade";
    		$res_grade=mysql_query($req_grade) or die ("Erreur SQL <br>".$req_grade."<br>".mysql_error());
    		$res_grade_tab=mysql_fetch_array($res_grade);
     
    		$req_zone = "SELECT * FROM zone";
    		$res_zone=mysql_query($req_zone) or die ("Erreur SQL <br>".$req_zone."<br>".mysql_error());
    		$res_zone_tab=mysql_fetch_array($res_zone);
     
    		$req_etab = "SELECT * FROM etablissement";
    		$res_etab=mysql_query($req_etab) or die ("Erreur SQL <br>".$req_etab."<br>".mysql_error());
    		$res_etab_tab=mysql_fetch_array($res_etab);
     
    		$req_anneecotis = "SELECT MAX(annee) as annee FROM evol_cotis";
    		$res_anneecotis=mysql_query($req_anneecotis) or die ("Erreur SQL <br>".$req_anneecotis."<br>".mysql_error());
    		$res_anneecotis_tab=mysql_fetch_array($res_anneecotis);
     
    		echo '<td width="760">';
    		echo '<form name="formajoutadh" method="post" onsubmit="return valider()" action="#">';
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td class="texte" height="10" align="center"><div id="errors"></div></td>';
    			echo '</tr>';
    		echo '</table>';
     
    		echo '<fieldset class="fieldset1"><legend class="texteGras">Cotisation</legend>';
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td width="150" class="texte" height="25"><label>&nbsp;&nbsp;Montant Cotisation :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" id="mtcotis" name="mtcotis" size="10" maxlength="8" class="boiteFormulaire" value="'.$res_anneecotis_tab['annee'].'" readonly/></td>';
    			echo '<td width="150" class="texte" height="25"><label>&nbsp;&nbsp;N° de Cotisation :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" id="numcotis" name="numcotis" size="5" maxlength="2" class="boiteFormulaire" value="1" realonly/></td>';
    			echo '</tr>';
    		echo '</table>';
    		echo '</fieldset>';
     
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td class="texte" height="25" align="right">&nbsp;&nbsp;&nbsp;&nbsp;</td>';
    			echo '</tr>';
    		echo '</table>';
     
    		echo '<fieldset class="fieldset1"><legend class="texteGras">Informations personnelles</legend>';
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td width="150" height="25"><label for="nom" id="1" class="texte">&nbsp;&nbsp;Nom :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="nom" id="nom" size="35" maxlength="30" class="boiteFormulaire" value="' .$HTTP_POST_VARS['nom']. '"/></td>';
    			echo '<td width="150" height="25"><label for="prenom" id="2" class="texte">&nbsp;&nbsp;Prénom :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="prenom" id="prenom" size="35" maxlength="30" class="boiteFormulaire" value="' .$HTTP_POST_VARS['prenom']. '"/></td>';
    			echo '</tr>';
    			echo '<tr>';
    			echo '<td width="150" height="25"><label for="situation" id="3" class="texte">&nbsp;&nbsp;Situation :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<select name="situation" id="situation" size="1" class="boiteFormulaire">';?>
    														<option value="-1" <?php if($HTTP_POST_VARS['situation']== -1)  echo '"selected"'; ?> >---</option> 
    														<option value="célibataire" <?php if($HTTP_POST_VARS['situation']== "célibataire") echo '"selected"'; ?> >célibataire</option>
    														<option value="divorcé" <?php if($HTTP_POST_VARS['situation']== "divorcé") echo '"selected"'; ?> >divorcé</option>
    														<option value="Marié" <?php if($HTTP_POST_VARS['situation']== "Marié")echo '"selected"'; ?> >Marié</option>
    														<option value="Veuf" <?php if($HTTP_POST_VARS['situation']== "Veuf") echo '"selected"'; ?> >Veuf</option> <?php
    														echo '</select></td>';
    			echo '<td width="150" height="25"><label for="date1" id="4" class="texte">&nbsp;&nbsp;Date de naissance :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="date1" id="date1" size="3" maxlength="2" class="boiteFormulaire" value="' .$HTTP_POST_VARS['date1']. '"/>&nbsp;/
    															&nbsp;<input type="text" name="date2" id="date2" size="3" maxlength="2" class="boiteFormulaire" value="' .$HTTP_POST_VARS['date2']. '"/>&nbsp;/
    															&nbsp;<input type="text" name="date3" id="date3" size="5" maxlength="4" class="boiteFormulaire" value="' .$HTTP_POST_VARS['date3']. '"/>
    															</td>';
    			echo '</tr>';
    			echo '<tr>';
    			echo '<td width="150" height="25"><label for="adresse" id="5" class="texte">&nbsp;&nbsp;Adresse :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="adresse" id="adresse" size="35" maxlength="30" class="boiteFormulaire" value="'.$HTTP_POST_VARS['adresse'].'"/></td>';
    			echo '<td width="150" height="25"><label for="mail" id="6" class="texte">&nbsp;&nbsp;E-mail :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="mail" id="mail" size="35" maxlength="30" class="boiteFormulaire" value="' .$HTTP_POST_VARS['mail']. '"/></td>';
    			echo '</tr>';
    		echo '</table>';
    		echo '</fieldset>';
     
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td class="texte" height="25" align="right">&nbsp;&nbsp;&nbsp;&nbsp;</td>';
    			echo '</tr>';
    		echo '</table>';
     
    		echo '<fieldset class="fieldset1"><legend class="texteGras">Informations professionnelles</legend>';
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td width="150" height="25"><label for="grade" id="7" class="texte">&nbsp;&nbsp;Grade :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<select name="grade" id="grade" size="1" class="boiteFormulaire">';
    														echo '<option value="-1">Sélectionner un Grade</option>';
    														while ($res_grade_tab) { 
    														?><option <?php if ($HTTP_POST_VARS['grade'] == $res_grade_tab['lib_grade']) { ?> selected <?php } ?> value=" <?php echo $res_grade_tab['lib_grade'];?> "> <?php echo $res_grade_tab['lib_grade'];?> </option><?php
    														$res_grade_tab=mysql_fetch_array($res_grade);
    														}
    														echo '</select></td>';
    			echo '<td width="150" height="25"><label for="fonction" id="8" class="texte">&nbsp;&nbsp;Fonction :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="fonction" id="fonction" size="35" maxlength="30" class="boiteFormulaire" value="' .$HTTP_POST_VARS['fonction']. '"/></td>';
    			echo '</tr>';
    			echo '<tr>';
    			echo '<td width="150" height="25"><label for="zone" id="9" class="texte">&nbsp;&nbsp;Zone :</label></td>';
    			echo '<td width="200" class="texte" height="25" colspan="3">&nbsp;<select name="zone" id="zone" size="1" class="boiteFormulaire">';
    														echo '<option value="-1">Sélectionner une Zone</option>';
    														while ($res_zone_tab) { ?>
    														?><option <?php if($HTTP_POST_VARS['zone']==$res_zone_tab['num_zone']) { ?> selected <?php } ?> value=" <?php echo $res_zone_tab['num_zone'];?> "> <?php echo $res_zone_tab['num_zone'].' .|. '.$res_zone_tab['nom_zone'];?> </option><?php
    														$res_zone_tab=mysql_fetch_array($res_zone);
    														}
    														echo '</select></td>';
    			echo '</tr>';
    			echo '<tr>';
    			echo '<td width="150" height="25"><label for="etab" id="10" class="texte">&nbsp;&nbsp;Etablissement :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<select name="etab" id="etab" size="1" class="boiteFormulaire">';
    														echo '<option value="-1">Sélectionner une Zone</option>';
    														while ($res_etab_tab) { ?>
    														?><option <?php if($HTTP_POST_VARS['etab']==$res_etab_tab['num_etab']) { ?> selected <?php } ?> value=" <?php echo $res_etab_tab['num_etab'];?> "> <?php echo $res_etab_tab['num_etab'].' .|. '.$res_etab_tab['nom_etab'];?> </option><?php
    														$res_etab_tab=mysql_fetch_array($res_etab);
    														}
    														echo '</select></td>';
    			echo '<td width="150" height="25"><label for="annee" id="11" class="texte">&nbsp;&nbsp;Année d\'Affectation :</label></td>';
    			echo '<td width="200" class="texte" height="25">&nbsp;<input type="text" name="annee" id="annee" size="5" maxlength="4" class="boiteFormulaire"  value="' .$HTTP_POST_VARS['annee']. '"/></td>';
    			echo '</tr>';
    		echo '</table>';
    		echo '</fieldset>';
     
    		echo '<table width="700" border="0" cellpadding="0" cellspacing="0">';
    			echo '<tr>';
    			echo '<td class="texte" height="25" align="right">&nbsp;&nbsp;&nbsp;&nbsp;</td>';
    			echo '</tr>';
    			echo '<tr>';
    			echo '<td class="texte" height="25" align="right"><input type="submit" name="ajouter" value="   Correction   " class="boiteFormulaire"></td>';
    			echo '</tr>';
    		echo '</table>';
     
    		echo '</form></td>';

Discussions similaires

  1. Demande aide à propos de probleme sur contrat cdi
    Par viromain dans le forum Contrat
    Réponses: 1
    Dernier message: 15/12/2010, 11h03
  2. Probleme sur un formulaire de recherche
    Par Flash_Over dans le forum IHM
    Réponses: 7
    Dernier message: 11/07/2008, 18h10
  3. probleme sur un formulaire html
    Par hahlex dans le forum Balisage (X)HTML et validation W3C
    Réponses: 8
    Dernier message: 12/04/2007, 15h24
  4. [MySQL] probleme sur un formulaire d'inscription
    Par Henry9 dans le forum PHP & Base de données
    Réponses: 12
    Dernier message: 17/09/2006, 18h55
  5. Probleme sur ouverture formulaire
    Par Bass_Room dans le forum Access
    Réponses: 8
    Dernier message: 27/06/2006, 15h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo