342 lines
13 KiB
PHP
342 lines
13 KiB
PHP
<?php include('include/headscript.php');
|
|
if (isset($_SESSION["tempcode"])) {
|
|
unset($_SESSION["tempcode"]);
|
|
}
|
|
|
|
/*
|
|
* $db è l'istanza di DBHandlerSelect, resa disponibile in headscript.php:
|
|
* require_once(__DIR__ . '/../class/db-functions.php');
|
|
* $db = DBHandlerSelect::getInstance();
|
|
*
|
|
* Tutte le query qui sotto sono parametrizzate (niente più variabili
|
|
* dentro la stringa SQL => niente SQL injection).
|
|
*/
|
|
|
|
// N. TRF dell'utente loggato
|
|
$numbertrfuser = $db->count(
|
|
"SELECT idtrfdetails FROM `trf-details` WHERE iduser = ?",
|
|
[$iduserlogin]
|
|
);
|
|
|
|
// N. TRF della company
|
|
$numbertrfcompany = $db->count(
|
|
"SELECT idtrfdetails FROM `trf-details` WHERE idcompany = ?",
|
|
[$idcompany]
|
|
);
|
|
|
|
// N. parti totali collegate ai TRF dell'utente
|
|
// NOTA: l'originale usava $user (oggetto Auth), qui uso $iduserlogin per coerenza.
|
|
$totalpartstrf = $db->count(
|
|
"SELECT identificationparts.ididentificationparts
|
|
FROM identificationparts
|
|
LEFT JOIN `trf-details`
|
|
ON identificationparts.idtrfdetails = `trf-details`.idtrfdetails
|
|
WHERE `trf-details`.iduser = ?",
|
|
[$iduserlogin]
|
|
);
|
|
|
|
// Modulo "GO" in sospeso (secondo certificato non ancora firmato)
|
|
$modulego = $db->selectOne(
|
|
"SELECT csgo FROM `trf-details`
|
|
WHERE iduser = ? AND csgo = 'Y' AND signedonsecondcert IS NULL
|
|
LIMIT 1",
|
|
[$iduserlogin]
|
|
);
|
|
$csgoyes = (!empty($modulego['csgo'])) ? 'Y' : null;
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title><?php echo $titlepage; ?> </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
<meta content="CIMAC TRF Portal" name="description" />
|
|
<meta content="" name="author" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
|
|
<!-- App favicon -->
|
|
<link rel="shortcut icon" href="../images/favicon.ico">
|
|
|
|
<!--Form Wizard-->
|
|
<link href="../plugins/jquery-steps/jquery.steps.css" rel="stylesheet" type="text/css">
|
|
|
|
<!-- App css -->
|
|
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="assets/css/jquery-ui.min.css" rel="stylesheet">
|
|
<link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="assets/css/metisMenu.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="assets/css/app.min.css" rel="stylesheet" type="text/css" />
|
|
<style>
|
|
:root {
|
|
--brand: #6588f1;
|
|
--brand-dark: #4755d6;
|
|
--brand-soft: #eef2fe;
|
|
}
|
|
|
|
/* --- Bottoni azione principali --- */
|
|
.btn-action {
|
|
border: none;
|
|
padding: 22px 20px;
|
|
font-size: 1.35rem;
|
|
font-weight: 600;
|
|
letter-spacing: .2px;
|
|
border-radius: 14px;
|
|
color: #fff;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 12px;
|
|
box-shadow: 0 6px 18px rgba(71, 85, 214, .18);
|
|
transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
|
|
}
|
|
|
|
.btn-action i {
|
|
font-size: 1.5rem;
|
|
opacity: .9;
|
|
}
|
|
|
|
.btn-action:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 10px 24px rgba(71, 85, 214, .28);
|
|
color: #fff;
|
|
}
|
|
|
|
.btn-action-primary {
|
|
background-color: var(--brand-dark);
|
|
}
|
|
|
|
.btn-action-primary:hover {
|
|
background-color: #3b48c4;
|
|
}
|
|
|
|
.btn-action-secondary {
|
|
background-color: var(--brand);
|
|
}
|
|
|
|
.btn-action-secondary:hover {
|
|
background-color: var(--brand-dark);
|
|
}
|
|
|
|
.btn-block {
|
|
display: flex;
|
|
width: 100%;
|
|
}
|
|
|
|
/* --- Card dati / statistiche --- */
|
|
.stat-card {
|
|
border: none;
|
|
border-radius: 14px;
|
|
box-shadow: 0 2px 10px rgba(20, 30, 70, .06);
|
|
transition: transform .18s ease, box-shadow .18s ease;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.stat-card:hover {
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 10px 22px rgba(20, 30, 70, .12);
|
|
}
|
|
|
|
.stat-card .stat-icon {
|
|
width: 54px;
|
|
height: 54px;
|
|
border-radius: 14px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 1.4rem;
|
|
}
|
|
|
|
.stat-card .stat-label {
|
|
font-size: .78rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: .6px;
|
|
color: #8a94a6;
|
|
margin-bottom: 2px;
|
|
}
|
|
|
|
.stat-card .stat-value {
|
|
font-size: 1.9rem;
|
|
font-weight: 700;
|
|
line-height: 1;
|
|
color: #2a3142;
|
|
}
|
|
|
|
.icon-users {
|
|
background: #e7f6ee;
|
|
color: #2fb87a;
|
|
}
|
|
|
|
.icon-company {
|
|
background: #fdeef4;
|
|
color: #e668a0;
|
|
}
|
|
|
|
.icon-parts {
|
|
background: #f0ecfd;
|
|
color: #8b6ff0;
|
|
}
|
|
|
|
.icon-reg {
|
|
background: #fdf4e6;
|
|
color: #e0a13a;
|
|
}
|
|
|
|
/* --- Header profilo utente --- */
|
|
.welcome-card {
|
|
border: none;
|
|
border-radius: 16px;
|
|
background: linear-gradient(135deg, var(--brand-soft) 0%, #ffffff 60%);
|
|
box-shadow: 0 2px 12px rgba(20, 30, 70, .05);
|
|
}
|
|
|
|
.welcome-card .avatar {
|
|
border: 3px solid #fff;
|
|
box-shadow: 0 3px 10px rgba(20, 30, 70, .12);
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- Top Bar Start -->
|
|
<?php include('include/topbar.php'); ?>
|
|
<!-- Top Bar End -->
|
|
|
|
<!-- Left Sidenav -->
|
|
<?php include('include/leftsidenav.php'); ?>
|
|
<!-- end left-sidenav-->
|
|
|
|
<div class="page-wrapper">
|
|
<!-- Page Content-->
|
|
<div class="page-content">
|
|
|
|
<div class="container-fluid">
|
|
<!-- Page-Title -->
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="page-title-box">
|
|
<div class="float-right">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="javascript:void(0);"><?php echo $titlepage; ?></a></li>
|
|
<li class="breadcrumb-item active">Starter</li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title"><?php echo $titlewb; ?></h4>
|
|
</div><!--end page-title-box-->
|
|
</div><!--end col-->
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="card welcome-card mb-4">
|
|
<div class="card-body">
|
|
<div class="media">
|
|
<img src="upload/users/<?php echo $avatarname; ?>" alt="" class="avatar thumb-md rounded-circle mr-3">
|
|
<div class="media-body align-self-center">
|
|
<h4 class="mt-0 mb-1"><?php echo $welcomeuser; ?><?php echo $nameuser; ?></h4>
|
|
<p class="text-muted mb-0 font-14 pr-5"><?php echo $welcome_help; ?></p>
|
|
</div><!--end media-body-->
|
|
</div><!--end media-->
|
|
|
|
<!-- Due tasti azione -->
|
|
<div class="row mt-4">
|
|
<div class="col-md-4 mb-3">
|
|
<a href="typeofcertificatenew.php?varcertificate=m&certotherclient=N" class="btn-action btn-action-primary btn-block">
|
|
<i class="fas fa-plus"></i> <?php echo $insertnewrequest; ?>
|
|
</a>
|
|
</div>
|
|
<div class="col-md-4 mb-3">
|
|
<a href="archivetrf.php" class="btn-action btn-action-secondary btn-block">
|
|
<i class="fas fa-archive"></i> <?php echo $showarchive; ?>
|
|
</a>
|
|
</div>
|
|
</div><!--end row dei tasti -->
|
|
</div><!--end card-body-->
|
|
</div><!--end card-->
|
|
|
|
<!-- Riquadri con i numeri -->
|
|
<div class="row">
|
|
<div class="col-sm-3 mb-3">
|
|
<div class="card stat-card h-100">
|
|
<div class="card-body d-flex align-items-center">
|
|
<div class="stat-icon icon-users mr-3">
|
|
<i class="far fa-user"></i>
|
|
</div>
|
|
<div>
|
|
<p class="stat-label"><?php echo $numbertrfusertitle; ?></p>
|
|
<div class="stat-value"><?php echo $numbertrfuser; ?></div>
|
|
</div>
|
|
</div><!--end card-body-->
|
|
</div><!--end card-->
|
|
</div><!--end col-->
|
|
|
|
<div class="col-sm-3 mb-3">
|
|
<div class="card stat-card h-100">
|
|
<div class="card-body d-flex align-items-center">
|
|
<div class="stat-icon icon-company mr-3">
|
|
<i class="fas fa-chess-rook"></i>
|
|
</div>
|
|
<div>
|
|
<p class="stat-label"><?php echo $numbertrfcompanytitle; ?></p>
|
|
<div class="stat-value"><?php echo $numbertrfcompany; ?></div>
|
|
</div>
|
|
</div><!--end card-body-->
|
|
</div><!--end card-->
|
|
</div><!--end col-->
|
|
|
|
<div class="col-sm-3 mb-3">
|
|
<div class="card stat-card h-100">
|
|
<div class="card-body d-flex align-items-center">
|
|
<div class="stat-icon icon-parts mr-3">
|
|
<i class="fas fa-angle-double-up"></i>
|
|
</div>
|
|
<div>
|
|
<p class="stat-label"><?php echo $partsnumbertitle; ?></p>
|
|
<div class="stat-value"><?php echo $totalpartstrf; ?></div>
|
|
</div>
|
|
</div><!--end card-body-->
|
|
</div><!--end card-->
|
|
</div><!--end col-->
|
|
|
|
<div class="col-sm-3 mb-3">
|
|
<div class="card stat-card h-100">
|
|
<div class="card-body d-flex align-items-center">
|
|
<div class="stat-icon icon-reg mr-3">
|
|
<i class="far fa-registered"></i>
|
|
</div>
|
|
<div>
|
|
<p class="stat-label"> </p>
|
|
<div class="stat-value">-</div>
|
|
</div>
|
|
</div><!--end card-body-->
|
|
</div><!--end card-->
|
|
</div><!--end col-->
|
|
</div><!--end row-->
|
|
</div><!--end col-->
|
|
</div><!--end row-->
|
|
</div><!-- container -->
|
|
<!-- footer start -->
|
|
<?php include('include/footer.php'); ?>
|
|
</div>
|
|
<!-- end page content -->
|
|
</div>
|
|
<!-- end page-wrapper -->
|
|
|
|
<!-- jQuery -->
|
|
<script src="assets/js/jquery.min.js"></script>
|
|
<script src="assets/js/bootstrap.bundle.min.js"></script>
|
|
<script src="assets/js/metismenu.min.js"></script>
|
|
<script src="assets/js/waves.js"></script>
|
|
<script src="assets/js/feather.min.js"></script>
|
|
<script src="assets/js/jquery.slimscroll.min.js"></script>
|
|
<script src="assets/js/jquery-ui.min.js"></script>
|
|
|
|
<script src="../plugins/jquery-steps/jquery.steps.min.js"></script>
|
|
<script src="assets/pages/jquery.form-wizard.init.js"></script>
|
|
|
|
<!-- App js -->
|
|
<script src="assets/js/app.js"></script>
|
|
</body>
|
|
|
|
</html>
|