<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
    <meta name="description" content="">

    <meta name="keywords" content="">



    <link rel="icon" href="<?php echo base_url(); ?>assets/ico.png">
    <title>Book an appointment - Expert Solutions</title>
    <!-- Bootstrap core CSS -->
    <link href="<?php echo base_url(); ?>assets/css/bootstrap.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/css/reset.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/aos/aos.css" rel="stylesheet">-
    <link href="<?php echo base_url(); ?>assets/css/gwmenu.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/css/font-awesome.css" rel="stylesheet">
<!--<link href="<?php echo base_url(); ?>assets/css/responsive.css" rel="stylesheet">
   <link href="<?php echo base_url(); ?>assets/css/datepicker.css" rel="stylesheet">
   <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker.css'>
      <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/formvalidation/0.6.2-dev/css/formValidation.min.css'>-->

   <link href="<?php echo base_url(); ?>assets/css/datepicker.css" rel="stylesheet">

   
    <link href="<?php echo base_url(); ?>assets/css/style.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/css/custom.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxbookn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxbookn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

   

</head>
<div class="booking-banner">
        
       
		 <p><a href="<?php echo site_url('user/index'); ?>">home</a> / <a style="color:#545454;">book online</a></p>  
         <h2>Book an appointment</h2>
		</div>
		 <div class="clearfix"></div>

<body class="servicereq">
 	
<div id="servicereq">

				

       <div class="home-form" >
  		
    <form id="emergency_form2" name="emergency_form2" action="" method="post" >
       
	  <input type="hidden" name="page" value="footer">
    <div class="">
	
	<div class="container">
		
	
                                        	<div class="row">
											<div class="col-xxs-12 col-xs-12 mt alternate">
											<label for="from">Name: *</label>
                                              <input type="text" class="form-control" id="from-place1" name="name" placeholder=""  
                                                    required="" data-original-title="Please provide name" title="">
												</div></div>	

												
												<div class="row">
												<div class="col-xxs-12 col-xs-4 mt pull-right" id="checkbox" style="display:none;">
                                          
				                         <label for="Create_account">  Create account</label>
										 <input onclick="Check_account(event)" type="checkbox" id ="Create_account" name="Create_account" 
										 value="" data-validation="checkbox_group" data-validation-qty="1-3"> 
			                            	
											</div>
												
												</div>
																								
										
												
<div class="row">
											<div class="col-xxs-12 col-xs-6 mt alternate">
											<label for="from">Phone: *</label>

											
												<div class="input-field">
                                
                              <input type="tel" class="form-control" id="to-place"  maxlength="8" name="contact" placeholder="" 
							     required="" data-original-title="Please provide phone" title="" > 			
	                                
				
				</div></div>
				
				
						<div class="col-xxs-12 col-xs-6 mt alternate" id="EmElement13" style="display:none;">
												<div class="input-field">
										<label for="email">Email: *</label>
                                 
                             	 
                              <input type="text" class="form-control" id="email"  name="email" placeholder="" autocomplete="off" data-validation="required"  data-validation-error-msg-required="Please provide email"  > 			
	                                  
				
				</div>
				</div>
				
				</div>
			  							<div class="row">
											<div class="col-xxs-12 col-xs-6 mt alternate">																					
													<label for="service_type">Type of service required:</label>
													</div></div>
													
			                                      <div class="row">
												  
												  <div class="col-xxs-12 col-xs-6 mt alternate" >
												  <div class="input-field">
                                                     
                                                    <select class="form-control"  name="service_type">
													<option value="Fitness Equipment Maintenance" >Fitness Equipment Maintenance</option>
                                                    <!--<option value="Buy Equipment and Spare parts">Buy Equipment and Spare parts </option>-->
                                                    
                                                    </select>

                                                   </div></div>
												
												
											
											<div class="col-xxs-12 col-xs-6 mt alternate">																		
			                                       <div class="input-field">
                                                                                              												
													<select class="form-control"  name="booking_type" id="booking_type" onChange="Booking_type(event)">
													<option value="Emergency call out" > Emergency call out</option>
                                                    <option value="One Time Service"> One Time Service</option>
                                                    <option value="Annual Maintenance"> Annual Maintenance</option>
                                                    </select>
                                                   </div>
												
												
											</div>
									</div> 
									
								<div class="row">	
										
											<div class="col-xxs-12 col-xs-12 mt alternate" id= "EmElement1">
											 <label for="date-start">No(s) of equipment:</label>
											 </div>
											 
											 
											 </div>
<div class="row">
											 <div class="col-xxs-12 col-xs-4 mt alternate" id= "EmElement2">
                                                <div class="input-field" >
                                                   
                                                    <select class="form-control" name="no_of_equipment">
                                                    
                                                        <option value="1">1</option>
                                                        <option value="2">2</option>
                                                         <option value="3">3</option>
                                                         <option value="4">4</option>
                                                         <option value="5">5</option>
                                                         <option value="6">6</option>
                                                        <option value="7">7</option>
                                                         <option value="8">8</option>
                                                         <option value="9">9</option>
                                                         <option value="10">10</option>
                                                    </select>
                                                </div>
                                            </div>
											
											<div class="col-xxs-12 col-xs-4 mt alternate" id= "EmElement3" style="display:none;">
                                                <div class="input-field">
                                                    <label for="date-start">Cardio:</label>
                                                    <select class="form-control" name="cardio">
                                                    <option value="0">0</option>
                                                        <option value="1">1</option>
                                                        <option value="2">2</option>
                                                         <option value="3">3</option>
                                                         <option value="4">4</option>
                                                         <option value="5">5</option>
                                                         <option value="6">6</option>
                                                        <option value="7">7</option>
                                                         <option value="8">8</option>
                                                         <option value="9">9</option>
                                                         <option value="10">10</option>
                                                    </select>
                                                </div>
                                            </div>     
                                            <div class="col-xxs-12 col-xs-4 mt alternate" id= "EmElement4" style="display:none;">
                                                <div class="input-field">
                                                    <label for="date-start">Strength:</label>
                                                    <select class="form-control" name="strength">
                                                    <option value="0">0</option>
                                                        <option value="1">1</option>
                                                        <option value="2">2</option>
                                                         <option value="3">3</option>
                                                         <option value="4">4</option>
                                                         <option value="5">5</option>
                                                         <option value="6">6</option>
                                                        <option value="7">7</option>
                                                         <option value="8">8</option>
                                                         <option value="9">9</option>
                                                         <option value="10">10</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-xxs-12 col-xs-4 mt alternate" id= "EmElement5" style="display:none;">
                                                <div class="input-field">
                                                    <label for="date-start">Other:</label>
                                                    <select class="form-control" name="other">
                                                    <option value="0">0</option>
                                                        <option value="1">1</option>
                                                        <option value="2">2</option>
                                                         <option value="3">3</option>
                                                         <option value="4">4</option>
                                                         <option value="5">5</option>
                                                         <option value="6">6</option>
                                                        <option value="7">7</option>
                                                         <option value="8">8</option>
                                                         <option value="9">9</option>
                                                         <option value="10">10</option>
                                                    </select>
                                                </div>
                                            </div>
</div>	
											
									
<div class="row" >
											<div class="col-xxs-12 col-xs-6 mt alternate" id="EmElement6">
											<label for="date-end">Appointment:</label>
                                              </div> </div>
											  <div class="row" >
											  <div class="col-xxs-12 col-xs-6 mt alternate" id="EmElement7">
												<div class="input-field">																																						
													<input type="text"  class="form-control date-end" id="date-end" name="appointment_date" placeholder="" data-validation="required date" data-validation-format="dd/mm/yyyy" data-validation-error-msg-required="Please pick a date" autocomplete="off">
												</div>
												
												</div>
												<div class="col-xxs-12 col-xs-6 mt alternate" id="EmElement8">
												
                                                <div class="input-field">
                                               
                                                     
                                                    <select class="form-control"  name="appointment_time" id="appointment_time">
													<option value="0900-1200">Morning: 9am to 12pm</option>
                                                    <option value="1200-1700"> Afternoon: 12pm to 5pm</option>
                                                    <option value="1700-2100"> Evening: 5pm to 9pm</option>
                                                    </select>
                                                </div>
												
												</div> 
												
												</div>
												
										    <div class="row">
											  <div class="col-xxs-12 col-xs-6 mt alternate" id="EmElement9" style="display:none;">
											
											<div class="input-field">		
                                               <label for="date-start">Frequency of visits:</label>											
                                                   <select class="form-control" name="frequency_of_visit">
                                                    <option value="Every month">Every month</option>
                                                        <option value="Every two months">Every two months</option>
                                                        <option value="Quarterly">Quarterly</option>
                                                         <option value="Bi-annual">Bi-annual</option>
                                                         <option value="Technical Team’s Call prior to inspection">Technical Team’s Call prior to inspection</option>
                                                        
                                                    </select>
													</div>
                                              </div>
											 

											 
												
											  <div class="col-xxs-12 col-xs-6 mt alternate" id="EmElement10" style="display:none;">
                                                
												<div class="input-field">
                                                <label for="date-start">Site visit:</label>
                                                   <select class="form-control" name="site_visit">
                                                    <option value="Necessary">Necessary</option>
                                                        <option value="Not necessary">Not necessary</option>
                                                        <option value="Technical Team’s Call">Technical Team’s Call</option>
                                                         
                                                    </select>
                                                </div>
												
												</div> 
                                                
                                             </div>
                                                


<div class="row">										
											
											<div class="col-xxs-12 col-xs-12 mt alternate">
												<div class="input-field">
													<label for="from">A brief explanation of whats going on: *</label>
													<input type="text" class="form-control" id="from-place" name="issue" placeholder="" required="" data-original-title="Please explain" title="">
												</div>
											</div>
</div>	

								


                                         <div class="row">
											<div class="col-xxs-12 col-xs-4 mt alternate" id="EmElement14" style="display:none;">																					
													<label for="from">Password: *</label>
													</div></div>
													
			                                      <div class="row">
												  
												  <div class="col-xxs-12 col-xs-4 mt alternate" id="EmElement15" style="display:none;">
												  <div class="input-field">
                                                     
											<input type="text" class="form-control" id="from-place1" name="password" placeholder="Type New Password"  
				                                  data-validation="required" data-validation-error-msg-required="Please provide your Name" autocomplete="off">
                                           

                                                   </div></div>
												
												
											
											<div class="col-xxs-12 col-xs-3 mt alternate" id="EmElement16" style="display:none;">	
 										
			                                       <div class="input-field">
                                                                                              												
											<input type="text" class="form-control" id="from-place1" name="confirmPassword" placeholder="Confirm Password"  
				                                 data-validation="required" data-validation-error-msg-required="Please provide your Name" autocomplete="off">
                                                  
												  </div>
												
												
											</div>
										<div class="form-column" >		
											<div class="col-xxs-12 col-xs-6 mt alternate pull-right" id="EmElement18">
                                                   <button type="submit" id="submit_btn1" class="theme-btn btn-style-one" onclick="emergency_footer(event)">
                                                   Book Now
                                                  </button>
												
											</div> 
											
											<div class="col-xxs-12 col-xs-6 mt alternate pull-right" id="EmElement19" style="display:none;">
                                                   <button type="submit" id="submit_btn2" class="theme-btn btn-style-one" onclick="one_time_footer(event)">
                                                   Book Now
                                                  </button>
												
											</div> 
											
											<div class="col-xxs-12 col-xs-6 mt alternate pull-right" id="EmElement20" style="display:none;">
                                                 <button type="submit" id="submit_btn3" class="theme-btn btn-style-one" onclick="contract_footer(event)">
                                                   Book Now
                                                  </button>  
												
											</div> 
											
											<div class="col-xxs-12 col-xs-4 mt alternate pull-right" id="EmElement21" style="display:none;">
                                                  <button type="submit" id="submit_btn4" class="theme-btn btn-style-one" onclick="">
                                                  Sign up & book Now
                                                  </button>  
												
											</div>
										</div>	
									</div>  
												
									</div>  			
											
											
											
											
										</div></div>
                                    </form>
 
        
                                   
                        
                        
                        </div>
      </div>     
  
    <div class="clearfix"></div>
  
       
      
<div>
    <?php  $this->load->view("layout/footer"); ?>
</div>
 
 <script src="<?php echo base_url(); ?>assets/js/jquery.min.js"></script>
 <script src="<?php echo base_url(); ?>assets/aos/aos.js"></script>
<script src="<?php echo base_url(); ?>assets/js/modernizr.js"></script>
<script src="<?php echo base_url(); ?>assets/js/owl.carousel.min.js"></script>
     
     <div id="snackbar">Some text some message..</div>
      <script src="<?php echo base_url(); ?>assets/js/jquery.min.js"></script>
	<!--  <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.2.1/jquery.form-validator.min.js"></script>-->

 <script src="<?php echo base_url(); ?>assets/aos/aos.js"></script>
<script src="<?php echo base_url(); ?>assets/js/modernizr.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/bootstrap.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/jquery.gwmenu.js"></script>
<!-- <script src="<?php echo base_url(); ?>assets/js/bootstrap-datepicker.js"></script>-->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script> 
 <!--<script src="<?php echo base_url(); ?>assets/js/bootstrap-tabcollapse.js"></script>-->
    <script src="<?php echo base_url(); ?>assets/js/main.js"></script>
      <!--   <script src="https://cdnjs.cloudflare.com/ajax/libs/formvalidation/0.6.2-dev/js/formValidation.min.js"></script> 
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>-->
     
	 <script src="<?php echo base_url(); ?>assets/js/jquery_formvalidator1.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/jquery_formvalidator2.js"></script>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>



<script type="text/javascript">

$('#from-place1').tooltip({
  
  trigger: "manual"
});

$("#from-place1").click(function(e) {
  $(this).tooltip("hide");
});

$("#submit_btn1,#submit_btn2,#submit_btn3").click(function() {
  
  if(!$('#from-place1').val())
  {
    $('#from-place1').tooltip("show");  
  }
 
});

$('#to-place').tooltip({
  title: "Enter Phone",
  trigger: "manual"
});

$("#to-place").click(function(e) {
  $(this).tooltip("hide");
});



$("#submit_btn1,#submit_btn2,#submit_btn3").click(function() {
  
  if(!$('#to-place').val())
  {
    $('#to-place').tooltip("show");  
  }
 
});

$('#from-place').tooltip({
  
  trigger: "manual"
});

$("#from-place").click(function(e) {
  $(this).tooltip("hide");
});

$("#submit_btn1,#submit_btn2,#submit_btn3").click(function() {
  
  if(!$('#from-place').val())
  {
    $('#from-place').tooltip("show");  
  }
 
});

</script>
	
    <script>
	
  $.validate({
    lang: 'en',
    modules : 'file,date'
  });

 /* $("booking_type").change(function() {
   $.ajax({
     url : "<?php echo base_url(); ?>index.php/user/emergency_index",
     method: "POST" /* use get or post,
     data: "booking_type=" + $(this).val(),
     success: function(response) {
     }
  })  
}); */

function Check_account(event){
	var check = document.getElementById("checkbox");
	   check.show =true;
	if(check.checked){
	     document.getElementById("EmElement13").style.display = "block";
		 document.getElementById("EmElement14").style.display = "block";
		 document.getElementById("EmElement15").style.display = "block";
		 document.getElementById("EmElement16").style.display = "block";
		 
		 var bType = document.getElementById("booking_type");
		 
	     if((bType.value)=="Emergency call out" || (bType.value)=="One_Time_Service" || (bType.value)=="Annual Maintenance"){
		 document.getElementById("EmElement21").style.display = "block";		 
		 document.getElementById("EmElement18").style.display = "none";
		 document.getElementById("EmElement19").style.display = "none";
		 document.getElementById("EmElement20").style.display = "none";
		 }
	} else {
		
		 document.getElementById("EmElement13").style.display = "none";
		 document.getElementById("EmElement14").style.display = "none";
		 document.getElementById("EmElement15").style.display = "none";
		 document.getElementById("EmElement16").style.display = "none";
		  document.getElementById("EmElement21").style.display = "none";
		 
		 var bType = document.getElementById("booking_type");
	     if((bType.value)=="Emergency call out"){
			  
		 document.getElementById("EmElement18").style.display = "block";
		 document.getElementById("EmElement19").style.display = "none";
		 document.getElementById("EmElement20").style.display = "none";
		  }
		 else if((bType.value)=="One_Time_Service"){
	     document.getElementById("EmElement18").style.display = "none";
		 document.getElementById("EmElement19").style.display = "block";
		 document.getElementById("EmElement20").style.display = "none";
			 
			 
		 }
		else if((bType.value)=="Annual Maintenance"){
		 document.getElementById("EmElement18").style.display = "none";
		 document.getElementById("EmElement19").style.display = "none";
		 document.getElementById("EmElement20").style.display = "block";
			
		
	}
	
} 
}
function Booking_type(event){
	
	var bType = document.getElementById("booking_type");
	if((bType.value)=="Emergency call out")
	{
		 document.getElementById("EmElement1").style.display = "block";
		 document.getElementById("EmElement2").style.display = "block";
		 document.getElementById("EmElement3").style.display = "none";
		 document.getElementById("EmElement4").style.display = "none";
		 document.getElementById("EmElement5").style.display = "none";
		 document.getElementById("EmElement6").style.display = "block";
		 document.getElementById("EmElement7").style.display = "block";
		 document.getElementById("EmElement8").style.display = "block";
		 document.getElementById("EmElement9").style.display = "none";
		 document.getElementById("EmElement10").style.display = "none";
		 
		 
		 var check = document.getElementById("Create_account");
	
	        if(check.checked){
		 document.getElementById("EmElement18").style.display = "none";
		 document.getElementById("EmElement19").style.display = "none";
		 document.getElementById("EmElement20").style.display = "none";
		 document.getElementById("EmElement21").style.display = "block";
				
			}
		 else{
		 document.getElementById("EmElement18").style.display = "block";
		 document.getElementById("EmElement19").style.display = "none";
		 document.getElementById("EmElement20").style.display = "none";
		 document.getElementById("EmElement21").style.display = "none";
		 }
		
	} else if((bType.value)=="One Time Service")
	{
		 document.getElementById("EmElement1").style.display = "none";
		 document.getElementById("EmElement2").style.display = "none";		 
		 document.getElementById("EmElement3").style.display = "block";
		 document.getElementById("EmElement4").style.display = "block";
		 document.getElementById("EmElement5").style.display = "block";
		 document.getElementById("EmElement6").style.display = "block";
		 document.getElementById("EmElement7").style.display = "block";
		 document.getElementById("EmElement8").style.display = "block";
		 document.getElementById("EmElement9").style.display = "none";
		 document.getElementById("EmElement10").style.display = "none";
		 
		 
		 var check = document.getElementById("Create_account");
	
	        if(check.checked){
		 document.getElementById("EmElement18").style.display = "none";
		 document.getElementById("EmElement19").style.display = "none";
		 document.getElementById("EmElement20").style.display = "none";
		 document.getElementById("EmElement21").style.display = "block";
				
			}
		 else{
		 document.getElementById("EmElement18").style.display = "none";
		 document.getElementById("EmElement19").style.display = "block";
		 document.getElementById("EmElement20").style.display = "none";
		 document.getElementById("EmElement21").style.display = "none";
		 }
		 
		
	} 
	else if((bType.value)=="Annual Maintenance"){
		
		 document.getElementById("EmElement1").style.display = "none";
		 document.getElementById("EmElement2").style.display = "none";		
		 document.getElementById("EmElement3").style.display = "block";
		 document.getElementById("EmElement4").style.display = "block";
		 document.getElementById("EmElement5").style.display = "block";		 
		 document.getElementById("EmElement6").style.display = "none";
		 document.getElementById("EmElement7").style.display = "none";
		 document.getElementById("EmElement8").style.display = "none";		 
		 document.getElementById("EmElement9").style.display = "block";
		 document.getElementById("EmElement10").style.display = "block";
		 
		 
		 
		 var check = document.getElementById("Create_account");
	
	        if(check.checked){
		 document.getElementById("EmElement18").style.display = "none";
		 document.getElementById("EmElement19").style.display = "none";
		 document.getElementById("EmElement20").style.display = "none";
		 document.getElementById("EmElement21").style.display = "block";
				
			}
		 else{
		 document.getElementById("EmElement18").style.display = "none";
		 document.getElementById("EmElement19").style.display = "none";
		 document.getElementById("EmElement20").style.display = "block";
		 document.getElementById("EmElement21").style.display = "none";
		 }
		 
		 
		
	}
}
  
</script>
	 
	  
<!--	<script type="text/javascript">
	
	$(document).ready(function(){
            $("#appointment_time").on("focusout",function(e){
                var currentTime = new Date();
                var userTime = $("#appointment_time").val().split(":"); 
                if(currentTime.getHours() > parseInt(userTime[0])){
                    alert("To old value");
                    $(this).focus();                
                }
                if(currentTime.getHours() <= parseInt(userTime[0])){
                    if(currentTime.getMinutes() > parseInt(userTime[1])){
                        alert("To old value");
                    $(this).focus();
                    }
                }
            });
        });
		
		
		
	
		
	
</script>	
 <script type="text/javascript">

document.getElementById("to-place").addEventListener("click", function(e){
	e.target.value = '+974' + e.target.value;
	//var y = document.getElementById("to-place");
    //var contact = '+974' + y.value;
	alert(contact);
	}, false);

</script> -->

<script type="text/javascript">



window.onload = function(){
	
	checkDate(event);
	Booking_type(event);
	Check_account(event);
	//myContact(event);
};

function checkDate(event) {
  
  
  
   var currentDate = new Date();
   //alert(currentDate.toUTCString().toString());
   
   var day = currentDate.getDate();
   var month = currentDate.getMonth() + 1;
   var year = currentDate.getFullYear();
   day = day < 10 ? '0' + day : day;
   month = month < 10 ? '0'+ month : month;
   var z =  day + "/" + month  + "/" + year;
   //alert(z);
   var x = document.getElementById("appointment_time");
   var y = document.getElementById("date-end");
   //var xx =  document.getElementById("appointment_time").getElementsByTagName("option");
   var yy = y.value;
    yy =yy.split("/");
   var lo_day = yy[0];
   var lo_month =yy[1];
   var lo_year =yy[2];
   
   //alert(lo_date);
   
   var minutes = currentDate.getMinutes();
   var hours = currentDate.getHours();
   
      hours = hours < 10 ? '0' + hours : hours;
      minutes = minutes < 10 ? '0'+ minutes : minutes ;
   var strTime = "" + hours  + minutes ;
   //var strTime1 = new Date().getTime();
   
   if((lo_day>day) || (lo_month>month)||(lo_year>year)){ 
		
		var i1;
		   for(i1=0; i1 < x.length;i1++)
		   {
			  var x1 =  document.getElementById("appointment_time").getElementsByTagName("option");
		      x1[i1].disabled = false; 
			  x1[0].selected =true;
		   }
		
	}
	else if((lo_day<day) || (lo_month<month)||(lo_year<year)){
		
		var i2; 
		   for(i2=0; i2 < x.length;i2++)
		   {
			  var x2 =  document.getElementById("appointment_time").getElementsByTagName("option");
		      x2[i2].disabled = true;			  
		   }
		
	}
    else if(y.value==z){
    var txt;
    var i3;
    
         for (i3 = 0; i3 < x.length; i3++) {
             txt =  x.options[i3].value;
             txt =txt.split("-");
			 
             if((parseInt(txt[1])) < (170+parseInt(strTime)) ){  
 
			  var xx =  document.getElementById("appointment_time").getElementsByTagName("option");
		      xx[i3].disabled = true;  
              xx[i3+1].selected =true;
			  if((parseInt(strTime))>= (parseInt(1900)))
			 {
				
                 document.getElementById("appointment_time").selectedIndex = -1;
				 
				 
				 
			 } 

			 
       } 
	    
	 }  
           
    } 
	
   }
   

   


	</script>
	
 <script type="text/javascript">
 
 
function emergency_footer(event)
{
 
  event.preventDefault();
  var flag=1;
  var name=$("#emergency_form2 input[name=name]").val();
  var contact= $("#emergency_form2 input[name=contact]").val();
  var issue=$("#emergency_form2 input[name=issue]").val();
  var appointment_date=$("#emergency_form2 input[name=appointment_date]").val();
  

	//alert(contact);
		
  if(name=="")
  {
    flag=0;       
   
  }
  if(contact=="")
  {
    flag=0;
	
  }
  if(issue=="")
  {
    flag=0;
	
	
  } 
  if(appointment_date=="")
  {
    flag=0;
  }
  // alert(flag);
  if(flag==1)
  {
    var $form = $('#emergency_form2');
    $.ajax({
      type: "POST",
      dataType:"",
      data: $form.serialize(),
      url:'<?php echo base_url(); ?>index.php/user/emergency_index',
      success:function(response){
       // alert(data);
        // var response_split=response.split('@');
        var dataSplit=response.split('@');
        if(dataSplit[0]=="Success")
        {
			
            $("#emergency_form2").trigger("reset");
            var x = document.getElementById("snackbar");
            x.className = "show"; 
            $("#snackbar").html(dataSplit[1]);
            setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
			window.location.reload();  
          
        }
        else
        {
          var x = document.getElementById("snackbar");
            x.className = "show";
            $("#snackbar").html(dataSplit[0]);
            setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
        }
      }
    });
  }
  else
  {
    /*alert(flag);
	var x = document.getElementById("snackbar");
    x.className = "show";
    $("#snackbar").html('Enter Requied fields');
    setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); */
		

  }
 
    
}



  function one_time_footer(event)
{
	
  event.preventDefault();
  var flag=1;
  var name=$("#emergency_form2 input[name=name]").val();
  var contact= $("#emergency_form2 input[name=contact]").val();
  var issue=$("#emergency_form2 input[name=issue]").val();
  var appointment_date=$("#emergency_form2 input[name=appointment_date]").val();

  if(name=="")
  {
    flag=0;

  }
  if(contact=="")
  {
    flag=0;
  }
  if(issue=="")
  {
    flag=0;
  }
  if(appointment_date=="")
  {
    flag=0;
  }
  if(flag==1)
  {
    var $form = $('#emergency_form2');
    $.ajax({
      type: "POST",
      dataType:"",
      data: $form.serialize(),
      url:'<?php echo base_url(); ?>index.php/user/one_time_index',
      success:function(response){
        // alert(response);
        // var response_split=response.split('@');
        var dataSplit=response.split('@');
        if(dataSplit[0]=="Success")
        {
            $("#emergency_form2").trigger("reset");
            var x = document.getElementById("snackbar");
            x.className = "show";
            $("#snackbar").html(dataSplit[1]);
            setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
			window.location.reload();  
          
        }
        else
        {
          var x = document.getElementById("snackbar");
            x.className = "show";
            $("#snackbar").html(dataSplit[0]);
            setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
        }
      }
    });
  }
  else
  {
    // alert(flag);
    
  }
  
}
  
  function contract_footer(event)
{
		

  event.preventDefault();

  var flag=1;
  var name=$("#emergency_form2 input[name=name]").val();
  var contact= $("#emergency_form2 input[name=contact]").val();
  var issue=$("#emergency_form2 input[name=issue]").val();
 
  
  if(name=="")   
  {
    flag=0;

  }
  if(contact=="")
  {
    flag=0;
  }
  if(issue=="")
  {
    flag=0;
  }
  
  if(flag==1)
  {
    var $form = $('#emergency_form2');
    $.ajax({
      type: "POST",
      dataType:"",
      data: $form.serialize(),
      url:'<?php echo base_url(); ?>index.php/user/contract_index',
      success:function(response){
        // alert(response);
        // var response_split=response.split('@');
        var dataSplit=response.split('@');
        if(dataSplit[0]=="Success")
        {
            $("#emergency_form2").trigger("reset");
            var x = document.getElementById("snackbar");
            x.className = "show";
            $("#snackbar").html(dataSplit[1]);
            setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
			window.location.reload();  
          
        }
        else
        {
          var x = document.getElementById("snackbar");
            x.className = "show";
            $("#snackbar").html(dataSplit[0]);
            setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
        }
      }
    });
  }
  else
  {
   
  }

  
}
</script>

</body>

</html>
     