added additional services
This commit is contained in:
parent
726f82ba03
commit
2ae24e4eb3
2 changed files with 49 additions and 0 deletions
24
index.php
24
index.php
|
@ -67,6 +67,26 @@ foreach ($seats as $seat) {
|
||||||
//Generate Coupon Badge
|
//Generate Coupon Badge
|
||||||
$rabatt = ($row2["coupon_id"]!=0) ? $row2["zbc_code"] . ' (-' . $row2["zbc_discount"].'€)' : "-";
|
$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
|
//Build HTML Site, which will be converted into a PDF
|
||||||
$data = '<!doctype html>
|
$data = '<!doctype html>
|
||||||
<html lang="de-AT">
|
<html lang="de-AT">
|
||||||
|
@ -104,6 +124,10 @@ $data = '<!doctype html>
|
||||||
<td class="td_desc">Ticket-Nummer</td>
|
<td class="td_desc">Ticket-Nummer</td>
|
||||||
<td>' . $row2["order_id"] . "_" . $row2["code"] . '</td>
|
<td>' . $row2["order_id"] . "_" . $row2["code"] . '</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="td_desc">Zusätze</td>
|
||||||
|
<td>' . $zusatz . '</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="td_desc">Name</td>
|
<td class="td_desc">Name</td>
|
||||||
<td>' . sonderzeichen($row2["first_name"]) . " " . sonderzeichen($row2["last_name"]) . '</td>
|
<td>' . sonderzeichen($row2["first_name"]) . " " . sonderzeichen($row2["last_name"]) . '</td>
|
||||||
|
|
|
@ -56,6 +56,27 @@ foreach ($seats as $seat) {
|
||||||
//Generate Coupon Badge
|
//Generate Coupon Badge
|
||||||
$rabatt = ($row2["coupon_id"]!=0) ? $row2["zbc_code"] . ' (-' . $row2["zbc_discount"].'€)' : "-";
|
$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>
|
echo '<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
@ -89,6 +110,10 @@ echo '<html>
|
||||||
<td class="td_desc">Name</td>
|
<td class="td_desc">Name</td>
|
||||||
<td>' . $row2["first_name"] . " " . $row2["last_name"] . '</td>
|
<td>' . $row2["first_name"] . " " . $row2["last_name"] . '</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="td_desc">Zusätze</td>
|
||||||
|
<td>' . $zusatz . '</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="td_desc">Bestelldatum</td>
|
<td class="td_desc">Bestelldatum</td>
|
||||||
<td>' . $row2["date"] . '</td>
|
<td>' . $row2["date"] . '</td>
|
||||||
|
|
Loading…
Reference in a new issue