<?php require_once('../auth/auth.php'); ?>
   <?php
     $eco_tamplate_query= mysqli_query($conn,"SELECT * FROM  eco_tamplate WHERE coid='$coid' AND bid ='$bid' AND brid ='$brid' ") or die (mysqli_error($conn)); 
    $rowcount = mysqli_num_rows($eco_tamplate_query);
    ?>  
<section class="content">
 <div class="container-fluid">
  <div class="row">
    <div class="col-md-1"></div>
    <div class="col-md-10">
      <div class="card card-primary card-outline direct-chat direct-chat-primary shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
        <div class="card-header" style="padding: 3px 8px;">
          <h3 class="card-title"> Eco Contact List </h3>
          <div class="card-tools">
            <button type="button" class="btn btn-tool" data-card-widget="remove" data-dismiss="modal">
              <i class="fas fa-times"></i>
            </button>
          </div>
        </div>      
            <div class="card-body p-1 table-responsive cscroll" id="b_statment" style="max-height: 450px;">
              <table id="sttable<?php echo $gcoid;?>" class="ttable" cellpadding="0" cellspacing="0">
                 <thead>
                    <tr class="sticky-top" style="background: hsl(0deg 0% 50% / 42%);">
                       <th class="text-center" style="width:3%;"> <?php echo language(15);?></th>
                       <th class="text-center" style="width:10%;"><?php echo 'Name';?></th>
                       <th class="text-center" style="width:15%;"><?php echo 'Email';?></th>
                       <th class="text-center" style="width:12%;"><?php echo 'Number';?></th>
                       <th class="text-center" style="width:15%;"><?php echo 'Subject';?></th>
                       <th class="text-center" style="width:35%;"><?php echo 'Message';?></th>
                       <th class="text-center" style="width:5%;"><?php echo 'ip address';?></th>
                       <th class="text-center" style="width:5%;"><?php echo 'User';?></th>


                    </tr>
                 </thead>
                 <tbody>

                                 <?php
         $result= mysqli_query($conn,"SELECT `cid`, `coid`, `bid`, `brid`, `y_name`, `y_email`,`y_number`, `y_subject`, `y_message`, `ip_add`, `userid`, `active` FROM contact_us WHERE coid='$coid' AND bid ='$bid' AND brid ='$brid'  ") or die (mysqli_error($conn));
         $i=0;
         while ($row= mysqli_fetch_array ($result) ){
         $cid = $row['cid'];
         

         ?>
                    <tr>
      
                       <td class="text-center"  style="border-top:0;"><dt> <?php echo ++$i;?> </dt></td>
                       <td class="text-center" style="border-top:0;"><dt><?php echo $row['y_name'];?></dt></td>
                       <td class="text-center" style="border-top:0;"><dt><?php echo $row['y_email'];?></dt></td>
                       <td class="text-center" style="border-top:0;"><dt><?php echo $row['y_number'];?></dt></td>
                       <td class="text-center" style="border-top:0;"><dt><?php echo $row['y_subject'];?></dt></td>
                       <td class="text-center" style="border-top:0;"><dt><?php echo $row['y_message'];?></dt></td>
                       <td class="text-center" style="border-top:0;"><dt><?php echo $row['ip_add'];?></dt></td>
                       <td class="text-center" style="border-top:0;"><dt><?php echo $row['userid'];?></dt></td>
                    </tr>

                 <?php } ?>
                 </tbody>
       
              </table>
            </div>
           </div>
        </div>
      <div class="col-md-1"></div>
   </div>
  </div>
</section>






<script type="text/javascript">
  $(document).ready(function() {
    $(".onlive").on('input change', function(){
      eco_id = $(this).attr("eco_id");
      col_name = $(this).attr("col_name");
      col_value = $(this).val();
      $.ajax({
        type: "POST",
        url: "../eco/eco_tamplate_db.php",
        data: ({eco_id: eco_id,col_name: col_name,col_value:col_value}),
        cache:false,
      });
    });
  });
</script>



