Autosave: 20260209-174509
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 193 KiB |
|
After Width: | Height: | Size: 209 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 215 KiB |
|
After Width: | Height: | Size: 201 KiB |
|
After Width: | Height: | Size: 242 KiB |
|
After Width: | Height: | Size: 220 KiB |
|
After Width: | Height: | Size: 162 KiB |
@ -54,7 +54,6 @@ $cobertura_banner = 'assets/uploads/cobertura_banner.jpg';
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th style="width: 150px;">Imagen</th>
|
||||
<th>Título</th>
|
||||
<th>Descripción</th>
|
||||
<th style="width: 100px;">Acciones</th>
|
||||
@ -63,21 +62,11 @@ $cobertura_banner = 'assets/uploads/cobertura_banner.jpg';
|
||||
<tbody>
|
||||
<?php if (empty($coberturas)): ?>
|
||||
<tr>
|
||||
<td colspan="4" class="text-center">No hay zonas de cobertura definidas.</td>
|
||||
<td colspan="3" class="text-center">No hay zonas de cobertura definidas.</td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<?php foreach ($coberturas as $row): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
$image_path = 'assets/uploads/cobertura_images/' . $row['imagen'];
|
||||
if (file_exists($image_path) && !empty($row['imagen'])):
|
||||
?>
|
||||
<img src="<?php echo $image_path; ?>?v=<?php echo time();?>" alt="Imagen de cobertura" class="img-fluid">
|
||||
<?php else: ?>
|
||||
<span class="text-muted">Sin imagen</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo htmlspecialchars($row['titulo']); ?></td>
|
||||
<td><?php echo nl2br(htmlspecialchars($row['descripcion'])); ?></td>
|
||||
<td>
|
||||
|
||||
@ -205,7 +205,7 @@ include 'layout_header.php';
|
||||
}
|
||||
?>
|
||||
<span class="badge <?php echo $estado_pago_class; ?>">
|
||||
<?php if ($user_role === 'Administrador'): ?>
|
||||
<?php if (in_array($user_role, ['Administrador', 'Verificador de Pagos'])): ?>
|
||||
<select class="form-select-pago" onchange="updateEstadoPago(<?php echo $pedido['id']; ?>, this)">
|
||||
<option value="Pendiente a verificación" <?php echo ($pedido['estado_pago'] == 'Pendiente a verificación') ? 'selected' : ''; ?>>Pendiente a verificación</option>
|
||||
<option value="Verificado" <?php echo ($pedido['estado_pago'] == 'Verificado') ? 'selected' : ''; ?>>Verificado</option>
|
||||
|
||||
@ -570,25 +570,51 @@ $selected_month] . ' ' . $selected_year; ?>)</h6>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (empty($asesor_data)):
|
||||
<?php if (empty($asesor_data)):
|
||||
echo "<tr><td colspan=\"" . (count($estados) + 2) . "\" class=\"text-center\">No hay datos para el período seleccionado.</td></tr>";
|
||||
else:
|
||||
// Initialize totals
|
||||
$totals = array_fill_keys($estados, 0);
|
||||
$grand_total = 0;
|
||||
|
||||
// Definir los grupos de estados para los cálculos de porcentaje
|
||||
$estados_efectividad = ['RUTA_CONTRAENTREGA', 'RETORNADO', 'ENTREGA EXITOSA'];
|
||||
|
||||
foreach ($asesor_data as $data):
|
||||
echo "<tr>";
|
||||
echo "<td>" . htmlspecialchars($data['nombre']) . "</td>";
|
||||
|
||||
// Calcular los totales para cada grupo
|
||||
$total_efectividad = 0;
|
||||
$total_general_grupo = 0;
|
||||
foreach ($estados_efectividad as $e) {
|
||||
$total_efectividad += $data['pedidos'][$e];
|
||||
}
|
||||
foreach ($estados as $estado) {
|
||||
if (!in_array($estado, $estados_efectividad)) {
|
||||
$total_general_grupo += $data['pedidos'][$estado];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($estados as $estado):
|
||||
$cantidad = $data['pedidos'][$estado];
|
||||
$totals[$estado] += $cantidad;
|
||||
echo "<td>";
|
||||
echo $cantidad;
|
||||
if ($data['total'] > 0) {
|
||||
$porcentaje = round(($cantidad / $data['total']) * 100, 1);
|
||||
echo " <span class=\"text-muted\">({" . $porcentaje . "}%)</span>";
|
||||
|
||||
// Calcular porcentaje basado en el grupo
|
||||
if (in_array($estado, $estados_efectividad)) {
|
||||
if ($total_efectividad > 0) {
|
||||
$porcentaje = round(($cantidad / $total_efectividad) * 100, 1);
|
||||
echo " <span class=\"text-muted\">({" . $porcentaje . "}%)</span>";
|
||||
}
|
||||
} else {
|
||||
if ($total_general_grupo > 0) {
|
||||
$porcentaje = round(($cantidad / $total_general_grupo) * 100, 1);
|
||||
echo " <span class=\"text-muted\">({" . $porcentaje . "}%)</span>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</td>";
|
||||
endforeach;
|
||||
echo "<td><strong>" . $data['total'] . "</strong></td>";
|
||||
|
||||
@ -42,13 +42,13 @@ $navItems = [
|
||||
'url' => 'buscador_general.php',
|
||||
'icon' => 'fa-search',
|
||||
'text' => 'Buscador General',
|
||||
'roles' => ['Administrador', 'admin', 'Asesor', 'Control Logistico', 'Soporte Logistico']
|
||||
'roles' => ['Administrador', 'admin', 'Asesor', 'Control Logistico', 'Soporte Logistico', 'Verificador de Pagos']
|
||||
],
|
||||
'completados' => [
|
||||
'url' => 'completados.php',
|
||||
'icon' => 'fa-check-circle',
|
||||
'text' => 'Pedidos Completados',
|
||||
'roles' => ['Administrador', 'admin', 'Asesor', 'Control Logistico', 'Soporte Logistico']
|
||||
'roles' => ['Administrador', 'admin', 'Asesor', 'Control Logistico', 'Soporte Logistico', 'Verificador de Pagos']
|
||||
],
|
||||
'listos_para_recojo' => [
|
||||
'url' => 'listos_para_recojo.php',
|
||||
|
||||
@ -154,6 +154,7 @@ include 'layout_header.php';
|
||||
<option value="Asesor">Asesor</option>
|
||||
<option value="Control Logistico">Control Logístico</option>
|
||||
<option value="Soporte Logistico">Soporte Logístico</option>
|
||||
<option value="Verificador de Pagos">Verificador de Pagos</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" name="create_user" class="btn btn-primary w-100">Crear Usuario</button>
|
||||
@ -237,6 +238,7 @@ include 'layout_header.php';
|
||||
<option value="Asesor">Asesor</option>
|
||||
<option value="Control Logistico">Control Logístico</option>
|
||||
<option value="Soporte Logistico">Soporte Logístico</option>
|
||||
<option value="Verificador de Pagos">Verificador de Pagos</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -3,7 +3,7 @@ session_start();
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Check for user role
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'Administrador') {
|
||||
if (!isset($_SESSION['user_id']) || !in_array($_SESSION['user_role'], ['Administrador', 'Verificador de Pagos'])) {
|
||||
echo json_encode(['success' => false, 'message' => 'Acceso no autorizado.']);
|
||||
exit;
|
||||
}
|
||||
|
||||