File "service-edit.php"

Full path: /home/fsibplc/public_html/admin/service-edit.php
File size: 5.98 B (5.98 KB bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?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 Service<a href="service-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)) {
                  $service_id = mysqli_real_escape_string($con, $_GET['id']); 

                  //  $service_id = $_GET['id'];

                  $stmt = $conn->prepare("SELECT * FROM services WHERE id= ? LIMIT 1"); 
                  $stmt->bind_param("i", $service_id);
                  $stmt->execute();
                  $result = $stmt->get_result();
                  $stmt->close();


                    

                    if(mysqli_num_rows($result) > 0)
                    {
                        $service_row = mysqli_fetch_array($result);
                        ?>


                    
                  
                <form action="code.php" method="POST" enctype="multipart/form-data" id="post-form">

                        <input type="hidden" name="service_id" value="<?= $service_row['id'] ?>">
                          
                            <div class="row">
                                
                                 
                                 <!--   <input type="hidden" name="slug" value="<?= $service_row['slug']; ?>" required class="form-control">-->
                                 
                                <div class="col-md-6 md-3">
                                  <label for="">Name</label>
                                    <input type="text" name="name" value="<?= $service_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="<?= $service_row['name_bn']; ?>" required class="form-control">
                                </div>
                                
                                <div class="col-md-12 md-3">
                                  <label for="">Description</label>
                                    <textarea id="summernote1" name="description" required class="form-control" rows="4"><?= $service_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"><?= $service_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="<?= $service_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"><?= $service_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"><?= $service_row['meta_keyword'] ?></textarea>
                                </div>
                                 
                                <div class="col-md-6 md-3">
                                  <label for="">Featured Image</label>
                                   <input type="hidden" name="old_image" value="<?= $service_row['image'] ?>">   
                                    <input type="file" name="image" class="form-control">
                                </div>

                                <div class="col-md-6 md-3">
                                  <label for="">Service Icon</label>
                                   <input type="hidden" name="old_image2" value="<?= $service_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" <?= $service_row['status'] == '1' ? 'checked':''?> width="70px" height="70px" />
                                </div>
                                <div class="col-md-6 md-3">
                                       <button type="submit" class="btn btn-primary" name="service_update">Update Service</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');

?>