keringportal/public/userportal/detailimportedrsl.php

283 lines
15 KiB
PHP

<?php include('include/headscript.php'); ?>
<?php
// Imposta la connessione al database
$conn = new mysqli($servername, $username, $password, $database);
// Verifica la connessione
if ($conn->connect_error) {
die("Connessione fallita: " . $conn->connect_error);
}
// Recupera il valore di `uniquecode` dal parametro GET
$uniquecode = isset($_GET['uniquecode']) ? $_GET['uniquecode'] : null;
// Verifica che il parametro GET esista
if (!$uniquecode) {
die("Uniquecode non specificato.");
}
// Query per ottenere tutti i campi, escludendo `id`, `uniquecode`, `importfilename`, e `dateimport`
$sql = "SELECT id, scope, material_category, material_subcategory, finished_product, age, parameter_family, parameter, cas, unit_of_measure, minimum_limit, test_method, country, additional_requirement_note
FROM rslxls
WHERE uniquecode = ?";
$stmt = $conn->prepare($sql);
// Verifica che la query sia stata preparata correttamente
if (!$stmt) {
die("Errore nella preparazione della query: " . $conn->error);
}
// Esegui il binding dei parametri e l'esecuzione della query
$stmt->bind_param('s', $uniquecode);
$stmt->execute();
// Recupera il risultato
$result = $stmt->get_result();
// Verifica che ci siano risultati
if ($result === false || $result->num_rows === 0) {
die("Nessun dato trovato per il codice unico fornito.");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Detail Imported RSL</title>
<!-- Bootstrap 4 CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<!-- Icons CSS -->
<link href="assets/css/icons.css" rel="stylesheet" type="text/css">
<!-- Custom CSS -->
<link href="assets/css/style.css" rel="stylesheet" type="text/css">
<!-- DataTables CSS -->
<link href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap4.min.css" rel="stylesheet" />
<!-- X-editable CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.1/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet" />
<!-- Font Awesome -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet" />
</head>
<style>
/* Visualizza il pulsante mobile anche su desktop */
.button-menu-mobile {
display: inline-block !important;
}
/* Nascondi il quadrato rosso con la X su desktop */
@media (min-width: 992px) {
.button-menu-mobile {
background-color: transparent;
border: none;
padding: 0;
width: auto;
height: auto;
}
.button-menu-mobile i.ion-close {
display: none;
}
.button-menu-mobile i.mdi-menu {
display: inline-block;
}
}
/* Stile per mobile: Mantieni il comportamento originale */
@media (max-width: 991.98px) {
.button-menu-mobile {
background-color: #ff5e5e;
border-radius: 50%;
width: 50px;
height: 50px;
}
.button-menu-mobile i.ion-close {
display: inline-block;
}
.button-menu-mobile i.mdi-menu {
display: none;
}
}
</style>
<body class="fixed-left">
<!-- 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="#">Kering Portal</a></li>
<li class="breadcrumb-item active">Detail Imported RSL</li>
</ol>
</div>
<h4 class="page-title">Editable RSL Data</h4>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="rslTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Scope</th>
<th>Material Category</th>
<th>Material Subcategory</th>
<th>Finished Product</th>
<th>Age</th>
<th>Parameter Family</th>
<th>Parameter</th>
<th>CAS</th>
<th>Unit of Measure</th>
<th>Minimum Limit</th>
<th>Test Method</th>
<th>Country</th>
<th>Additional Requirement Note</th>
</tr>
<tr>
<!-- Campi di input per i filtri -->
<th><input type="text" placeholder="Search Scope" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Material Category" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Material Subcategory" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Finished Product" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Age" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Parameter Family" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Parameter" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search CAS" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Unit of Measure" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Minimum Limit" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Test Method" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Country" class="form-control form-control-sm"></th>
<th><input type="text" placeholder="Search Note" class="form-control form-control-sm"></th>
</tr>
</thead>
<tbody>
<?php while ($row = $result->fetch_assoc()) { ?>
<tr>
<td><a href="#" class="editable" data-name="scope" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Scope"><?php echo $row['scope']; ?></a></td>
<td><a href="#" class="editable" data-name="material_category" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Material Category"><?php echo $row['material_category']; ?></a></td>
<td><a href="#" class="editable" data-name="material_subcategory" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Material Subcategory"><?php echo $row['material_subcategory']; ?></a></td>
<td><a href="#" class="editable" data-name="finished_product" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Finished Product"><?php echo $row['finished_product']; ?></a></td>
<td><a href="#" class="editable" data-name="age" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Age"><?php echo $row['age']; ?></a></td>
<td><a href="#" class="editable" data-name="parameter_family" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Parameter Family"><?php echo $row['parameter_family']; ?></a></td>
<td><a href="#" class="editable" data-name="parameter" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Parameter"><?php echo $row['parameter']; ?></a></td>
<td><a href="#" class="editable" data-name="cas" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit CAS"><?php echo $row['cas']; ?></a></td>
<td><a href="#" class="editable" data-name="unit_of_measure" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Unit of Measure"><?php echo $row['unit_of_measure']; ?></a></td>
<td><a href="#" class="editable" data-name="minimum_limit" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Minimum Limit"><?php echo $row['minimum_limit']; ?></a></td>
<td><a href="#" class="editable" data-name="test_method" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Test Method"><?php echo $row['test_method']; ?></a></td>
<td><a href="#" class="editable" data-name="country" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Country"><?php echo $row['country']; ?></a></td>
<td><a href="#" class="editable" data-name="additional_requirement_note" data-pk="<?php echo $row['id']; ?>" data-url="update_rslxls.php" data-title="Edit Additional Requirement Note"><?php echo $row['additional_requirement_note']; ?></a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div><!--end table-responsive-->
</div>
</div>
</div>
</div>
</div><!-- container -->
</div> <!-- Page content Wrapper -->
</div> <!-- content -->
<?php include('include/footer.php'); ?>
</div>
<!-- End Right content here -->
</div>
<!-- END wrapper -->
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Popper.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<!-- Bootstrap JS -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- DataTables JS -->
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.5/js/dataTables.bootstrap4.min.js"></script>
<!-- X-editable JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.1/bootstrap-editable/js/bootstrap-editable.min.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/app.js"></script>
<!-- Personalizzazione e abilitazione dell'editing inline -->
<script>
$(document).ready(function() {
// Personalizza i pulsanti di X-editable
$.fn.editableform.buttons =
'<button type="submit" class="btn btn-success btn-sm editable-submit"><i class="fas fa-check"></i></button>' +
'<button type="button" class="btn btn-danger btn-sm editable-cancel"><i class="fas fa-times"></i></button>';
// Abilita l'editing inline di X-editable
$.fn.editable.defaults = $.extend($.fn.editable.defaults, {
inputclass: 'form-control', // Ensure inputs have the correct styling
template: '<div class="editable-container editable-inline"></div>'
});
$('.editable').editable({
mode: 'inline',
url: 'update_rslxls.php',
success: function(response, newValue) {
console.log("Updated: " + newValue);
},
error: function(response, newValue) {
console.error("Error: " + response.responseText);
}
});
// Inizializza DataTables con filtri di colonna
var table = $('#rslTable').DataTable();
// Aggiungi ricerca personalizzata in ogni colonna
$('#rslTable thead tr:eq(1) th').each(function(i) {
$('input', this).on('keyup change', function() {
if (table.column(i).search() !== this.value) {
table.column(i).search(this.value).draw();
}
});
});
// Gestione dell'hamburger menu
$('.button-menu-mobile').on('click', function(e) {
e.preventDefault();
$('body').toggleClass('enlarged');
$('.left-side-menu').toggleClass('collapsed');
});
});
</script>
</body>
</html>