:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/finartindia.com/admin/**
:: Editing File: category_add.php
<?php require_once 'db.php'; require_once 'session.php'; include"header.php"; // Close database connection mysqli_close($conn); ?> <!-- start page content wrapper--> <div class="page-content-wrapper"> <!-- start page content--> <div class="page-content"> <!--start breadcrumb--> <div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3"> <div class="breadcrumb-title pe-3">Category</div> <div class="ps-3"> <nav aria-label="breadcrumb"> <ol class="breadcrumb mb-0 p-0 align-items-center"> <li class="breadcrumb-item"><a href="dashboard.php"><ion-icon name="home-outline"></ion-icon></a> </li> <li class="breadcrumb-item active" aria-current="page">Add Category</li> </ol> </nav> </div> </div> <!--end breadcrumb--> <div class="card"> <div class="card-header"> <h6 class="mb-0">Add Category</h6> </div> <div class="card-body"> <form action="category_save.php" method="POST" enctype="multipart/form-data"> <div class="row"> <div class="mb-3 col-sm-6"> <label class="form-label">Category Name </label> <input type="text" class="form-control" id="categoryName" name="name" required> </div> <div class="mb-3 col-sm-6"> <label class="form-label">Subheading</label> <input type="text" class="form-control" id="subheading" name="subheading"> </div> <div class="mb-3 col-sm-6"> <label class="form-label">Image Upload </label> <input type="file" class="form-control" id="groupImage" name="image" accept="image/*"> </div> <div class="mb-3 col-sm-6"> <label class="form-label">URL Slug </label> <input type="text" class="form-control" id="urlSlug" name="url"> </div> <!--<div class="mb-3 col-sm-4"> <label class="form-label">Sort Order </label> <input type="number" class="form-control" id="sortOrder" name="sort_order"> </div> --> <div class="mb-3 col-sm-12"> <label class="form-label">Content/Description </label> <textarea class="form-control" id="groupContent" name="content" rows="5"></textarea> </div> <div class="col-12 mt-4"> <button type="submit" class="btn btn-primary" >Save Collection Group</button> <a href="category.php" class="btn btn-warning">Back to List</a> </div> </div> </form> </div> </div> </div> </div> <?php include"footer.php";?> <script> document.getElementById('categoryName').addEventListener('input', function () { let name = this.value.trim(); // Convert to lowercase let slug = name.toLowerCase(); // Replace spaces and underscores with hyphens slug = slug.replace(/[\s_]+/g, '-'); // Remove all non-alphanumeric characters except hyphens slug = slug.replace(/[^a-z0-9\-]/g, ''); // Remove multiple consecutive hyphens slug = slug.replace(/-+/g, '-'); // Remove hyphens from start and end slug = slug.replace(/^-+|-+$/g, ''); document.getElementById('urlSlug').value = slug; }); </script>