<?php
include 'back/auth-core.php';
include 'back/admin-core.php';
include 'back/all-cars.php';
?>
<!DOCTYPE html>
<html dir="ltr">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <!-- Favicon -->
    <link rel="apple-touch-icon" sizes="180x180" href="app-assets/favicon/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="app-assets/favicon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="app-assets/favicon/favicon-16x16.png">
    <link rel="manifest" href="app-assets/favicon/site.webmanifest.txt">
    <link rel="mask-icon" href="app-assets/favicon/safari-pinned-tab.svg" color="#0010f7">
    <meta name="msapplication-TileColor" content="#0010f7">
    <meta name="theme-color" content="#ffffff">

    <!-- Font -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&amp;display=swap" rel="stylesheet" />

    <!-- Plugin -->
    <link rel="stylesheet" type="text/css" href="app-assets/css/plugin/swiper-bundle.min.css">
    <link rel="stylesheet" type="text/css" href="app-assets/icons/iconly/index.min.css">
    <link rel="stylesheet" type="text/css" href="app-assets/icons/remix-icon/index.min.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/colors.css">

    <!-- Base -->
    <link rel="stylesheet" type="text/css" href="app-assets/css/base/typography.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/base/base.css">

    <!-- Theme -->
    <link rel="stylesheet" type="text/css" href="app-assets/css/theme/colors-dark.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/theme/theme-dark.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/custom-rtl.css">

    <!-- Layouts -->
    <link rel="stylesheet" type="text/css" href="app-assets/css/layouts/sider.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/layouts/header.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/layouts/page-content.css">
    <link rel="stylesheet" type="text/css" href="app-assets/css/components.css">
    <!-- Customizer -->
    <link rel="stylesheet" type="text/css" href="app-assets/css/layouts/customizer.css">

    <!-- Custom -->
    <link rel="stylesheet" type="text/css" href="assets/css/style.css">

    <title> <?php echo $fullname; ?> </title>

</head>

<body >
    <main class="hp-bg-color-dark-90 d-flex min-vh-100">
        <?php include 'aside.php'; ?>

        <div class="hp-main-layout">
            <?php include 'top-nav.php'; ?>
            <?php include 'mobile-nav.php'; ?>

            <div class="hp-main-layout-content">
                <div class="row mb-32 gy-32">

                  <div class="col-12">
                      <div class="row align-items-center justify-content-between g-24">
                          <div class="col-12 col-md-6">
                              <h3> <?php echo $singleCarModel; ?> Vehicles </h3>
                              <p> All <?php echo $singleCarModel; ?> Models on Cardio </p>
                          </div>
                      </div>
                  </div>

                  <div class="col-12">
                      <div class="row g-32">


                          <?php
                          foreach($newCarDetails as $SingleCAr){
                            $modelID = $SingleCAr['modelID'];
                            $modelPhoto = $SingleCAr['modelPhoto'];
                            $modelName = $SingleCAr['modelName'];

                            echo '

                            <div class="col-12 col-md-6 col-xl-4">
                                <div class="card hp-card-6 hp-eCommerceCardOne hp-eCommerceCardOne-wishlist">
                                    <div class="card-body">
                                        <div class="row">
                                            <div class="col-12">
                                                <div class="row mx-0 align-items-start justify-content-between">
                                                    <span class="badge bg-primary-4 hp-bg-dark-primary text-primary border-none w-auto py-8 px-16 fw-medium"> '.$modelName.' </span>

                                                    <div class="d-flex w-auto lh-1 hp-wish-button hp-cursor-pointer text-primary bg-primary-4 hp-bg-color-dark-danger rounded-circle remix-icon p-8">
                                                        <i class="ri-caravan-fill"></i>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-12">
                                                <div class="text-center mb-24">
                                                    <a href="#" class="d-block">
                                                        <img src="'.$modelPhoto.'" height="200" alt="" >
                                                    </a>
                                                </div>

                                                <div class="col-12 mb-16 mt-16">
                                                    <p class="mb-4 text-black-100 hp-text-color-dark-0 hp-p1-body fw-medium"> '.$modelName.' </p>
                                                    <p class="mb-0 hp-caption fw-normal text-black-80 hp-text-color-dark-30"> Model ID: #'.$modelID.' </p>
                                                </div>

                                                <div class="row g-8">

                                                    <form class="col-6" method="GET">
                                                      <input type="hidden" name="car" value="'.$modelID.'/'.$modelName.'">
                                                      <select name="model" class="form-control" required>
                                                          <option selected value="" > Choose Year </option>';

                                                          for ($x = 2009; $x <= 2023; $x++) {
                                                            echo '<option> '.$x.' </option>';
                                                          }

                                                          echo '
                                                      </select>
                                                      <br>
                                                      <button class="btn btn-primary px-12 w-100" type="submit">
                                                          <i class="ri-bank-card-line remix-icon"></i>
                                                          <span> View Pricing </span>
                                                      </button>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>


                            ';
                          }
                          ?>

                      </div>
                  </div>

                </div>
            </div>

        </div>
    </main>

    <?php include 'theme.php'; ?>

    <div class="scroll-to-top">
        <button type="button" class="btn btn-primary btn-icon-only rounded-circle hp-primary-shadow">
            <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" height="16px" width="16px" xmlns="http://www.w3.org/2000/svg">
                <g>
                    <path fill="none" d="M0 0h24v24H0z"></path>
                    <path d="M13 7.828V20h-2V7.828l-5.364 5.364-1.414-1.414L12 4l7.778 7.778-1.414 1.414L13 7.828z"></path>
                </g>
            </svg>
        </button>
    </div>

    <!-- Plugin -->
    <script src="app-assets/js/plugin/jquery.min.js"></script>
    <script src="app-assets/js/plugin/bootstrap.bundle.min.js"></script>
    <script src="app-assets/js/plugin/swiper-bundle.min.js"></script>
    <script src="app-assets/js/plugin/jquery.mask.min.js"></script>
    <script src="app-assets/js/plugin/autocomplete.min.js"></script>
    <script src="app-assets/js/plugin/moment.min.js"></script>

    <!-- Layouts -->
    <script src="app-assets/js/layouts/header-search.js"></script>
    <script src="app-assets/js/layouts/sider.js"></script>
    <script src="app-assets/js/components/input-number.js"></script>

    <!-- Base -->
    <script src="app-assets/js/base/index.js"></script>
    <!-- Customizer -->
    <script src="app-assets/js/customizer.js"></script>

    <!-- Custom -->
    <script src="assets/js/main.js"></script>

    <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

    <script type="text/javascript">
    function googleTranslateElementInit() {
      new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
    }
    </script>
</body>

</html>
