<?php session_start();
if($_SESSION){
?>

<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;
}
html,body{

background-size: cover;
background-repeat: no-repeat;


font-family: 'Numans', sans-serif;
}


#looo{
text-align: right;
color: #FDFEFE      ;

font-family:Monotype Corsiva;
font-size: 35px;"
 }
#navbar {
 overflow: visible;
  background-color:white;
  padding: 10px 7px;
  transition: 0.2s;
  position: fixed;
  width: 100%;
  top: 0px;
  font-family:Monotype Corsiva;
background-color:#2980B9  ;
color:   brown ;
  z-index: 91;
   flex-direction: row;
}

#navbar a {
  float: left;
  color:  black;

  text-align: center;
  padding: 15px;
  text-decoration: none;
  font-size: 25px; 
  font-family:Monotype Corsiva;
  line-height: 10px;
  padding-right: .5rem !important;
      padding-left: .5rem !important;

}

#navbar #logo {
  font-size: 25px;
 
  transition: 0.4s;
  font-family:Monotype Corsiva;
}

#navbar #logoo {
  font-size: 25px;

  transition: 0.4s;
}

#navbar #loga {
  font-size: 25px;

  transition: 0.4s;
}
#navbar #log{
  font-size: 25px;

  transition: 0.4s;
}
#navbar #lo{
  font-size: 25px;

  transition: 0.4s;
}
#navbar #lgg{
  font-size: 25px;

  transition: 0.4s;

}
#navbar #loo{
  font-size: 25px;

  transition: 0.4s;
  float: right;
}
#navbar #lg{
  font-size: 25px;

  transition: 0.4s;
  float: right;
}
     .navbar-nav {
      flex-direction: row;
    }
    
    .nav-link {
      float: left;
  color:  white;
  text-align: center;
  padding: 10px;
  text-decoration: none;
  font-size: 10px; 
  font-family:Monotype Corsiva;
  line-height: 10px;
  padding-right: .5rem !important;
      padding-left: .5rem !important;
    }
    
    /* Fixes dropdown menus placed on the right side */
    .ml-auto .dropdown-menu {
        padding-right: .5rem !important;
      padding-left: .5rem !important;
    }
#navbar a:hover {
  
  color:  #000080;
}

#navbar a.active {
  background-color: gold;
  color: gold;
    line-height: 10px;


}




@media screen and (max-width: 580px) {
  #navbar {
    padding: 20px 10px !important;
  }
  #navbar a {
    float: none;
    display: block;
    text-align: left;
  }
  #navbar-right {
    float: none;
  }

}

</style>
    </head>
  <body  style="background-color: #5499C7    ;">
      <nav class="navbar navbar-expand-lg navbar-dark " id="navbar" >
 <h3  class="text-red" style="text-align:right;color: #FDFEFE;font-family:Monotype Corsiva;
font-size: 20px;"><b>Event management System </b></h3>
<br>
  <ul class="navbar-nav mr-auto">
 <li class="nav-item">
      <a class="nav-link" id="logoo" style="font-family:Rockwell;font-size: 20px;color: black; " href="wedding_plarners.php"><i>My_details</i></a>
    </li>
    
     <li class="nav-item">
    <a  style="font-family:Rockwell;font-size: 20px;color: black; " href="display1.php">Booking_History</a></li>
    <li class="nav-item">
      <a class="nav-link" id="logoo" style="font-family:Rockwell;font-size: 20px;color: black; " href="feedbackcreate.php"><i>Feedback</i></a>
    </li>
    <li class="nav-item dropdown">
     
      <a class="nav-link dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="navbarDropdown" style="font-family:Rockwell;font-size: 20px;color: black; " href=""><i>view_Venues</i></a>
      <div class="dropdown-menu" aria-labelledby="navbarDropdown">
        <a class="dropdown-item" style="font-family:Rockwell;font-size: 20px;color: black;" href="Customer_all_view_venue.php"><i>View_Hall</i></a>
        <a class="dropdown-item" style="font-family:Rockwell;font-size: 20px;color: black;" href="Customer_all_view_eqiment1.php">View_Event_Eqi1</a>
        <a class="dropdown-item" style="font-family:Rockwell;font-size: 20px;color: black;" href="Customer_all_view_eqiment2.php">View_Event_Eqi2</a>
      </div>

    </li>

    
             <li class="nav-item"><br><br></li>
             
  </ul>
  <ul class="navbar-nav ml-auto">
    <li class="nav-item">
     <a id="lg" style="font-family:Rockwell;font-size: 20px;color: black; " href="http://localhost/event_managment_system/event2.php"><i class="fa fa-sign-in" style="font-size:24px"></i><i> Logout</i></a>
    </li>
    
  </ul>
</nav><br><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_birthday_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>
      
      
      </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>
          
          </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_birthday_event WHERE id='".$id."'";
 $data=mysqli_query($conn,$query);

 


?>
<?php
  }
  else{
    echo "<script>
   alert('You have to  login first...!');
   window.location.href='event2.php';
   </script>";
  }
  
?>