Académique Documents
Professionnel Documents
Culture Documents
DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<?php
if (isset($_SESSION['message'])): ?>
<?php
echo $_SESSION['message'];
unset($_SESSION['message']);
?>
</div>
<?php
//pre_r($result);
?>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Nom</th>
<th>Prenom</th>
<th
colspan="2">Operation</th>
</tr>
</thead>
<?php
<tr>
<td>
<a href="etudiants-add.php?
edit=<?php echo $row['Id']; ?>" class="btn btn-info">Modifier</a>
<a href="process.php?
delete=<?php echo $row['Id']; ?>" class="btn btn-danger">Supprimer</a>
</td>
</tr>
</table>
</div>
<?php
echo '<pre>';
print_r($array);
echo '</pre>';
?>
<div class="form-group">
<label>Nom</label>
<input type="text" name="Nom" class="form-control"
value="<?php echo $Nom; ?>" placeholder="Entrer votre nom">
</div>
<div class="form-group">
<label>Prenom</label>
</div>
<div class="form-group">
<?php
if ($update == true):
?>
</div>
</form>
</div>
</div>
</body>
</html>
<?php
session_start();
$update = false;
$Id=0;
$Nom = '';
$Prenom = '';
if (isset($_POST['save'])){
$Nom = $_POST['Nom'];
$Prenom=$_POST['Prenom'];
$_SESSION['msg_type'] = "success";
header("Prenom: etudiants-add.php");
if (isset($_GET['delete'])){
$Id = $_GET['delete'];
$_SESSION['msg_type'] = "danger";
header("Prenom: etudiants-add.php");
if (isset($_GET['edit'])){
$Id = $_GET['edit'];
$update = true;
if (@count($result)==1){
$row = $result->fetch_array();
$Nom = $row['Nom'];
$Prenom = $row['Prenom'];
if (isset($_POST['update'])){
$Id = $_POST['Id'];
$Nom = $_POST['Nom'];
$Prenom = $_POST['Prenom'];
$_SESSION['msg_type']="warning";
header('Prenom: etudiants-add.php');
?>