Merge branch 'dev/ui_fixing' into 'main'

Dev/ui fixing

See merge request jjimenez/safekat!29
This commit is contained in:
Ignacio Martinez Navajas
2023-07-12 10:38:54 +00:00
6185 changed files with 6817 additions and 317295 deletions

View File

@ -41,22 +41,22 @@ app.baseURL = 'https://sk-imn.imnavajas.es'
# DATABASE
#--------------------------------------------------------------------
database.default.hostname = localhost
database.default.database = sk_jjo
database.default.username = sk_jjo
database.default.password = 61tv&G1Zf^XY
database.default.DBDriver = MySQLi
database.default.DBPrefix =
database.default.dump =
# database.default.hostname = localhost
# database.default.database = sk_imn
# database.default.username = sk_imn
# database.default.password = Uyia19_87
# database.default.database = sk_jjo
# database.default.username = sk_jjo
# database.default.password = 61tv&G1Zf^XY
# database.default.DBDriver = MySQLi
# database.default.DBPrefix =
# database.default.dump =
database.default.hostname = localhost
database.default.database = sk_imn
database.default.username = sk_imn
database.default.password = Uyia19_87
database.default.DBDriver = MySQLi
database.default.DBPrefix =
database.default.dump =
# database.tests.hostname = localhost
# database.tests.database = ci4
# database.tests.username = root

View File

@ -52,25 +52,16 @@ $routes->delete('api/user/(:segment)', 'Api::user/delete/$1');
* --------------------------------------------------------------------
*/
$routes->group('paises', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Paises::index', ['as' => 'paisList']);
$routes->get('index', 'Paises::index', ['as' => 'paisIndex']);
$routes->get('add', 'Paises::add', ['as' => 'newPais']);
$routes->post('add', 'Paises::add', ['as' => 'createPais']);
$routes->get('edit/(:num)', 'Paises::edit/$1', ['as' => 'editPais']);
$routes->post('edit/(:num)', 'Paises::edit/$1', ['as' => 'updatePais']);
$routes->get('delete/(:num)', 'Paises::delete/$1', ['as' => 'deletePais']);
$routes->post('allmenuitems', 'Paises::allItemsSelect', ['as' => 'select2ItemsOfPaises']);
$routes->post('menuitems', 'Paises::menuItems', ['as' => 'menuItemsOfPaises']);
});
$routes->group('tarifaacabado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
$routes->get('', 'Tarifaacabado::index', ['as' => 'tarifaAcabadoList']);
$routes->get('index', 'Tarifaacabado::index', ['as' => 'tarifaAcabadoIndex']);
$routes->get('list', 'Tarifaacabado::index', ['as' => 'tarifaAcabadoList2']);
$routes->get('add', 'Tarifaacabado::add', ['as' => 'newTarifaAcabado']);
$routes->post('add', 'Tarifaacabado::add', ['as' => 'createTarifaAcabado']);
$routes->post('create', 'Tarifaacabado::create', ['as' => 'ajaxCreateTarifaAcabado']);
$routes->put('(:num)/update', 'Tarifaacabado::update/$1', ['as' => 'ajaxUpdateTarifaAcabado']);
$routes->post('edit/(:num)', 'Tarifaacabado::edit/$1', ['as' => 'updateTarifaAcabado']);
$routes->get('delete/(:num)', 'Tarifaacabado::delete/$1', ['as' => 'deleteTarifaAcabado']);
$routes->post('datatable', 'Tarifaacabado::datatable', ['as' => 'dataTableOfTarifasAcabado']);
$routes->post('allmenuitems', 'Tarifaacabado::allItemsSelect', ['as' => 'select2ItemsOfTarifasAcabado']);
$routes->post('menuitems', 'Tarifaacabado::menuItems', ['as' => 'menuItemsOfTarifasAcabado']);
@ -275,6 +266,74 @@ $routes->group('profile', ['namespace' => 'App\Controllers'], function ($routes)
});
$routes->group('comunidades-autonomas', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Comunidadesautonomas::index', ['as' => 'comunidadAutonomaList']);
$routes->get('add', 'Comunidadesautonomas::add', ['as' => 'newComunidadAutonoma']);
$routes->post('add', 'Comunidadesautonomas::add', ['as' => 'createComunidadAutonoma']);
$routes->post('create', 'Comunidadesautonomas::create', ['as' => 'ajaxCreateComunidadAutonoma']);
$routes->put('(:num)/update', 'Comunidadesautonomas::update/$1', ['as' => 'ajaxUpdateComunidadAutonoma']);
$routes->post('(:num)/edit', 'Comunidadesautonomas::edit/$1', ['as' => 'updateComunidadAutonoma']);
$routes->post('datatable', 'Comunidadesautonomas::datatable', ['as' => 'dataTableOfComunidadesAutonomas']);
$routes->post('allmenuitems', 'Comunidadesautonomas::allItemsSelect', ['as' => 'select2ItemsOfComunidadesAutonomas']);
$routes->post('menuitems', 'Comunidadesautonomas::menuItems', ['as' => 'menuItemsOfComunidadesAutonomas']);
});
$routes->resource('comunidades-autonomas', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Comunidadesautonomas', 'except' => 'show,new,create,update']);
$routes->group('paises', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Paises::index', ['as' => 'paisList']);
$routes->get('add', 'Paises::add', ['as' => 'newPais']);
$routes->post('add', 'Paises::add', ['as' => 'createPais']);
$routes->post('create', 'Paises::create', ['as' => 'ajaxCreatePais']);
$routes->put('(:num)/update', 'Paises::update/$1', ['as' => 'ajaxUpdatePais']);
$routes->post('(:num)/edit', 'Paises::edit/$1', ['as' => 'updatePais']);
$routes->post('datatable', 'Paises::datatable', ['as' => 'dataTableOfPaises']);
$routes->post('allmenuitems', 'Paises::allItemsSelect', ['as' => 'select2ItemsOfPaises']);
$routes->post('menuitems', 'Paises::menuItems', ['as' => 'menuItemsOfPaises']);
});
$routes->resource('paises', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Paises', 'except' => 'show,new,create,update']);
$routes->group('provincias', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Provincias::index', ['as' => 'provinciaList']);
$routes->get('add', 'Provincias::add', ['as' => 'newProvincia']);
$routes->post('add', 'Provincias::add', ['as' => 'createProvincia']);
$routes->post('create', 'Provincias::create', ['as' => 'ajaxCreateProvincia']);
$routes->put('(:num)/update', 'Provincias::update/$1', ['as' => 'ajaxUpdateProvincia']);
$routes->post('(:num)/edit', 'Provincias::edit/$1', ['as' => 'updateProvincia']);
$routes->post('datatable', 'Provincias::datatable', ['as' => 'dataTableOfProvincias']);
$routes->post('allmenuitems', 'Provincias::allItemsSelect', ['as' => 'select2ItemsOfProvincias']);
$routes->post('menuitems', 'Provincias::menuItems', ['as' => 'menuItemsOfProvincias']);
});
$routes->resource('provincias', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Provincias', 'except' => 'show,new,create,update']);
$routes->group('cliente', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
$routes->get('', 'Cliente::index', ['as' => 'clienteList']);
$routes->get('add', 'Cliente::add', ['as' => 'newCliente']);
$routes->post('add', 'Cliente::add', ['as' => 'createCliente']);
$routes->post('create', 'Cliente::create', ['as' => 'ajaxCreateCliente']);
$routes->put('(:num)/update', 'Cliente::update/$1', ['as' => 'ajaxUpdateCliente']);
$routes->post('(:num)/edit', 'Cliente::edit/$1', ['as' => 'updateCliente']);
$routes->post('datatable', 'Cliente::datatable', ['as' => 'dataTableOfClientes']);
$routes->post('allmenuitems', 'Cliente::allItemsSelect', ['as' => 'select2ItemsOfClientes']);
$routes->post('menuitems', 'Cliente::menuItems', ['as' => 'menuItemsOfClientes']);
});
$routes->resource('cliente', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Cliente', 'except' => 'show,new,create,update']);
$routes->group('formas-pagos', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Formaspagos::index', ['as' => 'formaDePagoList']);
$routes->get('add', 'Formaspagos::add', ['as' => 'newFormaDePago']);
$routes->post('add', 'Formaspagos::add', ['as' => 'createFormaDePago']);
$routes->post('create', 'Formaspagos::create', ['as' => 'ajaxCreateFormaDePago']);
$routes->put('(:num)/update', 'Formaspagos::update/$1', ['as' => 'ajaxUpdateFormaDePago']);
$routes->post('(:num)/edit', 'Formaspagos::edit/$1', ['as' => 'updateFormaDePago']);
$routes->post('datatable', 'Formaspagos::datatable', ['as' => 'dataTableOfFormasDePagos']);
$routes->post('allmenuitems', 'Formaspagos::allItemsSelect', ['as' => 'select2ItemsOfFormasDePagos']);
$routes->post('menuitems', 'Formaspagos::menuItems', ['as' => 'menuItemsOfFormasDePagos']);
});
$routes->resource('formas-pagos', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Formaspagos', 'except' => 'show,new,create,update']);
/*

View File

@ -1,50 +1,415 @@
<?php
namespace App\Controllers\Clientes;
use App\Controllers\BaseController;
<?php namespace App\Controllers\Clientes;
class Cliente extends BaseController
{
function __construct()
{
use App\Controllers\GoBaseResourceController;
use App\Models\Collection;
use App\Entities\Clientes\ClienteEntity;
use App\Models\Clientes\ClienteModel;
use App\Models\Configuracion\ProvinciaModel;
use App\Models\Configuracion\UserModel;
use App\Models\Configuracion\ComunidadAutonomaModel;
use App\Models\Configuracion\FormaPagoModel;
use App\Models\Configuracion\PaisModel;
class Cliente extends \App\Controllers\GoBaseResourceController {
protected $modelName = ClienteModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Cliente';
protected static $singularObjectNameCc = 'cliente';
protected static $pluralObjectName = 'Clientes';
protected static $pluralObjectNameCc = 'clientes';
protected static $controllerSlug = 'cliente';
protected static $viewPath = 'themes/backend/vuexy/form/clientes/cliente/';
protected $indexRoute = 'clienteList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
$this->viewData['pageTitle'] = lang('Clientes.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_clientes"), 'route' => "", 'active' => false],
['title' => lang("App.menu_cliente"), 'route' => site_url('clientes/cliente'), 'active' => true]
];
parent::initController($request, $response, $logger);
}
public function index()
{
$uri = service('uri');
$data['page_name'] = "Cliente";
$data['url'] = base_url() . $uri->getSegment(1) . '/' . $uri->getSegment(2);
echo view(getenv('theme.path').'main/demo_view', $data);
}
public function index() {
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Clientes.cliente')]),
'clienteEntity' => new ClienteEntity(),
'usingServerSideDataTable' => true,
];
public function delete()
{
$uri = service('uri');
$data['page_name'] = "Cliente";
$data['url'] = base_url() . $uri->getSegment(1) . '/' . $uri->getSegment(2);
echo view(getenv('theme.path').'main/demo_view', $data);
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath.'viewClienteList', $viewData);
}
public function add()
{
$uri = service('uri');
$data['page_name'] = "Cliente";
$data['url'] = base_url() . $uri->getSegment(1) . '/' . $uri->getSegment(2);
echo view(getenv('theme.path').'main/demo_view', $data);
public function add() {
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Clientes.cliente'))]);
$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;
if ($noException && $successfulResult) :
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Clientes.cliente'))]).'.';
$message .= anchor( "admin/cliente/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['clienteEntity'] = isset($sanitizedData) ? new ClienteEntity($sanitizedData) : new ClienteEntity();
$this->viewData['comunidadAutonomaList'] = $this->getComunidadAutonomaListItems($clienteEntity->comunidad_autonoma_id ?? null);
$this->viewData['provinciaList'] = $this->getProvinciaListItems($clienteEntity->provincia_id ?? null);
$this->viewData['paisList'] = $this->getPaisListItems($clienteEntity->pais_id ?? null);
$this->viewData['userList'] = $this->getUserListItems($clienteEntity->comercial_id ?? null);
$this->viewData['userList2'] = $this->getUserListItems2($clienteEntity->soporte_id ?? null);
$this->viewData['formaDePagoList'] = $this->getFormaDePagoListItems($clienteEntity->forma_pago_id ?? null);
$this->viewData['formAction'] = route_to('createCliente');
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Clientes.moduleTitle').' '.lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null) {
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$clienteEntity = $this->model->find($id);
if ($clienteEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Clientes.cliente')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
if ($this->request->getPost('credito_asegurado') == null ) {
$sanitizedData['credito_asegurado'] = false;
}
if ($this->request->getPost('disponible_fe') == null ) {
$sanitizedData['disponible_fe'] = false;
}
if ($this->request->getPost('message_tracking') == null ) {
$sanitizedData['message_tracking'] = false;
}
if ($this->request->getPost('message_production_start') == null ) {
$sanitizedData['message_production_start'] = false;
}
if ($this->request->getPost('tirada_flexible') == null ) {
$sanitizedData['tirada_flexible'] = false;
}
if ($this->request->getPost('lineasEnvioFactura') == null ) {
$sanitizedData['lineasEnvioFactura'] = false;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$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('Clientes.cliente'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$clienteEntity->fill($sanitizedData);
$thenRedirect = true;
endif;
if ($noException && $successfulResult) :
$id = $clienteEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Clientes.cliente'))]).'.';
$message .= anchor( "admin/cliente/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
//var_dump($clienteEntity); dd();
$this->viewData['clienteEntity'] = $clienteEntity;
$this->viewData['comunidadAutonomaList'] = $this->getComunidadAutonomaListItems($clienteEntity->comunidad_autonoma_id ?? null);
$this->viewData['provinciaList'] = $this->getProvinciaListItems($clienteEntity->provincia_id ?? null);
$this->viewData['paisList'] = $this->getPaisListItems($clienteEntity->pais_id ?? null);
$this->viewData['userList'] = $this->getUserListItems($clienteEntity->comercial_id ?? null);
$this->viewData['userList2'] = $this->getUserListItems2($clienteEntity->soporte_id ?? null);
$this->viewData['formaDePagoList'] = $this->getFormaDePagoListItems($clienteEntity->forma_pago_id ?? null);
$this->viewData['formAction'] = route_to('updateCliente', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Clientes.moduleTitle').' '.lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function datatable() {
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = ClienteModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
foreach ($resourceData as $item) :
if (isset($item->direccion) && strlen($item->direccion) > 100) :
$item->direccion = character_limiter($item->direccion, 100);
endif;if (isset($item->comentarios_tirada_flexible) && strlen($item->comentarios_tirada_flexible) > 100) :
$item->comentarios_tirada_flexible = character_limiter($item->comentarios_tirada_flexible, 100);
endif;if (isset($item->comentarios_produccion) && strlen($item->comentarios_produccion) > 100) :
$item->comentarios_produccion = character_limiter($item->comentarios_produccion, 100);
endif;if (isset($item->comentarios) && strlen($item->comentarios) > 100) :
$item->comentarios = character_limiter($item->comentarios, 100);
endif;
endforeach;
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function edit()
{
$uri = service('uri');
$data['page_name'] = "Cliente";
$data['url'] = base_url() . $uri->getSegment(1) . '/' . $uri->getSegment(2);
echo view(getenv('theme.path').'main/demo_view', $data);
public function allItemsSelect() {
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal.', nombre', 'nombre', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems() {
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems($selId = null) {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
if (!empty($selId)) :
$paisModel = model('App\Models\Configuracion\PaisModel');
$selOption = $paisModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
protected function getUserListItems($selId = null) {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
if (!empty($selId)) :
$userModel = model('App\Models\Usuarios\UserModel');
$selOption = $userModel->where('id_user', $selId)->findColumn('first_name');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
protected function getComunidadAutonomaListItems($selId = null) {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))])];
if (!empty($selId)) :
$comunidadAutonomaModel = model('App\Models\Configuracion\ComunidadAutonomaModel');
$selOption = $comunidadAutonomaModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
protected function getUserListItems2($selId = null) {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
if (!empty($selId)) :
$userModel = model('App\Models\Configuracion\UserModel');
$selOption = $userModel->where('id_user', $selId)->findColumn('last_name');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
protected function getFormaDePagoListItems($selId = null) {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('FormasPagoes.formaDePago'))])];
if (!empty($selId)) :
$formaPagoModel = model('App\Models\Configuracion\FormaPagoModel');
$selOption = $formaPagoModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
protected function getProvinciaListItems($selId = null) {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Provincias.provincia'))])];
if (!empty($selId)) :
$provinciaModel = model('App\Models\Configuracion\ProvinciaModel');
$selOption = $provinciaModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
}

View File

@ -0,0 +1,289 @@
<?php namespace App\Controllers\Configuracion;
use App\Controllers\GoBaseResourceController;
use App\Models\Collection;
use App\Entities\Configuracion\ComunidadAutonomaEntity;
use App\Models\Configuracion\PaisModel;
use App\Models\Configuracion\ComunidadAutonomaModel;
class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
protected $modelName = ComunidadAutonomaModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Comunidad Autonoma';
protected static $singularObjectNameCc = 'comunidadAutonoma';
protected static $pluralObjectName = 'Comunidades Autonomas';
protected static $pluralObjectNameCc = 'comunidadesAutonomas';
protected static $controllerSlug = 'comunidades-autonomas';
protected static $viewPath = 'themes/backend/vuexy/form/configuracion/comunidades-autonomas/';
protected $indexRoute = 'comunidadAutonomaList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
$this->viewData['pageTitle'] = lang('ComunidadesAutonomas.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
parent::initController($request, $response, $logger);
}
public function index() {
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('ComunidadesAutonomas.comunidadAutonoma')]),
'comunidadAutonomaEntity' => new ComunidadAutonomaEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath.'viewComunidadAutonomaList', $viewData);
}
public function add() {
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))]);
$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;
if ($noException && $successfulResult) :
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))]).'.';
$message .= anchor( "admin/comunidades-autonomas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['comunidadAutonomaEntity'] = isset($sanitizedData) ? new ComunidadAutonomaEntity($sanitizedData) : new ComunidadAutonomaEntity();
$this->viewData['paisList'] = $this->getPaisListItems($comunidadAutonomaEntity->pais_id ?? null);
$this->viewData['formAction'] = route_to('createComunidadAutonoma');
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('ComunidadesAutonomas.moduleTitle').' '.lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null) {
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$comunidadAutonomaEntity = $this->model->find($id);
if ($comunidadAutonomaEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$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('ComunidadesAutonomas.comunidadAutonoma'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$comunidadAutonomaEntity->fill($sanitizedData);
$thenRedirect = true;
endif;
if ($noException && $successfulResult) :
$id = $comunidadAutonomaEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))]).'.';
$message .= anchor( "admin/comunidades-autonomas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['comunidadAutonomaEntity'] = $comunidadAutonomaEntity;
$this->viewData['paisList'] = $this->getPaisListItems($comunidadAutonomaEntity->pais_id ?? null);
$this->viewData['formAction'] = route_to('updateComunidadAutonoma', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('ComunidadesAutonomas.moduleTitle').' '.lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function datatable() {
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = ComunidadAutonomaModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function allItemsSelect() {
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal.', nombre', 'nombre', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems() {
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems($selId = null) {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
if (!empty($selId)) :
$paisModel = model('App\Models\Configuracion\PaisModel');
$selOption = $paisModel->where('id', $selId)->findColumn('id');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
}

View File

@ -1,35 +1,232 @@
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseController;
<?php namespace App\Controllers\Configuracion;
class Formaspago extends BaseController
{
function __construct()
{
use App\Entities\Configuracion\FormasPagoEntity;
class Formaspago extends \App\Controllers\GoBaseController {
use \CodeIgniter\API\ResponseTrait;
protected static $primaryModelName = 'App\Models\Configuracion\FormasPagoModel';
protected static $singularObjectNameCc = 'formaPago';
protected static $singularObjectName = 'Forma Pago';
protected static $pluralObjectName = 'Formas Pago';
protected static $controllerSlug = 'formaspago';
protected static $viewPath = 'themes/backend/vuexy/form/configuracion/formas-pago/';
protected $indexRoute = 'formaPagoList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
$this->viewData['pageTitle'] = lang('FormasPagoes.moduleTitle');
parent::initController($request, $response, $logger);
$this->viewData['usingSweetAlert'] = true;
if (session('errorMessage')) {
$this->session->setFlashData('sweet-error', session('errorMessage'));
}
if (session('successMessage')) {
$this->session->setFlashData('sweet-success', session('successMessage'));
}
}
public function index() {
$this->viewData['usingClientSideDataTable'] = true;
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('FormasPagoes.formaPago')]);
parent::index();
}
public function add() {
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
}
public function index()
{
echo 'Formas de pago';
}
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('FormasPagoes.formaPago'))]);
$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;
if ($noException && $successfulResult) :
public function edit()
{
$id = $this->model->db->insertID();
}
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('FormasPagoes.formaPago'))]).'.';
$message .= anchor(route_to('editFormaPago', $id), lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
public function add()
{
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['formasPagoEntity'] = isset($sanitizedData) ? new FormasPagoEntity($sanitizedData) : new FormasPagoEntity();
$this->viewData['formAction'] = route_to('createFormaPago');
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('FormasPagoes.formaPago').' '.lang('Basic.global.addNewSuffix');
}
public function delete()
{
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null) {
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$formasPagoEntity = $this->model->find($id);
if ($formasPagoEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('FormasPagoes.formaPago')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$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('FormasPagoes.formaPago'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$formasPagoEntity->fill($sanitizedData);
$thenRedirect = true;
endif;
if ($noException && $successfulResult) :
$id = $formasPagoEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('FormasPagoes.formaPago'))]).'.';
$message .= anchor(route_to('editFormaPago', $id), lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['formasPagoEntity'] = $formasPagoEntity;
$this->viewData['formAction'] = route_to('updateFormaPago', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('FormasPagoes.formaPago').' '.lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function allItemsSelect() {
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal.', nombre', 'nombre', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems() {
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -0,0 +1,271 @@
<?php namespace App\Controllers\Configuracion;
use App\Controllers\GoBaseResourceController;
use App\Models\Collection;
use App\Entities\Configuracion\FormaPagoEntity;
use App\Models\Configuracion\FormaPagoModel;
class Formaspagos extends \App\Controllers\GoBaseResourceController {
protected $modelName = FormaPagoModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Forma de Pago';
protected static $singularObjectNameCc = 'formaDePago';
protected static $pluralObjectName = 'Formas de Pagos';
protected static $pluralObjectNameCc = 'formasDePagos';
protected static $controllerSlug = 'formas-pagos';
protected static $viewPath = 'themes/backend/vuexy/form/configuracion/formasPagoViews/';
protected $indexRoute = 'formaDePagoList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
$this->viewData['pageTitle'] = lang('FormasPagoes.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
parent::initController($request, $response, $logger);
}
public function index() {
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('FormasPagoes.formaDePago')]),
'formaPagoEntity' => new FormaPagoEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath.'viewFormaDePagoList', $viewData);
}
public function add() {
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('FormasPagoes.formaDePago'))]);
$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;
if ($noException && $successfulResult) :
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('FormasPagoes.formaDePago'))]).'.';
$message .= anchor( "admin/formas-pagos/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['formaPagoEntity'] = isset($sanitizedData) ? new FormaPagoEntity($sanitizedData) : new FormaPagoEntity();
$this->viewData['formAction'] = route_to('createFormaDePago');
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('FormasPagoes.moduleTitle').' '.lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null) {
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$formaPagoEntity = $this->model->find($id);
if ($formaPagoEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('FormasPagoes.formaDePago')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$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('FormasPagoes.formaDePago'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$formaPagoEntity->fill($sanitizedData);
$thenRedirect = true;
endif;
if ($noException && $successfulResult) :
$id = $formaPagoEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('FormasPagoes.formaDePago'))]).'.';
$message .= anchor( "admin/formas-pagos/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['formaPagoEntity'] = $formaPagoEntity;
$this->viewData['formAction'] = route_to('updateFormaDePago', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('FormasPagoes.moduleTitle').' '.lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function datatable() {
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = FormaPagoModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function allItemsSelect() {
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal.', nombre', 'nombre', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems() {
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -1,19 +1,27 @@
<?php namespace App\Controllers\Configuracion;
use App\Entities\Configuracion\Pais;
class Paises extends \App\Controllers\GoBaseController {
use App\Controllers\GoBaseResourceController;
use \CodeIgniter\API\ResponseTrait;
use App\Models\Collection;
protected static $primaryModelName = 'App\Models\Configuracion\PaisModel';
use App\Entities\Configuracion\PaisEntity;
use App\Models\Configuracion\PaisModel;
class Paises extends \App\Controllers\GoBaseResourceController {
protected $modelName = PaisModel::class;
protected $format = 'json';
protected static $singularObjectNameCc = 'pais';
protected static $singularObjectName = 'Pais';
protected static $singularObjectNameCc = 'pais';
protected static $pluralObjectName = 'Paises';
protected static $pluralObjectNameCc = 'paises';
protected static $controllerSlug = 'paises';
static $viewPath = '';
protected static $viewPath = 'themes/backend/vuexy/form/configuracion/paises/';
protected $indexRoute = 'paisList';
@ -21,21 +29,27 @@ class Paises extends \App\Controllers\GoBaseController {
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
$this->viewData['pageTitle'] = lang('Paises.moduleTitle');
self::$viewPath = getenv('theme.path').'form/configuracion/paises/';
$this->viewData['usingSweetAlert'] = true;
parent::initController($request, $response, $logger);
}
public function index() {
$this->viewData['usingClientSideDataTable'] = true;
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Paises.pais')]);
parent::index();
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Paises.pais')]),
'paisEntity' => new PaisEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath.'viewPaisList', $viewData);
}
public function add() {
@ -47,12 +61,13 @@ class Paises extends \App\Controllers\GoBaseController {
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
@ -73,28 +88,28 @@ class Paises extends \App\Controllers\GoBaseController {
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Paises.pais'))]).'.';
$message .= anchor(route_to('editPais', $id), lang('Basic.global.continueEditing').'?');
$message .= anchor( "admin/paises/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('successMessage', $message);
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('successMessage', $message);
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->viewData['successMessage'] = $message;
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['pais'] = isset($sanitizedData) ? new Pais($sanitizedData) : new Pais();
$this->viewData['paisEntity'] = isset($sanitizedData) ? new PaisEntity($sanitizedData) : new PaisEntity();
$this->viewData['formAction'] = route_to('createPais');
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Paises.pais').' '.lang('Basic.global.addNewSuffix');
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Paises.moduleTitle').' '.lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
@ -106,11 +121,11 @@ class Paises extends \App\Controllers\GoBaseController {
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$pais = $this->model->find($id);
$paisEntity = $this->model->find($id);
if ($pais == false) :
if ($paisEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Paises.pais')), $id]);
return $this->redirect2listView('errorMessage', $message);
return $this->redirect2listView('sweet-error', $message);
endif;
$requestMethod = $this->request->getMethod();
@ -120,10 +135,11 @@ class Paises extends \App\Controllers\GoBaseController {
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
if ($this->request->getPost('show_erp') == null ) {
$sanitizedData['show_erp'] = false;
}
if ($this->request->getPost('show_erp') == null ) {
$sanitizedData['show_erp'] = false;
}
@ -145,49 +161,76 @@ class Paises extends \App\Controllers\GoBaseController {
endif;
$pais->fill($sanitizedData);
$paisEntity->fill($sanitizedData);
$thenRedirect = true;
endif;
if ($noException && $successfulResult) :
$id = $pais->id ?? $id;
$id = $paisEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Paises.pais'))]).'.';
$message .= anchor(route_to('editPais', $id), lang('Basic.global.continueEditing').'?');
$message .= anchor( "admin/paises/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('successMessage', $message);
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('successMessage', $message);
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->viewData['successMessage'] = $message;
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['pais'] = $pais;
$this->viewData['formAction'] = route_to('updatePais', $id);
$this->viewData['paisEntity'] = $paisEntity;
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Paises.pais').' '.lang('Basic.global.edit3');
$this->viewData['formAction'] = route_to('updatePais', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Paises.moduleTitle').' '.lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function datatable() {
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = PaisModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function allItemsSelect() {
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal.', Select a field...', 'Select a field...', $onlyActiveOnes, false);
$menu = $this->model->getAllForMenu($reqVal.', nombre', 'nombre', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
//$nonItem->'Select a field...' = '- '.lang('Basic.global.None').' -';
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
@ -201,14 +244,14 @@ class Paises extends \App\Controllers\GoBaseController {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems() {
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'Select a field...'];
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
@ -227,5 +270,5 @@ class Paises extends \App\Controllers\GoBaseController {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -0,0 +1,289 @@
<?php namespace App\Controllers\Configuracion;
use App\Controllers\GoBaseResourceController;
use App\Models\Collection;
use App\Entities\Configuracion\ProvinciaEntity;
use App\Models\Configuracion\PaisModel;
use App\Models\Configuracion\ProvinciaModel;
class Provincias extends \App\Controllers\GoBaseResourceController {
protected $modelName = ProvinciaModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Provincia';
protected static $singularObjectNameCc = 'provincia';
protected static $pluralObjectName = 'Provincias';
protected static $pluralObjectNameCc = 'provincias';
protected static $controllerSlug = 'provincias';
protected static $viewPath = 'themes/backend/vuexy/form/configuracion/provincias/';
protected $indexRoute = 'provinciaList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
$this->viewData['pageTitle'] = lang('Provincias.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
parent::initController($request, $response, $logger);
}
public function index() {
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Provincias.provincia')]),
'provinciaEntity' => new ProvinciaEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath.'viewProvinciaList', $viewData);
}
public function add() {
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Provincias.provincia'))]);
$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;
if ($noException && $successfulResult) :
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Provincias.provincia'))]).'.';
$message .= anchor( "admin/provincias/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['provinciaEntity'] = isset($sanitizedData) ? new ProvinciaEntity($sanitizedData) : new ProvinciaEntity();
$this->viewData['paisList'] = $this->getPaisListItems($provinciaEntity->pais_id ?? null);
$this->viewData['formAction'] = route_to('createProvincia');
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Provincias.moduleTitle').' '.lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null) {
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$provinciaEntity = $this->model->find($id);
if ($provinciaEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Provincias.provincia')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
$requestMethod = $this->request->getMethod();
if ($requestMethod === 'post') :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$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('Provincias.provincia'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$provinciaEntity->fill($sanitizedData);
$thenRedirect = true;
endif;
if ($noException && $successfulResult) :
$id = $provinciaEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Provincias.provincia'))]).'.';
$message .= anchor( "admin/provincias/{$id}/edit" , lang('Basic.global.continueEditing').'?');
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['provinciaEntity'] = $provinciaEntity;
$this->viewData['paisList'] = $this->getPaisListItems($provinciaEntity->pais_id ?? null);
$this->viewData['formAction'] = route_to('updateProvincia', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Provincias.moduleTitle').' '.lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function datatable() {
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = ProvinciaModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function allItemsSelect() {
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal.', nombre', 'nombre', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems() {
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems($selId = null) {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
if (!empty($selId)) :
$paisModel = model('App\Models\Configuracion\PaisModel');
$selOption = $paisModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
}

View File

@ -568,7 +568,7 @@ class login extends BaseController
if($user != null){
$phpass = new PasswordHash(8, true);
$this->user_model->save([
'id_user' => $user['id_user'],
'id_user' => $user->id_user,
'password' => $phpass->HashPassword($listPost['password'])
]);
$this->pass_recovery_model->save([

View File

@ -13,8 +13,36 @@ class Presupuesto extends BaseController
public function index()
{
echo 'Presupuesto';
}
$data['title'] = [
'module' => lang("App.settings_title"),
'page' => lang("App.settings_subtitle"),
'icon' => 'fas fa-sliders-h'
];
$data['breadcrumb'] = [
['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto'), 'active' => true]
];
echo view(getenv('theme.path').'form/presupuestos/index', $data);
}
public function tapa_blanda_encolada()
{
$data['title'] = [
'module' => lang("App.settings_title"),
'page' => lang("App.settings_subtitle"),
'icon' => 'fas fa-sliders-h'
];
$data['breadcrumb'] = [
['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto'), 'active' => false],
['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto/tapa_blanda_encolada'), 'active' => true]
];
echo view(getenv('theme.path').'form/presupuestos/tapa-blanda-encolada', $data);
}
public function delete()
{

View File

@ -343,7 +343,7 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
$this->model->getResource($search, $id_TM)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);

View File

@ -0,0 +1,85 @@
<?php
namespace App\Entities\Clientes;
use CodeIgniter\Entity;
class ClienteEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"nombre" => null,
"alias" => null,
"cif" => null,
"direccion" => null,
"ciudad" => null,
"comunidad_autonoma_id" => null,
"provincia_id" => 0,
"cp" => null,
"pais_id" => null,
"telefono" => null,
"email" => null,
"comercial_id" => 1,
"soporte_id" => 1,
"forma_pago_id" => null,
"vencimiento" => 15,
"fecha_vencimiento" => null,
"margen" => 40.0,
"margen_pod" => null,
"descuento" => 0.0,
"limite_credito" => 0.0,
"limite_credito_user_id" => 1,
"limite_credito_change_at" => null,
"credito_solunion" => null,
"credito_asegurado" => false,
"ccc" => null,
"ccc_cliente" => null,
"num_cuenta" => null,
"disponible_fe" => false,
"message_tracking" => true,
"message_production_start" => true,
"tirada_flexible" => false,
"descuento_tirada_flexible" => 20.0,
"comentarios_tirada_flexible" => null,
"saturacion" => 100.0,
"tienda_id" => null,
"margen_plantilla_id" => null,
"comentarios_produccion" => null,
"ps_customer_id" => null,
"lineasEnvioFactura" => true,
"comentarios" => null,
"is_deleted" => 0,
"deleted_at" => null,
"created_at" => null,
"updated_at" => null,
"user_created_id" => 1,
"user_update_id" => 1,
];
protected $casts = [
"comunidad_autonoma_id" => "?int",
"provincia_id" => "int",
"pais_id" => "?int",
"comercial_id" => "int",
"soporte_id" => "int",
"forma_pago_id" => "?int",
"vencimiento" => "int",
"margen" => "float",
"margen_pod" => "?float",
"descuento" => "float",
"limite_credito" => "float",
"limite_credito_user_id" => "int",
"credito_asegurado" => "?boolean",
"disponible_fe" => "boolean",
"message_tracking" => "boolean",
"message_production_start" => "boolean",
"tirada_flexible" => "boolean",
"descuento_tirada_flexible" => "float",
"saturacion" => "float",
"tienda_id" => "?int",
"margen_plantilla_id" => "?int",
"ps_customer_id" => "?int",
"lineasEnvioFactura" => "boolean",
"is_deleted" => "int",
"user_created_id" => "int",
"user_update_id" => "int",
];
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Entities\Configuracion;
use CodeIgniter\Entity;
class ComunidadAutonomaEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"nombre" => null,
"pais_id" => null,
"created_at" => null,
"updated_at" => null,
];
protected $casts = [
"pais_id" => "int",
];
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Entities\Configuracion;
use CodeIgniter\Entity;
class ComunidadesAutonomasEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"nombre" => null,
"pais_id" => null,
"created_at" => null,
"updated_at" => null,
];
protected $casts = [
"pais_id" => "int",
];
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Entities\Configuracion;
use CodeIgniter\Entity;
class FormaPagoEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"nombre" => null,
"created_at" => null,
"updated_at" => null,
];
protected $casts = [];
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Entities\Configuracion;
use CodeIgniter\Entity;
class FormasPagoEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"nombre" => null,
"created_at" => null,
"updated_at" => null,
];
protected $casts = [];
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Entities\Configuracion;
use CodeIgniter\Entity;
class PaisEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"nombre" => null,
"code" => null,
"code3" => null,
"moneda" => null,
"url_erp" => null,
"user_erp" => null,
"key_erp" => null,
"show_erp" => false,
];
protected $casts = [
"show_erp" => "boolean",
];
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Entities\Configuracion;
use CodeIgniter\Entity;
class ProvinciaEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"code" => null,
"nombre" => null,
"pais_id" => 1,
"created_at" => null,
"updated_at" => null,
];
protected $casts = [
"pais_id" => "int",
];
}

View File

@ -8,6 +8,8 @@ class TarifaacabadoEntity extends \CodeIgniter\Entity\Entity
protected $attributes = [
"id" => null,
"nombre" => null,
"precio_min" => 0,
"importe_fijo" => 0,
"user_created_id" => 0,
"user_update_id" => 0,
"is_deleted" => 0,

View File

@ -0,0 +1,233 @@
<?php
return [
'alias' => 'Alias',
'ccc' => 'Ccc',
'cccCliente' => 'Ccc Cliente',
'cif' => 'Cif',
'ciudad' => 'Ciudad',
'cliente' => 'Clientes',
'clienteList' => 'Cliente List',
'clientes' => 'Clientes',
'comentarios' => 'Comentarios',
'comentariosProduccion' => 'Comentarios Produccion',
'comentariosTiradaFlexible' => 'Comentarios Tirada Flexible',
'comercialId' => 'Comercial',
'comunidadAutonomaId' => 'Comunidad Autonoma ID',
'cp' => 'Cp',
'createdAt' => 'Created At',
'creditoAsegurado' => 'Credito Asegurado',
'creditoSolunion' => 'Credito Solunion',
'deletedAt' => 'Deleted At',
'descuento' => 'Descuento',
'descuentoTiradaFlexible' => 'Descuento Tirada Flexible',
'direccion' => 'Direccion',
'disponibleFe' => 'Disponible Fe',
'email' => 'Email',
'fechaVencimiento' => 'Fecha Vencimiento',
'formaPagoId' => 'Forma Pago ID',
'id' => 'ID',
'isDeleted' => 'Is Deleted',
'limiteCredito' => 'Limite Credito',
'limiteCreditoChangeAt' => 'Limite Credito Change At',
'limiteCreditoUserId' => 'Limite Credito User ID',
'lineasenviofactura' => 'Lineasenviofactura',
'margen' => 'Margen',
'margenPlantillaId' => 'Margen Plantilla ID',
'margenPod' => 'Margen Pod',
'messageProductionStart' => 'Message Production Start',
'messageTracking' => 'Message Tracking',
'moduleTitle' => 'Clientes',
'nombre' => 'Nombre',
'numCuenta' => 'Num Cuenta',
'paisId' => 'Pais ID',
'provinciaId' => 'Provincia',
'psCustomerId' => 'Ps Customer ID',
'saturacion' => 'Saturacion',
'soporteId' => 'Soporte',
'telefono' => 'Telefono',
'tiendaId' => 'Tienda ID',
'tiradaFlexible' => 'Tirada Flexible',
'updatedAt' => 'Updated At',
'userCreatedId' => 'User Created ID',
'userUpdateId' => 'User Update ID',
'vencimiento' => 'Vencimiento',
'validation' => [
'ccc' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'ccc_cliente' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'ciudad' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'comentarios' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'comentarios_produccion' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'cp' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'credito_solunion' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'direccion' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'fecha_vencimiento' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'margen_plantilla_id' => [
'integer' => 'The {field} field must contain an integer.',
],
'margen_pod' => [
'decimal' => 'The {field} field must contain a decimal number.',
],
'num_cuenta' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'ps_customer_id' => [
'integer' => 'The {field} field must contain an integer.',
],
'telefono' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'tienda_id' => [
'integer' => 'The {field} field must contain an integer.',
],
'alias' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
'cif' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
'comentarios_tirada_flexible' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
'descuento' => [
'decimal' => 'The {field} field must contain a decimal number.',
'required' => 'The {field} field is required.',
],
'descuento_tirada_flexible' => [
'decimal' => 'The {field} field must contain a decimal number.',
'required' => 'The {field} field is required.',
],
'email' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'valid_email' => 'The {field} field must contain a valid email address.',
],
'is_deleted' => [
'integer' => 'The {field} field must contain an integer.',
'required' => 'The {field} field is required.',
],
'limite_credito' => [
'decimal' => 'The {field} field must contain a decimal number.',
'required' => 'The {field} field is required.',
],
'limite_credito_change_at' => [
'required' => 'The {field} field is required.',
'valid_date' => 'The {field} field must contain a valid date.',
],
'limite_credito_user_id' => [
'integer' => 'The {field} field must contain an integer.',
'required' => 'The {field} field is required.',
],
'margen' => [
'decimal' => 'The {field} field must contain a decimal number.',
'required' => 'The {field} field is required.',
],
'nombre' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
'saturacion' => [
'decimal' => 'The {field} field must contain a decimal number.',
'required' => 'The {field} field is required.',
],
'user_created_id' => [
'integer' => 'The {field} field must contain an integer.',
'required' => 'The {field} field is required.',
],
'user_update_id' => [
'integer' => 'The {field} field must contain an integer.',
'required' => 'The {field} field is required.',
],
'vencimiento' => [
'integer' => 'The {field} field must contain an integer.',
'required' => 'The {field} field is required.',
],
],
];

View File

@ -0,0 +1,34 @@
<?php
return [
'comunidadAutonoma' => 'Comunidad Autonoma',
'comunidadAutonomaList' => 'Comunidad Autonoma List',
'comunidades-autonomas' => 'Comunidades Autonomas',
'comunidadesAutonoma' => 'Comunidades Autonoma',
'comunidadesAutonomaList' => 'Comunidades Autonoma List',
'comunidadesAutonomas' => 'Comunidades Autonomas',
'createdAt' => 'Created At',
'id' => 'ID',
'moduleTitle' => 'Comunidades Autonomas',
'nombre' => 'Nombre',
'paisId' => 'Pais',
'updatedAt' => 'Updated At',
'validation' => [
'id' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'nombre' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
],
];

View File

@ -0,0 +1,35 @@
<?php
return [
'createdAt' => 'Created At',
'formaDePago' => 'Forma de Pago',
'formaDePagoList' => 'Forma de Pago List',
'formas-pagoes' => 'Formas Pagoes',
'formas-pagos' => 'Formas de Pagos',
'formasDePagos' => 'Formas de Pagos',
'formasPago' => 'Formas Pago',
'formasPagoList' => 'Formas Pago List',
'formasPagoes' => 'Formas Pagoes',
'id' => 'ID',
'moduleTitle' => 'Formas Pagoes',
'nombre' => 'Nombre',
'updatedAt' => 'Updated At',
'validation' => [
'id' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'nombre' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
],
];

View File

@ -8,11 +8,13 @@ return [
'id' => 'ID',
'keyErp' => 'Key Erp',
'moduleTitle' => 'Paises',
'moneda' => 'Currency',
'nombre' => 'Name',
'pais' => 'Country',
'paisList' => 'Country List',
'paises' => 'Countries',
'moneda' => 'Moneda',
'nombre' => 'Nombre',
'pais' => 'Pais',
'paisList' => 'Pais List',
'paise' => 'Paise',
'paiseList' => 'Paise List',
'paises' => 'Paises',
'showErp' => 'Show Erp',
'urlErp' => 'URL Erp',
'userErp' => 'User Erp',
@ -22,6 +24,11 @@ return [
],
'id' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'key_erp' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',

View File

@ -0,0 +1,44 @@
<?php
return [
'code' => 'Code',
'createdAt' => 'Created At',
'id' => 'ID',
'moduleTitle' => 'Provincias',
'nombre' => 'Nombre',
'paisId' => 'Pais ID',
'provincia' => 'Provincia',
'provinciaList' => 'Provincia List',
'provincias' => 'Provincias',
'updatedAt' => 'Updated At',
'validation' => [
'id' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'pais_id' => [
'integer' => 'The {field} field must contain an integer.',
],
'nombre' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
'code' => [
'is_unique' => 'The {field} field must contain a unique value',
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
],
];

View File

@ -646,7 +646,7 @@ return [
"permisos_catalogo" => "Catálogo",
"permisos_clientes" => "Clientes",
"permisos_clientes" => "Cliente",
"permisos_tarifacliente" => "Tarifas cliente",
"permisos_proveedores" => "Proveedores",
@ -672,6 +672,7 @@ return [
"menu_dashboard" => "Panel de control",
"menu_clientes" => "Clientes",
"menu_cliente" => "Cliente",
"menu_clientes_nuevo" => "Nuevo",
"menu_tarifacliente" => "Tarifas",

View File

@ -0,0 +1,233 @@
<?php
return [
'alias' => 'Alias',
'ccc' => 'Ccc',
'cccCliente' => 'Ccc Cliente',
'cif' => 'CIF',
'ciudad' => 'Ciudad',
'cliente' => 'Clientes',
'clienteList' => 'Cliente List',
'clientes' => 'Clientes',
'comentarios' => 'Comentarios',
'comentariosProduccion' => 'Comentarios Producción',
'comentariosTiradaFlexible' => 'Comentarios Tirada Flexible',
'comercialId' => 'Comercial',
'comunidadAutonomaId' => 'Comunidad Autónoma ID',
'cp' => 'Cp',
'createdAt' => 'Creado el',
'creditoAsegurado' => 'Crédito Asegurado',
'creditoSolunion' => 'Crédito Solunion',
'deletedAt' => 'Deleted At',
'descuento' => 'Descuento',
'descuentoTiradaFlexible' => 'Descuento Tirada Flexible',
'direccion' => 'Dirección',
'disponibleFe' => 'Disponible Fe',
'email' => 'Email',
'fechaVencimiento' => 'Fecha Vencimiento',
'formaPagoId' => 'Forma Pago ID',
'id' => 'ID',
'isDeleted' => 'Is Deleted',
'limiteCredito' => 'Limite Crédito',
'limiteCreditoChangeAt' => 'Limite Crédito Change At',
'limiteCreditoUserId' => 'Limite Crédito User ID',
'lineasenviofactura' => 'Lineas envéo factura',
'margen' => 'Margen',
'margenPlantillaId' => 'Margen Plantilla ID',
'margenPod' => 'Margen Pod',
'messageProductionStart' => 'Message Production Start',
'messageTracking' => 'Message Tracking',
'moduleTitle' => 'Clientes',
'nombre' => 'Nombre',
'numCuenta' => 'Num Cuenta',
'paisId' => 'Pais ID',
'provinciaId' => 'Provincia',
'psCustomerId' => 'Ps Customer ID',
'saturacion' => 'Saturación',
'soporteId' => 'Soporte',
'telefono' => 'Teléfono',
'tiendaId' => 'Tienda ID',
'tiradaFlexible' => 'Tirada Flexible',
'updatedAt' => 'Actualizado el',
'userCreatedId' => 'User Created ID',
'userUpdateId' => 'User Update ID',
'vencimiento' => 'Vencimiento',
'validation' => [
'ccc' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'ccc_cliente' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'ciudad' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'comentarios' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'comentarios_produccion' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'cp' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'credito_solunion' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'direccion' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'fecha_vencimiento' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'margen_plantilla_id' => [
'integer' => 'El campo {field} debe contener un número entero.',
],
'margen_pod' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
],
'num_cuenta' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'ps_customer_id' => [
'integer' => 'El campo {field} debe contener un número entero.',
],
'telefono' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'tienda_id' => [
'integer' => 'El campo {field} debe contener un número entero.',
],
'alias' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'cif' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'comentarios_tirada_flexible' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'descuento' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
'descuento_tirada_flexible' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
'email' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'valid_email' => 'The {field} field must contain a valid email address.',
],
'is_deleted' => [
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],
'limite_credito' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
'limite_credito_change_at' => [
'required' => 'El campo {field} es obligatorio.',
'valid_date' => 'The {field} field must contain a valid date.',
],
'limite_credito_user_id' => [
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],
'margen' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
'nombre' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'saturacion' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
'user_created_id' => [
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],
'user_update_id' => [
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],
'vencimiento' => [
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],
],
];

View File

@ -0,0 +1,34 @@
<?php
return [
'comunidadAutonoma' => 'Comunidad Autónoma',
'comunidadAutonomaList' => 'Comunidad Autónoma List',
'comunidades-autonomas' => 'Comunidades Autónomas',
'comunidadesAutonoma' => 'Comunidades Autónoma',
'comunidadesAutonomaList' => 'Comunidades Autónoma List',
'comunidadesAutonomas' => 'Comunidades Autónomas',
'createdAt' => 'Creado el',
'id' => 'ID',
'moduleTitle' => 'Comunidades Autónomas',
'nombre' => 'Nombre',
'paisId' => 'País',
'updatedAt' => 'Actualizado el',
'validation' => [
'id' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'nombre' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
],
];

View File

@ -0,0 +1,27 @@
<?php
return [
'createdAt' => 'Creado el',
'formaPago' => 'Forma Pago',
'formaPagoList' => 'Listado de Formas Pago',
'formas-pago' => 'Formas de Pago',
'formasPago' => 'Formas Pago',
'formasPagoList' => 'Listado de Formas Pago',
'formaspago' => 'Formas de Pago',
'id' => 'ID',
'moduleTitle' => 'Formas de Pago',
'nombre' => 'Nombre',
'updatedAt' => 'Actualizado el',
'validation' => [
'id' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'nombre' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'The {field} field is required.',
],
],
];

View File

@ -3,17 +3,19 @@
return [
'code' => 'Código',
'code3' => 'Código33',
'code' => 'Code',
'code3' => 'Code3',
'id' => 'ID',
'keyErp' => 'Key Erp',
'moduleTitle' => 'Países',
'moduleTitle' => 'Paises',
'moneda' => 'Moneda',
'nombre' => 'Nombre',
'pais' => 'País',
'paisList' => 'Lista Países',
'paises' => 'Países',
'showErp' => 'Mostrar Erp',
'pais' => 'Pais',
'paisList' => 'Pais List',
'paise' => 'Paise',
'paiseList' => 'Paise List',
'paises' => 'Paises',
'showErp' => 'Show Erp',
'urlErp' => 'URL Erp',
'userErp' => 'User Erp',
'validation' => [
@ -22,6 +24,11 @@ return [
],
'id' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'key_erp' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
@ -50,7 +57,7 @@ return [
],
'code' => [
'is_unique' => 'El campo {field} debe contener un valor único',
'is_unique' => 'The {field} field must contain a unique value',
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',

View File

@ -5,7 +5,7 @@
return [
'code' => 'Código',
'codeOt' => 'Código Ot',
'createdAt' => 'Created At',
'createdAt' => 'Creado el',
'deletedAt' => 'Deleted At',
'id' => 'ID',
'isDeleted' => 'Is Deleted',
@ -16,7 +16,7 @@ return [
'papelGenericoList' => 'Lista Papeles Genéricos',
'papelesGenericos' => 'Papeles Genéricos',
'showInClient' => 'Mostrar en cliente',
'updatedAt' => 'Updated At',
'updatedAt' => 'Actualizado el',
'form_acordion_title' => 'Propiedades Papel Genérico',
'validation' => [

View File

@ -85,7 +85,7 @@ return [
],
'papel_generico_id' => [
'integer' => 'The {field} field must contain an integer.',
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],

View File

@ -0,0 +1,44 @@
<?php
return [
'code' => 'Code',
'createdAt' => 'Creado el',
'id' => 'ID',
'moduleTitle' => 'Provincias',
'nombre' => 'Nombre',
'paisId' => 'Pais ID',
'provincia' => 'Provincia',
'provinciaList' => 'Provincia List',
'provincias' => 'Provincias',
'updatedAt' => 'Actualizado el',
'validation' => [
'id' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
],
'pais_id' => [
'integer' => 'El campo {field} debe contener un número entero.',
],
'nombre' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'code' => [
'is_unique' => 'The {field} field must contain a unique value',
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
],
];

View File

@ -13,31 +13,31 @@ return [
'tiradaMin' => 'Tirada Min',
'validation' => [
'precio_max' => [
'decimal' => 'The {field} field must contain a decimal number.',
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'The {field} field is required.',
],
'precio_min' => [
'decimal' => 'The {field} field must contain a decimal number.',
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'The {field} field is required.',
],
'precio_unidad' => [
'decimal' => 'The {field} field must contain a decimal number.',
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'The {field} field is required.',
],
'tirada_max' => [
'decimal' => 'The {field} field must contain a decimal number.',
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'The {field} field is required.',
],
'tirada_min' => [
'decimal' => 'The {field} field must contain a decimal number.',
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'The {field} field is required.',
],

View File

@ -10,13 +10,11 @@ return [
'id' => 'ID',
'moduleTitle' => 'Tarifas Acabado',
'nombre' => 'Nombre',
'precioMax' => 'Precio Max',
'precioMin' => 'Precio Min',
'precioMin' => 'Precio Mínimo',
'importeFijo' => 'Importe Fijo',
'tarifaacabado' => 'Tarifas Acabado',
'tarifaacabadoList' => 'Lista Tarifas Acabado',
'tarifasacabado' => 'Tarifas Acabado',
'tiradaMax' => 'Tirada Max',
'tiradaMin' => 'Tirada Min',
'updatedAt' => 'Actualizado en',
'userCreatedId' => 'ID Usuario "Creado en"',
'userUpdateId' => 'ID Usuario "Actualizado en"',
@ -26,25 +24,12 @@ return [
'required' => 'El campo {field} es obligatorio.',
],
],
'validation' => [
'nombre' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
],
'validation' => [
'precio_max' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
@ -54,31 +39,15 @@ return [
'precio_min' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
],
'validation' => [
'tirada_max' => [
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],
],
'validation' => [
'tirada_min' => [
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],
],
'validation' => [
'importe_fijo' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
],
'validation' => [
'user_created_id' => [

View File

@ -13,14 +13,14 @@ return [
'tipologiaslibros' => 'Tipologias Libros',
'validation' => [
'nombre' => [
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'The {field} field is required.',
],
'code' => [
'is_unique' => 'The {field} field must contain a unique value',
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'The {field} field is required.',
],

View File

@ -71,7 +71,7 @@ return [
],
'email_confirmed' => [
'integer' => 'The {field} field must contain an integer.',
'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.',
],

View File

@ -0,0 +1,373 @@
<?php
namespace App\Models\Clientes;
class ClienteModel extends \App\Models\GoBaseModel
{
protected $table = "clientes";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
0 => "t1.nombre",
1 => "t1.alias",
2 => "t1.cif",
3 => "t1.email",
4 => "t1.comercial_id",
5 => "t1.forma_pago_id",
6 => "t1.vencimiento",
];
protected $allowedFields = [
"nombre",
"alias",
"cif",
"direccion",
"ciudad",
"comunidad_autonoma_id",
"provincia_id",
"cp",
"pais_id",
"telefono",
"email",
"comercial_id",
"soporte_id",
"forma_pago_id",
"vencimiento",
"fecha_vencimiento",
"margen",
"margen_pod",
"descuento",
"limite_credito",
"limite_credito_user_id",
"limite_credito_change_at",
"credito_solunion",
"credito_asegurado",
"ccc",
"ccc_cliente",
"num_cuenta",
"disponible_fe",
"message_tracking",
"message_production_start",
"tirada_flexible",
"descuento_tirada_flexible",
"comentarios_tirada_flexible",
"saturacion",
"tienda_id",
"margen_plantilla_id",
"comentarios_produccion",
"ps_customer_id",
"lineasEnvioFactura",
"comentarios",
"is_deleted",
"deleted_at",
"user_created_id",
"user_update_id",
];
protected $returnType = "App\Entities\Clientes\ClienteEntity";
protected $deletedField = 'deleted_at';
public static $labelField = "nombre";
protected $validationRules = [
"alias" => [
"label" => "Clientes.alias",
"rules" => "trim|required|max_length[255]",
],
"ccc" => [
"label" => "Clientes.ccc",
"rules" => "trim|max_length[100]",
],
"ccc_cliente" => [
"label" => "Clientes.cccCliente",
"rules" => "trim|max_length[100]",
],
"cif" => [
"label" => "Clientes.cif",
"rules" => "trim|required|max_length[50]",
],
"ciudad" => [
"label" => "Clientes.ciudad",
"rules" => "trim|max_length[100]",
],
"comentarios" => [
"label" => "Clientes.comentarios",
"rules" => "trim|max_length[16313]",
],
"comentarios_produccion" => [
"label" => "Clientes.comentariosProduccion",
"rules" => "trim|max_length[16313]",
],
"comentarios_tirada_flexible" => [
"label" => "Clientes.comentariosTiradaFlexible",
"rules" => "trim|required|max_length[16313]",
],
"cp" => [
"label" => "Clientes.cp",
"rules" => "trim|max_length[10]",
],
"credito_solunion" => [
"label" => "Clientes.creditoSolunion",
"rules" => "trim|max_length[100]",
],
"descuento" => [
"label" => "Clientes.descuento",
"rules" => "required|decimal",
],
"descuento_tirada_flexible" => [
"label" => "Clientes.descuentoTiradaFlexible",
"rules" => "required|decimal",
],
"direccion" => [
"label" => "Clientes.direccion",
"rules" => "trim|max_length[300]",
],
"email" => [
"label" => "Clientes.email",
"rules" => "trim|max_length[150]|valid_email|permit_empty",
],
"fecha_vencimiento" => [
"label" => "Clientes.fechaVencimiento",
"rules" => "trim|max_length[100]",
],
"is_deleted" => [
"label" => "Clientes.isDeleted",
"rules" => "required|integer",
],
"limite_credito" => [
"label" => "Clientes.limiteCredito",
"rules" => "required|decimal",
],
"limite_credito_change_at" => [
"label" => "Clientes.limiteCreditoChangeAt",
"rules" => "required|valid_date",
],
"limite_credito_user_id" => [
"label" => "Clientes.limiteCreditoUserId",
"rules" => "required|integer",
],
"margen" => [
"label" => "Clientes.margen",
"rules" => "required|decimal",
],
"margen_plantilla_id" => [
"label" => "Clientes.margenPlantillaId",
"rules" => "integer|permit_empty",
],
"margen_pod" => [
"label" => "Clientes.margenPod",
"rules" => "decimal|permit_empty",
],
"nombre" => [
"label" => "Clientes.nombre",
"rules" => "trim|required|max_length[255]",
],
"num_cuenta" => [
"label" => "Clientes.numCuenta",
"rules" => "trim|max_length[10]",
],
"ps_customer_id" => [
"label" => "Clientes.psCustomerId",
"rules" => "integer|permit_empty",
],
"saturacion" => [
"label" => "Clientes.saturacion",
"rules" => "required|decimal",
],
"telefono" => [
"label" => "Clientes.telefono",
"rules" => "trim|max_length[60]",
],
"tienda_id" => [
"label" => "Clientes.tiendaId",
"rules" => "integer|permit_empty",
],
"user_created_id" => [
"label" => "Clientes.userCreatedId",
"rules" => "required|integer",
],
"user_update_id" => [
"label" => "Clientes.userUpdateId",
"rules" => "required|integer",
],
"vencimiento" => [
"label" => "Clientes.vencimiento",
"rules" => "required|integer",
],
];
protected $validationMessages = [
"alias" => [
"max_length" => "Clientes.validation.alias.max_length",
"required" => "Clientes.validation.alias.required",
],
"ccc" => [
"max_length" => "Clientes.validation.ccc.max_length",
],
"ccc_cliente" => [
"max_length" => "Clientes.validation.ccc_cliente.max_length",
],
"cif" => [
"max_length" => "Clientes.validation.cif.max_length",
"required" => "Clientes.validation.cif.required",
],
"ciudad" => [
"max_length" => "Clientes.validation.ciudad.max_length",
],
"comentarios" => [
"max_length" => "Clientes.validation.comentarios.max_length",
],
"comentarios_produccion" => [
"max_length" => "Clientes.validation.comentarios_produccion.max_length",
],
"comentarios_tirada_flexible" => [
"max_length" => "Clientes.validation.comentarios_tirada_flexible.max_length",
"required" => "Clientes.validation.comentarios_tirada_flexible.required",
],
"cp" => [
"max_length" => "Clientes.validation.cp.max_length",
],
"credito_solunion" => [
"max_length" => "Clientes.validation.credito_solunion.max_length",
],
"descuento" => [
"decimal" => "Clientes.validation.descuento.decimal",
"required" => "Clientes.validation.descuento.required",
],
"descuento_tirada_flexible" => [
"decimal" => "Clientes.validation.descuento_tirada_flexible.decimal",
"required" => "Clientes.validation.descuento_tirada_flexible.required",
],
"direccion" => [
"max_length" => "Clientes.validation.direccion.max_length",
],
"email" => [
"max_length" => "Clientes.validation.email.max_length",
"valid_email" => "Clientes.validation.email.valid_email",
],
"fecha_vencimiento" => [
"max_length" => "Clientes.validation.fecha_vencimiento.max_length",
],
"is_deleted" => [
"integer" => "Clientes.validation.is_deleted.integer",
"required" => "Clientes.validation.is_deleted.required",
],
"limite_credito" => [
"decimal" => "Clientes.validation.limite_credito.decimal",
"required" => "Clientes.validation.limite_credito.required",
],
"limite_credito_change_at" => [
"required" => "Clientes.validation.limite_credito_change_at.required",
"valid_date" => "Clientes.validation.limite_credito_change_at.valid_date",
],
"limite_credito_user_id" => [
"integer" => "Clientes.validation.limite_credito_user_id.integer",
"required" => "Clientes.validation.limite_credito_user_id.required",
],
"margen" => [
"decimal" => "Clientes.validation.margen.decimal",
"required" => "Clientes.validation.margen.required",
],
"margen_plantilla_id" => [
"integer" => "Clientes.validation.margen_plantilla_id.integer",
],
"margen_pod" => [
"decimal" => "Clientes.validation.margen_pod.decimal",
],
"nombre" => [
"max_length" => "Clientes.validation.nombre.max_length",
"required" => "Clientes.validation.nombre.required",
],
"num_cuenta" => [
"max_length" => "Clientes.validation.num_cuenta.max_length",
],
"ps_customer_id" => [
"integer" => "Clientes.validation.ps_customer_id.integer",
],
"saturacion" => [
"decimal" => "Clientes.validation.saturacion.decimal",
"required" => "Clientes.validation.saturacion.required",
],
"telefono" => [
"max_length" => "Clientes.validation.telefono.max_length",
],
"tienda_id" => [
"integer" => "Clientes.validation.tienda_id.integer",
],
"user_created_id" => [
"integer" => "Clientes.validation.user_created_id.integer",
"required" => "Clientes.validation.user_created_id.required",
],
"user_update_id" => [
"integer" => "Clientes.validation.user_update_id.integer",
"required" => "Clientes.validation.user_update_id.required",
],
"vencimiento" => [
"integer" => "Clientes.validation.vencimiento.integer",
"required" => "Clientes.validation.vencimiento.required",
],
];
public function findAllWithAllRelations(string $selcols = "*", int $limit = null, int $offset = 0)
{
$sql =
"SELECT t1." .
$selcols .
", t2.nombre AS comunidad_autonoma_id, t3.nombre AS provincia, t4.nombre AS pais_id, t5.first_name AS comercial, t6.last_name AS soporte, t7.nombre AS forma_pago_id FROM " .
$this->table .
" t1 LEFT JOIN lg_comunidades_autonomas t2 ON t1.comunidad_autonoma_id = t2.id LEFT JOIN lg_provincias t3 ON t1.provincia_id = t3.id LEFT JOIN lg_paises t4 ON t1.pais_id = t4.id LEFT JOIN auth_user t5 ON t1.comercial_id = t5.id_user LEFT JOIN auth_user t6 ON t1.soporte_id = t6.id_user LEFT JOIN lg_formas_pago t7 ON t1.forma_pago_id = t7.id";
if (!is_null($limit) && intval($limit) > 0) {
$sql .= " LIMIT " . intval($limit);
}
if (!is_null($offset) && intval($offset) > 0) {
$sql .= " OFFSET " . intval($offset);
}
$query = $this->db->query($sql);
$result = $query->getResultObject();
return $result;
}
/**
* Get resource data.
*
* @param string $search
*
* @return \CodeIgniter\Database\BaseBuilder
*/
public function getResource(string $search = "")
{
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS id, t1.nombre AS nombre, t1.alias AS alias, t1.cif AS cif, t1.email AS email, t1.vencimiento AS vencimiento, t5.first_name AS comercial, t7.nombre AS forma_pago_id"
)
->where("is_deleted", 0);;
$builder->join("auth_user t5", "t1.comercial_id = t5.id_user", "left");
$builder->join("lg_formas_pago t7", "t1.forma_pago_id = t7.id", "left");
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.nombre", $search)
->orLike("t1.alias", $search)
->orLike("t1.cif", $search)
->orLike("t1.email", $search)
->orLike("t1.soporte_id", $search)
->orLike("t1.forma_pago_id", $search)
->orLike("t1.vencimiento", $search)
->orLike("t5.id_user", $search)
->orLike("t5.first_name", $search)
->orLike("t5.last_name", $search)
->orLike("t7.id", $search)
->orLike("t7.nombre", $search)
->groupEnd();
}
}

View File

@ -0,0 +1,97 @@
<?php
namespace App\Models\Configuracion;
class ComunidadAutonomaModel extends \App\Models\GoBaseModel
{
protected $table = "lg_comunidades_autonomas";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
1 => "t1.id",
2 => "t1.nombre",
3 => "t1.pais_id",
4 => "t1.created_at",
5 => "t1.updated_at",
6 => "t2.id",
];
protected $allowedFields = ["nombre", "pais_id"];
protected $returnType = "App\Entities\Configuracion\ComunidadAutonomaEntity";
public static $labelField = "nombre";
protected $validationRules = [
"nombre" => [
"label" => "ComunidadesAutonomas.nombre",
"rules" => "trim|required|max_length[100]",
],
];
protected $validationMessages = [
"nombre" => [
"max_length" => "ComunidadesAutonomas.validation.nombre.max_length",
"required" => "ComunidadesAutonomas.validation.nombre.required",
],
];
public function findAllWithPaises(string $selcols = "*", int $limit = null, int $offset = 0)
{
$sql =
"SELECT t1." .
$selcols .
", t2.id AS pais FROM " .
$this->table .
" t1 LEFT JOIN lg_paises t2 ON t1.pais_id = t2.id";
if (!is_null($limit) && intval($limit) > 0) {
$sql .= " LIMIT " . $limit;
}
if (!is_null($offset) && intval($offset) > 0) {
$sql .= " OFFSET " . $offset;
}
$query = $this->db->query($sql);
$result = $query->getResultObject();
return $result;
}
/**
* Get resource data.
*
* @param string $search
*
* @return \CodeIgniter\Database\BaseBuilder
*/
public function getResource(string $search = "")
{
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS id, t1.nombre AS nombre, t1.created_at AS created_at, t1.updated_at AS updated_at, t2.id AS pais"
);
$builder->join("lg_paises t2", "t1.pais_id = t2.id", "left");
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t2.id", $search)
->orLike("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.pais_id", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t2.id", $search)
->groupEnd();
}
}

View File

@ -0,0 +1,97 @@
<?php
namespace App\Models\Configuracion;
class ComunidadesAutonomasModel extends \App\Models\GoBaseModel
{
protected $table = "lg_comunidades_autonomas";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
1 => "t1.id",
2 => "t1.nombre",
3 => "t1.pais_id",
4 => "t1.created_at",
5 => "t1.updated_at",
6 => "t2.nombre",
];
protected $allowedFields = ["nombre", "pais_id"];
protected $returnType = "App\Entities\Configuracion\ComunidadesAutonomasEntity";
public static $labelField = "nombre";
protected $validationRules = [
"nombre" => [
"label" => "ComunidadesAutonomas.nombre",
"rules" => "trim|required|max_length[100]",
],
];
protected $validationMessages = [
"nombre" => [
"max_length" => "ComunidadesAutonomas.validation.nombre.max_length",
"required" => "ComunidadesAutonomas.validation.nombre.required",
],
];
public function findAllWithPaises(string $selcols = "*", int $limit = null, int $offset = 0)
{
$sql =
"SELECT t1." .
$selcols .
", t2.nombre AS pais FROM " .
$this->table .
" t1 LEFT JOIN lg_paises t2 ON t1.pais_id = t2.id";
if (!is_null($limit) && intval($limit) > 0) {
$sql .= " LIMIT " . $limit;
}
if (!is_null($offset) && intval($offset) > 0) {
$sql .= " OFFSET " . $offset;
}
$query = $this->db->query($sql);
$result = $query->getResultObject();
return $result;
}
/**
* Get resource data.
*
* @param string $search
*
* @return \CodeIgniter\Database\BaseBuilder
*/
public function getResource(string $search = "")
{
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS id, t1.nombre AS nombre, t1.created_at AS created_at, t1.updated_at AS updated_at, t2.nombre AS pais"
);
$builder->join("lg_paises t2", "t1.pais_id = t2.id", "left");
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t2.id", $search)
->orLike("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.pais_id", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t2.nombre", $search)
->groupEnd();
}
}

View File

@ -0,0 +1,68 @@
<?php
namespace App\Models\Configuracion;
class FormaPagoModel extends \App\Models\GoBaseModel
{
protected $table = "lg_formas_pago";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
1 => "t1.id",
2 => "t1.nombre",
3 => "t1.created_at",
4 => "t1.updated_at",
];
protected $allowedFields = ["nombre"];
protected $returnType = "App\Entities\Configuracion\FormaPagoEntity";
public static $labelField = "nombre";
protected $validationRules = [
"nombre" => [
"label" => "FormasPagoes.nombre",
"rules" => "trim|required|max_length[255]",
],
];
protected $validationMessages = [
"nombre" => [
"max_length" => "FormasPagoes.validation.nombre.max_length",
"required" => "FormasPagoes.validation.nombre.required",
],
];
/**
* Get resource data.
*
* @param string $search
*
* @return \CodeIgniter\Database\BaseBuilder
*/
public function getResource(string $search = "")
{
$builder = $this->db
->table($this->table . " t1")
->select("t1.id AS id, t1.nombre AS nombre, t1.created_at AS created_at, t1.updated_at AS updated_at");
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->groupEnd();
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace App\Models\Configuracion;
class FormasPagoModel extends \App\Models\GoBaseModel
{
protected $table = "lg_formas_pago";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
protected $allowedFields = ["nombre"];
protected $returnType = "App\Entities\Configuracion\FormasPagoEntity";
public static $labelField = "nombre";
protected $validationRules = [
"nombre" => [
"label" => "FormasPagoes.nombre",
"rules" => "trim|required|max_length[255]",
],
];
protected $validationMessages = [
"nombre" => [
"max_length" => "FormasPagoes.validation.nombre.max_length",
"required" => "FormasPagoes.validation.nombre.required",
],
];
}

View File

@ -12,8 +12,20 @@ class PaisModel extends \App\Models\GoBaseModel
*/
protected $useAutoIncrement = true;
const SORTABLE = [
1 => "t1.id",
2 => "t1.nombre",
3 => "t1.code",
4 => "t1.code3",
5 => "t1.moneda",
6 => "t1.url_erp",
7 => "t1.user_erp",
8 => "t1.key_erp",
9 => "t1.show_erp",
];
protected $allowedFields = ["nombre", "code", "code3", "moneda", "url_erp", "user_erp", "key_erp", "show_erp"];
protected $returnType = "App\Entities\Configuracion\Pais";
protected $returnType = "App\Entities\Configuracion\PaisEntity";
public static $labelField = "nombre";
@ -75,4 +87,42 @@ class PaisModel extends \App\Models\GoBaseModel
"max_length" => "Paises.validation.user_erp.max_length",
],
];
/**
* Get resource data.
*
* @param string $search
*
* @return \CodeIgniter\Database\BaseBuilder
*/
public function getResource(string $search = "")
{
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code3 AS code3, t1.moneda AS moneda, t1.url_erp AS url_erp, t1.user_erp AS user_erp, t1.key_erp AS key_erp, t1.show_erp AS show_erp"
);
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.code", $search)
->orLike("t1.code3", $search)
->orLike("t1.moneda", $search)
->orLike("t1.url_erp", $search)
->orLike("t1.user_erp", $search)
->orLike("t1.key_erp", $search)
->orLike("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.code", $search)
->orLike("t1.code3", $search)
->orLike("t1.moneda", $search)
->orLike("t1.url_erp", $search)
->orLike("t1.user_erp", $search)
->orLike("t1.key_erp", $search)
->groupEnd();
}
}

View File

@ -0,0 +1,109 @@
<?php
namespace App\Models\Configuracion;
class ProvinciaModel extends \App\Models\GoBaseModel
{
protected $table = "lg_provincias";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
1 => "t1.id",
2 => "t1.code",
3 => "t1.nombre",
4 => "t1.pais_id",
5 => "t1.created_at",
6 => "t1.updated_at",
7 => "t2.nombre",
];
protected $allowedFields = ["code", "nombre", "pais_id"];
protected $returnType = "App\Entities\Configuracion\ProvinciaEntity";
public static $labelField = "nombre";
protected $validationRules = [
"code" => [
"label" => "Provincias.code",
"rules" => "trim|required|max_length[2]|is_unique[lg_provincias.code,id,{id}]",
],
"nombre" => [
"label" => "Provincias.nombre",
"rules" => "trim|required|max_length[255]",
],
];
protected $validationMessages = [
"code" => [
"is_unique" => "Provincias.validation.code.is_unique",
"max_length" => "Provincias.validation.code.max_length",
"required" => "Provincias.validation.code.required",
],
"nombre" => [
"max_length" => "Provincias.validation.nombre.max_length",
"required" => "Provincias.validation.nombre.required",
],
];
public function findAllWithPaises(string $selcols = "*", int $limit = null, int $offset = 0)
{
$sql =
"SELECT t1." .
$selcols .
", t2.nombre AS pais FROM " .
$this->table .
" t1 LEFT JOIN lg_paises t2 ON t1.pais_id = t2.id";
if (!is_null($limit) && intval($limit) > 0) {
$sql .= " LIMIT " . $limit;
}
if (!is_null($offset) && intval($offset) > 0) {
$sql .= " OFFSET " . $offset;
}
$query = $this->db->query($sql);
$result = $query->getResultObject();
return $result;
}
/**
* Get resource data.
*
* @param string $search
*
* @return \CodeIgniter\Database\BaseBuilder
*/
public function getResource(string $search = "")
{
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS id, t1.code AS code, t1.nombre AS nombre, t1.created_at AS created_at, t1.updated_at AS updated_at, t2.nombre AS pais"
);
$builder->join("lg_paises t2", "t1.pais_id = t2.id", "left");
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.id", $search)
->orLike("t1.code", $search)
->orLike("t1.nombre", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t2.id", $search)
->orLike("t1.id", $search)
->orLike("t1.code", $search)
->orLike("t1.nombre", $search)
->orLike("t1.pais_id", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t2.nombre", $search)
->groupEnd();
}
}

View File

@ -18,6 +18,8 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
protected $allowedFields = [
"nombre",
"precio_min",
"importe_fijo",
"deleted_at",
"is_deleted",
"user_created_id",
@ -36,16 +38,33 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
protected $validationRules = [
"nombre" => [
"label" => "Acabadoes.nombre",
"label" => "TarifaAcabado.nombre",
"rules" => "trim|required|max_length[255]",
],
"precio_min" => [
"label" => "TarifaAcabado.precioMin",
"rules" => "required|decimal",
],
"importe_fijo" => [
"label" => "TarifaAcabado.importeFijo",
"rules" => "required|decimal",
],
];
protected $validationMessages = [
"nombre" => [
"max_length" => "Acabadoes.validation.nombre.max_length",
"required" => "Acabadoes.validation.nombre.required",
"max_length" => "TarifaAcabado.validation.nombre.max_length",
"required" => "TarifaAcabado.validation.nombre.required",
],
"precio_min" => [
"required" => "TarifaAcabado.validation.precio_min.required",
"decimal" => "TarifaAcabado.validation.precio_min.decimal",
],
"importe_fijo" => [
"required" => "TarifaAcabado.validation.importe_fijo.required",
"decimal" => "TarifaAcabado.validation.importe_fijo.decimal",
],
];
/**
@ -57,7 +76,9 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
*/
public function getResource(string $search = "")
{
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre");
$builder = $this->db->table($this->table . " t1")->select(
"t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo"
);
//JJO
$builder->where("t1.is_deleted", 0);
@ -68,6 +89,8 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
->groupStart()
->like("t1.nombre", $search)
->orLike("t1.nombre", $search)
->orLike("t1.precio_min", $search)
->orLike("t1.importe_fijo", $search)
->groupEnd();
}
}

View File

@ -4,15 +4,15 @@
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirm2deleteLabel">Confirm to delete record</h5>
<h5 class="modal-title" id="confirm2deleteLabel"><?= lang('Basic.global.deleteConfirmation') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Are you sure you want to delete this record?
<?= lang('Basic.global.deleteConfirmationQuestion') ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
<a class="btn btn-danger btn-confirm"> Yes, Delete It! </a>
<button type="button" class="btn btn-default" data-bs-dismiss="modal"><?= lang('Basic.global.deleteConfirmationCancel') ?></button>
<a class="btn btn-danger btn-confirm"><?= lang('Basic.global.deleteConfirmationButton') ?></a>
</div><!--//.modal-footer -->
</div><!--//.modal-content -->
</div><!--//.modal-dialog -->
@ -24,17 +24,17 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="confirm2deleteLabel">Confirm to delete record</h4>
<h4 class="modal-title" id="confirm2deleteLabel"><?= lang('Basic.global.deleteConfirmation') ?></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to delete this record?
<?= lang('Basic.global.deleteConfirmationQuestion') ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<a class="btn btn-danger btn-confirm"> Yes, Delete It! </a>
<button type="button" class="btn btn-default" data-dismiss="modal"><?= lang('Basic.global.deleteConfirmationCancel') ?></button>
<a class="btn btn-danger btn-confirm">><?= lang('Basic.global.deleteConfirmationButton') ?></a>
</div><!--//.modal-footer -->
</div><!--//.modal-content -->
</div><!--//.modal-dialog -->

View File

@ -2,8 +2,9 @@
<?= $this->section('css') ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@4/dark.css">
<!-- <link rel="stylesheet" href="--><?php //= site_url('themes/vuexy/vendor/libs/toastr/toastr.css') ?><!--"/>-->
<style>
1 <style>
/* Toastr */
.colored-toast.swal2-icon-success {
background-color: #478921 !important;
@ -44,6 +45,7 @@
<!-- Push section js -->
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
<!--<script src="--><?php //= site_url('themes/vuexy/vendor/libs/toastr/toastr.js') ?><!--"></script>-->
<?= $this->endSection() ?>

View File

@ -0,0 +1,423 @@
<div class="row">
<div class="col-md-12 col-lg-6 px-4">
<div class="mb-3">
<label for="nombre" class="form-label">
<?= lang('Clientes.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control"
value="<?= old('nombre', $clienteEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="alias" class="form-label">
<?= lang('Clientes.alias') ?>*
</label>
<input type="text" id="alias" name="alias" required maxLength="255" class="form-control"
value="<?= old('alias', $clienteEntity->alias) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="cif" class="form-label">
<?= lang('Clientes.cif') ?>*
</label>
<input type="text" id="cif" name="cif" required maxLength="50" class="form-control"
value="<?= old('cif', $clienteEntity->cif) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="direccion" class="form-label">
<?= lang('Clientes.direccion') ?>
</label>
<textarea rows="3" id="direccion" name="direccion" style="height: 10em;"
class="form-control"><?= old('direccion', $clienteEntity->direccion) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="ciudad" class="form-label">
<?= lang('Clientes.ciudad') ?>
</label>
<input type="text" id="ciudad" name="ciudad" maxLength="100" class="form-control"
value="<?= old('ciudad', $clienteEntity->ciudad) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comunidadAutonomaId" class="form-label">
<?= lang('Clientes.comunidadAutonomaId') ?>
</label>
<select id="comunidadAutonomaId" name="comunidad_autonoma_id" class="select2 form-control"
style="width: 100%;">
<?php if (isset($comunidadAutonomaList) && is_array($comunidadAutonomaList) && !empty($comunidadAutonomaList)) :
foreach ($comunidadAutonomaList as $k => $v) : ?>
<option value="<?= $k ?>"<?= $k == $clienteEntity->comunidad_autonoma_id ? ' selected' : '' ?>>
<?= $v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="provinciaId" class="form-label">
<?= lang('Clientes.provinciaId') ?>*
</label>
<select id="provinciaId" name="provincia_id" required class="form-control select2" style="width: 100%;">
<?php if (isset($provinciaList) && is_array($provinciaList) && !empty($provinciaList)) :
foreach ($provinciaList as $k => $v) : ?>
<option value="<?= $k ?>"<?= $k == $clienteEntity->provincia_id ? ' selected' : '' ?>>
<?= $v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="cp" class="form-label">
<?= lang('Clientes.cp') ?>
</label>
<input type="text" id="cp" name="cp" maxLength="10" class="form-control"
value="<?= old('cp', $clienteEntity->cp) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="paisId" class="form-label">
<?= lang('Clientes.paisId') ?>
</label>
<select id="paisId" name="pais_id" class="form-control select2" style="width: 100%;">
<?php if (isset($paisList) && is_array($paisList) && !empty($paisList)) :
foreach ($paisList as $k => $v) : ?>
<option value="<?= $k ?>"<?= $k == $clienteEntity->pais_id ? ' selected' : '' ?>>
<?= $v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="telefono" class="form-label">
<?= lang('Clientes.telefono') ?>
</label>
<input type="text" id="telefono" name="telefono" maxLength="60" class="form-control"
value="<?= old('telefono', $clienteEntity->telefono) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="email" class="form-label">
<?= lang('Clientes.email') ?>
</label>
<input type="email" id="email" name="email" maxLength="150" class="form-control"
value="<?= old('email', $clienteEntity->email) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comercialId" class="form-label">
<?= lang('Clientes.comercialId') ?>*
</label>
<select id="comercialId" name="comercial_id" required class="form-control select2" style="width: 100%;">
<?php if (isset($userList) && is_array($userList) && !empty($userList)) :
foreach ($userList as $k => $v) : ?>
<option value="<?= $k ?>"<?= $k == $clienteEntity->comercial_id ? ' selected' : '' ?>>
<?= $v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="soporteId" class="form-label">
<?= lang('Clientes.soporteId') ?>*
</label>
<select id="soporteId" name="soporte_id" required class="form-control select2" style="width: 100%;">
<?php if (isset($userList2) && is_array($userList2) && !empty($userList2)) :
foreach ($userList2 as $k => $v) : ?>
<option value="<?= $k ?>"<?= $k == $clienteEntity->soporte_id ? ' selected' : '' ?>>
<?= $v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="formaPagoId" class="form-label">
<?= lang('Clientes.formaPagoId') ?>
</label>
<select id="formaPagoId" name="forma_pago_id" class="form-control select2" style="width: 100%;">
<?php if (isset($formaDePagoList) && is_array($formaDePagoList) && !empty($formaDePagoList)) :
foreach ($formaDePagoList as $k => $v) : ?>
<option value="<?= $k ?>"<?= $k == $clienteEntity->forma_pago_id ? ' selected' : '' ?>>
<?= $v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="vencimiento" class="form-label">
<?= lang('Clientes.vencimiento') ?>*
</label>
<input type="number" id="vencimiento" name="vencimiento" required placeholder="15" maxLength="10"
class="form-control" value="<?= old('vencimiento', $clienteEntity->vencimiento) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="fechaVencimiento" class="form-label">
<?= lang('Clientes.fechaVencimiento') ?>
</label>
<input type="text" id="fechaVencimiento" name="fecha_vencimiento" maxLength="100" class="form-control"
value="<?= old('fecha_vencimiento', $clienteEntity->fecha_vencimiento) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="margen" class="form-label">
<?= lang('Clientes.margen') ?>*
</label>
<input type="number" id="margen" name="margen" required placeholder="40.00" maxLength="8" step="0.01"
class="form-control" value="<?= old('margen', $clienteEntity->margen) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="margenPod" class="form-label">
<?= lang('Clientes.margenPod') ?>
</label>
<input type="number" id="margenPod" name="margen_pod" maxLength="8" step="0.01" class="form-control"
value="<?= old('margen_pod', $clienteEntity->margen_pod) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="descuento" class="form-label">
<?= lang('Clientes.descuento') ?>*
</label>
<input type="number" id="descuento" name="descuento" required placeholder="0.00" maxLength="8" step="0.01"
class="form-control" value="<?= old('descuento', $clienteEntity->descuento) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="limiteCredito" class="form-label">
<?= lang('Clientes.limiteCredito') ?>*
</label>
<input type="number" id="limiteCredito" name="limite_credito" required placeholder="0.00" maxLength="8"
step="0.01" class="form-control"
value="<?= old('limite_credito', $clienteEntity->limite_credito) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="limiteCreditoUserId" class="form-label">
<?= lang('Clientes.limiteCreditoUserId') ?>*
</label>
<input type="number" id="limiteCreditoUserId" name="limite_credito_user_id" required placeholder="1"
maxLength="10" class="form-control"
value="<?= old('limite_credito_user_id', $clienteEntity->limite_credito_user_id) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="limiteCreditoChangeAt" class="form-label">
<?= lang('Clientes.limiteCreditoChangeAt') ?>*
</label>
<input type="text" id="limiteCreditoChangeAt" name="limite_credito_change_at" required
placeholder="2017-02-13 12:38:03" maxLength="20" class="form-control"
value="<?= old('limite_credito_change_at', $clienteEntity->limite_credito_change_at) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="creditoSolunion" class="form-label">
<?= lang('Clientes.creditoSolunion') ?>
</label>
<input type="text" id="creditoSolunion" name="credito_solunion" maxLength="100" class="form-control"
value="<?= old('credito_solunion', $clienteEntity->credito_solunion) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
<div class="col-md-12 col-lg-6 px-4">
<div class="mb-3">
<div class="form-check">
<label for="creditoAsegurado" class="form-check-label">
<input type="checkbox" id="creditoAsegurado" name="credito_asegurado" value="1"
class="form-check-input"<?= $clienteEntity->credito_asegurado == true ? 'checked' : ''; ?>>
<?= lang('Clientes.creditoAsegurado') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="ccc" class="form-label">
<?= lang('Clientes.ccc') ?>
</label>
<input type="text" id="ccc" name="ccc" maxLength="100" class="form-control"
value="<?= old('ccc', $clienteEntity->ccc) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="cccCliente" class="form-label">
<?= lang('Clientes.cccCliente') ?>
</label>
<input type="text" id="cccCliente" name="ccc_cliente" maxLength="100" class="form-control"
value="<?= old('ccc_cliente', $clienteEntity->ccc_cliente) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="numCuenta" class="form-label">
<?= lang('Clientes.numCuenta') ?>
</label>
<input type="text" id="numCuenta" name="num_cuenta" maxLength="10" class="form-control"
value="<?= old('num_cuenta', $clienteEntity->num_cuenta) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="disponibleFe" class="form-check-label">
<input type="checkbox" id="disponibleFe" name="disponible_fe" value="1"
class="form-check-input"<?= $clienteEntity->disponible_fe == true ? 'checked' : ''; ?>>
<?= lang('Clientes.disponibleFe') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="messageTracking" class="form-check-label">
<input type="checkbox" id="messageTracking" name="message_tracking" value="1"
class="form-check-input"<?= $clienteEntity->message_tracking == true ? 'checked' : ''; ?>>
<?= lang('Clientes.messageTracking') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="messageProductionStart" class="form-check-label">
<input type="checkbox" id="messageProductionStart" name="message_production_start" value="1"
class="form-check-input"<?= $clienteEntity->message_production_start == true ? 'checked' : ''; ?>>
<?= lang('Clientes.messageProductionStart') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="tiradaFlexible" class="form-check-label">
<input type="checkbox" id="tiradaFlexible" name="tirada_flexible" value="1"
class="form-check-input"<?= $clienteEntity->tirada_flexible == true ? 'checked' : ''; ?>>
<?= lang('Clientes.tiradaFlexible') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="descuentoTiradaFlexible" class="form-label">
<?= lang('Clientes.descuentoTiradaFlexible') ?>*
</label>
<input type="number" id="descuentoTiradaFlexible" name="descuento_tirada_flexible" required
placeholder="20.00" maxLength="8" step="0.01" class="form-control"
value="<?= old('descuento_tirada_flexible', $clienteEntity->descuento_tirada_flexible) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comentariosTiradaFlexible" class="form-label">
<?= lang('Clientes.comentariosTiradaFlexible') ?>*
</label>
<textarea rows="3" id="comentariosTiradaFlexible" name="comentarios_tirada_flexible" required
style="height: 10em;"
class="form-control"><?= old('comentarios_tirada_flexible', $clienteEntity->comentarios_tirada_flexible) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="saturacion" class="form-label">
<?= lang('Clientes.saturacion') ?>*
</label>
<input type="number" id="saturacion" name="saturacion" required placeholder="100.00" maxLength="8"
step="0.01" class="form-control" value="<?= old('saturacion', $clienteEntity->saturacion) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="tiendaId" class="form-label">
<?= lang('Clientes.tiendaId') ?>
</label>
<input type="number" id="tiendaId" name="tienda_id" maxLength="10" class="form-control"
value="<?= old('tienda_id', $clienteEntity->tienda_id) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="margenPlantillaId" class="form-label">
<?= lang('Clientes.margenPlantillaId') ?>
</label>
<input type="number" id="margenPlantillaId" name="margen_plantilla_id" maxLength="10" class="form-control"
value="<?= old('margen_plantilla_id', $clienteEntity->margen_plantilla_id) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comentariosProduccion" class="form-label">
<?= lang('Clientes.comentariosProduccion') ?>
</label>
<textarea rows="3" id="comentariosProduccion" name="comentarios_produccion" style="height: 10em;"
class="form-control"><?= old('comentarios_produccion', $clienteEntity->comentarios_produccion) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="psCustomerId" class="form-label">
<?= lang('Clientes.psCustomerId') ?>
</label>
<input type="number" id="psCustomerId" name="ps_customer_id" maxLength="10" class="form-control"
value="<?= old('ps_customer_id', $clienteEntity->ps_customer_id) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="lineasenviofactura" class="form-check-label">
<input type="checkbox" id="lineasenviofactura" name="lineasEnvioFactura" value="1"
class="form-check-input"<?= $clienteEntity->lineasEnvioFactura == true ? 'checked' : ''; ?>>
<?= lang('Clientes.lineasenviofactura') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comentarios" class="form-label">
<?= lang('Clientes.comentarios') ?>
</label>
<textarea rows="3" id="comentarios" name="comentarios" style="height: 10em;"
class="form-control"><?= old('comentarios', $clienteEntity->comentarios) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="isDeleted" class="form-label">
<?= lang('Clientes.isDeleted') ?>*
</label>
<input type="number" id="isDeleted" name="is_deleted" required placeholder="0" maxLength="4"
class="form-control" value="<?= old('is_deleted', $clienteEntity->is_deleted) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="userCreatedId" class="form-label">
<?= lang('Clientes.userCreatedId') ?>*
</label>
<input type="number" id="userCreatedId" name="user_created_id" required placeholder="1" maxLength="10"
class="form-control" value="<?= old('user_created_id', $clienteEntity->user_created_id) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="userUpdateId" class="form-label">
<?= lang('Clientes.userUpdateId') ?>*
</label>
<input type="number" id="userUpdateId" name="user_update_id" required placeholder="1" maxLength="10"
class="form-control" value="<?= old('user_update_id', $clienteEntity->user_update_id) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -0,0 +1,212 @@
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="clienteForm" method="post" class="card-body" action="<?= $formAction ?>">
<?= csrf_field() ?>
<div class="card-body">
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/clientes/cliente/_clienteFormItems") ?>
</div><!-- /.card-body -->
<div class="pt-4">
<input
type="submit"
class="btn btn-primary float-start me-sm-3 me-1"
name="save"
value="<?= lang("Basic.global.Save") ?>"
>
<?= anchor(route_to("clienteList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>
<?= $this->section("additionalInlineJs") ?>
$('#soporteId').select2({
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfUsers") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id_user',
text: 'first_name',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#formaPagoId').select2({
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfFormasDePagos") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id',
text: 'nombre',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#paisId').select2({
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfPaises") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id',
text: 'nombre',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#provinciaId').select2({
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfProvincias") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id',
text: 'nombre',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#comunidadAutonomaId').select2({
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfComunidadesAutonomas") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id',
text: 'nombre',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#comercialId').select2({
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfUsers") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id_user',
text: 'first_name',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
<?= $this->endSection() ?>

View File

@ -0,0 +1,163 @@
<?=$this->include('themes/_commonPartialsBs/select2bs5') ?>
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?=$this->section('content'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('Clientes.clienteList') ?></h3>
<?=anchor(route_to('newCliente'), lang('Basic.global.addNew').' '.lang('Clientes.cliente'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-header -->
<div class="card-body">
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfClientes" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('Clientes.nombre') ?></th>
<th><?= lang('Clientes.alias') ?></th>
<th><?= lang('Clientes.cif') ?></th>
<th><?= lang('Clientes.email') ?></th>
<th><?= lang('Users.comercial') ?></th>
<th><?= lang('FormasPagoes.formaDePago') ?></th>
<th><?= lang('Clientes.vencimiento') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$this->endSection() ?>
<?=$this->section('additionalInlineJs') ?>
const lastColNr = $('#tableOfClientes').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `
<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
</div>
</td>`;
};
theTable = $('#tableOfClientes').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
pageLength: 10,
lengthChange: true,
"dom": 'lfBrtip',
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
stateSave: true,
order: [[0, 'asc']],
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfClientes') ?>',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr]
}
],
columns : [
{ 'data': 'nombre' },
{ 'data': 'alias' },
{ 'data': 'cif' },
{ 'data': 'email' },
{ 'data': 'comercial' },
{ 'data': 'forma_pago_id' },
{ 'data': 'vencimiento' },
{ 'data': actionBtns }
]
});
$(document).on('click', '.btn-edit', function(e) {
//window.location.href = `<?= site_url('/cliente/edit') ?>/${$(this).attr('data-id')}/edit`;
window.location.href = `/clientes/cliente/edit/${$(this).attr('data-id')}`;
});
$(document).on('click', '.btn-delete', function(e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Clientes.cliente'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
})
.then((result) => {
const dataId = $(this).data('id');
const row = $(this).closest('tr');
if (result.value) {
$.ajax({
url: `<?= route_to('clienteList') ?>/${dataId}`,
method: 'DELETE',
}).done((data, textStatus, jqXHR) => {
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
})
}
});
});
<?=$this->endSection() ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<?=$this->endSection() ?>

View File

@ -0,0 +1,28 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('ComunidadesAutonomas.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="100" class="form-control" value="<?=old('nombre', $comunidadAutonomaEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="paisId" class="form-label">
<?=lang('ComunidadesAutonomas.paisId') ?>*
</label>
<select id="paisId" name="pais_id" required class="form-control select2bs2" style="width: 100%;" >
<?php if ( isset($paisList) && is_array($paisList) && !empty($paisList) ) :
foreach ($paisList as $k => $v) : ?>
<option value="<?=$k ?>"<?=$k==$comunidadAutonomaEntity->pais_id ? ' selected':'' ?>>
<?=$v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -0,0 +1,65 @@
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/defaultLayout") ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="comunidadAutonomaForm" method="post" action="<?= $formAction ?>">
<?= csrf_field() ?>
<div class="card-body">
<?= view("Themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/configuracion/comunidades-autonomas/_comunidadAutonomaFormItems") ?>
</div><!-- /.card-body -->
<div class="card-footer">
<?= anchor(route_to("comunidadAutonomaList"), lang("Basic.global.Cancel"), [
"class" => "btn btn-secondary float-start",
]) ?>
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>
<?= $this->section("additionalInlineJs") ?>
$('#paisId').select2({
theme: 'bootstrap-5',
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfPaises") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id',
text: 'id',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
<?= $this->endSection() ?>

View File

@ -0,0 +1,160 @@
<?=$this->include('Themes/_commonPartialsBs/select2bs5') ?>
<?=$this->include('Themes/_commonPartialsBs/datatables') ?>
<?=$this->include('Themes/_commonPartialsBs/sweetalert') ?>
<?=$this->extend('Themes/'.config('Basics')->theme['name'].'/AdminLayout/defaultLayout') ?>
<?=$this->section('content'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('ComunidadesAutonomas.comunidadAutonomaList') ?></h3>
</div><!--//.card-header -->
<div class="card-body">
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfComunidadesautonomas" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
<th><?=lang('ComunidadesAutonomas.id')?></th>
<th><?= lang('ComunidadesAutonomas.nombre') ?></th>
<th><?= lang('Paises.pais') ?></th>
<th><?= lang('ComunidadesAutonomas.createdAt') ?></th>
<th><?= lang('ComunidadesAutonomas.updatedAt') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
<?=anchor(route_to('newComunidadAutonoma'), lang('Basic.global.addNew').' '.lang('ComunidadesAutonomas.comunidadAutonoma'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$this->endSection() ?>
<?=$this->section('additionalInlineJs') ?>
const lastColNr = $('#tableOfComunidadesautonomas').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
</div>
</td>`;
};
theTable = $('#tableOfComunidadesautonomas').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
pageLength: 10,
lengthChange: true,
stateSave: true,
order: [[1, 'asc']],
language: {
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
},
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfComunidadesAutonomas') ?>',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columnDefs: [
{
orderable: false,
searchable: false,
targets: [0,lastColNr]
}
],
columns : [
{ 'data': actionBtns },
{ 'data': 'id' },
{ 'data': 'nombre' },
{ 'data': 'pais' },
{ 'data': 'created_at' },
{ 'data': 'updated_at' },
{ 'data': actionBtns }
]
});
theTable.on( 'draw.dt', function () {
const dateCols = [4, 5];
const shortDateFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY')?>';
const dateTimeFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY h:i a')?>';
for (let coln of dateCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
const datestr = cell.innerHTML;
const dateStrLen = datestr.toString().trim().length;
if (dateStrLen > 0) {
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
const d = new Date(...dateTimeParts); // new Date(datestr);
const md = moment(d);
const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat;
const formattedDateStr = md.format(usingThisFormat);
cell.innerHTML = formattedDateStr;
}
});
}
});
$(document).on('click', '.btn-edit', function(e) {
window.location.href = `<?= route_to('comunidadAutonomaList') ?>/${$(this).attr('data-id')}/edit`;
});
$(document).on('click', '.btn-delete', function(e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('ComunidadesAutonomas.comunidad autonoma'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
})
.then((result) => {
const dataId = $(this).data('id');
const row = $(this).closest('tr');
if (result.value) {
$.ajax({
url: `<?= route_to('comunidadAutonomaList') ?>/${dataId}`,
method: 'DELETE',
}).done((data, textStatus, jqXHR) => {
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
})
}
});
});
<?=$this->endSection() ?>

View File

@ -0,0 +1,12 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('FormasPagoes.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $formaPagoEntity->nombre) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -0,0 +1,12 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('FormasPagoes.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $formasPagoEntity->nombre) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -0,0 +1,26 @@
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/defaultLayout") ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="formaDePagoForm" method="post" action="<?= $formAction ?>">
<?= csrf_field() ?>
<div class="card-body">
<?= view("Themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/configuracion/formasPagoViews/_formaDePagoFormItems") ?>
</div><!-- /.card-body -->
<div class="card-footer">
<?= anchor(route_to("formaDePagoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>

View File

@ -0,0 +1,185 @@
<?=$this->include('Themes/_commonPartialsBs/datatables') ?>
<?=$this->include('Themes/_commonPartialsBs/sweetalert') ?>
<?=$this->extend('Themes/'.config('Basics')->theme['name'].'/AdminLayout/defaultLayout') ?>
<?=$this->section('content'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('FormasPagoes.formaDePagoList') ?></h3>
</div><!--//.card-header -->
<div class="card-body">
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfFormasdepagos" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
<th><?=lang('FormasPagoes.id')?></th>
<th><?= lang('FormasPagoes.nombre') ?></th>
<th><?= lang('FormasPagoes.createdAt') ?></th>
<th><?= lang('FormasPagoes.updatedAt') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
<?=anchor(route_to('newFormaDePago'), lang('Basic.global.addNew').' '.lang('FormasPagoes.formaDePago'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$this->endSection() ?>
<?=$this->section('additionalInlineJs') ?>
const lastColNr = $('#tableOfFormasdepagos').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
</div>
</td>`;
};
theTable = $('#tableOfFormasdepagos').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
pageLength: 10,
lengthChange: true,
"dom": 'lfrtipB', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
// "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
stateSave: true,
order: [[1, 'asc']],
language: {
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
},
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfFormasDePagos') ?>',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columnDefs: [
{
orderable: false,
searchable: false,
targets: [0,lastColNr]
}
],
columns : [
{ 'data': actionBtns },
{ 'data': 'id' },
{ 'data': 'nombre' },
{ 'data': 'created_at' },
{ 'data': 'updated_at' },
{ 'data': actionBtns }
]
});
theTable.on( 'draw.dt', function () {
const dateCols = [3, 4];
const shortDateFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY')?>';
const dateTimeFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY h:i a')?>';
for (let coln of dateCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
const datestr = cell.innerHTML;
const dateStrLen = datestr.toString().trim().length;
if (dateStrLen > 0) {
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
const d = new Date(...dateTimeParts); // new Date(datestr);
const md = moment(d);
const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat;
const formattedDateStr = md.format(usingThisFormat);
cell.innerHTML = formattedDateStr;
}
});
}
});
$(document).on('click', '.btn-edit', function(e) {
window.location.href = `<?= route_to('formaDePagoList') ?>/${$(this).attr('data-id')}/edit`;
});
$(document).on('click', '.btn-delete', function(e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('FormasPagoes.forma de pago'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
})
.then((result) => {
const dataId = $(this).data('id');
const row = $(this).closest('tr');
if (result.value) {
$.ajax({
url: `<?= route_to('formaDePagoList') ?>/${dataId}`,
method: 'DELETE',
}).done((data, textStatus, jqXHR) => {
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
})
}
});
});
<?=$this->endSection() ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.css">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<?=$this->endSection() ?>

View File

@ -0,0 +1,26 @@
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/defaultLayout") ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="formaPagoForm" method="post" action="<?= $formAction ?>">
<?= csrf_field() ?>
<div class="card-body">
<?= view("Themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/configuracion/formas-pago/_formaPagoFormItems") ?>
</div><!-- /.card-body -->
<div class="card-footer">
<?= anchor(route_to("formaPagoList2"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>

View File

@ -0,0 +1,144 @@
<?=$this->include('Themes/_commonPartialsBs/datatables') ?>
<?=$this->include('Themes/_commonPartialsBs/sweetalert') ?>
<?=$this->extend('Themes/'.config('Basics')->theme['name'].'/AdminLayout/defaultLayout') ?>
<?=$this->section('content'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('FormasPagoes.formaPagoList') ?></h3>
</div><!--//.card-header -->
<div class="card-body">
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfFormaspago" class="table table-striped table-hover using-exportable-data-table" style="width: 100%;">
<thead>
<tr>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
<th><?= lang('FormasPagoes.id') ?></th>
<th><?= lang('FormasPagoes.nombre') ?></th>
<th><?= lang('FormasPagoes.createdAt') ?></th>
<th><?= lang('FormasPagoes.updatedAt') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($formaPagoList as $item ) : ?>
<tr>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editFormaPago', $item->id), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deleteFormaPago', $item->id)]); ?>
</td>
<td class="align-middle text-center">
<?=$item->id ?>
</td>
<td class="align-middle">
<?= empty($item->nombre) || strlen($item->nombre) < 51 ? esc($item->nombre) : character_limiter(esc($item->nombre), 50) ?>
</td>
<td class="align-middle text-nowrap">
<?= empty($item->created_at) ? '' : date('mm/dd/YYYY H:i', strtotime($item->created_at)) ?>
</td>
<td class="align-middle text-nowrap">
<?= empty($item->updated_at) ? '' : date('mm/dd/YYYY H:i', strtotime($item->updated_at)) ?>
</td>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editFormaPago', $item->id), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deleteFormaPago', $item->id)]); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
<?=anchor(route_to('newFormaPago'), lang('Basic.global.addNew').' '.lang('FormasPagoes.formaPago'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$this->endSection() ?>
<?=$this->section('additionalInlineJs') ?>
const lastColNr2 = $(".using-exportable-data-table").find("tr:first th").length - 1;
theTable = $('.using-exportable-data-table').DataTable({
"responsive": true,
"paging": true,
"lengthMenu": [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
"pageLength": 10,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"dom": 'lfrtipB', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
// "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
"autoWidth": true,
"scrollX": true,
"stateSave": true,
"language": {
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
},
"columnDefs": [
{
orderable: false,
searchable: false,
targets: [0,lastColNr2]
}
]
});
$(document).on('click', '.btn-delete', function(e) {
e.preventDefault();
const dataHref = $(this).data('href');
Swal.fire({
title: "<?= lang('Basic.global.sweet.sureToDeleteTitle', [lang('FormasPagoes.forma pago')]) ?>",
text: "<?= lang('Basic.global.sweet.sureToDeleteText') ?>",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
}).then((result) => {
if (result.value) {
window.location.href = `${dataHref}`;
}
});
});
<?=$this->endSection() ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.css">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<?=$this->endSection() ?>

View File

@ -4,28 +4,28 @@
<label for="nombre" class="form-label">
<?=lang('Paises.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $pais->nombre) ?>">
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $paisEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="code" class="form-label">
<?=lang('Paises.code') ?>*
</label>
<input type="text" id="code" name="code" required maxLength="2" class="form-control" value="<?=old('code', $pais->code) ?>">
<input type="text" id="code" name="code" required maxLength="2" class="form-control" value="<?=old('code', $paisEntity->code) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="code3" class="form-label">
<?=lang('Paises.code3') ?>
</label>
<input type="text" id="code3" name="code3" maxLength="3" class="form-control" value="<?=old('code3', $pais->code3) ?>">
<input type="text" id="code3" name="code3" maxLength="3" class="form-control" value="<?=old('code3', $paisEntity->code3) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="moneda" class="form-label">
<?=lang('Paises.moneda') ?>*
</label>
<input type="text" id="moneda" name="moneda" required maxLength="3" class="form-control" value="<?=old('moneda', $pais->moneda) ?>">
<input type="text" id="moneda" name="moneda" required maxLength="3" class="form-control" value="<?=old('moneda', $paisEntity->moneda) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
@ -34,28 +34,28 @@
<label for="urlErp" class="form-label">
<?=lang('Paises.urlErp') ?>
</label>
<input type="url" id="urlErp" name="url_erp" maxLength="255" class="form-control" value="<?=old('url_erp', $pais->url_erp) ?>">
<input type="url" id="urlErp" name="url_erp" maxLength="255" class="form-control" value="<?=old('url_erp', $paisEntity->url_erp) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="userErp" class="form-label">
<?=lang('Paises.userErp') ?>
</label>
<input type="text" id="userErp" name="user_erp" maxLength="255" class="form-control" value="<?=old('user_erp', $pais->user_erp) ?>">
<input type="text" id="userErp" name="user_erp" maxLength="255" class="form-control" value="<?=old('user_erp', $paisEntity->user_erp) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="keyErp" class="form-label">
<?=lang('Paises.keyErp') ?>
</label>
<input type="text" id="keyErp" name="key_erp" maxLength="255" class="form-control" value="<?=old('key_erp', $pais->key_erp) ?>">
<input type="text" id="keyErp" name="key_erp" maxLength="255" class="form-control" value="<?=old('key_erp', $paisEntity->key_erp) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="showErp" class="form-check-label">
<input type="checkbox" id="showErp" name="show_erp" value="1" class="form-check-input"<?=$pais->show_erp== true ? 'checked' : ''; ?>>
<input type="checkbox" id="showErp" name="show_erp" value="1" class="form-check-input"<?=$paisEntity->show_erp== true ? 'checked' : ''; ?>>
<?=lang('Paises.showErp') ?>
</label>
</div><!--//.form-check -->

View File

@ -1,6 +1,6 @@
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/defaultLayout") ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
@ -8,20 +8,17 @@
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="paisForm" method="post" class="card-body" action="<?= $formAction ?>">
<form id="paisForm" method="post" action="<?= $formAction ?>">
<?= csrf_field() ?>
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
<div class="card-body">
<?= view("Themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/focus2/form/configuracion/paises/_paisFormItems") ?>
<div class="pt-4">
<input
type="submit"
class="btn btn-primary float-start me-sm-3 me-1"
name="save"
value="<?= lang("Basic.global.Save") ?>"
/>
<?= anchor(route_to("paisList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
</div><!-- /.card-footer -->
<?= view("themes/backend/vuexy/form/configuracion/paises/_paisFormItems") ?>
</div><!-- /.card-body -->
<div class="card-footer">
<?= anchor(route_to("paisList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->

View File

@ -1,21 +1,22 @@
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?=$this->include('Themes/_commonPartialsBs/datatables') ?>
<?=$this->include('Themes/_commonPartialsBs/sweetalert') ?>
<?=$this->extend('Themes/'.config('Basics')->theme['name'].'/AdminLayout/defaultLayout') ?>
<?=$this->section('content'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('Paises.paisList') ?></h3>
<?=anchor(route_to('newPais'), lang('Basic.global.addNew').' '.lang('Paises.pais'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-header -->
<div class="card-body">
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfPaises" class="table table-striped table-hover using-data-table" style="width: 100%;">
<table id="tableOfPaises" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('Paises.id') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
<th><?=lang('Paises.id')?></th>
<th><?= lang('Paises.nombre') ?></th>
<th><?= lang('Paises.code') ?></th>
<th><?= lang('Paises.code3') ?></th>
@ -28,56 +29,154 @@
</tr>
</thead>
<tbody>
<?php foreach ($paisList as $item ) : ?>
<tr>
<td class="align-middle text-center">
<?=$item->id ?>
</td>
<td class="align-middle">
<?= empty($item->nombre) || strlen($item->nombre) < 51 ? esc($item->nombre) : character_limiter(esc($item->nombre), 50) ?>
</td>
<td class="align-middle">
<?= esc($item->code) ?>
</td>
<td class="align-middle">
<?= esc($item->code3) ?>
</td>
<td class="align-middle">
<?= esc($item->moneda) ?>
</td>
<td class="align-middle">
<?= esc($item->url_erp) ?>
</td>
<td class="align-middle">
<?= empty($item->user_erp) || strlen($item->user_erp) < 51 ? esc($item->user_erp) : character_limiter(esc($item->user_erp), 50) ?>
</td>
<td class="align-middle">
<?= empty($item->key_erp) || strlen($item->key_erp) < 51 ? esc($item->key_erp) : character_limiter(esc($item->key_erp), 50) ?>
</td>
<td class="align-middle text-center text-green">
<?php if ( $item->show_erp ) { ?>
<i class="text-success bi bi-check-lg"></i>
<?php } ?>
</td>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editPais', $item->id), "<i class='ti ti-pencil ti-sm mx-2'></i>", ['class'=>'text-body', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', "<i class='ti ti-trash ti-sm mx-2'></i>", ['class'=>'text-body', 'data-href'=>route_to('deletePais', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
<?=anchor(route_to('newPais'), lang('Basic.global.addNew').' '.lang('Paises.pais'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$this->endSection() ?>
<?=$this->endSection() ?>
<?=$this->section('additionalInlineJs') ?>
const lastColNr = $('#tableOfPaises').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
</div>
</td>`;
};
theTable = $('#tableOfPaises').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
pageLength: 10,
lengthChange: true,
"dom": 'lfrtipB', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
// "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
stateSave: true,
order: [[1, 'asc']],
language: {
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
},
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfPaises') ?>',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columnDefs: [
{
orderable: false,
searchable: false,
targets: [0,lastColNr]
}
],
columns : [
{ 'data': actionBtns },
{ 'data': 'id' },
{ 'data': 'nombre' },
{ 'data': 'code' },
{ 'data': 'code3' },
{ 'data': 'moneda' },
{ 'data': 'url_erp' },
{ 'data': 'user_erp' },
{ 'data': 'key_erp' },
{ 'data': 'show_erp' },
{ 'data': actionBtns }
]
});
theTable.on( 'draw.dt', function () {
const boolCols = [9];
for (let coln of boolCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
cell.innerHTML = cell.innerHTML == '1' ? '<i class="text-success bi bi-check-lg"></i>' : '';
});
}
});
$(document).on('click', '.btn-edit', function(e) {
window.location.href = `<?= route_to('paisList') ?>/${$(this).attr('data-id')}/edit`;
});
$(document).on('click', '.btn-delete', function(e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Paises.pais'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
})
.then((result) => {
const dataId = $(this).data('id');
const row = $(this).closest('tr');
if (result.value) {
$.ajax({
url: `<?= route_to('paisList') ?>/${dataId}`,
method: 'DELETE',
}).done((data, textStatus, jqXHR) => {
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
})
}
});
});
<?=$this->endSection() ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.css">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<?=$this->endSection() ?>

View File

@ -0,0 +1,35 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<label for="code" class="form-label">
<?=lang('Provincias.code') ?>*
</label>
<input type="text" id="code" name="code" required maxLength="2" class="form-control" value="<?=old('code', $provinciaEntity->code) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('Provincias.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $provinciaEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="paisId" class="form-label">
<?=lang('Provincias.paisId') ?>*
</label>
<select id="paisId" name="pais_id" class="form-control select2bs2" style="width: 100%;" >
<?php if ( isset($paisList) && is_array($paisList) && !empty($paisList) ) :
foreach ($paisList as $k => $v) : ?>
<option value="<?=$k ?>"<?=$k==$provinciaEntity->pais_id ? ' selected':'' ?>>
<?=$v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -0,0 +1,63 @@
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/defaultLayout") ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="provinciaForm" method="post" action="<?= $formAction ?>">
<?= csrf_field() ?>
<div class="card-body">
<?= view("Themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/configuracion/provincias/_provinciaFormItems") ?>
</div><!-- /.card-body -->
<div class="card-footer">
<?= anchor(route_to("provinciaList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>
<?= $this->section("additionalInlineJs") ?>
$('#paisId').select2({
theme: 'bootstrap-5',
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfPaises") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id',
text: 'nombre',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
<?= $this->endSection() ?>

View File

@ -0,0 +1,190 @@
<?=$this->include('Themes/_commonPartialsBs/select2bs5') ?>
<?=$this->include('Themes/_commonPartialsBs/datatables') ?>
<?=$this->include('Themes/_commonPartialsBs/sweetalert') ?>
<?=$this->extend('Themes/'.config('Basics')->theme['name'].'/AdminLayout/defaultLayout') ?>
<?=$this->section('content'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('Provincias.provinciaList') ?></h3>
</div><!--//.card-header -->
<div class="card-body">
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfProvincias" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
<th><?=lang('Provincias.id')?></th>
<th><?= lang('Provincias.code') ?></th>
<th><?= lang('Provincias.nombre') ?></th>
<th><?= lang('Paises.pais') ?></th>
<th><?= lang('Provincias.createdAt') ?></th>
<th><?= lang('Provincias.updatedAt') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
<?=anchor(route_to('newProvincia'), lang('Basic.global.addNew').' '.lang('Provincias.provincia'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$this->endSection() ?>
<?=$this->section('additionalInlineJs') ?>
const lastColNr = $('#tableOfProvincias').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
</div>
</td>`;
};
theTable = $('#tableOfProvincias').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
pageLength: 10,
lengthChange: true,
"dom": 'lfrtipB', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
// "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
stateSave: true,
order: [[1, 'asc']],
language: {
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
},
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfProvincias') ?>',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columnDefs: [
{
orderable: false,
searchable: false,
targets: [0,lastColNr]
}
],
columns : [
{ 'data': actionBtns },
{ 'data': 'id' },
{ 'data': 'code' },
{ 'data': 'nombre' },
{ 'data': 'pais' },
{ 'data': 'created_at' },
{ 'data': 'updated_at' },
{ 'data': actionBtns }
]
});
theTable.on( 'draw.dt', function () {
const dateCols = [5, 6];
const shortDateFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY')?>';
const dateTimeFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY h:i a')?>';
for (let coln of dateCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
const datestr = cell.innerHTML;
const dateStrLen = datestr.toString().trim().length;
if (dateStrLen > 0) {
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
const d = new Date(...dateTimeParts); // new Date(datestr);
const md = moment(d);
const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat;
const formattedDateStr = md.format(usingThisFormat);
cell.innerHTML = formattedDateStr;
}
});
}
});
$(document).on('click', '.btn-edit', function(e) {
window.location.href = `<?= route_to('provinciaList') ?>/${$(this).attr('data-id')}/edit`;
});
$(document).on('click', '.btn-delete', function(e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Provincias.provincia'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
})
.then((result) => {
const dataId = $(this).data('id');
const row = $(this).closest('tr');
if (result.value) {
$.ajax({
url: `<?= route_to('provinciaList') ?>/${dataId}`,
method: 'DELETE',
}).done((data, textStatus, jqXHR) => {
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
})
}
});
});
<?=$this->endSection() ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.css">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<?=$this->endSection() ?>

View File

@ -0,0 +1,490 @@
<?= $this->extend('themes/backend/vuexy/main/presupuestos_layout') ?>
<?= $this->section('content'); ?>
<div class="container-xxl flex-grow-1 container-p-y">
<div class="faq-header d-flex flex-column justify-content-center align-items-center rounded">
<h3 class="text-center">Presupuestos SAFEKAT</h3>
</div>
<div class="row mt-4">
<!-- Navigation -->
<div class="col-lg-3 col-md-4 col-12 mb-md-0 mb-3">
<div class="d-flex justify-content-between flex-column mb-2 mb-md-0">
<ul class="nav nav-align-left nav-pills flex-column">
<li class="nav-item">
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#payment">
<i class="ti ti-credit-card me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Libros</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#delivery">
<i class="ti ti-briefcase me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Publicidad</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#cancellation">
<i class="ti ti-rotate-clockwise-2 me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Folletos a grapa</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#orders">
<i class="ti ti-box me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Espiral/Wire-o</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
<i class="ti ti-settings me-1 ti-sm"></i>
<span class="align-middle fw-semibold">POD</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
<i class="ti ti-settings me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Externos</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
<i class="ti ti-settings me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Incidencia</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
<i class="ti ti-settings me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Mixto</span>
</button>
</li>
</ul>
</div>
</div>
<!-- /Navigation -->
<!-- Presupuestos -->
<div class="col-lg-9 col-md-8 col-12">
<div class="tab-content py-0">
<div class="tab-pane fade show active" id="payment" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-credit-card ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0">
<span class="align-middle">Libros</span>
</h4>
<small>Seleccione la tipología de libro</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title"><a href="<?= site_url('presupuestos/presupuesto/tapa_blanda_encolada') ?>">Encuadernación encolada tapa blanda</a></h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
<div class="tab-pane fade" id="delivery" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-briefcase ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0">
<span class="align-middle">Item 2</span>
</h4>
<small>Lorem ipsum, dolor sit amet.</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
<div class="tab-pane fade" id="cancellation" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-rotate-clockwise-2 ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0"><span class="align-middle">Itemm 3</span></h4>
<small>Lorem ipsum, dolor sit amet.</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
<div class="tab-pane fade" id="orders" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-box ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0">
<span class="align-middle">Item 4</span>
</h4>
<small>Lorem ipsum, dolor sit amet.</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
<div class="tab-pane fade" id="product" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-camera ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0">
<span class="align-middle">Item N</span>
</h4>
<small>Lorem ipsum, dolor sit amet.</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
</div>
</div>
<!-- /FAQ's -->
</div>
<!-- Contact -->
<div class="row mt-5">
<div class="col-12 text-center mb-4">
<div class="badge bg-label-primary">¿Preguntas?</div>
<h4 class="my-2">¿Necesita ayuda?</h4>
<p>No dude en contactar con nuestro equipo de soporte en soporte@safekat.com</p>
</div>
</div>
<div class="row text-center justify-content-center gap-sm-0 gap-3">
<div class="col-sm-6">
<div class="py-3 rounded bg-faq-section text-center">
<span class="badge bg-label-primary my-3 rounded-2 p-2">
<i class="ti ti-phone ti-md"></i>
</span>
<h4 class="mb-2"><a class="text-body" href="tel:+(34)123456789">+(34) 123 456 789</a></h4>
</div>
</div>
<div class="col-sm-6">
<div class="py-3 rounded bg-faq-section text-center">
<span class="badge bg-label-primary my-3 rounded-2 p-2">
<i class="ti ti-mail ti-md"></i>
</span>
<h4 class="mb-2"><a class="text-body" href="mailto:ayuda@safekat.com">ayuda@safekat.com</a></h4>
</div>
</div>
</div>
<!-- /Contact -->
</div>
<?= $this->endSection() ?>

View File

@ -0,0 +1,472 @@
<?= $this->extend('themes/backend/vuexy/main/presupuestos_layout') ?>
<?= $this->section('content'); ?>
<div class="container-xxl flex-grow-1 container-p-y">
<div class="faq-header d-flex flex-column justify-content-center align-items-center rounded">
<h3 class="text-center">Presupuestos SAFEKAT</h3>
</div>
<div class="row mt-4">
<!-- Navigation -->
<div class="col-lg-3 col-md-4 col-12 mb-md-0 mb-3">
<div class="d-flex justify-content-between flex-column mb-2 mb-md-0">
<ul class="nav nav-align-left nav-pills flex-column">
<li class="nav-item">
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#payment">
<i class="ti ti-credit-card me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Libros</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#delivery">
<i class="ti ti-briefcase me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Item 2</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#cancellation">
<i class="ti ti-rotate-clockwise-2 me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Item 3</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#orders">
<i class="ti ti-box me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Item 4</span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
<i class="ti ti-settings me-1 ti-sm"></i>
<span class="align-middle fw-semibold">Item N</span>
</button>
</li>
</ul>
</div>
</div>
<!-- /Navigation -->
<!-- Presupuestos -->
<div class="col-lg-9 col-md-8 col-12">
<div class="tab-content py-0">
<div class="tab-pane fade show active" id="payment" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-credit-card ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0">
<span class="align-middle">Libros</span>
</h4>
<small>Seleccione la tipología de libro</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title"><a href="<?= site_url('presupuestos/presupuesto/tapa_blanda_encolada') ?>">Encuadernación encolada tapa blanda</a></h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
<div class="tab-pane fade" id="delivery" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-briefcase ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0">
<span class="align-middle">Item 2</span>
</h4>
<small>Lorem ipsum, dolor sit amet.</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
<div class="tab-pane fade" id="cancellation" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-rotate-clockwise-2 ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0"><span class="align-middle">Itemm 3</span></h4>
<small>Lorem ipsum, dolor sit amet.</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
<div class="tab-pane fade" id="orders" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-box ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0">
<span class="align-middle">Item 4</span>
</h4>
<small>Lorem ipsum, dolor sit amet.</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
<div class="tab-pane fade" id="product" role="tabpanel">
<div class="d-flex mb-3 gap-3">
<div>
<span class="badge bg-label-primary rounded-2 p-2">
<i class="ti ti-camera ti-lg"></i>
</span>
</div>
<div>
<h4 class="mb-0">
<span class="align-middle">Item N</span>
</h4>
<small>Lorem ipsum, dolor sit amet.</small>
</div>
</div>
<!-- Libros -->
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
<p class="card-text">
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
<p class="card-text">
La encuadernación rústica hace referencia a los libros de tapa blanda.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
<div class="col-md-3">
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
</div>
<div class="col-md-9">
<div class="card-body">
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
<p class="card-text">
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
</p>
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Libros -->
</div>
</div>
</div>
<!-- /FAQ's -->
</div>
<!-- Contact -->
<div class="row mt-5">
<div class="col-12 text-center mb-4">
<div class="badge bg-label-primary">¿Preguntas?</div>
<h4 class="my-2">¿Necesita ayuda?</h4>
<p>No dude en contactar con nuestro equipo de soporte en soporte@safekat.com</p>
</div>
</div>
<div class="row text-center justify-content-center gap-sm-0 gap-3">
<div class="col-sm-6">
<div class="py-3 rounded bg-faq-section text-center">
<span class="badge bg-label-primary my-3 rounded-2 p-2">
<i class="ti ti-phone ti-md"></i>
</span>
<h4 class="mb-2"><a class="text-body" href="tel:+(34)123456789">+(34) 123 456 789</a></h4>
</div>
</div>
<div class="col-sm-6">
<div class="py-3 rounded bg-faq-section text-center">
<span class="badge bg-label-primary my-3 rounded-2 p-2">
<i class="ti ti-mail ti-md"></i>
</span>
<h4 class="mb-2"><a class="text-body" href="mailto:ayuda@safekat.com">ayuda@safekat.com</a></h4>
</div>
</div>
</div>
<!-- /Contact -->
</div>
<?= $this->endSection() ?>

View File

@ -109,7 +109,7 @@
<div class="col-lg-12 mb-3">
<label class="form-label text-primary"><?=lang("App.settings_label_general_subtitle_1")?></label>
</div>
<div class="col-lg-9 mb-3">
<div class="col-lg-12 mb-3">
<label for="title" class="form-label"><?=lang("App.settings_field_title")?></label>
<input
type="text"
@ -120,6 +120,7 @@
value="<?= (isset($obj)) ? $obj['title'] : set_value('title');?>"
/>
</div>
<?php /*
<div class="col-lg-3 mb-3">
<label for="activate_frontend" class="form-label"><?=lang("App.settings_field_frontend")?></label>
<?php $id_select = (isset($obj)) ? $obj['activate_frontend'] : set_value('activate_frontend');?>
@ -128,6 +129,7 @@
<option value="1" <?= $id_select == "1" ? 'selected' : '' ?>><?=lang("App.notification_grid_yes")?></option>
</select>
</div>
*/ ?>
<div class="col-lg-6 mb-3">
<label class="form-label"><?=lang("App.settings_field_seo_description")?></label>
<textarea
@ -216,7 +218,7 @@
<option value="comma" <?= $id_select == "comma" ? 'selected' : '' ?>><?=lang("App.settings_field_default_currency_separation_coma")?></option>
</select>
</div>
<div class="col-lg-3 mb-3">
<div class="col-lg-4 mb-3">
<label for="default_currency_position" class="form-label"><?=lang("App.settings_field_default_currency_position")?></label>
<?php $id_select = (isset($obj)) ? $obj['default_currency_position'] : set_value('default_currency_position');?>
<select name="default_currency_position" id="default_currency_position" class="select2 form-control">
@ -224,7 +226,7 @@
<option value="right" <?= $id_select == "right" ? 'selected' : '' ?>><?=lang("App.settings_field_default_currency_position_right")?></option>
</select>
</div>
<div class="col-lg-3 mb-3">
<div class="col-lg-4 mb-3">
<label for="default_country" class="form-label"><?=lang("App.settings_field_default_country")?></label>
<?php $id_select = (isset($obj)) ? $obj['default_country'] : set_value('default_country');?>
<select name="default_country" id="default_country" class="select2 form-control">
@ -233,7 +235,7 @@
<?php endforeach; ?>
</select>
</div>
<div class="col-lg-3 mb-3">
<div class="col-lg-4 mb-3">
<label for="default_theme" class="form-label"><?=lang("App.settings_field_default_theme")?></label>
<?php $id_select = (isset($obj)) ? $obj['default_theme'] : set_value('default_theme');?>
<select name="default_theme" id="default_theme" class="select2 form-control">
@ -244,6 +246,7 @@
<?php endforeach; ?>
</select>
</div>
<?php /*
<div class="col-lg-3 mb-3">
<label for="default_theme_front" class="form-label"><?=lang("App.settings_field_default_theme_front")?></label>
<select name="default_theme_front" id="default_theme_front" class="select2 form-control">
@ -254,6 +257,7 @@
<?php endforeach; ?>
</select>
</div>
*/ ?>
</div>
</div>
</div>

View File

@ -7,6 +7,20 @@
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $tarifaacabadoEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('Tarifaacabado.precioMin') ?>*
</label>
<input type="text" id="precio_min" name="precio_min" required class="form-control" value="<?=old('precio_min', $tarifaacabadoEntity->precio_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('Tarifaacabado.importeFijo') ?>*
</label>
<input type="text" id="importe_fijo" name="importe_fijo" required class="form-control" value="<?=old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -1,5 +1,5 @@
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
<?php //$this->include('themes/_commonPartialsBs/sweetalert') ?>
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section('content'); ?>
<div class="row">
@ -17,6 +17,8 @@
<thead>
<tr>
<th><?= lang('Tarifaacabado.nombre') ?></th>
<th><?= lang('Tarifaacabado.precioMin') ?></th>
<th><?= lang('Tarifaacabado.importeFijo') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
@ -32,6 +34,30 @@
</div><!--//.col -->
</div><!--//.row -->
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div class="modal-body">
<p>Croissant jelly beans donut apple pie. Caramels bonbon lemon drops. Sesame snaps lemon drops lemon drops liquorice icing bonbon pastry pastry carrot cake. Dragée sweet sweet roll sugar plum.</p>
<p>Jelly-o cookie jelly gummies pudding cheesecake lollipop macaroon. Sweet chocolate bar sweet roll carrot cake. Sweet roll sesame snaps fruitcake brownie bear claw toffee bonbon brownie.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary btn-imn" data-bs-dismiss="modal">Borrar</button>
</div>
</div>
</div>
</div>
<?= $this->endSection() ?>
@ -40,12 +66,19 @@
const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `
<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
</div>
</td>`;
<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<!-- <a href="--><?php //= site_url('/tarifas/tarifaacabado/edit/') ?><!--${data.id}" class="text-body" data-id="${data.id}">-->
<!-- <i class="ti ti-pencil ti-sm mx-2"></i>-->
<!-- </a>-->
<!-- <a class="text-body" data-href="${data.id}" data-bs-toggle="modal" data-bs-target="#exampleModal">-->
<!-- <i class="ti ti-trash ti-sm mx-2"></i>-->
<!-- </a>-->
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
<i class="ti ti-trash ti-sm btn-del mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#exampleModal"></i>
<!-- <i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>-->
</div>
</td>`;
};
theTable = $('#tableOfTarifasacabado').DataTable({
processing: true,
@ -84,54 +117,47 @@
],
columns : [
{ 'data': 'nombre' },
{ 'data': 'precio_min' },
{ 'data': 'importe_fijo' },
{ 'data': actionBtns }
]
});
$(document).on('click', '.btn-edit', function(e) {
//window.location.href = `<?= route_to('tarifaAcabadoList') ?>/edit/${$(this).attr('data-id')}`;
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;
});
$(document).on('click', '.btn-delete', function(e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Tarifaacabado.tarifa acabado'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
})
.then((result) => {
const dataId = $(this).data('id');
const row = $(this).closest('tr');
if (result.value) {
$.ajax({
//url: `<?= route_to('tarifaAcabadoList') ?>/${dataId}`,
//method: 'DELETE',
url: `/tarifas/tarifaacabado/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
})
}
});
$(document).on('click', '.btn-del', function(e) {
$(".btn-imn").attr('data-id', $(this).attr('data-id'));
});
$(document).on('click', '.btn-imn', function(e) {
const dataId = $(this).attr('data-id');
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
$.ajax({
url: `/tarifas/tarifaacabado/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
})
}
});
<?= $this->endSection() ?>

View File

@ -2,6 +2,7 @@
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">

View File

@ -37,65 +37,64 @@
<?=$this->section('additionalInlineJs') ?>
const lastColNr = $('#tableOfTarifasmanipulado').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
</div>
</td>`;
};
theTable = $('#tableOfTarifasmanipulado').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
pageLength: 10,
lengthChange: true,
"dom": 'lfBrtip',
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
stateSave: true,
order: [[0, 'asc']],
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfTarifasManipulado') ?>',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr]
}
],
columns : [
{ 'data': 'nombre' },
{ 'data': actionBtns }
]
});
const lastColNr = $('#tableOfTarifasmanipulado').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
</div>
</td>`;
};
theTable = $('#tableOfTarifasmanipulado').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
pageLength: 10,
lengthChange: true,
"dom": 'lfBrtip',
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
stateSave: true,
order: [[0, 'asc']],
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfTarifasManipulado') ?>',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr]
}
],
columns : [
{ 'data': 'nombre' },
{ 'data': actionBtns }
]
});
$(document).on('click', '.btn-edit', function(e) {
$(document).on('click', '.btn-edit', function(e) {
//window.location.href = `<?= route_to('tarifaManipuladoList') ?>/${$(this).attr('data-id')}/edit`;
window.location.href = `/tarifas/tarifasmanipulado/edit/${$(this).attr('data-id')}`;
});
$(document).on('click', '.btn-delete', function(e) {
$(document).on('click', '.btn-delete', function(e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Tarifamanipulado.tarifa manipulado'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
@ -132,8 +131,6 @@ $(document).on('click', '.btn-delete', function(e) {
}
});
});
<?=$this->endSection() ?>

View File

@ -0,0 +1,339 @@
<?php
$session = session();
$token = $session->get('token') ?? '';
$tfa = $session->get('tfa') ?? false;
$settings = $session->get('settings');
$picture = session()->get('picture');
$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><?= lang("App.dashboard_title") ?> - <?= $settings['title'] ?? '' ?></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/demo.css') ?>"/>
<!-- Vendors CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') ?>"/>
<!-- Page CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/page-faq.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 -->
<!-- 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('first_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("login/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 -->
<?= $this->renderSection('content') ?>
<!-- / 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

@ -1,41 +0,0 @@
<script src="<?= site_url('themes/focus2/vendor/timeago/jquery.timeago.js'); ?>"></script>
<script src="<?= site_url('themes/focus2/vendor/timeago/locales/jquery.timeago.'.langJS().'.js'); ?>"></script>
<script>
"use strict";
$(document).ready(function () {
let time_ago = document.getElementsByClassName("timeAgo");
for (let i = 0; i < time_ago.length; i++) {
time_ago[i].innerText = jQuery.timeago(time_ago[i].innerText)
}
});
(function($) {
"use strict"
window.addEventListener('resize', function(e){
let body = document.querySelector('body');
let ws = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
let mw = document.getElementById('main-wrapper');
if(ws>=1216){
body.setAttribute('data-sidebar-style', 'full');
body.setAttribute('data-sidebar-position', 'fixed');
body.setAttribute('data-header-position', 'fixed');
mw.classList.remove('menu-toggle');
}else if(ws<1216 && ws>=768){
body.setAttribute('data-sidebar-style', 'mini');
mw.classList.add('menu-toggle');
body.setAttribute('data-sidebar-position', 'fixed');
body.setAttribute('data-header-position', 'fixed');
}else{
body.setAttribute('data-sidebar-style', 'overlay');
mw.classList.remove('menu-toggle');
}
});
})(jQuery);
</script>
<div class="footer">
<div class="copyright">
<p>Copyright © Designed by <a href="https://quixkit.com/" target="_blank">Quixkit</a> &amp; Developed by <a href="https://eduardofiorini.com/" target="_blank">Eduardo Fiorini</a> - WebGuard v1.2.0 </p>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,130 +0,0 @@
<?php
$settings = session()->get('settings');
$picture = session()->get('picture');
$pulse = session()->get('pulse');
$notification = session()->get('notification');
?>
<!DOCTYPE html>
<html lang="<?= $settings['default_language']??'en'=='pt' ? 'pt-br' : $settings['default_language']??'en' ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><?= lang("App.dashboard_title") ?> - <?= $settings['title']??'' ?></title>
<!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="<?=site_url('themes/focus2/images/favicon.png')?>">
<link href="<?=site_url('themes/focus2/vendor/owl-carousel/css/owl.carousel.min.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/vendor/owl-carousel/css/owl.theme.default.min.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/vendor/jqvmap/css/jqvmap.min.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/vendor/datatables/css/jquery.dataTables.min.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/vendor/select2/css/select2.min.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/vendor/lou-multi-select/css/multi-select.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/vendor/nestable2/css/jquery.nestable.min.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/vendor/toastr/css/toastr.min.css')?>" rel="stylesheet">
<link href="<?=site_url('themes/focus2/css/style.css')?>" rel="stylesheet">
</head>
<body>
<!--PreLoader-->
<div id="preloader">
<div class="sk-three-bounce">
<div class="sk-child sk-bounce1"></div>
<div class="sk-child sk-bounce2"></div>
<div class="sk-child sk-bounce3"></div>
</div>
</div>
<!--Main Wrapper-->
<div id="main-wrapper">
<!--Nav Header-->
<div class="nav-header">
<a href="<?=site_url('home')?>" class="brand-logo">
<img class="logo-abbr" src="<?=site_url('themes/focus2/images/logo.png')?>" alt="">
<img class="logo-compact" src="<?=site_url('themes/focus2/images/logo-text.png')?>" alt="">
<img class="brand-title" src="<?=site_url('themes/focus2/images/logo-text.png')?>" alt="">
</a>
<div class="nav-control">
<div class="hamburger">
<span class="line"></span><span class="line"></span><span class="line"></span>
</div>
</div>
</div>
<!--Header-->
<div class="header">
<div class="header-content">
<nav class="navbar navbar-expand">
<div class="collapse navbar-collapse justify-content-between">
<div class="header-left"></div>
<ul class="navbar-nav header-right">
<li class="nav-item dropdown notification_dropdown">
<a class="nav-link" href="#" role="button" data-toggle="dropdown">
<i class="fas fa-bell"></i>
<?php if ($pulse > 0) : ?>
<div class="pulse-css text-danger"></div>
<?php endif; ?>
</a>
<div class="dropdown-menu dropdown-menu-right">
<ul class="list-unstyled">
<?php foreach ($notification??[] as $item) : ?>
<a href="<?=site_url('my/notification_view/'.$item['token'])?>">
<li class="media dropdown-item">
<?php if ($item['is_read']) : ?>
<span class="success"><i class="far fa-envelope-open"></i> </span>
<?php else : ?>
<span class="primary"><i class="far fa-envelope"></i> </span>
<?php endif; ?>
<div class="media-body">
<p><?=$item['title']?></p>
</div>
<span class="notify-time timeAgo"><?=$item['created_at']?></span>
</li>
</a>
<?php endforeach; ?>
</ul>
<a class="all-notification" href="<?=site_url('my/notification')?>"><?= lang("App.notification_bell_btn") ?> <i class="ti-arrow-right"></i></a>
</div>
</li>
<li class="nav-item dropdown header-profile">
<a class="nav-link" href="#" role="button" data-toggle="dropdown">
<i class="fas fa-globe-americas"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= site_url('lang/en'); ?>" class="dropdown-item">
<img src="<?=site_url('assets/flags/us_32_circle.png')?>">
<span class="ml-2"><?= lang("App.lang_en") ?></span>
</a>
<a href="<?= site_url('lang/es'); ?>" class="dropdown-item">
<img src="<?=site_url('assets/flags/es_32_circle.png')?>">
<span class="ml-2"><?= lang("App.lang_es") ?></span>
</a>
<a href="<?= site_url('lang/pt'); ?>" class="dropdown-item">
<img src="<?=site_url('assets/flags/br_32_circle.png')?>">
<span class="ml-2"><?= lang("App.lang_pt") ?></span>
</a>
</div>
</li>
<li class="nav-item dropdown header-profile">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<img src="<?= $picture??''?>" class="btn-circle btn-circle-sm" style="width: 50px ; height: 50px;">
</a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= site_url('profile'); ?>" class="dropdown-item">
<i class="fas fa-user"></i>
<span class="ml-2"><?= lang("App.menu_profile") ?></span>
</a>
<a href="<?= site_url('activity'); ?>" class="dropdown-item">
<i class="fas fa-list"></i>
<span class="ml-2"><?= lang("App.menu_activity") ?></span>
</a>
<a href="<?= site_url('login/logout'); ?>" class="dropdown-item">
<i class="fas fa-sign-out-alt"></i>
<span class="ml-2"><?= lang("App.menu_logout") ?></span>
</a>
</div>
</li>
</ul>
</div>
</nav>
</div>
</div>
<?php include "menu.php" ?>

View File

@ -1,61 +0,0 @@
<?php $menus = getMenuControl(); ?>
<!--Sidebar-->
<div class="quixnav">
<div class="quixnav-scroll">
<ul class="metismenu" id="menu">
<li><a href="/" aria-expanded="false"><i class="fas fa-th-large"></i><span class="nav-text"><?= lang("App.menu_dashboard") ?></span></a></li>
<?php if (count(getArrayItem($menus,'name','User')) > 0): ?>
<li class="nav-label"><?= lang("App.menu_registration") ?></li>
<li><a class="has-arrow" href="javascript:void()" aria-expanded="false"><i class="fas fa-user-friends"></i><span class="nav-text"><?= lang("App.menu_users") ?></span></a>
<ul aria-expanded="false">
<?php if (count(getArrayItem($menus,'methods','index',true)) > 0): ?>
<li><a href="/user"><?= lang("App.menu_list") ?></a></li>
<?php endif; ?>
<?php if (count(getArrayItem($menus,'methods','add',true)) > 0): ?>
<li><a href="/user/add"><?= lang("App.menu_add") ?></a></li>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>
<?php if (count(getArrayItem($menus,'name','Group')) > 0): ?>
<li><a class="has-arrow" href="javascript:void()" aria-expanded="false"><i class="fas fa-user-lock"></i><span class="nav-text"><?= lang("App.menu_permission_group") ?></span></a>
<ul aria-expanded="false">
<?php if (count(getArrayItem($menus,'methods','index',true)) > 0): ?>
<li><a href="/group"><?= lang("App.menu_list") ?></a></li>
<?php endif; ?>
<?php if (count(getArrayItem($menus,'methods','add',true)) > 0): ?>
<li><a href="/group/add"><?= lang("App.menu_add") ?></a></li>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>
<?php if (count(getArrayItem($menus,'name','Notification')) > 0): ?>
<li><a class="has-arrow" href="javascript:void()" aria-expanded="false"><i class="fas fa-bell"></i><span class="nav-text"><?= lang("App.menu_notification") ?></span></a>
<ul aria-expanded="false">
<?php if (count(getArrayItem($menus,'methods','index',true)) > 0): ?>
<li><a href="/notification"><?= lang("App.menu_list") ?></a></li>
<?php endif; ?>
<?php if (count(getArrayItem($menus,'methods','add',true)) > 0): ?>
<li><a href="/notification/add"><?= lang("App.menu_add") ?></a></li>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>
<?php if (count(getArrayItem($menus,'name','Settings')) > 0): ?>
<li class="nav-label"><?= lang("App.menu_settings") ?></li>
<?php if (count(getArrayItem($menus,'methods','index',true)) > 0): ?>
<li><a href="/settings" aria-expanded="false"><i class="fas fa-sliders-h"></i><span class="nav-text"><?= lang("App.menu_general") ?></span></a></li>
<?php endif; ?>
<?php if (count(getArrayItem($menus,'methods','template',true)) > 0): ?>
<li><a href="/settings/template" aria-expanded="false"><i class="fas fa-mail-bulk"></i><span class="nav-text"><?= lang("App.menu_template") ?></span></a></li>
<?php endif; ?>
<?php endif; ?>
<li class="nav-label"></li>
<?php if (count(getArrayItem($menus,'name','Activity')) > 0): ?>
<li><a href="/activity" aria-expanded="false"><i class="fas fa-list"></i><span class="nav-text"><?= lang("App.menu_activity") ?></span></a></li>
<?php endif; ?>
<li><a href="/login/logout" aria-expanded="false"><i class="fas fa-sign-out-alt"></i><span class="nav-text"><?= lang("App.menu_logout") ?></span></a></li>
</ul>
</div>
</div>