fixing bug

This commit is contained in:
Janis Steiner
2024-12-08 12:59:48 +00:00
parent 4d445228bd
commit 7295152038

View File

@@ -94,6 +94,23 @@
} }
if(isset($_GET["set_class"]) && isset($_POST["class"])){
$class_id=htmlspecialchars($_POST["class"]);
$sql="update users set class_id=$class_id where username='$username'";
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_execute($stmt);
$stmt->close();
$sql="select name from class where id=$class_id";
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_execute($stmt);
$class_name="";
mysqli_stmt_bind_result($stmt, $class_name);
$stmt->close();
$_SESSION["class"]=$class_name;
$_SESSION["class_id"]=$class_id;
}
?> ?>
<script src="/assets/js/load_page.js"></script> <script src="/assets/js/load_page.js"></script>
@@ -107,25 +124,25 @@
load_user(); load_user();
</script> </script>
<style> <style>
.description { .description {
display: none; /* Hide the description by default */ display: none; /* Hide the description by default */
position: absolute; position: absolute;
background-color: rgba(0, 0, 0, 0.7); background-color: rgba(0, 0, 0, 0.7);
color: #fff; color: #fff;
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
width: 200px; width: 200px;
z-index: 10; /* Ensure it appears above other elements */ z-index: 10; /* Ensure it appears above other elements */
} }
/* Style for the element to trigger hover */ /* Style for the element to trigger hover */
.hover-element { .hover-element {
position: relative; position: relative;
/* Add some space below the element */ /* Add some space below the element */
} }
/* Style for the element to trigger hover when hovered */ /* Style for the element to trigger hover when hovered */
.hover-element:hover .description { .hover-element:hover .description {
display: block; /* Show the description on hover */ display: block; /* Show the description on hover */
} }
</style> </style>
</head> </head>
@@ -136,7 +153,6 @@
Launch cancel modal Launch cancel modal
</button> </button>
<div id="printer-container"></div> <div id="printer-container"></div>
<!-- Modals --> <!-- Modals -->