<?php
if(isset($params) && $params->get('show_page_heading') == 1){
    if($params->get('page_heading') != "") {
        ?>
        <div class="page-header">
            <h1>
                <?php echo $params->get('page_heading');?>
            </h1>
        </div>
        <?php
    }
}
if($introtext != "")
{
	?>
	<div class="<?php echo $mapClass['row-fluid'];?>" id="itemsListingintrotext">
		<div class="<?php echo $mapClass['span12'];?>">
			<?php
			echo $introtext;
			?>
		</div>
	</div>
	<?php
}
if(($show_category == 1) && (count($categories) > 0))
{
    ?>
	<div class="<?php echo $mapClass['row-fluid'];?>" id="categoriesListing">
		<div class="<?php echo $mapClass['span12'];?>">
			<div class="sub-page-header">
				<h2>
					<?php echo JText::_('OS_LIST_ALL_CATEGORIES');?>
				</h2>
			</div>
			<div id="mainwrapper" class="<?php echo $mapClass['row-fluid'];?>">
			<?php
			$j = 0;
			foreach ($categories as $category){
				$j++;
				$link = Jroute::_('index.php?option=com_osservicesbooking&task=default_layout&category_id='.$category->id.'&Itemid='.$jinput->getInt('Itemid',0));
				?>
				<div class="<?php echo $mapClass['span4'];?>">
					<div class="information_box">
						<div class="information_box_img">
							<a href="<?php echo $link; ?>" title="<?php echo JText::_('OS_CATEGORY_DETAILS');?>">
								<?php
								if($category->category_photo != ""){
									?>
									<img src="<?php echo JURI::root()?>images/osservicesbooking/category/<?php echo $category->category_photo?>" alt="<?php echo OSBHelper::getLanguageFieldValue($category,'category_name');?>" />
									<?php
								}else{
									?>
									<img src="<?php echo JURI::root()?>components/com_osservicesbooking/asset/images/no_image_available.png" alt="<?php echo OSBHelper::getLanguageFieldValue($category,'category_name');?>" />
									<?php
								}
								?>
							</a>
						</div>
						<span class="full-caption">
							<h3><a href="<?php echo $link; ?>" title="<?php echo JText::_('OS_CATEGORY_DETAILS');?>"><?php echo OSBHelper::getLanguageFieldValue($category,'category_name');?></a></h3>
							<?php
							if($category->show_desc == 1){
								?>
								<div class="full-desc">
									<?php HelperOSappscheduleCommon::showDescription(strip_tags(OSBHelper::getLanguageFieldValue($category,'category_description')));?>
								</div>
								<?php
							}
							?>
						</span>
					</div>
				</div>
				<?php
				if($j == 3){
					$j = 0;
					?>
					</div><div class="<?php echo $mapClass['row-fluid'];?>">
					<?php
				}
			}
			?>
			</div>
		</div>
	</div>
    <?php
}

if(($show_service == 1) && (count($services) > 0))
{
    ?>
	<div class="<?php echo $mapClass['row-fluid'];?>" id="servicesListing">
		<div class="<?php echo $mapClass['span12'];?>">
			<div class="sub-page-header">
				<h2>
					<?php echo JText::_('OS_LIST_ALL_SERVICES');?>
				</h2>
			</div>
			<div id="mainwrapper" class="<?php echo $mapClass['row-fluid'];?>">
			<?php
			$j = 0;
			foreach ($services as $service)
			{
				$j++;
				$link = Jroute::_('index.php?option=com_osservicesbooking&task=default_layout&sid='.$service->id.'&Itemid='.$jinput->getInt('Itemid',0));
				?>
				<div class="<?php echo $mapClass['span4'];?>">
					<div class="information_box">
						<div class="information_box_img">
							<a href="<?php echo $link; ?>" title="<?php echo JText::_('OS_SERVICE_DETAILS');?>">
								<?php
								if($service->service_photo != ""){
									?>
									<img src="<?php echo JURI::root()?>images/osservicesbooking/services/<?php echo $service->service_photo; ?>" alt="<?php echo OSBHelper::getLanguageFieldValue($service,'service_name');?>" />
									<?php
								}else{
									?>
									<img src="<?php echo JURI::root()?>components/com_osservicesbooking/asset/images/no_image_available.png" alt="<?php echo OSBHelper::getLanguageFieldValue($service,'service_name');?>" />
									<?php
								}
								?>
							</a>
						</div>
						<span class="full-caption">
							<h3><a href="<?php echo $link; ?>" title="<?php echo JText::_('OS_SERVICE_DETAILS');?>"><?php echo OSBHelper::getLanguageFieldValue($service,'service_name');?></a></h3>
							<div class="full-desc">
								<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-tag-fill" viewBox="0 0 16 16">
								  <path d="M2 1a1 1 0 0 0-1 1v4.586a1 1 0 0 0 .293.707l7 7a1 1 0 0 0 1.414 0l4.586-4.586a1 1 0 0 0 0-1.414l-7-7A1 1 0 0 0 6.586 1H2zm4 3.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/>
								</svg> <?php echo HelperOSappscheduleCommon::getCategoryName($service->id); ?>
								<div class="clearfix"></div>
								<?php echo HelperOSappscheduleCommon::showDescription(strip_tags(OSBHelper::getLanguageFieldValue($service,'service_description')));?>
							</div>
						</span>
					</div>
				</div>
				<?php
				if($j == 3){
					$j = 0;
					?>
					</div><div class="<?php echo $mapClass['row-fluid'];?>">
					<?php
				}
			}
			?>

			</div>
		</div>
	</div>
    <?php
}

if(($show_employee == 1) && (count($employees) > 0))
{
    ?>
	<div class="<?php echo $mapClass['row-fluid'];?>" id="employeesListing">
		<div class="<?php echo $mapClass['span12'];?>">
			<div class="sub-page-header">
				<h2>
					<?php echo JText::_('OS_LIST_ALL_EMPLOYEES');?>
				</h2>
			</div>
			<div id="mainwrapper" class="<?php echo $mapClass['row-fluid'];?>">
			<?php
			$j = 0;
			foreach ($employees as $employee)
			{
				$j++;
				$link = Jroute::_('index.php?option=com_osservicesbooking&task=default_layout&employee_id='.$employee->id.'&Itemid='.$jinput->getInt('Itemid',0));
				?>
				<div class="<?php echo $mapClass['span4'];?>">
					<div class="information_box">
						<div class="information_box_img">
							<a href="<?php echo $link; ?>" title="<?php echo JText::_('OS_DETAILS');?>">
								<?php
								if ($employee->employee_photo != "") {
									?>
									<img src="<?php echo JURI::root()?>images/osservicesbooking/employee/<?php echo $employee->employee_photo?>" alt="<?php echo $employee->employee_name;?>" />
									<?php
								} else {
									?>
									<img src="<?php echo JURI::root()?>components/com_osservicesbooking/asset/images/no_image_available.png" alt="<?php echo $employee->employee_name;?>" />
									<?php
								}
								?>
							</a>
						</div>
						<span class="full-caption">
							<h3><a href="<?php echo $link; ?>" title="<?php echo JText::_('OS_DETAILS');?>"><?php echo $employee->employee_name;?></a></h3>
							<div class="full-desc">
								<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-tag-fill" viewBox="0 0 16 16">
  <path d="M2 1a1 1 0 0 0-1 1v4.586a1 1 0 0 0 .293.707l7 7a1 1 0 0 0 1.414 0l4.586-4.586a1 1 0 0 0 0-1.414l-7-7A1 1 0 0 0 6.586 1H2zm4 3.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/>
</svg> <?php echo HelperOSappscheduleCommon::getServiceNames($employee->id); ?>
								<?php
								echo '<div class="clearfix"></div>';
								if ($employee->employee_phone != "") {
									?>
									<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-telephone-fill" viewBox="0 0 16 16">
									  <path fill-rule="evenodd" d="M1.885.511a1.745 1.745 0 0 1 2.61.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511z"/>
									</svg>
									<?php
									echo "&nbsp;".$employee->employee_phone;
									echo '<div class="clearfix"></div>';
								}
								if ($employee->employee_email != "") {
									?>
									<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-fill" viewBox="0 0 16 16">
									  <path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z"/>
									</svg>
									<?php
									echo "&nbsp;<a href='mailto:" . $employee->employee_email . "'>" . $employee->employee_email . "</a>";
									echo '<div class="clearfix"></div>';
								}
								if ($employee->employee_notes != "") {
									echo $employee->employee_notes;
								}
								?>
							</div>
						</span>
					</div>
				</div>
				<?php
				if($j == 3)
				{
					$j = 0;
					?>
					</div><div class="<?php echo $mapClass['row-fluid'];?>">
					<?php
				}
			}
			?>
			</div>
		</div>
	</div>
    <?php
}
?>