versão 1 aprimorada
This commit is contained in:
parent
7db2b83552
commit
8be2551b13
38
add_installation.php
Normal file
38
add_installation.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require_once __DIR__ . '/db/config.php';
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
$client_name = trim($_POST['client_name'] ?? '');
|
||||||
|
$address = trim($_POST['address'] ?? '');
|
||||||
|
$technician_name = trim($_POST['technician_name'] ?? '');
|
||||||
|
$observations = trim($_POST['observations'] ?? '');
|
||||||
|
$voltage = trim($_POST['voltage'] ?? null);
|
||||||
|
$phase_neutral_ground = trim($_POST['phase_neutral_ground'] ?? null);
|
||||||
|
$breaker_output = trim($_POST['breaker_output'] ?? null);
|
||||||
|
|
||||||
|
if (empty($client_name) || empty($address) || empty($technician_name)) {
|
||||||
|
$_SESSION['message'] = 'Please fill all required fields.';
|
||||||
|
$_SESSION['message_type'] = 'danger';
|
||||||
|
header('Location: index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$pdo = db();
|
||||||
|
$stmt = $pdo->prepare(
|
||||||
|
"INSERT INTO installations (client_name, address, technician_name, observations, voltage, phase_neutral_ground, breaker_output) VALUES (?, ?, ?, ?, ?, ?, ?)"
|
||||||
|
);
|
||||||
|
$stmt->execute([$client_name, $address, $technician_name, $observations, $voltage, $phase_neutral_ground, $breaker_output]);
|
||||||
|
|
||||||
|
$_SESSION['message'] = 'Installation registered successfully!';
|
||||||
|
$_SESSION['message_type'] = 'success';
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
error_log("Database error: " . $e->getMessage());
|
||||||
|
$_SESSION['message'] = 'Failed to register installation. Please try again.';
|
||||||
|
$_SESSION['message_type'] = 'danger';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Location: index.php');
|
||||||
|
exit;
|
||||||
131
assets/css/custom.css
Normal file
131
assets/css/custom.css
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--primary-color: #6cc24a;
|
||||||
|
--secondary-color: #2c3e50;
|
||||||
|
--sidebar-width: 280px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Poppins', sans-serif;
|
||||||
|
background-color: #f0f2f5;
|
||||||
|
color: #495057;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
width: var(--sidebar-width);
|
||||||
|
background-color: var(--secondary-color);
|
||||||
|
padding-top: 1rem;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar .nav-link {
|
||||||
|
color: #adb5bd;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 0.75rem 1.5rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar .nav-link i {
|
||||||
|
margin-right: 0.75rem;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
width: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar .nav-link:hover, .sidebar .nav-link.active {
|
||||||
|
color: #fff;
|
||||||
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar .navbar-brand {
|
||||||
|
color: #fff !important;
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 0.5rem 1.5rem;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-content {
|
||||||
|
margin-left: var(--sidebar-width);
|
||||||
|
padding: 2rem;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-navbar {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
padding: 0.75rem 1.5rem;
|
||||||
|
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-card {
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.75rem;
|
||||||
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-card .card-body {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-card .kpi-icon {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 1.5rem;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-card .kpi-value {
|
||||||
|
font-size: 2rem;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-card .kpi-label {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #6c757d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
border-radius: 0.75rem;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
padding: 0.5rem 1.5rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover {
|
||||||
|
background-color: #58a83a;
|
||||||
|
border-color: #58a83a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table thead th {
|
||||||
|
border-bottom: 2px solid #dee2e6;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-hover tbody tr:hover {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-footer {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
12
db/migrate.php
Normal file
12
db/migrate.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/config.php';
|
||||||
|
|
||||||
|
try {
|
||||||
|
$pdo = db();
|
||||||
|
$sql = file_get_contents(__DIR__ . '/migrations/001_create_installations_table.sql');
|
||||||
|
$pdo->exec($sql);
|
||||||
|
echo "Migration completed successfully.\n";
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
die("Migration failed: " . $e->getMessage() . "\n");
|
||||||
|
}
|
||||||
|
|
||||||
8
db/migrations/001_create_installations_table.sql
Normal file
8
db/migrations/001_create_installations_table.sql
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS installations (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
client_name VARCHAR(255) NOT NULL,
|
||||||
|
address TEXT NOT NULL,
|
||||||
|
technician_name VARCHAR(255) NOT NULL,
|
||||||
|
observations TEXT,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
4
db/migrations/002_add_electrical_fields.sql
Normal file
4
db/migrations/002_add_electrical_fields.sql
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
ALTER TABLE `installations`
|
||||||
|
ADD COLUMN `voltage` VARCHAR(255) NULL,
|
||||||
|
ADD COLUMN `phase_neutral_ground` VARCHAR(255) NULL,
|
||||||
|
ADD COLUMN `breaker_output` VARCHAR(255) NULL;
|
||||||
394
index.php
394
index.php
@ -1,150 +1,262 @@
|
|||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
session_start();
|
||||||
@ini_set('display_errors', '1');
|
$message = $_SESSION['message'] ?? null;
|
||||||
@error_reporting(E_ALL);
|
$message_type = $_SESSION['message_type'] ?? null;
|
||||||
@date_default_timezone_set('UTC');
|
unset($_SESSION['message'], $_SESSION['message_type']);
|
||||||
|
|
||||||
$phpVersion = PHP_VERSION;
|
require_once __DIR__ . '/db/config.php';
|
||||||
$now = date('Y-m-d H:i:s');
|
try {
|
||||||
|
$pdo = db();
|
||||||
|
$stmt = $pdo->query("SELECT * FROM installations ORDER BY created_at DESC LIMIT 10");
|
||||||
|
$installations = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
$total_installations = count($installations);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$installations = [];
|
||||||
|
$total_installations = 0;
|
||||||
|
$db_error = "Database connection failed or table not found. Please run the migration.";
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="pt-BR">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>New Style</title>
|
<title>ILOADNET SOLUTIONS - Dashboard</title>
|
||||||
<?php
|
<meta name="description" content="Dashboard para gerenciamento de instalações de carregadores de veículos elétricos.">
|
||||||
// Read project preview data from environment
|
<meta name="keywords" content="EV charger, installation management, maintenance log, ILOADNET, dashboard, electric vehicle, fleet management, charge point operator, Built with Flatlogic Generator">
|
||||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
<meta property="og:title" content="ILOADNET SOLUTIONS">
|
||||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
<meta property="og:description" content="Dashboard para gerenciamento de instalações de carregadores de veículos elétricos.">
|
||||||
?>
|
<meta property="og:image" content="<?php echo $_SERVER['PROJECT_IMAGE_URL']; ?>">
|
||||||
<?php if ($projectDescription): ?>
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<!-- Meta description -->
|
<meta name="twitter:image" content="<?php echo $_SERVER['PROJECT_IMAGE_URL']; ?>">
|
||||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
|
||||||
<!-- Open Graph meta tags -->
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||||
<!-- Twitter meta tags -->
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($projectImageUrl): ?>
|
|
||||||
<!-- Open Graph image -->
|
|
||||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
|
||||||
<!-- Twitter image -->
|
|
||||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
|
||||||
<?php endif; ?>
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
|
||||||
<style>
|
|
||||||
:root {
|
|
||||||
--bg-color-start: #6a11cb;
|
|
||||||
--bg-color-end: #2575fc;
|
|
||||||
--text-color: #ffffff;
|
|
||||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
|
||||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
|
||||||
color: var(--text-color);
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
min-height: 100vh;
|
|
||||||
text-align: center;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
body::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
|
||||||
animation: bg-pan 20s linear infinite;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
@keyframes bg-pan {
|
|
||||||
0% { background-position: 0% 0%; }
|
|
||||||
100% { background-position: 100% 100%; }
|
|
||||||
}
|
|
||||||
main {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
background: var(--card-bg-color);
|
|
||||||
border: 1px solid var(--card-border-color);
|
|
||||||
border-radius: 16px;
|
|
||||||
padding: 2rem;
|
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
-webkit-backdrop-filter: blur(20px);
|
|
||||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
.loader {
|
|
||||||
margin: 1.25rem auto 1.25rem;
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
||||||
border-top-color: #fff;
|
|
||||||
border-radius: 50%;
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
@keyframes spin {
|
|
||||||
from { transform: rotate(0deg); }
|
|
||||||
to { transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
.hint {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
.sr-only {
|
|
||||||
position: absolute;
|
|
||||||
width: 1px; height: 1px;
|
|
||||||
padding: 0; margin: -1px;
|
|
||||||
overflow: hidden;
|
|
||||||
clip: rect(0, 0, 0, 0);
|
|
||||||
white-space: nowrap; border: 0;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 3rem;
|
|
||||||
font-weight: 700;
|
|
||||||
margin: 0 0 1rem;
|
|
||||||
letter-spacing: -1px;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
code {
|
|
||||||
background: rgba(0,0,0,0.2);
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
||||||
}
|
|
||||||
footer {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 1rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
|
||||||
<div class="card">
|
<div class="sidebar">
|
||||||
<h1>Analyzing your requirements and generating your website…</h1>
|
<a class="navbar-brand" href="#">ILOAD</a>
|
||||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
<ul class="nav flex-column">
|
||||||
<span class="sr-only">Loading…</span>
|
<li class="nav-item">
|
||||||
</div>
|
<a class="nav-link active" href="#">
|
||||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
<i class="bi bi-grid-1x2-fill"></i> Dashboard
|
||||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
</a>
|
||||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">
|
||||||
|
<i class="bi bi-ev-station-fill"></i> Installations
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">
|
||||||
|
<i class="bi bi-people-fill"></i> Users
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">
|
||||||
|
<i class="bi bi-gear-fill"></i> Settings
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
|
||||||
<footer>
|
<div class="main-content">
|
||||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
<nav class="top-navbar navbar navbar-expand">
|
||||||
</footer>
|
<div class="container-fluid">
|
||||||
|
<form class="d-flex me-auto" role="search">
|
||||||
|
<input class="form-control me-2" type="search" placeholder="Search for..." aria-label="Search">
|
||||||
|
</form>
|
||||||
|
<ul class="navbar-nav ms-auto">
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
<i class="bi bi-person-circle me-1"></i> Admin
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-end">
|
||||||
|
<li><a class="dropdown-item" href="#">Profile</a></li>
|
||||||
|
<li><a class="dropdown-item" href="#">Logout</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<?php if (isset($db_error)): ?>
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<p><?php echo htmlspecialchars($db_error); ?></p>
|
||||||
|
<p>From your terminal, please run: <code>php db/migrate.php</code></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($message): ?>
|
||||||
|
<div class="alert alert-<?php echo htmlspecialchars($message_type); ?> alert-dismissible fade show" role="alert">
|
||||||
|
<?php echo htmlspecialchars($message); ?>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
|
||||||
|
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addInstallationModal">
|
||||||
|
<i class="bi bi-plus-circle-fill me-2"></i>Register New Installation
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-3 col-md-6">
|
||||||
|
<div class="kpi-card card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="kpi-icon" style="background-color: #4e73df;">
|
||||||
|
<i class="bi bi-ev-station"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="kpi-value"><?php echo $total_installations; ?></div>
|
||||||
|
<div class="kpi-label">Total Installations</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xl-3 col-md-6">
|
||||||
|
<div class="kpi-card card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="kpi-icon" style="background-color: #1cc88a;">
|
||||||
|
<i class="bi bi-check-circle"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="kpi-value">0</div>
|
||||||
|
<div class="kpi-label">Active Now</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xl-3 col-md-6">
|
||||||
|
<div class="kpi-card card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="kpi-icon" style="background-color: #36b9cc;">
|
||||||
|
<i class="bi bi-person-check"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="kpi-value">0</div>
|
||||||
|
<div class="kpi-label">Technicians</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xl-3 col-md-6">
|
||||||
|
<div class="kpi-card card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="kpi-icon" style="background-color: #f6c23e;">
|
||||||
|
<i class="bi bi-exclamation-triangle"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="kpi-value">0</div>
|
||||||
|
<div class="kpi-label">Pending Issues</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header d-flex justify-content-between align-items-center">
|
||||||
|
<h5 class="card-title mb-0"><i class="bi bi-list-task me-2"></i>Recent Installations</h5>
|
||||||
|
<a href="#" class="btn btn-sm btn-outline-secondary">View All</a>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Client</th>
|
||||||
|
<th>Address</th>
|
||||||
|
<th>Technician</th>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (empty($installations) && !isset($db_error)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="text-center">No installations found.</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($installations as $inst): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo htmlspecialchars($inst['client_name']); ?></td>
|
||||||
|
<td><?php echo htmlspecialchars($inst['address']); ?></td>
|
||||||
|
<td><?php echo htmlspecialchars($inst['technician_name']); ?></td>
|
||||||
|
<td><?php echo date("d/m/Y", strtotime($inst['created_at'])); ?></td>
|
||||||
|
<td>
|
||||||
|
<a href="#" class="btn btn-sm btn-outline-secondary"><i class="bi bi-pencil-square"></i></a>
|
||||||
|
<a href="#" class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Add Installation Modal -->
|
||||||
|
<div class="modal fade" id="addInstallationModal" tabindex="-1" aria-labelledby="addInstallationModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="addInstallationModalLabel">Register New Installation</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form action="add_installation.php" method="POST">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="client_name" class="form-label">Client Name</label>
|
||||||
|
<input type="text" class="form-control" id="client_name" name="client_name" required>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="address" class="form-label">Installation Address</label>
|
||||||
|
<textarea class="form-control" id="address" name="address" rows="3" required></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="technician_name" class="form-label">Technician Name</label>
|
||||||
|
<input type="text" class="form-control" id="technician_name" name="technician_name" required>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="observations" class="form-label">Observations</label>
|
||||||
|
<textarea class="form-control" id="observations" name="observations" rows="3"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<h6 class="mb-3">Electrical Measurements</h6>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 mb-3">
|
||||||
|
<label for="voltage" class="form-label">Voltage (V)</label>
|
||||||
|
<input type="text" class="form-control" id="voltage" name="voltage">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4 mb-3">
|
||||||
|
<label for="phase_neutral_ground" class="form-label">Phase-Neutral-Ground</label>
|
||||||
|
<input type="text" class="form-control" id="phase_neutral_ground" name="phase_neutral_ground">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4 mb-3">
|
||||||
|
<label for="breaker_output" class="form-label">Breaker Output (A)</label>
|
||||||
|
<input type="text" class="form-control" id="breaker_output" name="breaker_output">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||||
|
<button type="submit" class="btn btn-primary">Save Installation</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user