<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Log in</title>
    <link rel="icon" href="<?= base_url() ?>assets/images/favicon.png" type="image/png" />
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Font Awesome -->
    <link rel="stylesheet" href="<?= base_url(); ?>assets/plugins/fontawesome-free/css/all.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<?= base_url(); ?>assets/dist/css/adminlte.min.css">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head>

<body class="hold-transition login-page" style="background-color: #CCF630;">
    <div class="row">
        <div class="col-md-6">

            <img class="img-fluid rounded" src="<?= base_url(); ?>/assets/images/Field@3x.png" alt="">
        </div>
        <div class="col-md-6">
            <div class="login-box" style="height: 100%; width: 100%;">



                <div class="row">
                    <?php $successMessage = $this->session->flashdata('successmessage');
                    $warningmessage = $this->session->flashdata('warningmessage');
                    if (isset($successMessage)) {
                        echo '<div id="alertmessage" class="col-md-12">
                    <div class="alert alert-success alert-dismissible">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            ' . output($successMessage) . '
                            </div>
                    </div>';
                    }
                    if (isset($warningmessage)) {
                        echo '<div id="alertmessage" class="col-md-12">
                    <div class="alert alert-warning alert-dismissible">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            ' . output($warningmessage) . '
                            </div>
                    </div>';
                    }
                    ?>
                </div>
                <!-- /.login-logo -->

                <div class="card rounded    " style="height:100%">
                    <div class="card-body login-card-body rounded" style="background-color: #612F6C;">
                        <h3 class="login-box-msg" style="color: white;">Audio Book</h3>


                        <form action="<?= base_url() . 'login/login_action'; ?>" method="post">
                            <div class="input-group mb-3">
                                <input type="text" name="email" required class="form-control" placeholder="Email" value="<?= set_value('email', $this->session->flashdata('email')); ?>">
                                <div class="input-group-append">
                                    <div class="input-group-text">
                                        <span class="fas fa-envelope"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="input-group mb-3">
                                <input type="password" name="password" class="form-control" placeholder="Password" required>
                                <div class="input-group-append">
                                    <div class="input-group-text">
                                        <span class="fas fa-lock"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="row justify-content-center">

                                <!-- /.col -->
                                <div class="col-md-6">
                                    <button type="submit" class="btn btn-block" style="background-color: #fff;color:#612F6C;font-weight:700;">Sign In</button>
                                </div>
                                <!-- /.col -->
                            </div>
                        </form>
                        <div class="row justify-content-center mt-3">
                        <div class="col-md-6 d-flex justify-content-center">
                            <a class="text-white" href="<?= base_url(); ?>login/signup" >Ready to Join? Click Here to <b>Sign Up</b></a>
                        </div>
                        </div>
                    </div>
                    <!-- /.login-card-body -->
                </div>
            </div>
        </div>
    </div>

    <!-- /.login-box -->

    <!-- jQuery -->
    <script src="<?= base_url(); ?>assets/plugins/jquery/jquery.min.js"></script>
    <!-- Bootstrap 4 -->
    <script src="<?= base_url(); ?>assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>

</body>

</html>