<!DOCTYPE html>

<html class="no-js" lang="en">
<head>
<?php
$this->load->view('user/common_style');
?>
<link rel="stylesheet" href="<?php echo base_url();?>/styles/css/set1.css">
<style>
.contact_one .contact_left_content form input[type="text"]{border:0px;}
.input__label-content {
font-weight: normal;
color: #8d8d8d;
}
.form-group {
margin-bottom: 8px;
}
.input--hoshi select {
text-transform: none;
}

.contact_left_content .help-block {
padding: 0 10px 10px;
position: absolute;
}
.contact_page_btn button{
border: 1px solid #fff;
background-color: transparent;
width: 240px;
height: 50px;
margin: 5px 0 0 5px;
color: #fff;
font-weight: 700;
text-transform: uppercase;
position: relative;
z-index: 999;
}
.input--hoshi .select2-container {
border:0px;
height:50px;
padding:12px 20px;
width:100%;
font-size:16px;
background:#f9f9f9 url(styles/img/arw1.png) no-repeat right center;
margin-top:13px;
border-bottom: 1px solid #B9C1CA !important;
color:#8d8d8d;
transition: transform 0.3s;
}
a{
color:#595f6e;
/*cursor: default;*/
}
/*.form-group input {
min-height: 112px;
}*/

div.coun ul li div.select2-result-label{
cursor: default;
}
.select2-choice{
cursor: default;
}
div.coun small.help-block{
padding-top: 15px !important;
}
.contact_left_content .help-block {
width: 99%;
}
#select2-drop{
border: none;
}
.select2-input{
border: 1px solid #e6e6e6;
margin-top:5px;
}
.agree small {
padding-top: 20px !important;
}


.page-container{
overflow-x: hidden;
}
.yellow-btn button {
all: unset;
cursor: pointer;
}

.select2-container {
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle;
height: 35px;
}            

.help-block
{
color :rgb(169, 68, 66) !important;       
}
</style>  
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body>
<div class="page-container page-section-1-ptb">
<div class="container" style="min-height:600px;">
<div class="row">  
<div class="col-md-4 col-md-offset-4">
<div class="form-page">
<?php 
$logo_img = site_info('site_logo');
if($logo_img) 
{
?>
<a class="logo" href="<?php echo base_url();?>"><img class="img-responsive center-block mb-30" src="<?php echo base_url()."content/site/".site_info('site_logo');?>" alt="<?php echo site_info('site_logo');?>"></a>
<?php } else { ?>
<a class="logo" href="<?php echo base_url();?>"><img class="img-responsive center-block mb-30" src="<?php echo base_url();?>styles/img/logo.png" alt="logo"></a>
<?php } ?> </a>
<div class="form-container mb-10">
<?php if($log_reg_allow_user == 'on') { ?>
<h4 class="other-title theme-color fw-3"><?php echo $this->lang->line('registeration_subtitle'); ?></h4>
<?php if($this->session->flashdata('success_message')) {?>
<div class="row"><div class="col-lg-12 ">     <p class="frgtpwd frgtpwd1"><i class="fa fa-thumbs-up"></i><?php echo $this->session->flashdata('success_message');?></p></div></div>
<?php } 
else if ($this->session->flashdata('error_message')) 
{ 
?>
<div class="row"><div class="col-lg-12">  <p class="frgtpwd frgtpwd1 frgtpwdred"><i class="fa fa-thumbs-down"></i><?php echo $this->session->flashdata('error_message');?></p></div></div>
<?php } else { }?>

<?php 
$us_data = userMinPass();
?> 
<form class="steps-validation create-user" method="post" action="<?php echo $action;?>">
<div class="col-md-12">
<div class="form">                                      

<?php 

if($ref_program == 'on' AND $ref_auto_upline != 'on' AND $user_refer_friend == 'on')
{ 
if(isset($sponsor_details))
{
$sponsordet = $sponsor_details->username;
$sponsordetfullname = $sponsor_details->fullname;
}
else
{
$sponsordet = "";
$sponsordetfullname = "";
}

?>

<div class="form-block form-group">
<i class="fa fa-user"></i>
<input name="referralname" placeholder="<?php echo $this->lang->line('lbl_sponsername'); ?><?php if($ref_upline_reg == 'on'){?> *<?}?>"  type="text" <?php if(isset($reff_name)){ echo 'readonly';}else{ echo '';} ?>  id="referralname_check" value="<?php if($ref_upline_reg == 'on') { echo (isset($reff_name)) ? $reff_name : $sponsordet;} ?>"/>
</label>
</span>
</div>

<div class="form-block form-group">
<i class="fa fa-user"></i>
<input name="sponsorname" placeholder="<?php echo $this->lang->line('place_sponsername'); ?> "  type="text" id="sponsorname" readonly="true" value="<?php if($ref_upline_reg == 'on') { echo $sponsordetfullname; } ?>" />

</label>
</span>
</div>

<?php } ?>

<div class="form-block form-group">
<i class="fa fa-user"></i>
<input name="firstname" placeholder="<?php echo $this->lang->line('place_first_name'); ?>" type="text" id="input-4"/>
</div>
<?php if($required_last_name=='on' || $enable_last_name=='on') { ?>
<div class="form-block form-group">
<i class="fa fa-user"></i>
<input name="lastname"  type="text" id="input-4" placeholder="<?php echo $this->lang->line('place_last_name'); ?>"/>
</div>
<?php } ?>
<div class="form-block form-group">
<i class="fa fa-user"></i>
<input name="username"  type="text" id="input-4" required="" placeholder="<?php echo $this->lang->line('place_user_name'); ?>"/>
</div>
<div class="form-block form-group">
<i class="fa fa-envelope"></i>
<input name="email"  type="text" id="input-4" required="" placeholder="<?php echo $this->lang->line('place_user_email'); ?>"/>
</div>
<div class="form-block form-group">
<i class="fa fa-lock"></i>
<input name="password"  type="password" id="input-4" required="" placeholder="<?php echo $this->lang->line('place_password'); ?>"/>
</div>
<div class="form-block form-group">
<i class="fa fa-lock"></i>
<input name="cpassword"  type="password" id="input-4" required="" placeholder="<?php echo $this->lang->line('place_retype_password'); ?>"/>
</div>
<?php if($required_user_address=='on' || $enable_user_address=='on') { ?>
<div class="form-block form-group">
<i class="fa fa-street-view"></i>
<input name="address"  type="text" id="input-4" placeholder="<?php echo $this->lang->line('place_user_address'); ?>"/>
</div>
<?php } ?>

<?php if($required_user_city=='on' || $enable_user_city=='on') { ?>
<div class="form-block form-group">
<i class="fa fa-street-view"></i>
<input name="city"  type="text" id="input-4" placeholder="<?php echo $this->lang->line('place_user_city'); ?>" />
</div>
<?php } ?>

<?php if($required_user_zip=='on' || $enable_user_zip=='on') { ?>
<div class="form-block form-group">
<i class="fa fa-street-view"></i>
<input name="zip"  type="text" id="input-4" placeholder="<?php echo $this->lang->line('place_user_zip'); ?>" <?php if($required_user_zip=='on') {?>*<?php } ?> />
</div>
<?php } ?>

<?php if($required_user_state=='on' || $enable_user_state=='on') { ?>
<div class="form-block form-group">
<i class="fa fa-street-view"></i>
<input name="state"  type="text" id="input-4" placeholder="<?php echo $this->lang->line('place_user_state'); ?>" <?php if($required_user_state=='on') {?> * <?php } ?>/>
</div>
<?php } ?>

<?php if($required_user_country=='on' || $enable_user_country=='on') { ?>
<div class="form-block form-group coun">

<select name="country" id="simg" class="select form-control">
<option value=""><?php echo $this->lang->line('reg_select_country'); ?></option>
<?php foreach ($countries as $country) { ?>
<option value="<?php echo $country->iso_2;?>"><?php echo $country->Country;?></option> 
<?php } ?>
</select>
</span>
</div>
<?php } ?>

<?php if($required_user_phone=='on' || $enable_user_phone=='on') { ?>
<div class="form-block form-group">
<i class="fa fa-phone"></i>
<input type="text"  id="code"  name="code" data-fv-field="phone" readonly placeholder="<?php echo $this->lang->line('security_phonecode'); ?>">
</div>
<div class="form-block form-group phone" >
<i class="fa fa-phone"></i>
<input type="text" id="input-4"  name="phone" placeholder="<?php echo $this->lang->line('place_user_phone'); ?>" <?php if($required_user_phone=='on') {?> * <?php } ?>/>
</div>
<?php } ?>

<?php if($required_trans_pin=='on' || $enable_trans_pin=='on') { ?>
<div class="form-block form-group">
<i class="fa fa-lock"></i>
<input name="trans_pin" type="password" id="input-4" placeholder="<?php echo $this->lang->line('plac_trans_pin'); ?>" <?php if($required_trans_pin=='on') {?> * <?php } ?> />

</div>
<?php } ?>

<?php if($required_security_question=='on' || $enable_security_question=='on') { ?>
<div class="form-group has-feedback has-feedback-left coun">
<select name="question" class="select">
<option value=""><?php echo $this->lang->line('reg_select_question'); ?></option>
<?php foreach ($questions as $question) { ?>
<option value="<?php echo $question->security_question;?>"><?php echo $question->security_question;?></option> 
<?php } ?>
</select>
</div>
<div class="form-block form-group">
<i class="fa fa-reply-all"></i>
<input name="answer"  type="text" id="input-4" placeholder="<?php echo $this->lang->line('lbl_security_answer'); ?>"/>    
</div>
<?php } ?>

<?php
if($this->data['log_captcha_status'] == 'on'){
?>
<div class="col-md-9">
<div  class="form-block form-group has-feedback has-feedback-left">
<?php
$sitekey = $this->db->query("select * from site_controls where site_key='captcha_key'");
$site_kval=$sitekey->result();
?>
<div class="center-div">
<div class="g-recaptcha" data-callback="recaptchaCallback" data-sitekey="<?php echo $site_kval[0]->site_value;?>"></div>
<br><br>
<div style='color:red'><?php echo form_error('g-recaptcha-response');?></div>
</div>
</div>

</div>



<?php } ?>


<div class=""> 
<div class="form-group has-feedback has-feedback-left agree">
<span style="padding-top:13px" class="">
<input name="agree" class="" type="checkbox" id="" required="" data/>
<label class="" for="agree">
<span><a href="cms/terms"><?php echo $this->lang->line('lbl_agree_terms'); ?></a></span>
</label>
</span>
</div>
</div>

</div>
</div>
<div style="clear:both;"><br></div>
<div class="">
<div class="yellow-btn">
<button  class="" type="submit"><?php echo $this->lang->line('contact_submit'); ?></button>
</div>
</div>

</form>

<?php }  else { ?>
<section class="dmain">
<div class="container" >
<div class="row section_padding_50">
<div class="col-lg-12"> 
<div class="gry clearfix">
<div class="col-lg-6" >
<p style="color:white;" class="frgtpwd frgtpwd1 frgtpwdred"><i class="fa fa-thumbs-down"></i><?php echo $this->lang->line('register_option_disabled'); ?> !</p>
</div>
</div>
</div>
</div>
</div>
</section>

<?php } ?>



<!-- ============= contact_wrapper end ============== -->



</div>
</div>
</div>
</div>
<?php
// $this->load->view('user/footer');
?>
</div>
</div>




<?php
$this->load->view('user/common_script');
?>
<script src="<?php echo base_url();?>styles/js/jquery-1.12.2.min.js"></script>
<script src="<?php echo base_url();?>styles/js/classie.js"></script>
<script src="<?php echo base_url();?>styles/js/jquery.counterup.min.js"></script>
<script type="text/javascript">
(function() {

if (!String.prototype.trim) {
(function() {

var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
String.prototype.trim = function() {
return this.replace(rtrim, '');
};
})();
}

[].slice.call( document.querySelectorAll( 'input.input__field' ) ).forEach( function( inputEl ) {

if( inputEl.value.trim() !== '' ) {
classie.add( inputEl.parentNode, 'input--filled' );
}


inputEl.addEventListener( 'focus', onInputFocus );
inputEl.addEventListener( 'blur', onInputBlur );
} );

function onInputFocus( ev ) {
classie.add( ev.target.parentNode, 'input--filled' );
}

function onInputBlur( ev ) {
if( ev.target.value.trim() === '' ) {
classie.remove( ev.target.parentNode, 'input--filled' );
}
}
})();
</script>

<!--<script type="text/javascript" src="<?php echo base_url();?>styles/js/jquery-parallax.js"></script>-->

<script type="text/javascript" src="<?php echo base_url();?>assets/js/formValidation.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap.js"></script>

<script src="<?php echo base_url();?>/assets/boots/js/select_min.js"></script>

<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>/assets/boots/css/select2.css">

<script type="text/javascript">
jQuery.noConflict();
(function( $ ) {
$(function() {

$(document).ready(function() {

$('#referralname_check').change(function(){

$.ajax({
type: 'post',
url : '<?php echo base_url();?>user/register/getfullname',
data : {'sponsor':$('#referralname_check').val()},
dataType: 'json',
success : function(msg)
{
if(msg['fullname']) {
$('#sponsorname').val(msg['fullname']);
} else {
$('#sponsorname').val('');
}
}
});

})

if ($("#simg").length > 0) {
function formatFlags(state) {
if (!state.id) return state.text;
return "<img style='padding-right:10px;' src='<?php echo base_url();?>assets/images/flags/" + state.id.toLowerCase() + ".png'/>" + state.text;
}
$("#simg").select2({
formatResult: formatFlags,
formatSelection: formatFlags,
escapeMarkup: function(m) {
return m;
}
});
}

$('#simg').change(function(){
var id = $(this).val();
if(id) {
$.ajax({
type: 'post',
url : '<?php echo base_url();?>user/register/changecountry',
data : {'id':id},
success : function(msg)
{
if(msg!=0) {
$('#code').val('+'+msg);
$('#co').addClass('input--filled');
}
}
});
}
});


$("#refresh").on('click', function(e) {
$.ajax({
type: 'post',
url : '<?php echo base_url()."user/register/refersh"; ?>',
data : { },
success : function(msg)
{
$("#capt").attr('src',msg);
}
});
});

$('.create-user').formValidation({
framework: 'bootstrap',
excluded: [':disabled'],

fields: {

<?php

if($ref_upline_reg=='on')
{?>
referralname: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_sponsername_empty");?>'
},
}
},
<?}
?>
firstname: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_firstname_empty");?>'
},
regexp: {
regexp: /^[a-z ]+$/i,
message: '<?php echo $this->lang->line("user_firstname_alpha");?>'
}
}
},

lastname: {
validators: {
<?php if($required_last_name=='on') { ?>
notEmpty: {
message: '<?php echo $this->lang->line("user_lastname_empty");?>'
},
<?php } ?>
regexp: {
regexp: /^[a-z ]+$/i,
message: '<?php echo $this->lang->line("user_lastname_alpha");?>'
}
}
},

email: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_emailid_empty");?>'
},
regexp: {
regexp: /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/,
message: '<?php echo $this->lang->line("user_emailid_invalid"); ?>'
},
remote: {
url: function(validator, $field, value) {

return '<?php echo base_url();?>user/register/validemail'
},
type: 'POST',
delay: 1000,
message: '<?php echo $this->lang->line("mailaddress_invalid"); ?>'
}
}
},
username: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_username_empty");?>'
},
regexp: {
regexp: /^[a-zA-Z0-9]*$/,
message: '<?php echo $this->lang->line("login_name_err");?>'
},
remote: {
url: function(validator, $field, value) {

return '<?php echo base_url();?>user/register/validuser'
},
type: 'POST',
delay: 1000,
message: '<?php echo $this->lang->line("username_invalid"); ?>'
}

}
},
<?php if(isset($us_data)) { ?>
password: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_password_empty");?>'
},
stringLength: {
min: <?php echo $us_data;?>,
message: '<?php echo $this->lang->line("user_password_limit");?><?php echo $us_data;?>'
}

}
},
cpassword: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_confirmpassword_empty");?>'
},
stringLength: {
min: <?php echo $us_data;?>,
message: '<?php echo $this->lang->line("user_confirmpassword_limit");?><?php echo $us_data;?>',
},
identical: {
field: "password",
message: '<?php echo $this->lang->line("user_confirmpassword_match");?>'
}

}
},
<?php } else { ?>

password: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_password_empty");?>'
}

}
},
cpassword: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_confirmpassword_empty");?>'
},
identical: {
field: "password",
message: '<?php echo $this->lang->line("user_confirmpassword_match");?>'
}

}
},
<?php } ?>
<?php if($required_user_address=='on') { ?>
address: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_address_empty");?>'
}
}
},
<?php } ?>

state: {
validators: {
<?php if($required_user_state=='on') { ?>
notEmpty: {
message: '<?php echo $this->lang->line("user_state_empty");?>'
},
<?php } ?>
regexp: {
regexp: /^[a-z ]+$/i,
message: '<?php echo $this->lang->line("user_state_alpha");?>'
}
}
},


zip: {
validators: {
<?php if($required_user_zip=='on') { ?>
notEmpty: {
message: '<?php echo $this->lang->line("user_zip_empty");?>'
},
<?php } ?>
regexp: {
regexp: /^[a-zA-Z0-9 ]*$/,
message: '<?php echo $this->lang->line("user_zip_num");?>'
}
}
},

<?php if($required_user_phone=='on') { ?>
phone: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_phone_empty");?>'
},
digits: {
message: '<?php echo $this->lang->line("user_phone_num");?>'
},
stringLength: {
max: 15,
message: '<?php echo $this->lang->line("user_phone_max_limit");?>'
}

}
},
<?php } ?>
<?php if($required_security_question=='on') { ?>
question: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_question_empty");?>'
}

}
},
answer: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_answer_empty");?>'
}

}
},
<?php } ?>
<?php if($required_user_country=='on') { ?>
country: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("country_pls_Select");?>'
}

}
},
<?php } ?>
<?php if($required_user_city=='on') { ?>
city: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("user_city_empty");?>'
},
regexp: {
regexp: /^[a-z ]+$/i,
message: '<?php echo $this->lang->line("user_city_alpha");?>'
}

}
},
<?php } ?>
<?php if($ref_program == 'on' AND $ref_auto_upline != 'on') { ?>
referralname: {
validators: {
<?php if(isset($sponsor_details)){ ?>
notEmpty: {
message: '<?php echo $this->lang->line("sponser_empty");?>'
},
<?php } ?>
regexp: {
regexp: /^[a-zA-Z0-9]*$/,
message: '<?php echo $this->lang->line("user_sponsername_alpha");?>'
},
remote: {

url: function(validator, $field, value) {

return '<?php echo base_url();?>user/register/validreferral'
},
type: 'POST',
delay: 1000,
message: '<?php echo $this->lang->line("sponser_invalid"); ?>'
}

}
},
<?php } ?>
<?php if($required_trans_pin=='on') { ?>
trans_pin:{
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("trans_required");?>'
},
digits: {
message: '<?php echo $this->lang->line("registration_trans_digit_err");?>'
} 
}

},
<?php } ?> 
agree: {
validators: {
notEmpty: {
message: '<?php echo $this->lang->line("lbl_agree_terms");?>'
}
}
}

}
})

});

});
})(jQuery);

</script>
</body>
</html>