añadidos los ficheros de Ozar para maquinas por defecto

This commit is contained in:
Jaime Jimenez
2023-07-10 19:00:45 +02:00
parent a8454a191a
commit 247f4ea485
6 changed files with 448 additions and 0 deletions

View File

@ -0,0 +1,80 @@
<div class="row">
<div class="col-md-12 col-lg-6 px-4">
<div class="mb-3">
<label for="tipo" class="form-label">
<?=lang('MaquinaPorDefectoes.tipo') ?>*
</label>
<select id="tipo" name="tipo" required class="form-control select2bs" style="width: 100%;" >
<option value="" selected="selected"><?=lang('Basic.global.pleaseSelectOne') ?></option>
<option value="bn"<?=$maquinaDefectoEntity->tipo == 'bn' ? ' selected':'' ?>><?= lang('MaquinaPorDefectoes.bn') ?></option>
<option value="bnhq"<?=$maquinaDefectoEntity->tipo == 'bnhq' ? ' selected':'' ?>><?= lang('MaquinaPorDefectoes.bnhq') ?></option>
<option value="color"<?=$maquinaDefectoEntity->tipo == 'color' ? ' selected':'' ?>><?= lang('MaquinaPorDefectoes.color') ?></option>
<option value="portada"<?=$maquinaDefectoEntity->tipo == 'portada' ? ' selected':'' ?>><?= lang('MaquinaPorDefectoes.portada') ?></option>
<option value="cubierta"<?=$maquinaDefectoEntity->tipo == 'cubierta' ? ' selected':'' ?>><?= lang('MaquinaPorDefectoes.cubierta') ?></option>
<option value="rotativa"<?=$maquinaDefectoEntity->tipo == 'rotativa' ? ' selected':'' ?>><?= lang('MaquinaPorDefectoes.rotativa') ?></option>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="anchoMin" class="form-label">
<?=lang('MaquinaPorDefectoes.anchoMin') ?>*
</label>
<input type="number" id="anchoMin" name="ancho_min" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_min', $maquinaDefectoEntity->ancho_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="anchoMax" class="form-label">
<?=lang('MaquinaPorDefectoes.anchoMax') ?>*
</label>
<input type="number" id="anchoMax" name="ancho_max" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_max', $maquinaDefectoEntity->ancho_max) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="altoMin" class="form-label">
<?=lang('MaquinaPorDefectoes.altoMin') ?>*
</label>
<input type="number" id="altoMin" name="alto_min" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_min', $maquinaDefectoEntity->alto_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="altoMax" class="form-label">
<?=lang('MaquinaPorDefectoes.altoMax') ?>*
</label>
<input type="number" id="altoMax" name="alto_max" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_max', $maquinaDefectoEntity->alto_max) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="tiradaMin" class="form-label">
<?=lang('MaquinaPorDefectoes.tiradaMin') ?>*
</label>
<input type="number" id="tiradaMin" name="tirada_min" required placeholder="1" maxLength="11" class="form-control" value="<?=old('tirada_min', $maquinaDefectoEntity->tirada_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="tiradaMax" class="form-label">
<?=lang('MaquinaPorDefectoes.tiradaMax') ?>*
</label>
<input type="number" id="tiradaMax" name="tirada_max" required placeholder="10000" maxLength="11" class="form-control" value="<?=old('tirada_max', $maquinaDefectoEntity->tirada_max) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
<div class="col-md-12 col-lg-6 px-4">
<div class="mb-3">
<label for="maquinaId" class="form-label">
<?=lang('MaquinaPorDefectoes.maquinaId') ?>*
</label>
<select id="maquinaId" name="maquina_id" required class="form-control select2bs2" style="width: 100%;" >
<?php if ( isset($maquinaList) && is_array($maquinaList) && !empty($maquinaList) ) :
foreach ($maquinaList as $k => $v) : ?>
<option value="<?=$k ?>"<?=$k==$maquinaDefectoEntity->maquina_id ? ' selected':'' ?>>
<?=$v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -0,0 +1,64 @@
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
<?= $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="maquinaPorDefectoForm" 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/maquinas/_maquinaPorDefectoFormItems") ?>
</div><!-- /.card-body -->
<div class="card-footer">
<?= anchor(route_to("maquinaPorDefectoList2"), 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") ?>
$('#maquinaId').select2({
theme: 'bootstrap-5',
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfMaquinas") ?>',
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,138 @@
<?=$this->include('Themes/_commonPartialsBs/select2bs5') ?>
<?=$this->include('Themes/_commonPartialsBs/datatables') ?>
<?=$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('MaquinaPorDefectoes.maquinaPorDefectoList') ?></h3>
</div><!--//.card-header -->
<div class="card-body">
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfMaquinaspordefecto" 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('MaquinaPorDefectoes.id') ?></th>
<th><?= lang('MaquinaPorDefectoes.tipo') ?></th>
<th><?= lang('MaquinaPorDefectoes.anchoMin') ?></th>
<th><?= lang('MaquinaPorDefectoes.anchoMax') ?></th>
<th><?= lang('MaquinaPorDefectoes.altoMin') ?></th>
<th><?= lang('MaquinaPorDefectoes.altoMax') ?></th>
<th><?= lang('MaquinaPorDefectoes.tiradaMin') ?></th>
<th><?= lang('MaquinaPorDefectoes.tiradaMax') ?></th>
<th><?= lang('Maquinas.maquina') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($maquinaPorDefectoList as $item ) : ?>
<tr>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editMaquinaPorDefecto', $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('deleteMaquinaPorDefecto', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>
</td>
<td class="align-middle text-center">
<?=$item->id ?>
</td>
<td class="align-middle">
<?= esc($item->tipo) ?>
</td>
<td class="align-middle">
<?= esc($item->ancho_min) ?>
</td>
<td class="align-middle">
<?= esc($item->ancho_max) ?>
</td>
<td class="align-middle">
<?= esc($item->alto_min) ?>
</td>
<td class="align-middle">
<?= esc($item->alto_max) ?>
</td>
<td class="align-middle">
<?= esc($item->tirada_min) ?>
</td>
<td class="align-middle">
<?= esc($item->tirada_max) ?>
</td>
<td class="align-middle">
<?= esc($item->maquina) ?>
</td>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editMaquinaPorDefecto', $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('deleteMaquinaPorDefecto', $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('newMaquinaPorDefecto'), lang('Basic.global.addNew').' '.lang('MaquinaPorDefectoes.maquinaPorDefecto'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$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() ?>
<?=$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]
}
]
});
<?=$this->endSection() ?>