<div class="row mt-1">
   <form id="form_edit_empresas" action="" method="post" accept-charset="utf-8">
      <!-- Token CSRF -->
      <input type="hidden" name="csrf_test_name" value="<?= csrf_hash(); ?>">

      <div class="row g-2 mb-2">
         <div class="col-lg-2">
            <div class="form-floating">
               <input type="text" class="form-control" name="id_empresa" placeholder=" " maxlength="5" required value="<?php if (isset($empresa['id'])) { echo $empresa['id']; } ?>">
               <label for="id_empresa">Id Empresa</label>
            </div>
         </div>
         <div class="col-lg-3">
            <div class="form-floating">
               <input type="text" class="form-control" name="telefono1" placeholder="+58 414-3326009" maxlength="25" required value="<?php if (isset($empresa['telefono1'])) { echo $empresa['telefono1']; } ?>">
               <label for="telefono1">Telefono **WhatsApp</label>
            </div>
         </div>
         <div class="col-lg-4">
            <div class="form-floating">
               <input type="text" class="form-control" name="contacto" placeholder=" "  value="<?php if (isset($empresa['contacto'])) { echo $empresa['contacto']; } ?>">
               <label for="contacto">Nombre y Apellido</label>
            </div>
         </div>
      </div>

      <div class="row g-2 mb-2">
         <div class="col-lg-2">
            <div class="form-floating">
               <input type="text" class="form-control" name="rif" placeholder=" " style="text-transform: uppercase;" maxlength="15" maxlength="20" required value="<?php if (isset($empresa['rif'])) { echo $empresa['rif']; } ?>" >
               <label for="rif">Rif</label>
            </div>
         </div>
         <div class="col-lg-4">
            <div class="form-floating">
               <input type="text" class="form-control" name="razonsocial" placeholder=" " required value="<?php if (isset($empresa['razonsocial'])) { echo $empresa['razonsocial']; } ?>">
               <label for="razonsocial">Razon Social</label>
            </div>
         </div>
         <div class="col-lg-3">
            <div class="form-floating">
               <input type="text" class="form-control" name="telefono2" placeholder="+58 414-3326009" maxlength="25" value="<?php if (isset($empresa['telefono2'])) { echo $empresa['telefono2']; } ?>">
               <label for="telefono2">Telefono 2</label>
            </div>
         </div>
         <div class="col-lg-3">
            <div class="form-floating">
               <input type="text" class="form-control" name="nombrecorto" placeholder=" " value="<?php if (isset($empresa['nombrecorto'])) { echo $empresa['nombrecorto']; } ?>" >
               <label for="nombrecorto">Nombre Corto</label>
            </div>
         </div>
         <div class="col-lg-6">
            <div class="form-floating">
               <input type="email" class="form-control" name="email" placeholder=" " value="<?php if (isset($empresa['email'])) { echo $empresa['email']; } ?>">
               <label for="email">Email address</label>
            </div>
         </div>
         <div class="col-lg-6">
            <div class="form-floating">
              <textarea class="form-control" id="direccion" name="direccion"><?php if (isset($empresa['direccion'])) { echo $empresa['direccion']; } ?></textarea>
              <label for="direccion">Direccion</label>
            </div>
         </div>
      </div>

      <hr>
      <div class="row g-2">
         <div class="col-lg-4">
           <label for="formFile" class="form-label">Logo Principal</label>
           <input class="form-control" type="file" id="file_input_logo" name="logo" value="<?php if (isset($empresa['logo'])) { echo $empresa['logo']; } ?>">
           <div class="row justify-content-center">
            <div class="card " style="width:50%;">
                  <img id="img_file_input_logo" class="p-2" onclick="ver_img()" src="<?php if (isset($empresa['logo'])) {echo base_url() ?>assets/epscolor/img/empresas/<?php echo $empresa['logo'] ; } ?>" alt="Logo" />
            </div>
           </div>
         </div>
         <div class="col-lg-4">
           <label for="formFile" class="form-label">Logo 2</label>
           <input class="form-control" type="file" id="file_input_logo2" name="logo2" value="<?php if (isset($empresa['logo2'])) { echo $empresa['logo2']; } ?>">
           <div class="row justify-content-center">
            <div class="card " style="width:50%;">
              <img id="img_file_input_logo2" class="p-2" onclick="ver_img()" src="<?php if (isset($empresa['logo2'])) {echo base_url() ?>assets/epscolor/img/empresas/<?php echo $empresa['logo2'] ; } ?>" alt="Logo" />
            </div>           
           </div>
         </div>
         <div class="col-lg-4">
           <label for="formFile" class="form-label">Logo White</label>
           <input class="form-control" type="file" id="file_input_logow" name="logow" value="<?php if (isset($empresa['logowhite'])) { echo $empresa['logowhite']; } ?>">
           <div class="row justify-content-center">
            <div class="card bg-dark " style="width:50%;">
               <img id="img_file_input_logow" class="p-2" onclick="ver_img()" src="<?php if (isset($empresa['logowhite'])) {echo base_url() ?>assets/epscolor/img/empresas/<?php echo $empresa['logowhite'] ; } ?>" alt="Logow" />
            </div>
           </div>
         </div>

         
         <div class="form-check form-switch">
           <input class="form-check-input" type="checkbox" role="switch" id="check_activo" name="check_activo"<?php if (isset($empresa['activo'])) { if ($empresa['activo'] == 1) { echo 'checked'; } } ?>>
           <label class="form-check-label" for="check_activo">Activo</label>
         </div>
      </div>

      <hr>
      <div class="d-flex justify-content-between">
         <div></div>
         <div><button type="submit" class="btn btn-secondary">Enviar</button></div>
         
      </div>
   </form>
</div>
