����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 162.0.232.25 / Your IP : 52.14.176.111 Web Server : LiteSpeed System : Linux premium276.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : kwacuqig ( 988) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/kwacuqig/learn.skilltainment.org/ |
Upload File : |
<?php include './sidebar.php'; include './navbar.php'; if (isset($_GET['title'])) { if (!empty($_GET['title'])) { $title_hiphen = mysqli_real_escape_string($conn, $_GET['title']); $title = str_replace('-', ' ', $title_hiphen); $run = mysqli_query($conn, "SELECT * FROM `workshops` WHERE `title`='$title'") or die(mysqli_error($conn)); while ($row = mysqli_fetch_array($run)) { $workshop_id = $row['wid']; $workshop_calender = $row['calender']; $workshop_link = $row['link']; } } } ?> <div class="container-fluid pt-2 px-4"> <div class="row g-2"> <?php if ($user_type == 1) { if (isset($_POST['submit'])) { $id = $_POST['id']; $image_name = strtolower($_FILES['image']['name']); $image_type = $_FILES['image']['type']; $image_size = $_FILES['image']['size']; $image_tmp_name = $_FILES['image']['tmp_name']; switch ($image_type) { case 'image/png': $extension = ".png"; break; case 'image/jpg': $extension = ".jpg"; break; case 'image/jpeg': $extension = ".jpg"; break; case 'image/gif': $extension = ".gif"; default: $extension = ".jpg"; } //new image name with its particular extension $image_new_name = filter_file('image-' . date('Ymd-His') . $extension); $location = './workshops/images/'; //checking if file to be uploaded is an image if ($image_type == 'image/JPG' || $image_type == 'image/jpeg' || $image_type == 'image/png' || $image_type == 'image/jpg') { //checking if both audio and image are uploaded if (compressImage($image_tmp_name, $location . $image_new_name, 50)) { $sql = "INSERT INTO `workshop`(`wid`,`image`) VALUES('$id','$image_new_name')"; //checking if the query has run successfully if (mysqli_query($conn, $sql)) { unset($_SESSION['title'], $_SESSION['link']) ?> <script type="text/javascript"> swal("", "Image was successfully uploaded", "success"); </script> <?php } else { die(mysqli_error($conn)); } } else { ?> <script type="text/javascript"> swal("", "Failed to upload image", "error"); </script> <?php } } else { ?> <script type="text/javascript"> swal("", "<?php echo $image_new_name; ?> is not an image", "error"); </script> <?php } } ?> <div class="col-12 d-flex justify-content-end"> <form action="workshop=<?php echo $title_hiphen; ?>" method="POST" enctype="multipart/form-data" class="d-flex"> <div> <input type="file" name="image" id="file-2" class="inputfile inputfile-2" data-multiple-caption="{count} files selected" accept=".jpg, .png, .jpeg" multiple required /> <label for="file-2"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 17"> <path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z" /> </svg> <span>Select Image</span> </label> </div> <input type="hidden" name="id" value="<?php echo $workshop_id; ?>"> <div> <button type="submit" name="submit" class="btn btn-primary w-100 pt-2 pb-2" style="height:48px;">Upload</button> </div> </form> </div> <?php } ?> <?php $run = mysqli_query($conn, "SELECT * FROM `workshop` WHERE `wid`='$workshop_id'") or die(mysqli_error($conn)); while ($row = mysqli_fetch_array($run)) { ?> <div class="col-xl-3 col-lg-4 col-md-4 col-sm-6" data-aos="flip-up" data-aos-duration="500"> <img src="./workshops/images/<?php echo $row['image']; ?>" class="workshop-image" alt> </div> <?php } ?> </div> <div class="col-12 d-flex justify-content-center my-1"> <a href="<?php echo $workshop_link;?>" class="bg-primary btn text-white">More Images...</a> </div> <div class="col-12"> <iframe src="<?php echo $workshop_calender; ?>" class="calender" frameborder="0" scrolling="no"></iframe> </div> </div> <script> document.querySelector("title").innerText = "<?php echo strtoupper($title); ?>"; <?php if ($user_type == 1) { ?> document.querySelectorAll(".navbar-nav a")[4].classList.add("active"); <?php } else { ?> document.querySelectorAll(".navbar-nav a")[1].classList.add("active"); <?php } ?> </script> <?php include './footer.php'; ?>