diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-03-18 03:48:04 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-03-18 03:48:04 +0100 |
commit | 2060e198b1f9ac41deee93848417121fb1c066f5 (patch) | |
tree | ff3abf3f4af68cef081d19f3aa935079bdf25ad6 /public | |
parent | 3650a038f0a6c99d52723e9567d5f173c4398c3a (diff) | |
download | wcms-2060e198b1f9ac41deee93848417121fb1c066f5.tar.gz wcms-2060e198b1f9ac41deee93848417121fb1c066f5.zip |
classes fonctionnelles
Diffstat (limited to 'public')
-rw-r--r-- | public/css/style.css | 15 | ||||
-rw-r--r-- | public/rsc/css/style.css | 0 | ||||
-rw-r--r-- | public/w/index.php | 117 |
3 files changed, 91 insertions, 41 deletions
diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..ca04f38 --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,15 @@ +body {background-color: #dcdcdceb;} + +input, textarea, select { + width: 90%; + padding-left: 15px; + padding-right: 15px; + margin: 5px; + margin-left: 5%; + margin-right: 5%; + height: 30px; + border-style: unset; +} +textarea { + height: 1000px; +}
\ No newline at end of file diff --git a/public/rsc/css/style.css b/public/rsc/css/style.css deleted file mode 100644 index e69de29..0000000 --- a/public/rsc/css/style.css +++ /dev/null diff --git a/public/w/index.php b/public/w/index.php index 99d8cb6..41137d0 100644 --- a/public/w/index.php +++ b/public/w/index.php @@ -24,21 +24,21 @@ head('article'); // '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' -]); +// $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); @@ -54,32 +54,67 @@ $arraytest = ([ // echo '<p>article exist :' . $app->exist('articlet') . '</p>'; // var_dump($app->exist('articlet')); - - -echo '<pre>'; -$art = $app->get('articlet'); - -var_dump($art); - -echo 'count : ' . $app->count(); - - var_dump($app->exist('bouffffe')); - var_dump($app->exist('bouffe')); - - - $art2 = new Art($arraytest); - -// $app->add($art2); - -$app->update($art2); - -var_dump($app->getlist()); - -echo '</pre>'; - - - - +$session = 2; + + +if (isset($_GET['id'])) { + + if ($session == 2) { + ?> + <nav> + <a href="?" >home</a> + <a href="?id=<?= $_GET['id'] ?>&display=1" target="_blank">display</a> + <a href="?id=<?= $_GET['id'] ?>&edit=1" >edit</a> + </nav> + <?php + + +} + +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); + } + } else { + if (isset($_POST['action'])) { + if ($_POST['action'] == 'new') { + $art = new Art($_GET); + $art->default(); + var_dump($art); + $app->add($art); + header('Location: ?id=' . $_GET['id'] . '&edit=1'); + } + } else { + echo '<h4>Cet article n\'éxiste pas encore</h4>'; + + if ($session >= 2) { + echo '<form action="?id=' . $_GET['id'] . '&edit=1" method="post"><input type="hidden" name="action" value="new"><input type="submit" value="créer"></form>'; + } + echo '<a href="?info=erreur">retour maison</a>'; + + } + + } +} else { + echo "<h4>Bienvenue sur ce site.</h4>"; + $app->menu($session); +} |