public function showItems() { include_once "./Services/Repository/classes/class.ilRepositoryExplorer.php"; $this->initBookingsObject(); $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); if (!count($bookings = ilPaymentBookings::getBookingsOfCustomer($this->user_obj->getId()))) { ilUtil::sendInfo($this->lng->txt('pay_not_buyed_any_object')); return true; } $counter = 0; foreach ($bookings as $booking) { $tmp_obj = ilObjectFactory::getInstanceByRefId($booking['ref_id'], false); $tmp_vendor = ilObjectFactory::getInstanceByObjId($booking['b_vendor_id'], false); $tmp_purchaser = ilObjectFactory::getInstanceByObjId($booking['customer_id'], false); $transaction = $booking['transaction']; include_once './Services/Payment/classes/class.ilPayMethods.php'; $str_paymethod = ilPayMethods::getStringByPaymethod($booking['b_pay_method']); $transaction .= " (" . $str_paymethod . ")"; $f_result[$counter]['transaction'] = $transaction; if ($tmp_obj) { $obj_link = ilRepositoryExplorer::buildLinkTarget($booking['ref_id'], $tmp_obj->getType()); $obj_target = ilRepositoryExplorer::buildFrameTarget($tmp_obj->getType(), $booking['ref_id'], $tmp_obj->getId()); $f_result[$counter]['object_title'] = "<a href=\"" . $obj_link . "\" target=\"" . $obj_target . "\">" . $tmp_obj->getTitle() . "</a>"; } else { $obj_link = ''; $obj_target = ''; $f_result[$counter]['object_title'] = $booking['object_title'] . '<br> (' . $this->lng->txt('object_deleted') . ')'; } $f_result[$counter]['vendor'] = '[' . $tmp_vendor->getLogin() . ']'; $f_result[$counter]['customer'] = '[' . $tmp_purchaser->getLogin() . ']'; $f_result[$counter]['order_date'] = ilDatePresentation::formatDate(new ilDateTime($booking['order_date'], IL_CAL_UNIX)); //todo check for accessduration!! if ($booking['duration'] == 0 && $booking['access_enddate'] == NULL) { $f_result[$counter]['duration'] = $this->lng->txt("unlimited_duration"); } else { if ($booking['duration'] > 0) { $f_result[$counter]['duration'] = $booking['duration'] . ' ' . $this->lng->txt('paya_months'); } $f_result[$counter]['duration'] .= ilDatePresentation::formatDate(new ilDateTime($booking['access_startdate'], IL_CAL_DATETIME)) . ' - ' . ilDatePresentation::formatDate(new ilDateTime($booking['access_enddate'], IL_CAL_DATETIME)); } $f_result[$counter]['price'] = $booking['price'] . ' ' . $booking['currency_unit']; $f_result[$counter]['discount'] = $booking['discount'] != '' ? round($booking['discount'], 2) . ' ' . $booking['currency_unit'] : ' '; $payed_access = $booking['payed'] ? $this->lng->txt('yes') : $this->lng->txt('no'); $payed_access .= '/'; $payed_access .= $booking['access_granted'] ? $this->lng->txt('yes') : $this->lng->txt('no'); $f_result[$counter]['payed_access'] = $payed_access; unset($tmp_obj); unset($tmp_vendor); unset($tmp_purchaser); ++$counter; } return $this->showStatisticTable($f_result); }