Panel Principal
Repartidores Activos
5
IDs: REP-001, REP-002, REP-004, REP-005
Cobros Hoy
12
Total Cobrado Hoy
$3,450
Promedio por Cobro
prepare("SELECT * FROM administradores WHERE usuario = ?"); $stmt->execute([$_POST['username']]); $admin = $stmt->fetch(); if($admin && password_verify($_POST['password'], $admin['password'])) { $_SESSION['user'] = [ 'role' => 'admin', 'name' => $admin['nombre'], 'id' => $admin['id'] ]; header('Location: index.php'); exit; } } else { // Verificar repartidor $stmt = $conn->prepare("SELECT * FROM repartidores WHERE id = ? AND activo = 1"); $stmt->execute([$_POST['delivery_id']]); $delivery = $stmt->fetch(); if($delivery) { $_SESSION['user'] = [ 'role' => 'delivery', 'id' => $delivery['id'], 'name' => $delivery['nombre'], 'phone' => $delivery['telefono'] ]; header('Location: index.php'); exit; } } $error = "Credenciales incorrectas"; } ?> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { die("Error de conexión: " . $e->getMessage()); } ?>
Control de pagos para repartidores