mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en user y groups con el nuevo formato
This commit is contained in:
@ -0,0 +1,111 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?=$this->extend('themes/backend/focus2/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>
|
||||
<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>
|
||||
<?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 endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</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><!-- /.card-body -->
|
||||
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,66 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->extend('themes/backend/focus2/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>
|
||||
<?=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'); ?>
|
||||
|
||||
<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>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
Reference in New Issue
Block a user