first commit

This commit is contained in:
claus75a
2024-06-10 10:07:23 +02:00
parent e43b9b4b28
commit c76565c1a3
226 changed files with 24944 additions and 531 deletions
+203
View File
@@ -0,0 +1,203 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<?php if (isset($_GET['idanalysis'])) {
$idanalysis = $_GET['idanalysis'];
}
if (isset($_GET['idanalysisrsl'])) {
$idanalysisrsl = $_GET['idanalysisrsl'];
}
if (isset($_GET['idmaterial'])) {
$idmaterial = $_GET['idmaterial'];
}
if (isset($_POST['idanalysis'])) {
$idanalysis = $_POST['idanalysis'];
}
if (isset($_POST['idanalysisrsl'])) {
$idanalysisrsl = $_POST['idanalysisrsl'];
}
if (isset($_POST['idmaterial'])) {
$idmaterial = $_POST['idmaterial'];
}
if (isset($_POST['comment'])) {
$comment = $_POST['comment'];
}
if (isset($_POST['updmeth'])) {
$updmeth = $_POST['updmeth'];
}
?>
<?php if (isset($updmeth)) {
// echo "Ciao";
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`analysis_rsl`";
$UpdateQuery->bindColumn("comment_anrsl", "s", "" . ((isset($_POST["comment"])) ? $_POST["comment"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("idanalysis_rsl", "=", "i", "" . ($_POST['idanalysisrsl']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
$analysisdet = new WA_MySQLi_RS("analysisdet", $repnew, 1);
$analysisdet->setQuery("SELECT * FROM analysis WHERE analysis.idanalysis='$idanalysis'");
$analysisdet->execute(); ?>
<?php
$materialdet = new WA_MySQLi_RS("materialdet", $repnew, 1);
$materialdet->setQuery("SELECT * FROM material_type WHERE material_type.idmaterial_type='$idmaterial'");
$materialdet->execute(); ?>
<?php
$analrsldet = new WA_MySQLi_RS("analrsldet", $repnew, 1);
$analrsldet->setQuery("SELECT * FROM analysis_rsl WHERE analysis_rsl.idanalysis_rsl='$idanalysisrsl'");
$analrsldet->execute();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="alert alert-primary" role="alert">
<?php echo $addcommtitle; ?><?php echo ($analysisdet->getColumnVal("name_analysis")); ?><?php echo $addcommattitle; ?><?php echo $materialdet->getColumnVal("name_material"); ?>
</div>
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">xxxx</h5>
<div class="table-responsive">
<form method="post" title="querysearch" id="querysearch">
<textarea class="form-control" name="comment" id="comment"><?php echo ($analrsldet->getColumnVal("comment_anrsl")); ?></textarea>
<script>
tinymce.init({
selector: '#comment'
});
</script>
<input type="hidden" id="idanalysisrsl" name="idanalysisrsl" value="<?php echo $idanalysisrsl; ?>">
<input type="hidden" id="idmaterial" name="idmaterial" value="<?php echo $idmaterial; ?>">
<input type="hidden" id="idanalysis" name="idanalysis" value="<?php echo $idanalysis; ?>">
<input type="hidden" id="updmeth" name="updmeth" value="Y">
<input type="submit">
<script>
function Setcontent() {
var ContentSet = tinymce.get('comment').setContent('Hello World');
}
</script>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div><button onclick="self.close()" type="button" class="btn btn-success waves-effect waves-light"><?php echo $closewindowtitle; ?></button>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<!-- 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>
@@ -0,0 +1,318 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">EasySpec: Analysis Category</h5>
<a href="insert-analysiscategory.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">New Analysis Category</button></a>
<a class="btn btn-danger" href="insert-rsl.php" role="button"><?php echo $insertnewrsltitle; ?></a> <a class="btn btn-danger" href="rsl-category.php" role="button">RSL Category</a> <a class="btn btn-danger" href="material.php" role="button"><?php echo $materialstitle; ?></a> <a class="btn btn-danger" href="analysis.php" role="button">Analysis</a><?php if ($infobox == "wizard") { ?> <a class="btn btn-dark" href="rslwizard1.php" role="button">Back to Wizard</a><?php } ?>
<a href="component.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Components</button></a>
<a href="standards.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Standards</button></a>
<br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong>Analysis Category Name</strong></th>
<th><strong></strong></th>
</tr>
</thead>
<tbody>
<?php $rsllist = new WA_MySQLi_RS("rsl", $repnew, 0);
$rsllist->setQuery("SELECT * FROM family_analysis ORDER BY family_analysis.namefamily");
$rsllist->execute();
$wa_startindex = 0;
while (!$rsllist->atEnd()) {
$wa_startindex = $rsllist->Index;
?> <tr>
<td><?php echo ($rsllist->getColumnVal("namefamily")); ?></td>
<td>
<a class="btn btn-warning" href="update-analysiscategory.php?idfamilyanalysis=<?php echo htmlspecialchars($rsllist->getColumnVal('idfamilyanalysis')); ?>" role="button">
<i class="fas fa-pencil-alt text-white"></i>
</a>
<a class="btn btn-danger" role="button" onclick="confirmDeletionWithSweetAlert(<?php echo htmlspecialchars($rsllist->getColumnVal('idfamilyanalysis')); ?>);">
<i class="fas fa-trash-alt text-white"></i>
</a>
</td>
</tr>
<?php $rsllist->moveNext();
}
$rsllist->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?></tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
function confirmDeletionWithSweetAlert(idfamilyanalysis) {
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-analysiscategory.php?idfamilyanalysis=${idfamilyanalysis}`;
}
});
}
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-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: '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');
// 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: '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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+329
View File
@@ -0,0 +1,329 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<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 {
word-wrap: break-word;
/* Previene l'overflow del testo fuori dai confini della cella */
}
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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-->
</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');
// 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: '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');
// 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: '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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,295 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">EasySpec: Analysis Category</h5>
<a class="btn btn-danger" href="insert-rsl.php" role="button"><?php echo $insertnewrsltitle; ?></a> <a class="btn btn-danger" href="rsl-category.php" role="button">RSL Category</a> <a class="btn btn-danger" href="material.php" role="button"><?php echo $materialstitle; ?></a> <a class="btn btn-danger" href="analysis.php" role="button">Analysis</a><?php if ($infobox == "wizard") { ?> <a class="btn btn-dark" href="rslwizard1.php" role="button">Back to Wizard</a><?php } ?>
<a href="component.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Components</button></a>
<a href="standards.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Standards</button></a>
<br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong>Analysis Category Name</strong></th>
<th><strong></strong></th>
</tr>
</thead>
<tbody>
<?php $rsllist = new WA_MySQLi_RS("rsl", $repnew, 0);
$rsllist->setQuery("SELECT * FROM family_analysis ORDER BY family_analysis.namefamily");
$rsllist->execute();
$wa_startindex = 0;
while (!$rsllist->atEnd()) {
$wa_startindex = $rsllist->Index;
?> <tr>
<td><?php echo ($rsllist->getColumnVal("namefamily")); ?></td>
<td>
<a class="btn btn-primary rev-btn" href="rev-rsl.php?id=<?php echo ($rsllist->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Revision"><i class="fa fa-history font-size-16 align-middle"></i></a>
<a class="btn btn-warning clone-btn" href="clone-rsl.php?id=<?php echo ($rsllist->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Clone"><i class="far fa-clone font-size-16 align-middle"></i></a>
</td>
</tr>
<?php $rsllist->moveNext();
}
$rsllist->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?></tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-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: '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');
// 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: '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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,126 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<div class="table-responsive">
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "../../.."
}
],
"settings": {}
}
@@ -0,0 +1,203 @@
<?php include('../include/headscript.php'); ?>
<?php include("class/company.php");
?>
?>
<?php if (isset($_GET['idanalysis'])) {
$idanalysis = $_GET['idanalysis'];
}
if (isset($_GET['idanalysisrsl'])) {
$idanalysisrsl = $_GET['idanalysisrsl'];
}
if (isset($_GET['idmaterial'])) {
$idmaterial = $_GET['idmaterial'];
}
if (isset($_POST['idanalysis'])) {
$idanalysis = $_POST['idanalysis'];
}
if (isset($_POST['idanalysisrsl'])) {
$idanalysisrsl = $_POST['idanalysisrsl'];
}
if (isset($_POST['idmaterial'])) {
$idmaterial = $_POST['idmaterial'];
}
if (isset($_POST['comment'])) {
$comment = $_POST['comment'];
}
if (isset($_POST['updmeth'])) {
$updmeth = $_POST['updmeth'];
}
?>
<?php if (isset($updmeth)) {
// echo "Ciao";
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`analysis_rsl`";
$UpdateQuery->bindColumn("comment_anrsl", "s", "" . ((isset($_POST["comment"])) ? $_POST["comment"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("idanalysis_rsl", "=", "i", "" . ($_POST['idanalysisrsl']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
$analysisdet = new WA_MySQLi_RS("analysisdet", $repnew, 1);
$analysisdet->setQuery("SELECT * FROM analysis WHERE analysis.idanalysis='$idanalysis'");
$analysisdet->execute(); ?>
<?php
$materialdet = new WA_MySQLi_RS("materialdet", $repnew, 1);
$materialdet->setQuery("SELECT * FROM material_type WHERE material_type.idmaterial_type='$idmaterial'");
$materialdet->execute(); ?>
<?php
$analrsldet = new WA_MySQLi_RS("analrsldet", $repnew, 1);
$analrsldet->setQuery("SELECT * FROM analysis_rsl WHERE analysis_rsl.idanalysis_rsl='$idanalysisrsl'");
$analrsldet->execute();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="alert alert-primary" role="alert">
<?php echo $addcommtitle; ?><?php echo ($analysisdet->getColumnVal("name_analysis")); ?><?php echo $addcommattitle; ?><?php echo $materialdet->getColumnVal("name_material"); ?>
</div>
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">xxxx</h5>
<div class="table-responsive">
<form method="post" title="querysearch" id="querysearch">
<textarea name="comment" id="comment"><?php echo ($analrsldet->getColumnVal("comment_anrsl")); ?></textarea>
<script>
tinymce.init({
selector: '#comment'
});
</script>
<input type="hidden" id="idanalysisrsl" name="idanalysisrsl" value="<?php echo $idanalysisrsl; ?>">
<input type="hidden" id="idmaterial" name="idmaterial" value="<?php echo $idmaterial; ?>">
<input type="hidden" id="idanalysis" name="idanalysis" value="<?php echo $idanalysis; ?>">
<input type="hidden" id="updmeth" name="updmeth" value="Y">
<input type="submit">
<script>
function Setcontent() {
var ContentSet = tinymce.get('comment').setContent('Hello World');
}
</script>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div><button onclick="self.close()" type="button" class="btn btn-success waves-effect waves-light"><?php echo $closewindowtitle; ?></button>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<!-- 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>
@@ -0,0 +1,16 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
?>
<?php if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "`analysis`";
$DeleteQuery->addFilter("idanalysis", "=", "i", "" . ($_GET['idanalysis']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "analysis.php";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
@@ -0,0 +1,16 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
?>
<?php if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "`family_analysis`";
$DeleteQuery->addFilter("idfamilyanalysis", "=", "i", "" . ($_GET['idfamilyanalysis']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "analysis-category.php";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
@@ -0,0 +1,18 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php $idrsl = $_GET['id']; ?>
<?php $material_id = $_GET['material_id']; ?>
<?php $idmaterial_rsl = $_GET['idmaterial_rsl']; ?>
<?php
if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "analysis_rsl";
$DeleteQuery->addFilter("idanalysis_rsl", "=", "i", "" . ($_GET['idanalysis_rsl']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "detail-rsl.php?id=$idrsl&material_id=$material_id&idmaterial_rsl=$idmaterial_rsl";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
@@ -0,0 +1,14 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "`component_family`";
$DeleteQuery->addFilter("idcomponentfamily", "=", "i", "" . ($_GET['idcomponentfamily']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "component-family.php";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
@@ -0,0 +1,15 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "`component`";
$DeleteQuery->addFilter("idcomponent", "=", "i", "" . ($_GET['idcomponent']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "component.php";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
@@ -0,0 +1,18 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
$idanalysis = $_GET['idanalysis'];
?>
<?php
if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "analysis_component";
$DeleteQuery->addFilter("idanalysiscomponent", "=", "i", "" . ($_GET['idanalysiscomponent']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "update-component-list.php?idanalysis=$idanalysis";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
@@ -0,0 +1,14 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "`material_type`";
$DeleteQuery->addFilter("idmaterial_type", "=", "i", "" . ($_GET['idmaterial_type']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "material.php";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
?>
@@ -0,0 +1,17 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<?php $idrsl = $_GET['id']; ?>
<?php
if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "material_rsl";
$DeleteQuery->addFilter("idmaterial_rsl", "=", "i", "" . ($_GET['idmaterial_rsl']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "material-rsl.php?id=$idrsl";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
@@ -0,0 +1,14 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "`rsl_category`";
$DeleteQuery->addFilter("idrslcat", "=", "i", "" . ($_GET['idrslcat']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "rsl-category.php";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
+62
View File
@@ -0,0 +1,62 @@
<?php
require_once(BASE_URL . 'Connections/repnew.php');
// Connessione al database
$conn = new mysqli($servername, $username, $password, $database);
// Controllo connessione
if ($conn->connect_error) {
die("Connessione fallita: " . $conn->connect_error);
}
// Preleva l'ID dal parametro GET
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
if ($id > 0) {
// Cancella i record correlati dalla tabella material_rsl
$query_material_rsl = "DELETE FROM material_rsl WHERE rsl_id = ?";
$stmt_material_rsl = $conn->prepare($query_material_rsl);
$stmt_material_rsl->bind_param("i", $id);
if (!$stmt_material_rsl->execute()) {
echo "Errore durante la cancellazione dei record da material_rsl: " . $stmt_material_rsl->error;
$stmt_material_rsl->close();
$conn->close();
exit;
}
$stmt_material_rsl->close();
// Cancella i record correlati dalla tabella analysis_rsl
$query_analysis_rsl = "DELETE FROM analysis_rsl WHERE rsl_id = ?";
$stmt_analysis_rsl = $conn->prepare($query_analysis_rsl);
$stmt_analysis_rsl->bind_param("i", $id);
if (!$stmt_analysis_rsl->execute()) {
echo "Errore durante la cancellazione dei record da analysis_rsl: " . $stmt_analysis_rsl->error;
$stmt_analysis_rsl->close();
$conn->close();
exit;
}
$stmt_analysis_rsl->close();
// Cancella il record dalla tabella rsl
$query_rsl = "DELETE FROM rsl WHERE id = ?";
$stmt_rsl = $conn->prepare($query_rsl);
$stmt_rsl->bind_param("i", $id);
if ($stmt_rsl->execute()) {
echo "Record e record correlati cancellati con successo!";
} else {
echo "Errore durante la cancellazione del record da rsl: " . $stmt_rsl->error;
}
$stmt_rsl->close();
} else {
echo "ID non valido.";
}
$conn->close();
// Reindirizza all'utente verso rsl.php
header('Location: rsl.php');
@@ -0,0 +1,14 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php if (true) {
$DeleteQuery = new WA_MySQLi_Query($repnew);
$DeleteQuery->Action = "delete";
$DeleteQuery->Table = "`standards`";
$DeleteQuery->addFilter("idstandards", "=", "i", "" . ($_GET['id']) . "");
$DeleteQuery->execute();
$DeleteGoTo = "standards.php";
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo ? rel2abs($DeleteGoTo, dirname(__FILE__)) : "";
$DeleteQuery->redirect($DeleteGoTo);
}
?>
@@ -0,0 +1,6 @@
<?php
$checkanpr = new WA_MySQLi_RS("checkanpr", $repnew, 1);
$checkanpr->setQuery("SELECT * FROM analysis_rsl WHERE analysis_rsl.analysis_id='$idanalysis' AND analysis_rsl.rsl_id='$idrsl' AND analysis_rsl.material_id='$idmaterial_type'");
$checkanpr->execute();
?>
@@ -0,0 +1,7 @@
<?php
$checkcomp = new WA_MySQLi_RS("checkcomp", $repnew, 1);
$checkcomp->setQuery("SELECT * FROM analysis_component WHERE analysis_component.idanalysis='$idanalysis' AND analysis_component.idcomponent='$idcomponent'");
$checkcomp->execute();
?>
@@ -0,0 +1,7 @@
<?php
$checkmatpr = new WA_MySQLi_RS("checkmatpr", $repnew, 1);
$checkmatpr->setQuery("SELECT * FROM material_rsl WHERE material_rsl.material_id='$idmaterial_type' AND material_rsl.rsl_id='$idrsl'");
$checkmatpr->execute();
?>
@@ -0,0 +1,290 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $component; ?> Family</h5>
<a class="btn btn-danger" href="insert-component-family.php" role="button">Insert New Component Family</a> <a class="btn btn-danger" href="component.php" role="button">Components</a> <button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button> <br><br>
<script>
function goBack() {
window.history.back();
}
</script>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0" id="table-search">
<thead>
<tr>
<th><strong><?php echo $name_componentfamily_lang; ?></strong></th>
<th><strong><?php echo $description_componentfamily_lang; ?></strong></th>
<th><strong><?php echo $labfamily_component_lang; ?></strong></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php $tablequery = new WA_MySQLi_RS("component_family", $repnew, 0);
$tablequery->setQuery("SELECT * FROM `component_family` LEFT JOIN component_family_type ON component_family.component_family_type=component_family_type.idcomponentfamilytype WHERE `component_family`.company_id='$idcompany' OR `component_family`.company_id IS NULL");
$tablequery->execute();
$wa_startindex = 0;
while (!$tablequery->atEnd()) {
$wa_startindex = $tablequery->Index;
?> <tr>
<td><?php echo ($tablequery->getColumnVal("name_componentfamily")); ?></td>
<td><?php echo ($tablequery->getColumnVal("description_componentfamily")); ?></td>
<td><?php echo ($tablequery->getColumnVal("name_componentfamilytype")); ?></td>
<td>
<?php
$compidcompany = $tablequery->getColumnVal("company_id");
if ($compidcompany == $idcompany) { ?>
<a class="btn btn-danger" href="update-component-family.php?idcomponentfamily=<?php echo ($tablequery->getColumnVal("idcomponentfamily")); ?>" role="button">E</a><?php } ?>
</td>
<td><?php
if ($compidcompany == $idcompany) { ?><a class="btn btn-danger" href="cancel-component-family.php?idcomponentfamily=<?php echo ($tablequery->getColumnVal("idcomponentfamily")); ?>" role="button">C</a><?php } ?></td>
</tr>
<?php $tablequery->moveNext();
}
$tablequery->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?></tbody>
</table>
</div><br>
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
document.addEventListener("DOMContentLoaded", function() {
const componentInput = document.getElementById("filter-component");
const descriptionInput = document.getElementById("filter-description");
const casInput = document.getElementById("filter-cas");
const formulaInput = document.getElementById("filter-formula");
const familyInput = document.getElementById("filter-family");
const tableBody = document.getElementById("table-data").getElementsByTagName("tbody")[0];
// Memorizza il contenuto originale della tabella
const originalTableContent = tableBody.innerHTML;
// Aggiungi un ascoltatore di eventi input per ciascun input di filtro
componentInput.addEventListener("input", filterTable);
descriptionInput.addEventListener("input", filterTable);
casInput.addEventListener("input", filterTable);
formulaInput.addEventListener("input", filterTable);
familyInput.addEventListener("input", filterTable);
function filterTable() {
const componentValue = componentInput.value;
const descriptionValue = descriptionInput.value;
const casValue = casInput.value;
const formulaValue = formulaInput.value;
const familyValue = familyInput.value;
// Se tutti gli input sono vuoti, ripristina la tabella al suo stato originale
if (!componentValue && !descriptionValue && !casValue && !formulaValue && !familyValue) {
tableBody.innerHTML = originalTableContent;
return;
}
// Verifica se almeno uno degli input ha una lunghezza di almeno 3
if (componentValue.length < 3 && descriptionValue.length < 3 && casValue.length < 3 && formulaValue.length < 3 && familyValue.length < 3) {
return; // esce dalla funzione se nessun input ha una lunghezza di almeno 3
}
// Effettua una richiesta AJAX al server per ottenere i risultati filtrati
fetch(`filter.php?component=${componentValue}&description=${descriptionValue}&cas=${casValue}&formula=${formulaValue}&family=${familyValue}`)
.then(response => response.json())
.then(data => {
// Aggiorna la tabella con i dati filtrati
updateTable(data);
})
.catch(error => {
console.error('Errore durante la richiesta AJAX:', error);
});
}
function updateTable(filteredData) {
tableBody.innerHTML = "";
filteredData.forEach(rowData => {
const row = document.createElement("tr");
row.innerHTML = `
<td>${rowData.idcomponent}</td>
<td>${rowData.name_component}</td>
<td>${rowData.description_component}</td>
<td>${rowData.cas_component}</td>
<td>${rowData.formula_component}</td>
<td>${rowData.name_componentfamily}</td>
<td><a class="btn btn-danger" href="update-component.php?idcomponent=${rowData.idcomponent}" role="button">E</a></td>
<td><a class="btn btn-danger" href="cancel-component.php?idcomponent=${rowData.idcomponent}" role="button">C</a></td>
`;
tableBody.appendChild(row);
});
}
});
</script>
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+359
View File
@@ -0,0 +1,359 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $component; ?></h5>
<a class="btn btn-danger" href="insert-component.php" role="button">Insert New Component</a> <a class="btn btn-danger" href="component-family.php" role="button">Component Family</a> <button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button> <br><br>
<script>
function goBack() {
window.history.back();
}
</script>
<div class="col-sm-12 mb-3">
<input type="text" class="form-control" id="searchInput" placeholder="Search by Component or CAS">
</div>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong></strong></th>
<th><strong><?php echo $name_component_lang; ?></strong></th>
<th><strong><?php echo $cas_component_lang; ?></strong></th>
<th><strong><?php echo $formula_component_lang; ?></strong></th>
<th><strong><?php echo $component_family_id_lang; ?></strong></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$tablequery = new WA_MySQLi_RS("tablequery", $repnew, 30);
$tablequery->setQuery("SELECT component.*, component_family.*, component_family_type.*, component.company_id AS companyidcomp FROM `component` LEFT JOIN component_family ON component.component_Family_id=component_family.idcomponentfamily LEFT JOIN component_family_type ON component.component_family_type=component_family_type.idcomponentfamilytype ORDER BY component.preset");
$tablequery->execute();
?>
<?php
$wa_startindex = 0;
while (!$tablequery->atEnd()) {
$wa_startindex = $tablequery->Index;
?>
<tr>
<td><?php echo ($tablequery->getColumnVal("idcomponent")); ?></td>
<td><?php echo ($tablequery->getColumnVal("name_component")); ?></td>
<td><?php echo ($tablequery->getColumnVal("cas_component")); ?></td>
<td><?php echo ($tablequery->getColumnVal("formula_component")); ?></td>
<td><?php echo ($tablequery->getColumnVal("name_componentfamily")); ?></td>
<td>
<?php
$compidcompany = $tablequery->getColumnVal("companyidcomp");
//if ($compidcompany == $idcompany) {
?>
<a class="btn btn-danger" href="update-component.php?idcomponent=<?php echo ($tablequery->getColumnVal("idcomponent")); ?>" role="button">E</a><?php //}
?>
</td>
<td>
<?php
// if ($compidcompany == $idcompany) {
?>
<a class="btn btn-danger" href="cancel-component.php?idcomponent=<?php echo ($tablequery->getColumnVal("idcomponent")); ?>" role="button">C</a>
</td>
</tr> <?php // }
?>
<?php
$tablequery->moveNext();
}
$tablequery->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tbody>
</table>
<br>
<a href="<?php echo $tablequery->getFirstPageLink(); ?>"><i class="fas fa-angle-double-left fa-2x"></i></a>
<a href="<?php echo $tablequery->getPrevPageLink(); ?>"><i class="fas fa-angle-left fa-2x"></i></a>
<a href="<?php echo $tablequery->getNextPageLink(); ?>"><i class="fas fa-angle-right fa-2x"></i></a>
<a href="<?php echo $tablequery->getLastPageLink(); ?>"><i class="fas fa-angle-double-right fa-2x"></i></a>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
$(document).ready(function() {
$('#searchInput').on('input', function() {
var searchValue = $(this).val();
if (searchValue.length >= 3) {
$.ajax({
url: 'search_components.php', // Percorso del file PHP che gestisce la ricerca
type: 'GET',
data: {
query: searchValue
}, // Invia la query come parametro GET
success: function(data) {
$('table tbody').html(data); // Aggiorna il corpo della tabella con i risultati
},
error: function() {
alert('Errore nella ricerca dei componenti');
}
});
} else {
fetchAllComponents(); // Funzione per ripristinare tutti i componenti
}
});
});
function fetchAllComponents() {
$.ajax({
url: 'fetchAllComponents.php', // Percorso del file PHP che restituisce tutti i componenti
type: 'GET',
success: function(data) {
$('table tbody').html(data);
},
error: function() {
alert('Errore nel caricamento dei componenti');
}
});
}
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
const componentInput = document.getElementById("filter-component");
const descriptionInput = document.getElementById("filter-description");
const casInput = document.getElementById("filter-cas");
const formulaInput = document.getElementById("filter-formula");
const familyInput = document.getElementById("filter-family");
const tableBody = document.getElementById("table-data").getElementsByTagName("tbody")[0];
// Memorizza il contenuto originale della tabella
const originalTableContent = tableBody.innerHTML;
// Aggiungi un ascoltatore di eventi input per ciascun input di filtro
componentInput.addEventListener("input", filterTable);
descriptionInput.addEventListener("input", filterTable);
casInput.addEventListener("input", filterTable);
formulaInput.addEventListener("input", filterTable);
familyInput.addEventListener("input", filterTable);
function filterTable() {
const componentValue = componentInput.value;
const descriptionValue = descriptionInput.value;
const casValue = casInput.value;
const formulaValue = formulaInput.value;
const familyValue = familyInput.value;
// Se tutti gli input sono vuoti, ripristina la tabella al suo stato originale
if (!componentValue && !descriptionValue && !casValue && !formulaValue && !familyValue) {
tableBody.innerHTML = originalTableContent;
return;
}
// Verifica se almeno uno degli input ha una lunghezza di almeno 3
if (componentValue.length < 3 && descriptionValue.length < 3 && casValue.length < 3 && formulaValue.length < 3 && familyValue.length < 3) {
return; // esce dalla funzione se nessun input ha una lunghezza di almeno 3
}
// Effettua una richiesta AJAX al server per ottenere i risultati filtrati
fetch(`filter.php?component=${componentValue}&description=${descriptionValue}&cas=${casValue}&formula=${formulaValue}&family=${familyValue}`)
.then(response => response.json())
.then(data => {
// Aggiorna la tabella con i dati filtrati
updateTable(data);
})
.catch(error => {
console.error('Errore durante la richiesta AJAX:', error);
});
}
function updateTable(filteredData) {
tableBody.innerHTML = "";
filteredData.forEach(rowData => {
const row = document.createElement("tr");
row.innerHTML = `
<td>${rowData.idcomponent}</td>
<td>${rowData.name_component}</td>
<td>${rowData.description_component}</td>
<td>${rowData.cas_component}</td>
<td>${rowData.formula_component}</td>
<td>${rowData.name_componentfamily}</td>
<td><a class="btn btn-danger" href="update-component.php?idcomponent=${rowData.idcomponent}" role="button">E</a></td>
<td><a class="btn btn-danger" href="cancel-component.php?idcomponent=${rowData.idcomponent}" role="button">C</a></td>
`;
tableBody.appendChild(row);
});
}
});
</script>
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+27
View File
@@ -0,0 +1,27 @@
<?php
include('../include/headscript.php');
include("../class/company.php");
if (isset($_POST['filename']) && isset($_POST['idstandards'])) {
$filename = $_POST['filename'];
$idstandards = $_POST['idstandards'];
$filePath = "../pdfstandards/" . $filename;
// Cancella il file dal server
if (file_exists($filePath)) {
unlink($filePath);
}
// Cancella il record dal database
$conn = new mysqli($servername, $username, $password, $database);
$delete = $conn->prepare("DELETE FROM pdfstandards WHERE idstandards = ? AND pdffilename = ?");
$delete->bind_param("is", $idstandards, $filename);
if ($delete->execute()) {
echo json_encode(array("status" => "success", "message" => "File cancellato."));
} else {
echo json_encode(array("status" => "error", "message" => "Errore durante la cancellazione dal database."));
}
$delete->close();
} else {
echo json_encode(array("status" => "error", "message" => "Parametri mancanti."));
}
+675
View File
@@ -0,0 +1,675 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Select2 CSS -->
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<!-- Select2 JS -->
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<style>
.table-custom .form-control,
.table-custom .form-select {
height: 25px;
padding: 2px 6px;
font-size: 14px;
}
.table-custom .form-control-sm.analysis-input {
height: 25px;
padding: 2px 6px;
font-size: 12px;
}
.form-row {
display: flex;
align-items: center;
gap: 10px;
}
.select-container {
position: relative;
display: inline-block;
}
.selected-text {
padding: 6px;
cursor: pointer;
width: 150px;
display: inline-block;
}
select.form-control {
position: absolute;
top: 0;
left: 0;
width: 150px;
}
.select2-selection__clear {
display: none !important;
}
.select-container {
position: relative;
display: inline-block;
}
.selected-text {
padding: 6px;
cursor: pointer;
width: 200px;
/* aumenta la larghezza della select */
display: inline-block;
border: none;
background: none;
outline: none;
}
.select-container select.form-control {
width: 200px;
/* aumenta la larghezza della select */
-webkit-appearance: none;
/* rimuove la freccia di default di alcuni browser */
-moz-appearance: none;
/* rimuove la freccia di default di Firefox */
appearance: none;
/* rimuove la freccia di default */
background: none;
border: 1px solid #ced4da;
/* aggiunge un bordo alla select */
padding: 6px;
outline: none;
cursor: pointer;
}
.green-highlight {
background-color: #228B22 !important;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<?php if (isset($_POST['id'])) {
$idrsl = $_POST['id'];
} ?>
<?php if (isset($_GET['id'])) {
$idrsl = $_GET['id'];
} ?>
<?php if (isset($_GET['idmaterial_rsl'])) {
$idmaterial_rsl = $_GET['idmaterial_rsl'];
} ?>
<?php
if ((((isset($_POST["analysis"])) ? $_POST["analysis"] : "") != "")) {
$idanalysis = $_POST['analysis'];
$idmaterial_type = $_POST['material_id'];
$idrsl = $_POST['id'];
include('check-an-present.php');
$idanpr = $checkanpr->getColumnVal("idanalysis_rsl");
if (empty($idanpr)) {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "analysis_rsl";
$InsertQuery->bindColumn("analysis_id", "i", "" . ((isset($_POST["analysis"])) ? $_POST["analysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("rsl_id", "i", "" . ((isset($_POST["id"])) ? $_POST["id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("material_id", "i", "" . ((isset($_POST["material_id"])) ? $_POST["material_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo); ?>
<?php
}
if (!empty($idanpr)) {
?>
<div class="alert alert-warning"><i class="fa fa-exclamation-triangle"></i> Analysis not added. The Analysis was already present in the RSL. </div>
<?php }
}
?>
<?php
$material_id = $_GET['material_id'];
$conn = new mysqli($servername, $username, $password, $database);
$sql = "SELECT name_material FROM material_type WHERE idmaterial_type = $material_id";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$name_material = $row['name_material'];
}
$conn->close();
$tablequery = new WA_MySQLi_RS("tablequery", $repnew, 0);
$tablequery->setQuery("SELECT * FROM rsl LEFT JOIN rsl_category ON rsl.rsl_category_id=rsl_category.idrslcat LEFT JOIN department ON rsl.department_id=department.`id-department` WHERE rsl.id='$idrsl'");
$tablequery->execute();
?>
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">RSL <?php echo ($tablequery->getColumnVal("name")); ?></h5>
<a class="btn btn-danger" href="material-rsl.php?id=<?php echo ($tablequery->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Edit TRL">Detail RSL</a>
<a class="btn btn-danger" href="update-rsl.php?id=<?php echo ($tablequery->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Edit TRL">Edit RSL</a>
<a class="btn btn-danger" href="analysis.php" role="button">Analysis</a>
<a class="btn btn-danger" href="material.php" role="button">Material</a>
<a href="synoptic-table.php?idrsl=<?php echo ($tablequery->getColumnVal("id")); ?>"><button type="button" class="btn btn-success waves-effect waves-light" data-toggle="tooltip" title="Synoptic Table"><i class="bx bx-table font-size-16 align-middle"></i></button></a>
<a href="pdfcreation/pdf-rsl.php?idrsl=<?php echo ($tablequery->getColumnVal("id")); ?>"><button type="button" class="btn btn-success waves-effect waves-light" data-toggle="tooltip" title="Print"><i class="bx bx-printer font-size-16 align-middle"></i></button></a>
<button type="button" class="btn btn-danger waves-effect waves-light" data-toggle="tooltip" title="Save PDF" onclick="showConfirmation(<?php echo ($tablequery->getColumnVal('id')); ?>)">
<i class="fa fa-file-pdf font-size-16 align-middle"></i>
</button>
<!-- <a href="send-email-trl.php"> --><button type="button" id="btn_send_trl" class="btn btn-success waves-effect waves-light"><i class="bx bx-mail-send font-size-16 align-middle"></i> Send TRL to clients</button><!-- </a> -->
<a class="btn btn-dark" href="javascript:void(0);" onclick="window.history.back();" role="button">Go Back</a><br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong><?php echo $name_lang; ?></strong></th>
<th><strong><?php echo $description_lang; ?></strong></th>
<th><strong><?php echo $start_lang; ?></strong></th>
<th><strong><?php echo $end_lang; ?></strong></th>
<th><strong><?php echo $rsl_category_id_lang; ?></strong></th>
<th><?php echo $version_lang; ?></th>
<th><?php echo $active_lang; ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo ($tablequery->getColumnVal("name")); ?></td>
<td><?php echo ($tablequery->getColumnVal("description")); ?></td>
<td><?php echo ($tablequery->getColumnVal("start")); ?></td>
<td><?php echo ($tablequery->getColumnVal("end")); ?></td>
<td><?php echo ($tablequery->getColumnVal("name_rslcat")); ?></td>
<td><?php echo ($tablequery->getColumnVal("version")); ?></td>
<td>
<?php if ($tablequery->getColumnVal("active") == 'Y') : ?>
<button class="btn btn-success">
<i class="bx bx-check-double"></i>
</button>
<?php endif; ?>
</td>
</tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<?php
$materialtype = new WA_MySQLi_RS("materialtype", $repnew, 1);
$materialtype->setQuery("SELECT * FROM material_type WHERE material_type.idmaterial_type='$material_id'");
$materialtype->execute();
?>
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<div class="alert alert-danger" style="font-weight: bold; font-size: 16px;">
<i class="fa fa-angle-double-right"></i> Material <?php echo ($materialtype->getColumnVal("name_material")); ?>
</div>
<h6 class="card-subtitle">Choose the analysis to add to the RSL for the material <?php echo $name_material; ?></h6><br>
<?php
$analysislist = new WA_MySQLi_RS("analysislist", $repnew, 0);
$analysislist->setQuery("SELECT * FROM analysis WHERE analysis.company_id='$idcompany' ORDER BY analysis.name_analysis");
$analysislist->execute();
?>
<form method="post" id="addanalysis">
<div class="form-row align-items-end">
<div class="col-md-8">
<label for="analysis" class="form-label">Select Analysis</label>
<select name="analysis" class="form-select form-control-sm" id="analysis">
<?php while (!$analysislist->atEnd()) { //dyn select
?>
<option value="<?php echo ($analysislist->getColumnVal("idanalysis")); ?>">
<?php echo ($analysislist->getColumnVal("name_analysis")); ?>
</option>
<?php $analysislist->moveNext(); ?>
<?php } //dyn select
?>
</select>
<input name="idcompany" type="hidden" id="idcompany" value="<?php echo $idcompany; ?>">
<input name="material_id" type="hidden" id="material_id" value="<?php echo $material_id; ?>">
<input name="id" type="hidden" id="id" value="<?php echo ($tablequery->getColumnVal("id")); ?>">
<input type="submit" class="btn btn-primary btn-sm" value="Submit">
<button type="button" id="openPopuppreset" class="btn btn-success btn-sm ml-2">Analysis Preset</button>
</div>
</div>
</form>
<br>
<script>
document.getElementById("openPopuppreset").addEventListener("click", function() {
// Recupera i valori delle variabili
var materialId = "<?php echo $material_id; ?>";
var idMaterialRsl = "<?php echo $idmaterial_rsl; ?>";
var id = "<?php echo $idrsl; ?>";
// Costruisci l'URL con le variabili come parametri
var popupUrl = "presetanalisys.php?material_id=" + materialId + "&idmaterial_rsl=" + idMaterialRsl + "&id=" + id;
// Apri il popup con le dimensioni specificate
var width = window.innerWidth / 2; // Larghezza metà schermo
var height = window.innerHeight; // Altezza intera schermo
var left = (window.innerWidth - width) / 2; // Posizione X centrata
var top = (window.innerHeight - height) / 2; // Posizione Y centrata
// Apri il popup
var popup = window.open(popupUrl, "_blank", "width=" + width + ", height=" + height + ", left=" + left + ", top=" + top);
// Verifica se il popup è stato aperto con successo
if (!popup) {
alert("Il browser ha bloccato l'apertura del popup. Assicurati di consentire i popup per questo sito.");
}
});
</script>
<?php
// Connessione al database
$conn = new mysqli($servername, $username, $password, $database);
// Verifica connessione
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Esegui la query
$query = "SELECT idstandards, titlestandards, numberstandards FROM standards";
$result = $conn->query($query);
?>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong><?php echo $analysis_id_lang; ?></strong></th>
<th>Method</th>
<th style="width: 100px;"></th>
<th style="width: 100px;">ACTION</th>
<th style="width: 100px;"></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody class="table-danger">
<?php
$tablequery2 = new WA_MySQLi_RS("tablequery2", $repnew, 0);
$tablequery2->setQuery("SELECT * FROM `analysis_rsl` LEFT JOIN analysis ON analysis_rsl.analysis_id=analysis.idanalysis LEFT JOIN standards ON `analysis_rsl`.idmethods=standards.idstandards WHERE analysis_rsl.rsl_id='$idrsl' AND analysis_rsl.material_id='$material_id'");
$tablequery2->execute();
?>
<?php
$wa_startindex = 0;
while (!$tablequery2->atEnd()) {
$wa_startindex = $tablequery2->Index;
$idanalysis = $tablequery2->getColumnVal("analysis_id");
?>
<tr class="parent" id="row<?php echo $idanalysis; ?>">
<td><?php echo ($tablequery2->getColumnVal("name_analysis")); ?></td>
<td>
<label for="standards-<?php echo $idanalysis; ?>"></label>
<div class="select-container">
<?php
// Ripeti la query per ottenere i dati degli standard
$result = $conn->query("SELECT idstandards, titlestandards, numberstandards FROM standards");
$currentStandard = $tablequery2->getColumnVal("numberstandards");
$displayText = "Select a standard";
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
if ($row["numberstandards"] == $currentStandard) {
$displayText = $row["titlestandards"] . ' - ' . $row["numberstandards"];
}
}
}
?>
<select id="standards-<?php echo $idanalysis; ?>" name="standards" class="form-control" data-idanalysisrsl="<?php echo $tablequery2->getColumnVal('idanalysis_rsl'); ?>" onchange="updateSelectedTextAndDatabase('standards-<?php echo $idanalysis; ?>')">
<option value=""><?php echo $displayText; ?></option>
<?php
$result->data_seek(0); // Reset result set pointer to the beginning
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$selected = ($row["numberstandards"] == $currentStandard) ? "selected" : "";
echo '<option value="' . $row["idstandards"] . '" ' . $selected . '>' . $row["titlestandards"] . ' - ' . $row["numberstandards"] . '</option>';
}
} else {
echo '<option value="">No standards found</option>';
}
?>
</select>
<span id="update-message-<?php echo $idanalysis; ?>" class="update-message" style="display: none; color: green;">Updated</span>
</div>
<script>
$(document).ready(function() {
$('#standards-<?php echo $idanalysis; ?>').select2({
placeholder: 'Select a standard',
allowClear: true
});
});
</script>
</td>
<td>
<!-- <a onclick="window.open('searchenginemethod.php?idanalysis=<?php echo ($tablequery2->getColumnVal("idanalysis")); ?>&idmaterial=<?php echo $material_id; ?>&idanalysisrsl=<?php echo ($tablequery2->getColumnVal("idanalysis_rsl")); ?>', '_blank', 'location=yes,height=720,width=1000,scrollbars=yes,status=yes');">
<button type="button" class="btn btn-primary waves-effect waves-light">Method</button>
</a> -->
</td>
<td>
<a onclick="window.open('addcommentrsl.php?idanalysis=<?php echo ($tablequery2->getColumnVal("idanalysis")); ?>&idmaterial=<?php echo $material_id; ?>&idanalysisrsl=<?php echo ($tablequery2->getColumnVal("idanalysis_rsl")); ?>', '_blank', 'location=yes,height=720,width=1000,scrollbars=yes,status=yes');">
<button type="button" class="btn btn-primary waves-effect waves-light">Comment</button>
</a>
</td>
<td>
<a class="btn btn-danger" href="cancel-analysisrsl.php?idmaterial_rsl=<?php echo $idmaterial_rsl; ?>&idanalysis_rsl=<?php echo ($tablequery2->getColumnVal("idanalysis_rsl")); ?>&id=<?php echo ($tablequery->getColumnVal("id")); ?>&material_id=<?php echo $material_id; ?>" role="button">C</a>
</td>
<td>
</td>
<td><i class="fas fa-angle-double-down toggle-row" style="cursor: pointer;"></i></td>
</tr>
<script>
function updateSelectedText(selectId) {
var selectElement = document.getElementById(selectId);
var selectedText = selectElement.options[selectElement.selectedIndex].text;
selectElement.options[0].text = selectedText;
}
</script>
<script>
$(document).ready(function() {
$('#standards-<?php echo $idanalysis; ?>').select2({
placeholder: 'Select a standard',
allowClear: true
});
});
</script>
<?php
$companalysis = new WA_MySQLi_RS("companalysis", $repnew, 0);
$companalysis->setQuery("SELECT * FROM analysis_component LEFT JOIN component ON analysis_component.idcomponent=component.idcomponent WHERE analysis_component.idanalysis='$idanalysis'");
$companalysis->execute(); ?>
<?php
$umlist = new WA_MySQLi_RS("umlist", $repnew, 1);
$umlist->setQuery("SELECT * FROM unit_measure ORDER BY unit_measure.name");
$umlist->execute();
?>
<tr class="child-row<?php echo $idanalysis; ?> table-primary" style="display: table-row;">
<th>Component</th>
<th>CAS</th>
<th style="width: 100px;">Low Lim</th>
<th style="width: 100px;">High Lim *</th>
<th style="width: 100px;">LOQ</th>
<th style="width: 150px;">UM</th>
<th style="width: 150px;">Status</th>
</tr>
<?php
$wa_startindex = 0;
while (!$companalysis->atEnd()) {
$wa_startindex = $companalysis->Index;
?>
<?php
$idrsl = $tablequery2->getColumnVal("rsl_id");
$material_id = $tablequery2->getColumnVal("material_id");
$component_id = $companalysis->getColumnVal("idcomponent");
$analysis_id = $tablequery2->getColumnVal("analysis_id");
?>
<tr class="child-row<?php echo $idanalysis; ?> table-info" style="display: table-row;">
<?php $testo = "Prova suggerimento"; ?>
<td class="sa-trigger" data-testo="<?php echo $testo; ?>">
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" title="Suggestion"></i>
<?php echo ($companalysis->getColumnVal("name_component")); ?>
</td>
<td><?php echo ($companalysis->getColumnVal("cas_component")); ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php include('../class/req-form.php'); ?>
<?php
$companalysis->moveNext();
}
$companalysis->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
<?php $tablequery2->moveNext();
}
$tablequery2->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
function updateSelectedTextAndDatabase(selectId) {
var selectElement = document.getElementById(selectId);
var selectedText = selectElement.options[selectElement.selectedIndex].text;
selectElement.options[0].text = selectedText;
var idmethods = selectElement.value;
var idanalysisrsl = selectElement.getAttribute('data-idanalysisrsl');
$.ajax({
url: 'update-analysis-rsl.php', // crea questo file PHP per gestire l'aggiornamento
type: 'POST',
data: {
idmethods: idmethods,
idanalysisrsl: idanalysisrsl
},
success: function(response) {
// Mostra il messaggio "Updated"
var messageElement = document.getElementById('update-message-' + selectId.split('-')[1]);
$(messageElement).show();
setTimeout(function() {
$(messageElement).fadeOut();
}, 2000);
},
error: function(xhr, status, error) {
alert('Si è verificato un errore durante l\'aggiornamento del database: ' + error);
}
});
}
</script>
<script type="text/javascript">
// Aggiungi il gestore di eventi di clic alla freccia
$(document).on('click', '.toggle-row', function(event) {
event.stopPropagation(); // Impedisce che l'evento si propaghi alla riga
var parentRowId = $(this).closest('tr').attr('id');
$(this).closest('tr').siblings('.child-' + parentRowId).toggle();
});
// Nascondi le righe figlio per default
$('tr[class*=child-]').hide().children('td');
/* SAVE ANALYSIS FORM UPON DATA CHANGE */
$('.analysis-input').on('change', function() {
if ($(this).attr('oldVal') !== $(this).val()) {
let parentForm = $(this).closest('form');
let formId = parentForm.context.form[10].defaultValue;
let inputE = $(this);
let defBGColor = $(inputE).css("background-color");
let defTxtColor = $(inputE).css("color");
$.post('../include/ajax-request.php', $('#' + formId).serialize(), function(data) {
if (data != 'SUCCESS') {
/* ERROR */
alert(data);
} else {
/* SUCCESS */
$(inputE).css({
'background-color': '#228B22',
'color': '#F0F8FF'
});
$(inputE).fadeOut(300, function() {
$(inputE).css({
'background-color': defBGColor,
'color': defTxtColor
})
}).fadeIn(100);
}
});
}
});
function save_record(id) {
let inputE = $('.tr-input-' + id);
let defBGColor = $(inputE).css("background-color");
let defTxtColor = $(inputE).css("color");
$.post('../include/ajax-request.php', $('#form-' + id).serialize(), function(data) {
console.log(data);
return;
if (data != 'SUCCESS') {
/* ERROR */
alert(data);
} else {
/* SUCCESS */
$(inputE).css({
'background-color': '#00a65a ',
'color': '#FFF'
});
$(inputE).fadeOut(500, function() {
$(inputE).css({
'background-color': defBGColor,
'color': defTxtColor
})
}).fadeIn(100);
}
});
}
</script>
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
// Aggiungi un gestore di eventi di clic a tutti gli elementi con la classe .sa-trigger
$('.sa-trigger').click(function() {
// Ottieni il testo associato a questo elemento dall'attributo data-testo
var testo = $(this).data('testo');
// Mostra lo SweetAlert con il testo
Swal.fire({
title: 'Testo da PHP',
text: testo,
icon: 'info',
confirmButtonText: 'Chiudi'
});
});
});
</script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<!-- plugin JS -->
<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>
<script>
$(document).ready(function() {
$('#analysis').select2();
});
</script>
</body>
</html>
@@ -0,0 +1,28 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php // Assicurati di includere il file di connessione al DB
$conn = new mysqli($servername, $username, $password, $database);
$query = $_GET['query']; // Ricevi la stringa di ricerca
$sql = "SELECT * FROM component ORDER BY name_component"; // Query SQL per il filtraggio
$stmt = $conn->prepare($sql);
$searchTerm = '%' . $query . '%';
$stmt->bind_param('ss', $searchTerm, $searchTerm);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr>
<td>{$row['idcomponent']}</td>
<td>{$row['name_component']}</td>
<td>{$row['cas_component']}</td>
<td>{$row['formula_component']}</td>
<td>{$row['component_family_id']}</td>
<td>Edit/Delete Buttons</td>
</tr>";
}
} else {
echo "<tr><td colspan='6'>No results found</td></tr>";
}
$stmt->close();
$conn->close();
+15
View File
@@ -0,0 +1,15 @@
<?php
include('../include/headscript.php');
$idstandards = $_GET['idstandards'];
$query = $conn->prepare("SELECT name, url FROM pdfstandards WHERE idstandards = ?");
$query->bind_param("i", $idstandards);
$query->execute();
$result = $query->get_result();
$pdfs = [];
while ($row = $result->fetch_assoc()) {
$pdfs[] = ['name' => $row['name'], 'url' => $row['url']];
}
echo json_encode($pdfs);
@@ -0,0 +1,239 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
if ($kindofrole == '3') {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "`analysistemplate`";
$InsertQuery->bindColumn("idanalysis", "s", "" . ((isset($_POST["idanalysis"])) ? $_POST["idanalysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("name_analysis", "s", "" . ((isset($_POST["name_analysis"])) ? $_POST["name_analysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("description_analysis", "s", "" . ((isset($_POST["description_analysis"])) ? $_POST["description_analysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("department_id", "s", "" . ((isset($_POST["department_id"])) ? $_POST["department_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("created_at", "s", "" . ((isset($_POST["created_at"])) ? $_POST["created_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("preset", "s", "" . ((isset($_POST["preset"])) ? $_POST["preset"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "analysis.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
} else {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "`analysis`";
$InsertQuery->bindColumn("idanalysis", "s", "" . ((isset($_POST["idanalysis"])) ? $_POST["idanalysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("name_analysis", "s", "" . ((isset($_POST["name_analysis"])) ? $_POST["name_analysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("description_analysis", "s", "" . ((isset($_POST["description_analysis"])) ? $_POST["description_analysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("family_analysis", "s", "" . ((isset($_POST["family_analysis"])) ? $_POST["family_analysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("department_id", "s", "" . ((isset($_POST["department_id"])) ? $_POST["department_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("created_at", "s", "" . ((isset($_POST["created_at"])) ? $_POST["created_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("preset", "s", "" . ((isset($_POST["preset"])) ? $_POST["preset"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "analysis.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="alert alert-warning" role="alert">
<?php echo $newanalysistitle; ?>
<?php echo $insertanalysisalert; ?>
</div>
<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 $insertanalysisinfo; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_analysis_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="name_analysis" type="text" class="form-control" id="name_analysis">
</div>
</div>
</div>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $description_analysis_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="description_analysis" type="text" class="form-control" id="description_analysis">
</div>
</div>
</div>
<?php
$conn = new mysqli($servername, $username, $password, $database);
$query = "SELECT idfamilyanalysis, namefamily FROM family_analysis ORDER BY family_analysis.namefamily";
$result = $conn->query($query);
?>
<div class="form-group row">
<label for="family_analysis" class="col-sm-3 control-label">Analysis Family</label>
<div class="col-sm-9">
<div class="input-group">
<select name="family_analysis" id="family_analysis" class="form-control">
<option value="">Select</option>
<?php if ($result->num_rows > 0) : ?>
<?php while ($row = $result->fetch_assoc()) : ?>
<option value="<?php echo htmlspecialchars($row['idfamilyanalysis']); ?>">
<?php echo htmlspecialchars($row['namefamily']); ?>
</option>
<?php endwhile; ?>
<?php endif; ?>
</select>
</div>
</div>
</div>
<input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>">
<?php if ($kindofrole == '3') { ?>
<input name="preset" type="hidden" id="preset" value="Y"><?php } else { ?>
<input name="preset" type="hidden" id="preset" value="N"><?php } ?>
<td><input name="department_id" type="hidden" id="department_id"></td>
<td><input name="created_at" type="hidden" id="created_at"></td>
<td><input name="updated_at" type="hidden" id="updated_at"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9"><br>
<button type="submit" class="btn btn-success waves-effect waves-light">Insert</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,276 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "`family_analysis`";
$InsertQuery->bindColumn("namefamily", "s", "" . ((isset($_POST["namefamily"])) ? $_POST["namefamily"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "analysis-category.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
/* select2 css */
.select2-container {
width: 100% !important;
}
.select2-selection__choice,
.select2-selection__choice__remove {
background-color: blue !important;
color: white !important;
border: 1px solid blue !important;
}
/* select2 css end */
input:invalid {
border-color: #ff0000;
background-color: #fff7e6;
}
input:focus {
background: yellow;
}
input:valid {
border-color: #66ff33;
background-color: #eeffe6;
}
select:invalid {
border-color: #ff0000;
background-color: #fff7e6;
}
select:focus {
background-color: yellow;
}
select:valid {
border-color: #66ff33;
background-color: #eeffe6;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="name" class="col-md-2 col-form-label"><?php echo $name_lang; ?></label>
<div class="col-md-10">
<div class="input-group">
<input name="namefamily" type="text" class="form-control" id="namefamily">
</div>
</div>
</div>
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Insert</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
// File upload via Ajax
$("#uploadForm").on('submit', function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
url: 'uploadlogorsl.php',
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
$('#uploadStatus').html('<img src="images/uploading.gif"/>');
},
error: function() {
$('#uploadStatus').html('<span style="color:#EA4335;">Images upload failed, please try again.<span>');
},
success: function(data) {
$('#uploadForm')[0].reset();
$('#uploadStatus').html('<span style="color:#28A74B;">Images uploaded successfully.<span>');
$('.gallery').html(data);
}
});
});
// File type validation
$("#fileInput").change(function() {
var fileLength = this.files.length;
var match = ["image/jpeg", "image/png", "image/jpg", "image/gif"];
var i;
for (i = 0; i < fileLength; i++) {
var file = this.files[i];
var imagefile = file.type;
if (!((imagefile == match[0]) || (imagefile == match[1]) || (imagefile == match[2]) || (imagefile == match[3]))) {
alert('Please select a valid image file (JPEG/JPG/PNG/GIF).');
$("#fileInput").val('');
return false;
}
}
});
});
</script>
<script>
$(document).ready(function() {
$(".upload-image").click(function() {
$(".form-horizontal").ajaxForm({
target: '.preview'
}).submit();
});
$('#form').parsley();
});
</script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,211 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "`component_family`";
$InsertQuery->bindColumn("idcomponentfamily", "s", "" . ((isset($_POST["idcomponentfamily"])) ? $_POST["idcomponentfamily"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("name_componentfamily", "s", "" . ((isset($_POST["name_componentfamily"])) ? $_POST["name_componentfamily"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("description_componentfamily", "s", "" . ((isset($_POST["description_componentfamily"])) ? $_POST["description_componentfamily"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("component_family_type", "s", "" . ((isset($_POST["laboratory_componentfamily"])) ? $_POST["laboratory_componentfamily"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("created_at", "s", "" . ((isset($_POST["created_at"])) ? $_POST["created_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "component-family.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<?php
$maincatlist = new WA_MySQLi_RS("maincatlist", $repnew, 0);
$maincatlist->setQuery("SELECT * FROM component_family_type ORDER BY component_family_type.name_componentfamilytype");
$maincatlist->execute();
?>
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $insertcompfamilytitle; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_componentfamily_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="name_componentfamily" type="text" class="form-control" id="name_componentfamily">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $description_componentfamily_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="description_componentfamily" type="text" class="form-control" id="description_componentfamily">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $maincattile; ?></label>
<div class="col-sm-9">
<div class="input-group">
<select class="form-select" name="laboratory_componentfamily" id="laboratory_componentfamily">
<option value=""><?php echo $selecttitle; ?></option>
<?php
while (!$maincatlist->atEnd()) { //dyn select
?>
<option value="<?php echo ($maincatlist->getColumnVal("idcomponentfamilytype")); ?>"><?php echo ($maincatlist->getColumnVal("name_componentfamilytype")); ?></option>
<?php
$maincatlist->moveNext();
} //dyn select
$maincatlist->moveFirst();
?>
</select>
</div>
</div>
</div>
<td><input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>"></td>
<td><input name="created_at" type="hidden" id="created_at"></td>
<td><input name="updated_at" type="hidden" id="updated_at"></td>
<div class="form-group row m-b-0">
<input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Insert</button>
</div>
</div>
<div class="card-body collapse show">
<br><br><button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,285 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php if (isset($_POST['name_component'])) {
$name_component = $_POST['name_component'];
}
if (isset($_POST['description_component'])) {
$description_component = $_POST['description_component'];
}
if (isset($_POST['cas_component'])) {
$cas_component = $_POST['cas_component'];
}
if (isset($_POST['formula_component'])) {
$formula_component = $_POST['formula_component'];
}
if (isset($_POST['component_family_id'])) {
$component_family_id = $_POST['component_family_id'];
}
if (isset($_POST['maincat'])) {
$component_family_type = $_POST['maincat'];
}
if (isset($_POST['company_id'])) {
$company_id = $_POST['company_id'];
}
if (isset($_POST['insertcompform'])) {
$insertcompform = $_POST['insertcompform'];
}
if (isset($_POST['preset'])) {
$presetcomponent = $_POST['preset'];
}
?>
<?php
if (isset($_POST['insertcompform'])) {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "component";
$InsertQuery->bindColumn("name_component", "s", "$name_component", "WA_DEFAULT");
$InsertQuery->bindColumn("description_component", "s", "$description_component", "WA_DEFAULT");
$InsertQuery->bindColumn("cas_component", "s", "$cas_component", "WA_DEFAULT");
$InsertQuery->bindColumn("formula_component", "s", "$formula_component", "WA_DEFAULT");
$InsertQuery->bindColumn("component_family_id", "i", "$component_family_id", "WA_DEFAULT");
$InsertQuery->bindColumn("component_family_type", "i", "$component_family_type", "WA_DEFAULT");
$InsertQuery->bindColumn("company_id", "i", "$company_id", "WA_DEFAULT");
$InsertQuery->bindColumn("preset", "s", "$presetcomponent", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<?php
$fanilycatquery = new WA_MySQLi_RS("fanilycatquery", $repnew, 0);
$fanilycatquery->setQuery("SELECT * FROM component_family ORDER BY component_family.name_componentfamily");
$fanilycatquery->execute();
?>
<?php
$maincatquery = new WA_MySQLi_RS("maincatquery", $repnew, 0);
$maincatquery->setQuery("SELECT * FROM component_family_type ORDER BY component_family_type.name_componentfamilytype");
$maincatquery->execute(); ?>
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="alert alert-warning" role="alert">
<?php echo $newanalysistitle; ?>
<?php echo $insertanalysisalert; ?>
</div>
<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 $insertcomponenttitle; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="name_component" type="text" class="form-control" id="name_component">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $description_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="description_component" type="text" class="form-control" id="description_component">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $cas_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="cas_component" type="text" class="form-control" id="cas_component">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $formula_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="formula_component" type="text" class="form-control" id="formula_component">
</div>
</div>
</div>
<input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>">
<?php if ($kindofrole == '3') { ?>
<input name="preset" type="hidden" id="preset" value="Y"><?php } else { ?>
<input name="preset" type="hidden" id="preset" value="N"><?php } ?>
<input name="insertcompform" type="hidden" id="insertcompform" value="insertcompform">
<div class="mb-3 row">
<label class="col-md-2 col-form-label"><?php echo $family_component_lang; ?></label>
<div class="col-md-10">
<select class="form-select" id="component_family_id" name="component_family_id">
<option value=""><?php echo $selecttitle; ?></option>
<?php
while (!$fanilycatquery->atEnd()) { //dyn select
?>
<option value="<?php echo ($fanilycatquery->getColumnVal("idcomponentfamily")); ?>"><?php echo ($fanilycatquery->getColumnVal("name_componentfamily")); ?></option>
<?php
$fanilycatquery->moveNext();
} //dyn select
$fanilycatquery->moveFirst();
?>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-md-2 col-form-label"><?php echo $labfamily_component_lang; ?></label>
<div class="col-md-10">
<select class="form-select" id="maincat" name="maincat">
<option value=""><?php echo $selecttitle; ?></option>
<?php
while (!$maincatquery->atEnd()) { //dyn select
?>
<option value="<?php echo ($maincatquery->getColumnVal("idcomponentfamilytype")); ?>"><?php echo ($maincatquery->getColumnVal("name_componentfamilytype")); ?></option>
<?php
$maincatquery->moveNext();
} //dyn select
$maincatquery->moveFirst();
?>
</select>
</div>
</div>
<td><input name="created_at" type="hidden" id="created_at"></td>
<td><input name="updated_at" type="hidden" id="updated_at"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light"><?php echo $inserttitle; ?></button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> <?php echo $back; ?></button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,177 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "`material_type`";
$InsertQuery->bindColumn("idmaterial_type", "s", "" . ((isset($_POST["idmaterial_type"])) ? $_POST["idmaterial_type"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("name_material", "s", "" . ((isset($_POST["name_material"])) ? $_POST["name_material"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("desc_material", "s", "" . ((isset($_POST["desc_material"])) ? $_POST["desc_material"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "material.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $insertmaterialtitle; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<td><input name="idmaterial_type" type="hidden" id="idmaterial_type"></td>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_material_lang; ?></label>
<div class="col-sm-9">
<div class="mb-3 row">
<input name="name_material" type="text" class="form-control" id="name_material">
</div>
</div>
</div>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $desc_material_lang; ?></label>
<div class="col-sm-9">
<div class="mb-3 row">
<input name="desc_material" type="text" class="form-control" id="desc_material">
</div>
</div>
</div>
<td><input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Insert</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+193
View File
@@ -0,0 +1,193 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "`rsl_category`";
$InsertQuery->bindColumn("name_rslcat", "s", "" . ((isset($_POST["name_rslcat"])) ? $_POST["name_rslcat"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("comment_rslcat", "s", "" . ((isset($_POST["comment_rslcat"])) ? $_POST["comment_rslcat"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("user_id", "s", "" . ((isset($_POST["user_id"])) ? $_POST["user_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("department_id", "s", "" . ((isset($_POST["department_id"])) ? $_POST["department_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("created_at", "s", "" . ((isset($_POST["created_at"])) ? $_POST["created_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "rsl-category.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_rslcat_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="name_rslcat" type="text" class="form-control" id="name_rslcat">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $comment_rslcat_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="comment_rslcat" type="text" class="form-control" id="comment_rslcat">
</div>
</div>
</div>
<td><input name="user_id" type="hidden" id="user_id" value="<?php echo $iduserlog; ?>"></td>
<td><input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>"></td>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $department_id_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="department_id" type="text" class="form-control" id="department_id">
</div>
</div>
</div>
<td><input name="created_at" type="hidden" id="created_at"></td>
<td><input name="updated_at" type="hidden" id="updated_at"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Insert</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+399
View File
@@ -0,0 +1,399 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "`rsl`";
$InsertQuery->bindColumn("name", "s", "" . ((isset($_POST["name"])) ? $_POST["name"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("description", "s", "" . ((isset($_POST["description"])) ? $_POST["description"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("start", "s", "" . ((isset($_POST["start"])) ? $_POST["start"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("end", "s", "" . ((isset($_POST["end"])) ? $_POST["end"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("department_id", "s", "" . ((isset($_POST["department_id"])) ? $_POST["department_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("rsl_category_id", "s", "" . ((isset($_POST["rsl_category_id"])) ? $_POST["rsl_category_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("user_id", "s", "" . ((isset($_POST["user_id"])) ? $_POST["user_id"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("version", "s", "" . ((isset($_POST["version"])) ? $_POST["version"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("active", "s", "" . ((isset($_POST["active"])) ? $_POST["active"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("created_at", "s", "" . ((isset($_POST["created_at"])) ? $_POST["created_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
// Get the last inserted ID
$lastInsertedId = $repnew->insert_id;
// Now, insert into rsllimits
$InsertRsllimitsQuery = new WA_MySQLi_Query($repnew);
$InsertRsllimitsQuery->Action = "insert";
$InsertRsllimitsQuery->Table = "`rsllimits`";
$InsertRsllimitsQuery->bindColumn("idrsl", "s", $lastInsertedId, "WA_DEFAULT");
$InsertRsllimitsQuery->bindColumn("namersllimits", "s", "default", "WA_DEFAULT");
$InsertRsllimitsQuery->execute();
$InsertGoTo = "rsl.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
?>
<?php
if (isset($_GET['id'])) {
$id = $_GET['id'];
}
if (isset($_POST['id'])) {
$id = $_POST['id'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
/* select2 css */
.select2-container {
width: 100% !important;
}
.select2-selection__choice,
.select2-selection__choice__remove {
background-color: blue !important;
color: white !important;
border: 1px solid blue !important;
}
/* select2 css end */
input:invalid {
border-color: #ff0000;
background-color: #fff7e6;
}
input:focus {
background: yellow;
}
input:valid {
border-color: #66ff33;
background-color: #eeffe6;
}
select:invalid {
border-color: #ff0000;
background-color: #fff7e6;
}
select:focus {
background-color: yellow;
}
select:valid {
border-color: #66ff33;
background-color: #eeffe6;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="name" class="col-md-2 col-form-label"><?php echo $name_lang; ?></label>
<div class="col-md-10">
<div class="input-group">
<input name="name" type="text" class="form-control" id="name" required>
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-md-2 col-form-label"><?php echo $description_lang; ?></label>
<div class="col-md-10">
<div class="input-group">
<input name="description" type="text" class="form-control" id="description">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-md-2 col-form-label"><?php echo $start_lang; ?></label>
<div class="col-md-10">
<div class="input-group">
<input name="start" required type="date" class="form-control" id="start">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-md-2 col-form-label"><?php echo $end_lang; ?></label>
<div class="col-md-10">
<div class="input-group">
<input name="end" type="date" class="form-control" id="end">
</div>
</div>
</div>
<td><input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>"></td>
<td><input name="department_id" type="hidden" id="department_id"></td>
<?php
//rsl category
$rslcat = new WA_MySQLi_RS("rslcat", $repnew, 0);
$rslcat->setQuery("SELECT * FROM rsl_category WHERE rsl_category.company_id=$idcompany");
$rslcat->execute();
?>
<div class="mb-3 row">
<label for="rsl_category_id" class="col-md-2 col-form-label"><?php echo $rsl_category_id_lang; ?></label>
<div class="col-md-10">
<div class="input-group">
<select class="form-select" name="rsl_category_id" id="rsl_category_id">
<option value=""><?php echo $selecttitle; ?></option>
<?php
while (!$rslcat->atEnd()) { // Iterazione delle opzioni dinamiche
?>
<option value="<?php echo htmlspecialchars($rslcat->getColumnVal("idrslcat")); ?>">
<?php echo htmlspecialchars($rslcat->getColumnVal("name_rslcat")); ?>
</option>
<?php
$rslcat->moveNext();
}
$rslcat->moveFirst(); // Riporta l'iteratore all'inizio per il riutilizzo
?>
</select>
</div>
</div>
</div>
<td><input name="user_id" type="hidden" id="user_id"></td>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-md-2 col-form-label"><?php echo $version_lang; ?></label>
<div class="col-md-10">
<div class="input-group">
<input name="version" required type="text" class="form-control" id="version">
</div>
</div>
</div>
<input name="user_id" type="hidden" id="user_id"></td>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-md-2 col-form-label"><?php echo $rsllogoupload_lang; ?></label>
<div class="col-md-10">
<div class="input-group">
<input type="file" class="form-control" id="inputGroupFile02">
<label class="input-group-text" for="inputGroupFile02">Upload</label>
</div>
</div>
</div>
<div class="mb-3 row">
<label for="active" class="col-md-2 col-form-label"><?php echo $active_lang; ?></label>
<div class="col-md-10">
<div class="form-check">
<input name="active" type="checkbox" class="form-check-input" id="active" value="Y">
<label class="form-check-label" for="active"></label>
</div>
</div>
</div>
<td><input name="created_at" type="hidden" id="created_at"></td>
<td><input name="updated_at" type="hidden" id="updated_at"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Insert</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
// File upload via Ajax
$("#uploadForm").on('submit', function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
url: 'uploadlogorsl.php',
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
$('#uploadStatus').html('<img src="images/uploading.gif"/>');
},
error: function() {
$('#uploadStatus').html('<span style="color:#EA4335;">Images upload failed, please try again.<span>');
},
success: function(data) {
$('#uploadForm')[0].reset();
$('#uploadStatus').html('<span style="color:#28A74B;">Images uploaded successfully.<span>');
$('.gallery').html(data);
}
});
});
// File type validation
$("#fileInput").change(function() {
var fileLength = this.files.length;
var match = ["image/jpeg", "image/png", "image/jpg", "image/gif"];
var i;
for (i = 0; i < fileLength; i++) {
var file = this.files[i];
var imagefile = file.type;
if (!((imagefile == match[0]) || (imagefile == match[1]) || (imagefile == match[2]) || (imagefile == match[3]))) {
alert('Please select a valid image file (JPEG/JPG/PNG/GIF).');
$("#fileInput").val('');
return false;
}
}
});
});
</script>
<script>
$(document).ready(function() {
$(".upload-image").click(function() {
$(".form-horizontal").ajaxForm({
target: '.preview'
}).submit();
});
$('#form').parsley();
});
</script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,251 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "`standards`";
// Handling text inputs
$InsertQuery->bindColumn("titlestandards", "s", $_POST["titlestandards"] ?? "", "WA_DEFAULT");
$InsertQuery->bindColumn("numberstandards", "s", $_POST["numberstandards"] ?? "", "WA_DEFAULT");
$InsertQuery->bindColumn("yearstandards", "i", $_POST["yearstandards"] ?? "", "WA_DEFAULT");
// Handling the checkbox for 'status'
$status = isset($_POST["status"]) && $_POST["status"] === "A" ? "A" : "Inactive"; // Default to 'Inactive' if not checked
$InsertQuery->bindColumn("status", "s", $status, "WA_DEFAULT");
// Date fields with default value of today's date
$InsertQuery->bindColumn("activefrom", "s", $_POST["activefrom"] ?? date("Y-m-d"), "WA_DEFAULT");
$InsertQuery->bindColumn("activeto", "s", $_POST["activeto"] ?? date("Y-m-d"), "WA_DEFAULT");
// Handling hidden inputs
$InsertQuery->bindColumn("company_id", "s", $_POST["company_id"] ?? "", "WA_DEFAULT");
// Execute the query
$InsertQuery->execute();
// Dopo l'esecuzione dell'inserimento
$lastInsertedId = $InsertQuery->InsertID;
// Redirect con l'ID dello standard
$InsertGoTo = "update-standards.php?id=$lastInsertedId";
if (function_exists("rel2abs")) {
$InsertGoTo = rel2abs($InsertGoTo, dirname(__FILE__));
}
$InsertQuery->redirect($InsertGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">EasySpec: Insert New Standard</h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label">Title Standard</label>
<div class="col-sm-9">
<div class="input-group">
<input name="titlestandards" type="text" class="form-control" id="titlestandards">
</div>
</div>
</div>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label">Number Standard</label>
<div class="col-sm-9">
<div class="input-group">
<input name="numberstandards" type="text" class="form-control" id="numberstandards">
</div>
</div>
</div>
<!-- Year Standard with year dropdown -->
<div class="form-group row">
<label for="yearstandards" class="col-sm-3 control-label">Year Standard</label>
<div class="col-sm-9">
<select name="yearstandards" class="form-control" id="yearstandards">
<option value="">Select</option> <!-- Opzione predefinita -->
<?php
$currentYear = date('Y');
for ($year = $currentYear; $year >= 1900; $year--) {
echo "<option value='$year'>$year</option>";
}
?>
</select>
</div>
</div>
<!-- Status with checkbox, using inline styles for quick fixes -->
<div class="form-group row">
<label for="status" class="col-sm-3 control-label">Status</label>
<div class="col-sm-2">
<input name="status" type="checkbox" class="form-check-input" id="status" value="A" style="width: 20px; height: 20px;">
<label class="form-check-label" for="status">Active</label>
</div>
</div>
<!-- Description with text area -->
<div class="form-group row">
<label for="description" class="col-sm-3 control-label">Description</label>
<div class="col-sm-9">
<textarea name="description" class="form-control" id="description" rows="4"></textarea>
</div>
</div>
<!-- Active From and Active To with date pickers -->
<div class="form-group row">
<label for="activefrom" class="col-sm-3 control-label">Active From</label>
<div class="col-sm-9">
<input name="activefrom" type="date" class="form-control" id="activefrom" value="<?php echo date('Y-m-d'); ?>">
</div>
</div>
<div class="form-group row">
<label for="activeto" class="col-sm-3 control-label">Active To</label>
<div class="col-sm-9">
<input name="activeto" type="date" class="form-control" id="activeto">
</div>
</div>
</div>
<input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>">
<?php if ($kindofrole == '3') { ?>
<input name="preset" type="hidden" id="preset" value="Y"><?php } else { ?>
<input name="preset" type="hidden" id="preset" value="N"><?php } ?>
<td><input name="department_id" type="hidden" id="department_id"></td>
<td><input name="created_at" type="hidden" id="created_at"></td>
<td><input name="updated_at" type="hidden" id="updated_at"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9"><br>
<button type="submit" class="btn btn-success waves-effect waves-light">Insert</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+471
View File
@@ -0,0 +1,471 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<?php if (isset($_POST['id'])) {
$idrsl = $_POST['id'];
} ?>
<?php if (isset($_GET['id'])) {
$idrsl = $_GET['id'];
} ?>
<?php
$tablequery = new WA_MySQLi_RS("tablequery", $repnew, 0);
$tablequery->setQuery("SELECT * FROM rsl LEFT JOIN rsl_category ON rsl.rsl_category_id=rsl_category.idrslcat WHERE rsl.id='$idrsl'");
$tablequery->execute();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$idmaterial_type = $_POST['material'];
$idrsl = $_POST['id'];
include('check-mat-present.php');
$idmatpr = $checkmatpr->getColumnVal("idmaterial_rsl");
if (empty($idmatpr)) {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "material_rsl";
$InsertQuery->bindColumn("material_id", "i", "" . ((isset($_POST["material"])) ? $_POST["material"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("rsl_id", "i", "" . ((isset($_POST["id"])) ? $_POST["id"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo); ?>
<div class="alert alert-success"><i class="fa fa-check"></i> Material added! </div>
<?php
}
if (!empty($idmatpr)) {
?>
<div class="alert alert-warning"><i class="fa fa-exclamation-triangle"></i> Material not added. The Material was already present in the RSL. </div>
<?php }
}
?>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="mb-0">RSL <?php echo ($tablequery->getColumnVal("name")); ?> </h5>
<br>
<a class="btn btn-danger" href="update-rsl.php?id=<?php echo ($tablequery->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Edit TRL">Edit TRL</a>
<a class="btn btn-danger" href="analysis.php" role="button">Analysis</a>
<a class="btn btn-danger" href="material.php" role="button">Material</a>
<a href="synoptic-table.php?idrsl=<?php echo ($tablequery->getColumnVal("id")); ?>"><button type="button" class="btn btn-success waves-effect waves-light" data-toggle="tooltip" title="Synoptic Table"><i class="bx bx-table font-size-16 align-middle"></i></button></a>
<a href="pdfcreation/pdf-rsl.php?idrsl=<?php echo ($tablequery->getColumnVal("id")); ?>"><button type="button" class="btn btn-success waves-effect waves-light" data-toggle="tooltip" title="Print"><i class="bx bx-printer font-size-16 align-middle"></i></button></a>
<button type="button" class="btn btn-danger waves-effect waves-light" data-toggle="tooltip" title="Save PDF" onclick="showConfirmation(<?php echo ($tablequery->getColumnVal('id')); ?>)">
<i class="fa fa-file-pdf font-size-16 align-middle"></i>
</button>
<!-- <a href="send-email-trl.php"> --><button type="button" id="btn_send_trl" class="btn btn-success waves-effect waves-light"><i class="bx bx-mail-send font-size-16 align-middle"></i> Send TRL to clients</button><!-- </a> -->
<a class="btn btn-dark" href="javascript:void(0);" onclick="window.history.back();" role="button">Go Back</a><br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead style="background-color:pink">
<tr>
<th><strong><?php echo $name_lang; ?></strong></th>
<th><strong><?php echo $version_lang; ?></strong></th>
<th><strong><?php echo $description_lang; ?></strong></th>
<th><strong><?php echo $start_lang; ?></strong></th>
<th><strong><?php echo $end_lang; ?></strong></th>
<th><strong><?php echo $rsl_category_id_lang; ?></strong></th>
<th><strong><?php echo $active_lang; ?></strong></th>
<th><strong>PDF</strong></th>
</tr>
</thead>
<tbody class="table-danger">
<tr>
<td><?php echo ($tablequery->getColumnVal("name")); ?></td>
<td><?php echo ($tablequery->getColumnVal("version")); ?></td>
<td><?php echo ($tablequery->getColumnVal("description")); ?></td>
<td><?php echo ($tablequery->getColumnVal("start")); ?></td>
<td><?php echo ($tablequery->getColumnVal("end")); ?></td>
<td><?php echo ($tablequery->getColumnVal("name_rslcat")); ?></td>
<td><?php $actstatus = $tablequery->getColumnVal("active");
if ($actstatus == "Y") { ?><button type="button" class="btn btn-success waves-effect waves-light"><i class="bx bx-check-double font-size-16 align-middle"></i></button><?php } else { ?><button type="button" class="btn btn-danger waves-effect waves-light"><i class="bx bx-block font-size-16 align-middle"></i></button><?php } ?></td>
<td>
<?php
$trlpdf = $tablequery->getColumnVal("trlpdf");
if (!empty($trlpdf)) {
echo '<a href="trlstorage/' . $trlpdf . '" target="_blank"><i class="fa fa-file-pdf red-pdf-icon"></i></a>';
}
?>
</td>
</tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h4 class="mb-0"><?php echo $materialsadd; ?> - <?php echo $materialsaddlist; ?> </h4>
<br>
<?php
$materiallist = new WA_MySQLi_RS("materiallist", $repnew, 0);
$materiallist->setQuery("SELECT * FROM material_type WHERE material_type.company_id='$idcompany' ORDER BY material_type.name_material");
$materiallist->execute();
?>
<form method="post" class="form-control" id="addmaterial" style="display: flex; align-items: center; justify-content: flex-start;">
<select class="select2 form-control custom-select select2-hidden-accessible" name="material" id="material" style="max-width: 200px;">
<?php
while (!$materiallist->atEnd()) {
?>
<option value="<?php echo ($materiallist->getColumnVal("idmaterial_type")); ?>">
<?php echo ($materiallist->getColumnVal("name_material")); ?>
</option>
<?php
$materiallist->moveNext();
}
$materiallist->moveFirst();
?>
</select>
<input name="idcompany" type="hidden" id="idcompany">
<input name="id" type="hidden" id="id" value="<?php echo ($tablequery->getColumnVal("id")); ?>">
<button type="button" class="btn btn-primary waves-effect waves-light" onclick="document.getElementById('addmaterial').submit();" style="white-space: nowrap;">
Add
</button>
</form>
<br>
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong><?php echo $name_material_lang; ?></strong></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$tablequery2 = new WA_MySQLi_RS("tablequery2", $repnew, 0);
$tablequery2->setQuery("SELECT * FROM `material_rsl` LEFT JOIN material_type ON material_rsl.material_id=material_type.idmaterial_type WHERE material_rsl.rsl_id='$idrsl'");
$tablequery2->execute();
?>
<?php
$wa_startindex = 0;
while (!$tablequery2->atEnd()) {
$wa_startindex = $tablequery2->Index;
?>
<tr>
<td><?php echo ($tablequery2->getColumnVal("name_material")); ?></td>
<td><a class="btn btn-danger" href="detail-rsl.php?idmaterial_rsl=<?php echo ($tablequery2->getColumnVal("idmaterial_rsl")); ?>&id=<?php echo ($tablequery->getColumnVal("id")); ?>&material_id=<?php echo ($tablequery2->getColumnVal("material_id")); ?>" role="button">Add/Show Analysis List</a></td>
<td>
<a class="btn btn-danger" href="javascript:void(0);" role="button" data-toggle="tooltip" title="Delete" onclick="deleteMaterial(<?php echo ($tablequery2->getColumnVal('idmaterial_rsl')); ?>, <?php echo ($tablequery->getColumnVal('id')); ?>)">C</a>
</td>
<?php $tablequery2->moveNext();
}
$tablequery2->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script src="assets/js/jquery-2.2.4.min.js"></script>
<script>
function deleteMaterial(idMaterialRsl, id) {
Swal.fire({
title: 'Do you want to delete this material from the TRL?',
showCancelButton: true,
confirmButtonText: 'Confirm',
cancelButtonText: 'Close',
reverseButtons: false,
confirmButtonColor: '#d33'
}).then((result) => {
if (result.isConfirmed) {
// Se l'utente conferma, reindirizza alla pagina di cancellazione
window.location.href = 'cancel-materialrsl.php?idmaterial_rsl=' + idMaterialRsl + '&id=' + id;
}
});
}
function sendNewsletter(idRsl) {
Swal.fire({
title: 'SayTRL: Do you want to distribute the TRL to your suppliers?',
showCancelButton: true,
confirmButtonText: 'Confirm',
cancelButtonText: 'Close',
reverseButtons: false, // "Confirm" viene mostrato prima di "Close"
confirmButtonColor: 'blue' // Colore rosso per il pulsante di conferma
}).then((result) => {
if (result.isConfirmed) {
// Se l'utente conferma, reindirizza alla pagina sendnewsletter.php
window.location.href = 'sendnewsletter.php?idrsl=' + idRsl;
}
});
}
</script>
<script>
$(document).ready(function() {
// $('[data-toggle="tooltip"]').tooltip();
});
</script>
<script>
$(document).ready(function() {
$('#btn_send_trl').on('click', function() {
$('.modal-body').html('<i class="fas fa-hourglass-start"></i> Sending email. Please wait...');
$('#successModal').modal('show');
$.ajax({
url: 'include/send-email-trl-ajax.php',
method: 'GET',
dataType: 'json',
data: {
"action": "get_maillist",
"idcompany": "<?php echo $idcompany; ?>",
},
success: function(response) {
if (response.length > 0) {
jsonObject = response;
var index = 0;
var success_counter = 0;
var error_counter = 0;
var sending_failed = "<font color=\"tomato\"><i class=\"fas fa-exclamation-triangle\"></i> Unable to send email to the following recipient(s):<br>";
/* CREATE SEPARATE COUNTER FOR PROCESSED ITEMS */
var n = 0;
/* Define a function to process the JSON data */
function processItem() {
if (index < jsonObject.length) {
var item = jsonObject[index];
index++;
$.get('send-email-trl.php', {
idrsl: '<?php echo $idrsl; ?>',
mail_id: item.id,
}, function(response) {
if (response.trim() == 'ok') {
success_counter++
} else {
/* GET EMAIL ADDRESS IF SENDING FAILED */
sending_failed += '-' + response.trim() + '<br>'
error_counter++;
}
n++
if (success_counter > 0) {
/* SHOW MESSAGE IF ATLEAST 1 EMAIL SENT SUCCESSFULLY */
$('.modal-body').text(success_counter + ' of ' + jsonObject.length + ' email(s) sent.');
}
/* IF FINISHED SENDING EMAIL */
if (n >= jsonObject.length) {
if (success_counter > 0) {
/* SHOW MESSAGE IF ATLEAST 1 EMAIL SENT SUCCESSFULLY */
$('.modal-body').append('<br><br><i class="fas fa-check-circle"></i> Finished Sending Email.');
}
if (error_counter > 0) {
if (success_counter == 0) {
/* CLEAR MODAL BODY */
$('.modal-body').text('');
} else {
/* ADD SPACER */
$('.modal-body').append("<br><br>");
}
/* SHOW EMAIL FAILED */
$('.modal-body').append(sending_failed + '</font>');
}
}
});
/* Continue the loop after 2 seconds */
setTimeout(processItem, 2000);
}
}
/* Start the loop */
processItem();
} else {
$('.modal-body').text('Unable to send email. No recipient found.');
}
},
error: function() {
}
});
});
});
</script>
<script>
function showConfirmation(id) {
Swal.fire({
title: 'Do you want to delete this material from the TRL?',
showCancelButton: true,
confirmButtonText: 'Confirm',
cancelButtonText: 'Close',
reverseButtons: false,
confirmButtonColor: '#d33'
}).then((result) => {
if (result.isConfirmed) {
// Se l'utente conferma, reindirizza alla pagina di cancellazione
window.location.href = 'cancel-materialrsl.php?idmaterial_rsl=' + idMaterialRsl + '&id=' + id;
}
});
}
</script>
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+292
View File
@@ -0,0 +1,292 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<a class="btn btn-danger" href="insert-material.php" role="button">Insert Material</a> <a class="btn btn-danger" href="rsl.php" role="button">RSL</a> <a class="btn btn-danger" href="analysis.php" role="button">Analysis</a> <?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_material_lang; ?></strong></th>
<th><strong><?php echo $desc_material_lang; ?></strong></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$tablequery = new WA_MySQLi_RS("tablequery", $repnew, 0);
$tablequery->setQuery("SELECT * FROM material_type WHERE material_type.company_id='$idcompany'");
$tablequery->execute();
?>
<?php
$wa_startindex = 0;
while (!$tablequery->atEnd()) {
$wa_startindex = $tablequery->Index;
?>
<tr>
<td><?php echo ($tablequery->getColumnVal("name_material")); ?></td>
<td><?php echo ($tablequery->getColumnVal("desc_material")); ?></td>
<td><a class="btn btn-danger" href="update-material.php?idmaterial_type=<?php echo ($tablequery->getColumnVal("idmaterial_type")); ?>" role="button">E</a></td>
<td><a class="btn btn-danger" href="cancel-material.php?idmaterial_type=<?php echo ($tablequery->getColumnVal("idmaterial_type")); ?>" role="button">C</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-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-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: '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');
// 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: '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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+172
View File
@@ -0,0 +1,172 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<a class="btn btn-danger" href="insert-rsl-cat.php" role="button">Insert RSL Category</a>
<a class="btn btn-danger" href="rsl.php" role="button">RSL</a>
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
<br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong><?php echo $name_rslcat_lang; ?></strong></th>
<th><strong><?php echo $comment_rslcat_lang; ?></strong></th>
<th><strong><?php echo $department_id_lang; ?></strong></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php $tablequery = new WA_MySQLi_RS("rsl_category", $repnew, 0);
$tablequery->setQuery("SELECT * FROM `rsl_category` WHERE rsl_category.company_id='$idcompany'");
$tablequery->execute();
$wa_startindex = 0;
while (!$tablequery->atEnd()) {
$wa_startindex = $tablequery->Index;
?> <tr>
<td><?php echo ($tablequery->getColumnVal("name_rslcat")); ?></td>
<td><?php echo ($tablequery->getColumnVal("comment_rslcat")); ?></td>
<td><?php echo ($tablequery->getColumnVal("department_id")); ?></td>
<td><a class="btn btn-danger" href="update-rsl-cat.php?idrslcat=<?php echo ($tablequery->getColumnVal("idrslcat")); ?>" role="button">M</a></td>
<td><a class="btn btn-danger" href="cancel-rsl-cat.php?idrslcat=<?php echo ($tablequery->getColumnVal("idrslcat")); ?>" role="button">C</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-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+312
View File
@@ -0,0 +1,312 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<a class="btn btn-danger" href="insert-rsl.php" role="button"><?php echo $insertnewrsltitle; ?></a> <a class="btn btn-danger" href="rsl-category.php" role="button">RSL Category</a> <a class="btn btn-danger" href="material.php" role="button"><?php echo $materialstitle; ?></a> <a class="btn btn-danger" href="analysis.php" role="button">Analysis</a><?php if ($infobox == "wizard") { ?> <a class="btn btn-dark" href="rslwizard1.php" role="button">Back to Wizard</a><?php } ?>
<a href="component.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Components</button></a>
<a href="standards.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Standards</button></a>
<a href="saytrl-newsletter.php"><button type="button" class="btn btn-success w-lg waves-effect waves-light">SayTRL</button></a>
<br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong><?php echo $active_lang; ?></strong></th>
<th><strong><?php echo $name_lang; ?></strong></th>
<th><strong><?php echo $version_lang; ?></strong></th>
<th><strong><?php echo $description_lang; ?></strong></th>
<th><strong><?php echo $start_lang; ?></strong></th>
<th><strong><?php echo $rsl_category_id_lang; ?></strong></th>
<th width="170"></th>
<th width="120"></th>
</tr>
</thead>
<tbody>
<?php $rsllist = new WA_MySQLi_RS("rsl", $repnew, 0);
$rsllist->setQuery("SELECT * FROM rsl LEFT JOIN rsl_category ON rsl.rsl_category_id=rsl_category.idrslcat WHERE rsl.company_id='$idcompany'");
$rsllist->execute();
$wa_startindex = 0;
while (!$rsllist->atEnd()) {
$wa_startindex = $rsllist->Index;
?> <tr>
<td>
<?php $actstatus = $rsllist->getColumnVal("active");
if ($actstatus == "Y") { ?><button type="button" class="btn btn-success waves-effect waves-light" data-toggle="tooltip" title="Active"><i class="bx bx-check-double font-size-16 align-middle"></i></button><?php } else { ?><button type="button" class="btn btn-danger waves-effect waves-light" data-toggle="tooltip" title="Inactive"><i class="bx bx-block font-size-16 align-middle"></i></button><?php } ?></td>
<td><?php echo ($rsllist->getColumnVal("name")); ?></td>
<td><?php echo ($rsllist->getColumnVal("version")); ?></td>
<td><?php echo ($rsllist->getColumnVal("description")); ?></td>
<td><?php echo ($rsllist->getColumnVal("start")); ?></td>
<td><?php echo ($rsllist->getColumnVal("name_rslcat")); ?></td>
<td>
<a href="synoptic-table.php?idrsl=<?php echo ($rsllist->getColumnVal("id")); ?>"><button type="button" class="btn btn-success waves-effect waves-light" data-toggle="tooltip" title="Synoptic Table"><i class="bx bx-table font-size-16 align-middle"></i></button></a>
<a class="btn btn-success" href="material-rsl.php?id=<?php echo ($rsllist->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Go"><i class="fas fa-angle-double-right font-size-16 align-middle"></i></a>
<a class="btn btn-danger canc-btn" href="cancel-rsl.php?id=<?php echo ($rsllist->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Delete"><i class="fas fa-trash font-size-16 align-middle"></i></a>
</td>
<td>
<a class="btn btn-primary rev-btn" href="rev-rsl.php?id=<?php echo ($rsllist->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Revision"><i class="fa fa-history font-size-16 align-middle"></i></a>
<a class="btn btn-warning clone-btn" href="clone-rsl.php?id=<?php echo ($rsllist->getColumnVal("id")); ?>" role="button" data-toggle="tooltip" title="Clone"><i class="far fa-clone font-size-16 align-middle"></i></a>
</td>
</tr>
<?php $rsllist->moveNext();
}
$rsllist->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?></tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-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: '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');
// 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: '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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,28 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php // Assicurati di includere il file di connessione al DB
$conn = new mysqli($servername, $username, $password, $database);
$query = $_GET['query']; // Ricevi la stringa di ricerca
$sql = "SELECT * FROM component WHERE name_component LIKE ? OR cas_component LIKE ?"; // Query SQL per il filtraggio
$stmt = $conn->prepare($sql);
$searchTerm = '%' . $query . '%';
$stmt->bind_param('ss', $searchTerm, $searchTerm);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr>
<td>{$row['idcomponent']}</td>
<td>{$row['name_component']}</td>
<td>{$row['cas_component']}</td>
<td>{$row['formula_component']}</td>
<td>{$row['component_family_id']}</td>
<td>Edit/Delete Buttons</td>
</tr>";
}
} else {
echo "<tr><td colspan='6'>No results found</td></tr>";
}
$stmt->close();
$conn->close();
+341
View File
@@ -0,0 +1,341 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php if (isset($_GET['idanalysis'])) {
$idanalysis = $_GET['idanalysis'];
}
if (isset($_GET['idcomponent'])) {
$idcomponent = $_GET['idcomponent'];
} ?>
<?php
if (isset($_GET['idcomponent'])) {
$checkcomponentpresent = new WA_MySQLi_RS("checkcomponentpresent", $repnew, 1);
$checkcomponentpresent->setQuery("SELECT * FROM analysis_component WHERE analysis_component.idanalysis='$idanalysis' AND analysis_component.idcomponent='$idcomponent' AND analysis_component.idcompany='$idcompany'");
$checkcomponentpresent->execute();
if (empty($checkcomponentpresent->getColumnVal("idanalysiscomponent"))) {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "analysis_component";
$InsertQuery->bindColumn("idanalysis", "i", "$idanalysis", "WA_DEFAULT");
$InsertQuery->bindColumn("idcomponent", "i", "$idcomponent", "WA_DEFAULT");
$InsertQuery->bindColumn("idcompany", "i", "$idcompany", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
}
?>
<?php
if ($_GET['idanalysis'] != '') {
$idanalysis = $_GET['idanalysis'];
}
//pickup post criteria search and query
if ((isset($_POST['compname'])) && ($_POST['compname'] != '')) {
$compname = $_POST['compname'];
} else {
$compname = 'abracadabra';
}
if ((isset($_POST['familycat'])) && ($_POST['familycat'] != '')) {
$familycat = $_POST['familycat'];
} else {
$familycat = 'abracadabra';
}
if ((isset($_POST['maincat'])) && ($_POST['maincat'] != '')) {
$maincat = $_POST['maincat'];
} else {
$maincat = 'abracadabra';
}
if ((isset($_POST['casnum'])) && ($_POST['casnum'] != '')) {
$casnum = $_POST['casnum'];
} else {
$casnum = 'abracadabra';
} ?>
<?php
//echo $compname;
//echo $familycat;
//echo $maincat;
//echo $casnum;
$querybuildselect = "SELECT * FROM component WHERE ";
if ($compname != 'abracadabra') {
$querybuild2 = "component.name_component LIKE '%$compname%'";
} else {
$querybuild2 = "";
}
if ($familycat != 'abracadabra') {
$querybuild3 = "component.component_family_id='$familycat'";
} else {
$querybuild3 = "";
}
if ($maincat != 'abracadabra') {
$querybuild4 = "component.component_family_type='$maincat'";
} else {
$querybuild4 = "";
}
if ($casnum != 'abracadabra') {
$querybuild5 = "component.cas_component='$casnum'";
} else {
$querybuild5 = "";
}
$querybuildorder = " ORDER BY component.name_component";
if (($querybuild2 != '') && (($querybuild3 != '') || ($querybuild4 != '') || ($querybuild5 != ''))) {
$queryand1 = " AND ";
} else {
$queryand1 = '';
}
if (($querybuild3 != '') && (($querybuild4 != '') || ($querybuild5 != ''))) {
$queryand2 = " AND ";
} else {
$queryand2 = '';
}
if (($querybuild4 != '') && ($querybuild5 != '')) {
$queryand3 = " AND ";
} else {
$queryand3 = '';
}
if (isset($_POST['querysearchform'])) {
$querybuildtotal = $querybuildselect . $querybuild2 . $queryand1 . $querybuild3 . $queryand2 . $querybuild4 . $queryand3 . $querybuild5;
//echo $querybuildtotal;
$querylist = "SELECT * FROM component LEFT JOIN component_family ON component.component_family_id=component_family.idcomponentfamily LEFT JOIN component_family_type ON component.component_family_type=component_family_type.idcomponentfamilytype WHERE component.name_component LIKE '%$compname%' OR component.cas_component='$casnum' OR component.component_family_id='$familycat' OR component.component_family_type='$maincat' ORDER BY component.name_component";
$searchenginequery = new WA_MySQLi_RS("searchenginequery", $repnew, 50);
$searchenginequery->setQuery("$querybuildtotal");
$searchenginequery->execute();
}
?>
<?php
$analysisdet = new WA_MySQLi_RS("analysisdet", $repnew, 1);
$analysisdet->setQuery("SELECT * FROM analysis WHERE analysis.idanalysis='$idanalysis'");
$analysisdet->execute();
?>
<?php
$fanilycatquery = new WA_MySQLi_RS("fanilycatquery", $repnew, 0);
$fanilycatquery->setQuery("SELECT * FROM component_family ORDER BY component_family.name_componentfamily");
$fanilycatquery->execute();
?>
<?php
$maincatquery = new WA_MySQLi_RS("maincatquery", $repnew, 0);
$maincatquery->setQuery("SELECT * FROM component_family_type ORDER BY component_family_type.name_componentfamilytype");
$maincatquery->execute(); ?>
<!doctype html>
<script type='text/javascript'>
window.onunload = function() {
window.opener.location.reload();
}
</script>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?php echo $titlewebsite; ?></title>
<?php //include('../include/metacont.php');
?>
<!-- App favicon -->
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<!-- Bootstrap Css -->
<link href="../assets/css/bootstrap.min.css" id="bootstrap-style" rel="stylesheet" type="text/css" />
<!-- Icons Css -->
<link href="../assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<!-- App Css-->
<link href="../assets/css/app.min.css" id="app-style" rel="stylesheet" type="text/css" />
<style>
.table-custom tr {
height: 25px;
line-height: 25px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</head>
<body>
<div id="layout-wrapper">
<div class="page-content">
<div class="alert alert-primary" role="alert">
<?php echo $searcandaddtitle; ?><?php echo ($analysisdet->getColumnVal("name_analysis")); ?>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead style="background-color:#66ccff">
<tr>
<th><strong><?php echo $name_component_lang; ?></strong></th>
<th><strong><?php echo $family_component_lang; ?></strong></th>
<th><strong><?php echo $labfamily_component_lang; ?></strong></th>
<th><strong><?php echo $cas_component_lang; ?></strong></th>
<th width="200"></th>
</tr>
</thead>
<form method="post" title="querysearch" id="querysearch">
<input type="hidden" id="querysearchform" name="querysearchform" value="querysearchform">
<tbody class="table-primary">
<tr>
<td>
<div>
<input class="form-control" type="text" placeholder="<?php echo $name_component_lang; ?>" id="compname" name="compname">
</div>
</td>
<td>
<div>
<select class="form-select" id="familycat" name="familycat">
<option value=""><?php echo $selecttitle; ?></option>
<?php
while (!$fanilycatquery->atEnd()) { //dyn select
?>
<option value="<?php echo ($fanilycatquery->getColumnVal("idcomponentfamily")); ?>"><?php echo ($fanilycatquery->getColumnVal("name_componentfamily")); ?></option>
<?php
$fanilycatquery->moveNext();
} //dyn select
$fanilycatquery->moveFirst();
?>
</select>
</div>
</td>
<td>
<div class="col-md-12">
<select class="form-select" id="maincat" name="maincat">
<option value=""><?php echo $selecttitle; ?></option>
<?php
while (!$maincatquery->atEnd()) { //dyn select
?>
<option value="<?php echo ($maincatquery->getColumnVal("idcomponentfamilytype")); ?>"><?php echo ($maincatquery->getColumnVal("name_componentfamilytype")); ?></option>
<?php
$maincatquery->moveNext();
} //dyn select
$maincatquery->moveFirst();
?>
</select>
</div>
</td>
<td>
<div>
<input class="form-control" type="text" placeholder="<?php echo $cas_component_lang; ?>" id="casnum" name="casnum">
</div>
</td>
<td>
<div>
<button type="submit" class="btn btn-primary w-md"><?php echo $searchgotitle; ?></button>
</div>
</td>
</tr>
</tbody>
</form>
</table>
</div>
<div class="table-responsive table-custom">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong><?php echo $name_component_lang; ?></strong></th>
<th><strong><?php echo $family_component_lang; ?></strong></th>
<th><strong><?php echo $labfamily_component_lang; ?></strong></th>
<th><strong><?php echo $cas_component_lang; ?></strong></th>
<th width="200"></th>
</tr>
</thead>
<tbody>
<?php
if (isset($_POST['querysearchform'])) {
$wa_startindex = 0;
while (!$searchenginequery->atEnd()) {
$wa_startindex = $searchenginequery->Index;
?>
<tr>
<td><?php echo $searchenginequery->getColumnVal("name_component"); ?></td>
<td><?php echo $searchenginequery->getColumnVal("name_componentfamily"); ?></td>
<td><?php echo $searchenginequery->getColumnVal("name_componentfamilytype"); ?></td>
<td><?php echo $searchenginequery->getColumnVal("cas_component"); ?></td>
<td><a class="btn btn-danger" href="searchengine.php?idanalysis=<?php echo $analysisdet->getColumnVal("idanalysis"); ?>&idcomponent=<?php echo $searchenginequery->getColumnVal("idcomponent"); ?>" role="button"><?php echo $addtitle; ?></a></td>
</tr>
<?php
$searchenginequery->moveNext();
}
$searchenginequery->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
}
?>
</tbody>
</table>
</div>
</div>
</div><button onclick="self.close()" type="button" class="btn btn-success waves-effect waves-light"><?php echo $closewindowtitle; ?></button>
</div>
</div>
</div>
</div>
</div>
<script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/libs/metismenujs/metismenujs.min.js"></script>
<script src="assets/libs/simplebar/simplebar.min.js"></script>
<script src="assets/libs/eva-icons/eva.min.js"></script>
<script src="assets/js/app.js"></script>
</body>
</html>
@@ -0,0 +1,297 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<?php if (isset($_GET['idanalysis'])) {
$idanalysis = $_GET['idanalysis'];
}
if (isset($_GET['idanalysisrsl'])) {
$idanalysisrsl = $_GET['idanalysisrsl'];
}
if (isset($_GET['idmaterial'])) {
$idmaterial = $_GET['idmaterial'];
}
if ((isset($_POST['methodsname'])) && ($_POST['methodsname'] != '')) {
$methodsname = $_POST['methodsname'];
} else {
$methodsname = 'abracadabra';
}
if ((isset($_POST['methodsnumber'])) && ($_POST['methodsnumber'] != '')) {
$methodsnumber = $_POST['methodsnumber'];
} else {
$methodsnumber = 'abracadabra';
}
if (isset($_GET['updmeth'])) {
$updmeth = $_GET['updmeth'];
}
if (isset($_GET['idmethods'])) {
$idmethods = $_GET['idmethods'];
}
?>
<?php if (isset($updmeth)) {
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`analysis_rsl`";
$UpdateQuery->bindColumn("idmethods", "i", "" . ((isset($_GET["idmethods"])) ? $_GET["idmethods"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("idanalysis_rsl", "=", "i", "" . ($_GET['idanalysisrsl']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
//echo $methodsnumber;
//echo $methodsname;
$querybuildselect = "SELECT * FROM standards WHERE ";
if ($methodsname != 'abracadabra') {
$querybuild2 = "standards.titlestandards LIKE '%$methodsname%'";
} else {
$querybuild2 = "";
}
if ($methodsnumber != 'abracadabra') {
$querybuild3 = "standards.numberstandards LIKE '%$methodsnumber%'";
} else {
$querybuild3 = "";
}
$querybuildorder = " ORDER BY standards.numberstandards";
if (($querybuild2 != '') && (($querybuild3 != ''))) {
$queryand1 = " AND ";
} else {
$queryand1 = '';
}
if (($querybuild3 != '')) {
$queryand2 = " AND ";
} else {
$queryand2 = '';
}
if (isset($_POST['querysearchform'])) {
$querybuildtotal = $querybuildselect . $querybuild2 . $queryand1 . $querybuild3 . $querybuildorder;
//echo $querybuildtotal;
//$querylist="SELECT * FROM component WHERE component.name_component LIKE '%$compname%' OR component.cas_component='$casnum' OR component.component_family_id='$familycat' OR component.component_family_type='$maincat' ORDER BY component.name_component";
$searchenginequery = new WA_MySQLi_RS("searchenginequery", $repnew, 50);
$searchenginequery->setQuery("$querybuildtotal");
$searchenginequery->execute();
}
?>
<?php
$analysisdet = new WA_MySQLi_RS("analysisdet", $repnew, 1);
$analysisdet->setQuery("SELECT * FROM analysis WHERE analysis.idanalysis='$idanalysis'");
$analysisdet->execute();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">Search your method and add to the analysis: <?php echo ($analysisdet->getColumnVal("name_analysis")); ?></h5>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead style="background-color:#66ccff">
<tr>
<th><strong>Methods Name</strong></th>
<th><strong>Methods Number</strong></th>
<th width="200"></th>
</tr>
</thead>
<form method="post" title="querysearch" id="querysearch">
<input type="hidden" id="querysearchform" name="querysearchform" value="querysearchform">
<tbody class="table-primary">
<tr>
<td>
<div>
<input class="form-control" type="text" placeholder="Methods Name" id="methodsname" name="methodsname">
</div>
</td>
<td>
<div>
<input class="form-control" type="text" placeholder="Methods Name" id="methodsnumber" name="methodsnumber">
</div>
</td>
<td>
<div>
<button type="submit" class="btn btn-primary w-md"><?php echo $searchgotitle; ?></button>
</div>
</td>
</tr>
</tbody>
</form>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">Method List</h5>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong>Methods Name</strong></th>
<th><strong>Methods Number</strong></th>
<th><strong>Year</strong></th>
<th width="200"></th>
</tr>
</thead>
<tbody>
<?php
if (isset($_POST['querysearchform'])) {
$wa_startindex = 0;
while (!$searchenginequery->atEnd()) {
$wa_startindex = $searchenginequery->Index;
?>
<tr>
<td><?php echo $searchenginequery->getColumnVal("titlestandards"); ?></td>
<td><?php echo $searchenginequery->getColumnVal("numberstandards"); ?></td>
<td><?php echo $searchenginequery->getColumnVal("yearstandards"); ?></td>
<td><a class="btn btn-danger" href="searchenginemethod.php?idanalysis=<?php echo $analysisdet->getColumnVal("idanalysis"); ?>&idmethods=<?php echo $searchenginequery->getColumnVal("idstandards"); ?>&updmeth=Y&idmaterial=<?php echo $idmaterial; ?>&idanalysisrsl=<?php echo $idanalysisrsl; ?>" role="button"><?php echo $addtitle; ?></a></td>
</tr>
<?php
$searchenginequery->moveNext();
}
$searchenginequery->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
}
?>
</tbody>
</table>
</div><!--end table-responsive-->
<button onclick="self.close()" type="button" class="btn btn-success waves-effect waves-light"><?php echo $closewindowtitle; ?></button>
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<!-- 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>
+367
View File
@@ -0,0 +1,367 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">EasySpec: STANDARDS </h5>
<a class="btn btn-danger" href="insert-standards.php" role="button">Insert new Standard</a> <a class="btn btn-danger" href="rsl-category.php" role="button">RSL Category</a> <a class="btn btn-danger" href="material.php" role="button"><?php echo $materialstitle; ?></a> <a class="btn btn-danger" href="analysis.php" role="button">Analysis</a><?php if ($infobox == "wizard") { ?> <a class="btn btn-dark" href="rslwizard1.php" role="button">Back to Wizard</a><?php } ?>
<a href="component.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Components</button></a>
<a href="rsl.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">RSL</button></a>
<a href="saytrl-newsletter.php"><button type="button" class="btn btn-success w-lg waves-effect waves-light">SayTRL</button></a>
<br><br>
<div class="row">
<div class="col-sm-12">
<input type="text" class="form-control mb-3" id="searchInput" placeholder="Search by Title or Number">
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong><?php echo $active_lang; ?></strong></th>
<th><strong>Standards Name</strong></th>
<th><strong>Number</strong></th>
<th><strong>Year</strong></th>
<th><strong>Active From</strong></th>
<th><strong>Active to</strong></th>
<th>PDF</th>
<th width="170"></th>
</tr>
</thead>
<tbody>
<?php $rsllist = new WA_MySQLi_RS("rsl", $repnew, 0);
$rsllist->setQuery("SELECT * FROM standards WHERE company_id='$idcompany'");
$rsllist->execute();
$wa_startindex = 0;
while (!$rsllist->atEnd()) {
$wa_startindex = $rsllist->Index;
?> <tr>
<td>
<?php $actstatus = $rsllist->getColumnVal("status");
if ($actstatus == "A") { ?><button type="button" class="btn btn-success waves-effect waves-light" data-toggle="tooltip" title="Active"><i class="bx bx-check-double font-size-16 align-middle"></i></button><?php } else { ?><button type="button" class="btn btn-danger waves-effect waves-light" data-toggle="tooltip" title="Inactive"><i class="bx bx-block font-size-16 align-middle"></i></button><?php } ?></td>
<td><?php echo ($rsllist->getColumnVal("titlestandards")); ?></td>
<td><?php echo ($rsllist->getColumnVal("numberstandards")); ?></td>
<td><?php echo ($rsllist->getColumnVal("yearstandards")); ?></td>
<td><?php echo ($rsllist->getColumnVal("activefrom")); ?></td>
<td><?php echo ($rsllist->getColumnVal("activeto")); ?></td>
<?php $idstandards = $rsllist->getColumnVal("idstandards");
// Assumendo che $conn sia l'oggetto della connessione al database
$conn = new mysqli($servername, $username, $password, $database);
$query = $conn->prepare("SELECT pdffilename FROM pdfstandards WHERE idstandards = ?");
$query->bind_param("i", $idstandards);
$query->execute();
$result = $query->get_result();
$pdfFiles = [];
while ($row = $result->fetch_assoc()) {
$pdfFiles[] = $row['pdffilename'];
}
?>
<!-- Esempio di come aggiungere il pulsante con data-id -->
<td>
<?php
$pdfCount = count($pdfFiles);
if ($pdfCount === 1) {
// Solo un PDF, mostra il link diretto
$pdfUrl = "../pdfstandards/" . $pdfFiles[0];
echo "<a href='$pdfUrl' target='_blank' class='btn btn-danger'>Open PDF</a>";
} elseif ($pdfCount > 1) {
// Più PDF, link alla pagina di gestione
$updateUrl = "update-standards.php?id=" . $rsllist->getColumnVal('idstandards');
echo "<a href='$updateUrl' class='btn btn-danger'>Manage PDFs</a>";
} else {
echo "<a href='' class='btn btn-secondary'>No PDFs</a>"; // Nessun PDF disponibile
}
?>
</td>
<td>
<a class="btn btn-success" href="update-standards.php?id=<?php echo ($rsllist->getColumnVal("idstandards")); ?>" role="button" data-toggle="tooltip" title="Go"><i class="fas fa-angle-double-right font-size-16 align-middle"></i></a>
<a class="btn btn-danger canc-btn" href="cancel-standards.php?id=<?php echo ($rsllist->getColumnVal("idstandards")); ?>" role="button" data-toggle="tooltip" title="Delete"><i class="fas fa-trash font-size-16 align-middle"></i></a>
</td>
</tr>
<?php $rsllist->moveNext();
}
$rsllist->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?></tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
$(document).ready(function() {
$('#searchInput').on('keyup', function() {
var searchValue = $(this).val().toLowerCase();
// Filtra solo se sono stati digitati almeno 3 caratteri
if (searchValue.length >= 3) {
$('table tbody tr').filter(function() {
$(this).toggle($(this).find('td:nth-child(2)').text().toLowerCase().indexOf(searchValue) > -1 ||
$(this).find('td:nth-child(3)').text().toLowerCase().indexOf(searchValue) > -1);
});
} else if (searchValue.length === 0) {
// Se il campo di ricerca è vuoto, mostra tutte le righe
$('table tbody tr').show();
}
});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-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: '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');
// 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: '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 Standard?",
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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+26
View File
@@ -0,0 +1,26 @@
<?php
include('../include/headscript.php'); // Assicurati che questo file contenga la configurazione di $conn
include("../class/company.php");
$conn = new mysqli($servername, $username, $password, $database);
$idstandards = $_GET['idstandards'];
$response = array();
$response['files'] = array();
if (isset($idstandards)) {
$query = $conn->prepare("SELECT pdffilename FROM pdfstandards WHERE idstandards = ?");
$query->bind_param("i", $idstandards);
$query->execute();
$result = $query->get_result();
while ($row = $result->fetch_assoc()) {
$response['files'][] = array(
'filename' => $row['pdffilename']
);
}
echo json_encode($response);
} else {
echo json_encode(array("status" => "error", "message" => "ID non fornito."));
}
+52
View File
@@ -0,0 +1,52 @@
<?php
include('../include/headscript.php'); // Assicurati che questo file contenga la configurazione di $conn
include("../class/company.php");
$idstandards = $_POST['idstandards']; // Assicurati che questo valore venga passato correttamente
$targetDir = "../pdfstandards/";
$response = array();
$uploadStatus = 1;
// Se il file è stato inviato
if (!empty($_FILES["file"]["name"])) {
$fileName = basename($_FILES["file"]["name"]);
$fileType = pathinfo($fileName, PATHINFO_EXTENSION);
// Permetti solo file PDF
if (strtolower($fileType) == 'pdf') {
// Rinomina il file con il timestamp
$newFileName = $fileName . '_' . time() . '.' . $fileType;
$targetFilePath = $targetDir . $newFileName;
// Carica il file
if (move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath)) {
// Inserisci il record nel database
$conn = new mysqli($servername, $username, $password, $database);
$insert = $conn->prepare("INSERT INTO pdfstandards (idstandards, pdffilename) VALUES (?, ?)");
$insert->bind_param("is", $idstandards, $newFileName);
if ($insert->execute()) {
$response['status'] = 'ok';
$response['message'] = 'File caricato e inserito con successo.';
} else {
$uploadStatus = 0;
$response['message'] = 'Caricamento del file riuscito, ma errore durante l\'inserimento nel database.';
}
$insert->close();
} else {
$uploadStatus = 0;
$response['message'] = 'Errore durante il caricamento del file.';
}
} else {
$uploadStatus = 0;
$response['message'] = 'Solo i file PDF sono permessi.';
}
} else {
$uploadStatus = 0;
$response['message'] = 'Si prega di selezionare un file da caricare.';
}
// Risposta dello stato di upload
$response['status'] = $uploadStatus ? 'ok' : 'err';
echo json_encode($response);
+356
View File
@@ -0,0 +1,356 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<?php if (isset($_GET['idrsl'])) {
$idrsl = $_GET['idrsl'];
} ?>
<?php
$rsldet = new WA_MySQLi_RS("rsldet", $repnew, 1);
$rsldet->setQuery("SELECT * FROM rsl WHERE rsl.id='$idrsl'");
$rsldet->execute();
?>
<?php
$materialrsllist = new WA_MySQLi_RS("materialrsllist", $repnew, 0);
$materialrsllist->setQuery("SELECT DISTINCT material_id,name_material FROM analysis_rsl LEFT JOIN material_type ON analysis_rsl.material_id=material_type.idmaterial_type WHERE analysis_rsl.rsl_id='$idrsl' ORDER BY analysis_rsl.material_id");
$materialrsllist->execute();
?>
<?php
$idmaterial = $materialrsllist->getColumnVal("idmaterial_type");
?>
<?php // group analysis_id for specific rsl (it will decide number of lines)
?>
<?php
$materialanalysislist = new WA_MySQLi_RS("materialanalysislist", $repnew, 0);
$materialanalysislist->setQuery("SELECT DISTINCT analysis_id FROM analysis_rsl WHERE analysis_rsl.rsl_id='$idrsl' ORDER BY analysis_rsl.analysis_id");
$materialanalysislist->execute(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="mb-0"><?php echo ($rsldet->getColumnVal("name")); ?>- Ver. <?php echo ($rsldet->getColumnVal("version")); ?></h5>
<br>
<button type="button" class="btn btn-dark" onclick="window.history.back();"><?php echo $back; ?></button>
<a href="../pdfcreation/pdf-creation.php?idrsl=<?php echo $idrsl; ?>"><button type="button" class="btn btn-danger"><i class="far fa-file-pdf font-size-16 align-middle"></i></button></a>
<button type="button" class="btn btn-success"><i class="far fa-file-excel font-size-16 align-middle"></i></button>
<br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><strong>Analysis</strong></th>
<?php
$wa_startindex = 0;
while (!$materialrsllist->atEnd()) {
$wa_startindex = $materialrsllist->Index;
?>
<th><strong><?php echo ($materialrsllist->getColumnVal("name_material")); ?></strong></th>
<?php
$materialrsllist->moveNext();
}
$materialrsllist->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tr>
</thead>
<tbody>
<?php
$wa_startindex = 0;
while (!$materialanalysislist->atEnd()) {
$wa_startindex = $materialanalysislist->Index;
?>
<tr>
<th><?php $idanalysis = ($materialanalysislist->getColumnVal("analysis_id"));
$analysisname = new WA_MySQLi_RS("analysisname", $repnew, 1);
$analysisname->setQuery("SELECT * FROM analysis WHERE analysis.idanalysis='$idanalysis'");
$analysisname->execute();
echo $analysisname->getColumnVal("name_analysis");
?></th>
<?php //query materials
?>
<?php
$idmaterialrsl = new WA_MySQLi_RS("idmaterialrsl", $repnew, 0);
$idmaterialrsl->setQuery("SELECT DISTINCT analysis_rsl.material_id FROM analysis_rsl WHERE analysis_rsl.rsl_id='$idrsl' ORDER BY analysis_rsl.material_id");
$idmaterialrsl->execute();
?>
<?php
$wa_startindex = 0;
while (!$idmaterialrsl->atEnd()) {
$wa_startindex = $idmaterialrsl->Index;
?> <td>
<?php
$idmaterial = $idmaterialrsl->getColumnVal("material_id");
$crosscheck = new WA_MySQLi_RS("crosscheck", $repnew, 1);
$crosscheck->setQuery("SELECT * FROM analysis_rsl WHERE analysis_rsl.analysis_id='$idanalysis' AND analysis_rsl.rsl_id='$idrsl' AND analysis_rsl.material_id='$idmaterial'");
$crosscheck->execute(); ?>
<?php if (empty($crosscheck->getColumnVal("idanalysis_rsl"))) {
echo "";
} else { ?><button type="button" class="btn btn-success waves-effect waves-light"><i class="bx bx-check-double font-size-16 align-middle"></i></button><?php } ?>
</td> <?php
$idmaterialrsl->moveNext();
}
$idmaterialrsl->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tr>
<?php
$materialanalysislist->moveNext();
}
$materialanalysislist->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-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: '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');
// 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: '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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,27 @@
<?php include('../include/headscript.php'); ?>
<?php
$conn = new mysqli($servername, $username, $password, $database);
// Verifica connessione
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Recupera i dati dal POST
$idmethods = $_POST['idmethods'];
$idanalysisrsl = $_POST['idanalysisrsl'];
// Prepara e esegui la query di aggiornamento
$sql = "UPDATE analysis_rsl SET idmethods = ? WHERE idanalysis_rsl = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ii", $idmethods, $idanalysisrsl);
if ($stmt->execute()) {
echo "SUCCESS";
} else {
echo "ERROR: " . $stmt->error;
}
// Chiudi la connessione
$stmt->close();
$conn->close();
@@ -0,0 +1,400 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`analysis`";
$UpdateQuery->bindColumn("name_analysis", "s", "" . ((isset($_POST["name_analysis"])) ? $_POST["name_analysis"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("description_analysis", "s", "" . ((isset($_POST["description_analysis"])) ? $_POST["description_analysis"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("family_analysis", "s", "" . ((isset($_POST["family_analysis"])) ? $_POST["family_analysis"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("idanalysis", "=", "i", "" . ($_GET['idanalysis']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "analysis.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<?php $idanalysis = $_GET['idanalysis']; ?>
<?php
$updatequery = new WA_MySQLi_RS("updatequery", $repnew, 0);
$updatequery->setQuery("SELECT * FROM analysis LEFT JOIN family_analysis ON analysis.family_analysis=family_analysis.idfamilyanalysis WHERE analysis.idanalysis='$idanalysis'");
$updatequery->execute();
?>
<!-- end row -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<h4 class="mt-0 header-title">Update Analysis</h4>
<p class="text-muted mb-4 font-13">Herefater you can modify the analysis</p>
<div class="row">
<div class="col-md-6">
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_analysis_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="name_analysis" type="text" class="form-control" id="name_analysis" value="<?php echo htmlspecialchars($updatequery->getColumnVal("name_analysis")); ?>">
</div>
</div>
</div>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $description_analysis_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="description_analysis" type="text" class="form-control" id="description_analysis" value="<?php echo htmlspecialchars($updatequery->getColumnVal("description_analysis")); ?>">
</div>
</div>
</div>
<?php
$conn = new mysqli($servername, $username, $password, $database);
$query = "SELECT idfamilyanalysis, namefamily FROM family_analysis ORDER BY family_analysis.namefamily";
$result = $conn->query($query);
?>
<div class="form-group row">
<label for="family_analysis" class="col-sm-3 control-label">Analysis Family</label>
<div class="col-sm-9">
<div class="input-group">
<select name="family_analysis" id="family_analysis" class="form-control">
<option value="">Select</option>
<?php if ($result->num_rows > 0) : ?>
<?php while ($row = $result->fetch_assoc()) : ?>
<option value="<?php echo htmlspecialchars($row['idfamilyanalysis']); ?>" <?php echo ($updatequery->getColumnVal("family_analysis") == $row['idfamilyanalysis']) ? 'selected' : ''; ?>>
<?php echo htmlspecialchars($row['namefamily']); ?>
</option>
<?php endwhile; ?>
<?php endif; ?>
</select>
</div>
</div>
</div>
<input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>">
<?php if ($kindofrole == '3') { ?>
<input name="preset" type="hidden" id="preset" value="Y"><?php } else { ?>
<input name="preset" type="hidden" id="preset" value="N"><?php } ?>
<td><input name="department_id" type="hidden" id="department_id"></td>
<input name="updated_at" type="hidden" id="updated_at" value="<?php echo date('Y-m-d H:i:s'); ?>">
<input name="idanalysis" type="hidden" id="idanalysis" value="<?php echo $idanalysis; ?>">
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9"><br>
<button type="submit" class="btn btn-success waves-effect waves-light">Update</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div> <!-- end col -->
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-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: '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');
// 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: '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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
// File upload via Ajax
$("#uploadForm").on('submit', function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
url: 'uploadlogorsl.php',
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
$('#uploadStatus').html('<img src="images/uploading.gif"/>');
},
error: function() {
$('#uploadStatus').html('<span style="color:#EA4335;">Images upload failed, please try again.<span>');
},
success: function(data) {
$('#uploadForm')[0].reset();
$('#uploadStatus').html('<span style="color:#28A74B;">Images uploaded successfully.<span>');
$('.gallery').html(data);
}
});
});
// File type validation
$("#fileInput").change(function() {
var fileLength = this.files.length;
var match = ["image/jpeg", "image/png", "image/jpg", "image/gif"];
var i;
for (i = 0; i < fileLength; i++) {
var file = this.files[i];
var imagefile = file.type;
if (!((imagefile == match[0]) || (imagefile == match[1]) || (imagefile == match[2]) || (imagefile == match[3]))) {
alert('Please select a valid image file (JPEG/JPG/PNG/GIF).');
$("#fileInput").val('');
return false;
}
}
});
});
</script>
<script>
$(document).ready(function() {
$(".upload-image").click(function() {
$(".form-horizontal").ajaxForm({
target: '.preview'
}).submit();
});
$('#form').parsley();
});
</script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,368 @@
<?php include('../include/headscript.php'); ?>
<?php //include("class/company.php");
?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`family_analysis`";
$UpdateQuery->bindColumn("namefamily", "s", "" . ((isset($_POST["namefamily"])) ? $_POST["namefamily"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("idfamilyanalysis", "=", "i", "" . ($_GET['idfamilyanalysis']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "analysis-category.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
.table-custom tr {
height: 40px;
line-height: 40px;
}
.table-custom td,
.table-custom th {
padding: 4px 8px;
}
.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;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<?php $idfamilyanalysis = $_GET['idfamilyanalysis']; ?>
<?php
$updatequery = new WA_MySQLi_RS("updatequery", $repnew, 0);
$updatequery->setQuery("SELECT * FROM family_analysis WHERE family_analysis.idfamilyanalysis='$idfamilyanalysis'");
$updatequery->execute();
?>
<!-- end row -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<h4 class="mt-0 header-title">Update Category Analysis</h4>
<div class="row">
<div class="col-md-6">
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_analysis_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="namefamily" type="text" class="form-control" id="namefamily" value="<?php echo htmlspecialchars($updatequery->getColumnVal("namefamily")); ?>">
</div>
</div>
</div>
<input name="company_id" type="hidden" id="company_id" value="<?php echo $idcompany; ?>">
<?php if ($kindofrole == '3') { ?>
<input name="preset" type="hidden" id="preset" value="Y"><?php } else { ?>
<input name="preset" type="hidden" id="preset" value="N"><?php } ?>
<td><input name="department_id" type="hidden" id="department_id"></td>
<input name="updated_at" type="hidden" id="updated_at" value="<?php echo date('Y-m-d H:i:s'); ?>">
<input name="idfamilyanalysis" type="hidden" id="idfamilyanalysis" value="<?php echo $idfamilyanalysis; ?>">
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9"><br>
<button type="submit" class="btn btn-success waves-effect waves-light">Update</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div> <!-- end col -->
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Selezioniamo tutti i bottoni con la classe 'clone-btn'
let cloneBtns = document.querySelectorAll('.clone-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: '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');
// 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: '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 -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
// File upload via Ajax
$("#uploadForm").on('submit', function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
url: 'uploadlogorsl.php',
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
$('#uploadStatus').html('<img src="images/uploading.gif"/>');
},
error: function() {
$('#uploadStatus').html('<span style="color:#EA4335;">Images upload failed, please try again.<span>');
},
success: function(data) {
$('#uploadForm')[0].reset();
$('#uploadStatus').html('<span style="color:#28A74B;">Images uploaded successfully.<span>');
$('.gallery').html(data);
}
});
});
// File type validation
$("#fileInput").change(function() {
var fileLength = this.files.length;
var match = ["image/jpeg", "image/png", "image/jpg", "image/gif"];
var i;
for (i = 0; i < fileLength; i++) {
var file = this.files[i];
var imagefile = file.type;
if (!((imagefile == match[0]) || (imagefile == match[1]) || (imagefile == match[2]) || (imagefile == match[3]))) {
alert('Please select a valid image file (JPEG/JPG/PNG/GIF).');
$("#fileInput").val('');
return false;
}
}
});
});
</script>
<script>
$(document).ready(function() {
$(".upload-image").click(function() {
$(".form-horizontal").ajaxForm({
target: '.preview'
}).submit();
});
$('#form').parsley();
});
</script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,223 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`component_family`";
$UpdateQuery->bindColumn("idcomponentfamily", "s", "" . ((isset($_POST["idcomponentfamily"])) ? $_POST["idcomponentfamily"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("name_componentfamily", "s", "" . ((isset($_POST["name_componentfamily"])) ? $_POST["name_componentfamily"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("description_componentfamily", "s", "" . ((isset($_POST["description_componentfamily"])) ? $_POST["description_componentfamily"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("component_family_type", "s", "" . ((isset($_POST["laboratory_componentfamily"])) ? $_POST["laboratory_componentfamily"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("created_at", "s", "" . ((isset($_POST["created_at"])) ? $_POST["created_at"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("idcomponentfamily", "=", "i", "" . ($_GET['idcomponentfamily']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "component-family.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<?php $idcomponentfamily = $_GET['idcomponentfamily']; ?>
<?php
$updatequery = new WA_MySQLi_RS("updatequery", $repnew, 0);
$updatequery->setQuery("SELECT * FROM component_family WHERE component_family.idcomponentfamily='$idcomponentfamily'");
$updatequery->execute();
?>
<?php
$maincatlist = new WA_MySQLi_RS("maincatlist", $repnew, 0);
$maincatlist->setQuery("SELECT * FROM component_family_type ORDER BY component_family_type.name_componentfamilytype");
$maincatlist->execute();
?>
<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 $updatecomfam; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_componentfamily_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="name_componentfamily" type="text" class="form-control" id="name_componentfamily" value="<?php echo ($updatequery->getColumnVal("name_componentfamily")); ?>">"
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $description_componentfamily_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="description_componentfamily" type="text" class="form-control" id="description_componentfamily" value="<?php echo ($updatequery->getColumnVal("description_componentfamily")); ?>">"
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $labfamily_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<select class="form-select" name="laboratory_componentfamily" id="laboratory_componentfamily">
<option value="" <?php if (!(strcmp("", ($updatequery->getColumnVal("component_family_type"))))) {
echo "selected=\"selected\"";
} ?>><?php echo $selecttitle; ?></option>
<?php
while (!$maincatlist->atEnd()) { //dyn select
?>
<option value="<?php echo ($maincatlist->getColumnVal("idcomponentfamilytype")); ?>" <?php if (!(strcmp($maincatlist->getColumnVal("idcomponentfamilytype"), ($updatequery->getColumnVal("component_family_type"))))) {
echo "selected=\"selected\"";
} ?>><?php echo ($maincatlist->getColumnVal("name_componentfamilytype")); ?></option>
<?php
$maincatlist->moveNext();
} //dyn select
$maincatlist->moveFirst();
?>
</select>
</div>
</div>
</div>
<td><input name="company_id" type="hidden" id="company_id" value="<?php echo ($updatequery->getColumnVal("company_id")); ?>"></td>
<td><input name="created_at" type="hidden" id="created_at" value="<?php echo ($updatequery->getColumnVal("created_at")); ?>"></td>
<td><input name="updated_at" type="hidden" id="updated_at" value="<?php echo ($updatequery->getColumnVal("updated_at")); ?>"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Update</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,273 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<!-- Inserire nel <head> del documento HTML -->
<!-- Bootstrap Select CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/css/bootstrap-select.min.css" rel="stylesheet">
<!-- jQuery (necessario per Bootstrap JS) -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<!-- Bootstrap Select JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/js/bootstrap-select.min.js"></script>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$idanalysis = $_POST['idanalysis'];
$idcomponent = $_POST['component'];
include('check-comp-present.php');
$idancompo = $checkcomp->getColumnVal("idanalysiscomponent");
if (empty($idancompo)) {
if ($kindofrole == '3') {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "analysis_componenttemplate";
$InsertQuery->bindColumn("idanalysis", "i", "" . ((isset($_POST["idanalysis"])) ? $_POST["idanalysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("idcomponent", "i", "" . ((isset($_POST["component"])) ? $_POST["component"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
} else {
$InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "analysis_component";
$InsertQuery->bindColumn("idanalysis", "i", "" . ((isset($_POST["idanalysis"])) ? $_POST["idanalysis"] : "") . "", "WA_DEFAULT");
$InsertQuery->bindColumn("idcomponent", "i", "" . ((isset($_POST["component"])) ? $_POST["component"] : "") . "", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
$InsertQuery->redirect($InsertGoTo);
}
?>
<div class="alert alert-success"><i class="fa fa-check"></i> <?php echo $componentaddedtitle; ?> </div>
<?php
}
if (!empty($idancompo)) {
?>
<div class="alert alert-warning"><i class="fa fa-exclamation-triangle"></i> <?php echo $componentnotaddedtitle; ?> </div>
<?php }
}
?>
<?php $idanalysis = $_GET['idanalysis']; ?><?php $tablequery = new WA_MySQLi_RS("analysis", $repnew, 0);
$tablequery->setQuery("SELECT * FROM `analysis` WHERE analysis.idanalysis='$idanalysis'");
$tablequery->execute();
?>
<?php
$componentlist = new WA_MySQLi_RS("componentlist", $repnew, 0);
$componentlist->setQuery("SELECT * FROM component WHERE component.company_id='$idcompany' ORDER BY component.name_component");
$componentlist->execute();
?>
<?php
$companalysis = new WA_MySQLi_RS("companalysis", $repnew, 0);
$companalysis->setQuery("SELECT * FROM analysis_component LEFT JOIN component ON analysis_component.idcomponent=component.idcomponent WHERE analysis_component.idanalysis=$idanalysis ORDER BY component.name_component");
$companalysis->execute();
?>
<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 $dashboard; ?></h5>
<div>
<a class="btn btn-danger" href="update-analysis.php?idanalysis=<?php echo ($tablequery->getColumnVal("idanalysis")); ?>" role="button">Edit</a> <a class="btn btn-danger" href="analysis.php" role="button"><?php echo $analysis; ?></a> <a class="btn btn-danger" href="rsl.php" role="button">RSL</a><br><br>
<h4 class="card-title">Analysis: <?php echo ($tablequery->getColumnVal("name_analysis")); ?> </h4>
<h6 class="card-subtitle"><?php echo $textaddcomplist; ?><code></code></h6>
</div><!--end table-responsive-->
<form method="post" id="addcomp">
<div class="mb-3 row">
<div class="col-sm-4">
<?php echo $yourcomponentstitle; ?>
<select name="component" class="selectpicker m-b-20 m-r-10" id="component" data-style="btn-primary" data-live-search="true">
<?php while (!$componentlist->atEnd()) { ?>
<option value="<?php echo $componentlist->getColumnVal("idcomponent"); ?>">
<?php echo $componentlist->getColumnVal("name_component"); ?>
</option>
<?php $componentlist->moveNext();
}
$componentlist->moveFirst(); ?>
</select>
<input name="idanalysis" type="hidden" id="idanalysis" value="<?php echo $idanalysis; ?>">
<input name="Add" type="submit" id="Add" class="btn btn-primary">
</div>
</div>
</form>
<a onclick="window.open('searchengine.php?idanalysis=<?php echo ($tablequery->getColumnVal("idanalysis")); ?>', '_blank', 'location=yes,height=720,width=1000,scrollbars=yes,status=yes');"><button type="button" class="btn btn-danger waves-effect waves-light"><?php echo $clickaddcomponentstitle; ?></button></a>
<br><br>
<div class="table-responsive">
<table class="table table-striped table-sm sm-0">
<thead>
<tr>
<th><?php echo $name_component_lang; ?></th>
<th><?php echo $description_component_lang; ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$wa_startindex = 0;
while (!$companalysis->atEnd()) {
$wa_startindex = $companalysis->Index;
?>
<tr>
<td><?php echo $companalysis->getColumnVal("name_component"); ?></td>
<td><?php echo $companalysis->getColumnVal("description_component"); ?></td>
<?php
?>
<td><a class="btn btn-danger" href="cancel-componentanalysis.php?idanalysiscomponent=<?php echo ($companalysis->getColumnVal("idanalysiscomponent")); ?>&idanalysis=<?php echo $idanalysis; ?>" role="button">C</a></td>
</tr>
<?php
$companalysis->moveNext();
}
$companalysis->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,252 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<?php $idcomponent = $_GET['idcomponent']; ?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`component`";
$UpdateQuery->bindColumn("name_component", "s", "" . ((isset($_POST["name_component"])) ? $_POST["name_component"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("description_component", "s", "" . ((isset($_POST["description_component"])) ? $_POST["description_component"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("cas_component", "s", "" . ((isset($_POST["cas_component"])) ? $_POST["cas_component"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("formula_component", "s", "" . ((isset($_POST["formula_component"])) ? $_POST["formula_component"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("component_family_id", "s", "" . ((isset($_POST["component_family_id"])) ? $_POST["component_family_id"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("update_at", "s", "" . ((isset($_POST["update_at"])) ? $_POST["update_at"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("idcomponent", "=", "i", "" . ($_GET['idcomponent']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "component.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
$updatequery = new WA_MySQLi_RS("updatequery", $repnew, 0);
$updatequery->setQuery("SELECT * FROM component WHERE component.idcomponent='$idcomponent'");
$updatequery->execute();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">EasySpec: Edit Material/End Use</h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text"></span></div>
<input name="name_component" type="text" class="form-control" id="name_component" value="<?php echo ($updatequery->getColumnVal("name_component")); ?>">
</div>
</div>
</div>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $description_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text"></span></div>
<input name="description_component" type="text" class="form-control" id="description_component" value="<?php echo ($updatequery->getColumnVal("description_component")); ?>">
</div>
</div>
</div>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $cas_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text"></span></div>
<input name="cas_component" type="text" class="form-control" id="cas_component" value="<?php echo ($updatequery->getColumnVal("cas_component")); ?>">
</div>
</div>
</div>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $formula_component_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text"></span></div>
<input name="formula_component" type="text" class="form-control" id="formula_component" value="<?php echo ($updatequery->getColumnVal("formula_component")); ?>">
</div>
</div>
</div>
<div class="form-group row">
<label for="component_family_id" class="col-sm-3 control-label"><?php echo $component_family_id_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text"></span></div>
<select name="component_family_id" class="form-control" id="component_family_id">
<?php
// Connessione al database e selezione dei dati
$conn = new mysqli($servername, $username, $password, $database);
// Verifica se la connessione è riuscita
if ($conn->connect_error) {
die("Connessione fallita: " . $conn->connect_error);
}
$query = "SELECT * FROM component_family ORDER BY name_componentfamily";
$result = $conn->query($query);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<option value='" . $row["idcomponentfamily"] . "'>" . $row["name_componentfamily"] . "</option>";
}
} else {
echo "<option value=''>Nessuna famiglia di componenti trovata</option>";
}
$conn->close();
?>
</select>
</div>
</div>
</div>
<td><input name="created_at" type="hidden" id="created_at" value="<?php echo ($updatequery->getColumnVal("created_at")); ?>"></td>
<td>
<input name="updated_at" type="hidden" id="updated_at" value="<?php echo date('Y-m-d H:i:s'); ?>">
</td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Update</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,184 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`material_type`";
$UpdateQuery->bindColumn("idmaterial_type", "s", "" . ((isset($_POST["idmaterial_type"])) ? $_POST["idmaterial_type"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("name_material", "s", "" . ((isset($_POST["name_material"])) ? $_POST["name_material"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("desc_material", "s", "" . ((isset($_POST["desc_material"])) ? $_POST["desc_material"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("idmaterial_type", "=", "i", "" . ($_GET['idmaterial_type']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "material.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<?php $idmaterial_type = $_GET['idmaterial_type'];
$updatequery = new WA_MySQLi_RS("updatequery", $repnew, 0);
$updatequery->setQuery("SELECT * FROM material_type WHERE material_type.idmaterial_type=$idmaterial_type");
$updatequery->execute();
?>
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">EasySpec: Edit Material/End Use</h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<td><input name="idmaterial_type" type="hidden" id="idmaterial_type" value="<?php echo ($updatequery->getColumnVal("idmaterial_type")); ?>"></td>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $name_material_lang; ?></label>
<div class="col-sm-9">
<div class="mb-3 row">
<input name="name_material" type="text" class="form-control" id="name_material" value="<?php echo ($updatequery->getColumnVal("name_material")); ?>">
</div>
</div>
</div>
<div class="form-group row">
<label for="exampleInputuname3" class="col-sm-3 control-label"><?php echo $desc_material_lang; ?></label>
<div class="col-sm-9">
<div class="mb-3 row">
<input name="desc_material" type="text" class="form-control" id="desc_material" value="<?php echo ($updatequery->getColumnVal("desc_material")); ?>">
</div>
</div>
</div>
<td><input name="company_id" type="hidden" id="company_id" value="<?php echo ($updatequery->getColumnVal("company_id")); ?>"></td>
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Update</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+129
View File
@@ -0,0 +1,129 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<a class="btn btn-danger" href="insert-rsl.php" role="button"><?php echo $insertnewrsltitle; ?></a> <a class="btn btn-danger" href="rsl-category.php" role="button">RSL Category</a> <a class="btn btn-danger" href="material.php" role="button"><?php echo $materialstitle; ?></a> <a class="btn btn-danger" href="analysis.php" role="button">Analysis</a><?php if ($infobox == "wizard") { ?> <a class="btn btn-dark" href="rslwizard1.php" role="button">Back to Wizard</a><?php } ?>
<a href="component.php"><button type="button" class="btn btn-danger w-md waves-effect waves-light">Components</button></a>
<a href="saytrl-newsletter.php"><button type="button" class="btn btn-success w-lg waves-effect waves-light">SayTRL</button></a>
<br><br>
<div class="table-responsive">
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
+390
View File
@@ -0,0 +1,390 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$UpdateQuery = new WA_MySQLi_Query($repnew);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "`rsl`";
$UpdateQuery->bindColumn("name", "s", "" . ((isset($_POST["name"])) ? $_POST["name"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("description", "s", "" . ((isset($_POST["description"])) ? $_POST["description"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("start", "s", "" . ((isset($_POST["start"])) ? $_POST["start"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("end", "s", "" . ((isset($_POST["end"])) ? $_POST["end"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("department_id", "s", "" . ((isset($_POST["department_id"])) ? $_POST["department_id"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("rsl_category_id", "s", "" . ((isset($_POST["rsl_category_id"])) ? $_POST["rsl_category_id"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("version", "s", "" . ((isset($_POST["version"])) ? $_POST["version"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("active", "s", "" . ((isset($_POST["active"])) ? $_POST["active"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("created_at", "s", "" . ((isset($_POST["created_at"])) ? $_POST["created_at"] : "") . "", "WA_DEFAULT");
$UpdateQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT");
$UpdateQuery->addFilter("id", "=", "i", "" . ($_GET['id']) . "");
$UpdateQuery->execute();
$UpdateGoTo = "rsl.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
if (isset($_GET['id'])) {
$id = $_GET['id'];
}
if (isset($_POST['id'])) {
$id = $_POST['id'];
}
?>
<?php
$updatequery = new WA_MySQLi_RS("updatequery", $repnew, 0);
$updatequery->setQuery("SELECT * FROM rsl LEFT JOIN rsl_category ON rsl.rsl_category_id=rsl_category.idrslcat WHERE rsl.id='$id'");
$updatequery->execute();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<style>
/* select2 css */
.select2-container {
width: 100% !important;
}
.select2-selection__choice,
.select2-selection__choice__remove {
background-color: blue !important;
color: white !important;
border: 1px solid blue !important;
}
/* select2 css end */
input:invalid {
border-color: #ff0000;
background-color: #fff7e6;
}
input:focus {
background: yellow;
}
input:valid {
border-color: #66ff33;
background-color: #eeffe6;
}
select:invalid {
border-color: #ff0000;
background-color: #fff7e6;
}
select:focus {
background-color: yellow;
}
select:valid {
border-color: #66ff33;
background-color: #eeffe6;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<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 $dashboard; ?></h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 col-form-label"><?php echo $name_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="name" type="text" class="form-control" id="name" value="<?php echo ($updatequery->getColumnVal("name")); ?>">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 col-form-label"><?php echo $description_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="description" type="text" class="form-control" id="description" value="<?php echo ($updatequery->getColumnVal("description")); ?>">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 col-form-label"><?php echo $start_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="start" type="date" class="form-control" id="start" value="<?php echo ($updatequery->getColumnVal("start")); ?>">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="exampleInputuname3" class="col-sm-3 col-form-label"><?php echo $end_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="end" type="date" class="form-control" id="end" value="<?php echo ($updatequery->getColumnVal("end")); ?>">
</div>
</div>
</div>
<input name="company_id" type="hidden" id="company_id" value="<?php echo ($updatequery->getColumnVal("company_id")); ?>">
<input name="department_id" type="hidden" id="department_id" value="<?php echo ($updatequery->getColumnVal("department_id")); ?>">
<?php
//rsl category
$rslcat = new WA_MySQLi_RS("rslcat", $repnew, 0);
$rslcat->setQuery("SELECT * FROM rsl_category WHERE rsl_category.company_id=$idcompany");
$rslcat->execute();
?>
<div class="mb-3 row">
<label for="rsl_category_id" class="col-sm-3 col-form-label"><?php echo $rsl_category_id_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<select class="form-select" name="rsl_category_id" id="rsl_category_id">
<option value="" <?php if (!(strcmp("", ($updatequery->getColumnVal("rsl_category_id"))))) {
echo "selected=\"selected\"";
} ?>><?php echo $selecttitle; ?></option>
<?php
while (!$rslcat->atEnd()) { //dyn select
?>
<option value="<?php echo ($rslcat->getColumnVal("idrslcat")); ?>" <?php if (!(strcmp($rslcat->getColumnVal("idrslcat"), ($updatequery->getColumnVal("rsl_category_id"))))) {
echo "selected=\"selected\"";
} ?>><?php echo ($rslcat->getColumnVal("name_rslcat")); ?></option>
<?php
$rslcat->moveNext();
} //dyn select
$rslcat->moveFirst();
?>
</select>
</div>
</div>
</div>
<input name="user_id" type="hidden" id="user_id" value="<?php echo ($updatequery->getColumnVal("user_id")); ?>">
<div class="mb-3 row">
<label for="version" class="col-sm-3 col-form-label"><?php echo $version_lang; ?></label>
<div class="col-sm-9">
<div class="input-group">
<input name="version" type="text" class="form-control" id="version" value="<?php echo ($updatequery->getColumnVal("version")); ?>">
</div>
</div>
</div>
<div class="mb-3 row">
<label for="active" class="col-sm-3 col-form-label"><?php echo $active_lang; ?></label>
<div class="col-sm-9">
<div class="form-check">
<?php $act = $updatequery->getColumnVal("active");
if ($act == "Y") { ?>
<input type="checkbox" name="active" class="form-check-input" id="active" value="Y" checked>
<?php } else { ?>
<input type="checkbox" name="active" class="form-check-input" id="active" value="Y">
<?php } ?>
<label class="form-check-label" for="active"><?php echo $active_lang; ?></label>
</div>
</div>
</div>
<input name="created_at" type="hidden" id="created_at" value="<?php echo ($updatequery->getColumnVal("created_at")); ?>">
<input name="updated_at" type="hidden" id="updated_at" value="<?php echo ($updatequery->getColumnVal("updated_at")); ?>">
<div class="form-group row m-b-0">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-success waves-effect waves-light">Update</button>
</div>
</div>
<div class="card-body collapse show">
<button type="button" onclick="goBack()" class="btn btn-dark waves-effect waves-light"><i class="fa fa-backward"></i> Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
document.addEventListener('DOMContentLoaded', function() {
let versionInput = document.getElementById('version');
let originalValue = versionInput.value; // Conserviamo il valore originale per confrontarlo in seguito
versionInput.addEventListener('change', function(e) {
if (versionInput.value !== originalValue) { // Se il valore è cambiato...
e.preventDefault(); // Preveniamo ulteriori azioni
Swal.fire({
title: 'Are you sure?',
text: "Are you sure to change the version? If you change without revision the system will not store the previous version.",
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Proceed',
cancelButtonText: 'Cancel',
}).then((result) => {
if (result.isConfirmed) {
originalValue = versionInput.value; // Aggiorniamo il valore originale se l'utente ha confermato il cambiamento
} else {
versionInput.value = originalValue; // Se l'utente annulla, ripristiniamo il valore originale
}
});
}
});
});
</script>
<script>
$(document).ready(function() {
// File upload via Ajax
$("#uploadForm").on('submit', function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
url: 'uploadlogorsl.php',
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
$('#uploadStatus').html('<img src="images/uploading.gif"/>');
},
error: function() {
$('#uploadStatus').html('<span style="color:#EA4335;">Images upload failed, please try again.<span>');
},
success: function(data) {
$('#uploadForm')[0].reset();
$('#uploadStatus').html('<span style="color:#28A74B;">Images uploaded successfully.<span>');
$('.gallery').html(data);
}
});
});
// File type validation
$("#fileInput").change(function() {
var fileLength = this.files.length;
var match = ["image/jpeg", "image/png", "image/jpg", "image/gif"];
var i;
for (i = 0; i < fileLength; i++) {
var file = this.files[i];
var imagefile = file.type;
if (!((imagefile == match[0]) || (imagefile == match[1]) || (imagefile == match[2]) || (imagefile == match[3]))) {
alert('Please select a valid image file (JPEG/JPG/PNG/GIF).');
$("#fileInput").val('');
return false;
}
}
});
});
</script>
<script>
$(document).ready(function() {
$(".upload-image").click(function() {
$(".form-horizontal").ajaxForm({
target: '.preview'
}).submit();
});
$('#form').parsley();
});
</script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</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>
@@ -0,0 +1,540 @@
<?php include('../include/headscript.php'); ?>
<?php include("../class/company.php"); ?>
<?php
$idstandards = isset($_GET['id']) ? intval($_GET['id']) : 0;
$conn = new mysqli($servername, $username, $password, $database);
if ($idstandards <= 0) {
die("ID non valido.");
}
$data = [];
if ($idstandards > 0) {
$query = $conn->prepare("SELECT * FROM `standards` WHERE idstandards = ?");
$query->bind_param("i", $idstandards);
$query->execute();
$result = $query->get_result();
if ($result->num_rows > 0) {
$data = $result->fetch_assoc();
} else {
die("Record non trovato.");
}
$query->close();
}
// Controlla se ci sono dati da mostrare nel form
$titlestandards = $data['titlestandards'] ?? '';
$numberstandards = $data['numberstandards'] ?? '';
$yearstandards = $data['yearstandards'] ?? '';
$status = $data['status'] ?? '';
$activefrom = $data['activefrom'] ?? date('Y-m-d');
$activeto = $data['activeto'] ?? '';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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'); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="../assets/images/favicon.ico">
<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>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css">
<!-- Includi il CSS di Dropzone -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.2/min/dropzone.min.css" rel="stylesheet">
<!-- Includi il JavaScript di Dropzone -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.2/min/dropzone.min.js"></script>
<style>
.updated-field {
background-color: #c9e2c9 !important;
/* Colore verde chiaro */
transition: background-color 2s ease-out;
/* Transizione lenta per una migliore visibilità */
}
.form-check-input {
position: relative;
/* Posizionamento relativo per il contenitore del checkbox */
}
.update-message {
position: absolute;
/* Posizionamento assoluto per il messaggio */
left: 100%;
/* Posiziona a destra del checkbox */
margin-left: 10px;
/* Spazio tra il checkbox e il messaggio */
color: green;
/* Colore del testo */
}
.updated-label {
background-color: #c9e2c9 !important;
/* Colore verde chiaro */
transition: background-color 2s ease-out;
/* Transizione lenta per una migliore visibilità */
}
.dropzone {
border: 2px dashed #0087F7;
/* bordo tratteggiato azzurro */
border-radius: 5px;
/* bordi arrotondati */
background: rgba(0, 135, 247, 0.1);
/* sfondo leggermente azzurrino */
min-height: 100px;
/* altezza ridotta */
display: flex;
align-items: center;
/* allinea verticalmente l'icona e il testo */
justify-content: center;
/* allinea orizzontalmente l'icona e il testo */
padding: 20px;
}
.dropzone .dz-message {
text-align: center;
margin: 0;
font-size: 16px;
color: #333;
}
.dropzone .dz-message:before {
content: '\2601';
/* Codice Unicode per l'icona della nuvola */
font-size: 48px;
color: #0087F7;
display: block;
}
</style>
</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="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<div class="btn-group float-right">
<ol class="breadcrumb hide-phone p-0 m-0">
<li class="breadcrumb-item"><a href="#">Reportify</a></li>
<li class="breadcrumb-item active">EasySpec</li>
</ol>
</div>
<h4 class="page-title">EasySpec</h4>
</div>
</div>
</div>
<!-- end page title end breadcrumb -->
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">EasySpec: Update Standard</h5>
<div>
<form method="post" class="form-horizontal p-t-20" id="updatebeach">
<div class="mb-3 row">
<label for="titlestandards" class="col-sm-3 control-label">Title Standard</label>
<div class="col-sm-9">
<input name="titlestandards" type="text" class="form-control" id="titlestandards" value="<?php echo htmlspecialchars($titlestandards ?? ''); ?>">
</div>
</div>
<div class="form-group row">
<label for="numberstandards" class="col-sm-3 control-label">Number Standard</label>
<div class="col-sm-9">
<input name="numberstandards" type="text" class="form-control" id="numberstandards" value="<?php echo htmlspecialchars($numberstandards ?? ''); ?>">
</div>
</div>
<div class="form-group row">
<label for="yearstandards" class="col-sm-3 control-label">Year Standard</label>
<div class="col-sm-9">
<select name="yearstandards" class="form-control" id="yearstandards">
<option value="">Select</option>
<?php
$currentYear = date('Y');
for ($year = $currentYear; $year >= 1900; $year--) {
echo "<option value='$year'" . (($yearstandards ?? '') == $year ? " selected" : "") . ">$year</option>";
}
?>
</select>
</div>
</div>
<div class="form-group row">
<label for="status" class="col-sm-3 control-label">Status</label>
<div class="col-sm-2">
<input type="hidden" name="status" value="I"> <!-- Campo nascosto con valore "I" -->
<input name="status" type="checkbox" class="form-check-input" id="status" value="A" style="width: 20px; height: 20px;" <?php echo (($status ?? '') == 'A' ? 'checked' : ''); ?>>
<label class="form-check-label" for="status">Active</label>
</div>
</div>
<input type="hidden" name="idstandards" value="<?php echo htmlspecialchars($idstandards ?? ''); ?>">
<div class="form-group row">
<label for="description" class="col-sm-3 control-label">Description</label>
<div class="col-sm-9">
<textarea name="description" class="form-control" id="description" rows="4"><?php echo htmlspecialchars($description ?? ''); ?></textarea>
</div>
</div>
<div class="form-group row">
<label for="activefrom" class="col-sm-3 control-label">Active From</label>
<div class="col-sm-9">
<input name="activefrom" type="date" class="form-control" id="activefrom" value="<?php echo htmlspecialchars($activefrom ?? date('Y-m-d')); ?>">
</div>
</div>
<div class="form-group row">
<label for="activeto" class="col-sm-3 control-label">Active To</label>
<div class="col-sm-9">
<input name="activeto" type="date" class="form-control" id="activeto" value="<?php echo htmlspecialchars($activeto ?? ''); ?>">
</div>
</div>
</form>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div><!-- container -->
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-body">
<h5 class="header-title pb-3 mt-0">Documenti Caricati</h5>
<table class="table">
<thead>
<tr>
<th>Filename</th>
<th>Action</th>
</tr>
</thead>
<tbody id="fileList">
<!-- I file caricati verranno aggiunti qui dinamicamente -->
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Dropzone Area -->
<div class="row">
<div class="col-sm-12">
<form action="stdupload.php" class="dropzone" id="file-upload"></form>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 text-center">
<a href="standards.php" class="btn btn-primary mt-3">
<i class="bx bx-arrow-back"></i> Back to Standards
</a>
</div>
</div><br>
<script>
Dropzone.options.fileUpload = {
url: "stdupload.php",
paramName: "file", // I file saranno disponibili in $_FILES['file']
maxFilesize: 20, // Dimensione massima del file in MB
acceptedFiles: "application/pdf",
dictDefaultMessage: "Trascina qui i file o clicca per caricare",
sending: function(file, xhr, formData) {
// Aggiungi l'idstandards come parte del formData
formData.append("idstandards", '<?php echo $idstandards; ?>');
},
init: function() {
this.on("success", function(file, responseText) {
var response = JSON.parse(responseText);
if (response.status === 'ok') {
fetchFiles();
} else {
alert(response.message);
}
});
}
};
</script>
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('../include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$('#updatebeach input[type="checkbox"]').change(function() {
// Quando lo stato del checkbox cambia
if (this.checked) {
// Se il checkbox è selezionato, imposta il valore "A"
$(this).val('A');
} else {
// Se il checkbox non è selezionato, imposta il valore del campo nascosto su "I"
$(this).prev('input[type="hidden"]').val('I');
}
});
$('#updatebeach').on('submit', function() {
// Prima del submit, verifica lo stato del checkbox e aggiorna i valori di conseguenza
var checkbox = $('#status');
if (checkbox.is(':checked')) {
checkbox.val('A');
} else {
checkbox.prev('input[type="hidden"]').val('I');
}
});
$('#updatebeach input, #updatebeach select, #updatebeach textarea').on('change blur', function() {
var field = $(this);
var formData = $(this).closest('form').serialize();
updateData(formData, field);
});
function updateData(formData, field) {
$.ajax({
type: 'POST',
url: 'updatestd.php',
data: formData,
dataType: 'json',
success: function(data) {
if (data.success) {
if (field.is(':checkbox')) {
// Applica la classe al label che segue il checkbox
var label = field.next('label');
label.addClass('updated-label');
setTimeout(function() {
label.removeClass('updated-label');
}, 2000); // Mantiene il colore verde per 2 secondi
} else {
// Applica la classe per il colore verde
field.addClass('updated-field');
setTimeout(function() {
field.removeClass('updated-field');
}, 2000);
}
} else {
alert(data.message || "Errore sconosciuto.");
}
},
error: function(xhr, status, error) {
alert('Errore di connessione al server: ' + error);
}
});
}
});
</script>
<script>
function fetchFiles() {
$.ajax({
url: 'stdlistquery.php',
type: 'GET',
data: {
idstandards: '<?php echo $idstandards; ?>'
},
dataType: 'json',
success: function(data) {
console.log(data); // Debugging: stampa i dati ricevuti
var tableRef = document.getElementById('fileList');
tableRef.innerHTML = ''; // Pulisci la tabella
data.files.forEach(function(file) {
var newRow = tableRef.insertRow();
var nameCell = newRow.insertCell(0);
var link = document.createElement('a');
link.setAttribute('href', "../pdfstandards/" + file.filename);
link.setAttribute('target', '_blank');
link.textContent = file.filename;
nameCell.appendChild(link);
var deleteCell = newRow.insertCell(1);
var deleteIcon = document.createElement('i');
deleteIcon.className = 'fa fa-trash';
deleteIcon.style.color = 'red';
deleteIcon.style.cursor = 'pointer';
deleteIcon.onclick = function() {
deleteFile(file.filename, '<?php echo $idstandards; ?>');
};
deleteCell.appendChild(deleteIcon);
});
},
error: function(xhr, status, error) {
console.error("Errore durante il recupero dei file: " + error);
}
});
}
document.addEventListener('DOMContentLoaded', function() {
fetchFiles(); // Chiamata iniziale al caricamento della pagina
// Configurazione di Dropzone
Dropzone.options.fileUpload = {
url: "stdupload.php",
init: function() {
this.on("success", function(file, responseText) {
var response = JSON.parse(responseText);
if (response.status === 'ok') {
fetchFiles(); // Aggiorna la tabella solo se il file è caricato con successo
} else {
console.error("Errore: " + response.message); // Utilizza console.error per gli errori
}
});
this.on("error", function(file, response) {
console.error("Errore durante il caricamento del file: " + response); // Mostra gli errori in console
});
}
};
});
</script>
<script>
function deleteFile(filename, idstandards) {
// Mostra un dialogo di conferma prima di procedere con la cancellazione
Swal.fire({
title: 'Do you want to cancel the file?',
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) {
// Se l'utente conferma, procedi con la cancellazione
$.ajax({
url: 'deleteFile.php',
type: 'POST',
data: {
filename: filename,
idstandards: idstandards
},
dataType: 'json',
success: function(response) {
if (response.status === 'success') {
Swal.fire(
'Deleted!',
'Your file has been deleted.',
'success'
);
fetchFiles(); // Aggiorna la lista dopo la cancellazione
} else {
Swal.fire(
'Error!',
'An error occurred while deleting the file.',
'error'
);
}
}
});
}
});
}
</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>
+90
View File
@@ -0,0 +1,90 @@
<?php
header('Content-Type: application/json'); // Assicura che la risposta sia in formato JSON
// Include il file di connessione al database e le eventuali classi necessarie
include("../include/headscript.php");
include("../class/company.php");
// Controlla se la richiesta è stata effettuata tramite metodo POST
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$conn = new mysqli($servername, $username, $password, $database);
// Verifica la connessione
if ($conn->connect_error) {
echo json_encode(["success" => false, "message" => "Connessione fallita: " . $conn->connect_error]);
exit;
}
$query = "UPDATE `standards` SET ";
$params = [];
$types = '';
$updates = [];
// Verifica se il campo è stato inviato e aggiungilo alla query
if (isset($_POST['titlestandards'])) {
$updates[] = "titlestandards=?";
$params[] = $_POST['titlestandards'];
$types .= 's';
}
if (isset($_POST['numberstandards'])) {
$updates[] = "numberstandards=?";
$params[] = $_POST['numberstandards'];
$types .= 's';
}
if (isset($_POST['yearstandards'])) {
$updates[] = "yearstandards=?";
$params[] = $_POST['yearstandards'];
$types .= 's';
}
if (isset($_POST['status'])) {
$updates[] = "status=?";
$params[] = $_POST['status'];
$types .= 's';
}
if (isset($_POST['description'])) {
$updates[] = "description=?";
$params[] = $_POST['description'];
$types .= 's';
}
if (isset($_POST['activefrom'])) {
$updates[] = "activefrom=?";
$params[] = $_POST['activefrom'];
$types .= 's';
}
if (isset($_POST['activeto'])) {
$updates[] = "activeto=?";
$params[] = $_POST['activeto'];
$types .= 's';
}
// Assicurati che ci sia almeno un campo da aggiornare
if (count($updates) > 0) {
$query .= join(', ', $updates) . " WHERE idstandards=?";
$params[] = $_POST['idstandards'];
$types .= 'i';
$stmt = $conn->prepare($query);
$stmt->bind_param($types, ...$params);
if ($stmt->execute()) {
echo json_encode(["success" => true]);
} else {
echo json_encode(["success" => false, "message" => "Errore durante l'aggiornamento: " . $stmt->error]);
}
$stmt->close();
} else {
echo json_encode(["success" => false, "message" => "Nessun dato da aggiornare."]);
}
$conn->close();
} else {
echo json_encode(["success" => false, "message" => "Metodo non consentito"]);
}