<?php 
   session_start();
    include '../assets/constant/config.php';
    
    try {
           $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
           $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
   
           }
           catch(PDOException $e)
           {
           echo "Connection failed: " . $e->getMessage();
           }
   ?>
<?php include('include/sidebar.php');?>

<!--  Author Name: Mayuri K. 
 for any PHP, Codeignitor or Laravel website or software development contact me at mayuri.infospace@gmail.com  -->
<!-- Top Bar End -->
<?php include('include/header.php');?>
<div class="page-content-wrapper ">
   <div class="container-fluid">
      <div class="row">
         <div class="col-sm-12">
            <div class="page-title-box">
               <h4 class="page-title">Show Follow Up</h4>
            </div>
         </div>
         <div class="clearfix"></div>
      </div>
      <!-- end page title end breadcrumb -->
     
      <div class="row">
         <div class="col-lg-12">
            <div class="card">
               <div class="card-body">
                  <div class="table-responsive">
                     <table id="datatable-buttons"  class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;" enctype="multipart/form-data">
                        <thead>
                        </thead>
                        <tbody>
<?php



$stmt=$conn->prepare("SELECT * FROM `follow_up` WHERE id = ? AND delete_status='0'");

//print_r($stmt);
$stmt->execute([$_GET['id']]);
$record=$stmt->fetch();
$i=1;
 ?>
                           <tr>
                            <th>Id</th>
                   <td><?php echo $record['id'];?> </td>
                    
                </tr>
                <tr>
                 <th>Gender</th>
                 <td><?php echo $record['user'];?> </td>
                </tr>
                             
                <tr>
                    <th>Email</th>        
                    <td><?php echo $record['member'];?> </td>
                </tr>
                <tr>
                    <th> Phone</th>
                    <td><?php echo $record['category'];?> </td>
                </tr>
                <tr>
                    <th>Date</th>
                    <td><?php echo $record['status'];?>
                     </td>
                </tr>
                <tr>
                    <th>Updated Date</th>
                    <td><?php echo $record['created_at'];?>
                     </td>
                </tr>
                
                  </tbody>
                         
                     </table>
                  </div>
                  <!--end /tableresponsive-->
               </div>
               <!--end card-body-->
            </div>
            <!--end card-->
         </div>
         <!--end col-->
      </div>
      <!--end row-->


 <div class="row">
         <div class="col-lg-12">
            <div class="card">
               <div class="card-body">
                  <div class="table-responsive">
                     <table id="datatable-buttons"  class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;" enctype="multipart/form-data">
                        <thead>
                                <!-- <th>Note</th>
                                <th>Category Note</th> -->
                        </thead>
                        <tbody>
 <?php
                            // Prepare and execute the SQL query
                            $stmt = $conn->prepare("SELECT follow_up.description AS note, followup_category.note AS category_note FROM follow_up INNER JOIN followup_category ON follow_up.id = followup_category.id ");
                            $stmt->execute();
                            $records = $stmt->fetchAll(PDO::FETCH_ASSOC);

                            // Iterate through the fetched records and display them in the table
                            foreach ($records as $row) {
                            ?>
                           <tr>
                            <th>Note</th>
                   <td><?php echo $row['note'];?> </td>
                    
                </tr>
                <tr>
                 <th>Category Note</th>
                 <td><?php echo $row['category_note'];?> </td>
                </tr>
                     <?php } ?>        
                  </tbody>
                         
               </table>
                  </div>
                  <!--end /tableresponsive-->
               </div>
               <!--end card-body-->
            </div>
            <!--end card-->
         </div>
         <!--end col-->
      </div>
      <!--end row-->








   </div>
   <!-- Page content Wrapper -->
</div>
<!-- content -->
<?php include('include/footer.php');?>

<script>
   function addNews(){
     jQuery.validator.addMethod("alphanumeric", function (value, element) {
    return this.optional(element) || /^(?=.*[a-zA-Z])[a-zA-Z0-9\s!@#$%^&*()_-]+$/.test(value);
   }, "Please enter alphabet characters only");
     
      jQuery.validator.addMethod("lettersonly", function(value, element) {
   // Check if the value is empty
   if (value.trim() === "") {
    return false;
   }
   return /^[a-zA-Z\s]*$/.test(value);
   }, "Please enter alphabet characters only");
   $('#add_news').validate({
    rules: {
      import_file: {
        required: true,
        numbersOnly: true
      },
       
      
      },
    
   });
   };
</script>







































































































