<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); ?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?= $page_title.' | '.$Settings->site_name; ?></title>
    <link rel="shortcut icon" href="<?= $assets ?>img/iconoFSFT.png"/>
    <script type="text/javascript">if (parent.frames.length !== 0) { top.location = '<?=site_url('login')?>'; }</script>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
</head>

<style type="text/css" media="screen">
    *{
    font-family: 'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;
    }
    body{
        background-image: url('<?= $assets ?>img/imagee.png');
        background-position: unset ;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: 100% 100%;
        background-color: #ffffff ;
    }
    @media (max-width: 770px) { 
        body{
            background-image: unset;
        }
    }
</style>
<body background="#5569A8">
    <div class="mt-5 container ">
        <div class="row justify-content-center align-items-center"> 
            <div class="card text-center pt-2 bg-transparent border-0 shadow" style="width: 25rem;">
                <center><img src="<?= $assets ?>img/logo.png" class="card-img-top" alt="..." style="max-width: 10rem;"></center>
                <h5 class="text-secondary pt-2 pb-4">Sistema de gestión para empresas</h5>
                <?php if($logueo["estado"]== 1){?>
                <div class="pt-0 card-body align-items-center">
                    <?php if($error)  { ?>
                        <div class=" alert alert-danger fade show mb-0" role="alert">
                            <span style="font-size: 14px"><?= $error; ?></span>
                            <?php $this->session->sess_destroy(); ?>
                        </div>
                    <?php } if($message) { ?>
                        <div class=" alert alert-success fade show mb-0" role="alert">
                            <span style="font-size: 14px"><?= $message; ?></span>
                        </div>
                    <?php } ?>

                    <span class="text-muted"><small><?= lang('login_to_your_account'); ?></small></span>
                    <?= form_open("auth/login"); ?>
                        <div class="mt-2 mr-4 ml-4 align-items-center">
                            <div class="form-group has-feedback">
                                <?php
                                    $count = 0;
                                    $lc[''] = lang("select")." ".lang('local');
                                    foreach($locals as $local) {
                                        $lc[$local->id] = $local->name;
                                        $count = $count + 1;
                                    }
                                    $local = "";
                                    if($count == 1){
                                        $local = 1;
                                    }
                                ?>
                                <?= form_dropdown('local', $lc, set_value('local', $local), 'class="mb-2 form-control rounded-0" id="local"  required="required" style="width:100%;font-size: 14px;"'); ?>
                            </div>
                            <input style="font-size: 14px;" type="email" name="identity" class="mb-2 form-control rounded-0" placeholder="<?= lang('email'); ?>">
                            <input style="font-size: 14px;" type="password" name="password" class="mb-2 form-control rounded-0" placeholder="<?= lang('password'); ?>">
                            <button style="font-size: 14px;background-color: #9fc10b;color: #004785;" class="btn btn-block rounded-0" type="submit"><b><?= lang('sign_in'); ?></b></button>
                        </div>
                    <?= form_close(); ?><hr>
                    <span style="font-size: 14px" class="text-secondary"><?= lang('forgot_your_password'); ?> <?= lang('dont_worry'); ?> <br>
                        <a  data-toggle="modal" data-target="#myModal" href="#" class="" style="color: #004785;"><?= lang('click_here'); ?></a>
                    </span>
                </div>
                <?php } else{?>
                <div class="pt-0 card-body align-items-center">
                    <div class="login-box-body">
                        <br/>
                        <br/>
                        <br/>
                        <?php if($logueo["estado"]== 2){?>
                        <center><label style="color:red;">El servicio se encuentra suspendido por mantener una deuda pendiente.</label></center>
                        <?php }if($logueo["estado"]== 3){?>
                            <center><label style="color:red;">El sistema fue dado de baja, por favor comunicarse con el administrador.</label></center>
                        <?php }?>

                        <br/>
                        <br/>
                        <br/>
                    </div>
                </div>        
                <?php }?>

            </div>
        </div>     
    </div> 
    <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <?php echo form_open("auth/forgot_password"); ?>
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalCenterTitle"><?= lang('forgot_password'); ?></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <span><?= lang('forgot_password_heading'); ?></span>
                    <input type="email" name="forgot_email" placeholder="<?= lang('email'); ?>" autocomplete="off" class="form-control rounded-0">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-sm btn-danger" data-dismiss="modal"><?= lang('close'); ?></button>
                    <button type="submit" class="btn btn-sm btn-success"><?= lang('submit'); ?></button>
                </div>
                <?php echo form_close(); ?>
            </div>
        </div>
    </div>
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</body>
</html>
