diff options
Diffstat (limited to 'public/m/index.php')
-rw-r--r-- | public/m/index.php | 90 |
1 files changed, 72 insertions, 18 deletions
diff --git a/public/m/index.php b/public/m/index.php index bf14b0f..e29c801 100644 --- a/public/m/index.php +++ b/public/m/index.php @@ -9,6 +9,7 @@ $config = require('../../config.php'); require('../../fn/fn.php'); require('../../class/class.art.php'); +require('../../class/class.media.php'); require('../../class/class.app.php'); require('../../class/class.aff.php'); session(); @@ -42,6 +43,24 @@ if (isset($_POST['action'])) { case 'addmedia': $app->addmedia($_FILES, 2 ** 30, $_POST['id']); break; + + case 'login': + $_SESSION['level'] = $app->login($_POST['pass']); + if (isset($_GET['id'])) { + header('Location: ?id=' . $_GET['id']); + } else { + header('Location: ?'); + } + break; + + case 'logout': + $_SESSION['level'] = $app->logout(); + if (isset($_GET['id'])) { + header('Location: ?id=' . $_GET['id']); + } else { + header('Location: ?'); + } + break; } } @@ -53,49 +72,84 @@ echo '<body>'; $aff->nav($app); $aff->addmedia(); -echo '<h1>Media</h1>'; -echo '<section class="grid">'; +echo '<details open>'; +echo '<summary>Media List</summary>'; +echo '<h1>Media</h1>'; +echo '<section class="gest">'; $dir = "../media/"; +echo '<form action="" method="post">'; + +echo '<div class="grid">'; if ($handle = opendir($dir)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $fileinfo = pathinfo($entry); - $filepath = '../media/' . $fileinfo['filename'] . '.' . $fileinfo['extension']; + $filepath = $dir . $fileinfo['filename'] . '.' . $fileinfo['extension']; list($width, $height, $type, $attr) = getimagesize($filepath); $filesize = filesize($filepath); - echo '<a href="#" class="little">'; - echo '<h3>' . $entry . '</h3>'; + echo '<div class="little">'; + + + ?> + <label for="<?= $entry ?>"><?= $entry ?></label> + <input type="hidden" name="" value=""> + <input type="checkbox" id="<?= $entry ?>" name="<?= $entry ?>" value="1"> + + <?php + echo '<img class="thumbnail" src="' . $filepath . '" alt="' . $fileinfo['filename'] . '">'; + echo '<span class="infobulle">'; + echo 'width = ' . $width . ' px'; + echo '<br/>'; + echo 'height = ' . $height . ' px'; + echo '<br/>'; + echo 'filesize = ' . readablesize($filesize); + echo '<br/>'; - echo '<img class="thumbnail" src="' . $filepath . '" alt="' . $fileinfo['filename'] . '">'; + echo '<input type="text" value="![' . $fileinfo['filename'] . '](/' . $entry . ')">'; + echo '<br/>'; - echo '<span class="infobulle">'; - echo 'width = ' . $width; - echo '<br/>'; - echo 'height = ' . $height; - echo '<br/>'; - echo 'filesize = ' . readablesize($filesize); - echo '<br/>'; - echo '<img src="' . $filepath . '" alt="' . $fileinfo['filename'] . '">'; - echo '</span>'; + echo '<img src="' . $filepath . '" alt="' . $fileinfo['filename'] . '">'; + echo '</span>'; - echo '</a>'; - } + + echo '</div>'; } - closedir($handle); } +closedir($handle); +} + +echo '</div>'; + +?> +<select name="action" id=""> + <option value="">compress /2</option> + <option value="">downscale /2</option> + <option value="">upscale *2</option> +</select> +<input type="submit" value="edit"> +<input type="submit" value="delete"> +</form> +</div> + + +<?php + echo '</section>'; +echo '</details>'; + +var_dump($app->getlistermedia($dir)); echo '</body>'; |