<?php 
    if($this -> session -> ci_usrid) {
        $this -> app -> autoupdate();
    }

    $uri1 = $this -> uri -> segment(1);
    $uri2 = $this -> uri -> segment(2);
    $uris = $this -> uri -> uri_string();

    if($uri1 == '') {
        $css = '
            <link rel="stylesheet" href="'.base_url().'assets/css/home.css">
        ';        
    } else if($uri1 == 'detail' && $uri2 == 'produk') {
        $css = '
             <link rel="stylesheet" href="'.base_url().'assets/css/detail.css">
        ';
    }  else if($uri1 == 'produk') {
        $css = '
             <link rel="stylesheet" href="'.base_url().'assets/css/produk.css">
        ';
    } else if($uri1 == 'keranjang' || $uri1 == 'pembayaran') {
        $css = '
             <link rel="stylesheet" href="'.base_url().'assets/css/keranjang.css">
        ';
    } else if($uri1 == 'auth') {
        $css = '
             <link rel="stylesheet" href="'.base_url().'assets/css/login.css">
        ';
    } else if($uri1 == 'akun' || $uri1 == 'tagihan') {
        $css = '
             <link rel="stylesheet" href="'.base_url().'assets/css/akun.css">
        ';
    } else {
        $css = '';
    }
    
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <?php if($uri1 != 'detail' && $uri2 != 'produk') : ?>
        <meta content="#6475d3" name="msapplication-navbutton-color">
        <meta content="#6475d3" name="apple-mobile-web-app-status-bar-style">
        <meta content="#6475d3" name="theme-color">
    <?php endif ?>

    <!-- css -->
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/font/fa/css/all.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/owlcarousel/dist/assets/owl.carousel.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/owlcarousel/dist/assets/owl.theme.default.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/select2/dist/css/select2.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/select2/dist/css/select2-bootstrap-5-theme.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/css/mod.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/css/main.css">
    <?= $css ?>
    <link rel="stylesheet" href="<?= base_url() ?>assets/css/media.css">

    <link rel="shortcut icon" href="<?= base_url() ?>assets/img/logo-circle.png" type="image/x-icon">
    
    <title><?= $title ?></title>

    <style>
        .text-img {
            width: 100%;
            height: 100%;
        }
        .opacity-0-5 {
            opacity: 0.5;
        }
        .w-px-30 {
            width: 30px !important;
        }
        .w-px-50 {
            width: 50px !important;
        }
        .w-px-100 {
            width: 90px !important;
        }
        .w-px-120 {
            width: 120px !important;
        }
        .w-px-200 {
            width: 200px !important;
        }
        #modal_src .src-mod-inp {
            border: 1px solid #ccc;
            width: 100%;
            outline: none;
            border-radius: 5px;
            padding: 7px 10px;
        }
        .modal .close {
            border: 0;
            outline: none;
            background-color: transparent;
            margin-right: 15px;
            font-size: 18px;
        }
        
    </style>

    <!-- JS -->
    <script src="<?= base_url() ?>assets/vendor/jQuery/jquery-3.6.0.min.js"></script>
    <script src="<?= base_url() ?>assets/vendor/jQuery/lazyLoad/jquery.lazy.min.js"></script>
    <script src="<?= base_url() ?>assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="<?= base_url() ?>assets/vendor/owlcarousel/dist/owl.carousel.min.js"></script>
    <script src="<?= base_url() ?>assets/vendor/sweetalert2/dist/sweetalert2.all.min.js"></script>
    <script src="<?= base_url() ?>assets/vendor/sweetalert2/dist/sweetalert2.all.min.js"></script>
    <script src="<?= base_url() ?>assets/vendor/select2/dist/js/select2.full.min.js"></script>


    <script>
        let base_url = '<?= site_url() ?>';
        let w        = $(window);                
    </script>
</head>
<?php if(isset($loading)) : ?>
    <body class="o-hidden">
        <div class="loading">
            <div class="animasi"></div>
        </div>
<?php else: ?>
    <body>
<?php endif ?>
   
      