<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Gas MOR-1 - Admin</title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
    <link rel="stylesheet" href="<?=base_url()?>/assets/fontawesome-free/css/all.min.css">
    <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <link rel="stylesheet" href="<?=base_url()?>/assets/icheck-bootstrap/icheck-bootstrap.min.css">
    <link rel="stylesheet" href="<?=base_url()?>/assets/template/css/adminlte.min.css">
    <link rel="stylesheet" href="<?=base_url()?>/assets/overlayScrollbars/css/OverlayScrollbars.min.css">
    <link rel="stylesheet" href="<?=base_url()?>/assets/toastr/toastr.min.css">
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="<?=base_url()?>assets/datatables/datatables.min.css">

    <script src="<?=base_url()?>/assets/jquery/jquery.min.js"></script>
    <script src="<?=base_url()?>/assets/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="<?=base_url()?>/assets/swal2/sweetalert2.all.min.js"></script>

    <script src="<?=base_url()?>/assets/toastr/toastr.min.js"></script>
    <script src="<?=base_url()?>/assets/moment/moment.min.js"></script>
    <script src="<?=base_url()?>/assets/inputmask/jquery.inputmask.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
    <script src="<?=base_url()?>/assets/datatables/datatables.min.js"></script>
    <style>
        .select2-container .select2-selection--single {
            height: calc(2.25rem + 2px) !important;
        }
    </style>   
</head>
<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <div class="preloader flex-column justify-content-center align-items-center">
            <img class="animation__shake" src="<?=base_url()?>/src/img/pertamina.png" alt="Pertamina" height="60">
        </div>

        <nav class="main-header navbar navbar-expand navbar-white navbar-light">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
                </li> 
                <li class="nav-item d-none d-sm-inline-block">
                    <a href="<?=base_url()?>/home" class="nav-link">Home</a>
                </li>
            </ul>
            <ul class="navbar-nav ml-auto">
                <li class="nav-item dropdown">
                    <a class="nav-link" data-toggle="dropdown" href="#">
                        <i class="far fa-bell"></i>
                        <?php
                        $notif_count = 0;
                        $notif_count += count($notifikasi_pengajuan_pangkalan);
                        $notif_count += count($notifikasi_pengajuan_perubahan);
                        if ($notif_count > 0){
                        ?>
                        <span class="badge badge-danger navbar-badge"><?=$notif_count?></span>
                        <?php
                        }
                        ?>
                    </a>
                    <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                        <?php
                        foreach($notifikasi_pengajuan_pangkalan as $item):
                            $url = "";
                            $bg = "";
                            if ($item->tipe == 'revision'){
                                $url = base_url().'agen_view_pangkalan_add/'.$item->id_pangkalan;
                                $bg = "warning";
                            }elseif ($item->tipe == 'reject'){
                                $url = base_url().'agen_view_pangkalan_add/'.$item->id_pangkalan;
                                $bg = "danger";
                            }if (($item->tipe == 'approve') || ($item->tipe == 'AKTIF')){
                                $url = base_url().'agen_view_pangkalan/'.$item->id_pangkalan;
                                $bg = "success";
                            }
                        ?>
                        <a href="<?=$url?>" class="dropdown-item bg-gradient-<?=$bg?>">
                            <div class="media">
                                <div class="media-body">
                                    <h3 class="dropdown-item-title">
                                        <?=$item->pesan?>
                                        <span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span>
                                    </h3>
                                    <p class="text-sm">ID Registrasi : <?=$item->id_registrasi?></p>
                                    <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> <?=$item->tanggal?></p>
                                </div>
                            </div>
                        </a>
                        <div class="dropdown-divider"></div>
                        <?php
                        endforeach;
                        ?>

                        <?php
                        foreach($notifikasi_pengajuan_perubahan as $item):
                            $url = "";
                            $bg = "";
                            if ($item->tipe == 'revision'){
                                $url = base_url().'agen_view_pangkalan_add/'.$item->id_pangkalan;
                                $bg = "warning";
                            }elseif ($item->tipe == 'reject'){
                                $url = base_url().'agen_view_pangkalan_add/'.$item->id_pangkalan;
                                $bg = "danger";
                            }if (($item->tipe == 'approve') || ($item->tipe == 'AKTIF')){
                                $url = base_url().'agen_view_pangkalan/'.$item->id_pangkalan;
                                $bg = "success";
                            }
                        ?>
                        <a href="<?=$url?>" class="dropdown-item bg-gradient-<?=$bg?>">
                            <div class="media">
                                <div class="media-body">
                                    <h3 class="dropdown-item-title">
                                        <?=$item->pesan?>
                                        <span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span>
                                    </h3>
                                    <p class="text-sm">ID Registrasi : <?=$item->id_registrasi?></p>
                                    <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> <?=$item->tanggal?></p>
                                </div>
                            </div>
                        </a>
                        <div class="dropdown-divider"></div>
                        <?php
                        endforeach;
                        ?>
                    </div>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link" data-toggle="dropdown" href="#" alt="Profile">
                        <i class="far fa-user"></i>
                    </a>
                    <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                        <a href="<?=base_url()?>admin_pengguna" class="dropdown-item">
                            <i class="fas fa-user mr-2"></i> Accounts
                        </a>
                        <div class="dropdown-divider"></div>
                        <a href="#" class="log_out dropdown-item">
                            <i class="fas fa-lock mr-2"></i> Log Out
                        </a>
                    </div>
                </li>
                <li class="nav-item">
                    <a class="nav-link" data-widget="fullscreen" href="#" role="button">
                        <i class="fas fa-expand-arrows-alt"></i>
                    </a>
                </li>
            </ul>
        </nav>

        <aside class="main-sidebar main-sidebar elevation-4 sidebar-light-primary">
            <a href="index3.html" class="brand-link">
                <img src="<?=base_url()?>/src/img/pertamina.png" alt="Pertamina" class="img-fluid" style="opacity: .8;">&nbsp;
                <div class="font-weight-light"><b>GAS - MOR 1</b></div>
            </a>
            <div class="sidebar">
                <div class="user-panel mt-3 pb-3 mb-3 d-flex">
                    <div class="image">
                        <img src="<?=$user_foto?>" class="img-circle elevation-2" alt="User Image">
                        </div>
                        <div class="info">
                        <a href="#" class="d-block"><?=$user_data->data->nama?></a>
                    </div>
                </div>
                <nav class="mt-2">
                    <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                        <li class="nav-item">
                            <a href="<?=base_url()?>home" class="nav-link <?php echo($active_menu=='dashboard'?'active':'');?>">
                                <i class="nav-icon fas fa-tachometer-alt"></i>
                                <p>
                                    Dashboard
                                </p>
                            </a>
                        </li>
                        <li class="nav-item <?php
                            $menu_arr_agen = ['data_agen'];
                            if (in_array($active_menu,$menu_arr_agen))
                            {
                                echo 'menu-open';
                            }
                        ?>">
                            <a href="#" class="nav-link">
                                <i class="nav-icon nav-icon far fa-plus-square"></i>
                                <p>
                                    Agen
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="<?=base_url()?>admin_list_agen" class="nav-link <?php echo($active_menu=='data_agen'?'active':'');?>">
                                    <i class="nav-icon fas fa-book"></i>
                                    <p>Data Agen</p>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="nav-item">
                            <a href="#" class="nav-link">
                                <i class="nav-icon fas fa-th"></i>
                                <p>
                                    Pangkalan
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="<?=base_url()?>admin_pangkalan_aktif" class="nav-link">
                                    <i class="nav-icon fas fa-book"></i>
                                    <p>Data Pangkalan</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?=base_url()?>admin_pangkalan_pengajuan" class="nav-link">
                                    <i class="nav-icon fas fa-book"></i>
                                    <p>Pengajuan Pangkalan</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?=base_url()?>admin_perubahan_pangkalan" class="nav-link">
                                    <i class="nav-icon fas fa-book"></i>
                                    <p>Riwayat Perubahan</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?=base_url()?>admin_pengajuan_perubahan_pangkalan" class="nav-link">
                                    <i class="nav-icon fas fa-book"></i>
                                    <p>Pengajuan Perubahan</p>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="nav-item">
                            <a href="#" class="nav-link">
                                <i class="nav-icon fas fa-chart-pie"></i>
                                <p>
                                    Statistik
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="<?=base_url()?>stat_distribusi_kabupaten" class="nav-link">
                                    <i class="nav-icon fas fa-inbox"></i>
                                    <p>Distribusi Kabupaten</p>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="nav-header">Utilities</li>
                        <li class="nav-item">
                            <a href="#" class="nav-link">
                                <i class="nav-icon far fa-bell"></i>
                                <p>
                                    Notifikasi
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="<?=base_url()?>admin_notifikasi_pengajuan" class="nav-link">
                                    <i class="nav-icon far fa-envelope"></i>
                                    <p>Pengajuan Pangkalan</p>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="nav-item">
                            <a href="<?=base_url()?>admin_pengguna" class="nav-link">
                                <i class="nav-icon fas fa-user"></i>
                                <p>
                                    User Account
                                </p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="<?=base_url()?>users_admin" class="nav-link">
                                <i class="nav-icon fas fa-user"></i>
                                <p>
                                    Admin Accounts
                                </p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="#" class="log_out nav-link">
                                <i class="nav-icon fas fa-lock"></i>
                                <p>
                                    Log Out
                                </p>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </aside>
        

        