<?php session_start();
if($_SESSION){
?>
<html>
<head>
	<title> view venue </title>
<style type="text/css">
	td{
		color: black;
	}
	th{
		color: black;
		font-family:Monotype Corsiva;
		font-size: 30px;
	}
	#myInput {
  background-image: url('/css/searchicon.png');
  background-position: 10px 10px;
  background-repeat: no-repeat;
  width: 100%;
  font-size: 10px;
  padding: 12px 20px 12px 40px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
}
</style>
</head>

<body >
 <?php include 'customer.php';?><br><br>
 <div class="container">
 <h3 class="text-red" style="text-align: center;color:black;font-family:Monotype Corsiva;font-size: 30px;"><b> View Venus </b></h3>
                                                                                        
  <div class="table-responsive">   
  <input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for Hall_name...." title="Type in a Hall_name">
       <?php
	error_reporting(0);
     $conn = new mysqli("localhost","root","","event");
     $query="SELECT * FROM add_event ";
      //$query1="SELECT * FROM add_birthday_event";
     $data=mysqli_query($conn,$query);
     //$data1=mysqli_query($conn,$query1);
     $total =mysqli_num_rows($data);
     
     
     
     if ($total != 0) {
     	?>
  <table class="table" id="myTable" style="height: w" width="">
    <thead>
      <tr>
   
      
        <th>Halls Name</th>
         <th>Place</th>
        <th>address</th>
         <th>Event_Type</th>
        <th>phone</th>
        
       
        
       
        <th>Rs.</th>
      
      
      </tr>
    </thead>



      <tbody>
      <tr>
     	
     	<?php
     	$a =5;
     	while ( $result =mysqli_fetch_assoc($data)) {
     		echo "<tbody>
      <tr>	
     			<td>".$result['name']."</td>
          <td><img style='height:100px;width:100px' src='".$result['image']."'></td>
     			<td>".$result['address']."</td>
          <td>".$result['event']."</td>
     			<td>".$result['phone']."</td>
     			
     			
     			
     			<td>".$result['rs']."</td>
     			
     		  </tr>
       

    </tbody>";
     	}
     	
     } else {
     	echo "no records";
     }
     
?>

</table>





</div>
</div>
<script type="text/javascript">
	function myFunction() {
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }       
  }
}
</script></body>
</html>
<?php
  }
  else{
    echo "<script>
   alert('You have to  login first...!');
   window.location.href='event2.php';
   </script>";
  }
  
?>