main
inicio
This commit is contained in:
167
views/solicitud_importacion/crear.php
Normal file
167
views/solicitud_importacion/crear.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>➕ Nueva Solicitud de Importación</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
.sidebar { width: 220px; height: 100vh; background-color: #343a40; position: fixed; top: 0; left: 0; padding-top: 60px; }
|
||||
.sidebar .nav-link { color: #ccc; padding: 12px 20px; }
|
||||
.sidebar .nav-link:hover, .sidebar .nav-link.active { background-color: #495057; color: #fff; }
|
||||
.content { margin-left: 220px; padding: 40px 20px; }
|
||||
.card { border-radius: 12px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php include __DIR__ . '/../partials/sidebar_importador.php'; ?>
|
||||
<br><br>
|
||||
<div class="content">
|
||||
<h4>➕ Nueva Solicitud de Importación</h4>
|
||||
<div class="card p-4 bg-white shadow-sm">
|
||||
<form action="/IMPORTADORES/solicitud_importacion/guardar" method="POST" enctype="multipart/form-data">
|
||||
|
||||
<!-- Sección principal -->
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="numero_factura" class="form-label">Número de Factura</label>
|
||||
<input id="numero_factura" name="numero_factura" type="text" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="fecha_factura" class="form-label">Fecha de Factura</label>
|
||||
<input id="fecha_factura" name="fecha_factura" type="date" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="anexo22_apendice" class="form-label">Anexo 22 – Apéndice</label>
|
||||
<select id="anexo22_apendice" name="anexo22_apendice" class="form-select" required>
|
||||
<option value="">-- Selecciona Aduana --</option>
|
||||
<?php foreach($aduanas as $a): ?>
|
||||
<option value="<?= $a['aduana_seccion'] ?>"><?= htmlspecialchars($a['aduana_seccion'].' – '.$a['nombre']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Segunda fila: Incoterm, País, Moneda -->
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="incoterm" class="form-label">INCOTERM</label>
|
||||
<select id="incoterm" name="incoterm" class="form-select" required>
|
||||
<option value="">-- Selecciona Incoterm --</option>
|
||||
<?php foreach($incoterms as $inc): ?>
|
||||
<option value="<?= htmlspecialchars($inc['INCOTERM']) ?>"><?= htmlspecialchars($inc['INCOTERM'].' - '.$inc['DESCESPANOL']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="pais_proveedor" class="form-label">País (Proveedor)</label>
|
||||
<select id="pais_proveedor" name="pais_proveedor" class="form-select">
|
||||
<option value="">-- Selecciona País --</option>
|
||||
<?php foreach($paises as $p): ?>
|
||||
<option value="<?= $p['id_pais'] ?>"><?= htmlspecialchars($p['nombre']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="tipo_moneda" class="form-label">Moneda</label>
|
||||
<select id="tipo_moneda" name="tipo_moneda" class="form-select">
|
||||
<?php foreach(['MXN'=>'Peso Mexicano','USD'=>'Dólar USD','EUR'=>'Euro','CNY'=>'Yuan','GBP'=>'Libra GBP','JPY'=>'Yen'] as $code=>$label): ?>
|
||||
<option value="<?= $code ?>"><?= "$label ($code)" ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Valor y vinculación -->
|
||||
<div class="row">
|
||||
<div class="col-md-8 mb-3">
|
||||
<label for="valor_factura" class="form-label">Valor Factura</label>
|
||||
<input id="valor_factura" name="valor_factura" type="number" step="0.01" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="vinculacion" class="form-label">Vinculación</label>
|
||||
<select id="vinculacion" name="vinculacion" class="form-select">
|
||||
<option value="0">No existe</option>
|
||||
<option value="1">Existe, no afecta</option>
|
||||
<option value="2">Existe y afecta</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Transportista, Chofer, Foto Solicitud -->
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="transportista_id" class="form-label">Transportista</label>
|
||||
<select id="transportista_id" name="transportista_id" class="form-select" required>
|
||||
<option value="">-- Selecciona --</option>
|
||||
<?php foreach($transportistas as $t): ?>
|
||||
<option value="<?= $t['id_transportista'] ?>"><?= htmlspecialchars($t['nombre']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="chofer_id" class="form-label">Chofer</label>
|
||||
<select id="chofer_id" name="chofer_id" class="form-select" required>
|
||||
<option value="">-- Selecciona Chofer --</option>
|
||||
<?php foreach($choferes as $c): ?>
|
||||
<option value="<?= $c['id_chofer'] ?>"><?= htmlspecialchars($c['nombre']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="foto_solicitud" class="form-label">Foto de la solicitud</label>
|
||||
<input id="foto_solicitud" name="foto_solicitud" type="file" class="form-control" accept="image/*">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Partidas dinámicas -->
|
||||
<hr>
|
||||
<h5>📦 Partidas</h5>
|
||||
<table class="table table-sm" id="tabla-partidas">
|
||||
<thead>
|
||||
<tr><th>Descripción</th><th>Precio Unitario</th><th></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input name="partidas[0][descripcion]" class="form-control"></td>
|
||||
<td><input name="partidas[0][precio_unitario]" type="number" step="0.01" class="form-control"></td>
|
||||
<td><button type="button" class="btn btn-danger btn-sm remove-row">✖️</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="button" class="btn btn-secondary btn-sm" id="add-partida">➕ Agregar partida</button>
|
||||
|
||||
<!-- Activo -->
|
||||
<div class="form-check mt-4">
|
||||
<input id="status" name="status" type="checkbox" class="form-check-input" checked>
|
||||
<label for="status" class="form-check-label">Activo</label>
|
||||
</div>
|
||||
|
||||
<!-- Botones finales -->
|
||||
<button type="submit" class="btn btn-success mt-3">Guardar</button>
|
||||
<a href="/IMPORTADORES/solicitud_importacion/lista" class="btn btn-secondary mt-3 ms-2">Cancelar</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('add-partida').addEventListener('click', () => {
|
||||
const tbody = document.querySelector('#tabla-partidas tbody');
|
||||
const idx = tbody.querySelectorAll('tr').length;
|
||||
const row = document.createElement('tr');
|
||||
row.innerHTML = `
|
||||
<td><input name="partidas[\${idx}][descripcion]" class="form-control"></td>
|
||||
<td><input name="partidas[\${idx}][precio_unitario]" type="number" step="0.01" class="form-control"></td>
|
||||
<td><button type="button" class="btn btn-danger btn-sm remove-row">✖️</button></td>
|
||||
`;
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
document.querySelector('#tabla-partidas tbody').addEventListener('click', e => {
|
||||
if (e.target.matches('.remove-row')) e.target.closest('tr').remove();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
199
views/solicitud_importacion/editar.php
Normal file
199
views/solicitud_importacion/editar.php
Normal file
@@ -0,0 +1,199 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>✏️ Editar Solicitud #<?= (int)$factura['id_solicitud'] ?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
.sidebar { width: 220px; height: 100vh; background-color: #343a40; position: fixed; top: 0; left: 0; padding-top: 60px; }
|
||||
.sidebar .nav-link { color: #ccc; padding: 12px 20px; }
|
||||
.sidebar .nav-link:hover, .sidebar .nav-link.active { background-color: #495057; color: #fff; }
|
||||
.content { margin-left: 220px; padding: 40px 20px; }
|
||||
.card { border-radius: 12px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php include __DIR__ . '/../partials/sidebar_importador.php'; ?>
|
||||
<br><br>
|
||||
<div class="content">
|
||||
<h4>✏️ Editar Solicitud #<?= (int)$factura['id_solicitud'] ?></h4>
|
||||
<div class="card p-4 bg-white shadow-sm">
|
||||
<form action="/IMPORTADORES/solicitud_importacion/actualizar" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="id_solicitud" value="<?= (int)$factura['id_solicitud'] ?>">
|
||||
|
||||
<!-- Datos principales -->
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="numero_factura" class="form-label">Número de Factura</label>
|
||||
<input id="numero_factura" name="numero_factura" type="text" class="form-control"
|
||||
value="<?= htmlspecialchars($factura['numero_factura']) ?>" required>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="fecha_factura" class="form-label">Fecha de Factura</label>
|
||||
<input id="fecha_factura" name="fecha_factura" type="date" class="form-control"
|
||||
value="<?=
|
||||
($factura['fecha_factura'] instanceof DateTime)
|
||||
? htmlspecialchars($factura['fecha_factura']->format('Y-m-d'))
|
||||
: htmlspecialchars($factura['fecha_factura'])
|
||||
?>" required>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="anexo22_apendice" class="form-label">Anexo 22 – Apéndice</label>
|
||||
<select id="anexo22_apendice" name="anexo22_apendice" class="form-select" required>
|
||||
<option value="">-- Selecciona Aduana --</option>
|
||||
<?php foreach ($aduanas as $a): ?>
|
||||
<option value="<?= $a['aduana_seccion'] ?>"
|
||||
<?= $factura['anexo22_apendice'] == $a['aduana_seccion'] ? 'selected' : '' ?>>
|
||||
<?= htmlspecialchars($a['aduana_seccion'] . ' – ' . $a['nombre']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="incoterm" class="form-label">INCOTERM</label>
|
||||
<select id="incoterm" name="incoterm" class="form-select">
|
||||
<option value="">-- Selecciona Incoterm --</option>
|
||||
<?php foreach ($incoterms as $inc): ?>
|
||||
<option value="<?= htmlspecialchars($inc['INCOTERM']) ?>"
|
||||
<?= $factura['incoterm'] === $inc['INCOTERM'] ? 'selected' : '' ?>>
|
||||
<?= htmlspecialchars($inc['INCOTERM'] . ' - ' . $inc['DESCESPANOL']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="pais_proveedor" class="form-label">País (Proveedor)</label>
|
||||
<select id="pais_proveedor" name="pais_proveedor" class="form-select">
|
||||
<option value="">-- Selecciona País --</option>
|
||||
<?php foreach ($paises as $p): ?>
|
||||
<option value="<?= $p['id_pais'] ?>"
|
||||
<?= $factura['pais_proveedor'] == $p['id_pais'] ? 'selected' : '' ?>>
|
||||
<?= htmlspecialchars($p['nombre']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="tipo_moneda" class="form-label">Moneda</label>
|
||||
<select id="tipo_moneda" name="tipo_moneda" class="form-select">
|
||||
<?php
|
||||
$currs = ['MXN'=>'Peso Mexicano','USD'=>'Dólar USD','EUR'=>'Euro','CNY'=>'Yuan','GBP'=>'Libra GBP','JPY'=>'Yen'];
|
||||
foreach ($currs as $code => $label): ?>
|
||||
<option value="<?= $code ?>"
|
||||
<?= $factura['tipo_moneda']==$code ? 'selected' : '' ?>>
|
||||
<?= "$label ($code)" ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 mb-3">
|
||||
<label for="valor_factura" class="form-label">Valor Factura</label>
|
||||
<input id="valor_factura" name="valor_factura" type="number" step="0.01" class="form-control"
|
||||
value="<?= htmlspecialchars($factura['valor_factura']) ?>">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="vinculacion" class="form-label">Vinculación</label>
|
||||
<select id="vinculacion" name="vinculacion" class="form-select">
|
||||
<option value="0" <?= $factura['vinculacion']==0?'selected':'' ?>>No existe</option>
|
||||
<option value="1" <?= $factura['vinculacion']==1?'selected':'' ?>>Existe, no afecta</option>
|
||||
<option value="2" <?= $factura['vinculacion']==2?'selected':'' ?>>Existe y afecta</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="transportista_id" class="form-label">Transportista</label>
|
||||
<select id="transportista_id" name="transportista_id" class="form-select" required>
|
||||
<?php foreach ($transportistas as $t): ?>
|
||||
<option value="<?= $t['id_transportista'] ?>"
|
||||
<?= $factura['transportista_id']==$t['id_transportista']?'selected':'' ?>>
|
||||
<?= htmlspecialchars($t['nombre']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="chofer_id" class="form-label">Chofer</label>
|
||||
<select id="chofer_id" name="chofer_id" class="form-select" required>
|
||||
<?php foreach ($choferes as $c): ?>
|
||||
<option value="<?= $c['id_chofer'] ?>"
|
||||
<?= $factura['chofer_id']==$c['id_chofer']?'selected':'' ?>>
|
||||
<?= htmlspecialchars($c['nombre']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="foto_solicitud" class="form-label">Nueva Foto de la solicitud</label>
|
||||
<input id="foto_solicitud" name="foto_solicitud" type="file" class="form-control" accept="image/*">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Partidas dinámicas -->
|
||||
<hr>
|
||||
<h5>📦 Partidas</h5>
|
||||
<table class="table table-sm" id="tabla-partidas">
|
||||
<thead>
|
||||
<tr><th>Descripción</th><th>Precio Unitario</th><th></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (!empty($partidas)): ?>
|
||||
<?php foreach ($partidas as $i => $p): ?>
|
||||
<tr>
|
||||
<td><input name="partidas[<?= $i ?>][descripcion]" class="form-control" value="<?= htmlspecialchars($p['descripcion']) ?>"></td>
|
||||
<td><input name="partidas[<?= $i ?>][precio_unitario]" type="number" step="0.01" class="form-control" value="<?= htmlspecialchars($p['precio_unitario']) ?>"></td>
|
||||
<td><button type="button" class="btn btn-danger btn-sm remove-row">✖️</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td><input name="partidas[0][descripcion]" class="form-control"></td>
|
||||
<td><input name="partidas[0][precio_unitario]" type="number" step="0.01" class="form-control"></td>
|
||||
<td><button type="button" class="btn btn-danger btn-sm remove-row">✖️</button></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="button" class="btn btn-secondary btn-sm mb-3" id="add-partida">➕ Agregar partida</button>
|
||||
|
||||
<!-- Activo -->
|
||||
<div class="form-check mb-4">
|
||||
<input id="status" name="status" type="checkbox" class="form-check-input" <?= $factura['status']==1?'checked':'' ?>>
|
||||
<label for="status" class="form-check-label">Activo</label>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Actualizar</button>
|
||||
<a href="/IMPORTADORES/solicitud_importacion/lista" class="btn btn-secondary ms-2">Cancelar</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('add-partida').addEventListener('click', function() {
|
||||
var tbody = document.querySelector('#tabla-partidas tbody');
|
||||
var idx = tbody.querySelectorAll('tr').length;
|
||||
var row = document.createElement('tr');
|
||||
row.innerHTML = '<td><input name="partidas[' + idx + '][descripcion]" class="form-control"></td>' +
|
||||
'<td><input name="partidas[' + idx + '][precio_unitario]" type="number" step="0.01" class="form-control"></td>' +
|
||||
'<td><button type="button" class="btn btn-danger btn-sm remove-row">✖️</button></td>';
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
document.querySelector('#tabla-partidas tbody').addEventListener('click', function(e) {
|
||||
if (e.target.matches('.remove-row')) {
|
||||
e.target.closest('tr').remove();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
111
views/solicitud_importacion/lista.php
Normal file
111
views/solicitud_importacion/lista.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>📄 Solicitudes de Importación</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<style>
|
||||
table.dataTable thead th { background: #343a40; color: #fff; }
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
.sidebar { width: 220px; height: 100vh; background-color: #343a40; position: fixed; top: 0; left: 0; padding-top: 60px; }
|
||||
.sidebar .nav-link { color: #ccc; padding: 12px 20px; }
|
||||
.sidebar .nav-link:hover, .sidebar .nav-link.active { background-color: #495057; color: #fff; }
|
||||
.content { margin-left: 220px; padding: 40px 20px; }
|
||||
.navbar { position: fixed; top: 0; width: 100%; z-index: 1000; }
|
||||
.card { border-radius: 12px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php include __DIR__ . '/../partials/sidebar_importador.php'; ?>
|
||||
<br><br>
|
||||
<div class="content">
|
||||
<h4>📄 Solicitudes de Importación</h4>
|
||||
<a href="/IMPORTADORES/solicitud_importacion/crear" class="btn btn-success mb-3">➕ Nueva Solicitud</a>
|
||||
<table class="table table-striped" id="tabla-solicitudes">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Factura</th>
|
||||
<th>Fecha</th>
|
||||
<th>Pedimento</th>
|
||||
<th>Incoterm</th>
|
||||
<th>País Proveedor</th>
|
||||
<th>Moneda</th>
|
||||
<th>Valor</th>
|
||||
<th>Vinculación</th>
|
||||
<th>Transportista</th>
|
||||
<th>PDF</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($facturas as $f): ?>
|
||||
<tr>
|
||||
<td><?= $f['id_solicitud'] ?></td>
|
||||
<td><?= htmlspecialchars($f['numero_factura']) ?></td>
|
||||
<td><?= htmlspecialchars($f['fecha_factura']) ?></td>
|
||||
<td><?= htmlspecialchars($f['numero_pedimento']) ?></td>
|
||||
<td><?= htmlspecialchars($f['incoterm']) ?></td>
|
||||
<td><?= htmlspecialchars($f['pais_proveedor']) ?></td>
|
||||
<td><?= htmlspecialchars($f['tipo_moneda']) ?></td>
|
||||
<td><?= number_format($f['valor_factura'],2) ?></td>
|
||||
<td>
|
||||
<?php
|
||||
switch($f['vinculacion']) {
|
||||
case 1: echo 'Existe, no afecta'; break;
|
||||
case 2: echo 'Existe y afecta'; break;
|
||||
default: echo 'No existe';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($f['transportista']) ?></td>
|
||||
<td>
|
||||
<a href="/IMPORTADORES/solicitud_importacion/pdf?id=<?= $f['id_solicitud'] ?>"
|
||||
class="btn btn-sm btn-outline-secondary" target="_blank">
|
||||
📄 PDF
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/IMPORTADORES/solicitud_importacion/editar?id=<?= $f['id_solicitud'] ?>"
|
||||
class="btn btn-sm btn-primary">✏️</a>
|
||||
<button class="btn btn-sm btn-danger"
|
||||
onclick="confirmDelete(<?= $f['id_solicitud'] ?>)">🗑️</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function confirmDelete(id) {
|
||||
Swal.fire({
|
||||
title: '¿Eliminar solicitud?',
|
||||
text: 'Se marcará como inactiva.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Sí, eliminar',
|
||||
cancelButtonText: 'Cancelar',
|
||||
confirmButtonColor: '#d33'
|
||||
}).then(r => {
|
||||
if (r.isConfirmed) {
|
||||
window.location = `/IMPORTADORES/solicitud_importacion/eliminar?id=${id}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
<?php if(isset($_GET['deleted'])): ?>
|
||||
Swal.fire('¡Hecho!','Solicitud eliminada.','success');
|
||||
<?php endif; ?>
|
||||
<?php if(isset($_GET['created'])): ?>
|
||||
Swal.fire('¡Listo!','Solicitud creada.','success');
|
||||
<?php endif; ?>
|
||||
<?php if(isset($_GET['updated'])): ?>
|
||||
Swal.fire('¡Listo!','Solicitud actualizada.','success');
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user