$smarty->assign('tpl_changed', $request->GetVar('frm_changed', 'post')); if ($request->GetVar('frm_action', 'post') == "add") { $id = $request->GetVar('frm_action_id', 'post') - 1; $articleid = $request->GetVar('frm_article', 'post'); $receiptdata = $receipt->additem($id, $bookid, $length_short_stay, $articleid, $guestid); } elseif ($request->GetVar('frm_action', 'post') == "del") { $id = $request->GetVar('frm_action_id', 'post') - 1; $receiptdata = $receipt->delitem($id, $bookid, $length_short_stay, $guestid); } // one booking (get) } else { $bookid = $request->GetVar('bookid', 'get'); if ($request->GetVar('receiptid', 'get') !== $request->undefined) { $receiptid = $request->GetVar('receiptid', 'get'); } else { $receiptid = $receipt->getReceiptId($bookid, $guestid); } $bookids[0] = $bookid; $smarty->assign('tpl_bookid', $bookid); if ($receiptid == -1) { // is there a draft version ? if ($request->GetVar('draftreceiptid', 'get') !== $request->undefined) { $receiptdata = $receipt->getCompleteDraft($request->GetVar('draftreceiptid', 'get'), $guestid); $guestid = $receiptdata[data][guestid]; $load = true; $smarty->assign('tpl_draft', 'true'); } elseif ($receipt->getDraftReceiptId($bookid, $guestid) != -1) { $receiptdata = $receipt->getCompleteDraft($receipt->getDraftReceiptId($bookid, $guestid), $guestid); $guestid = $receiptdata[data][guestid]; $load = true; $smarty->assign('tpl_bookids', $receiptdata['data']['bookid']);