templates/equipo/show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block stylesheets %}
  3.     <style>
  4.         fieldset {
  5.             border: 1px solid #bbbbbb !important;
  6.             margin: 0;
  7.             min-width: 0;
  8.             padding: 10px;
  9.             position: relative;
  10.             border-radius: 4px;
  11.             background-color: #f5f5f5;
  12.         }
  13.         legend {
  14.             font-size: 15px;
  15.             font-weight: bold;
  16.             margin-bottom: 0;
  17.             width: 35%;
  18.             border: 1px solid #bbbbbb;
  19.             border-radius: 4px;
  20.             padding: 5px 5px 5px 10px;
  21.             background-color: #cecece;
  22.         }
  23.         label {
  24.             font-size: 14px;
  25.             color: #5C5A5A;
  26.         }
  27.         .btn-margin-right {
  28.             margin-right: 10px; /* Ajusta el valor según tus necesidades */
  29.         }
  30.         .hidden {
  31.             display: none;
  32.         }
  33.         .refacciones-background {
  34.             background-color: #d4edda; /* Verde claro */
  35.             padding: 10px;
  36.             border-radius: 4px;
  37.         }
  38.     </style>
  39. {% endblock %}
  40. {% block body %}
  41.     <div class="content-wrapper">
  42.         <!-- Content Header (Page header) -->
  43.         <section class="content-header">
  44.             <div class="card">
  45.                 <div class="card-header">
  46.                     <h1 class="card-title">Visualización del Equipo de Cómputo</h1>
  47.                     <div class="card-tools">
  48.                         <ol class="breadcrumb float-sm-right">
  49.                             <li class="breadcrumb-item">Inicio</li>
  50.                             <li class="breadcrumb-item active">Equipo</li>
  51.                         </ol>
  52.                     </div>
  53.                 </div>
  54.             </div>
  55.         </section>
  56.         <!-- Main content -->
  57.         <section class="content">
  58.             <div class="row justify-content-center">
  59.                 <div class="col-10">
  60.                     <!-- Default box -->
  61.                     <div class="card">
  62.                         <div class="card-header">
  63.                             <div class="row">
  64.                                 <div class="col text-right">
  65.                                     <!-- Contenedor adicional para los botones -->
  66.                                     <div class="btn-group" role="group" aria-label="Botones de acción">
  67.                                         <a href="{{ path('app_equipo_index') }}" class="btn btn-outline-primary btn-margin-right">
  68.                                             Regresar
  69.                                         </a>
  70.                                         <!-- Formulario para la descarga del archivo Excel -->
  71.                                         <form action="{{ path('app_equipo_download_excel', { id: equipo.idEqu }) }}" method="get" style="display: inline;">
  72.                                             <button type="submit" class="btn btn-primary btn-margin-right"><i class="fas fa-file-excel"></i>
  73.                                                 Descargar Refacciones en Excel
  74.                                             </button>
  75.                                         </form>
  76.                                         <button type="button" class="btn btn-outline-info" id="toggleRefaccionesBtn"><i class="fas fa-solid fa-business-time"></i>
  77.                                             Ver Refacciones
  78.                                         </button>
  79.                                     </div>
  80.                                 </div>
  81.                             </div>
  82.                         </div>
  83.                         <div class="card-body">
  84.                             <!-- Aquí va el contenido de tu equipo como antes -->
  85.                             <fieldset>
  86.                                 <legend>Datos del equipo</legend>
  87.                                 <table class="table table-striped">
  88.                                     <tr>
  89.                                         <th>Marbete:</th>
  90.                                         <td>{{ equipo.marbete }}</td>
  91.                                         <th>Marca:</th>
  92.                                         <td>{{ equipo.marca }}</td>
  93.                                         <th>Modelo:</th>
  94.                                         <td>{{ equipo.modelo }}</td>
  95.                                     </tr>
  96.                                     <tr>
  97.                                         <th>No. serie:</th>
  98.                                         <td>{{ equipo.serie }}</td>
  99.                                         <th>Descripción:</th>
  100.                                         <td colspan="5">{{ equipo.descripcion }}</td>
  101.                                     </tr>
  102.                                 </table>
  103.                             </fieldset>
  104.                             <br>
  105.                             <!-- Sección de refacciones, inicialmente oculta -->
  106.                             <div id="refaccionesSection" class="hidden refacciones-background">
  107.                                 <br>
  108.                                 <fieldset>
  109.                                     <legend>Refacciones</legend>
  110.                                     <table id="refaccionesTable" class="table table-bordered">
  111.                                         <thead>
  112.                                         <tr>
  113.                                             <th>ID Mov</th>
  114.                                             <th>Fecha Movimiento</th>
  115.                                             <th>Tipo Equipo</th>
  116.                                             <th>Componente</th>
  117.                                             <th>Observación</th>
  118.                                             <th>Núcleos</th>
  119.                                             <th>Velocidad</th>
  120.                                             <th>Capacidad Memoria</th>
  121.                                             <th>Unidad</th>
  122.                                             <th>Usuario</th>
  123.                                         </tr>
  124.                                         </thead>
  125.                                         <tbody>
  126.                                         {% for bitacora in bitacoras %}
  127.                                             <tr>
  128.                                                 <td>{{ bitacora.idMov }}</td>
  129.                                                 <td>{{ bitacora.fechaMov ? bitacora.fechaMov|date('Y-m-d H:i:s') : '' }}</td>
  130.                                                 <td>{{ bitacora.tipoEquipo }}</td>
  131.                                                 <td>{{ bitacora.idComponente ? bitacora.idComponente.tipo : 'N/A' }}</td>
  132.                                                 <td>{{ bitacora.observacion }}</td>
  133.                                                 <td>{{ bitacora.nucleos }}</td>
  134.                                                 <td>{{ bitacora.velocidad }}</td>
  135.                                                 <td>{{ bitacora.capacidadMemoria }}</td>
  136.                                                 <td>{{ bitacora.idUni ? bitacora.idUni.nombre : 'N/A' }}</td>
  137.                                                 <td>{{ bitacora.idUsu ? bitacora.idUsu.nombre : 'N/A' }}</td>
  138.                                             </tr>
  139.                                         {% else %}
  140.                                             <tr>
  141.                                                 <td colspan="10">No hay bitácoras disponibles.</td>
  142.                                             </tr>
  143.                                         {% endfor %}
  144.                                         </tbody>
  145.                                     </table>
  146.                                 </fieldset>
  147.                             </div>
  148.                             <br>
  149.                             <fieldset>
  150.                                 <legend>Datos del hardware</legend>
  151.                                 <table class="table table-striped">
  152.                                     <tbody>
  153.                                     <tr>
  154.                                         <th>Procesador:</th>
  155.                                         <td>{{ equipo.procesador }}</td>
  156.                                         <th>Núcleos:</th>
  157.                                         <td>{{ equipo.nucleos }}</td>
  158.                                         <th>Velocidad CPU:</th>
  159.                                         <td>{{ equipo.cpuVelocidad }}</td>
  160.                                         <th>RAM:</th>
  161.                                         <td>{{ equipo.ram }}</td>
  162.                                     </tr>
  163.                                     <tr>
  164.                                         <th>SSD:</th>
  165.                                         <td colspan="2">{{ equipo.ssd }}</td>
  166.                                         <th>HDD:</th>
  167.                                         <td colspan="4">{{ equipo.hhd }}</td>
  168.                                     </tr>
  169.                                     </tbody>
  170.                                 </table>
  171.                             </fieldset>
  172.                             <br>
  173.                             <fieldset>
  174.                                 <legend>Datos del monitor</legend>
  175.                                 <table class="table table-striped">
  176.                                     <tbody>
  177.                                     <tr>
  178.                                         <th>Marbete:</th>
  179.                                         <td>{{ equipo.monitorMarbete }}</td>
  180.                                         <th>Marca:</th>
  181.                                         <td>{{ equipo.monitorMarca }}</td>
  182.                                         <th>Modelo:</th>
  183.                                         <td>{{ equipo.monitorModelo }}</td>
  184.                                     </tr>
  185.                                     <tr>
  186.                                         <th>No. Serie:</th>
  187.                                         <td>{{ equipo.monitorSerie }}</td>
  188.                                         <th>Tipo:</th>
  189.                                         <td>{{ equipo.monitorTipo }}</td>
  190.                                         <th>Pulgadas:</th>
  191.                                         <td>{{ equipo.monitorPulgadas }}</td>
  192.                                     </tr>
  193.                                     </tbody>
  194.                                 </table>
  195.                             </fieldset>
  196.                             <br>
  197.                             <fieldset>
  198.                                 <legend>Datos del teclado</legend>
  199.                                 <table class="table table-striped">
  200.                                     <tbody>
  201.                                     <tr>
  202.                                         <th>Marca:</th>
  203.                                         <td>{{ equipo.tecladoMarca }}</td>
  204.                                         <th>Modelo:</th>
  205.                                         <td>{{ equipo.tecladoModelo }}</td>
  206.                                         <th>No. Serie:</th>
  207.                                         <td>{{ equipo.tecladoSerie }}</td>
  208.                                     </tr>
  209.                                     </tbody>
  210.                                 </table>
  211.                             </fieldset>
  212.                             <br>
  213.                             <fieldset>
  214.                                 <legend>Datos del mouse</legend>
  215.                                 <table class="table table-striped">
  216.                                     <tbody>
  217.                                     <tr>
  218.                                         <th>Marca:</th>
  219.                                         <td>{{ equipo.mouseMarca }}</td>
  220.                                         <th>Modelo:</th>
  221.                                         <td>{{ equipo.mouseModelo }}</td>
  222.                                         <th>Serie:</th>
  223.                                         <td>{{ equipo.mouseSerie }}</td>
  224.                                     </tr>
  225.                                     </tbody>
  226.                                 </table>
  227.                             </fieldset>
  228.                             <br>
  229.                             <fieldset>
  230.                                 <legend>Estatus y resguardo</legend>
  231.                                 <table class="table table-striped">
  232.                                     <tbody>
  233.                                     <tr>
  234.                                         <th>Estatus:</th>
  235.                                         <td colspan="2">
  236.                                             {% if equipo.estatus == 2 %}
  237.                                                 <span>Descompuesto</span>
  238.                                             {% elseif equipo.estatus == 1 %}
  239.                                                 <span>En operación</span>
  240.                                             {% elseif equipo.estatus == 3 %}
  241.                                                 <span>Sin instalar</span>
  242.                                             {% elseif equipo.estatus == 4 %}
  243.                                                 <span>En proceso de baja</span>
  244.                                             {% elseif equipo.estatus == 5 %}
  245.                                                 <span>Baja</span>
  246.                                             {% endif %}
  247.                                         </td>
  248.                                         <th>Uso:</th>
  249.                                         <td colspan="2">
  250.                                             {% if equipo.uso == 0 %}
  251.                                                 <span class="">Docente</span>
  252.                                             {% elseif equipo.uso == 1 %}
  253.                                                 <span class="">Educativo</span>
  254.                                             {% elseif equipo.uso == 2 %}
  255.                                                 <span class="">Administrativo</span>
  256.                                             {% endif %}
  257.                                         </td>
  258.                                     </tr>
  259.                                     <tr>
  260.                                         <th>Función:</th>
  261.                                         <td>
  262.                                             {% if equipo.funcion == 1 %}
  263.                                                 <span class="">Escritorio</span>
  264.                                             {% elseif equipo.funcion == 2 %}
  265.                                                 <span class="">Servidor</span>
  266.                                             {% endif %}
  267.                                         </td>
  268.                                         <th>Descripción de la función:</th>
  269.                                         <td colspan="4">{{ equipo.funcionDescripcion }}</td>
  270.                                     </tr>
  271.                                     <tr>
  272.                                         <th>Resguardatario:</th>
  273.                                         <td colspan="5">{% if equipo.usuario is defined %}{{ equipo.usuario }}{% endif %} {% if equipo.usuario.papellido is defined %}{{ equipo.usuario.papellido }}{% endif %} {% if equipo.usuario.sapellido is defined %}{{ equipo.usuario.sapellido }}{% endif %}</td>
  274.                                         <th>EMHV:</th>
  275.                                         <td>{% if equipo.emhv == 1 %}
  276.                                                 <span>Cumple</span>
  277.                                             {% elseif equipo.emhv == 0 %}
  278.                                                 <span>No Cumple</span>
  279.                                             {% endif %}</td>
  280.                                         <th>Ubicación:</th>
  281.                                         <td colspan="3">{{ equipo.ubicacion }}</td>
  282.                                     </tr>
  283.                                     </tbody>
  284.                                 </table>
  285.                             </fieldset>
  286.                             <br>
  287.                             <fieldset>
  288.                                 <legend>Fechas de modificación</legend>
  289.                                 <table class="table table-striped">
  290.                                     <tbody>
  291.                                     <tr>
  292.                                         <th>Fecha de alta:</th>
  293.                                         <td>{{ equipo.falta ? equipo.falta|date('d-m-Y H:i:s') : '' }}</td>
  294.                                         <th>Fecha de actualización:</th>
  295.                                         <td>{{ equipo.factualizacion ? equipo.factualizacion|date('d-m-Y H:i:s') : '' }}</td>
  296.                                     </tr>
  297.                                     </tbody>
  298.                                 </table>
  299.                             </fieldset>
  300.                         </div>
  301.                     </div>
  302.                     <!-- /.card -->
  303.                 </div>
  304.             </div>
  305.         </section>
  306.         <!-- /.content -->
  307.     </div>
  308. {% endblock %}
  309. {% block javascripts %}
  310.     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  311.     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
  312.     <script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script>
  313.     <script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
  314.     <script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
  315.     <script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
  316.     <script src="{{ asset('plugins/datatables-buttons/js/dataTables.buttons.min.js') }}"></script>
  317.     <script src="{{ asset('plugins/datatables-buttons/js/buttons.bootstrap4.min.js') }}"></script>
  318.     <script src="{{ asset('plugins/jszip/jszip.min.js') }}"></script>
  319.     <script src="{{ asset('plugins/pdfmake/pdfmake.min.js') }}"></script>
  320.     <script src="{{ asset('plugins/pdfmake/vfs_fonts.js') }}"></script>
  321.     <script src="{{ asset('plugins/datatables-buttons/js/buttons.html5.min.js') }}"></script>
  322.     <script src="{{ asset('plugins/datatables-buttons/js/buttons.print.min.js') }}"></script>
  323.     <script src="{{ asset('plugins/datatables-buttons/js/buttons.colVis.min.js') }}"></script>
  324.     <script src="{{ asset('plugins/toastr/toastr.min.js') }}"></script>
  325.     <script>
  326.         $(document).ready(function() {
  327.             $('#toggleRefaccionesBtn').on('click', function() {
  328.                 $('#refaccionesSection').toggleClass('hidden');
  329.             });
  330.             $('#refaccionesTable').DataTable({
  331.                 "paging": true,
  332.                 "lengthChange": true,
  333.                 "searching": true,
  334.                 "ordering": true,
  335.                 "info": true,
  336.                 "autoWidth": false,
  337.                 "responsive": true,
  338.                 "language": {
  339.                     "url": "//cdn.datatables.net/plug-ins/1.11.3/i18n/es_es.json"
  340.                 }
  341.             });
  342.         });
  343.     </script>
  344. {% endblock %}