Файловый менеджер - Редактировать - /www/wwwroot/gamenworld.store/static/img/logo/imagestore.php.tar
�азад
www/wwwroot/gamenworld.store/admin/imagestore.php 0000755 00000016530 15044540660 0016366 0 ustar 00 <?php require "../app/includes/function_general.php"; ?> <?php $page = "Image"; require "../app/includes/imagestore_fun.php"; // $questionList = questionList(); include "includes/header.php"; ?> <?php $add = $_GET['add'] ?? ''; $edit = $_GET['edit'] ?? ''; if (isset($_POST) && !empty($_POST)) { if (isset($_POST['add_question'])) { $image_name = $_POST['image_name']; $image_path = $_POST['image_path']; $image_category_name = $_POST['image_category_name']; $sql = "INSERT INTO zon_image (`image_name`, `image_path`, `image_category_name`) VALUES ('$image_name', '$image_path', '$image_category_name') "; if (mysqli_query($socket, $sql)) { echo "<script>window.location.href = '?';</script>"; } } } if (isset($_POST) && !empty($_POST)) { if (isset($_POST['update_question'])) { $id = $_GET['token_id']; $image_name = $_POST['image_name']; $image_path = $_POST['image_path']; $image_category_name = $_POST['image_category_name']; mysqli_query($con, "SET GLOBAL max_allowed_packet=1073741824"); $sql = "UPDATE zon_image SET `image_name`='$image_name', `image_path`='$image_path', `image_category_name`='$image_category_name' WHERE id=$id "; if (mysqli_query($socket, $sql)) { echo "<script>window.location.href = '?';</script>"; } } } if (isset($_GET) && !empty($_GET)) { if (isset($_GET['action']) && isset($_GET['token_id'])) { if ($_GET['action'] == 'delete') { $id = $_GET['token_id']; if (mysqli_query($socket, "DELETE FROM zon_image WHERE id=$id")) { echo "<script>window.location.href = '?';</script>"; } } } } function getBlogDataById($id) { global $socket; $sql = mysqli_query($socket, "SELECT * FROM zon_image WHERE id=$id"); $data = mysqli_fetch_assoc($sql); return $data; } $data = []; if (isset($_GET) && isset($_GET['edit']) && isset($_GET['token_id'])) { $data = getBlogDataById($_GET['token_id']); } ?> <body> <main class="d-flex"> <?php include "includes/sidebar.php"; ?> <div class="main w-full px-12 py-6"> <?php if ($add == 'true' || $edit == 'true') { ?> <div class="games-list mt-6"> <form action="" method="post" id="add-page" enctype="multipart/form-data" class="tab"> <div class="input-group flex flex-column mt-6"> <label class="text-gray-500 uppercase text-[10px] mb-2">Image Name</label> <input value="<?php echo $edit == 'true' ? $data['image_name'] : '' ?>" name="image_name" class="py-[15px] text-gray-500 outline-none focus:outline focus:outline-blue-500 transition-sm px-3 text-xs" type="text" placeholder="Blog Description"> </div> <div class="input-group flex flex-column mt-6"> <label class="text-gray-500 uppercase text-[10px] mb-2">Image Category</label> <input value="<?php echo $edit == 'true' ? $data['image_category_name'] : '' ?>" name="image_category_name" class="py-[15px] text-gray-500 outline-none focus:outline focus:outline-blue-500 transition-sm px-3 text-xs" type="text" placeholder="Blog Description"> </div> <div class="input-group flex flex-column mt-6"> <label class="text-gray-500 uppercase text-[10px] mb-2">ImagePath</label> <input value="<?php echo $edit == 'true' ? $data['image_path'] : '' ?>" required name="image_path" class="py-[15px] text-gray-500 outline-none focus:outline focus:outline-blue-500 transition-sm px-3 text-xs" type="text" placeholder="Image Path"> </div> <button name="<?php echo $edit == 'true' ? 'update_question' : 'add_question' ?>" class="bg-blue-600 text-white uppercase mt-4 text-sm rounded-sm py-2 px-3 "> <?php echo $edit == 'true' ? 'Update Questions' : 'Add Questions' ?> </button> </form> </div> <?php } else { ?> <div class="games-list"> <a href="?add=true" class="py-2 px-6 bg-blue-400 text-white uppercase text-xs rounded-md">ADD</a> <table class="w-full mt-10 "> <thead class="border-b-2 dark:border-zinc-900 px-16 border-gray-100 py-2"> <td class=" text-gray-400 py-2 text-xs px-6">#Id</td> <td class=" text-gray-400 py-2 text-xs px-6 w-full">Image</td> <td class=" text-gray-400 py-2 text-xs px-6 w-full">Image Category</td> <td class=" text-gray-400 py-2 text-xs text-right px-6">Action</td> </thead> <tbody class="py-4"> <?php $run = mysqli_query($con, 'select * from zon_image') ?> <?php while ($row = mysqli_fetch_assoc($run)) { ?> <tr class="bg-[white] dark:bg-zinc-900 px-16 py-4 rounded-lg"> <td class="text-xs px-6 text-gray-500"> <?= $row['id'] ?> </td> <td class="text-gray-500 px-4 text-sm flex items-center py-3"> <img class="object-cover h-12 w-12 rounded-lg mr-4 overflow-hidden" src="<?= $row['image_path'] ?>"><?= $row['image_name'] ?> </td> <td class="text-xs px-6 text-gray-500"> <?= $row['image_category_name'] ?> </td> <td class="text-right relative px-6"> <button data-target="#dc_<?= $row['id'] ?>" class="bi-three-dots-vertical text-gray-500 drop_btn"></button> <div id="dc_<?= $row['id'] ?>" style="z-index: 99;" class="dropdown absolute bg-white text-right right-0 hidden flex-column "> <a href="?action=delete&token_id=<?= $row['id'] ?>" class="text-xs px-4 py-2 text-red-700">Delete</a> <a href="?edit=true&token_id=<?= $row['id'] ?>" class="text-xs px-4 py-2">Edit</a> </div> </td> </tr> <?php } ?> </tbody> </table> </div> <?php } ?> </div> </main> <script> var editor1 = new RichTextEditor("#editor"); </script> <?php include "includes/footer.php"; ?> </body> </html>