Abgleich mit Live-Daten
This commit is contained in:
+30
-30
@@ -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_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_user();
|
||||
|
||||
include("templates/header.inc.php");
|
||||
|
||||
|
||||
if(check_admin()){
|
||||
echo "Admin";
|
||||
}else{
|
||||
echo "nicht Admin";
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
include("templates/footer.inc.php")
|
||||
?>
|
||||
|
||||
+118
-118
@@ -1,56 +1,56 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||
|
||||
|
||||
include("templates/header.inc.php");
|
||||
?>
|
||||
|
||||
</header>
|
||||
|
||||
<!-- Main -->
|
||||
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
<?php
|
||||
if( is_checked_in_index() ){
|
||||
$user = check_intern_user();
|
||||
?>
|
||||
<h1>Interner Bereich</h1>
|
||||
|
||||
<p>Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
|
||||
Herzlich Willkommen im internen Bereich von <?php echo $organisationsname; ?>!<br><br></p>
|
||||
|
||||
|
||||
<?php
|
||||
if(!check_mailreg()){
|
||||
|
||||
echo "<br><br>";
|
||||
echo "Es fehlt die Authentifizierung Ihres Kontos per E-Mail! Bitte authentifizieren Sie Ihre E-Mail-Adresse.<br>";
|
||||
echo "<form action='authmeldung.php' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='E-Mail Authentifizierung'><br>";
|
||||
echo '</form>';
|
||||
|
||||
|
||||
}
|
||||
if(!check_userdatenvorhanden()){
|
||||
|
||||
echo "<br><br>";
|
||||
echo "Es fehlen noch Informationen in Ihrem Stammdaten. Bitte pflegen Sie die Daten nach, damit <br>";
|
||||
echo "<form action='settings.php' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='Stammdaten pflegen'><br>";
|
||||
echo '</form>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(check_mailreg() && check_userdatenvorhanden() ){
|
||||
?>
|
||||
<?php
|
||||
session_start();
|
||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||
|
||||
|
||||
include("templates/header.inc.php");
|
||||
?>
|
||||
|
||||
</header>
|
||||
|
||||
<!-- Main -->
|
||||
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
<?php
|
||||
if( is_checked_in_index() ){
|
||||
$user = check_intern_user();
|
||||
?>
|
||||
<h1>Interner Bereich</h1>
|
||||
|
||||
<p>Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
|
||||
Herzlich Willkommen im internen Bereich von <?php echo $organisationsname; ?>!<br><br></p>
|
||||
|
||||
|
||||
<?php
|
||||
if(!check_mailreg()){
|
||||
|
||||
echo "<br><br>";
|
||||
echo "Es fehlt die Authentifizierung Ihres Kontos per E-Mail! Bitte authentifizieren Sie Ihre E-Mail-Adresse.<br>";
|
||||
echo "<form action='authmeldung.php' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='E-Mail Authentifizierung'><br>";
|
||||
echo '</form>';
|
||||
|
||||
|
||||
}
|
||||
if(!check_userdatenvorhanden()){
|
||||
|
||||
echo "<br><br>";
|
||||
echo "Es fehlen noch Informationen in Ihrem Stammdaten. Bitte pflegen Sie die Daten nach, damit <br>";
|
||||
echo "<form action='settings.php' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='Stammdaten pflegen'><br>";
|
||||
echo '</form>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(check_mailreg() && check_userdatenvorhanden() ){
|
||||
?>
|
||||
<p>Neue Anfragen können Sie über diesen Button einreichen:<br><br></p>
|
||||
<p><a class="btn btn-primary btn-lg" href="neueanfrage.php" role="button">Neue Anfragen erstellen</a></p><br><br>
|
||||
|
||||
@@ -58,69 +58,69 @@ if( is_checked_in_index() ){
|
||||
<p><a class="btn btn-primary btn-lg" href="impfwarteliste.php" role="button">Zur Impfwarteliste</a></p><br><br>
|
||||
|
||||
<p>Hier können Sie Ihre Anfragen einsehen. Die Antwort erhalten Sie per E-Mail.<br><br></p>
|
||||
<p><a class="btn btn-primary btn-lg" href="meineanfragen.php" role="button">Meine Anfragen einsehen</a></p><br><br>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
}else{
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
}else{
|
||||
|
||||
?>
|
||||
|
||||
<h1>Interner Bereich</h1>
|
||||
|
||||
<p>Nach der Anmeldung können Sie Ihre Anfragen an <?php echo $organisationsname; ?> einsehen oder neue Anfragen erstellen.<br>
|
||||
Bevor Sie sich anmelden können, müssen Sie sich registieren.<br><br></p>
|
||||
<form action="login.php" method="post">
|
||||
<h2 class="form-signin-heading">Login</h2>
|
||||
|
||||
<?php
|
||||
if(isset($error_msg) && !empty($error_msg)) {
|
||||
echo $error_msg;
|
||||
}
|
||||
?>
|
||||
<label for="inputEmail" class="sr-only">E-Mail</label>
|
||||
<input type="email" name="email" id="inputEmail" class="form-control" placeholder="E-Mail" value="<?php echo $email_value; ?>" required autofocus>
|
||||
<label for="inputPassword" class="sr-only">Passwort</label>
|
||||
<input type="password" name="passwort" id="inputPassword" class="form-control" placeholder="Passwort" required>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" value="remember-me" name="angemeldet_bleiben" value="1" checked> Angemeldet bleiben
|
||||
</label>
|
||||
</div>
|
||||
<br>
|
||||
<button class="btn btn-lg btn-primary " type="submit">Login</button>
|
||||
<br><br>
|
||||
<a href="passwortvergessen.php">Passwort vergessen</a>
|
||||
</form>
|
||||
|
||||
<br><br><br><br>
|
||||
|
||||
<p><a class="btn btn-primary " href="register.php" role="button">Jetzt registrieren</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("templates/footer.inc.php")
|
||||
<p><a class="btn btn-primary btn-lg" href="meineanfragen.php" role="button">Meine Anfragen einsehen</a></p><br><br>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
}else{
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
}else{
|
||||
|
||||
?>
|
||||
|
||||
<h1>Interner Bereich</h1>
|
||||
|
||||
<p>Nach der Anmeldung können Sie Ihre Anfragen an <?php echo $organisationsname; ?> einsehen oder neue Anfragen erstellen.<br>
|
||||
Bevor Sie sich anmelden können, müssen Sie sich registieren.<br><br></p>
|
||||
<form action="login.php" method="post">
|
||||
<h2 class="form-signin-heading">Login</h2>
|
||||
|
||||
<?php
|
||||
if(isset($error_msg) && !empty($error_msg)) {
|
||||
echo $error_msg;
|
||||
}
|
||||
?>
|
||||
<label for="inputEmail" class="sr-only">E-Mail</label>
|
||||
<input type="email" name="email" id="inputEmail" class="form-control" placeholder="E-Mail" value="<?php echo $email_value; ?>" required autofocus>
|
||||
<label for="inputPassword" class="sr-only">Passwort</label>
|
||||
<input type="password" name="passwort" id="inputPassword" class="form-control" placeholder="Passwort" required>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" value="remember-me" name="angemeldet_bleiben" value="1" checked> Angemeldet bleiben
|
||||
</label>
|
||||
</div>
|
||||
<br>
|
||||
<button class="btn btn-lg btn-primary " type="submit">Login</button>
|
||||
<br><br>
|
||||
<a href="passwortvergessen.php">Passwort vergessen</a>
|
||||
</form>
|
||||
|
||||
<br><br><br><br>
|
||||
|
||||
<p><a class="btn btn-primary " href="register.php" role="button">Jetzt registrieren</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("templates/footer.inc.php")
|
||||
?>
|
||||
|
||||
+46
-46
@@ -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;
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+45
-45
@@ -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;
|
||||
}
|
||||
+95
-95
@@ -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>
|
||||
@@ -1,19 +1,19 @@
|
||||
<?php
|
||||
|
||||
include('../impfconfig.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
|
||||
|
||||
include('../impfconfig.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
@@ -1,60 +1,60 @@
|
||||
<?php
|
||||
|
||||
include('../impfconfig.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
|
||||
|
||||
include('../impfconfig.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;
|
||||
|
||||
?>
|
||||
+264
-264
@@ -1,265 +1,265 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||
|
||||
$user = check_intern_user();
|
||||
if (!$user) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
include("templates/header.inc.php");
|
||||
|
||||
?>
|
||||
|
||||
</header>
|
||||
|
||||
<!-- Main -->
|
||||
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
|
||||
<h1>Interner Bereich</h1>
|
||||
|
||||
Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
|
||||
Herzlich Willkommen im internen Bereich von <?php echo $organisationsname; ?>!<br><br>
|
||||
|
||||
|
||||
<?php
|
||||
if(!check_mailreg()){
|
||||
|
||||
echo "<br><br>";
|
||||
echo "Es fehlt die Authentifizierung Ihres Kontos per E-Mail! Bitte authentifizieren Sie Ihre E-Mail-Adresse.<br>";
|
||||
echo "<form action='authmeldung.php' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='E-Mail Authentifizierung'><br>";
|
||||
echo '</form>';
|
||||
|
||||
|
||||
}
|
||||
if(!check_userdatenvorhanden()){
|
||||
|
||||
echo "<br><br>";
|
||||
echo "Es fehlen noch Informationen in Ihrem Stammdaten. Bitte pflegen Sie die Daten nach, damit <br>";
|
||||
echo "<form action='settings.php' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='Stammdaten pflegen'><br>";
|
||||
echo '</form>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(check_mailreg() && check_userdatenvorhanden() ){
|
||||
if($_POST["aktion"] == "11"){
|
||||
|
||||
$sqlstring = "SELECT * FROM anfragen INNER JOIN persons ON anfragen.requester_person_id = persons.person_id INNER JOIN anfrageart ON anfragen.anforderungart = anfrageart.artid WHERE anfrageid='" . $_POST["anfrageid"] . "'";
|
||||
$query = mysqli_query($con,$sqlstring);
|
||||
// Ticket und Antwort ansehen.
|
||||
while ($row = $query->fetch_assoc()) {
|
||||
|
||||
|
||||
$anfrageid = $row["anfrageid"];
|
||||
$Zeitanzeige = $datum . " " . $start . "-" . $ende ;
|
||||
$userid = $row["userid"];
|
||||
$checked = $row["checked"];
|
||||
$workerid = $row["workerid"];
|
||||
$antwortid = $row["antwortid"];
|
||||
$date_created = $row["create_time"];
|
||||
|
||||
$vorname = $row["vorname"];
|
||||
$nachname = $row["nachname"];
|
||||
$mail = $row["mail"];
|
||||
$tel = $row["tele"];
|
||||
|
||||
$geburtstag = $row["geburtstag"];
|
||||
$ausgabegeburstag = $geburtstag;
|
||||
|
||||
$ort = $row["ort"];
|
||||
$plz = $row["plz"];
|
||||
$strasse = $row["strasse"];
|
||||
$ordnungsid = $row["ordnungsid"];
|
||||
$ordnungsstring = GetOrdnungsid($ordnungsid);
|
||||
$nachricht = $row["nachricht"];
|
||||
$medikamenteins = $row["medikament1"];
|
||||
$medikamentzwei = $row["medikament2"];
|
||||
$medikamentdrei = $row["medikament3"];
|
||||
$medikamentvier = $row["medikament4"];
|
||||
$medikamentfuenf = $row["medikament5"];
|
||||
$medikamentsechs = $row["medikament6"];
|
||||
$anfrageart = $row["artname"];
|
||||
#$anfrageart = iconv('UTF-8' ,'CP1252//IGNORE', $anfrageart);
|
||||
$antworttext = $row["antworttext"];
|
||||
$WeitereInfos= "";
|
||||
if($medikamenteins){
|
||||
$WeitereInfos .= "Medikament1: $medikamenteins<br>";
|
||||
}
|
||||
if($medikamentzwei){
|
||||
$WeitereInfos .= "Medikament2: $medikamentzwei<br>";
|
||||
}
|
||||
if($medikamentdrei){
|
||||
$WeitereInfos .= "Medikament3: $medikamentdrei<br>";
|
||||
}
|
||||
if($medikamentvier){
|
||||
$WeitereInfos .= "Medikament4: $medikamentvier<br>";
|
||||
}
|
||||
if($medikamentfuenf){
|
||||
$WeitereInfos .= "Medikament5: $medikamentfuenf<br>";
|
||||
}
|
||||
if($medikamentsechs){
|
||||
$WeitereInfos .= "Medikament6: $medikamentsechs<br>";
|
||||
}
|
||||
if($nachricht){
|
||||
$WeitereInfos .= "Nachricht: $nachricht";
|
||||
}
|
||||
|
||||
$datumausgabe= date("d.m.Y H:i", strtotime($date_created ));
|
||||
|
||||
$ausgabeworker = GetWorkerName($workerid);
|
||||
$farbe = GetStatusFarbe($checked);
|
||||
$checkausgabe = GetStatus($checked);
|
||||
|
||||
$userausgabe = $vorname . " " . $nachname;
|
||||
$adresse = $plz . " " . $ort . ", " . $strasse ;
|
||||
/*
|
||||
$queryconfig = mysqli_query($con, "Select betreff,body,name FROM mailtemplates WHERE templetid='$antwortid' ");
|
||||
$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' , $antworttext);
|
||||
|
||||
|
||||
echo "<b>Person:</b><br>$userausgabe <br> $mail <br><br><b>Anfrageinformationen:</b><br>$ordnungsstring - $anfrageart <br>$WeitereInfos<br><br><b>Status der Anfrage:</b><br>$checkausgabe - $datumausgabe<br><br>";
|
||||
|
||||
echo "<b>Antwortnachricht:<b><br><br>";
|
||||
echo "$body <br>";
|
||||
|
||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='Zurück'><br>";
|
||||
echo '</form>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
?>
|
||||
<p>Hier finden Sie die letzten 100 Anfragen für die E-Mail-Adresse '<?php echo $user["email"];?>'.<br>Die Antworten können Sie auf dieser Webseite datenschutzkonform einsehen.<br><br></p>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
//global $pdo;
|
||||
$statement = $pdo->prepare("SELECT * FROM anfragen INNER JOIN persons ON anfragen.requester_person_id = persons.person_id INNER JOIN anfrageart ON anfragen.anforderungart = anfrageart.artid WHERE persons.email = :email ORDER by create_time DESC LIMIT 100 ");
|
||||
$statement->execute(array('email' => $user["email"]));
|
||||
|
||||
|
||||
echo '<table class="table display" id="table_id" > ';
|
||||
echo '<thead><tr><th >Person/Adresse</th><th >createdate</th><th >Anfragedatum</th><th >Anfrage/Status</th><th>Aktion</th></tr> </thead>';
|
||||
echo "<tbody>";
|
||||
while($row = $statement->fetch(PDO::FETCH_ASSOC)){
|
||||
#echo $row["anfrageid"];
|
||||
#echo "<br>";
|
||||
$anfrageid = $row["anfrageid"];
|
||||
$Zeitanzeige = $datum . " " . $start . "-" . $ende ;
|
||||
$userid = $row["userid"];
|
||||
$checked = $row["checked"];
|
||||
$workerid = $row["workerid"];
|
||||
$date_created = $row["create_time"];
|
||||
$mailtime = $row["update_time"];
|
||||
|
||||
$vorname = $row["vorname"];
|
||||
$nachname = $row["nachname"];
|
||||
$mail = $row["mail"];
|
||||
$tel = $row["tele"];
|
||||
|
||||
$geburtstag = $row["geburtstag"];
|
||||
$ausgabegeburstag = $geburtstag;
|
||||
|
||||
$ort = $row["ort"];
|
||||
$plz = $row["plz"];
|
||||
$strasse = $row["strasse"];
|
||||
|
||||
$nachricht = $row["nachricht"];
|
||||
$medikamenteins = $row["medikament1"];
|
||||
$medikamentzwei = $row["medikament2"];
|
||||
$medikamentdrei = $row["medikament3"];
|
||||
$medikamentvier = $row["medikament4"];
|
||||
$medikamentfuenf = $row["medikament5"];
|
||||
$medikamentsechs = $row["medikament6"];
|
||||
$anfrageart = $row["artname"];
|
||||
$ordnungsid = $row["ordnungsid"];
|
||||
$ordnungsstring = GetOrdnungsid($ordnungsid);
|
||||
$WeitereInfos= "";
|
||||
if($medikamenteins){
|
||||
$WeitereInfos .= "Medikament1: $medikamenteins<br>";
|
||||
}
|
||||
if($medikamentzwei){
|
||||
$WeitereInfos .= "Medikament2: $medikamentzwei<br>";
|
||||
}
|
||||
if($medikamentdrei){
|
||||
$WeitereInfos .= "Medikament3: $medikamentdrei<br>";
|
||||
}
|
||||
if($medikamentvier){
|
||||
$WeitereInfos .= "Medikament4: $medikamentvier<br>";
|
||||
}
|
||||
if($medikamentfuenf){
|
||||
$WeitereInfos .= "Medikament5: $medikamentfuenf<br>";
|
||||
}
|
||||
if($nachricht){
|
||||
$WeitereInfos .= "Nachricht: $nachricht";
|
||||
}
|
||||
|
||||
$datumausgabe= date("d.m.Y H:i", strtotime($date_created ));
|
||||
$antwortzeit = date("d.m.Y H:i", strtotime($mailtime ));
|
||||
|
||||
$farbe = GetStatusFarbe($checked);
|
||||
$checkausgabe = GetStatus($checked);
|
||||
|
||||
$userausgabe = $vorname . " " . $nachname . "<br>" . $ausgabegeburstag;
|
||||
$adresse = $plz . " " . $ort . "<br>" . $strasse ;
|
||||
|
||||
echo "<tr style='background-color:". $farbe. ";' ><th scope='row' >$userausgabe <br> $adresse</th><td>$date_created</td><td>$datumausgabe</td><td >$ordnungsstring - $anfrageart <br>$WeitereInfos<br><br>Status:<br>$checkausgabe<br>$antwortzeit</td>";
|
||||
echo "<td >";
|
||||
if($checked == "10"){
|
||||
echo "
|
||||
<div style='float: left;margin:15px; height: 20px;'>
|
||||
<form action='". $_SERVER["PHP_SELF"] ."' method=POST>
|
||||
<input type=hidden name=aktion value=11>
|
||||
<input type=hidden name=anfrageid value=$anfrageid>
|
||||
<input type=submit class='btn btn-primary' value='Antwort einsehen'>
|
||||
</form>
|
||||
</div>
|
||||
";
|
||||
}else{
|
||||
|
||||
echo "Keine Antwort einsehbar.";
|
||||
|
||||
}
|
||||
echo "</td ></tr>";
|
||||
}
|
||||
|
||||
echo "</tbody></table>";
|
||||
//echo "</div>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("templates/footer.inc.php")
|
||||
<?php
|
||||
session_start();
|
||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||
|
||||
$user = check_intern_user();
|
||||
if (!$user) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
include("templates/header.inc.php");
|
||||
|
||||
?>
|
||||
|
||||
</header>
|
||||
|
||||
<!-- Main -->
|
||||
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
|
||||
<h1>Interner Bereich</h1>
|
||||
|
||||
Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
|
||||
Herzlich Willkommen im internen Bereich von <?php echo $organisationsname; ?>!<br><br>
|
||||
|
||||
|
||||
<?php
|
||||
if(!check_mailreg()){
|
||||
|
||||
echo "<br><br>";
|
||||
echo "Es fehlt die Authentifizierung Ihres Kontos per E-Mail! Bitte authentifizieren Sie Ihre E-Mail-Adresse.<br>";
|
||||
echo "<form action='authmeldung.php' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='E-Mail Authentifizierung'><br>";
|
||||
echo '</form>';
|
||||
|
||||
|
||||
}
|
||||
if(!check_userdatenvorhanden()){
|
||||
|
||||
echo "<br><br>";
|
||||
echo "Es fehlen noch Informationen in Ihrem Stammdaten. Bitte pflegen Sie die Daten nach, damit <br>";
|
||||
echo "<form action='settings.php' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='Stammdaten pflegen'><br>";
|
||||
echo '</form>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(check_mailreg() && check_userdatenvorhanden() ){
|
||||
if($_POST["aktion"] == "11"){
|
||||
|
||||
$sqlstring = "SELECT * FROM anfragen INNER JOIN persons ON anfragen.requester_person_id = persons.person_id INNER JOIN anfrageart ON anfragen.anforderungart = anfrageart.artid WHERE anfrageid='" . $_POST["anfrageid"] . "'";
|
||||
$query = mysqli_query($con,$sqlstring);
|
||||
// Ticket und Antwort ansehen.
|
||||
while ($row = $query->fetch_assoc()) {
|
||||
|
||||
|
||||
$anfrageid = $row["anfrageid"];
|
||||
$Zeitanzeige = $datum . " " . $start . "-" . $ende ;
|
||||
$userid = $row["userid"];
|
||||
$checked = $row["checked"];
|
||||
$workerid = $row["workerid"];
|
||||
$antwortid = $row["antwortid"];
|
||||
$date_created = $row["create_time"];
|
||||
|
||||
$vorname = $row["vorname"];
|
||||
$nachname = $row["nachname"];
|
||||
$mail = $row["mail"];
|
||||
$tel = $row["tele"];
|
||||
|
||||
$geburtstag = $row["geburtstag"];
|
||||
$ausgabegeburstag = $geburtstag;
|
||||
|
||||
$ort = $row["ort"];
|
||||
$plz = $row["plz"];
|
||||
$strasse = $row["strasse"];
|
||||
$ordnungsid = $row["ordnungsid"];
|
||||
$ordnungsstring = GetOrdnungsid($ordnungsid);
|
||||
$nachricht = $row["nachricht"];
|
||||
$medikamenteins = $row["medikament1"];
|
||||
$medikamentzwei = $row["medikament2"];
|
||||
$medikamentdrei = $row["medikament3"];
|
||||
$medikamentvier = $row["medikament4"];
|
||||
$medikamentfuenf = $row["medikament5"];
|
||||
$medikamentsechs = $row["medikament6"];
|
||||
$anfrageart = $row["artname"];
|
||||
#$anfrageart = iconv('UTF-8' ,'CP1252//IGNORE', $anfrageart);
|
||||
$antworttext = $row["antworttext"];
|
||||
$WeitereInfos= "";
|
||||
if($medikamenteins){
|
||||
$WeitereInfos .= "Medikament1: $medikamenteins<br>";
|
||||
}
|
||||
if($medikamentzwei){
|
||||
$WeitereInfos .= "Medikament2: $medikamentzwei<br>";
|
||||
}
|
||||
if($medikamentdrei){
|
||||
$WeitereInfos .= "Medikament3: $medikamentdrei<br>";
|
||||
}
|
||||
if($medikamentvier){
|
||||
$WeitereInfos .= "Medikament4: $medikamentvier<br>";
|
||||
}
|
||||
if($medikamentfuenf){
|
||||
$WeitereInfos .= "Medikament5: $medikamentfuenf<br>";
|
||||
}
|
||||
if($medikamentsechs){
|
||||
$WeitereInfos .= "Medikament6: $medikamentsechs<br>";
|
||||
}
|
||||
if($nachricht){
|
||||
$WeitereInfos .= "Nachricht: $nachricht";
|
||||
}
|
||||
|
||||
$datumausgabe= date("d.m.Y H:i", strtotime($date_created ));
|
||||
|
||||
$ausgabeworker = GetWorkerName($workerid);
|
||||
$farbe = GetStatusFarbe($checked);
|
||||
$checkausgabe = GetStatus($checked);
|
||||
|
||||
$userausgabe = $vorname . " " . $nachname;
|
||||
$adresse = $plz . " " . $ort . ", " . $strasse ;
|
||||
/*
|
||||
$queryconfig = mysqli_query($con, "Select betreff,body,name FROM mailtemplates WHERE templetid='$antwortid' ");
|
||||
$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' , $antworttext);
|
||||
|
||||
|
||||
echo "<b>Person:</b><br>$userausgabe <br> $mail <br><br><b>Anfrageinformationen:</b><br>$ordnungsstring - $anfrageart <br>$WeitereInfos<br><br><b>Status der Anfrage:</b><br>$checkausgabe - $datumausgabe<br><br>";
|
||||
|
||||
echo "<b>Antwortnachricht:<b><br><br>";
|
||||
echo "$body <br>";
|
||||
|
||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
||||
echo "<input name=aktion type=hidden value=1>";
|
||||
echo "<input type=submit class='btn btn-primary' value='Zurück'><br>";
|
||||
echo '</form>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
?>
|
||||
<p>Hier finden Sie die letzten 100 Anfragen für die E-Mail-Adresse '<?php echo $user["email"];?>'.<br>Die Antworten können Sie auf dieser Webseite datenschutzkonform einsehen.<br><br></p>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
//global $pdo;
|
||||
$statement = $pdo->prepare("SELECT * FROM anfragen INNER JOIN persons ON anfragen.requester_person_id = persons.person_id INNER JOIN anfrageart ON anfragen.anforderungart = anfrageart.artid WHERE persons.email = :email ORDER by create_time DESC LIMIT 100 ");
|
||||
$statement->execute(array('email' => $user["email"]));
|
||||
|
||||
|
||||
echo '<table class="table display" id="table_id" > ';
|
||||
echo '<thead><tr><th >Person/Adresse</th><th >createdate</th><th >Anfragedatum</th><th >Anfrage/Status</th><th>Aktion</th></tr> </thead>';
|
||||
echo "<tbody>";
|
||||
while($row = $statement->fetch(PDO::FETCH_ASSOC)){
|
||||
#echo $row["anfrageid"];
|
||||
#echo "<br>";
|
||||
$anfrageid = $row["anfrageid"];
|
||||
$Zeitanzeige = $datum . " " . $start . "-" . $ende ;
|
||||
$userid = $row["userid"];
|
||||
$checked = $row["checked"];
|
||||
$workerid = $row["workerid"];
|
||||
$date_created = $row["create_time"];
|
||||
$mailtime = $row["update_time"];
|
||||
|
||||
$vorname = $row["vorname"];
|
||||
$nachname = $row["nachname"];
|
||||
$mail = $row["mail"];
|
||||
$tel = $row["tele"];
|
||||
|
||||
$geburtstag = $row["geburtstag"];
|
||||
$ausgabegeburstag = $geburtstag;
|
||||
|
||||
$ort = $row["ort"];
|
||||
$plz = $row["plz"];
|
||||
$strasse = $row["strasse"];
|
||||
|
||||
$nachricht = $row["nachricht"];
|
||||
$medikamenteins = $row["medikament1"];
|
||||
$medikamentzwei = $row["medikament2"];
|
||||
$medikamentdrei = $row["medikament3"];
|
||||
$medikamentvier = $row["medikament4"];
|
||||
$medikamentfuenf = $row["medikament5"];
|
||||
$medikamentsechs = $row["medikament6"];
|
||||
$anfrageart = $row["artname"];
|
||||
$ordnungsid = $row["ordnungsid"];
|
||||
$ordnungsstring = GetOrdnungsid($ordnungsid);
|
||||
$WeitereInfos= "";
|
||||
if($medikamenteins){
|
||||
$WeitereInfos .= "Medikament1: $medikamenteins<br>";
|
||||
}
|
||||
if($medikamentzwei){
|
||||
$WeitereInfos .= "Medikament2: $medikamentzwei<br>";
|
||||
}
|
||||
if($medikamentdrei){
|
||||
$WeitereInfos .= "Medikament3: $medikamentdrei<br>";
|
||||
}
|
||||
if($medikamentvier){
|
||||
$WeitereInfos .= "Medikament4: $medikamentvier<br>";
|
||||
}
|
||||
if($medikamentfuenf){
|
||||
$WeitereInfos .= "Medikament5: $medikamentfuenf<br>";
|
||||
}
|
||||
if($nachricht){
|
||||
$WeitereInfos .= "Nachricht: $nachricht";
|
||||
}
|
||||
|
||||
$datumausgabe= date("d.m.Y H:i", strtotime($date_created ));
|
||||
$antwortzeit = date("d.m.Y H:i", strtotime($mailtime ));
|
||||
|
||||
$farbe = GetStatusFarbe($checked);
|
||||
$checkausgabe = GetStatus($checked);
|
||||
|
||||
$userausgabe = $vorname . " " . $nachname . "<br>" . $ausgabegeburstag;
|
||||
$adresse = $plz . " " . $ort . "<br>" . $strasse ;
|
||||
|
||||
echo "<tr style='background-color:". $farbe. ";' ><th scope='row' >$userausgabe <br> $adresse</th><td>$date_created</td><td>$datumausgabe</td><td >$ordnungsstring - $anfrageart <br>$WeitereInfos<br><br>Status:<br>$checkausgabe<br>$antwortzeit</td>";
|
||||
echo "<td >";
|
||||
if($checked == "10"){
|
||||
echo "
|
||||
<div style='float: left;margin:15px; height: 20px;'>
|
||||
<form action='". $_SERVER["PHP_SELF"] ."' method=POST>
|
||||
<input type=hidden name=aktion value=11>
|
||||
<input type=hidden name=anfrageid value=$anfrageid>
|
||||
<input type=submit class='btn btn-primary' value='Antwort einsehen'>
|
||||
</form>
|
||||
</div>
|
||||
";
|
||||
}else{
|
||||
|
||||
echo "Keine Antwort einsehbar.";
|
||||
|
||||
}
|
||||
echo "</td ></tr>";
|
||||
}
|
||||
|
||||
echo "</tbody></table>";
|
||||
//echo "</div>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("templates/footer.inc.php")
|
||||
?>
|
||||
+810
-810
File diff suppressed because it is too large
Load Diff
+810
-810
File diff suppressed because it is too large
Load Diff
+443
-443
@@ -1,443 +1,443 @@
|
||||
<?php
|
||||
|
||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||
|
||||
ini_set('display_errors', '1');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
|
||||
/* ---------------------------
|
||||
Page start
|
||||
----------------------------*/
|
||||
|
||||
include(__DIR__ . "/templates/header.inc.php");
|
||||
|
||||
echo "</header>";
|
||||
echo "<div class='jumbotron'><div class='container'>";
|
||||
|
||||
$user = check_intern_user(); // intern session user
|
||||
|
||||
if (!$user) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "<h1>Neue Anfrage</h1>";
|
||||
echo "<p>Hallo " . e((string)($user['vorname'] ?? '')) . ",<br></p>";
|
||||
|
||||
// Preconditions
|
||||
if (!check_mailreg()) {
|
||||
echo "<br><br>";
|
||||
echo "Es fehlt die Authentifizierung Ihres Kontos per E-Mail! Bitte authentifizieren Sie Ihre E-Mail-Adresse.<br>";
|
||||
echo "<form action='authmeldung.php' method='POST'>";
|
||||
echo "<input name='aktion' type='hidden' value='1'>";
|
||||
echo "<input type='submit' class='btn btn-primary' value='E-Mail Authentifizierung'><br>";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
if (!check_userdatenvorhanden()) {
|
||||
echo "<br><br>";
|
||||
echo "Es fehlen noch Informationen in Ihren Stammdaten. Bitte pflegen Sie die Daten nach.<br>";
|
||||
echo "<form action='settings.php' method='POST'>";
|
||||
echo "<input name='aktion' type='hidden' value='1'>";
|
||||
echo "<input type='submit' class='btn btn-primary' value='Stammdaten pflegen'><br>";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
if (!(check_mailreg() && check_userdatenvorhanden())) {
|
||||
echo "<br><br><br><form action='index.php' method='POST'>
|
||||
<input type='submit' class='btn btn-primary' value='Zum Hauptmenü'>
|
||||
</form>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// action routing
|
||||
$aktion = $_POST['aktion'] ?? ''; // '', choose, confirm, submit
|
||||
|
||||
// Ensure persons id early
|
||||
try {
|
||||
$internUserId = isset($_SESSION['userid']) ? (int)$_SESSION['userid'] : null;
|
||||
$personId = ensurePersonFromInternUsersByEmail($pdo, (string)($user['email'] ?? ''), $internUserId);
|
||||
} catch (Throwable $t) {
|
||||
echo "<div class='alert alert-danger'>Fehler: " . e($t->getMessage()) . "</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Vacation check
|
||||
if ($aktion === 'choose' || $aktion === 'confirm' || $aktion === 'submit' || $aktion === '') {
|
||||
if (isPraxisImUrlaub($pdo)) {
|
||||
$info = loadAktuelleUrlaubsInfo($pdo);
|
||||
echo "<h2>Praxis im Urlaub</h2>";
|
||||
echo "Wir befinden uns aktuell im Urlaub.<br>Wenden Sie sich an unsere Vertretung oder warten Sie bis nach unserem Urlaub mit Ihrer Anfrage.<br><br>";
|
||||
|
||||
if ($info) {
|
||||
$ende = (string)$info['ende'];
|
||||
$endeausgabe = date("d.m.Y", strtotime("+1 day", strtotime($ende)));
|
||||
|
||||
if (!empty($info['vertretung'])) echo "Unsere Vertretung: " . e($info['vertretung']) . "<br>";
|
||||
if (!empty($info['vertreterurl'])) echo "Webseite Vertretung: " . e($info['vertreterurl']) . "<br>";
|
||||
if (!empty($info['vertretertelefon'])) echo "Telefonischer Kontakt Vertretung: " . e($info['vertretertelefon']) . "<br>";
|
||||
if (!empty($info['vertreteradresse'])) echo "Adresse Vertretung: " . e($info['vertreteradresse']) . "<br>";
|
||||
|
||||
echo "<br>Wir stehen Ihnen ab dem " . e($endeausgabe) . " wieder zur Verfügung.<br><br><br>";
|
||||
}
|
||||
|
||||
echo "<form action='index.php' method='POST'><input type='submit' class='btn btn-primary' value='Zurück'></form>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// default: show selection
|
||||
if ($aktion === '') {
|
||||
echo "<p>Wählen Sie die Anfragenart aus:<br><br></p>";
|
||||
echo "<form action='" . e($_SERVER['PHP_SELF']) . "' method='POST'>";
|
||||
echo "<input type='hidden' name='aktion' value='choose'>";
|
||||
|
||||
echo "<h4>Benutzer</h4>";
|
||||
echo "Name: " . e((string)$user["vorname"]) . " " . e((string)$user["nachname"]) . "<br>";
|
||||
echo "Geburtstag: " . e((string)$user["geburtstag"]) . "<br>";
|
||||
echo "Adresse: " . e((string)$user["strasse"]) . ", " . e((string)$user["plz"]) . ", " . e((string)$user["ort"]) . "<br>";
|
||||
|
||||
echo "<input type='hidden' name='requester_person_id' value='" . (int)$personId . "'>";
|
||||
|
||||
echo "<br><br>";
|
||||
echo "<label for='anfrageart'>Art der Anfrage:</label>";
|
||||
echo "<select class='form-control' name='anfrageart' id='anfrageart' required>
|
||||
<option value='1'>Rezeptanfrage</option>
|
||||
<option value='2'>Allgemeine Anfrage</option>
|
||||
<option value='3'>Terminabsage</option>
|
||||
</select>";
|
||||
echo "<br><br>";
|
||||
echo "<input type='submit' class='btn btn-primary' value='Anfrage stellen'><br>";
|
||||
echo "</form>";
|
||||
|
||||
echo "<br><br><br><form action='index.php' method='POST'>
|
||||
<input type='submit' class='btn btn-primary' value='Zum Hauptmenü'>
|
||||
</form>";
|
||||
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// choose -> show form
|
||||
if ($aktion === 'choose') {
|
||||
$anfrageart = (int)($_POST['anfrageart'] ?? 0);
|
||||
$requester_person_id = (int)($_POST['requester_person_id'] ?? $personId);
|
||||
|
||||
$mode = match ($anfrageart) {
|
||||
1 => 'rezept',
|
||||
2 => 'allgemein',
|
||||
3 => 'terminabsage',
|
||||
default => ''
|
||||
};
|
||||
if ($mode === '') {
|
||||
echo "<div class='alert alert-danger'>Unbekannte Anfrageart.</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$arten = loadAnfragearten($pdo, $mode);
|
||||
|
||||
echo "<p>Füllen Sie das Formular aus.</p>";
|
||||
echo "<form action='" . e($_SERVER['PHP_SELF']) . "' method='POST'>";
|
||||
echo "<input type='hidden' name='aktion' value='confirm'>";
|
||||
echo "<input type='hidden' name='mode' value='" . e($mode) . "'>";
|
||||
echo "<input type='hidden' name='requester_person_id' value='" . (int)$requester_person_id . "'>";
|
||||
|
||||
// User block
|
||||
echo "<h4>Benutzer</h4>";
|
||||
echo "Name: " . e((string)$user["vorname"]) . " " . e((string)$user["nachname"]) . "<br>";
|
||||
echo "Geburtstag: " . e((string)$user["geburtstag"]) . "<br>";
|
||||
echo "Adresse: " . e((string)$user["strasse"]) . ", " . e((string)$user["plz"]) . ", " . e((string)$user["ort"]) . "<br>";
|
||||
|
||||
echo "<br><br><div class='col-sm-10'>";
|
||||
echo "<label for='category'>Thema:</label>";
|
||||
echo "<select class='form-control' name='category' id='category' required>";
|
||||
echo "<option value=''>Bitte wählen Sie aus</option>";
|
||||
foreach ($arten as $a) {
|
||||
$artid = (int)$a['artid'];
|
||||
$artname = (string)$a['artname'];
|
||||
echo "<option value='{$artid}'>" . e($artname) . "</option>";
|
||||
}
|
||||
echo "</select></div>";
|
||||
|
||||
// Special fields for rezept
|
||||
if ($mode === 'rezept') {
|
||||
$curdate = date('d.m.Y');
|
||||
$curyear = date('Y');
|
||||
$curMonth = (int)date('m');
|
||||
$curQuarter = (int)ceil($curMonth / 3);
|
||||
$current_quarter = (int)ceil(date('n') / 3);
|
||||
$first_date = date('d.m.Y', strtotime(date('Y') . '-' . (($current_quarter * 3) - 2) . '-1'));
|
||||
$last_date = date('t.m.Y', strtotime(date('Y') . '-' . (($current_quarter * 3)) . '-1'));
|
||||
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "<label for='karte'>Ich habe dieses Quartal schon meine Gesundheitskarte in der Praxis einlesen lassen:</label><br>";
|
||||
echo "Aktuell befinden wir uns im {$curQuarter}. Quartal von {$curyear}.<br>";
|
||||
echo "Dieses geht vom <b>{$first_date} bis {$last_date}</b><br>";
|
||||
echo "Heute ist der {$curdate}.<br>";
|
||||
echo "War die Chipkarte dieses Quartal noch nicht eingelesen, ist die Abholung nur in der Praxis möglich.<br><br>";
|
||||
echo "<select class='form-control' name='karte' id='karte' required onchange='checkkarte()'>
|
||||
<option value=''>Bitte wählen Sie aus</option>
|
||||
<option value='Ja'>Ja</option>
|
||||
<option value='Nein'>Nein</option>
|
||||
<option value='Privat'>Privatrezept (Selbstzahler)</option>
|
||||
</select>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "<label for='abholung'>Ich möchte das Rezept hier abholen:</label>";
|
||||
echo "<select class='form-control' name='abholung' id='abholung' required onchange='checkkarte()'>
|
||||
<option value=''>Bitte wählen Sie aus</option>
|
||||
<option value='Praxis'>Praxis Creutzburg</option>
|
||||
<option value='Apotheke'>Apotheke</option>
|
||||
</select>";
|
||||
echo "</div>";
|
||||
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "<input class='form-control' type='text' name='Medikament{$i}' placeholder='Medikament, Wirkstoff, Packungsgröße' maxlength='150'>";
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "<textarea class='form-control' name='message' id='message' placeholder='Ihre Nachricht/Bemerkung' rows='6' maxlength='500'></textarea>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "Bedenken Sie bitte, dass wir einmal im Quartal Ihre Chipkarte benötigen. Ohne Chipkarte sind seit 1.1.2016 keine Kassendienstleistungen mehr möglich.<br>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='col-sm-10'><br><br>";
|
||||
echo "<input class='form-control' type='submit' value='Weiter'>";
|
||||
echo "<br><br><br></div>";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
echo "<script>
|
||||
function checkkarte(){
|
||||
var karte = document.getElementById('karte');
|
||||
var abholung = document.getElementById('abholung');
|
||||
if (!karte || !abholung) return;
|
||||
if (karte.value === 'Nein') {
|
||||
abholung.value = 'Praxis';
|
||||
}
|
||||
}
|
||||
</script>";
|
||||
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// confirm -> summary
|
||||
if ($aktion === 'confirm') {
|
||||
$mode = (string)($_POST['mode'] ?? '');
|
||||
$requester_person_id = (int)($_POST['requester_person_id'] ?? 0);
|
||||
$category = (int)($_POST['category'] ?? 0);
|
||||
|
||||
if ($requester_person_id <= 0 || $category <= 0 || $mode === '') {
|
||||
echo "<div class='alert alert-danger'>Ungültige Eingaben.</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$anfrageartText = loadAnfrageartName($pdo, $category);
|
||||
|
||||
echo "<h4>Kontrollieren Sie Ihre Angaben!</h4><br>";
|
||||
echo "<form action='" . e($_SERVER['PHP_SELF']) . "' method='POST'>";
|
||||
echo "<input type='hidden' name='aktion' value='submit'>";
|
||||
echo "<input type='hidden' name='mode' value='" . e($mode) . "'>";
|
||||
echo "<input type='hidden' name='requester_person_id' value='" . (int)$requester_person_id . "'>";
|
||||
echo "<input type='hidden' name='category' value='" . (int)$category . "'>";
|
||||
|
||||
echo "<table border='0' class='table'>";
|
||||
echo "<tr><td class='fett' style='width:160px;'>Thema</td><td>" . e($anfrageartText) . "</td></tr>";
|
||||
|
||||
if ($mode === 'rezept') {
|
||||
$karte = (string)($_POST['karte'] ?? '');
|
||||
$abholung = (string)($_POST['abholung'] ?? '');
|
||||
echo "<input type='hidden' name='karte' value='" . e($karte) . "'>";
|
||||
echo "<input type='hidden' name='abholung' value='" . e($abholung) . "'>";
|
||||
echo "<tr><td class='fett'>Karte</td><td>" . e($karte) . "</td></tr>";
|
||||
echo "<tr><td class='fett'>Abholung</td><td>" . e($abholung) . "</td></tr>";
|
||||
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
$med = (string)($_POST["Medikament{$i}"] ?? '');
|
||||
echo "<input type='hidden' name='Medikament{$i}' value='" . e($med) . "'>";
|
||||
if ($med !== '') {
|
||||
echo "<tr><td class='fett'>Medikament{$i}</td><td>" . e($med) . "</td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$message = (string)($_POST['message'] ?? '');
|
||||
echo "<input type='hidden' name='message' value='" . e($message) . "'>";
|
||||
echo "<tr><td class='fett'>Nachricht</td><td>" . nl2br(e($message)) . "</td></tr>";
|
||||
echo "</table>";
|
||||
|
||||
echo "<input type='submit' class='form-control' value='Anfrage abschicken'>";
|
||||
echo "</form>";
|
||||
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// submit -> insert + mail
|
||||
if ($aktion === 'submit') {
|
||||
$mode = (string)($_POST['mode'] ?? '');
|
||||
$requester_person_id = (int)($_POST['requester_person_id'] ?? 0);
|
||||
$anforderungart = (int)($_POST['category'] ?? 0);
|
||||
$message = (string)($_POST['message'] ?? '');
|
||||
|
||||
if ($requester_person_id <= 0 || $anforderungart <= 0) {
|
||||
echo "<div class='alert alert-danger'>Ungültige Eingaben.</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$nachricht = $message;
|
||||
|
||||
$abholungnr = 0;
|
||||
if ($mode === 'rezept') {
|
||||
$karte = (string)($_POST['karte'] ?? '');
|
||||
$abholung = (string)($_POST['abholung'] ?? '');
|
||||
|
||||
$abholungnr = ($abholung === 'Praxis') ? 1 : (($abholung === 'Apotheke') ? 2 : 0);
|
||||
if ($karte === 'Privat') {
|
||||
$karte = 'Privatrezept (Selbstzahler)';
|
||||
}
|
||||
$nachricht = "Karte eingelesen: {$karte}<br>Abholungsort: {$abholung}<br>" . $nachricht;
|
||||
}
|
||||
|
||||
$med = [];
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
$med[$i] = trim((string)($_POST["Medikament{$i}"] ?? ''));
|
||||
}
|
||||
|
||||
// duplicate check (best effort)
|
||||
$exists = false;
|
||||
try {
|
||||
$stmtDup = $pdo->prepare("
|
||||
SELECT *
|
||||
FROM anfragen
|
||||
WHERE requester_person_id = :pid
|
||||
AND anforderungart = :art
|
||||
AND nachricht = :nachricht
|
||||
AND create_time >= DATE_SUB(NOW(), INTERVAL 7 DAY)
|
||||
");
|
||||
$stmtDup->execute([
|
||||
':pid' => $requester_person_id,
|
||||
':art' => $anforderungart,
|
||||
':nachricht' => $nachricht,
|
||||
]);
|
||||
$rows = $stmtDup->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$medFieldAliases = [
|
||||
1 => ['med1', 'medikament1', 'med_1'],
|
||||
2 => ['med2', 'medikament2', 'med_2'],
|
||||
3 => ['med3', 'medikament3', 'med_3'],
|
||||
4 => ['med4', 'medikament4', 'med_4'],
|
||||
5 => ['med5', 'medikament5', 'med_5'],
|
||||
6 => ['med6', 'medikament6', 'med_6'],
|
||||
];
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$allMedsEqual = true;
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
$dbValue = '';
|
||||
foreach ($medFieldAliases[$i] as $fieldName) {
|
||||
if (array_key_exists($fieldName, $row)) {
|
||||
$dbValue = trim((string)($row[$fieldName] ?? ''));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($dbValue !== $med[$i]) {
|
||||
$allMedsEqual = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($allMedsEqual) {
|
||||
$exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Throwable $t) {
|
||||
error_log('Duplicate check failed: ' . $t->getMessage());
|
||||
$exists = false;
|
||||
}
|
||||
|
||||
if ($exists) {
|
||||
echo "<h3>Doppelte Anfrage</h3><br>Ihre Anfrage wurde schon in unserem System gespeichert.<br>
|
||||
Sie haben die identische Anfrage schon in den letzten sieben Tagen eingereicht.<br>
|
||||
Bitte warten Sie auf die Verarbeitung Ihrer Anfrage.<br><br>";
|
||||
echo "<form action='index.php' method='POST'>
|
||||
<input type='submit' class='btn btn-primary' value='Zum Hauptmenü'>
|
||||
</form>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$hash = bin2hex(random_bytes(16));
|
||||
$ordnungsid = ($mode === 'rezept') ? 1 : 2;
|
||||
|
||||
try {
|
||||
$anfrageid = insertAnfrage($pdo, [
|
||||
'person_id' => $requester_person_id,
|
||||
'anforderungart' => $anforderungart,
|
||||
'med1' => $med[1],
|
||||
'med2' => $med[2],
|
||||
'med3' => $med[3],
|
||||
'med4' => $med[4],
|
||||
'med5' => $med[5],
|
||||
'med6' => $med[6],
|
||||
'nachricht' => $nachricht,
|
||||
'hash' => $hash,
|
||||
'ordnungsid' => $ordnungsid,
|
||||
'abholort' => $abholungnr,
|
||||
'sicherenachricht' => 1,
|
||||
'checked' => 1,
|
||||
]);
|
||||
|
||||
$templateId = ($mode === 'rezept') ? 26 : 19;
|
||||
|
||||
// IMPORTANT: Your SendMailMessageVorlage() must accept PDO after your migration.
|
||||
SendMailMessageVorlage($pdo, "3", $anfrageid, (string)$templateId);
|
||||
|
||||
echo "<h3>Nachricht abgeschickt!</h3><br>Sie bekommen eine Bestätigung per E-Mail!<br>
|
||||
Überprüfen Sie auch Ihren Spam-Filter!<br><br>";
|
||||
|
||||
} catch (Throwable $t) {
|
||||
echo "<h3>Speicherung nicht erfolgreich</h3><br>Ihre Anfrage konnte nicht gespeichert werden.<br>";
|
||||
echo "<div class='alert alert-danger'>Fehler: " . e($t->getMessage()) . "</div>";
|
||||
}
|
||||
|
||||
echo "<br><br><br><form action='index.php' method='POST'>
|
||||
<input type='submit' class='btn btn-primary' value='Zum Hauptmenü'>
|
||||
</form>";
|
||||
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// fallback
|
||||
echo "<div class='alert alert-warning'>Unbekannte Aktion.</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
<?php
|
||||
|
||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||
|
||||
ini_set('display_errors', '1');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
|
||||
/* ---------------------------
|
||||
Page start
|
||||
----------------------------*/
|
||||
|
||||
include(__DIR__ . "/templates/header.inc.php");
|
||||
|
||||
echo "</header>";
|
||||
echo "<div class='jumbotron'><div class='container'>";
|
||||
|
||||
$user = check_intern_user(); // intern session user
|
||||
|
||||
if (!$user) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "<h1>Neue Anfrage</h1>";
|
||||
echo "<p>Hallo " . e((string)($user['vorname'] ?? '')) . ",<br></p>";
|
||||
|
||||
// Preconditions
|
||||
if (!check_mailreg()) {
|
||||
echo "<br><br>";
|
||||
echo "Es fehlt die Authentifizierung Ihres Kontos per E-Mail! Bitte authentifizieren Sie Ihre E-Mail-Adresse.<br>";
|
||||
echo "<form action='authmeldung.php' method='POST'>";
|
||||
echo "<input name='aktion' type='hidden' value='1'>";
|
||||
echo "<input type='submit' class='btn btn-primary' value='E-Mail Authentifizierung'><br>";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
if (!check_userdatenvorhanden()) {
|
||||
echo "<br><br>";
|
||||
echo "Es fehlen noch Informationen in Ihren Stammdaten. Bitte pflegen Sie die Daten nach.<br>";
|
||||
echo "<form action='settings.php' method='POST'>";
|
||||
echo "<input name='aktion' type='hidden' value='1'>";
|
||||
echo "<input type='submit' class='btn btn-primary' value='Stammdaten pflegen'><br>";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
if (!(check_mailreg() && check_userdatenvorhanden())) {
|
||||
echo "<br><br><br><form action='index.php' method='POST'>
|
||||
<input type='submit' class='btn btn-primary' value='Zum Hauptmenü'>
|
||||
</form>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// action routing
|
||||
$aktion = $_POST['aktion'] ?? ''; // '', choose, confirm, submit
|
||||
|
||||
// Ensure persons id early
|
||||
try {
|
||||
$internUserId = isset($_SESSION['userid']) ? (int)$_SESSION['userid'] : null;
|
||||
$personId = ensurePersonFromInternUsersByEmail($pdo, (string)($user['email'] ?? ''), $internUserId);
|
||||
} catch (Throwable $t) {
|
||||
echo "<div class='alert alert-danger'>Fehler: " . e($t->getMessage()) . "</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Vacation check
|
||||
if ($aktion === 'choose' || $aktion === 'confirm' || $aktion === 'submit' || $aktion === '') {
|
||||
if (isPraxisImUrlaub($pdo)) {
|
||||
$info = loadAktuelleUrlaubsInfo($pdo);
|
||||
echo "<h2>Praxis im Urlaub</h2>";
|
||||
echo "Wir befinden uns aktuell im Urlaub.<br>Wenden Sie sich an unsere Vertretung oder warten Sie bis nach unserem Urlaub mit Ihrer Anfrage.<br><br>";
|
||||
|
||||
if ($info) {
|
||||
$ende = (string)$info['ende'];
|
||||
$endeausgabe = date("d.m.Y", strtotime("+1 day", strtotime($ende)));
|
||||
|
||||
if (!empty($info['vertretung'])) echo "Unsere Vertretung: " . e($info['vertretung']) . "<br>";
|
||||
if (!empty($info['vertreterurl'])) echo "Webseite Vertretung: " . e($info['vertreterurl']) . "<br>";
|
||||
if (!empty($info['vertretertelefon'])) echo "Telefonischer Kontakt Vertretung: " . e($info['vertretertelefon']) . "<br>";
|
||||
if (!empty($info['vertreteradresse'])) echo "Adresse Vertretung: " . e($info['vertreteradresse']) . "<br>";
|
||||
|
||||
echo "<br>Wir stehen Ihnen ab dem " . e($endeausgabe) . " wieder zur Verfügung.<br><br><br>";
|
||||
}
|
||||
|
||||
echo "<form action='index.php' method='POST'><input type='submit' class='btn btn-primary' value='Zurück'></form>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// default: show selection
|
||||
if ($aktion === '') {
|
||||
echo "<p>Wählen Sie die Anfragenart aus:<br><br></p>";
|
||||
echo "<form action='" . e($_SERVER['PHP_SELF']) . "' method='POST'>";
|
||||
echo "<input type='hidden' name='aktion' value='choose'>";
|
||||
|
||||
echo "<h4>Benutzer</h4>";
|
||||
echo "Name: " . e((string)$user["vorname"]) . " " . e((string)$user["nachname"]) . "<br>";
|
||||
echo "Geburtstag: " . e((string)$user["geburtstag"]) . "<br>";
|
||||
echo "Adresse: " . e((string)$user["strasse"]) . ", " . e((string)$user["plz"]) . ", " . e((string)$user["ort"]) . "<br>";
|
||||
|
||||
echo "<input type='hidden' name='requester_person_id' value='" . (int)$personId . "'>";
|
||||
|
||||
echo "<br><br>";
|
||||
echo "<label for='anfrageart'>Art der Anfrage:</label>";
|
||||
echo "<select class='form-control' name='anfrageart' id='anfrageart' required>
|
||||
<option value='1'>Rezeptanfrage</option>
|
||||
<option value='2'>Allgemeine Anfrage</option>
|
||||
<option value='3'>Terminabsage</option>
|
||||
</select>";
|
||||
echo "<br><br>";
|
||||
echo "<input type='submit' class='btn btn-primary' value='Anfrage stellen'><br>";
|
||||
echo "</form>";
|
||||
|
||||
echo "<br><br><br><form action='index.php' method='POST'>
|
||||
<input type='submit' class='btn btn-primary' value='Zum Hauptmenü'>
|
||||
</form>";
|
||||
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// choose -> show form
|
||||
if ($aktion === 'choose') {
|
||||
$anfrageart = (int)($_POST['anfrageart'] ?? 0);
|
||||
$requester_person_id = (int)($_POST['requester_person_id'] ?? $personId);
|
||||
|
||||
$mode = match ($anfrageart) {
|
||||
1 => 'rezept',
|
||||
2 => 'allgemein',
|
||||
3 => 'terminabsage',
|
||||
default => ''
|
||||
};
|
||||
if ($mode === '') {
|
||||
echo "<div class='alert alert-danger'>Unbekannte Anfrageart.</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$arten = loadAnfragearten($pdo, $mode);
|
||||
|
||||
echo "<p>Füllen Sie das Formular aus.</p>";
|
||||
echo "<form action='" . e($_SERVER['PHP_SELF']) . "' method='POST'>";
|
||||
echo "<input type='hidden' name='aktion' value='confirm'>";
|
||||
echo "<input type='hidden' name='mode' value='" . e($mode) . "'>";
|
||||
echo "<input type='hidden' name='requester_person_id' value='" . (int)$requester_person_id . "'>";
|
||||
|
||||
// User block
|
||||
echo "<h4>Benutzer</h4>";
|
||||
echo "Name: " . e((string)$user["vorname"]) . " " . e((string)$user["nachname"]) . "<br>";
|
||||
echo "Geburtstag: " . e((string)$user["geburtstag"]) . "<br>";
|
||||
echo "Adresse: " . e((string)$user["strasse"]) . ", " . e((string)$user["plz"]) . ", " . e((string)$user["ort"]) . "<br>";
|
||||
|
||||
echo "<br><br><div class='col-sm-10'>";
|
||||
echo "<label for='category'>Thema:</label>";
|
||||
echo "<select class='form-control' name='category' id='category' required>";
|
||||
echo "<option value=''>Bitte wählen Sie aus</option>";
|
||||
foreach ($arten as $a) {
|
||||
$artid = (int)$a['artid'];
|
||||
$artname = (string)$a['artname'];
|
||||
echo "<option value='{$artid}'>" . e($artname) . "</option>";
|
||||
}
|
||||
echo "</select></div>";
|
||||
|
||||
// Special fields for rezept
|
||||
if ($mode === 'rezept') {
|
||||
$curdate = date('d.m.Y');
|
||||
$curyear = date('Y');
|
||||
$curMonth = (int)date('m');
|
||||
$curQuarter = (int)ceil($curMonth / 3);
|
||||
$current_quarter = (int)ceil(date('n') / 3);
|
||||
$first_date = date('d.m.Y', strtotime(date('Y') . '-' . (($current_quarter * 3) - 2) . '-1'));
|
||||
$last_date = date('t.m.Y', strtotime(date('Y') . '-' . (($current_quarter * 3)) . '-1'));
|
||||
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "<label for='karte'>Ich habe dieses Quartal schon meine Gesundheitskarte in der Praxis einlesen lassen:</label><br>";
|
||||
echo "Aktuell befinden wir uns im {$curQuarter}. Quartal von {$curyear}.<br>";
|
||||
echo "Dieses geht vom <b>{$first_date} bis {$last_date}</b><br>";
|
||||
echo "Heute ist der {$curdate}.<br>";
|
||||
echo "War die Chipkarte dieses Quartal noch nicht eingelesen, ist die Abholung nur in der Praxis möglich.<br><br>";
|
||||
echo "<select class='form-control' name='karte' id='karte' required onchange='checkkarte()'>
|
||||
<option value=''>Bitte wählen Sie aus</option>
|
||||
<option value='Ja'>Ja</option>
|
||||
<option value='Nein'>Nein</option>
|
||||
<option value='Privat'>Privatrezept (Selbstzahler)</option>
|
||||
</select>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "<label for='abholung'>Ich möchte das Rezept hier abholen:</label>";
|
||||
echo "<select class='form-control' name='abholung' id='abholung' required onchange='checkkarte()'>
|
||||
<option value=''>Bitte wählen Sie aus</option>
|
||||
<option value='Praxis'>Praxis Creutzburg</option>
|
||||
<option value='Apotheke'>Apotheke</option>
|
||||
</select>";
|
||||
echo "</div>";
|
||||
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "<input class='form-control' type='text' name='Medikament{$i}' placeholder='Medikament, Wirkstoff, Packungsgröße' maxlength='150'>";
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "<textarea class='form-control' name='message' id='message' placeholder='Ihre Nachricht/Bemerkung' rows='6' maxlength='500'></textarea>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='col-sm-10'><br>";
|
||||
echo "Bedenken Sie bitte, dass wir einmal im Quartal Ihre Chipkarte benötigen. Ohne Chipkarte sind seit 1.1.2016 keine Kassendienstleistungen mehr möglich.<br>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='col-sm-10'><br><br>";
|
||||
echo "<input class='form-control' type='submit' value='Weiter'>";
|
||||
echo "<br><br><br></div>";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
echo "<script>
|
||||
function checkkarte(){
|
||||
var karte = document.getElementById('karte');
|
||||
var abholung = document.getElementById('abholung');
|
||||
if (!karte || !abholung) return;
|
||||
if (karte.value === 'Nein') {
|
||||
abholung.value = 'Praxis';
|
||||
}
|
||||
}
|
||||
</script>";
|
||||
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// confirm -> summary
|
||||
if ($aktion === 'confirm') {
|
||||
$mode = (string)($_POST['mode'] ?? '');
|
||||
$requester_person_id = (int)($_POST['requester_person_id'] ?? 0);
|
||||
$category = (int)($_POST['category'] ?? 0);
|
||||
|
||||
if ($requester_person_id <= 0 || $category <= 0 || $mode === '') {
|
||||
echo "<div class='alert alert-danger'>Ungültige Eingaben.</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$anfrageartText = loadAnfrageartName($pdo, $category);
|
||||
|
||||
echo "<h4>Kontrollieren Sie Ihre Angaben!</h4><br>";
|
||||
echo "<form action='" . e($_SERVER['PHP_SELF']) . "' method='POST'>";
|
||||
echo "<input type='hidden' name='aktion' value='submit'>";
|
||||
echo "<input type='hidden' name='mode' value='" . e($mode) . "'>";
|
||||
echo "<input type='hidden' name='requester_person_id' value='" . (int)$requester_person_id . "'>";
|
||||
echo "<input type='hidden' name='category' value='" . (int)$category . "'>";
|
||||
|
||||
echo "<table border='0' class='table'>";
|
||||
echo "<tr><td class='fett' style='width:160px;'>Thema</td><td>" . e($anfrageartText) . "</td></tr>";
|
||||
|
||||
if ($mode === 'rezept') {
|
||||
$karte = (string)($_POST['karte'] ?? '');
|
||||
$abholung = (string)($_POST['abholung'] ?? '');
|
||||
echo "<input type='hidden' name='karte' value='" . e($karte) . "'>";
|
||||
echo "<input type='hidden' name='abholung' value='" . e($abholung) . "'>";
|
||||
echo "<tr><td class='fett'>Karte</td><td>" . e($karte) . "</td></tr>";
|
||||
echo "<tr><td class='fett'>Abholung</td><td>" . e($abholung) . "</td></tr>";
|
||||
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
$med = (string)($_POST["Medikament{$i}"] ?? '');
|
||||
echo "<input type='hidden' name='Medikament{$i}' value='" . e($med) . "'>";
|
||||
if ($med !== '') {
|
||||
echo "<tr><td class='fett'>Medikament{$i}</td><td>" . e($med) . "</td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$message = (string)($_POST['message'] ?? '');
|
||||
echo "<input type='hidden' name='message' value='" . e($message) . "'>";
|
||||
echo "<tr><td class='fett'>Nachricht</td><td>" . nl2br(e($message)) . "</td></tr>";
|
||||
echo "</table>";
|
||||
|
||||
echo "<input type='submit' class='form-control' value='Anfrage abschicken'>";
|
||||
echo "</form>";
|
||||
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// submit -> insert + mail
|
||||
if ($aktion === 'submit') {
|
||||
$mode = (string)($_POST['mode'] ?? '');
|
||||
$requester_person_id = (int)($_POST['requester_person_id'] ?? 0);
|
||||
$anforderungart = (int)($_POST['category'] ?? 0);
|
||||
$message = (string)($_POST['message'] ?? '');
|
||||
|
||||
if ($requester_person_id <= 0 || $anforderungart <= 0) {
|
||||
echo "<div class='alert alert-danger'>Ungültige Eingaben.</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$nachricht = $message;
|
||||
|
||||
$abholungnr = 0;
|
||||
if ($mode === 'rezept') {
|
||||
$karte = (string)($_POST['karte'] ?? '');
|
||||
$abholung = (string)($_POST['abholung'] ?? '');
|
||||
|
||||
$abholungnr = ($abholung === 'Praxis') ? 1 : (($abholung === 'Apotheke') ? 2 : 0);
|
||||
if ($karte === 'Privat') {
|
||||
$karte = 'Privatrezept (Selbstzahler)';
|
||||
}
|
||||
$nachricht = "Karte eingelesen: {$karte}<br>Abholungsort: {$abholung}<br>" . $nachricht;
|
||||
}
|
||||
|
||||
$med = [];
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
$med[$i] = trim((string)($_POST["Medikament{$i}"] ?? ''));
|
||||
}
|
||||
|
||||
// duplicate check (best effort)
|
||||
$exists = false;
|
||||
try {
|
||||
$stmtDup = $pdo->prepare("
|
||||
SELECT *
|
||||
FROM anfragen
|
||||
WHERE requester_person_id = :pid
|
||||
AND anforderungart = :art
|
||||
AND nachricht = :nachricht
|
||||
AND create_time >= DATE_SUB(NOW(), INTERVAL 7 DAY)
|
||||
");
|
||||
$stmtDup->execute([
|
||||
':pid' => $requester_person_id,
|
||||
':art' => $anforderungart,
|
||||
':nachricht' => $nachricht,
|
||||
]);
|
||||
$rows = $stmtDup->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$medFieldAliases = [
|
||||
1 => ['med1', 'medikament1', 'med_1'],
|
||||
2 => ['med2', 'medikament2', 'med_2'],
|
||||
3 => ['med3', 'medikament3', 'med_3'],
|
||||
4 => ['med4', 'medikament4', 'med_4'],
|
||||
5 => ['med5', 'medikament5', 'med_5'],
|
||||
6 => ['med6', 'medikament6', 'med_6'],
|
||||
];
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$allMedsEqual = true;
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
$dbValue = '';
|
||||
foreach ($medFieldAliases[$i] as $fieldName) {
|
||||
if (array_key_exists($fieldName, $row)) {
|
||||
$dbValue = trim((string)($row[$fieldName] ?? ''));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($dbValue !== $med[$i]) {
|
||||
$allMedsEqual = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($allMedsEqual) {
|
||||
$exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Throwable $t) {
|
||||
error_log('Duplicate check failed: ' . $t->getMessage());
|
||||
$exists = false;
|
||||
}
|
||||
|
||||
if ($exists) {
|
||||
echo "<h3>Doppelte Anfrage</h3><br>Ihre Anfrage wurde schon in unserem System gespeichert.<br>
|
||||
Sie haben die identische Anfrage schon in den letzten sieben Tagen eingereicht.<br>
|
||||
Bitte warten Sie auf die Verarbeitung Ihrer Anfrage.<br><br>";
|
||||
echo "<form action='index.php' method='POST'>
|
||||
<input type='submit' class='btn btn-primary' value='Zum Hauptmenü'>
|
||||
</form>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$hash = bin2hex(random_bytes(16));
|
||||
$ordnungsid = ($mode === 'rezept') ? 1 : 2;
|
||||
|
||||
try {
|
||||
$anfrageid = insertAnfrage($pdo, [
|
||||
'person_id' => $requester_person_id,
|
||||
'anforderungart' => $anforderungart,
|
||||
'med1' => $med[1],
|
||||
'med2' => $med[2],
|
||||
'med3' => $med[3],
|
||||
'med4' => $med[4],
|
||||
'med5' => $med[5],
|
||||
'med6' => $med[6],
|
||||
'nachricht' => $nachricht,
|
||||
'hash' => $hash,
|
||||
'ordnungsid' => $ordnungsid,
|
||||
'abholort' => $abholungnr,
|
||||
'sicherenachricht' => 1,
|
||||
'checked' => 1,
|
||||
]);
|
||||
|
||||
$templateId = ($mode === 'rezept') ? 26 : 19;
|
||||
|
||||
// IMPORTANT: Your SendMailMessageVorlage() must accept PDO after your migration.
|
||||
SendMailMessageVorlage($pdo, "3", $anfrageid, (string)$templateId);
|
||||
|
||||
echo "<h3>Nachricht abgeschickt!</h3><br>Sie bekommen eine Bestätigung per E-Mail!<br>
|
||||
Überprüfen Sie auch Ihren Spam-Filter!<br><br>";
|
||||
|
||||
} catch (Throwable $t) {
|
||||
echo "<h3>Speicherung nicht erfolgreich</h3><br>Ihre Anfrage konnte nicht gespeichert werden.<br>";
|
||||
echo "<div class='alert alert-danger'>Fehler: " . e($t->getMessage()) . "</div>";
|
||||
}
|
||||
|
||||
echo "<br><br><br><form action='index.php' method='POST'>
|
||||
<input type='submit' class='btn btn-primary' value='Zum Hauptmenü'>
|
||||
</form>";
|
||||
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// fallback
|
||||
echo "<div class='alert alert-warning'>Unbekannte Aktion.</div>";
|
||||
echo "</div></div>";
|
||||
include(__DIR__ . "/templates/footer.inc.php");
|
||||
|
||||
+111
-111
@@ -1,111 +1,111 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||
|
||||
|
||||
/* ---------- Kein direkter Zugriff ---------- */
|
||||
if (empty($_SESSION['2fa_userid'])) {
|
||||
header('Location: login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$error_msg = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['code'])) {
|
||||
|
||||
$userId = (int)$_SESSION['2fa_userid'];
|
||||
$codeHash = hash('sha256', $_POST['code']);
|
||||
|
||||
// 2FA-Code prüfen
|
||||
$stmt = $pdo->prepare("
|
||||
SELECT id
|
||||
FROM intern_2fa_codes
|
||||
WHERE user_id = :uid
|
||||
AND code = :code
|
||||
AND expires_at > NOW()
|
||||
LIMIT 1
|
||||
");
|
||||
$stmt->execute([
|
||||
'uid' => $userId,
|
||||
'code' => $codeHash
|
||||
]);
|
||||
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($row) {
|
||||
|
||||
// Code löschen (Einmalverwendung)
|
||||
$pdo->prepare("DELETE FROM intern_2fa_codes WHERE user_id = :uid")
|
||||
->execute(['uid' => $userId]);
|
||||
|
||||
session_regenerate_id(true);
|
||||
|
||||
$_SESSION['userid'] = $userId;
|
||||
$_SESSION['2fa_verified'] = true;
|
||||
unset($_SESSION['2fa_userid']);
|
||||
|
||||
/* ---------- Gerät merken ---------- */
|
||||
if (!empty($_POST['remember_device'])) {
|
||||
|
||||
$identifier = bin2hex(random_bytes(32));
|
||||
$token = bin2hex(random_bytes(32));
|
||||
|
||||
$pdo->prepare("
|
||||
INSERT INTO intern_securitytokens
|
||||
(user_id, identifier, securitytoken, expires_at)
|
||||
VALUES (:uid, :identifier, :token, :expires)
|
||||
")->execute([
|
||||
'uid' => $userId,
|
||||
'identifier' => $identifier,
|
||||
'token' => hash('sha256', $token),
|
||||
'expires' => date('Y-m-d H:i:s', time() + 30 * 24 * 3600)
|
||||
]);
|
||||
|
||||
$opts = [
|
||||
'expires' => time() + 30 * 24 * 3600,
|
||||
'path' => '/',
|
||||
'secure' => true,
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax'
|
||||
];
|
||||
|
||||
setcookie('remember_device', $identifier, $opts);
|
||||
setcookie('remember_device_token', $token, $opts);
|
||||
}
|
||||
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$error_msg = 'Falscher oder abgelaufener Code.';
|
||||
}
|
||||
|
||||
include("templates/header.inc.php");
|
||||
?>
|
||||
|
||||
<div class="container small-container-330 form-signin">
|
||||
<form action="verify_2fa.php" method="post">
|
||||
<h2 class="form-signin-heading">Zwei-Faktor-Authentifizierung</h2>
|
||||
|
||||
<p>Die Praxis Creutzburg sichert diesen Zugang mit einer Zwei-Faktor-Authentifizierung ab.<br>
|
||||
Sie benötigt neben Ihren Passwort auch den zweiten Faktor: eine zufällig generierte Nummer, die an Ihre E-Mail-Adresse versendet wurde.<br>
|
||||
Der zweite Faktor ist 5 Minuten gültig.<br>
|
||||
Prüfen Sie bitte jetzt Ihr Postfach und auch Ihren Spam-Ordner auf eine E-Mail von uns und geben Sie hier die sechsstellige Nummer ein.<br></p>
|
||||
|
||||
<?php if(!empty($error_msg)) echo $error_msg; ?>
|
||||
<label for="inputCode">6-stelliger Code</label>
|
||||
<input type="text" name="code" class="form-control" placeholder="Code eingeben" required>
|
||||
<br>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="remember_device" value="1"> Dieses Gerät für 30 Tage merken
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Bestätigen</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php include("templates/footer.inc.php"); ?>
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||
|
||||
|
||||
/* ---------- Kein direkter Zugriff ---------- */
|
||||
if (empty($_SESSION['2fa_userid'])) {
|
||||
header('Location: login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$error_msg = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['code'])) {
|
||||
|
||||
$userId = (int)$_SESSION['2fa_userid'];
|
||||
$codeHash = hash('sha256', $_POST['code']);
|
||||
|
||||
// 2FA-Code prüfen
|
||||
$stmt = $pdo->prepare("
|
||||
SELECT id
|
||||
FROM intern_2fa_codes
|
||||
WHERE user_id = :uid
|
||||
AND code = :code
|
||||
AND expires_at > NOW()
|
||||
LIMIT 1
|
||||
");
|
||||
$stmt->execute([
|
||||
'uid' => $userId,
|
||||
'code' => $codeHash
|
||||
]);
|
||||
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($row) {
|
||||
|
||||
// Code löschen (Einmalverwendung)
|
||||
$pdo->prepare("DELETE FROM intern_2fa_codes WHERE user_id = :uid")
|
||||
->execute(['uid' => $userId]);
|
||||
|
||||
session_regenerate_id(true);
|
||||
|
||||
$_SESSION['userid'] = $userId;
|
||||
$_SESSION['2fa_verified'] = true;
|
||||
unset($_SESSION['2fa_userid']);
|
||||
|
||||
/* ---------- Gerät merken ---------- */
|
||||
if (!empty($_POST['remember_device'])) {
|
||||
|
||||
$identifier = bin2hex(random_bytes(32));
|
||||
$token = bin2hex(random_bytes(32));
|
||||
|
||||
$pdo->prepare("
|
||||
INSERT INTO intern_securitytokens
|
||||
(user_id, identifier, securitytoken, expires_at)
|
||||
VALUES (:uid, :identifier, :token, :expires)
|
||||
")->execute([
|
||||
'uid' => $userId,
|
||||
'identifier' => $identifier,
|
||||
'token' => hash('sha256', $token),
|
||||
'expires' => date('Y-m-d H:i:s', time() + 30 * 24 * 3600)
|
||||
]);
|
||||
|
||||
$opts = [
|
||||
'expires' => time() + 30 * 24 * 3600,
|
||||
'path' => '/',
|
||||
'secure' => true,
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax'
|
||||
];
|
||||
|
||||
setcookie('remember_device', $identifier, $opts);
|
||||
setcookie('remember_device_token', $token, $opts);
|
||||
}
|
||||
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$error_msg = 'Falscher oder abgelaufener Code.';
|
||||
}
|
||||
|
||||
include("templates/header.inc.php");
|
||||
?>
|
||||
|
||||
<div class="container small-container-330 form-signin">
|
||||
<form action="verify_2fa.php" method="post">
|
||||
<h2 class="form-signin-heading">Zwei-Faktor-Authentifizierung</h2>
|
||||
|
||||
<p>Die Praxis Creutzburg sichert diesen Zugang mit einer Zwei-Faktor-Authentifizierung ab.<br>
|
||||
Sie benötigt neben Ihren Passwort auch den zweiten Faktor: eine zufällig generierte Nummer, die an Ihre E-Mail-Adresse versendet wurde.<br>
|
||||
Der zweite Faktor ist 5 Minuten gültig.<br>
|
||||
Prüfen Sie bitte jetzt Ihr Postfach und auch Ihren Spam-Ordner auf eine E-Mail von uns und geben Sie hier die sechsstellige Nummer ein.<br></p>
|
||||
|
||||
<?php if(!empty($error_msg)) echo $error_msg; ?>
|
||||
<label for="inputCode">6-stelliger Code</label>
|
||||
<input type="text" name="code" class="form-control" placeholder="Code eingeben" required>
|
||||
<br>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="remember_device" value="1"> Dieses Gerät für 30 Tage merken
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Bestätigen</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php include("templates/footer.inc.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user