<?php
/**
* @package com_spmedical
* @author JoomShaper http://www.joomshaper.com
* @copyright Copyright (c) 2010 - 2025 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/

// No Direct Access
defined ('_JEXEC') or die('Restricted Access');

use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

?>

<div id="spmedical" class="spmedical view-spmedical-department spmedical-department">

	<div class="spmedical-department-wrapper">
	
		<div class="spmedical-department-main-content">
			<?php if($this->item->image){ ?>
				<div class="img-wrapper">
					<img src="<?php echo Uri::root() . $this->item->image; ?>" alt="">
				</div>
			<?php } ?>
			<h2 class="spmedical-title"><?php echo $this->item->title; ?></h2>
			<div class="spmedical-details"><?php echo $this->item->description; ?></div>
			<?php if($this->item->symptoms || $this->item->causes || $this->item->treatments_info){ ?>
			<div class="spmedical-symptoms">
				<ul class="nav nav-tabs" id="myTab" role="tablist">
				<?php if($this->item->symptoms){ ?>
					<li class="nav-item" role="presentation">
						<button class="nav-link active" id="symptoms-tab" data-bs-toggle="tab" data-bs-target="#symptoms" type="button" role="tab" aria-controls="symptoms" aria-selected="true"><?php echo Text::_('COM_SPMEDICAL_DEPARTMENT_SYMPTOMS'); ?></button>
					</li>
					<?php } ?>

					<?php if($this->item->causes){ ?>
					<li class="nav-item" role="presentation">
						<button class="nav-link" id="causes-tab" data-bs-toggle="tab" data-bs-target="#causes" type="button" role="tab" aria-controls="causes" aria-selected="false"><?php echo Text::_('COM_SPMEDICAL_DEPARTMENT_CAUSES'); ?></button>
					</li>
					<?php } ?>

					<?php if($this->item->treatments_info){ ?>
					<li class="nav-item" role="presentation">
						<button class="nav-link" id="treatments-tab" data-bs-toggle="tab" data-bs-target="#treatments" type="button" role="tab" aria-controls="treatments" aria-selected="false"><?php echo Text::_('COM_SPMEDICAL_DEPARTMENT_TREATMENTS_INFO'); ?></button>
					</li>
					<?php } ?>
				</ul>
				<div class="tab-content" id="myTabContent">
				<?php if($this->item->symptoms){ ?>
					<div class="tab-pane fade show active" id="symptoms" role="tabpanel" aria-labelledby="symptoms-tab">
						<?php echo $this->item->symptoms ?>
					</div>
					<?php } ?>

					<?php if( $this->item->causes){ ?>
					<div class="tab-pane fade" id="causes" role="tabpanel" aria-labelledby="causes-tab">
						<?php echo $this->item->causes ?>
					</div>
					<?php } ?>

					<?php if($this->item->treatments_info){ ?>
					<div class="tab-pane fade" id="treatments" role="tabpanel" aria-labelledby="treatments-tab">
						<?php echo $this->item->treatments_info ?>
					</div>
					<?php } ?>
				</div>
			</div>
			<?php } ?>
		</div>

		<?php if(count($this->specialists)) { ?>
			<!-- Care Providers -->
			<div class="spmedical-specialists-wrapper">
				<h2 class="spmedical-title"><?php echo Text::_('COM_SPMEDICAL_CARE_PROVIDER_TITLE'); ?></h2>
				<div class="spmedical-details"><?php echo Text::_('COM_SPMEDICAL_CARE_PROVIDER_SUBTITLE'); ?></div>
				<div class="spmedical-row">
					<?php foreach ($this->specialists as $specialist) { ;
						?>
					<div class="spmedical-specialists spmedical-col-md-3 spmedical-col-sm-6">
						<div class="specialists-wrapper">
							<div class="specialists-img-wrapper">
								<?php if($specialist->image) { ?>
									<img src="<?php echo Uri::root() . $specialist->image; ?>" class="spmedical-person-img spmedical-img-responsive" alt="<?php echo $specialist->title; ?>">
								<?php } ?>
								<div class="area-of-specialties">
									<div class="specialists-name">
										<h3><a class="splms-person-title" href="<?php echo $specialist->url; ?>"><?php echo $specialist->title; ?></a></h3>
										<?php if($specialist->designation){ ?>
											<p class="specialists-designation"><?php echo $specialist->designation; ?></p>
										<?php } ?>
									</div>
								</div>
							</div> <!-- /.specialists-img-wrapper -->
						</div>
					</div> <!-- /.spmedical-specialists -->
					<?php } ?>
				</div> <!-- //.spmedical-row -->
			</div>
		<?php } //has specialitist ?>

		<?php if( !empty($this->item->treatments) || !empty($this->item->investigations) || !empty($this->item->others_services) ) { ?>
			<h2 class="spmedical-title"><?php echo Text::_('COM_SPMEDICAL_TEST_TITLE'); ?></h2>
			<div class="spmedical-details"><?php echo Text::_('COM_SPMEDICAL_TEST_SUBTITLE'); ?></div>
			<div class="spmedical-row">
				<?php if( !empty($this->item->treatments) ) { ?>
					<?php echo LayoutHelper::render('departments.department_services', array('services' => $this->item->treatments, 'columns' => 3, 'services_title' => Text::_('COM_SPMEDICAL_DEPARTMENT_TREATMENTS'))); ?>
				<?php } if( $this->item->investigations ) { ?>
					<?php echo LayoutHelper::render('departments.department_services', array('services' => $this->item->investigations, 'columns' => 3, 'services_title' => Text::_('COM_SPMEDICAL_DEPARTMENT_INVESTIGATIONS'))); ?>
				<?php } if( $this->item->others_services ) { ?>
					<?php echo LayoutHelper::render('departments.department_services', array('services' => $this->item->others_services, 'columns' => 3, 'services_title' => Text::_('COM_SPMEDICAL_DEPARTMENT_OTHERS_SERVICES'))); ?>
				<?php } ?>
			</div> <!-- //.spmedical-row -->
		<?php } ?>
		
		<!-- CTA -->
		<div class="spmedical-department-cta">
			<div class="spmedical-row">
				<div class="spmedical-col-md-8">
					<h3 class="tilte"><?php echo Text::_('COM_SPMEDICAL_COST_CALCULATOR'); ?></h3>
				</div>
				<div class="spmedical-col-md-4 spmedical-text-right">
					<a href="<?php echo $this->item->costestimate_url; ?>" class="spmedical-btn spmedical-btn-primary"><?php echo Text::_('COM_SPMEDICAL_ESTIMATE_COST'); ?></a>
				</div>
			</div>
		</div>

	</div> <!-- //.spmedical-department-wrapper -->
</div> <!-- //.splms view-splms-teacher -->
