<?php
helper('html');
?>
<!doctype html>
<html lang="en">

<head>

    <meta charset="utf-8" />
    <title><?= isset($pageTitle) ? $pageTitle : 'Login'; ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
    <meta content="Themesbrand" name="author" />
    <!-- App favicon -->
    <link rel="shortcut icon" href="assets/images/favicon.ico">

    <?php
    echo link_tag('css/bootstrap.min.css');
    echo link_tag('css/icons.min.css');
    echo link_tag('css/app.css');
    echo link_tag('css/login.css');
    ?>

</head>

<body>
<div class="auth-page">
    <div class="container-fluid p-0">
        <div class="row g-0 align-items-center">
            <div class="col-xxl-4 col-lg-4 col-md-6">
                <div class="row justify-content-center g-0">
                    <div class="col-xl-9">
                        <div class="p-4">
                            <div class="card mb-0">
                                <div class="card-body">
                                    <div class="auth-full-page-content rounded d-flex p-3 my-2">
                                        <div class="w-100">
                                            <div class="d-flex flex-column h-100">
                                                <div class="mb-4>
                                                    <a href="index.html" class="d-block auth-logo">
                                                        <img src="assets/images/logo-dark.png" alt="" height="22" class="auth-logo-dark me-start">
                                                        <img src="assets/images/logo-light.png" alt="" height="22" class="auth-logo-light me-start">
                                                    </a>
                                                </div>
                                                <div class="auth-content my-auto">
                                                    <div class="text-center">
                                                        <h5 class="mb-0">BOLSA DE TRABAJO</h5>
                                                        <p class="text-muted mt-2">Registrar empresa.</p>
                                                    </div>

                                                    <?= validation_list_errors('listErrors') ?>


                                                    <?php if($registrado===false) {?>
                                                    <form class="mt-4 pt-2" action="<?= route_to('empresa.registrar') ?>" method="post">
                                                        <ul class="wizard-nav mb-5">
                                                            <li class="wizard-list-item">
                                                                <div class="list-item">
                                                                    <div class="step-icon" data-bs-toggle="tooltip" data-bs-placement="top"
                                                                         title="Datos de responsable">
                                                                        <i class="fa fa-user"></i>
                                                                    </div>
                                                                </div>
                                                            </li>
                                                            <li class="wizard-list-item">
                                                                <div class="list-item">
                                                                    <div class="step-icon" data-bs-toggle="tooltip" data-bs-placement="top"
                                                                         title="Datos de empresa">
                                                                        <i class="fa fa-building"></i>
                                                                    </div>
                                                                </div>
                                                            </li>

                                                            <li class="wizard-list-item">
                                                                <div class="list-item">
                                                                    <div class="step-icon" data-bs-toggle="tooltip" data-bs-placement="top"
                                                                         title="Datos de acceso">
                                                                        <i class="fa fa-lock"></i>
                                                                    </div>
                                                                </div>
                                                            </li>
                                                        </ul>
                                                        <!-- wizard-nav -->

                                                        <div class="wizard-tab">
                                                            <div class="text-center mb-4">
                                                                <h5>Datos de responsable</h5>
                                                            </div>
                                                            <div>
                                                                <div class="row mb-0 mt-3">
                                                                    <div class="col-12">
                                                                        <div class="form-floating mb-3">
                                                                            <input type="text" class="form-control" id="emta_responsable_documento" name="emta_responsable_documento" placeholder="Dni" value="<?= set_value('emta_responsable_documento') ?>">
                                                                            <label for="emta_responsable_documento">Dni</label>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-12">
                                                                        <div class="form-floating mb-3">
                                                                            <input type="text" class="form-control" id="emta_responsable_nombres" name="emta_responsable_nombres" placeholder="Nombres" value="<?= set_value('emta_responsable_nombres') ?>">
                                                                            <label for="emta_responsable_nombres">Nombres</label>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-12">
                                                                        <div class="form-floating mb-3">
                                                                            <input type="text" class="form-control" id="emta_responsable_primer_apellido" name="emta_responsable_primer_apellido" placeholder="Primer Apellido"  value="<?= set_value('emta_responsable_primer_apellido') ?>">
                                                                            <label for="emta_responsable_primer_apellido">Primer Apellido</label>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-12">
                                                                        <div class="form-floating mb-3">
                                                                            <input type="text" class="form-control" id="emta_responsable_segundo_apellido" name="emta_responsable_segundo_apellido" placeholder="Segundo Apellido" value="<?= set_value('emta_responsable_segundo_apellido') ?>">
                                                                            <label for="emta_responsable_segundo_apellido">Segundo Apellido</label>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-12">
                                                                        <div class="form-floating mb-3">
                                                                            <input type="text" class="form-control" id="emta_responsable_correo" name="emta_responsable_correo" placeholder="Correo de contacto" value="<?= set_value('emta_responsable_correo') ?>">
                                                                            <label for="emta_responsable_correo">Correo de contacto</label>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-12">
                                                                        <div class="form-floating mb-3">
                                                                            <input type="text" class="form-control" id="emta_responsable_telefono" name="emta_responsable_telefono" placeholder="Telefono de contacto" value="<?= set_value('emta_responsable_telefono') ?>">
                                                                            <label for="emta_responsable_telefono">Telefono de contacto</label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                        </div>
                                                        <!-- wizard-tab -->

                                                        <div class="wizard-tab">
                                                            <div>
                                                                <div class="text-center mb-4">
                                                                    <h5>Datos de la empresa</h5>
                                                                </div>
                                                                <div>
                                                                    <div class="row mb-0 mt-3">
                                                                        <div class="col-12">
                                                                            <div class="form-floating mb-3">
                                                                                <input type="text" class="form-control" id="pers_num_doc" name="pers_num_doc" placeholder="Ruc" value="<?= set_value('pers_num_doc') ?>">
                                                                                <label for="pers_num_doc">Ruc</label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-12">
                                                                            <div class="form-floating mb-3">
                                                                                <input type="text" class="form-control" id="pers_primer_nombre" name="pers_primer_nombre" placeholder="Razon Social" value="<?= set_value('pers_primer_nombre') ?>">
                                                                                <label for="pers_primer_nombre">Razon Social</label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-12">
                                                                            <div class="form-floating mb-3">
                                                                                <input type="text" class="form-control" id="pers_direccion" name="pers_direccion" placeholder="Domicilio Fiscal" value="<?= set_value('pers_direccion') ?>">
                                                                                <label for="pers_direccion">Domicilio Fiscal</label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-12">
                                                                            <div class="form-floating mb-3">
                                                                                <input type="text" class="form-control" id="emda_nombre_comercial" name="emda_nombre_comercial" placeholder="Nombre Comercial" value="<?= set_value('emda_nombre_comercial') ?>">
                                                                                <label for="emda_nombre_comercial">Nombre Comercial</label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-12">
                                                                            <div class="form-floating mb-3">
                                                                                <select class="form-control" id="emse_id" name="emse_id">
                                                                                    <?php foreach ($lsEmpresaSector as $sector) : ?>
                                                                                        <option value="<?=$sector->emse_id ?>" ><?=$sector->emse_descripcion ?></option>
                                                                                    <?php endforeach ?>
                                                                                </select>
                                                                                <label for="emse_id">Sector Empresarial</label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-12">
                                                                            <div class="form-floating mb-3">
                                                                                <select class="form-control" id="emta_id" name="emta_id">
                                                                                    <?php foreach ($lsEmpresaTamanio as $tamanio) : ?>
                                                                                        <option value="<?=$tamanio->emta_id ?>" ><?=$tamanio->emta_descripcion ?></option>
                                                                                    <?php endforeach ?>
                                                                                </select>
                                                                                <label for="emta_id">Tamaño Empresa</label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-12">
                                                                            <div class="form-floating mb-3">
                                                                                <textarea class="form-control" id="emda_descripcion" name="emda_descripcion" rows="4" style="min-height: 100px"><?= set_value('emda_descripcion') ?></textarea>
                                                                                <label for="emda_descripcion">Cuentanos mas sobre la empresa y describela</label>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div><!-- end form -->
                                                            </div>
                                                        </div>
                                                        <!-- wizard-tab -->

                                                        <div class="wizard-tab">
                                                            <div>
                                                                <div class="text-center mb-4">
                                                                    <h5>Datos de acceso</h5>
                                                                </div>
                                                                <div>
                                                                    <div class="">
                                                                        <div class="form-floating mb-3">
                                                                            <input type="text" class="form-control" id="usua_usuario" name="usua_usuario" placeholder="Correo electronico" value="<?= set_value('usua_usuario') ?>">
                                                                            <label for="usua_usuario">Correo electronico</label>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-floating  mb-3">
                                                                        <input type="password" class="form-control pe-5" id="usua_contrasena" name="usua_contrasena" placeholder="Ingrese clave">
                                                                        <label for="usua_contrasena">Clave</label>
                                                                    </div>
                                                                    <div class="form-floating  mb-3">
                                                                        <input type="password" class="form-control pe-5" id="usua_contrasena_repite" name="usua_contrasena_repite" placeholder="Repite Clave">
                                                                        <label for="usua_contrasena_repite">Repite Clave</label>
                                                                    </div>
                                                                </div><!-- end form -->

                                                            </div>
                                                        </div>
                                                        <!-- wizard-tab -->

                                                        <div class="d-flex align-items-start gap-3 mt-4">
                                                            <button type="button" class="btn btn-secondary w-sm" id="prevBtn" onclick="nextPrev(-1)">Anterior</button>
                                                            <button type="button" class="btn btn-primary w-sm ms-auto" id="nextBtn" onclick="nextPrev(1)">Siguiente</button>
                                                            <button type="submit" class="btn btn-primary w-sm ms-auto" id="enviar">Enviar</button>
                                                        </div>
                                                    </form>

                                                    <div class="mt-4 pt-3 text-center">
                                                        <div class="signin-other-title">
                                                            <h5 class="font-size-14 mb-4 text-muted fw-medium">- O inicia sesion -</h5>
                                                        </div>

                                                        <div class="d-flex gap-2">
                                                            <a type="button" class="btn btn-soft-primary waves-effect waves-light w-100" href="/login">
                                                                <i class="fa fa-user-tie font-size-16 align-middle"></i> Iniciar sesion
                                                            </a>
                                                        </div>
                                                    </div>

                                                    <?php }else{ ?>

                                                        <div class="mt-4 pt-3 text-center">

                                                            <?php if($registradoError == ''){?>
                                                            <div class="alert alert-success" role="alert">
                                                                El usuario se registro correctamente, ingrese a su bandeja de correo y confirme el registro para activar su usuario.
                                                            </div>
                                                            <?php }else{?>

                                                                <?php if($registradoError == 'VALIDADO'){?>
                                                                    <div class="alert alert-success" role="alert">
                                                                        El usuario se activo correctamente, ya puede iniciar sesión.
                                                                    </div>
                                                                <?php }else{?>
                                                                    <div class="alert alert-danger" role="alert">
                                                                        <?=$registradoError?>
                                                                    </div>
                                                                <?php }?>

                                                            <?php }?>

                                                            <div class="d-flex gap-2">
                                                                <a type="button" class="btn btn-soft-primary waves-effect waves-light w-100" href="/login">
                                                                    <i class="fa fa-user-tie font-size-16 align-middle"></i> Iniciar sesion
                                                                </a>
                                                            </div>
                                                        </div>

                                                    <?php }?>

                                                </div>
                                                <div class="mt-4 text-center">

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- end auth full page content -->
            </div>
            <!-- end col -->
            <div class="col-xxl-8 col-lg-8 col-md-6">
                <div class="col-sm-12" style="background-color: red">

                </div>
                <div class="auth-bg bg-white py-md-5 p-4 d-flex">
                    <div class="bg-overlay bg-white"></div>
                    <!-- end bubble effect -->
                    <div class="row justify-content-center align-items-center">
                        <div class="col-xl-8">
                            <div class="mt-4">
                                <?php echo img('images/login-img.png', false, ['class'  => 'img-fluid',]); ?>
                            </div>
                            <div class="p-0 p-sm-4 px-xl-0 py-5">
                                <div id="reviewcarouselIndicators" class="carousel slide auth-carousel" data-bs-ride="carousel">
                                    <div class="carousel-indicators carousel-indicators-rounded">
                                        <button type="button" data-bs-target="#reviewcarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
                                    </div>

                                    <!-- end carouselIndicators -->
                                    <div class="carousel-inner w-75 mx-auto">

                                        <div class="carousel-item active">
                                            <div class="testi-contain text-center">
                                                <h5 class="font-size-20 mt-4">
                                                </h5>
                                                <p class="font-size-15 text-muted mt-3 mb-0"></p>
                                            </div>
                                        </div>

                                    </div>
                                    <!-- end carousel-inner -->
                                </div>
                                <!-- end review carousel -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- end col -->
        </div>
        <!-- end row -->
    </div>
    <!-- end container fluid -->
</div>

<?php
echo script_tag('js/libs/bootstrap.bundle.min.js');
echo script_tag('js/libs/metismenujs.min.js');
echo script_tag('js/libs/simplebar.min.js');
echo script_tag('js/libs/eva.min.js');

echo script_tag('js/libs/pass-addon.init.js');
echo script_tag('js/libs/eva-icon.init.js');
echo script_tag('js/modulos/registrar_empresa.js');

?>

</body>
</html>