Abgleich mit Live-Daten
This commit is contained in:
+119
-119
@@ -1,120 +1,120 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Patientsuche
|
||||
* @copyright Copyright (C) 2021 ctb-it.de Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
include("config.inc.php");
|
||||
|
||||
|
||||
if(isset($_POST["timeid"])){
|
||||
$timeid=$_POST["timeid"];
|
||||
|
||||
$statementtermin = $pdo->prepare("SELECT impfstoff, date,terminart, ZIminimal, ZImaximal, ZIaktiv, ZIbiontech, ZIastra, ZImoderna FROM timeslots INNER JOIN impfstoff ON timeslots.impfstoff = impfstoff.impfid WHERE timeid = :timeid");
|
||||
$statementtermin->execute(array('timeid' => $timeid));
|
||||
$rowtime = $statementtermin->fetch(PDO::FETCH_ASSOC);
|
||||
$ZIaktiv = $rowtime["ZIaktiv"];
|
||||
$ZIminimal = $rowtime["ZIminimal"];
|
||||
$ZImaximal = $rowtime["ZImaximal"];
|
||||
$ZIbiontech = $rowtime["ZIbiontech"];
|
||||
$ZIastra = $rowtime["ZIastra"];
|
||||
$ZImoderna = $rowtime["ZImoderna"];
|
||||
$impfname = $rowtime["impfname"];
|
||||
$terminart = $rowtime["terminart"];
|
||||
|
||||
$minimaldate = date_create($rowtime["date"]);
|
||||
date_add($minimaldate, date_interval_create_from_date_string($ZIminimal . ' days'));
|
||||
$minimaldate = date_format($minimaldate, 'Y-m-d');
|
||||
$maximaldate = date_create($rowtime["date"]);
|
||||
date_add($maximaldate, date_interval_create_from_date_string($ZImaximal . ' days'));
|
||||
$maximaldate = date_format($maximaldate, 'Y-m-d');
|
||||
$impfstoffstring = "";
|
||||
$terminartstring = "";
|
||||
|
||||
if($ZIaktiv && ($terminart == 1 || $terminart == 0) ){
|
||||
if($ZIbiontech){
|
||||
if($impfstoffstring == ""){
|
||||
$impfstoffstring = $impfstoffstring . "(impfstoff='3'";
|
||||
}else{
|
||||
$impfstoffstring = $impfstoffstring . " OR impfstoff='3'";
|
||||
}
|
||||
}
|
||||
if($ZIastra){
|
||||
if($impfstoffstring == ""){
|
||||
$impfstoffstring = $impfstoffstring . "(impfstoff='2'";
|
||||
}else{
|
||||
$impfstoffstring = $impfstoffstring . " OR impfstoff='2'";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if($ZImoderna){
|
||||
if($impfstoffstring == ""){
|
||||
$impfstoffstring = $impfstoffstring . "(impfstoff='5'";
|
||||
}else{
|
||||
$impfstoffstring = $impfstoffstring . " OR impfstoff='5'";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$impfstoffstring = $impfstoffstring . ")";
|
||||
$terminartstring = " AND (terminart='1' OR terminart='3' OR terminart='5')";
|
||||
|
||||
|
||||
|
||||
$statement = $pdo->prepare("SELECT date,start,ende,impfdosen,timeid,impfstoff FROM timeslots WHERE date>= '$minimaldate' AND date<='$maximaldate' AND $impfstoffstring $terminartstring AND impfdosen > 0");
|
||||
$statement->execute();
|
||||
$count = $statement->rowCount();
|
||||
|
||||
if($count == 0){
|
||||
echo"<h3>Zweitimpfung</h3><b>Aktuell stehen bei uns keine Termine für die Zweitimpfung zur Verfügung.</b><br>Bitte kümmern Sie sich selbstständig, um einen Termin für die Zweitimpfung.<br>Sobald wir Termine für die Zweitimpfung zur Verfügung haben, finden Sie diese auch auf dieser Webseite.<br><h4>Sehen Sie von weiteren telefonischen Anfragen ab!</h4><br>";
|
||||
}else{
|
||||
?>
|
||||
<div class="select-wrapper">
|
||||
<label for="Zweitimpfung">Die Zweitimpfung nehme ich am folgenden Termin wahr:</label>
|
||||
<select name="Zweitimpfung" id="Zweitimpfung" required onchange="checkTerminzeitraumZweit()">
|
||||
<?php
|
||||
|
||||
//echo '<form action="'. $_SERVER['PHP_SELF'] .'" method=POST>';
|
||||
echo '<option value="">- Terminzeitraum </option>';
|
||||
|
||||
foreach ($statement as $row) {
|
||||
$datum = date("d.m.Y", strtotime($row["date"]));
|
||||
$start = substr($row["start"],0, 5);
|
||||
$ende = substr($row["ende"],0, 5);
|
||||
$dosenanzahl = $row["impfdosen"];
|
||||
$timeid = $row["timeid"];
|
||||
$impfid = $row["impfstoff"];
|
||||
|
||||
$statementtermin = $pdo->prepare("SELECT impfname FROM impfstoff WHERE impfid =:impfid");
|
||||
$statementtermin->execute(array('impfid' => $impfid));
|
||||
$rowimpf = $statementtermin->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
|
||||
$impfstofftext = $rowimpf["impfname"];
|
||||
|
||||
$value = "$timeid";
|
||||
$anzeige = "$datum - $start-$ende - $dosenanzahl Plätze frei - $impfstofftext";
|
||||
echo '<option value="' . $value . '">' . $anzeige . '</option>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</select>
|
||||
<div id="TerminzeitrauminfoZweit"></div><br>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* @package Patientsuche
|
||||
* @copyright Copyright (C) 2021 ctb-it.de Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
include("config.inc.php");
|
||||
|
||||
|
||||
if(isset($_POST["timeid"])){
|
||||
$timeid=$_POST["timeid"];
|
||||
|
||||
$statementtermin = $pdo->prepare("SELECT impfstoff, date,terminart, ZIminimal, ZImaximal, ZIaktiv, ZIbiontech, ZIastra, ZImoderna FROM timeslots INNER JOIN impfstoff ON timeslots.impfstoff = impfstoff.impfid WHERE timeid = :timeid");
|
||||
$statementtermin->execute(array('timeid' => $timeid));
|
||||
$rowtime = $statementtermin->fetch(PDO::FETCH_ASSOC);
|
||||
$ZIaktiv = $rowtime["ZIaktiv"];
|
||||
$ZIminimal = $rowtime["ZIminimal"];
|
||||
$ZImaximal = $rowtime["ZImaximal"];
|
||||
$ZIbiontech = $rowtime["ZIbiontech"];
|
||||
$ZIastra = $rowtime["ZIastra"];
|
||||
$ZImoderna = $rowtime["ZImoderna"];
|
||||
$impfname = $rowtime["impfname"];
|
||||
$terminart = $rowtime["terminart"];
|
||||
|
||||
$minimaldate = date_create($rowtime["date"]);
|
||||
date_add($minimaldate, date_interval_create_from_date_string($ZIminimal . ' days'));
|
||||
$minimaldate = date_format($minimaldate, 'Y-m-d');
|
||||
$maximaldate = date_create($rowtime["date"]);
|
||||
date_add($maximaldate, date_interval_create_from_date_string($ZImaximal . ' days'));
|
||||
$maximaldate = date_format($maximaldate, 'Y-m-d');
|
||||
$impfstoffstring = "";
|
||||
$terminartstring = "";
|
||||
|
||||
if($ZIaktiv && ($terminart == 1 || $terminart == 0) ){
|
||||
if($ZIbiontech){
|
||||
if($impfstoffstring == ""){
|
||||
$impfstoffstring = $impfstoffstring . "(impfstoff='3'";
|
||||
}else{
|
||||
$impfstoffstring = $impfstoffstring . " OR impfstoff='3'";
|
||||
}
|
||||
}
|
||||
if($ZIastra){
|
||||
if($impfstoffstring == ""){
|
||||
$impfstoffstring = $impfstoffstring . "(impfstoff='2'";
|
||||
}else{
|
||||
$impfstoffstring = $impfstoffstring . " OR impfstoff='2'";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if($ZImoderna){
|
||||
if($impfstoffstring == ""){
|
||||
$impfstoffstring = $impfstoffstring . "(impfstoff='5'";
|
||||
}else{
|
||||
$impfstoffstring = $impfstoffstring . " OR impfstoff='5'";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$impfstoffstring = $impfstoffstring . ")";
|
||||
$terminartstring = " AND (terminart='1' OR terminart='3' OR terminart='5')";
|
||||
|
||||
|
||||
|
||||
$statement = $pdo->prepare("SELECT date,start,ende,impfdosen,timeid,impfstoff FROM timeslots WHERE date>= '$minimaldate' AND date<='$maximaldate' AND $impfstoffstring $terminartstring AND impfdosen > 0");
|
||||
$statement->execute();
|
||||
$count = $statement->rowCount();
|
||||
|
||||
if($count == 0){
|
||||
echo"<h3>Zweitimpfung</h3><b>Aktuell stehen bei uns keine Termine für die Zweitimpfung zur Verfügung.</b><br>Bitte kümmern Sie sich selbstständig, um einen Termin für die Zweitimpfung.<br>Sobald wir Termine für die Zweitimpfung zur Verfügung haben, finden Sie diese auch auf dieser Webseite.<br><h4>Sehen Sie von weiteren telefonischen Anfragen ab!</h4><br>";
|
||||
}else{
|
||||
?>
|
||||
<div class="select-wrapper">
|
||||
<label for="Zweitimpfung">Die Zweitimpfung nehme ich am folgenden Termin wahr:</label>
|
||||
<select name="Zweitimpfung" id="Zweitimpfung" required onchange="checkTerminzeitraumZweit()">
|
||||
<?php
|
||||
|
||||
//echo '<form action="'. $_SERVER['PHP_SELF'] .'" method=POST>';
|
||||
echo '<option value="">- Terminzeitraum </option>';
|
||||
|
||||
foreach ($statement as $row) {
|
||||
$datum = date("d.m.Y", strtotime($row["date"]));
|
||||
$start = substr($row["start"],0, 5);
|
||||
$ende = substr($row["ende"],0, 5);
|
||||
$dosenanzahl = $row["impfdosen"];
|
||||
$timeid = $row["timeid"];
|
||||
$impfid = $row["impfstoff"];
|
||||
|
||||
$statementtermin = $pdo->prepare("SELECT impfname FROM impfstoff WHERE impfid =:impfid");
|
||||
$statementtermin->execute(array('impfid' => $impfid));
|
||||
$rowimpf = $statementtermin->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
|
||||
$impfstofftext = $rowimpf["impfname"];
|
||||
|
||||
$value = "$timeid";
|
||||
$anzeige = "$datum - $start-$ende - $dosenanzahl Plätze frei - $impfstofftext";
|
||||
echo '<option value="' . $value . '">' . $anzeige . '</option>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</select>
|
||||
<div id="TerminzeitrauminfoZweit"></div><br>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user