Abgleich mit Live-Daten

This commit is contained in:
2026-03-24 14:45:06 +01:00
parent 00077aa09a
commit 211ce11e06
116 changed files with 16602 additions and 16612 deletions
+30 -30
View File
@@ -1,30 +1,30 @@
<?php
session_start();
require_once("inc/config.inc.php");
require_once("inc/functions.inc.php");
//Überprüfe, dass der User eingeloggt ist
//Der Aufruf von check_user() muss in alle internen Seiten eingebaut sein
$user = check_admin_user();
include("templates/header.inc.php");
if(check_admin()){
echo "Admin";
}else{
echo "nicht Admin";
}
?>
<?php
include("templates/footer.inc.php")
?>
<?php
session_start();
require_once("inc/config.inc.php");
require_once("inc/functions.inc.php");
//Überprüfe, dass der User eingeloggt ist
//Der Aufruf von check_user() muss in alle internen Seiten eingebaut sein
$user = check_admin_user();
include("templates/header.inc.php");
if(check_admin()){
echo "Admin";
}else{
echo "nicht Admin";
}
?>
<?php
include("templates/footer.inc.php")
?>
+58 -58
View File
@@ -1,58 +1,58 @@
<?php
session_start();
require_once(__DIR__ . "/../inc/config.inc.php");
require_once(__DIR__ . "/../inc/functions.inc.php");
//Überprüfe, dass der User eingeloggt ist
//Der Aufruf von check_user() muss in alle internen Seiten eingebaut sein
$user = check_admin_user();
include("templates/header.inc.php");
?>
<script src="/admin/js/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
<div class="container main-container">
<?php
##test2
echo '<div style="float: right; width: 200px; ">';
echo "<form action='". $_SERVER['PHP_SELF'] . "' id='formbenutzersuche' method=POST>";
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
echo '<input type="hidden" name="userid_input" id="userid_input" />';
echo '<label>Benutzersuche Anfragen:</label>
<input type="text" id="user_input" name="skill_input" width="48"/>';
//echo '<input type="submit" class="btn btn-primary" id="submitbox" value="" />';
echo "</form>";
echo '</div>';
?>
<h2>Administration - Anrufantworter</h2>
Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
Herzlich Willkommen im internen Bereich!<br><br>
<?php
if(!check_worker()){
echo "Dieser Bereich ist nur für Bearbeiter freigeschaltet!<br><br><br>";
}else{
?>
<a href="file:///P:\Telefonanlage\telefonanlage.html" target="_blank">Übersicht der Anruf auf dem Anrufbeantworter</a>
</div>
<?php
}
include("templates/footer.inc.php")
?>
<?php
session_start();
require_once(__DIR__ . "/../inc/config.inc.php");
require_once(__DIR__ . "/../inc/functions.inc.php");
//Überprüfe, dass der User eingeloggt ist
//Der Aufruf von check_user() muss in alle internen Seiten eingebaut sein
$user = check_admin_user();
include("templates/header.inc.php");
?>
<script src="/admin/js/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
<div class="container main-container">
<?php
##test2
echo '<div style="float: right; width: 200px; ">';
echo "<form action='". $_SERVER['PHP_SELF'] . "' id='formbenutzersuche' method=POST>";
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
echo '<input type="hidden" name="userid_input" id="userid_input" />';
echo '<label>Benutzersuche Anfragen:</label>
<input type="text" id="user_input" name="skill_input" width="48"/>';
//echo '<input type="submit" class="btn btn-primary" id="submitbox" value="" />';
echo "</form>";
echo '</div>';
?>
<h2>Administration - Anrufantworter</h2>
Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
Herzlich Willkommen im internen Bereich!<br><br>
<?php
if(!check_worker()){
echo "Dieser Bereich ist nur für Bearbeiter freigeschaltet!<br><br><br>";
}else{
?>
<a href="file:///P:\Telefonanlage\telefonanlage.html" target="_blank">Übersicht der Anruf auf dem Anrufbeantworter</a>
</div>
<?php
}
include("templates/footer.inc.php")
?>
+39 -39
View File
@@ -1,40 +1,40 @@
/* Popup box BEGIN */
.infofenster {
position: absolute;
top: 100px;
right: 100px;
width: auto;
height: auto;
min-height: 100px;
min-width: 400px;
padding-left: 50px;
padding-right: 50px;
padding-top: 15px;
padding-bottom: 15px;
border-radius: 15px 15px 15px 15px;
text-align: center;
z-index: 1000;
background-color: #555;
color: #fff;
animation:signup-response 0.5s 1;
-webkit-animation:signup-response 0.5s 1;
animation-fill-mode: forwards;
animation-delay:5s;
-webkit-animation-delay:5s; /* Safari and Chrome */
-webkit-animation-fill-mode: forwards;
}
@keyframes signup-response{
from {opacity :1;}
to {opacity :0;}
}
@-webkit-keyframes signup-response{
from {opacity :1;}
to {opacity :0;}
}
/* Popup box BEGIN */
.infofenster {
position: absolute;
top: 100px;
right: 100px;
width: auto;
height: auto;
min-height: 100px;
min-width: 400px;
padding-left: 50px;
padding-right: 50px;
padding-top: 15px;
padding-bottom: 15px;
border-radius: 15px 15px 15px 15px;
text-align: center;
z-index: 1000;
background-color: #555;
color: #fff;
animation:signup-response 0.5s 1;
-webkit-animation:signup-response 0.5s 1;
animation-fill-mode: forwards;
animation-delay:5s;
-webkit-animation-delay:5s; /* Safari and Chrome */
-webkit-animation-fill-mode: forwards;
}
@keyframes signup-response{
from {opacity :1;}
to {opacity :0;}
}
@-webkit-keyframes signup-response{
from {opacity :1;}
to {opacity :0;}
}
/* Popup box BEGIN */
+3 -3
View File
@@ -1,4 +1,4 @@
<?php
require_once __DIR__ . '/impfworkflow_stammdaten.php';
<?php
require_once __DIR__ . '/impfworkflow_stammdaten.php';
+2 -2
View File
@@ -1179,5 +1179,5 @@ try {
</div>
<?php include __DIR__ . "/templates/footer.inc.php"; ?>
+1 -1
View File
@@ -1,3 +1,3 @@
<?php
$_GET['view'] = 'event-create';
require_once __DIR__ . '/impfworkflow.php';
require_once __DIR__ . '/impfworkflow.php';
+1 -1
View File
@@ -1,3 +1,3 @@
<?php
$_GET['view'] = 'event-teilnehmer';
require_once __DIR__ . '/impfworkflow.php';
require_once __DIR__ . '/impfworkflow.php';
+1 -1
View File
@@ -1,3 +1,3 @@
<?php
$_GET['view'] = 'teilnehmer';
require_once __DIR__ . '/impfworkflow.php';
require_once __DIR__ . '/impfworkflow.php';
+118 -118
View File
@@ -1,119 +1,119 @@
<?php
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
require_once(__DIR__ . "/../inc/config.inc.php");
require_once(__DIR__ . "/../inc/functions.inc.php");
$user = check_admin_user();
$internUserId = (int)$_SESSION['auth']['id'];
include("templates/header.inc.php");
if (!$user) { echo "<div class='container main-container'><h3>Erst anmelden: <a href=login.php>Login</a></h3><br>";
include("templates/footer.inc.php");
exit; }
?>
<meta http-equiv="refresh" content = "0;url=anfragen.php">
</header>
<!-- Main -->
<div class="container main-container">
<?php
/*
global $pdo;
$identifier = $_COOKIE['identifier'];
$securitytoken = $_COOKIE['securitytoken'];
$statement = $pdo->prepare("SELECT * FROM securitytokens WHERE identifier = :identifier");
$result = $statement->execute(array('identifier' => $identifier));
$securitytoken_row = $statement->fetch();
echo $securitytoken_row['securitytoken'];
echo "<br>";
echo sha1($securitytoken);
*/
?>
<h1>Administration</h1>
Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
Herzlich Willkommen im internen Bereich!<br>
<!--
<p>Hier finden Sie die weiteren Bearbeitungsschritte:<br><br></p>
<p><a class="btn btn-primary btn-lg" href="anfragen.php" role="button">Bearbeitung der Anfragen</a>&ensp;&ensp;
<a class="btn btn-primary btn-lg" role="button" href="anfragen.php">Anfragen</a></p>
<br>
<p><a class="btn btn-primary btn-lg" role="button" href="../zeiterfassung">Zeiterfassung</a></p>
<br>
<p><a class="btn btn-primary btn-lg" href="impfadmin.php" role="button">Impf-Administration</a> &ensp;&ensp;
<a class="btn btn-primary btn-lg" role="button" href="impfadmin.php">Impfung</a> &ensp;&ensp;
<a class="btn btn-primary btn-lg" role="button" href="togoadmin.php">togo-Impfung</a></p>
<br>
<p><a class="btn btn-primary btn-lg" role="button" href="webseitenadmin.php">Webseiteninhalt ändern</a></p>
<br><br><br>
<p><a class="btn btn-primary btn-lg" role="button" href="settings.php">Einstellungen</a></p>
<p><a class="btn btn-primary btn-lg" role="button" href="logout.php">Logout</a></p>
-->
<?php
echo '<h4>Welche Aktion möchtest du durchführen?</h4>
<table width=100%><tr><td width=40%>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=1>
<input type=submit class="btn btn-primary btn-lg" value="Formular-Anfragen bearbeiten">
</form>
</td></tr>
<tr><td><br><br>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=18>
<input type=submit class="btn btn-primary" value="Mailvorlagen anlegen">
</form>
</td></tr>
<tr><td><br><br>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=12>
<input type=submit class="btn btn-primary" value="Formular Auswertung">
</form>
</td></tr>
<tr><td><br><br>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=16>
<input type=submit class="btn btn-primary" value="Mailvorlagen anpassen">
</form>
</td></tr><br><br><br><br>
<tr></tr>
<tr><td><h3>Urlaub / Hinweis planen</h3></td><td></td></tr>
<tr><td>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=4>
<input type=submit class="btn btn-primary btn-lg" value="Urlaub eintragen">
</form>
</td></tr>
<tr><td><br><br>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=6>
<input type=submit class="btn btn-primary" value="Notfallsprechstunde eintragen">
</form>
</tr>
</table>
<br><br>
';
?>
</div>
<?php
include("templates/footer.inc.php")
<?php
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
require_once(__DIR__ . "/../inc/config.inc.php");
require_once(__DIR__ . "/../inc/functions.inc.php");
$user = check_admin_user();
$internUserId = (int)$_SESSION['auth']['id'];
include("templates/header.inc.php");
if (!$user) { echo "<div class='container main-container'><h3>Erst anmelden: <a href=login.php>Login</a></h3><br>";
include("templates/footer.inc.php");
exit; }
?>
<meta http-equiv="refresh" content = "0;url=anfragen.php">
</header>
<!-- Main -->
<div class="container main-container">
<?php
/*
global $pdo;
$identifier = $_COOKIE['identifier'];
$securitytoken = $_COOKIE['securitytoken'];
$statement = $pdo->prepare("SELECT * FROM securitytokens WHERE identifier = :identifier");
$result = $statement->execute(array('identifier' => $identifier));
$securitytoken_row = $statement->fetch();
echo $securitytoken_row['securitytoken'];
echo "<br>";
echo sha1($securitytoken);
*/
?>
<h1>Administration</h1>
Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
Herzlich Willkommen im internen Bereich!<br>
<!--
<p>Hier finden Sie die weiteren Bearbeitungsschritte:<br><br></p>
<p><a class="btn btn-primary btn-lg" href="anfragen.php" role="button">Bearbeitung der Anfragen</a>&ensp;&ensp;
<a class="btn btn-primary btn-lg" role="button" href="anfragen.php">Anfragen</a></p>
<br>
<p><a class="btn btn-primary btn-lg" role="button" href="../zeiterfassung">Zeiterfassung</a></p>
<br>
<p><a class="btn btn-primary btn-lg" href="impfadmin.php" role="button">Impf-Administration</a> &ensp;&ensp;
<a class="btn btn-primary btn-lg" role="button" href="impfadmin.php">Impfung</a> &ensp;&ensp;
<a class="btn btn-primary btn-lg" role="button" href="togoadmin.php">togo-Impfung</a></p>
<br>
<p><a class="btn btn-primary btn-lg" role="button" href="webseitenadmin.php">Webseiteninhalt ändern</a></p>
<br><br><br>
<p><a class="btn btn-primary btn-lg" role="button" href="settings.php">Einstellungen</a></p>
<p><a class="btn btn-primary btn-lg" role="button" href="logout.php">Logout</a></p>
-->
<?php
echo '<h4>Welche Aktion möchtest du durchführen?</h4>
<table width=100%><tr><td width=40%>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=1>
<input type=submit class="btn btn-primary btn-lg" value="Formular-Anfragen bearbeiten">
</form>
</td></tr>
<tr><td><br><br>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=18>
<input type=submit class="btn btn-primary" value="Mailvorlagen anlegen">
</form>
</td></tr>
<tr><td><br><br>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=12>
<input type=submit class="btn btn-primary" value="Formular Auswertung">
</form>
</td></tr>
<tr><td><br><br>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=16>
<input type=submit class="btn btn-primary" value="Mailvorlagen anpassen">
</form>
</td></tr><br><br><br><br>
<tr></tr>
<tr><td><h3>Urlaub / Hinweis planen</h3></td><td></td></tr>
<tr><td>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=4>
<input type=submit class="btn btn-primary btn-lg" value="Urlaub eintragen">
</form>
</td></tr>
<tr><td><br><br>
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
<input type=hidden name=aktion value=6>
<input type=submit class="btn btn-primary" value="Notfallsprechstunde eintragen">
</form>
</tr>
</table>
<br><br>
';
?>
</div>
<?php
include("templates/footer.inc.php")
?>
+46 -46
View File
@@ -1,47 +1,47 @@
var http = createRequestObject();
var objectId = '';
function createRequestObject(htmlObjectId){
var obj;
var browser = navigator.appName;
objectId = htmlObjectId;
if(browser == "Microsoft Internet Explorer"){
obj = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
obj = new XMLHttpRequest();
}
return obj;
}
function sendReq(serverFileName, variableNames, variableValues) {
var paramString = '';
variableNames = variableNames.split(',');
variableValues = variableValues.split(',');
for(i=0; i<variableNames.length; i++) {
paramString += variableNames[i]+'='+variableValues[i]+'&';
}
paramString = paramString.substring(0, (paramString.length-1));
if (paramString.length == 0) {
http.open('get', serverFileName);
}
else {
http.open('get', serverFileName+'?'+paramString);
}
http.onreadystatechange = handleResponse;
http.send(null);
}
function handleResponse() {
if(http.readyState == 4){
responseText = http.responseText;
document.getElementById(objectId).innerHTML = responseText;
}
var http = createRequestObject();
var objectId = '';
function createRequestObject(htmlObjectId){
var obj;
var browser = navigator.appName;
objectId = htmlObjectId;
if(browser == "Microsoft Internet Explorer"){
obj = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
obj = new XMLHttpRequest();
}
return obj;
}
function sendReq(serverFileName, variableNames, variableValues) {
var paramString = '';
variableNames = variableNames.split(',');
variableValues = variableValues.split(',');
for(i=0; i<variableNames.length; i++) {
paramString += variableNames[i]+'='+variableValues[i]+'&';
}
paramString = paramString.substring(0, (paramString.length-1));
if (paramString.length == 0) {
http.open('get', serverFileName);
}
else {
http.open('get', serverFileName+'?'+paramString);
}
http.onreadystatechange = handleResponse;
http.send(null);
}
function handleResponse() {
if(http.readyState == 4){
responseText = http.responseText;
document.getElementById(objectId).innerHTML = responseText;
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+45 -45
View File
@@ -1,46 +1,46 @@
$(function() {
$("#user_input").autocomplete({
source: "inc/suchepatient.php",
minLength: 3,
select: function( event, ui ) {
event.preventDefault();
$("#userid_input").val(ui.item.id);
$("#user_input").val(ui.item.value);
$("#formbenutzersuche").submit();
}
});
});
function behandelt(str) {
result = $.ajax({
type: 'POST',
async: false,
url: 'inc/behandelt.php',
data: ({
terminid: str
})
}).responseText;
document.getElementById(str).style.display = 'none';
//window.location.reload(false);
}
function submitForm(sub) {
e.preventDefault();
result = $.ajax({
type: 'POST',
async: false,
url: 'impfadmin.php',
data: ({
aktion: 4,
searchdate: sub
})
}).responseText;
//window.location.reload(false);
document.body.innerHTML = result;
$(function() {
$("#user_input").autocomplete({
source: "inc/suchepatient.php",
minLength: 3,
select: function( event, ui ) {
event.preventDefault();
$("#userid_input").val(ui.item.id);
$("#user_input").val(ui.item.value);
$("#formbenutzersuche").submit();
}
});
});
function behandelt(str) {
result = $.ajax({
type: 'POST',
async: false,
url: 'inc/behandelt.php',
data: ({
terminid: str
})
}).responseText;
document.getElementById(str).style.display = 'none';
//window.location.reload(false);
}
function submitForm(sub) {
e.preventDefault();
result = $.ajax({
type: 'POST',
async: false,
url: 'impfadmin.php',
data: ({
aktion: 4,
searchdate: sub
})
}).responseText;
//window.location.reload(false);
document.body.innerHTML = result;
}
+110 -110
View File
@@ -1,111 +1,111 @@
<?php
session_start();
require_once(__DIR__ . "/../inc/config.inc.php");
require_once(__DIR__ . "/../inc/functions.inc.php");
//Überprüfe, dass der User eingeloggt ist
//Der Aufruf von check_user() muss in alle internen Seiten eingebaut sein
$user = check_admin_user();
include("templates/header.inc.php");
echo '<div class="container main-container">';
function build_calendar($month, $year) {
$daysOfWeek = array('M','T','W','T','F','S','S');
$firstDayOfMonth = mktime(0,0,0,$month,1,$year);
$numberDays = date('t',$firstDayOfMonth);
$dateComponents = getdate($firstDayOfMonth);
$monthName = $dateComponents['month'];
$dayOfWeek = $dateComponents['wday'] -1;
$calendar = "<table class='calendar table table-condensed table-bordered' >";
$calendar .= "<caption><h3>$monthName $year</h3></caption>";
$calendar .= "<tr>";
foreach($daysOfWeek as $day) {
$calendar .= "<th class='header'>$day</th>";
}
$currentDay = 1;
$calendar .= "</tr><tr>";
if ($dayOfWeek > 0) {
$calendar .= "<td colspan='$dayOfWeek'>&nbsp;</td>";
}
$month = str_pad($month, 2, "0", STR_PAD_LEFT);
while($currentDay <= $numberDays){
if($dayOfWeek == 7){
$dayOfWeek = 0;
$calendar .= "</tr><tr>";
}
$currentDayRel = str_pad($currentDay, 2, "0", STR_PAD_LEFT);
$date = "$year-$month-$currentDayRel";
// Is this today?
if(date('Y-m-d') == $date) {
$calendar .= "<td class='day success' rel='$date' onClick='submitForm('".$date ."')'><b>$currentDay</b>";
} else {
$calendar .= "<td class='day' rel='$date' onClick='submitForm(\"".$date ."\")'>$currentDay";
}
$calendar .= "<form action='". $_SERVER['PHP_SELF'] . "' name='".$date ."' method=POST><input type=hidden name=searchdate value='". $date. "'><input type=hidden name=aktion value='4'></form>";
$calendar .= AuswertungImpfungdailycalendar($date);
$calendar .= "</td>";
$currentDay++;
$dayOfWeek++;
}
if($dayOfWeek != 7){
$remainingDays = 7 - $dayOfWeek;
$calendar .= "<td colspan='$remainingDays'>&nbsp;</td>";
}
$calendar .= "</tr>";
$calendar .= "</table>";
return $calendar;
}
$calendar = build_calendar(7, 2021);
//$calendar = '<div style="width:200px">' . $calendar . '</div>';
$calendar .= '<style type="text/css">table tbody tr td, table tbody tr th { text-align: center; }</style>';
$calendar .= '<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>';
$calendar .= "<script>function submitForm(sub) {
result = $.ajax({
type: 'POST',
async: false,
url: 'impfadmin.php',
data: ({
aktion: 4,
searchdate: sub
})
}).responseText;
//window.location.reload(false);
document.body.innerHTML = result;
}</script>";
/*
$calendar .= "<script>function submitForm(sub) {
// Form fields, see IDs above
const params = {
aktion: 4
}
const http = new XMLHttpRequest()
http.open('POST', 'impfadmin.php')
http.setRequestHeader('Content-type', 'application/json')
http.send(JSON.stringify(params)) // Make sure to stringify
http.onload = function() {
// Do whatever with response
//alert(sub)
document.body.innerHTML = http.responseText;
}
}</script>";
*/
print $calendar;
include_once('footer.php');
<?php
session_start();
require_once(__DIR__ . "/../inc/config.inc.php");
require_once(__DIR__ . "/../inc/functions.inc.php");
//Überprüfe, dass der User eingeloggt ist
//Der Aufruf von check_user() muss in alle internen Seiten eingebaut sein
$user = check_admin_user();
include("templates/header.inc.php");
echo '<div class="container main-container">';
function build_calendar($month, $year) {
$daysOfWeek = array('M','T','W','T','F','S','S');
$firstDayOfMonth = mktime(0,0,0,$month,1,$year);
$numberDays = date('t',$firstDayOfMonth);
$dateComponents = getdate($firstDayOfMonth);
$monthName = $dateComponents['month'];
$dayOfWeek = $dateComponents['wday'] -1;
$calendar = "<table class='calendar table table-condensed table-bordered' >";
$calendar .= "<caption><h3>$monthName $year</h3></caption>";
$calendar .= "<tr>";
foreach($daysOfWeek as $day) {
$calendar .= "<th class='header'>$day</th>";
}
$currentDay = 1;
$calendar .= "</tr><tr>";
if ($dayOfWeek > 0) {
$calendar .= "<td colspan='$dayOfWeek'>&nbsp;</td>";
}
$month = str_pad($month, 2, "0", STR_PAD_LEFT);
while($currentDay <= $numberDays){
if($dayOfWeek == 7){
$dayOfWeek = 0;
$calendar .= "</tr><tr>";
}
$currentDayRel = str_pad($currentDay, 2, "0", STR_PAD_LEFT);
$date = "$year-$month-$currentDayRel";
// Is this today?
if(date('Y-m-d') == $date) {
$calendar .= "<td class='day success' rel='$date' onClick='submitForm('".$date ."')'><b>$currentDay</b>";
} else {
$calendar .= "<td class='day' rel='$date' onClick='submitForm(\"".$date ."\")'>$currentDay";
}
$calendar .= "<form action='". $_SERVER['PHP_SELF'] . "' name='".$date ."' method=POST><input type=hidden name=searchdate value='". $date. "'><input type=hidden name=aktion value='4'></form>";
$calendar .= AuswertungImpfungdailycalendar($date);
$calendar .= "</td>";
$currentDay++;
$dayOfWeek++;
}
if($dayOfWeek != 7){
$remainingDays = 7 - $dayOfWeek;
$calendar .= "<td colspan='$remainingDays'>&nbsp;</td>";
}
$calendar .= "</tr>";
$calendar .= "</table>";
return $calendar;
}
$calendar = build_calendar(7, 2021);
//$calendar = '<div style="width:200px">' . $calendar . '</div>';
$calendar .= '<style type="text/css">table tbody tr td, table tbody tr th { text-align: center; }</style>';
$calendar .= '<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>';
$calendar .= "<script>function submitForm(sub) {
result = $.ajax({
type: 'POST',
async: false,
url: 'impfadmin.php',
data: ({
aktion: 4,
searchdate: sub
})
}).responseText;
//window.location.reload(false);
document.body.innerHTML = result;
}</script>";
/*
$calendar .= "<script>function submitForm(sub) {
// Form fields, see IDs above
const params = {
aktion: 4
}
const http = new XMLHttpRequest()
http.open('POST', 'impfadmin.php')
http.setRequestHeader('Content-type', 'application/json')
http.send(JSON.stringify(params)) // Make sure to stringify
http.onload = function() {
// Do whatever with response
//alert(sub)
document.body.innerHTML = http.responseText;
}
}</script>";
*/
print $calendar;
include_once('footer.php');
?>
+95 -95
View File
@@ -1,96 +1,96 @@
<!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">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="favicon.png">
<title>Sticky Footer Navbar Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="http://getbootstrap.com/examples/sticky-footer-navbar/sticky-footer-navbar.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Wrap all page content here -->
<div id="wrap">
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>PHP Calendar</h1>
</div>
<?php print $calendar; ?>
</div>
</div>
<div id="footer">
<div class="container">
<p class="text-muted">Place sticky footer content here.</p>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.0/backbone-min.js"></script>
<!--
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.syphon/0.4.1/backbone.syphon.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.modelbinder/1.0.4/Backbone.ModelBinder.min.js"></script>
-->
</body>
<!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">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="favicon.png">
<title>Sticky Footer Navbar Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="http://getbootstrap.com/examples/sticky-footer-navbar/sticky-footer-navbar.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Wrap all page content here -->
<div id="wrap">
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>PHP Calendar</h1>
</div>
<?php print $calendar; ?>
</div>
</div>
<div id="footer">
<div class="container">
<p class="text-muted">Place sticky footer content here.</p>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.0/backbone-min.js"></script>
<!--
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.syphon/0.4.1/backbone.syphon.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.modelbinder/1.0.4/Backbone.ModelBinder.min.js"></script>
-->
</body>
</html>
+44 -44
View File
@@ -1,45 +1,45 @@
<?php
require_once __DIR__ . '/../inc/config.inc.php';
require_once __DIR__ . '/../inc/functions.inc.php';
header('Content-Type: application/json');
try {
$templetid = $_POST['templetid'] ?? '';
$anfrageid = (int)($_POST['anfrageid'] ?? 0);
if ($templetid === '' || $anfrageid <= 0) {
throw new RuntimeException('Fehlende Parameter');
}
// URL aus config-Tabelle holen (sicher, unabhängig von globalen Variablen)
$stmt = $pdo->query("SELECT anfragebestaetigung FROM config LIMIT 1");
$anfragebestaetigung = (string)$stmt->fetchColumn();
if ($anfragebestaetigung === '') {
throw new RuntimeException('Config anfragebestaetigung ist leer');
}
$result = renderTemplateForAnfrage(
$pdo,
$anfrageid,
$templetid,
$anfragebestaetigung, // aus config
[
// optional:
// '%TERMINZEITVORGABE%' => $Zeitanzeige,
],
false // CP1252 nur wenn nötig
);
echo json_encode([
'betreff' => $result['betreff'],
'body' => $result['body']
]);
} catch (Throwable $e) {
http_response_code(500);
echo json_encode([
'error' => $e->getMessage()
]);
<?php
require_once __DIR__ . '/../inc/config.inc.php';
require_once __DIR__ . '/../inc/functions.inc.php';
header('Content-Type: application/json');
try {
$templetid = $_POST['templetid'] ?? '';
$anfrageid = (int)($_POST['anfrageid'] ?? 0);
if ($templetid === '' || $anfrageid <= 0) {
throw new RuntimeException('Fehlende Parameter');
}
// URL aus config-Tabelle holen (sicher, unabhängig von globalen Variablen)
$stmt = $pdo->query("SELECT anfragebestaetigung FROM config LIMIT 1");
$anfragebestaetigung = (string)$stmt->fetchColumn();
if ($anfragebestaetigung === '') {
throw new RuntimeException('Config anfragebestaetigung ist leer');
}
$result = renderTemplateForAnfrage(
$pdo,
$anfrageid,
$templetid,
$anfragebestaetigung, // aus config
[
// optional:
// '%TERMINZEITVORGABE%' => $Zeitanzeige,
],
false // CP1252 nur wenn nötig
);
echo json_encode([
'betreff' => $result['betreff'],
'body' => $result['body']
]);
} catch (Throwable $e) {
http_response_code(500);
echo json_encode([
'error' => $e->getMessage()
]);
}
+18 -18
View File
@@ -1,19 +1,19 @@
<?php
require_once("inc/config.inc.php");
// E-Mail Vorlage laden
$templetid = $_POST["templetid"];
$anfrageid = $_POST["anfrageid"];
$queryconfig = mysqli_query($con, "Select betreff,body,name FROM mailtemplates WHERE templetid='$templetid' ");
$rowconfig = mysqli_fetch_assoc($queryconfig);
$body = $rowconfig["body"];
$betreff = $rowconfig["betreff"];
$name = $rowconfig["name"];
$betreff = iconv('CP1252//IGNORE', 'UTF-8' , $betreff);
$body = iconv('CP1252//IGNORE', 'UTF-8' , $body);
echo $betreff;
<?php
require_once("inc/config.inc.php");
// E-Mail Vorlage laden
$templetid = $_POST["templetid"];
$anfrageid = $_POST["anfrageid"];
$queryconfig = mysqli_query($con, "Select betreff,body,name FROM mailtemplates WHERE templetid='$templetid' ");
$rowconfig = mysqli_fetch_assoc($queryconfig);
$body = $rowconfig["body"];
$betreff = $rowconfig["betreff"];
$name = $rowconfig["name"];
$betreff = iconv('CP1252//IGNORE', 'UTF-8' , $betreff);
$body = iconv('CP1252//IGNORE', 'UTF-8' , $body);
echo $betreff;
?>
+59 -59
View File
@@ -1,60 +1,60 @@
<?php
require_once("inc/config.inc.php");
// E-Mail Vorlage laden
$templetid = $_POST["templetid"];
$anfrageid = $_POST["anfrageid"];
$queryconfig = mysqli_query($con, "Select betreff,body,name FROM mailtemplates WHERE templetid='$templetid' ");
$rowconfig = mysqli_fetch_assoc($queryconfig);
$body = $rowconfig["body"];
$betreff = $rowconfig["betreff"];
$name = $rowconfig["name"];
$sqlstring = "SELECT * FROM anfragen INNER JOIN user ON anfragen.personid = user.userid WHERE anfrageid ='" . $anfrageid . "'";
$query = mysqli_query($con,$sqlstring);
$rowtime = mysqli_fetch_assoc($query);
$vorname = $rowtime["vorname"];
$nachname = $rowtime["nachname"];
$geburtstag = $rowtime["geburtstag"];
$tele = $rowtime["tele"];
$plz = $rowtime["plz"];
$ort = $rowtime["ort"];
$strasse = $rowtime["strasse"];
$adresse = "$ort $plz, $stasse";
$empfaenger = $rowtime["mail"];
$hash = $rowtime["hash"];
$timeid = $rowtime["timeid"];
$userausgabe = $vorname . " " . $nachname;
$anfragenlogin = $anfragebestaetigung . "?id=" . $hash ;
$nachricht = $rowtime["nachricht"];
$medikamenteins = $rowtime["medikament1"];
$medikamentzwei = $rowtime["medikament2"];
$anforderungart = $rowtime["anforderungart"];
$sqlimpfstoffstring = "SELECT artname FROM anfrageart WHERE artid ='" . $anforderungart . "'";
$queryimpfstoff = mysqli_query($con,$sqlimpfstoffstring);
$rowimpf = mysqli_fetch_assoc($queryimpfstoff);
$rezeptart = $rowimpf["artname"];
$body = str_replace("%BENUTZERVORNAME%", $vorname, $body);
$body = str_replace("%BENUTZERNACHNAME%", $nachname, $body);
$body = str_replace("%BENUTZERGEBURTSTAG%", $geburtstag, $body);
$body = str_replace("%BENUTZERADRESSE%", $adresse, $body);
$body = str_replace("%TERMINZEITVORGABE%", $Zeitanzeige, $body);
$body = str_replace("%TERMINIMPFSTOFF%", $impfstofftext, $body);
$body = str_replace("%TERMINLOGIN%", $terminlogin, $body);
$body = str_replace("%WARTELISTELOGIN%", $wartelistelogin, $body);
$body = str_replace("%WARTELISTEIMPFSTOFF%", $impfstofftextwarte, $body);
$body = str_replace("%WARTELISTEIMPFANGEBOT%", $impfangebottext, $body);
$body = str_replace("%REZEPTART%", $rezeptart, $body);
$body = str_replace("%MEDIKAMENTNUMMEREINS%", $medikamenteins, $body);
$body = str_replace("%MEDIKAMENTNUMMERZWEI%", $medikamentzwei, $body);
$body = str_replace("%ANFRAGENACHRICHT%", $nachricht, $body);
$body = str_replace("%ANFRAGENLOGIN%", $anfragenlogin, $body);
$betreff = iconv('CP1252//IGNORE', 'UTF-8' , $betreff);
$body = iconv('CP1252//IGNORE', 'UTF-8' , $body);
echo $body;
<?php
require_once("inc/config.inc.php");
// E-Mail Vorlage laden
$templetid = $_POST["templetid"];
$anfrageid = $_POST["anfrageid"];
$queryconfig = mysqli_query($con, "Select betreff,body,name FROM mailtemplates WHERE templetid='$templetid' ");
$rowconfig = mysqli_fetch_assoc($queryconfig);
$body = $rowconfig["body"];
$betreff = $rowconfig["betreff"];
$name = $rowconfig["name"];
$sqlstring = "SELECT * FROM anfragen INNER JOIN user ON anfragen.personid = user.userid WHERE anfrageid ='" . $anfrageid . "'";
$query = mysqli_query($con,$sqlstring);
$rowtime = mysqli_fetch_assoc($query);
$vorname = $rowtime["vorname"];
$nachname = $rowtime["nachname"];
$geburtstag = $rowtime["geburtstag"];
$tele = $rowtime["tele"];
$plz = $rowtime["plz"];
$ort = $rowtime["ort"];
$strasse = $rowtime["strasse"];
$adresse = "$ort $plz, $stasse";
$empfaenger = $rowtime["mail"];
$hash = $rowtime["hash"];
$timeid = $rowtime["timeid"];
$userausgabe = $vorname . " " . $nachname;
$anfragenlogin = $anfragebestaetigung . "?id=" . $hash ;
$nachricht = $rowtime["nachricht"];
$medikamenteins = $rowtime["medikament1"];
$medikamentzwei = $rowtime["medikament2"];
$anforderungart = $rowtime["anforderungart"];
$sqlimpfstoffstring = "SELECT artname FROM anfrageart WHERE artid ='" . $anforderungart . "'";
$queryimpfstoff = mysqli_query($con,$sqlimpfstoffstring);
$rowimpf = mysqli_fetch_assoc($queryimpfstoff);
$rezeptart = $rowimpf["artname"];
$body = str_replace("%BENUTZERVORNAME%", $vorname, $body);
$body = str_replace("%BENUTZERNACHNAME%", $nachname, $body);
$body = str_replace("%BENUTZERGEBURTSTAG%", $geburtstag, $body);
$body = str_replace("%BENUTZERADRESSE%", $adresse, $body);
$body = str_replace("%TERMINZEITVORGABE%", $Zeitanzeige, $body);
$body = str_replace("%TERMINIMPFSTOFF%", $impfstofftext, $body);
$body = str_replace("%TERMINLOGIN%", $terminlogin, $body);
$body = str_replace("%WARTELISTELOGIN%", $wartelistelogin, $body);
$body = str_replace("%WARTELISTEIMPFSTOFF%", $impfstofftextwarte, $body);
$body = str_replace("%WARTELISTEIMPFANGEBOT%", $impfangebottext, $body);
$body = str_replace("%REZEPTART%", $rezeptart, $body);
$body = str_replace("%MEDIKAMENTNUMMEREINS%", $medikamenteins, $body);
$body = str_replace("%MEDIKAMENTNUMMERZWEI%", $medikamentzwei, $body);
$body = str_replace("%ANFRAGENACHRICHT%", $nachricht, $body);
$body = str_replace("%ANFRAGENLOGIN%", $anfragenlogin, $body);
$betreff = iconv('CP1252//IGNORE', 'UTF-8' , $betreff);
$body = iconv('CP1252//IGNORE', 'UTF-8' , $body);
echo $body;
?>
+5 -5
View File
@@ -1,6 +1,6 @@
<?php
// Zeigt alle Informationen (Standardwert ist INFO_ALL)
phpinfo();
<?php
// Zeigt alle Informationen (Standardwert ist INFO_ALL)
phpinfo();
?>
+1 -1
View File
@@ -87,4 +87,4 @@
<?php endif; ?>
</div>
</nav>
+856 -856
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,3 +1,3 @@
<?php
require_once __DIR__ . '/impfworkflow_warteliste.php';
+169 -169
View File
@@ -1,169 +1,169 @@
<?php
session_start();
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
require_once __DIR__ . "/../inc/config.inc.php";
require_once __DIR__ . "/../inc/functions.inc.php";
// Login prüfen
$user = check_admin_user();
include __DIR__ . "/templates/header.inc.php";
$user = check_admin_user();
$internUserId = (int)$_SESSION['auth']['id'];
if (!$user) { echo "<div class='container main-container'><h3>Erst anmelden: <a href=login.php>Login</a></h3><br>";
include("templates/footer.inc.php");
exit; }
?>
<script src="js/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
<div class="container main-container">
<?php
echo '<div style="float: right; width: 200px; ">';
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' id='formbenutzersuche' method='POST'>";
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
echo '<input type="hidden" name="userid_input" id="userid_input" />';
echo '<label>Benutzersuche Impfen:</label>
<input type="text" id="user_input" name="skill_input" width="48"/>';
echo "</form>";
echo '</div>';
?>
<h2>Administration - webseiteninhalt anpassen</h2>
Hallo <?php echo htmlspecialchars($user['vorname'] ?? '', ENT_QUOTES, 'UTF-8'); ?>,<br>
Herzlich Willkommen im internen Bereich!<br><br>
<?php
$aktion = $_POST["aktion"] ?? null;
$subaktion = $_POST["subaktion"] ?? null;
if (!check_worker()) {
echo "Dieser Bereich ist nur für Bearbeiter freigeschaltet!<br><br><br>";
} else {
// =========================
// EDIT-MODUS
// =========================
if ($aktion === "edit") {
// ------- Speichern -------
if ($subaktion === "save") {
$inhaltid = (int)($_POST["inhaltid"] ?? 0);
$inhalt = $_POST["inhalt"] ?? "";
$webseitentitel = $_POST["webseitentitel"] ?? "";
try {
$stmt = $pdo->prepare("
UPDATE webseiteninhalt
SET inhalt = :inhalt,
webseitentitel = :webseitentitel
WHERE inhaltid = :inhaltid
");
$stmt->execute([
':inhalt' => $inhalt,
':webseitentitel' => $webseitentitel,
':inhaltid' => $inhaltid,
]);
echo "<div class='infofenster'><h4>Speicherung der Vorlage erfolgreich!</h4></div>";
} catch (Throwable $e) {
echo "<div class='infofenster'><h4>Fehler bei der Speicherung der Vorlage!</h4></div>";
// Optional debug:
// echo "<pre>" . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8') . "</pre>";
}
}
// ------- Vorlage laden -------
$inhaltid = (int)($_POST["inhaltid"] ?? 0);
try {
$stmt = $pdo->prepare("
SELECT webseitentitel, inhalt
FROM webseiteninhalt
WHERE inhaltid = ?
LIMIT 1
");
$stmt->execute([$inhaltid]);
$rowconfig = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$rowconfig) {
echo "<div class='infofenster'><h4>Vorlage nicht gefunden.</h4></div>";
} else {
$webseitentitel = $rowconfig["webseitentitel"] ?? "";
$inhalt = $rowconfig["inhalt"] ?? "";
echo "<h1>Webseiteninhalt bearbeiten</h1><br>";
echo "<h4>Vorlage: " . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "</h4>";
echo "<br><br>";
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
echo "<input name='webseitentitel' type='hidden' value='" . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "'>";
echo "<div id='my-editor'></div>";
// Inhalt ist HTML -> bewusst NICHT escapen, sonst zerstörst du HTML im Editor
echo "<textarea height='200' name='inhalt' id='trumbowyg-demo'>" . $inhalt . "</textarea>";
echo "<input name='aktion' type='hidden' value='edit'>";
echo "<input name='subaktion' type='hidden' value='save'>";
echo "<input name='inhaltid' type='hidden' value='" . (int)$inhaltid . "'><br><br>";
echo "<input type='submit' value='Speichern'><br>";
echo "</form>";
echo "<br><br>";
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
echo "<input type='submit' class='btn btn-primary btn-sm' value='zurück'>";
echo "</form>";
}
} catch (Throwable $e) {
echo "<div class='infofenster'><h4>Fehler beim Laden der Vorlage.</h4></div>";
// Optional debug:
// echo "<pre>" . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8') . "</pre>";
}
// =========================
// LISTE (Auswahl)
// =========================
} else {
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
echo "Wählen Sie die zu bearbeitenden Webseiteninhalt aus:<br><br>";
try {
$stmt = $pdo->prepare("
SELECT webseitentitel, inhaltid
FROM webseiteninhalt
ORDER BY webseitentitel
");
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo "<input name='aktion' type='hidden' value='edit'>";
echo "<select name='inhaltid' class='form-control'>";
foreach ($rows as $row) {
$id = (int)$row["inhaltid"];
$titel = (string)($row["webseitentitel"] ?? "");
echo "<option value='" . $id . "'>" . htmlspecialchars($titel, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . "</option>";
}
echo "</select><br><br>";
echo "<input type='submit' value='Bearbeiten' class='btn btn-primary btn'><br><br><br>";
echo "</form>";
} catch (Throwable $e) {
echo "<div class='infofenster'><h4>Fehler beim Laden der Liste.</h4></div>";
// Optional debug:
// echo "<pre>" . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8') . "</pre>";
}
}
}
include __DIR__ . "/templates/footer.inc.php";
?>
</div>
<?php
session_start();
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
require_once __DIR__ . "/../inc/config.inc.php";
require_once __DIR__ . "/../inc/functions.inc.php";
// Login prüfen
$user = check_admin_user();
include __DIR__ . "/templates/header.inc.php";
$user = check_admin_user();
$internUserId = (int)$_SESSION['auth']['id'];
if (!$user) { echo "<div class='container main-container'><h3>Erst anmelden: <a href=login.php>Login</a></h3><br>";
include("templates/footer.inc.php");
exit; }
?>
<script src="js/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
<div class="container main-container">
<?php
echo '<div style="float: right; width: 200px; ">';
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' id='formbenutzersuche' method='POST'>";
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
echo '<input type="hidden" name="userid_input" id="userid_input" />';
echo '<label>Benutzersuche Impfen:</label>
<input type="text" id="user_input" name="skill_input" width="48"/>';
echo "</form>";
echo '</div>';
?>
<h2>Administration - webseiteninhalt anpassen</h2>
Hallo <?php echo htmlspecialchars($user['vorname'] ?? '', ENT_QUOTES, 'UTF-8'); ?>,<br>
Herzlich Willkommen im internen Bereich!<br><br>
<?php
$aktion = $_POST["aktion"] ?? null;
$subaktion = $_POST["subaktion"] ?? null;
if (!check_worker()) {
echo "Dieser Bereich ist nur für Bearbeiter freigeschaltet!<br><br><br>";
} else {
// =========================
// EDIT-MODUS
// =========================
if ($aktion === "edit") {
// ------- Speichern -------
if ($subaktion === "save") {
$inhaltid = (int)($_POST["inhaltid"] ?? 0);
$inhalt = $_POST["inhalt"] ?? "";
$webseitentitel = $_POST["webseitentitel"] ?? "";
try {
$stmt = $pdo->prepare("
UPDATE webseiteninhalt
SET inhalt = :inhalt,
webseitentitel = :webseitentitel
WHERE inhaltid = :inhaltid
");
$stmt->execute([
':inhalt' => $inhalt,
':webseitentitel' => $webseitentitel,
':inhaltid' => $inhaltid,
]);
echo "<div class='infofenster'><h4>Speicherung der Vorlage erfolgreich!</h4></div>";
} catch (Throwable $e) {
echo "<div class='infofenster'><h4>Fehler bei der Speicherung der Vorlage!</h4></div>";
// Optional debug:
// echo "<pre>" . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8') . "</pre>";
}
}
// ------- Vorlage laden -------
$inhaltid = (int)($_POST["inhaltid"] ?? 0);
try {
$stmt = $pdo->prepare("
SELECT webseitentitel, inhalt
FROM webseiteninhalt
WHERE inhaltid = ?
LIMIT 1
");
$stmt->execute([$inhaltid]);
$rowconfig = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$rowconfig) {
echo "<div class='infofenster'><h4>Vorlage nicht gefunden.</h4></div>";
} else {
$webseitentitel = $rowconfig["webseitentitel"] ?? "";
$inhalt = $rowconfig["inhalt"] ?? "";
echo "<h1>Webseiteninhalt bearbeiten</h1><br>";
echo "<h4>Vorlage: " . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "</h4>";
echo "<br><br>";
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
echo "<input name='webseitentitel' type='hidden' value='" . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "'>";
echo "<div id='my-editor'></div>";
// Inhalt ist HTML -> bewusst NICHT escapen, sonst zerstörst du HTML im Editor
echo "<textarea height='200' name='inhalt' id='trumbowyg-demo'>" . $inhalt . "</textarea>";
echo "<input name='aktion' type='hidden' value='edit'>";
echo "<input name='subaktion' type='hidden' value='save'>";
echo "<input name='inhaltid' type='hidden' value='" . (int)$inhaltid . "'><br><br>";
echo "<input type='submit' value='Speichern'><br>";
echo "</form>";
echo "<br><br>";
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
echo "<input type='submit' class='btn btn-primary btn-sm' value='zurück'>";
echo "</form>";
}
} catch (Throwable $e) {
echo "<div class='infofenster'><h4>Fehler beim Laden der Vorlage.</h4></div>";
// Optional debug:
// echo "<pre>" . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8') . "</pre>";
}
// =========================
// LISTE (Auswahl)
// =========================
} else {
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
echo "Wählen Sie die zu bearbeitenden Webseiteninhalt aus:<br><br>";
try {
$stmt = $pdo->prepare("
SELECT webseitentitel, inhaltid
FROM webseiteninhalt
ORDER BY webseitentitel
");
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo "<input name='aktion' type='hidden' value='edit'>";
echo "<select name='inhaltid' class='form-control'>";
foreach ($rows as $row) {
$id = (int)$row["inhaltid"];
$titel = (string)($row["webseitentitel"] ?? "");
echo "<option value='" . $id . "'>" . htmlspecialchars($titel, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . "</option>";
}
echo "</select><br><br>";
echo "<input type='submit' value='Bearbeiten' class='btn btn-primary btn'><br><br><br>";
echo "</form>";
} catch (Throwable $e) {
echo "<div class='infofenster'><h4>Fehler beim Laden der Liste.</h4></div>";
// Optional debug:
// echo "<pre>" . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8') . "</pre>";
}
}
}
include __DIR__ . "/templates/footer.inc.php";
?>
</div>