up
This commit is contained in:
@@ -114,11 +114,13 @@ class Domicilio {
|
||||
$dom = $this->db->fetch("
|
||||
SELECT
|
||||
d.*,
|
||||
p.nombre_completo AS paciente_nombre,
|
||||
p.telefono AS paciente_telefono,
|
||||
p.tipo_documento AS paciente_tipo_documento,
|
||||
p.numero_documento AS paciente_numero_documento,
|
||||
p.direccion AS paciente_direccion,
|
||||
p.nombre_completo AS paciente_nombre,
|
||||
p.telefono AS paciente_telefono,
|
||||
p.email AS paciente_email,
|
||||
p.fecha_nacimiento AS paciente_fecha_nacimiento,
|
||||
p.tipo_documento AS paciente_tipo_documento,
|
||||
p.numero_documento AS paciente_numero_documento,
|
||||
p.direccion AS paciente_direccion,
|
||||
o.examenes_solicitados,
|
||||
o.indicaciones AS indicaciones_orden,
|
||||
o.local_file AS orden_local_file,
|
||||
|
||||
@@ -459,6 +459,7 @@ $domIdParam = (int)($_GET['id'] ?? 0);
|
||||
<dt class="col-4">Tipo doc.</dt> <dd class="col-8" id="inf-tipodoc"></dd>
|
||||
<dt class="col-4">Nº documento</dt> <dd class="col-8" id="inf-numdoc"></dd>
|
||||
<dt class="col-4">Teléfono</dt> <dd class="col-8" id="inf-telefono"></dd>
|
||||
<dt class="col-4">F. nacimiento</dt><dd class="col-8" id="inf-fnac"></dd>
|
||||
<dt class="col-4">Correo</dt> <dd class="col-8" id="inf-correo"></dd>
|
||||
<dt class="col-4">Dirección</dt> <dd class="col-8" id="inf-direccion"></dd>
|
||||
<dt class="col-4">Seguro/tipo</dt> <dd class="col-8" id="inf-seguro"></dd>
|
||||
@@ -749,6 +750,7 @@ async function verDomicilio(id) {
|
||||
<dt class="col-5 text-muted">Paciente</dt><dd class="col-7 fw-semibold">${esc(dom.paciente_nombre)}</dd>
|
||||
<dt class="col-5 text-muted">Documento</dt><dd class="col-7">${esc(dom.paciente_tipo_documento||'')} ${esc(dom.paciente_numero_documento||'—')}</dd>
|
||||
<dt class="col-5 text-muted">Teléfono</dt><dd class="col-7">${esc(dom.paciente_telefono||'—')}</dd>
|
||||
<dt class="col-5 text-muted">F. nacimiento</dt><dd class="col-7">${formatFechaNac(dom.paciente_fecha_nacimiento)}</dd>
|
||||
<dt class="col-5 text-muted">Dirección</dt><dd class="col-7">${esc(dom.direccion)}</dd>
|
||||
<dt class="col-5 text-muted">Barrio</dt><dd class="col-7">${esc(dom.barrio||'—')}</dd>
|
||||
<dt class="col-5 text-muted">Indicaciones</dt><dd class="col-7">${esc(dom.indicaciones_dir||'—')}</dd>
|
||||
@@ -930,6 +932,7 @@ async function verInformeDom() {
|
||||
document.getElementById('inf-numdoc').textContent = dom.paciente_numero_documento || '—';
|
||||
document.getElementById('inf-telefono').textContent= dom.paciente_telefono || '—';
|
||||
document.getElementById('inf-correo').textContent = dom.paciente_email || '—';
|
||||
document.getElementById('inf-fnac').textContent = formatFechaNac(dom.paciente_fecha_nacimiento);
|
||||
document.getElementById('inf-direccion').textContent = (dom.direccion||'') + (dom.barrio ? ', ' + dom.barrio : '');
|
||||
document.getElementById('inf-seguro').textContent = dom.tipo_cliente === 'seguro'
|
||||
? ('Seguro' + (dom.seguro_nombre ? ' — ' + dom.seguro_nombre : ''))
|
||||
@@ -1239,6 +1242,16 @@ function exportarDomicilios() {
|
||||
|
||||
// ── Utils ──────────────────────────────────────────────────────────────────
|
||||
const esc = s => String(s||'').replace(/[<>&"]/g, c => ({'<':'<','>':'>','&':'&','"':'"'}[c]));
|
||||
function formatFechaNac(fnac) {
|
||||
if (!fnac) return '—';
|
||||
const d = new Date(fnac + 'T00:00:00');
|
||||
if (isNaN(d)) return fnac;
|
||||
const hoy = new Date();
|
||||
let edad = hoy.getFullYear() - d.getFullYear();
|
||||
const m = hoy.getMonth() - d.getMonth();
|
||||
if (m < 0 || (m === 0 && hoy.getDate() < d.getDate())) edad--;
|
||||
return d.toLocaleDateString('es-CO') + ' (' + edad + ' años)';
|
||||
}
|
||||
function calcDuracion(hl, hs) {
|
||||
if (!hl || !hs) return '—';
|
||||
const [h1, m1] = hl.slice(0,5).split(':').map(Number);
|
||||
|
||||
Reference in New Issue
Block a user