function display($tpl = null) { // Load the helper(s) if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $model = tmsModel::getModel(); $config = JFactory::getConfig(); $layoutName = vRequest::getCmd('layout', 'default'); if ($layoutName == 'edit') { $cid = vRequest::getInt('cid'); $this->view_height = 1500; $task = vRequest::getCmd('task', 'add'); if ($task != 'add' && !empty($cid) && !empty($cid[0])) { $cid = (int) $cid[0]; } else { $cid = 0; } $model->setId($cid); $this->item = $model->getItem(); $this->SetViewTitle('', $this->item->service_class_name); $this->addStandardEditViewCommandsPopup(); } else { $app = JFactory::getApplication(); $input = $app->input; $this->SetViewTitle(); JToolBarHelper::save('save', 'Save'); $this->addStandardDefaultViewLists($model, 0, 'ASC'); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentsetting.php'; $this->list_config_mode = vmpaymentsetting::get_config_mode(); $this->hold_seat_type = vmpaymentsetting::get_hold_seat_type(); $this->currencies = vmpaymentsetting::get_list_currency(); //get list payment method require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentmethod.php'; $list_payment_method = vmpaymentmethod::get_list_payment_method(); $this->assignRef('list_payment_method', $list_payment_method); //end get list payment method $tsmart_paymentsetting_id = $input->get('tsmart_paymentsetting_id', 0, 'int'); if (!$tsmart_paymentsetting_id) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('tsmart_paymentsetting_id')->from('#__tsmart_paymentsetting'); $tsmart_paymentsetting_id = $db->setQuery($query)->loadResult(); } $this->item = $model->getItem($tsmart_paymentsetting_id); // $list_payment_method = vmpaymentsetting::get_list_payment_method_by_paymentsetting_id($tsmart_paymentsetting_id); $this->assignRef('list_payment_method', $list_payment_method); } parent::display($tpl); }
function display($tpl = null) { // Load the helper(s) if (!class_exists('VmHTML')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $model = tmsModel::getModel(); $config = JFactory::getConfig(); $layoutName = vRequest::getCmd('layout', 'default'); if ($layoutName == 'edit') { $cid = vRequest::getInt('cid'); $task = vRequest::getCmd('task', 'add'); if ($task != 'add' && !empty($cid) && !empty($cid[0])) { $cid = (int) $cid[0]; } else { $cid = 0; } $this->view_height = 1000; $model->setId($cid); $this->item = $model->getItem(); //get list tour require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpayment.php'; $this->item->list_tour_id = vmPayment::get_list_tour_id_by_payment_id($this->item->tsmart_payment_id); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php'; $this->list_tour = vmproduct::get_list_product(); //end get list tour require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmcurrency.php'; $list_currency = tsmcurrency::get_list_currency(); $this->assignRef('list_currency', $list_currency); //get list payment method require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentmethod.php'; $list_payment_method = vmpaymentmethod::get_list_payment_method(); $this->assignRef('list_payment_method', $list_payment_method); $this->item->list_payment_method_id = vmpaymentmethod::get_list_payment_method_id_by_payment_id($this->item->tsmart_payment_id); //end get list payment method //get list mode payment require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpaymentmethod.php'; $list_mode_payment = vmpaymentmethod::get_list_mode_payment(); $this->assignRef('list_mode_payment', $list_mode_payment); //end get list mode payment $this->SetViewTitle('', $this->item->title); $this->addStandardEditViewCommandsPopup(); } else { $this->SetViewTitle(); $this->addStandardDefaultViewCommands(); $this->addStandardDefaultViewLists($model, 0, 'ASC'); $this->items = $model->getItemList(vRequest::getCmd('search', false)); $this->pagination = $model->getPagination(); } parent::display($tpl); }