Merge branch 'main' into 'feat/edit_factura'

Main

See merge request jjimenez/safekat!292
This commit is contained in:
2024-07-17 07:55:06 +00:00
19 changed files with 386 additions and 2356 deletions

View File

@ -13,6 +13,7 @@ declare(strict_types=1);
namespace Config;
use App\Entities\Usuarios\UsersEntity;
use App\Models\UserModel;
use CodeIgniter\Shield\Authentication\Passwords\ValidationRules;
use CodeIgniter\Shield\Config\Auth as ShieldAuth;

View File

@ -1,4 +1,4 @@
<?php namespace App\Controllers\Configuracion;
<?php namespace App\Controllers\Configuracion;
use App\Entities\Usuarios\UserEntity;
@ -8,15 +8,17 @@ use App\Models\Usuarios\GroupModel;
use App\Models\UserModel;
use App\Models\Usuarios\GroupsUsersModel;
use CodeIgniter\Shield\Entities\User;
use function PHPUnit\Framework\isNull;
class Users extends \App\Controllers\GoBaseController {
class Users extends \App\Controllers\GoBaseController
{
private $group_model;
private $group_user_model;
private $user_model;
use \CodeIgniter\API\ResponseTrait;
use \CodeIgniter\API\ResponseTrait;
protected static $primaryModelName = 'App\Models\UserModel';
@ -29,9 +31,9 @@ class Users extends \App\Controllers\GoBaseController {
protected $indexRoute = 'userList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->group_model = new GroupModel();
$this->group_user_model = new GroupsUsersModel();
@ -46,72 +48,80 @@ class Users extends \App\Controllers\GoBaseController {
];
parent::initController($request, $response, $logger);
}
public function index() {
public function index()
{
$this->viewData['usingClientSideDataTable'] = true;
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Users.user')]);
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Users.user')]);
$this->viewData['user_model'] = $this->user_model;
$this->viewData['userList2'] = $this->user_model->getUsersList();
$this->viewData['userList2'] = auth()->getProvider()->findAll();
parent::index();
}
public function add() {
public function add()
{
if ($this->request->getPost()) :
$postData = $this->request->getPost();
$currentGroups = $postData['group']??[];
// Obtener contraseña nueva si se ha introducido en texto plano
if (empty($postData['new_pwd'])) {
$postData['password'] = 'Safekat2024'; // Contraseña por defecto
}else{
$postData['password'] = $postData['new_pwd'];
}
// Obtener los grupos a los que pertenece
$currentGroups = $postData['group'] ?? [];
unset($postData['group']);
// Generar el nombre de usuario
$postData['username'] = strstr($postData['email'], '@', true);
$sanitizedData = $this->sanitized($postData, true);
$sanitizedData = $this->sanitized($postData, true);
$noException = true;
// Obtener proveedor de usuarios
$users = auth()->getProvider();
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()) :
if ($this->canValidate()) :
try {
try {
$user = new User([
'username' => $sanitizedData['username'],
'first_name' => $sanitizedData['first_name'],
'last_name' => $sanitizedData['last_name'],
'email' => $sanitizedData['email'],
'password' => 'Safekat2024',
'status' => $sanitizedData['status']??0,
'active' => $sanitizedData['active']??0,
'email' => $sanitizedData['email'],
'password' => $sanitizedData['password'],
'status' => $sanitizedData['status'] ?? 0,
'active' => $sanitizedData['active'] ?? 0,
]);
$users->save($user);
$successfulResult = true; // Hacked
} catch (\Exception $e) {
$noException = false;
//$this->dealWithException($e);
} catch (\Exception $e) {
$noException = false;
//$this->dealWithException($e);
if (strpos($e->getMessage(), 'correo duplicado') !== false) {
$this->viewData['errorMessage'] = "El correo electrónico ya está registrado en el sistema";
$this->session->setFlashdata('formErrors', $this->model->errors());
}
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Users.user'))]);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Users.user'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
$id = $users->getInsertID();
$this->group_user_model->where('user_id', $id)->delete();
foreach($currentGroups as $group){
foreach ($currentGroups as $group) {
$group_user_data = [
'user_id' => $id,
'group' => $group
@ -119,8 +129,7 @@ class Users extends \App\Controllers\GoBaseController {
$this->group_user_model->insert($group_user_data);
}
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Users.user'))]) . 'Downloads';
$message .= anchor(route_to('editUser', $id), lang('Basic.global.continueEditing').'?');
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Users.user'))]) . '.';
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
@ -141,88 +150,92 @@ class Users extends \App\Controllers\GoBaseController {
$this->viewData['clienteList'] = $this->getClienteListItems();
$this->viewData['formAction'] = route_to('createUser');
$this->viewData['groups'] = $this->group_model->select('keyword, title')->findAll();
$this->viewData['boxTitle'] = lang('Basic.global.addNew') .lang('Users.user').' '.lang('Basic.global.addNewSuffix');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Users.user') . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null) {
if ($requestedId == null) :
public function edit($requestedId = null)
{
if ($requestedId == null) {
return $this->redirect2listView();
endif;
}
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$user = $this->model->find($id);
$users = auth()->getProvider();
$user = $users->findById($id);
if ($user == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Users.user')), $id]);
return $this->redirect2listView('errorMessage', $message);
endif;
if ($this->request->getPost()) :
$postData = $this->request->getPost();
$currentGroups = $postData['group'];
$currentGroups = $postData['group'] ?? [];
unset($postData['group']);
// Obtener contraseña nueva si se ha introducido en texto plano
// Obtener contraseña nueva si se ha introducido en texto plano
if (!empty($postData['new_pwd'])) {
$postData['password'] = $postData['new_pwd'];
}
$sanitizedData = $this->sanitized($postData, true);
if ($this->request->getPost('status') == 0 ) {
if ($this->request->getPost('status') == 0) {
$sanitizedData['status'] = null;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()) :
if ($this->canValidate()) :
try {
if ($this->canValidate()) :
try {
if (in_array('cliente-editor', $currentGroups) || in_array('cliente-administrador', $currentGroups)) {
if(!array_key_exists('cliente_id', $sanitizedData) || is_null($sanitizedData['cliente_id'])) {
if (!array_key_exists('cliente_id', $sanitizedData) || is_null($sanitizedData['cliente_id'])) {
$this->viewData['errorMessage'] = lang('Users.errors.cliente_sin_clienteID');
$this->session->setFlashdata('formErrors', $this->model->errors());
$successfulResult = false;
} else {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
}
else{
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
}
}
else {
} else {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
}
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Users.user'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Users.user'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
$user->fill($sanitizedData);
$thenRedirect = false;
endif;
$user->fill($sanitizedData);
$users->save($user);
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
$this->group_user_model->where('user_id', $user->id)->delete();
foreach($currentGroups as $group){
foreach ($currentGroups as $group) {
$group_user_data = [
'user_id' => $user->id,
'group' => $group
];
$this->group_user_model->insert($group_user_data);
}
$id = $user->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Users.user'))]) . 'Downloads';
$message .= anchor(route_to('editUser', $id), lang('Basic.global.continueEditing').'?');
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Users.user'))]) . '.';
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
@ -234,7 +247,7 @@ class Users extends \App\Controllers\GoBaseController {
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
@ -243,13 +256,14 @@ class Users extends \App\Controllers\GoBaseController {
$this->viewData['formAction'] = route_to('updateUser', $id);
$this->viewData['selectedGroups'] = $this->group_model->getUsersRoles($requestedId);
$this->viewData['groups'] = $this->group_model->select('keyword, title')->findAll();
$this->viewData['boxTitle'] = lang('Basic.global.edit2') .lang('Users.user').' '.lang('Basic.global.edit3');
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Users.user') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function delete($requestedId = null, bool $deletePermanently = true) {
public function delete($requestedId = null, bool $deletePermanently = true)
{
if ($requestedId == null) :
return $this->redirect2listView();
@ -264,26 +278,25 @@ class Users extends \App\Controllers\GoBaseController {
endif;
$users = auth()->getProvider();
$users->delete($user->id, $deletePermanently);
$users->delete($user->id);
$message = "Usuario eliminado correctamente";
return $this->redirect2listView('successMessage', $message);
} // end function delete(...)
public function allItemsSelect() {
public function allItemsSelect()
{
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id_user';
$menu = $this->model->getAllForMenu($reqVal.', first_name', 'first_name', $onlyActiveOnes, false);
$menu = $this->model->getAllForMenu($reqVal . ', first_name', 'first_name', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id_user = '';
$nonItem->first_name = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$nonItem->first_name = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
@ -296,8 +309,9 @@ class Users extends \App\Controllers\GoBaseController {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems() {
public function menuItems()
{
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
@ -308,8 +322,8 @@ class Users extends \App\Controllers\GoBaseController {
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
@ -323,10 +337,11 @@ class Users extends \App\Controllers\GoBaseController {
}
}
public function getMenuComerciales(){
public function getMenuComerciales()
{
if ($this->request->isAJAX()) {
$comerciales = $this->model->getComerciales();
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
@ -339,15 +354,16 @@ class Users extends \App\Controllers\GoBaseController {
}
}
protected function getPaisListItems() {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Pais.pais'))])];
protected function getPaisListItems()
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Pais.pais'))])];
$paisModel = model('App\Models\Configuracion\PaisModel');
$registers = $paisModel->findAll();
return $registers;
}
return $registers;
}
protected function getClienteListItems($selId = null)
{
@ -362,5 +378,5 @@ class Users extends \App\Controllers\GoBaseController {
endif;
return $data;
}
}

View File

@ -7,91 +7,81 @@ use App\Models\UserModel;
class Profile extends BaseController
{
private $user_model;
private $id_user;
function __construct()
{
$this->user_model = new UserModel();
$this->id_user = auth()->user()->id;
}
public function index()
{
helper('file');
helper('form');
helper('text');
$data['title'] = [
'module' => lang("App.profile_title"),
'page' => lang("App.profile_subtitle"),
'icon' => 'fas fa-user'
];
$data['breadcrumb'] = [
['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false],
['title' => lang("App.profile_title"), 'route' => "", 'active' => true]
];
$data['btn_return'] = [
'title' => lang("App.global_come_back"),
'route' => '/',
'class' => 'btn btn-dark mr-1',
'icon' => 'fas fa-angle-left'
];
// Get the User Provider (UserModel by default)
$users = auth()->getProvider();
$data['btn_submit'] = [
'title' => lang("App.global_save"),
'route' => '',
'class' => 'btn btn-primary mr-1',
'icon' => 'fas fa-save'
];
// Find by the user_id
$data['obj'] = $users->findById(auth()->id());
$session = session();
$data['obj'] = $this->user_model->where('id', $this->id_user)->first();
echo view(getenv('theme.path') . 'form/profile/index', $data);
echo view(getenv('theme.path') . 'form/profile/profileDetails', $data);
}
public function store()
{
$session = session();
helper('form');
$rules = [
'first_name' => 'required',
'last_name' => 'required',
'new_pwd' => 'permit_empty|min_length[8]',
'new_pwd_confirm' => 'required_with[new_pwd]|matches[new_pwd]'
];
// Definir los mensajes de error personalizados
$rules_error = [
'first_name' => ['required' => lang("App.profile_rules_first_name_r")],
'last_name' => ['required' => lang("App.profile_rules_last_name_r")],
'new_pwd' => ['min_length' => lang("App.profile_rules_password_m")],
'new_pwd_confirm' => [
'matches' => lang("App.profile_rules_password_confirm_m")
]
];
if ($this->validate($rules ?? [], $rules_error ?? [])) {
if (!empty($this->id_user)) {
$this->user_model->save([
'id' => $this->id_user,
'first_name' => $this->request->getPost('first_name'),
'last_name' => $this->request->getPost('last_name')
]);
$session->setFlashdata('sweet', ['success', lang("App.global_alert_save_success")]);
} else {
$session->setFlashdata('sweet', ['error', lang("App.global_alert_save_error")]);
}
} else {
$session->setFlashdata('error', 'error');
return $this->index();
// Validar la entrada
if (!$this->validate($rules, $rules_error)) {
// Si la validación falla, redirigir de vuelta con errores
return redirect()->back()->withInput()->with('errors', $this->validator->getErrors());
}
return redirect()->to('/profile');
// Obtener los valores de los campos
$firstName = $this->request->getPost('first_name');
$lastName = $this->request->getPost('last_name');
$newPwd = $this->request->getPost('new_pwd');
$update_data = [
'first_name' => $firstName,
'last_name' => $lastName,
'password' => $newPwd,
];
if(empty($newPwd)){
unset($update_data['password']);
}
// Aquí debes obtener el usuario actual, por ejemplo, desde la sesión
$users = auth()->getProvider();
$user = $users->findById(auth()->id());
$user->fill($update_data);
$users->save($user);
// Redirigir con un mensaje de éxito
return redirect()->back()->with('success', lang('App.profile_updated_successfully'));
}
}

View File

@ -24,18 +24,25 @@ class UserEntity extends \CodeIgniter\Entity\Entity
"cliente_id" => "int",
"active" => "boolean",
];
/**
* Returns a full name: "first last"
* Get the full name of the user
*
* @return string
* If the first name and last name are available, the full name is generated as "{first name} {last name}".
* If the first name or last name is missing, only the available name is used.
* If both the first name and last name are missing, the username is used as the full name.
*
* @return string The full name of the user
*/
public function getFullName()
{
$fullName =
(!empty($this->attributes["first_name"]) ? trim($this->attributes["first_name"]) . " " : "") .
(!empty($this->attributes["last_name"]) ? trim($this->attributes["last_name"]) : "");
$name = empty($fullName) ? $this->attributes["username"] : $fullName;
return $name;
$firstName = trim($this->attributes["first_name"] ?? "");
$lastName = trim($this->attributes["last_name"] ?? "");
$fullName = $firstName . ' ' . $lastName;
$fullName = trim($fullName); // In case first name is empty, this will remove the leading space
// Use the username attribute if the full name is still empty after trimming
return $fullName ?: $this->attributes["username"];
}
/**

View File

@ -1,16 +1,30 @@
<?php
namespace App\Entities\Usuarios;
use CodeIgniter\Entity;
use CodeIgniter\Shield\Entities\User;
class UsersEntity extends User
{
protected $attributes = [
"first_name" => null,
"last_name" => null
'first_name' => null,
'last_name'=> null,
'cliente_id' => null,
'comments' => null,
];
protected $casts = [
"cliente_id" => "int",
];
public function getFullName()
{
$firstName = trim($this->attributes["first_name"] ?? "");
$lastName = trim($this->attributes["last_name"] ?? "");
$fullName = $firstName . ' ' . $lastName;
$fullName = trim($fullName); // In case first name is empty, this will remove the leading space
// Use the username attribute if the full name is still empty after trimming
return $fullName ?: $this->attributes["username"];
}
}

View File

@ -137,9 +137,9 @@ return [
"profile_mobile" => "Teléfono Móvil",
"profile_mobile_ph" => "Escriba su número de celular",
"profile_password" => "Cambiar Contraseña",
"profile_password_ph" => "Escribe tu contraseña",
"profile_confirm_password" => "Confirmar seña",
"profile_confirm_password_ph" => "Confirma tu contraseña anterior",
"profile_password_ph" => "Escribe nueva contraseña para cambiarla",
"profile_confirm_password" => "Confirmar contraseña",
"profile_confirm_password_ph" => "Confirma tu contraseña anterior para cambiarla",
"profile_date_birth" => "Fecha de Nacimiento",
"profile_date_birth_ph" => "Seleccionar fecha de nacimiento",
"profile_address" => "Dirección",

View File

@ -153,18 +153,6 @@ return [
],
'tfa_code' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'tfa_secret' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'email' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Models;
use App\Entities\Usuarios\UsersEntity;
use CodeIgniter\Shield\Models\UserModel as ShieldUserModel;
class UserModel extends ShieldUserModel
@ -17,26 +18,51 @@ class UserModel extends ShieldUserModel
'first_name', // Añadido
'last_name', // Añadido
'cliente_id', // Añadido
'comments', // Añadido
];
}
protected $returnType = UsersEntity::class;
protected $useSoftDeletes = true;
protected $useTimestamps = true;
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
protected $deletedField = 'deleted_at';
protected $validationRules = [
"username" => [
"label" => "correo duplicado",
"rules" => "is_unique[users.username]",
]
"first_name" => "required|trim|max_length[150]",
"last_name" => "required|trim|max_length[150]",
'new_pwd' => 'permit_empty|min_length[8]',
'new_pwd_confirm' => 'permit_empty|required_with[new_pwd]|matches[new_pwd]',
"comments" => "permit_empty|trim|max_length[512]"
];
protected $validationMessages = [
'first_name' => [
"max_length" => "Users.validation.first_name.max_length",
"required" => "Users.validation.first_name.required"
],
'last_name' => [
"max_length" => "Users.validation.last_name.max_length",
"required" => "Users.validation.last_name.required"
],
'new_pwd' => [
'min_length' => "App.profile_rules_password_m"
],
'new_pwd_confirm' => [
'matches' => "App.profile_rules_password_confirm_m"
],
'comments' => [
"max_length" => "Users.validation.last_name.max_length",
],
];
public function getComerciales(){
public function getComerciales()
{
$builder = $this->db
->table("users" . " t1")
->select(
@ -51,17 +77,5 @@ class UserModel extends ShieldUserModel
}
public function getUsersList(){
$builder = $this->db
->table("users" . " t1")
->select(
"t1.id AS id, t1.first_name AS first_name, t1.last_name AS last_name, t1.last_active AS last_active, t2.group AS group"
);
$builder->where('t1.deleted_at', null);
$builder->join("auth_groups_users t2", "t1.id = t2.user_id", "left");
return $builder->get()->getResult();
}
}

View File

@ -1,444 +0,0 @@
<!--Style-->
<link href="<?= site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css") ?>"
rel="stylesheet">
<style>
.input_hidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
</style>
<!--Content Body-->
<div class="content-body">
<div class="container-fluid">
<div class="row page-titles mx-0">
<div class="col-sm-6 p-md-0">
<div class="welcome-text">
<h4><i class="<?= $title['icon'] ?? '' ?>"></i> <?= $title['module'] ?? '' ?></h4>
<span class="ml-1"><?= $title['page'] ?? '' ?></span>
</div>
</div>
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
<ol class="breadcrumb">
<?php foreach ($breadcrumb ?? [] as $item) : ?>
<?php if (!$item['active']) : ?>
<li class="breadcrumb-item"><a
href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
<?php else : ?>
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-header">
<h4 class="card-title"><?= $title['page'] ?? '' ?></h4>
</div>
<div class="card-body">
<?= formAlert() ?>
<form class="form" action="<?= site_url("profile/store") ?>" method="post">
<?= csrf_field() ?>
<div class="form-body">
<div class="row">
<div class="col-lg-12">
<label class="text-primary"><?= lang("App.profile_msg_desc_1") ?></label>
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="text-dark"><?= lang("App.profile_first_name") ?></label>
<input type="text" id="first_name" name="first_name" class="form-control"
placeholder="<?= lang("App.profile_first_name_ph") ?>"
value="<?= (isset($obj)) ? $obj->first_name : set_value('first_name'); ?>">
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="text-dark"><?= lang("App.profile_last_name") ?></label>
<input type="text" id="last_name" name="last_name" class="form-control"
placeholder="<?= lang("App.profile_last_name_ph") ?>"
value="<?= (isset($obj)) ? $obj->last_name : set_value('last_name'); ?>">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label class="text-dark"><?= lang("App.profile_date_birth") ?></label>
<input type="text" class="form-control"
placeholder="<?= lang("App.profile_date_birth_ph") ?>"
id="date_birth" name="date_birth"
value="<?= (isset($obj)) ? $obj->date_birth : set_value('date_birth'); ?>">
</div>
</div>
<div class="col-lg-8">
<div class="form-group">
<label class="text-dark"><?= lang("App.profile_email") ?></label>
<input type="text" id="email" name="email" class="form-control"
placeholder="<?= lang("App.profile_email_ph") ?>"
value="<?= (isset($obj)) ? $obj->email : set_value('email'); ?>"
disabled>
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="mobile"
class="text-dark"><?= lang("App.profile_mobile") ?></label>
<input type="text" id="mobile" name="mobile" class="form-control"
placeholder="<?= lang("App.profile_mobile_ph") ?>"
value="<?= (isset($obj)) ? $obj->mobile : set_value('mobile'); ?>">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="password"
class="text-dark"><?= lang("App.profile_password") ?></label>
<input type="password" id="password" name="password" class="form-control"
placeholder="<?= lang("App.profile_password_ph") ?>">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="confirm_password"
class="text-dark"><?= lang("App.profile_confirm_password") ?></label>
<input type="password" id="confirm_password" name="confirm_password"
class="form-control"
placeholder="<?= lang("App.profile_confirm_password_ph") ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<label class="text-primary"><?= lang("App.profile_msg_desc_2") ?></label>
</div>
<div class="col-lg-8">
<div class="form-group">
<label class="text-dark"><?= lang("App.profile_address") ?></label>
<input type="text" id="address" name="address" class="form-control"
placeholder="<?= lang("App.profile_address_ph") ?>"
value="<?= (isset($obj)) ? $obj->address : set_value('address'); ?>">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="city" class="text-dark"><?= lang("App.profile_city") ?></label>
<input type="text" id="city" name="city" class="form-control"
placeholder="<?= lang("App.profile_city_ph") ?>"
value="<?= (isset($obj)) ? $obj->city : set_value('city'); ?>">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="state"
class="text-dark"><?= lang("App.profile_state") ?></label>
<input type="text" id="state" name="state" class="form-control"
placeholder="<?= lang("App.profile_state_ph") ?>"
value="<?= (isset($obj)) ? $obj->state : set_value('state'); ?>">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="country"
class="text-dark"><?= lang("App.profile_country") ?></label>
<?php $id_select = (isset($obj)) ? $obj->country ?? [] : set_value('country'); ?>
<select name="country" id="country" class="form-control">
<option value=""><?= lang("App.global_select") ?></option>
<?php foreach ($country ?? [] as $item) : ?>
<option value="<?= $item['code'] ?? '' ?>" <?= $id_select == $item['code'] ? 'selected' : '' ?>><?= $item['name'] ?? '' ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="language"
class="text-dark"><?= lang("App.profile_language") ?></label>
<?php $id_select = (isset($obj)) ? $obj->language ?? [] : set_value('language'); ?>
<select name="language" id="language" class="form-control">
<option value=""><?= lang("App.global_select") ?></option>
<option value="en" <?= $id_select == "en" ? 'selected' : '' ?>><?= lang("App.lang_en") ?></option>
<option value="es" <?= $id_select == "es" ? 'selected' : '' ?>><?= lang("App.lang_es") ?></option>
<option value="pt" <?= $id_select == "pt" ? 'selected' : '' ?>><?= lang("App.lang_pt") ?></option>
</select>
</div>
</div>
</div>
</div>
<div class="form-actions">
<a href="<?= site_url($btn_return['route'] ?? '#') ?>"
class="<?= $btn_return['class'] ?? '' ?>">
<i class="<?= $btn_return['icon'] ?? '' ?>"></i> <?= $btn_return['title'] ?? '' ?>
</a>
<button type="submit" class="<?= $btn_submit['class'] ?? '' ?>">
<i class="<?= $btn_submit['icon'] ?? '' ?>"></i> <?= $btn_submit['title'] ?? '' ?>
</button>
</div>
</form>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h4 class="card-title"><?= lang("App.profile_subtitle_image") ?></h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12 justify-content-center d-flex">
<img src="<?= $obj->picture ?? '' ?>" class="btn-circle btn-circle-md">
</div>
<div class="col-lg-12 text-center mt-3">
<span><b><?= $obj->first_name ?? '' ?></b></span><br>
<span><?= $obj->email ?? '' ?></span>
</div>
<div class="col-lg-12 mt-3">
<button type="button" class="btn btn-primary btn-block" data-toggle="modal"
data-target="#photoModalCenter"><i
class="fas fa-camera"></i> <?= lang("App.profile_change_photo") ?></button>
</div>
<!-- Modal -->
<div class="modal fade" id="photoModalCenter">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-lg-12 mb-2">
<h5><?= lang("App.profile_change_image") ?></h5>
</div>
<div class="col-lg-3 mt-2">
<div class="row">
<div class="col-lg-12 justify-content-center d-flex">
<form name="form_upload" class="form"
action="<?= site_url("profile") ?>"
enctype="multipart/form-data" method="post">
<?= csrf_field() ?>
<input type="file" name="file" id="file"
class="input_hidden"
onchange="form_upload.submit()" accept="image/*">
<div class="btn btn-light btn-circle btn-circle-md"><a
href="#" class="file-upload"><i
class="fas fa-cloud-upload-alt fa-2xl"></i></a>
</div>
</form>
</div>
<div class="col-lg-12 text-center mt-1">
<b><i class="fas fa-upload"></i> <?= strtoupper(lang("App.profile_upload_msg")) ?>
</b>
</div>
</div>
</div>
<div class="col-lg-3 mt-2">
<div class="row">
<div class="col-lg-12 justify-content-center d-flex">
<form name="form_not" action="<?= site_url("profile") ?>"
method="post">
<?= csrf_field() ?>
<input type="hidden" id="image_not" name="image_not"
value="<?= site_url("assets/img/default-user.png") ?>">
<a href="javascript:form_not.submit()"><img
src="<?= site_url("assets/img/default-user.png") ?>"
class="btn-circle btn-circle-md"></a>
</form>
</div>
<div class="col-lg-12 text-center mt-1">
<b><i class="fas fa-user-slash"></i> <?= strtoupper(lang("App.profile_no_image_msg")) ?>
</b>
</div>
</div>
</div>
<div class="col-lg-3 mt-2">
<div class="row">
<div class="col-lg-12 justify-content-center d-flex">
<form name="form_gravatar"
action="<?= site_url("profile") ?>" method="post">
<?= csrf_field() ?>
<input type="hidden" id="image_gravatar"
name="image_gravatar"
value="https://s.gravatar.com/avatar/<?= MD5($obj->email ?? '') ?>?s=150">
<a href="javascript:form_gravatar.submit()"><img
src="https://s.gravatar.com/avatar/<?= MD5($obj->email ?? '') ?>?s=150"
class="btn-circle btn-circle-md"></a>
</form>
</div>
<div class="col-lg-12 text-center mt-1">
<b><i class="fas fa-user-circle"></i> <?= strtoupper(lang("App.profile_gravatar_msg")) ?>
</b>
</div>
</div>
</div>
<?php foreach ($oauth ?? [] as $item) : ?>
<?php
$icon = '';
switch ($item['provider']) {
case "vkontakte":
$icon = '<i class="fab fa-vk"></i> ';
break;
case "wechat":
$icon = '<i class="fab fa-weixin"></i> ';
break;
default:
$icon = '<i class="fab fa-' . $item['provider'] . '"></i> ';
break;
}
?>
<div class="col-lg-3 mt-2">
<div class="row">
<div class="col-lg-12 justify-content-center d-flex">
<form name="form_<?= $item['provider'] ?? '' ?>"
action="<?= site_url("profile") ?>" method="post">
<?= csrf_field() ?>
<input type="hidden"
id="image_<?= $item['provider'] ?? '' ?>"
name="image_<?= $item['provider'] ?? '' ?>"
value="<?= $item['picture'] ?? '' ?>">
<a href="javascript:form_<?= $item['provider'] ?? '' ?>.submit()"><img
src="<?= $item['picture'] ?? '' ?>"
class="btn-circle btn-circle-md"></a>
</form>
</div>
<div class="col-lg-12 text-center mt-1">
<b><?= $icon ?><?= strtoupper($item['provider'] ?? '') ?></b>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $settings = session()->get('settings'); ?>
<?php if ($settings['two_factor_auth']) : ?>
<form name="form_otp" class="form" action="<?= site_url("profile/store") ?>" method="post" id="sendFormTFA">
<?= csrf_field() ?>
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-header">
<div class="row mx-0" style="width: 100%;">
<div class="col-sm-6 p-md-0">
<h4 class="card-title"><?= lang("App.profile_subtitle_tfa") ?></h4>
</div>
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
<div class="custom-control custom-switch ml-2">
<input type="checkbox" id="tfa" name="tfa" class="custom-control-input"
onchange="tfaView()" <?= $obj['tfa'] ?? false ? 'checked' : '' ?>>
<label for="tfa"
class="custom-control-label"><?= lang("App.profile_tfa_msg") ?></label>
</div>
</div>
</div>
</div>
<div class="card-body">
<div id="otp" style="display: <?= $obj['tfa'] ?? false ? 'block' : 'none' ?>">
<?php
$tfa = new \App\Libraries\Authenticator();
$name = $obj['first_name'] ?? '';
if ($obj['tfa'] && !empty($obj['tfa_secret'])) {
$tfa_secret = $obj['tfa_secret'] ?? '';
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
} else {
$tfa_secret = $tfa->createSecret();
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
}
?>
<div class="row">
<div class="col-lg-6">
<p><b><?= lang("App.profile_qrcode") ?></b></p>
<img src="<?php echo $qrcode; ?>" class="img-responsive">
</div>
<div class="col-lg-6">
<p><b><?= lang("App.profile_backup_code") ?></b></p>
<?php
$codes = "";
if (!empty($obj['tfa_code'] ?? '')) {
$codes = explode(',', $obj['tfa_code'] ?? '');
foreach ($codes as $item) {
echo '<span class="badge badge-primary mr-2 mb-1">' . $item . '</span>';
}
} else {
$codes = array();
for ($i = 1; $i <= 8; $i++) {
$code = random_string('numeric', 6);
$codes[] = $code;
echo '<span class="badge badge-primary mr-2 mb-1">' . $code . '</span>';
}
}
?>
<p class="mt-2"><b><?= lang("App.profile_tfa_secret") ?></b><br><b
class="text-primary"><?= $tfa_secret ?></b></p>
<input type="hidden" id="tfa_secret" name="tfa_secret"
value="<?= $tfa_secret ?>">
<input type="hidden" id="tfa_code" name="tfa_code"
value="<?= implode(',', $codes) ?>">
<button type="button" class="btn btn-primary btn-block mt-2"
onclick="download('<?= lang("App.profile_qrcode") ?>\n<?= implode(",", $codes) ?>\n<?= lang("App.profile_tfa_secret") ?>\n<?= $tfa_secret ?>','backup_codes.txt')">
<i class="fas fa-download mr-1"></i> <?= lang("App.profile_tfa_download") ?>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<?php endif; ?>
</div>
</div>
<!-- Required vendors -->
<script src="<?= site_url("themes/focus2/vendor/global/global.min.js") ?>">></script>
<script src="<?= site_url("themes/focus2/js/quixnav-init.js") ?>">></script>
<script src="<?= site_url("themes/focus2/js/custom.min.js") ?>">></script>
<script src="<?= site_url("themes/focus2/vendor/select2/js/select2.full.min.js") ?>">></script>
<!-- Alert -->
<script src="<?= site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js") ?>">></script>
<script src="<?= site_url("themes/focus2/vendor/toastr/js/toastr.min.js") ?>">></script>
<!-- Date Range Picker -->
<!-- momment js is must -->
<script src="<?= site_url("themes/focus2/vendor/moment/moment.min.js") ?>">></script>
<script src="<?= site_url("themes/focus2/vendor/bootstrap-daterangepicker/daterangepicker.js") ?>">></script>
<!-- Material color picker -->
<script src="<?= site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js") ?>">></script>
<!-- Form -->
<script>
"use strict";
$(document).ready(function () {
$('#first_name').focus();
$("#country").select2();
$("#language").select2();
$('#date_birth').bootstrapMaterialDatePicker({
format: '<?=momentDateJS()?>',
time: false
});
});
$('.file-upload').on('click', function (e) {
e.preventDefault();
$('#file').trigger('click');
});
function download(text, filename) {
let blob = new Blob([text], {type: "text/plain;charset=utf-8"});
let url = window.URL.createObjectURL(blob);
let a = document.createElement("a");
a.href = url;
a.download = filename;
a.click();
}
function tfaView() {
document.getElementById("sendFormTFA").submit();
}
</script>
<?= sweetAlert() ?>

View File

@ -1,5 +1,4 @@
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->extend('themes/vuexy/main/general_settings_layout') ?>
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
<?= $this->section('content'); ?>
<!--Content Body-->
@ -12,10 +11,11 @@
<form id="formAccountSettings" method="POST" action="<?= site_url("profile/store") ?>">
<?= csrf_field() ?>
<div class="row">
<div class="mb-3 col-md-6">
<label for="first_name" class="form-label"><?= lang("App.profile_first_name") ?></label>
<div class="mb-3 col-md-4">
<label for="first_name" class="form-label"><?= lang("App.profile_first_name") ?> *</label>
<input
class="form-control"
tabindex="1"
type="text"
id="first_name"
name="first_name"
@ -24,9 +24,10 @@
autofocus
/>
</div>
<div class="mb-3 col-md-6">
<label for="last_name" class="form-label"><?= lang("App.profile_last_name") ?></label>
<div class="mb-3 col-md-4">
<label for="last_name" class="form-label"><?= lang("App.profile_last_name") ?> *</label>
<input class="form-control"
tabindex="2"
type="text"
name="last_name"
id="last_name"
@ -34,54 +35,52 @@
value="<?= (isset($obj)) ? $obj->last_name : set_value('last_name'); ?>"
/>
</div>
<div class="mb-3 col-md-6">
<div class="mb-3 col-md-4">
<label for="email" class="form-label"><?= lang("App.profile_email") ?></label>
<input
class="form-control"
tabindex="3"
type="text"
id="email"
name="email"
disabled
placeholder="<?= lang("App.profile_email_ph") ?>"
value="<?= (isset($obj)) ? $obj->email : set_value('email'); ?>"
/>
</div>
<div class="mb-3 col-md-6">
<label for="new_pwd" class="form-label"><?= lang("App.profile_password") ?></label>
<input
class="form-control"
tabindex="4"
type="text"
id="new_pwd"
name="new_pwd"
placeholder="<?= lang("App.profile_password_ph") ?>"
value=""
/>
</div>
<div class="mb-3 col-md-6">
<label for="new_pwd_confirm" class="form-label"><?= lang("App.profile_confirm_password") ?></label>
<input
class="form-control"
tabindex="5"
type="text"
id="new_pwd_confirm"
name="new_pwd_confirm"
placeholder="<?= lang("App.profile_confirm_password_ph") ?>"
value=""
/>
</div>
</div>
<div class="mt-2">
<button type="submit" class="btn btn-primary me-2"><?= $btn_submit['title'] ?? '' ?></button>
<button type="reset" class="btn btn-label-secondary"><?= $btn_return['title'] ?? '' ?></button>
<button type="submit" class="btn btn-primary me-2"><?= lang("Basic.global.Save") ?? '' ?></button>
<?= anchor(route_to("home"), lang("Basic.global.Cancel"), ["class" => "btn btn-dark"]) ?>
</div>
</form>
</div>
<!-- /Account -->
</div>
<!-- <div class="card">
<h5 class="card-header">Delete Account</h5>
<div class="card-body">
<div class="mb-3 col-12 mb-0">
<div class="alert alert-warning">
<h5 class="alert-heading mb-1">Are you sure you want to delete your account?</h5>
<p class="mb-0">Once you delete your account, there is no going back. Please be certain.</p>
</div>
</div>
<form id="formAccountDeactivation" onsubmit="return false">
<div class="form-check mb-4">
<input
class="form-check-input"
type="checkbox"
name="accountActivation"
id="accountActivation"
/>
<label class="form-check-label" for="accountActivation"
>I confirm my account deactivation</label
>
</div>
<button type="submit" class="btn btn-danger deactivate-account">Deactivate Account</button>
</form>
</div>
</div> -->
</div>
<?php $settings = session()->get('settings'); ?>
@ -96,12 +95,7 @@
<?= $this->section('additionalInlineJs') ?>
"use strict";
$(document).ready(function () {
$('#first_name').focus();
$('#first_name').focus();
});
$('.file-upload').on('click', function (e) {
e.preventDefault();
$('#file').trigger('click');
});
<?= $this->endSection() ?>

View File

@ -1,26 +1,41 @@
<div class="row">
<div class="col-md-12 col-lg-6 px-4">
<div class="col-md-12 col-lg-12 px-4">
<div class="row">
<div class="col-md-6 col-lg-4">
<div class="mb-3">
<label for="firstName" class="form-label">
<?= lang('Users.firstName') ?> *
</label>
<input tabindex="1" type="text" id="firstName" name="first_name" maxLength="150" class="form-control"
value="<?= old('first_name', $user->first_name) ?>">
</div>
</div>
<div class="mb-3">
<label for="firstName" class="form-label">
<?= lang('Users.firstName') ?>
</label>
<input tabindex="1" type="text" id="firstName" name="first_name" maxLength="150" class="form-control"
value="<?= old('first_name', $user->first_name) ?>">
</div><!--//.mb-3 -->
<div class="col-md-6 col-lg-4">
<div class="mb-3">
<label for="lastName" class="form-label">
<?= lang('Users.lastName') ?> *
</label>
<input tabindex="2" type="text" id="lastName" name="last_name" maxLength="150" class="form-control"
value="<?= old('last_name', $user->last_name) ?>">
</div>
</div>
<div class="mb-3">
<label for="email" class="form-label">
<?= lang('Users.email') ?>*
</label>
<input tabindex="13" type="email" id="email" name="email" maxLength="150" class="form-control"
value="<?= old('email', $user->email) ?>">
</div><!--//.mb-3 -->
<div class="col-md-6 col-lg-4">
<div class="mb-3">
<label for="email" class="form-label">
<?= lang('Users.email') ?>*
</label>
<input tabindex="3" type="email" id="email" name="email" maxLength="150" class="form-control"
value="<?= old('email', $user->email) ?>">
</div>
</div>
</div>
<div class="row">
<div class="mb-3">
<div class="form-group">
<label for="group" class="form-label"> <?= lang('Users.group') ?></label>
<select tabindex="17" name="group[]" id="group" multiple="multiple"
<select tabindex="5" name="group[]" id="group" multiple="multiple"
class="form-control select2 form-select">
<option value=""><?= lang('Basic.global.pleaseSelectA', [lang('Users.group')]) ?></option>
<?php
@ -36,59 +51,106 @@
<?php endforeach; ?>
</select>
</div>
</div><!--//.mb-3 -->
</div><!--//.col -->
<div class="col-md-12 col-lg-6 px-4">
<div class="mb-3">
<label for="lastName" class="form-label">
<?= lang('Users.lastName') ?>
</label>
<input tabindex="2" type="text" id="lastName" name="last_name" maxLength="150" class="form-control"
value="<?= old('last_name', $user->last_name) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="status" class="form-label">
<?= lang('Users.blocked') ?>
</label>
<?php $isBanned = old('blocked', $user->status); ?>
<select tabindex="12" name="status" id="status" class="select2 form-control">
<option value="0" <?= is_null($isBanned) ? 'selected' : '' ?>><?= lang("Users.non_blocked") ?></option>
<option value="1" <?= $isBanned === "banned" ? 'selected' : '' ?>><?= lang("Users.blocked") ?></option>
</select>
</div>
<div class="mb-3">
<label for="active" class="form-label">
<?= lang('Users.status') ?>
</label>
<?php $isActive = old('status', $user->active); ?>
<select tabindex="16" name="active" id="active" class="select2 form-control">
<option value="1" <?= $isActive ? 'selected' : '' ?>><?= lang("Users.global_active") ?></option>
<option value="0" <?= $isActive ? '' : 'selected' ?>><?= lang("Users.global_inactive") ?></option>
</select>
</div><!--//.mb-3 -->
</div><!--//.col -->
<div class="col-md-12 col-lg-6 px-4">
<div class="mb-3">
<label for="cliente_id" class="form-label">
<?= lang('Presupuestos.clienteId') ?>
</label>
<select id="cliente_id" name="cliente_id" class="form-control select2bs2" style="width: 100%;">
<select tabindex="7" id="cliente_id" name="cliente_id" class="form-control select2bs2" style="width: 100%;">
<?php if (isset($clienteList) && is_array($clienteList) && !empty($clienteList)) :
foreach ($clienteList as $k => $v) : ?>
<option value="<?= $k ?>" <?= $k == $user->cliente_id ? ' selected' : '' ?>>
<?= $v ?>
</option>
<?php endforeach;
<?php endforeach;
endif; ?>
</select>
</div>
</div><!--//.col -->
</div>
<div class="row">
<div class="col-md-6 col-lg-6">
<div class="mb-3">
<label for="status" class="form-label">
<?= lang('Users.blocked') ?>
</label>
<?php $isBanned = old('blocked', $user->status); ?>
<select tabindex="4" name="status" id="status" class="select2 form-control">
<option value="0" <?= is_null($isBanned) ? 'selected' : '' ?>><?= lang("Users.non_blocked") ?></option>
<option value="1" <?= $isBanned === "banned" ? 'selected' : '' ?>><?= lang("Users.blocked") ?></option>
</select>
</div>
</div>
<div class="col-md-6 col-lg-6">
<div class="mb-3">
<label for="active" class="form-label">
<?= lang('Users.status') ?>
</label>
<?php $isActive = old('status', $user->active); ?>
<select tabindex="6" name="active" id="active" class="select2 form-control">
<option value="1" <?= $isActive ? 'selected' : '' ?>><?= lang("Users.global_active") ?></option>
<option value="0" <?= $isActive ? '' : 'selected' ?>><?= lang("Users.global_inactive") ?></option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-6">
<div class="mb-3">
<label for="new_pwd" class="form-label">
<?= lang('Users.password') ?>
</label>
<input
tabindex="8"
type="text"
id="new_pwd"
name="new_pwd"
maxLength="50"
class="form-control"
placeholder="Introduzca contraseña para cambiarla"
value=""
>
</div>
</div>
<div class="col-md-6 col-lg-6">
<div class="mb-3">
<label for="new_pwd_confirm" class="form-label">
Repita <?= lang('Users.password') ?>
</label>
<input
tabindex="9"
type="text"
id="new_pwd_confirm"
name="new_pwd_confirm"
maxLength="50"
class="form-control"
placeholder="Repita la contraseña para cambiarla"
value=""
>
</div>
</div>
</div>
<div class="row">
<div class="mb-3">
<label for="comments" class="form-label">
Comentarios
</label>
<textarea
rows="3"
id="comments"
name="comments"
style="height: 10em;"
class="form-control"
><?=old('comments', $user->comments) ?></textarea>
</div>
</div>
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -17,8 +17,8 @@
<tr>
<th><?= lang('Users.firstName') ?></th>
<th><?= lang('Users.lastName') ?></th>
<th><?= lang('Users.group') ?></th>
<th><?= lang('Users.lastAccess') ?></th>
<th><?= lang('Users.email') ?></th>
<th><?= lang('Users.lastAccess') ?></th>
<?php /*
<th><?= lang('Users.mobile') ?></th>
<th><?= lang('Users.email') ?></th>
@ -46,11 +46,10 @@
<td class="align-middle">
<?= empty($item->last_name) || strlen($item->last_name) < 51 ? esc($item->last_name) : character_limiter(esc($item->last_name), 50) ?>
</td>
<td class="align-middle">
<?= empty($item->group) ? "" : character_limiter(esc(lang('Users.' . $item->group)), 50) ?>
</td>
<td class="align-middle text-nowrap">
<td class="align-middle">
<?= empty($item->email) ? "" : character_limiter(esc(lang($item->email)), 50) ?>
</td>
<td class="align-middle text-nowrap">
<?= empty($item->last_active) ? '' : date('d/m/Y H:m:s', strtotime($item->last_active)) ?>
</td>

View File

@ -1,357 +0,0 @@
<?php
$session = session();
$token = $session->get('token') ?? '';
$tfa = $session->get('tfa') ?? false;
$settings = $session->get('settings');
$picture = "/assets/img/default-user.png";
$pulse = session()->get('pulse');
$notification = session()->get('notification');
if (!empty($token) && $tfa == false) {
//echo "<script>window.location.href = '/'; </script>";
}
?>
<!DOCTYPE html>
<html
lang="<?= $session->get('lang') ?>"
class="h-100 light-style layout-navbar-fixed layout-menu-fixed"
dir="ltr"
data-theme="theme-default"
data-assets-path="<?= site_url('themes/vuexy/') ?>"
data-template="vertical-menu-template-no-customizer"
>
<head>
<meta charset="utf-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<title><?= config('Safekat')->appName ?></title>
<meta name="description" content=""/>
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>"/>
<link rel="apple-touch-icon" sizes="57x57" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-57x57.png') ?>">
<link rel="apple-touch-icon" sizes="60x60" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-60x60.png') ?>">
<link rel="apple-touch-icon" sizes="72x72" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-72x72.png') ?>">
<link rel="apple-touch-icon" sizes="76x76" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-76x76.png') ?>">
<link rel="apple-touch-icon" sizes="114x114"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-114x114.png') ?>">
<link rel="apple-touch-icon" sizes="120x120"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-120x120.png') ?>">
<link rel="apple-touch-icon" sizes="144x144"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-144x144.png') ?>">
<link rel="apple-touch-icon" sizes="152x152"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-152x152.png') ?>">
<link rel="apple-touch-icon" sizes="180x180"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-180x180.png') ?>">
<link rel="icon" type="image/png" sizes="192x192"
href="<?= site_url('themes/vuexy/img/favicon/android-icon-192x192.png') ?>">
<link rel="icon" type="image/png" sizes="32x32"
href="<?= site_url('themes/vuexy/img/favicon/favicon-32x32.png') ?>">
<link rel="icon" type="image/png" sizes="96x96"
href="<?= site_url('themes/vuexy/img/favicon/favicon-96x96.png') ?>">
<link rel="icon" type="image/png" sizes="16x16"
href="<?= site_url('themes/vuexy/img/favicon/favicon-16x16.png') ?>">
<link rel="manifest" href="<?= site_url('themes/vuexy/img/favicon/manifest.json') ?>">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
<link
href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet"
/>
<!-- Icons -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>"/>
<!-- Core CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>"/>
<!-- Vendors CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') ?>"/>
<!-- Page CSS -->
<?= $this->renderSection('css') ?>
<!-- Helpers -->
<script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>
</head>
<body>
<!-- Layout wrapper -->
<div class="layout-wrapper layout-content-navbar">
<div class="layout-container">
<?php include "selector_menu.php" ?>
<!-- Layout container -->
<div class="layout-page">
<!-- Navbar -->
<nav
class="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
id="layout-navbar"
>
<div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
<a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
<i class="ti ti-menu-2 ti-sm"></i>
</a>
</div>
<div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
<div class="navbar-nav align-items-center">
<a class="nav-link style-switcher-toggle hide-arrow" href="javascript:void(0);">
<i class="ti ti-sm"></i>
</a>
</div>
<ul class="navbar-nav flex-row align-items-center ms-auto">
<!-- Notification -->
<li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-1">
<a
class="nav-link dropdown-toggle hide-arrow"
href="javascript:void(0);"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<i class="ti ti-bell ti-md"></i>
<span class="badge bg-danger rounded-pill badge-notifications">5</span>
</a>
</li>
<!--/ Notification -->
<!-- Search Budgets -->
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
<a
class="nav-link hide-arrow"
href="<?= site_url('presupuestos/buscador'); ?>"
title="Acceso directo a buscador de presupuestos"
>
<i class="ti ti-report-search ti-md"></i>
</a>
</li>
<!--/ Search Budgets -->
<!-- View Mode links -->
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
<a
class="nav-link dropdown-toggle hide-arrow"
href="javascript:void(0);"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<i class="ti ti-eye ti-md"></i>
</a>
<div class="dropdown-menu dropdown-menu-end py-0">
<div class="dropdown-menu-header border-bottom">
<div class="dropdown-header d-flex align-items-center py-3">
<h5 class="text-body mb-0 me-auto">Vistas</h5>
</div>
</div>
<div class="dropdown-shortcuts-list scrollable-container">
<div class="row row-bordered overflow-visible g-0">
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-printer fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_impresion); ?>" class="stretched-link">Impresión</a>
</div>
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-ruler-2 fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_maquetacion); ?>" class="stretched-link">Maquetación</a>
</div>
</div>
<div class="row row-bordered overflow-visible g-0">
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-file-code-2 fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_digitalizacion); ?>" class="stretched-link">Digitalización</a>
</div>
</div>
</div>
</div>
</li>
<!-- View Mode links -->
<!-- Language -->
<li class="nav-item dropdown-language dropdown me-2 me-xl-0">
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
data-bs-toggle="dropdown">
<i class="fi <?= getCurrentLanguageFlag(); ?> fis rounded-circle me-1 fs-3"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="<?= site_url('lang/es'); ?>" data-language="es">
<i class="fi fi-es fis rounded-circle me-1 fs-3"></i>
<span class="align-middle"><?= lang("App.lang_es") ?></span>
</a>
</li>
<li>
<a class="dropdown-item" href="<?= site_url('lang/en'); ?>" data-language="en">
<i class="fi fi-gb fis rounded-circle me-1 fs-3"></i>
<span class="align-middle"><?= lang("App.lang_en") ?></span>
</a>
</li>
</ul>
</li>
<!--/ Language -->
<!-- User -->
<li class="nav-item navbar-dropdown dropdown-user dropdown">
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
data-bs-toggle="dropdown">
<div class="avatar">
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
</div>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="#">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar avatar">
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
<small class="text-muted">Admin</small>
</div>
</div>
</a>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url('profile'); ?>">
<i class="ti ti-user-check me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_profile") ?></span>
</a>
</li>
<!-- <li>-->
<!-- <a class="dropdown-item" href="#">-->
<!-- <i class="ti ti-settings me-2 ti-sm"></i>-->
<!-- <span class="align-middle">Settings</span>-->
<!-- </a>-->
<!-- </li>-->
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url("logout") ?>">
<i class="ti ti-logout me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_logout") ?></span>
</a>
</li>
</ul>
</li>
<!--/ User -->
</ul>
</div>
</nav>
<!-- / Navbar -->
<!-- Content wrapper -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<h5 class="py-3 mb-4">
<?php include "breadcrumbs.php" ?>
</h5>
<?= $this->renderSection('content') ?>
</div>
<!-- / Content -->
<!-- Footer -->
<footer class="content-footer footer bg-footer-theme">
<div class="container-xxl">
<div class="footer-container d-flex align-items-center justify-content-between py-2 flex-md-row flex-column">
<div>
<a href="#" target="_blank" class="fw-semibold">Safekat</a> © <?= date('Y'); ?>
</div>
</div>
</div>
</footer>
<!-- / Footer -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
</div>
<!-- / Layout page -->
</div>
<!-- Overlay -->
<div class="layout-overlay layout-menu-toggle"></div>
<!-- Drag Target Area To SlideIn Menu On Small Screens -->
<div class="drag-target"></div>
</div>
<!-- / Layout wrapper -->
<?= $this->renderSection('footerAdditions') ?>
<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<!-- endbuild -->
<!-- Vendors JS -->
<?= $this->renderSection('additionalExternalJs') ?>
<!-- Main JS -->
<script src="<?= site_url('themes/vuexy/js/main.js') ?>"></script>
<!-- Page JS -->
<script src="<?= site_url('assets/js/main.js') ?>"></script>
<?= sweetAlert() ?>
<script type="text/javascript">
<?= $this->renderSection('additionalInlineJs') ?>
</script>
</body>
</html>

View File

@ -1,570 +0,0 @@
<?php
$session = session();
$settings = $session->get('settings');
$picture = "/assets/img/default-user.png";
?>
<!DOCTYPE html>
<html
lang="<?= $session->get('lang') ?>"
class="h-100"
class="semi-dark-style customizer-hide"
dir="ltr"
data-theme="theme-default"
data-assets-path="<?= site_url('themes/vuexy/') ?>"
data-template="vertical-menu-template-no-customizer"
>
<head>
<meta charset="utf-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<title><?= config('Safekat')->appName ?></title>
<meta name="description" content=""/>
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>"/>
<link rel="apple-touch-icon" sizes="57x57" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-57x57.png') ?>">
<link rel="apple-touch-icon" sizes="60x60" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-60x60.png') ?>">
<link rel="apple-touch-icon" sizes="72x72" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-72x72.png') ?>">
<link rel="apple-touch-icon" sizes="76x76" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-76x76.png') ?>">
<link rel="apple-touch-icon" sizes="114x114"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-114x114.png') ?>">
<link rel="apple-touch-icon" sizes="120x120"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-120x120.png') ?>">
<link rel="apple-touch-icon" sizes="144x144"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-144x144.png') ?>">
<link rel="apple-touch-icon" sizes="152x152"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-152x152.png') ?>">
<link rel="apple-touch-icon" sizes="180x180"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-180x180.png') ?>">
<link rel="icon" type="image/png" sizes="192x192"
href="<?= site_url('themes/vuexy/img/favicon/android-icon-192x192.png') ?>">
<link rel="icon" type="image/png" sizes="32x32"
href="<?= site_url('themes/vuexy/img/favicon/favicon-32x32.png') ?>">
<link rel="icon" type="image/png" sizes="96x96"
href="<?= site_url('themes/vuexy/img/favicon/favicon-96x96.png') ?>">
<link rel="icon" type="image/png" sizes="16x16"
href="<?= site_url('themes/vuexy/img/favicon/favicon-16x16.png') ?>">
<link rel="manifest" href="<?= site_url('themes/vuexy/img/favicon/manifest.json') ?>">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
<link
href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet"
/>
<!-- Icons -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>"/>
<!-- Core CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>"/>
<!-- Vendors CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') ?>"/>
<!-- Page CSS -->
<!-- Helpers -->
<script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>
</head>
<body>
<!-- Layout wrapper -->
<div class="layout-wrapper layout-content-navbar">
<div class="layout-container">
<?php include "selector_menu.php" ?>
<!-- Layout container -->
<div class="layout-page">
<!-- Navbar -->
<nav
class="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
id="layout-navbar"
>
<div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
<a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
<i class="ti ti-menu-2 ti-sm"></i>
</a>
</div>
<div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
<div class="navbar-nav align-items-center">
<a class="nav-link style-switcher-toggle hide-arrow" href="javascript:void(0);">
<i class="ti ti-sm"></i>
</a>
</div>
<ul class="navbar-nav flex-row align-items-center ms-auto">
<!-- Notification -->
<li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-1">
<a
class="nav-link dropdown-toggle hide-arrow"
href="javascript:void(0);"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<i class="ti ti-bell ti-md"></i>
<span class="badge bg-danger rounded-pill badge-notifications">5</span>
</a>
<ul class="dropdown-menu dropdown-menu-end py-0">
<li class="dropdown-menu-header border-bottom">
<div class="dropdown-header d-flex align-items-center py-3">
<h5 class="text-body mb-0 me-auto">Notification</h5>
<a
href="javascript:void(0)"
class="dropdown-notifications-all text-body"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Mark all as read"
><i class="ti ti-mail-opened fs-4"></i
></a>
</div>
</li>
<li class="dropdown-notifications-list scrollable-container">
<ul class="list-group list-group-flush">
<li class="list-group-item list-group-item-action dropdown-notifications-item">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img src="../../assets/img/avatars/1.png" alt
class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">Congratulation Lettie 🎉</h6>
<p class="mb-0">Won the monthly best seller gold badge</p>
<small class="text-muted">1h ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<span class="avatar-initial rounded-circle bg-label-danger">CF</span>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">Charles Franklin</h6>
<p class="mb-0">Accepted your connection</p>
<small class="text-muted">12hr ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img src="../../assets/img/avatars/2.png" alt
class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">New Message ✉️</h6>
<p class="mb-0">You have new message from Natalie</p>
<small class="text-muted">1h ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<span class="avatar-initial rounded-circle bg-label-success"
><i class="ti ti-shopping-cart"></i
></span>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">Whoo! You have new order 🛒</h6>
<p class="mb-0">ACME Inc. made new order $1,154</p>
<small class="text-muted">1 day ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img src="../../assets/img/avatars/9.png" alt
class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">Application has been approved 🚀</h6>
<p class="mb-0">Your ABC project application has been approved.</p>
<small class="text-muted">2 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<span class="avatar-initial rounded-circle bg-label-success"
><i class="ti ti-chart-pie"></i
></span>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">Monthly report is generated</h6>
<p class="mb-0">July monthly financial report is generated</p>
<small class="text-muted">3 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img src="../../assets/img/avatars/5.png" alt
class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">Send connection request</h6>
<p class="mb-0">Peter sent you connection request</p>
<small class="text-muted">4 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img src="../../assets/img/avatars/6.png" alt
class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">New message from Jane</h6>
<p class="mb-0">Your have new message from Jane</p>
<small class="text-muted">5 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<span class="avatar-initial rounded-circle bg-label-warning"
><i class="ti ti-alert-triangle"></i
></span>
</div>
</div>
<div class="flex-grow-1">
<h6 class="mb-1">CPU is running high</h6>
<p class="mb-0">CPU Utilization Percent is currently at 88.63%,</p>
<small class="text-muted">5 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a href="javascript:void(0)" class="dropdown-notifications-read"
><span class="badge badge-dot"></span
></a>
<a href="javascript:void(0)" class="dropdown-notifications-archive"
><span class="ti ti-x"></span
></a>
</div>
</div>
</li>
</ul>
</li>
<li class="dropdown-menu-footer border-top">
<a
href="javascript:void(0);"
class="dropdown-item d-flex justify-content-center text-primary p-2 h-px-40 mb-1 align-items-center"
>
View all notifications
</a>
</li>
</ul>
</li>
<!--/ Notification -->
<!-- Search Budgets -->
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
<a
class="nav-link hide-arrow"
href="<?= site_url('presupuestos/buscador'); ?>"
title="Acceso directo a buscador de presupuestos"
>
<i class="ti ti-report-search ti-md"></i>
</a>
</li>
<!--/ Search Budgets -->
<!-- View Mode links -->
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
<a
class="nav-link dropdown-toggle hide-arrow"
href="javascript:void(0);"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<i class="ti ti-building ti-md"></i>
</a>
<div class="dropdown-menu dropdown-menu-end py-0">
<div class="dropdown-menu-header border-bottom">
<div class="dropdown-header d-flex align-items-center py-3">
<h5 class="text-body mb-0 me-auto">Vistas</h5>
</div>
</div>
<div class="dropdown-shortcuts-list scrollable-container">
<div class="row row-bordered overflow-visible g-0">
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-printer fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_impresion); ?>" class="stretched-link">Impresión</a>
</div>
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-ruler-2 fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_maquetacion); ?>" class="stretched-link">Maquetación</a>
</div>
</div>
<div class="row row-bordered overflow-visible g-0">
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-file-code-2 fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_digitalizacion); ?>" class="stretched-link">Digitalización</a>
</div>
</div>
</div>
</div>
</li>
<!-- View Mode links -->
<!-- Language -->
<li class="nav-item dropdown-language dropdown me-2 me-xl-0">
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
data-bs-toggle="dropdown">
<i class="fi <?= getCurrentLanguageFlag(); ?> fis rounded-circle me-1 fs-3"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="<?= site_url('lang/es'); ?>" data-language="es">
<i class="fi fi-es fis rounded-circle me-1 fs-3"></i>
<span class="align-middle"><?= lang("App.lang_es") ?></span>
</a>
</li>
<li>
<a class="dropdown-item" href="<?= site_url('lang/en'); ?>" data-language="en">
<i class="fi fi-gb fis rounded-circle me-1 fs-3"></i>
<span class="align-middle"><?= lang("App.lang_en") ?></span>
</a>
</li>
</ul>
</li>
<!--/ Language -->
<!-- User -->
<li class="nav-item navbar-dropdown dropdown-user dropdown">
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
data-bs-toggle="dropdown">
<div class="avatar">
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
</div>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="#">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar avatar-online">
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
<small class="text-muted">Admin</small>
</div>
</div>
</a>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url('profile'); ?>">
<i class="ti ti-user-check me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_profile") ?></span>
</a>
</li>
<!-- <li>-->
<!-- <a class="dropdown-item" href="#">-->
<!-- <i class="ti ti-settings me-2 ti-sm"></i>-->
<!-- <span class="align-middle">Settings</span>-->
<!-- </a>-->
<!-- </li>-->
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url("logout") ?>">
<i class="ti ti-logout me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_logout") ?></span>
</a>
</li>
</ul>
</li>
<!--/ User -->
</ul>
</div>
</nav>
<!-- / Navbar -->
<!-- Content wrapper -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<h5 class="py-3 mb-4">
<?php include "breadcrumbs.php" ?>
</h5>
<p>
Sample page.
</p>
</div>
<!-- / Content -->
<!-- Footer -->
<footer class="content-footer footer bg-footer-theme">
<div class="container-xxl">
<div class="footer-container d-flex align-items-center justify-content-between py-2 flex-md-row flex-column">
<div>
<a href="#" target="_blank" class="fw-semibold">Safekat</a> © <?= date('Y'); ?>
</div>
</div>
</div>
</footer>
<!-- / Footer -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
</div>
<!-- / Layout page -->
</div>
<!-- Overlay -->
<div class="layout-overlay layout-menu-toggle"></div>
<!-- Drag Target Area To SlideIn Menu On Small Screens -->
<div class="drag-target"></div>
</div>
<!-- / Layout wrapper -->
<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<!-- endbuild -->
<!-- Vendors JS -->
<!-- Main JS -->
<script src="<?= site_url('themes/vuexy/js/main.js') ?>"></script>
<!-- Page JS -->
</body>
</html>

View File

@ -133,7 +133,6 @@ $picture = "/assets/img/default-user.png";
title="Acceso directo a buscador de presupuestos"
>
<i class="ti ti-report-search ti-md"></i>
</a>
</li>
<!--/ Search Budgets -->
@ -232,8 +231,8 @@ $picture = "/assets/img/default-user.png";
</div>
</div>
<div class="flex-grow-1">
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
<small class="text-muted">Admin</small>
<span class="fw-semibold d-block"><?= auth()->user()->getFullName(); ?></span>
<small class="text-muted"><?= auth()->user()->getEmail(); ?></small>
</div>
</div>
</a>
@ -247,13 +246,6 @@ $picture = "/assets/img/default-user.png";
<span class="align-middle"><?= lang("App.menu_profile") ?></span>
</a>
</li>
<!-- <li>-->
<!-- <a class="dropdown-item" href="#">-->
<!-- <i class="ti ti-settings me-2 ti-sm"></i>-->
<!-- <span class="align-middle">Settings</span>-->
<!-- </a>-->
<!-- </li>-->
<li>
<div class="dropdown-divider"></div>
</li>

View File

@ -1,297 +0,0 @@
<?php
$session = session();
$token = $session->get('token') ?? '';
$tfa = $session->get('tfa') ?? false;
$settings = $session->get('settings');
$picture = "/assets/img/default-user.png";
$pulse = session()->get('pulse');
$notification = session()->get('notification');
if (!empty($token) && $tfa == false) {
//echo "<script>window.location.href = '/'; </script>";
}
?>
<!DOCTYPE html>
<html
lang="<?= $session->get('lang') ?>"
class="h-100 light-style layout-navbar-fixed layout-menu-fixed"
dir="ltr"
data-theme="theme-default"
data-assets-path="<?= site_url('themes/vuexy/') ?>"
data-template="vertical-menu-template-no-customizer"
>
<head>
<meta charset="utf-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<title><?= config('Safekat')->appName ?></title>
<meta name="description" content=""/>
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>"/>
<link rel="apple-touch-icon" sizes="57x57" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-57x57.png') ?>">
<link rel="apple-touch-icon" sizes="60x60" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-60x60.png') ?>">
<link rel="apple-touch-icon" sizes="72x72" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-72x72.png') ?>">
<link rel="apple-touch-icon" sizes="76x76" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-76x76.png') ?>">
<link rel="apple-touch-icon" sizes="114x114"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-114x114.png') ?>">
<link rel="apple-touch-icon" sizes="120x120"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-120x120.png') ?>">
<link rel="apple-touch-icon" sizes="144x144"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-144x144.png') ?>">
<link rel="apple-touch-icon" sizes="152x152"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-152x152.png') ?>">
<link rel="apple-touch-icon" sizes="180x180"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-180x180.png') ?>">
<link rel="icon" type="image/png" sizes="192x192"
href="<?= site_url('themes/vuexy/img/favicon/android-icon-192x192.png') ?>">
<link rel="icon" type="image/png" sizes="32x32"
href="<?= site_url('themes/vuexy/img/favicon/favicon-32x32.png') ?>">
<link rel="icon" type="image/png" sizes="96x96"
href="<?= site_url('themes/vuexy/img/favicon/favicon-96x96.png') ?>">
<link rel="icon" type="image/png" sizes="16x16"
href="<?= site_url('themes/vuexy/img/favicon/favicon-16x16.png') ?>">
<link rel="manifest" href="<?= site_url('themes/vuexy/img/favicon/manifest.json') ?>">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
<link
href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet"
/>
<!-- Icons -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>"/>
<!-- Core CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>"/>
<!-- Vendors CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/node-waves/node-waves.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/select2/select2.css') ?>"/>
<!-- Page CSS -->
<!-- Helpers -->
<script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>
</head>
<body>
<!-- Layout wrapper -->
<div class="layout-wrapper layout-content-navbar">
<div class="layout-container">
<?php include "menu.php" ?>
<!-- Layout container -->
<div class="layout-page">
<!-- Navbar -->
<nav
class="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
id="layout-navbar"
>
<div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
<a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
<i class="ti ti-menu-2 ti-sm"></i>
</a>
</div>
<div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
<div class="navbar-nav align-items-center">
<a class="nav-link style-switcher-toggle hide-arrow" href="javascript:void(0);">
<i class="ti ti-sm"></i>
</a>
</div>
<ul class="navbar-nav flex-row align-items-center ms-auto">
<!-- Notification -->
<li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-1">
<a
class="nav-link dropdown-toggle hide-arrow"
href="javascript:void(0);"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<i class="ti ti-bell ti-md"></i>
<span class="badge bg-danger rounded-pill badge-notifications">5</span>
</a>
</li>
<!--/ Notification -->
<!-- Language -->
<li class="nav-item dropdown-language dropdown me-2 me-xl-0">
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);" data-bs-toggle="dropdown">
<i class="fi fi-es fis rounded-circle me-1 fs-3"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="<?= site_url('lang/es'); ?>" data-language="es">
<i class="fi fi-es fis rounded-circle me-1 fs-3"></i>
<span class="align-middle"><?= lang("App.lang_es") ?></span>
</a>
</li>
<li>
<a class="dropdown-item" href="<?= site_url('lang/en'); ?>" data-language="en">
<i class="fi fi-gb fis rounded-circle me-1 fs-3"></i>
<span class="align-middle"><?= lang("App.lang_en") ?></span>
</a>
</li>
</ul>
</li>
<!--/ Language -->
<!-- User -->
<li class="nav-item navbar-dropdown dropdown-user dropdown">
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
data-bs-toggle="dropdown">
<div class="avatar">
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
</div>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="#">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar avatar-online">
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
<small class="text-muted">Admin</small>
</div>
</div>
</a>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url('profile'); ?>">
<i class="ti ti-user-check me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_profile") ?></span>
</a>
</li>
<li>
<a class="dropdown-item" href="#">
<i class="ti ti-settings me-2 ti-sm"></i>
<span class="align-middle">Settings</span>
</a>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url("logout") ?>">
<i class="ti ti-logout me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_logout") ?></span>
</a>
</li>
</ul>
</li>
<!--/ User -->
</ul>
</div>
</nav>
<!-- / Navbar -->
<!-- Content wrapper -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<h4 class="fw-bold py-3 mb-4">
<span class="text-muted fw-light">Safekat /</span>
<?= $page_name ?? "" ?>
</h4>
<div class="row">
<div class="col-12">
<div class="card mb-4">
<h5 class="card-header">Prueba privilegios</h5>
<div class="card-body">
<div class="d-grid gap-2 col-lg-6 mx-auto">
<button onclick="location.href='<?= $url ?>/add'" type="button" class="btn btn-dark">Añadir</button>
<button onclick="location.href='<?= $url ?>/edit'" type="button" class="btn btn-info">Editar</button>
<button onclick="location.href='<?= $url ?>/delete'" type="button" class="btn btn-danger">Borrar</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- / Content -->
<!-- Footer -->
<footer class="content-footer footer bg-footer-theme">
<div class="container-xxl">
<div class="footer-container d-flex align-items-center justify-content-between py-2 flex-md-row flex-column">
<div>
<a href="#" target="_blank" class="fw-semibold">Safekat</a> © <?= date('Y'); ?>
</div>
</div>
</div>
</footer>
<!-- / Footer -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
</div>
<!-- / Layout page -->
</div>
<!-- Overlay -->
<div class="layout-overlay layout-menu-toggle"></div>
<!-- Drag Target Area To SlideIn Menu On Small Screens -->
<div class="drag-target"></div>
</div>
<!-- / Layout wrapper -->
<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/node-waves/node-waves.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<!-- endbuild -->
<!-- Vendors JS -->
<script src="<?= site_url('themes/vuexy/vendor/libs/select2/select2.js') ?>"></script>
<!-- Main JS -->
<script src="<?= site_url('themes/vuexy/js/main.js') ?>"></script>
<!-- Page JS -->
</body>
</html>

View File

@ -1,359 +0,0 @@
<?php
$session = session();
$token = $session->get('token') ?? '';
$tfa = $session->get('tfa') ?? false;
$settings = $session->get('settings');
$picture = "/assets/img/default-user.png";
$pulse = session()->get('pulse');
$notification = session()->get('notification');
if (!empty($token) && $tfa == false) {
//echo "<script>window.location.href = '/'; </script>";
}
?>
<!DOCTYPE html>
<html
lang="<?= $session->get('lang') ?>"
class="h-100 light-style layout-navbar-fixed layout-menu-fixed"
dir="ltr"
data-theme="theme-default"
data-assets-path="<?= site_url('themes/vuexy/') ?>"
data-template="vertical-menu-template-no-customizer"
>
<head>
<meta charset="utf-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<title><?= config('Safekat')->appName ?></title>
<meta name="description" content=""/>
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>"/>
<link rel="apple-touch-icon" sizes="57x57" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-57x57.png') ?>">
<link rel="apple-touch-icon" sizes="60x60" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-60x60.png') ?>">
<link rel="apple-touch-icon" sizes="72x72" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-72x72.png') ?>">
<link rel="apple-touch-icon" sizes="76x76" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-76x76.png') ?>">
<link rel="apple-touch-icon" sizes="114x114"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-114x114.png') ?>">
<link rel="apple-touch-icon" sizes="120x120"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-120x120.png') ?>">
<link rel="apple-touch-icon" sizes="144x144"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-144x144.png') ?>">
<link rel="apple-touch-icon" sizes="152x152"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-152x152.png') ?>">
<link rel="apple-touch-icon" sizes="180x180"
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-180x180.png') ?>">
<link rel="icon" type="image/png" sizes="192x192"
href="<?= site_url('themes/vuexy/img/favicon/android-icon-192x192.png') ?>">
<link rel="icon" type="image/png" sizes="32x32"
href="<?= site_url('themes/vuexy/img/favicon/favicon-32x32.png') ?>">
<link rel="icon" type="image/png" sizes="96x96"
href="<?= site_url('themes/vuexy/img/favicon/favicon-96x96.png') ?>">
<link rel="icon" type="image/png" sizes="16x16"
href="<?= site_url('themes/vuexy/img/favicon/favicon-16x16.png') ?>">
<link rel="manifest" href="<?= site_url('themes/vuexy/img/favicon/manifest.json') ?>">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
<link
href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet"
/>
<!-- Icons -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>"/>
<!-- Core CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>"/>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>"/>
<!-- Vendors CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') ?>"/>
<!-- Page CSS -->
<?= $this->renderSection('css') ?>
<!-- Helpers -->
<script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>
</head>
<body>
<!-- Layout wrapper -->
<div class="layout-wrapper layout-content-navbar">
<div class="layout-container">
<?php include "selector_menu.php" ?>
<!-- Layout container -->
<div class="layout-page">
<!-- Navbar -->
<nav
class="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
id="layout-navbar"
>
<div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
<a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
<i class="ti ti-menu-2 ti-sm"></i>
</a>
</div>
<div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
<div class="navbar-nav align-items-center">
<a class="nav-link style-switcher-toggle hide-arrow" href="javascript:void(0);">
<i class="ti ti-sm"></i>
</a>
</div>
<ul class="navbar-nav flex-row align-items-center ms-auto">
<!-- Notification -->
<li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-1">
<a
class="nav-link dropdown-toggle hide-arrow"
href="javascript:void(0);"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<i class="ti ti-bell ti-md"></i>
<span class="badge bg-danger rounded-pill badge-notifications">5</span>
</a>
</li>
<!--/ Notification -->
<!-- Search Budgets -->
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
<a
class="nav-link hide-arrow"
href="<?= site_url('presupuestos/buscador'); ?>"
title="Acceso directo a buscador de presupuestos"
>
<i class="ti ti-report-search ti-md"></i>
</a>
</li>
<!--/ Search Budgets -->
<!-- View Mode links -->
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
<a
class="nav-link dropdown-toggle hide-arrow"
href="javascript:void(0);"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<i class="ti ti-building ti-md"></i>
</a>
<div class="dropdown-menu dropdown-menu-end py-0">
<div class="dropdown-menu-header border-bottom">
<div class="dropdown-header d-flex align-items-center py-3">
<h5 class="text-body mb-0 me-auto">Vistas</h5>
</div>
</div>
<div class="dropdown-shortcuts-list scrollable-container">
<div class="row row-bordered overflow-visible g-0">
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-printer fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_impresion); ?>"
class="stretched-link">Impresión</a>
</div>
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-ruler-2 fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_maquetacion); ?>"
class="stretched-link">Maquetación</a>
</div>
</div>
<div class="row row-bordered overflow-visible g-0">
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-2">
<i class="ti ti-file-code-2 fs-4"></i>
</span>
<small class="text-muted mb-0">Vista</small>
<a href="<?= site_url('viewmode/' . config("Basics")->vista_digitalizacion); ?>"
class="stretched-link">Digitalización</a>
</div>
</div>
</div>
</div>
</li>
<!-- View Mode links -->
<!-- Language -->
<li class="nav-item dropdown-language dropdown me-2 me-xl-0">
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
data-bs-toggle="dropdown">
<i class="fi <?= getCurrentLanguageFlag(); ?> fis rounded-circle me-1 fs-3"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="<?= site_url('lang/es'); ?>" data-language="es">
<i class="fi fi-es fis rounded-circle me-1 fs-3"></i>
<span class="align-middle"><?= lang("App.lang_es") ?></span>
</a>
</li>
<li>
<a class="dropdown-item" href="<?= site_url('lang/en'); ?>" data-language="en">
<i class="fi fi-gb fis rounded-circle me-1 fs-3"></i>
<span class="align-middle"><?= lang("App.lang_en") ?></span>
</a>
</li>
</ul>
</li>
<!--/ Language -->
<!-- User -->
<li class="nav-item navbar-dropdown dropdown-user dropdown">
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
data-bs-toggle="dropdown">
<div class="avatar">
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
</div>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="#">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar avatar">
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
</div>
</div>
<div class="flex-grow-1">
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
<small class="text-muted">Admin</small>
</div>
</div>
</a>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url('profile'); ?>">
<i class="ti ti-user-check me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_profile") ?></span>
</a>
</li>
<!-- <li>-->
<!-- <a class="dropdown-item" href="#">-->
<!-- <i class="ti ti-settings me-2 ti-sm"></i>-->
<!-- <span class="align-middle">Settings</span>-->
<!-- </a>-->
<!-- </li>-->
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url("logout") ?>">
<i class="ti ti-logout me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_logout") ?></span>
</a>
</li>
</ul>
</li>
<!--/ User -->
</ul>
</div>
</nav>
<!-- / Navbar -->
<!-- Content wrapper -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<h5 class="py-3 mb-4">
<?php include "breadcrumbs.php" ?>
</h5>
<?= $this->renderSection('content') ?>
</div>
<!-- / Content -->
<!-- Footer -->
<footer class="content-footer footer bg-footer-theme">
<div class="container-xxl">
<div class="footer-container d-flex align-items-center justify-content-between py-2 flex-md-row flex-column">
<div>
<a href="#" target="_blank" class="fw-semibold">Safekat</a> © <?= date('Y'); ?>
</div>
</div>
</div>
</footer>
<!-- / Footer -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
</div>
<!-- / Layout page -->
</div>
<!-- Overlay -->
<div class="layout-overlay layout-menu-toggle"></div>
<!-- Drag Target Area To SlideIn Menu On Small Screens -->
<div class="drag-target"></div>
</div>
<!-- / Layout wrapper -->
<?= $this->renderSection('footerAdditions') ?>
<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<!-- endbuild -->
<!-- Vendors JS -->
<?= $this->renderSection('additionalExternalJs') ?>
<!-- Main JS -->
<script src="<?= site_url('themes/vuexy/js/main.js') ?>"></script>
<!-- Page JS -->
<?= sweetAlert() ?>
<script type="text/javascript">
<?= $this->renderSection('additionalInlineJs') ?>
</script>
</body>
</html>

View File

@ -247,8 +247,8 @@ if (!empty($token) && $tfa == false) {
</div>
</div>
<div class="flex-grow-1">
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
<small class="text-muted">Admin</small>
<span class="fw-semibold d-block"><?= auth()->user()->getFullName(); ?></span>
<small class="text-muted"><?= auth()->user()->getEmail(); ?></small>
</div>
</div>
</a>

View File

@ -1,20 +0,0 @@
@echo off
REM Solicitar al usuario el nombre de la nueva rama
set /p nombre_rama=Nuevo nombre de la rama:
echo %nombre_rama%
REM Verificar si se proporciona un nombre de rama
if not "%nombre_rama%"=="" (
REM Cambiar y actualizar la rama main
git checkout main
git pull
REM Crear nueva rama
git checkout -b %nombre_rama%
REM Hacer push de la nueva rama al repositorio remoto
git push -u origin %nombre_rama%
echo Se ha creado (a partir de la rama main) y cambiado a la nueva rama: %nombre_rama%
) else (
echo No se proporcionó un nombre de rama. La creación de la rama ha sido omitida.
)