File "multiple_team_reg.php"

Full Path: /home/ichhrkpd/public_html/application/controllers/paypal/multiple_team_reg.php
File size: 18.01 KB
MIME-type: text/x-php
Charset: utf-8

<?php 

?>      
       
       
        <!-- Start Tab Section -->
        <section class="pad100">
            <div class="container">
                <div class="row">
                    <div class="section-title text-center">
                        <h3>Multiple Team Registration</h3>
                    </div>
                </div>
                                   
                                   
                                    <div class="row">
                						<form id="contactForm" action="<?php echo base_url()."home/add_organizer"?>" 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>Organizer Information</h4></div>
                       								 <div class="controls">
                            							<div class="row">
							                                <div class="col-md-12">
															    <div class="form-group">
							                                    	<label class="control-label" for="organizer_name"><?php _e("Organizer's Full Name"); ?></label>
							                                        <input style="margin-bottom: 0px !important;" id="organizer_name" type="text" maxlength="100" autocomplete="off" name="organizer_name" class="form-control" placeholder="Organizer's Full Name *" required="required" data-error="Organizer's Full 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="organizer_email"><?php _e("Email Address"); ?></label>
							                                        <input id="form_email" type="email" autocomplete="off" name="organizer_email" class="form-control" placeholder="Email Address *" required="required" data-error="Valid email is required.">
							                                        <div class="help-block with-errors"></div><div id="check_org_email" style="color: #a94442;"></div>
							                                    </div>
							                                    <div class="form-group">
							                                    	<label class="control-label" for="con_organizer_email"><?php _e("Confirm Email Address"); ?></label>
							                                        <input id="con_organizer_email" type="text" autocomplete="off" name="con_organizer_email" class="form-control" placeholder="Confirm Email Address *" data-error="Confirm Email Address is required.">
							                                        <div id="confirm_email" style="color: #a94442;"></div>
							                                    </div>
							                                    <div class="form-group">
							                                    	<label class="control-label" for="password"><?php _e("Password"); ?></label>
							                                        <input id="password" type="password" maxlength="32" name="password" class="form-control" placeholder="Password *" required="required" data-error="Password is required.">
							                                        <div class="help-block with-errors"></div><div id="divPassLen" style="color: #a94442;"></div>
							                                    </div>
							                                    <div class="form-group">
							                                    	<label class="control-label" for="c_password"><?php _e("Confirm Password"); ?></label>
							                                        <input id="c_password" type="password" maxlength="32" name="c_password" class="form-control" placeholder="Confirm Password *" data-error="Confirm Password is required.">
							                                        <div class="help-block with-errors"></div><div id="divCheckPasswordMatch" 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>
        </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();
		$("#c_password").keyup(checkPasswordMatch);
		$("#password").keyup(checkPasswordLength);
		$("#con_organizer_email").keyup(checkEmailMatch);
		
		$("#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
			}
			});
		});


		$("#form_email").keyup(function(){
			$.ajax({
			type: "POST",
			url: "<?php echo base_url()?>home/checkOrgEmail",
			data:'oemail='+$(this).val(),
			success: function(data3){
				$("#check_team_email").show();
				if(data3=='Y'){
					$("#check_org_email").html("<p>Email Already Exists!</p>");
					$("#email_exists").val('Y');
				}
				if(data3=='N'){
					$("#check_org_email").html("");
					$("#email_exists").val('N');
				}
				
			}
			});
		});				
	});
	

	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();
	};
	

	//http://jsfiddle.net/rpP4K/
	 //http://stackoverflow.com/questions/9717588/checking-password-match-while-typing
	 function checkPasswordMatch() {
		    var password = $("#password").val();
		    var confirmPassword = $("#c_password").val();

		    if (password != confirmPassword)
		        $("#divCheckPasswordMatch").html("Passwords do not match!");
		    else
		        $("#divCheckPasswordMatch").html("");
		}

	 function checkPasswordLength() {
		    var password = $("#password").val().length;
		    if (password < 8){
		        	$("#divPassLen").html("Password must be at least 8 characters long!");
		        }
		    else
		        $("#divPassLen").html("");
		}

	  function checkEmailMatch() {
		    var email = $("#form_email").val();
		    var confirmEmail = $("#con_organizer_email").val();

		    if (email != confirmEmail)
		        $("#confirm_email").html("Email do not match!");
		    else
		        $("#confirm_email").html("");
		}	
</script>