CM89 - expired contract handling

This commit is contained in:
“VeLiTi”
2024-09-25 12:01:18 +02:00
parent ffb29b731a
commit ae821d3870
16 changed files with 923 additions and 159 deletions

79
maintenance.php Normal file
View File

@@ -0,0 +1,79 @@
<?php
defined(page_security_key) or exit;
$page = 'maintenance';
//Check if allowed
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
header('location: index.php');
exit;
}
//PAGE Security
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
$delete_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'D');
$create_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'C');
if ($update_allowed === 1){
if (isset($_POST['geoupdate'])){
//GEOLOCATION UPDATE
geolocationUpdate($_SESSION['userkey']);
}
if (isset($_POST['closeContract'])){
//GEOLOCATION UPDATE
closeContract();
}
if (isset($_POST['updatecartest'])){
//GEOLOCATION UPDATE
convertCartest();
}
}
// Handle success messages
if (isset($_GET['success_msg'])) {
if ($_GET['success_msg'] == 1) {
$success_msg = 'Settings updated successfully!';
}
}
//EMPTY VIEW
$view = '';
template_header('Maintenance', 'maintenance', 'manage');
if (isset($success_msg)){
$view .= ' <div class="msg error">
<i class="fas fa-check-circle"></i>
<p>'.$success_msg.'</p>
<i class="fas fa-times"></i>
</div>';
}
$view .='
<form action="" method="post">
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
<h2 class="responsive-width-100">Maintenance</h2>
</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$general_actions .'</a>
</div>
';
if ($update_allowed === 1){
$view .= '<div class="content-block tab-content active">
<div class="form responsive-width-100">
<label for="service">Expired contract closure</label>
<input type="submit" name="closeContract" style="width: 15%;" value="closeContract" class="btn">
<label for="service">CarTestUpdate</label>
<input type="submit" name="updatecartest" style="width: 15%;" value="CarTestUpdate" class="btn">
<label for="service">GeoUpdate</label>
<input type="submit" name="geoupdate" style="width: 15%;" value="GeoUpdate" class="btn">
</div>
</div>';
}
$view .= '</form>';
//Output
echo $view;
template_footer()
?>