<?php if(isset($_POST['Ncandidat']) && !empty($_POST['Ncandidat'])){ include("connection.php"); $id= (int)$_POST['Ncandidat']; $id=mysql_real_escape_string($id); $sql = "SELECT DISTINCT Ncandidat,nom,pieceP,contact,nationalite FROM candidat where Ncandidat='".$id."'"; $req = mysql_query($sql) or die('Erreur SQL ! '.$sql.' '.mysql_error()); } ?> <!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>Document sans titre</title> <style type="text/css"> <!-- .Style3 {color: #FFFFFF} .Style11 {color: #0000FF; font-weight: bold; } .Style14 {color: #990000} .Style16 { color: #000000; font-weight: bold; } .Style17 {font-weight: bold} --> </style> </head> <form id="form1" name="form1" method="post" action=""> Accueil, , ---- Numero du Candidat , </form> <center> <fieldset style="width: 650px;" > <legend>RENSEIGNEMENT SUR LE CANDIDAT</legend> <table width="637" border="0" align="center" cellspacing="1" bordercolor="#333333" bgcolor="#FFFFCC"> ---- |, </td> ---- NOM ET PRENOMS | NUMERO DE LA PIECE | CONTACT | NATIONALITEL | <?php while ($liste_etu =mysql_fetch_assoc($req)) { $j= $i%2; ?> ---- "/>, "/>, "/>, "/>, <?php } ?> </fieldset> </center> <center> <fieldset style="width: 650px;" ><legend>PAYEMENT</legend> | , ---- NUMERO DE PAYEMENT | DATE DE PAEYEMENT | MTV | <?php //if(isset($_POST['Ncandidat']) && !empty($_POST['Ncandidat'])){ include(\"connection.php\"); $id =(int)$_POST['Ncandidat']; $id=mysql_real_escape_string($id); // if($req){ $id1=(int)$_POST['id_P']; $id1=mysql_real_escape_string($id1); $sql = \"SELECT * FROM payement WHERE id_P='\".$id.\"' \"; $req = mysql_query($sql) or die(a.'Erreur SQL ! '.$sql.' '.mysql_error()); while ($liste_etu=mysql_fetch_assoc($req)) { $j=$i%2; ?> ---- "/>, "/>, "/>, <?php // } //} } ?> </fieldset> </center></td> <td width="316"> </td> </tr> <tr> <td height="225"> </td> <td width="316"> </td> </tr> <tr> <td> </td> <td width="316"> </td> </tr> </table> </html>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question<?php if(isset($_POST['Ncandidat']) && !empty($_POST['Ncandidat'])){ include("connection.php"); $id= (int)$_POST['Ncandidat']; $id=mysql_real_escape_string($id); $sql = "SELECT DISTINCT a.Ncandidat,a.nom,a.pieceP,a.contact,a.nationalite,b.Npayement,b.datePay,b.MTV FROM candidat a, renseigner b where Ncandidat='".$id."'"; $req = mysql_query($sql) or die('Erreur SQL ! '.$sql.' '.mysql_error()); } ?> <!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>Document sans titre</title> <style type="text/css"> <!-- .Style3 {color: #FFFFFF} .Style11 {color: #0000FF; font-weight: bold; } .Style14 {color: #990000} .Style16 { color: #000000; font-weight: bold; } .Style17 {font-weight: bold} --> </style> </head> <form id="form1" name="form1" method="post" action=""> Accueil, , ---- Numero du Candidat , </form> <center> <fieldset style="width: 650px;" > <legend>RENSEIGNEMENT SUR LE CANDIDAT</legend> <table width="637" border="0" align="center" cellspacing="1" bordercolor="#333333" bgcolor="#FFFFCC"> ---- |, </td> ---- NOM ET PRENOMS | NUMERO DE LA PIECE | CONTACT | NATIONALITEL | NUMERO DE PAYEMENT | DATE DE PAEYEMENT | MTV | <?php while ($liste_etu =mysql_fetch_assoc($req)) { $j=$i%2; ?> ---- "/>, "/>, "/>, "/>, "/>, "/>, "/>, <?php } ?> </fieldset> </center> <td width="316"> </td> </tr> <tr> <td height="225"> </td> <td width="316"> </td> </tr> <tr> <td> </td> <td width="316"> </td> </tr> </table> </html>
<?php print_r($_POST); if(isset($_POST['Ncandidat']) && !empty($_POST['Ncandidat'])){ include("config/config.php"); echo $id= (int)$_POST['Ncandidat']; $id=mysql_real_escape_string($id); $sql = "SELECT DISTINCT candidat.Ncandidat,candidat.nom,candidat.pieceP,candidat.contact,candidat.nationalite,payement.Npayement,payement.datePay,payement.MTV FROM candidat,payement where candidat.Ncandidat = payement.Ncandidat and candidat.Ncandidat='".$id."'"; /* $query = "SELECT candidat.Ncandidat,candidat.nom,candidat.pieceP,candidat.contact,candidat.nationalite,payement.Npayement,payement.datePay,payement.MTV ". "FROM candidat, payement ". "WHERE candidat.Ncandidat = payement.Ncandidat"; */ $req = mysql_query($sql) or die('Erreur SQL ! '.$sql.' '.mysql_error()); $res=null; while ($liste_etu=mysql_fetch_assoc($req)) { //$j=$i%2; $res.='<tr bgcolor=#FFFFCC> <td bgcolor="#CCCCCC"></td> <td bgcolor="#CCCCCC"></td> <td bgcolor="#CCCCCC"></td> <td bgcolor="#CCCCCC"></td> <td bgcolor="#CCCCCC"></td> <td bgcolor="#CCCCCC"></td> <td bgcolor="#CCCCCC"></td> </tr>'; } }else{ $res=null; } ?> <!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>Document sans titre</title> <style type="text/css"> <!-- .Style3 {color: #FFFFFF} .Style11 {color: #0000FF; font-weight: bold; } .Style14 {color: #990000} .Style16 { color: #000000; font-weight: bold; } .Style17 {font-weight: bold} --> </style> </head> <form id="form1" name="form1" method="post" action=""> Accueil, , ---- Numero du Candidat , </form> <center> <fieldset style="width: 650px;" > <legend>RENSEIGNEMENT SUR LE CANDIDAT</legend> <table width="637" border="0" align="center" cellspacing="1" bordercolor="#333333" bgcolor="#FFFFCC"> ---- |, </td> ---- NOM ET PRENOMS | NUMERO DE LA PIECE | CONTACT | NATIONALITEL | NUMERO DE PAYEMENT | DATE DE PAEYEMENT | MTV | <?php echo $res = isset($res) ? $res : null; ?> </fieldset> </center> <td width="316"> </td> </tr> <tr> <td height="225"> </td> <td width="316"> </td> </tr> <tr> <td> </td> <td width="316"> </td> </tr> </table> </html>
<?php /******************************************************************************/ function nettoieProtect(){ foreach($_POST as $k => $v){ $v=mysql_real_escape_string(strip_tags(trim($v))); $_POST[$k]=$v; } foreach($_GET as $k => $v){ $v=mysql_real_escape_string(strip_tags(trim($v))); $_GET[$k]=$v; } foreach($_REQUEST as $k => $v){ $v=mysql_real_escape_string(strip_tags(trim($v))); $_REQUEST[$k]=$v; } } /******************************************************************************/ $dbhost='localhost';/*adresse du serveur de la base de donnée*/ $dbuser='root';/*identifiant personnel à la base de donnée*/ $dbpass='';/*mot de passe pour y accéder*/ $db='amsi';/*nom de la base*/ $table='comptes_utilisateurs'; /*connexion au serveur*/ @mysql_connect($dbhost,$dbuser,$dbpass); @mysql_select_db($db); /*protection de la base*/ nettoieProtect(); ?>
$sql = "SELECT DISTINCT candidat.Ncandidat,candidat.nom,candidat.pieceP,candidat.contact,candidat.nationalite,payement.Npayement,payement.datePay,payement.MTV ,candidat.montantT - payement.MTV AS "RESTE" FROM candidat,payement where candidat.Ncandidat = payement.Ncandidat and candidat.Ncandidat='".$id."'";
$sql = "SELECT DISTINCT candidat.Ncandidat,candidat.nom,candidat.pieceP,candidat.contact,candidat.nationalite,payement.Npayement,payement.datePay,payement.MTV ,candidat.montantT - payement.MTV AS RESTE FROM candidat,payement where candidat.Ncandidat = payement.Ncandidat and candidat.Ncandidat='".$id."'";