
<html>
<head>
  <title> view venue </title>
   <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" />
  <link rel="stylesheet" href="bootstrap-checkbox-radio-list-group-item.min.css">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

  <link rel="stylesheet" href="bootstrap.min.css">

<link rel="stylesheet" href="font-awesome.min.css">
<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: 12px;
  padding: 12px 20px 12px 40px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
}
</style>
</head>

<body >
 <?php include 'adminheader.php';?><br><br>
 <div class="container">
 <h3 class="text-red" style="text-align: center;color:black;font-family:Monotype Corsiva;font-size: 40px;"><b> View Venues </b></h3>
                                                                                        
  <div class="table-responsive">   
  <input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search  Name...." title="Type in a name">
       <?php
  error_reporting(0);
     $conn = new mysqli("localhost","root","","event");
     $query="SELECT * FROM add_music_event";
     $data=mysqli_query($conn,$query);
     $total =mysqli_num_rows($data);
     
     
     
     if ($total != 0) {
      ?>
   <table class="table table-striped table-hover" id="myTable">
    <thead>
      <tr>
      <th>Halls_Name</th>
       <th>ID</th>
        
           <th>Place</th>
            <th>Events_Type</th>
        <th>address</th>
        <th>phone</th>
        
       
        
     
        <th>Rs.</th>
        <th colspan="2">operations</th>
      
      </tr>
    </thead>



      <tbody>
      <tr>
      
      <?php
      $a =5;
      while ( $result =mysqli_fetch_assoc($data)) {
        echo "<tbody>
      <tr>    
      <td>".$result['name']."</td>
      <td>".$result['id']."</td>
          
          <td><img style='height:100px;width:100px' src='".$result['image']."'></td>
          <td>".$result['event']."</td>
          <td>".$result['address']."</td>
          <td>".$result['phone']."</td>
          
          
          
          <td>".$result['rs']."</td>
          <td><a href='music_events_update.php? i=$result[id]&n=$result[name] & a=$result[address] & p=$result[phone] & e=$result[event] &  im=$result[image] & r=$result[rs]'class='btn btn-warning'>Update<a></td>
          <td><a href='music_events_display.php? i=$result[id]'><font color='blue'class='btn btn-danger'>Delete</a></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
 $conn = new mysqli("localhost","root","","event");
 $id= $_GET['i'];
 $query ="DELETE FROM add_music_event WHERE id='".$id."'";
 $data=mysqli_query($conn,$query);

 


?>