115 lines
5.6 KiB
PHP
115 lines
5.6 KiB
PHP
<?php
|
|
require_once __DIR__ . '/includes/servicios-data.php';
|
|
require_once __DIR__ . '/includes/csrf.php';
|
|
|
|
$slug = $_GET['s'] ?? '';
|
|
if (!isset($SERVICIOS[$slug])) {
|
|
http_response_code(404);
|
|
$pageTitle = 'Servicio no encontrado';
|
|
require_once __DIR__ . '/includes/header.php';
|
|
echo '<section class="section" style="text-align:center;padding:100px 20px;">'
|
|
. '<h1>Servicio no encontrado</h1>'
|
|
. '<p>El servicio solicitado no existe.</p>'
|
|
. '<a href="index.php" class="btn btn--primary">Volver al inicio</a>'
|
|
. '</section>';
|
|
require_once __DIR__ . '/includes/footer.php';
|
|
exit;
|
|
}
|
|
|
|
$servicio = $SERVICIOS[$slug];
|
|
$pageTitle = $servicio['nombre'] . ' - Gestoría LP';
|
|
|
|
if (session_status() === PHP_SESSION_NONE) session_start();
|
|
|
|
require_once __DIR__ . '/includes/header.php';
|
|
?>
|
|
|
|
<!-- Service Hero -->
|
|
<section class="service-hero">
|
|
<div class="container">
|
|
<div class="service-hero__icon">
|
|
<i class="fas <?= htmlspecialchars($servicio['icono']) ?>"></i>
|
|
</div>
|
|
<h1><?= htmlspecialchars($servicio['nombre']) ?></h1>
|
|
<p class="service-hero__price"><i class="fas fa-tag"></i> Precio: <strong><?= htmlspecialchars($servicio['precio']) ?></strong></p>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Service Detail -->
|
|
<section class="section">
|
|
<div class="container">
|
|
<div class="service-detail">
|
|
<div class="service-detail__info">
|
|
<p class="service-detail__desc"><?= htmlspecialchars($servicio['descripcion']) ?></p>
|
|
|
|
<h2><i class="fas fa-clipboard-list"></i> Requisitos</h2>
|
|
<ul class="requirements-list">
|
|
<?php foreach ($servicio['requisitos'] as $req): ?>
|
|
<li><i class="fas fa-check-circle"></i> <?= htmlspecialchars($req) ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
|
|
<h2><i class="fas fa-tasks"></i> Proceso</h2>
|
|
<ol class="process-list">
|
|
<?php foreach ($servicio['proceso'] as $i => $paso): ?>
|
|
<li>
|
|
<span class="step-number"><?= $i + 1 ?></span>
|
|
<?= htmlspecialchars($paso) ?>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ol>
|
|
</div>
|
|
|
|
<div class="service-detail__form" id="formulario">
|
|
<h2>Solicita este tramite</h2>
|
|
<form action="formulario.php" method="POST">
|
|
<?= csrfField() ?>
|
|
<input type="hidden" name="servicio" value="<?= htmlspecialchars($slug) ?>">
|
|
|
|
<div class="form-group">
|
|
<label for="nombre">Nombre completo *</label>
|
|
<input type="text" id="nombre" name="nombre" class="form-control" required placeholder="Tu nombre completo">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="telefono">Telefono *</label>
|
|
<input type="tel" id="telefono" name="telefono" class="form-control" required placeholder="Ej: 612 123 4567">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email">Correo electronico</label>
|
|
<input type="email" id="email" name="email" class="form-control" placeholder="tucorreo@ejemplo.com">
|
|
</div>
|
|
|
|
<?php foreach ($servicio['campos_formulario'] as $campo): ?>
|
|
<div class="form-group">
|
|
<label for="<?= htmlspecialchars($campo['name']) ?>">
|
|
<?= htmlspecialchars($campo['label']) ?>
|
|
<?= $campo['required'] ? ' *' : '' ?>
|
|
</label>
|
|
<?php if ($campo['type'] === 'select'): ?>
|
|
<select id="<?= htmlspecialchars($campo['name']) ?>" name="<?= htmlspecialchars($campo['name']) ?>" class="form-control" <?= $campo['required'] ? 'required' : '' ?>>
|
|
<option value="">Seleccione...</option>
|
|
<?php foreach ($campo['options'] as $opt): ?>
|
|
<option value="<?= htmlspecialchars($opt) ?>"><?= htmlspecialchars($opt) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<?php elseif ($campo['type'] === 'textarea'): ?>
|
|
<textarea id="<?= htmlspecialchars($campo['name']) ?>" name="<?= htmlspecialchars($campo['name']) ?>" class="form-control" rows="4" <?= $campo['required'] ? 'required' : '' ?> placeholder="Escribe aqui..."></textarea>
|
|
<?php elseif ($campo['type'] === 'date'): ?>
|
|
<input type="date" id="<?= htmlspecialchars($campo['name']) ?>" name="<?= htmlspecialchars($campo['name']) ?>" class="form-control" <?= $campo['required'] ? 'required' : '' ?>>
|
|
<?php else: ?>
|
|
<input type="text" id="<?= htmlspecialchars($campo['name']) ?>" name="<?= htmlspecialchars($campo['name']) ?>" class="form-control" <?= $campo['required'] ? 'required' : '' ?>>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
<button type="submit" class="btn btn--primary btn--block">
|
|
<i class="fas fa-paper-plane"></i> Solicitar <?= htmlspecialchars($servicio['nombre']) ?>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|