<?php
/*
Template Name: Customer Page
*/
get_header();
require("customfunction.php");  
require("chklogin.php");  
require("islogin.php"); 


$apiUrl=$apiBaseUrl."/api/customers/quotes.php?apikey=".$apiKey."&time=".$time;
$postdata=$postdata.'&customers_id='.$customers_id_UL.'';
//echo $apiUrl;
$resp=GetApiData($apiUrl,$postdata);
$responseAPI=json_decode($resp);
//print_r($responseAPI);
$dtQL=$responseAPI->reservationlist;

$apiUrl2=$apiBaseUrl."/api/customers/reservation.php?apikey=".$apiKey."&time=".$time;
$postdata2=$postdata2.'&customers_id='.$customers_id_UL.'';
$resp2=GetApiData($apiUrl2,$postdata2);
$responseAPI2=json_decode($resp2);
$dt=$responseAPI2->reservationlist;
//print_r($responseAPI2);

//$dt=$objCst->getReservationList($customers_id_UL);
?>
<section id="contentPage"> 
    <!--main-content-wrap-->
    <section id="main-content-wrap" class="main-content-wrap">
      <div class="container">
        <div class="middleSecCont">
          <div class="reviewWrap">
            <div class="row">
              <div class="col-sm-3">
                <ul class="reviewSideMenu DivMobileSizeHide">
                  <li class="userDetail"><span class="userPhoto"><img src="<?=$profileimageURL_UL?>" width="36" height="36" alt="<?=$customers_name_UL?>'s Profile"></span> <?=$customers_name_UL?>'s Profile</li>
                  <li><a href="#profileOverview" class="contetnTabsBtn"><span class="leftMenuIcon businesPhoto"></span> Profile Overview</a></li>
                  <li><a href="#myDetails" class="contetnTabsBtn"><span class="leftMenuIcon kudos"></span> My Details</a></li>
                  <li><a href="#changePassword" class="contetnTabsBtn"><span class="leftMenuIcon following"></span> Change Password</a></li>
																		<li><a href="/proccessform.php?actions=logoutcustomer"><span class="leftMenuIcon logouticon"></span> Log out</a></li>
                </ul>
                <ul class="reviewSideMenu MobileSizeshow">
                  <li class="userDetail"><span class="userPhoto"><img src="<?=$profileimageURL_UL?>" width="36" height="36" alt="<?=$customers_name_UL?>'s Profile"></span> <?=$customers_name_UL?>'s Profile Overview <span class="addProfilebtn"><a data-toggle="modal" href="#ProfileImageModal">Add</a></span></li>
                  <li><a href="#myDetails" class="contetnTabsBtn"><span class="leftMenuIcon kudos"></span> My Details</a></li>
                  <li><a href="#changePassword" class="contetnTabsBtn"><span class="leftMenuIcon following"></span> Change Password</a></li>
																		<li><a href="/proccessform.php?actions=logoutcustomer"><span class="leftMenuIcon logouticon"></span> Log out</a></li>
                </ul>
              </div>
              <div class="col-sm-9 DivMobileSizeHide">
                <div class="userInfoFormWrap row">
                  <div class="col-sm-7">
                    <div class="userImgWrap">
                      <div class="userImg"><img src="<?=$profileimageURL_UL?>" width="582" height="205" style="width:582px;height:205px;" alt=""> <? if($profileimage_UL!=''){?><div align="right" style="float:right;"><a data-toggle="modal" href="#ProfileImageModal" class="addImageBtn" >Edit Image</a></div><? }else{?><a data-toggle="modal" href="#ProfileImageModal" class="addImageBtn">Add Image</a><? }?></div>

                    </div>

                  </div>

                  <div class="col-sm-5 DivMobileSizeHide">

                    <div class="FormCostomerPickup">

                      <div class="AirportPickform">

                        <div class="FormTopHeader">

                          <ul class="FormStapes">

                            <li><span>1</span><br>

                              From / To</li>

                            <li><span>2</span><br>

                              Choose a Car</li>

                            <li><span>3</span><br>

                              Payment</li>

                          </ul>

                        </div>

                        <div class="FormBodyCont">

                          <h3>Where can we pick you up?</h3>

                          <div class="FormBoxOne"> <a href="javascript:OpenSearchModel(1)"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/form-location-icons.png" alt="From an Address">

                            <p>From an Address</p>

                            </a> </div>

                          <div class="FormBoxOr">or</div>

                          <div class="FormBoxOne"> <a href="javascript:OpenSearchModel(1)"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/from-airport-icons.png" alt="From an Airport">

                            <p>From an Airport</p>

                            </a> </div>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

              </div>

            </div>

          </div>

          <div class="borderBoxCont">

            <div class="commentsNav">

              <ul class="commentNav DivMobileSizeHide">

                <li><a href="#quotesCont" class="contetnTabsBtn">Quotes Received</a></li>

                <li><a href="#reservationsCont" class="contetnTabsBtn active">Reservations</a></li>

                <li><a href="#reviewsCont" class="contetnTabsBtn">Reviews</a></li>

              </ul>

              <ul class="commentNav MobileSizeshow">

                <li><a href="#quotesCont" class="contetnTabsBtn">Existing Quotes</a></li>

                <li><a href="#bookNewRideCont" class="contetnTabsBtn">Book New Ride</a></li>

                <li><a href="#reviewsCont" class="contetnTabsBtn">Reviews</a></li>

                <li><a href="#reservationsCont" class="contetnTabsBtn active">Reservations</a></li>

              </ul>

            </div>

            <div id="bookNewRideCont" class="showHideCont InnerTabConts">

              <div class="reviewRow">

                <div class="FormCostomerPickup">

                  <div class="AirportPickform">

                    <div class="FormTopHeader">

                      <ul class="FormStapes">

                        <li><span>1</span><br>

                          From / To</li>

                        <li><span>2</span><br>

                          Choose a Car</li>

                        <li><span>3</span><br>

                          Payment</li>

                      </ul>

                    </div>

                    <div class="FormBodyCont">

                      <h3>Where can we pick you up?</h3>

                      <div class="FormBoxOne"> <a href="#"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/form-location-icons.png" alt="From an Address">

                        <p>From an Address</p>

                        </a> </div>

                      <div class="FormBoxOr">or</div>

                      <div class="FormBoxOne"> <a href="#"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/from-airport-icons.png" alt="From an Airport">

                        <p>From an Airport</p>

                        </a> </div>

                    </div>

                  </div>

                </div>

              </div>

            </div>

            <div id="quotesCont" class="showHideCont InnerTabConts">

              <div class="reviewRow">
                <div class="row">
					<div class="col-sm-12">
						<?
						$num_rowsQL = count($dtQL);
						if($num_rowsQL > 0){?>
						 <? foreach ($dtQL as $rowViewQL){
								$reservation_idQL=$rowViewQL->reservation_id;
						  ?>
								<div class="CustomerInfoWrapSec col-padding-5">
								  <div class="FillResevationWrap padd0">
									<div class="row">
									  <div class="col-sm-2 colWidth100">
										<div class="quotesDetailsWr">
										 <h5>Quote Number</h5>
										 <span class="qoutenumber"><?=$reservation_idQL?></span>
										</div>
									  </div>
									  <div class="col-sm-8 colWidth100">
										<div class="ResevationDetailsSec">
										 <ul class="ResevationsListDetails ReListDetails">
										 <li class="ReDateIcons">Pick up, <?=date('l, M d, Y', strtotime($rowViewQL->pickup_date))?></li>
										 <li class="ReTimeIcons">Pick up Time <?=date('h:i A', strtotime($rowViewQL->pickup_time))?>, <? if($rowViewQL->dropoff_time!=''){?> Drop off <?=date('h:i A', strtotime($rowViewQL->dropoff_time))?>,<? }?> Rental Period <?=$rowViewQL->no_of_hrs?> Hours</li>
										 <li class="ReColorIcons">Number of Passengers <?=$rowViewQL->no_of_passengers?></li>
										  <li class="ReGearIcons"><?=getServiceName($rowViewQL->services_id,$rowViewQL->services_id_B)?></li>
										  <li class="ReLocationIcons">Pick up Address: <?=$rowViewQL->fullpaaddress?></li>
											
											<div class="hideContentDiv">
											  <li class="ReLocationIcons">Drop off at: <? if($rowViewQL->fulldaaddress!=''){ echo $rowViewQL->fulldaaddress; }else{ echo 'NA';}?></li>
											  <? 
												$dtRSQL=$rowViewQL->reservationStopA;
												$num_rowsRSQL = count($dtRSQL);
												if($num_rowsRSQL > 0)
												{
													$indxRsQL=0;
													foreach ($dtRSQL as $rowRSQL)
													{
														$indxRsQL=$indxRsQL+1;
													?>
														<li class="ReLocationIcons">Stop <?=$indxRsQL?>: <?=$rowRSQL->locations?> <?=$rowRSQL->address?> <?=$rowRSQL->city?>, <?=$rowRSQL->state?>, <?=$rowRSQL->zip_code?></li>
													<?			
													}
												}?>
											</div>
											<div class="ViewMoreSec"><a class="ViewMoreExpand viewAllExpand" href="#">View More<br>
											  <span class="moreServiceIcon">moreService</span></a></div>
										  </ul>
										</div>
									  </div>
									  <div class="col-sm-2 colWidth100">
										<div class="SecBookNow">
									   <a class="Rebuttonwr ColorGreen" href="/vehicle-selection/?guid=<?=$rowViewQL->v_code?>" target="_blank">See Vehicles</a>
									   <p>(10% off on all vehicles)</p>
									   </div>
									  </div>
									</div>
								  </div>
								</div>
					   <? }
					   }?>         
					</div>
				</div>
              </div>
            </div>

            <div id="reservationsCont" class="showHideCont InnerTabConts active">
              <div class="reviewRow">
                <div class="row">
                  <div class="col-sm-12">
				  <?
				$num_rows = count($dt);
				if($num_rows > 0){?>
				<? foreach ($dt as $rowView ){
			  		$reservation_id=$rowView->reservation_id;					
					$idp_copy=$rowView->idp_copy;	
					$card_copy=$rowView->card_copy;	
					$quote_total=$rowView->quote_total;														
					$reservations_final_id=$rowView->reservations_final_id;
					$rate_fleets_id=$rowView->rate_fleets_id;
					if($reservations_final_id!=""){
						$fontColor="green";
					}else{
						$fontColor="";
					}
					$fleetidselect=$rowView->fleetidselect;
					$fleetimage=$rowView->fleetimage;
					$fleetname=$rowView->fleetname;
					$fleetpass=$rowView->fleetpass;
			  ?>
                    <div class="CustomerInfoWrapSec col-padding-5">
                      <div class="FillResevationWrap padd0">
                        <div class="row">
                          <div class="col-sm-2 colWidth100">
                            <div class="ResevationImageSec"><img src="<?=$fleetimage?>" alt="<?=$fleetname?>" title="<?=$fleetname?>" border="0" style="width:220px; height:164px;"/></div>
                          </div>
                          <div class="col-sm-8 colWidth100">
                            <div class="ResevationDetailsSec">
                              <h5>Ride #: <?=$rowView->reservation_id?></h5>
                              <ul class="ResevationsListDetails ReListDetails">
                               <li class="ReDateIcons">Pick up, <?=date('l, M d, Y', strtotime($rowView->pickup_date))?></li>
                             <li class="ReTimeIcons">Pick up Time <?=date('h:i A', strtotime($rowView->pickup_time))?>,<? if($rowView->dropoff_time!=''){?> Drop off <?=date('h:i A', strtotime($rowView->dropoff_time))?>,<? }?> Rental Period <?=$rowView->no_of_hrs?> Hours</li>
                             <li class="ReColorIcons">Number of Passengers <?=$rowView->no_of_passengers?></li>
                              <li class="ReGearIcons"><?=getServiceName($rowView->services_id,$rowView->services_id_B)?></li>
                              <li class="ReLocationIcons">Pick up Address: <?=$rowView->fullpaaddress?></li>
                              </ul>
                              <div class="hideContentDiv">
                                <ul class="ResevationsListDetails">
                                  <li class="ReLocationIcons">Drop off at:  <? if($rowView->fulldaaddress!=''){ echo $rowView->fulldaaddress; }else{ echo 'NA';}?></li>
								 <? 
									$dtRS=$rowView->reservationStopA;
									$num_rowsRS = count($dtRS);
									if($num_rowsRS > 0)
									{
										$indxRs=0;
										foreach ($dtRS as $rowRS)
										{
											$indxRs=$indxRs+1;
										?>
			                                <li class="ReLocationIcons">Stop <?=$indxRs?>: <?=$rowRS->locations?> <?=$rowRS->address?> <?=$rowRS->city?>, <?=$rowRS->state?>, <?=$rowRS->zip_code?></li>
										<?			
										}
									}?>
                                </ul>
                              </div>
                              <div class="ViewMoreSec"><a class="ViewMoreExpand viewAllExpand" href="#">View More <br>
                                  <span class="moreServiceIcon">moreService</span></a></a></div>
                            </div>
                          </div>
                          <div class="col-sm-2 colWidth100">
                            <div class="SecBookNow">
                              <p><span class="prices">$<?=number_format($quote_total,2)?></span><br>
                                Fees Included</p>
                            </div>
                          </div>
                        </div>
                        <div class="RebuttonSecWrap"> 
						<? if($card_copy!="" && $idp_copy!=""){}else{?>
				 			<? if($rowView->ismyaccountlink==1){?>
								 <a class="Rebuttonwr ColorGreen" href="/contract/?guid=<?=$rowView->v_code?>&rfid=<?=$rate_fleets_id?>"><font style=" white-space: nowrap;">Verify Card & Sign</font></a> 
				 			<? }elseif($rowView->ismyaccountlink==2){?>
								 <a class="Rebuttonwr ColorGreen" href="/contract/?guid=<?=$rowView->v_code?>&rfid=<?=$rate_fleets_id?>"><font style=" white-space: nowrap;">Sign Reservation</font></a> 
				 			<? }?>
				 		<? }?> <a class="Rebuttonwr ColorGreen" href="/pdf_contract_customer.php?guid=<?=$rowView->v_code?>&rfid=<?=$rate_fleets_id?>&auth=" target="_blank"><font color="" style=" white-space: nowrap;">Print Contract</font></a>  <a class="Rebuttonwr ColorGreen" href="/contracttermandconditions?rfid=<?=$rate_fleets_id?>" target="_blank"><font style=" white-space: nowrap;">Print Terms And Conditions</font></a>
				 
						</div>
                      </div>
                    </div>
				<? }				
				}?>	
                  </div>
                </div>

              </div>

            </div>

            <div id="reviewsCont" class="showHideCont">

              <div class="reviewRow ComingSoon">

                <h1>Coming Soon</h1>

              </div>

            </div>

            <div id="profileOverview" class="showHideCont"></div>

            <div id="myDetails" class="showHideCont">

              <div class="reviewRow">

               <div class="MyDetailsHeadingSec noBG">

                <h2>Edit Your Name, Email</h2>

                <p>In this section you can change the name, email address, mobile phone, zip with your account</p>

                </div>

                <form>

                <div class="reviewRowMyDetails CustomerInfoWrapSec ">
                  <div class="CustomerInfoMyDetails ">
                    <div class="col-padding-5">
                      <div class="row">
					  
					  <!--<div class="col-sm-3 col-xs-6">
                          <div class="form-group">
                            <select id="" class="form-control selectChange">
                              <option value="4" <? if($accounttype_ULD==4){?> selected="selected"<? }?>>Meeting Events</option>
                              <option value="1" <? if($accounttype_ULD==1){?> selected="selected"<? }?>>Private</option>
                              <option value="2" <? if($accounttype_ULD==2){?> selected="selected"<? }?>>Corporate</option>
                              <option value="3" <? if($accounttype_ULD==3){?> selected="selected"<? }?>>Travel Agent</option>
                            </select>
                          </div>
                        </div>-->
					  <? if($accounttype_ULD==1){?>					  
                        <div class="col-sm-3 col-xs-6" style="display:none">
                          <div class="form-group">
                            <select id="" class="form-control selectChange" disabled="disabled">
                              <option value="1" <? if($accounttype_ULD==1){?> selected="selected"<? }?>>Private</option>                            </select>
                          </div>
                        </div>
                        <div class="privateSection">
                          <div class="reviewRowMyDetails">
                            <div class="CustomerInfoWrapSec CustomerInfoMyDetails">
                              <div class="CustomerInfoWrap  col-padding-5">
                                <div class="row">
                                  <div class="col-sm-6 col-xs-6">
                                    <div class="form-group">
                                      <input type="text" class="form-control" placeholder="First Name" id="cstfirstname" name="cstfirstname" value="<?=$customers_name_UL?>">
                                    </div>
                                  </div>
                                  <div class="col-sm-6 col-xs-6">
                                    <div class="form-group">
                                      <input type="text" class="form-control" placeholder="Last Name" id="cstlastname" name="cstlastname" value="<?=$customers_name_l_UL?>">
                                    </div>
                                  </div>
                                  <div class="col-sm-6 col-xs-12">
                                    <div class="form-group">
                                      <input type="text" class="form-control" placeholder="Email Address" id="cstemail" name="cstemail" value="<?=$customers_email_UL?>">
                                    </div>
                                  </div>
                                  <div class="col-sm-4 col-xs-7">
                                    <div class="form-group">
                                      <input type="text" class="form-control" maxlength="10" size="10" placeholder="Phone Number" value="<?=$customers_mobile_UL?>" onkeypress="return isNumberKey(event);" id="cstphone" name="cstphone">
                                    </div>
                                  </div>
                                  <div class="col-sm-2 col-xs-5">
                                    <div class="form-group">
                                      <input type="text" class="form-control" maxlength="5" size="5" placeholder="Zip Code" value="<?=$customers_zip_UL?>" id="cstzip" name="cstzip">
                                    </div>
                                  </div>
                                  <div class="col-sm-6 col-xs-6"></div>
									  <div class="col-sm-12 col-xs-12">
										<div class="InnecheckBoxWrap">
										  <div class="checkbox ">
											<div class="checkboxField"><span class="checkbox checkboxBtnWrp">
											  <input id="cstisdiscount" name="cstisdiscount" type="checkbox" <? if($is_discount_UL==1){?> checked="checked"<? }?>/>
											  <label></label>
											  </span> Email me discount and special offers</div>
										  </div>
										</div>
									  </div>
                                </div>								
								<div class="btnRow text-center">
								   <input type="button" class="btnchangePassword" value="Update Profile" onclick="UpdateCustomerDetails();">
									  <br /><span id="loadingUpdateCustomerDetails"></span>
								</div>								
                              </div>
                            </div>
                          </div>
                        </div>
					  <? }elseif($accounttype_ULD==4){?>		
					  	 <input type="hidden" id="phonecountry" name="phonecountry" value="<?=$phonecountry_UL?>">			  
                       	 <input type="hidden" id="accounttype" name="accounttype" value="<?=$accounttype_UL?>">						 
                        <div class="privateSection">
                          <div class="reviewRowMyDetails">
                            <div class="CustomerInfoWrapSec CustomerInfoMyDetails">
                              <div class="CustomerInfoWrap  col-padding-5">
                                <div class="row">
                                  <div class="col-sm-4 col-xs-6">
                                    <div class="form-group">
                                      <input type="text" class="form-control" placeholder="First Name" id="cstfirstname" name="cstfirstname" value="<?=$customers_name_UL?>">
                                    </div>
                                  </div>
                                  <div class="col-sm-4 col-xs-6">
                                    <div class="form-group">
                                      <input type="text" class="form-control" placeholder="Last Name" id="cstlastname" name="cstlastname" value="<?=$customers_name_l_UL?>">
                                    </div>
                                  </div>
                                  <div class="col-sm-4 col-xs-6">
                                    <div class="form-group">
                                      <input type="text" class="form-control" placeholder="Email Address" id="cstemail" name="cstemail" value="<?=$customers_email_UL?>">
                                    </div>
                                  </div>
                                  <div class="col-sm-3 col-xs-6">
                                    <div class="form-group">
                                      <input type="text" class="form-control" maxlength="10" size="10" placeholder="Phone Number" value="<?=$customers_mobile_UL?>" onkeypress="return isNumberKey(event);" id="cstphone" name="cstphone">
                                    </div>
                                  </div>
                                  <div class="col-sm-3 col-xs-4">
                                    <div class="form-group">
                                      <select class="form-control" id="serviceid" name="serviceid">
										<option selected="selected" value="">Type of Event</option>
										<?=fnGetService($serviceid_UL)?>
									</select>
                                    </div>
                                  </div>
                                  <div class="col-sm-3 col-xs-4">
                                    <div class="form-group">
                                      <select class="form-control" id="noofpass" name="noofpass">
										<option selected="selected" value="">No. of People</option>
										<?= fnDdlNumber($noofpass_UL,20)?>
										</select>
                                    </div>
                                  </div>
                                  <div class="col-sm-3 col-xs-4">
                                    <div class="form-group">
                                      <select class="form-control" id="noofvehicles" name="noofvehicles">
										<option selected="selected" value="">No. of Vehicles Needed</option>
										<?= fnDdlNumber($noofvehicles_UL,20)?>
									</select>
                                    </div>
                                  </div>
                                  <div class="col-sm-6 col-xs-6"></div>
									  <div class="col-sm-12 col-xs-12">
										<div class="InnecheckBoxWrap">
										  <div class="checkbox ">
											<div class="checkboxField"><span class="checkbox checkboxBtnWrp">
											  <input id="cstisdiscount" name="cstisdiscount" type="checkbox" <? if($is_discount_UL==1){?> checked="checked"<? }?>/>
											  <label></label>
											  </span> Email me discount and special offers</div>
										  </div>
										</div>
									  </div>
                                </div>								
								<div class="btnRow text-center">
								   <input type="button" class="btnchangePassword" value="Update Profile" onclick="UpdateCustomerDetails4();">
									  <br /><span id="loadingUpdateCustomerDetails"></span>
								</div>								
                              </div>
                            </div>
                          </div>
                        </div>
					<? }elseif($accounttype_ULD==2){?>	
					  	 <input type="hidden" id="phonecountry" name="phonecountry" value="<?=$phonecountry_UL?>">			  
                       	 <input type="hidden" id="accounttype" name="accounttype" value="<?=$accounttype_UL?>">		
                        <div class="col-sm-3 col-xs-6">
                          <div class="form-group">
                            <input type="text" class="form-control" placeholder="Company Name" id="businessname" name="businessname" value="<?=$businessname_UL?>">
                          </div>
                        </div>
                        <div class="col-sm-2 col-xs-6 corporateDiv">
                          <div class="form-group">
                            <select id="typeofbusiness" name="typeofbusiness" class="form-control">
                              <option value="" <? if($typeofbusiness_UL==''){?> selected="selected"<? }?>>Type of Business</option>
							  <option value="Transport" <? if($typeofbusiness_UL=='Transport'){?> selected="selected"<? }?>>Transport</option>
							  <option value="Corporate" <? if($typeofbusiness_UL=='Corporate'){?> selected="selected"<? }?>>Corporate</option>
                            </select>
                          </div>
                        </div>

                        <div class="col-sm-3 col-xs-6 corporateDiv">
                          <div class="form-group">
                            <select id="department" name="department" class="form-control">
                              <option value="" <? if($department_UL==''){?> selected="selected"<? }?>>Department</option>
                              <option value="Transportation" <? if($department_UL=='Transportation'){?> selected="selected"<? }?>>Transportation</option>
                              <option value="Human Resources" <? if($department_UL=='Human Resources'){?> selected="selected"<? }?>>Human Resources</option>
                              <option value="Other" <? if($department_UL=='Other'){?> selected="selected"<? }?>>Other</option> 
                            </select>
                          </div>
                        </div>

                        <div class="col-sm-2 col-xs-6">
                          <div class="form-group">
                            <select id="noofpeopleauth" name="noofpeopleauth" class="form-control">
                              <option value="">No. of People Auth. to Book</option>
                              <option value="01" <? if($noofpeopleauth_UL=='01'){?> selected="selected"<? }?>>01</option>
                              <option value="02" <? if($noofpeopleauth_UL=='02'){?> selected="selected"<? }?>>02</option>
                              <option value="03" <? if($noofpeopleauth_UL=='03'){?> selected="selected"<? }?>>03</option>
                              <option value="04" <? if($noofpeopleauth_UL=='04'){?> selected="selected"<? }?>>04</option>
                              <option value="05" <? if($noofpeopleauth_UL=='05'){?> selected="selected"<? }?>>05</option>
                              <option value="06" <? if($noofpeopleauth_UL=='06'){?> selected="selected"<? }?>>06</option>
                              <option value="07" <? if($noofpeopleauth_UL=='07'){?> selected="selected"<? }?>>07</option>
                              <option value="08" <? if($noofpeopleauth_UL=='08'){?> selected="selected"<? }?>>08</option>
                              <option value="09" <? if($noofpeopleauth_UL=='09'){?> selected="selected"<? }?>>09</option>
                              <option value="10" <? if($noofpeopleauth_UL=='10'){?> selected="selected"<? }?>>10</option>
                            </select>
                          </div>
                        </div>
						<div class="col-sm-2 col-xs-6">
                          <div class="form-group">
                            <select id="hearaboutus" name="hearaboutus" class="form-control">
                              <option value="" <? if($hearaboutus_UL==''){?> selected="selected"<? }?>>How'd they hear about us</option>
                              <option value="Google" <? if($hearaboutus_UL=='Google'){?> selected="selected"<? }?>>Google</option>
                              <option value="Other Online Search" <? if($hearaboutus_UL=='Other Online Search'){?> selected="selected"<? }?>>Other Online Search</option>
                              <option value="Referral" <? if($hearaboutus_UL=='Referral'){?> selected="selected"<? }?>>Referral</option>
                            </select>
                          </div>
                        </div>
                        <!--<div class="col-sm-2 col-xs-6 hideDiv travelAgent">

                          <div class="form-group">

                            <select id="" class="form-control">

                              <option value="">Est. yearly trips</option>

                              <option value="">01</option>

                              <option value="">02</option>

                              <option value="">03</option>

                            </select>

                          </div>

                        </div>-->

                       <!-- <div class="col-sm-2 col-xs-6 hideDiv travelAgent">

                          <div class="form-group">

                            <select id="" class="form-control">

                              <option value="">Annual $ Volume</option>

                              <option value="">01</option>

                              <option value="">02</option>

                              <option value="">03</option>

                            </select>

                          </div>

                        </div>-->

                        <!--<div class="col-sm-2 col-xs-6 hideDiv travelAgent">

                          <div class="form-group">

                            <select id="" class="form-control">

                              <option value="">Annual $ Volume</option>

                              <option value="">01</option>

                              <option value="">02</option>

                              <option value="">03</option>

                            </select>

                          </div>

                        </div>-->

                        <div class="col-sm-4 col-xs-12">
                          <div class="form-group">
                            <input type="text" class="form-control locationIcon" placeholder="Primary Business Addresss" id="Billing_Address" name="Billing_Address" value="<?=$Billing_Address_UL?>">
                          </div>
                        </div>
                        <div class="col-sm-3 col-xs-4">
                          <div class="form-group">
                            <input type="text" class="form-control" placeholder="City" id="Billing_City" name="Billing_City" value="<?=$Billing_City_UL?>">
                          </div>
                        </div>
                        <div class="col-sm-3 col-xs-4">
                          <div class="form-group">
                            <input type="text" class="form-control" placeholder="State" id="Billing_State" name="Billing_State" value="<?=$Billing_State_UL?>">
                          </div>
                        </div>
                        <div class="col-sm-2 col-xs-4">
                          <div class="form-group">
                            <input type="text" class="form-control" placeholder="ZipCode" id="postal_code" name="postal_code" value="<?=$postal_code_UL?>">
                          </div>
                        </div>
						
                        <div class="col-sm-3 col-xs-12">
                          <div class="form-group">
							<select class="form-control" id="jobtitle" name="jobtitle">
								<option value="" <? if($jobtitle_UL==''){?> selected="selected"<? }?>>Contact Person's Job Title</option>
								<option value="CEO" <? if($jobtitle_UL=='CEO'){?> selected="selected"<? }?>>CEO</option>
								<option value="Owner" <? if($jobtitle_UL=='Owner'){?> selected="selected"<? }?>>Owner</option>
								<option value="Manager" <? if($jobtitle_UL=='Manager'){?> selected="selected"<? }?>>Manager</option>
								<option value="In-charge of Transportation" <? if($jobtitle_UL=='In-charge of Transportation'){?> selected="selected"<? }?>>In-charge of Transportation</option>
\							</select>
                           </div>
                        </div>

                        <div class="col-sm-2 col-xs-6">
                          <div class="form-group">
                            <input type="text" class="form-control" placeholder="First Name" id="cstfirstname" name="cstfirstname" value="<?=$customers_name_UL?>">
                          </div>
                        </div>

                        <div class="col-sm-2 col-xs-6">
                          <div class="form-group">
                            <input type="text" class="form-control" placeholder="Last Name" id="cstlastname" name="cstlastname" value="<?=$customers_name_l_UL?>">
                          </div>
                        </div>

                        <div class="col-sm-3 col-xs-6">
                          <div class="form-group">
                            <input type="text" class="form-control" placeholder="Email Address" id="cstemail" name="cstemail" value="<?=$customers_email_UL?>">
                          </div>
                        </div>

                        <div class="col-sm-2 col-xs-6">
                          <div class="form-group">
                            <div class="lableLeftFeildsBs width50">
                              <label><img src="<?php echo get_template_directory_uri(); ?>/assets/images/flag-icon.jpg" alt="" width="16" height="11"> <?=$phonecountry_UL?></label>
                              <input type="text" class="form-control" maxlength="10" size="10" placeholder="Phone Number" value="<?=$customers_mobile_UL?>" onkeypress="return isNumberKey(event);" id="cstphone" name="cstphone">
                            </div>

                          </div>

                        </div>

                        <div class="col-sm-4 col-xs-12">
                          <div class="form-group">
                            <div class="textareaFieldSec">
                              <label>Notes for Us</label>
                              <textarea type="text" class="form-control txtareascroll" placeholder="" id="notesforus" name="notesforus"><?=$notesforus_UL?></textarea>
                            </div>
                          </div>
                        </div>

                        <div class="col-sm-4 col-xs-12">
                          <div class="form-group">
                            <div class="textareaFieldSec">
                              <label>Notes for Drivers</label>
                              <textarea type="text" class="form-control txtareascroll" placeholder="" id="notesfordrivers" name="notesfordrivers"><?=$notesfordrivers_UL?></textarea>
                            </div>
                          </div>
                        </div>

                        <div class="col-sm-4 col-xs-12">
                          <div class="form-group">
                            <div class="textareaFieldSec">
                              <label>Trip Notes Customer Preferences</label>
                              <textarea type="text" class="form-control txtareascroll" placeholder="" id="notesforcustomer" name="notesforcustomer"><?=$notesforcustomer_UL?></textarea>
                            </div>
                          </div>
                        </div>
					<? }?>
                      </div>

                    </div>

                  </div>

                </div>

			<? if($accounttype_ULD==2){?>	
                <div class="reviewRowMyDetails assignAccUsers">

                  <div class="MyDetailsHeadingSec">

                    <h2>ASSIGN ACCOUNT USERS</h2>

                  </div>

                  <div class="CustomerInfoWrapSec CustomerInfoMyDetails">

                    <div class="CustomerInfoWrap  col-padding-5">

                      <div class="row">

                        <div class="col-sm-2 col-xs-6">

                          <div class="form-group">

                            <input type="text" class="form-control" placeholder="First Name">

                          </div>

                        </div>

                        <div class="col-sm-2 col-xs-6">

                          <div class="form-group">

                            <input type="text" class="form-control" placeholder="Last Name">

                          </div>

                        </div>

                        <div class="col-sm-2 col-xs-6">

                          <div class="form-group">

                            <input type="text" class="form-control" placeholder="Email">

                          </div>

                        </div>

                        <div class="col-sm-2 col-xs-6">

                          <div class="form-group">

                            <select id="" class="form-control">

                              <option value="">Access to</option>

                              <option value="">01</option>

                              <option value="">02</option>

                              <option value="">03</option>

                            </select>

                          </div>

                        </div>

                        <div class="col-sm-2 col-xs-6">

                          <div class="form-group">
                              <select id="webaccess" name="webaccess" class="form-control">
								  <option value="" <? if($webaccess_UL==''){?> selected="selected"<? }?> >Web Access</option>
								  <option value="Allowed" <? if($webaccess_UL=='Allowed'){?> selected="selected"<? }?> >Allowed</option>
								  <option value="Not-allowed" <? if($webaccess_UL=='Not-allowed'){?> selected="selected"<? }?>>Not-allowed</option>
                              </select>
                          </div>

                        </div>

                        <div class="btnRow text-center">

                          <input class="addMoreUser" value="ADD MORE USERS" type="submit">

                          <br>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

                <div class="reviewRowMyDetails">

                  <div class="CustomerInfoWrapSec CustomerInfoMyDetails">

                    <div class="CustomerInfoWrap  col-padding-5">

                      <div class="row">

                        <div class="col-sm-4 col-xs-12">

                          <div class="form-group">

                            <div class="lableLeftFeildsBs width150">
                              <label>Cust. Account Type</label>
                              <select class="form-control" id="custaccounttype" name="custaccounttype">
							  <option value="" <? if($custaccounttype_UL==''){?> selected="selected"<? }?> >--Select--</option>
                                <option value="Admin" <? if($custaccounttype_UL=='Admin'){?> selected="selected"<? }?> >Admin</option>
                                <option value="Non-Admin" <? if($custaccounttype_UL=='Non-Admin'){?> selected="selected"<? }?> >Non-Admin</option>
                              </select>
                            </div>
                          </div>
                        </div>

                        <div class="col-sm-2 col-xs-12">
                          <div class="form-group">
                            <div class="lableLeftFeildsBs width60">
                              <label>Priorty</label>
                              <select id="cstpriority" name="cstpriority" class="form-control">
							  <option value="" <? if($cstpriority_UL==''){?> selected="selected"<? }?> >--Select--</option>
							  <option value="VVIP" <? if($cstpriority_UL=='VVIP'){?> selected="selected"<? }?> >VVIP</option>
							  <option value="VIP" <? if($cstpriority_UL=='VIP'){?> selected="selected"<? }?> >VIP</option>
							  <option value="Regular" <? if($cstpriority_UL=='Regular'){?> selected="selected"<? }?> >Regular</option>
                              </select>
                            </div>
                          </div>
                        </div>

                        <div class="col-sm-2 col-xs-12">
                          <div class="form-group">
                            <div class="lableLeftFeildsBs width60">
                              <label>Status</label>
                              <select id="status" name="status" class="form-control" disabled="disabled">
								  <option value="1" <? if($status_UL=='1'){?> selected="selected"<? }?> >Active</option>
								  <option value="0" <? if($status_UL=='0'){?> selected="selected"<? }?>>De-Active</option>
                              </select>
                            </div>
                          </div>
                        </div>

                        <div class="col-sm-4 col-xs-12">
                          <div class="form-group">
                            <div class="lableLeftFeildsBs width200">
                              <label>Main Account Web Access</label>
                              <select id="mainactwebaccess" name="mainactwebaccess" class="form-control">
								  <option value="" <? if($mainactwebaccess_UL==''){?> selected="selected"<? }?> >--Select--</option>
								  <option value="Whole Account" <? if($mainactwebaccess_UL=='Whole Account'){?> selected="selected"<? }?> >Whole Account</option>
								  <option value="Self" <? if($mainactwebaccess_UL=='Self'){?> selected="selected"<? }?>>Self</option>
                              </select>
                            </div>
                          </div>
                        </div>

                        <div class="col-sm-4 col-xs-12">
                          <div class="form-group">
                            <div class="lableLeftFeildsBs width150">
                              <label>Rental Agreement</label>
                              <select id="rentalagreement" name="rentalagreement" class="form-control">
    	                          <option value="">--Select--</option>
								  <option value="01" <? if($rentalagreement_UL=='01'){?> selected="selected"<? }?>>01</option>
								  <option value="02" <? if($rentalagreement_UL=='02'){?> selected="selected"<? }?>>02</option>
								  <option value="03" <? if($rentalagreement_UL=='03'){?> selected="selected"<? }?>>03</option>
								  <option value="04" <? if($rentalagreement_UL=='04'){?> selected="selected"<? }?>>04</option>
								  <option value="05" <? if($rentalagreement_UL=='05'){?> selected="selected"<? }?>>05</option>
								  <option value="06" <? if($rentalagreement_UL=='06'){?> selected="selected"<? }?>>06</option>
								  <option value="07" <? if($rentalagreement_UL=='07'){?> selected="selected"<? }?>>07</option>
								  <option value="08" <? if($rentalagreement_UL=='08'){?> selected="selected"<? }?>>08</option>
								  <option value="09" <? if($rentalagreement_UL=='09'){?> selected="selected"<? }?>>09</option>
								  <option value="10" <? if($rentalagreement_UL=='10'){?> selected="selected"<? }?>>10</option>
                              </select>
                            </div>
                          </div>
                        </div>
                        <div class="col-sm-4 col-xs-12">
                          <div class="form-group">
                            <div class="lableLeftFeildsBs width150">
                              <label>Payment Method</label>
                              <select id="paymentmethod" name="paymentmethod" class="form-control">
								  <option value="" <? if($paymentmethod_UL==''){?> selected="selected"<? }?>>--Select--</option>
								  <option value="Credit Card" <? if($paymentmethod_UL=='Credit Card'){?> selected="selected"<? }?>>Credit Card</option>
								  <option value="Cheque" <? if($paymentmethod_UL=='Cheque'){?> selected="selected"<? }?>>Cheque</option>
                              </select>
                            </div>
                          </div>
                        </div>

                        <div class="col-sm-4 col-xs-12">
                          <div class="form-group">
                            <div class="lableLeftFeildsBs width150">
                              <label>Payment Terms</label>
							  <select id="paymentterms" name="paymentterms" class="form-control">
								  <option value="" <? if($paymentterms_UL==''){?> selected="selected"<? }?>>--Select--</option>								  								  <option value="On Checkout" <? if($paymentterms_UL=='On Checkout'){?> selected="selected"<? }?>>On Checkout</option>
								  <option value="7 Days" <? if($paymentterms_UL=='7 Days'){?> selected="selected"<? }?>>7 Days</option>	
								  <option value="14 Days" <? if($paymentterms_UL=='14 Days'){?> selected="selected"<? }?>>14 Days</option>					  								  <option value="30 Days" <? if($paymentterms_UL=='30 Days'){?> selected="selected"<? }?>>30 Days</option>
                              </select>
                            </div>
                          </div>
                        </div>
                      </div>

                    </div>

                  </div>

                </div>

                <div class="reviewRowMyDetails financialinfo">

                  <div class="MyDetailsHeadingSec">

                    <h2>FINANCIAL INFORMATION</h2>

                  </div>

                  <div class="CustomerInfoWrapSec CustomerInfoMyDetails">

                    <div class="CustomerInfoWrap  col-padding-5">

                      <div class="row">

                        <div class="col-sm-4 col-xs-12">

                          <div class="form-group">

                            <div class="lableLeftFeildsBs width200">

                              <label>Card Holder's First Name</label>

                              <input type="text" class="form-control" placeholder="">

                            </div>

                          </div>

                        </div>

                        <div class="col-sm-4 col-xs-12">

                          <div class="form-group">

                            <div class="lableLeftFeildsBs width200">

                              <label>Card Holder's Last Name</label>

                              <input type="text" class="form-control" placeholder="">

                            </div>

                          </div>

                        </div>

                        <div class="col-sm-4 col-xs-12">

                          <div class="form-group">

                            <div class="lableLeftFeildsBs width100">

                              <label>Job Title</label>

                              <select id="" class="form-control">

                                <option value="">01</option>

                                <option value="">02</option>

                                <option value="">03</option>

                              </select>

                            </div>

                          </div>

                        </div>

                        <div class="col-sm-4 col-xs-12">

                          <div class="form-group">

                            <input type="text" class="form-control" placeholder="Credit Card Number">

                          </div>

                        </div>

                        <div class="col-sm-3 col-xs-6">

                          <div class="form-group">

                            <select id="" class="form-control">

                              <option value="">Expiration Month</option>

                              <option value="">01</option>

                              <option value="">02</option>

                              <option value="">03</option>

                            </select>

                          </div>

                        </div>

                        <div class="col-sm-3 col-xs-6">

                          <div class="form-group">

                            <select id="" class="form-control">

                              <option value="">Expiration Year</option>

                              <option value="">01</option>

                              <option value="">02</option>

                              <option value="">03</option>

                            </select>

                          </div>

                        </div>

                        <div class="col-sm-2 col-xs-12">

                          <div class="form-group">

                            <input type="text" class="form-control" maxlength="5" size="5" placeholder="Security Code">

                          </div>

                        </div>

                        <div class="col-sm-4 col-xs-12">

                          <div class="form-group">

                            <select id="" class="form-control">

                              <option value="">Stored Credit Cards</option>

                              <option value="">01</option>

                              <option value="">02</option>

                              <option value="">03</option>

                            </select>

                          </div>

                        </div>

                        <div class="col-sm-3 col-xs-12">

                          <div class="AddNewCreditCard">

                            <input class="addbtncrd" value="ADD NEW CREDIT CARD" type="submit">

                          </div>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>
				<!--
                <div class="reviewRowMyDetails">
                  <div class="MyDetailsHeadingSec">
                    <h2>Signed Card Authorizations</h2>
                  </div>
                  <div class="signedCard text-center">
                    <p>****-*****-****-1900 VISA John Gill <a href="#">View PDF</a><br>
                      ****-*****-****-8590 MASTERCARD Jay P <a href="#">View PDF</a></p>
                  </div>
                </div>
				-->
				<div class="btnRow text-center">
                  <input class="commeninfoBtn" value="SAVE INFO" type="button" onclick="UpdateCustomerDetailsCorporate();"> <span id="loadingUpdateCustomerDetails"></span>
                  <br>
                </div>
			<? }?>
            	</form>
              </div>
            </div>
			
            <div id="changePassword" class="showHideCont">
              <div class="reviewRow">
                <div class="reviewRowMyDetails">
                  <div class="MyDetailsHeadingSec">
                    <h2>Change Password</h2>
                  </div>
                  <div class="CustomerInfoWrapSec CustomerInfoMyDetails">
                    <div class="CustomerInfoWrap  col-padding-5">
                      <form>
                        <div class="row">
                          <div class="col-sm-6 col-xs-6">
                            <div class="form-group">
                              <input type="password" class="form-control" placeholder="Password" id="cp_password" name="cp_password">
                            </div>
                          </div>
                          <div class="col-sm-6 col-xs-6">
                            <div class="form-group">
                              <input type="password" class="form-control" placeholder="Confirm Code" id="cp_password2" name="cp_password2">
                            </div>
                          </div>
                        </div>
                        <div class="btnRow text-center">
                          <input type="button" class="btnchangePassword" value="Change Password" onclick="ChangePassword();">
						  <br /><span id="loadingcp"></span>
                        </div>
                      </form>
                    </div>
                  </div>
                </div>
              </div>
            </div>
			
          </div>
        </div>
      </div>
    </section>
    <!--/main-content-wrap --> 
  </section> 
<!--/.contentPart--> 
<script language="javascript" type="text/javascript">
function ChangePassword(){
	var IsValid = true;
	var cp_password = $('#cp_password').val();
	if(cp_password == ''){
		$('#cp_password').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cp_password').css("border", "1px solid #a1a1a1");
	}
	var cp_password2 = $('#cp_password2').val();
	if(cp_password2 == ''){
		$('#cp_password2').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cp_password2').css("border", "1px solid #a1a1a1");
	}
	
	if(cp_password != cp_password2){
		alert('Password not match!');
		$('#cp_password').val('');
		$('#cp_password2').val('');
		IsValid = false;
	}
	if(IsValid==true){
		$('#loadingcp').fadeIn('slow');
		$("#loadingcp").html('<img src="/ajax-loading.gif" alt="loading" title="loading">');
		$.ajax({
			method: 'POST',
			url: '/proccessform.php?actions=changepasswordcustomer',		
			data: {cstpassword: cp_password, customersid: '<?=$customers_id_UL?>'},	                
			headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
		}).success(function(r){
			$('#cp_password').val('');
			$('#cp_password2').val('');		
			$("#loadingcp").html(r);	
			$('#loadingcp').delay(5000).fadeOut('slow');
		});
	}
	return IsValid;
}
function UpdateCustomerDetails(){
	var IsValid = true;
	var cstemail = $('#cstemail').val();
	var cstfirstname = $('#cstfirstname').val();
	if(cstfirstname == ''){
		$('#cstfirstname').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstfirstname').css("border", "1px solid #a1a1a1");
	}
	var cstlastname = $('#cstlastname').val();
	if(cstlastname == ''){
		$('#cstlastname').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstlastname').css("border", "1px solid #a1a1a1");
	}
	var cstphone = $('#cstphone').val();
	if(cstphone == ''){
		$('#cstphone').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstphone').css("border", "1px solid #a1a1a1");
	}
	var cstzip = $('#cstzip').val();
	if(cstzip == ''){
		$('#cstzip').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstzip').css("border", "1px solid #a1a1a1");
	}
	if(cstemail == ''){
		$('#cstemail').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstemail').css("border", "1px solid #a1a1a1");
		var eml= new  String(cstemail);
		var val1=eml.indexOf("@");
		var val2=eml.indexOf(".");
		if((val1==-1) || (val2==-1)){
			$('#cstemail').css("border", "2px solid #FF0000");
			IsValid = false;
		}
	}
	var cstisdiscount = $('#cstisdiscount:checked').val()?1:0;

	if(IsValid==true){
		$('#loadingUpdateCustomerDetails').fadeIn('slow');
		$("#loadingUpdateCustomerDetails").html('<img src="/ajax-loading.gif" alt="loading" title="loading">');
		$.ajax({
			method: 'POST',
			url: '/proccessform.php?actions=updateprofilecustomer',		
			data: {cstfirstname: cstfirstname,cstlastname: cstlastname,cstemail: cstemail,cstphone: cstphone,cstzip: cstzip,cstisdiscount: cstisdiscount, customersid: '<?=$customers_id_UL?>'},	                
			headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
		}).success(function(r){	
			$("#loadingUpdateCustomerDetails").html(r);	
			$('#loadingUpdateCustomerDetails').delay(5000).fadeOut('slow');
		});
	}
	return IsValid;
}
function UpdateCustomerDetails4(){
	var IsValid = true;
	var cstemail = $('#cstemail').val();
	var cstfirstname = $('#cstfirstname').val();
	if(cstfirstname == ''){
		$('#cstfirstname').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstfirstname').css("border", "1px solid #a1a1a1");
	}
	var cstlastname = $('#cstlastname').val();
	if(cstlastname == ''){
		$('#cstlastname').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstlastname').css("border", "1px solid #a1a1a1");
	}
	var cstphone = $('#cstphone').val();
	if(cstphone == ''){
		$('#cstphone').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstphone').css("border", "1px solid #a1a1a1");
	}
	var cstzip = $('#cstzip').val();
	if(cstzip == ''){
		$('#cstzip').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstzip').css("border", "1px solid #a1a1a1");
	}
	if(cstemail == ''){
		$('#cstemail').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstemail').css("border", "1px solid #a1a1a1");
		var eml= new  String(cstemail);
		var val1=eml.indexOf("@");
		var val2=eml.indexOf(".");
		if((val1==-1) || (val2==-1)){
			$('#cstemail').css("border", "2px solid #FF0000");
			IsValid = false;
		}
	}
	var cstisdiscount = $('#cstisdiscount:checked').val()?1:0;
	
	var accounttype = $('#accounttype').val();
	var serviceid = $('#serviceid').val();
	var noofpass = $('#noofpass').val();
	var noofvehicles = $('#noofvehicles').val();
	var phonecountry = $('#phonecountry').val();
	if(IsValid==true){
		$('#loadingUpdateCustomerDetails').fadeIn('slow');
		$("#loadingUpdateCustomerDetails").html('<img src="/ajax-loading.gif" alt="loading" title="loading">');
		$.ajax({
			method: 'POST',
			url: '/proccessform.php?actions=updateprofilecustomer',		
			data: {cstfirstname: cstfirstname,cstlastname: cstlastname,cstemail: cstemail,cstphone: cstphone,cstzip: cstzip,cstisdiscount: cstisdiscount, customersid: '<?=$customers_id_UL?>',serviceid: serviceid,noofpass: noofpass,accounttype: accounttype,noofvehicles: noofvehicles,phonecountry: phonecountry},	                
			headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
		}).success(function(r){	
			$("#loadingUpdateCustomerDetails").html(r);	
			$('#loadingUpdateCustomerDetails').delay(5000).fadeOut('slow');
		});
	}
	return IsValid;
}

function UpdateCustomerDetailsCorporate(){
	var IsValid = true;
	var cstemail = $('#cstemail').val();
	var cstfirstname = $('#cstfirstname').val();
	if(cstfirstname == ''){
		$('#cstfirstname').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstfirstname').css("border", "1px solid #a1a1a1");
	}
	var cstlastname = $('#cstlastname').val();
	if(cstlastname == ''){
		$('#cstlastname').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstlastname').css("border", "1px solid #a1a1a1");
	}
	var cstphone = $('#cstphone').val();
	if(cstphone == ''){
		$('#cstphone').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstphone').css("border", "1px solid #a1a1a1");
	}
	var cstzip = $('#postal_code').val();
	if(cstzip == ''){
		$('#postal_code').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#postal_code').css("border", "1px solid #a1a1a1");
	}
	if(cstemail == ''){
		$('#cstemail').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#cstemail').css("border", "1px solid #a1a1a1");
		var eml= new  String(cstemail);
		var val1=eml.indexOf("@");
		var val2=eml.indexOf(".");
		if((val1==-1) || (val2==-1)){
			$('#cstemail').css("border", "2px solid #FF0000");
			IsValid = false;
		}
	}
	var cstisdiscount = 1;	
	var accounttype = $('#accounttype').val();
	var phonecountry = $('#phonecountry').val();
	
	var Billing_Address = $('#Billing_Address').val();
	if(Billing_Address == ''){
		$('#Billing_Address').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#Billing_Address').css("border", "1px solid #a1a1a1");
	}
	var Billing_City = $('#Billing_City').val();
	if(Billing_City == ''){
		$('#Billing_City').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#Billing_City').css("border", "1px solid #a1a1a1");
	}
	var Billing_State = $('#Billing_State').val();
	if(Billing_State == ''){
		$('#Billing_State').css("border", "2px solid #FF0000");
		IsValid = false;
	}
	else{
		$('#Billing_State').css("border", "1px solid #a1a1a1");
	}
	
	var jobtitle = $('#jobtitle').val();
	var typeofbusiness = $('#typeofbusiness').val();
	var hearaboutus = $('#hearaboutus').val();
	var department = $('#department').val();
	var noofpeopleauth = $('#noofpeopleauth').val();
	var notesforus = $('#notesforus').val();
	var notesfordrivers = $('#notesfordrivers').val();
	var notesforcustomer = $('#notesforcustomer').val();
	var custaccounttype = $('#custaccounttype').val();
	var cstpriority = $('#cstpriority').val();
	var webaccess = $('#webaccess').val();
	var mainactwebaccess = $('#mainactwebaccess').val();
	var rentalagreement = $('#rentalagreement').val();
	var paymentmethod = $('#paymentmethod').val();
	var paymentterms = $('#paymentterms').val();
	if(IsValid==true){
		$('#loadingUpdateCustomerDetails').fadeIn('slow');
		$("#loadingUpdateCustomerDetails").html('<img src="/ajax-loading.gif" alt="loading" title="loading">');
		$.ajax({
			method: 'POST',
			url: '/proccessform.php?actions=updateprofilecustomer',		
			data: {cstfirstname: cstfirstname,cstlastname: cstlastname,cstemail: cstemail,cstphone: cstphone,cstzip: cstzip,cstisdiscount: cstisdiscount, customersid: '<?=$customers_id_UL?>',Billing_Address: Billing_Address,Billing_City: Billing_City,accounttype: accounttype,Billing_State: Billing_State,phonecountry: phonecountry,jobtitle: jobtitle,typeofbusiness: typeofbusiness,hearaboutus: hearaboutus,department: department,noofpeopleauth: noofpeopleauth,notesforus: notesforus,notesfordrivers: notesfordrivers,notesforcustomer: notesforcustomer,custaccounttype: custaccounttype,cstpriority: cstpriority,webaccess: webaccess,mainactwebaccess: mainactwebaccess,rentalagreement: rentalagreement,paymentmethod: paymentmethod,paymentterms: paymentterms},	                
			headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
		}).success(function(r){	
			$("#loadingUpdateCustomerDetails").html(r);	
			$('#loadingUpdateCustomerDetails').delay(5000).fadeOut('slow');
		});
	}
	return IsValid;
}

function isNumberKey(evt){
	var charCode=(evt.which)?evt.which:event.keyCode;
	if(charCode>31&&charCode<48||charCode>57)
		if(event.keyCode!=46)
			if(event.keyCode!=110)
				return false;			
			return true;
}
</script>
<div id="ProfileImageModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Upload Profile Image</h4>
            </div>
		 <form name="frmFU" method="post" id="frmFU" action="/proccessform.php?actions=uploadprofileimagecustomer" enctype="multipart/form-data">
			<input type="hidden" id="customersid" name="customersid" value="<?=$customers_id_UL?>" />
            <div class="modal-body">
				<div class="row">
		            <div class="col-md-12">
						<label>Select Image</label>
						<input type="file" name="profileimage" id="profileimage"/>
					</div>
				</div>											
				<div class="btnRow text-center">
				   <input type="submit" class="btnchangePassword" value="Upload Image">
				</div>	
            </div>
		</form>
        </div>
    </div>
</div>
<?php get_footer();?>