<?php

$id                 = isset($results->id) ? $results->id : '';
$title              = isset($results->title) ? $results->title : '';
$service_type       = isset($results->service_type) ? $results->service_type : '';
$description        = isset($results->description) ? $results->description : '';
$photo              = isset($results->photo) ? $results->photo : '';
$day_rate_min       = isset($results->day_rate_min) ? $results->day_rate_min : '';
$day_rate_max       = isset($results->day_rate_max) ? $results->day_rate_max : '';
$night_rate_min     = isset($results->night_rate_min) ? $results->night_rate_min : '';
$night_rate_max     = isset($results->night_rate_max) ? $results->night_rate_max : '';
$availability       = isset($results->availability) ? $results->availability : '';
$language           = isset($results->language) ? $results->language : '';

$hair_color         = isset($results->hair_color) ? $results->hair_color : '';
$eye_color          = isset($results->eye_color) ? $results->eye_color : '';
$body_type          = isset($results->body_type) ? $results->body_type : '';
$orientation_name   = isset($results->orientation_name) ? $results->orientation_name : '';

$liquor             = isset($results->liquor) ? $results->liquor : '';
$bust_size          = isset($results->bust_size) ? $results->bust_size : '';
$smoker             = isset($results->smoker) ? $results->smoker : '';
$public_hair        = isset($results->public_hair) ? $results->public_hair : '';

$location           = isset($results->location) ? $results->location : '';
$nationality        = isset($results->nationality) ? $results->nationality : '';
$age                = isset($results->age) ? $results->age : '';
$weight             = isset($results->weight) ? $results->weight : '';
$height             = isset($results->height) ? $results->height : '';

$name               = isset($results->name) ? $results->name : '';
$breast_type        = isset($results->breast_type) ? $results->breast_type : '';

$phone              = isset($results->phone) ? $results->phone : '';
$whatsapp           = isset($results->whatsapp) ? $results->whatsapp : '';
$telegram           = isset($results->telegram) ? $results->telegram : '';
$viber              = isset($results->viber) ? $results->viber : '';


?>


<div class="modal-header">
    <h5 class="modal-title" id="modalLabel">
        <?= $name  ?>
    </h5>
    <button type="button" class="btn-close icon-btn-sm" data-bs-dismiss="modal" aria-label="Close">
        <i class="ri-close-large-line fw-semibold"></i>
    </button>
</div>
<div class="modal-body">
    <div class="row">
        <div class="col-md-12">
            <div id="with_controls" class="carousel slide" data-bs-ride="carousel" data-bs-interval="4000">
                <div class="carousel-inner">
                    <?php $images = explode(",", $photo);

                    if (isset($images) && count($images) > 0) {
                        foreach ($images as $key => $img) { ?>
                            <div class="carousel-item <?= ($key == 0) ? 'active' : '' ?>">
                                <img src="<?= $img ?>" height="260" width="100%" class="d-block w-100" alt="">
                            </div>
                    <?php }
                    } ?>
                </div>
                <?php 
                 if (isset($images) && count($images) > 1) { ?>
                <button class="carousel-control-prev" type="button" data-bs-target="#with_controls" data-bs-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="visually-hidden">Previous</span>
                </button>
                <button class="carousel-control-next" type="button" data-bs-target="#with_controls" data-bs-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="visually-hidden">Next</span>
                </button>
                <?php } ?>
            </div>
        </div>
        <div class="card p-3" style="background:#fafafa;border-radius:10px;">

            <!-- TITLE -->
            <?php if (!empty($title)) { ?>
                <h4 class="mb-1"><?php echo $title; ?></h4>
                <label class="badge bg-light rounded-pill text-body mt-2" style="width:120px;"><?= $service_type ?></label>
            <?php } ?>

            <!-- OVERVIEW -->
            <?php if (!empty($description)) { ?>
                <h4 class="mb-1">Overview</h4>
                <p class="text-muted"><?php echo $description; ?></p>
            <?php } ?>

            <h4 class="">Service Details</h4>
            <div class="card">
                <div class="card-body" style="background:#f8f9fa;">
                    <?php if (!empty($day_rate_min) || !empty($day_rate_max)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Hour Price</span>
                            <span>₹<?php echo $day_rate_min; ?> – ₹<?php echo $day_rate_max; ?></span>
                        </div>
                    <?php } ?>
                    <?php if (!empty($night_rate_min) || !empty($night_rate_max)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Night Price</span>
                            <span>₹<?php echo $night_rate_min; ?> – ₹<?php echo $night_rate_max; ?></span>
                        </div>
                    <?php } ?>
                    <?php if (!empty($service_type)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Service Type</span>
                            <span><?php echo $service_type; ?></span>
                        </div>
                    <?php } ?>
                    <?php if (!empty($availability)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Service Availability</span>
                            <span><?php echo $availability; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($bust_size)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Bust Size</span>
                            <span><?php echo $bust_size; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($location)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Location</span>
                            <span><?php echo $location; ?></span>
                        </div>
                    <?php } ?>
                </div>
            </div>
            <h4 class="">Personal Details</h4>
            <div class="card">
                <div class="card-body" style="background:#f8f9fa;">
                    <?php if (!empty($name)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Name</span>
                            <span><?php echo $name; ?></span>
                        </div>
                    <?php } ?>
                    <?php if (!empty($language)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Language</span>
                            <span><?php echo $language; ?></span>
                        </div>
                    <?php } ?>
                    <?php if (!empty($nationality)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Nationality</span>
                            <span><?php echo $nationality; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($age)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Age</span>
                            <span><?php echo $age; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($weight)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Weight</span>
                            <span><?php echo $weight; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($height)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Height</span>
                            <span><?php echo $height; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($hair_color)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Hair Color</span>
                            <span><?php echo $hair_color; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($eye_color)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Eye Color</span>
                            <span><?php echo $eye_color; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($body_type)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Body Type</span>
                            <span><?php echo $body_type; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($orientation_name)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Orientation</span>
                            <span><?php echo $orientation_name; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($liquor)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Liquor</span>
                            <span><?php echo $liquor; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($bust_size)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Bust Size</span>
                            <span><?php echo $bust_size; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($breast_type)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Breast Type</span>
                            <span><?php echo $breast_type; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($smoker)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Smoker</span>
                            <span><?php echo $smoker; ?></span>
                        </div>
                    <?php } ?>

                    <?php if (!empty($public_hair)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Public Hair</span>
                            <span><?php echo $public_hair; ?></span>
                        </div>
                    <?php } ?>

                </div>
            </div>
            <h4 class="">Contact Details</h4>
            <div class="card">
                <div class="card-body" style="background:#f8f9fa;">
                    <?php if (!empty($phone)) { ?>
                        <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Phone Number</span>
                            <span><?php echo $phone; ?></span>
                        </div>
                    <?php } ?>
                    <div class="d-flex justify-content-between py-1">
                            <span class="text-danger fw-bold">Social</span>
                            <span>
                                <?php if (!empty($whatsapp)) { ?>
                                    <a href="<?=$whatsapp ?>">
                                        <img src="<?= asset('backend_assets') ?>/images/whatsapp.png" width="30" />
                                    </a>
                                <?php } ?>
                                 <?php if (!empty($telegram)) { ?>
                                    <a href="<?=$telegram ?>">
                                        <img src="<?= asset('backend_assets') ?>/images/telegram.png" width="30" />
                                    </a>
                                <?php } ?>
                                 <?php if (!empty($viber)) { ?>
                                    <a href="<?=$viber ?>">
                                        <img src="<?= asset('backend_assets') ?>/images/viber.png" width="30" />
                                    </a>
                                <?php } ?>
                            </span>
                        </div>
                </div>
            </div>

        </div>

    </div>

</div>