added additional services

This commit is contained in:
Alec Höfler 2022-05-04 10:27:20 +02:00
parent 726f82ba03
commit 2ae24e4eb3
No known key found for this signature in database
GPG key ID: BE83D6C1099F2835
2 changed files with 49 additions and 0 deletions

View file

@ -67,6 +67,26 @@ foreach ($seats as $seat) {
//Generate Coupon Badge
$rabatt = ($row2["coupon_id"]!=0) ? $row2["zbc_code"] . ' (-' . $row2["zbc_discount"].'€)' : "-";
$zusatz = "";
//converting [1,2,3] to (1,2,3) => sql syntax
$ids = str_replace("[","(",$row2["additional_ids"]);
$ids = str_replace("]",")",$ids);
//Get all used additional services
$statement_additional = $pdo->prepare("SELECT * from zf_bap_additional WHERE additional_id IN ".$ids);
//Execute Statement and fetch Data
$statement_additional->execute();
$row_additional = $statement_additional->fetchAll();
foreach ($row_additional as $item){
$zusatz .= $item["name"]." (".$item["price_eur"]."€)";
if(count($row_additional)>1){
$zusatz .= "<br/>";
}
}
//Build HTML Site, which will be converted into a PDF
$data = '<!doctype html>
<html lang="de-AT">
@ -104,6 +124,10 @@ $data = '<!doctype html>
<td class="td_desc">Ticket-Nummer</td>
<td>' . $row2["order_id"] . "_" . $row2["code"] . '</td>
</tr>
<tr>
<td class="td_desc">Zusätze</td>
<td>' . $zusatz . '</td>
</tr>
<tr>
<td class="td_desc">Name</td>
<td>' . sonderzeichen($row2["first_name"]) . "&nbsp;" . sonderzeichen($row2["last_name"]) . '</td>

View file

@ -56,6 +56,27 @@ foreach ($seats as $seat) {
//Generate Coupon Badge
$rabatt = ($row2["coupon_id"]!=0) ? $row2["zbc_code"] . ' (-' . $row2["zbc_discount"].'€)' : "-";
$zusatz = "";
//converting [1,2,3] to (1,2,3) => sql syntax
$ids = str_replace("[","(",$row2["additional_ids"]);
$ids = str_replace("]",")",$ids);
//Get all used additional services
$statement_additional = $pdo->prepare("SELECT * from zf_bap_additional WHERE additional_id IN ".$ids);
//Execute Statement and fetch Data
$statement_additional->execute();
$row_additional = $statement_additional->fetchAll();
foreach ($row_additional as $item){
$zusatz .= $item["name"]." (".$item["price_eur"]."€)";
if(count($row_additional)>1){
$zusatz .= "<br/>";
}
}
echo '<html>
<head>
<meta charset="UTF-8">
@ -89,6 +110,10 @@ echo '<html>
<td class="td_desc">Name</td>
<td>' . $row2["first_name"] . "&nbsp;" . $row2["last_name"] . '</td>
</tr>
<tr>
<td class="td_desc">Zusätze</td>
<td>' . $zusatz . '</td>
</tr>
<tr>
<td class="td_desc">Bestelldatum</td>
<td>' . $row2["date"] . '</td>