Example #1
0
File: index.php Project: hbenji/Web
<!DOCTYPE html>
<?php 
include_once 'user.php';
include_once 'bd2.php';
include_once 'FormUser.php';
include_once 'Affichage.php';
$mabd = new bd();
$monform = new FormUser();
if (isset($_POST['ajout'])) {
    if ($_POST['id'] == '' || !$mabd->Ajout(new user($_POST['id'], $_POST['nom'], $_POST['prenom'], $_POST['date']))) {
        exit('Ajout impossible');
    }
}
if (isset($_GET['aeffacer'])) {
    if (!$mabd->Efface($_GET['aeffacer'])) {
        exit('Suppression impossible');
    }
}
if (isset($_POST['modif'])) {
    $u = new user($_POST['id'], $_POST['nom'], $_POST['prenom'], $_POST['date']);
    if (!$mabd->Update($u)) {
        exit('Modification impossible');
    }
}
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="default.css" rel="stylesheet" type="text/css" media="screen" />
        <title>Liste des user avec Class</title>
    </head>