From d2cdcf4dcb5f6d774017ed5e2aa410a697e58c87 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 4 Dec 2025 19:40:19 +0000 Subject: [PATCH] 1 --- assets/css/custom.css | 27 +++++ assets/js/main.js | 1 + db/setup.php | 71 ++++++++++++ index.php | 255 ++++++++++++++++++------------------------ shared/footer.php | 12 ++ shared/header.php | 46 ++++++++ 6 files changed, 266 insertions(+), 146 deletions(-) create mode 100644 assets/css/custom.css create mode 100644 assets/js/main.js create mode 100644 db/setup.php create mode 100644 shared/footer.php create mode 100644 shared/header.php diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..71ccc56 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,27 @@ +body { + background-color: #f8f9fa; +} + +.kpi-card { + border: none; + border-left: 5px solid var(--bs-primary); + transition: transform 0.2s; +} + +.kpi-card:hover { + transform: translateY(-5px); +} + +.kpi-card .card-title { + font-size: 1.2rem; + font-weight: 500; +} + +.kpi-card .card-text { + font-size: 2.5rem; + font-weight: 700; +} + +.table-responsive { + box-shadow: 0 0 15px rgba(0,0,0,0.05); +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..40d83c4 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1 @@ +// Future JavaScript will go here diff --git a/db/setup.php b/db/setup.php new file mode 100644 index 0000000..86b2ebe --- /dev/null +++ b/db/setup.php @@ -0,0 +1,71 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // Create responsables table + $sql = <<exec($sql); + echo "Table 'responsables' created successfully.
"; + + // Create actividades table + $sql = <<exec($sql); + echo "Table 'actividades' created successfully.
"; + + // Create users table + $sql = <<exec($sql); + echo "Table 'users' created successfully.
"; + + // Insert admin user if not exists + $stmt = $pdo->prepare("SELECT id FROM users WHERE username = 'admin'"); + $stmt->execute(); + if ($stmt->fetch()) { + echo "User 'admin' already exists.
"; + } else { + $adminPassword = password_hash('admin', PASSWORD_DEFAULT); + $sql = "INSERT INTO `users` (`username`, `password_hash`, `role`) VALUES ('admin', :password, 'administrador')"; + $stmt = $pdo->prepare($sql); + $stmt->bindParam(':password', $adminPassword); + $stmt->execute(); + echo "User 'admin' created successfully.
"; + } + +} catch (PDOException $e) { + die("DB ERROR: " . $e->getMessage()); +} diff --git a/index.php b/index.php index 7205f3d..1fd6695 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,113 @@ - -$phpVersion = PHP_VERSION; -$now = date('Y-m-d H:i:s'); -?> - - - - - - New Style query("SELECT a.*, r.nombre as responsable_nombre FROM actividades a LEFT JOIN responsables r ON a.responsable_id = r.id ORDER BY a.fecha_inicio, a.hora_inicio"); +$actividades = $stmt->fetchAll(PDO::FETCH_ASSOC); + +// This is just a placeholder, we will calculate this properly in a future step. +$total_actividades = count($actividades); + ?> - - - - - - - - - - - - - - - - - - - - -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ +
+
+

Dashboard de Actividades

-
-
- Page updated: (UTC) -
- - + + + +
+
+
+
+
Total de Actividades
+

+
+
+
+
+
+
+
Actividades en Progreso
+

+
+
+
+
+
+
+
Actividades Completadas
+

+
+
+
+
+
+
+
Actividades Vencidas
+

+
+
+
+
+ + +
+
+
+
Lista de Actividades
+ Nueva Actividad +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FolioDescripciónFecha de InicioFecha de TérminoResponsableEstadoAcciones
No hay actividades registradas.
+ + + + +
+
+
+
+ + \ No newline at end of file diff --git a/shared/footer.php b/shared/footer.php new file mode 100644 index 0000000..48bb640 --- /dev/null +++ b/shared/footer.php @@ -0,0 +1,12 @@ + + +
+
+

© Control de Actividades TI. Todos los derechos reservados.

+
+
+ + + + + diff --git a/shared/header.php b/shared/header.php new file mode 100644 index 0000000..5449b52 --- /dev/null +++ b/shared/header.php @@ -0,0 +1,46 @@ + + + + + + + Control de Actividades de TI + + + + + + + + +