/
/
home
/
u917864144
/
domains
/
dtdesigner.in
/
public_html
/
admin
EDITOR
/home/u917864144/domains/dtdesigner.in/public_html/admin/category_edit.php
SAVE
CLOSE
<?php include('header.php'); $id = $_GET['id']; $query = "SELECT * FROM category WHERE id = '$id' "; $query_run = mysqli_query($con, $query); $row = mysqli_fetch_array($query_run); if (isset($_POST['submit'])) { $category_name = $_POST['category_name']; $description = $_POST['description']; $image_old = $_POST['image_old']; $image = $_FILES['image']['name']; $tmp_file = $_FILES['image']['tmp_name']; $targetPath = '../image/category/' . $image; if ($image != '') { $update_image = $image; } else { $update_image = $image_old; } $query = "UPDATE `category` SET `category_name`='$category_name',`description`='$description',`image`='$update_image' WHERE id='$id'"; $query_run = mysqli_query($con, $query); if (move_uploaded_file($tmp_file, $targetPath)) { echo " <script> alert('Successfully Data Send'); document.location.href='category.php'; </script>"; } else { echo " <script> alert('Image does not send successfully'); document.location.href='category.php'; </script>"; } } ?> <!-- sa-app__body --> <form action="" method="POST" enctype="multipart/form-data"> <div id="top" class="sa-app__body"> <div class="mx-sm-2 px-2 px-sm-3 px-xxl-4 pb-6"> <div class="container container--max--xl"> <div class="py-5"> <div class="row g-4 align-items-center"> <div class="col"> <h1 class="h3 m-0">Edit Category</h1> </div> </div> </div> <div class="sa-entity-layout" data-sa-container-query="{"920":"sa-entity-layout--size--md","1100":"sa-entity-layout--size--lg"}"> <div class="sa-entity-layout__body"> <div class="sa-entity-layout__main"> <div class="card"> <div class="card-body p-5"> <div class="mb-4"> <label for="form-coupon/code" class="form-label">Name</label> <input type="text" name="category_name" class="form-control" id="form-coupon/code" placeholder="Enter your category name" value="<?php echo $row['category_name']; ?>" /> </div> <div class="mb-4"> <label for="form-coupon/value" class="form-label">Description</label> <textarea type="text" name="description" class="form-control" id="form-coupon/value" placeholder="Enter your description" ><?php echo $row['description']; ?></textarea> </div> <div class="mb-4"> <label for="form-coupon/value" class="form-label">Image</label> <input type="file" name="image" class="form-control" id="form-coupon/value" placeholder="Enter your image" /> <input type="hidden" name="image_old" class="form-control" id="image_old" value="<?php echo $row['image']; ?>"> <img class="mt-5" src="../image/category/<?php echo $row['image']; ?>" width="50"> </div> </div> </div> </div> </div> </div> </div> <div class="col-auto d-flex justify-content-end m-5"> <a href="category.php" class="btn btn-secondary me-3">Cancel</a> <button type="submit" name="submit" class="btn btn-primary">Update</button> </div> </div> </div><!-- sa-app__body / end --> </form> <?php include('footer.php'); ?>
Ln 1, Col 1
FORMAT
WRAP
SAVE FILE
ONLINE
admin
27 items
14:08:44
TERMINAL FM
×
NAVIGATION
Root
Parent Dir
Refresh
ACTIONS
New Folder
New File
Upload Files
New Symlink
SELECTION
Select All
Deselect
Delete Selected
NEW FOLDER
FOLDER NAME
NEW FILE
FILE NAME
UPLOAD FILES
Click to browse or drag & drop files
No files selected
RENAME
CURRENT NAME
NEW NAME
COPY FILE
SOURCE
DESTINATION NAME
CHMOD
FILE / FOLDER
CURRENT PERMISSIONS
NEW MODE (octal)
755 (rwxr-xr-x)
644 (rw-r--r--)
777 (rwxrwxrwx)
600 (rw-------)
444 (r--r--r--)
CONFIRM DELETE
You are about to delete:
This action is irreversible. All contents will be permanently removed.
NEW SYMLINK
LINK TARGET (path)
LINK NAME
Edit
Preview
Download
Rename
Copy
Chmod
Delete