<?php include("includes/header.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title>Signup | <?php echo $sitename; ?></title>
  	<link rel="stylesheet" href="bootstrap/css/bootstrap.css">
  	<meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <script src="bootstrap/js/jquery.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <!----------------------------------------------------------------------->

    <!-- Font Awesome -->
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
    <style>
    body{
      background-image: url(/signup-bg.jpg);
      background-attachment: fixed;
    }
                         .panel{
                          border-radius: 0px;
                          box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
                         }
                         .strike {
                             display: block;
                             text-align: center;
                             overflow: hidden;
                             white-space: nowrap; 
                         }

                         .strike > span {
                             position: relative;
                             display: inline-block;
                         }

                         .strike > span:before,
                         .strike > span:after {
                             content: "";
                             position: absolute;
                             top: 50%;
                             width: 9999px;
                             height: 1.3px;
                             background: rgba(0, 0, 0, 0.35);
                         }

                         .strike > span:before {
                             right: 100%;
                             margin-right: 15px;
                         }

                         .strike > span:after {
                             left: 100%;
                             margin-left: 15px;
                         }
                         .btn-danger{
                          background-color: #337ab7;;
                         }
                         .input-danger{
                           border:1px solid darkred;
                           color:darkred;
                         }
                         .input-danger::placeholder{
                           opacity: 0.6;
                           color:darkred;
                         }

       </style>
    </style>
</head>
<body>
  <?php //include("includes/navbar.php"); ?>
<div class="container-fluid" style="margin-top: 100px;">
<!-------------------------------------------------------------------------------->
<!-------------------------------------------------------------------------------->
  <div class="row">
    <div class="col-sm-3"></div>
    <div class="col-sm-6">
      <div><a href="../online-registration.php"><i class="glyphicon glyphicon-arrow-left"></i> BACK</a></div>
      <br>
      <div class="ddd" align="">
         <div class="alert alert-success">
           <img src="images/7346464.png" width="50xp">
           <br>
           <p>Fill in your personal details with the form below(name,email,phone,gender...)</p>
         </div>
      </div>
    </div>
    <div class="col-sm-3"></div>
  </div>
  <br><br>
  <div class="row">
    <div class="col-sm-3"></div>
    <div class="col-sm-6">

      <span id="output"></span>
      
    <input type="text" id="b_firstname" class="form-control input-md" style="border-radius: 0px;" placeholder="First Name*">
    <input type="text" id="b_middlename" class="form-control input-md" style="border-radius: 0px;" placeholder="Middle Name">
    <input type="text" id="b_lastname" class="form-control input-md" style="border-radius: 0px;" placeholder="Last Name*">
    <br>
    <input type="email" id="b_email" class="form-control input-md" style="border-radius: 0px;" placeholder="Email*">
    <input type="phone" id="b_phone" class="form-control input-md" style="border-radius: 0px;" placeholder="Phone Number*">
    <br>
    <select class="form-control input-md" style="border-radius: 0px;" id="b_gender">
      <option>Select Gender</option>
      <option>Male</option>
      <option>Female</option>
    </select>
    <br>
    <select type="text" id="b_currency" class="form-control input-md" style="border-radius: 0px;">
        <option>Select Currency</option>
        <option value="AED">UAE Dirham</option>
        <option value="EUR">Euro</option>
        <option value="GBP">Pound sterling</option>
        <option value="ZAR">South African Rands</option>
        <option value="CHF">Swiss franc</option>
        <option value="$">United state dollar</option>
        
    </select>
          
    </div>
    <div class="col-sm-3"></div>
  </div>
<!-------------------------------------------------------------------------------->
<!-------------------------------------------------------------------------------->


<br>



<!-------------------------------------------------------------------------------->
<!-------------------------------------------------------------------------------->
  <div class="row">
    <div class="col-sm-3"></div>
    <div class="col-sm-6">
      <div class="alert alert-success">
           <img src="images/2801677.png" width="50xp">
           <br>
           <p>Fill in your residential details with the form below(country,state,city,residential address,zip code...)</p>
         </div>
    </div>
    <div class="col-sm-3"></div>
  </div>
  <br><br>
  <div class="row">
    <div class="col-sm-3"></div>
    <div class="col-sm-6">
      
    <select class="form-control input-md" style="border-radius: 0px;" id="b_country">
      <option>Select Country</option>
      <option>United Arab Emirates (UAE)</option>
      <?php include("includes/all-countries.php"); ?>
    </select>
    <br>
    <input type="text" id="b_state" class="form-control input-md" style="border-radius: 0px;" placeholder="State*">
    <input type="text" id="b_city" class="form-control input-md" style="border-radius: 0px;" placeholder="City*">
    <br>
    <input type="text" id="b_zip_code" class="form-control input-md" style="border-radius: 0px;" placeholder="Zip Code*">
    <br>
        <textarea id="b_address" class="form-control" style="border-radius: 0px; resize: none;" rows="3" placeholder="Primary Residential Address"></textarea>
          
    </div>
    <div class="col-sm-3"></div>
  </div>
<!-------------------------------------------------------------------------------->
<!-------------------------------------------------------------------------------->


<br>



<!-------------------------------------------------------------------------------->
<!-------------------------------------------------------------------------------->
  <div class="row">
    <div class="col-sm-3"></div>
    <div class="col-sm-6">
      <div class="alert alert-success">
           <img src="images/508312.png" width="50xp">
           <br>
           <p>Fill in your secure password. Password should be up to 8 characters</p>
         </div>
    </div>
    <div class="col-sm-3"></div>
  </div>
  <br><br>
  <div class="row">
    <div class="col-sm-3"></div>
    <div class="col-sm-6">
      
    <input type="password" id="b_password" class="form-control input-md" style="border-radius: 0px;" placeholder="Password*">
    <input type="password" id="b_password2" class="form-control input-md" style="border-radius: 0px;" placeholder="Confirm Password*">
    <?php $b_account_type = $_GET["account_type"]; ?>
    <input type="hidden" id="b_account_type" value="<?php echo $b_account_type; ?>">
    <br>

    <button id="regbtn" class="btn btn-primary" style="border-radius: 0px; background-color:#337ab7; border-color: #337ab7;"><i id="hide-fa" class="fa  fa-spinner fa-spin"></i> REGISTER ACCOUNT</button>


    <!--------------------------------------------JQUERY FOR REGRISTRATION------------------------------------------------------------>
    <script>
      $(document).ready(function(){
        $("#hide-fa").hide();
          $("#regbtn").click(function(){
              var b_firstname = $("#b_firstname").val();
              var b_middlename = $("#b_middlename").val();
              var b_lastname = $("#b_lastname").val();
              var b_email = $("#b_email").val();
              var b_gender = $("#b_gender").val();
              var b_phone = $("#b_phone").val();
              var b_currency = $("#b_currency").val();

              var b_country = $("#b_country").val();
              var b_state = $("#b_state").val();
              var b_city = $("#b_city").val();
              var b_zip_code = $("#b_zip_code").val();
              var b_address = $("#b_address").val();
              var b_account_type = $("#b_account_type").val();

              var b_password = $("#b_password").val();
              var b_password2 = $("#b_password2").val();

              //VALIDATION OF FORMS

              if(b_firstname == ""){
                 $("#b_firstname").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_firstname").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_lastname == ""){
                 $("#b_lastname").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_lastname").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_email == ""){
                 $("#b_email").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_email").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_gender == "Select Gender"){
                 $("#b_gender").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_gender").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_phone == ""){
                 $("#b_phone").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_phone").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_country == "Select Country"){
                 $("#b_country").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_country").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_state == ""){
                 $("#b_state").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_state").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_city == ""){
                 $("#b_city").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_city").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_zip_code == ""){
                 $("#b_zip_code").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_zip_code").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_address == ""){
                 $("#b_address").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_address").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_password == ""){
                 $("#b_password").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_password").removeClass('form-control input-danger').addClass('form-control');
              }

              if(b_password2 == ""){
                 $("#b_password2").removeClass('form-control').addClass('form-control input-danger');
               }else{
                $("#b_password2").removeClass('form-control input-danger').addClass('form-control');
              }


              if(b_firstname != "" && b_lastname != "" && b_email != "" && b_gender != "" && b_phone != "" && b_country != "Select Country" && b_state != "" && b_city != "" && b_zip_code != "" && b_address != "" && b_password != "" && b_password2 != ""){
                $("#hide-fa").show();

                   $.ajax({
               url:"apply-now-ajax.php",
               method:"post", 
               data:{b_firstname:b_firstname,b_middlename:b_middlename,b_lastname:b_lastname,b_email:b_email,b_gender:b_gender,b_phone:b_phone,b_country:b_country,b_state:b_state,b_city:b_city,b_zip_code:b_zip_code,b_address:b_address,b_password:b_password,b_password2:b_password2,b_account_type:b_account_type,b_currency:b_currency},
               dataType: "text",
               success: function(data) {
                 $("#output").html(data);
               }
               });

              }else{

              }


          });
      });
    </script>
    <!--------------------------------------------/JQUERY FOR REGRISTRATION------------------------------------------------------------>
         
    </div>
    <div class="col-sm-3"></div>
  </div>
<!-------------------------------------------------------------------------------->
<!-------------------------------------------------------------------------------->


</div>
<br><br><br>
</body>
</html>