mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Arreglando UI-delete de Tariba Acabado
This commit is contained in:
@ -114,7 +114,7 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
return redirect()->to(route_to('tarifas/tarifaacabado/edit/' . $id))->with('sweet-success', $message);
|
return redirect()->to(site_url('tarifas/tarifaacabado/edit/' . $id))->with('sweet-success', $message);
|
||||||
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||||
else:
|
else:
|
||||||
return $this->redirect2listView('sweet-success', $message);
|
return $this->redirect2listView('sweet-success', $message);
|
||||||
|
|||||||
@ -1,33 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Open-Source License Information:
|
$errorMessage = $errorMessage ?? session('errorMessage');
|
||||||
/*
|
$warningMessage = session('warningMessage');
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2020 Ozar (https://www.ozar.net/)
|
if (session()->has('message')) {
|
||||||
|
$successMessage = session('message');
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
}
|
||||||
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
if (session()->has('error')) {
|
||||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
$errorMessage = is_array(session('error')) ? implode(session('error')) : session('error');
|
||||||
|
} /* // Uncomment this block if you want the errors listed line by line in the alert
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
||||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
$errorMessage = $errorMessage ?? session('errorMessage');
|
|
||||||
$warningMessage = session('warningMessage');
|
|
||||||
|
|
||||||
if (session()->has('message')) {
|
|
||||||
$successMessage = session('message');
|
|
||||||
}
|
|
||||||
if (session()->has('error')) {
|
|
||||||
$errorMessage = is_array(session('error')) ? implode(session('error')) : session('error');
|
|
||||||
} /* // Uncomment this block if you want the errors listed line by line in the alert
|
|
||||||
elseif (session()->has('errors')) {
|
elseif (session()->has('errors')) {
|
||||||
$errorMessage = '<ul class="text-start">';
|
$errorMessage = '<ul class="text-start">';
|
||||||
foreach (session('errors') as $error) :
|
foreach (session('errors') as $error) :
|
||||||
@ -39,43 +20,56 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (isset($successMessage) && $successMessage): ?>
|
<?php if (isset($successMessage) && $successMessage): ?>
|
||||||
|
<div class="alert alert-success alert-dismissible d-flex align-items-baseline" role="alert">
|
||||||
<div class="alert alert-success" role="alert">
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||||
<svg class="bi mt-1 me-3 float-start" width="24" height="24" role="img" aria-label="Success:"><use xlink:href="#check-circle-fill"/></svg>
|
<i class="ti ti-check ti-sm"></i>
|
||||||
<button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>
|
</span>
|
||||||
<div>
|
<div class="d-flex flex-column ps-1">
|
||||||
<h4><?=lang('Basic.global.Success')?>!</h4>
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Success') ?></h5>
|
||||||
<?= $successMessage; ?>
|
<p class="mb-0"><?= $successMessage; ?></p>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (isset($errorMessage) && $errorMessage): ?>
|
<?php if (isset($errorMessage) && $errorMessage): ?>
|
||||||
|
<div class="alert alert-danger alert-dismissible d-flex align-items-baseline" role="alert">
|
||||||
<div class="alert alert-danger" role="alert">
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||||
<svg class="bi mt-1 me-3 float-start" width="24" height="24" role="img" aria-label="Error:"><use xlink:href="#exclamation-triangle-fill"/></svg>
|
<i class="ti ti-ban ti-sm"></i>
|
||||||
<button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>
|
</span>
|
||||||
<div>
|
<div class="d-flex flex-column ps-1">
|
||||||
<h4><?=lang('Basic.global.Error')?>!</h4>
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Error') ?></h5>
|
||||||
<?= $errorMessage; ?>
|
<p class="mb-0"><?= $errorMessage; ?></p>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php if (isset($warningMessage) && $warningMessage): ?>
|
<?php if (isset($warningMessage) && $warningMessage): ?>
|
||||||
|
<div class="alert alert-warning alert-dismissible d-flex align-items-baseline" role="alert">
|
||||||
<div class="alert alert-warning" role="alert">
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||||
<svg class="bi mt-1 me-3 float-start" width="24" height="24" role="img" aria-label="Error:"><use xlink:href="#exclamation-triangle-fill"/></svg>
|
<i class="ti ti-bell ti-sm"></i>
|
||||||
<button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>
|
</span>
|
||||||
<div>
|
<div class="d-flex flex-column ps-1">
|
||||||
<h4 class="text-start"><?=lang('Basic.global.Warning')?></h4>
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Warning') ?></h5>
|
||||||
<?= $warningMessage ?>
|
<p class="mb-0"><?= $warningMessage; ?></p>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<div id="imn-alert" class="alert alert-warning alert-dismissible d-flex d-none align-items-baseline" role="alert">
|
||||||
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||||
|
<i class="ti ti-check ti-sm"></i>
|
||||||
|
</span>
|
||||||
|
<div class="d-flex flex-column ps-1">
|
||||||
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Warning') ?></h5>
|
||||||
|
<p class="mb-0"><?= $warningMessage; ?></p>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@ -11,30 +11,9 @@
|
|||||||
<?= lang('Basic.global.deleteConfirmationQuestion') ?>
|
<?= lang('Basic.global.deleteConfirmationQuestion') ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-bs-dismiss="modal"><?= lang('Basic.global.deleteConfirmationCancel') ?></button>
|
<button type="button" class="btn btn-default"
|
||||||
<a class="btn btn-danger btn-confirm"><?= lang('Basic.global.deleteConfirmationButton') ?></a>
|
data-bs-dismiss="modal"><?= lang('Basic.global.deleteConfirmationCancel') ?></button>
|
||||||
</div><!--//.modal-footer -->
|
<a class="btn btn-danger btn-confirm btn-remove"><?= lang('Basic.global.deleteConfirmationButton') ?></a>
|
||||||
</div><!--//.modal-content -->
|
|
||||||
</div><!--//.modal-dialog -->
|
|
||||||
</div><!--//.modal -->
|
|
||||||
<?php
|
|
||||||
} else { ?>
|
|
||||||
<div id="confirm2delete" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="confirm2deleteLabel"
|
|
||||||
aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<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">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<?= lang('Basic.global.deleteConfirmationQuestion') ?>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<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-footer -->
|
||||||
</div><!--//.modal-content -->
|
</div><!--//.modal-content -->
|
||||||
</div><!--//.modal-dialog -->
|
</div><!--//.modal-dialog -->
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||||
<?php //$this->include('themes/_commonPartialsBs/sweetalert') ?>
|
<?php $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||||
|
<?php $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||||
<?= $this->section('content'); ?>
|
<?= $this->section('content'); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -32,49 +33,18 @@
|
|||||||
</div><!--//.col -->
|
</div><!--//.col -->
|
||||||
</div><!--//.row -->
|
</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() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('additionalInlineJs') ?>
|
<?= $this->section('additionalInlineJs') ?>
|
||||||
|
|
||||||
const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
|
const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
|
||||||
const actionBtns = function(data) {
|
const actionBtns = function(data) {
|
||||||
return `
|
return `
|
||||||
<td class="text-right py-0 align-middle">
|
<td class="text-right py-0 align-middle">
|
||||||
<div class="btn-group btn-group-sm">
|
<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-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}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i>
|
||||||
<!-- <i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>-->
|
|
||||||
</div>
|
</div>
|
||||||
</td>`;
|
</td>`;
|
||||||
};
|
};
|
||||||
@ -124,11 +94,11 @@
|
|||||||
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;
|
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.btn-del', function(e) {
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
$(".btn-imn").attr('data-id', $(this).attr('data-id'));
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.btn-imn', function(e) {
|
$(document).on('click', '.btn-remove', function(e) {
|
||||||
const dataId = $(this).attr('data-id');
|
const dataId = $(this).attr('data-id');
|
||||||
const row = $(this).closest('tr');
|
const row = $(this).closest('tr');
|
||||||
if ($.isNumeric(dataId)) {
|
if ($.isNumeric(dataId)) {
|
||||||
@ -136,6 +106,7 @@
|
|||||||
url: `/tarifas/tarifaacabado/delete/${dataId}`,
|
url: `/tarifas/tarifaacabado/delete/${dataId}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
|
$('#confirm2delete').modal('toggle'),
|
||||||
Toast.fire({
|
Toast.fire({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: data.msg ?? jqXHR.statusText,
|
title: data.msg ?? jqXHR.statusText,
|
||||||
@ -152,7 +123,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#imn-alert').on('click', function (e) {
|
||||||
|
$(this).toggleClass('d-none');
|
||||||
|
});
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|||||||
@ -15,17 +15,8 @@
|
|||||||
<table id="tableOfTarifaspreimpresion" class="table table-striped table-hover using-exportable-data-table" style="width: 100%;">
|
<table id="tableOfTarifaspreimpresion" class="table table-striped table-hover using-exportable-data-table" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<?php /*
|
|
||||||
<th><?= lang('Tarifapreimpresion.id') ?></th>
|
|
||||||
*/ ?>
|
|
||||||
<th><?= lang('Tarifapreimpresion.nombre') ?></th>
|
<th><?= lang('Tarifapreimpresion.nombre') ?></th>
|
||||||
<th><?= lang('Tarifapreimpresion.precio') ?></th>
|
<th><?= lang('Tarifapreimpresion.precio') ?></th>
|
||||||
<?php /*
|
|
||||||
<th><?= lang('Tarifapreimpresion.userCreatedId') ?></th>
|
|
||||||
<th><?= lang('Tarifapreimpresion.userUpdateId') ?></th>
|
|
||||||
<th><?= lang('Tarifapreimpresion.createdAt') ?></th>
|
|
||||||
<th><?= lang('Tarifapreimpresion.updatedAt') ?></th>
|
|
||||||
*/ ?>
|
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
Reference in New Issue
Block a user