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


<!DOCTYPE html>
<html>
<head>
  <title>Contact</title>
   <!--Made with love by Mutiullah Samim -->
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <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>
  
    

  <!--Custom styles-->
  <link rel="stylesheet" type="text/css" href="styles.css">
 
    /* Made with love by Mutiullah Samim*/


</head>
<body  >


      <?php include 'heder.php';?>
      <br><br><br><br><br><br>
<center>
    <div class=" container"  >

        <div class="col-lg-8 m-auto d-block" style="font-family:Rockwell;font-size: 20px; 
        background-color: #4682B4;">
        
    <h1 class="text-red" style="text-align: center;color:#8B0000;font-family:Monotype Corsiva;font-size: 60px;"><b>Contact_Us  </b></h1>

       
            <form method="POST" action="contactus1.php" >
                <div class="form-group row col-lg-10">
                    <label for="user" style="font-size: 20px; color: black "> Name: </label>
                    <input type="text"  minlength="3" maxlength="10" placeholder="Name" name="name" id="name" class="form-control" autocomplete="off" required>
                    <h5 id="usercheck" ></h5>
                </div>
                <div class="form-group  row col-lg-10">
        <label style="font-size: 20px; color: black ">Email Address</label>
        <input type="email"  id="email" name="email" class="form-control" placeholder="Email" required>
        <h5 id="emailcheck"></h5>
        
    </div> <!-- form-group end.// -->
    <div class="form-group row col-lg-10">
     
        <label style="font-size: 20px; color: black ">Phone Number:</label>
        <input type="text" name="phone" id="phone" class="form-control" autocomplete="off"  placeholder="Phone Number" onkeypress="if(this.value.length==10) return false;" required>
        <h5 id="phonecheck"></h5>
    </div> <!-- form-group end.// -->
    <div class="form-group col-lg-10">
          <label style="font-size: 20px; color: black ">City</label>
          <select  id="city" name="city" class="form-control" required>
            <option value="" > Choose...</option>
              <option >Mumbai</option>
              <option>Kolkata</option>
              <option >Delhi</option>
              <option>Pune</option>
              
              <h5 id="citycheck"></h5>
          </select>
        </div> <!-- form-group end.// -->
         <div class="form-group row col-lg-10">
                    <label for="user" style="font-size: 20px; color: black "> Event: </label>
                    <input type="text"  minlength="3" maxlength="10" placeholder="Event" name="event" id="event" class="form-control" autocomplete="off" required>
                    <h5 id="eventcheck" ></h5>
                </div>


               
                 
                <div class="form-group">
             <input type="submit" name="Send message" id="submitbtn" class="btn btn-success btn-send" value="Send message" style="text-align: center; font-size: 25px">
          </div>
            
                
                
            </form><br>
        </div>
    </div></center>
    <br>
      <div class="jumbotron" style="margin-top: 0px;background-color:#2980B9;  margin-bottom: 0px;">
    <div class="container" style="margin-top: 30px;">
      <p id="abt-ftr" style="color: white">@ Copyright 2019-2020 www.bi_lal.com. All rights reseerved. Developed by <span style="color:black;">Saurabh Salvi</span> &nbsp;<span style="color: white;"> Privacy policy &#10072; Disclaimer</span></p>
    </div>
  </div>
  </div>
  
<script type="text/javascript">
    $(document).ready(function(){
            $('usercheck').hide();
            $('passcheck').hide();
            $('emailcheck').hide();
            $('phonecheck').hide();

            var user_err =true;
            var email_err =true;
            var pass_err =true;
            var phone_err =true;
            

            $('#name').keyup(function(){
                name_check();
            });
            function name_check(){
                var user_val =$('#name').val();

                if (user_val.length == '') {
                    $('#usercheck').show();
                    $('#usercheck').html("**Please Fill the name");
                    $('#usercheck').focus();
                    $('#usercheck').css("color","DarkRed");
                    user_err =false;
                    return false;
                } else {
                    $('#usercheck').hide();
                }
                  if ((user_val.length <3) || (user_val.length >10)) {
                    $('#usercheck').show();
                    $('#usercheck').html("**name length must be between 3 and 10");
                    $('#usercheck').focus();
                    $('#usercheck').css("color","DarkRed");
                    user_err =false;
                    return false;
                } else {
                    $('#usercheck').hide();
                }
            }
             $('#email').keyup(function(){
                if(email_check()){
                    $("#email").css("border","2px solid DarkGreen");
                    $("#emailcheck").html("<p class=text-light>Validated</p>");

                }else{
                    $("#email").css("border","2px solid DarkRed");
                    $("#emailcheck").html("<p class=text-DarkRed>Un-Validated</p>");
                }
            });



            function email_check(){
                var email_val =$('#email').val();
                var reg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
                if (reg.test(email_val)) {
                    
                    email_err=true;
                    return true;
                }

                 else {
                     
                  return false;
                   
                }
                  
            }
           
            
             $('#phone').keyup(function(){
                phone_check();
            });
            function phone_check(){
                var phone_val =$('#phone').val();
                var rag=/^0[0-9]{9}$/;
                if (phone_val.length == '') {
                    $('#phonecheck').show();
                    $('#phonecheck').html("<p class=text-DarkRed >**Please Fill the phone</p>");
                    $('#phonecheck').focus();
                    $('#phone').css("border","2px solid DarkRed ");
                    user_err =false;
                    return false;
                } else {
                    $('#phonecheck').hide();
                }
                   if ((phone_val.length == '10'))
                {
                
                    
                                   $('#phonecheck').focus();
$('#phonecheck').show();
                    $("#phone").css("border","2px solid DarkGreen ");
                    $("#phonecheck").html("<p class=text-light>Validated</p>");
                    return true;
                } else {
      $('#phonecheck').show();
                    $('#phonecheck').html("<p class=text-DarkRed >**phone only 10 numbers</p>");
                    $('#phonecheck').focus();
                      $("#phone").css("border","2px solid DarkRed ");
                    return false;
                    
                }
            }

            
            $('#city').keyup(function(){
                if(city_check()){
                    $("#city").css("border","2px solid DarkGreen");
                    $("#citycheck").html("<p class=text-success>Created </p>");
                }else{
                    $("#city").css("border","2px solid red");
                    $("#citycheck").html("<p class=text-danger>Please Create inputState</p>");
                }
            });
            

            function city_check(){
                var city_val =$('#city').val();

                if 
                ((city_val.length =='7')) {
                   
                    city_err =true;
                    return true;
                } else {
                     return false;
                }
           }
           $('#event').keyup(function(){
                event_check();
            });
            function event_check(){
                var event_val =$('#event').val();

                if (event_val.length == '') {
                    $('#eventcheck').show();
                    $('#eventcheck').html("**Please Fill the event");
                    $('#eventcheck').focus();
                    $('#eventcheck').css("color","DarkRed");
                    user_err =false;
                    return false;
                } else {
                    $('#eventcheck').hide();
                }
                  if ((event_val.length <3) || (event_val.length >10)) {
                    $('#eventcheck').show();
                    $('#eventcheck').html("**event length must be between 3 and 10");
                    $('#eventcheck').focus();
                    $('#eventcheck').css("color","DarkRed");
                    user_err =false;
                    return false;
                } else {
                    $('#eventcheck').hide();
                }
            }
             
          
                
            
            $('#submitbtn').click(function(){
                var user_err =true;
                var pass_err =true;
               
               

                name_check();
                password_check();
            
              

                if ((user_err == true) && (pass_err == true)  ) {
                    return true;
                } else {
                    return false;
                }
            });

            

    });
</script>


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