added charts and fixed analysis component

This commit is contained in:
2024-11-22 11:57:39 +01:00
parent 18735127bb
commit 22c95fa063
12 changed files with 1355 additions and 556 deletions
+136 -249
View File
@@ -1,6 +1,4 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
@@ -9,101 +7,67 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<?php include('../include/seo.php'); ?>
<title>EasySpec - Reportify</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Favicon -->
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<!-- Bootstrap CSS -->
<link href="../assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="../assets/css/icons.css" rel="stylesheet" type="text/css">
<link href="../assets/css/style.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/boxicons@2.0.7/css/boxicons.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.js"></script>
<!-- DataTables CSS -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.1/css/buttons.dataTables.min.css">
<!-- SweetAlert CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<!-- Boxicons -->
<link href="https://cdn.jsdelivr.net/npm/boxicons@2.0.7/css/boxicons.min.css" rel="stylesheet">
<style>
.table {
width: 100%;
/* Assicura che la tabella utilizzi tutta la larghezza disponibile */
table-layout: fixed;
/* Opzionale, forza la tabella a rispettare la larghezza assegnata */
}
.table th,
.table td {
.table-custom th,
.table-custom td {
word-wrap: break-word;
/* Previene l'overflow del testo fuori dai confini della cella */
}
.table-custom tr {
height: 40px;
line-height: 40px;
.table td {
white-space: nowrap;
/* Impedisce che i contenuti vadano a capo automaticamente */
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
.table td:first-child {
white-space: normal;
/* Forza il nome dell'analisi ad andare a capo */
word-wrap: break-word;
max-width: 200px;
/* Regola la larghezza massima della cella */
}
.table-custom .btn {
padding: 2px 15px;
line-height: 1.7;
font-size: 14px;
}
.form-row {
display: flex;
align-items: center;
/* Questo allinea verticalmente gli elementi nella riga */
gap: 10px;
/* Questo crea una piccola distanza tra gli elementi nella riga */
}
.table-custom .form-control,
.table-custom .form-select {
height: 25px;
/* Puoi modificare questo valore per adattarlo al tuo design */
padding: 2px 6px;
/* riduce la dimensione del padding */
font-size: 14px;
/* riduce la dimensione del font */
}
.table-custom .form-control-sm.analysis-input {
height: 25px;
/* Questo modifica la dimensione degli input con classe 'form-control-sm' e 'analysis-input' */
padding: 2px 6px;
font-size: 12px;
.table td:last-child .btn {
margin-right: 5px;
/* Aggiunge spazi tra i pulsanti */
}
</style>
</head>
</head>
<body class="fixed-left">
<!-- Loader -->
<div id="preloader">
<div id="status">
<div class="spinner"></div>
</div>
</div>
<!-- Begin page -->
<div id="wrapper">
<?php include('../include/navigationbar.php'); ?>
<!-- Start right Content here -->
<div class="content-page">
<!-- Start content -->
<div class="content">
<?php include('../include/topbar.php'); ?>
<div class="page-content-wrapper ">
<div class="page-content-wrapper">
<div class="container-fluid">
<!-- Page Title -->
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
@@ -117,213 +81,136 @@
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<!-- Action Buttons -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">EasySpec: <?php echo $analysis; ?></h5>
<a class="btn btn-danger" href="insert-analysis.php" role="button">Insert Analysis</a> <a class="btn btn-danger" href="analysis-category.php" role="button">Analysis Category</a> <a class="btn btn-danger" href="rsl.php" role="button">RSL</a> <?php if (isset($action)) {
if ($action == "wizard") { ?><a class="btn btn-dark" href="rsl-wizard.php" role="button">Back to the Wizard</a><?php }
} ?><?php if ($infobox == "wizard") { ?> <a class="btn btn-dark" href="rslwizard1.php" role="button">Back to Wizard</a><?php } ?> <br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong><?php echo $name_analysis_lang; ?></strong></th>
<th><strong><?php echo $description_analysis_lang; ?></strong></th>
<th>Family</th>
<th></th>
</tr>
</thead>
<tbody>
<?php $tablequery = new WA_MySQLi_RS("analysis", $repnew, 0);
$tablequery->setQuery("SELECT * FROM `analysis` LEFT JOIN family_analysis ON family_analysis.idfamilyanalysis=analysis.family_analysis WHERE analysis.company_id='$idcompany'");
$tablequery->execute();
$wa_startindex = 0;
while (!$tablequery->atEnd()) {
$wa_startindex = $tablequery->Index;
?> <tr>
<td><?php echo ($tablequery->getColumnVal("name_analysis")); ?></td>
<td><?php echo ($tablequery->getColumnVal("description_analysis")); ?></td>
<td><?php echo ($tablequery->getColumnVal("namefamily")); ?></td>
<td><a class="btn btn-success" href="update-component-list.php?idanalysis=<?php echo ($tablequery->getColumnVal("idanalysis")); ?>" role="button">Update Component List</a>
<a class="btn btn-warning" href="update-analysis.php?idanalysis=<?php echo htmlspecialchars($tablequery->getColumnVal('idanalysis')); ?>" role="button">
<i class="fas fa-pencil-alt text-white"></i>
</a>
<a class="btn btn-danger" onclick="confirmDeletion(<?php echo htmlspecialchars($tablequery->getColumnVal('idanalysis')); ?>);" role="button">
<i class="fas fa-trash-alt text-white"></i>
</a>
</td>
</tr>
<?php $tablequery->moveNext();
}
$tablequery->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?></tbody>
</table>
</div><!--end table-responsive-->
<h5 class="header-title pb-3 mt-0">EasySpec</h5>
<a class="btn btn-danger" href="insert-analysis.php" role="button">Insert Analysis</a>
<a class="btn btn-danger" href="analysis-category.php" role="button">Analysis Category</a>
<a class="btn btn-danger" href="rsl.php" role="button">RSL</a>
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
function confirmDeletion(idAnalysis) {
Swal.fire({
title: 'Do you want to cancel the analysis?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = `cancel-analysis.php?idanalysis=${idAnalysis}`;
}
});
}
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-btn');
<!-- DataTable -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="datatable-analysis" class="table table-striped table-sm table-custom">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Family</th>
<th>SuperGroup</th>
<th>Analysis Code</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
$tablequery = new WA_MySQLi_RS("analysis", $repnew, 0);
$tablequery->setQuery("SELECT * FROM `analysisvocabulary`
LEFT JOIN family_analysis ON family_analysis.idfamilyanalysis = analysisvocabulary.family_analysis
LEFT JOIN supergroup ON analysisvocabulary.supergroup=supergroup.idsupergroup
WHERE analysisvocabulary.preferred = 'Y'
ORDER BY analysisvocabulary.nameanalysisvoc");
$tablequery->execute();
// Aggiungiamo un ascoltatore d'evento a ciascun bottone
cloneBtns.forEach(cloneBtn => {
cloneBtn.addEventListener('click', function(e) {
// Preveniamo il comportamento predefinito del link
e.preventDefault();
while (!$tablequery->atEnd()) {
?>
<tr>
<td><?php echo $tablequery->getColumnVal("nameanalysisvoc"); ?></td>
<td><?php echo $tablequery->getColumnVal("description_analysis"); ?></td>
<td><?php echo $tablequery->getColumnVal("namefamily"); ?></td>
<td><?php echo $tablequery->getColumnVal("name"); ?></td>
<td><?php echo $tablequery->getColumnVal("analysiscode"); ?></td>
<td>
<a class="btn btn-success" href="update-component-list.php?idanalysis=<?php echo $tablequery->getColumnVal('idanalysisvocabulary'); ?>">Component List</a>
<a class="btn btn-warning" href="update-analysis.php?idanalysis=<?php echo htmlspecialchars($tablequery->getColumnVal('idanalysisvocabulary')); ?>"><i class="fas fa-pencil-alt text-white"></i></a>
<a class="btn btn-danger" onclick="confirmDeletion(<?php echo htmlspecialchars($tablequery->getColumnVal('idanalysisvocabulary')); ?>);"><i class="fas fa-trash-alt text-white"></i></a>
</td>
</tr>
<?php
$tablequery->moveNext();
}
$tablequery->moveFirst();
?>
</tbody>
</table>
Swal.fire({
title: 'Clone TRL',
text: "Do you want to clone the TRL?",
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
}).then((result) => {
if (result.isConfirmed) {
// Se confermato, andiamo al link originale
window.location.href = cloneBtn.getAttribute('href');
}
});
});
});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.rev-btn');
</div>
</div>
</div>
</div>
</div>
// Aggiungiamo un ascoltatore d'evento a ciascun bottone
cloneBtns.forEach(cloneBtn => {
cloneBtn.addEventListener('click', function(e) {
// Preveniamo il comportamento predefinito del link
e.preventDefault();
</div>
</div>
Swal.fire({
title: 'Revise TRL',
text: "Do you want to Revise the TRL?",
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
}).then((result) => {
if (result.isConfirmed) {
// Se confermato, andiamo al link originale
window.location.href = cloneBtn.getAttribute('href');
}
});
});
});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.canc-btn');
// Aggiungiamo un ascoltatore d'evento a ciascun bottone
cloneBtns.forEach(cloneBtn => {
cloneBtn.addEventListener('click', function(e) {
// Preveniamo il comportamento predefinito del link
e.preventDefault();
Swal.fire({
title: 'Cancel TRL',
text: "Do you want to cancel the TRL?",
icon: 'danger',
showCancelButton: true,
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
}).then((result) => {
if (result.isConfirmed) {
// Se confermato, andiamo al link originale
window.location.href = cloneBtn.getAttribute('href');
}
});
});
});
});
</script>
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
</div>
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<!-- Bootstrap JS -->
<script src="../assets/js/bootstrap.min.js"></script>
<!-- DataTables JS -->
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.print.min.js"></script>
<!-- SweetAlert2 JS -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.js"></script>
<!-- DataTable Initialization -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
$('#datatable-analysis').DataTable({
dom: 'lBfrtip',
buttons: ['copy', 'csv', 'excel', 'pdf', 'print'],
paging: true,
searching: true,
pageLength: 50,
ordering: true,
responsive: true,
language: {
url: "https://cdn.datatables.net/plug-ins/1.13.6/i18n/en-GB.json"
}
});
});
function confirmDeletion(idAnalysis) {
Swal.fire({
title: 'Do you want to cancel the analysis?',
text: "The Analysis will be deactivated!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = `cancel-analysis.php?idanalysis=${idAnalysis}`;
}
});
}
</script>
<!-- plugin JS -->
<script src="../assets/js/jquery.min.js"></script>
<script src="../assets/js/popper.min.js"></script>
<script src="../assets/js/bootstrap.min.js"></script>
<script src="../assets/js/modernizr.min.js"></script>
<script src="../assets/js/detect.js"></script>
<script src="../assets/js/fastclick.js"></script>
<script src="../assets/js/jquery.slimscroll.js"></script>
<script src="../assets/js/jquery.blockUI.js"></script>
<script src="../assets/js/waves.js"></script>
<script src="../assets/js/jquery.nicescroll.js"></script>
<script src="../assets/js/jquery.scrollTo.min.js"></script>
<script src="../assets/plugins/chart.js/chart.min.js"></script>
<script src="../assets/pages/dashboard.js"></script>
<!-- App js -->
<script src="../assets/js/app.js"></script>
</body>
</html>