public function currenciesObject()
 {
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $currency_res = ilPaymentCurrency::_getAvailableCurrencies();
     // currency table
     $counter = 0;
     foreach ($currency_res as $cur) {
         $f_result[$counter]['currency_id'] = ilUtil::formRadioButton(0, 'currency_id', $cur['currency_id']);
         $f_result[$counter]['is_default'] = $cur['is_default'] == 1 ? $this->lng->txt('yes') : $this->lng->txt('no');
         $f_result[$counter]['currency_unit'] = $cur['unit'];
         $f_result[$counter]['iso_code'] = $cur['iso_code'];
         $f_result[$counter]['currency_symbol'] = $cur['symbol'];
         $f_result[$counter]['conversion_rate'] = $cur['conversion_rate'];
         $counter++;
     }
     $tbl = new ilShopTableGUI($this);
     $tbl->setTitle($this->lng->txt("currencies"));
     $tbl->setId('tbl_show_currencies');
     $tbl->setRowTemplate("tpl.shop_currencies_row.html", "Services/Payment");
     $tbl->addColumn(' ', 'currency_id', '1%', true);
     $tbl->addColumn($this->lng->txt('is_default'), 'is_default', '5%');
     $tbl->addColumn($this->lng->txt('currency_unit'), 'currency_unit', '10%');
     $tbl->addColumn($this->lng->txt('iso_code'), 'iso_code', '20%');
     $tbl->addColumn($this->lng->txt('currency_symbol'), 'currency_symbol', '20%');
     $tbl->addColumn($this->lng->txt('conversion_rate'), 'conversion_rate', '15%');
     $tbl->addColumn('', 'options', '5%');
     $this->ctrl->setParameter($this, 'cmd', 'currencies');
     $tbl->addMultiCommand('updateDefaultCurrency', $this->lng->txt('paya_set_default_currency'));
     $tbl->addMultiCommand("editCurrency", $this->lng->txt('edit'));
     $tbl->addMultiCommand("deleteCurrency", $this->lng->txt('delete'));
     $tbl->addCommandButton('addCurrency', $this->lng->txt('add_currency'));
     $tbl->setData($f_result);
     $this->tpl->setVariable('TABLE', $tbl->getHTML());
     return true;
 }
 public function __showSearchUserTable($a_result_set)
 {
     $this->ctrl->setParameter($this, "sell_id", $_GET["sell_id"]);
     $tbl = new ilShopTableGUI($this);
     $tbl->setTitle($this->lng->txt("users"));
     $tbl->setId('tbl_users_search');
     $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
     $tbl->addColumn('', 'user_id', '1%', true);
     $tbl->addColumn($this->lng->txt('login'), 'login', '10%');
     $tbl->addColumn($this->lng->txt('firstname'), 'firstname', '10%');
     $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '10%');
     $tbl->addMultiCommand('addCustomer', $this->lng->txt('add'));
     $tbl->setData($a_result_set);
     $this->tpl->setVariable('TABLE', $tbl->getHTML());
     return true;
 }
 private function showStatisticTable($a_result_set)
 {
     $tbl = new ilShopTableGUI($this);
     $tbl->setTitle($this->lng->txt("paya_buyed_objects"));
     $tbl->setId('tbl_bought_objects');
     $tbl->setRowTemplate("tpl.shop_statistics_row.html", "Services/Payment");
     $tbl->addColumn($this->lng->txt('paya_transaction'), 'transaction', '10%');
     $tbl->addColumn($this->lng->txt('title'), 'object_title', '10%');
     $tbl->addColumn($this->lng->txt('paya_vendor'), 'vendor', '10%');
     $tbl->addColumn($this->lng->txt('paya_customer'), 'customer', '10%');
     $tbl->addColumn($this->lng->txt('paya_order_date'), 'order_date', '10%');
     $tbl->addColumn($this->lng->txt('duration'), 'duration', '10%');
     $tbl->addColumn($this->lng->txt('price_a'), 'price', '5%');
     $tbl->addColumn($this->lng->txt('paya_coupons_coupon'), 'discount', '5%');
     $tbl->addColumn($this->lng->txt('paya_payed_access'), 'payed_access', '5%');
     $tbl->setData($a_result_set);
     $this->tpl->setVariable('TABLE', $tbl->getHTML());
     return true;
 }
 function __showTrusteesTable($a_result_set)
 {
     $tbl = new ilShopTableGUI($this);
     $tbl->setTitle($this->lng->txt("paya_trustee_table"));
     $tbl->setId('tbl_show_trustee');
     $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
     $tbl->addColumn(' ', 'trustee_id', '1%', true);
     $tbl->addColumn($this->lng->txt('login'), 'login', '10%');
     $tbl->addColumn($this->lng->txt('firstname'), 'firstname', '20%');
     $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '20%');
     $tbl->addColumn($this->lng->txt('paya_perm_stat'), 'perm_stat', '15%');
     $tbl->addColumn($this->lng->txt('paya_perm_obj'), 'perm_obj', '15%');
     $tbl->addColumn($this->lng->txt('paya_perm_coupons'), 'perm_coupons', '15%');
     $tbl->addColumn('', 'options', '5%');
     $tbl->setSelectAllCheckbox('trustee_id');
     $tbl->addMultiCommand("deleteTrustee", $this->lng->txt("delete"));
     $tbl->addCommandButton('update', $this->lng->txt('apply'));
     $tbl->setData($a_result_set);
     $this->tpl->setVariable('TABLE', $tbl->getHTML());
     return true;
 }
 private function __showObjectsTable($a_result_set)
 {
     $tbl = new ilShopTableGUI($this);
     $tbl->setTitle($this->lng->txt('objects'));
     $tbl->setId('tbl_objects');
     $tbl->setRowTemplate("tpl.shop_objects_row.html", "Services/Payment");
     $tbl->addColumn($this->lng->txt('title'), 'title', '10%');
     $tbl->addColumn($this->lng->txt('status'), 'status', '10%');
     $tbl->addColumn($this->lng->txt('paya_pay_method'), 'pay_method', '10%');
     $tbl->addColumn($this->lng->txt('vat_rate'), 'vat_rate', '15%');
     $tbl->addColumn($this->lng->txt('paya_vendor'), 'vendor', '10%');
     $tbl->addColumn($this->lng->txt('paya_count_purchaser'), 'purchasers', '10%');
     $tbl->addColumn('', 'options', '10%');
     $tbl->setData($a_result_set);
     $this->tpl->setVariable('TABLE', $tbl->getHTML());
     return true;
 }
 public function showObjects()
 {
     $this->coupon_obj->setId($_GET['coupon_id']);
     $this->__initPaymentObject();
     $this->ctrl->setParameter($this, 'coupon_id', $_GET['coupon_id']);
     $this->__showButtons();
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $objects = $this->pobject->_getObjectsData($this->user_obj->getId());
     $this->coupon_obj->getCouponById(ilUtil::stripSlashes($_GET['coupon_id']));
     $counter_assigned = 0;
     $counter_unassigned = 0;
     $f_result_assigned = array();
     $f_result_unassigned = array();
     foreach ($objects as $data) {
         if ($this->coupon_obj->isObjectAssignedToCoupon($data['ref_id'])) {
             $p_counter =& $counter_assigned;
             $p_result =& $f_result_assigned;
         } else {
             $p_counter =& $counter_unassigned;
             $p_result =& $f_result_unassigned;
         }
         $tmp_obj = ilObjectFactory::getInstanceByRefId($data['ref_id'], false);
         if ($tmp_obj) {
             $p_result[$p_counter]['object_id'] = ilUtil::formCheckbox(0, 'object_id[]', $data['ref_id']);
             $p_result[$p_counter]['title'] = $tmp_obj->getTitle();
             switch ($data['status']) {
                 case $this->pobject->STATUS_BUYABLE:
                     $p_result[$p_counter]['status'] = $this->lng->txt('paya_buyable');
                     break;
                 case $this->pobject->STATUS_NOT_BUYABLE:
                     $p_result[$p_counter]['status'] = $this->lng->txt('paya_not_buyable');
                     break;
                 case $this->pobject->STATUS_EXPIRES:
                     $p_result[$p_counter]['status'] = $this->lng->txt('paya_expires');
                     break;
             }
             include_once './Services/Payment/classes/class.ilPayMethods.php';
             $p_result[$p_counter]['pay_method'] = ilPaymethods::getStringByPaymethod($data['pay_method']);
         } else {
             $p_result[$p_counter]['object_id'] = '';
             $p_result[$p_counter]['title'] = $this->lng->txt('object_not_found');
             $p_result[$p_counter]['status'] = '';
             $p_result[$p_counter]['pay_method'] = '';
         }
         ++$p_counter;
         unset($tmp_obj);
     }
     $this->ctrl->setParameter($this, "cmd", "showObjects");
     if (count($f_result_assigned) > 0) {
         $tbl = new ilShopTableGUI($this);
         $tbl->setTitle($this->lng->txt("paya_coupons_coupon") . " " . $this->coupon_obj->getTitle() . ": " . $this->lng->txt("paya_coupons_assigned_objects"));
         $tbl->setId('tbl_show_assigned');
         $tbl->setPrefix('assigned');
         $tbl->setRowTemplate("tpl.shop_objects_row.html", "Services/Payment");
         $tbl->addColumn('', 'object_id', '1%');
         $tbl->addColumn($this->lng->txt('title'), 'title', '10%');
         $tbl->addColumn($this->lng->txt('status'), 'status', '30%');
         $tbl->addColumn($this->lng->txt('paya_pay_method'), 'paya_pay_method', '60%');
         $tbl->setSelectAllCheckbox('object_id');
         $tbl->addMultiCommand('unassignObjects', $this->lng->txt('remove'));
         $tbl->setData($f_result_assigned);
         $this->tpl->setVariable('TABLE', $tbl->getHTML());
     }
     if (count($f_result_unassigned) > 0) {
         $tbl_2 = new ilShopTableGUI($this);
         $tbl_2->setTitle($this->lng->txt("paya_coupons_coupon") . " " . $this->coupon_obj->getTitle() . ": " . $this->lng->txt("paya_coupons_unassigned_objects"));
         $tbl_2->setId('tbl_show_unassigned');
         $tbl_2->setPrefix('unassigned');
         $tbl_2->setRowTemplate("tpl.shop_objects_row.html", "Services/Payment");
         $tbl_2->addColumn('', 'object_id', '1%');
         $tbl_2->addColumn($this->lng->txt('title'), 'title', '10%');
         $tbl_2->addColumn($this->lng->txt('status'), 'status', '30%');
         $tbl_2->addColumn($this->lng->txt('paya_pay_method'), 'pay_method', '60%');
         $tbl_2->setSelectAllCheckbox('object_id');
         $tbl_2->addMultiCommand('assignObjects', $this->lng->txt('add'));
         $tbl_2->setData($f_result_unassigned);
         $this->tpl->setVariable('TABLE_2', $tbl_2->getHTML());
     }
     return true;
 }