<div class="clearfix"></div>

  <div class="content-wrapper">

    <div class="container-fluid">

     <div class="row pt-2 pb-2">

        <div class="col-sm-9">

		    <h4 class="page-title">Manage Enquiries</h4>

	   </div>

     </div>

     <div class="row">

			

            <div class="col-lg-12">

               <div class="card">

                    <div class="card-header">Listed Enquiries</div>

                    <div class="card-body">

                    <table class="table table-condensed table-bordered" id="default-datatable">
                        <thead>
                                                            <tr>
                                                                <th>S.No.</th><th>Date</th>
                                                                <th>Phone</th>
                                                                <th>Name & Email</th>
                                                                <th>Message</th>
                                                                <th>Action</th>
                                                            </tr>
                                                        </thead>
                        <tbody>
                                                    <?php  $i=1;foreach($cons as $user){?>
                                                    <tr>
                                                        <td><?php echo $i;?></td>
                                                        <td><?php echo date("d M Y",strtotime($user->enq_date));?></td>
                                                        <td><?php echo $user->phone;?></td>
                                  <td><i class="fa fa-user"></i> <?php echo $user->name;?><br/><i class="fa fa-envelope"></i> <?php echo $user->email;?></td>
                                   <td><?php echo $user->msg;?></td>
                                   <td> <a class="btn btn-sm btn-danger deletecon" href="<?php echo $user->id;?>"><i class="fa fa-trash-o"></i></a></td>
                                                    </tr>
                                                    <?php $i++;}?>
                                                    </tbody>
                    </table>

                    </div>

                    

               </div>                  

            </div>

            

        </div><!--End Row-->

	  

	  <!--End Row-->



    </div>

    <!-- End container-fluid-->

    

    </div><!--End content-wrapper-->

   <!--Start Back To Top Button-->

    <a href="javaScript:void();" class="back-to-top"><i class="fa fa-angle-double-up"></i> </a>

    <!--End Back To Top Button-->

	

	<!--Start footer-->

	<footer class="footer">

      <div class="container">

        <div class="text-center">

          Copyright © 2022

        </div>

      </div>

    </footer>

	<!--End footer-->

   

  </div><!--End wrapper-->





  <!-- Bootstrap core JavaScript-->

	

	<!-- simplebar js -->

     <script src="<?php echo base_url();?>adminassets/plugins/bootstrap-datatable/js/jquery.dataTables.min.js"></script>

  <script src="<?php echo base_url();?>adminassets/plugins/bootstrap-datatable/js/dataTables.bootstrap4.min.js"></script>



    <script>

	$(document).ready(function(){ 

		$('#default-datatable').DataTable();

		$(".in_trend").click(function(){

		var id=$(this).val();

		var v="";

		if ($(this).is(':checked')) {

			var v=$(this).val();

		}

		//alert(v);

		$.ajax({

			 type: "POST",
	
			 url: '<?php echo base_url();?>admin/in_trendcat',
	
			 data: {v:v,id:id},
	
			 success: function(response){
	
				// alert(response);
	
			 }

		 });

	});

		$(".enable").click(function(e){e.preventDefault();

			var st=$(this).text();

			var id=$(this).attr("href");

			if(st=="Enable"){

			$(this).text("Disable");

			}else{

			$(this).text("Enable");	

			}

			$.ajax({

							 type: "POST",

							 url: '<?php echo base_url();?>admin/catenable',

							 data: {id:id,st:st},

							 success: function(response){

								 //alert(response);

							 }

							 });

		});

		$(".deletecon").click(function(e){e.preventDefault();

		if (!confirm("Sure you want to delete?")){

				  return false;

				}

			var id=$(this).attr("href");$(this).closest("tr").remove();

			$.ajax({

							 type: "POST",

							 url: '<?php echo base_url();?>admin/deletecon',

							 data: {id:id},

							 success: function(response){

								 //alert(response);

							 }

							 });

		});

	});

</script>

	

  <script src="<?php echo base_url();?>adminassets/js/sidebar-menu.js"></script>

  <!-- Custom scripts -->

  <script src="<?php echo base_url();?>adminassets/js/app-script.js"></script>

  

  <!-- Vector map JavaScript -->

  <!-- Index js -->

  <script src="<?php echo base_url();?>adminassets/js/index.js"></script>

  

 

</body>

</html>

