<?php include("includes/header.php"); ?>
<?php include("includes/auto_out.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title>Create New User | <?php echo $sitename;  ?> HQ</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

   <!--CSS-->
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

    <!-- Bootstrap Core CSS -->
      <link href="css/bootstrap.min.css" rel="stylesheet">

     <!-- Font Awesome -->
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">

      <!-- Custom CSS -->
      <link href="css/blog-home.css" rel="stylesheet">

      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
      <!--[if lt IE 9]-->
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
          <script src="js/jquery.js"></script>
          <script src="js/bootstrap.js"></script>





          <!----MODAL-------------------->
          <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>



</head>

<body>
  <?php  include("includes/dashboard_navbar.php"); ?>
  <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
  <style>
    body{
      background-color: #f5f5f5;
    }
    .destop-siderbar{
      background-color: #131e2a;
      height: 100%;
      width:240px;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      position: fixed;
      margin-left:-20px;
      padding:50px 25px;
    }
    .destop-siderbar li{
       padding: 30px 20px;
       list-style: none;
    }
    .destop-siderbar li a{
      color: #fff;
      font-size: 17px;
      padding:10px 0px;
    }
    .destop-siderbar li a i{
      color:rgb(45, 156, 219);
      font-weight: lighter;
    }
    .destop-siderbar .active {
      background-color:#123962;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      
    }
    .destop-siderbar .active a{
      color:#fff;
    }
    .destop-siderbar .active a:hover{
      color:#fff;
    }
    .destop-siderbar li a:hover{
      color: #a5bdd9;
      text-decoration: none;
    }
    .panel{
      border-radius: 0px;
      border-color: transparent;
    }
    .input-danger{
       border:1px solid darkred;
       color:darkred;
     }
     .input-danger::placeholder{
       opacity: 0.6;
       color:darkred;
     }
  </style>

  <div class="container-fluid">
    <div class="row">
      <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-2 hidden-xs" style="height: 100%;">
             <?php include("includes/desktop_side.php"); ?>
      </div>
      <!--/////////////////////// DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-10">
        <br><br><br><br>

        <!----------------------------------------------------------------------------------->

        <div class="row">
          <div class="col-sm-12">
              
             
            
            
            <!-------------------------------------------------------------------------------->
  <div class="row">
    <div class="col-sm-3"></div>
    <div class="col-sm-6">
     
      <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="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>
      <?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>

    <br><br><br>
    <!--------------------------------------------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>








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