File "single_team.php"
Full Path: /home/ichhrkpd/public_html/application/examples/scripts/single_team.php
File size: 22.33 KB
MIME-type: text/x-php
Charset: utf-8
<?php
$tab_1 = "";
$tab_2 = "";
$tab_3 = "";
$tab_4 = "";
$tab_id = isset($tab_id) ? $tab_id : "1";
if($tab_id == '1'){
$tab_1 = 'active';
}elseif($tab_id == '2'){
$tab_2 = 'active';
}elseif($tab_id == '3'){
$tab_3 = 'active';
}elseif($tab_id == '4'){
$tab_4 = 'active';
}else{
$tab_1 = 'active';
}
?>
<!-- Start Tab Section -->
<section class="pad100">
<div class="container">
<div class="row">
<div class="section-title text-center">
<h3>Single Team Registration</h3>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="max-tab-2">
<!-- Nav tabs -->
<ul class="nav nav-tabs nav-justified" role="tablist">
<li role="presentation" class="<?php echo $tab_1;?>">
<a href="#tab1" role="tab" data-toggle="tab" aria-expanded="false">
Create a Team
</a>
</li>
<li role="presentation" class="<?php echo $tab_2;?>">
<a href="#tab2" role="tab" data-toggle="tab" aria-expanded="false">
Edit a Team
</a>
</li>
<li role="presentation" class="<?php echo $tab_3;?>">
<a href="#tab3" role="tab" data-toggle="tab" aria-expanded="false">
Sign Waiver
</a>
</li>
<li role="presentation" class="<?php echo $tab_4;?>">
<a href="#tab4" role="tab" data-toggle="tab" aria-expanded="false">
Pay for a Team
</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<!-- Start Tab Content 1 -->
<div role="tabpanel" class="tab-pane <?php echo $tab_1;?>" id="tab1">
<div class="row">
<form id="contactForm" action="<?php echo base_url()."home/add_teams"?>" class="contact-form" method="post" role="form">
<div class="col-md-6">
<div class="messages" style="padding-bottom: 10px; text-align: center;"><h4>Employer Information</h4></div>
<div class="controls">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label" for="employer_name"><?php _e("Employer Name"); ?></label>
<input autocomplete="off" style="margin-bottom: 0px !important;" id="employer_name" type="text" maxlength="100" name="employer_name" class="form-control" placeholder="Employer Name *" required="required" data-error="Employer Name is required.">
<div id="suggesstion-box"></div>
<div id="employer_name_err" class="help-block with-errors"></div>
</div>
<div class="form-group">
<label class="control-label" for="role"><?php _e("Type"); ?></label>
<select name="employer_type" id="employer_type" class="form-control">
<option value="S">State & Federal Govt</option>
<option value="C">Corporation & Businesses</option>
<option value="N">Nonprofit & Local</option>
<option value="O">Open</option>
</select>
</div>
<div class="form-group">
<label class="control-label" for="employer_address"><?php _e("Street Address"); ?></label>
<input id="employer_address" type="text" maxlength="150" name="employer_address" class="form-control" placeholder="Street Address *" required="required" data-error="Employer Street Address is required.">
<div id="employer_address_err" class="help-block with-errors"></div>
</div>
<div class="form-group">
<label class="control-label" for="employer_city"><?php _e("City"); ?></label>
<input id="employer_city" type="text" maxlength="50" name="employer_city" class="form-control" placeholder="City *" required="required" data-error="Employer City is required.">
<div id="employer_city_err" class="help-block with-errors"></div>
</div>
<div class="form-group">
<label class="control-label" for="role"><?php _e("State"); ?></label>
<select name="employer_state" id="employer_state" class="form-control">
<option value="AL" >Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT" selected>Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
</div>
<div class="form-group">
<label class="control-label" for="employer_zip"><?php _e("ZIP Code"); ?></label>
<input id="employer_zip" pattern="[0-9]{5}" maxlength="5" name="employer_zip" class="form-control" placeholder="ZIP Code *" required="required" data-error="Please enter only digits with 5 characters">
<div id="employer_zip_err" class="help-block with-errors"></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="messages" style="padding-bottom: 10px; text-align: center;"><h4>Team Information</h4></div>
<div class="controls">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label" for="race_type"><?php _e("Team Type"); ?></label>
<select name="race_type" class="form-control" style="margin-bottom: 0px !important;">
<option value="W">Walking</option>
<option value="R">Running</option>
</select>
</div>
<div class="form-group">
<label class="control-label" for="team_name"><?php _e("Team Name (Max. 20 Character)"); ?></label>
<input id="team_name" type="text" maxlength="20" autocomplete="off" name="team_name" class="form-control" placeholder="Team Name *" required="required" data-error="Team Name is required.">
<div class="help-block with-errors" ></div><div id="check_team_name" style="color: #a94442;"></div>
<input type="hidden" name="email_exists" id="email_exists" value="N">
<input type="hidden" name="team_exists" id="team_exists" value="N">
<input type="hidden" name="isNewEmployer" id="isNewEmployer" value="N">
</div>
<div class="form-group">
<label class="control-label" for="first_name"><?php _e("First Name"); ?></label>
<input id="first_name" type="text" maxlength="100" name="first_name" class="form-control" placeholder="First Name *" required="required" data-error="First Name is required.">
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label class="control-label" for="last_name"><?php _e("Last Name"); ?></label>
<input id="last_name" type="text" maxlength="100" name="last_name" class="form-control" placeholder="Last Name *" required="required" data-error="Last Name is required.">
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label class="control-label" for="email"><?php _e("Email"); ?></label>
<input id="form_email" type="email" autocomplete="off" name="email" class="form-control" placeholder="Email *" required="required" data-error="Valid email is required.">
<div class="help-block with-errors"></div><div id="check_team_email" style="color: #a94442;"></div>
</div>
<div class="form-group">
<div class="g-recaptcha" data-callback="recaptchaCallback" style="transform:scale(.77);-webkit-transform:scale(.77);transform-origin:0 0;-webkit-transform-origin:0 0;" data-sitekey="6Le5OjwUAAAAADSA1l5jTeYjomg8GtKov8t29QIB"></div>
<div id="captcha_msg" style="color: #a94442;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" style="text-align: center;">
<input type="submit" id="submit_btn" class="btn btn-primary" value="Submit">
</div>
</div>
</form>
</div>
</div>
<!-- Start Tab Content 2 -->
<div role="tabpanel" class="tab-pane <?php echo $tab_2;?>" id="tab2">
<div class="row">
<div class="col-md-6 col-md-offset-2">
<form method="post" action="<?php echo base_url()."home/single_team_login/type/e"?>">
<div class="form-group">
<label for="team_code_edit">Please enter your <b class="text-danger">Team Code</b></label>
<input type="text" class="form-control" id="team_code_edit" name="team_code_edit">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
<!-- Start Tab Content 3 -->
<div role="tabpanel" class="tab-pane <?php echo $tab_3;?>" id="tab3">
<div class="row">
<div class="col-md-6 col-md-offset-2">
<form method="post" action="<?php echo base_url()."home/release_of_liability"?>">
<div class="form-group">
<label for="w_code">Please enter your <b class="text-danger">Waiver Code</b></label>
<input type="text" class="form-control" id="w_code" name="w_code">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
<!-- Start Tab Content 4 -->
<div role="tabpanel" class="tab-pane <?php echo $tab_4;?>" id="tab4">
<div class="row">
<div class="col-md-6 col-md-offset-2">
<form method="post" action="<?php echo base_url()."home/single_team_login/type/p"?>">
<div class="form-group">
<label for="team_code_edit">Please enter your <b class="text-danger">Team Code</b></label>
<input type="text" class="form-control" id="team_code_edit" name="team_code_edit">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- End Tab Section -->
<!-- Start Service Section -->
<section class="">
<div class="container">
<div class="row">
<div class="col-md-12 mb30">
<div class="section-title left mb50">
<h3 style="font-size: 34px;">Note</h3>
</div>
<ul class="fa-ul">
<li><i class="fa-li fa fa-check-square"></i>If your team participates with a substitute or any other changes that should have been reported prior to May 8, 2017 at Midnight, your team will automatically be disqualified.</li>
<li><i class="fa-li fa fa-check-square"></i>Each Team Member MUST Sign the Registration Form.</li>
<li><i class="fa-li fa fa-check-square"></i>All qualified teams must consist of 3 persons. If less than 3, the team will not be eligible for an award.</li>
<li><i class="fa-li fa fa-check-square"></i>All members on a team must be all walkers or runners not combined.</li>
<li><i class="fa-li fa fa-check-square"></i>The age of each participant must be at least 16 years old (with parental permission if age = 16 or 17).</li>
<li><i class="fa-li fa fa-check-square"></i>All members on a team must be employees, part or full time or retirees of the same employer.</li>
<li><i class="fa-li fa fa-check-square"></i>If you work for the State of Vermont then your team must consist of individuals from the same Agency. </li>
<li><i class="fa-li fa fa-check-square"></i>A violation of any of the above rules will result in disqualification of your team.</li>
</ul>
<a href="#" class="btn btn-primary mt20">View Info & rules</a>
</div>
</div>
</div>
</section>
<script>
$(document).ready(function(){
$('#contactForm').validator();
$("#employer_name").keyup(function(){
$.ajax({
type: "POST",
url: "<?php echo base_url()?>home/getEmployer_name",
data:'keyword='+$(this).val(),
beforeSend: function(){
//$("#search-box").css("background","#FFF url(LoaderIcon.gif) no-repeat 165px");
},
success: function(data){
$("#suggesstion-box").show();
$("#suggesstion-box").html(data);
//$("#search-box").css("background","#FFF");jFrFrnYgcvJhQYsh
}
});
});
$("#team_name").keyup(function(){
$.ajax({
type: "POST",
url: "<?php echo base_url()?>home/checkTeamName",
data:'tn='+$(this).val(),
success: function(data2){
$("#check_team_name").show();
//$("#check_team_name").html(data2);
if(data2=='Y'){
$("#check_team_name").html("<p>Team Name Already Exists!</p>");
$("#team_exists").val('Y');
}
if(data2=='N'){
$("#check_team_name").html("");
$("#team_exists").val('N');
}
}
});
});
$("#form_email").keyup(function(){
$.ajax({
type: "POST",
url: "<?php echo base_url()?>home/checkTeamEmail",
data:'temail='+$(this).val(),
success: function(data3){
$("#check_team_email").show();
if(data3=='Y'){
$("#check_team_email").html("<p>Email Already Exists!</p>");
$("#email_exists").val('Y');
}
if(data3=='N'){
$("#check_team_email").html("");
$("#email_exists").val('N');
}
}
});
});
});
function selectEmployer2(employer_name,employer_type,employer_address,employer_city,employer_state,employer_zip) {
//alert(employer_type);isNewEmployer
$("#employer_name").val(employer_name);$("#employer_name").prop("disabled", true);
$("#employer_type").val(employer_type);$("#employer_type").prop("disabled", true);
$("#employer_address").val(employer_address);$("#employer_address").prop("disabled", true);
$("#employer_city").val(employer_city);$("#employer_city").prop("disabled", true);
$("#employer_state").val(employer_state);$("#employer_state").prop("disabled", true);
$("#employer_zip").val(employer_zip);$("#employer_zip").prop("disabled", true);
$("#suggesstion-box").hide();
}
function selectEmployer(eid) {
$.ajax({
type:"POST",
url:"<?php echo base_url()?>home/getEmployerDetails",
data:{eid:eid},
dataType:"json",
success:function(response) {
$("#employer_name").val(response[0].employer_name);$("#employer_name").prop("disabled", true);
$("#employer_type").val(response[0].employer_type);$("#employer_type").prop("disabled", true);
$("#employer_address").val(response[0].employer_address);$("#employer_address").prop("disabled", true);
$("#employer_city").val(response[0].employer_city);$("#employer_city").prop("disabled", true);
$("#employer_state").val(response[0].employer_state);$("#employer_state").prop("disabled", true);
$("#employer_zip").val(response[0].employer_zip);$("#employer_zip").prop("disabled", true);
$("#isNewEmployer").val(response[0].eid);
$("#suggesstion-box").hide();
$("#employer_name_err").hide();
$("#employer_address_err").hide();
$("#employer_city_err").hide();
$("#employer_zip_err").hide();
}
});
}
$('#contactForm').submit(function() {
var recaptcha = $("#g-recaptcha-response").val();
if ($.trim($("#team_exists").val()) == "Y" || $.trim($("#email_exists").val()) == "Y" || recaptcha === "") {
alert('Please Check your inputs!');
$("#captcha_msg").html("<p>Please check the recaptcha</p>");
return false;
}else{
//$body = $("body");
//$body.addClass("loading");
return true;
}
});
function recaptchaCallback() {
$("#captcha_msg").hide();
};
</script>