<?php
// include_once dirname(__FILE__) . '/elements/header.php';
$SEARCH = @$_SESSION[$controller->defaultStore]['search'];
$months = __('months', true);
$short_days = __('short_days', true);
ksort($months);
ksort($short_days);
$week_start = isset($tpl['option_arr']['o_week_start']) && in_array((int) $tpl['option_arr']['o_week_start'], range(0,6)) ? (int) $tpl['option_arr']['o_week_start'] : 0;
?>
<div class="pjTbs-head">
	<div class="row">
		<div class="col-sm-4 col-xs-8">
		
		</div>
		<div class="col-sm-8 col-xs-12 text-right pull-right">
			<div class="btn-group btnn">
				<?php
				if(!$controller->isFrontLogged())
				{
    				?>
      				<button type="button" class="btn btn-default pjCssLogin"><?php __('front_btn_login');?></button>
      				<?php
				}else{
				    ?>
      				<button type="button" class="btn btn-default pjTbsProfile"><?php __('front_btn_profile');?></button>
      				<button type="button" class="btn btn-default pjTbsReservations"><?php __('front_btn_reservations');?></button>
      				<button type="button" class="btn btn-default pjCssLogout"><?php __('front_btn_logout');?></button>
      				<?php
				}
      			?>
			</div>
			<?php if ((!isset($_GET['hide']) || (int) $_GET['hide'] === 0) && isset($tpl['locale_arr']) && is_array($tpl['locale_arr']) && count($tpl['locale_arr']) > 1) : ?>
    		<?php
    		$selected_title = null;
    		$selected_src = NULL;
    		foreach ($tpl['locale_arr'] as $locale)
    		{
    			if ($controller->getLocaleId() == $locale['id'])
    			{
    				$selected_title = $locale['language_iso'];
    				$lang_iso = explode("-", $selected_title);
    				if(isset($lang_iso[1]))
    				{
    					$selected_title = $lang_iso[1];
    				}
    				if (!empty($locale['flag']) && is_file(PJ_INSTALL_PATH . $locale['flag']))
    				{
    					$selected_src = PJ_INSTALL_URL . $locale['flag'];
    				} elseif (!empty($locale['file']) && is_file(PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'])) {
    					$selected_src = PJ_INSTALL_URL . PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'];
    				}
    				break;
    			}
    		}
    		?>
			<div class="btn-group pull-right pjTbsLangaugeSelector">
				<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					<img src="<?php echo $selected_src; ?>" alt="">
					<?php echo $selected_title; ?>
					<span class="caret"></span>
				</button>

				<ul class="dropdown-menu">
					<?php
					foreach ($tpl['locale_arr'] as $locale)
					{
						$selected_src = NULL;
						if (!empty($locale['flag']) && is_file(PJ_INSTALL_PATH . $locale['flag']))
						{
							$selected_src = PJ_INSTALL_URL . $locale['flag'];
						} elseif (!empty($locale['file']) && is_file(PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'])) {
							$selected_src = PJ_INSTALL_URL . PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'];
						}
						?>
						<li<?php echo $controller->getLocaleId() == $locale['id'] ? ' active' : NULL; ?>>
							<a href="#" class="pjTbsLocale" data-id="<?php echo $locale['id']; ?>" data-dir="<?php echo $locale['dir']; ?>">
								<img src="<?php echo $selected_src; ?>" alt="">
								<?php echo pjSanitize::html($locale['name']); ?>
							</a>
						</li>
						<?php
					}
					?>
				</ul>
			</div>
    		</div><!-- /.col-sm-4 -->
    		<?php endif;?>
		</div>
	</div><!-- /.row -->
</div><!-- /.pjTbs-head -->

<script language="javascript" type="text/javascript">
    function abc(){
        // var a=("The URL of this page is: " + window.location.href);
        // alert(a);
        // var element = document.getElementById('get_data');
        // var dataID = element.getAttribute('data-id');
        var type=document.getElementById('get_data').value;
        // alert(type);
        if(type == "1"){
            window.location = "http://localhost/varunsir/aziz/TaxiBooking";
        }
        else if(type == "2"){
            window.location = "http://localhost/varunsir/aziz/TaxiBooking/en";
        }
    }

</script>

<div class="pjTbs-body">
	<form id="pjTbsSearchForm_<?php echo $controller->_get->toString('index');?>" action="#" method="post" class="pjTbsSearchForm">
		<input type="hidden" name="tbs_search" value="1" />
		<div id="pjTbsCalendarLocale" style="display: none;" data-months="<?php echo implode("_", $months);?>" data-days="<?php echo implode("_", $short_days);?>" data-fday="<?php echo $week_start;?>"></div>
		<div class="pjTbs-box">
			<div class="pjTbs-box-title"><?php __('front_booking_details');?></div><!-- /.pjTbs-box-title -->
	
			<div class="row">
				<div class="col-sm-6 col-xs-12">
					<div class="form-group">
						<label class="control-label"><?php __('front_pickup_address');?></label>
	
						<input type="text" id="pickup_address_<?php echo $controller->_get->toString('index');?>" name="pickup_address" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control required pjTbsAddress" data-msg-required="<?php __('front_required_field');?>">
						<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
					</div><!-- /.form-group -->

					<div class="form-group">
						<label class="control-label"><?php __('front_dropoff_address');?></label>
	
						<input type="text" id="return_address_<?php echo $controller->_get->toString('index');?>" name="return_address" value="<?php echo isset($SEARCH['return_address']) ? pjSanitize::clean($SEARCH['return_address']) : NULL;?>" class="form-control required pjTbsAddress" data-msg-required="<?php __('front_required_field');?>">
						<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
					</div><!-- /.form-group -->
				</div>

				<div class="col-sm-6 col-xs-12">
					<label><?php __('front_passengers');?></label>
					
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
							</span>
					
							<div class="btn-group pjTbs-spinner" role="group" aria-label="...">
					            						<button type="button" class="btn pjTbs-spinner pjTbs-spinner-down">-</button>
					
								<input type="text" name="passengers" class="pjTbs-spinner-result digits" maxlength="3" value="<?php echo isset($SEARCH['passengers']) ? $SEARCH['passengers'] : 1;?>" data-msg-digits="<?php __('front_digits_validation');?>">
					
								<button type="button" class="btn pjTbs-spinner pjTbs-spinner-up">+</button>
							</div>
						</div>
						<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
					</div><!-- /.form-group --><!-- /.col-sm-6 -->
					
					<label><?php __('front_pieces_of_luggage');?></label>
					
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span>
							</span>
					
							<div class="btn-group pjTbs-spinner" role="group" aria-label="...">
					            						<button type="button" class="btn pjTbs-spinner pjTbs-spinner-down">-</button>
					
								<input type="text" name="luggage" class="pjTbs-spinner-result digits" maxlength="3" value="<?php echo isset($SEARCH['luggage']) ? $SEARCH['luggage'] : NULL;?>" data-msg-digits="<?php __('front_digits_validation');?>">
					
								<button type="button" class="btn pjTbs-spinner pjTbs-spinner-up">+</button>
							</div>
						</div>
						<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
					</div><!-- /.form-group --><!-- /.col-sm-6 --><!-- /.row -->
				</div><!-- /.col-sm-6 -->
	
				<div class="col-sm-6 col-xs-12">
					<label class="control-label"><?php __('front_date_time');?></label>
	
					<div class="row">
						<div class="col-md-6 col-sm-7 col-xs-12">
							<div class="form-group">
								<div class="input-group date-pick">
									<span class="input-group-addon">
										<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
									</span>
			
									<input type="text" name="booking_date" value="<?php echo isset($SEARCH['booking_date']) ? $SEARCH['booking_date'] : NULL;?>" class="form-control required" readonly="readonly" data-msg-required="<?php __('front_required_field');?>"/>
								</div>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.form-group -->
						</div><!-- /.col-sm-6 -->
	
						<div class="col-md-6 col-sm-5 col-xs-12">
							<div class="form-group">
								<div class="input-group time-pick">
									<span class="input-group-addon">
										<span class="glyphicon glyphicon-time" aria-hidden="true"></span>
									</span>
	
									<input type="text" name="booking_time" value="<?php echo isset($SEARCH['booking_time']) ? $SEARCH['booking_time'] : NULL;?>" class="form-control required" readonly data-msg-required="<?php __('front_required_field');?>"/>
								</div>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.form-group -->
						</div><!-- /.col-sm-6 -->
					</div><!-- /.row -->
				</div><!-- /.col-sm-6 -->

				<div class="col-sm-6 col-xs-12">
					<label class="control-label"><?php __('front_distance');?>:</label>

					<div class="pjTbs-distance">
						<input type="text" id="pjTbsDistanceFiled" name="distance" name="booking_date" value="<?php echo isset($SEARCH['distance']) ? $SEARCH['distance'] : NULL;?>" class="required number" data-msg-required="<?php __('front_required_field');?>" data-msg-number="<?php __('front_number_validation');?>" readonly="readonly"/> km</div>
					<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
				</div>
			</div><!-- /.row -->
	
			<div class="pjTbs-body-actions">		
				<input value="<?php __('front_btn_book_a_taxi');?>" class="btn btn-primary" type="submit">
			</div>
	
			<div class="pjTbs-map" id="pjTbsMapCanvas"></div>
		</div><!-- /.pjTbs-box -->
	</form>
</div><!-- /.pjTbs-body -->