mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Igualando a rama dev/formateando
This commit is contained in:
@ -1,123 +1,155 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?= $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 -->
|
||||
<div class="card-body">
|
||||
<?= formAlert() ?>
|
||||
<form id="groupForm" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="id_group" value="<?= (isset($obj)) ? $obj['id_group'] : set_value('id_group') ?>">
|
||||
<input type="hidden" name="token" value="<?= (isset($obj)) ? $obj['token'] : set_value('token') ?>">
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="title" class="text-dark"><?=lang("App.group_field_title")?></label>
|
||||
<input type="text" name="title" id="title" class="form-control" value="<?= old('title', $group->title) ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="dashboard" class="text-dark"><?=lang("App.group_field_dashboard")?></label>
|
||||
<?php $id_select = (isset($group)) ? $group->dashboard : set_value('dashboard');?>
|
||||
<select name="dashboard" id="dashboard" class="form-control">
|
||||
<option value="user" <?= $id_select == "user" ? 'selected' : '' ?>><?=lang("App.group_label_user")?></option>
|
||||
<option value="admin" <?= $id_select == "admin" ? 'selected' : '' ?>><?=lang("App.group_label_admin")?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 right">
|
||||
<div class="form-group">
|
||||
<button type="button" name="select_all" id="select_all" class="btn btn-primary round"><i class="la la-toggle-on"></i> <?=lang("App.group_btn_select")?></button>
|
||||
<button type="button" name="remove_all" id="remove_all" class="btn btn-primary round ml-1"><i class="la la-toggle-off"></i> <?=lang("App.group_btn_remove")?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 right">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= lang("App.permisos_general") ?></h4>
|
||||
|
||||
<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 -->
|
||||
<div class="card-body">
|
||||
<?= formAlert() ?>
|
||||
<form id="groupForm" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="id_group"
|
||||
value="<?= (isset($obj)) ? $obj['id_group'] : set_value('id_group') ?>">
|
||||
<input type="hidden" name="token"
|
||||
value="<?= (isset($obj)) ? $obj['token'] : set_value('token') ?>">
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="title"
|
||||
class="text-dark"><?= lang("App.group_field_title") ?></label>
|
||||
<input type="text" name="title" id="title" class="form-control"
|
||||
value="<?= old('title', $group->title) ?>">
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<?php foreach(getAllClass() as $item): ?>
|
||||
<?php if (empty($item['path'])): ?>
|
||||
<div class="col-md-3 col-lg-2">
|
||||
<h4 class="danger"><?=getDictionary($item['name'])?></h4>
|
||||
<?php foreach($item['methods'] as $subitem): ?>
|
||||
<?php if(!getIgnoreMethod($subitem)): ?>
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" id="<?=$item['name'].'_'.$subitem?>" name="<?=$item['name'].'_'.$subitem?>" class="custom-control-input">
|
||||
<label for="<?=$item['name'].'_'.$subitem?>" class="custom-control-label"><?=getDictionary($subitem)?></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="dashboard"
|
||||
class="text-dark"><?= lang("App.group_field_dashboard") ?></label>
|
||||
<?php $id_select = (isset($group)) ? $group->dashboard : set_value('dashboard'); ?>
|
||||
<select name="dashboard" id="dashboard" class="form-control">
|
||||
<option value="user" <?= $id_select == "user" ? 'selected' : '' ?>><?= lang("App.group_label_user") ?></option>
|
||||
<option value="admin" <?= $id_select == "admin" ? 'selected' : '' ?>><?= lang("App.group_label_admin") ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 right">
|
||||
<div class="form-group">
|
||||
<button type="button" name="select_all" id="select_all"
|
||||
class="btn btn-primary round"><i
|
||||
class="la la-toggle-on"></i> <?= lang("App.group_btn_select") ?>
|
||||
</button>
|
||||
<button type="button" name="remove_all" id="remove_all"
|
||||
class="btn btn-primary round ml-1"><i
|
||||
class="la la-toggle-off"></i> <?= lang("App.group_btn_remove") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5>Role Permissions</h5>
|
||||
<!-- Permission table -->
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush-spacing">
|
||||
<tbody>
|
||||
<!-- <tr>-->
|
||||
<!-- <td class="text-nowrap fw-semibold">-->
|
||||
<!-- Permisos GLobales-->
|
||||
<!-- <i-->
|
||||
<!-- class="ti ti-info-circle"-->
|
||||
<!-- data-bs-toggle="tooltip"-->
|
||||
<!-- data-bs-placement="top"-->
|
||||
<!-- title="Allows a full access to the system"></i>-->
|
||||
<!-- </td>-->
|
||||
<!-- <td>-->
|
||||
<!-- <div class="form-check">-->
|
||||
<!-- <input class="form-check-input" type="checkbox" id="selectAll"/>-->
|
||||
<!-- <label class="form-check-label" for="selectAll"> Seleccionar-->
|
||||
<!-- todos </label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<?php foreach (getAllFolder() as $folder): ?>
|
||||
|
||||
<?php foreach (getAllClass() as $item): ?>
|
||||
<?php if (str_contains($item['path'], $folder)): ?>
|
||||
<tr>
|
||||
<td class="text-nowrap fw-semibold"><?= getDictionary($folder) ?? '' ?> >> <?= getDictionary($item['name']) ?></td>
|
||||
<?php foreach ($item['methods'] as $subitem): ?>
|
||||
<?php if (!getIgnoreMethod($subitem)): ?>
|
||||
<td>
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
id="<?= $item['name'] . '_' . $subitem ?>"
|
||||
name="<?= $item['name'] . '_' . $subitem ?>"
|
||||
class="form-check-input">
|
||||
<label for="<?= $item['name'] . '_' . $subitem ?>"
|
||||
class="form-check-label"><?= getDictionary($subitem) ?></label>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach(getAllFolder() as $folder): ?>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= getDictionary($folder)??'' ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<?php foreach(getAllClass() as $item): ?>
|
||||
<?php if (str_contains($item['path'], $folder)): ?>
|
||||
<div class="col-md-3 col-lg-2">
|
||||
<h4 class="danger"><?=getDictionary($item['name'])?></h4>
|
||||
<?php foreach($item['methods'] as $subitem): ?>
|
||||
<?php if(!getIgnoreMethod($subitem)): ?>
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" id="<?=$item['name'].'_'.$subitem?>" name="<?=$item['name'].'_'.$subitem?>" class="custom-control-input">
|
||||
<label for="<?=$item['name'].'_'.$subitem?>" class="custom-control-label"><?=getDictionary($subitem)?></label>
|
||||
</div>
|
||||
|
||||
<?php foreach (getAllClass() as $item): ?>
|
||||
<?php if (empty($item['path'])): ?>
|
||||
<tr>
|
||||
<td class="text-nowrap fw-semibold"><?= getDictionary($item['name']) ?></td>
|
||||
<?php foreach ($item['methods'] as $subitem): ?>
|
||||
<?php if (!getIgnoreMethod($subitem)): ?>
|
||||
<td>
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
id="<?= $item['name'] . '_' . $subitem ?>"
|
||||
name="<?= $item['name'] . '_' . $subitem ?>"
|
||||
class="form-check-input">
|
||||
<label for="<?= $item['name'] . '_' . $subitem ?>"
|
||||
class="form-check-label"><?= getDictionary($subitem) ?></label>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions mt-2">
|
||||
<?= anchor(route_to("groupIndex"), 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>
|
||||
</form>
|
||||
<div class="form-actions mt-2">
|
||||
<?= anchor(route_to("groupIndex"), 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>
|
||||
</form>
|
||||
|
||||
</div><!-- /.card-body -->
|
||||
|
||||
</div><!-- /.card-body -->
|
||||
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
|
||||
|
||||
$('#select_all').on('click', function () {
|
||||
$(':checkbox').each(function() {
|
||||
$(':checkbox').each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
});
|
||||
});
|
||||
$('#remove_all').on('click', function () {
|
||||
$(':checkbox').each(function() {
|
||||
@ -125,5 +157,4 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,66 +1,82 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $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('Group.grouplist') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<!-- Role cards -->
|
||||
<div class="row g-4">
|
||||
<div class="col-xl-4 col-lg-6 col-md-6">
|
||||
<div class="card h-100">
|
||||
<div class="row h-100">
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex align-items-end h-100 justify-content-center mt-sm-0 mt-3">
|
||||
<img
|
||||
src="<?= site_url('themes/vuexy/img/illustrations/add-new-roles.png') ?>"
|
||||
class="img-fluid mt-sm-4 mt-md-0"
|
||||
alt="add-new-roles"
|
||||
width="83"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="card-body text-sm-end text-center ps-sm-0">
|
||||
<button
|
||||
onclick="window.location='<?= route_to('newGroup') ?>'"
|
||||
class="btn btn-primary mb-2 text-nowrap add-new-role"
|
||||
>
|
||||
<?= lang('Basic.global.addNew') ?>
|
||||
</button>
|
||||
<p class="mb-0 mt-1">Añadir rol si no existe</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Group.grouplist') ?></h3>
|
||||
<?=anchor(route_to('newGroup'), lang('Basic.global.addNew').' '.lang('Group.group'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<?php foreach ($userGroupList as $item) : ?>
|
||||
<div class="col-xl-4 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h6 class="fw-normal mb-2">Total 4 users</h6>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-end mt-1">
|
||||
<div class="role-heading">
|
||||
<h4 class="mb-1"><?= esc($item->title) ?></h4>
|
||||
<a href="<?= route_to('editGroup', $item->id_group) ?>">
|
||||
<span><?= lang('Basic.global.edit') ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?=
|
||||
anchor('#confirm2delete', "<i class='ti ti-trash ti-md'></i>",
|
||||
[
|
||||
'class' => 'text-muted',
|
||||
'data-href' => route_to('deleteGroup', $item->id_group),
|
||||
'data-bs-toggle' => 'modal',
|
||||
'data-bs-target' => '#confirm2delete'
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<!--/ Role cards -->
|
||||
</div>
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfGroups" class="table table-striped table-hover using-data-table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?=lang("Group.id")?></th>
|
||||
<th><?=lang("Group.group_grid_title")?></th>
|
||||
<th><?=lang("Group.group_grid_dashboard")?></th>
|
||||
<th><?= lang('UserGroups.token') ?></th>
|
||||
<th><?= lang('UserGroups.createdAt') ?></th>
|
||||
<th><?= lang('UserGroups.updatedAt') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($userGroupList as $item ) : ?>
|
||||
<tr>
|
||||
<td class="align-middle text-center">
|
||||
<?=$item->id_group ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->title) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->dashboard) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->token) ?>
|
||||
</td>
|
||||
</td>
|
||||
<td class="align-middle text-nowrap">
|
||||
<?= empty($item->created_at) ? '' : date('d/m/Y H:m:s', strtotime($item->created_at)) ?>
|
||||
</td>
|
||||
<td class="align-middle text-nowrap">
|
||||
<?= empty($item->updated_at) ? '' : date('d/m/Y H:m:s', strtotime($item->updated_at)) ?>
|
||||
</td>
|
||||
<td class="align-middle text-center text-nowrap">
|
||||
<?=anchor(route_to('editGroup', $item->id_group), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id_group,]); ?>
|
||||
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deleteGroup', $item->id_group), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
<?= $this->endSection() ?>
|
||||
Reference in New Issue
Block a user