private function __showSearchUserTable($a_result_set)
 {
     $tbl = new ilShopTableGUI($this);
     $tbl->setTitle($this->lng->txt("pays_header_select_vendor"));
     $tbl->setId('tbl_search_user_vendor');
     $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
     $tbl->addColumn(' ', 'vendor_id', '3%', true);
     $tbl->addColumn($this->lng->txt('login'), 'login', '32%');
     $tbl->addColumn($this->lng->txt('firstname'), 'firstname', '32%');
     $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '32%');
     $tbl->setSelectAllCheckbox('vendor_id');
     $tbl->addMultiCommand("addUser", $this->lng->txt("add"));
     $tbl->addCommandButton('vendors', $this->lng->txt('cancel'));
     $tbl->fillFooter();
     $tbl->setData($a_result_set);
     $this->tpl->setVariable('TABLE', $tbl->getHTML());
     return true;
 }
 private function __editPricesTable($a_result_set)
 {
     $tbl = new ilShopTableGUI($this);
     /** @var $tmp_obj ilObject */
     $tmp_obj = ilObjectFactory::getInstanceByRefId($this->pobject->getRefId(), false);
     if ($tmp_obj) {
         $tbl->setTitle($tmp_obj->getTitle());
     } else {
         $tbl->setTitle($this->lng->txt('object_not_found'));
     }
     $tbl->setId('tbl_bookings');
     $tbl->setRowTemplate("tpl.shop_prices_row.html", "Services/Payment");
     $tbl->addColumn(' ', 'price_id', '5%');
     $tbl->addColumn($this->lng->txt('duration'), 'duration', '40%');
     $tbl->addColumn($this->lng->txt('price_a'), 'price', '1%');
     $tbl->addColumn($this->lng->txt('currency'), 'currency_unit', '10%');
     $tbl->addColumn($this->lng->txt('extension_price'), 'extension', '10%');
     $tbl->addColumn('', 'edit', '30%');
     $tbl->setSelectAllCheckbox('price_id');
     $tbl->addCommandButton('addPrice', $this->lng->txt('paya_add_price'));
     $tbl->addMultiCommand("deletePrice", $this->lng->txt("paya_delete_price"));
     $tbl->fillFooter();
     $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;
 }
 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;
 }