380 lines
13 KiB
PHP
380 lines
13 KiB
PHP
<?php include('include/headscript.php'); ?>
|
|
<!doctype html>
|
|
<html lang="it">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="icon" href="assets/images/favicon-32x32.png" type="image/png" />
|
|
<?php include('cssinclude.php'); ?>
|
|
<title>Dashboard Produzione - <?= htmlspecialchars($titlewebsite, ENT_QUOTES, 'UTF-8'); ?></title>
|
|
|
|
<!-- Bootstrap + jQuery -->
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
|
|
|
|
<style>
|
|
body {
|
|
background: linear-gradient(135deg, #f3f6f8, #e8eef3);
|
|
font-family: 'Segoe UI', sans-serif;
|
|
color: #2b3e50;
|
|
}
|
|
|
|
.page-content {
|
|
padding: 2rem 1rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
h3.dashboard-title {
|
|
text-align: center;
|
|
font-weight: 700;
|
|
color: #2b3e50;
|
|
margin-bottom: 2rem;
|
|
letter-spacing: 0.3px;
|
|
}
|
|
|
|
/* ===== STATISTICHE ===== */
|
|
.stats-row {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
gap: 15px;
|
|
margin-bottom: 20px;
|
|
width: 100%;
|
|
max-width: 900px;
|
|
}
|
|
|
|
.stat-card {
|
|
flex: 1 1 250px;
|
|
background: #fff;
|
|
border-radius: 16px;
|
|
padding: 20px 25px;
|
|
box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
|
|
text-align: center;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.stat-card:hover {
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.stat-value {
|
|
font-size: 2rem;
|
|
font-weight: 700;
|
|
color: #2b3e50;
|
|
}
|
|
|
|
.stat-label {
|
|
font-size: 1rem;
|
|
font-weight: 500;
|
|
color: #6b7a89;
|
|
}
|
|
|
|
.stat-prod {
|
|
background: linear-gradient(135deg, #cde5ff, #dff0ff);
|
|
}
|
|
|
|
.stat-mese {
|
|
background: linear-gradient(135deg, #d2f7d9, #e7ffea);
|
|
}
|
|
|
|
.stat-scarti {
|
|
background: linear-gradient(135deg, #ffe7cc, #fff3df);
|
|
}
|
|
|
|
/* ===== BOTTONI ===== */
|
|
.dashboard-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(200px, 1fr));
|
|
gap: 25px 35px;
|
|
width: 100%;
|
|
max-width: 900px;
|
|
justify-items: center;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.dashboard-grid-bottom {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(200px, 1fr));
|
|
gap: 15px 35px;
|
|
width: 100%;
|
|
max-width: 900px;
|
|
justify-items: center;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.btn-tools {
|
|
background: linear-gradient(135deg, #9f7aea, #b794f4);
|
|
}
|
|
|
|
.dash-btn {
|
|
width: 100%;
|
|
max-width: 280px;
|
|
border: none;
|
|
border-radius: 16px;
|
|
padding: 24px 10px;
|
|
color: #2b3e50;
|
|
font-size: 1.3rem;
|
|
font-weight: 600;
|
|
background: #fff;
|
|
transition: all 0.2s ease;
|
|
box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.dash-btn:hover {
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.dash-icon {
|
|
font-size: 3.2rem;
|
|
margin-bottom: 10px;
|
|
line-height: 1;
|
|
}
|
|
|
|
/* Colori pastello */
|
|
.btn-inserisci {
|
|
background: linear-gradient(135deg, #a4c2f3ff, #c1d8ffff);
|
|
}
|
|
|
|
.btn-visualizza {
|
|
background: linear-gradient(135deg, #82f09eff, #aaecaaff);
|
|
}
|
|
|
|
.btn-statistiche {
|
|
background: linear-gradient(135deg, #ffe0a3ff, #fff1c1ff);
|
|
}
|
|
|
|
.btn-mescole {
|
|
background: linear-gradient(135deg, #ffc853ff, #fdd98bff);
|
|
}
|
|
|
|
.btn-matrici {
|
|
background: linear-gradient(135deg, #ff8585ff, #ff9d9dff);
|
|
}
|
|
|
|
.btn-linee {
|
|
background: linear-gradient(135deg, #b9e3ffff, #d7f1ffff);
|
|
}
|
|
|
|
.btn-programmazione {
|
|
background: linear-gradient(135deg, #7c7afaff, #7c7afaff);
|
|
}
|
|
|
|
.btn-status {
|
|
background: linear-gradient(135deg, #61ce5dff, #61ce5dff);
|
|
}
|
|
|
|
.btn-problem {
|
|
background-color: #ef4444 !important;
|
|
color: #ffffff !important;
|
|
border-radius: 12px;
|
|
}
|
|
|
|
.btn-problem:hover {
|
|
background-color: #dc2626 !important;
|
|
}
|
|
|
|
.btn-tools {
|
|
background: linear-gradient(135deg, #9f7aea, #b794f4);
|
|
}
|
|
|
|
/* 🔹 Nuovo bottone Employees */
|
|
.btn-employees {
|
|
background: linear-gradient(135deg, #a5b4fc, #c7d2fe);
|
|
}
|
|
|
|
/* --- Pulsanti grandi (default) --- */
|
|
.dash-btn-large {
|
|
padding: 18px 10px;
|
|
font-size: 1.3rem;
|
|
}
|
|
|
|
/* --- Pulsanti di servizio: più bassi --- */
|
|
.dash-btn-small {
|
|
padding: 9px 10px !important;
|
|
font-size: 1.05rem !important;
|
|
min-height: 80px;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
.stats-row {
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.dashboard-grid,
|
|
.dashboard-grid-bottom {
|
|
grid-template-columns: 1fr;
|
|
gap: 15px;
|
|
}
|
|
|
|
.dash-btn {
|
|
font-size: 1.2rem;
|
|
padding: 30px 8px;
|
|
}
|
|
|
|
.dash-icon {
|
|
font-size: 2.6rem;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="wrapper toggled">
|
|
<?php include('include/navbar.php'); ?>
|
|
<?php include('include/topbar.php'); ?>
|
|
|
|
<div class="page-wrapper">
|
|
<div class="page-content">
|
|
|
|
<h3 class="dashboard-title">Dashboard Produzione</h3>
|
|
|
|
<!-- ===== STATISTICHE PRINCIPALI ===== -->
|
|
<div class="stats-row">
|
|
<?php
|
|
$db = DBHandlerSelect::getInstance();
|
|
$pdo = $db->getConnection();
|
|
|
|
// Totale odierno
|
|
$stmt = $pdo->query("SELECT SUM(kgprod) AS totale_oggi FROM productiondata WHERE DATE(Data) = CURDATE()");
|
|
$totOggi = number_format($stmt->fetchColumn() ?? 0, 2, ',', '.');
|
|
|
|
// Totale mese
|
|
$stmt = $pdo->query("SELECT SUM(kgprod) AS totale_mese FROM productiondata WHERE MONTH(Data) = MONTH(CURDATE()) AND YEAR(Data) = YEAR(CURDATE())");
|
|
$totMese = number_format($stmt->fetchColumn() ?? 0, 2, ',', '.');
|
|
|
|
// Scarti medi %
|
|
$stmt = $pdo->query("SELECT (SUM(scarto)/NULLIF(SUM(kgprod),0))*100 AS perc_scarto FROM productiondata WHERE MONTH(Data) = MONTH(CURDATE()) AND YEAR(Data) = YEAR(CURDATE())");
|
|
$percScarto = number_format($stmt->fetchColumn() ?? 0, 2, ',', '.');
|
|
?>
|
|
|
|
<div class="stat-card stat-prod">
|
|
<div class="stat-value"><?= $totOggi ?> kg</div>
|
|
<div class="stat-label">Produzione odierna</div>
|
|
</div>
|
|
|
|
<div class="stat-card stat-mese">
|
|
<div class="stat-value"><?= $totMese ?> kg</div>
|
|
<div class="stat-label">Produzione mese corrente</div>
|
|
</div>
|
|
|
|
<div class="stat-card stat-scarti">
|
|
<div class="stat-value"><?= $percScarto ?>%</div>
|
|
<div class="stat-label">Scarto medio mensile</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ===== PRIMA RIGA ===== -->
|
|
<div class="dashboard-grid">
|
|
<button class="dash-btn dash-btn-large btn-programmazione" onclick="location.href='produzione_programmazione_drag.php'">
|
|
<div class="dash-icon">🗓️</div>
|
|
<div>Programmazione</div>
|
|
</button>
|
|
|
|
<button class="dash-btn dash-btn-large btn-status" onclick="location.href='production_line_view2.php'">
|
|
<div class="dash-icon">⚙️</div>
|
|
<div>Line View</div>
|
|
</button>
|
|
|
|
<button class="dash-btn dash-btn-large btn-statistiche" onclick="location.href='production_stats.php'">
|
|
<div class="dash-icon">📈</div>
|
|
<div>Statistiche</div>
|
|
</button>
|
|
|
|
<button class="dash-btn dash-btn-large btn-manager" onclick="location.href='manager_produzione.php'">
|
|
<div class="dash-icon">👔</div>
|
|
<div>Manager</div>
|
|
</button>
|
|
|
|
<button class="dash-btn dash-btn-large btn-manager-stats" onclick="location.href='manager_stats.php'">
|
|
<div class="dash-icon">📊</div>
|
|
<div>Manager Stats</div>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- ===== SECONDA RIGA ===== -->
|
|
<div class="dashboard-grid">
|
|
<button class="dash-btn dash-btn-small btn-mescole" onclick="location.href='mescole.php'">
|
|
<div class="dash-icon">⚗️</div>
|
|
<div>Mescole</div>
|
|
</button>
|
|
|
|
<button class="dash-btn dash-btn-small btn-matrici" onclick="location.href='matrici.php'">
|
|
<div class="dash-icon">🧩</div>
|
|
<div>Elenco Profili</div>
|
|
</button>
|
|
|
|
<button class="dash-btn dash-btn-small btn-linee" onclick="location.href='linee.php'">
|
|
<div class="dash-icon">🏭</div>
|
|
<div>Linee di Produzione</div>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- ===== TERZA RIGA ===== -->
|
|
<div class="dashboard-grid-bottom">
|
|
<button class="dash-btn dash-btn-small btn-inserisci btn-inserisci-status" onclick="location.href='production_status.php'">
|
|
<div class="dash-icon">📋</div>
|
|
<div>Status</div>
|
|
</button>
|
|
|
|
<button class="dash-btn dash-btn-small btn-problem" onclick="location.href='production_pause_reasons.php'">
|
|
<div class="dash-icon">🛑</div>
|
|
<div>Cause di Pausa</div>
|
|
</button>
|
|
|
|
<button class="dash-btn dash-btn-small btn-tools" onclick="location.href='production_tools.php'">
|
|
<div class="dash-icon">🛠️</div>
|
|
<div>Attrezzature</div>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 🔹 QUARTA RIGA: EMPLOYEES -->
|
|
<div class="dashboard-grid-bottom" style="margin-top: 20px;">
|
|
<button class="dash-btn dash-btn-small btn-skills" onclick="location.href='worksheets.php'">
|
|
<div class="dash-icon">🛠️</div>
|
|
<div>Fogli di lavoro</div>
|
|
</button>
|
|
<button class="dash-btn dash-btn-small btn-employees" onclick="location.href='employees.php'">
|
|
<div class="dash-icon">👥</div>
|
|
<div>Employees</div>
|
|
</button>
|
|
<button class="dash-btn dash-btn-small btn-skills" onclick="location.href='skills.php'">
|
|
<div class="dash-icon">🛠️</div>
|
|
<div>Skills</div>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 🔹 Quinta RIGA: EMPLOYEES -->
|
|
<div class="dashboard-grid-bottom" style="margin-top: 20px;">
|
|
<button class="dash-btn dash-btn-small btn-skills" onclick="location.href='suppliers.php'">
|
|
<div class="dash-icon">🛠️</div>
|
|
<div>Suppliers</div>
|
|
</button>
|
|
<button class="dash-btn dash-btn-small btn-skills" onclick="location.href='lookup_values.php'">
|
|
<div class="dash-icon">🛠️</div>
|
|
<div>Setup</div>
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<?php include('jsinclude.php'); ?>
|
|
<?php include('include/footer.php'); ?>
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|