<pre><?php if($_GET['id']) { $id=$_GET['id']; include 'connect.php'; $sql = "SELECT * FROM etudiant WHERE id='$id'"; $res = mysqli_query($connect, $sql); $row = mysqli_fetch_assoc($res); if (mysqli_num_rows($res)>0) ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Supprimer</title> </head> <body> <p><div align="center"><h1>Voulez vous supprimer l'étudiant(e) <?php echo $row['prenom']; ?> ?</h1></p> <p><a href="supp2.php?id=<?php echo $row['id']; ?>"><button>Oui</button></a> <a href="accueil.php"><button>Non</button></a></p> <?php include ("captcha.php") ?> </div> <pre><?php include ("captcha.php") ?> </div> </body> </html> <?php }
<?php session_start(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Accueil</title> </head> <body> <?php if(isset($_SESSION['email']) AND isset($_SESSION['password'])) { echo "<h3>Bienvenue ".$_SESSION['prenom']." ".$_SESSION['nom']." !"; echo "<div align='right'><a align='right' href='deconnect.php'><button type='button'>Se déconnecter</button></a></div>"; ?> <table border="1" align="center"> <caption><h1>La liste des étudiants</h1></caption> <tr><td align="center">Photo</td> <td align="center">Matricule</td> <td align="center">Nom</td> <td align="center">Prénom</td> <td align="center">Adresse</td> <td align="center">Date de naissance</td> <td align="center">E-mail</td> <td align="center" colspan="2">Action</td> <td align="center">Suppression Multiple</td> <td align="center">Upload</td></tr> <?php include 'connect.php'; $sql = "SELECT * FROM etudiant"; $res = mysqli_query($connect, $sql); if (mysqli_num_rows($res)>0){ while($row = mysqli_fetch_assoc($res)) { echo "<tr><td>"; ?> <?php if(empty($row['photo'])) { ?> <img src='photos/image.jpg' width="100" height="100"> <?php } else { ?> <img src='photos/<?php echo $row['photo'] ?>' width="100" height="100"> <?php } echo "</td>"; echo "<td align='center'>".$row['matricule']."</td>"; echo "<td align='center'>".$row['nom']."</td>"; echo "<td align='center'>".$row['prenom']."</td>"; echo "<td align='center'>".$row['adresse']."</td>"; echo "<td align='center'>".$row['date_naissance']."</td>"; echo "<td align='center'>".$row['email']."</td>"; if($_SESSION['email']==$row['email'] OR $_SESSION['email']=='medsedkicherif@gmail.com') { echo "<td><a href='Modif.php?id=".$row['id']."'><button type='button'>Modifier</button></a>"; echo "<td><a href='Supp.php?id=".$row['id']."'><button type='button'>Supprimer</button></a></td>"; echo "<form method='POST' action='Supp3.php'><td align='center'><input type='checkbox' name='sup[]' value='".$row['id']."'></form></td>"; echo "<td align='center'><form method='POST' enctype='multipart/form-data' action='upload.php'><input type='file' name='fichier'><input type='submit' value='Valider'></td></tr><input type='hidden' name='id' value='".$row['id']."'></td></tr></form>"; } } echo "<tr><td colspan='9'></td><td colspan='1' align='center'><button>Suppression Multiple</button></td></tr></form>"; } else { echo "<tr><td colspan ='10' align='center'>Pas de données disponibles.</td></tr>"; $sql = "TRUNCATE etudiant"; $res = mysqli_query($connect, $sql); } ?> </table> <p align="center"><a href="ajout.php"><button>Ajouter un étudiant</button></a></p> <?php } else { echo "<div align='center'><h1>Vous n'êtes pas autorisé à acceder a cette page."; echo "<br><a href='index.php'><button type='button'>Retour</button></a></div>"; } ?> </body> </html>
<!DOCTYPE html> <html> <body> <tr> <td colspan=2 align="center"> <div class="g-recaptcha" data-sitekey="" data-callback="verifyCaptcha"></div> <div Id="g-recaptcha-error"></div> <script src="https://www.google.com/recaptcha/api.js"> { }</script> <tr> <script> function submitUserForm() { var response = grecaptcha.getResponse(); console.log(response.length); if(response.length == 0) { document.getElementById('g-recaptcha-error').innerHTML = '<span style="color:red;">Google recaptcha field is required.</span>'; return false; } return true; } function verifyCaptcha() { console.log('verified'); document.getElementById('g-recaptcha-error').innerHTML = ''; } </script> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)