<ul class="list-group pjAsChosenServices">
	<li class="list-group-item alert pjAsChosenService">
		<h3 class="text-uppercase pjAsSectionTitle"><?php __('front_selected_services');?></h3><!-- /.text-uppercase pjAsSectionTitle -->
		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<h4 class="text-capitalize pjAsServiceTitle">Gewählte Person</h4>
			</div><!-- /.col-lg-7 col-md-7 col-sm-7 col-xs-12 -->
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<div class="row">
					<div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
						<h4 class="pjAsServiceTitle"><?php __('front_date_time');?></h4>
					</div><!-- /.col-lg-8 col-md-8 col-sm-8 col-xs-8 -->
					<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">
						<h4 class="text-capitalize pjAsServiceTitle">Total Price<?php //__('single_price');?></h4>
					</div>
				</div><!-- /.row -->
			</div>
		</div><!-- /.row -->
	</li>
	
	<?php
	//echo "<pre>";
	
	$price = 0;
	$price_per_peopel = $tpl['option_arr']['o_price_per_people']; // Assuming you want to multiply by 2
	$total_person = $_SESSION['cart_value']['number_of_people'];
	$slot_id = $_SESSION['cart_value']['slot_id'];
	
	$extra_hours = isset($_SESSION['cart_value']['extra_hours']) && is_array($_SESSION['cart_value']['extra_hours'])
    ? array_sum($_SESSION['cart_value']['extra_hours']) // Sum the extra hours prices
    : 0;

	$extra_hours_name = $_SESSION['cart_value']['extra_hours_name'];

	if (!empty($extra_hours_name) && is_array($extra_hours_name)) {
		$extra_hours_display = implode(', ', array_map('pjSanitize::html', $extra_hours_name));
	} else {
		$extra_hours_display = ''; // Default value if empty
	}


	// Calculate the price based on the number of people
	$price = $price_per_peopel * $total_person;
	
	//Apply multiplier for slot_id 4 or 5
	if ($slot_id == 4 || $slot_id == 5) {
		$price = $price * 2;
	}
	$totla_price  = $price += $extra_hours;
	//  echo "V4IG78QA"; 
	// print_r($tpl['option_arr']['o_tax']); //die();
	$total_vats = ($totla_price * (float) $tpl['option_arr']['o_tax']) / 100;
	//print_r($_SESSION['total_price']);
	$dicounted_amount = $_SESSION['vcode'][0]['discount']? $_SESSION['vcode'][0]['discount'] : '0.00';

	$total_vat = $_SESSION['voucher_response']['tax_amount'] ? $_SESSION['voucher_response']['tax_amount'] : $total_vats;

	$dicounted_price = $_SESSION['voucher_response']['total_price'] ? $_SESSION['voucher_response']['total_price'] : $totla_price;

	$final_paid_price = $dicounted_price + $total_vat;

	$vcode = $_SESSION['vcode'][0]['code'];
	foreach ($cart as $key => $value)
	{   
		list($cid, $date, $service_id, $start_ts, $end_ts, $employee_id) = explode("|", $key);
		
		$fixed_start_ts = $start_ts ;//+ $cart_arr[$service_id]['before'] * 60;
		$fixed_end_ts = $end_ts ; //- $cart_arr[$service_id]['after'] * 60;

		// print_r($fixed_start_ts); die('okk');
		?>
		<li class="list-group-item alert alert-dismissible pjAsChosenService">
			<div class="row">
				<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
					<p class="text-capitalize"> 
						<strong>Person : </strong> <?php echo pjSanitize::html($total_person);?>
					</p>
					<?php if (!empty($extra_hours_display)): ?>
						<p class="text-capitalize"><strong>Extra item selected: </strong> <?php echo $extra_hours_display; ?></p>
					<?php endif; ?>
					<p>
						<?php
						$slug = NULL;
						$iso_date = $date;
						if ((int) $tpl['option_arr']['o_seo_url'] === 1)
						{
							list($year, $month, $day) = explode("-", $iso_date);
							$slug = sprintf("%s/%s/%s/%s/%s-%u/%s-%u.html", 'Employee', $year, $month, $day, $controller->friendlyURL($cart_arr[$service_id]['employee_arr'][$employee_id]['name']), $employee_id, $controller->friendlyURL($cart_arr[$service_id]['name']), $service_id);
						}
						?>
                         <?php /** AUSBLENDEN PERSON
                        <a href="javascript:void(0);" class="text-capitalize" data-iso="<?php echo $iso_date;?>" data-eid="<?php echo $employee_id; ?>" data-sid="<?php echo $service_id; ?>" data-slug="<?php echo $slug;?>"><?php echo pjSanitize::html($cart_arr[$service_id]['employee_arr'][$employee_id]['name']);?></a>
                        */?>
					</p>
				</div><!-- /.col-lg-7 col-md-7 col-sm-7 col-xs-12 -->

				<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
					<div class="row">
						<div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
							<p class="text-capitalize">Date : <?php  echo date($tpl['option_arr']['o_date_format'], strtotime($date));?></p><!-- /.text-capitalize -->

							<p class="text-uppercase">Time : <?php echo $fixed_start_ts; //date($tpl['option_arr']['o_time_format'], $fixed_start_ts);?></p><!-- /.text-uppercase -->
						</div><!-- /.col-lg-8 col-md-8 col-sm-7 col-xs-7 -->
                        <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 pjAsChosenServiceActions">
							<p>
								<strong><?php echo pjCurrency::formatPrice($totla_price); ?></strong>
							</p>
							<!-- <button type="button" class="close pjAsBtnRemove asSelectorRemoveFromCart" data-dismiss="alert" aria-label="Close" data-start_ts="<?php // echo $start_ts; ?>" data-end_ts="<?php // echo $end_ts; ?>" data-date="<?php // echo $date; ?>" data-service_id="<?php // echo $service_id; ?>" data-employee_id="<?php // echo $employee_id; ?>"><span aria-hidden="true">×</span></button> -->
						</div>

						<?php /** AUSBLENDEN PERSON
						<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 pjAsChosenServiceActions">
							<p>
                                <a href="javascript:void(0);" class="text-capitalize" data-iso="<?php echo $iso_date;?>" data-eid="<?php echo $employee_id; ?>" data-sid="<?php echo $service_id; ?>" data-slug="<?php echo $slug;?>"><?php echo pjSanitize::html($cart_arr[$service_id]['employee_arr'][$employee_id]['name']);?></a>
                            </p>
							
						</div> */ ?>

                        <!-- /.col-lg-4 col-md-4 col-sm-5 col-xs-5 pjAsChosenServiceActions -->
					</div><!-- /.row -->
				</div><!-- /.col-lg-5 col-md-5 col-sm-5 col-xs-12 -->
			</div><!-- /.row -->
		</li><!-- /.list-group-item alert alert-dismissible pjAsChosenService -->
		<li class="list-group-item pjCrProductExtra">
			<div class="row">
				<div class="col-lg-4 col-md-4 col-sm-3 col-xs-12">
					<h4>Enter Voucher Code</h4>
				</div><!-- /.col-lg-4 col-md-4 col-sm-3 col-xs-12 -->
				<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
				<input type="text" name="voucher_code" id="voucher_code" value="<?php echo $_SESSION['vcode'][0]['code'] ?$_SESSION['vcode'][0]['code'] : ''; ?>" class="form-control">
				</div><!-- /.col-lg-4 col-md-4 col-sm-5 col-xs-7 -->
				
				<?php if (!empty($_SESSION['vcode'])): ?>
					<button type="button" id="removed_code" class="btn btn-default text-capitalize pull-right pjCrBtntDefault pjCrBtnRemoveds">Redeemed</button>
					<button type="button" id="apply_code" class="btn btn-default text-capitalize pull-right pjCrBtntDefault pjCrBtnAdd crBtnVoucher" style="display:none;">Redeem</button>
				<?php else: ?>
					<button type="button" id="removed_code" class="btn btn-default text-capitalize pull-right pjCrBtntDefault pjCrBtnRemoveds" style="display:none;"> Redeemed </button>
					<button type="button" id="apply_code" class="btn btn-default text-capitalize pull-right pjCrBtntDefault pjCrBtnAdd crBtnVoucher">Redeem</button>
				<?php endif; ?>
				
				<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
				<p id="messageContainer"></p>
				</div><!-- /.col-lg-4 col-md-4 col-sm-5 col-xs-7 -->
			</div>
		</li>
		<li class="list-group-item pjCrProductExtra">
			<div class="row">
				<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
					<p>Reduction amount : </p> 
				</div><!-- /.col-lg-4 col-md-4 col-sm-3 col-xs-12 -->
				<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
					<p id="discount_amount"><strong> - <?php echo pjCurrency::formatPrice($dicounted_amount); ?></strong> </p>
				</div><!-- /.col-lg-4 col-md-4 col-sm-5 col-xs-7 -->
			</div>
			<div class="row">
				<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
					<p>Sub Total : </p> 
				</div><!-- /.col-lg-4 col-md-4 col-sm-3 col-xs-12 -->
				<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
					<p id="after_discount"><strong> <?php echo pjCurrency::formatPrice($dicounted_price); ?></strong> </p>
				</div><!-- /.col-lg-4 col-md-4 col-sm-5 col-xs-7 -->
			</div>
			<div class="row">
				<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
					<p>Vat : </p> 
				</div><!-- /.col-lg-4 col-md-4 col-sm-3 col-xs-12 -->
				<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
					<p id="vat_amount"><strong> + <?php echo pjCurrency::formatPrice($total_vat); ?></strong> </p>
				</div><!-- /.col-lg-4 col-md-4 col-sm-5 col-xs-7 -->
			</div>
			<div class="row">
				<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
					<p>Total : </p> 
				</div><!-- /.col-lg-4 col-md-4 col-sm-3 col-xs-12 -->
				<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
					<p id="total_amount"><strong> <?php echo pjCurrency::formatPrice($final_paid_price); ?></strong> </p>
				</div><!-- /.col-lg-4 col-md-4 col-sm-5 col-xs-7 -->
			</div>
		</li>
		<?php
	}
	?>
</ul><!-- /.list-group pjAsChosenServices -->