Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
localhost
/
admin
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php include('config/dbcon.php'); include('authentication.php'); //session_start(); include('include/header.php'); ?> <div class="container-fluid px-4"> <div class="row mt-4"> <div class="col-md-12"> <?php include('message.php'); ?> <div class="card"> <div class="card-header"> <h4>Edit Page<a href="page-view.php" class="btn btn-danger float-end">Back</a></h4> </div> <div class="card-body"> <?php if (isset($_GET['id']) && filter_var($_GET['id'], FILTER_VALIDATE_INT)) { $page_id = mysqli_real_escape_string($con, $_GET['id']); $stmt = $conn->prepare("SELECT * FROM pages WHERE id = ? LIMIT 1"); $stmt->bind_param("i", $page_id); $stmt->execute(); $result = $stmt->get_result(); $stmt->close(); /* $page_query = "SELECT * FROM pages WHERE id= '$page_id' LIMIT 1"; $page_query_res = mysqli_query($con, $page_query); */ if(mysqli_num_rows($result) > 0) { $page_row = mysqli_fetch_array($result); ?> <form action="code.php" method="POST" enctype="multipart/form-data" id="post-form"> <input type="hidden" name="page_id" value="<?= $page_row['id'] ?>"> <div class="row"> <!-- <div class="col-md-6 md-3"> <label for="">Slug (URL)</label> <input type="text" name="slug" value="<?= $page_row['slug']; ?>" required class="form-control"> </div>--> <div class="col-md-6 md-3"> <label for="">Name</label> <input type="text" name="name" value="<?= $page_row['name']; ?>" required class="form-control"> </div> <div class="col-md-6 md-3"> <label for="">Short Details</label> <input type="text" name="name_bn" value="<?= $page_row['name_bn']; ?>" required class="form-control"> </div> <div class="col-md-6 md-3"> <label for="">Category List</label> <?php $category = "SELECT * from categories WHERE category_type ='page' AND status ='0' "; $category_run = mysqli_query($con, $category); if(mysqli_num_rows($category_run) > 0 ) { ?> <select name="category_id" required class="form-control"> <option value="">--Select Category--</option> <?php foreach($category_run as $categoryitem) { ?> <?php if($_SESSION['auth_role'] == 2 || $u['user_name'] == 'International Division' && $categoryitem['name'] == 'Foreign Exchange'|| $u['user_name'] == 'Marketing Division' && $categoryitem['name'] == 'Deposit Scheme'|| $u['user_name'] == 'Card Division' && $categoryitem['name'] == 'FSIB Card') : ?> <option value="<?=$categoryitem['id']; ?>" <?= $categoryitem['id']==$page_row['category_id'] ? 'selected':''?> > <?=$categoryitem['name']; ?> </option> <?php endif; ?> <?php } ?> </select> <?php }else{ } ?> </div> <div class="col-md-12 md-3"> <label for="">Description</label> <textarea id="summernote1" name="description" required class="form-control" rows="4"><?= $page_row['description']; ?></textarea> </div> <div class="col-md-12 md-3"> <label for="">Description More</label> <textarea id="summernote2" name="description_bn" required class="form-control" rows="4"><?= $page_row['description_bn']; ?></textarea> </div> <div class="col-md-12 md-3"> <label for="">Meta Title</label> <input type="text" name="meta_title" max="191" value="<?= $page_row['meta_title']; ?>" required class="form-control"> </div> <div class="col-md-6 md-3"> <label for="">Meta Description</label> <textarea name="meta_description" required class="form-control" rows="4"><?= $page_row['meta_description'] ?></textarea> </div> <div class="col-md-6 md-3"> <label for="">Meta Keyword</label> <textarea name="meta_keyword" required class="form-control" rows="4"><?= $page_row['meta_keyword'] ?></textarea> </div> <div class="col-md-6 md-3"> <label for="">Featured Image</label> <input type="hidden" name="old_image" value="<?= $page_row['image'] ?>"> <input type="file" name="image" class="form-control"> </div> <div class="col-md-6 md-3"> <label for="">Cover Image</label> <input type="hidden" name="old_image2" value="<?= $page_row['icon'] ?>"> <input type="file" name="icon" class="form-control"> </div> <div class="col-md-6 md-3"> <label for="Status">Status</label> <input type="checkbox" name="status" <?= $page_row['status'] == '1' ? 'checked':''?> width="70px" height="70px" /> </div> <div class="col-md-6 md-3"> <button type="submit" class="btn btn-primary" name="page_update">Update Page</button> </div> </div> </form> <?php }else{ ?> <h4>No Record Found.</h4> <?php } } ?> </div> </div> </div> </div> </div> <?php include('include/footer.php'); include('include/script.php'); ?>