From aad58a057640120027650ab3847212ba1178538e Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sun, 18 Mar 2018 20:20:03 +0100 Subject: version 01 --- public/css/style.css | 72 ++++++++++++++++++++++++-- public/index.php | 50 +----------------- public/w/art.php | 0 public/w/art_create.php | 0 public/w/art_delete.php | 0 public/w/art_display.php | 0 public/w/art_edit.php | 0 public/w/index.php | 131 ++++++++++++++++++++++------------------------- 8 files changed, 130 insertions(+), 123 deletions(-) delete mode 100644 public/w/art.php delete mode 100644 public/w/art_create.php delete mode 100644 public/w/art_delete.php delete mode 100644 public/w/art_display.php delete mode 100644 public/w/art_edit.php (limited to 'public') diff --git a/public/css/style.css b/public/css/style.css index ca04f38..245258c 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,6 +1,25 @@ -body {background-color: #dcdcdceb;} +body { + background-color: #dcdcdceb; -input, textarea, select { +} + +h1 { + font-size: 3em; +} + +h2 { + font-style: italic; +} + +h3 { + opacity: 0.7; +} + +p{ + font-size: 1.1em; +} + +article input, textarea, select { width: 90%; padding-left: 15px; padding-right: 15px; @@ -10,6 +29,51 @@ input, textarea, select { height: 30px; border-style: unset; } -textarea { - height: 1000px; +#html{ + height: 400px; +} + +#css{ + height: 100px; +} + +input[type="submit"] { + background-color: #bfbfbf; +} + +aside { + position: fixed; + bottom: 0px; + right: -300px; + padding: 7px; + z-index: 5; + background: coral; + opacity: 0.3; + width: 350px; +} + +aside:hover { + opacity: 0.9; + right: 0px; +} + +nav { + position: fixed; + top: 0px; + right: -50px; + padding: 7px; + z-index: 10; + background: #5085ff; + opacity: 0.3; + width:100px; +} + +nav:hover { + opacity: 0.9; + right: 0px; +} + +.alert h4 { + background-color: red; + margin: 0px; } \ No newline at end of file diff --git a/public/index.php b/public/index.php index 9b8a61b..2409769 100644 --- a/public/index.php +++ b/public/index.php @@ -1,51 +1,3 @@ w - - -getMessage()); -} - -// $reponse = $bdd->query('SELECT nom, age FROM art2 WHERE nom = \'eddie\''); - -// while ($donnees = $reponse->fetch()) -// { -// echo $donnees['nom'] . ' a ' . $donnees['age'] . ' ANS
'; -// } - -// $reponse->closeCursor(); - -// $req = $bdd->prepare('SELECT nom, age FROM art2 WHERE age = 23 '); -// $req->execute(array($_GET['possesseur'], $_GET['prix_max'])); - -// echo ''; - -// $req->closeCursor(); - -$req = $bdd->prepare('SELECT * FROM art WHERE id = :id '); -$req->execute(array('id' => 'articlet')); - -echo ''; - -$req->closeCursor(); - - - -?> \ No newline at end of file + \ No newline at end of file diff --git a/public/w/art.php b/public/w/art.php deleted file mode 100644 index e69de29..0000000 diff --git a/public/w/art_create.php b/public/w/art_create.php deleted file mode 100644 index e69de29..0000000 diff --git a/public/w/art_delete.php b/public/w/art_delete.php deleted file mode 100644 index e69de29..0000000 diff --git a/public/w/art_display.php b/public/w/art_display.php deleted file mode 100644 index e69de29..0000000 diff --git a/public/w/art_edit.php b/public/w/art_edit.php deleted file mode 100644 index e69de29..0000000 diff --git a/public/w/index.php b/public/w/index.php index 41137d0..6148dee 100644 --- a/public/w/index.php +++ b/public/w/index.php @@ -1,95 +1,86 @@ exist($_GET['id'])) { + $art = new Art($_POST); + $app->update($art); + header('Location: ?id=' . $art->id() . '&edit=1'); + } + break; + + case 'login' : + $app->login($_POST['pass']); + header('Location: ?id=' . $_GET['id']); + break; + + case 'logout' : + $app->logout(); + header('Location: ?id=' . $_GET['id']); + break; + } + +} -// $art = new Art([ -// 'id' => 'prout', -// 'titre' => 'Prout', -// 'soustitre' => 'mega prout !', -// 'intro' => 'bienvenue dans le mega prout', -// 'datemodif' => new DateTimeImmutable(null, timezone_open("Europe/Paris")) -// ]); -// $arraytest = ([ -// 'id' => 'articlet2', -// 'titre' => 'titre', -// 'soustitre' => 'soustitre', -// 'intro' => 'intro', -// 'tag' => 'sans tag,', -// 'datecreation' => '2018-03-17 18:31:34', -// 'datemodif' => '2018-03-17 18:31:34', -// 'css' => 'display: inline:', -// 'html' => 'coucou les loulous', -// 'secure' => 0, -// 'couleurtext' => '#000000', -// 'couleurbkg' => '#ffffff', -// 'couleurlien' => '#2a3599' -// ]); -// $art = new Art($arreytest); +// _______________________________________________________ H E A D _____________________________________________________________ +$titre = 'home'; +if (isset($_GET['id'])) { + $titre = $_GET['id']; + if ($app->exist($_GET['id'])) { + $art = $app->get($_GET['id']); + $titre = $art->titre(); + } +} +$aff->head($titre); -// echo '
';
-// print_r($art);
-// print_r($app);
-// echo '
'; -// $app->add($art); -// echo '

art count :' . $app->count() . '

'; -// echo '

article exist :' . $app->exist('articlet') . '

'; -// var_dump($app->exist('articlet')); +// ______________________________________________________ B O D Y _______________________________________________________________ -$session = 2; +echo ''; +$aff->nav($app); if (isset($_GET['id'])) { - - if ($session == 2) { - ?> - - exist($_GET['id'])) { + + $art = $app->get($_GET['id']); -if ($app->exist($_GET['id'])) { - - if (isset($_POST['action']) and $_POST['action'] == 'update') { - $art = new Art($_POST); - var_dump($art); - $app->update($art); - header('Location: ?id=' . $art->id() . '&edit=1'); - - } - - $art = $app->get($_GET['id']); - - - - if (isset($_GET['display']) and $_GET['display'] == 1) { - $art->display($session); - } if (isset($_GET['edit']) and $_GET['edit'] == 1) { - $art->edit($session); + $aff->edit($art); + $aff->aside($app->list()); + } else { + $aff->lecture($art); + } } else { if (isset($_POST['action'])) { @@ -101,20 +92,20 @@ if ($app->exist($_GET['id'])) { header('Location: ?id=' . $_GET['id'] . '&edit=1'); } } else { - echo '

Cet article n\'éxiste pas encore

'; + echo '

Cet article n\'existe pas encore

'; - if ($session >= 2) { + if ($_SESSION['level'] >= 2) { echo '
'; } - echo 'retour maison'; } } } else { echo "

Bienvenue sur ce site.

"; - $app->menu($session); + $aff->home($app->list()); } +echo ''; -- cgit v1.2.3