<?php session_start();
if($_SESSION){
?>
<?php
error_reporting(0);
 $_GET['id'];



$_GET['e2'];

$_GET['r'];

?>
<!DOCTYPE html>
<html>
<head>
	<title>addvenue</title>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
 
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/js/bootstrap-multiselect.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css" />
  <!--Custom styles-->
  <link rel="stylesheet" type="text/css" href="styles.css">
  <style type="text/css">
    /* Made with love by Mutiullah Samim*/



html,body{

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

 height:2000px;
font-family: 'Numans', sans-serif;
}

.imagePreview {
    width: 100%;
    height: 180px;
    background-position: center center;
  background:url(http://cliquecities.com/assets/no-image-e3699ae23f866f6cbdf8ba2443ee5c4e.jpg);
  background-color:#fff;
    background-size: cover;
  background-repeat:no-repeat;
    display: inline-block;
  box-shadow:0px -3px 6px 2px rgba(0,0,0,0.2);
}
.btn-primary
{
  display:block;
  border-radius:0px;
  box-shadow:0px 4px 6px 2px rgba(0,0,0,0.2);
  margin-top:5px;
}
.imgUp
{
  margin-bottom:15px;
}
.del
{
  position:absolute;
  top:0px;
  right:15px;
  width:30px;
  height:20px;
  text-align:center;
  line-height:30px;
  background-color:rgba(255,255,255,0.6);
  cursor:pointer;
}
.imgAdd
{
  width:25px;
  height:20px;
  border-radius:50%;
  background-color:#4bd7ef;
  color:#fff;
  box-shadow:0px 0px 2px 1px rgba(0,0,0,0.2);
  text-align:center;
  line-height:10px;
  margin-top:0px;
  cursor:pointer;
  font-size:15px;
}
.uploadFile{
  width: 5px;
  height: 5px;
}

</style>
</head>
<body >
  <?php include 'adminheader.php';?><br><br><br><br><br>






<center>
<div class="container " >
   
  <h3 id="looo" class="text-red" style="text-align: center;color:red;font-family:Monotype Corsiva;font-size: 50px;"><b>Birthday_Equipment2  </b></h3>
 
  
  <form action="" method="get"enctype="multipart/form-data">
 	   <div class=" form-group row col-lg-8">
             <label for="email"  style="font-size: 20px; color: white "><b> ID: </b> </label>
          <input type="text" class="form-control" name="id" value="<?php echo $_GET['id']; ?>" required>
        
          </div>
    
          
          
          <div class="form-group row col-lg-8"">
    <label for="email"  style="font-size: 20px; color: white "><b>Select Equipment :</b></label>
    
      <input type="text" class="form-control" name="eqi2" value="<?php echo $_GET['e2']; ?>" required>
      
   
  

    </div>
	 <div class="form-group row col-lg-8"">
    <label for="email"  style="font-size: 20px; color: white "><b>Rs :</b></label>
    
      <input type="text" class="form-control" name="rs" value="<?php echo $_GET['r']; ?>" required>
      
   
  

    </div>
    
        
       
<!--
  <div class="row row col-lg-12"> <label for="email"  style="font-size: 20px; color: white "><b>image:</b></label>
  <div class="col-sm-2 imgUp">
    <div class="imagePreview"></div><br>
<label class="btn btn-primary">
                Upload<input type="file" class="uploadFile " name="upload" value="Upload Photo" style="width: 7px;height: 5px;overflow: hidden; " value="<?php //echo $_GET['im']; ?>" >
                                                      
                </label>
  </div> 
  <i class="fa fa-plus imgAdd"></i>
 </div>-->



          <center>
    <button type="submit" name="Update" value="Update" class="btn btn-primary" style="text-align: center; font-size: 20px">Update</button></center>
  </form>
</div>
</center>
<?php
if ($_GET['Update']) {
	$id = $_GET['id'];
	
	$eqi2 = $_GET['eqi2'];
$rs = $_GET['rs'];



	//$filename= $_FILES["upload"]["name"];
//$tmpname= $_FILES["upload"]["tmp_name"];
//$folder ="event_img/".$filename;

//hash_update_file($tmpname, $folder);
	

	 
   $conn = new mysqli("localhost","root","","event");
	$query ="Update birthday_event_eqi2 set eqi2='".$eqi2."',rs='".$rs."'where  id='".$id."'";

	$data=mysqli_query($conn,$query);
	if ($data) {
    //echo "<script>window.top.location='http://localhost/event_managment_system/display2.php';</script>";
echo "<script>window.top.location='birthday_eqi2_display.php';</script>";
  } else {
    echo "Record Not Updated";
  }
  
}else{
  echo "<font color='blue'>click on Update button to save the changes";
}
?>




<script>
$(document).ready(function(){
        var hallrent=0;
        $("#image").change(function() {
            var src = $(this).val();
            
            var price = parseInt($('option:selected', this).data('price'));
            hallrent= price;
            $("#imagePreview").html(src ? "<img src='" + src + "'><br> <h4>Rs."+price+"</h4>" : "");
        });
        var hallrent;
        var main_price = 0;
        $('#framework').multiselect({

            onChange: function(element, checked) {
     
                
                if(checked == true){
                 
                  main_price += parseInt (element.attr("data-price"));
               
                }
                else{
                  main_price -= parseInt(element.attr("data-price"));

                }
                var total = main_price+ hallrent;
             
                $("#main_price").val("Rs."+hallrent+"+ Rs."+main_price+"= Rs."+total);


            }
        });
 $('#framework2').multiselect({
  nonSelectedText: 'Select Framework',

    
  buttonWidth:'300px'
 });
 
});  
</script>
</body>
</html>

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