Browse Source

cambios de vista

ya usuarios,marcas y prestamos funciona correctamente cree el apartado de prestamos con diferentes secciones el de crear un nuevo prestamo ya funciona los botones exel y pdf en los 3 apartados funcionan y se ven bonitos
main
sergiomarquez778 6 days ago
parent
commit
d87f3e9975
  1. 12
      app/Exports/MarcasExport.php
  2. 33
      app/Exports/PrestamosExport.php
  3. 16
      app/Exports/UsuariosExport.php
  4. 14
      app/Http/Controllers/TiposLicenciasController.php
  5. 3
      composer.json
  6. 595
      composer.lock
  7. 42
      resources/views/exports/marcas-pdf.blade.php
  8. 76
      resources/views/exports/prestamos-pdf.blade.php
  9. 8
      resources/views/marcas.blade.php
  10. 106
      resources/views/prestamos.blade.php
  11. 130
      resources/views/prestamosCrearEditar.blade.php
  12. 46
      resources/views/usuarios.blade.php
  13. 86
      resources/views/usuariosCrearEditar.blade.php
  14. 17
      routes/web.php

12
app/Exports/MarcasExport.php

@ -7,7 +7,6 @@ use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
class MarcasExport implements FromCollection, WithHeadings
{
/**
* Método que devuelve la colección de datos a exportar.
@ -16,9 +15,7 @@ class MarcasExport implements FromCollection, WithHeadings
*/
public function collection()
{
return Marca::where('eliminado', 0) // Solo marcas activas
->select('id', 'marca') // Selecciona los campos que deseas exportar
->get();
return Marca::where('eliminado', 0)->get();
}
/**
@ -29,8 +26,11 @@ class MarcasExport implements FromCollection, WithHeadings
public function headings(): array
{
return [
'ID', // Encabezado para la columna ID
'Marca', // Encabezado para la columna Marca
'ID',
'Marca',
'Estado',
'Fecha de Creación',
'Última Actualización'
];
}
}

33
app/Exports/PrestamosExport.php

@ -0,0 +1,33 @@
<?php
namespace App\Exports;
use App\Models\Prestamo;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
class PrestamosExport implements FromCollection, WithHeadings
{
public function collection()
{
return Prestamo::where('eliminado', 0)->get();
}
public function headings(): array
{
return [
'ID',
'Nombre Solicitante',
'Destino',
'Fecha y Hora Salida',
'Fecha y Hora Llegada',
'Motivo',
'Domicilio',
'Número de Personas',
'Chofer',
'Estado',
'Fecha de Creación',
'Última Actualización'
];
}
}

16
app/Exports/UsuariosExport.php

@ -10,15 +10,23 @@ class UsuariosExport implements FromCollection, WithHeadings
{
public function collection()
{
return User::select('id', 'name', 'email')->get();
return User::select( 'name', 'email','apellido',
'puesto',
'carrera',
'telefono',)->get();
}
public function headings(): array
{
return [
'ID',
'Nombre',
'Email'
'nombre',
'correo',
'apellido',
'puesto',
'carrera',
'telefono',
'Fecha de Creación',
'Última Actualización'
];
}
}

14
app/Http/Controllers/TiposLicenciasController.php

@ -4,11 +4,9 @@ namespace App\Http\Controllers;
use App\Models\tiposLicencias;
use App\Exports\TiposLicenciasExport;
use PDF;
use Excel;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use PDF;
class TiposLicenciasController extends Controller
{
/**
@ -107,13 +105,13 @@ class TiposLicenciasController extends Controller
public function exportExcel()
{
return Excel::download(new tiposLicenciasExport(), 'tiposLicencias.xlsx');
return Excel::download(new TiposLicenciasExport(), 'tiposLicencias.xlsx');
}
public function exportPDF()
{
$marcas = tiposLicencias::where('eliminado', 0)->get();
$pdf = PDF::loadView('exports.tiposlicencias-pdf', ['tiposlicencias' => $marcas]);
return $pdf->download('tiposlicencias.pdf');
$tiposLicencias = TiposLicencias::where('eliminado', 0)->get();
$pdf = PDF::loadView('exports.tiposlicencias-pdf', ['tiposLicencias' => $tiposLicencias]);
return $pdf->download('tiposLicencias.pdf');
}
}

3
composer.json

@ -11,7 +11,8 @@
"laravel/framework": "^10.0",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.6"
"laravel/ui": "^4.6",
"maatwebsite/excel": "^3.1"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",

595
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c6ed296b7f7a718cbed7be50543dfa5b",
"content-hash": "fe2612b7b0bc8d9bd48499fcb0b1cc71",
"packages": [
{
"name": "barryvdh/laravel-dompdf",
@ -212,6 +212,166 @@
],
"time": "2023-12-11T17:09:12+00:00"
},
{
"name": "composer/pcre",
"version": "3.3.2",
"source": {
"type": "git",
"url": "https://github.com/composer/pcre.git",
"reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
"reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0"
},
"conflict": {
"phpstan/phpstan": "<1.11.10"
},
"require-dev": {
"phpstan/phpstan": "^1.12 || ^2",
"phpstan/phpstan-strict-rules": "^1 || ^2",
"phpunit/phpunit": "^8 || ^9"
},
"type": "library",
"extra": {
"phpstan": {
"includes": [
"extension.neon"
]
},
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Pcre\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "PCRE wrapping library that offers type-safe preg_* replacements.",
"keywords": [
"PCRE",
"preg",
"regex",
"regular expression"
],
"support": {
"issues": "https://github.com/composer/pcre/issues",
"source": "https://github.com/composer/pcre/tree/3.3.2"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2024-11-12T16:29:46+00:00"
},
{
"name": "composer/semver",
"version": "3.4.3",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
"reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
"reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"symfony/phpunit-bridge": "^3 || ^7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Semver\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
"homepage": "http://www.naderman.de"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
},
{
"name": "Rob Bast",
"email": "rob.bast@gmail.com",
"homepage": "http://robbast.nl"
}
],
"description": "Semver library that offers utilities, version constraint parsing and validation.",
"keywords": [
"semantic",
"semver",
"validation",
"versioning"
],
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
"source": "https://github.com/composer/semver/tree/3.4.3"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2024-09-19T14:15:21+00:00"
},
{
"name": "dflydev/dot-access-data",
"version": "v3.0.3",
@ -742,6 +902,67 @@
],
"time": "2025-03-06T22:45:56+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.18.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "cb56001e54359df7ae76dc522d08845dc741621b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/cb56001e54359df7ae76dc522d08845dc741621b",
"reference": "cb56001e54359df7ae76dc522d08845dc741621b",
"shasum": ""
},
"require": {
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
"simpletest/simpletest": "dev-master"
},
"suggest": {
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
"ext-bcmath": "Used for unit conversion and imagecrash protection",
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
"ext-tidy": "Used for pretty-printing HTML"
},
"type": "library",
"autoload": {
"files": [
"library/HTMLPurifier.composer.php"
],
"psr-0": {
"HTMLPurifier": "library/"
},
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"support": {
"issues": "https://github.com/ezyang/htmlpurifier/issues",
"source": "https://github.com/ezyang/htmlpurifier/tree/v4.18.0"
},
"time": "2024-11-01T03:51:45+00:00"
},
{
"name": "fruitcake/php-cors",
"version": "v1.3.0",
@ -2184,6 +2405,272 @@
],
"time": "2024-09-21T08:32:55+00:00"
},
{
"name": "maatwebsite/excel",
"version": "3.1.64",
"source": {
"type": "git",
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
"reference": "e25d44a2d91da9179cd2d7fec952313548597a79"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/e25d44a2d91da9179cd2d7fec952313548597a79",
"reference": "e25d44a2d91da9179cd2d7fec952313548597a79",
"shasum": ""
},
"require": {
"composer/semver": "^3.3",
"ext-json": "*",
"illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0",
"php": "^7.0||^8.0",
"phpoffice/phpspreadsheet": "^1.29.9",
"psr/simple-cache": "^1.0||^2.0||^3.0"
},
"require-dev": {
"laravel/scout": "^7.0||^8.0||^9.0||^10.0",
"orchestra/testbench": "^6.0||^7.0||^8.0||^9.0||^10.0",
"predis/predis": "^1.1"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
},
"providers": [
"Maatwebsite\\Excel\\ExcelServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Maatwebsite\\Excel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Patrick Brouwers",
"email": "patrick@spartner.nl"
}
],
"description": "Supercharged Excel exports and imports in Laravel",
"keywords": [
"PHPExcel",
"batch",
"csv",
"excel",
"export",
"import",
"laravel",
"php",
"phpspreadsheet"
],
"support": {
"issues": "https://github.com/SpartnerNL/Laravel-Excel/issues",
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.64"
},
"funding": [
{
"url": "https://laravel-excel.com/commercial-support",
"type": "custom"
},
{
"url": "https://github.com/patrickbrouwers",
"type": "github"
}
],
"time": "2025-02-24T11:12:50+00:00"
},
{
"name": "maennchen/zipstream-php",
"version": "3.1.2",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/aeadcf5c412332eb426c0f9b4485f6accba2a99f",
"reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
"php-64bit": "^8.2"
},
"require-dev": {
"brianium/paratest": "^7.7",
"ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.16",
"guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.5",
"phpunit/phpunit": "^11.0",
"vimeo/psalm": "^6.0"
},
"suggest": {
"guzzlehttp/psr7": "^2.4",
"psr/http-message": "^2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"ZipStream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Duncan",
"email": "pabs@pablotron.org"
},
{
"name": "Jonatan Männchen",
"email": "jonatan@maennchen.ch"
},
{
"name": "Jesse Donat",
"email": "donatj@gmail.com"
},
{
"name": "András Kolesár",
"email": "kolesar@kolesar.hu"
}
],
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
"keywords": [
"stream",
"zip"
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.2"
},
"funding": [
{
"url": "https://github.com/maennchen",
"type": "github"
}
],
"time": "2025-01-27T12:07:53+00:00"
},
{
"name": "markbaker/complex",
"version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
"source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
},
"time": "2022-12-06T16:21:08+00:00"
},
{
"name": "markbaker/matrix",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@demon-angel.eu"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
"source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
},
"time": "2022-12-02T22:17:43+00:00"
},
{
"name": "masterminds/html5",
"version": "2.9.0",
@ -2752,6 +3239,112 @@
],
"time": "2024-11-21T10:36:35+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.29.10",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "c80041b1628c4f18030407134fe88303661d4e4e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/c80041b1628c4f18030407134fe88303661d4e4e",
"reference": "c80041b1628c4f18030407134fe88303661d4e4e",
"shasum": ""
},
"require": {
"composer/pcre": "^1||^2||^3",
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"ezyang/htmlpurifier": "^4.15",
"maennchen/zipstream-php": "^2.1 || ^3.0",
"markbaker/complex": "^3.0",
"markbaker/matrix": "^3.0",
"php": "^7.4 || ^8.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^1.0 || ^2.0 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "^10.3",
"mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"ext-intl": "PHP Internationalization Functions",
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
},
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.10"
},
"time": "2025-02-08T02:56:14+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.9.3",

42
resources/views/exports/marcas-pdf.blade.php

@ -3,10 +3,14 @@
<head>
<title>Lista de Marcas</title>
<style>
body {
font-family: Arial, sans-serif;
font-size: 12px;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
margin-top: 20px;
}
th, td {
border: 1px solid #ddd;
@ -16,29 +20,51 @@
th {
background-color: #f2f2f2;
}
h2 {
color: #333;
h1 {
text-align: center;
margin-bottom: 20px;
}
.header {
margin-bottom: 20px;
}
.footer {
margin-top: 20px;
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<h2>Lista de Marcas</h2>
<div class="header">
<h1>Lista de Marcas</h1>
<p>Fecha de generación: {{ date('d/m/Y H:i:s') }}</p>
</div>
<table>
<thead>
<tr>
<th>ID</th>
<th>Marca</th>
<th>Estado</th>
<th>Fecha de Creación</th>
<th>Última Actualización</th>
</tr>
</thead>
<tbody>
@foreach($marcas as $marca)
<tr>
<td>{{ $marca->id }}</td>
<td>{{ $marca->marca }}</td>
</tr>
<tr>
<td>{{ $marca->id }}</td>
<td>{{ $marca->marca }}</td>
<td>{{ $marca->eliminado == 0 ? 'Activo' : 'Inactivo' }}</td>
<td>{{ $marca->created_at->format('d/m/Y H:i:s') }}</td>
<td>{{ $marca->updated_at->format('d/m/Y H:i:s') }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
<p>Página {{ $loop->iteration }} de {{ $loop->count }}</p>
</div>
</body>
</html>

76
resources/views/exports/prestamos-pdf.blade.php

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<title>Lista de Préstamos</title>
<style>
body {
font-family: Arial, sans-serif;
font-size: 12px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
h1 {
text-align: center;
margin-bottom: 20px;
}
.header {
margin-bottom: 20px;
}
.footer {
margin-top: 20px;
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<div class="header">
<h1>Lista de Préstamos</h1>
<p>Fecha de generación: {{ date('d/m/Y H:i:s') }}</p>
</div>
<table>
<thead>
<tr>
<th>ID</th>
<th>Solicitante</th>
<th>Destino</th>
<th>Salida</th>
<th>Llegada</th>
<th>Motivo</th>
<th>Domicilio</th>
<th>Personas</th>
<th>Chofer</th>
<th>Estado</th>
</tr>
</thead>
<tbody>
@foreach($prestamos as $prestamo)
<tr>
<td>{{ $prestamo->id }}</td>
<td>{{ $prestamo->nombre_solicitante }}</td>
<td>{{ $prestamo->destino }}</td>
<td>{{ $prestamo->fecha_hora_salida }}</td>
<td>{{ $prestamo->fecha_hora_llegada }}</td>
<td>{{ $prestamo->motivo }}</td>
<td>{{ $prestamo->domicilio }}</td>
<td>{{ $prestamo->numero_personas }}</td>
<td>{{ $prestamo->chofer ? 'Sí' : 'No' }}</td>
<td>{{ $prestamo->eliminado == 0 ? 'Activo' : 'Inactivo' }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

8
resources/views/marcas.blade.php

@ -91,12 +91,12 @@
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
@if($marca->eliminado == 0)
<span class="flex items-center">
<span class="h-2 w-2 bg-green-500 rounded-full mr-2"></span> Activo
</span>
<span class="inline-flex items-center px-2 py-1 text-xs font-semibold text-green-800 bg-green-100 rounded-full">
<span class="fas fa-check-circle mr-1"></span> Activo
</span>
@else
<span class="flex items-center">
<span class="h-2 w-2 bg-red-500 rounded-full mr-2"></span> Inactivo
<span class="fas fa-check-circle mr-1"></span> Inactivo
</span>
@endif
</td>

106
resources/views/prestamos.blade.php

@ -20,12 +20,30 @@
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
<h2 class="text-2xl font-bold">Gestión de Préstamos</h2>
<div class="flex items-center space-x-6">
<!-- Agregar nuevo préstamo -->
<a href="{{ route('prestamos.create') }}"
class="text-blue-500 hover:text-blue-600 transition-colors duration-200"
title="Agregar nuevo préstamo">
<!-- Íconos de exportación -->
<div class="flex space-x-4">
<!-- Exportar a Excel -->
<a href="{{ route('prestamos.excel') }}"
class="text-green-600 hover:text-green-700 transition-colors duration-200"
title="Exportar a Excel">
<i class="fas fa-file-excel text-xl"></i>
</a>
<!-- Exportar a PDF -->
<a href="{{ route('prestamos.pdf') }}"
class="text-red-600 hover:text-red-700 transition-colors duration-200"
title="Exportar a PDF">
<i class="fas fa-file-pdf text-xl"></i>
</a>
<!-- Agregar nuevo préstamo -->
<a href="{{ route('prestamos.create') }}"
class="text-blue-500 hover:text-blue-600 transition-colors duration-200"
title="Agregar nuevo préstamo">
<i class="fas fa-plus text-xl"></i>
</a>
</div>
</div>
</div>
@ -65,7 +83,7 @@
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fecha y Hora Llegada</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Motivo</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Domicilio</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Numero de personas</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Número de Personas</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Chofer</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th>
@ -74,24 +92,69 @@
<tbody class="bg-white divide-y divide-gray-200">
@foreach($prestamos as $prestamo)
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $prestamo->id }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $prestamo->nombre_solicitante }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $prestamo->destino }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $prestamo->fecha_hora_salida }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $prestamo->fecha_hora_llegada }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $prestamo->motivo }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $prestamo->domicilio }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $prestamo->numero_perosonas}}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $prestamo->cofer }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="font-medium">#{{ $prestamo->id }}</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex items-center">
<i class="fas fa-user text-blue-500 mr-2"></i>
{{ $prestamo->nombre_solicitante }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex items-center">
<i class="fas fa-map-marker-alt text-red-500 mr-2"></i>
{{ $prestamo->destino }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex items-center">
<i class="fas fa-truck text-green-500 mr-2"></i>
{{ $prestamo->fecha_hora_salida }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex items-center">
<i class="fas fa-truck text-yellow-500 mr-2"></i>
{{ $prestamo->fecha_hora_llegada }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex items-center">
<i class="fas fa-info-circle text-purple-500 mr-2"></i>
{{ $prestamo->motivo }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex items-center">
<i class="fas fa-home text-indigo-500 mr-2"></i>
{{ $prestamo->domicilio }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex items-center">
<i class="fas fa-users text-blue-500 mr-2"></i>
{{ $prestamo->numero_personas }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex items-center">
<i class="fas fa-id-card text-gray-500 mr-2"></i>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full {{ $prestamo->chofer ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800' }}">
{{ $prestamo->chofer ? 'Sí' : 'No' }}
</span>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<span class="inline-flex items-center px-2 py-1 text-xs font-semibold text-green-800 bg-green-100 rounded-full">
<i class="fas fa-check-circle mr-1"></i> Activo
</span>
</td>
<td class="flex space-x-2 px-6 py-4 whitespace-nowrap text-sm">
<a href="{{ route('prestamos.edit', $prestamo->id) }}"
class="text-yellow-600 hover:text-yellow-700 transition-colors duration-200"
title="Editar préstamo">
<i class="fas fa-edit"></i>
<i class="fas fa-pencil-alt"></i>
</a>
<form action="{{ route('prestamos.destroy', $prestamo->id) }}" method="POST" class="d-inline">
@csrf
@ -99,7 +162,7 @@
<a href="#" onclick="event.preventDefault(); this.closest('form').submit();"
class="text-red-600 hover:text-red-700 transition-colors duration-200"
title="Eliminar préstamo">
<i class="fas fa-trash"></i>
<i class="fas fa-trash-alt"></i>
</a>
</form>
</td>
@ -125,6 +188,3 @@
}, 3000);
</script>
@endsection

130
resources/views/prestamosCrearEditar.blade.php

@ -46,13 +46,16 @@
<label for="nombre_solicitante" class="block text-sm font-medium text-gray-700 mb-2">
Nombre del Solicitante
</label>
<input type="text"
name="nombre_solicitante"
id="nombre_solicitante"
class="block w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el nombre del solicitante"
value="{{ isset($prestamo) ? $prestamo->nombre_solicitante : old('nombre_solicitante') }}">
<div class="relative">
<i class="fas fa-user absolute left-3 top-2.5 text-gray-400"></i>
<input type="text"
name="nombre_solicitante"
id="nombre_solicitante"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el nombre del solicitante"
value="{{ isset($prestamo) ? $prestamo->nombre_solicitante : old('nombre_solicitante') }}">
</div>
@error('nombre_solicitante')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
@ -63,13 +66,16 @@
<label for="destino" class="block text-sm font-medium text-gray-700 mb-2">
Destino
</label>
<input type="text"
name="destino"
id="destino"
class="block w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el destino"
value="{{ isset($prestamo) ? $prestamo->destino : old('destino') }}">
<div class="relative">
<i class="fas fa-map-marker-alt absolute left-3 top-2.5 text-gray-400"></i>
<input type="text"
name="destino"
id="destino"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el destino"
value="{{ isset($prestamo) ? $prestamo->destino : old('destino') }}">
</div>
@error('destino')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
@ -80,12 +86,15 @@
<label for="fecha_hora_salida" class="block text-sm font-medium text-gray-700 mb-2">
Fecha y Hora de Salida
</label>
<input type="datetime-local"
name="fecha_hora_salida"
id="fecha_hora_salida"
class="block w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
value="{{ isset($prestamo) ? $prestamo->fecha_hora_salida : old('fecha_hora_salida') }}">
<div class="relative">
<i class="fas fa-clock absolute left-3 top-2.5 text-gray-400"></i>
<input type="datetime-local"
name="fecha_hora_salida"
id="fecha_hora_salida"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
value="{{ isset($prestamo) ? $prestamo->fecha_hora_salida : old('fecha_hora_salida') }}">
</div>
@error('fecha_hora_salida')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
@ -96,12 +105,15 @@
<label for="fecha_hora_llegada" class="block text-sm font-medium text-gray-700 mb-2">
Fecha y Hora de Llegada
</label>
<input type="datetime-local"
name="fecha_hora_llegada"
id="fecha_hora_llegada"
class="block w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
value="{{ isset($prestamo) ? $prestamo->fecha_hora_llegada : old('fecha_hora_llegada') }}">
<div class="relative">
<i class="fas fa-clock absolute left-3 top-2.5 text-gray-400"></i>
<input type="datetime-local"
name="fecha_hora_llegada"
id="fecha_hora_llegada"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
value="{{ isset($prestamo) ? $prestamo->fecha_hora_llegada : old('fecha_hora_llegada') }}">
</div>
@error('fecha_hora_llegada')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
@ -112,11 +124,14 @@
<label for="motivo" class="block text-sm font-medium text-gray-700 mb-2">
Motivo
</label>
<textarea name="motivo"
id="motivo"
class="block w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el motivo">{{ isset($prestamo) ? $prestamo->motivo : old('motivo') }}</textarea>
<div class="relative">
<i class="fas fa-info-circle absolute left-3 top-2.5 text-gray-400"></i>
<textarea name="motivo"
id="motivo"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el motivo">{{ isset($prestamo) ? $prestamo->motivo : old('motivo') }}</textarea>
</div>
@error('motivo')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
@ -127,13 +142,16 @@
<label for="domicilio" class="block text-sm font-medium text-gray-700 mb-2">
Domicilio
</label>
<input type="text"
name="domicilio"
id="domicilio"
class="block w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el domicilio"
value="{{ isset($prestamo) ? $prestamo->domicilio : old('domicilio') }}">
<div class="relative">
<i class="fas fa-home absolute left-3 top-2.5 text-gray-400"></i>
<input type="text"
name="domicilio"
id="domicilio"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el domicilio"
value="{{ isset($prestamo) ? $prestamo->domicilio : old('domicilio') }}">
</div>
@error('domicilio')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
@ -144,28 +162,29 @@
<label for="numero_personas" class="block text-sm font-medium text-gray-700 mb-2">
Número de Personas
</label>
<input type="number"
name="numero_personas"
id="numero_personas"
class="block w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el número de personas"
value="{{ isset($prestamo) ? $prestamo->numero_personas : old('numero_personas') }}">
<div class="relative">
<i class="fas fa-users absolute left-3 top-2.5 text-gray-400"></i>
<input type="number"
name="numero_personas"
id="numero_personas"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
required
placeholder="Ingresa el número de personas"
value="{{ isset($prestamo) ? $prestamo->numero_personas : old('numero_personas') }}">
</div>
@error('numero_personas')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<!-- Campo Chofer -->
<div>
<label for="chofer" class="inline-flex items-center">
<input type="checkbox"
name="chofer"
id="chofer"
class="rounded border-gray-300 text-blue-600 shadow-sm focus:ring-blue-500"
{{ isset($prestamo) && $prestamo->chofer ? 'checked' : '' }}>
<span class="ml-2 text-sm text-gray-700">¿Requiere chofer?</span>
</label>
<div class="flex items-center">
<input type="checkbox"
name="chofer"
id="chofer"
class="rounded border-gray-300 text-blue-600 shadow-sm focus:ring-blue-500"
{{ isset($prestamo) && $prestamo->chofer ? 'checked' : '' }}>
<label for="chofer" class="ml-2 text-sm text-gray-700">¿Requiere chofer?</label>
</div>
<!-- Botones de acción -->
@ -185,5 +204,4 @@
</div>
</div>
</div>
@endsection
@endsection

46
resources/views/usuarios.blade.php

@ -76,15 +76,15 @@
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nombre</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Apellido</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Puesto</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Carrera</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Teléfono</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Número</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nombre </th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email </th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Apellido </th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Puesto </th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Carrera </th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Teléfono </th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado </th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones </th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@ -93,22 +93,32 @@
<td colspan="9" class="px-6 py-4 text-center text-gray-500">No hay usuarios registrados.</td>
</tr>
@else
@foreach($usuarios as $usuario)
@foreach($usuarios as $index => $usuario)
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $usuario->id }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $index + 1 }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<i class="fas fa-user text-blue-500 mr-2"></i>
{{ $usuario->name }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $usuario->email }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $usuario->apellido }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $usuario->puesto }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $usuario->carrera }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $usuario->telefono }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<i class="fas fa-envelope text-blue-500"></i> {{ $usuario->email }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<i class="fas fa-user-tag text-green-500"></i> {{ $usuario->apellido }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<i class="fas fa-briefcase text-yellow-500"></i> {{ $usuario->puesto }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<i class="fas fa-graduation-cap text-purple-500"></i> {{ $usuario->carrera }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<i class="fas fa-phone text-red-500"></i> {{ $usuario->telefono }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
@if($usuario->eliminado == 0)
<span class="flex items-center">
<span class="h-2 w-2 bg-green-500 rounded-full mr-2"></span> Activo
<span class="inline-flex items-center px-2 py-1 text-xs font-semibold text-green-800 bg-green-100 rounded-full">
<span class="h-2 w-2 bg-green-500 rounded-full mr-2"></span> Activo
</span>
@else
<span class="flex items-center">

86
resources/views/usuariosCrearEditar.blade.php

@ -34,48 +34,114 @@
<div class="space-y-6">
<div>
<label for="name" class="block text-sm font-medium text-gray-700 mb-2">Nombre</label>
<input type="text" name="name" id="name" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->name : old('name') }}">
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-user text-gray-400"></i>
</div>
<input type="text" name="name" id="name"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md"
placeholder="Ingresa el nombre"
required value="{{ isset($usuario) ? $usuario->name : old('name') }}">
</div>
</div>
<div>
<label for="email" class="block text-sm font-medium text-gray-700 mb-2">Correo Electrónico</label>
<input type="email" name="email" id="email" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->email : old('email') }}">
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-envelope text-gray-400"></i>
</div>
<input type="email" name="email" id="email"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md"
placeholder="Ingresa el correo electrónico"
required value="{{ isset($usuario) ? $usuario->email : old('email') }}">
</div>
</div>
<div>
<label for="apellido" class="block text-sm font-medium text-gray-700 mb-2">Apellido</label>
<input type="text" name="apellido" id="apellido" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->apellido : old('apellido') }}">
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-user-tag text-gray-400"></i>
</div>
<input type="text" name="apellido" id="apellido"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md"
placeholder="Ingresa el apellido"
required value="{{ isset($usuario) ? $usuario->apellido : old('apellido') }}">
</div>
</div>
<div>
<label for="puesto" class="block text-sm font-medium text-gray-700 mb-2">Puesto</label>
<input type="text" name="puesto" id="puesto" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->puesto : old('puesto') }}">
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-briefcase text-gray-400"></i>
</div>
<input type="text" name="puesto" id="puesto"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md"
placeholder="Ingresa el puesto"
required value="{{ isset($usuario) ? $usuario->puesto : old('puesto') }}">
</div>
</div>
<div>
<label for="carrera" class="block text-sm font-medium text-gray-700 mb-2">Carrera</label>
<input type="text" name="carrera" id="carrera" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->carrera : old('carrera') }}">
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-graduation-cap text-gray-400"></i>
</div>
<input type="text" name="carrera" id="carrera"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md"
placeholder="Ingresa la carrera"
required value="{{ isset($usuario) ? $usuario->carrera : old('carrera') }}">
</div>
</div>
<div>
<label for="telefono" class="block text-sm font-medium text-gray-700 mb-2">Teléfono</label>
<input type="text" name="telefono" id="telefono" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->telefono : old('telefono') }}">
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-phone text-gray-400"></i>
</div>
<input type="text" name="telefono" id="telefono"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md"
placeholder="Ingresa el número telefónico"
required value="{{ isset($usuario) ? $usuario->telefono : old('telefono') }}">
</div>
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700 mb-2">Contraseña</label>
<input type="password" name="password" id="password" class="block w-full px-3 py-2 border border-gray-300 rounded-md" {{ isset($usuario) ? '' : 'required' }}>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-lock text-gray-400"></i>
</div>
<input type="password" name="password" id="password"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md"
placeholder="Ingresa la contraseña"
{{ isset($usuario) ? '' : 'required' }}>
</div>
</div>
<div>
<label for="password_confirmation" class="block text-sm font-medium text-gray-700 mb-2">Confirmar Contraseña</label>
<input type="password" name="password_confirmation" id="password_confirmation" class="block w-full px-3 py-2 border border-gray-300 rounded-md" {{ isset($usuario) ? '' : 'required' }}>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-lock text-gray-400"></i>
</div>
<input type="password" name="password_confirmation" id="password_confirmation"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md"
placeholder="Confirma la contraseña"
{{ isset($usuario) ? '' : 'required' }}>
</div>
</div>
<div class="flex justify-end space-x-2 pt-4 border-t border-gray-200">
<a href="{{ route('usuarios') }}" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50">Cancelar</a>
<a href="{{ route('usuarios') }}" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50">
<i class="fas fa-times mr-2"></i>Cancelar
</a>
<button type="submit" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700">
{{ isset($usuario) ? 'Actualizar' : 'Guardar' }}
<i class="fas fa-save mr-2"></i>{{ isset($usuario) ? 'Actualizar' : 'Guardar' }}
</button>
</div>
</div>

17
routes/web.php

@ -47,17 +47,24 @@ use App\Http\Controllers\PrestamoController;
Route::resource('capacidades', CapacidadController::class);
Route::resource('prestamos',PrestamoController::class);
Route::get('marcas/excel', [MarcaController::class, 'exportExcel'])->name('marcas.excel');
Route::get('marcas/pdf', [MarcaController::class, 'exportPDF'])->name('marcas.pdf');
Route::get('/marcas/excel', [MarcaController::class, 'exportExcel'])->name('marcas.excel');
Route::get('/marcas/pdf', [MarcaController::class, 'exportPDF'])->name('marcas.pdf');
// Primero las rutas de exportación (más específicas)
Route::get('/prestamos/excel', [PrestamoController::class, 'exportExcel'])->name('prestamos.excel');
Route::get('/prestamos/pdf', [PrestamoController::class, 'exportPDF'])->name('prestamos.pdf');
// Después la ruta de recurso (más general)
Route::resource('prestamos', PrestamoController::class);
Route::get('/docentes/export/{format}', [DocentesController::class, 'export'])->name('docentes.export');
Route::get('/docentes/{id}/toggle-status', [DocentesController::class, 'toggleStatus'])->name('docentes.toggle-status');
Route::get('tiposLicencias/excel', [TiposLicenciasController::class, 'exportExcel'])->name('tiposLicencias.excel');
Route::get('tiposLicencias/pdf', [TiposLicenciasController::class, 'exportPDF'])->name('tiposLicencias.pdf');
Route::get('tiposLicencias/excel', [TiposLicenciasController::class, 'exportExcel'])->name('tiposLicencias.excel');
Route::get('tiposLicencias/pdf', [TiposLicenciasController::class, 'exportPDF'])->name('tiposLicencias.pdf');
// Rutas protegidas que requieren autenticación

Loading…
Cancel
Save