MoneyFlix: Add Auth module, fix error monitoring, improve lock screen functionality

- Add complete Auth module with login, logout, lock screen functionality
- Fix 401 error on error monitoring page by adding /error-monitoring/ to public patterns
- Improve lock screen with proper form handling and unlock functionality
- Add RoleModel and role management views
- Add BaseModel for common model functionality
- Update authentication system and middleware
- Add troubleshooting documentation
- Update assets and build tools
This commit is contained in:
1sonhador committed 2025-10-22 18:09:43 +01:00
1 parent 10176fd47e
commit 97eca96f83
185 files changed
+78889 -18

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
# Alpine.js Troubleshooting Guide
## Problema: Alpine.js não renderiza dados após carregamento assíncrono
### Sintomas
- Console logs mostram que os dados foram carregados com sucesso
- Variáveis Alpine.js estão definidas e têm valores corretos
- HTML não atualiza para mostrar os dados carregados
- `x-text` bindings mostram valores vazios ou não atualizam
### Causa Raiz
**Conflito de escopo do Alpine.js** - A div principal com `x-data` estava fechada antes do conteúdo principal, quebrando o contexto do Alpine.js.
### Estrutura Problemática
```html
<div class="row" x-data="adminUsersList">
<!-- Conteúdo que funciona -->
</div> <!-- ❌ Fecha aqui -->
<div class="row">
<!-- Conteúdo que NÃO funciona - fora do escopo -->
</div>
```
### Solução
**Mover `x-data` para envolver todo o conteúdo:**
```html
<div x-data="adminUsersList">
<div class="row">
<!-- Todo o conteúdo dentro do escopo -->
</div>
<div class="row">
<!-- Todo o conteúdo dentro do escopo -->
</div>
</div> <!-- ✅ Fecha no final -->
```
### Outros Problemas Encontrados
#### 1. Componente Inline Incompleto
**Problema:** Componente inline só tinha 3 variáveis, mas HTML usava dezenas.
**Solução:** Incluir todas as variáveis necessárias no componente inline.
#### 2. Conflito entre Componente Bundled e Inline
**Problema:** Dois componentes com o mesmo nome (`adminUsersList`).
**Solução:** Remover componente bundled do `main.js` quando usar inline.
#### 3. Headers já enviados
**Problema:** `http_response_code()` chamado após output.
**Solução:** Verificar `headers_sent()` antes de chamar `http_response_code()`.
### Debugging Steps
1. **Verificar escopo:** `x-data` deve envolver todo o conteúdo
2. **Verificar variáveis:** Todas as variáveis usadas no HTML devem existir no componente
3. **Verificar conflitos:** Não ter dois componentes com o mesmo nome
4. **Verificar logs:** Console deve mostrar dados carregados
5. **Testar com dados mock:** Confirmar que Alpine.js funciona
### Prevenção
1. **Sempre verificar estrutura HTML** antes de adicionar Alpine.js
2. **Usar componentes inline** para funcionalidades complexas
3. **Testar com dados mock** antes de integrar com API
4. **Verificar console** para erros de variáveis não definidas
### Arquivos Afetados
- `crm/Modules/Users/Views/admin-users.php` - Template principal
- `src/js/main.js` - Registro de componentes
- `crm/Modules/Users/Controllers/UserController.php` - Headers
### Data da Resolução
Janeiro 2025
+94
View File
@@ -0,0 +1,94 @@
<?php
namespace App\Core;
use App\Core\DatabaseManager;
abstract class BaseModel
{
protected DatabaseManager $db;
protected string $table = '';
public function __construct(DatabaseManager $db)
{
$this->db = $db;
}
/**
* Get all records from the table
*/
public function getAll(): array
{
$sql = "SELECT * FROM {$this->table}";
return $this->db->fetchAll($sql) ?: [];
}
/**
* Get a record by ID
*/
public function getById(int $id): ?array
{
$sql = "SELECT * FROM {$this->table} WHERE id = ?";
$result = $this->db->fetch($sql, [$id]);
return $result ?: null;
}
/**
* Find a record by ID (alias for getById)
*/
public function find(int $id): ?array
{
return $this->getById($id);
}
/**
* Create a new record
*/
public function create(array $data): bool
{
$columns = array_keys($data);
$placeholders = array_fill(0, count($columns), '?');
$sql = sprintf(
"INSERT INTO %s (%s) VALUES (%s)",
$this->table,
implode(', ', $columns),
implode(', ', $placeholders)
);
return $this->db->query($sql, array_values($data)) > 0;
}
/**
* Update a record by ID
*/
public function update(int $id, array $data): bool
{
$sets = [];
foreach (array_keys($data) as $column) {
$sets[] = "{$column} = ?";
}
$sql = sprintf(
"UPDATE %s SET %s WHERE id = ?",
$this->table,
implode(', ', $sets)
);
$params = array_values($data);
$params[] = $id;
return $this->db->query($sql, $params) > 0;
}
/**
* Delete a record by ID
*/
public function delete(int $id): bool
{
$sql = "DELETE FROM {$this->table} WHERE id = ?";
return $this->db->query($sql, [$id]) > 0;
}
}
@@ -0,0 +1,625 @@
<?php
namespace App\Modules\Auth\Controllers;
use App\Core\BaseController;
use App\Core\Sanitize;
use App\Core\Auth;
use App\Core\View;
use App\Core\ErrorReporter;
class AuthController extends BaseController
{
public function __construct()
{
parent::__construct('Auth');
}
/**
* Show the login form.
*/
public function showLoginForm(): void
{
try {
// Use a simple, dedicated layout for auth pages
View::render('layouts/auth.php', [
'title' => 'Login',
'page_content' => function() {
View::render('@auth/login', []);
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_show_login_form']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
/**
* Handle the login request.
*/
public function handleLogin(): void
{
try {
// Validação simples e sanitização
$email = Sanitize::email($_POST['email'] ?? '');
$password = $_POST['password'] ?? '';
$rememberMe = isset($_POST['remember_me']);
// Validar campos obrigatórios
if (empty($email) || empty($password)) {
$this->errorResponse('Email and password are required', 400);
return;
}
// Validar formato de email
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$this->errorResponse('Invalid email format', 400);
return;
}
// Tentar login
if (Auth::login($email, $password, $rememberMe)) {
// Redirecionar após login bem-sucedido
$this->successResponse([], 'Login successful');
} else {
$this->errorResponse('Invalid credentials', 401);
}
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_handle_login']);
$this->errorResponse('Internal server error', 500);
}
}
/**
* Handle the logout request.
*/
public function logout(): void
{
try {
Auth::logout();
header('Location: /login');
exit();
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_logout']);
header('Location: /login?error=logout_error');
exit();
}
}
public function loginBasic(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Sign In',
'page_content' => function() {
View::render('@auth/login');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_login_basic']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function registerBasic(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Create Account',
'page_content' => function() {
View::render('@auth/signup/basic');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_register_basic']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function passResetBasic(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Password Reset',
'page_content' => function() {
View::render('@auth/pass/reset/basic');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_pass_reset_basic']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function loginCover(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Sign In',
'page_content' => function() {
View::render('@auth/signin/cover');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_login_cover']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function registerCover(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Create Account',
'page_content' => function() {
View::render('@auth/signup/cover');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_register_cover']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function passResetCover(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Password Reset',
'page_content' => function() {
View::render('@auth/pass/reset/cover');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_pass_reset_cover']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function lockScreen(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Lock Screen',
'page_content' => function() {
View::render('@auth/lockscreen/basic');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_lock_screen']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function unlock(): void
{
try {
// Check if request is AJAX
if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest') {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'Invalid request']);
return;
}
// Check if user is logged in (has session)
if (!isset($_SESSION['user_id'])) {
echo json_encode(['success' => false, 'message' => 'No active session found. Please login again.', 'redirect' => '/login']);
return;
}
// Get password from POST
$password = $_POST['password'] ?? '';
if (empty($password)) {
echo json_encode(['success' => false, 'message' => 'Password is required']);
return;
}
// Get user from database
$db = DatabaseManager::getInstance();
$stmt = $db->prepare("SELECT id, password FROM users WHERE id = ? AND is_active = 1");
$stmt->execute([$_SESSION['user_id']]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$user) {
echo json_encode(['success' => false, 'message' => 'User not found']);
return;
}
// Verify password
if (password_verify($password, $user['password'])) {
// Password is correct, redirect to dashboard
echo json_encode(['success' => true, 'message' => 'Unlocked successfully']);
} else {
echo json_encode(['success' => false, 'message' => 'Invalid password']);
}
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_unlock']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Internal server error']);
}
}
public function twoStepVerification(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Two Step Verification',
'page_content' => function() {
View::render('@auth/twostep/basic');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_two_step_verification']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function errors404(): void
{
try {
View::render('layouts/auth.php', [
'title' => '404 Error',
'page_content' => function() {
View::render('@auth/404/basic');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_errors_404']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function errors404Cover(): void
{
try {
View::render('layouts/auth.php', [
'title' => '404 Error',
'page_content' => function() {
View::render('@auth/404/cover');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_errors_404_cover']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function errors404Alt(): void
{
try {
View::render('layouts/main.php', [
'title' => '404 Error',
'page_content' => function() {
View::render('@auth/404/alt');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_errors_404_alt']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function errors500(): void
{
try {
View::render('layouts/main.php', [
'title' => '500 Error',
'page_content' => function() {
View::render('@auth/500');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_errors_500']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public function errorsOffline(): void
{
try {
View::render('layouts/main.php', [
'title' => 'Offline',
'page_content' => function() {
View::render('@auth/offline');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_errors_offline']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public static function authSuccessMsgCoverPage(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Success Message',
'page_content' => function() {
View::render('@auth/success/msg/cover');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_success_msg_cover']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public static function authSuccessMsgBasicPage(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Success Message',
'page_content' => function() {
View::render('@auth/success/msg/basic');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_success_msg_basic']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public static function authPassChangeCoverPage(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Password Change',
'page_content' => function() {
View::render('@auth/pass/change/cover');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_pass_change_cover']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public static function authPassChangeBasicPage(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Password Change',
'page_content' => function() {
View::render('@auth/pass/change/basic');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_pass_change_basic']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public static function authTwostepCoverPage(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Two Step Verification',
'page_content' => function() {
View::render('@auth/twostep/cover');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_twostep_cover']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
public static function authTwostepBasicPage(): void
{
try {
View::render('layouts/auth.php', [
'title' => 'Two Step Verification',
'page_content' => function() {
View::render('@auth/twostep/basic');
}
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_twostep_basic']);
http_response_code(500);
echo 'Erro interno do servidor';
}
}
// API Methods - SEGURANÇA MÁXIMA APLICADA
public static function loginApi(): void
{
try {
// Validar método HTTP
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
echo json_encode(['success' => false, 'message' => 'Método não permitido']);
return;
}
// Sanitizar inputs
$email = Sanitize::email($_POST['email'] ?? '');
$password = $_POST['password'] ?? '';
// Validar campos obrigatórios
if (empty($email) || empty($password)) {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'Email e password são obrigatórios']);
return;
}
// Validar formato de email
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'Formato de email inválido']);
return;
}
// Tentar login
if (Auth::login($email, $password, false)) {
header('Content-Type: application/json');
echo json_encode(['success' => true, 'message' => 'Login realizado com sucesso']);
} else {
http_response_code(401);
echo json_encode(['success' => false, 'message' => 'Credenciais inválidas']);
}
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_login_api']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
public static function logoutApi(): void
{
try {
// Validar método HTTP
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
echo json_encode(['success' => false, 'message' => 'Método não permitido']);
return;
}
Auth::logout();
header('Content-Type: application/json');
echo json_encode(['success' => true, 'message' => 'Logout realizado com sucesso']);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_logout_api']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
public static function registerApi(): void
{
try {
// Validar método HTTP
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
echo json_encode(['success' => false, 'message' => 'Método não permitido']);
return;
}
// Sanitizar inputs
$email = Sanitize::email($_POST['email'] ?? '');
$password = $_POST['password'] ?? '';
$confirmPassword = $_POST['confirm_password'] ?? '';
$firstName = Sanitize::string($_POST['first_name'] ?? '');
$lastName = Sanitize::string($_POST['last_name'] ?? '');
// Validar campos obrigatórios
if (empty($email) || empty($password) || empty($confirmPassword) || empty($firstName) || empty($lastName)) {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'Todos os campos são obrigatórios']);
return;
}
// Validar formato de email
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'Formato de email inválido']);
return;
}
// Validar passwords
if ($password !== $confirmPassword) {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'Passwords não coincidem']);
return;
}
if (strlen($password) < 8) {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'Password deve ter pelo menos 8 caracteres']);
return;
}
// Verificar se email já existe
$userModel = new \App\Modules\Users\Models\UserModel();
if ($userModel->findByEmail($email)) {
http_response_code(409);
echo json_encode(['success' => false, 'message' => 'Email já registado']);
return;
}
// Criar utilizador
$userId = $userModel->create([
'first_name' => $firstName,
'last_name' => $lastName,
'email' => $email,
'password' => password_hash($password, PASSWORD_DEFAULT),
'is_active' => 1
]);
if ($userId) {
http_response_code(201);
echo json_encode(['success' => true, 'message' => 'Registo realizado com sucesso']);
} else {
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro ao criar utilizador']);
}
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_register_api']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
public static function userApi(): void
{
try {
// Validar método HTTP
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
http_response_code(405);
echo json_encode(['success' => false, 'message' => 'Método não permitido']);
return;
}
// Verificar autenticação
if (!Auth::check()) {
http_response_code(401);
echo json_encode(['success' => false, 'message' => 'Utilizador não autenticado']);
return;
}
// Obter dados do utilizador autenticado
$userId = Auth::id();
if (!$userId) {
http_response_code(401);
echo json_encode(['success' => false, 'message' => 'Utilizador não autenticado']);
return;
}
$userModel = new \App\Modules\Users\Models\UserModel();
$userData = $userModel->find($userId);
if (!$userData) {
http_response_code(404);
echo json_encode(['success' => false, 'message' => 'Utilizador não encontrado']);
return;
}
unset($userData['password'], $userData['remember_token'], $userData['remember_token_expires']);
header('Content-Type: application/json');
echo json_encode(['success' => true, 'data' => $userData]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'auth_user_api']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
}
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace App\Modules\Auth;
use App\Core\Router;
use App\Core\View;
use App\Core\ServiceContainer;
class Module
{
public static function registerRoutes(Router $router): void
{
// Registar rotas do módulo
if (file_exists(__DIR__ . '/Routes/web.php')) {
require __DIR__ . '/Routes/web.php';
}
if (file_exists(__DIR__ . '/Routes/api.php')) {
require __DIR__ . '/Routes/api.php';
}
}
public static function registerMenu(): void
{
// Registar menu do módulo
if (file_exists(__DIR__ . '/menu.php')) {
require __DIR__ . '/menu.php';
}
}
public static function registerServices(): void
{
// Registar namespace das views do módulo
View::addNamespace('auth', __DIR__ . '/Views');
$container = ServiceContainer::getInstance();
// Registar serviços do módulo aqui
}
}
+11
View File
@@ -0,0 +1,11 @@
<?php
use App\Core\Router;
use App\Modules\Auth\Controllers\AuthController;
$router = Router::getInstance();
// --- AUTH API ROUTES - SEGURANÇA MÁXIMA ---
$router->post('/api/auth/login', [AuthController::class, 'loginApi']);
$router->post('/api/auth/logout', [AuthController::class, 'logoutApi']);
$router->post('/api/auth/register', [AuthController::class, 'registerApi']);
$router->get('/api/auth/user', [AuthController::class, 'userApi']);
+25
View File
@@ -0,0 +1,25 @@
<?php
use App\Core\Router;
use App\Modules\Auth\Controllers\AuthController;
$router = Router::getInstance();
// --- AUTH ROUTES ---
$router->get('/login', [AuthController::class, 'showLoginForm']);
$router->post('/login', [AuthController::class, 'handleLogin']);
$router->get('/logout', [AuthController::class, 'logout']);
$router->get('/auth/login', [AuthController::class, 'loginBasic']);
$router->post('/auth/login', [AuthController::class, 'handleLogin']);
$router->get('/auth/register', [AuthController::class, 'registerBasic']);
$router->get('/auth/pass-reset', [AuthController::class, 'passResetBasic']);
$router->get('/auth/login-cover', [AuthController::class, 'loginCover']);
$router->get('/auth/register-cover', [AuthController::class, 'registerCover']);
$router->get('/auth/pass-reset-cover', [AuthController::class, 'passResetCover']);
$router->get('/auth/lock-screen', [AuthController::class, 'lockScreen']);
$router->post('/auth/unlock', [AuthController::class, 'unlock']);
$router->get('/auth/two-step', [AuthController::class, 'twoStepVerification']);
$router->get('/auth/404', [AuthController::class, 'errors404']);
$router->get('/auth/404-cover', [AuthController::class, 'errors404Cover']);
$router->get('/auth/404-alt', [AuthController::class, 'errors404Alt']);
$router->get('/auth/500', [AuthController::class, 'errors500']);
$router->get('/auth/offline', [AuthController::class, 'errorsOffline']);
+52
View File
@@ -0,0 +1,52 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth 404 alt';
$page_description = 'Página Auth 404 alt';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
View::include('layouts/main.php');?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-5">
<div class="card overflow-hidden">
<div class="card-body p-4">
<div class="text-center">
<lord-icon class="avatar-xl" src="/assets/lordicon/etwtznjn.json" trigger="loop" colors="primary:#405189,secondary:#0ab39c">
</lord-icon>
<h1 class="text-primary mb-4">Oops !</h1>
<h4 class="text-uppercase">Sorry, Page not Found 😭</h4>
<p class="text-muted mb-4">The page you are looking for not available!</p>
<a href="/" class="btn btn-success"><i class="mdi mdi-home me-1"></i>Back to home</a>
</div>
</div>
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
</div>
<!-- end auth-page-wrapper -->
<?php
}
]);
?>
+72
View File
@@ -0,0 +1,72 @@
<?php
use App\Core\View;
use App\Core\AssetManager;
// Page variables
$page_title = '404 Not Found';
$page_description = 'The page you are looking for was not found.';
// Render the authentication layout
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<div class="auth-page-wrapper pt-5">
<!-- auth page bg -->
<div class="auth-one-bg-position auth-one-bg" id="auth-particles">
<div class="bg-overlay"></div>
<div class="shape">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 120">
<path d="M 0,36 C 144,53.6 432,123.2 720,124 C 1008,124.8 1296,56.8 1440,40L1440 140L0 140z"></path>
</svg>
</div>
</div>
<!-- auth page content -->
<div class="auth-page-content">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center pt-4">
<div>
<img src="<?php echo View::asset('assets/images/error.svg'); ?>" alt="" class="error-basic-img move-animation">
</div>
<div class="mt-n4">
<h1 class="display-1 fw-medium">404</h1>
<h3 class="text-uppercase">Sorry, Page not Found 😭</h3>
<p class="text-muted mb-4">The page you are looking for not available!</p>
<a href="/" class="btn btn-success"><i class="mdi mdi-home me-1"></i>Back to home</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0 text-muted">&copy; <script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.</p>
</div>
</div>
</div>
</div>
</footer>
</div>
<!-- particles js -->
<!-- particles app js -->
<?php
},
'scripts' => function() {
AssetManager::addFooterJs(View::asset('assets/libs/particles.js/particles.js'));
AssetManager::addFooterJs(View::asset('assets/js/pages/particles.app.js'));
}
]);
?>
+45
View File
@@ -0,0 +1,45 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth 404 cover';
$page_description = 'Página Auth 404 cover';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
?>
<?php View::include('layouts/main.php'); ?>
<?php View::include('layouts/head-css.php');?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper py-5 d-flex justify-content-center align-items-center min-vh-100">
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden p-0">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-7 col-lg-8">
<div class="text-center">
<img src="<?php echo View::asset('/assets/images/error400-cover.png'); ?>" alt="error img" class="img-fluid">
<div class="mt-3">
<h3 class="text-uppercase">Sorry, Page not Found 😭</h3>
<p class="text-muted mb-4">The page you are looking for not available!</p>
<a href="/" class="btn btn-success"><i class="mdi mdi-home me-1"></i>Back to home</a>
</div>
</div>
</div><!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth-page content -->
</div>
<!-- end auth-page-wrapper -->
<?php
}
]);
?>
+46
View File
@@ -0,0 +1,46 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth 500';
$page_description = 'Página Auth 500';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
View::include('layouts/main.php'); ?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper py-5 d-flex justify-content-center align-items-center min-vh-100">
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden p-0">
<div class="row justify-content-center">
<div class="col-xl-4 text-center">
<div class="error-500 position-relative">
<img src="<?php echo View::asset('/assets/images/error500.png'); ?>" alt="" class="img-fluid error-500-img error-img" />
<h1 class="title text-muted">500</h1>
</div>
<div>
<h4>Internal Server Error!</h4>
<p class="text-muted w-75 mx-auto">Server Error 500. We're not exactly sure what happened, but our servers say something is wrong.</p>
<a href="/" class="btn btn-success"><i class="mdi mdi-home me-1"></i>Back to home</a>
</div>
</div><!-- end col-->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth-page content -->
</div>
<!-- end auth-page-wrapper -->
<?php
}
]);
?>
@@ -0,0 +1,125 @@
<?php
use App\Core\View;
?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="card overflow-hidden">
<div class="row g-0">
<div class="col-lg-6">
<div class="p-lg-5 p-4 auth-one-bg h-100">
<div class="bg-overlay"></div>
<div class="position-relative h-100 d-flex flex-column">
<div class="mb-4">
<a href="/index/" class="d-block">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="18">
</a>
</div>
<div class="mt-auto">
<div class="mb-3">
<i class="ri-double-quotes-l display-4 text-success"></i>
</div>
<div id="qoutescarouselIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner text-center text-white pb-5">
<div class="carousel-item active">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" The theme is really great with an amazing customer support."</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
</div>
</div>
<!-- end carousel -->
</div>
</div>
</div>
</div>
<!-- end col -->
<div class="col-lg-6">
<div class="p-lg-5 p-4">
<div>
<h5 class="text-primary">Welcome Back !</h5>
<p class="text-muted">Sign in to continue to <?php echo \App\Core\AppConfig::getCompanyName(); ?>.</p>
</div>
<div class="mt-4">
<form action="index.php">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" id="username" placeholder="Enter username">
</div>
<div class="mb-3">
<div class="float-end">
<a href="/auth-pass-reset-cover/" class="text-muted">Forgot password?</a>
</div>
<label class="form-label" for="password-input">Password</label>
<div class="position-relative auth-pass-inputgroup mb-3">
<input type="password" class="form-control pe-5 password-input" placeholder="Enter password" id="password-input">
<button class="btn btn-link position-absolute end-0 top-0 text-decoration-none text-muted password-addon" type="button" id="password-addon"><i class="ri-eye-fill align-middle"></i></button>
</div>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="auth-remember-check">
<label class="form-check-label" for="auth-remember-check">Remember me</label>
</div>
<div class="mt-4">
<button class="btn btn-success w-100" type="submit">Sign In</button>
</div>
</form>
</div>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
@@ -0,0 +1,154 @@
<?php
use App\Core\View;
?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="card overflow-hidden m-0">
<div class="row justify-content-center g-0">
<div class="col-lg-6">
<div class="p-lg-5 p-4 auth-one-bg h-100">
<div class="bg-overlay"></div>
<div class="position-relative h-100 d-flex flex-column">
<div class="mb-4">
<a href="/index/" class="d-block">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="18">
</a>
</div>
<div class="mt-auto">
<div class="mb-3">
<i class="ri-double-quotes-l display-4 text-success"></i>
</div>
<div id="qoutescarouselIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner text-center text-white pb-5">
<div class="carousel-item active">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" The theme is really great with an amazing customer support."</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
</div>
</div>
<!-- end carousel -->
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="p-lg-5 p-4">
<div>
<h5 class="text-primary">Register Account</h5>
<p class="text-muted">Get your Free <?php echo \App\Core\AppConfig::getCompanyName(); ?> account now.</p>
</div>
<div class="mt-4">
<form class="needs-validation" novalidate action="index.php">
<div class="mb-3">
<label for="useremail" class="form-label">Email <span class="text-danger">*</span></label>
<input type="email" class="form-control" id="useremail" placeholder="Enter email address" required>
<div class="invalid-feedback">
Please enter email
</div>
</div>
<div class="mb-3">
<label for="username" class="form-label">Username <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="username" placeholder="Enter username" required>
<div class="invalid-feedback">
Please enter username
</div>
</div>
<div class="mb-3">
<label class="form-label" for="password-input">Password</label>
<div class="position-relative auth-pass-inputgroup">
<input type="password" class="form-control pe-5 password-input" onpaste="return false" placeholder="Enter password" id="password-input" aria-describedby="passwordInput" pattern="(?=.*\d](?=.*[a-z])(?=.*[A-Z]).{8,}" required>
<button class="btn btn-link position-absolute end-0 top-0 text-decoration-none text-muted password-addon" type="button" id="password-addon"><i class="ri-eye-fill align-middle"></i></button>
<div class="invalid-feedback">
Please enter password
</div>
</div>
</div>
<div class="mb-4">
<p class="mb-0 fs-12 text-muted fst-italic">By registering you agree to the <?php echo \App\Core\AppConfig::getCompanyName(); ?> <a href="#" class="text-primary text-decoration-underline fst-normal fw-medium">Terms of Use</a></p>
</div>
<div id="password-contain" class="p-3 bg-light mb-2 rounded">
<h5 class="fs-14">Password must contain:</h5>
<p id="pass-length" class="invalid fs-13 mb-2">Minimum <b>8 characters</b></p>
<p id="pass-lower" class="invalid fs-13 mb-2">At <b>lowercase</b> letter (a-z)</p>
<p id="pass-upper" class="invalid fs-13 mb-2">At least <b>uppercase</b> letter (A-Z)</p>
<p id="pass-number" class="invalid fs-13 mb-0">A least <b>number</b> (0-9)</p>
</div>
<div class="mt-4">
<button class="btn btn-success w-100" type="submit">Sign Up</button>
</div>
<div class="mt-4 text-center">
<div class="signin-other-title">
<h5 class="fs-13 mb-4 title text-muted">Create account with</h5>
</div>
<div>
<button type="button" class="btn btn-primary btn-icon waves-effect waves-light"><i class="ri-facebook-fill fs-16"></i></button>
<button type="button" class="btn btn-danger btn-icon waves-effect waves-light"><i class="ri-google-fill fs-16"></i></button>
<button type="button" class="btn btn-dark btn-icon waves-effect waves-light"><i class="ri-github-fill fs-16"></i></button>
<button type="button" class="btn btn-info btn-icon waves-effect waves-light"><i class="ri-twitter-fill fs-16"></i></button>
</div>
</div>
</form>
</div>
<div class="mt-5 text-center">
<p class="mb-0">Already have an account ? <a href="/auth-signin-cover/" class="fw-semibold text-primary text-decoration-underline"> Signin</a> </p>
</div>
</div>
</div>
</div>
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
+177
View File
@@ -0,0 +1,177 @@
<?php
use App\Core\View;
?>
<div class="auth-page-wrapper" style="min-height: 100vh; display: flex; flex-direction: column;">
<!-- auth page bg -->
<div class="auth-one-bg-position auth-one-bg" id="auth-particles" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;">
<div class="bg-overlay"></div>
<div class="shape">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 120">
<path d="M 0,36 C 144,53.6 432,123.2 720,124 C 1008,124.8 1296,56.8 1440,40L1440 140L0 140z"></path>
</svg>
</div>
</div>
<!-- auth page content -->
<div class="auth-page-content" style="flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 0;">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-12 text-center mb-4">
<div class="text-white-50">
<div>
<a href="/index/" class="d-inline-block auth-logo">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="20">
</a>
</div>
<p class="mt-3 fs-15 fw-medium">BitReport CRM - Sistema de Gestão Empresarial</p>
</div>
</div>
</div>
<!-- end row -->
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card">
<div class="card-body p-4">
<div class="text-center mt-2">
<h5 class="text-primary">Lock Screen</h5>
<p class="text-muted">Enter your password to unlock the screen!</p>
</div>
<div class="user-thumb text-center">
<img src="<?php echo View::asset('/assets/images/users/avatar-1.jpg'); ?>" class="rounded-circle img-thumbnail avatar-lg" alt="thumbnail">
<h5 class="font-size-15 mt-3">Pedro Alves</h5>
</div>
<div class="p-2 mt-4">
<form id="lockScreenForm" method="POST" action="/auth/unlock">
<div class="mb-3">
<label class="form-label" for="userpassword">Password</label>
<input type="password" class="form-control" id="userpassword" name="password" placeholder="Enter password" required>
</div>
<div class="mb-2 mt-4">
<button class="btn btn-success w-100" type="submit" id="unlockBtn">
<span class="spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span>
<span class="btn-text">Unlock</span>
</button>
</div>
</form><!-- end form -->
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
<div class="mt-4 text-center">
<p class="mb-0">Not you ? return <a href="/login" class="fw-semibold text-primary text-decoration-underline"> Signin </a> </p>
</div>
</div>
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0 text-muted">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<!-- particles js -->
<!-- particles app js -->
<script src="<?php echo View::asset('/assets/libs/particles.js/particles.js'); ?>"></script>
<script src="<?php echo View::asset('/assets/js/pages/particles.app.js'); ?>"></script>
<!-- Lock Screen Form Handler -->
<script>
document.addEventListener('DOMContentLoaded', function() {
const form = document.getElementById('lockScreenForm');
const unlockBtn = document.getElementById('unlockBtn');
const spinner = unlockBtn.querySelector('.spinner-border');
const btnText = unlockBtn.querySelector('.btn-text');
form.addEventListener('submit', async function(e) {
e.preventDefault();
// Show loading state
unlockBtn.disabled = true;
spinner.classList.remove('d-none');
btnText.textContent = 'Unlocking...';
try {
const formData = new FormData(form);
const response = await fetch('/auth/unlock', {
method: 'POST',
body: formData,
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
});
const result = await response.json();
if (result.success) {
// Redirect to dashboard
window.location.href = '/dashboard';
} else {
// Check if we need to redirect to login
if (result.redirect) {
window.location.href = result.redirect;
return;
}
// Show error message
showAlert('error', result.message || 'Invalid password. Please try again.');
}
} catch (error) {
console.error('Error:', error);
if (error.name === 'TypeError' && error.message.includes('fetch')) {
showAlert('error', 'Network error. Please check your connection and try again.');
} else {
showAlert('error', 'An error occurred. Please try again.');
}
} finally {
// Reset button state
unlockBtn.disabled = false;
spinner.classList.add('d-none');
btnText.textContent = 'Unlock';
}
});
function showAlert(type, message) {
// Create alert element
const alertDiv = document.createElement('div');
alertDiv.className = `alert alert-${type === 'error' ? 'danger' : 'success'} alert-dismissible fade show`;
alertDiv.innerHTML = `
${message}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
`;
// Insert before form
form.parentNode.insertBefore(alertDiv, form);
// Auto remove after 5 seconds
setTimeout(() => {
if (alertDiv.parentNode) {
alertDiv.remove();
}
}, 5000);
}
});
</script>
+129
View File
@@ -0,0 +1,129 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth lockscreen cover';
$page_description = 'Página Auth lockscreen cover';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
View::include('layouts/main.php'); ?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="card overflow-hidden">
<div class="row justify-content-center g-0">
<div class="col-lg-6">
<div class="p-lg-5 p-4 auth-one-bg h-100">
<div class="bg-overlay"></div>
<div class="position-relative h-100 d-flex flex-column">
<div class="mb-4">
<a href="/index/" class="d-block">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="18">
</a>
</div>
<div class="mt-auto">
<div class="mb-3">
<i class="ri-double-quotes-l display-4 text-success"></i>
</div>
<div id="qoutescarouselIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner text-center text-white pb-5">
<div class="carousel-item active">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" The theme is really great with an amazing customer support."</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
</div>
</div>
<!-- end carousel -->
</div>
</div>
</div>
</div>
<!-- end col -->
<div class="col-lg-6">
<div class="p-lg-5 p-4">
<div>
<h5 class="text-primary">Lock Screen</h5>
<p class="text-muted">Enter your password to unlock the screen!</p>
</div>
<div class="user-thumb text-center">
<img src="<?php echo View::asset('/assets/images/users/avatar-1.jpg'); ?>" class="rounded-circle img-thumbnail avatar-lg" alt="thumbnail">
<h5 class="font-size-15 mt-3">Pedro Alves</h5>
</div>
<div class="mt-4">
<form>
<div class="mb-3">
<label class="form-label" for="userpassword">Password</label>
<input type="password" class="form-control" id="userpassword" placeholder="Enter password" required>
</div>
<div class="mb-2 mt-4">
<button class="btn btn-success w-100" type="submit">Unlock</button>
</div>
</form><!-- end form -->
</div>
<div class="mt-5 text-center">
<p class="mb-0">Not you ? return <a href="/auth-signin-cover/" class="fw-semibold text-primary text-decoration-underline"> Signin</a></p>
</div>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer start-0">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<?php
}
]);
?>
+170
View File
@@ -0,0 +1,170 @@
<?php
use App\Core\InputSanitizer;
?>
<div class="auth-page-wrapper pt-5">
<!-- auth page bg -->
<div class="auth-one-bg-position auth-one-bg" id="auth-particles">
<div class="bg-overlay"></div>
</div>
<!-- auth page content -->
<div class="auth-page-content">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center mt-sm-5 mb-4 text-white-50">
<div>
<a href="/" class="d-inline-block auth-logo">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="<?php echo \App\Core\AppConfig::getCompanyName(); ?>" height="40">
</a>
</div>
<p class="mt-3 fs-15 fw-medium"><?php echo \App\Core\AppConfig::getCompanyName(); ?></p>
</div>
</div>
</div>
<!-- end row -->
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card mt-4">
<div class="card-body p-4">
<div class="text-center mt-2">
<h5 class="text-primary">Welcome Back!</h5>
<p class="text-muted">Sign in to continue to <?php echo \App\Core\AppConfig::getCompanyName(); ?>.</p>
</div>
<?php if (null !== InputSanitizer::get('error', 'GET')): ?>
<div class="alert alert-danger mt-3" role="alert">
Invalid email or password.
</div>
<?php endif; ?>
<div class="p-2 mt-4">
<div id="login-error" class="alert alert-danger d-none" role="alert"></div>
<form id="login-form" action="/login" method="POST">
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" placeholder="Enter email" required>
</div>
<div class="mb-3">
<div class="float-end">
<a href="#" class="text-muted">Forgot password?</a>
</div>
<label class="form-label" for="password-input">Password</label>
<div class="position-relative auth-pass-inputgroup mb-3">
<input type="password" class="form-control pe-5 password-input" placeholder="Enter password" id="password-input" name="password" required>
<button class="btn btn-link position-absolute end-0 top-0 text-decoration-none text-muted password-addon" type="button" id="password-addon"><i class="ri-eye-fill align-middle"></i></button>
</div>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="1" id="auth-remember-check" name="remember_me">
<label class="form-check-label" for="auth-remember-check">Remember me</label>
</div>
<div class="mt-4">
<button class="btn btn-success w-100" type="submit" id="login-btn">Sign In</button>
</div>
</form>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
</div>
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0 text-muted">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const form = document.getElementById('login-form');
const errorDiv = document.getElementById('login-error');
const submitBtn = document.getElementById('login-btn');
form.addEventListener('submit', async function(e) {
e.preventDefault();
// Disable button and show loading state
submitBtn.disabled = true;
submitBtn.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>Signing in...';
// Hide previous errors
errorDiv.classList.add('d-none');
// Get form data
const formData = new FormData(form);
try {
const response = await fetch('/login', {
method: 'POST',
body: formData
});
const data = await response.json();
if (response.ok && data.success) {
// Redirect to dashboard on success
window.location.href = '/';
} else {
// Show error message
errorDiv.textContent = data.message || 'Invalid credentials';
errorDiv.classList.remove('d-none');
// Re-enable button
submitBtn.disabled = false;
submitBtn.innerHTML = 'Sign In';
}
} catch (error) {
console.error('Login error:', error);
errorDiv.textContent = 'An error occurred. Please try again.';
errorDiv.classList.remove('d-none');
// Re-enable button
submitBtn.disabled = false;
submitBtn.innerHTML = 'Sign In';
}
});
// Password visibility toggle
const passwordAddon = document.getElementById('password-addon');
const passwordInput = document.getElementById('password-input');
if (passwordAddon && passwordInput) {
passwordAddon.addEventListener('click', function() {
const type = passwordInput.type === 'password' ? 'text' : 'password';
passwordInput.type = type;
const icon = this.querySelector('i');
if (icon) {
icon.classList.toggle('ri-eye-fill');
icon.classList.toggle('ri-eye-off-fill');
}
});
}
});
</script>
+113
View File
@@ -0,0 +1,113 @@
<?php
use App\Core\View;
use App\Core\AssetManager;
// Definir variáveis para o layout
$page_title = 'Auth logout basic';
$page_description = 'Página Auth logout basic';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
// Initialize the session
session_start();
// Check if the user is already logged in
if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
session_destroy();
// header("location: auth-signin-basic.php");
// exit;
}
?>
<div class="auth-page-wrapper pt-5">
<!-- auth page bg -->
<div class="auth-one-bg-position auth-one-bg" id="auth-particles">
<div class="bg-overlay"></div>
<div class="shape">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 120">
<path d="M 0,36 C 144,53.6 432,123.2 720,124 C 1008,124.8 1296,56.8 1440,40L1440 140L0 140z"></path>
</svg>
</div>
</div>
<!-- auth page content -->
<div class="auth-page-content">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center mt-sm-5 mb-4 text-white-50">
<div>
<a href="/" class="d-inline-block auth-logo">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="20">
</a>
</div>
<p class="mt-3 fs-15 fw-medium">BitReport CRM - Sistema de Gestão Empresarial</p>
</div>
</div>
</div>
<!-- end row -->
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card mt-4">
<div class="card-body p-4 text-center">
<lord-icon src="/assets/lordicon/hzomhqxz.json" trigger="loop" colors="primary:#405189,secondary:#08a88a" style="width:180px;height:180px">
</lord-icon>
<div class="mt-4 pt-2">
<h5>You are Logged Out</h5>
<p class="text-muted">Obrigado por usar o <span class="fw-semibold"><?php echo \App\Core\AppConfig::getCompanyName(); ?></span> sistema de gestão</p>
<div class="mt-4">
<a href="/auth-signin-basic/" class="btn btn-success w-100">Sign In</a>
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0 text-muted">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<!-- particles js -->
<!-- particles app js -->
<?php
},
'scripts' => function() {
AssetManager::addFooterJs(View::asset('/assets/libs/particles.js/particles.js'));
AssetManager::addFooterJs(View::asset('/assets/js/pages/particles.app.js'));
}
]);
?>
+115
View File
@@ -0,0 +1,115 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth logout cover';
$page_description = 'Página Auth logout cover';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
View::include('layouts/main.php');?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="card overflow-hidden">
<div class="row justify-content-center g-0">
<div class="col-lg-6">
<div class="p-lg-5 p-4 auth-one-bg h-100">
<div class="bg-overlay"></div>
<div class="position-relative h-100 d-flex flex-column">
<div class="mb-4">
<a href="/index/" class="d-block">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="18">
</a>
</div>
<div class="mt-auto">
<div class="mb-3">
<i class="ri-double-quotes-l display-4 text-success"></i>
</div>
<div id="qoutescarouselIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner text-center text-white pb-5">
<div class="carousel-item active">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" The theme is really great with an amazing customer support."</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
</div>
</div>
<!-- end carousel -->
</div>
</div>
</div>
</div>
<!-- end col -->
<div class="col-lg-6">
<div class="p-lg-5 p-4 text-center">
<lord-icon src="/assets/lordicon/hzomhqxz.json" trigger="loop" colors="primary:#405189,secondary:#08a88a" style="width:180px;height:180px">
</lord-icon>
<div class="mt-4 pt-2">
<h5>You are Logged Out</h5>
<p class="text-muted">Obrigado por usar o <span class="fw-semibold"><?php echo \App\Core\AppConfig::getCompanyName(); ?></span> sistema de gestão</p>
<div class="mt-4">
<a href="/auth-signin-basic/" class="btn btn-success w-100">Sign In</a>
</div>
</div>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer start-0">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0">&copy;
<script>document.write(new Date().getFullYear(])</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<?php
}
]);
?>
+50
View File
@@ -0,0 +1,50 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth offline';
$page_description = 'Página Auth offline';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
View::include('layouts/main.php');?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-5">
<div class="card overflow-hidden">
<div class="card-body p-4">
<div class="text-center">
<img src="https://img.<?php echo \App\Core\AppConfig::getCompanyName(); ?>.com/<?php echo \App\Core\AppConfig::getCompanyName(); ?>/images/auth-offline.gif" alt="" height="210">
<h3 class="mt-4 fw-semibold">We're currently offline</h3>
<p class="text-muted mb-4 fs-14">We can't show you this images because you aren't connected to the internet. When you're back online refresh the page or hit the button below</p>
<button class="btn btn-success btn-border" onClick="window.location.href=window.location.href"><i class="ri-refresh-line align-bottom"></i> Refresh</button>
</div>
</div>
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
</div>
<!-- end auth-page-wrapper -->
<?php
}
]);
?>
@@ -0,0 +1,142 @@
<?php
use App\Core\View;
use App\Core\AssetManager;
// Definir variáveis para o layout
$page_title = 'Auth pass change basic';
$page_description = 'Página Auth pass change basic';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
?>
<div class="auth-page-wrapper pt-5">
<!-- auth page bg -->
<div class="auth-one-bg-position auth-one-bg" id="auth-particles">
<div class="bg-overlay"></div>
<div class="shape">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 120">
<path d="M 0,36 C 144,53.6 432,123.2 720,124 C 1008,124.8 1296,56.8 1440,40L1440 140L0 140z"></path>
</svg>
</div>
</div>
<!-- auth page content -->
<div class="auth-page-content">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center mt-sm-5 mb-4 text-white-50">
<div>
<a href="/index/" class="d-inline-block auth-logo">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="20">
</a>
</div>
<p class="mt-3 fs-15 fw-medium">BitReport CRM - Sistema de Gestão Empresarial</p>
</div>
</div>
</div>
<!-- end row -->
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card mt-4">
<div class="card-body p-4">
<div class="text-center mt-2">
<h5 class="text-primary">Create new password</h5>
<p class="text-muted">Your new password must be different from previous used password.</p>
</div>
<div class="p-2">
<form action="auth-signin-basic.php">
<div class="mb-3">
<label class="form-label" for="password-input">Password</label>
<div class="position-relative auth-pass-inputgroup">
<input type="password" class="form-control pe-5 password-input" onpaste="return false" placeholder="Enter password" id="password-input" aria-describedby="passwordInput" pattern="(?=.*\d](?=.*[a-z])(?=.*[A-Z]).{8,}" required>
<button class="btn btn-link position-absolute end-0 top-0 text-decoration-none text-muted password-addon" type="button" id="password-addon"><i class="ri-eye-fill align-middle"></i></button>
</div>
<div id="passwordInput" class="form-text">Must be at least 8 characters.</div>
</div>
<div class="mb-3">
<label class="form-label" for="confirm-password-input">Confirm Password</label>
<div class="position-relative auth-pass-inputgroup mb-3">
<input type="password" class="form-control pe-5 password-input" onpaste="return false" placeholder="Confirm password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" id="confirm-password-input" required>
<button class="btn btn-link position-absolute end-0 top-0 text-decoration-none text-muted password-addon" type="button" id="confirm-password-input"><i class="ri-eye-fill align-middle"></i></button>
</div>
</div>
<div id="password-contain" class="p-3 bg-light mb-2 rounded">
<h5 class="fs-14">Password must contain:</h5>
<p id="pass-length" class="invalid fs-13 mb-2">Minimum <b>8 characters</b></p>
<p id="pass-lower" class="invalid fs-13 mb-2">At <b>lowercase</b> letter (a-z)</p>
<p id="pass-upper" class="invalid fs-13 mb-2">At least <b>uppercase</b> letter (A-Z)</p>
<p id="pass-number" class="invalid fs-13 mb-0">A least <b>number</b> (0-9)</p>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="auth-remember-check">
<label class="form-check-label" for="auth-remember-check">Remember me</label>
</div>
<div class="mt-4">
<button class="btn btn-success w-100" type="submit">Reset Password</button>
</div>
</form>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
<div class="mt-4 text-center">
<p class="mb-0">Wait, I remember my password... <a href="/auth-signin-basic/" class="fw-semibold text-primary text-decoration-underline"> Click here </a> </p>
</div>
</div>
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0 text-muted">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<!-- particles js -->
<!-- particles app js -->
<!-- password-addon init -->
<?php
},
'scripts' => function() {
AssetManager::addFooterJs(View::asset('/assets/libs/particles.js/particles.js'));
AssetManager::addFooterJs(View::asset('/assets/js/pages/particles.app.js'));
AssetManager::addFooterJs(View::asset('/assets/js/pages/passowrd-create.init.js'));
}
]);
?>
+132
View File
@@ -0,0 +1,132 @@
<?php
use App\Core\View;
use App\Core\AssetManager;
$page_title = 'Auth pass reset basic';
$page_description = 'Página Auth pass reset basic';
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<div class="auth-page-wrapper pt-5">
<div class="auth-one-bg-position auth-one-bg" id="auth-particles">
<div class="bg-overlay"></div>
<div class="shape">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 120">
<path d="M 0,36 C 144,53.6 432,123.2 720,124 C 1008,124.8 1296,56.8 1440,40L1440 140L0 140z"></path>
</svg>
</div>
</div>
<div class="auth-page-content">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center mt-sm-5 mb-4 text-white-50">
<div>
<a href="/index/" class="d-inline-block auth-logo">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="20">
</a>
</div>
<p class="mt-3 fs-15 fw-medium">BitReport CRM - Sistema de Gestão Empresarial</p>
</div>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card mt-4">
<div class="card-body p-4">
<div class="text-center mt-2">
<h5 class="text-primary">Forgot Password?</h5>
<p class="text-muted">Reset password with <?php echo \App\Core\AppConfig::getCompanyName(); ?></p>
<lord-icon src="/assets/lordicon/rhvddzym.json" trigger="loop" colors="primary:#0ab39c" class="avatar-xl"></lord-icon>
</div>
<div class="alert border-0 alert-warning text-center mb-2 mx-2" role="alert">
Enter your email and instructions will be sent to you!
</div>
<div class="p-2" x-data="resetPassword()">
<div x-show="success" class="alert alert-success text-center mb-4 mt-4 pt-2" role="alert">We have emailed your password reset link!</div>
<form @submit.prevent="submit">
<div class="mb-4">
<label class="form-label">Email</label>
<input type="email" class="form-control" x-model="email" placeholder="Enter Email" required>
<span class="text-danger" x-text="error"></span>
</div>
<div class="text-center mt-4">
<button class="btn btn-success w-100" type="submit" :disabled="loading">
<span x-show="!loading">Send Reset Link</span>
<span x-show="loading">Sending...</span>
</button>
</div>
</form>
</div>
</div>
</div>
<div class="mt-4 text-center">
<p class="mb-0">Wait, I remember my password... <a href="/auth-signin-basic/" class="fw-semibold text-primary text-decoration-underline"> Click here </a> </p>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0 text-muted">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
</div>
<script>
function resetPassword(){
return {
email: '',
loading: false,
error: '',
success: false,
async submit(){
this.error = '';
this.success = false;
this.loading = true;
try{
const res = await fetch('/api/auth/password-reset', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email: this.email })
});
const data = await res.json();
if(res.ok && data.success){
this.success = true;
} else {
this.error = data.message || 'Failed to process request';
}
} catch(e){
this.error = 'Network error';
} finally {
this.loading = false;
}
}
}
}
</script>
<?php
},
'scripts' => function() {
AssetManager::addFooterJs(View::asset('/assets/libs/particles.js/particles.js'));
AssetManager::addFooterJs(View::asset('/assets/js/pages/particles.app.js'));
}
]);
+132
View File
@@ -0,0 +1,132 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth pass reset cover';
$page_description = 'Página Auth pass reset cover';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
?>
<?php View::include('layouts/main.php'); ?>
<?php View::include('layouts/head-css.php');?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="card overflow-hidden">
<div class="row justify-content-center g-0">
<div class="col-lg-6">
<div class="p-lg-5 p-4 auth-one-bg h-100">
<div class="bg-overlay"></div>
<div class="position-relative h-100 d-flex flex-column">
<div class="mb-4">
<a href="/index/" class="d-block">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="18">
</a>
</div>
<div class="mt-auto">
<div class="mb-3">
<i class="ri-double-quotes-l display-4 text-success"></i>
</div>
<div id="qoutescarouselIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner text-center text-white pb-5">
<div class="carousel-item active">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" The theme is really great with an amazing customer support."</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
</div>
</div>
<!-- end carousel -->
</div>
</div>
</div>
</div>
<!-- end col -->
<div class="col-lg-6">
<div class="p-lg-5 p-4">
<h5 class="text-primary">Forgot Password?</h5>
<p class="text-muted">Reset password with <?php echo \App\Core\AppConfig::getCompanyName(); ?></p>
<div class="mt-2 text-center">
<lord-icon src="/assets/lordicon/rhvddzym.json" trigger="loop" colors="primary:#0ab39c" class="avatar-xl">
</lord-icon>
</div>
<div class="alert border-0 alert-warning text-center mb-2 mx-2" role="alert">
Enter your email and instructions will be sent to you!
</div>
<div class="p-2">
<form>
<div class="mb-4">
<label class="form-label">Email</label>
<input type="email" class="form-control" id="email" placeholder="Enter email address">
</div>
<div class="text-center mt-4">
<button class="btn btn-success w-100" type="submit">Send Reset Link</button>
</div>
</form><!-- end form -->
</div>
<div class="mt-5 text-center">
<p class="mb-0">Wait, I remember my password... <a href="/auth-signin-cover/" class="fw-semibold text-primary text-decoration-underline"> Click here </a> </p>
</div>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<?php
}
]);
?>
+16
View File
@@ -0,0 +1,16 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth signin cover';
$page_description = 'Página Auth signin cover';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
View::include('@auth/components/auth/signin-cover.php');
}
]);
?>
+354
View File
@@ -0,0 +1,354 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth signup basic';
$page_description = 'Página Auth signup basic';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
// Check if user is logged in
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
header("location: /");
exit;
}
?>
<div class="auth-page-wrapper pt-5">
<!-- auth page bg -->
<div class="auth-one-bg-position auth-one-bg" id="auth-particles">
<div class="bg-overlay"></div>
<div class="shape">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 120">
<path d="M 0,36 C 144,53.6 432,123.2 720,124 C 1008,124.8 1296,56.8 1440,40L1440 140L0 140z"></path>
</svg>
</div>
</div>
<!-- auth page content -->
<div class="auth-page-content">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center mt-sm-5 mb-4 text-white-50">
<div>
<a href="/" class="d-inline-block auth-logo">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="20">
</a>
</div>
<p class="mt-3 fs-15 fw-medium">BitReport CRM - Sistema de Gestão Empresarial</p>
</div>
</div>
</div>
<!-- end row -->
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card mt-4">
<div class="card-body p-4">
<div class="text-center mt-2">
<h5 class="text-primary">Create New Account</h5>
<p class="text-muted">Register a new user account</p>
</div>
<div class="p-2 mt-4">
<form id="registerForm" class="needs-validation" novalidate>
<div class="mb-3">
<label for="first_name" class="form-label">First Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="first_name" id="first_name" placeholder="Enter first name" required>
<div class="invalid-feedback" id="first_name-error"></div>
</div>
<div class="mb-3">
<label for="last_name" class="form-label">Last Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="last_name" id="last_name" placeholder="Enter last name" required>
<div class="invalid-feedback" id="last_name-error"></div>
</div>
<div class="mb-3">
<label for="useremail" class="form-label">Email <span class="text-danger">*</span></label>
<input type="email" class="form-control" name="email" id="useremail" placeholder="Enter email address" required>
<div class="invalid-feedback" id="email-error"></div>
</div>
<div class="mb-3">
<label for="username" class="form-label">Username <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="username" id="username" placeholder="Enter username" required>
<div class="invalid-feedback" id="username-error"></div>
</div>
<div class="mb-3">
<label for="role" class="form-label">Role <span class="text-danger">*</span></label>
<select class="form-select" name="role" id="role" required>
<option value="">Select role</option>
<option value="user">User</option>
<option value="admin">Admin</option>
<option value="manager">Manager</option>
</select>
<div class="invalid-feedback" id="role-error"></div>
</div>
<div class="mb-3">
<label class="form-label" for="password-input">Password</label>
<div class="position-relative auth-pass-inputgroup">
<input type="password" class="form-control pe-5 password-input" name="password" onpaste="return false" placeholder="Enter password" id="password-input" aria-describedby="passwordInput" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" required>
<button class="btn btn-link position-absolute end-0 top-0 text-decoration-none text-muted password-addon" type="button" id="password-addon"><i class="ri-eye-fill align-middle"></i></button>
<div class="invalid-feedback" id="password-error"></div>
</div>
</div>
<div class="mb-4">
<p class="mb-0 fs-12 text-muted fst-italic">By registering you agree to the <?php echo \App\Core\AppConfig::getCompanyName(); ?> <a href="#" class="text-primary text-decoration-underline fst-normal fw-medium">Terms of Use</a></p>
</div>
<div id="password-contain" class="p-3 bg-light mb-2 rounded">
<h5 class="fs-13">Password must contain:</h5>
<p id="pass-length" class="invalid fs-12 mb-2">Minimum <b>8 characters</b></p>
<p id="pass-lower" class="invalid fs-12 mb-2">At <b>lowercase</b> letter (a-z)</p>
<p id="pass-upper" class="invalid fs-12 mb-2">At least <b>uppercase</b> letter (A-Z)</p>
<p id="pass-number" class="invalid fs-12 mb-0">A least <b>number</b> (0-9)</p>
</div>
<div class="mt-4">
<button class="btn btn-success w-100" type="submit" id="registerBtn">
<span class="spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span>
Create Account
</button>
</div>
</form>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
<div class="mt-4 text-center">
<p class="mb-0">Already have an account ? <a href="/login" class="fw-semibold text-primary text-decoration-underline"> Sign In </a> </p>
</div>
</div>
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0 text-muted">&copy; <script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>. Crafted with <i class="mdi mdi-heart text-danger"></i> by Themesdesign</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<!-- app-scripts.php removido para evitar warning de include inexistente -->
<script>
document.addEventListener('DOMContentLoaded', function() {
const registerForm = document.getElementById('registerForm');
const registerBtn = document.getElementById('registerBtn');
const spinner = registerBtn.querySelector('.spinner-border');
const btnText = registerBtn.querySelector('span:not(.spinner-border)');
// Password visibility toggle
const passwordAddon = document.getElementById('password-addon');
const passwordInput = document.getElementById('password-input');
passwordAddon.addEventListener('click', function() {
const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
passwordInput.setAttribute('type', type);
this.querySelector('i').classList.toggle('ri-eye-fill');
this.querySelector('i').classList.toggle('ri-eye-off-fill');
});
// Password strength validation
passwordInput.addEventListener('input', function() {
const password = this.value;
const length = document.getElementById('pass-length');
const lower = document.getElementById('pass-lower');
const upper = document.getElementById('pass-upper');
const number = document.getElementById('pass-number');
// Check length
if (password.length >= 8) {
length.classList.remove('invalid');
length.classList.add('valid');
} else {
length.classList.remove('valid');
length.classList.add('invalid');
}
// Check lowercase
if (/[a-z]/.test(password)) {
lower.classList.remove('invalid');
lower.classList.add('valid');
} else {
lower.classList.remove('valid');
lower.classList.add('invalid');
}
// Check uppercase
if (/[A-Z]/.test(password)) {
upper.classList.remove('invalid');
upper.classList.add('valid');
} else {
upper.classList.remove('valid');
upper.classList.add('invalid');
}
// Check number
if (/[0-9]/.test(password)) {
number.classList.remove('invalid');
number.classList.add('valid');
} else {
number.classList.remove('valid');
number.classList.add('invalid');
}
});
// Form submission
registerForm.addEventListener('submit', async function(e) {
e.preventDefault();
// Clear previous errors
clearErrors();
// Get form data
const formData = new FormData(registerForm);
const userData = {
first_name: formData.get('first_name'),
last_name: formData.get('last_name'),
email: formData.get('email'),
username: formData.get('username'),
password: formData.get('password'),
role: formData.get('role')
};
// Validate input
if (!userData.first_name || !userData.last_name || !userData.email || !userData.username || !userData.password || !userData.role) {
showError('general', 'All fields are required');
return;
}
// Validate email format
if (!isValidEmail(userData.email)) {
showError('email', 'Invalid email format');
return;
}
// Validate password strength
if (userData.password.length < 8) {
showError('password', 'Password must be at least 8 characters long');
return;
}
// Show loading state
setLoading(true);
try {
const response = await fetch('/api/auth/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(userData)
});
const result = await response.json();
if (result.success) {
// Show success message
Swal.fire({
title: 'Success!',
text: result.message,
icon: 'success',
confirmButtonText: 'Continue',
timer: 2000,
timerProgressBar: true
}).then(() => {
// Reset form
registerForm.reset();
// Redirect to dashboard or user list
window.location.href = '/';
});
} else {
// Show error message
showError('general', result.message);
}
} catch (error) {
console.error('Registration error:', error);
showError('general', 'Network error. Please try again.');
} finally {
setLoading(false);
}
});
function clearErrors() {
document.querySelectorAll('.is-invalid').forEach(el => {
el.classList.remove('is-invalid');
});
document.querySelectorAll('.invalid-feedback').forEach(el => {
el.textContent = '';
});
}
function showError(field, message) {
if (field === 'general') {
// Show general error at top of form
const errorDiv = document.createElement('div');
errorDiv.className = 'alert alert-danger mb-3';
errorDiv.textContent = message;
registerForm.insertBefore(errorDiv, registerForm.firstChild);
// Remove after 5 seconds
setTimeout(() => {
errorDiv.remove();
}, 5000);
} else {
const input = document.getElementById(field === 'email' ? 'useremail' : field);
const errorDiv = document.getElementById(field === 'email' ? 'email-error' : field + '-error');
if (input && errorDiv) {
input.classList.add('is-invalid');
errorDiv.textContent = message;
}
}
}
function setLoading(loading) {
if (loading) {
registerBtn.disabled = true;
spinner.classList.remove('d-none');
btnText.textContent = 'Creating Account...';
} else {
registerBtn.disabled = false;
spinner.classList.add('d-none');
btnText.textContent = 'Create Account';
}
}
function isValidEmail(email) {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailRegex.test(email);
}
});
</script>
<?php
}
]);
?>
+16
View File
@@ -0,0 +1,16 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth signup cover';
$page_description = 'Página Auth signup cover';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
View::include('@auth/components/auth/signup-cover.php');
}
]);
?>
@@ -0,0 +1,38 @@
<?php
use App\Core\View;
use App\Core\AppConfig;
?>
<div class="auth-page-wrapper pt-5">
<div class="auth-one-bg-position auth-one-bg" id="auth-particles">
<div class="bg-overlay"></div>
<div class="shape">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 120">
<path d="M 0,36 C 144,53.6 432,123.2 720,124 C 1008,124.8 1296,56.8 1440,40L1440 140L0 140z"></path>
</svg>
</div>
</div>
<div class="auth-page-content">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card mt-4">
<div class="card-body p-4 text-center">
<div class="avatar-lg mx-auto mt-2">
<div class="avatar-title bg-light text-success display-3 rounded-circle">
<i class="ri-checkbox-circle-fill"></i>
</div>
</div>
<div class="mt-4 pt-2">
<h4>Well done !</h4>
<p class="text-muted mx-4">Aww yeah, you successfully read this important message.</p>
<div class="mt-4">
<a href="/auth-signin-basic/" class="btn btn-success w-100">Back to Dashboard</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,117 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth success msg cover';
$page_description = 'Página Auth success msg cover';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
View::include('layouts/main.php');?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="card overflow-hidden">
<div class="row justify-content-center g-0">
<div class="col-lg-6">
<div class="p-lg-5 p-4 auth-one-bg h-100">
<div class="bg-overlay"></div>
<div class="position-relative h-100 d-flex flex-column">
<div class="mb-4">
<a href="/index/" class="d-block">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="18">
</a>
</div>
<div class="mt-auto">
<div class="mb-3">
<i class="ri-double-quotes-l display-4 text-success"></i>
</div>
<div id="qoutescarouselIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner text-center text-white pb-5">
<div class="carousel-item active">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" The theme is really great with an amazing customer support."</p>
</div>
<div class="carousel-item">
<p class="fs-15 fst-italic">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
</div>
</div>
<!-- end carousel -->
</div>
</div>
</div>
</div>
<!-- end col -->
<div class="col-lg-6">
<div class="p-lg-5 p-4 text-center">
<div class="avatar-lg mx-auto mt-2">
<div class="avatar-title bg-light text-success display-3 rounded-circle">
<i class="ri-checkbox-circle-fill"></i>
</div>
</div>
<div class="mt-4 pt-2">
<h4>Well done !</h4>
<p class="text-muted mx-4">Aww yeah, you successfully read this important message.</p>
<div class="mt-4">
<a href="/auth-signin-basic/" class="btn btn-success w-100">Back to Dashboard</a>
</div>
</div>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0">&copy;
<script>document.write(new Date().getFullYear(])</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<?php
}
]);
?>
+149
View File
@@ -0,0 +1,149 @@
<?php
use App\Core\View;
use App\Core\AssetManager;
// Definir variáveis para o layout
$page_title = 'Auth twostep basic';
$page_description = 'Página Auth twostep basic';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
?>
<div class="auth-page-wrapper pt-5">
<!-- auth page bg -->
<div class="auth-one-bg-position auth-one-bg" id="auth-particles">
<div class="bg-overlay"></div>
<div class="shape">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 120">
<path d="M 0,36 C 144,53.6 432,123.2 720,124 C 1008,124.8 1296,56.8 1440,40L1440 140L0 140z"></path>
</svg>
</div>
</div>
<!-- auth page content -->
<div class="auth-page-content">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center mt-sm-5 mb-4 text-white-50">
<div>
<a href="/index/" class="d-inline-block auth-logo">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="20">
</a>
</div>
<p class="mt-3 fs-15 fw-medium">BitReport CRM - Sistema de Gestão Empresarial</p>
</div>
</div>
</div>
<!-- end row -->
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card mt-4">
<div class="card-body p-4">
<div class="mb-4">
<div class="avatar-lg mx-auto">
<div class="avatar-title bg-light text-primary display-5 rounded-circle">
<i class="ri-mail-line"></i>
</div>
</div>
</div>
<div class="p-2 mt-4">
<div class="text-muted text-center mb-4 mx-lg-3">
<h4>Verify Your Email</h4>
<p>Please enter the 4 digit code sent to <span class="fw-semibold">[email protected]</span></p>
</div>
<form autocomplete="off">
<div class="row">
<div class="col-3">
<div class="mb-3">
<label for="digit1-input" class="visually-hidden">Digit 1</label>
<input type="text" class="form-control form-control-lg bg-light border-light text-center" onkeyup="moveToNext(1, event)" maxLength="1" id="digit1-input">
</div>
</div><!-- end col -->
<div class="col-3">
<div class="mb-3">
<label for="digit2-input" class="visually-hidden">Digit 2</label>
<input type="text" class="form-control form-control-lg bg-light border-light text-center" onkeyup="moveToNext(2, event)" maxLength="1" id="digit2-input">
</div>
</div><!-- end col -->
<div class="col-3">
<div class="mb-3">
<label for="digit3-input" class="visually-hidden">Digit 3</label>
<input type="text" class="form-control form-control-lg bg-light border-light text-center" onkeyup="moveToNext(3, event)" maxLength="1" id="digit3-input">
</div>
</div><!-- end col -->
<div class="col-3">
<div class="mb-3">
<label for="digit4-input" class="visually-hidden">Digit 4</label>
<input type="text" class="form-control form-control-lg bg-light border-light text-center" onkeyup="moveToNext(4, event)" maxLength="1" id="digit4-input">
</div>
</div><!-- end col -->
</div>
</form><!-- end form -->
<div class="mt-3">
<button type="button" class="btn btn-success w-100">Confirm</button>
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
<div class="mt-4 text-center">
<p class="mb-0">Didn't receive a code ? <a href="/auth-pass-reset-basic/" class="fw-semibold text-primary text-decoration-underline">Resend</a> </p>
</div>
</div>
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0 text-muted">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<!-- particles js -->
<!-- particles app js -->
<!-- two-step-verification js -->
<?php
},
'scripts' => function() {
AssetManager::addFooterJs(View::asset('/assets/libs/particles.js/particles.js'));
AssetManager::addFooterJs(View::asset('/assets/js/pages/particles.app.js'));
AssetManager::addFooterJs(View::asset('/assets/js/pages/two-step-verification.init.js'));
}
]);
?>
+163
View File
@@ -0,0 +1,163 @@
<?php
use App\Core\View;
// Definir variáveis para o layout
$page_title = 'Auth twostep cover';
$page_description = 'Página Auth twostep cover';
// Incluir o layout principal
View::render('layouts/auth.php', [
'title' => $page_title,
'description' => $page_description,
'page_content' => function() {
?>
<?php
View::include('layouts/main.php'); ?>
<!-- auth-page wrapper -->
<div class="auth-page-wrapper auth-bg-cover py-5 d-flex justify-content-center align-items-center min-vh-100">
<div class="bg-overlay"></div>
<!-- auth-page content -->
<div class="auth-page-content overflow-hidden pt-lg-5">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="card overflow-hidden">
<div class="row justify-content-center g-0">
<div class="col-lg-6">
<div class="p-lg-5 p-4 auth-one-bg h-100">
<div class="bg-overlay"></div>
<div class="position-relative h-100 d-flex flex-column">
<div class="mb-4">
<a href="/index/" class="d-block">
<img src="<?php echo \App\Core\AppConfig::getLogoLight(); ?>" alt="" height="18">
</a>
</div>
<div class="mt-auto">
<div class="mb-3">
<i class="ri-double-quotes-l display-4 text-success"></i>
</div>
<div id="qoutescarouselIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#qoutescarouselIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner text-center text-white pb-5">
<div class="carousel-item active">
<p class="fs-15">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
<div class="carousel-item">
<p class="fs-15">" The theme is really great with an amazing customer support."</p>
</div>
<div class="carousel-item">
<p class="fs-15">" Great! Clean code, clean design, easy for customization. Thanks very much! "</p>
</div>
</div>
</div>
<!-- end carousel -->
</div>
</div>
</div>
</div>
<!-- end col -->
<div class="col-lg-6">
<div class="p-lg-5 p-4">
<div class="mb-4">
<div class="avatar-lg mx-auto">
<div class="avatar-title bg-light text-primary display-5 rounded-circle">
<i class="ri-mail-line"></i>
</div>
</div>
</div>
<div class="text-muted text-center mx-lg-3">
<h4 class="">Verify Your Email</h4>
<p>Please enter the 4 digit code sent to <span class="fw-semibold">[email protected]</span></p>
</div>
<div class="mt-4">
<form autocomplete="off">
<div class="row">
<div class="col-3">
<div class="mb-3">
<label for="digit1-input" class="visually-hidden">Digit 1</label>
<input type="text" class="form-control form-control-lg bg-light border-light text-center" onkeyup="moveToNext(1, event)" maxLength="1" id="digit1-input">
</div>
</div><!-- end col -->
<div class="col-3">
<div class="mb-3">
<label for="digit2-input" class="visually-hidden">Digit 2</label>
<input type="text" class="form-control form-control-lg bg-light border-light text-center" onkeyup="moveToNext(2, event)" maxLength="1" id="digit2-input">
</div>
</div><!-- end col -->
<div class="col-3">
<div class="mb-3">
<label for="digit3-input" class="visually-hidden">Digit 3</label>
<input type="text" class="form-control form-control-lg bg-light border-light text-center" onkeyup="moveToNext(3, event)" maxLength="1" id="digit3-input">
</div>
</div><!-- end col -->
<div class="col-3">
<div class="mb-3">
<label for="digit4-input" class="visually-hidden">Digit 4</label>
<input type="text" class="form-control form-control-lg bg-light border-light text-center" onkeyup="moveToNext(4, event)" maxLength="1" id="digit4-input">
</div>
</div><!-- end col -->
</div>
<div class="mt-3">
<button type="button" class="btn btn-success w-100">Confirm</button>
</div>
</form>
</div>
<div class="mt-5 text-center">
<p class="mb-0">Didn't receive a code ? <a href="/auth-pass-reset-cover/" class="fw-semibold text-primary text-decoration-underline">Resend</a> </p>
</div>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end auth page content -->
<!-- footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<p class="mb-0">&copy;
<script>document.write(new Date().getFullYear())</script> <?php echo \App\Core\AppConfig::getCompanyName(); ?>.
</p>
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end auth-page-wrapper -->
<!-- two-step-verification js -->
<script src="<?php echo View::asset('/assets/js/pages/two-step-verification.init.js'); ?>"></script>
<?php
}
]);
?>
@@ -0,0 +1,369 @@
<?php
namespace App\Modules\Redirects\Controllers\Api;
use App\Core\BaseController;
use App\Core\ErrorReporter;
class RedirectsApiController extends BaseController
{
public function __construct()
{
parent::__construct('Redirects');
}
/**
* Get redirect types for forms
*/
public function getRedirectTypes(): void
{
try {
header('Content-Type: application/json');
$types = [
['value' => '302', 'label' => '302 - Temporary Redirect'],
['value' => '301', 'label' => '301 - Permanent Redirect'],
['value' => 'meta', 'label' => 'Meta Refresh'],
['value' => 'javascript', 'label' => 'JavaScript']
];
echo json_encode([
'success' => true,
'data' => $types
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_api_get_types']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
/**
* Get redirect statuses for forms
*/
public function getStatuses(): void
{
try {
header('Content-Type: application/json');
$statuses = [
['value' => '1', 'label' => 'Active'],
['value' => '0', 'label' => 'Inactive']
];
echo json_encode([
'success' => true,
'data' => $statuses
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_api_get_statuses']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
/**
* Get filter types for redirects
*/
public function getFilterTypes(): void
{
try {
header('Content-Type: application/json');
$filterTypes = [
['value' => 'country', 'label' => 'Country'],
['value' => 'browser', 'label' => 'Browser'],
['value' => 'device_type', 'label' => 'Device Type'],
['value' => 'os', 'label' => 'Operating System'],
['value' => 'language', 'label' => 'Language'],
['value' => 'hour', 'label' => 'Hour of Day'],
['value' => 'referer', 'label' => 'Referer']
];
echo json_encode([
'success' => true,
'data' => $filterTypes
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_api_get_filter_types']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
/**
* Get filter operators for redirects
*/
public function getFilterOperators(): void
{
try {
header('Content-Type: application/json');
$operators = [
['value' => 'equals', 'label' => 'Equals'],
['value' => 'contains', 'label' => 'Contains'],
['value' => 'starts_with', 'label' => 'Starts with'],
['value' => 'ends_with', 'label' => 'Ends with'],
['value' => 'in', 'label' => 'In list'],
['value' => 'not_in', 'label' => 'Not in list'],
['value' => 'greater_than', 'label' => 'Greater than'],
['value' => 'less_than', 'label' => 'Less than'],
['value' => 'between', 'label' => 'Between']
];
echo json_encode([
'success' => true,
'data' => $operators
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_api_get_filter_operators']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
/**
* Get redirect settings
*/
public function getSettings(): void
{
try {
header('Content-Type: application/json');
// Default settings for redirects module
$settings = [
'default_redirect_type' => '302',
'tracking_enabled' => true,
'max_redirects_per_day' => 10000,
'enable_analytics' => true,
'enable_filters' => true,
'cache_redirects' => true,
'cache_duration' => 3600
];
echo json_encode([
'success' => true,
'data' => $settings
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_api_get_settings']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
/**
* Update redirect settings
*/
public function updateSettings(): void
{
try {
header('Content-Type: application/json');
$input = json_decode(file_get_contents('php://input'), true) ?: [];
// Here you would normally save settings to database
// For now, just return success
echo json_encode([
'success' => true,
'message' => 'Settings updated successfully',
'data' => $input
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_api_update_settings']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
/**
* Get redirect statistics
*/
public function statsApi(): void
{
try {
header('Content-Type: application/json');
$startDate = $_GET['start_date'] ?? null;
$endDate = $_GET['end_date'] ?? null;
$trackerId = $_GET['tracker_id'] ?? null;
$country = $_GET['country'] ?? null;
$device = $_GET['device'] ?? null;
$browser = $_GET['browser'] ?? null;
$os = $_GET['os'] ?? null;
// Build WHERE clause for filtering
$whereConditions = [];
$params = [];
if ($startDate && $endDate) {
$whereConditions[] = "DATE(timestamp) BETWEEN ? AND ?";
$params[] = $startDate;
$params[] = $endDate;
} elseif ($startDate) {
$whereConditions[] = "DATE(timestamp) >= ?";
$params[] = $startDate;
} elseif ($endDate) {
$whereConditions[] = "DATE(timestamp) <= ?";
$params[] = $endDate;
}
if ($trackerId) {
$whereConditions[] = "redirect_id = ?";
$params[] = $trackerId;
}
if ($country) {
$whereConditions[] = "country_code = ?";
$params[] = $country;
}
if ($device) {
$whereConditions[] = "device_type = ?";
$params[] = $device;
}
if ($browser) {
$whereConditions[] = "browser = ?";
$params[] = $browser;
}
if ($os) {
$whereConditions[] = "os = ?";
$params[] = $os;
}
$whereClause = empty($whereConditions) ? "" : "WHERE " . implode(" AND ", $whereConditions);
// Get overall stats from database
$sql = "SELECT
COUNT(*) as total_clicks,
COUNT(DISTINCT session_id) as unique_clicks,
COUNT(DISTINCT ip_address) as unique_ips,
AVG(response_time_ms) as avg_response_time
FROM redirect_stats " . $whereClause;
$overviewStats = \App\Core\DatabaseManager::getInstance()->fetch($sql, $params) ?: [
'total_clicks' => 0,
'unique_clicks' => 0,
'unique_ips' => 0,
'avg_response_time' => 0
];
// Get stats by country
$countryWhereConditions = array_merge($whereConditions, ["country_code IS NOT NULL", "country_code != ''"]);
$countryWhereClause = "WHERE " . implode(" AND ", $countryWhereConditions);
$sql = "SELECT
country_code,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$countryWhereClause
GROUP BY country_code
ORDER BY clicks DESC
LIMIT 10";
$countryStats = \App\Core\DatabaseManager::getInstance()->fetchAll($sql, $params) ?: [];
// Get stats by device
$deviceWhereConditions = array_merge($whereConditions, ["device_type IS NOT NULL"]);
$deviceWhereClause = empty($deviceWhereConditions) ? "" : "WHERE " . implode(" AND ", $deviceWhereConditions);
$sql = "SELECT
device_type,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$deviceWhereClause
GROUP BY device_type
ORDER BY clicks DESC";
$deviceStats = \App\Core\DatabaseManager::getInstance()->fetchAll($sql, $params) ?: [];
// Get stats by browser
$browserWhereConditions = array_merge($whereConditions, ["browser IS NOT NULL"]);
$browserWhereClause = empty($browserWhereConditions) ? "" : "WHERE " . implode(" AND ", $browserWhereConditions);
$sql = "SELECT
browser,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$browserWhereClause
GROUP BY browser
ORDER BY clicks DESC";
$browserStats = \App\Core\DatabaseManager::getInstance()->fetchAll($sql, $params) ?: [];
echo json_encode([
'success' => true,
'data' => [
'overview' => $overviewStats,
'by_country' => $countryStats,
'by_device' => $deviceStats,
'by_browser' => $browserStats
]
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_api_stats']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
/**
* Get all redirects (API endpoint)
*/
public function index(): void
{
try {
header('Content-Type: application/json');
$db = \App\Core\DatabaseManager::getInstance();
// Query explícita, sem SELECT * e sem dummy data
$redirects = $db->fetchAll(
"SELECT
r.id,
r.cuid,
r.analytics_slug,
r.name,
r.source_url,
r.target_url,
r.status,
r.redirect_type,
r.tracking_enabled,
r.created_at,
r.updated_at,
COALESCE(rs.total_clicks, 0) AS total_clicks,
COALESCE(rs.unique_clicks, 0) AS unique_clicks
FROM redirects r
LEFT JOIN (
SELECT
redirect_id,
COUNT(*) AS total_clicks,
COUNT(DISTINCT ip_address) AS unique_clicks
FROM redirect_stats
GROUP BY redirect_id
) rs ON rs.redirect_id = r.id
WHERE r.status >= 0
ORDER BY r.created_at DESC"
) ?: [];
$stats = [
'total' => (int)count($redirects),
'active' => (int)array_sum(array_map(static function(array $r) { return (int)($r['status'] === 'active' || (string)$r['status'] === '1'); }, $redirects)),
'inactive' => (int)array_sum(array_map(static function(array $r) { return (int)($r['status'] === 'inactive' || (string)$r['status'] === '0'); }, $redirects)),
'total_clicks' => (int)array_sum(array_map(static function(array $r) { return (int)($r['total_clicks'] ?? 0); }, $redirects))
];
echo json_encode([
'success' => true,
'message' => 'Redirects retrieved successfully',
'data' => [
'redirects' => $redirects,
'stats' => $stats
]
]);
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_api_index']);
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Erro interno do servidor']);
}
}
}
@@ -0,0 +1,370 @@
<?php
namespace App\Modules\Redirects\Controllers;
use App\Core\BaseController;
use App\Core\View;
use App\Modules\Redirects\Models\RedirectModel;
use App\Modules\Redirects\Models\RedirectStatsModel;
use App\Modules\Redirects\Services\RedirectProcessor;
class PublicRedirectsController extends BaseController
{
private RedirectModel $redirectModel;
public function __construct()
{
parent::__construct();
$this->redirectModel = new RedirectModel();
}
public function dashboard(): void
{
try {
$stats = [
'total_redirects' => $this->redirectModel->getCount(),
'active_redirects' => $this->redirectModel->getActiveCount(),
'total_clicks' => 0, // Analytics handled by Advertising module
'unique_clicks' => 0 // Analytics handled by Advertising module
];
$recentRedirects = array_slice($this->redirectModel->getAll(), 0, 5);
View::render('layouts/public-blank.php', [
'page_name' => 'public-redirects-dashboard',
'page_content' => function() use ($stats, $recentRedirects) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'Dashboard',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/public/redirects'],
['label' => 'Dashboard', 'url' => null]
]
]);
View::render('public/redirects/dashboard', [
'stats' => $stats,
'recentRedirects' => $recentRedirects,
'title' => 'Redirects Dashboard'
]);
}
]);
} catch (\Exception $e) {
$this->handleError($e);
}
}
public function redirects(): void
{
try {
$filters = [
'status' => $_GET['status'] ?? '',
'search' => $_GET['search'] ?? ''
];
$redirects = $this->redirectModel->getAll($filters);
View::render('layouts/public-blank.php', [
'page_name' => 'public-redirects-list',
'page_content' => function() use ($redirects, $filters) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'All Redirects',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/public/redirects'],
['label' => 'All Redirects', 'url' => null]
]
]);
View::render('public/redirects/index', [
'redirects' => $redirects,
'filters' => $filters,
'title' => 'All Redirects'
]);
}
]);
} catch (\Exception $e) {
$this->handleError($e);
}
}
public function viewRedirect(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
header('Location: /public/redirects');
exit;
}
$stats = $this->statsModel->getStatsByRedirect($id);
$recentActivity = $this->statsModel->getRecentActivity($id, 10);
View::render('layouts/public-blank.php', [
'page_name' => 'public-redirects-view',
'page_content' => function() use ($redirect, $stats, $recentActivity) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'View Redirect',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/public/redirects'],
['label' => 'All Redirects', 'url' => '/public/redirects/redirects'],
['label' => 'View Redirect', 'url' => null]
]
]);
View::render('public/redirects/view', [
'redirect' => $redirect,
'stats' => $stats,
'recentActivity' => $recentActivity,
'title' => 'View Redirect'
]);
}
]);
} catch (\Exception $e) {
$this->handleError($e);
}
}
public function stats(): void
{
try {
$startDate = $_GET['start_date'] ?? date('Y-m-d', strtotime('-30 days'));
$endDate = $_GET['end_date'] ?? date('Y-m-d');
// Get overall stats from database
$sql = "SELECT
COUNT(*) as total_clicks,
COUNT(DISTINCT session_id) as unique_clicks,
COUNT(DISTINCT ip_address) as unique_ips,
AVG(response_time_ms) as avg_response_time
FROM redirect_stats";
$overviewStats = $this->statsModel->getDb()->fetch($sql) ?: [
'total_clicks' => 0,
'unique_clicks' => 0,
'unique_ips' => 0,
'avg_response_time' => 0
];
// Get stats by country
$sql = "SELECT
country_code,
COALESCE(NULLIF(country_name, ''), country_code) AS country_name,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE country_code IS NOT NULL AND country_code != ''
GROUP BY country_code, country_name
ORDER BY clicks DESC
LIMIT 10";
$countryStats = $this->statsModel->getDb()->fetchAll($sql) ?: [];
// Get stats by device
$sql = "SELECT
device_type,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE device_type IS NOT NULL
GROUP BY device_type
ORDER BY clicks DESC";
$deviceStats = $this->statsModel->getDb()->fetchAll($sql) ?: [];
// Get stats by browser
$sql = "SELECT
browser,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE browser IS NOT NULL AND browser != 'Unknown'
GROUP BY browser
ORDER BY clicks DESC";
$browserStats = $this->statsModel->getDb()->fetchAll($sql) ?: [];
View::render('layouts/public-blank.php', [
'page_name' => 'public-redirects-stats',
'page_content' => function() use ($overviewStats, $countryStats, $deviceStats, $browserStats, $startDate, $endDate) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'Analytics',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/public/redirects'],
['label' => 'Analytics', 'url' => null]
]
]);
View::render('public/redirects/stats/index', [
'overviewStats' => $overviewStats,
'countryStats' => $countryStats,
'deviceStats' => $deviceStats,
'browserStats' => $browserStats,
'startDate' => $startDate,
'endDate' => $endDate,
'title' => 'Analytics'
]);
}
]);
} catch (\Exception $e) {
$this->handleError($e);
}
}
public function statsApi(): void
{
try {
header('Content-Type: application/json');
$startDate = $_GET['start_date'] ?? null;
$endDate = $_GET['end_date'] ?? null;
$trackerId = $_GET['tracker_id'] ?? null;
$country = $_GET['country'] ?? null;
$device = $_GET['device'] ?? null;
$browser = $_GET['browser'] ?? null;
$os = $_GET['os'] ?? null;
// Build WHERE clause for filtering
$whereConditions = [];
$params = [];
if ($startDate && $endDate) {
$whereConditions[] = "DATE(timestamp) BETWEEN ? AND ?";
$params[] = $startDate;
$params[] = $endDate;
} elseif ($startDate) {
$whereConditions[] = "DATE(timestamp) >= ?";
$params[] = $startDate;
} elseif ($endDate) {
$whereConditions[] = "DATE(timestamp) <= ?";
$params[] = $endDate;
}
if ($trackerId) {
$whereConditions[] = "redirect_id = ?";
$params[] = $trackerId;
}
if ($country) {
$whereConditions[] = "country_code = ?";
$params[] = $country;
}
if ($device) {
$whereConditions[] = "device_type = ?";
$params[] = $device;
}
if ($browser) {
$whereConditions[] = "browser = ?";
$params[] = $browser;
}
if ($os) {
$whereConditions[] = "os = ?";
$params[] = $os;
}
$whereClause = empty($whereConditions) ? "" : "WHERE " . implode(" AND ", $whereConditions);
// Get overall stats from database
$sql = "SELECT
COUNT(*) as total_clicks,
COUNT(DISTINCT session_id) as unique_clicks,
COUNT(DISTINCT ip_address) as unique_ips,
AVG(response_time_ms) as avg_response_time
FROM redirect_stats " . $whereClause;
$overviewStats = $this->statsModel->getDb()->fetch($sql, $params) ?: [
'total_clicks' => 0,
'unique_clicks' => 0,
'unique_ips' => 0,
'avg_response_time' => 0
];
// Get stats by country
$countryWhereConditions = array_merge($whereConditions, ["country_code IS NOT NULL", "country_code != ''"]);
$countryWhereClause = "WHERE " . implode(" AND ", $countryWhereConditions);
$sql = "SELECT
country_code,
COALESCE(NULLIF(country_name, ''), country_code) AS country_name,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$countryWhereClause
GROUP BY country_code, country_name
ORDER BY clicks DESC
LIMIT 10";
$countryStats = $this->statsModel->getDb()->fetchAll($sql, $params) ?: [];
// Get stats by device
$deviceWhereConditions = array_merge($whereConditions, ["device_type IS NOT NULL"]);
$deviceWhereClause = empty($deviceWhereConditions) ? "" : "WHERE " . implode(" AND ", $deviceWhereConditions);
$sql = "SELECT
device_type,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$deviceWhereClause
GROUP BY device_type
ORDER BY clicks DESC";
$deviceStats = $this->statsModel->getDb()->fetchAll($sql, $params) ?: [];
// Get stats by browser
$browserWhereConditions = array_merge($whereConditions, ["browser IS NOT NULL", "browser != 'Unknown'"]);
$browserWhereClause = "WHERE " . implode(" AND ", $browserWhereConditions);
$sql = "SELECT
browser,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$browserWhereClause
GROUP BY browser
ORDER BY clicks DESC";
$browserStats = $this->statsModel->getDb()->fetchAll($sql, $params) ?: [];
echo json_encode([
'overview' => $overviewStats,
'country' => $countryStats,
'device' => $deviceStats,
'browser' => $browserStats
]);
} catch (\Exception $e) {
http_response_code(500);
echo json_encode(['error' => 'Failed to load statistics']);
}
}
public function processRedirect(string $cuid): void
{
try {
$redirect = $this->redirectModel->getByCuid($cuid);
if (!$redirect) {
http_response_code(404);
echo "Redirect not found";
return;
}
if ($redirect['status'] != 1) {
http_response_code(410);
echo "Redirect is inactive";
return;
}
// Simple redirect - no complex processing needed
$targetUrl = $redirect['target_url'];
// Analytics are handled by the Advertising module
// Just perform the redirect
header("Location: " . $targetUrl, true, (int)$redirect['redirect_type']);
exit;
} catch (\Exception $e) {
http_response_code(500);
echo "Internal server error";
}
}
private function handleError(\Exception $e): void
{
error_log("PublicRedirectsController error: " . $e->getMessage());
http_response_code(500);
echo "Internal server error";
}
}
@@ -0,0 +1,761 @@
<?php
namespace App\Modules\Redirects\Controllers;
use App\Core\BaseController;
use App\Core\Sanitize;
use App\Core\DatabaseManager;
use App\Modules\Redirects\Models\RedirectModel;
use App\Modules\Redirects\Models\RedirectFilterModel;
use App\Modules\Redirects\Models\RedirectStatsModel;
use App\Modules\Redirects\Services\RedirectAutoCreatorService;
class RedirectsApiController extends BaseController
{
private RedirectModel $redirectModel;
private RedirectFilterModel $filterModel;
private RedirectStatsModel $statsModel;
private RedirectAutoCreatorService $autoCreatorService;
public function __construct()
{
parent::__construct();
$this->redirectModel = new RedirectModel();
$this->filterModel = new RedirectFilterModel();
$this->statsModel = new RedirectStatsModel();
$this->autoCreatorService = new RedirectAutoCreatorService();
}
public function create(): void
{
try {
$input = json_decode(file_get_contents('php://input'), true) ?: [];
$data = [
'name' => Sanitize::string($input['name'] ?? ''),
'source_url' => Sanitize::url($input['source_url'] ?? ''),
'target_url' => Sanitize::url($input['target_url'] ?? ''),
'fallback_url' => Sanitize::url($input['fallback_url'] ?? ''),
'status' => (int)($input['status'] ?? 1),
'redirect_type' => Sanitize::string($input['redirect_type'] ?? '302'),
'tracking_enabled' => (int)($input['tracking_enabled'] ?? 1),
'max_clicks' => !empty($input['max_clicks']) ? (int)$input['max_clicks'] : null,
'expires_at' => !empty($input['expires_at']) ? $input['expires_at'] : null,
'created_by' => 1
];
if (empty($data['name']) || empty($data['target_url'])) {
$this->errorResponse('Name and target URL are required', 400);
return;
}
// ✅ Create redirect and associated creative
$success = $this->redirectModel->createWithCreative($data);
if ($success) {
// 🚀 AUTO-CREATE: multisite + campaign + creative
$autoResult = $this->autoCreatorService->createCompleteRedirect($data);
if ($autoResult['success']) {
$this->successResponse([
'redirect_created' => true,
'multisite_created' => $autoResult['site_group_id'],
'campaign_created' => $autoResult['campaign_id'],
'creative_created' => $autoResult['creative_id']
], 'Redirect created successfully with automatic multisite and campaign setup');
} else {
$this->successResponse([], 'Redirect created but multisite setup failed: ' . $autoResult['message']);
}
} else {
$this->errorResponse('Failed to create redirect with creative', 500);
}
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function index(): void
{
try {
// Bearer token auth for server-to-server
$authHeader = $_SERVER['HTTP_AUTHORIZATION'] ?? '';
$token = null;
if (stripos($authHeader, 'Bearer ') === 0) {
$token = trim(substr($authHeader, 7));
}
// Load expected key from env or fallback by parsing .env
$expectedKey = $_ENV['REDIRECTS_API_KEY'] ?? getenv('REDIRECTS_API_KEY') ?? '';
if (!$expectedKey) {
$candidates = [
realpath(__DIR__ . '/../../../../.env') ?: '',
realpath(__DIR__ . '/../../../.env') ?: '',
'/data/wwwroot/redirect.moneyflix.com/.env'
];
foreach ($candidates as $envPath) {
if ($envPath && is_file($envPath)) {
$lines = @file($envPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
foreach ($lines as $line) {
if (strpos($line, 'REDIRECTS_API_KEY=') === 0) {
$expectedKey = trim(substr($line, strlen('REDIRECTS_API_KEY=')));
$expectedKey = trim($expectedKey, "\"' ");
break 2;
}
}
}
}
}
// Check if authenticated via session OR Bearer token
$isAuthenticated = \App\Core\Auth::check();
$hasValidToken = $expectedKey && $token && hash_equals($expectedKey, $token);
if (!$isAuthenticated && !$hasValidToken) {
$this->errorResponse('Unauthorized', 401);
return;
}
$filters = [
'status' => $_GET['status'] ?? '',
'search' => $_GET['search'] ?? ''
];
$redirects = $this->redirectModel->getAll($filters);
$this->successResponse(['redirects' => $redirects], 'Redirects retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function update(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
$input = json_decode(file_get_contents('php://input'), true) ?: [];
$data = [
'name' => Sanitize::string($input['name'] ?? $redirect['name']),
'source_url' => Sanitize::url($input['source_url'] ?? $redirect['source_url']),
'target_url' => Sanitize::url($input['target_url'] ?? $redirect['target_url']),
'fallback_url' => Sanitize::url($input['fallback_url'] ?? $redirect['fallback_url']),
'status' => (int)($input['status'] ?? $redirect['status']),
'redirect_type' => Sanitize::string($input['redirect_type'] ?? $redirect['redirect_type']),
'tracking_enabled' => (int)($input['tracking_enabled'] ?? $redirect['tracking_enabled']),
'max_clicks' => !empty($input['max_clicks']) ? (int)$input['max_clicks'] : $redirect['max_clicks'],
'expires_at' => !empty($input['expires_at']) ? $input['expires_at'] : $redirect['expires_at']
];
$success = $this->redirectModel->updateWithCreative($id, $data);
if ($success) {
// 🚀 AUTO-UPDATE: Update associated creative via Advertising module
$redirectCreativeService = new \App\Modules\Redirects\Services\RedirectCreativeService();
$creativeResult = $redirectCreativeService->updateCreativeFromRedirect($id, $data);
if ($creativeResult) {
$this->successResponse([
'redirect_updated' => true,
'creative_updated' => true
], 'Redirect updated successfully with Advertising module integration');
} else {
$this->successResponse([], 'Redirect updated but Advertising module update failed');
}
} else {
$this->errorResponse('Failed to update redirect with creative', 500);
}
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function show(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
$this->successResponse(['redirect' => $redirect], 'Redirect retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function delete(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
$success = $this->redirectModel->deleteWithCreative($id);
if ($success) {
$this->successResponse([], 'Redirect deleted successfully with creative integration');
} else {
$this->errorResponse('Failed to delete redirect with creative', 500);
}
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function getStats(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
$startDate = $_GET['start_date'] ?? null;
$endDate = $_GET['end_date'] ?? null;
$stats = [
'overview' => $this->statsModel->getStatsByRedirect($id, $startDate, $endDate),
'by_country' => $this->statsModel->getStatsByCountry($id, $startDate, $endDate),
'by_device' => $this->statsModel->getStatsByDevice($id, $startDate, $endDate),
'by_browser' => $this->statsModel->getStatsByBrowser($id, $startDate, $endDate),
'by_hour' => $this->statsModel->getStatsByHour($id, $startDate, $endDate),
'recent_activity' => $this->statsModel->getRecentActivity($id, 10)
];
$this->successResponse($stats, 'Stats retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function getFilters(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
$filters = $this->filterModel->getByRedirectId($id);
$this->successResponse($filters, 'Filters retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function addFilter(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
$data = [
'redirect_id' => $id,
'filter_type' => Sanitize::string($_POST['filter_type'] ?? ''),
'filter_value' => Sanitize::string($_POST['filter_value'] ?? ''),
'filter_operator' => Sanitize::string($_POST['filter_operator'] ?? 'equals'),
'filter_value_secondary' => Sanitize::string($_POST['filter_value_secondary'] ?? null),
'priority' => (int)($_POST['priority'] ?? 0),
'is_active' => (int)($_POST['is_active'] ?? 1)
];
if (empty($data['filter_type']) || empty($data['filter_value'])) {
$this->errorResponse('Filter type and value are required', 400);
return;
}
$success = $this->filterModel->create($data);
if ($success) {
$this->successResponse([], 'Filter added successfully');
} else {
$this->errorResponse('Failed to add filter', 500);
}
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function deleteFilter(int $id, int $filterId): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
$success = $this->filterModel->delete($filterId);
if ($success) {
$this->successResponse([], 'Filter deleted successfully');
} else {
$this->errorResponse('Failed to delete filter', 500);
}
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
/**
* Obter os site groups associados a um redirect específico
*/
public function getSiteGroups(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
// Query para obter os site groups associados
$sql = "
SELECT
rsgm.*,
asg.name as site_group_name,
asg.description as site_group_description,
asg.status as site_group_status,
ac.name as creative_name,
ac.creative_type
FROM redirect_site_group_mapping rsgm
LEFT JOIN advertising_site_groups asg ON rsgm.site_group_id = asg.id
LEFT JOIN advertising_creatives ac ON rsgm.creative_id = ac.id
WHERE rsgm.redirect_id = ?
ORDER BY rsgm.priority DESC, rsgm.created_at DESC
";
$db = DatabaseManager::getInstance();
$siteGroups = $db->fetchAll($sql, [$id]);
$this->successResponse([
'redirect_id' => $id,
'site_groups' => $siteGroups
], 'Site groups retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
/**
* Associar um redirect com um site group
*/
public function associateSiteGroup(int $id): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
$input = json_decode(file_get_contents('php://input'), true) ?: [];
$data = [
'redirect_id' => $id,
'site_group_id' => (int)($input['site_group_id'] ?? 0),
'creative_id' => !empty($input['creative_id']) ? (int)$input['creative_id'] : null,
'mapping_type' => Sanitize::string($input['mapping_type'] ?? 'primary'),
'priority' => (int)($input['priority'] ?? 0),
'geo_targeting' => !empty($input['geo_targeting']) ? json_encode($input['geo_targeting']) : null,
'device_targeting' => !empty($input['device_targeting']) ? json_encode($input['device_targeting']) : null,
'time_targeting' => !empty($input['time_targeting']) ? json_encode($input['time_targeting']) : null,
'traffic_percentage' => (float)($input['traffic_percentage'] ?? 100.00),
'is_active' => (int)($input['is_active'] ?? 1)
];
if (empty($data['site_group_id'])) {
$this->errorResponse('Site group ID is required', 400);
return;
}
// Verificar se o site group existe
$db = DatabaseManager::getInstance();
$siteGroup = $db->fetch("SELECT id FROM advertising_site_groups WHERE id = ?", [$data['site_group_id']]);
if (!$siteGroup) {
$this->errorResponse('Site group not found', 404);
return;
}
// Verificar se já existe uma associação
$existing = $db->fetch("SELECT id FROM redirect_site_group_mapping WHERE redirect_id = ? AND site_group_id = ?", [$id, $data['site_group_id']]);
if ($existing) {
$this->errorResponse('Association already exists', 409);
return;
}
// Inserir a associação
$sql = "
INSERT INTO redirect_site_group_mapping (
redirect_id, site_group_id, creative_id, mapping_type,
priority, geo_targeting, device_targeting, time_targeting,
traffic_percentage, is_active
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
";
$success = $db->query($sql, [
$data['redirect_id'], $data['site_group_id'], $data['creative_id'],
$data['mapping_type'], $data['priority'], $data['geo_targeting'],
$data['device_targeting'], $data['time_targeting'], $data['traffic_percentage'],
$data['is_active']
]);
if ($success) {
$this->successResponse([], 'Site group associated successfully');
} else {
$this->errorResponse('Failed to associate site group', 500);
}
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
/**
* Remover a associação de um redirect com um site group
*/
public function removeSiteGroup(int $id, int $mappingId): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
// Verificar se a associação existe e pertence ao redirect
$db = DatabaseManager::getInstance();
$mapping = $db->fetch("SELECT id FROM redirect_site_group_mapping WHERE id = ? AND redirect_id = ?", [$mappingId, $id]);
if (!$mapping) {
$this->errorResponse('Mapping not found', 404);
return;
}
// Remover a associação
$success = $db->query("DELETE FROM redirect_site_group_mapping WHERE id = ?", [$mappingId]);
if ($success) {
$this->successResponse([], 'Site group association removed successfully');
} else {
$this->errorResponse('Failed to remove site group association', 500);
}
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
/**
* Atualizar uma associação existente de um redirect com um site group
*/
public function updateSiteGroup(int $id, int $mappingId): void
{
try {
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
$this->errorResponse('Redirect not found', 404);
return;
}
// Verificar se a associação existe e pertence ao redirect
$db = DatabaseManager::getInstance();
$mapping = $db->fetch("SELECT id FROM redirect_site_group_mapping WHERE id = ? AND redirect_id = ?", [$mappingId, $id]);
if (!$mapping) {
$this->errorResponse('Mapping not found', 404);
return;
}
$input = json_decode(file_get_contents('php://input'), true) ?: [];
$data = [
'creative_id' => !empty($input['creative_id']) ? (int)$input['creative_id'] : null,
'mapping_type' => Sanitize::string($input['mapping_type'] ?? 'primary'),
'priority' => (int)($input['priority'] ?? 0),
'geo_targeting' => !empty($input['geo_targeting']) ? json_encode($input['geo_targeting']) : null,
'device_targeting' => !empty($input['device_targeting']) ? json_encode($input['device_targeting']) : null,
'time_targeting' => !empty($input['time_targeting']) ? json_encode($input['time_targeting']) : null,
'traffic_percentage' => (float)($input['traffic_percentage'] ?? 100.00),
'is_active' => (int)($input['is_active'] ?? 1)
];
// Atualizar a associação
$sql = "
UPDATE redirect_site_group_mapping SET
creative_id = ?, mapping_type = ?, priority = ?,
geo_targeting = ?, device_targeting = ?, time_targeting = ?,
traffic_percentage = ?, is_active = ?
WHERE id = ?
";
$success = $db->query($sql, [
$data['creative_id'], $data['mapping_type'], $data['priority'],
$data['geo_targeting'], $data['device_targeting'], $data['time_targeting'],
$data['traffic_percentage'], $data['is_active'], $mappingId
]);
if ($success) {
$this->successResponse([], 'Site group association updated successfully');
} else {
$this->errorResponse('Failed to update site group association', 500);
}
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function getOverviewStats(): void
{
try {
$startDate = $_GET['start_date'] ?? date('Y-m-d', strtotime('-30 days'));
$endDate = $_GET['end_date'] ?? date('Y-m-d');
// Implementar estatísticas gerais
$stats = [
'total_clicks' => 0,
'unique_clicks' => 0,
'unique_ips' => 0,
'avg_response_time' => 0
];
$this->successResponse($stats, 'Overview stats retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function getStatsByCountry(): void
{
try {
$startDate = $_GET['start_date'] ?? date('Y-m-d', strtotime('-30 days'));
$endDate = $_GET['end_date'] ?? date('Y-m-d');
// Implementar estatísticas por país
$stats = [];
$this->successResponse($stats, 'Country stats retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function getStatsByDevice(): void
{
try {
$startDate = $_GET['start_date'] ?? date('Y-m-d', strtotime('-30 days'));
$endDate = $_GET['end_date'] ?? date('Y-m-d');
// Implementar estatísticas por dispositivo
$stats = [];
$this->successResponse($stats, 'Device stats retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function getStatsByBrowser(): void
{
try {
$startDate = $_GET['start_date'] ?? date('Y-m-d', strtotime('-30 days'));
$endDate = $_GET['end_date'] ?? date('Y-m-d');
// Implementar estatísticas por browser
$stats = [];
$this->successResponse($stats, 'Browser stats retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
public function getStatsByHour(): void
{
try {
$startDate = $_GET['start_date'] ?? date('Y-m-d', strtotime('-30 days'));
$endDate = $_GET['end_date'] ?? date('Y-m-d');
// Implementar estatísticas por hora
$stats = [];
$this->successResponse($stats, 'Hour stats retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
/**
* Get redirects as creatives for Advertising module integration
*/
public function getRedirectCreatives(): void
{
try {
$creativeService = new \App\Modules\Redirects\Services\RedirectCreativeService();
$redirectCreatives = $creativeService->getAllRedirectCreatives();
$this->successResponse([
'redirect_creatives' => $redirectCreatives,
'total' => count($redirectCreatives)
], 'Redirect creatives retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Server error: ' . $e->getMessage(), 500);
}
}
/**
* Migrate all existing redirects to creatives
*/
public function migrateRedirectsToCreatives(): void
{
try {
$creativeService = new \App\Modules\Redirects\Services\RedirectCreativeService();
$results = $creativeService->migrateAllRedirects();
$successCount = count(array_filter($results, fn($r) => $r['success']));
$totalCount = count($results);
$this->successResponse([
'migration_results' => $results,
'summary' => [
'total_redirects' => $totalCount,
'successful_migrations' => $successCount,
'failed_migrations' => $totalCount - $successCount
]
], "Migration completed: {$successCount}/{$totalCount} redirects migrated successfully");
} catch (\Exception $e) {
$this->errorResponse('Migration failed: ' . $e->getMessage(), 500);
}
}
public function statsApi(): void
{
try {
header('Content-Type: application/json');
$startDate = $_GET['start_date'] ?? null;
$endDate = $_GET['end_date'] ?? null;
$trackerId = $_GET['tracker_id'] ?? null;
$country = $_GET['country'] ?? null;
$device = $_GET['device'] ?? null;
$browser = $_GET['browser'] ?? null;
$os = $_GET['os'] ?? null;
// Build WHERE clause for filtering
$whereConditions = [];
$params = [];
if ($startDate && $endDate) {
$whereConditions[] = "DATE(timestamp) BETWEEN ? AND ?";
$params[] = $startDate;
$params[] = $endDate;
} elseif ($startDate) {
$whereConditions[] = "DATE(timestamp) >= ?";
$params[] = $startDate;
} elseif ($endDate) {
$whereConditions[] = "DATE(timestamp) <= ?";
$params[] = $endDate;
}
if ($trackerId) {
$whereConditions[] = "redirect_id = ?";
$params[] = $trackerId;
}
if ($country) {
$whereConditions[] = "country_code = ?";
$params[] = $country;
}
if ($device) {
$whereConditions[] = "device_type = ?";
$params[] = $device;
}
if ($browser) {
$whereConditions[] = "browser = ?";
$params[] = $browser;
}
if ($os) {
$whereConditions[] = "os = ?";
$params[] = $os;
}
$whereClause = empty($whereConditions) ? "" : "WHERE " . implode(" AND ", $whereConditions);
// Get overall stats from database
$sql = "SELECT
COUNT(*) as total_clicks,
COUNT(DISTINCT session_id) as unique_clicks,
COUNT(DISTINCT ip_address) as unique_ips,
AVG(response_time_ms) as avg_response_time
FROM redirect_stats " . $whereClause;
$overviewStats = DatabaseManager::getInstance()->fetch($sql, $params) ?: [
'total_clicks' => 0,
'unique_clicks' => 0,
'unique_ips' => 0,
'avg_response_time' => 0
];
// Get stats by country
$countryWhereConditions = array_merge($whereConditions, ["country_code IS NOT NULL", "country_code != ''"]);
$countryWhereClause = "WHERE " . implode(" AND ", $countryWhereConditions);
$sql = "SELECT
country_code,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$countryWhereClause
GROUP BY country_code
ORDER BY clicks DESC
LIMIT 10";
$countryStats = DatabaseManager::getInstance()->fetchAll($sql, $params) ?: [];
// Get stats by device
$deviceWhereConditions = array_merge($whereConditions, ["device_type IS NOT NULL"]);
$deviceWhereClause = empty($deviceWhereConditions) ? "" : "WHERE " . implode(" AND ", $deviceWhereConditions);
$sql = "SELECT
device_type,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$deviceWhereClause
GROUP BY device_type
ORDER BY clicks DESC";
$deviceStats = DatabaseManager::getInstance()->fetchAll($sql, $params) ?: [];
// Get stats by browser
$browserWhereConditions = array_merge($whereConditions, ["browser IS NOT NULL", "browser != 'Unknown'"]);
$browserWhereClause = "WHERE " . implode(" AND ", $browserWhereConditions);
$sql = "SELECT
browser,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
$browserWhereClause
GROUP BY browser
ORDER BY clicks DESC";
$browserStats = DatabaseManager::getInstance()->fetchAll($sql, $params) ?: [];
$this->successResponse([
'overview' => $overviewStats,
'by_country' => $countryStats,
'by_device' => $deviceStats,
'by_browser' => $browserStats
], 'Statistics retrieved successfully');
} catch (\Exception $e) {
$this->errorResponse('Failed to load statistics: ' . $e->getMessage(), 500);
}
}
}
@@ -0,0 +1,481 @@
<?php
namespace App\Modules\Redirects\Controllers;
use App\Core\BaseController;
use App\Core\View;
use App\Core\Sanitize;
use App\Core\DatabaseManager;
use App\Core\ErrorReporter;
use App\Modules\Redirects\Models\RedirectModel;
use App\Modules\Redirects\Models\RedirectFilterModel;
use App\Modules\Redirects\Models\RedirectStatsModel;
use App\Modules\Redirects\Services\RedirectProcessor;
use Visus\Cuid2\Cuid2;
class RedirectsController extends BaseController
{
private RedirectModel $redirectModel;
private RedirectFilterModel $filterModel;
private RedirectStatsModel $statsModel;
private RedirectProcessor $processor;
public function __construct()
{
parent::__construct();
// Require authentication for all redirects operations
\App\Core\AuthMiddleware::requireAuth();
$this->redirectModel = new RedirectModel();
$this->filterModel = new RedirectFilterModel();
$this->statsModel = new RedirectStatsModel();
$this->processor = new RedirectProcessor();
}
public function dashboard(): void
{
$stats = [
'total_redirects' => $this->redirectModel->getCount(),
'active_redirects' => $this->redirectModel->getActiveCount(),
'inactive_redirects' => $this->redirectModel->getInactiveCount(),
'recent_redirects' => array_slice($this->redirectModel->getAll(), 0, 5)
];
View::render('layouts/main.php', [
'title' => 'Redirects Dashboard',
'page_name' => 'apps-redirects-dashboard',
'page_content' => function() use ($stats) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'Dashboard',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/redirects'],
['label' => 'Dashboard', 'url' => null]
]
]);
View::render('@redirects/dashboard', ['stats' => $stats, 'title' => 'Redirects Dashboard']);
}
]);
}
public function redirects(): void
{
$filters = [
'status' => Sanitize::string($_GET['status'] ?? ''),
'search' => Sanitize::string($_GET['search'] ?? '')
];
$redirects = $this->redirectModel->getAll($filters);
View::render('layouts/main.php', [
'title' => 'All Redirects',
'page_name' => 'apps-redirects-list',
'page_content' => function() use ($redirects, $filters) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'All Redirects',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/redirects'],
['label' => 'All Redirects', 'url' => null]
]
]);
View::render('@redirects/redirects/index', ['redirects' => $redirects, 'filters' => $filters, 'title' => 'All Redirects']);
}
]);
}
public function createRedirect(): void
{
$config = require __DIR__ . '/../config.php';
View::render('layouts/main.php', [
'title' => 'Create Redirect',
'page_name' => 'apps-redirects-create',
'page_content' => function() use ($config) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'Create Redirect',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/redirects'],
['label' => 'All Redirects', 'url' => '/redirects/redirects'],
['label' => 'Create Redirect', 'url' => null]
]
]);
View::render('@redirects/redirects/create', ['config' => $config, 'title' => 'Create Redirect']);
}
]);
}
public function editRedirect(int $id): void
{
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
header('Location: /redirects/redirects');
exit;
}
$filters = $this->filterModel->getByRedirectId($id);
$config = require __DIR__ . '/../config.php';
View::render('layouts/main.php', [
'title' => 'Edit Redirect',
'page_name' => 'apps-redirects-edit',
'page_content' => function() use ($redirect, $filters, $config) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'Edit Redirect',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/redirects'],
['label' => 'All Redirects', 'url' => '/redirects/redirects'],
['label' => 'Edit Redirect', 'url' => null]
]
]);
View::render('@redirects/redirects/edit', ['redirect' => $redirect, 'filters' => $filters, 'config' => $config, 'title' => 'Edit Redirect']);
}
]);
}
public function viewRedirect(int $id): void
{
$redirect = $this->redirectModel->getById($id);
if (!$redirect) {
header('Location: /redirects/redirects');
exit;
}
$filters = $this->filterModel->getByRedirectId($id);
$stats = $this->statsModel->getStatsByRedirect($id);
$recentActivity = $this->statsModel->getRecentActivity($id, 10);
View::render('layouts/main.php', [
'title' => 'View Redirect',
'page_name' => 'apps-redirects-view',
'page_content' => function() use ($redirect, $filters, $stats, $recentActivity) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'View Redirect',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/redirects'],
['label' => 'All Redirects', 'url' => '/redirects/redirects'],
['label' => 'View Redirect', 'url' => null]
]
]);
View::render('@redirects/redirects/view', ['redirect' => $redirect, 'filters' => $filters, 'stats' => $stats, 'recentActivity' => $recentActivity, 'title' => 'View Redirect']);
}
]);
}
public function stats(): void
{
$startDate = Sanitize::string($_GET['start_date'] ?? date('Y-m-d', strtotime('-30 days')));
$endDate = Sanitize::string($_GET['end_date'] ?? date('Y-m-d'));
$stats = [
'overview' => $this->getOverviewStats($startDate, $endDate),
'by_country' => $this->getStatsByCountry($startDate, $endDate),
'by_device' => $this->getStatsByDevice($startDate, $endDate),
'by_browser' => $this->getStatsByBrowser($startDate, $endDate),
'by_hour' => $this->getStatsByHour($startDate, $endDate)
];
// Get filter options from database
$filterOptions = $this->getFilterOptions();
View::render('layouts/main.php', [
'title' => 'Redirects Analytics',
'page_name' => 'apps-redirects-stats',
'page_content' => function() use ($stats, $startDate, $endDate, $filterOptions) {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'Analytics',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/redirects'],
['label' => 'Analytics', 'url' => null]
]
]);
View::render('@redirects/stats/index', [
'stats' => $stats,
'startDate' => $startDate,
'endDate' => $endDate,
'title' => 'Redirects Analytics',
'filterOptions' => $filterOptions
]);
}
]);
}
public function settings(): void
{
View::render('layouts/main.php', [
'title' => 'Redirects Settings',
'page_name' => 'apps-redirects-settings',
'page_content' => function() {
View::render('layouts/page-title.php', [
'pagetitle' => 'Redirects',
'title' => 'Settings',
'breadcrumbs' => [
['label' => 'Home', 'url' => '/'],
['label' => 'Redirects', 'url' => '/redirects'],
['label' => 'Settings', 'url' => null]
]
]);
View::render('@redirects/settings', ['title' => 'Redirects Settings']);
}
]);
}
public function processRedirect(string $cuid): void
{
$startTime = microtime(true);
$redirect = $this->redirectModel->getByCuid($cuid);
if (!$redirect || $redirect['status'] != 1) {
http_response_code(404);
echo 'Redirect not found';
return;
}
// Verificar se expirou
if ($redirect['expires_at'] && strtotime($redirect['expires_at']) < time()) {
http_response_code(410);
echo 'Redirect expired';
return;
}
// Processar redirect com filtros
$targetUrl = $this->processor->processRedirect($redirect);
$responseTime = round((microtime(true) - $startTime) * 1000);
// Registrar estatísticas se ativado
if ($redirect['tracking_enabled']) {
$this->recordStats($redirect['id'], $targetUrl, $responseTime);
}
// Fazer redirect
header("Location: " . $targetUrl);
exit;
}
// apiRedirects removido — endpoint oficial em RedirectsApiController::index
private function getOverviewStats(string $startDate, string $endDate): array
{
try {
$db = \App\Core\DatabaseManager::getInstance();
$sql = "SELECT
COUNT(*) as total_clicks,
COUNT(DISTINCT session_id) as unique_clicks,
COUNT(DISTINCT ip_address) as unique_ips,
COALESCE(AVG(response_time_ms), 0) as avg_response_time
FROM redirect_stats
WHERE DATE(timestamp) BETWEEN ? AND ?";
$result = $db->fetch($sql, [$startDate, $endDate]);
return [
'total_clicks' => (int)($result['total_clicks'] ?? 0),
'unique_clicks' => (int)($result['unique_clicks'] ?? 0),
'unique_ips' => (int)($result['unique_ips'] ?? 0),
'avg_response_time' => round((float)($result['avg_response_time'] ?? 0), 2)
];
} catch (\Exception $e) {
// Fallback para dados vazios se a tabela não existir
return [
'total_clicks' => 0,
'unique_clicks' => 0,
'unique_ips' => 0,
'avg_response_time' => 0
];
}
}
private function getStatsByCountry(string $startDate, string $endDate): array
{
try {
$db = \App\Core\DatabaseManager::getInstance();
$sql = "SELECT
country_code,
country_name,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE DATE(timestamp) BETWEEN ? AND ?
GROUP BY country_code, country_name
ORDER BY clicks DESC
LIMIT 10";
return $db->fetchAll($sql, [$startDate, $endDate]) ?: [];
} catch (\Exception $e) {
return [];
}
}
private function getStatsByDevice(string $startDate, string $endDate): array
{
try {
$db = \App\Core\DatabaseManager::getInstance();
$sql = "SELECT
device_type,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE DATE(timestamp) BETWEEN ? AND ?
GROUP BY device_type
ORDER BY clicks DESC";
return $db->fetchAll($sql, [$startDate, $endDate]) ?: [];
} catch (\Exception $e) {
return [];
}
}
private function getStatsByBrowser(string $startDate, string $endDate): array
{
try {
$db = \App\Core\DatabaseManager::getInstance();
$sql = "SELECT
browser,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE DATE(timestamp) BETWEEN ? AND ?
GROUP BY browser
ORDER BY clicks DESC
LIMIT 10";
return $db->fetchAll($sql, [$startDate, $endDate]) ?: [];
} catch (\Exception $e) {
return [];
}
}
private function getStatsByHour(string $startDate, string $endDate): array
{
try {
$db = \App\Core\DatabaseManager::getInstance();
$sql = "SELECT
hour_of_day,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE DATE(timestamp) BETWEEN ? AND ?
GROUP BY hour_of_day
ORDER BY hour_of_day";
return $db->fetchAll($sql, [$startDate, $endDate]) ?: [];
} catch (\Exception $e) {
return [];
}
}
private function recordStats(int $redirectId, string $targetUrl, int $responseTime): void
{
$data = [
'redirect_id' => $redirectId,
'session_id' => session_id() ?: (string) new Cuid2(),
'ip_address' => $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0',
'ip_long' => ip2long($_SERVER['REMOTE_ADDR'] ?? '0.0.0.0'),
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? null,
'referer' => $_SERVER['HTTP_REFERER'] ?? null,
'country_code' => $_SERVER['HTTP_CF_IPCOUNTRY'] ?? null,
'country_name' => null, // Será preenchido pelo processor
'city' => $_SERVER['HTTP_CF_IPCITY'] ?? null,
'region_code' => $_SERVER['HTTP_CF_IPREGION'] ?? null,
'region_name' => null, // Será preenchido pelo processor
'timezone' => $_SERVER['HTTP_CF_IPTIMEZONE'] ?? null,
'asn' => $_SERVER['HTTP_CF_IPASN'] ?? null,
'isp' => $_SERVER['HTTP_CF_IPISP'] ?? null,
'browser' => null, // Será preenchido pelo processor
'browser_version' => null,
'os' => null, // Será preenchido pelo processor
'os_version' => null,
'device_type' => 'desktop', // Será preenchido pelo processor
'language' => $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? null,
'hour_of_day' => (int)date('G'),
'day_of_week' => (int)date('N'),
'month' => (int)date('n'),
'year' => (int)date('Y'),
'response_time_ms' => $responseTime,
'target_url_used' => $targetUrl,
'filter_matched' => null // Será preenchido pelo processor
];
$this->statsModel->create($data);
}
/**
* Get filter options for analytics dropdowns
*/
private function getFilterOptions(): array
{
$db = DatabaseManager::getInstance();
try {
// Get available redirects
$redirects = $db->fetchAll("
SELECT id, name, cuid
FROM redirects
WHERE status = 1
ORDER BY name
");
// Get available countries (fallback to code when name is null/empty)
$countries = $db->fetchAll("
SELECT DISTINCT
country_code,
COALESCE(NULLIF(country_name, ''), country_code) AS country_name
FROM redirect_stats
WHERE country_code IS NOT NULL AND country_code != ''
ORDER BY country_name
");
// Get available browsers
$browsers = $db->fetchAll("
SELECT DISTINCT browser
FROM redirect_stats
ORDER BY browser
");
// Get available operating systems
$operatingSystems = $db->fetchAll("
SELECT DISTINCT os
FROM redirect_stats
ORDER BY os
");
return [
'redirects' => $redirects ?: [],
'countries' => $countries ?: [],
'browsers' => $browsers ?: [],
'operatingSystems' => $operatingSystems ?: [],
'devices' => [
['type' => 'desktop', 'name' => 'Desktop'],
['type' => 'mobile', 'name' => 'Mobile'],
['type' => 'tablet', 'name' => 'Tablet'],
['type' => 'bot', 'name' => 'Bot']
]
];
} catch (\Exception $e) {
ErrorReporter::report($e, ['context' => 'redirects_filter_options']);
return [
'redirects' => [],
'countries' => [],
'browsers' => [],
'operatingSystems' => [],
'devices' => []
];
}
}
}
@@ -0,0 +1,163 @@
<?php
declare(strict_types=1);
namespace App\Modules\Redirects\Database\Migrations;
use App\Core\Database\Migration;
/**
* Migration: Extend Redirects for Analytics Integration
*
* This migration extends the redirects table to integrate with the analytics system
* while maintaining 100% backward compatibility with existing redirects functionality.
*/
class ExtendRedirectsForAnalytics extends Migration
{
/**
* Run the migration
*/
public function up(): void
{
// Add analytics integration fields to redirects table
$sql = "
ALTER TABLE redirects
ADD COLUMN analytics_enabled BOOLEAN DEFAULT TRUE COMMENT 'Enable analytics integration',
ADD COLUMN analytics_campaign_id BIGINT UNSIGNED NULL COMMENT 'Linked analytics campaign ID',
ADD COLUMN analytics_tracker_id BIGINT UNSIGNED NULL COMMENT 'Linked analytics tracker ID',
ADD COLUMN analytics_metadata JSON NULL COMMENT 'Additional analytics metadata',
ADD COLUMN last_analytics_sync TIMESTAMP NULL COMMENT 'Last analytics sync timestamp',
ADD COLUMN analytics_hash VARCHAR(32) NULL COMMENT 'Hash for analytics sync control'
";
$this->db->query($sql);
// Add indexes for performance
$this->db->query("
ALTER TABLE redirects
ADD INDEX idx_analytics_enabled (analytics_enabled),
ADD INDEX idx_analytics_campaign_id (analytics_campaign_id),
ADD INDEX idx_analytics_tracker_id (analytics_tracker_id)
");
// Create analytics_redirects_mapping table for seamless integration
$this->db->query("
CREATE TABLE IF NOT EXISTS analytics_redirects_mapping (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
redirect_id BIGINT UNSIGNED NOT NULL,
analytics_event_id BIGINT UNSIGNED NULL,
analytics_session_id BIGINT UNSIGNED NULL,
redirect_type ENUM('301', '302', 'meta', 'javascript') NOT NULL DEFAULT '302',
source_url VARCHAR(500) NOT NULL,
target_url VARCHAR(500) NOT NULL,
fallback_url VARCHAR(500) NULL,
filter_matched VARCHAR(100) NULL,
response_time_ms INT UNSIGNED NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX idx_redirect_id (redirect_id),
INDEX idx_analytics_event_id (analytics_event_id),
INDEX idx_analytics_session_id (analytics_session_id),
INDEX idx_created_at (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
");
// Create analytics_redirects_events table for event tracking
$this->db->query("
CREATE TABLE IF NOT EXISTS analytics_redirects_events (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
redirect_id BIGINT UNSIGNED NOT NULL,
event_type ENUM('redirect', 'click', 'conversion', 'error') NOT NULL DEFAULT 'redirect',
event_data JSON NOT NULL COMMENT 'Event data including geo, device, browser info',
ip_address VARCHAR(45) NOT NULL,
ip_long BIGINT NOT NULL,
session_id VARCHAR(64) NULL,
user_agent TEXT NULL,
referer TEXT NULL,
country_code VARCHAR(2) NULL,
country_name VARCHAR(100) NULL,
city VARCHAR(100) NULL,
region_code VARCHAR(10) NULL,
region_name VARCHAR(100) NULL,
timezone VARCHAR(50) NULL,
browser VARCHAR(50) NULL,
browser_version VARCHAR(20) NULL,
os VARCHAR(50) NULL,
os_version VARCHAR(20) NULL,
device_type ENUM('desktop', 'mobile', 'tablet', 'bot') DEFAULT 'desktop',
language VARCHAR(10) NULL,
hour_of_day TINYINT NOT NULL,
day_of_week TINYINT NOT NULL,
month TINYINT NOT NULL,
year SMALLINT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_redirect_id (redirect_id),
INDEX idx_event_type (event_type),
INDEX idx_ip_long (ip_long),
INDEX idx_session_id (session_id),
INDEX idx_country_code (country_code),
INDEX idx_device_type (device_type),
INDEX idx_browser (browser),
INDEX idx_os (os),
INDEX idx_created_at (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
");
// Create analytics_redirects_daily table for daily aggregations
$this->db->query("
CREATE TABLE IF NOT EXISTS analytics_redirects_daily (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
redirect_id BIGINT UNSIGNED NOT NULL,
date DATE NOT NULL,
total_redirects INT NOT NULL DEFAULT 0,
total_clicks INT NOT NULL DEFAULT 0,
total_conversions INT NOT NULL DEFAULT 0,
total_errors INT NOT NULL DEFAULT 0,
unique_visitors INT NOT NULL DEFAULT 0,
unique_ips INT NOT NULL DEFAULT 0,
avg_response_time DECIMAL(10,2) NOT NULL DEFAULT 0.00,
bounce_rate DECIMAL(5,2) NOT NULL DEFAULT 0.00,
conversion_rate DECIMAL(5,2) NOT NULL DEFAULT 0.00,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY unique_redirect_date (redirect_id, date),
INDEX idx_redirect_id (redirect_id),
INDEX idx_date (date)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
");
echo "✅ Analytics integration tables created successfully!\n";
}
/**
* Reverse the migration
*/
public function down(): void
{
// Remove analytics fields from redirects table
$this->db->query("
ALTER TABLE redirects
DROP COLUMN analytics_enabled,
DROP COLUMN analytics_campaign_id,
DROP COLUMN analytics_tracker_id,
DROP COLUMN analytics_metadata,
DROP COLUMN last_analytics_sync,
DROP COLUMN analytics_hash
");
// Remove analytics indexes
$this->db->query("
ALTER TABLE redirects
DROP INDEX idx_analytics_enabled,
DROP INDEX idx_analytics_campaign_id,
DROP INDEX idx_analytics_tracker_id
");
// Drop analytics tables
$this->db->query("DROP TABLE IF EXISTS analytics_redirects_mapping");
$this->db->query("DROP TABLE IF EXISTS analytics_redirects_events");
$this->db->query("DROP TABLE IF EXISTS analytics_redirects_daily");
echo "✅ Analytics integration tables removed successfully!\n";
}
}
@@ -0,0 +1,223 @@
<?php
declare(strict_types=1);
namespace App\Modules\Redirects\Database\Migrations;
use App\Core\Database\Migration;
/**
* Migration: Integrate Redirects with Site Groups and Creatives
*
* This migration creates a unified multisites system by integrating redirects
* with the existing advertising site groups and creatives, while maintaining
* the tracker functionality and analytics capabilities.
*/
class IntegrateRedirectsWithSiteGroups extends Migration
{
/**
* Run the migration
*/
public function up(): void
{
// Add site group integration fields to redirects table
$sql = "
ALTER TABLE redirects
ADD COLUMN site_group_id BIGINT UNSIGNED NULL COMMENT 'Foreign key to advertising_site_groups',
ADD COLUMN creative_id BIGINT UNSIGNED NULL COMMENT 'Foreign key to advertising_creatives',
ADD COLUMN multisite_type ENUM('standalone', 'site_group', 'creative_based') DEFAULT 'standalone' COMMENT 'Type of multisite integration',
ADD COLUMN site_group_settings JSON NULL COMMENT 'Site group specific settings and configuration',
ADD COLUMN creative_settings JSON NULL COMMENT 'Creative specific settings and configuration',
ADD COLUMN traffic_weight INT(11) NOT NULL DEFAULT 100 COMMENT 'Traffic distribution weight (0-100)',
ADD COLUMN is_primary_redirect BOOLEAN DEFAULT FALSE COMMENT 'Is this the primary redirect for the site group',
ADD COLUMN multisite_status ENUM('active', 'paused', 'archived', 'testing') DEFAULT 'active' COMMENT 'Multisite specific status'
";
$this->db->query($sql);
// Add indexes for performance
$this->db->query("
ALTER TABLE redirects
ADD INDEX idx_site_group_id (site_group_id),
ADD INDEX idx_creative_id (creative_id),
ADD INDEX idx_multisite_type (multisite_type),
ADD INDEX idx_multisite_status (multisite_status),
ADD INDEX idx_traffic_weight (traffic_weight),
ADD INDEX idx_is_primary_redirect (is_primary_redirect)
");
// Create redirect_site_group_mapping table for advanced multisite management
$this->db->query("
CREATE TABLE IF NOT EXISTS redirect_site_group_mapping (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
redirect_id BIGINT UNSIGNED NOT NULL,
site_group_id BIGINT UNSIGNED NOT NULL,
creative_id BIGINT UNSIGNED NULL,
mapping_type ENUM('primary', 'fallback', 'geo_specific', 'device_specific', 'time_specific') NOT NULL DEFAULT 'primary',
priority INT NOT NULL DEFAULT 0 COMMENT 'Priority for this mapping (higher = more important)',
geo_targeting JSON NULL COMMENT 'Geographic targeting rules',
device_targeting JSON NULL COMMENT 'Device targeting rules',
time_targeting JSON NULL COMMENT 'Time-based targeting rules',
traffic_percentage DECIMAL(5,2) NOT NULL DEFAULT 100.00 COMMENT 'Percentage of traffic for this mapping',
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY unique_redirect_site_group (redirect_id, site_group_id),
INDEX idx_redirect_id (redirect_id),
INDEX idx_site_group_id (site_group_id),
INDEX idx_creative_id (creative_id),
INDEX idx_mapping_type (mapping_type),
INDEX idx_priority (priority),
INDEX idx_is_active (is_active)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
COMMENT='Advanced mapping between redirects, site groups and creatives for multisite management'
");
// Create redirect_multisite_analytics table for unified analytics
$this->db->query("
CREATE TABLE IF NOT EXISTS redirect_multisite_analytics (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
redirect_id BIGINT UNSIGNED NOT NULL,
site_group_id BIGINT UNSIGNED NULL,
creative_id BIGINT UNSIGNED NULL,
date DATE NOT NULL,
total_redirects INT NOT NULL DEFAULT 0,
total_clicks INT NOT NULL DEFAULT 0,
total_conversions INT NOT NULL DEFAULT 0,
unique_visitors INT NOT NULL DEFAULT 0,
unique_ips INT NOT NULL DEFAULT 0,
avg_response_time DECIMAL(10,2) NOT NULL DEFAULT 0.00,
traffic_source VARCHAR(50) NULL COMMENT 'Traffic source (direct, organic, paid, social)',
device_breakdown JSON NULL COMMENT 'Device type breakdown',
geo_breakdown JSON NULL COMMENT 'Geographic breakdown',
conversion_funnel JSON NULL COMMENT 'Conversion funnel data',
revenue_data JSON NULL COMMENT 'Revenue and ROI data',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY unique_multisite_date (redirect_id, site_group_id, creative_id, date),
INDEX idx_redirect_id (redirect_id),
INDEX idx_site_group_id (site_group_id),
INDEX idx_creative_id (creative_id),
INDEX idx_date (date),
INDEX idx_traffic_source (traffic_source)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
COMMENT='Unified analytics for redirects in multisite context'
");
// Create redirect_multisite_templates table for template management
$this->db->query("
CREATE TABLE IF NOT EXISTS redirect_multisite_templates (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
site_group_id BIGINT UNSIGNED NOT NULL,
template_name VARCHAR(255) NOT NULL,
template_type ENUM('redirect', 'landing', 'popup', 'interstitial', 'custom') NOT NULL DEFAULT 'redirect',
template_config JSON NOT NULL COMMENT 'Template configuration and settings',
html_template LONGTEXT NULL COMMENT 'HTML template content',
css_template LONGTEXT NULL COMMENT 'CSS template content',
js_template LONGTEXT NULL COMMENT 'JavaScript template content',
variables_schema JSON NULL COMMENT 'Template variables schema',
is_active BOOLEAN DEFAULT TRUE,
created_by BIGINT UNSIGNED NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX idx_site_group_id (site_group_id),
INDEX idx_template_type (template_type),
INDEX idx_is_active (is_active),
INDEX idx_created_by (created_by)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
COMMENT='Templates for multisite redirects and landing pages'
");
// Add foreign key constraints
try {
$this->db->query("
ALTER TABLE redirects
ADD CONSTRAINT fk_redirects_site_group
FOREIGN KEY (site_group_id) REFERENCES advertising_site_groups(id)
ON DELETE SET NULL ON UPDATE CASCADE
");
echo "✅ Added foreign key constraint to advertising_site_groups\n";
} catch (\Exception $e) {
echo "⚠️ Foreign key constraint to site_groups skipped: " . $e->getMessage() . "\n";
}
try {
$this->db->query("
ALTER TABLE redirects
ADD CONSTRAINT fk_redirects_creative
FOREIGN KEY (creative_id) REFERENCES advertising_creatives(id)
ON DELETE SET NULL ON UPDATE CASCADE
");
echo "✅ Added foreign key constraint to advertising_creatives\n";
} catch (\Exception $e) {
echo "⚠️ Foreign key constraint to creatives skipped: " . $e->getMessage() . "\n";
}
echo "✅ Multisites integration tables created successfully!\n";
echo "🎯 Redirects now integrated with Site Groups and Creatives system\n";
echo "🌐 Unified multisites management system ready\n";
}
/**
* Reverse the migration
*/
public function down(): void
{
// Remove foreign key constraints first
try {
$this->db->query("ALTER TABLE redirects DROP FOREIGN KEY fk_redirects_site_group");
echo "✅ Removed foreign key constraint to site_groups\n";
} catch (\Exception $e) {
echo "⚠️ Foreign key constraint removal skipped: " . $e->getMessage() . "\n";
}
try {
$this->db->query("ALTER TABLE redirects DROP FOREIGN KEY fk_redirects_site_group");
echo "✅ Removed foreign key constraint to creatives\n";
} catch (\Exception $e) {
echo "⚠️ Foreign key constraint removal skipped: " . $e->getMessage() . "\n";
}
// Remove indexes
$this->db->query("
ALTER TABLE redirects
DROP INDEX idx_site_group_id,
DROP INDEX idx_creative_id,
DROP INDEX idx_multisite_type,
DROP INDEX idx_multisite_status,
DROP INDEX idx_traffic_weight,
DROP INDEX idx_is_primary_redirect
");
// Remove columns
$this->db->query("
ALTER TABLE redirects
DROP COLUMN site_group_id,
DROP COLUMN creative_id,
DROP COLUMN multisite_type,
DROP COLUMN site_group_settings,
DROP COLUMN creative_settings,
DROP COLUMN traffic_weight,
DROP COLUMN is_primary_redirect,
DROP COLUMN multisite_status
");
// Drop tables
$this->db->query("DROP TABLE IF EXISTS redirect_site_group_mapping");
$this->db->query("DROP TABLE IF EXISTS redirect_multisite_analytics");
$this->db->query("DROP TABLE IF EXISTS redirect_multisite_templates");
echo "✅ Multisites integration reverted successfully\n";
}
/**
* Get migration description
*/
public function getDescription(): string
{
return "Integrate Redirects with Site Groups and Creatives for unified multisites system";
}
}
@@ -0,0 +1,120 @@
<?php
namespace App\Modules\Redirects\Models;
use App\Core\DatabaseManager;
class RedirectFilterModel
{
private DatabaseManager $db;
public function __construct()
{
$this->db = DatabaseManager::getInstance();
}
public function getByRedirectId(int $redirectId): array
{
$sql = "SELECT * FROM redirect_filters WHERE redirect_id = :redirect_id AND is_active = 1 ORDER BY priority DESC, id ASC";
return $this->db->fetchAll($sql, [':redirect_id' => $redirectId]) ?: [];
}
public function create(array $data): bool
{
$sql = "INSERT INTO redirect_filters (
redirect_id, filter_type, filter_value, filter_operator,
filter_value_secondary, priority, is_active
) VALUES (
?, ?, ?, ?, ?, ?, ?
)";
$params = [
$data['redirect_id'],
$data['filter_type'],
$data['filter_value'],
$data['filter_operator'] ?? 'equals',
$data['filter_value_secondary'] ?? null,
$data['priority'] ?? 0,
(int)($data['is_active'] ?? 1)
];
return $this->db->query($sql, $params) > 0;
}
public function update(int $id, array $data): bool
{
$sql = "UPDATE redirect_filters SET
filter_type = ?, filter_value = ?, filter_operator = ?,
filter_value_secondary = ?, priority = ?, is_active = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?";
$params = [
$data['filter_type'],
$data['filter_value'],
$data['filter_operator'] ?? 'equals',
$data['filter_value_secondary'] ?? null,
$data['priority'] ?? 0,
(int)($data['is_active'] ?? 1),
$id
];
return $this->db->query($sql, $params) > 0;
}
/**
* Soft delete redirect filter (update status to -1)
*/
public function delete(int $id): bool
{
$sql = "UPDATE redirect_filters SET status = '-1', updated_at = CURRENT_TIMESTAMP WHERE id = :id";
return $this->db->query($sql, [':id' => $id]) > 0;
}
/**
* Soft delete redirect filters by redirect ID (update status to -1)
*/
public function deleteByRedirectId(int $redirectId): bool
{
$sql = "UPDATE redirect_filters SET status = '-1', updated_at = CURRENT_TIMESTAMP WHERE redirect_id = :redirect_id";
return $this->db->query($sql, [':redirect_id' => $redirectId]) > 0;
}
public function getFilterTypes(): array
{
return [
'browser' => 'Browser',
'os' => 'Operating System',
'device_type' => 'Device Type',
'country' => 'Country',
'city' => 'City',
'region' => 'Region',
'timezone' => 'Timezone',
'language' => 'Language',
'referer' => 'Referer',
'hour' => 'Hour of Day',
'asn' => 'ASN',
'isp' => 'ISP'
];
}
public function getOperators(): array
{
return [
'equals' => 'Equals',
'contains' => 'Contains',
'starts_with' => 'Starts with',
'ends_with' => 'Ends with',
'regex' => 'Regular Expression',
'in' => 'In list',
'not_in' => 'Not in list',
'greater_than' => 'Greater than',
'less_than' => 'Less than',
'between' => 'Between'
];
}
public function getDb(): DatabaseManager
{
return $this->db;
}
}
@@ -0,0 +1,346 @@
<?php
namespace App\Modules\Redirects\Models;
use App\Core\DatabaseManager;
class RedirectModel
{
private DatabaseManager $db;
public function __construct()
{
$this->db = DatabaseManager::getInstance();
}
public function getAll(array $filters = []): array
{
// ✅ MySQL > PHP: Tudo processado na query para performance
$sql = "SELECT
r.id,
r.cuid,
r.analytics_slug,
r.name,
r.source_url,
r.target_url,
r.status,
r.redirect_type,
r.tracking_enabled,
r.created_at,
r.updated_at,
COALESCE(rs.total_clicks, 0) as total_clicks,
COALESCE(rs.unique_clicks, 0) as unique_clicks
FROM redirects r
LEFT JOIN (
SELECT
redirect_id,
COUNT(*) as total_clicks,
COUNT(DISTINCT ip_address) as unique_clicks
FROM redirect_stats
GROUP BY redirect_id
) rs ON rs.redirect_id = r.id
WHERE r.status >= 0";
$params = [];
// ✅ MySQL > PHP: Filtros aplicados na query, não em PHP
if (isset($filters['status']) && $filters['status'] !== '') {
$sql .= " AND r.status = ?";
$params[] = (int)$filters['status'];
}
if (!empty($filters['search'])) {
$sql .= " AND (r.name LIKE ? OR r.source_url LIKE ? OR r.target_url LIKE ?)";
$searchTerm = '%' . $filters['search'] . '%';
$params[] = $searchTerm;
$params[] = $searchTerm;
$params[] = $searchTerm;
}
// ✅ MySQL > PHP: Ordenação na query
$sql .= " ORDER BY r.created_at DESC";
return $this->db->fetchAll($sql, $params) ?: [];
}
public function getById(int $id): ?array
{
// ✅ MySQL > PHP: Query otimizada com JOIN para estatísticas
$sql = "SELECT
r.id,
r.cuid,
r.analytics_slug,
r.name,
r.source_url,
r.target_url,
r.fallback_url,
r.status,
r.redirect_type,
r.tracking_enabled,
r.max_clicks,
r.expires_at,
r.created_by,
r.created_at,
r.updated_at,
COALESCE(rs.total_clicks, 0) as total_clicks,
COALESCE(rs.unique_clicks, 0) as unique_clicks
FROM redirects r
LEFT JOIN (
SELECT
redirect_id,
COUNT(*) as total_clicks,
COUNT(DISTINCT ip_address) as unique_clicks
FROM redirect_stats
WHERE redirect_id = ?
GROUP BY redirect_id
) rs ON rs.redirect_id = r.id
WHERE r.id = ? AND r.status >= 0";
$result = $this->db->fetch($sql, [$id, $id]);
return $result ?: null;
}
public function getByCuid(string $cuid): ?array
{
// ✅ MySQL > PHP: Query otimizada para buscar por CUID
$sql = "SELECT
r.id,
r.cuid,
r.analytics_slug,
r.name,
r.source_url,
r.target_url,
r.fallback_url,
r.status,
r.redirect_type,
r.tracking_enabled,
r.max_clicks,
r.expires_at,
r.created_by,
r.created_at,
r.updated_at,
COALESCE(rs.total_clicks, 0) as total_clicks,
COALESCE(rs.unique_clicks, 0) as unique_clicks
FROM redirects r
LEFT JOIN (
SELECT
redirect_id,
COUNT(*) as total_clicks,
COUNT(DISTINCT ip_address) as unique_clicks
FROM redirect_stats
WHERE redirect_id = r.id
GROUP BY redirect_id
) rs ON rs.redirect_id = r.id
WHERE r.cuid = ? AND r.status >= 0";
$result = $this->db->fetch($sql, [$cuid]);
return $result ?: null;
}
public function create(array $data): bool
{
$cuid = $this->generateCuid();
$analyticsSlug = $this->generateAnalyticsSlug();
$sql = "INSERT INTO redirects (
cuid, analytics_slug, name, source_url, target_url, fallback_url,
status, redirect_type, tracking_enabled, max_clicks,
expires_at, created_by
) VALUES (
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)";
$params = [
$cuid,
$analyticsSlug,
$data['name'] ?? '',
$data['source_url'] ?? '',
$data['target_url'] ?? '',
$data['fallback_url'] ?? null,
(int)($data['status'] ?? 1),
$data['redirect_type'] ?? '302',
(int)($data['tracking_enabled'] ?? 1),
$data['max_clicks'] ?? null,
$data['expires_at'] ?? null,
$data['created_by'] ?? 1
];
return $this->db->query($sql, $params) > 0;
}
public function update(int $id, array $data): bool
{
$sql = "UPDATE redirects SET
name = ?, source_url = ?, target_url = ?, fallback_url = ?,
status = ?, redirect_type = ?, tracking_enabled = ?,
max_clicks = ?, expires_at = ?, updated_at = CURRENT_TIMESTAMP
WHERE id = ?";
$params = [
$data['name'] ?? '',
$data['source_url'] ?? '',
$data['target_url'] ?? '',
$data['fallback_url'] ?? null,
(int)($data['status'] ?? 1),
$data['redirect_type'] ?? '302',
(int)($data['tracking_enabled'] ?? 1),
$data['max_clicks'] ?? null,
$data['expires_at'] ?? null,
$id
];
return $this->db->query($sql, $params) > 0;
}
public function delete(int $id): bool
{
$sql = "UPDATE redirects SET status = -1 WHERE id = :id";
return $this->db->query($sql, [':id' => $id]) > 0;
}
public function getActiveRedirects(): array
{
return $this->getAll(['status' => 1]);
}
public function getRedirectStats(int $redirectId, ?string $startDate = null, ?string $endDate = null): array
{
$sql = "SELECT
DATE(created_at) as date,
COUNT(*) as total_clicks,
COUNT(DISTINCT ip_address) as unique_clicks,
AVG(response_time) as avg_response_time
FROM redirect_stats
WHERE redirect_id = ?";
$params = [$redirectId];
if ($startDate) {
$sql .= " AND created_at >= ?";
$params[] = $startDate;
}
if ($endDate) {
$sql .= " AND created_at <= ?";
$params[] = $endDate;
}
$sql .= " GROUP BY DATE(created_at) ORDER BY date DESC";
return $this->db->fetchAll($sql, $params) ?: [];
}
public function getCount(): int
{
$result = $this->db->fetch("SELECT COUNT(*) as count FROM redirects WHERE status >= 0");
return (int)($result['count'] ?? 0);
}
public function getCountByStatus(): array
{
$sql = "SELECT status, COUNT(*) as count FROM redirects WHERE status >= 0 GROUP BY status";
return $this->db->fetchAll($sql) ?: [];
}
public function getActiveCount(): int
{
$result = $this->db->fetch("SELECT COUNT(*) as count FROM redirects WHERE status = 1");
return (int)($result['count'] ?? 0);
}
public function getInactiveCount(): int
{
$result = $this->db->fetch("SELECT COUNT(*) as count FROM redirects WHERE status = 0");
return (int)($result['count'] ?? 0);
}
public function getDb(): DatabaseManager
{
return $this->db;
}
/**
* Create redirect and associated creative
*/
public function createWithCreative(array $data): bool
{
return $this->db->transaction(function($db) use ($data) {
// Create redirect
$redirectCreated = $this->create($data);
if (!$redirectCreated) {
return false;
}
// Get the created redirect ID
$redirectId = $db->lastInsertId();
// Create associated creative
$creativeService = new \App\Modules\Redirects\Services\RedirectCreativeService();
$creativeCreated = $creativeService->createCreativeFromRedirect($data);
if (!$creativeCreated) {
return false;
}
return true;
});
}
/**
* Update redirect and associated creative
*/
public function updateWithCreative(int $id, array $data): bool
{
return $this->db->transaction(function($db) use ($id, $data) {
// Update redirect
$redirectUpdated = $this->update($id, $data);
if (!$redirectUpdated) {
return false;
}
// Update associated creative
$creativeService = new \App\Modules\Redirects\Services\RedirectCreativeService();
$creativeUpdated = $creativeService->updateCreativeFromRedirect($id, $data);
if (!$creativeUpdated) {
return false;
}
return true;
});
}
/**
* Delete redirect and associated creative
*/
public function deleteWithCreative(int $id): bool
{
return $this->db->transaction(function($db) use ($id) {
// Delete redirect (soft delete)
$redirectDeleted = $this->delete($id);
if (!$redirectDeleted) {
return false;
}
// Delete associated creative (soft delete)
$creativeService = new \App\Modules\Redirects\Services\RedirectCreativeService();
$creativeDeleted = $creativeService->deleteCreativeByRedirectId($id);
if (!$creativeDeleted) {
return false;
}
return true;
});
}
private function generateCuid(): string
{
return (string) new \Visus\Cuid2\Cuid2();
}
private function generateAnalyticsSlug(): string
{
// Usar cuid2 para gerar slug único para analytics (diferente do cuid principal)
return (string) new \Visus\Cuid2\Cuid2();
}
}
@@ -0,0 +1,210 @@
<?php
namespace App\Modules\Redirects\Models;
use App\Core\DatabaseManager;
class RedirectStatsModel
{
private DatabaseManager $db;
public function __construct()
{
$this->db = DatabaseManager::getInstance();
}
public function create(array $data): bool
{
$sql = "INSERT INTO redirect_stats (
redirect_id, session_id, ip_address, ip_long, user_agent, referer,
country_code, country_name, city, region_code, region_name, timezone,
asn, isp, browser, browser_version, os, os_version, device_type,
language, hour_of_day, day_of_week, month, year,
response_time_ms, target_url_used, filter_matched, raw_request
) VALUES (
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)";
$params = [
$data['redirect_id'],
$data['session_id'],
$data['ip_address'],
$data['ip_long'],
$data['user_agent'] ?? null,
$data['referer'] ?? null,
$data['country_code'] ?? null,
$data['country_name'] ?? null,
$data['city'] ?? null,
$data['region_code'] ?? null,
$data['region_name'] ?? null,
$data['timezone'] ?? null,
$data['asn'] ?? null,
$data['isp'] ?? null,
$data['browser'] ?? null,
$data['browser_version'] ?? null,
$data['os'] ?? null,
$data['os_version'] ?? null,
$data['device_type'] ?? 'desktop',
$data['language'] ? substr($data['language'], 0, 10) : null,
$data['hour_of_day'],
$data['day_of_week'],
$data['month'],
$data['year'],
$data['response_time_ms'] ?? null,
$data['target_url_used'] ?? null,
$data['filter_matched'] ?? null,
$data['raw_request'] ?? null
];
return $this->db->query($sql, $params) > 0;
}
public function getStatsByRedirect(int $redirectId, ?string $startDate = null, ?string $endDate = null): array
{
$sql = "SELECT
COUNT(*) as total_clicks,
COUNT(DISTINCT session_id) as unique_clicks,
COUNT(DISTINCT ip_address) as unique_ips,
AVG(response_time_ms) as avg_response_time
FROM redirect_stats
WHERE redirect_id = ?";
$params = [$redirectId];
if ($startDate) {
$sql .= " AND DATE(timestamp) >= ?";
$params[] = $startDate;
}
if ($endDate) {
$sql .= " AND DATE(timestamp) <= ?";
$params[] = $endDate;
}
return $this->db->fetch($sql, $params) ?: [];
}
public function getStatsByCountry(int $redirectId, ?string $startDate = null, ?string $endDate = null): array
{
$sql = "SELECT
country_code, country_name,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE redirect_id = ? AND country_code IS NOT NULL";
$params = [$redirectId];
if ($startDate) {
$sql .= " AND DATE(timestamp) >= ?";
$params[] = $startDate;
}
if ($endDate) {
$sql .= " AND DATE(timestamp) <= ?";
$params[] = $endDate;
}
$sql .= " GROUP BY country_code, country_name ORDER BY clicks DESC";
return $this->db->fetchAll($sql, $params) ?: [];
}
public function getStatsByDevice(int $redirectId, ?string $startDate = null, ?string $endDate = null): array
{
$sql = "SELECT
device_type,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE redirect_id = ? AND device_type IS NOT NULL";
$params = [$redirectId];
if ($startDate) {
$sql .= " AND DATE(timestamp) >= ?";
$params[] = $startDate;
}
if ($endDate) {
$sql .= " AND DATE(timestamp) <= ?";
$params[] = $endDate;
}
$sql .= " GROUP BY device_type ORDER BY clicks DESC";
return $this->db->fetchAll($sql, $params) ?: [];
}
public function getStatsByBrowser(int $redirectId, ?string $startDate = null, ?string $endDate = null): array
{
$sql = "SELECT
browser,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE redirect_id = ? AND browser IS NOT NULL";
$params = [$redirectId];
if ($startDate) {
$sql .= " AND DATE(timestamp) >= ?";
$params[] = $startDate;
}
if ($endDate) {
$sql .= " AND DATE(timestamp) <= ?";
$params[] = $endDate;
}
$sql .= " GROUP BY browser ORDER BY clicks DESC";
return $this->db->fetchAll($sql, $params) ?: [];
}
public function getStatsByHour(int $redirectId, ?string $startDate = null, ?string $endDate = null): array
{
$sql = "SELECT
hour_of_day,
COUNT(*) as clicks,
COUNT(DISTINCT session_id) as unique_clicks
FROM redirect_stats
WHERE redirect_id = ?";
$params = [$redirectId];
if ($startDate) {
$sql .= " AND DATE(timestamp) >= ?";
$params[] = $startDate;
}
if ($endDate) {
$sql .= " AND DATE(timestamp) <= ?";
$params[] = $endDate;
}
$sql .= " GROUP BY hour_of_day ORDER BY hour_of_day";
return $this->db->fetchAll($sql, $params) ?: [];
}
public function getRecentActivity(int $redirectId, int $limit = 10): array
{
// Sanitize limit to prevent SQL injection
$limit = max(1, min(1000, (int)$limit));
$sql = "SELECT
ip_address, user_agent, browser, os, device_type,
country_code, city, timestamp, target_url_used
FROM redirect_stats
WHERE redirect_id = ?
ORDER BY timestamp DESC
LIMIT " . $limit;
return $this->db->fetchAll($sql, [$redirectId]) ?: [];
}
public function getDb(): DatabaseManager
{
return $this->db;
}
}
+78
View File
@@ -0,0 +1,78 @@
<?php
namespace App\Modules\Redirects;
use App\Core\MenuManager;
use App\Core\View;
class Module
{
public static function getConfig(): array
{
return [
'name' => 'Redirects',
'version' => '1.0.0',
'description' => 'Sistema de redirects inteligentes com targeting server-side',
'author' => 'BitReport Unip. LDA',
'enabled' => true,
'dependencies' => ['Core', 'Analytics'],
'features' => [
'redirect_management' => true,
'server_side_targeting' => true,
'geo_targeting' => true,
'device_targeting' => true,
'browser_targeting' => true,
'time_targeting' => true,
'analytics_tracking' => true,
'performance_optimization' => true
]
];
}
public static function registerRoutes($router): void
{
require __DIR__ . '/Routes/web.php';
require __DIR__ . '/Routes/api.php';
require __DIR__ . '/Routes/public.php';
}
public static function registerServices(): void
{
// Registar namespace das views do módulo
View::addNamespace('redirects', __DIR__ . '/Views');
// Registar serviços do módulo no ServiceContainer
$container = \App\Core\ServiceContainer::getInstance();
// Registar modelos
$container->registerModuleService('Redirects', 'model.RedirectModel', function() {
return new \App\Modules\Redirects\Models\RedirectModel();
}, true);
$container->registerModuleService('Redirects', 'model.RedirectFilterModel', function() {
return new \App\Modules\Redirects\Models\RedirectFilterModel();
}, true);
$container->registerModuleService('Redirects', 'model.RedirectStatsModel', function() {
return new \App\Modules\Redirects\Models\RedirectStatsModel();
}, true);
// Registar serviços
if (file_exists(__DIR__ . '/Services/RedirectProcessor.php')) {
require_once __DIR__ . '/Services/RedirectProcessor.php';
$container->registerModuleService('Redirects', 'RedirectProcessor', function() {
return new \App\Modules\Redirects\Services\RedirectProcessor();
}, true);
}
}
public static function registerMenu(): void
{
// Carregar ficheiro de menu do módulo
$menuFile = __DIR__ . '/menu.php';
if (file_exists($menuFile)) {
require $menuFile;
}
}
}
+46
View File
@@ -0,0 +1,46 @@
<?php
use App\Core\Router;
use App\Core\AuthMiddleware;
use App\Modules\Redirects\Controllers\RedirectsApiController;
/** @var Router $router */
// Middleware para autenticação: aceita sessão ativa OU Bearer token
$authMiddleware = [AuthMiddleware::class, 'apiOrAuth'];
// Stats API endpoint (deve vir ANTES das rotas com {id} para evitar conflitos)
$router->get('/api/redirects/stats', [RedirectsApiController::class, 'statsApi'], $authMiddleware);
// Redirect creatives endpoint para integração com Advertising module (deve vir ANTES das rotas com {id})
$router->get('/api/redirects/creatives', [RedirectsApiController::class, 'getRedirectCreatives'], $authMiddleware);
$router->post('/api/redirects/creatives/migrate', [RedirectsApiController::class, 'migrateRedirectsToCreatives'], $authMiddleware);
// Dados dinâmicos para formulários de redirects
$router->get('/api/redirects/types', [RedirectsApiController::class, 'getRedirectTypes'], $authMiddleware);
$router->get('/api/redirects/statuses', [RedirectsApiController::class, 'getStatuses'], $authMiddleware);
$router->get('/api/redirects/filter-types', [RedirectsApiController::class, 'getFilterTypes'], $authMiddleware);
$router->get('/api/redirects/filter-operators', [RedirectsApiController::class, 'getFilterOperators'], $authMiddleware);
// Settings API endpoint
$router->get('/api/redirects/settings', [RedirectsApiController::class, 'getSettings'], $authMiddleware);
$router->post('/api/redirects/settings', [RedirectsApiController::class, 'updateSettings'], $authMiddleware);
// CRUD endpoints
// Endpoint principal da listagem
$router->get('/api/redirects', [RedirectsApiController::class, 'index'], $authMiddleware);
$router->post('/api/redirects', [RedirectsApiController::class, 'create'], $authMiddleware);
$router->get('/api/redirects/{id}', [RedirectsApiController::class, 'show'], $authMiddleware);
$router->put('/api/redirects/{id}', [RedirectsApiController::class, 'update'], $authMiddleware);
$router->delete('/api/redirects/{id}', [RedirectsApiController::class, 'delete'], $authMiddleware);
// Stats endpoints por redirect específico
$router->get('/api/redirects/{id}/stats', [RedirectsApiController::class, 'getStats'], $authMiddleware);
$router->get('/api/redirects/{id}/filters', [RedirectsApiController::class, 'getFilters'], $authMiddleware);
$router->post('/api/redirects/{id}/filters', [RedirectsApiController::class, 'addFilter'], $authMiddleware);
$router->delete('/api/redirects/{id}/filters/{filterId}', [RedirectsApiController::class, 'deleteFilter'], $authMiddleware);
// Site groups endpoint para integração com multisites
$router->get('/api/redirects/{id}/site-groups', [RedirectsApiController::class, 'getSiteGroups'], $authMiddleware);
$router->post('/api/redirects/{id}/site-groups', [RedirectsApiController::class, 'associateSiteGroup'], $authMiddleware);
$router->put('/api/redirects/{id}/site-groups/{mappingId}', [RedirectsApiController::class, 'updateSiteGroup'], $authMiddleware);
$router->delete('/api/redirects/{id}/site-groups/{mappingId}', [RedirectsApiController::class, 'removeSiteGroup'], $authMiddleware);
+12
View File
@@ -0,0 +1,12 @@
<?php
use App\Modules\Redirects\Controllers\PublicRedirectsController;
// Rotas públicas do módulo de redirects
$router->get('/public/redirects', [PublicRedirectsController::class, 'dashboard']);
$router->get('/public/redirects/redirects', [PublicRedirectsController::class, 'redirects']);
$router->get('/public/redirects/redirects/{int:id}', [PublicRedirectsController::class, 'viewRedirect']);
$router->get('/public/redirects/stats', [PublicRedirectsController::class, 'stats']);
$router->get('/public/redirects/stats/api', [PublicRedirectsController::class, 'statsApi']);
// Rota pública para processar redirects (sem autenticação)
$router->get('/r/{cuid}', [PublicRedirectsController::class, 'processRedirect']);
+20
View File
@@ -0,0 +1,20 @@
<?php
use App\Core\Router;
use App\Modules\Redirects\Controllers\RedirectsController;
$router = Router::getInstance();
// Rotas do módulo de redirects
$router->get('/redirects', [RedirectsController::class, 'dashboard']);
// API routes for redirects are defined in Redirects/Routes/api.php
$router->get('/redirects/stats', [RedirectsController::class, 'stats']);
$router->get('/redirects/settings', [RedirectsController::class, 'settings']);
$router->get('/redirects/create', [RedirectsController::class, 'createRedirect']); // Shortcut route
$router->get('/redirects/redirects', [RedirectsController::class, 'redirects']);
$router->get('/redirects/redirects/create', [RedirectsController::class, 'createRedirect']);
$router->get('/redirects/edit/{int:id}', [RedirectsController::class, 'editRedirect']); // Shortcut route
$router->get('/redirects/view/{int:id}', [RedirectsController::class, 'viewRedirect']); // Shortcut route
$router->get('/redirects/redirects/{int:id}/edit', [RedirectsController::class, 'editRedirect']);
$router->get('/redirects/redirects/{int:id}', [RedirectsController::class, 'viewRedirect']);
@@ -0,0 +1,245 @@
<?php
namespace App\Modules\Redirects\Services;
use App\Core\DatabaseManager;
use App\Core\ErrorReporter;
use Visus\Cuid2\Cuid2;
class RedirectAutoCreatorService
{
private DatabaseManager $db;
public function __construct()
{
$this->db = DatabaseManager::getInstance();
}
/**
* Create a complete redirect setup: multisite + campaign + creative
*/
public function createCompleteRedirect(array $redirectData): array
{
try {
return $this->db->transaction(function() use ($redirectData) {
// 1. Extract domain from source URL
$domain = $this->extractDomain($redirectData['source_url']);
if (!$domain) {
throw new \Exception("Invalid source URL");
}
// 2. Create or get site group (multisite)
$siteGroupId = $this->createOrGetSiteGroup($domain);
// 3. Create or get campaign
$campaignId = $this->createOrGetCampaign($domain, $siteGroupId);
// 4. Create creative
$creativeId = $this->createCreative($redirectData, $campaignId);
// 5. Associate creative with campaign
$this->associateCreativeWithCampaign($creativeId, $campaignId);
return [
'success' => true,
'site_group_id' => $siteGroupId,
'campaign_id' => $campaignId,
'creative_id' => $creativeId,
'message' => 'Redirect created successfully with multisite and campaign'
];
});
} catch (\Exception $e) {
ErrorReporter::report($e, [
'context' => 'redirect_auto_creation',
'redirect_data' => $redirectData
]);
return [
'success' => false,
'message' => 'Failed to create redirect: ' . $e->getMessage()
];
}
}
/**
* Extract domain from URL
*/
private function extractDomain(string $url): ?string
{
if (preg_match('/(?:https?:\/\/)?(?:www\.)?([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/', $url, $matches)) {
return $matches[1];
}
return null;
}
/**
* Create or get existing site group
*/
private function createOrGetSiteGroup(string $domain): int
{
// Check if site group already exists
$existing = $this->db->fetch(
"SELECT id FROM advertising_site_groups WHERE name LIKE ? OR alias LIKE ?",
["%$domain%", "%$domain%"]
);
if ($existing) {
return $existing['id'];
}
// Create new site group
$siteGroupData = [
'cuid' => (new Cuid2())->toString(),
'name' => "Redirects - $domain",
'alias' => "redirects_" . str_replace(['.', '-'], '_', $domain),
'status' => 1
];
$sql = "INSERT INTO advertising_site_groups (cuid, name, alias, status) VALUES (?, ?, ?, ?)";
$this->db->query($sql, [$siteGroupData['cuid'], $siteGroupData['name'], $siteGroupData['alias'], $siteGroupData['status']]);
return $this->db->lastInsertId();
}
/**
* Create or get existing campaign
*/
private function createOrGetCampaign(string $domain, int $siteGroupId): int
{
// Check if campaign already exists
$existing = $this->db->fetch(
"SELECT id FROM advertising_campaigns WHERE name LIKE ? AND site_group_id = ?",
["%$domain%", $siteGroupId]
);
if ($existing) {
return $existing['id'];
}
// Create new campaign
$campaignData = [
'cuid' => (new Cuid2())->toString(),
'name' => "Redirects - $domain",
'site_group_id' => $siteGroupId,
'status' => 1,
'type' => 'banner',
'timezone' => 'UTC',
'frequency_period' => 'day',
'expire_hours' => 24.00,
'expire_mobile_hours' => 24.00,
'allow_close' => 1,
'created_by' => 1
];
$sql = "INSERT INTO advertising_campaigns (
cuid, name, site_group_id, status, type, timezone,
frequency_period, expire_hours, expire_mobile_hours, allow_close, created_by
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$this->db->query($sql, [
$campaignData['cuid'], $campaignData['name'], $campaignData['site_group_id'],
$campaignData['status'], $campaignData['type'], $campaignData['timezone'],
$campaignData['frequency_period'], $campaignData['expire_hours'],
$campaignData['expire_mobile_hours'], $campaignData['allow_close'], $campaignData['created_by']
]);
return $this->db->lastInsertId();
}
/**
* Create creative from redirect data
*/
private function createCreative(array $redirectData, int $campaignId): string
{
$creativeData = [
'cuid' => (new Cuid2())->toString(),
'name' => $redirectData['name'],
'description' => "Redirect from {$redirectData['source_url']} to {$redirectData['target_url']}",
'view_url' => $redirectData['target_url'],
'creative_type' => 'redirect',
'is_active' => $redirectData['status'] ? 1 : 0,
'width' => 300,
'height' => 250,
'file_name' => "redirect_{$redirectData['name']}.html",
'file_path' => "/redirects/redirect_{$redirectData['name']}.html",
'file_size' => 1024,
'mime_type' => 'text/html'
];
$sql = "INSERT INTO advertising_creatives (
cuid, name, description, view_url, creative_type, is_active,
width, height, file_name, file_path, file_size, mime_type
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$this->db->query($sql, [
$creativeData['cuid'], $creativeData['name'], $creativeData['description'],
$creativeData['view_url'], $creativeData['creative_type'], $creativeData['is_active'],
$creativeData['width'], $creativeData['height'], $creativeData['file_name'],
$creativeData['file_path'], $creativeData['file_size'], $creativeData['mime_type']
]);
return $creativeData['cuid'];
}
/**
* Associate creative with campaign
*/
private function associateCreativeWithCampaign(string $creativeId, int $campaignId): void
{
$sql = "INSERT INTO advertising_campaign_trackers (campaign_id, tracker_id, format_id, country, order_position)
VALUES (?, (SELECT id FROM advertising_creatives WHERE cuid = ?), 1, 'PT', 0)";
$this->db->query($sql, [$campaignId, $creativeId]);
}
/**
* Update existing redirect with new creative
*/
public function updateRedirectCreative(int $redirectId, array $redirectData): array
{
try {
return $this->db->transaction(function() use ($redirectId, $redirectData) {
// Find existing creative by redirect ID
$creative = $this->db->fetch(
"SELECT c.cuid, c.id FROM advertising_creatives c
WHERE c.description LIKE ? AND c.creative_type = 'redirect'
ORDER BY c.created_at DESC LIMIT 1",
["%Redirect from " . $redirectData['source_url'] . "%"]
);
if (!$creative) {
throw new \Exception("Creative not found for redirect ID $redirectId");
}
// Update creative
$sql = "UPDATE advertising_creatives SET
name = ?, view_url = ?, is_active = ?,
description = ?, updated_at = CURRENT_TIMESTAMP
WHERE id = ?";
$this->db->query($sql, [
$redirectData['name'],
$redirectData['target_url'],
$redirectData['status'] ? 1 : 0,
"Redirect from {$redirectData['source_url']} to {$redirectData['target_url']}",
$creative['id']
]);
return [
'success' => true,
'creative_id' => $creative['cuid'],
'message' => 'Redirect updated successfully'
];
});
} catch (\Exception $e) {
ErrorReporter::report($e, [
'context' => 'redirect_update',
'redirect_id' => $redirectId,
'redirect_data' => $redirectData
]);
return [
'success' => false,
'message' => 'Failed to update redirect: ' . $e->getMessage()
];
}
}
}
@@ -0,0 +1,217 @@
<?php
namespace App\Modules\Redirects\Services;
use App\Core\DatabaseManager;
use App\Modules\Redirects\Models\RedirectModel;
/**
* Service to integrate redirects as creatives in the Advertising module
*
* This service transforms redirects into creatives of type "redirect"
* using the standard creative fields, not custom redirect fields
*/
class RedirectCreativeService
{
private DatabaseManager $db;
private RedirectModel $redirectModel;
public function __construct()
{
$this->db = DatabaseManager::getInstance();
$this->redirectModel = new RedirectModel();
}
/**
* Create a creative from a redirect
*/
public function createCreativeFromRedirect(array $redirectData): bool
{
// Generate unique CUID for creative
$cuid = $this->generateCuid();
// Create creative using standard fields
$sql = "INSERT INTO advertising_creatives (
cuid, name, file_name, file_path, file_size, mime_type,
width, height, alt_text, is_active, description,
creative_type, view_url, target_country
) VALUES (
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)";
$params = [
$cuid,
$redirectData['name'],
$this->generateFileName($redirectData['name']),
'/redirects/' . $cuid . '.html', // Virtual file path
1024, // Standard size for redirects
'text/html',
300, // Standard width
250, // Standard height
'Redirect: ' . $redirectData['name'],
1, // Active
'Redirect from ' . $redirectData['source_url'] . ' to ' . $redirectData['target_url'],
'redirect', // Creative type
$redirectData['target_url'], // View URL = target URL
null // Target country (can be set later)
];
return $this->db->query($sql, $params) > 0;
}
/**
* Update a creative when redirect is updated
*/
public function updateCreativeFromRedirect(int $redirectId, array $redirectData): bool
{
// Find the creative associated with this redirect
$creative = $this->getCreativeByRedirectId($redirectId);
if (!$creative) {
// If no creative exists, create one
return $this->createCreativeFromRedirect($redirectData);
}
$sql = "UPDATE advertising_creatives SET
name = ?,
description = ?,
view_url = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?";
$params = [
$redirectData['name'],
'Redirect from ' . $redirectData['source_url'] . ' to ' . $redirectData['target_url'],
$redirectData['target_url'],
$creative['id']
];
return $this->db->query($sql, $params) > 0;
}
/**
* Migrate all existing redirects to creatives
*/
public function migrateAllRedirects(): array
{
$results = [];
// Get all redirects that don't have associated creatives
$sql = "SELECT r.* FROM redirects r
LEFT JOIN advertising_creatives ac ON ac.creative_type = 'redirect'
AND ac.description LIKE CONCAT('%Redirect from ', r.id, '%')
WHERE r.status >= 0 AND ac.id IS NULL";
$redirects = $this->db->fetchAll($sql);
foreach ($redirects as $redirect) {
try {
$success = $this->createCreativeFromRedirect($redirect);
$results[] = [
'redirect_id' => $redirect['id'],
'redirect_name' => $redirect['name'],
'success' => $success,
'message' => $success ? 'Creative created successfully' : 'Failed to create creative'
];
} catch (\Exception $e) {
$results[] = [
'redirect_id' => $redirect['id'],
'redirect_name' => $redirect['name'],
'success' => false,
'message' => 'Error: ' . $e->getMessage()
];
}
}
return $results;
}
/**
* Get creative by redirect ID
*/
public function getCreativeByRedirectId(int $redirectId): ?array
{
// First, get the redirect to find its target_url
$redirect = $this->db->fetch("SELECT target_url FROM redirects WHERE id = ?", [$redirectId]);
if (!$redirect) {
return null;
}
// Find creative by view_url (which should match target_url)
$sql = "SELECT * FROM advertising_creatives
WHERE creative_type = 'redirect'
AND view_url = ?";
return $this->db->fetch($sql, [$redirect['target_url']]) ?: null;
}
/**
* Get all redirect creatives
*/
public function getAllRedirectCreatives(): array
{
$sql = "SELECT * FROM advertising_creatives
WHERE creative_type = 'redirect'
AND is_active = 1
ORDER BY created_at DESC";
return $this->db->fetchAll($sql) ?: [];
}
/**
* Delete creative when redirect is deleted
*/
public function deleteCreativeByRedirectId(int $redirectId): bool
{
try {
$creative = $this->getCreativeByRedirectId($redirectId);
if (!$creative) {
// Se não existe creative associado, consideramos sucesso
return true;
}
$sql = "UPDATE advertising_creatives SET
is_active = 0,
deleted_at = CURRENT_TIMESTAMP
WHERE id = ?";
return $this->db->query($sql, [$creative['id']]) > 0;
} catch (\Exception $e) {
// Log do erro mas não falha a operação
error_log("Error deleting creative for redirect {$redirectId}: " . $e->getMessage());
return true; // Consideramos sucesso para não bloquear a eliminação do redirect
}
}
/**
* Generate unique CUID for creative
*/
private function generateCuid(): string
{
return 'creative_' . uniqid() . '_' . time();
}
/**
* Generate file name for creative
*/
private function generateFileName(string $name): string
{
return 'redirect_' . preg_replace('/[^a-zA-Z0-9]/', '_', $name) . '.html';
}
/**
* Get redirect statistics for creative
*/
public function getRedirectStatsForCreative(int $creativeId): array
{
$creative = $this->db->fetch("SELECT * FROM advertising_creatives WHERE id = ?", [$creativeId]);
if (!$creative || $creative['creative_type'] !== 'redirect') {
return [];
}
// Extract redirect ID from description or use creative ID as reference
// This is a simplified approach - in production you might want a proper mapping table
$redirectId = $creativeId; // Simplified for now
return $this->redirectModel->getRedirectStats($redirectId);
}
}
@@ -0,0 +1,16 @@
<?php
namespace App\Modules\Redirects\Services;
/**
* Simplified RedirectProcessor - redirects are just creatives
* No complex filtering needed, just return target URL
*/
class RedirectProcessor
{
public function processRedirect(array $redirect): string
{
// Redirects are simple creatives, just return target URL
// Analytics and targeting are handled by the Advertising module
return $redirect['target_url'];
}
}
@@ -0,0 +1,35 @@
<!-- Template para filtros dinâmicos -->
<template id="filter-row-template">
<div class="filter-row row mb-3" data-filter-index="{{INDEX}}">
<div class="col-md-4">
<div class="mb-3">
<label for="filter_type_{{INDEX}}" class="form-label">Filter Type *</label>
<select class="form-select" id="filter_type_{{INDEX}}" name="filters[{{INDEX}}][type]" required>
<option value="">Select filter type...</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<label for="filter_operator_{{INDEX}}" class="form-label">Operator *</label>
<select class="form-select" id="filter_operator_{{INDEX}}" name="filters[{{INDEX}}][operator]" required>
<option value="">Select operator...</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="mb-3">
<label for="filter_value_{{INDEX}}" class="form-label">Value *</label>
<input type="text" class="form-control" id="filter_value_{{INDEX}}" name="filters[{{INDEX}}][value]" required>
</div>
</div>
<div class="col-md-1">
<div class="mb-3">
<label class="form-label">&nbsp;</label>
<button type="button" class="btn btn-danger remove-filter" title="Remove Filter">
<i class="ri-delete-bin-line"></i>
</button>
</div>
</div>
</div>
</template>
+289
View File
@@ -0,0 +1,289 @@
<?php
/**
* Redirects Dashboard
*
* @var array $stats Statistics data
* @var string $title Page title
*/
?>
<!-- Stats Cards -->
<div class="row">
<div class="col-xl-3 col-md-6">
<div class="card mini-stats-wid">
<div class="card-body">
<div class="d-flex">
<div class="flex-grow-1">
<p class="text-muted fw-medium">Total Redirects</p>
<h4 class="mb-0"><?= number_format($stats['total_redirects']) ?></h4>
</div>
<div class="flex-shrink-0 align-self-center">
<div class="mini-stat-icon avatar-sm rounded-circle bg-primary align-self-center">
<span class="avatar-title">
<i class="ri-link font-size-24"></i>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card mini-stats-wid">
<div class="card-body">
<div class="d-flex">
<div class="flex-grow-1">
<p class="text-muted fw-medium">Active Redirects</p>
<h4 class="mb-0"><?= number_format($stats['active_redirects']) ?></h4>
</div>
<div class="flex-shrink-0 align-self-center">
<div class="mini-stat-icon avatar-sm rounded-circle bg-success align-self-center">
<span class="avatar-title">
<i class="ri-check-line font-size-24"></i>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card mini-stats-wid">
<div class="card-body">
<div class="d-flex">
<div class="flex-grow-1">
<p class="text-muted fw-medium">Inactive Redirects</p>
<h4 class="mb-0"><?= number_format($stats['inactive_redirects']) ?></h4>
</div>
<div class="flex-shrink-0 align-self-center">
<div class="mini-stat-icon avatar-sm rounded-circle bg-warning align-self-center">
<span class="avatar-title">
<i class="ri-pause-line font-size-24"></i>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card mini-stats-wid">
<div class="card-body">
<div class="d-flex">
<div class="flex-grow-1">
<p class="text-muted fw-medium">Total Clicks</p>
<h4 class="mb-0">0</h4>
</div>
<div class="flex-shrink-0 align-self-center">
<div class="mini-stat-icon avatar-sm rounded-circle bg-info align-self-center">
<span class="avatar-title">
<i class="ri-mouse-line font-size-24"></i>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<h4 class="card-title mb-4">Quick Actions</h4>
<div class="row">
<div class="col-md-3">
<a href="/redirects/redirects/create" class="btn btn-primary w-100 mb-3">
<i class="ri-add-line me-2"></i>Create Redirect
</a>
</div>
<div class="col-md-3">
<a href="/redirects/redirects" class="btn btn-outline-primary w-100 mb-3">
<i class="ri-list-check me-2"></i>View All Redirects
</a>
</div>
<div class="col-md-3">
<a href="/redirects/stats" class="btn btn-outline-info w-100 mb-3">
<i class="ri-bar-chart-line me-2"></i>Analytics
</a>
</div>
<div class="col-md-3">
<a href="/redirects/settings" class="btn btn-outline-secondary w-100 mb-3">
<i class="ri-settings-3-line me-2"></i>Settings
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Recent Redirects -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="d-flex align-items-center mb-4">
<h4 class="card-title mb-0">Recent Redirects</h4>
<div class="flex-grow-1"></div>
<a href="/redirects/redirects" class="btn btn-sm btn-outline-primary">View All</a>
</div>
<?php if (empty($stats['recent_redirects'])): ?>
<div class="text-center py-4">
<i class="ri-link font-size-48 text-muted"></i>
<h5 class="mt-3 text-muted">No redirects yet</h5>
<p class="text-muted">Create your first redirect to get started</p>
<a href="/redirects/redirects/create" class="btn btn-primary">Create Redirect</a>
</div>
<?php else: ?>
<div class="table-responsive">
<table class="table table-centered table-nowrap mb-0">
<thead>
<tr>
<th>Name</th>
<th>Target URL</th>
<th>Status</th>
<th>Created</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($stats['recent_redirects'] as $redirect): ?>
<tr>
<td>
<div class="d-flex align-items-center">
<div class="avatar-sm bg-light rounded-circle me-3">
<span class="avatar-title">
<i class="ri-link font-size-16"></i>
</span>
</div>
<div>
<h6 class="mb-0"><?= htmlspecialchars($redirect['name']) ?></h6>
<small class="text-muted"><?= htmlspecialchars($redirect['id']) ?></small>
</div>
</div>
</td>
<td>
<span class="text-truncate d-inline-block" style="max-width: 200px;" title="<?= htmlspecialchars($redirect['target_url']) ?>">
<?= htmlspecialchars($redirect['target_url']) ?>
</span>
</td>
<td>
<?php if ($redirect['status'] == 1): ?>
<span class="badge bg-success">Active</span>
<?php elseif ($redirect['status'] == 0): ?>
<span class="badge bg-warning">Inactive</span>
<?php else: ?>
<span class="badge bg-danger">Deleted</span>
<?php endif; ?>
</td>
<td>
<?= date('M j, Y', strtotime($redirect['created_at'])) ?>
</td>
<td>
<div class="dropdown">
<a href="#" class="dropdown-toggle card-drop" data-bs-toggle="dropdown" aria-expanded="false">
<i class="ri-more-fill"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="/redirects/redirects/<?= $redirect['id'] ?>"><i class="ri-eye-line me-2"></i>View</a></li>
<li><a class="dropdown-item" href="/redirects/redirects/<?= $redirect['id'] ?>/edit"><i class="ri-pencil-line me-2"></i>Edit</a></li>
<li><a class="dropdown-item" href="/public/analytics/<?= $redirect['analytics_slug'] ?>" target="_blank"><i class="ri-bar-chart-line me-2"></i>Analytics Público</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRedirect(<?= $redirect['id'] ?>)"><i class="ri-delete-bin-line me-2"></i>Delete</a></li>
</ul>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- How it works -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<h4 class="card-title mb-4">How Redirects Work</h4>
<div class="row">
<div class="col-md-4">
<div class="text-center">
<div class="avatar-sm bg-light rounded-circle mx-auto mb-3">
<span class="avatar-title">
<i class="ri-link font-size-24 text-primary"></i>
</span>
</div>
<h5>1. Create Redirect</h5>
<p class="text-muted">Set up your source and target URLs with optional filters</p>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<div class="avatar-sm bg-light rounded-circle mx-auto mb-3">
<span class="avatar-title">
<i class="ri-filter-3-line font-size-24 text-success"></i>
</span>
</div>
<h5>2. Add Filters</h5>
<p class="text-muted">Target by country, browser, device, time, and more</p>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<div class="avatar-sm bg-light rounded-circle mx-auto mb-3">
<span class="avatar-title">
<i class="ri-bar-chart-line font-size-24 text-info"></i>
</span>
</div>
<h5>3. Track Analytics</h5>
<p class="text-muted">Monitor performance and user behavior in real-time</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function deleteRedirect(id) {
if (confirm('Are you sure you want to delete this redirect?')) {
fetch(`/api/redirects/${id}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
location.reload();
} else {
alert('Error: ' + data.error);
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while deleting the redirect');
});
}
}
</script>
@@ -0,0 +1,412 @@
<?php
/**
* Create Redirect
*
* @var array $config Module configuration
* @var string $title Page title
*/
?>
<!-- Include filter template -->
<?php include __DIR__ . '/../components/filter-template.php'; ?>
<!-- Create Form -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<form id="redirectForm" class="needs-validation" novalidate>
<div class="row">
<!-- Basic Information -->
<div class="col-md-8">
<h5 class="mb-3">Basic Information</h5>
<div class="mb-3">
<label for="name" class="form-label">Redirect Name *</label>
<input type="text" class="form-control" id="name" name="name" required>
<div class="invalid-feedback">Please provide a redirect name.</div>
</div>
<div class="mb-3">
<label for="source_url" class="form-label">Source URL</label>
<input type="url" class="form-control" id="source_url" name="source_url" placeholder="https://example.com/old-page">
<div class="form-text">Optional: The original URL that will be redirected</div>
</div>
<div class="mb-3">
<label for="target_url" class="form-label">Target URL *</label>
<input type="url" class="form-control" id="target_url" name="target_url" required>
<div class="invalid-feedback">Please provide a valid target URL.</div>
</div>
<div class="mb-3">
<label for="fallback_url" class="form-label">Fallback URL</label>
<input type="url" class="form-control" id="fallback_url" name="fallback_url" placeholder="https://example.com/fallback">
<div class="form-text">Optional: URL to redirect to when filters don't match</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="redirect_type" class="form-label" data-key="redirects.types.title">Redirect Type</label>
<select class="form-select" id="redirect_type" name="redirect_type">
<option value="" data-key="common.select">Selecionar tipo</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="status" class="form-label" data-key="redirects.status.title">Status</label>
<select class="form-select" id="status" name="status">
<option value="" data-key="common.select">Selecionar status</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="max_clicks" class="form-label">Max Clicks</label>
<input type="number" class="form-control" id="max_clicks" name="max_clicks" min="1" placeholder="Unlimited">
<div class="form-text">Optional: Maximum number of clicks before deactivation</div>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="expires_at" class="form-label">Expira Em</label>
<input type="datetime-local" class="form-control" id="expires_at" name="expires_at">
<div class="form-text">Optional: When this redirect should expire</div>
</div>
</div>
</div>
<div class="mb-3">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="tracking_enabled" name="tracking_enabled" value="1" checked>
<label class="form-check-label" for="tracking_enabled">
Enable Tracking
</label>
</div>
<div class="form-text">Track clicks and analytics for this redirect</div>
</div>
</div>
<!-- Filters Preview -->
<div class="col-md-4">
<h5 class="mb-3">Targeting Filters</h5>
<div class="alert alert-info">
<i class="ri-information-line me-2"></i>
<strong>No filters added yet</strong><br>
<small>Add filters to target specific users based on their location, browser, device, etc.</small>
</div>
<div id="filtersContainer" class="d-none">
<h6>Active Filters</h6>
<ul id="filtersPreview" class="list-unstyled">
<!-- Filters will be added here dynamically -->
</ul>
</div>
<button type="button" class="btn btn-outline-primary btn-sm" id="addFilterBtn">
<i class="ri-add-line me-1"></i><span data-key="redirects.filters.add">Add Filter</span>
</button>
</div>
</div>
<hr>
<div class="d-flex justify-content-end gap-2">
<a href="/redirects/redirects" class="btn btn-secondary">Cancel</a>
<button type="submit" class="btn btn-primary">
<i class="ri-save-line me-1"></i>Create Redirect
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Add Filter Modal -->
<div class="modal fade" id="addFilterModal" tabindex="-1" aria-labelledby="addFilterModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addFilterModalLabel">Add Targeting Filter</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="addFilterForm">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="filter_type" class="form-label">Filter Type *</label>
<select class="form-select" id="filter_type" name="filter_type" required>
<option value="">Select filter type...</option>
<option value="country">Country</option>
<option value="browser">Browser</option>
<option value="device_type">Device Type</option>
<option value="os">Operating System</option>
<option value="language">Language</option>
<option value="hour">Hour of Day</option>
<option value="referer">Referer</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="filter_operator" class="form-label">Operator *</label>
<select class="form-select" id="filter_operator" name="filter_operator" required>
<option value="equals">Equals</option>
<option value="contains">Contains</option>
<option value="starts_with">Starts with</option>
<option value="ends_with">Ends with</option>
<option value="in">In list</option>
<option value="not_in">Not in list</option>
<option value="greater_than">Greater than</option>
<option value="less_than">Less than</option>
<option value="between">Between</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="filter_value" class="form-label">Value *</label>
<input type="text" class="form-control" id="filter_value" name="filter_value" required>
<div class="form-text" id="filter_value_help"></div>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="filter_value_secondary" class="form-label">Secondary Value</label>
<input type="text" class="form-control" id="filter_value_secondary" name="filter_value_secondary">
<div class="form-text">Required for "Between" operator</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="filter_priority" class="form-label">Priority</label>
<input type="number" class="form-control" id="filter_priority" name="priority" value="0" min="0">
<div class="form-text">Higher priority filters are checked first</div>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<div class="form-check form-switch mt-4">
<input class="form-check-input" type="checkbox" id="filter_active" name="is_active" value="1" checked>
<label class="form-check-label" for="filter_active">
Active
</label>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" onclick="addFilter()">Add Filter</button>
</div>
</div>
</div>
</div>
<script>
let filters = [];
// Load form options on page load
document.addEventListener('DOMContentLoaded', function() {
loadRedirectTypes();
loadStatuses();
setupEventListeners();
});
function loadRedirectTypes() {
fetch('/api/redirects/types')
.then(response => response.json())
.then(data => {
if (data.success) {
const select = document.getElementById('redirect_type');
select.innerHTML = '<option value="">Selecionar tipo</option>';
data.data.forEach(type => {
const option = document.createElement('option');
option.value = type.value;
option.textContent = type.label;
select.appendChild(option);
});
}
})
.catch(error => console.error('Error loading redirect types:', error));
}
function loadStatuses() {
fetch('/api/redirects/statuses')
.then(response => response.json())
.then(data => {
if (data.success) {
const select = document.getElementById('status');
select.innerHTML = '<option value="">Selecionar status</option>';
data.data.forEach(status => {
const option = document.createElement('option');
option.value = status.value;
option.textContent = status.label;
select.appendChild(option);
});
// Set default to active
select.value = '1';
}
})
.catch(error => console.error('Error loading statuses:', error));
}
function setupEventListeners() {
// Add filter button
document.getElementById('addFilterBtn').addEventListener('click', showAddFilterModal);
}
// Filter type help text
const filterHelp = {
'country': 'Enter country code (e.g., PT, US, BR)',
'browser': 'Enter browser name (e.g., Chrome, Firefox, Safari)',
'device_type': 'Enter device type (desktop, mobile, tablet, bot)',
'os': 'Enter OS name (Windows, macOS, Linux, iOS, Android)',
'language': 'Enter language code (e.g., pt-PT, en-US)',
'hour': 'Enter hour (0-23)',
'referer': 'Enter domain or URL pattern'
};
document.getElementById('filter_type').addEventListener('change', function() {
const helpText = filterHelp[this.value] || '';
document.getElementById('filter_value_help').textContent = helpText;
});
function showAddFilterModal() {
if (typeof bootstrap !== 'undefined') {
const modal = new bootstrap.Modal(document.getElementById('addFilterModal'));
modal.show();
}
}
function addFilter() {
const form = document.getElementById('addFilterForm');
const formData = new FormData(form);
const filter = {
id: Date.now(), // Temporary ID
filter_type: formData.get('filter_type'),
filter_operator: formData.get('filter_operator'),
filter_value: formData.get('filter_value'),
filter_value_secondary: formData.get('filter_value_secondary'),
priority: formData.get('priority'),
is_active: formData.get('is_active') ? 1 : 0
};
if (!filter.filter_type || !filter.filter_value) {
alert('Please fill in all required fields');
return;
}
filters.push(filter);
updateFiltersPreview();
// Close modal and reset form
if (typeof bootstrap !== 'undefined') {
bootstrap.Modal.getInstance(document.getElementById('addFilterModal')).hide();
}
form.reset();
}
function removeFilter(filterId) {
filters = filters.filter(f => f.id !== filterId);
updateFiltersPreview();
}
function updateFiltersPreview() {
const container = document.getElementById('filtersContainer');
const list = document.getElementById('filtersPreview');
if (filters.length === 0) {
container.classList.add('d-none');
return;
}
container.classList.remove('d-none');
list.innerHTML = '';
filters.forEach(filter => {
const li = document.createElement('li');
li.className = 'mb-2 p-2 border rounded';
li.innerHTML = `
<div class="d-flex justify-content-between align-items-center">
<div>
<strong>${filter.filter_type}</strong> ${filter.filter_operator} <code>${filter.filter_value}</code>
${filter.filter_value_secondary ? ` and <code>${filter.filter_value_secondary}</code>` : ''}
</div>
<button type="button" class="btn btn-sm btn-outline-danger" onclick="removeFilter(${filter.id})">
<i class="ri-delete-bin-line"></i>
</button>
</div>
`;
list.appendChild(li);
});
}
document.getElementById('redirectForm').addEventListener('submit', function(e) {
e.preventDefault();
if (!this.checkValidity()) {
e.stopPropagation();
this.classList.add('was-validated');
return;
}
const formData = new FormData(this);
const data = {
name: formData.get('name'),
source_url: formData.get('source_url'),
target_url: formData.get('target_url'),
fallback_url: formData.get('fallback_url'),
redirect_type: formData.get('redirect_type'),
status: formData.get('status'),
tracking_enabled: formData.get('tracking_enabled') ? 1 : 0,
max_clicks: formData.get('max_clicks') || null,
expires_at: formData.get('expires_at') || null,
filters: filters
};
// Create redirect
fetch('/api/redirects', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => {
if (result.success) {
alert('Redirect created successfully!');
window.location.href = '/redirects/redirects';
} else {
alert('Error: ' + result.error);
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while creating the redirect');
});
});
</script>
@@ -0,0 +1,138 @@
<?php
/**
* Edit Redirect View - Alpine.js Version
*
* Loads data via API instead of PHP inline
*/
?>
<div class="row" x-data="editRedirect()" x-init="loadRedirect()">
<div class="col-12">
<div class="card">
<div class="card-body">
<!-- Loading state -->
<div x-show="loading" class="text-center py-4">
<div class="spinner-border text-primary" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<p class="mt-2">A carregar dados do redirect...</p>
</div>
<!-- Error state -->
<div x-show="error" class="alert alert-danger" x-text="error"></div>
<!-- Form content -->
<template x-if="!loading && !error && redirect">
<form id="editRedirectForm" @submit.prevent="updateRedirect">
<input type="hidden" name="_method" value="PUT">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="name" class="form-label">Nome do Redirect</label>
<input type="text" class="form-control" id="name" name="name" x-model="redirect.name" required>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">Estado</label>
<div>
<input type="checkbox" class="btn-check" id="status-toggle" autocomplete="off" x-model="redirect.status" :true-value="1" :false-value="0">
<input type="hidden" name="status" :value="redirect.status">
<label class="btn btn-outline-success" for="status-toggle" x-show="redirect.status == 1">
<i class="ri-toggle-line me-1"></i> Ativo
</label>
<label class="btn btn-outline-secondary" for="status-toggle" x-show="redirect.status == 0">
<i class="ri-toggle-line me-1"></i> Inativo
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="source_url" class="form-label">URL de Origem</label>
<input type="url" class="form-control" id="source_url" name="source_url" x-model="redirect.source_url" required>
<small class="form-text text-muted">A URL que irá ativar o redirect</small>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="target_url" class="form-label">URL de Destino</label>
<input type="url" class="form-control" id="target_url" name="target_url" x-model="redirect.target_url" required>
<small class="form-text text-muted">Para onde os utilizadores serão redirecionados quando os filtros corresponderem</small>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="fallback_url" class="form-label">URL de Fallback (Opcional)</label>
<input type="url" class="form-control" id="fallback_url" name="fallback_url" x-model="redirect.fallback_url">
<small class="form-text text-muted">Para onde os utilizadores serão redirecionados quando os filtros não corresponderem</small>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="redirect_type" class="form-label">Tipo de Redirect</label>
<select class="form-select" id="redirect_type" name="redirect_type" x-model="redirect.redirect_type">
<option value="302">302 (Temporário)</option>
<option value="301">301 (Permanente)</option>
<option value="meta">Meta Refresh</option>
<option value="javascript">JavaScript</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="max_clicks" class="form-label">Clicks Máximos (Opcional)</label>
<input type="number" class="form-control" id="max_clicks" name="max_clicks" x-model="redirect.max_clicks" min="1">
<small class="form-text text-muted">Desativar após este número de clicks</small>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="expires_at" class="form-label">Expira Em (Opcional)</label>
<input type="datetime-local" class="form-control" id="expires_at" name="expires_at" :value="formatDateForInput(redirect.expires_at)">
</div>
</div>
</div>
<div class="mb-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="tracking_enabled" name="tracking_enabled" value="1" x-model="redirect.tracking_enabled" x-show="redirect">
<label class="form-check-label" for="tracking_enabled" x-show="redirect">
Ativar rastreamento e analytics
</label>
</div>
</div>
<!-- Success message -->
<div x-show="success" class="alert alert-success alert-dismissible fade show" role="alert">
<i class="ri-check-double-line me-1 align-middle"></i>
<strong>Sucesso!</strong> Redirect atualizado com sucesso.
<button type="button" class="btn-close" @click="success = false"></button>
</div>
<div class="text-end">
<button type="button" class="btn btn-secondary me-2" @click="goBack()">Cancelar</button>
<button type="submit" class="btn btn-primary" :disabled="saving">
<span x-show="!saving">Atualizar Redirect</span>
<span x-show="saving">
<span class="spinner-border spinner-border-sm me-1" role="status"></span>
A guardar...
</span>
</button>
</div>
</form>
</template>
</div>
</div>
</div>
</div>
@@ -0,0 +1,378 @@
<?php
/**
* All Redirects List - Alpine.js Version
*
* Loads data via API instead of PHP inline
*/
?>
<div x-data="redirectsList()">
<!-- Loading state -->
<div x-show="loading" class="text-center py-5">
<div class="spinner-border text-primary" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<p class="mt-2">A carregar redirects...</p>
</div>
<!-- Error state -->
<div x-show="error" class="alert alert-danger" x-text="error"></div>
<!-- Content -->
<div x-show="!loading && !error">
<!-- Filters -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<form @submit.prevent="applyFilters()" class="row g-3">
<div class="col-md-4">
<label class="form-label">Pesquisar</label>
<input type="text" class="form-control" x-model="filters.search" placeholder="Pesquisar por nome ou URL...">
</div>
<div class="col-md-3">
<label class="form-label">Estado</label>
<select class="form-select" x-model="filters.status">
<option value="">Todos os Estados</option>
<option value="1">Ativo</option>
<option value="0">Inativo</option>
</select>
</div>
<div class="col-md-3">
<label class="form-label">&nbsp;</label>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary">
<i class="ri-search-line me-1"></i>Filtrar
</button>
<button type="button" class="btn btn-outline-secondary" @click="clearFilters()">
<i class="ri-refresh-line me-1"></i>Limpar
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Redirects List -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="d-flex align-items-center mb-4">
<h4 class="card-title mb-0">Redirects (<span x-text="redirects.length"></span>)</h4>
<div class="flex-grow-1"></div>
<button type="button" class="btn btn-primary" @click="goToCreate()">
<i class="ri-add-line me-1"></i>Criar Redirect
</button>
</div>
<!-- Empty state -->
<div x-show="redirects.length === 0" class="text-center py-5">
<i class="ri-link font-size-64 text-muted"></i>
<h4 class="mt-3 text-muted">Nenhum redirect encontrado</h4>
<p class="text-muted">Crie o seu primeiro redirect para começar</p>
<button type="button" class="btn btn-primary" @click="goToCreate()">Criar Redirect</button>
</div>
<!-- Table -->
<div x-show="redirects.length > 0" class="table-responsive">
<table class="table table-centered table-nowrap mb-0">
<thead>
<tr>
<th>Nome</th>
<th>URL de Origem</th>
<th>URL de Destino</th>
<th>Link Analytics</th>
<th>Estado</th>
<th>Tipo</th>
<th>Rastreamento</th>
<th>Criado</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
<template x-for="redirect in redirects" :key="redirect.id">
<tr>
<td>
<div class="d-flex align-items-center">
<div class="avatar-sm bg-light rounded-circle me-3">
<span class="avatar-title">
<i class="ri-link font-size-16"></i>
</span>
</div>
<div>
<h6 class="mb-0" x-text="redirect.name"></h6>
<small class="text-muted" x-text="redirect.id"></small>
</div>
</div>
</td>
<td>
<span class="text-truncate d-inline-block" style="max-width: 150px;" :title="redirect.source_url" x-text="redirect.source_url"></span>
</td>
<td>
<span class="text-truncate d-inline-block" style="max-width: 150px;" :title="redirect.target_url" x-text="redirect.target_url"></span>
</td>
<td>
<template x-if="redirect.analytics_slug">
<a :href="`/public/analytics/${redirect.analytics_slug}`" target="_blank" class="btn btn-sm btn-soft-primary">
<i class="ri-external-link-line me-1"></i>
<span x-text="redirect.analytics_slug.substring(0, 10) + '...'"></span>
</a>
</template>
<template x-if="!redirect.analytics_slug">
<span class="text-muted">-</span>
</template>
</td>
<td>
<span class="badge" :class="getStatusBadgeClass(redirect.status)" x-text="getStatusText(redirect.status)"></span>
</td>
<td>
<span class="badge" :class="getTypeBadgeClass(redirect.redirect_type)" x-text="redirect.redirect_type"></span>
</td>
<td>
<span class="badge" :class="getTrackingBadgeClass(redirect.tracking_enabled)" x-text="getTrackingText(redirect.tracking_enabled)"></span>
</td>
<td>
<span x-text="formatDate(redirect.created_at)"></span>
</td>
<td>
<div class="dropdown">
<a href="#" class="dropdown-toggle card-drop" data-bs-toggle="dropdown" aria-expanded="false">
<i class="ri-more-fill"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="#" @click.prevent="goToView(redirect.id)"><i class="ri-eye-line me-2"></i>Ver</a></li>
<li><a class="dropdown-item" href="#" @click.prevent="goToEdit(redirect.id)"><i class="ri-pencil-line me-2"></i>Editar</a></li>
<li><a class="dropdown-item" :href="`/r/${redirect.cuid}`" target="_blank"><i class="ri-external-link-line me-2"></i>Testar</a></li>
<li><a class="dropdown-item" :href="`/public/analytics/${redirect.analytics_slug}`" target="_blank"><i class="ri-bar-chart-line me-2"></i>Analytics Público</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="#" @click.prevent="deleteRedirect(redirect.id, redirect.name)"><i class="ri-delete-bin-line me-2"></i>Apagar</a></li>
</ul>
</div>
</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function redirectsList() {
return {
// Data
redirects: [],
stats: {
total: 0,
active: 0,
inactive: 0,
total_clicks: 0
},
pagination: {
page: 1,
limit: 20,
total: 0,
pages: 0
},
filters: {
search: '',
status: ''
},
loading: false,
error: false,
lastUpdated: null,
// Lifecycle
init() {
this.loadRedirects();
},
// Methods
async loadRedirects() {
try {
this.loading = true;
this.error = false;
const params = new URLSearchParams({
page: this.pagination.page,
limit: this.pagination.limit,
...(this.filters.search && { search: this.filters.search }),
...(this.filters.status && { status: this.filters.status })
});
const response = await fetch(`/api/redirects?${params}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer mf_redirect_2025'
}
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const result = await response.json();
if (result.success) {
this.redirects = result.data.redirects;
this.stats = result.data.stats || { total: 0, active: 0, inactive: 0, total_clicks: 0 };
this.pagination = result.data.pagination || { page: 1, limit: 20, total: 0, pages: 0 };
this.lastUpdated = result.timestamp;
} else {
throw new Error(result.error || 'Erro ao carregar redirects');
}
} catch (error) {
console.error('Erro ao carregar redirects:', error);
this.error = true;
this.redirects = [];
this.stats = { total: 0, active: 0, inactive: 0, total_clicks: 0 };
} finally {
this.loading = false;
}
},
// Computed properties
get hasRedirects() {
return this.redirects.length > 0;
},
get filteredRedirects() {
return this.redirects;
},
// Utility methods
formatDate(dateString) {
if (!dateString) return '-';
return new Date(dateString).toLocaleDateString('pt-PT');
},
getStatusBadgeClass(status) {
const classes = {
'1': 'badge bg-success',
'0': 'badge bg-secondary',
'-1': 'badge bg-danger'
};
return classes[status] || 'badge bg-secondary';
},
getStatusText(status) {
const texts = {
'1': 'Ativo',
'0': 'Inativo',
'-1': 'Eliminado'
};
return texts[status] || status;
},
getTypeBadgeClass(type) {
const classes = {
'301': 'badge bg-primary',
'302': 'badge bg-info',
'meta': 'badge bg-warning',
'javascript': 'badge bg-secondary'
};
return classes[type] || 'badge bg-secondary';
},
getTrackingBadgeClass(enabled) {
return enabled ? 'badge bg-success' : 'badge bg-secondary';
},
getTrackingText(enabled) {
return enabled ? 'Ativo' : 'Inativo';
},
formatNumber(value) {
return new Intl.NumberFormat('pt-PT').format(value || 0);
},
truncateUrl(url, maxLength = 50) {
if (!url) return '-';
return url.length > maxLength ? url.substring(0, maxLength) + '...' : url;
},
// Actions
applyFilters() {
this.pagination.page = 1;
this.loadRedirects();
},
clearFilters() {
this.filters.search = '';
this.filters.status = '';
this.pagination.page = 1;
this.loadRedirects();
},
changePage(page) {
this.pagination.page = page;
this.loadRedirects();
},
changeStatus(status) {
this.filters.status = status;
this.pagination.page = 1;
this.loadRedirects();
},
refreshRedirects() {
this.loadRedirects();
},
goToView(id) {
window.location.href = `/redirects/redirects/${id}`;
},
goToEdit(id) {
window.location.href = `/redirects/redirects/${id}/edit`;
},
goToCreate() {
window.location.href = '/redirects/redirects/create';
},
async deleteRedirect(id, name) {
if (!confirm(`Tem a certeza que deseja eliminar o redirect "${name}"?`)) {
return;
}
try {
const response = await fetch(`/api/redirects/${id}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer mf_redirect_2025'
}
});
const result = await response.json();
if (result.success) {
this.loadRedirects(); // Reload the list
} else {
alert('Erro: ' + result.error);
}
} catch (error) {
console.error('Erro:', error);
alert('Ocorreu um erro ao eliminar o redirect');
}
},
copyToClipboard(text) {
navigator.clipboard.writeText(text).then(() => {
// Could add a toast notification here
console.log('URL copied to clipboard');
});
}
};
}
</script>
@@ -0,0 +1,356 @@
<?php
/**
* View Redirect Details
*
* @var array $redirect Redirect data
* @var array $filters Filters data
* @var array $stats Statistics data
* @var array $recentActivity Recent activity data
*/
?>
<div class="row">
<div class="col-lg-8">
<!-- Redirect Details -->
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Redirect Details</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<p><strong>Name:</strong> <?= htmlspecialchars($redirect['name']) ?></p>
<p><strong>Status:</strong>
<span class="badge bg-<?= $redirect['status'] == 1 ? 'success' : 'warning' ?>">
<?= $redirect['status'] == 1 ? 'Active' : 'Inactive' ?>
</span>
</p>
<p><strong>Redirect Type:</strong> <?= htmlspecialchars($redirect['redirect_type']) ?></p>
<p><strong>Tracking:</strong>
<span class="badge bg-<?= $redirect['tracking_enabled'] ? 'info' : 'secondary' ?>">
<?= $redirect['tracking_enabled'] ? 'Enabled' : 'Disabled' ?>
</span>
</p>
</div>
<div class="col-md-6">
<p><strong>Created:</strong> <?= date('M j, Y H:i', strtotime($redirect['created_at'])) ?></p>
<p><strong>Updated:</strong> <?= date('M j, Y H:i', strtotime($redirect['updated_at'])) ?></p>
<?php if ($redirect['expires_at']): ?>
<p><strong>Expires:</strong> <?= date('M j, Y H:i', strtotime($redirect['expires_at'])) ?></p>
<?php endif; ?>
<?php if ($redirect['max_clicks']): ?>
<p><strong>Max Clicks:</strong> <?= number_format($redirect['max_clicks']) ?></p>
<?php endif; ?>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-4">
<h6>Source URL</h6>
<p class="text-break"><?= htmlspecialchars($redirect['source_url']) ?></p>
</div>
<div class="col-md-4">
<h6>Target URL</h6>
<p class="text-break"><?= htmlspecialchars($redirect['target_url']) ?></p>
</div>
<div class="col-md-4">
<h6>Fallback URL</h6>
<p class="text-break"><?= $redirect['fallback_url'] ? htmlspecialchars($redirect['fallback_url']) : '<em>None</em>' ?></p>
</div>
</div>
<hr>
<!-- Analytics Public URL -->
<div class="row">
<div class="col-12">
<h6>Analytics Público</h6>
<p class="text-muted small mb-2">Partilha este link para permitir acesso público aos analytics deste redirect</p>
<?php if (empty($redirect['analytics_slug'])): ?>
<div class="alert alert-warning">
<i class="ri-alert-line me-2"></i>Analytics slug não encontrado. Contacte o administrador.
</div>
<?php else: ?>
<div class="input-group">
<input type="text"
class="form-control"
id="analyticsUrl"
value="https://redirect.moneyflix.com/public/analytics/<?= htmlspecialchars($redirect['analytics_slug']) ?>"
readonly>
<button class="btn btn-outline-secondary" type="button" onclick="copyAnalyticsUrl()">
<i class="ri-file-copy-line me-1"></i>Copiar
</button>
<a href="/public/analytics/<?= htmlspecialchars($redirect['analytics_slug']) ?>"
target="_blank"
class="btn btn-outline-primary">
<i class="ri-external-link-line me-1"></i>Abrir
</a>
</div>
<?php endif; ?>
</div>
</div>
<div class="mt-3">
<a href="/redirects/redirects/<?= $redirect['id'] ?>/edit" class="btn btn-primary me-2">Edit Redirect</a>
<a href="/r/<?= $redirect['cuid'] ?>" target="_blank" class="btn btn-info me-2">Test Redirect</a>
<button class="btn btn-danger" onclick="deleteRedirect(<?= $redirect['id'] ?>)">Delete</button>
</div>
</div>
</div>
<!-- Filters -->
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h4 class="card-title mb-0">Filters</h4>
<button class="btn btn-sm btn-primary" onclick="addFilter()">Add Filter</button>
</div>
<div class="card-body">
<?php if (empty($filters)): ?>
<p class="text-muted">No filters configured. All visitors will be redirected to the target URL.</p>
<?php else: ?>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Type</th>
<th>Value</th>
<th>Operator</th>
<th>Priority</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($filters as $filter): ?>
<tr>
<td><?= htmlspecialchars(ucfirst($filter['filter_type'])) ?></td>
<td><?= htmlspecialchars($filter['filter_value']) ?></td>
<td><?= htmlspecialchars(ucfirst(str_replace('_', ' ', $filter['filter_operator']))) ?></td>
<td><?= $filter['priority'] ?></td>
<td>
<span class="badge bg-<?= $filter['is_active'] ? 'success' : 'secondary' ?>">
<?= $filter['is_active'] ? 'Active' : 'Inactive' ?>
</span>
</td>
<td>
<button class="btn btn-sm btn-outline-primary" onclick="editFilter(<?= $filter['id'] ?>)">Edit</button>
<button class="btn btn-sm btn-outline-danger" onclick="deleteFilter(<?= $filter['id'] ?>)">Delete</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div>
</div>
<div class="col-lg-4">
<!-- Statistics -->
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Statistics</h4>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-6">
<h4 class="text-primary"><?= number_format($stats['total_clicks'] ?? 0) ?></h4>
<p class="text-muted mb-0">Total Clicks</p>
</div>
<div class="col-6">
<h4 class="text-success"><?= number_format($stats['unique_clicks'] ?? 0) ?></h4>
<p class="text-muted mb-0">Unique Clicks</p>
</div>
</div>
<hr>
<div class="row text-center">
<div class="col-6">
<h4 class="text-info"><?= number_format($stats['unique_ips'] ?? 0) ?></h4>
<p class="text-muted mb-0">Unique IPs</p>
</div>
<div class="col-6">
<h4 class="text-warning"><?= number_format($stats['avg_response_time'] ?? 0, 1) ?>ms</h4>
<p class="text-muted mb-0">Avg Response</p>
</div>
</div>
</div>
</div>
<!-- Recent Activity -->
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Recent Activity</h4>
</div>
<div class="card-body">
<?php if (empty($recentActivity)): ?>
<p class="text-muted">No recent activity</p>
<?php else: ?>
<div class="timeline">
<?php foreach (array_slice($recentActivity, 0, 5) as $activity): ?>
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h6 class="mb-1">Click from <?= htmlspecialchars($activity['ip_address']) ?></h6>
<p class="text-muted mb-1">
<?= date('M j, Y H:i', strtotime($activity['timestamp'])) ?>
<?php if ($activity['country_code']): ?>
• <?= htmlspecialchars($activity['country_code']) ?>
<?php endif; ?>
<?php if ($activity['browser']): ?>
• <?= htmlspecialchars($activity['browser']) ?>
<?php endif; ?>
</p>
<div class="small text-muted">
<?php if ($activity['device_type']): ?>
<span class="badge bg-light text-dark me-1"><?= htmlspecialchars($activity['device_type']) ?></span>
<?php endif; ?>
<?php if ($activity['city']): ?>
<span class="badge bg-light text-dark me-1"><?= htmlspecialchars($activity['city']) ?></span>
<?php endif; ?>
<?php if ($activity['target_url_used']): ?>
<div class="mt-1">
<small class="text-break">→ <?= htmlspecialchars($activity['target_url_used']) ?></small>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<script>
function deleteRedirect(id) {
if (confirm('Are you sure you want to delete this redirect?')) {
fetch(`/api/redirects/${id}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
window.location.href = '/redirects/redirects';
} else {
alert('Error: ' + data.error);
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while deleting the redirect');
});
}
}
function addFilter() {
// Implement filter addition modal/form
alert('Filter addition functionality will be implemented');
}
function editFilter(filterId) {
// Implement filter editing modal/form
alert('Filter editing functionality will be implemented');
}
function deleteFilter(filterId) {
if (confirm('Are you sure you want to delete this filter?')) {
fetch(`/api/redirects/<?= $redirect['id'] ?>/filters/${filterId}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
location.reload();
} else {
alert('Error: ' + data.error);
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while deleting the filter');
});
}
}
function copyAnalyticsUrl() {
const analyticsUrl = document.getElementById('analyticsUrl');
analyticsUrl.select();
analyticsUrl.setSelectionRange(0, 99999); // For mobile devices
try {
document.execCommand('copy');
// Show success feedback
const button = event.target.closest('button');
const originalText = button.innerHTML;
button.innerHTML = '<i class="ri-check-line me-1"></i>Copiado!';
button.classList.remove('btn-outline-secondary');
button.classList.add('btn-success');
setTimeout(() => {
button.innerHTML = originalText;
button.classList.remove('btn-success');
button.classList.add('btn-outline-secondary');
}, 2000);
} catch (err) {
// Fallback for modern browsers
if (navigator.clipboard) {
navigator.clipboard.writeText(analyticsUrl.value).then(() => {
const button = event.target.closest('button');
const originalText = button.innerHTML;
button.innerHTML = '<i class="ri-check-line me-1"></i>Copiado!';
button.classList.remove('btn-outline-secondary');
button.classList.add('btn-success');
setTimeout(() => {
button.innerHTML = originalText;
button.classList.remove('btn-success');
button.classList.add('btn-outline-secondary');
}, 2000);
});
} else {
alert('Não foi possível copiar automaticamente. Por favor, selecione e copie manualmente.');
}
}
}
</script>
<style>
.timeline {
position: relative;
padding-left: 20px;
}
.timeline-item {
position: relative;
margin-bottom: 15px;
}
.timeline-marker {
position: absolute;
left: -20px;
top: 5px;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #007bff;
}
.timeline-content {
padding-left: 10px;
}
</style>
+308
View File
@@ -0,0 +1,308 @@
<?php
/**
* Redirects Settings View
*
* @var string $title Page title
*/
?>
<div class="row">
<div class="col-lg-8">
<!-- General Settings -->
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">General Settings</h4>
</div>
<div class="card-body">
<form id="generalSettingsForm">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="tracking_enabled" class="form-label">Default Tracking</label>
<select class="form-select" id="tracking_enabled" name="tracking_enabled">
<option value="1">Enabled</option>
<option value="0">Disabled</option>
</select>
<small class="form-text text-muted">Enable tracking by default for new redirects</small>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="default_redirect_type" class="form-label">Default Redirect Type</label>
<select class="form-select" id="default_redirect_type" name="default_redirect_type">
<option value="302">302 (Temporary)</option>
<option value="301">301 (Permanent)</option>
<option value="meta">Meta Refresh</option>
<option value="javascript">JavaScript</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="retention_days" class="form-label">Data Retention (Days)</label>
<input type="number" class="form-control" id="retention_days" name="retention_days" value="90" min="1" max="365">
<small class="form-text text-muted">How long to keep detailed statistics</small>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="max_filters_per_redirect" class="form-label">Max Filters per Redirect</label>
<input type="number" class="form-control" id="max_filters_per_redirect" name="max_filters_per_redirect" value="10" min="1" max="50">
</div>
</div>
</div>
<div class="mb-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="aggregation_enabled" name="aggregation_enabled" value="1" checked>
<label class="form-check-label" for="aggregation_enabled">
Enable daily aggregation for better performance
</label>
</div>
</div>
<button type="submit" class="btn btn-primary">Save General Settings</button>
</form>
</div>
</div>
<!-- Security Settings -->
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Security Settings</h4>
</div>
<div class="card-body">
<form id="securitySettingsForm">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="rate_limit_per_ip" class="form-label">Rate Limit per IP</label>
<input type="number" class="form-control" id="rate_limit_per_ip" name="rate_limit_per_ip" value="100" min="1">
<small class="form-text text-muted">Maximum clicks per IP per hour</small>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="geo_detection_method" class="form-label">Geo Detection Method</label>
<select class="form-select" id="geo_detection_method" name="geo_detection_method">
<option value="cloudflare">Cloudflare Headers</option>
<option value="ipapi">IP-API Service</option>
<option value="manual">Manual Configuration</option>
</select>
</div>
</div>
</div>
<div class="mb-3">
<label for="allowed_domains" class="form-label">Allowed Target Domains</label>
<textarea class="form-control" id="allowed_domains" name="allowed_domains" rows="3" placeholder="Enter domains, one per line (leave empty to allow all)"></textarea>
<small class="form-text text-muted">Restrict redirects to specific domains for security</small>
</div>
<div class="mb-3">
<label for="blocked_domains" class="form-label">Blocked Target Domains</label>
<textarea class="form-control" id="blocked_domains" name="blocked_domains" rows="3" placeholder="Enter domains to block, one per line"></textarea>
<small class="form-text text-muted">Prevent redirects to specific domains</small>
</div>
<button type="submit" class="btn btn-primary">Save Security Settings</button>
</form>
</div>
</div>
</div>
<div class="col-lg-4">
<!-- Module Information -->
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Module Information</h4>
</div>
<div class="card-body">
<div class="mb-3">
<strong>Version:</strong> 1.0.0
</div>
<div class="mb-3">
<strong>Author:</strong> BitReport Unip. LDA
</div>
<div class="mb-3">
<strong>Last Updated:</strong> <?= date('M j, Y') ?>
</div>
<div class="mb-3">
<strong>Status:</strong>
<span class="badge bg-success">Active</span>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Quick Actions</h4>
</div>
<div class="card-body">
<div class="d-grid gap-2">
<button class="btn btn-outline-primary" onclick="exportData()">
<i class="ri-download-line me-2"></i>Export Data
</button>
<button class="btn btn-outline-warning" onclick="clearOldData()">
<i class="ri-delete-bin-line me-2"></i>Clear Old Data
</button>
<button class="btn btn-outline-info" onclick="testGeoDetection()">
<i class="ri-global-line me-2"></i>Test Geo Detection
</button>
<button class="btn btn-outline-secondary" onclick="resetSettings()">
<i class="ri-refresh-line me-2"></i>Reset to Defaults
</button>
</div>
</div>
</div>
<!-- System Status -->
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">System Status</h4>
</div>
<div class="card-body">
<div class="mb-3">
<strong>Database Tables:</strong>
<span class="badge bg-success">✓ All Present</span>
</div>
<div class="mb-3">
<strong>Geo Detection:</strong>
<span class="badge bg-success">✓ Working</span>
</div>
<div class="mb-3">
<strong>Tracking:</strong>
<span class="badge bg-success">✓ Active</span>
</div>
<div class="mb-3">
<strong>Performance:</strong>
<span class="badge bg-success">✓ Optimized</span>
</div>
</div>
</div>
</div>
</div>
<script>
// Load current settings
document.addEventListener('DOMContentLoaded', function() {
loadSettings();
});
function loadSettings() {
fetch('/api/redirects/settings')
.then(response => response.json())
.then(data => {
if (data.success) {
const settings = data.settings;
// Populate form fields
document.getElementById('tracking_enabled').value = settings.tracking_enabled || '1';
document.getElementById('default_redirect_type').value = settings.default_redirect_type || '302';
document.getElementById('retention_days').value = settings.retention_days || '90';
document.getElementById('max_filters_per_redirect').value = settings.max_filters_per_redirect || '10';
document.getElementById('aggregation_enabled').checked = settings.aggregation_enabled == '1';
document.getElementById('rate_limit_per_ip').value = settings.rate_limit_per_ip || '100';
document.getElementById('geo_detection_method').value = settings.geo_detection_method || 'cloudflare';
// Parse JSON arrays
if (settings.allowed_domains) {
try {
const domains = JSON.parse(settings.allowed_domains);
document.getElementById('allowed_domains').value = domains.join('\n');
} catch (e) {
document.getElementById('allowed_domains').value = '';
}
}
if (settings.blocked_domains) {
try {
const domains = JSON.parse(settings.blocked_domains);
document.getElementById('blocked_domains').value = domains.join('\n');
} catch (e) {
document.getElementById('blocked_domains').value = '';
}
}
}
})
.catch(error => {
console.error('Error loading settings:', error);
});
}
// Save general settings
document.getElementById('generalSettingsForm').addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
const data = Object.fromEntries(formData.entries());
saveSettings(data, 'General settings saved successfully!');
});
// Save security settings
document.getElementById('securitySettingsForm').addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
const data = Object.fromEntries(formData.entries());
// Convert domain lists to JSON
if (data.allowed_domains) {
data.allowed_domains = JSON.stringify(data.allowed_domains.split('\n').filter(d => d.trim()));
}
if (data.blocked_domains) {
data.blocked_domains = JSON.stringify(data.blocked_domains.split('\n').filter(d => d.trim()));
}
saveSettings(data, 'Security settings saved successfully!');
});
function saveSettings(data, message) {
fetch('/api/redirects/settings', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => {
if (result.success) {
alert(message);
} else {
alert('Error: ' + result.error);
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while saving settings');
});
}
function exportData() {
alert('Export functionality will be implemented');
}
function clearOldData() {
if (confirm('Are you sure you want to clear old data? This action cannot be undone.')) {
alert('Data clearing functionality will be implemented');
}
}
function testGeoDetection() {
alert('Geo detection test functionality will be implemented');
}
function resetSettings() {
if (confirm('Are you sure you want to reset all settings to defaults?')) {
alert('Settings reset functionality will be implemented');
}
}
</script>
+441
View File
@@ -0,0 +1,441 @@
<?php
/**
* Redirects Analytics View
*
* @var array $stats Statistics data
* @var string $startDate Start date for filtering
* @var string $endDate End date for filtering
*/
?>
<div x-data="redirectsStats()" x-init="init()">
<!-- Filters -->
<div class="row">
<div class="col-12">
<div class="card border-0 shadow-sm">
<div class="card-header bg-transparent border-0 pb-0">
<h5 class="card-title mb-0">
<i class="ri-filter-3-line me-2 text-primary"></i>
<span>Filtros Avançados</span>
</h5>
</div>
<div class="card-body pt-3">
<div class="row g-3">
<!-- Date Range Filter -->
<div class="col-lg-3 col-md-6">
<label class="form-label fw-semibold text-dark">
<i class="ri-calendar-line me-1"></i>
<span>Intervalo de Datas</span>
</label>
<select class="form-select border-0 bg-light" x-model="selectedRange" @change="updateDateRange()">
<option value="all">Todo o Tempo</option>
<option value="7">Últimos 7 Dias</option>
<option value="30">Últimos 30 Dias</option>
<option value="90">Últimos 90 Dias</option>
<option value="month">Este Mês</option>
<option value="year">Este Ano</option>
<option value="custom">Intervalo Personalizado</option>
</select>
</div>
<!-- Tracker/Redirect Filter -->
<div class="col-lg-3 col-md-6">
<label class="form-label fw-semibold text-dark">
<i class="ri-link me-1"></i>
<span>Tracker</span>
</label>
<select class="form-select border-0 bg-light" x-model="selectedTracker">
<option value="">All Trackers</option>
<template x-for="redirect in availableRedirects" :key="redirect.id">
<option :value="redirect.id" x-text="redirect.name + ' (' + redirect.id + ')'"></option>
</template>
</select>
</div>
<!-- Country Filter -->
<div class="col-lg-3 col-md-6">
<label class="form-label fw-semibold text-dark">
<i class="ri-global-line me-1"></i>
<span>País</span>
</label>
<select class="form-select border-0 bg-light" x-model="selectedCountry">
<option value="">All Countries</option>
<template x-for="country in availableCountries" :key="country.country_code">
<option :value="country.country_code" x-text="country.country_name + ' (' + country.country_code + ')'"></option>
</template>
</select>
</div>
<!-- Device Filter -->
<div class="col-lg-3 col-md-6">
<label class="form-label fw-semibold text-dark">
<i class="ri-smartphone-line me-1"></i>
<span>Dispositivo</span>
</label>
<select class="form-select border-0 bg-light" x-model="selectedDevice">
<option value="">All Devices</option>
<option value="desktop">Desktop</option>
<option value="mobile">Mobile</option>
<option value="tablet">Tablet</option>
<option value="bot">Bot</option>
</select>
</div>
<!-- Browser Filter -->
<div class="col-lg-3 col-md-6">
<label class="form-label fw-semibold text-dark">
<i class="ri-window-line me-1"></i>
<span>Navegador</span>
</label>
<select class="form-select border-0 bg-light" x-model="selectedBrowser">
<option value="">All Browsers</option>
<template x-for="browser in availableBrowsers" :key="browser.browser">
<option :value="browser.browser" x-text="browser.browser"></option>
</template>
</select>
</div>
<!-- Operating System Filter -->
<div class="col-lg-3 col-md-6">
<label class="form-label fw-semibold text-dark">
<i class="ri-computer-line me-1"></i>
<span>Sistema Operativo</span>
</label>
<select class="form-select border-0 bg-light" x-model="selectedOS">
<option value="">All Operating Systems</option>
<template x-for="os in availableOS" :key="os.os">
<option :value="os.os" x-text="os.os"></option>
</template>
</select>
</div>
<!-- Custom Date Inputs -->
<div class="col-lg-3 col-md-6" x-show="selectedRange === 'custom'">
<label class="form-label fw-semibold text-dark">
<i class="ri-calendar-event-line me-1"></i>
<span>Data Início</span>
</label>
<input type="date" class="form-control border-0 bg-light" x-model="startDate">
</div>
<div class="col-lg-3 col-md-6" x-show="selectedRange === 'custom'">
<label class="form-label fw-semibold text-dark">
<i class="ri-calendar-event-line me-1"></i>
<span>Data Fim</span>
</label>
<input type="date" class="form-control border-0 bg-light" x-model="endDate">
</div>
<!-- Action Buttons -->
<div class="col-12">
<div class="d-flex gap-2 justify-content-center">
<button type="button" class="btn btn-primary px-4" @click="loadStats()" :disabled="loading">
<span x-show="loading" class="spinner-border spinner-border-sm me-2"></span>
<i class="ri-search-line me-1"></i>
<span>Filtrar</span>
</button>
<button type="button" class="btn btn-outline-secondary px-4" @click="resetFilters()">
<i class="ri-refresh-line me-1"></i>
<span>Reset</span>
</button>
<button type="button" class="btn btn-outline-info px-4" @click="exportStats()">
<i class="ri-download-line me-1"></i>
<span>Exportar</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Overview Stats -->
<div class="row">
<div class="col-xl-3 col-md-6">
<div class="card border-0 shadow-sm stats-card">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="avatar-sm bg-primary-subtle rounded-circle me-3 stats-icon">
<i class="ri-mouse-line text-primary font-size-18"></i>
</div>
<div class="flex-grow-1">
<p class="text-muted mb-1">Total de Cliques</p>
<h3 class="mb-0" x-text="formatNumber(stats.overview.total_clicks)">0</h3>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card border-0 shadow-sm stats-card">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="avatar-sm bg-success-subtle rounded-circle me-3 stats-icon">
<i class="ri-user-line text-success font-size-18"></i>
</div>
<div class="flex-grow-1">
<p class="text-muted mb-1">Cliques Únicos</p>
<h3 class="mb-0" x-text="formatNumber(stats.overview.unique_clicks)">0</h3>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card border-0 shadow-sm stats-card">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="avatar-sm bg-info-subtle rounded-circle me-3 stats-icon">
<i class="ri-global-line text-info font-size-18"></i>
</div>
<div class="flex-grow-1">
<p class="text-muted mb-1">IPs Únicos</p>
<h3 class="mb-0" x-text="formatNumber(stats.overview.unique_ips)">0</h3>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card border-0 shadow-sm stats-card">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="avatar-sm bg-warning-subtle rounded-circle me-3 stats-icon">
<i class="ri-time-line text-warning font-size-18"></i>
</div>
<div class="flex-grow-1">
<p class="text-muted mb-1">Tempo Médio de Resposta</p>
<h3 class="mb-0"><span x-text="formatNumber(stats.overview.avg_response_time, 2)">0</span>ms</h3>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Charts Row -->
<div class="row">
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Cliques por País</h4>
</div>
<div class="card-body">
<div style="height: 300px;">
<canvas id="country-chart"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Cliques por Dispositivo</h4>
</div>
<div class="card-body">
<div style="height: 300px;">
<canvas id="device-chart"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Cliques por Navegador</h4>
</div>
<div class="card-body">
<div style="height: 300px;">
<canvas id="browser-chart"></canvas>
</div>
</div>
</div>
</div>
</div>
<!-- Detailed Tables -->
<div class="row">
<!-- Top Countries Table -->
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Top Países</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered mb-0">
<thead>
<tr>
<th>País</th>
<th>Cliques</th>
<th>Percentagem</th>
</tr>
</thead>
<tbody>
<template x-for="country in stats.by_country" :key="country.country_code">
<tr>
<td x-text="country.country_code"></td>
<td x-text="formatNumber(country.clicks)"></td>
<td>
<span x-text="formatNumber(calculatePercentage(country.clicks, stats.overview.total_clicks), 1) + '%'"></span>
</td>
</tr>
</template>
<tr x-show="stats.by_country.length === 0">
<td colspan="3" class="text-center text-muted">Nenhum dado disponível</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Top Devices Table -->
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">Top Dispositivos</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered mb-0">
<thead>
<tr>
<th>Dispositivo</th>
<th>Cliques</th>
<th>Percentagem</th>
</tr>
</thead>
<tbody>
<template x-for="device in stats.by_device" :key="device.device_type">
<tr>
<td x-text="device.device_type"></td>
<td x-text="formatNumber(device.clicks)"></td>
<td>
<span x-text="formatNumber(calculatePercentage(device.clicks, stats.overview.total_clicks), 1) + '%'"></span>
</td>
</tr>
</template>
<tr x-show="stats.by_device.length === 0">
<td colspan="3" class="text-center text-muted">Nenhum dado disponível</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Data for JavaScript -->
<script>
window.redirectsStatsData = {
startDate: '<?= $startDate ?>',
endDate: '<?= $endDate ?>',
filterOptions: {
redirects: <?= json_encode($filterOptions['redirects'] ?? []) ?>,
countries: <?= json_encode($filterOptions['countries'] ?? []) ?>,
browsers: <?= json_encode($filterOptions['browsers'] ?? []) ?>,
operatingSystems: <?= json_encode($filterOptions['operatingSystems'] ?? []) ?>
},
stats: {
overview: <?= json_encode($stats['overview'] ?? []) ?>,
by_country: <?= json_encode($stats['by_country'] ?? []) ?>,
by_device: <?= json_encode($stats['by_device'] ?? []) ?>,
by_browser: <?= json_encode($stats['by_browser'] ?? []) ?>
}
};
</script>
<style>
.stats-card {
transition: all 0.3s ease;
border-radius: 12px;
}
.stats-card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}
.stats-icon {
width: 60px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
}
.stats-card:hover .stats-icon {
transform: scale(1.1);
}
.form-select.border-0,
.form-control.border-0 {
background-color: #f8f9fa !important;
border-radius: 8px;
padding: 0.75rem 1rem;
transition: all 0.2s ease;
}
.form-select.border-0:focus,
.form-control.border-0:focus {
background-color: #ffffff !important;
box-shadow: 0 0 0 0.2rem rgba(85, 110, 230, 0.25);
border-color: #556ee6;
}
.btn {
border-radius: 8px;
font-weight: 500;
transition: all 0.2s ease;
}
.btn:hover {
transform: translateY(-1px);
}
.card {
border-radius: 12px;
transition: all 0.3s ease;
}
.card:hover {
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.card-header {
border-bottom: 1px solid rgba(0,0,0,0.05);
background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}
.card-title {
font-weight: 600;
color: #495057;
}
.form-label {
font-weight: 600;
color: #495057;
margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
.page-title-box {
flex-direction: column;
align-items: flex-start !important;
gap: 1rem;
}
.page-title-right {
width: 100%;
}
.breadcrumb {
margin: 0 !important;
}
}
</style>
+92
View File
@@ -0,0 +1,92 @@
<?php
return [
'redirect' => [
'default_status' => 'active',
'statuses' => ['active', 'inactive', 'deleted'],
'types' => ['301', '302', 'meta', 'javascript'],
'targeting_options' => [
'geo' => true,
'device' => true,
'browser' => true,
'time' => true,
'referer' => true
]
],
'tracking' => [
'enabled' => true,
'retention_days' => 90,
'aggregation_enabled' => true,
'max_filters_per_redirect' => 10
],
'filters' => [
'types' => [
'browser' => [
'label' => 'Browser',
'operators' => ['equals', 'contains', 'in', 'not_in'],
'values' => ['Chrome', 'Firefox', 'Safari', 'Edge', 'Opera', 'IE']
],
'os' => [
'label' => 'Operating System',
'operators' => ['equals', 'contains', 'in', 'not_in'],
'values' => ['Windows', 'macOS', 'Linux', 'iOS', 'Android']
],
'device_type' => [
'label' => 'Device Type',
'operators' => ['equals', 'in', 'not_in'],
'values' => ['desktop', 'mobile', 'tablet', 'bot']
],
'country' => [
'label' => 'Country',
'operators' => ['equals', 'in', 'not_in'],
'values' => ['PT', 'US', 'BR', 'ES', 'FR', 'DE', 'IT', 'NL', 'BE', 'CH']
],
'city' => [
'label' => 'City',
'operators' => ['equals', 'contains', 'starts_with', 'ends_with']
],
'region' => [
'label' => 'Region',
'operators' => ['equals', 'contains', 'starts_with', 'ends_with']
],
'timezone' => [
'label' => 'Timezone',
'operators' => ['equals', 'contains', 'in', 'not_in'],
'values' => ['Europe/Lisbon', 'America/New_York', 'America/Sao_Paulo', 'Europe/London']
],
'language' => [
'label' => 'Language',
'operators' => ['equals', 'starts_with', 'in', 'not_in'],
'values' => ['pt-PT', 'en-US', 'es-ES', 'fr-FR', 'de-DE', 'it-IT']
],
'referer' => [
'label' => 'Referer',
'operators' => ['contains', 'starts_with', 'ends_with', 'regex']
],
'hour' => [
'label' => 'Hour of Day',
'operators' => ['equals', 'greater_than', 'less_than', 'between'],
'values' => range(0, 23)
],
'asn' => [
'label' => 'ASN',
'operators' => ['equals', 'contains', 'in', 'not_in']
],
'isp' => [
'label' => 'ISP',
'operators' => ['equals', 'contains', 'starts_with', 'ends_with']
]
]
],
'performance' => [
'rate_limit_per_ip' => 100,
'cache_enabled' => true,
'cache_ttl' => 300, // 5 minutes
'max_response_time' => 1000 // 1 second
],
'security' => [
'allowed_domains' => [],
'blocked_domains' => [],
'validate_urls' => true,
'sanitize_inputs' => true
]
];
+62
View File
@@ -0,0 +1,62 @@
<?php
use App\Core\MenuManager;
// Menu principal do Redirects
MenuManager::registerMenu('Redirects', [
'id' => 11,
'label' => 'Redirects',
'icon' => 'ri-link',
'url' => '/redirects',
'order' => 4,
'parent_id' => null,
'dev' => 0,
]);
// Submenus do Redirects
MenuManager::registerMenus('Redirects', [
[
'id' => 1101,
'label' => 'Dashboard',
'icon' => 'ri-dashboard-line',
'url' => '/redirects',
'order' => 1,
'parent_id' => 11,
'dev' => 0,
],
[
'id' => 1102,
'label' => 'All Redirects',
'icon' => 'ri-list-check',
'url' => '/redirects/redirects',
'order' => 2,
'parent_id' => 11,
'dev' => 0,
],
[
'id' => 1103,
'label' => 'Create Redirect',
'icon' => 'ri-add-line',
'url' => '/redirects/redirects/create',
'order' => 3,
'parent_id' => 11,
'dev' => 0,
],
[
'id' => 1104,
'label' => 'Analytics',
'icon' => 'ri-bar-chart-line',
'url' => '/redirects/stats',
'order' => 4,
'parent_id' => 11,
'dev' => 0,
],
[
'id' => 1105,
'label' => 'Settings',
'icon' => 'ri-settings-3-line',
'url' => '/redirects/settings',
'order' => 5,
'parent_id' => 11,
'dev' => 0,
],
]);
+126
View File
@@ -0,0 +1,126 @@
<?php
declare(strict_types=1);
namespace App\Modules\Users\Models;
use App\Core\BaseModel;
class RoleModel extends BaseModel
{
protected string $table = 'roles';
protected string $primaryKey = 'id';
protected array $fillable = [
'name',
'description',
'permissions',
'is_active'
];
public function __construct()
{
parent::__construct(\App\Core\DatabaseManager::getInstance());
}
/**
* Get all roles with user count
*/
public function getAllWithUserCount(): array
{
$query = "
SELECT
r.*,
COUNT(DISTINCT u.id) as users_count
FROM {$this->table} r
LEFT JOIN users u ON u.role = r.name AND u.is_active = 1
WHERE r.is_active = 1
GROUP BY r.id
ORDER BY r.name ASC
";
return $this->db->fetchAll($query);
}
/**
* Get role with users
*/
public function getRoleWithUsers(int $id): ?array
{
$role = $this->getById($id);
if (!$role) {
return null;
}
// Get users with this role
$users = $this->db->fetchAll(
"SELECT id, username, email, created_at
FROM users
WHERE role = ? AND is_active = 1
LIMIT 100",
[$role['name']]
);
$role['users'] = $users;
$role['users_count'] = count($users);
// Parse permissions JSON
if (!empty($role['permissions'])) {
$role['permissions'] = json_decode($role['permissions'], true) ?: [];
} else {
$role['permissions'] = [];
}
return $role;
}
/**
* Create role with permissions
*/
public function createRole(array $data): int
{
// Convert permissions array to JSON
if (isset($data['permissions']) && is_array($data['permissions'])) {
$data['permissions'] = json_encode($data['permissions']);
}
return $this->create($data);
}
/**
* Update role with permissions
*/
public function updateRole(int $id, array $data): bool
{
// Convert permissions array to JSON
if (isset($data['permissions']) && is_array($data['permissions'])) {
$data['permissions'] = json_encode($data['permissions']);
}
return $this->update($id, $data);
}
/**
* Delete role (soft delete)
*/
public function deleteRole(int $id): bool
{
return $this->update($id, ['is_active' => 0]);
}
/**
* Check if role name exists
*/
public function roleNameExists(string $name, ?int $excludeId = null): bool
{
$query = "SELECT COUNT(*) as count FROM {$this->table} WHERE name = ? AND is_active = 1";
$params = [$name];
if ($excludeId) {
$query .= " AND id != ?";
$params[] = $excludeId;
}
$result = $this->db->fetch($query, $params);
return ($result['count'] ?? 0) > 0;
}
}
+189
View File
@@ -0,0 +1,189 @@
<?php
use App\Core\View;
use App\Core\OutputSanitize;
$roleId = $role['id'];
$roleName = OutputSanitize::html($role['name']);
$roleDescription = OutputSanitize::html($role['description'] ?? '');
$permissions = $role['permissions'] ?? [];
?>
<div class="row" x-data="roleEdit(<?= $roleId ?>, <?= htmlspecialchars(json_encode($role), ENT_QUOTES, 'UTF-8') ?>)">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Editar Perfil: <?= $roleName ?></h5>
</div>
<div class="card-body">
<form @submit.prevent="updateRole()">
<div class="row g-3">
<div class="col-md-6">
<label for="role-name" class="form-label">Nome do Perfil *</label>
<input type="text"
class="form-control"
id="role-name"
x-model="formData.name"
required>
</div>
<div class="col-md-6">
<label for="role-status" class="form-label">Estado</label>
<select class="form-select" id="role-status" x-model="formData.is_active">
<option value="1">Ativo</option>
<option value="0">Inativo</option>
</select>
</div>
<div class="col-12">
<label for="role-description" class="form-label">Descrição</label>
<textarea class="form-control"
id="role-description"
x-model="formData.description"
rows="3"></textarea>
</div>
<div class="col-12">
<label class="form-label">Permissões</label>
<div class="alert alert-info">
<i class="ri-information-line me-1"></i>
Selecione as permissões que este perfil terá acesso
</div>
<div class="row">
<div class="col-md-6">
<h6 class="text-muted mb-2">Gestão de Utilizadores</h6>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-users-view"
x-model="formData.permissions" value="users.view">
<label class="form-check-label" for="perm-users-view">Ver utilizadores</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-users-create"
x-model="formData.permissions" value="users.create">
<label class="form-check-label" for="perm-users-create">Criar utilizadores</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-users-edit"
x-model="formData.permissions" value="users.edit">
<label class="form-check-label" for="perm-users-edit">Editar utilizadores</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-users-delete"
x-model="formData.permissions" value="users.delete">
<label class="form-check-label" for="perm-users-delete">Eliminar utilizadores</label>
</div>
</div>
<div class="col-md-6">
<h6 class="text-muted mb-2">Gestão de Redirects</h6>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-redirects-view"
x-model="formData.permissions" value="redirects.view">
<label class="form-check-label" for="perm-redirects-view">Ver redirects</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-redirects-create"
x-model="formData.permissions" value="redirects.create">
<label class="form-check-label" for="perm-redirects-create">Criar redirects</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-redirects-edit"
x-model="formData.permissions" value="redirects.edit">
<label class="form-check-label" for="perm-redirects-edit">Editar redirects</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-redirects-delete"
x-model="formData.permissions" value="redirects.delete">
<label class="form-check-label" for="perm-redirects-delete">Eliminar redirects</label>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<h6 class="text-muted mb-2">Analytics e Relatórios</h6>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-analytics-view"
x-model="formData.permissions" value="analytics.view">
<label class="form-check-label" for="perm-analytics-view">Ver analytics</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-reports-view"
x-model="formData.permissions" value="reports.view">
<label class="form-check-label" for="perm-reports-view">Ver relatórios</label>
</div>
</div>
<div class="col-md-6">
<h6 class="text-muted mb-2">Sistema</h6>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-system-settings"
x-model="formData.permissions" value="system.settings">
<label class="form-check-label" for="perm-system-settings">Configurações do sistema</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="perm-system-admin"
x-model="formData.permissions" value="system.admin">
<label class="form-check-label" for="perm-system-admin">Acesso administrativo completo</label>
</div>
</div>
</div>
</div>
</div>
<div class="hstack gap-2 justify-content-end mt-4">
<a href="/admin/roles/<?= $roleId ?>" class="btn btn-light">Cancelar</a>
<button type="submit" class="btn btn-primary" :disabled="saving">
<span x-show="!saving">Guardar Alterações</span>
<span x-show="saving">
<span class="spinner-border spinner-border-sm me-1" role="status"></span>
A guardar...
</span>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
function roleEdit(roleId, initialData) {
return {
roleId: roleId,
formData: {
name: initialData.name || '',
description: initialData.description || '',
permissions: initialData.permissions || [],
is_active: initialData.is_active || 1
},
saving: false,
async updateRole() {
if (this.saving) return;
this.saving = true;
try {
const response = await fetch(`/api/users/roles/${this.roleId}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams(this.formData)
});
const data = await response.json();
if (data.success) {
alert('Perfil atualizado com sucesso!');
window.location.href = `/admin/roles/${this.roleId}`;
} else {
alert('Erro: ' + data.message);
}
} catch (error) {
console.error('Erro:', error);
alert('Erro ao atualizar perfil');
} finally {
this.saving = false;
}
}
};
}
</script>
+116
View File
@@ -0,0 +1,116 @@
<?php
use App\Core\View;
use App\Core\OutputSanitize;
$roleId = $role['id'];
$roleName = OutputSanitize::html($role['name']);
$roleDescription = OutputSanitize::html($role['description'] ?? '');
$permissions = $role['permissions'] ?? [];
$users = $role['users'] ?? [];
$usersCount = $role['users_count'] ?? 0;
?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="d-flex align-items-center">
<h5 class="card-title flex-grow-1 mb-0">Detalhes do Perfil</h5>
<div class="flex-shrink-0">
<a href="/admin/roles/<?= $roleId ?>/edit" class="btn btn-soft-primary btn-sm">
<i class="ri-pencil-line align-middle"></i> Editar
</a>
<a href="/admin/roles" class="btn btn-soft-secondary btn-sm">
<i class="ri-arrow-left-line align-middle"></i> Voltar
</a>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label class="form-label fw-semibold">Nome do Perfil</label>
<p class="text-muted"><?= $roleName ?></p>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label fw-semibold">Utilizadores com este Perfil</label>
<p class="text-muted"><?= $usersCount ?> utilizadores</p>
</div>
</div>
<div class="col-12">
<div class="mb-3">
<label class="form-label fw-semibold">Descrição</label>
<p class="text-muted"><?= $roleDescription ?: 'Sem descrição' ?></p>
</div>
</div>
<div class="col-12">
<div class="mb-3">
<label class="form-label fw-semibold">Permissões</label>
<div>
<?php if (!empty($permissions)): ?>
<?php foreach ($permissions as $permission): ?>
<span class="badge bg-info-subtle text-info me-1 mb-1"><?= OutputSanitize::html($permission) ?></span>
<?php endforeach; ?>
<?php else: ?>
<span class="text-muted">Sem permissões definidas</span>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Utilizadores com este perfil -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Utilizadores com este Perfil (<?= $usersCount ?>)</h5>
</div>
<div class="card-body">
<?php if (!empty($users)): ?>
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead class="table-light">
<tr>
<th>Nome de Utilizador</th>
<th>Email</th>
<th>Data de Criação</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user): ?>
<tr>
<td><?= OutputSanitize::html($user['username']) ?></td>
<td><?= OutputSanitize::html($user['email']) ?></td>
<td><?= date('d/m/Y H:i', strtotime($user['created_at'])) ?></td>
<td>
<a href="/users/<?= $user['id'] ?>" class="btn btn-sm btn-soft-info">
<i class="ri-eye-line"></i> Ver
</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php else: ?>
<div class="text-center py-4">
<i class="ri-user-line fs-1 text-muted"></i>
<p class="text-muted mt-2">Nenhum utilizador com este perfil</p>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
+17
View File
@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
use App\Core\View;
View::render('layouts/main.php', [
'title' => 'Erro 404 - Página não encontrada',
'page_content' => function() {
// Simple, styled 404 message (Portuguese)
echo '<div class="row justify-content-center align-items-center" style="min-height:60vh;">';
echo '<div class="col-md-8 text-center">';
echo '<img src="' . View::asset('/assets/images/404-error.png') . '" alt="404" style="max-width:220px; margin-bottom:2rem;">';
echo '<h1 class="display-4 mb-3">Erro 404</h1>';
echo '<p class="lead mb-4">A página que procura não existe ou foi movida.</p>';
echo '<a href="/" class="btn btn-primary">Voltar à página inicial</a>';
echo '</div></div>';
}
]);
+1412
View File
File diff suppressed because it is too large. Load diff
+7 -17
View File
@@ -1,17 +1,7 @@
/* Error: Can't find stylesheet to import.
* ,
* 74 | @import "plugins/swiper";
* | ^^^^^^^^^^^^^^^^
* '
* crm/Views/assets/scss/app.scss 74:9 root stylesheet */
body::before {
font-family: "Source Code Pro", "SF Mono", Monaco, Inconsolata, "Fira Mono",
"Droid Sans Mono", monospace, monospace;
white-space: pre;
display: block;
padding: 1em;
margin-bottom: 1em;
border-bottom: 2px solid black;
content: "Error: Can't find stylesheet to import.\a \2577 \a 74 \2502 @import \"plugins/swiper\";\a \2502 ^^^^^^^^^^^^^^^^\a \2575 \a crm/Views/assets/scss/app.scss 74:9 root stylesheet";
}
@import"https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap";@import"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap";@font-face{font-family:"hkgrotesk";src:url("../fonts/hkgrotesk-light.eot");src:local("hkgrotesk light"),url("../fonts/hkgrotesk-light.woff") format("woff");font-weight:300}@font-face{font-family:"hkgrotesk";src:url("../fonts/hkgrotesk-regular.eot");src:local("hkgrotesk regular"),url("../fonts/hkgrotesk-regular.woff") format("woff");font-weight:400}@font-face{font-family:"hkgrotesk";src:url("../fonts/hkgrotesk-medium.eot");src:local("hkgrotesk medium"),url("../fonts/hkgrotesk-medium.woff") format("woff");font-weight:500}@font-face{font-family:"hkgrotesk";src:url("../fonts/hkgrotesk-semibold.eot");src:local("hkgrotesk semibold"),url("../fonts/hkgrotesk-semibold.woff") format("woff");font-weight:600}@font-face{font-family:"hkgrotesk";src:url("../fonts/hkgrotesk-bold.eot");src:local("hkgrotesk bold"),url("../fonts/hkgrotesk-bold.woff") format("woff");font-weight:700}#page-topbar{position:fixed;top:0;right:0;left:0;z-index:1002;background-color:var(--vz-header-bg);transition:all .1s ease-out;border-bottom:1px solid var(--vz-header-border)}#page-topbar.topbar-shadow{box-shadow:0 1px 2px rgba(56,65,74,.15)}@media(min-width: 768px){#page-topbar{left:var(--vz-vertical-menu-width)}}.navbar-header{display:flex;-ms-flex-pack:justify;justify-content:space-between;align-items:center;margin:0 auto;height:70px;padding:0 1.5rem 0 calc(1.5rem*.5)}@media(max-width: 767.98px){.navbar-header{padding:0 calc(1.5rem*.5) 0 calc(1.5rem*.5)}}.navbar-header .topbar-head-dropdown .dropdown-menu.show{top:13px !important}.navbar-header .topbar-head-dropdown .notification-actions{display:none;position:absolute;background-color:var(--vz-secondary-bg);left:0;right:0;bottom:0;padding:7px;border-top:1px solid var(--vz-border-color)}.navbar-header .btn-topbar{height:42px;width:42px;color:var(--vz-header-item-sub-color);transition:all .5s ease}.navbar-header .btn-topbar:hover,.navbar-header .btn-topbar:focus,.navbar-header .btn-topbar:active,.navbar-header .btn-topbar.active{background-color:var(--vz-header-item-bg)}@media(max-width: 360px){.navbar-header .btn-topbar{height:36px;width:36px}}.navbar-header .user-name-sub-text{color:var(--vz-header-item-sub-color)}.navbar-header .user-name-text{color:var(--vz-header-item-color)}.app-search{padding:calc(32px*.5) 0}.app-search .form-control{border:none;height:38px;padding-left:40px;padding-right:30px;background-color:var(--vz-topbar-search-bg);color:var(--vz-topbar-search-color);box-shadow:none}.app-search span.search-widget-icon{position:absolute;z-index:10;font-size:18px;line-height:38px;left:13px;top:0;color:var(--vz-header-item-sub-color)}.app-search .search-widget-icon-close{right:7px;left:auto !important}@media(max-width: 1023.99px){.app-search{padding-left:calc(1.5rem*.5)}}.app-search ::-webkit-input-placeholder{color:var(--vz-header-item-sub-color)}.app-search :-ms-input-placeholder{color:var(--vz-header-item-sub-color)}.app-search ::placeholder{color:var(--vz-header-item-sub-color)}.megamenu-list li{position:relative;padding:5px 0px}.megamenu-list li a{color:var(--vz-body-color)}@media(max-width: 767.98px){.logo span.logo-lg{display:none}.logo span.logo-sm{display:inline-block}}.header-item{height:70px;display:flex;align-items:center}.header-profile-user{height:32px;width:32px}.topbar-badge-sm{right:0;top:7px !important}.topbar-badge{right:-9px;top:4px !important}@media(min-width: 768px){.topbar-user{background-color:var(--vz-topbar-user-bg)}}.topbar-user .dropdown-menu{top:6px !important}.notification-item{padding:.75rem 1rem;white-space:inherit;position:relative}.notification-item .form-check-input{position:relative;z-index:2}.dropdown-icon-item{display:block;border-radius:3px;line-height:34px;text-align:center;padding:15px 0 9px;border:1px solid rgba(0,0,0,0);color:var(--vz-dropdown-link-color)}.dropdown-icon-item img{height:24px}.dropdown-icon-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-icon-item:hover{background-color:var(--vz-dropdown-link-hover-bg)}.fullscreen-enable [data-toggle=fullscreen] .bx-fullscreen::before{content:""}[data-bs-theme=dark] .light-dark-mode .bx-moon::before{content:""}[data-topbar=dark] .logo-dark{display:none}[data-topbar=dark] .logo-light{display:inline-block}[data-bs-theme=dark][data-topbar=light] .logo-dark{display:none}[data-bs-theme=dark][data-topbar=light] .logo-light{display:inline-block}@media(max-width: 600px){.navbar-header .dropdown{position:static}.navbar-header .dropdown .dropdown-menu{width:100%}}@media(max-width: 767.98px){#search-dropdown-reponsive{top:54px !important}}@media(min-width: 1024.1px){[data-layout=vertical][data-layout-style=detached] #page-topbar{left:0 !important;box-shadow:0 1px 2px rgba(56,65,74,.15)}[data-layout=vertical][data-layout-style=detached] .horizontal-logo{display:inLine truncated
* Waves v0.7.6
* http://fian.my.id/Waves
*
* Copyright 2014-2018 Alfiana E. Sibuea and other contributors
* Released under the MIT license
* https://github.com/fians/Waves/blob/master/LICENSE */.waves-effect{position:relative;cursor:pointer;display:inline-block;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.waves-effect .waves-ripple{position:absolute;border-radius:50%;width:100px;height:100px;margin-top:-50px;margin-left:-50px;opacity:0;background:rgba(0,0,0,.2);background:-webkit-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);background:-o-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);background:-moz-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);background:radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);-webkit-transition:all .5s ease-out;-moz-transition:all .5s ease-out;-o-transition:all .5s ease-out;transition:all .5s ease-out;-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:-moz-transform,opacity;-o-transition-property:-o-transform,opacity;transition-property:transform,opacity;-webkit-transform:scale(0) translate(0, 0);-moz-transform:scale(0) translate(0, 0);-ms-transform:scale(0) translate(0, 0);-o-transform:scale(0) translate(0, 0);transform:scale(0) translate(0, 0);pointer-events:none}.waves-effect.waves-light .waves-ripple{background:hsla(0,0%,100%,.4);background:-webkit-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);background:-o-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);background:-moz-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);background:radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%)}.waves-effect.waves-classic .waves-ripple{background:rgba(0,0,0,.2)}.waves-effect.waves-classic.waves-light .waves-ripple{background:hsla(0,0%,100%,.4)}.waves-notransition{-webkit-transition:none !important;-moz-transition:none !important;-o-transition:none !important;transition:none !important}.waves-button,.waves-circle{-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0);transform:translateZ(0);-webkit-mask-image:-webkit-radial-gradient(circle, white 100%, black 100%)}.waves-button,.waves-button:hover,.waves-button:visited,.waves-button-input{white-space:nowrap;vertical-align:middle;cursor:pointer;border:none;outline:none;color:inherit;background-color:rgba(0,0,0,0);font-size:1em;line-height:1em;text-align:center;text-decoration:none;z-index:1}.waves-button{padding:.85em 1.1em;border-radius:.2em}.waves-button-input{margin:0;padding:.85em 1.1em}.waves-input-wrapper{border-radius:.2em;vertical-align:bottom}.waves-input-wrapper.waves-button{padding:0}.waves-input-wrapper .waves-button-input{position:relative;top:0;left:0;z-index:1}.waves-circle{text-align:center;width:2.5em;height:2.5em;line-height:2.5em;border-radius:50%}.waves-float{-webkit-mask-image:none;-webkit-box-shadow:0px 1px 1.5px 1px rgba(0,0,0,.12);box-shadow:0px 1px 1.5px 1px rgba(0,0,0,.12);-webkit-transition:all 300ms;-moz-transition:all 300ms;-o-transition:all 300ms;transition:all 300ms}.waves-float:active{-webkit-box-shadow:0px 8px 20px 1px rgba(0,0,0,.3);box-shadow:0px 8px 20px 1px rgba(0,0,0,.3)}.waves-block{display:block}.waves-effect.waves-light .waves-ripple{background-color:hsla(0,0%,100%,.4)}.waves-effect.waves-primary .waves-ripple{background-color:rgba(94,163,203,.4)}.waves-effect.waves-success .waves-ripple{background-color:rgba(106,218,125,.4)}.waves-effect.waves-info .waves-ripple{background-color:rgba(88,202,234,.4)}.waves-effect.waves-warning .waves-ripple{background-color:rgba(247,184,75,.4)}.waves-effect.waves-danger .waves-ripple{background-color:rgba(250,137,107,.4)}.avatar-xxs{height:1.5rem;width:1.5rem}.avatar-xs{height:2rem;width:2rem}.avatar-sm{height:3rem;width:3rem}.avatar-md{height:4.5rem;width:4.5rem}.avatar-lg{height:6rem;width:6rem}.avatar-xl{height:7.5rem;width:7.5rem}.avatar-title{align-items:center;background-color:#5ea3cb;color:#fff;display:flex;font-weight:500;height:100%;justify-content:center;width:100%}.avatar-group{padding-left:12px;display:flex;flex-wrap:wrap}.avatar-group .avatar-group-item{margin-left:-12px;border:2px solid var(--vz-secondary-bg);border-radius:50%;transition:all .2s}.avatar-group .avatar-group-item:hover{position:relative;tLine truncated
+1 -1
View File
@@ -1 +1 @@
.ecommerce-layout{display:grid;grid-template-columns:320px 1fr;gap:24px;align-items:start;max-width:1600px;margin:0 auto;padding:16px;min-height:calc(100vh - 100px)}.filters-sidebar{position:sticky;top:16px;height:fit-content;max-height:calc(100vh - 32px);overflow-y:auto;background:#fff;border-radius:8px;box-shadow:0 1px 8px rgba(0,0,0,.06);padding:20px;border:1px solid #e9ecef}.products-main{background:#fff;border-radius:8px;box-shadow:0 1px 8px rgba(0,0,0,.06);border:1px solid #e9ecef;overflow:hidden;height:fit-content}@media(max-width: 991px){.ecommerce-layout{grid-template-columns:1fr;gap:16px;padding:12px}.filters-sidebar{position:static;max-height:none;order:2}.products-main{order:1}}.filter-accordion .accordion-item{border:none;border-bottom:1px solid #f1f3f4;margin-bottom:4px}.card .card-header{padding:20px 24px}.card .card-body{padding:20px 24px}.filter-accordion .accordion-button{padding:16px 20px;font-weight:600;color:#2c3e50;background:rgba(0,0,0,0);border:none;box-shadow:none}.filter-accordion .accordion-button:not(.collapsed){background-color:rgba(0,0,0,0);box-shadow:none;color:#405189}.filter-accordion .accordion-button:focus{box-shadow:none;border-color:rgba(0,0,0,0)}.filter-accordion .accordion-button::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23405189'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.filter-accordion .accordion-body{padding:0 20px 16px 20px}.filter-accordion .form-check{margin-bottom:8px;padding-left:0}.filter-accordion .form-check-input{margin-right:12px}.filter-accordion .form-check-label{padding-left:0;font-size:.9rem;line-height:1.4}.filter-accordion .mb-3{margin-bottom:1.5rem !important}.filter-accordion .text-uppercase.fs-13.fw-medium{margin-bottom:12px;padding-left:0}.filter-accordion .form-control{margin-bottom:12px;border-radius:6px;border:1px solid #e9ecef}.filter-accordion .form-control:focus{border-color:#405189;box-shadow:0 0 0 .2rem rgba(64,81,137,.25)}.filter-accordion .badge{margin-bottom:6px;margin-right:6px;padding:6px 10px;font-size:.8rem}.filter-accordion .filter-check{padding-left:0}.filter-accordion .filter-check .d-flex.align-items-center{padding:4px 0;margin-bottom:2px}.filter-accordion .btn-xs.btn-link{padding:2px 4px;margin-right:8px;color:#6c757d}.filter-accordion .btn-xs.btn-link:hover{color:#405189}.product-card{border:1px solid #e9ecef;border-radius:8px;transition:all .2s ease;background:#fff;overflow:hidden}.product-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.1);transform:translateY(-1px);border-color:#405189}.product-image{width:100%;height:180px;object-fit:cover;border-radius:8px 8px 0 0;transition:transform .2s ease}.product-image:hover{transform:scale(1.02)}.product-info{padding:16px}.product-title{font-size:1rem;font-weight:600;color:#2c3e50;margin-bottom:6px;line-height:1.3}.product-brand{color:#6c757d;font-size:.85rem;margin-bottom:10px}.product-price{font-size:1.2rem;font-weight:700;color:#0ab39c;margin-bottom:6px}.product-stock{font-size:.85rem;font-weight:500}.product-stock.in-stock{color:#0ab39c}.product-stock.low-stock{color:#f7b84b}.product-stock.out-of-stock{color:#f06548}.filter-section{margin-bottom:20px}.filter-section .filter-title{font-size:.8rem;font-weight:700;color:#405189;text-transform:uppercase;margin-bottom:10px;letter-spacing:.5px}.filter-checkbox{display:flex;align-items:center;margin-bottom:6px}.filter-checkbox input[type=checkbox]{margin-right:8px;accent-color:#405189}.filter-checkbox label{font-size:.85rem;color:#495057;cursor:pointer}.filter-checkbox label:hover{color:#405189}.filter-search{margin-bottom:12px}.filter-search .form-control{border-radius:6px;border:1px solid #e9ecef;padding:6px 10px;font-size:.85rem}.filter-search .form-control:focus{border-color:#405189;box-shadow:0 0 0 .15rem rgba(64,81,137,.25)}.pagination-wrapper{display:flex;justify-content:center;align-items:center;margin-top:20px;padding:16px;background:#f8f9fa;border-top:1px solid #e9ecef}.pagination .page-link{border-radius:6px;margin:0 2px;border:1px solid #e9ecef;color:#495057;font-weight:500;padding:6px 12px}.pagination .page-link:hover{background-color:#405189;border-color:#405189;color:#fff}.pagination .page-item.active .page-link{background-color:#405189;border-color:#405189}.loading-spinner{display:flex;justify-content:center;align-items:center;min-height:200px;flex-direction:column}.loading-spinner .spinner-border{color:#405189;width:2.5rem;height:2.5rem}.loading-spinner .loading-text{margin-top:12px;color:#6c757d;font-size:.9rem}.empty-state{text-align:center;padding:40px 20px;color:#6c757d}.empty-state .empty-icon{font-size:3rem;margin-bottom:16px;opacity:.3;color:#405189}.empty-state .empty-title{font-size:1.3rem;font-weight:600;margin-bottom:10px;color:#2c3e50}.empty-state .empty-description{font-size:.9rem;line-height:1.4}.table{Line truncated
.ecommerce-layout{display:grid;grid-template-columns:320px 1fr;gap:24px;align-items:start;max-width:1600px;margin:0 auto;padding:16px;min-height:calc(100vh - 100px)}.filters-sidebar{position:sticky;top:16px;height:fit-content;max-height:calc(100vh - 32px);overflow-y:auto;background:#fff;border-radius:8px;box-shadow:0 1px 8px rgba(0,0,0,.06);padding:20px;border:1px solid #e9ecef}.products-main{background:#fff;border-radius:8px;box-shadow:0 1px 8px rgba(0,0,0,.06);border:1px solid #e9ecef;overflow:hidden;height:fit-content}@media(max-width: 991px){.ecommerce-layout{grid-template-columns:1fr;gap:16px;padding:12px}.filters-sidebar{position:static;max-height:none;order:2}.products-main{order:1}}.filter-accordion .accordion-item{border:none;border-bottom:1px solid #f1f3f4;margin-bottom:4px}.card .card-header{padding:20px 24px}.card .card-body{padding:20px 24px}.filter-accordion .accordion-button{padding:16px 20px;font-weight:600;color:#2c3e50;background:rgba(0,0,0,0);border:none;box-shadow:none}.filter-accordion .accordion-button:not(.collapsed){background-color:rgba(0,0,0,0);box-shadow:none;color:#405189}.filter-accordion .accordion-button:focus{box-shadow:none;border-color:rgba(0,0,0,0)}.filter-accordion .accordion-button::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23405189'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.filter-accordion .accordion-body{padding:0 20px 16px 20px}.filter-accordion .form-check{margin-bottom:8px;padding-left:0}.filter-accordion .form-check-input{margin-right:12px}.filter-accordion .form-check-label{padding-left:0;font-size:.9rem;line-height:1.4}.filter-accordion .mb-3{margin-bottom:1.5rem !important}.filter-accordion .text-uppercase.fs-13.fw-medium{margin-bottom:12px;padding-left:0}.filter-accordion .form-control{margin-bottom:12px;border-radius:6px;border:1px solid #e9ecef}.filter-accordion .form-control:focus{border-color:#405189;box-shadow:0 0 0 .2rem rgba(64,81,137,.25)}.filter-accordion .badge{margin-bottom:6px;margin-right:6px;padding:6px 10px;font-size:.8rem}.filter-accordion .filter-check{padding-left:0}.filter-accordion .filter-check .d-flex.align-items-center{padding:4px 0;margin-bottom:2px}.filter-accordion .btn-xs.btn-link{padding:2px 4px;margin-right:8px;color:#6c757d}.filter-accordion .btn-xs.btn-link:hover{color:#405189}.product-card{border:1px solid #e9ecef;border-radius:8px;transition:all .2s ease;background:#fff;overflow:hidden}.product-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.1);transform:translateY(-1px);border-color:#405189}.product-image{width:100%;height:180px;object-fit:cover;border-radius:8px 8px 0 0;transition:transform .2s ease}.product-image:hover{transform:scale(1.02)}.product-info{padding:16px}.product-title{font-size:1rem;font-weight:600;color:#2c3e50;margin-bottom:6px;line-height:1.3}.product-brand{color:#6c757d;font-size:.85rem;margin-bottom:10px}.product-price{font-size:1.2rem;font-weight:700;color:#0ab39c;margin-bottom:6px}.product-stock{font-size:.85rem;font-weight:500}.product-stock.in-stock{color:#0ab39c}.product-stock.low-stock{color:#f7b84b}.product-stock.out-of-stock{color:#f06548}.filter-section{margin-bottom:20px}.filter-section .filter-title{font-size:.8rem;font-weight:700;color:#405189;text-transform:uppercase;margin-bottom:10px;letter-spacing:.5px}.filter-checkbox{display:flex;align-items:center;margin-bottom:6px}.filter-checkbox input[type=checkbox]{margin-right:8px;accent-color:#405189}.filter-checkbox label{font-size:.85rem;color:#495057;cursor:pointer}.filter-checkbox label:hover{color:#405189}.filter-search{margin-bottom:12px}.filter-search .form-control{border-radius:6px;border:1px solid #e9ecef;padding:6px 10px;font-size:.85rem}.filter-search .form-control:focus{border-color:#405189;box-shadow:0 0 0 .15rem rgba(64,81,137,.25)}.pagination-wrapper{display:flex;justify-content:center;align-items:center;margin-top:20px;padding:16px;background:#f8f9fa;border-top:1px solid #e9ecef}.pagination .page-link{border-radius:6px;margin:0 2px;border:1px solid #e9ecef;color:#495057;font-weight:500;padding:6px 12px}.pagination .page-link:hover{background-color:#405189;border-color:#405189;color:#fff}.pagination .page-item.active .page-link{background-color:#405189;border-color:#405189}.loading-spinner{display:flex;justify-content:center;align-items:center;min-height:200px;flex-direction:column}.loading-spinner .spinner-border{color:#405189;width:2.5rem;height:2.5rem}.loading-spinner .loading-text{margin-top:12px;color:#6c757d;font-size:.9rem}.empty-state{text-align:center;padding:40px 20px;color:#6c757d}.empty-state .empty-icon{font-size:3rem;margin-bottom:16px;opacity:.3;color:#405189}.empty-state .empty-title{font-size:1.3rem;font-weight:600;margin-bottom:10px;color:#2c3e50}.empty-state .empty-description{font-size:.9rem;line-height:1.4}.table{Line truncated
@@ -0,0 +1,3 @@
/*! For license information please see app.8e9399a666b59b9816a2.js.LICENSE.txt */
(()=>{var t={19:function(t,e,n){var i,r,o,a,s,l,c,u,h;t.exports=(h=n(9021),n(3009),n(1025),o=(r=(i=h).lib).Base,a=r.WordArray,l=(s=i.algo).SHA256,c=s.HMAC,u=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:25e4}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,i=c.create(n.hasher,t),r=a.create(),o=a.create([1]),s=r.words,l=o.words,u=n.keySize,h=n.iterations;s.length<u;){var d=i.update(e).finalize(o);i.reset();for(var p=d.words,f=p.length,g=d,m=1;m<h;m++){g=i.finalize(g),i.reset();for(var y=g.words,v=0;v<f;v++)p[v]^=y[v]}r.concat(d),l[0]++}return r.sigBytes=4*u,r}}),i.PBKDF2=function(t,e,n){return u.create(n).compute(t,e)},h.PBKDF2)},25:function(t,e,n){var i,r,o,a;t.exports=(a=n(9021),n(7165),r=(i=a).lib.CipherParams,o=i.enc.Hex,i.format.Hex={stringify:function(t){return t.ciphertext.toString(o)},parse:function(t){var e=o.parse(t);return r.create({ciphertext:e})}},a.format.Hex)},34:(t,e,n)=>{"use strict";var i=n(4901);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},81:(t,e,n)=>{"use strict";var i=n(9565),r=n(9306),o=n(8551),a=n(6823),s=n(851),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?s(t):e;if(r(n))return o(i(n,t));throw new l(a(t)+" is not iterable")}},283:(t,e,n)=>{"use strict";var i=n(9504),r=n(9039),o=n(4901),a=n(9297),s=n(3724),l=n(350).CONFIGURABLE,c=n(3706),u=n(1181),h=u.enforce,d=u.get,p=String,f=Object.defineProperty,g=i("".slice),m=i("".replace),y=i([].join),v=s&&!r(function(){return 8!==f(function(){},"length",{value:8}).length}),_=String(String).split("String"),x=t.exports=function(t,e,n){"Symbol("===g(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(s?f(t,"name",{value:e,configurable:!0}):t.name=e),v&&n&&a(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=h(t);return a(i,"source")||(i.source=y(_,"string"==typeof e?e:"")),t};Function.prototype.toString=x(function(){return o(this)&&d(this).source||c(this)},"toString")},350:(t,e,n)=>{"use strict";var i=n(3724),r=n(9297),o=Function.prototype,a=i&&Object.getOwnPropertyDescriptor,s=r(o,"name"),l=s&&"something"===function(){}.name,c=s&&(!i||i&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:l,CONFIGURABLE:c}},397:(t,e,n)=>{"use strict";var i=n(7751);t.exports=i("document","documentElement")},421:t=>{"use strict";t.exports={}},477:()=>{},482:function(t,e,n){var i;t.exports=(i=n(9021),n(7165),i.pad.Iso97971={pad:function(t,e){t.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(t,e)},unpad:function(t){i.pad.ZeroPadding.unpad(t),t.sigBytes--}},i.pad.Iso97971)},616:(t,e,n)=>{"use strict";var i=n(9039);t.exports=!i(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},655:(t,e,n)=>{"use strict";var i=n(6955),r=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return r(t)}},679:(t,e,n)=>{"use strict";var i=n(1625),r=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw new r("Incorrect invocation")}},687:(t,e,n)=>{"use strict";var i=n(4913).f,r=n(9297),o=n(8227)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!r(t,o)&&i(t,o,{configurable:!0,value:e})}},706:(t,e,n)=>{"use strict";var i=n(350).PROPER,r=n(9039),o=n(7452);t.exports=function(t){return r(function(){return!!o[t]()||"​…᠎"!=="​…᠎"[t]()||i&&o[t].name!==t})}},741:t=>{"use strict";var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?n:e)(i)}},754:function(t,e,n){var i,r,o;t.exports=(i=n(9021),o=(r=i).lib.WordArray,r.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,i=this._map;t.clamp();for(var r=[],o=0;o<n;o+=3)for(var a=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)r.push(i.charAt(a>>>6*(3-s)&63));var l=i.charAt(64);if(l)for(;r.length%4;)r.push(l);return r.join("")},parse:function(t){var e=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var r=0;r<n.length;r++)i[n.charCodeAt(r)]=r}var a=n.charAt(64);if(a){var s=t.indexOf(a);-1!==s&&(e=s)}return function(t,e,n){for(var i=[],r=0,a=0;a<e;a++)if(a%4){var s=n[t.charCodeAt(a-1)]<<a%4*2|n[t.charCodeAt(a)]>>>6-a%4*2;i[r>>>2]|=s<<24-r%4*8,r++}return o.create(i,r)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)},757:(t,e,n)=>{"use strict";var i=n(7751),r=n(4901),o=n(1625),a=n(7040),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return r(e)&&o(e.prototype,s(t))}},788:(t,e,n)=>{"use strict";var i=n(34),r=n(2195),o=n(8227)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[o])?!!e:"RegExp"===r(t))}},851:(t,e,n)=>{"use strict";var i=n(6955),r=n(5966),o=Line truncated
//# sourceMappingURL=app.8e9399a666b59b9816a2.js.map
@@ -0,0 +1,3 @@
/*! For license information please see public.6a37efa8030a7ee0bab7.js.LICENSE.txt */
(()=>{var t={19:function(t,e,n){var r,o,i,a,s,l,d,c,p;t.exports=(p=n(9021),n(3009),n(1025),i=(o=(r=p).lib).Base,a=o.WordArray,l=(s=r.algo).SHA256,d=s.HMAC,c=s.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:l,iterations:25e4}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,r=d.create(n.hasher,t),o=a.create(),i=a.create([1]),s=o.words,l=i.words,c=n.keySize,p=n.iterations;s.length<c;){var b=r.update(e).finalize(i);r.reset();for(var A=b.words,g=A.length,m=b,h=1;h<p;h++){m=r.finalize(m),r.reset();for(var u=m.words,f=0;f<g;f++)A[f]^=u[f]}o.concat(b),l[0]++}return o.sigBytes=4*c,o}}),r.PBKDF2=function(t,e,n){return c.create(n).compute(t,e)},p.PBKDF2)},25:function(t,e,n){var r,o,i,a;t.exports=(a=n(9021),n(7165),o=(r=a).lib.CipherParams,i=r.enc.Hex,r.format.Hex={stringify:function(t){return t.ciphertext.toString(i)},parse:function(t){var e=i.parse(t);return o.create({ciphertext:e})}},a.format.Hex)},34:(t,e,n)=>{"use strict";var r=n(4901);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},81:(t,e,n)=>{"use strict";var r=n(9565),o=n(9306),i=n(8551),a=n(6823),s=n(851),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?s(t):e;if(o(n))return i(r(n,t));throw new l(a(t)+" is not iterable")}},267:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTIuMzYyIiBoZWlnaHQ9IjI5Mi4zNjEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI5Mi4zNjIgMjkyLjM2MSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTI4Ni45MzUgMTk3LjI4NyAxNTkuMDI4IDY5LjM4MWMtMy42MTMtMy42MTctNy44OTUtNS40MjQtMTIuODQ3LTUuNDI0cy05LjIzMyAxLjgwNy0xMi44NSA1LjQyNEw1LjQyNCAxOTcuMjg3QzEuODA3IDIwMC45MDQgMCAyMDUuMTg2IDAgMjEwLjEzNHMxLjgwNyA5LjIzMyA1LjQyNCAxMi44NDdjMy42MjEgMy42MTcgNy45MDIgNS40MjUgMTIuODUgNS40MjVoMjU1LjgxM2M0Ljk0OSAwIDkuMjMzLTEuODA4IDEyLjg0OC01LjQyNSAzLjYxMy0zLjYxMyA1LjQyNy03Ljg5OCA1LjQyNy0xMi44NDdzLTEuODE0LTkuMjMtNS40MjctMTIuODQ3eiIvPjwvc3ZnPg=="},283:(t,e,n)=>{"use strict";var r=n(9504),o=n(9039),i=n(4901),a=n(9297),s=n(3724),l=n(350).CONFIGURABLE,d=n(3706),c=n(1181),p=c.enforce,b=c.get,A=String,g=Object.defineProperty,m=r("".slice),h=r("".replace),u=r([].join),f=s&&!o(function(){return 8!==g(function(){},"length",{value:8}).length}),v=String(String).split("String"),x=t.exports=function(t,e,n){"Symbol("===m(A(e),0,7)&&(e="["+h(A(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(s?g(t,"name",{value:e,configurable:!0}):t.name=e),f&&n&&a(n,"arity")&&t.length!==n.arity&&g(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&g(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=p(t);return a(r,"source")||(r.source=u(v,"string"==typeof e?e:"")),t};Function.prototype.toString=x(function(){return i(this)&&b(this).source||d(this)},"toString")},350:(t,e,n)=>{"use strict";var r=n(3724),o=n(9297),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),l=s&&"something"===function(){}.name,d=s&&(!r||r&&a(i,"name").configurable);t.exports={EXISTS:s,PROPER:l,CONFIGURABLE:d}},397:(t,e,n)=>{"use strict";var r=n(7751);t.exports=r("document","documentElement")},421:t=>{"use strict";t.exports={}},477:()=>{},482:function(t,e,n){var r;t.exports=(r=n(9021),n(7165),r.pad.Iso97971={pad:function(t,e){t.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(t,e)},unpad:function(t){r.pad.ZeroPadding.unpad(t),t.sigBytes--}},r.pad.Iso97971)},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},616:(t,e,n)=>{"use strict";var r=n(9039);t.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},655:(t,e,n)=>{"use strict";var r=n(6955),o=String;t.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},679:(t,e,n)=>{"use strict";var r=n(1625),o=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw new o("Incorrect invocation")}},687:(t,e,n)=>{"use strict";var r=n(4913).f,o=n(9297),i=n(8227)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&r(t,i,{configurable:!0,value:e})}},706:(t,e,n)=>{"use strict";var r=n(350).PROPER,o=n(9039),i=n(7452);t.exports=function(t){return o(function(){return!!i[t]()||"​…᠎"!=="​…᠎"[t]()||r&&i[t].name!==t})}},741:t=>{"use strict";var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},754:function(t,e,n){var r,o,i;t.exports=(r=n(9021),i=(o=r).lib.WordArray,o.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var o=[],i=0;i<n;i+=3)for(var a=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<n;s++)o.push(r.charAt(a>>>6*(3-s)&63));var l=r.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(t){var e=t.lengtLine truncated
//# sourceMappingURL=public.6a37efa8030a7ee0bab7.js.map
@@ -0,0 +1,3 @@
/*! For license information please see vendor.d567be5785f67ef5f74b.js.LICENSE.txt */
(()=>{var t={34:(t,e,i)=>{"use strict";var s=i(4901);t.exports=function(t){return"object"==typeof t?null!==t:s(t)}},283:(t,e,i)=>{"use strict";var s=i(9504),n=i(9039),a=i(4901),r=i(9297),o=i(3724),l=i(350).CONFIGURABLE,c=i(3706),h=i(1181),d=h.enforce,u=h.get,p=String,g=Object.defineProperty,f=s("".slice),m=s("".replace),x=s([].join),b=o&&!n(function(){return 8!==g(function(){},"length",{value:8}).length}),v=String(String).split("String"),y=t.exports=function(t,e,i){"Symbol("===f(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!r(t,"name")||l&&t.name!==e)&&(o?g(t,"name",{value:e,configurable:!0}):t.name=e),b&&i&&r(i,"arity")&&t.length!==i.arity&&g(t,"length",{value:i.arity});try{i&&r(i,"constructor")&&i.constructor?o&&g(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var s=d(t);return r(s,"source")||(s.source=x(v,"string"==typeof e?e:"")),t};Function.prototype.toString=y(function(){return a(this)&&u(this).source||c(this)},"toString")},350:(t,e,i)=>{"use strict";var s=i(3724),n=i(9297),a=Function.prototype,r=s&&Object.getOwnPropertyDescriptor,o=n(a,"name"),l=o&&"something"===function(){}.name,c=o&&(!s||s&&r(a,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},397:(t,e,i)=>{"use strict";var s=i(7751);t.exports=s("document","documentElement")},421:t=>{"use strict";t.exports={}},506:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var s=i(1354),n=i.n(s),a=i(6314),r=i.n(a)()(n());r.push([t.id,":root {\n --swiper-navigation-size: 44px;\n /*\n --swiper-navigation-top-offset: 50%;\n --swiper-navigation-sides-offset: 10px;\n --swiper-navigation-color: var(--swiper-theme-color);\n */\n}\n.swiper-button-prev,\n.swiper-button-next {\n position: absolute;\n top: var(--swiper-navigation-top-offset, 50%);\n width: calc(var(--swiper-navigation-size) / 44 * 27);\n height: var(--swiper-navigation-size);\n margin-top: calc(0px - (var(--swiper-navigation-size) / 2));\n z-index: 10;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--swiper-navigation-color, var(--swiper-theme-color));\n}\n.swiper-button-prev.swiper-button-disabled,\n.swiper-button-next.swiper-button-disabled {\n opacity: 0.35;\n cursor: auto;\n pointer-events: none;\n}\n.swiper-button-prev.swiper-button-hidden,\n.swiper-button-next.swiper-button-hidden {\n opacity: 0;\n cursor: auto;\n pointer-events: none;\n}\n.swiper-navigation-disabled .swiper-button-prev,\n.swiper-navigation-disabled .swiper-button-next {\n display: none !important;\n}\n.swiper-button-prev svg,\n.swiper-button-next svg {\n width: 100%;\n height: 100%;\n object-fit: contain;\n transform-origin: center;\n}\n.swiper-rtl .swiper-button-prev svg,\n.swiper-rtl .swiper-button-next svg {\n transform: rotate(180deg);\n}\n.swiper-button-prev,\n.swiper-rtl .swiper-button-next {\n left: var(--swiper-navigation-sides-offset, 10px);\n right: auto;\n}\n.swiper-button-next,\n.swiper-rtl .swiper-button-prev {\n right: var(--swiper-navigation-sides-offset, 10px);\n left: auto;\n}\n.swiper-button-lock {\n display: none;\n}\n/* Navigation font start */\n.swiper-button-prev:after,\n.swiper-button-next:after {\n font-family: swiper-icons;\n font-size: var(--swiper-navigation-size);\n text-transform: none !important;\n letter-spacing: 0;\n font-variant: initial;\n line-height: 1;\n}\n.swiper-button-prev:after,\n.swiper-rtl .swiper-button-next:after {\n content: 'prev';\n}\n.swiper-button-next,\n.swiper-rtl .swiper-button-prev {\n right: var(--swiper-navigation-sides-offset, 10px);\n left: auto;\n}\n.swiper-button-next:after,\n.swiper-rtl .swiper-button-prev:after {\n content: 'next';\n}\n/* Navigation font end */\n","",{version:3,sources:["webpack://./node_modules/swiper/modules/navigation.css"],names:[],mappings:"AAAA;EACE,8BAA8B;EAC9B;;;;GAIC;AACH;AACA;;EAEE,kBAAkB;EAClB,6CAA6C;EAC7C,oDAAoD;EACpD,qCAAqC;EACrC,2DAA2D;EAC3D,WAAW;EACX,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,gEAAgE;AAClE;AACA;;EAEE,aAAa;EACb,YAAY;EACZ,oBAAoB;AACtB;AACA;;EAEE,UAAU;EACV,YAAY;EACZ,oBAAoB;AACtB;AACA;;EAEE,wBAAwB;AAC1B;AACA;;EAEE,WAAW;EACX,YAAY;EACZ,mBAAmB;EACnB,wBAAwB;AAC1B;AACA;;EAEE,yBAAyB;AAC3B;AACA;;EAEE,iDAAiD;EACjD,WAAW;AACb;AACA;;EAEE,kDAAkD;EAClD,UAAU;AACZ;AACA;EACE,aAAa;AACf;AACA,0BAA0B;AAC1B;;EAEE,yBAAyB;EACzB,wCAAwC;EACxC,+BAA+B;EAC/B,iBAAiB;EACjB,qBAAqB;EACrB,cAAc;AAChB;AACA;;EAEE,eAAe;AACjB;AACA;;EAEE,kDAAkD;EAClD,UAAU;AACZ;AACA;;EAEE,eAAe;AACjB;AACA,wBAAwB",sourcesContent:[":root {\n --swiper-navigation-size: 44px;\n /*\n --swiper-navigation-top-offset: 50%;\n --swiper-navigation-sides-offset: 10px;\n --swiper-navigation-color: var(--swiper-theme-color);\n */\n}\n.swiper-button-prev,\n.swiper-button-next {\n position: absolute;\n top: var(--swiper-navigation-top-offset, 50%);\n width: calc(var(--swiper-navigation-size) / 44 * 27);\n height: var(--swiper-navigation-size);\n margin-top: calc(0px - (var(--swiper-navigatLine truncated
//# sourceMappingURL=vendor.d567be5785f67ef5f74b.js.map
+154
View File
@@ -0,0 +1,154 @@
//
// custom-variables
//
// Vertical menu
$vertical-menu-width: 250px;
$vertical-menu-width-md: 180px;
$vertical-menu-width-sm: 70px;
$vertical-menu-z-index: 1002;
$vertical-menu-item-font-size: 0.9375rem;
$vertical-menu-item-font-family: $font-family-secondary;
$vertical-menu-sub-item-font-family: $font-family-primary;
$vertical-menu-item-padding-x: 1.5rem;
$vertical-menu-item-padding-y: 0.625rem;
$vertical-menu-sub-item-font-size: 0.875rem;
$vertical-menu-item-icon-width: 1.75rem;
$vertical-menu-sub-item-padding-x: 1.5rem;
$vertical-menu-sub-item-padding-y: 0.55rem;
// Light Menu
$vertical-menu-bg: $white;
$vertical-menu-border: $white;
$vertical-menu-item-color: darken($gray-600, 10%);
$vertical-menu-item-bg: rgba($primary, .15);
$vertical-menu-item-hover-color: $primary;
$vertical-menu-item-active-color: $primary;
$vertical-menu-item-active-bg: rgba($primary, .15);
$vertical-menu-sub-item-color: darken($gray-600, 4%);
$vertical-menu-sub-item-hover-color: $primary;
$vertical-menu-sub-item-active-color: $primary;
$vertical-menu-title-color: #919da9;
$vertical-menu-box-shadow: 0 2px 4px rgba(15,34,58,0.12);
$vertical-menu-dropdown-box-shadow: 0 2px 4px rgba(15, 34, 58, 0.12);
//sidebar dark
$dark-vertical-menu-bg: #2e3230;
$dark-vertical-menu-border: #2e3230;
$dark-vertical-menu-item-color: #a4b0bf;
$dark-vertical-menu-item-bg: rgba($white, .15);
$dark-vertical-menu-item-hover-color: $white;
$dark-vertical-menu-item-active-color: $white;
$dark-vertical-menu-item-active-bg: rgba($white, .15);
$dark-vertical-menu-sub-item-color: #a4b0bf;
$dark-vertical-menu-sub-item-hover-color: $white;
$dark-vertical-menu-sub-item-active-color: $white;
$dark-vertical-menu-title-color: #a4b0bf;
$dark-vertical-menu-box-shadow: 0 2px 4px rgba(15,34,58,0.12);
$dark-vertical-menu-dropdown-box-shadow: 0 2px 4px rgba(15,34,58,0.12);
$dark-twocolumn-menu-iconview-bg: darken($dark-vertical-menu-bg, 2%);
//sidebar gradient
$vertical-menu-item-color-gradient: rgba($white, .5);
$vertical-menu-item-bg-gradient: rgba($white, .15);
$vertical-menu-item-hover-color-gradient: $white;
$vertical-menu-item-active-color-gradient: $white;
$vertical-menu-item-active-bg-gradient: rgba($white, .15);
$vertical-menu-sub-item-color-gradient: rgba($white, .5);
$vertical-menu-sub-item-hover-color-gradient: $white;
$vertical-menu-sub-item-active-color-gradient: $white;
$vertical-menu-title-color-gradient: rgba($white, .5);
$vertical-menu-box-shadow-gradient: 0 2px 4px rgba(15,34,58,0.12);
$vertical-menu-dropdown-box-shadow-gradient: 0 2px 4px rgba(15,34,58,0.12);
//gradient one
$vertical-menu-bg-gradient: linear-gradient(to right, var(--#{$prefix}primary), var(--#{$prefix}success));
$vertical-menu-border-gradient: var(--#{$prefix}success);
$twocolumn-menu-iconview-bg-gradient: var(--#{$prefix}primary);
//gradient-2
$vertical-menu-bg-gradient-2: linear-gradient(to right, var(--#{$prefix}info), var(--#{$prefix}secondary));
$vertical-menu-border-gradient-2: var(--#{$prefix}secondary);
$twocolumn-menu-iconview-bg-gradient-2: var(--#{$prefix}info);
//gradient-3
$vertical-menu-bg-gradient-3: linear-gradient(to right, var(--#{$prefix}info), var(--#{$prefix}success));
$vertical-menu-border-gradient-3: var(--#{$prefix}success);
$twocolumn-menu-iconview-bg-gradient-3: var(--#{$prefix}info);
//gradient-4
$vertical-menu-bg-gradient-4: linear-gradient(to right, #1a1d21, var(--#{$prefix}primary));
$vertical-menu-border-gradient-4: var(--#{$prefix}primary);
$twocolumn-menu-iconview-bg-gradient-4: #1a1d21;
// Topbar - (Default Light)
$header-height: 70px;
$header-bg: $white;
$header-border: $border-color;
$header-item-color: $gray-700;
$header-item-bg: rgba($secondary, .12);
$header-item-sub-color: #878a99;
$topbar-user-bg: #f3f3f9;
$topbar-search-bg: #f3f3f9;
$topbar-search-color: #262a2f;
//page title
$page-title-box-shadow: 0 1px 2px rgba(56,65,74,0.15);
$page-title-border: none;
// Topbar - dark
$dark-header-bg: #323835;
$dark-header-border: #323835;
$dark-header-item-color: rgba($white, .85);
$dark-header-item-bg: #3c423f;
$dark-header-item-sub-color: #a4b0bf;
$dark-topbar-user-bg: #39423e;
$dark-topbar-search-bg: rgba($white, .05);
$dark-topbar-search-color: $white;
// Horizontal Menu
$horizontal-menu-box-shadow: 0 2px 4px rgba(15,34,58,0.12);
$horizontal-menu-dropdown-box-shadow: 0 0px 5px rgba(15,34,58,0.15);
$horizontal-menu-dropdown-min-width: 12rem;
$horizontal-menu-item-padding-x: 1.5rem;
$horizontal-menu-item-padding-y: 0.75rem;
$topnav-bg: $white;
$topnav-item-color: darken($gray-600, 10%);
$topnav-item-active-color: $primary;
// Two Column Menu (Default Light)
$twocolumn-menu-iconview-width: 70px;
$twocolumn-menu-width: 220px;
$twocolumn-menu-box-shadow: 0 2px 4px rgba(15,34,58,0.12);
$twocolumn-menu-z-index: 1002;
$twocolumn-menu-iconview-bg: $white;
//semibox layout
$semibox-width: 110px;
// Brand
$navbar-brand-box-width: 240px;
// Boxed layout width
$boxed-layout-width: 1300px;
$boxed-body-bg: darken($body-bg, 4%);
// Footer
$footer-height: 60px;
$footer-bg: $white;
$footer-color: #98a6ad;
// Chat
$chat-primary-bg: var(--#{$prefix}light);
$chat-secondary-bg: rgba(var(--#{$prefix}success-rgb), 0.15);
$chat-secondary-color: var(--#{$prefix}success);
// Timeline
$timeline-color: var(--#{$prefix}secondary-bg);
//auth pages
$auth-bg-cover: linear-gradient(-45deg, $primary 50%, $success);
$input-bg-custom: $body-secondary-bg;
$input-border-custom: $border-color-translucent;
+201
View File
@@ -0,0 +1,201 @@
// Dark color mode variables
//
// Custom variables for the `[data-bs-theme="dark"]` theme. Use this as a starting point for your own custom color modes by creating a new theme-specific file like `_variables-dark.scss` and adding the variables you need.
//
// Global colors
//
$body-bg-dark: #1a1d21;
// scss-docs-start sass-dark-mode-vars
// scss-docs-start theme-text-dark-variables
$primary-text-emphasis-dark: tint-color($primary, 20%);
$secondary-text-emphasis-dark: tint-color($secondary, 20%);
$success-text-emphasis-dark: tint-color($success, 20%);
$info-text-emphasis-dark: tint-color($info, 20%);
$warning-text-emphasis-dark: tint-color($warning, 20%);
$danger-text-emphasis-dark: tint-color($danger, 20%);
$light-text-emphasis-dark: tint-color($body-bg-dark, 25%);
$dark-text-emphasis-dark: tint-color($body-bg-dark, 30%);
// scss-docs-end theme-text-dark-variables
// scss-docs-start theme-bg-subtle-dark-variables
$primary-bg-subtle-dark: rgba($primary, 0.15);
$secondary-bg-subtle-dark: rgba($secondary, 0.15);
$success-bg-subtle-dark: rgba($success, 0.15);
$info-bg-subtle-dark: rgba($info, 0.15);
$warning-bg-subtle-dark: rgba($warning, 0.15);
$danger-bg-subtle-dark: rgba($danger, 0.15);
$light-bg-subtle-dark: tint-color($body-bg-dark, 5%);
$dark-bg-subtle-dark: tint-color($body-bg-dark, 10%);
// scss-docs-end theme-bg-subtle-dark-variables
// scss-docs-start theme-border-subtle-dark-variables
$primary-border-subtle-dark: shade-color($primary, 35%);
$secondary-border-subtle-dark: shade-color($secondary, 50%);
$success-border-subtle-dark: shade-color($success, 50%);
$info-border-subtle-dark: shade-color($info, 50%);
$warning-border-subtle-dark: shade-color($warning, 50%);
$danger-border-subtle-dark: shade-color($danger, 50%);
$light-border-subtle-dark: tint-color($body-bg-dark, 12%);
$dark-border-subtle-dark: tint-color($body-bg-dark, 15%);
// scss-docs-end theme-border-subtle-dark-variables
$body-color-dark: #ced4da;
$body-secondary-color-dark: #878a99;
$body-secondary-bg-dark: #212529;
$body-tertiary-color-dark: rgba($body-color-dark, .75);
$body-tertiary-bg-dark: tint-color($body-bg-dark, 7%);
$body-emphasis-color-dark: $white;
$border-color-dark: #32383e;
$border-color-translucent-dark: #32383e;
$headings-color-dark: #ced4da;
$link-color-dark: tint-color($primary, 80%);
$link-hover-color-dark: shift-color($link-color-dark, -$link-shade-percentage);
$code-color-dark: $code-color;
//custom only default themes colors
$light-dark: tint-color($body-bg-dark, 6%);
$dark-color: tint-color($body-bg-dark, 10%);
$dropdown-bg-dark: #292e33;
$dropdown-link-color-dark: #adb5bd;
$dropdown-link-hover-color-dark: #b9bfc4;
$dropdown-link-hover-bg-dark: #2f343a;
$dropdown-link-hover-bg-dark: #2f343a;
$dropdown-border-width-dark: 1px;
$dropdown-link-active-color-dark: #adb5bd;
$dropdown-link-active-bg-dark: #2f343a;
$input-bg-custom-dark: #262a2f;
$input-border-custom-dark: #2a2f34;
//
// Forms
//
$form-select-indicator-color-dark: $body-color-dark;
$form-select-indicator-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='#{$form-select-indicator-color-dark}' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/></svg>");
$form-switch-color-dark: rgba($white, .25);
$form-switch-bg-image-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#{$form-switch-color-dark}'/></svg>");
// scss-docs-start form-validation-colors-dark
$form-valid-color-dark: $green-400;
$form-valid-border-color-dark: $green-400;
$form-invalid-color-dark: $red-400;
$form-invalid-border-color-dark: $red-400;
// scss-docs-end form-validation-colors-dark
//
// Accordion
//
$accordion-icon-color-dark: $primary-text-emphasis-dark;
$accordion-icon-active-color-dark: $primary-text-emphasis-dark;
$accordion-button-icon-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='#{$accordion-icon-color-dark}'><path fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>");
$accordion-button-active-icon-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='#{$accordion-icon-active-color-dark}'><path fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>");
// scss-docs-end sass-dark-mode-vars
/*********************variables-custom dark Mode***************************/
// Horizontal Menu
$topnav-bg-dark: #272b30;
$topnav-item-color-dark: #878a99;
$topnav-item-active-color-dark: $white;
// Topbar
$header-bg-dark: #292e32;
$header-border-dark: #292e32;
$header-item-color-dark: #e9ecef;
$header-item-bg-dark: #31363c;
$header-item-sub-color-dark: #878a99;
$topbar-user-bg-dark: #31373c;
$topbar-search-bg-dark: #202328;
$topbar-search-color-dark: $white;
//page-title
$page-title-border-dark: transparent;
$page-title-box-shadow-dark: 0 1px 2px rgba(56,65,74,0.15);
// Topbar - dark
$dark-header-bg-dark: #212529;
$dark-header-border-dark: #212529;
$dark-header-item-color-dark: rgba($white, .85);
$dark-header-item-bg-dark: #363b42;
$dark-header-item-sub-color-dark: #89929b;
$dark-topbar-user-bg-dark: #2f343a;
$dark-topbar-search-bg-dark: rgba($white, .05);
$dark-topbar-search-color-dark: $white;
//two column
$twocolumn-menu-box-shadow-dark: 0 2px 4px rgba(15,34,58,0.12);
// boxed
$boxed-body-bg-dark: darken($body-bg-dark, 4%);
// Footer
$footer-bg-dark: #212529;
$footer-color-dark: #878a99;
//sidebar light
$vertical-menu-bg-dark: $white;
$vertical-menu-border-dark: $white;
$vertical-menu-item-color-dark: darken($gray-600, 10%);
$vertical-menu-item-bg-dark: rgba($primary, .15);
$vertical-menu-item-hover-color-dark: $primary;
$vertical-menu-item-active-color-dark: $primary;
$vertical-menu-item-active-bg-dark: rgba($primary, .15);
$vertical-menu-sub-item-color-dark: darken($gray-600, 4%);
$vertical-menu-sub-item-hover-color-dark: $primary;
$vertical-menu-sub-item-active-color-dark: $primary;
$vertical-menu-title-color-dark: #919da9;
//sidebar dark
$dark-vertical-menu-bg-dark: #24292d;
$dark-vertical-menu-border-dark: #24292d;
$dark-vertical-menu-item-color-dark: #89929b;
$dark-vertical-menu-item-bg-dark: rgba($white, .15);
$dark-vertical-menu-item-hover-color-dark: $white;
$dark-vertical-menu-item-active-color-dark: $white;
$dark-vertical-menu-item-active-bg-dark: rgba($white, .15);
$dark-vertical-menu-sub-item-color-dark: #89929b;
$dark-vertical-menu-sub-item-hover-color-dark: $white;
$dark-vertical-menu-sub-item-active-color-dark: $white;
$dark-vertical-menu-title-color-dark: #89929b;
$dark-twocolumn-menu-iconview-bg-dark: darken($dark-vertical-menu-bg-dark, 2%);
//sidebar gradient
$vertical-menu-item-color-gradient-dark: rgba($white, .5);
$vertical-menu-item-bg-gradient-dark: rgba($white, .15);
$vertical-menu-item-hover-color-gradient-dark: $white;
$vertical-menu-item-active-color-gradient-dark: $white;
$vertical-menu-item-active-bg-gradient-dark: rgba($white, .15);
$vertical-menu-sub-item-color-gradient-dark: rgba($white, .5);
$vertical-menu-sub-item-hover-color-gradient-dark: $white;
$vertical-menu-sub-item-active-color-gradient-dark: $white;
$vertical-menu-title-color-gradient-dark: rgba($white, .5);
//gradient one
$vertical-menu-bg-gradient-dark: linear-gradient(to right, var(--#{$prefix}primary), var(--#{$prefix}success));
$vertical-menu-border-gradient-dark: var(--#{$prefix}success);
$twocolumn-menu-iconview-bg-gradient-dark: var(--#{$prefix}primary);
//gradient-2
$vertical-menu-bg-gradient-2-dark: linear-gradient(to right, var(--#{$prefix}info), var(--#{$prefix}secondary));
$vertical-menu-border-gradient-2-dark: var(--#{$prefix}secondary);
$twocolumn-menu-iconview-bg-gradient-2-dark: var(--#{$prefix}info);
//gradient-3
$vertical-menu-bg-gradient-3-dark: linear-gradient(to right, var(--#{$prefix}info), var(--#{$prefix}success));
$vertical-menu-border-gradient-3-dark: var(--#{$prefix}success);
$twocolumn-menu-iconview-bg-gradient-3-dark: var(--#{$prefix}info);
//gradient-4
$vertical-menu-bg-gradient-4-dark: linear-gradient(to right, #1a1d21, var(--#{$prefix}primary));
$vertical-menu-border-gradient-4-dark: var(--#{$prefix}primary);
$twocolumn-menu-iconview-bg-gradient-4-dark: #1a1d21;
+226
View File
@@ -0,0 +1,226 @@
// Dark color mode variables
//
// Custom variables for the `[data-bs-theme="dark"]` theme. Use this as a starting point for your own custom color modes by creating a new theme-specific file like `_variables-galaxy-dark.scss` and adding the variables you need.
//
// Global colors
//
$body-bg-galaxy-dark: #041324;
$card-bg-fill-dark: transparent;
$body-bg-image-1-dark: url('../images/galaxy/img-1.png');
$body-bg-image-2-dark: url('../images/galaxy/img-2.png');
$body-bg-image-3-dark: url('../images/galaxy/img-3.png');
[data-theme=galaxy][data-bs-theme=dark]:root {
$theme-colors-text-galaxy-dark: (
"primary": tint-color($primary, 20%),
"secondary": tint-color($secondary, 20%),
"success": tint-color($success, 20%),
"info": tint-color($info, 20%),
"warning": tint-color($warning, 20%),
"danger": tint-color($danger, 20%),
"light": tint-color($body-bg-galaxy-dark, 25%),
"dark": tint-color($body-bg-galaxy-dark, 30%),
);
// scss-docs-end theme-text-dark-map
// scss-docs-start theme-bg-subtle-dark-map
$theme-colors-bg-subtle-galaxy-dark: (
"primary": rgba($primary, 0.15),
"secondary": rgba($secondary, 0.15),
"success": rgba($success, 0.15),
"info": rgba($info, 0.15),
"warning": rgba($warning, 0.15),
"danger": rgba($danger, 0.15),
"light": tint-color($body-bg-galaxy-dark, 5%),
"dark": tint-color($body-bg-galaxy-dark, 10%),
);
// scss-docs-end theme-bg-subtle-galaxy-dark-map
// scss-docs-start theme-border-subtle-galaxy-dark-map
$theme-colors-border-subtle-galaxy-dark: (
"primary": shade-color($primary, 35%),
"secondary": shade-color($secondary, 50%),
"success": shade-color($success, 50%),
"info": shade-color($info, 50%),
"warning": shade-color($warning, 50%),
"danger": shade-color($danger, 50%),
"light": tint-color($body-bg-galaxy-dark, 12%),
"dark": tint-color($body-bg-galaxy-dark, 15%),
);
@each $color,
$value in $theme-colors-text-galaxy-dark {
--#{$prefix}#{$color}-text-emphasis: #{$value};
}
@each $color,
$value in $theme-colors-bg-subtle-galaxy-dark {
--#{$prefix}#{$color}-bg-subtle: #{$value};
}
@each $color,
$value in $theme-colors-border-subtle-galaxy-dark {
--#{$prefix}#{$color}-border-subtle: #{$value};
}
--#{$prefix}body-color: #ced4da;
--#{$prefix}body-color-rgb: #{to-rgb(#ced4da)};
--#{$prefix}body-bg: #{$body-bg-galaxy-dark};
--#{$prefix}body-bg-rgb: #{to-rgb($body-bg-galaxy-dark)};
--#{$prefix}emphasis-color: #{$body-emphasis-color-dark};
--#{$prefix}emphasis-color-rgb: #{to-rgb($body-emphasis-color-dark)};
--#{$prefix}secondary-color: #{#878a99};
--#{$prefix}secondary-color-rgb: #{to-rgb(#878a99)};
--#{$prefix}secondary-bg: #05192f;
--#{$prefix}secondary-bg-rgb: #{to-rgb(#05192f)};
--#{$prefix}tertiary-color: #{#a6afb8};
--#{$prefix}tertiary-color-rgb: #{to-rgb(#a6afb8)};
--#{$prefix}tertiary-bg: #{#061f3b};
--#{$prefix}tertiary-bg-rgb: #{to-rgb(#061f3b)};
--#{$prefix}link-color: #{tint-color($primary, 80%)};
--#{$prefix}link-hover-color: #{shift-color($link-color-dark, -$link-shade-percentage)};
--#{$prefix}link-color-rgb: #{tint-color($primary, 80%)};
--#{$prefix}link-hover-color-rgb: #{shift-color($link-color-dark, -$link-shade-percentage)};
//border-color
--#{$prefix}border-color: #{#2a4562};
--#{$prefix}border-color-translucent: #{#2a4562};
--#{$prefix}light: #{#061e39};
--#{$prefix}light-rgb: #{to-rgb(#061e39)};
--#{$prefix}light-text-emphasis: #{tint-color($body-bg-galaxy-dark, 25%)};
--#{$prefix}light-bg-subtle: #{tint-color($body-bg-galaxy-dark, 5%)};
--#{$prefix}light-border-subtle: #{tint-color($body-bg-galaxy-dark, 12%)};
--#{$prefix}dark: #{tint-color($body-bg-galaxy-dark, 10%)};
--#{$prefix}dark-rgb: #{to-rgb(tint-color($body-bg-galaxy-dark, 10%))};
--#{$prefix}dark-text-emphasis: #{tint-color($body-bg-galaxy-dark, 30%)};
--#{$prefix}dark-bg-subtle: #{tint-color($body-bg-galaxy-dark, 10%)};
--#{$prefix}dark-border-subtle: #{tint-color($body-bg-galaxy-dark, 15%)};
--#{$prefix}code-color: #{$code-color-dark};
@if $headings-color-dark !=null {
--#{$prefix}heading-color: #{#ced4da};
}
--#{$prefix}form-valid-color: #{$form-valid-color-dark};
--#{$prefix}form-valid-border-color: #{$form-valid-border-color-dark};
--#{$prefix}form-invalid-color: #{$form-invalid-color-dark};
--#{$prefix}form-invalid-border-color: #{$form-invalid-border-color-dark};
// card
--#{$prefix}card-logo-dark: none;
--#{$prefix}card-logo-light: block;
//footer
--#{$prefix}footer-bg: #{$footer-bg-dark};
--#{$prefix}footer-color: #{$footer-color-dark};
.table-light {
--#{$prefix}table-color: #{lighten($light-dark, 100%)};
--#{$prefix}table-bg: var(--#{$prefix}light);
--#{$prefix}table-border-color: var(--#{$prefix}border-color);
--#{$prefix}table-striped-bg: var(--#{$prefix}light);
--#{$prefix}table-striped-color: #{lighten($light-dark, 100%)};
--#{$prefix}table-active-bg: var(--#{$prefix}light);
--#{$prefix}table-active-color: #{lighten($light-dark, 100%)};
--#{$prefix}table-hover-bg: var(--#{$prefix}light);
--#{$prefix}table-hover-color: #{lighten($light-dark, 100%)};
}
.btn-light,
.btn-outline-light {
--#{$prefix}btn-color: #{tint-color($body-bg-galaxy-dark, 60%)};
--#{$prefix}btn-active-color: #{$white};
--#{$prefix}btn-hover-color: #{$white};
}
.btn-outline-dark,
.btn-subtle-dark {
--#{$prefix}btn-color: #{$white};
}
--#{$prefix}vertical-menu-bg: #{$white};
--#{$prefix}vertical-menu-border: #{$white};
--#{$prefix}vertical-menu-item-color: #{darken($gray-600, 10%)};
--#{$prefix}vertical-menu-item-bg: #{rgba(var(--#{$prefix}primary-rgb), .15)};
--#{$prefix}vertical-menu-item-hover-color: var(--#{$prefix}primary);
--#{$prefix}vertical-menu-item-active-color: var(--#{$prefix}primary);
--#{$prefix}vertical-menu-item-active-bg: #{rgba(var(--#{$prefix}primary-rgb), .15)};
--#{$prefix}vertical-menu-sub-item-color: #{darken($gray-600, 4%)};
--#{$prefix}vertical-menu-sub-item-hover-color: var(--#{$prefix}primary);
--#{$prefix}vertical-menu-sub-item-active-color: var(--#{$prefix}primary);
--#{$prefix}vertical-menu-title-color: #919da9;
--#{$prefix}vertical-menu-box-shadow: 0 2px 4px rgba(15, 34, 58, 0.12);
--#{$prefix}vertical-menu-dropdown-box-shadow: 0 2px 4px rgba(15, 34, 58, 0.12);
--#{$prefix}twocolumn-menu-iconview-bg: #{$white};
&[data-sidebar="dark"] {
//vertical dark
--#{$prefix}vertical-menu-bg: transparent;
--#{$prefix}vertical-menu-border: #2a4562;
--#{$prefix}vertical-menu-item-color: #A4AAC7;
--#{$prefix}vertical-menu-item-bg: #{rgba($white, .15)};
--#{$prefix}vertical-menu-item-hover-color: #{$white};
--#{$prefix}vertical-menu-item-active-color: #{$white};
--#{$prefix}vertical-menu-item-active-bg: #{rgba($white, .15)};
--#{$prefix}vertical-menu-sub-item-color: #9ba5af;
--#{$prefix}vertical-menu-sub-item-hover-color: #{$white};
--#{$prefix}vertical-menu-sub-item-active-color: #{$white};
--#{$prefix}vertical-menu-title-color: #798694;
--#{$prefix}twocolumn-menu-iconview-bg: rgba(6, 30, 57, 0.3);
--#{$prefix}vertical-menu-box-shadow: 0 2px 4px rgba(15, 34, 58, 0.12);
--#{$prefix}vertical-menu-dropdown-box-shadow: 0 2px 4px rgba(15, 34, 58, 0.12);
}
// Topbar - (Default Light)
--#{$prefix}header-bg: transparent;
--#{$prefix}header-border: #2a4562;
--#{$prefix}header-item-color: #e9ecef;
--#{$prefix}header-item-bg: #092748;
--#{$prefix}header-item-sub-color: #878a99;
--#{$prefix}topbar-search-bg: #{rgba(6, 21, 40, 0.80)};
--#{$prefix}topbar-user-bg: transparent;
--#{$prefix}topbar-search-color: #{$white};
// Topbar - Dark
&[data-topbar="dark"] {
--#{$prefix}header-bg: #8c68cd;
--#{$prefix}header-border: #8c68cd;
--#{$prefix}header-item-color: #{rgba($white, .85)};
--#{$prefix}header-item-bg: #966de1;
--#{$prefix}header-item-sub-color: #e2c4ff;
--#{$prefix}topbar-user-bg: #7958b5;
--#{$prefix}topbar-search-bg: #{rgba($white, .05)};
--#{$prefix}topbar-search-color: #{$white};
}
--#{$prefix}page-title-box-shadow: none;
--#{$prefix}page-title-border: #2a4562;
--#{$prefix}footer-bg: #transparent;
--#{$prefix}footer-color: #{#a6afb8};
//form
--#{$prefix}input-bg-custom: transparent;
--#{$prefix}input-border-custom: var(--#{$prefix}border-color);
.dropdown-menu {
--#{$prefix}dropdown-bg: #05192f;
--#{$prefix}dropdown-link-color: #a6afb8;
--#{$prefix}dropdown-link-hover-color: #b9bfc4;
--#{$prefix}dropdown-link-hover-bg: #061f3b;
--#{$prefix}dropdown-border-width: 1px;
--#{$prefix}dropdown-link-active-color: #a6afb8;
--#{$prefix}dropdown-link-active-bg: #061f3b;
}
}
+1788
View File
File diff suppressed because it is too large. Load diff
+122
View File
@@ -0,0 +1,122 @@
/*
Template Name: BitReport CRM Dashboard
Author: BitReport (Pedro Alves)
Website: https://bitreport.pt/
Contact: [email protected]
File: Main Css File
*/
//Fonts
@import "fonts/fonts";
//Core files
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "variables";
@import "variables-custom";
@import "variables-dark";
@import "bootstrap/scss/mixins";
// Structure
@import "structure/topbar";
@import "structure/page-head";
@import "structure/footer";
@import "structure/vertical";
@import "structure/horizontal";
@import "structure/two-column";
@import "structure/layouts";
// Components
@import "components/waves";
@import "components/avatar";
@import "components/accordion";
@import "components/helper";
@import "components/preloader";
@import "components/forms";
@import "components/widgets";
@import "components/demos";
@import "components/print";
@import "components/ribbons";
@import "components/toast";
@import "components/scrollspy";
// Bootstrap components
@import "components/root";
@import "components/reboot";
@import "components/alerts";
@import "components/badge";
@import "components/buttons";
@import "components/breadcrumb";
@import "components/card";
@import "components/dropdown";
@import "components/nav";
@import "components/table";
@import "components/modal";
@import "components/pagination";
@import "components/progress";
@import "components/popover";
@import "components/type";
@import "components/form-check";
@import "components/form-control";
@import "components/list-group";
// Plugins
@import "plugins/custom-scrollbar";
@import "plugins/prismjs";
@import "plugins/sweetalert2";
@import "plugins/dropzone";
@import "plugins/range-slider";
@import "plugins/sortablejs";
@import "plugins/tour";
@import "plugins/swiper";
@import "plugins/multijs";
@import "plugins/colorpicker";
@import "plugins/filepond";
@import "plugins/form-input-spin";
@import "plugins/ckeditor";
@import "plugins/quilljs";
@import "plugins/gridjs";
@import "plugins/listjs";
@import "plugins/apexcharts";
@import "plugins/chartjs";
@import "plugins/echarts";
@import "plugins/google-map";
@import "plugins/autocomplete";
@import "plugins/vector-maps";
@import "plugins/leaflet-maps";
@import "plugins/fullcalendar";
@import "plugins/emoji-picker";
@import "plugins/datatables";
@import "plugins/select2";
// Plugins
@import "plugins/toastify";
@import "plugins/choices";
@import "plugins/flatpicker";
@import "plugins/flag-input";
// Pages
@import "pages/authentication";
@import "pages/dashboard";
@import "pages/timeline";
@import "pages/gallery";
@import "pages/errors";
@import "pages/profile";
@import "pages/sitemap";
@import "pages/team";
@import "pages/coming-soon";
@import "pages/search-results";
@import "pages/ecommerce";
@import "pages/invoice";
@import "pages/chat";
@import "pages/email";
@import "pages/kanban";
@import "pages/landing";
@import "pages/nft-landing";
@import "pages/file-manager";
@import "pages/to-do";
@import "pages/jobs";
@import "pages/job-landing";
@import "pages/blog";
+17
View File
@@ -0,0 +1,17 @@
/*
Template Name: BitReport CRM Dashboard
Author: BitReport (Pedro Alves)
Website: https://bitreport.pt/
Contact: [email protected]
File: Custom Bootstrap Css File
*/
//Core files
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "variables";
@import "variables-dark";
@import "components/utilities";
@import "node_modules/bootstrap/scss/bootstrap";
+169
View File
@@ -0,0 +1,169 @@
//
// accordion.scss
//
.accordion {
.accordion-button {
font-weight: $font-weight-medium;
}
.accordion-body {
color: var(--#{$prefix}secondary-color);
}
&.accordion-icon-none {
.accordion-button {
&::after {
content: "";
background-image: none !important;
}
&:not(.collapsed) {
&::after {
content: "";
}
}
}
}
}
// Accordion with icon
.custom-accordionwithicon {
.accordion-button {
&::after {
background-image: none !important;
font-family: "Material Design Icons";
content: "\F0142";
font-size: 1.1rem;
vertical-align: middle;
line-height: 0.8;
}
&:not(.collapsed) {
&::after {
background-image: none !important;
content: "\F0140";
margin-right: -3px;
}
}
}
}
// Accordion with plus icon
.custom-accordionwithicon-plus {
.accordion-button {
&::after {
background-image: none !important;
font-family: "Material Design Icons";
content: "\F0415";
font-size: 1.1rem;
vertical-align: middle;
line-height: 0.8;
}
&:not(.collapsed) {
&::after {
background-image: none !important;
content: "\F0374";
margin-right: -3px;
}
}
}
}
// left Icon accordion
.lefticon-accordion {
.accordion-button {
padding-left: 2.75rem;
&::after {
position: absolute;
left: $accordion-button-padding-x;
top: 14px;
}
&:not(.collapsed) {
&::after {
top: 20px;
}
}
}
}
// border accordion
.accordion-border-box {
.accordion-item {
border-top: $accordion-border-width solid $accordion-border-color;
border-radius: $accordion-border-radius;
&:not(:first-of-type) {
margin-top: 8px;
}
.accordion-button {
border-radius: $accordion-border-radius;
&:not(.collapsed) {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}
}
}
.custom-accordion-border {
.accordion-item {
border-left: 3px solid $accordion-border-color;
}
}
//accordion Color
@each $color,
$value in $theme-colors {
.accordion-#{$color} {
.accordion-item {
border-color: rgba($value, 0.6);
.accordion-button {
box-shadow: none;
&:not(.collapsed) {
color: $value;
background-color: rgba($value, 0.1) !important;
}
&::after {
color: $value;
}
}
}
}
.accordion-fill-#{$color} {
.accordion-item {
.accordion-button {
box-shadow: none;
&:not(.collapsed) {
color: $white;
background-color: $value !important;
}
}
}
}
}
// rtl
[dir="rtl"]{
.custom-accordionwithicon {
.accordion-button::after{
transform: rotate(180deg);
}
}
}
+160
View File
@@ -0,0 +1,160 @@
//
// alerts.scss
//
// alert-label-icon
.alert-label-icon {
position: relative;
padding-left: 60px;
border: 0;
.label-icon {
position: absolute;
width: 45px;
height: 100%;
left: 0;
top: 0;
background-color: rgba($white, 0.15);
font-size: 16px;
display: flex;
align-items: center;
justify-content: center;
}
// label arrow
&.label-arrow {
overflow: hidden;
.label-icon {
&:after {
content: "";
position: absolute;
border: 6px solid transparent;
border-left-color: $primary;
right: -12px;
}
}
}
}
// Alert border left example
.alert-border-left {
border-left: 3px solid;
}
// alert top border example
.alert-top-border {
background-color: var(--#{$prefix}secondary-bg);
border-color: var(--#{$prefix}border-color);
border-top: 2px solid;
color: var(--#{$prefix}body-color);
}
//alert additional example
.alert-additional {
padding: 0;
.alert-body{
padding: $alert-padding-y $alert-padding-x;
}
.alert-content {
padding: $alert-padding-y $alert-padding-x;
border-bottom-left-radius: $alert-border-radius;
border-bottom-right-radius: $alert-border-radius;
margin: 0 (-$alert-border-width) (-$alert-border-width) (-$alert-border-width);
}
}
// rounded label example
.rounded-label {
.label-icon {
width: 45px;
height: 26px;
left: 0px;
top: 50%;
transform: translateY(-50%);
border-radius: 0 30px 30px 0;
}
}
// Alert example loop
@each $color, $value in $theme-colors {
// alert border left
.alert-border-left {
&.alert-#{$color} {
border-left-color: var(--#{$prefix}#{$color});
}
}
// alert top border
.alert-top-border {
&.alert-#{$color} {
border-top-color: var(--#{$prefix}#{$color});
}
}
// rounded label
.rounded-label {
&.alert-#{$color} {
.label-icon {
background-color: var(--#{$prefix}#{$color});
color: color-contrast($value);
}
}
}
// label arrow
.label-arrow {
&.alert-#{$color} {
.label-icon {
color: color-contrast($value);
background-color: var(--#{$prefix}#{$color});
&:after {
border-left-color: var(--#{$prefix}#{$color}) !important;
}
}
}
}
.alert{
&.alert-#{$color} {
.btn-close::after{
color: var(--#{$prefix}#{$color});
}
}
}
//alert additional example
.alert-additional {
&.alert-#{$color} {
.alert-content {
background-color: var(--#{$prefix}#{$color});
color: color-contrast($value);
}
}
}
}
.alert-dismissible {
.btn-close {
background: transparent !important;
&::after {
background: transparent !important;
content: "\F0156" !important;
font-size: 18px;
line-height:15px;
font-family: "Material Design Icons" !important;
}
}
}
+64
View File
@@ -0,0 +1,64 @@
//
// avatar.scss
//
.avatar-xxs {
height: 1.5rem;
width: 1.5rem;
}
.avatar-xs {
height: 2rem;
width: 2rem;
}
.avatar-sm {
height: 3rem;
width: 3rem;
}
.avatar-md {
height: 4.5rem;
width: 4.5rem;
}
.avatar-lg {
height: 6rem;
width: 6rem;
}
.avatar-xl {
height: 7.5rem;
width: 7.5rem;
}
.avatar-title {
align-items: center;
background-color: $primary;
color: $white;
display: flex;
font-weight: $font-weight-medium;
height: 100%;
justify-content: center;
width: 100%;
}
// avatar group
.avatar-group {
padding-left: 12px;
display: flex;
flex-wrap: wrap;
.avatar-group-item {
margin-left: -12px;
border: 2px solid var(--#{$prefix}secondary-bg);
border-radius: 50%;
transition: all 0.2s;
&:hover {
position: relative;
transform: translateY(-2px);
z-index: 1;
}
}
}
+59
View File
@@ -0,0 +1,59 @@
//
// badge.scss
//
.badge {
line-height: 0.95;
}
@each $color, $value in $theme-colors {
.badge-label {
&.bg-#{$color} {
&:before {
border-right-color: $value;
}
}
}
}
// badge-border
.badge-border {
border-left: 2px solid;
}
// badge-label
.badge-label {
margin-left: 8px;
position: relative;
&:before {
content: "";
position: absolute;
border: 8px solid transparent;
border-right-color: $primary;
left: -14px;
top: 0;
}
}
//Badge Gradient Style
$gradients: ();
$gradients: map-merge((primary: linear-gradient(135deg, $primary 0%, $success 100%),
secondary: linear-gradient(135deg, $secondary 0%, $info 100%),
success: linear-gradient(135deg, $success 0%, $warning 100%),
danger: linear-gradient(135deg, $danger 0%, $secondary 100%),
warning: linear-gradient(135deg, $warning 0%, darken($warning, 15%) 100%),
info: linear-gradient(135deg, $info 0%, $success 100%),
dark: linear-gradient(135deg, $dark 0%, $primary 100%)),
$gradients);
@mixin badge-gradient($parent, $gradient) {
#{$parent} {
background: $gradient;
}
}
@each $gradient,
$value in $gradients {
@include badge-gradient(".badge-gradient-#{$gradient}", $value);
}
+19
View File
@@ -0,0 +1,19 @@
//
// breadcrumb.scss
//
// Breadcrumb item arrow
.breadcrumb-item {
> a {
color: var(--#{$prefix}body-color);
}
+.breadcrumb-item {
&::before {
font-family: "Material Design Icons";
font-size: 15px;
line-height: 20px;
}
}
}
+254
View File
@@ -0,0 +1,254 @@
//
// _buttons.scss
//
button,
a {
outline: none !important;
}
.btn {
box-shadow: $element-shadow;
}
:is(.btn.show, .btn:first-child:active, :not(.btn-check)+.btn:active) {
border-color: transparent;
}
.btn-icon {
position: relative;
display: inline-flex;
justify-content: center;
align-items: center;
height: calc(#{$btn-padding-y * 2} + #{$btn-line-height}em + #{$border-width * 2});
width: calc(#{$btn-padding-y * 2} + #{$btn-line-height}em + #{$border-width * 2});
padding: 0;
:is(i, svg, img) {
vertical-align: middle;
}
&.btn-sm {
height: calc(#{$btn-padding-y-sm * 2} + #{$btn-line-height}em + #{$border-width * 2});
width: calc(#{$btn-padding-y-sm * 2} + #{$btn-line-height}em + #{$border-width * 2});
}
&.btn-lg {
height: calc(#{$btn-padding-y-lg * 2} + #{$btn-line-height}em + #{$border-width * 2});
width: calc(#{$btn-padding-y-lg * 2} + #{$btn-line-height}em + #{$border-width * 2});
}
}
//
// Soft Buttons
//
@each $state in map-keys($theme-colors) {
.btn-#{$state} {
--#{$prefix}btn-bg: var(--#{$prefix}#{$state});
--#{$prefix}btn-border-color: var(--#{$prefix}#{$state});
--#{$prefix}btn-hover-bg: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}btn-hover-border-color: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}btn-focus-shadow-rgb: var(--#{$prefix}#{$state}-rgb);
--#{$prefix}btn-active-bg: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}btn-active-border-color: var(--#{$prefix}#{$state}-text-emphasis);
}
.btn-outline-#{$state} {
--#{$prefix}btn-color: var(--#{$prefix}#{$state});
--#{$prefix}btn-bg: transparent;
--#{$prefix}btn-border-color: var(--#{$prefix}#{$state});
--#{$prefix}btn-hover-bg: var(--#{$prefix}#{$state});
--#{$prefix}btn-hover-border-color: var(--#{$prefix}#{$state});
--#{$prefix}btn-focus-shadow-rgb: var(--#{$prefix}#{$state}-rgb);
--#{$prefix}btn-active-bg: var(--#{$prefix}#{$state});
--#{$prefix}btn-active-border-color: var(--#{$prefix}#{$state});
}
// soft Buttons
.btn-soft-#{$state} {
--#{$prefix}btn-color: var(--#{$prefix}#{$state});
--#{$prefix}btn-bg: var(--#{$prefix}#{$state}-bg-subtle);
--#{$prefix}btn-border-color: transparent;
--#{$prefix}btn-hover-bg: var(--#{$prefix}#{$state});
--#{$prefix}btn-hover-border-color: transparent;
--#{$prefix}btn-focus-shadow-rgb: var(--#{$prefix}#{$state}-rgb);
--#{$prefix}btn-active-bg: var(--#{$prefix}#{$state});
--#{$prefix}btn-active-border-color: transparent;
}
// Ghost Buttons
.btn-ghost-#{$state} {
--#{$prefix}btn-color: var(--#{$prefix}#{$state});
--#{$prefix}btn-bg: transparent;
--#{$prefix}btn-border-color: transparent;
--#{$prefix}btn-hover-color: var(--#{$prefix}#{$state});
--#{$prefix}btn-hover-bg: var(--#{$prefix}#{$state}-bg-subtle);
--#{$prefix}btn-hover-border-color: transparent;
--#{$prefix}btn-focus-shadow-rgb: var(--#{$prefix}#{$state}-rgb);
--#{$prefix}btn-active-color: var(--#{$prefix}#{$state});
--#{$prefix}btn-active-bg: var(--#{$prefix}#{$state}-bg-subtle);
--#{$prefix}btn-active-border-color: transparent;
}
}
//button with icon
.btn-label {
position: relative;
padding-left: 44px;
.label-icon {
position: absolute;
width: 35.5px;
left: calc(#{$btn-border-width} * -1);
top: calc(#{$btn-border-width} * -1);
bottom: calc(#{$btn-border-width} * -1);
background-color: rgba($white, 0.1);
font-size: 16px;
display: flex;
align-items: center;
justify-content: center;
}
&.btn-light {
.label-icon {
background-color: rgba($dark, 0.05);
}
}
&.right {
padding-left: $btn-padding-x;
padding-right: 44px;
.label-icon {
right: calc(#{$btn-border-width} * -1);
left: auto;
}
}
}
// Animation Button
.btn-animation {
overflow: hidden;
transition: border-color 0.3s, background-color 0.3s;
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
&::after {
content: attr(data-text);
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: 0;
transform: translate3d(0, 25%, 0);
padding: $btn-padding-y $btn-padding-x;
transition: transform 0.3s, opacity 0.3s;
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
}
>span {
display: block;
transition: transform 0.3s, opacity 0.3s;
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
}
&:hover {
&::after {
opacity: 1;
transform: translate3d(0, 0, 0);
}
>span {
opacity: 0;
transform: translate3d(0, -25%, 0);
}
}
}
@mixin button-variant($bg) {
&.btn-animation {
background-color: $bg;
border-color: $bg !important;
&:is(:hover, :focus, :active, :focus-visible) {
color: $bg;
background-color: rgba($bg, 0.1);
}
}
}
@each $color,
$value in $theme-colors {
.btn-#{$color} {
@include button-variant($value);
}
}
//btn group
.btn-group-vertical {
label {
margin-bottom: 0;
}
}
// btn group radio
.btn-group.radio {
.btn {
border: none;
}
.btn-check:active+.btn-light,
.btn-check:checked+.btn-light,
.btn-light.active,
.btn-light.dropdown-toggle.show,
.btn-light:active {
background-color: rgba($info, 0.2);
color: $info;
}
}
.btn-load {
.spinner-border,
.spinner-grow {
height: 19px;
width: 19px;
}
}
//Border Bottom Buttons Style
@each $color,
$value in $theme-colors {
:is(.btn-#{$color}, .btn-outline-#{$color}, .btn-soft-#{$color}) {
&.btn-border {
border-bottom: 2px solid darken($value, 8%);
}
}
:is(.btn-soft-#{$color}, .btn-outline-#{$color}) {
--#{$prefix}btn-active-color: #{color-contrast($value)};
--#{$prefix}btn-hover-color: #{color-contrast($value)};
}
}
//custom toggle
.custom-toggle {
.icon-off {
display: none;
}
&.active {
.icon-on {
display: none;
}
.icon-off {
display: block;
}
}
}
+153
View File
@@ -0,0 +1,153 @@
//
// _card.scss
//
.card {
margin-bottom: $grid-gutter-width;
box-shadow: $card-box-shadow;
}
.card-header {
border-bottom: 1px solid var(--#{$prefix}border-color);
}
//Card Header Dropdown
.card-header-dropdown {
.dropdown-btn {
padding: $card-cap-padding-y 0;
}
}
.card-footer {
border-top: 1px solid var(--#{$prefix}border-color);
}
.card-title {
font-size: 16px;
margin: 0 0 7px 0;
}
.card-height-100 {
height: calc(100% - #{$grid-gutter-width});
}
.card-animate{
transition: all 0.4s;
&:hover{
transform: translateY(calc(#{-$grid-gutter-width} / 5));
box-shadow: $box-shadow-lg;
}
}
// card color variant
@each $color,
$value in $theme-colors {
.card-#{$color} {
background-color: $value;
color: color-contrast($value);
.card-header, .card-footer {
background-color: rgba($white, 0.1);
color: color-contrast($value);
border-color: transparent;
}
.card-title {
color: color-contrast($value);
}
}
}
@each $color,
$value in $theme-colors {
.card-border-#{$color} {
border-color: $value !important;
.card-header, .card-footer {
border-color: $value;
}
}
}
.card-light{
background-color: var(--#{$prefix}light);
.card-header, .card-footer{
color: var(--#{$prefix}body-color) !important;
background-color: rgba(var(--#{$prefix}dark-rgb), 0.1);
}
.card-title, .card-text {
color: var(--#{$prefix}body-color) !important;
}
}
// Loader
.card-preloader {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(var(--#{$prefix}light-rgb), 0.6);
z-index: 9999;
}
.card-status {
width: 40px;
height: 40px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%)!important;
}
.custom-loader {
animation: spin 2s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg) }
}
.card-overlay{
position: relative;
overflow: hidden;
&:before {
content: "";
background-color: rgba($primary, 0.20);
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
}
:is(.card-header, .card-footer) {
border-color: rgba($white, 0.15) !important;
}
}
.card-toolbar-menu {
line-height: 0.8;
a {
font-size: 17px;
}
.minimize-card {
.plus{
display: none;
}
.minus {
display: block;
}
&.collapsed{
.plus{
display: block;
}
.minus {
display: none;
}
}
}
}
+96
View File
@@ -0,0 +1,96 @@
//
// _demos.scss
//
// Modals
.bs-example-modal {
position: relative;
top: auto;
right: auto;
bottom: auto;
left: auto;
z-index: 1;
display: block;
}
[dir="rtl"] {
.modal-open {
padding-left: 0px !important;
}
}
// Icon demo ( Demo only )
.icon-demo-content {
color: var(--#{$prefix}gray-500);
i {
font-size: 24px;
margin-right: 10px;
color: var(--#{$prefix}gray-600);
transition: all 0.4s;
vertical-align: middle;
}
svg {
margin-right: 10px;
transition: all 0.4s;
height: 20px;
}
.col-lg-4 {
margin-top: 24px;
&:hover {
i, svg {
color: $primary;
transform: scale(1.5);
}
}
}
}
// customizer switch
.img-switch{
.card-radio{
.form-check-input {
display: none;
&:checked+.form-check-label {
&::before{
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba($primary, 0.5);
}
&::after{
content: '\eb80';
font-family: "remixicon";
position: absolute;
top: 50%;
left: 50%;
transform: translateY(-50%) translateX(-50%);
font-size: 18px;
color: $white;
}
}
}
}
}
[data-bs-target="#collapseBgGradient"]{
&.active{
border-color: $primary !important;
&::before{
content: "\eb80";
font-family: remixicon;
position: absolute;
top: 2px;
right: 6px;
font-size: 16px;
color: $primary;
}
}
}
+141
View File
@@ -0,0 +1,141 @@
//
// _dropdown.scss
//
.dropdown-toggle::after {
display: inline-block;
margin-left: .255em;
font-size: 15px;
line-height: 15px;
content: "\F0140";
font-family: "Material Design Icons";
}
.dropdown-menu {
box-shadow: $box-shadow-lg;
animation-name: DropDownSlide;
animation-duration: .3s;
animation-fill-mode: both;
position: absolute;
z-index: 1000;
&.dropdown-megamenu {
padding: 20px;
left: 0 !important;
right: 0 !important;
}
&[data-popper-placement="top-start"] {
animation-name: DropDownSlideDown;
}
}
@keyframes DropDownSlide {
100% {
margin-top: -1px;
}
0% {
margin-top: 8px;
}
}
@keyframes DropDownSlideDown {
100% {
margin-bottom: 0;
}
0% {
margin-bottom: 8px;
}
}
@media (min-width: 600px) {
.dropdown-menu-xl {
width: 420px;
}
.dropdown-menu-lg {
width: 320px;
}
.dropdown-menu-md {
width: 240px;
}
}
.dropdown-toggle-split {
border-left: none;
&::after {
margin-left: 0px;
}
&:before {
content: "";
position: absolute;
background-color: rgba($white,0.12);
top: calc(#{$btn-border-width} * -1);
bottom: calc(#{$btn-border-width} * -1);
right: calc(#{$btn-border-width} * -1);
left: 0;
border-radius: 0 $btn-border-radius $btn-border-radius 0;
}
}
// Dropdown Mega Menu
.dropdown-mega {
position: static !important;
}
// Dropdown size
.dropdown-mega-menu-xl {
width: 38rem;
}
.dropdown-mega-menu-lg {
width: 26rem;
}
[dir="ltr"] {
.dropdown-menu-start {
--#{$prefix}position: end;
}
.dropdown-menu-end {
--#{$prefix}position: start;
}
}
// Custom Dropdown with Tabs
.dropdown-head{
.nav-tabs-custom{
border: 0;
.nav-link {
&::after {
display: none;
}
color: rgba($white, 0.6);
&.active {
background-color: var(--#{$prefix}dropdown-bg);
}
&:hover {
color: $white;
}
}
}
}
@each $color,
$value in $theme-colors {
.dropdownmenu-#{$color} {
.dropdown-item{
&:is(:focus, :hover, .active){
background-color: rgba(($value), 0.07);
color: $value;
}
}
}
}
+317
View File
@@ -0,0 +1,317 @@
//
// _form-check.scss
//
.form-check {
position: relative;
text-align: left
/*rtl: right*/;
.form-check-input {
cursor: pointer;
}
label {
cursor: pointer;
}
}
// checkbox color
@each $color,
$value in $theme-colors {
.form-check-#{$color} {
.form-check-input {
&:checked {
background-color: $value;
border-color: $value;
}
}
}
.form-radio-#{$color} {
.form-check-input {
&:checked {
border-color: $value;
background-color: $value;
&:after {
background-color: $value;
}
}
}
}
}
.form-check-label {
cursor: pointer;
margin-bottom: 0;
}
// checkbox input right
.form-check-right {
padding-left: 0;
display: inline-block;
.form-check-input {
float: right;
margin-left: 0;
margin-right: calc($form-check-padding-start * -1);
}
.form-check-label {
display: block;
}
&.form-switch {
.form-check-input {
margin-right: calc($form-check-padding-start * -1.6);
}
}
}
// Checkbox outline
@each $color,
$value in $theme-colors {
.form-check-outline {
&.form-check-#{$color} {
.form-check-input {
&:checked[type=checkbox] {
color: $value;
background-color: transparent;
border-color: $value;
}
}
}
}
}
.form-check-outline {
.form-check-input {
position: relative;
&:checked[type=checkbox] {
background-image: none;
&::before {
content: "\F012C";
font-family: "Material Design Icons";
top: -2px;
position: absolute;
font-weight: 700;
font-size: 11px;
left: 1px;
}
}
}
}
// Radio
@each $color,
$value in $theme-colors {
.form-radio-outline {
&.form-radio-#{$color} {
.form-check-input {
&:checked[type=radio] {
color: $value;
background-color: transparent;
border-color: $value;
}
}
}
}
}
.form-radio-outline {
.form-check-input {
position: relative;
&:checked[type=radio] {
background-image: none;
&::before {
content: "\F0765";
font-family: "Material Design Icons";
top: 0px;
position: absolute;
font-size: 8px;
left: 2.2px;
}
}
}
}
// Switch sizes
.form-switch-md {
padding-left: 2.5rem;
min-height: 22px;
line-height: 22px;
.form-check-input {
width: 40px;
height: 20px;
left: -0.5rem;
position: relative;
}
.form-check-label {
vertical-align: middle;
}
}
.form-switch-lg {
padding-left: 2.75rem;
min-height: 28px;
line-height: 28px;
.form-check-input {
width: 48px;
height: 24px;
left: -0.75rem;
position: relative;
}
}
.input-group-text {
margin-bottom: 0px;
}
@each $color,
$value in $theme-colors {
.form-switch-#{$color} {
.form-check-input {
&:checked {
background-color: $value;
border-color: $value;
}
}
}
.form-switch-custom {
&.form-switch-#{$color} {
.form-check-input {
&:checked {
&::before {
color: $value;
}
}
}
}
}
}
// Custom Switch style
.form-switch-custom {
.form-check-input {
position: relative;
background-image: none;
&::before {
content: "\F0765";
font-family: "Material Design Icons";
top: -9px;
position: absolute;
font-size: 20px;
left: -3px;
color: var(--#{$prefix}secondary-color);
@include transition($form-switch-transition);
}
&:checked {
background-image: none;
background-color: $form-check-input-bg;
@include transition($form-switch-transition);
&::before {
right: -3px;
left: auto;
}
}
&:focus {
background-image: none;
}
}
}
// Switch - Right
.form-switch-right {
display: inline-block;
padding-right: calc($form-check-padding-start * .5);
margin-bottom: 0;
padding-left: 0 !important;
.form-check-input {
float: right;
margin-left: 0;
margin-right: calc($form-check-padding-start * -1);
margin-top: .1em !important;
}
label {
margin-bottom: 0;
margin-right: 1rem;
}
}
// card radio
.card-radio {
padding: 0;
.form-check-label {
background-color: var(--#{$prefix}secondary-bg);
border: 1px solid var(--#{$prefix}border-color);
border-radius: $border-radius;
padding: 1rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
position: relative;
padding-right: 32px;
&:hover {
cursor: pointer;
}
}
.form-check-input {
display: none;
&:checked+.form-check-label {
border-color: $primary !important;
&:before {
content: '\eb80';
font-family: "remixicon";
position: absolute;
top: 2px;
right: 6px;
font-size: 16px;
color: $primary;
}
}
}
&.dark {
.form-check-input {
&:checked+.form-check-label {
&:before {
color: $white;
}
}
}
}
}
+31
View File
@@ -0,0 +1,31 @@
//
// _form-control.scss
//
.form-icon{
position: relative;
.form-control-icon {
padding-left: calc(#{$input-padding-x} * 3);
position: relative;
}
i {
position: absolute;
top: 0px;
bottom: 0px;
left: 18px;
display: flex;
align-items: center;
}
&.right{
.form-control-icon {
padding-right: calc(#{$input-padding-x} * 3);
padding-left: $input-padding-x;
position: relative;
}
i {
left: auto;
right: 18px;
}
}
}
+9
View File
@@ -0,0 +1,9 @@
//
// forms.scss
//
:is([type="tel"], [type="url"], [type="email"], [type="number"]){
&::placeholder {
text-align: left /*rtl: right*/;
}
}
+275
View File
@@ -0,0 +1,275 @@
//
// _helper.scss
//
// Border Style
$border-style-mixing: double, dashed, groove, outset, ridge, dotted, inset;
@each $border-style-mixing in $border-style-mixing {
.border-#{$border-style-mixing} {
border-style: #{$border-style-mixing} !important;
}
.border-top-#{$border-style-mixing} {
border-top-style: #{$border-style-mixing} !important;
}
.border-bottom-#{$border-style-mixing} {
border-bottom-style: #{$border-style-mixing} !important;
}
.border-end-#{$border-style-mixing} {
border-right-style: #{$border-style-mixing} !important;
}
.border-start-#{$border-style-mixing} {
border-left-style: #{$border-style-mixing} !important;
}
// List Group Flush Style
.list-group-flush {
&.border-#{$border-style-mixing} {
border: none !important;
.list-group-item {
border-style: #{$border-style-mixing} !important;
}
}
}
}
// Font Family
.ff-base {
font-family: $font-family-base;
}
.ff-secondary {
font-family: $font-family-secondary;
}
// Background pattern
.bg-pattern {
background: url("../images/modal-bg.png") $modal-content-bg;
}
// Fixed minimum width
.w-xs {
min-width: 80px;
}
.w-sm {
min-width: 95px;
}
.w-md {
min-width: 110px;
}
.w-lg {
min-width: 140px;
}
.w-xl {
min-width: 160px;
}
// Icons Sizes
.icon-xs {
height: 16px;
width: 16px;
}
.icon-sm {
height: 18px;
width: 18px;
}
.icon-md {
height: 22px;
width: 22px;
}
.icon-lg {
height: 24px;
width: 24px;
}
.icon-xl {
height: 28px;
width: 28px;
}
.icon-xxl {
height: 32px;
width: 32px;
}
// Dual Icons
.icon-dual {
color: $gray-500;
fill: rgba($gray-500,0.16);
}
@each $color,
$value in $theme-colors {
.icon-dual-#{$color} {
color: $value;
fill: rgba($value, 0.16);
}
}
// Search
.search-box{
position: relative;
.form-control{
padding-left: 40px;
}
.search-icon{
font-size: 14px;
position: absolute;
left: 13px;
top: 0;
height: 100%;
display: flex;
align-items: center;
color: var(--#{$prefix}secondary-color);
}
}
// overlay
.bg-overlay {
position: absolute;
height: 100%;
width: 100%;
right: 0;
bottom: 0;
left: 0;
top: 0;
opacity: 0.7;
background-color: $black;
}
// Btn Customizer
.customizer-setting {
position: fixed;
bottom: 40px;
right: 20px;
z-index: 1000;
}
//
code {
user-select: all;
}
.layout-rightside {
width: 280px;
margin-right: calc(#{$grid-gutter-width} * -1);
margin-top: calc(1px - #{$grid-gutter-width} * 1.1);
height: calc(100% + #{$grid-gutter-width} * 1.1);
}
.layout-rightside-col {
@media (max-width: 1699.98px) {
display: none;
position: fixed !important;
height: 100vh;
right: 0px;
top: 0px;
bottom: 0px;
z-index: 1004;
.overlay{
position: fixed;
top: 0;
right: 0px;
bottom: 0px;
left: 0px;
background-color: rgba($dark, 0.2);
}
.layout-rightside {
margin-top: 0px;
height: 100%;
margin-left: auto;
}
.card-body {
overflow-y: auto;
padding-bottom: 1rem !important;
}
}
}
:is([data-layout="horizontal"], [data-layout-style=detached]) {
@media (min-width: 1700px) {
.layout-rightside{
margin-top: calc(28px - #{$grid-gutter-width});
margin-right: 0;
height: calc(100% - calc(#{$grid-gutter-width} * 0.5));
}
}
}
[data-layout="semibox"] {
.layout-rightside {
margin-right: 0px;
}
}
// text-truncate-two-lines
.text-truncate-two-lines{
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
white-space: normal;
}
// Favorite button
.favourite-btn{
border-color: transparent;
.ri-star-fill{
color: var(--#{$prefix}secondary-color);
}
&.active{
border-color: transparent;
.ri-star-fill{
color: $warning;
&:before{
content: "\f186";
}
}
}
}
// card
.card-logo-light{
display: var(--#{$prefix}card-logo-light);
}
.card-logo-dark{
display: var(--#{$prefix}card-logo-dark);
}
#back-to-top {
position: fixed;
bottom: 100px;
right: 28px;
transition: all 0.5s ease;
display: none;
z-index: 1000;
&:hover {
animation: fade-up 1.5s infinite linear;
}
}
@keyframes fade-up {
0% {
transform: translateY(0);
opacity: 1;
}
75% {
transform: translateY(-20px);
opacity: 0;
}
}
+31
View File
@@ -0,0 +1,31 @@
//
// _list-group.scss
//
@each $color,
$value in $theme-colors {
.list-group-fill-#{$color} {
&.list-group-item {
color: color-contrast($value);
background-color: var(--#{$prefix}#{$color}) !important;
border-color: var(--#{$prefix}#{$color});
}
}
}
.list-group-item {
margin-bottom: 0px;
.list-text {
color: var(--#{$prefix}secondary-color);
}
&.active {
box-shadow: $element-shadow;
.list-title {
color: $white;
}
.list-text {
color: rgba($white, 0.50);
}
}
}
+165
View File
@@ -0,0 +1,165 @@
//
// _modal.scss
//
.modal-title {
font-weight: $font-weight-semibold;
}
.modal-dialog:not(.modal-dialog-scrollable) {
.modal-header {
padding-bottom: 0;
.btn-close {
margin-top: -$modal-header-padding;
}
}
.modal-footer {
padding-top: 0;
}
}
.modal {
&.fadeInRight {
.modal-dialog {
opacity: 0;
transform: translateX(20%);
transition: all .3s ease-in-out;
}
&.show {
.modal-dialog {
opacity: 1;
transform: translateX(0);
}
}
}
&.fadeInLeft {
.modal-dialog {
animation: fadeInLeft 0.3s ease-in-out;
transform: translate(-50%, 0);
}
&.show {
.modal-dialog {
transform: none;
}
}
}
&.fadeInUp {
.modal-dialog {
animation: fadeInUp 0.3s ease-in-out;
transform: translate(0, 30%);
}
&.show {
.modal-dialog {
transform: none;
}
}
}
&.flip {
perspective: 1300px;
.modal-dialog {
opacity: 0;
transform: rotateY(-70deg);
transition: all .3s;
}
&.show {
.modal-dialog {
opacity: 1;
transform: rotateY(0deg);
}
}
}
&.zoomIn {
.modal-dialog {
opacity: 0;
transform: scale(.7);
transition: all .3s ease;
}
&.show {
.modal-dialog {
opacity: 1;
transform: scale(1)
}
}
}
}
.modal-dialog-right {
margin-right: $modal-dialog-margin-y-sm-up;
}
// modal-dialog-bottom
.modal-dialog-bottom {
display: flex;
align-items: flex-end;
min-height: calc(100% - #{$modal-dialog-margin-y-sm-up});
@media (min-width: 576px) {
min-height: calc(100% - #{$modal-dialog-margin-y-sm-up* 2 });
}
}
.modal-dialog-bottom-right {
display: flex;
align-items: flex-end;
min-height: calc(100% - #{$modal-dialog-margin-y-sm-up});
margin-right: $modal-dialog-margin-y-sm-up;
@media (min-width: 576px) {
min-height: calc(100% - #{$modal-dialog-margin-y-sm-up*2 });
}
}
@keyframes fadeInLeft {
0% {
opacity: 0;
transform: translate3d(-30%, 0, 0);
}
to {
opacity: 1;
transform: translateZ(0);
}
}
@keyframes fadeInUp {
0% {
opacity: 0;
transform: translate3d(0, 30%, 0);
}
to {
opacity: 1;
transform: translateZ(0);
}
}
@keyframes zoomIn {
0% {
opacity: 0;
transform: scale3d(.3, .3, .3);
}
50% {
opacity: 1
}
}
.login-modal {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' version='1.1' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:svgjs='http://svgjs.com/svgjs' width='1440' height='560' preserveAspectRatio='none' viewBox='0 0 1440 560'%3e%3cg mask='url(%26quot%3b%23SvgjsMask1016%26quot%3b)' fill='none'%3e%3crect width='1440' height='560' x='0' y='0' fill='rgba(64%2c 81%2c 137%2c 1)'%3e%3c/rect%3e%3cpath d='M0%2c650.704C122.328%2c648.746%2c159.175%2c473.043%2c255.674%2c397.837C339.724%2c332.333%2c461.529%2c324.924%2c526.449%2c240.421C598.428%2c146.73%2c655.546%2c24.847%2c631.015%2c-90.726C606.666%2c-205.444%2c482.926%2c-263.497%2c401.565%2c-347.958C325.215%2c-427.217%2c275.543%2c-549.012%2c167.826%2c-571.563C60.344%2c-594.065%2c-27.703%2c-482.932%2c-135.163%2c-460.325C-256.336%2c-434.833%2c-401.929%2c-509.651%2c-497.972%2c-431.495C-592.807%2c-354.321%2c-579.865%2c-206.886%2c-595.603%2c-85.635C-611.133%2c34.016%2c-656.761%2c169.183%2c-588.884%2c268.934C-520.854%2c368.909%2c-362.458%2c340.324%2c-260.989%2c406.106C-158.875%2c472.306%2c-121.679%2c652.651%2c0%2c650.704' fill='%2333416e'%3e%3c/path%3e%3cpath d='M1440 995.672C1519.728 984.741 1563.12 899.779 1626.466 850.1469999999999 1682.6390000000001 806.135 1756.261 782.602 1791.2939999999999 720.431 1827.571 656.052 1835.537 577.6610000000001 1820.814 505.247 1806.518 434.933 1753.2640000000001 383.16999999999996 1710.941 325.228 1664.475 261.614 1634.992 175.16000000000003 1560.657 149.07999999999998 1485.96 122.87299999999999 1402.146 155.543 1332.03 192.289 1269.541 225.038 1232.754 287.251 1189.969 343.347 1149.925 395.849 1115.781 448.9 1089.96 509.672 1056 589.599 988.9680000000001 671.1659999999999 1015.557 753.837 1041.91 835.774 1142.714 863.61 1217.498 906.22 1288.388 946.611 1359.167 1006.755 1440 995.672' fill='%234d61a4'%3e%3c/path%3e%3c/g%3e%3cdefs%3e%3cmask id='SvgjsMask1016'%3e%3crect width='1440' height='560' fill='white'%3e%3c/rect%3e%3c/mask%3e%3c/defs%3e%3c/svg%3e");
background-size: cover;
background-position: center;
}
+578
View File
@@ -0,0 +1,578 @@
//
// _nav.scss
//
:is(.nav-tabs, .nav-pills) {
>li {
>a {
color: var(--#{$prefix}body-color);
font-weight: $font-weight-medium;
}
}
}
.nav-pills {
>a {
color: var(--#{$prefix}body-color);
font-weight: $font-weight-medium;
}
}
.nav-pills {
:is(.nav-link.active, .show>.nav-link) {
box-shadow: $element-shadow;
}
}
.nav-tabs-custom {
border-bottom: 1px solid var(--#{$prefix}border-color);
.nav-item {
position: relative;
.nav-link {
border: none;
font-weight: $font-weight-medium;
&::after {
content: "";
background: $primary;
height: 1px;
position: absolute;
width: 100%;
left: 0;
bottom: 0;
transition: all 250ms ease 0s;
transform: scale(0);
}
&.active {
color: $primary;
&:after {
transform: scale(1);
}
}
}
}
&.card-header-tabs {
margin-top: -1rem;
.nav-link {
padding: $card-cap-padding-y $card-cap-padding-x;
}
}
}
// vertical nav
.vertical-nav {
.nav {
.nav-link {
padding: 24px 16px;
text-align: center;
margin-bottom: 8px;
.nav-icon {
font-size: 24px;
}
}
}
}
//Navtab custom
.navtab-bg {
li {
>a {
background-color: $gray-300;
margin: 0 5px;
}
}
}
// arrow-navtabs
.arrow-navtabs {
.nav-item {
.nav-link {
position: relative;
text-align: center;
&:before {
content: "";
position: absolute;
border: 6px solid transparent;
bottom: -12px;
left: 50%;
transform: translateX(-50%);
@include transition($nav-link-transition);
}
&.active {
&:before {
border-top-color: $primary;
}
}
}
}
}
// custom hover tab
.custom-hover-nav-tabs {
.nav-item {
text-align: center;
overflow: hidden;
.nav-link {
width: 120px;
height: 45px;
position: relative;
border-radius: 0px;
.nav-icon {
font-size: 22px;
}
.nav-titl {
font-size: 14px;
}
&.active {
.nav-tab-position {
color: $white;
}
}
.nav-tab-position {
position: absolute;
left: 0;
right: 0;
transition: all 0.4s;
&.nav-icon {
top: 50%;
transform: translateY(-50%);
}
&.nav-titl {
bottom: -20px;
}
}
&:hover {
.nav-titl {
bottom: 50%;
transform: translateY(50%);
}
.nav-icon {
top: -20px;
}
}
}
}
}
// custom vertical tab
.custom-verti-nav-pills {
.nav-link {
background-color: var(--#{$prefix}light);
margin-top: 7px;
position: relative;
@media (min-width: 992px) {
&::before {
content: "";
position: absolute;
right: -20px;
top: 50%;
transform: translateY(-50%);
border: 12px solid transparent;
border-left-color: transparent;
transition: border-left-color 0.04 ease;
}
&.active {
&::before {
border-left-color: $primary;
}
}
}
}
}
// animation nav
.animation-nav {
li {
position: relative;
a {
color: var(--#{$prefix}body-color);
border-radius: 4px;
position: relative;
overflow: hidden;
transition: all 0.4s;
z-index: 1;
span {
position: relative;
}
&::before {
content: "";
position: absolute;
top: 0;
width: 0;
right: 0;
height: 100%;
transition: width 0.4s cubic-bezier(0.51, 0.18, 0, 0.88) 0.1s;
background-color: $primary;
z-index: -1;
}
&:hover,
&.active {
color: $white;
background-color: transparent !important;
&::before {
width: 100%;
left: 0;
}
}
}
}
}
.nav-border-top {
.nav-link {
border-top: 3px solid transparent;
&.active {
border-top-color: $primary;
}
}
}
@each $color,
$value in $theme-colors {
.nav-border-top-#{$color} {
.nav-link {
&.active {
color: $value;
border-top-color: $value;
}
}
}
}
.nav-custom {
background-color: $primary;
border-radius: $card-border-radius;
.nav-item {
.nav-link {
color: rgba($white, 0.75);
&.active {
color: $white;
background-color: rgba($white, 0.1);
}
}
}
&.nav-custom-light {
.nav-item {
.nav-link {
color: rgba(var(--#{$prefix}body-rgb), 0.75);
&.active {
color: $light;
background-color: $primary;
}
}
}
}
}
@each $color,
$value in $theme-colors {
.nav-custom-#{$color} {
background-color: $value;
}
}
.nav-custom-light {
background-color: var(--#{$prefix}light);
}
@each $color,
$value in $theme-colors {
.nav-#{$color} {
.nav-link {
&.active {
color: $white;
background-color: $value;
}
}
&.nav-tabs {
.nav-link {
&.active {
color: $value;
background-color: var(--#{$prefix}secondary-bg);
}
}
}
&.nav-tabs-custom {
.nav-link {
&.active {
color: $value;
background-color: var(--#{$prefix}secondary-bg);
&::after {
background-color: $value;
}
}
}
}
&.arrow-navtabs {
.nav-link {
&.active {
&::before {
border-top-color: $value;
}
}
}
}
&.custom-verti-nav-pills {
.nav-link {
&.active {
&::before {
border-left-color: $value;
}
}
}
}
}
}
// progress nav
.progress-nav {
position: relative;
margin-right: 1rem;
margin-left: 1rem;
.progress {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 100%;
}
.nav {
margin-right: -1rem;
margin-left: -1rem;
justify-content: space-between;
.nav-link {
width: 2rem;
height: 2rem;
background-color: var(--#{$prefix}light);
padding: 0;
color: var(--#{$prefix}body-color);
font-weight: $font-weight-medium;
&.active,
&.done {
background-color: $primary;
color: $white;
}
}
}
}
// Step arrow nav
.step-arrow-nav {
.nav {
background-color: var(--#{$prefix}light);
.nav-link {
border-radius: 0;
position: relative;
font-weight: $font-weight-medium;
color: var(--#{$prefix}body-color);
&::before {
content: "";
position: absolute;
border: 7px solid transparent;
right: -14px;
top: 50%;
transform: translateY(-50%);
}
&.done {
background-color: rgba($primary, 0.05);
color: $primary;
&::before {
border-left-color: transparent;
}
}
&.active {
background-color: rgba($primary, 0.1);
color: $primary;
box-shadow: none;
&::before {
border-left-color: rgba($primary, 0.1);
}
}
}
.nav-item {
&:last-child {
.nav-link {
&:before {
display: none;
}
}
}
}
}
}
// vertical nav step
.vertical-navs-step {
.nav {
gap: 16px;
.nav-link {
text-align: left;
background-color: rgba(var(--#{$prefix}light-rgb), 0.4);
border: 1px solid var(--#{$prefix}border-color);
color: var(--#{$prefix}body-color);
.step-title {
font-weight: $font-weight-semibold;
}
.step-icon {
color: $danger;
vertical-align: middle;
font-weight: $font-weight-medium;
float: left;
}
&.active,
&.done {
.step-icon {
color: $success;
&:before {
content: "\eb80";
}
}
}
&.active {
border-color: $primary;
}
&.done {
border-color: $success;
}
}
}
}
//Outline Border Nav
.nav-custom-outline {
&.nav {
.nav-link {
border: 1px solid transparent;
border-bottom: 2px solid transparent;
&.active {
border-color: $primary;
background-color: transparent;
color: $primary;
}
}
}
}
@each $color,
$value in $theme-colors {
.nav-#{$color} {
&.nav-custom-outline {
.nav-link {
&.active {
color: $value;
border-color: $value;
}
}
}
}
}
//customs nav
.nav-customs {
&.nav {
padding-left: 34px;
overflow: hidden;
.nav-link {
position: relative;
display: block;
float: right;
background-color: var(--#{$prefix}tertiary-bg);
margin-right: 46px;
transition: all 0.5s ease;
&::before,
&::after {
display: block;
content: " ";
position: absolute;
top: -1px;
bottom: -1px;
width: 37px;
background-color: var(--#{$prefix}tertiary-bg);
transition: all 0.5s ease;
}
&::before {
border-radius: 0 8px 0 0;
right: -24px;
transform: skew(30deg, 0deg);
}
&::after {
border-radius: 8px 0 0 0;
left: -24px;
transform: skew(-30deg, 0deg);
}
&.active,
&.active:before,
&.active:after {
background-color: $primary;
color: $white;
}
&.active {
z-index: 1;
}
}
}
}
+38
View File
@@ -0,0 +1,38 @@
//
// _pagination.scss
//
// Pagination Separated
.pagination-separated {
.page-item {
.page-link {
margin-left: 0.35rem;
border-radius: var(--#{$prefix}border-radius);
}
}
}
// Pagination rounded (Custom)
.pagination-rounded {
.page-link {
border-radius: 30px !important;
margin: 0 3px !important;
border: none;
min-width: 32px;
min-height: 32px;
text-align: center;
}
&.pagination-sm {
.page-link {
min-width: 25px;
min-height: 25px;
}
}
}
.page-item.active {
.page-link{
box-shadow: $element-shadow;
}
}
+7
View File
@@ -0,0 +1,7 @@
//
// _popover.scss
//
.popover {
box-shadow: $popover-box-shadow;
}
+27
View File
@@ -0,0 +1,27 @@
//
// preloader.scss
//
#preloader {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--#{$prefix}secondary-bg);
z-index: 9999;
}
[data-preloader="disable"] #preloader {
opacity: 0;
visibility: hidden;
}
#status {
width: 40px;
height: 40px;
position: absolute;
left: 50%;
top: 50%;
margin: -20px 0 0 -20px;
}
+42
View File
@@ -0,0 +1,42 @@
//
// print.scss
//
// Used invoice page
@media print {
.vertical-menu,
.right-bar,
.page-title-box,
.navbar-header,
.app-menu,
.footer,
#back-to-top {
display: none !important;
}
.card-body,
.main-content,
.right-bar,
.page-content,
body {
padding: 0;
margin: 0;
}
.card{
border: 0;
box-shadow: none !important;
}
.invoice-details{
.d-sm-flex{
display: flex !important;
}
}
.address{
&.col-sm-6 {
flex: 0 0 auto !important;
width: 50% !important;
max-width: 100% !important;
}
}
}
+151
View File
@@ -0,0 +1,151 @@
//
// _progress.scss
//
// Progress height small
.progress-sm {
height: 5px;
}
// Progress height large
.progress-lg {
height: 12px;
}
// Progress height Extra large
.progress-xl {
height: 16px;
}
.custom-progess {
position: relative;
.progress-icon {
position: absolute;
top: -12px;
.avatar-title {
background: var(--#{$prefix}secondary-bg);
}
}
}
// animated-progress
.animated-progress {
position: relative;
.progress-bar {
position: relative;
border-radius: 6px;
animation: animate-positive 2s;
}
}
@keyframes animate-positive {
0% {
width: 0;
}
}
// custom-progress
.custom-progress {
height: 15px;
padding: 4px;
border-radius: 30px;
.progress-bar {
position: relative;
border-radius: 30px;
&::before {
content: "";
position: absolute;
width: 4px;
height: 4px;
background-color: $white;
border-radius: 7px;
right: 2px;
top: 50%;
transform: translateY(-50%);
}
}
}
// progress withlabel
.progress-label {
overflow: visible;
.progress-bar {
position: relative;
overflow: visible;
.label {
position: absolute;
top: -25px;
right: -9px;
background-color: $primary;
color: $white;
display: inline-block;
line-height: 18px;
padding: 0 4px;
border-radius: 4px;
&:after {
content: "";
position: absolute;
border: 4px solid transparent;
border-top-color: $primary;
bottom: -7px;
left: 50%;
transform: translateX(-50%);
}
}
}
}
.progress-step-arrow {
height: 3.25rem;
.progress-bar {
position: relative;
overflow: initial;
font-size: .875rem;
color: $white;
&::after {
content: "";
position: absolute;
border: 10px solid transparent;
bottom: 15px;
right: -20px;
z-index: 1;
}
}
}
@mixin progress-variant($bg) {
.progress-bar {
background-color: $bg;
&::after {
border-left-color: $bg;
}
&:nth-child(2) {
background-color: rgba($bg, 0.1) !important;
color: $bg !important;
&::after {
border-left-color: rgba($bg, 0.1);
}
}
}
}
@each $color, $value in $theme-colors {
.progress-#{$color} {
@include progress-variant($value);
}
}
+63
View File
@@ -0,0 +1,63 @@
//
// reboot.scss
//
html {
position: relative;
min-height: 100%;
}
:is(.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6) {
font-family: $headings-font-family;
}
label {
font-weight: $font-weight-medium;
margin-bottom: $form-label-margin-bottom;
}
b,
strong {
font-weight: $font-weight-semibold;
}
// blockquote
.blockquote {
padding: 10px 20px;
border-left: 4px solid var(--#{$prefix}border-color);
}
.blockquote-reverse {
border-left: 0;
border-right: 4px solid var(--#{$prefix}border-color);
text-align: right;
}
// container
:is(.container,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl) {
@media (min-width: 1200px) {
max-width: 1140px;
}
}
// row
.row>*{
position: relative;
}
+394
View File
@@ -0,0 +1,394 @@
//
// ribbons.scss
//
.ribbon-box {
position: relative;
.ribbon {
padding: 5px 12px;
box-shadow: 2px 5px 10px rgba($dark, 0.15);
color: $white;
font-size: $font-size-base;
font-weight: $font-weight-semibold;
position: absolute;
left: -1px;
top: 5px;
&.round-shape {
border-radius: 0 30px 30px 0;
}
&.ribbon-shape {
display: inline-block;
&::before {
content: "";
position: absolute;
right: -17px;
top: 0;
border: 14px solid transparent;
}
&::after {
content: "";
position: absolute;
right: -17px;
bottom: 0;
border: 14px solid transparent;
}
}
}
// ribbon circle
&.ribbon-circle {
.ribbon {
width: 48px;
height: 48px;
border-radius: 50%;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
left: 20px;
top: 20px;
}
}
// ribbon fill
&.ribbon-fill {
overflow: hidden;
.ribbon {
transform: rotate(-45deg);
width: 93px;
height: 52px;
left: -36px;
top: -16px;
display: flex;
justify-content: center;
align-items: flex-end;
}
&.ribbon-sm {
.ribbon {
padding: 2px 12px;
width: 78px;
height: 42px;
font-size: 12px;
box-shadow: none;
}
}
}
// right
&.right {
.ribbon {
position: absolute;
left: auto;
right: 0;
&.round-shape {
border-radius: 30px 0 0 30px;
}
&.ribbon-shape {
text-align: right;
&::before,
&::after {
right: auto;
left: -17px;
border-left-color: transparent;
}
}
}
&.ribbon-circle {
.ribbon {
left: auto;
right: 20px;
}
}
.icon-ribbon {
right: 24px;
left: auto;
}
&.ribbon-fill {
.ribbon {
transform: rotate(45deg);
right: -38px;
left: auto;
}
}
&.ribbon-box {
.ribbon-two {
left: auto;
right: -5px;
span {
left: auto;
right: -21px;
transform: rotate(45deg);
}
}
}
}
.ribbon-content {
clear: both;
}
@each $color,
$value in $theme-colors {
.ribbon-#{$color} {
background: ($value);
&:before {
border-color: darken(($value), 10%) transparent transparent;
}
&.ribbon-shape {
&::before {
border-left-color: ($value);
border-top-color: ($value);
}
&::after {
border-left-color: ($value);
border-bottom-color: ($value);
}
}
}
&.right {
.ribbon-#{$color} {
background: ($value);
&.ribbon-shape {
&::before {
border-right-color: ($value);
border-top-color: ($value);
}
&::after {
border-right-color: ($value);
border-bottom-color: ($value);
}
}
}
}
}
// Icon ribbon
.icon-ribbon {
box-shadow: none;
left: 24px;
top: -12px;
font-size: 40px;
padding: 0;
}
/* Ribbon two */
.ribbon-two {
position: absolute;
left: -5px;
top: -5px;
z-index: 1;
overflow: hidden;
width: 75px;
height: 75px;
text-align: right;
span {
font-size: 13px;
color: $white;
text-align: center;
line-height: 20px;
transform: rotate(-45deg);
width: 100px;
display: block;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0 0 rgba(0, 0, 0, 0.02);
position: absolute;
top: 19px;
left: -21px;
font-weight: $font-weight-semibold;
&:before {
content: "";
position: absolute;
left: 0;
top: 100%;
z-index: -1;
border-right: 3px solid transparent;
border-bottom: 3px solid transparent;
}
&:after {
content: "";
position: absolute;
right: 0;
top: 100%;
z-index: -1;
border-left: 3px solid transparent;
border-bottom: 3px solid transparent;
}
}
}
@each $color,
$value in $theme-colors {
.ribbon-two-#{$color} {
span {
background: ($value);
&:before {
border-left: 3px solid darken(($value), 15%);
border-top: 3px solid darken(($value), 15%);
}
&:after {
border-right: 3px solid darken(($value), 15%);
border-top: 3px solid darken(($value), 15%);
}
}
}
}
}
.ribbon-box {
&.right {
.ribbon-three {
position: absolute;
top: -6.1px;
right: 10px;
left: auto;
}
}
}
.ribbon-three {
position: absolute;
top: -6.1px;
left: 10px;
span {
position: relative;
display: block;
text-align: center;
color: $white;
font-size: 14px;
line-height: 1;
padding: 12px 8px 10px;
border-top-right-radius: 8px;
width: 90px;
&::after,
&::before {
position: absolute;
content: "";
}
&::before {
height: 6px;
width: 6px;
left: -6px;
top: 0;
}
&::after {
height: 6px;
width: 8px;
left: -8px;
top: 0;
border-radius: 8px 8px 0 0;
}
}
&::after {
position: absolute;
content: "";
width: 0;
height: 0;
border-left: 44px solid transparent;
border-right: 44px solid transparent;
border-top: 10px solid;
}
}
@each $color,
$value in $theme-colors {
.ribbon-three-#{$color} {
span {
background: ($value);
&:before {
background: ($value);
}
&:after {
background: darken($value, 10%);
}
}
&::after {
border-top-color: ($value);
}
}
}
//Ribbon Hover
.ribbon-box {
.trending-ribbon {
transform: translateX(-50px);
transition: all 0.5s ease;
.trending-ribbon-text {
transition: all 0.5s ease;
opacity: 0;
}
}
&:hover {
.trending-ribbon {
transform: translateX(0);
.trending-ribbon-text {
opacity: 1;
}
}
}
&.right {
.trending-ribbon {
transform: translateX(50px);
transition: all 0.5s ease;
.trending-ribbon-text {
transition: all 0.5s ease;
opacity: 0;
}
}
&:hover {
.trending-ribbon {
transform: translateX(0);
.trending-ribbon-text {
opacity: 1;
}
}
}
}
}
+331
View File
@@ -0,0 +1,331 @@
:root {
// card
--#{$prefix}card-logo-dark: block;
--#{$prefix}card-logo-light: none;
//vertical menu
--#{$prefix}vertical-menu-width: #{$vertical-menu-width};
--#{$prefix}vertical-menu-width-md: #{$vertical-menu-width-md};
--#{$prefix}vertical-menu-width-sm: #{$vertical-menu-width-sm};
// Topbar - (Default Light)
--#{$prefix}header-bg: #{$header-bg};
--#{$prefix}header-border: #{$header-border};
--#{$prefix}header-item-color: #{$header-item-color};
--#{$prefix}header-item-bg: #{$header-item-bg};
--#{$prefix}header-item-sub-color: #{$header-item-sub-color};
--#{$prefix}topbar-search-bg: #{$topbar-search-bg};
--#{$prefix}topbar-search-color: #{$topbar-search-color};
--#{$prefix}topbar-user-bg: #{$topbar-user-bg};
//page title
--#{$prefix}page-title-box-shadow: #{$page-title-box-shadow};
--#{$prefix}page-title-border: #{$page-title-border};
// Topbar - Dark
&[data-topbar="dark"] {
--#{$prefix}header-bg: #{$dark-header-bg};
--#{$prefix}header-item-color: #{$dark-header-item-color};
--#{$prefix}header-item-bg: #{$dark-header-item-bg};
--#{$prefix}header-item-sub-color: #{$dark-header-item-sub-color};
--#{$prefix}topbar-user-bg: #{$dark-topbar-user-bg};
--#{$prefix}topbar-search-bg: #{$dark-topbar-search-bg};
--#{$prefix}topbar-search-color: #{$dark-topbar-search-color};
--#{$prefix}header-border: #{$dark-header-border};
}
// Horizontal nav
--#{$prefix}topnav-bg: #{$twocolumn-menu-iconview-bg};
--#{$prefix}topnav-item-color: #{$topnav-item-color};
--#{$prefix}topnav-item-active-color: #{$topnav-item-active-color};
// twocolumn menu
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg};
--#{$prefix}twocolumn-menu-box-shadow: #{$twocolumn-menu-box-shadow};
// boxed
--#{$prefix}boxed-layout-width: #{$boxed-layout-width};
--#{$prefix}boxed-body-bg: #{$boxed-body-bg};
//semibox layout
--#{$prefix}semibox-width: #{$semibox-width};
//footer
--#{$prefix}footer-bg: #{$footer-bg};
--#{$prefix}footer-color: #{$footer-color};
//form
--#{$prefix}input-bg-custom: #{$input-bg-custom};
--#{$prefix}input-border-custom: #{$input-border-custom};
}
//sidebar light theme
@if $sidebar-mode {
:root {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border};
--#{$prefix}vertical-menu-item-color: #{$vertical-menu-item-color};
--#{$prefix}vertical-menu-item-bg: #{$vertical-menu-item-bg};
--#{$prefix}vertical-menu-item-hover-color: #{$vertical-menu-item-hover-color};
--#{$prefix}vertical-menu-item-active-color: #{$vertical-menu-item-active-color};
--#{$prefix}vertical-menu-item-active-bg: #{$vertical-menu-item-active-bg};
--#{$prefix}vertical-menu-sub-item-color: #{$vertical-menu-sub-item-color};
--#{$prefix}vertical-menu-sub-item-hover-color: #{$vertical-menu-sub-item-hover-color};
--#{$prefix}vertical-menu-sub-item-active-color: #{$vertical-menu-sub-item-active-color};
--#{$prefix}vertical-menu-title-color: #{$vertical-menu-title-color};
--#{$prefix}vertical-menu-box-shadow: #{$vertical-menu-box-shadow};
--#{$prefix}vertical-menu-dropdown-box-shadow: #{$vertical-menu-dropdown-box-shadow};
&[data-sidebar="dark"] {
//vertical dark
--#{$prefix}vertical-menu-bg: #{$dark-vertical-menu-bg};
--#{$prefix}vertical-menu-border: #{$dark-vertical-menu-border};
--#{$prefix}vertical-menu-item-color: #{$dark-vertical-menu-item-color};
--#{$prefix}vertical-menu-item-bg: #{$dark-vertical-menu-item-bg};
--#{$prefix}vertical-menu-item-hover-color: #{$dark-vertical-menu-item-hover-color};
--#{$prefix}vertical-menu-item-active-color: #{$dark-vertical-menu-item-active-color};
--#{$prefix}vertical-menu-item-active-bg: #{$dark-vertical-menu-item-active-bg};
--#{$prefix}vertical-menu-sub-item-color: #{$dark-vertical-menu-sub-item-color};
--#{$prefix}vertical-menu-sub-item-hover-color: #{$dark-vertical-menu-sub-item-hover-color};
--#{$prefix}vertical-menu-sub-item-active-color: #{$dark-vertical-menu-sub-item-active-color};
--#{$prefix}vertical-menu-title-color: #{$dark-vertical-menu-title-color};
--#{$prefix}twocolumn-menu-iconview-bg: #{$dark-twocolumn-menu-iconview-bg};
--#{$prefix}vertical-menu-box-shadow: #{$dark-vertical-menu-box-shadow};
--#{$prefix}vertical-menu-dropdown-box-shadow: #{$dark-vertical-menu-dropdown-box-shadow};
}
}
}
//sidebar gradient light theme
@if $sidebar-gradient-mode {
:root {
&:is([data-sidebar="gradient"], [data-sidebar="gradient-2"], [data-sidebar="gradient-3"], [data-sidebar="gradient-4"]) {
--#{$prefix}vertical-menu-item-color: #{$vertical-menu-item-color-gradient};
--#{$prefix}vertical-menu-item-bg: #{$vertical-menu-item-bg-gradient};
--#{$prefix}vertical-menu-item-hover-color: #{$vertical-menu-item-hover-color-gradient};
--#{$prefix}vertical-menu-item-active-color: #{$vertical-menu-item-active-color-gradient};
--#{$prefix}vertical-menu-item-active-bg: #{$vertical-menu-item-active-bg-gradient};
--#{$prefix}vertical-menu-sub-item-color: #{$vertical-menu-sub-item-color-gradient};
--#{$prefix}vertical-menu-sub-item-hover-color: #{$vertical-menu-sub-item-hover-color-gradient};
--#{$prefix}vertical-menu-sub-item-active-color: #{$vertical-menu-sub-item-active-color-gradient};
--#{$prefix}vertical-menu-title-color: #{$vertical-menu-title-color-gradient};
--#{$prefix}vertical-menu-box-shadow: #{$vertical-menu-box-shadow-gradient};
--#{$prefix}vertical-menu-dropdown-box-shadow: #{$vertical-menu-dropdown-box-shadow-gradient};
}
&[data-sidebar="gradient"] {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-gradient};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-gradient};
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg-gradient};
}
&[data-sidebar="gradient-2"] {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-gradient-2};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-gradient-2};
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg-gradient-2};
}
&[data-sidebar="gradient-3"] {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-gradient-3};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-gradient-3};
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg-gradient-3};
}
&[data-sidebar="gradient-4"] {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-gradient-4};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-gradient-4};
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg-gradient-4};
}
}
}
//theme dark
@if $enable-dark-mode {
@include color-mode(dark, true) {
--#{$prefix}light: #{$light-dark};
--#{$prefix}light-rgb: #{to-rgb($light-dark)};
--#{$prefix}light-text-emphasis: #{$light-text-emphasis-dark};
--#{$prefix}light-bg-subtle: #{$light-bg-subtle-dark};
--#{$prefix}light-border-subtle: #{$light-border-subtle-dark};
--#{$prefix}dark: #{$dark-color};
--#{$prefix}dark-rgb: #{to-rgb($dark-color)};
--#{$prefix}dark-text-emphasis: #{$dark-text-emphasis-dark};
--#{$prefix}dark-bg-subtle: #{$dark-bg-subtle-dark};
--#{$prefix}dark-border-subtle: #{$dark-border-subtle-dark};
// card
--#{$prefix}card-logo-dark: none;
--#{$prefix}card-logo-light: block;
//footer
--#{$prefix}footer-bg: #{$footer-bg-dark};
--#{$prefix}footer-color: #{$footer-color-dark};
// Horizontal nav
--#{$prefix}topnav-bg: #{$topnav-bg-dark};
--#{$prefix}topnav-item-color: #{$topnav-item-color-dark};
--#{$prefix}topnav-item-active-color: #{$topnav-item-active-color-dark};
//page title
--#{$prefix}page-title-box-shadow: #{$page-title-box-shadow-dark};
--#{$prefix}page-title-border: #{$page-title-border-dark};
//two columns
--#{$prefix}twocolumn-menu-box-shadow: #{$twocolumn-menu-box-shadow-dark};
// boxed
--#{$prefix}boxed-body-bg: #{$boxed-body-bg-dark};
.table-light {
--#{$prefix}table-color: #{lighten($light-dark, 100%)};
--#{$prefix}table-bg: var(--#{$prefix}light);
--#{$prefix}table-border-color: var(--#{$prefix}border-color);
--#{$prefix}table-striped-bg: var(--#{$prefix}light);
--#{$prefix}table-striped-color: #{lighten($light-dark, 100%)};
--#{$prefix}table-active-bg: var(--#{$prefix}light);
--#{$prefix}table-active-color: #{lighten($light-dark, 100%)};
--#{$prefix}table-hover-bg: var(--#{$prefix}light);
--#{$prefix}table-hover-color: #{lighten($light-dark, 100%)};
}
.btn-light,
.btn-outline-light {
--#{$prefix}btn-color: #{tint-color($body-bg-dark, 50%)};
--#{$prefix}btn-active-color: #{$white};
--#{$prefix}btn-hover-color: #{$white};
}
.btn-outline-dark,
.btn-soft-dark, .btn-ghost-dark {
--#{$prefix}btn-color: #{$white};
}
.btn-ghost-dark {
--#{$prefix}btn-active-color: #{$white};
--#{$prefix}btn-hover-color: #{$white};
}
.dropdown-menu {
--#{$prefix}dropdown-bg: #{$dropdown-bg-dark};
--#{$prefix}dropdown-link-color: #{$dropdown-link-color-dark};
--#{$prefix}dropdown-link-hover-color: #{$dropdown-link-hover-color-dark};
--#{$prefix}dropdown-link-hover-bg: #{$dropdown-link-hover-bg-dark};
--#{$prefix}dropdown-border-width: #{$dropdown-border-width-dark};
--#{$prefix}dropdown-link-active-color: #{$dropdown-link-active-color-dark};
--#{$prefix}dropdown-link-active-bg: #{$dropdown-link-active-bg-dark};
}
//form
--#{$prefix}input-bg-custom: #{$input-bg-custom-dark};
--#{$prefix}input-border-custom: #{$input-border-custom-dark};
}
}
//topbar dark mode
@if $topbar-dark-mode {
@include color-mode(dark, true) {
// Topbar
--#{$prefix}header-bg: #{$header-bg-dark};
--#{$prefix}header-border: #{$header-border-dark};
--#{$prefix}header-item-color: #{$header-item-color-dark};
--#{$prefix}header-item-bg: #{$header-item-bg-dark};
--#{$prefix}header-item-sub-color: #{$header-item-sub-color-dark};
--#{$prefix}topbar-user-bg: #{$topbar-user-bg-dark};
--#{$prefix}topbar-search-bg: #{$topbar-search-bg-dark};
--#{$prefix}topbar-search-color: #{$topbar-search-color-dark};
// Topbar - Dark
&[data-topbar="dark"] {
--#{$prefix}header-bg: #{$dark-header-bg-dark};
--#{$prefix}header-border: #{$dark-header-border-dark};
--#{$prefix}header-item-color: #{$dark-header-item-color-dark};
--#{$prefix}header-item-bg: #{$dark-header-item-bg-dark};
--#{$prefix}header-item-sub-color: #{$dark-header-item-sub-color-dark};
--#{$prefix}topbar-user-bg: #{$dark-topbar-user-bg-dark};
--#{$prefix}topbar-search-bg: #{$dark-topbar-search-bg-dark};
--#{$prefix}topbar-search-color: #{$dark-topbar-search-color-dark};
}
}
}
//sidebar dark mode
@if $sidebar-dark-mode {
@include color-mode(dark, true) {
//sidebar light
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-dark};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-dark};
--#{$prefix}vertical-menu-item-color: #{$vertical-menu-item-color-dark};
--#{$prefix}vertical-menu-item-bg: #{$vertical-menu-item-bg-dark};
--#{$prefix}vertical-menu-item-hover-color: #{$vertical-menu-item-hover-color-dark};
--#{$prefix}vertical-menu-item-active-color: #{$vertical-menu-item-active-color-dark};
--#{$prefix}vertical-menu-item-active-bg: #{$vertical-menu-item-active-bg-dark};
--#{$prefix}vertical-menu-sub-item-color: #{$vertical-menu-sub-item-color-dark};
--#{$prefix}vertical-menu-sub-item-hover-color: #{$vertical-menu-sub-item-hover-color-dark};
--#{$prefix}vertical-menu-sub-item-active-color: #{$vertical-menu-sub-item-active-color-dark};
--#{$prefix}vertical-menu-title-color: #{$vertical-menu-title-color-dark};
&[data-sidebar="dark"] {
//vertical dark
--#{$prefix}vertical-menu-bg: #{$dark-vertical-menu-bg-dark};
--#{$prefix}vertical-menu-border: #{$dark-vertical-menu-border-dark};
--#{$prefix}vertical-menu-item-color: #{$dark-vertical-menu-item-color-dark};
--#{$prefix}vertical-menu-item-bg: #{$dark-vertical-menu-item-bg-dark};
--#{$prefix}vertical-menu-item-hover-color: #{$dark-vertical-menu-item-hover-color-dark};
--#{$prefix}vertical-menu-item-active-color: #{$dark-vertical-menu-item-active-color-dark};
--#{$prefix}vertical-menu-item-active-bg: #{$dark-vertical-menu-item-active-bg-dark};
--#{$prefix}vertical-menu-sub-item-color: #{$dark-vertical-menu-sub-item-color-dark};
--#{$prefix}vertical-menu-sub-item-hover-color: #{$dark-vertical-menu-sub-item-hover-color-dark};
--#{$prefix}vertical-menu-sub-item-active-color: #{$dark-vertical-menu-sub-item-active-color-dark};
--#{$prefix}vertical-menu-title-color: #{$dark-vertical-menu-title-color-dark};
--#{$prefix}twocolumn-menu-iconview-bg: #{$dark-twocolumn-menu-iconview-bg-dark};
}
}
}
//sidebar gradient dark mode
@if $sidebar-gradient-dark-mode {
@include color-mode(dark, true) {
&:is([data-sidebar="gradient"], [data-sidebar="gradient-2"], [data-sidebar="gradient-3"], [data-sidebar="gradient-4"]) {
--#{$prefix}vertical-menu-item-color: #{$vertical-menu-item-color-gradient-dark};
--#{$prefix}vertical-menu-item-bg: #{$vertical-menu-item-bg-gradient-dark};
--#{$prefix}vertical-menu-item-hover-color: #{$vertical-menu-item-hover-color-gradient-dark};
--#{$prefix}vertical-menu-item-active-color: #{$vertical-menu-item-active-color-gradient-dark};
--#{$prefix}vertical-menu-item-active-bg: #{$vertical-menu-item-active-bg-gradient-dark};
--#{$prefix}vertical-menu-sub-item-color: #{$vertical-menu-sub-item-color-gradient-dark};
--#{$prefix}vertical-menu-sub-item-hover-color: #{$vertical-menu-sub-item-hover-color-gradient-dark};
--#{$prefix}vertical-menu-sub-item-active-color: #{$vertical-menu-sub-item-active-color-gradient-dark};
--#{$prefix}vertical-menu-title-color: #{$vertical-menu-title-color-gradient-dark};
}
&[data-sidebar="gradient"] {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-gradient-dark};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-gradient-dark};
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg-gradient-dark};
}
&[data-sidebar="gradient-2"] {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-gradient-2-dark};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-gradient-2-dark};
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg-gradient-2-dark};
}
&[data-sidebar="gradient-3"] {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-gradient-3-dark};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-gradient-3-dark};
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg-gradient-3-dark};
}
&[data-sidebar="gradient-4"] {
--#{$prefix}vertical-menu-bg: #{$vertical-menu-bg-gradient-4-dark};
--#{$prefix}vertical-menu-border: #{$vertical-menu-border-gradient-4-dark};
--#{$prefix}twocolumn-menu-iconview-bg: #{$twocolumn-menu-iconview-bg-gradient-4-dark};
}
}
}
+17
View File
@@ -0,0 +1,17 @@
//
// scrollspy.scss
//
// Scrollspy
.scrollspy-example {
position: relative;
height: 200px;
margin-top: .5rem;
overflow: auto;
}
.scrollspy-example-2 {
position: relative;
height: 370px;
overflow: auto;
}
+97
View File
@@ -0,0 +1,97 @@
//
// _table.scss
//
.table {
>thead {
border-color: $table-border-color;
}
>:not(:first-child) {
border-top-width: $table-border-width;
}
}
.table-nowrap {
th,
td {
white-space: nowrap;
}
}
// card table
.table-card{
margin: (-$card-spacer-y) (-$card-spacer-x);
th,
td {
&:first-child{
padding-left: 16px;
}
&:last-child{
padding-right: 16px;
}
}
.table > :not(:first-child) {
border-top-width: $table-border-width;
}
}
@each $color,
$value in $theme-colors {
.border-#{$color} {
&.table {
> thead {
border-color: $value !important;
}
}
}
.table-#{$color} {
&.table {
> thead {
border-bottom-color:lighten($value, 10%) !important;
}
}
}
}
.table>:not(caption)>*>* {
color: var(--vz-table-color-state), var(--vz-table-color-type, var(--vz-table-color));
}
.table {
.form-check {
padding-left: 0px;
margin-bottom: 0px;
.form-check-input {
margin-left: 0px;
margin-top: 0px;
float: none;
vertical-align: middle;
}
}
.sort {
position: relative;
&::before {
content: "\f035d";
position: absolute;
right: 0.5rem;
top: 18px;
font-size: 0.8rem;
font-family: "Material Design Icons";
}
&::after {
position:absolute;
right: 0.5rem;
content: "\f0360";
font-family: "Material Design Icons";
font-size: 0.8rem;
top: 12px;
}
}
}
+24
View File
@@ -0,0 +1,24 @@
//
// toast.scss
//
// toast
.toast {
&:not(:last-child) {
margin-bottom: $toast-padding-x;
}
}
@mixin toast-border-variant($bg) {
.toast-body{
color: $bg;
border-bottom: 3px solid $bg;
}
}
@each $color, $value in $theme-colors {
.toast-border-#{$color} {
@include toast-border-variant($value);
}
}
+43
View File
@@ -0,0 +1,43 @@
//
// type.scss
//
// Blockquote
.custom-blockquote {
&.blockquote {
padding: 16px;
border-left: 3px solid;
&.blockquote-outline{
background-color: var(--#{$prefix}secondary-bg) !important;
border: 1px solid;
border-left: 3px solid;
}
}
}
@each $color,
$value in $theme-colors {
.custom-blockquote {
&.blockquote {
&.blockquote-#{$color} {
border-color: var(--#{$prefix}#{$color});
background-color: var(--#{$prefix}#{$color}-bg-subtle);
.blockquote-footer {
color: var(--#{$prefix}#{$color}-text-emphasis);
}
}
&.blockquote-outline{
&.blockquote-#{$color} {
border-color: var(--#{$prefix}#{$color});
.blockquote-footer {
color: var(--#{$prefix}#{$color}-text-emphasis);
}
}
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
//
// _utilities.scss
//
$utilities: (
"font-size-custom": (property: font-size,
class: fs,
values: $font-size-custom ),
// Add new utilities
"cursor": (property: cursor,
class: cursor,
responsive: true,
values: auto pointer grab,
)
);
+168
View File
@@ -0,0 +1,168 @@
/*!
* Waves v0.7.6
* http://fian.my.id/Waves
*
* Copyright 2014-2018 Alfiana E. Sibuea and other contributors
* Released under the MIT license
* https://github.com/fians/Waves/blob/master/LICENSE */
.waves-effect {
position: relative;
cursor: pointer;
display: inline-block;
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
.waves-effect .waves-ripple {
position: absolute;
border-radius: 50%;
width: 100px;
height: 100px;
margin-top: -50px;
margin-left: -50px;
opacity: 0;
background: rgba(0, 0, 0, 0.2);
background: -webkit-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: -o-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: -moz-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
-o-transition-property: -o-transform, opacity;
transition-property: transform, opacity;
-webkit-transform: scale(0) translate(0, 0);
-moz-transform: scale(0) translate(0, 0);
-ms-transform: scale(0) translate(0, 0);
-o-transform: scale(0) translate(0, 0);
transform: scale(0) translate(0, 0);
pointer-events: none;
}
.waves-effect.waves-light .waves-ripple {
background: rgba(255, 255, 255, 0.4);
background: -webkit-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: -o-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: -moz-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
}
.waves-effect.waves-classic .waves-ripple {
background: rgba(0, 0, 0, 0.2);
}
.waves-effect.waves-classic.waves-light .waves-ripple {
background: rgba(255, 255, 255, 0.4);
}
.waves-notransition {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
transition: none !important;
}
.waves-button,
.waves-circle {
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
-webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
}
.waves-button,
.waves-button:hover,
.waves-button:visited,
.waves-button-input {
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: none;
outline: none;
color: inherit;
background-color: rgba(0, 0, 0, 0);
font-size: 1em;
line-height: 1em;
text-align: center;
text-decoration: none;
z-index: 1;
}
.waves-button {
padding: 0.85em 1.1em;
border-radius: 0.2em;
}
.waves-button-input {
margin: 0;
padding: 0.85em 1.1em;
}
.waves-input-wrapper {
border-radius: 0.2em;
vertical-align: bottom;
}
.waves-input-wrapper.waves-button {
padding: 0;
}
.waves-input-wrapper .waves-button-input {
position: relative;
top: 0;
left: 0;
z-index: 1;
}
.waves-circle {
text-align: center;
width: 2.5em;
height: 2.5em;
line-height: 2.5em;
border-radius: 50%;
}
.waves-float {
-webkit-mask-image: none;
-webkit-box-shadow: 0px 1px 1.5px 1px rgba(0, 0, 0, 0.12);
box-shadow: 0px 1px 1.5px 1px rgba(0, 0, 0, 0.12);
-webkit-transition: all 300ms;
-moz-transition: all 300ms;
-o-transition: all 300ms;
transition: all 300ms;
}
.waves-float:active {
-webkit-box-shadow: 0px 8px 20px 1px rgba(0, 0, 0, 0.3);
box-shadow: 0px 8px 20px 1px rgba(0, 0, 0, 0.3);
}
.waves-block {
display: block;
}
.waves-effect.waves-light {
.waves-ripple {
background-color: rgba($white, 0.4);
}
}
.waves-effect.waves-primary {
.waves-ripple {
background-color: rgba($primary, 0.4);
}
}
.waves-effect.waves-success {
.waves-ripple {
background-color: rgba($success, 0.4);
}
}
.waves-effect.waves-info {
.waves-ripple {
background-color: rgba($info, 0.4);
}
}
.waves-effect.waves-warning {
.waves-ripple {
background-color: rgba($warning, 0.4);
}
}
.waves-effect.waves-danger {
.waves-ripple {
background-color: rgba($danger, 0.4);
}
}
Loaded 100 of 185 files, more files were not shown because too many files have changed in this diff. Show more