<!DOCTYPE html>    
<html lang="en">    
<head>    
    <meta charset="UTF-8">    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">    
    <title>Login CSIRT</title>  
    <link rel="icon" href="<?php echo base_url('assets/img/favicon.ico'); ?>" type="image/x-icon">    
    <link rel="stylesheet" href="<?php echo base_url('assets/css/bootstrap.min.css'); ?>">    
    <style>    
        body {    
            background-color: #f8f9fa;    
            display: flex;    
            justify-content: center;    
            align-items: center;    
            height: 100vh;    
            margin: 0;    
        }    
        .login-form {    
            background-color: #fff;    
            padding: 20px;    
            border-radius: 5px;    
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);    
            width: 100%;    
            max-width: 400px;    
        }    
        .login-form h2 {    
            margin-bottom: 20px;  
            font-family: Tahoma, Verdana, sans-serif;  
            color: #2973B2;                
        }    
        .logo {    
            width: 100px;    
            height: auto;    
            margin-right: 20px;    
        }    
        .login-header {    
            display: flex;    
            align-items: center;    
            justify-content: center;    
            margin-bottom: 20px;    
        }    
    </style>    
</head>    
<body>    
    <div class="login-form">    
        <div class="login-header">    
            <img src="<?php echo base_url('assets/img/logo_login.png'); ?>" alt="Logo" class="logo">    
            <h2 class="text-center mb-0">CSIRT</h2>    
        </div>  

        <?php   
        // Menampilkan notifikasi dengan pesan umum
        if(isset($_GET['alert'])){  
            if($_GET['alert']=="gagal"){  
                echo "<div class='alert alert-danger font-weight-bold text-center'>Login gagal. Silakan coba lagi.</div>";  
            } else if($_GET['alert']=="belum_login"){  
                echo "<div class='alert alert-danger font-weight-bold text-center'>Anda harus login terlebih dahulu!</div>";  
            } else if($_GET['alert']=="logout"){  
                echo "<div class='alert alert-success font-weight-bold text-center'>Anda telah logout!</div>";  
            }  
        }   
        ?>   

        <?php echo form_open('login/aksi', ['class' => 'form', 'autocomplete' => 'off']); ?>    

        <!-- Menambahkan CSRF Token -->
        <?php echo form_hidden($this->security->get_csrf_token_name(), $this->security->get_csrf_hash()); ?>

        <div class="form-group">    
            <label for="username">Username</label>    
            <input type="text" class="form-control" id="username" name="username" placeholder="Masukkan username anda" required>    
            <?php if (form_error('username')): ?>    
                <div class="alert alert-danger"><?php echo form_error('username'); ?></div>    
            <?php endif; ?>    
        </div>    

        <div class="form-group">    
            <label for="password">Password</label>    
            <input type="password" class="form-control" id="password" name="password" placeholder="Masukkan password anda" required>    
            <?php if (form_error('password')): ?>    
                <div class="alert alert-danger"><?php echo form_error('password'); ?></div>    
            <?php endif; ?>    
        </div>    

        <button type="submit" class="btn btn-primary btn-block">Login</button>    

        <?php echo form_close(); ?>    
    </div>  

    <script src="<?php echo base_url('assets/js/jquery.slim.min.js'); ?>"></script>    
    <script src="<?php echo base_url('assets/js/popper.min.js'); ?>"></script>    
    <script src="<?php echo base_url('assets/js/bootstrap.min.js'); ?>"></script>    

    <script>  
        // Mencegah kembali ke halaman sebelumnya  
        function preventBack() {  
            window.history.pushState(null, '', window.location.href);  
            window.onpopstate = function() {  
                window.history.pushState(null, '', window.location.href);  
            };  
        }  

        // Panggil fungsi preventBack saat halaman dimuat  
        window.onload = preventBack;  
    </script>  
</body>    
</html>