本文整理汇总了PHP中AForm::getFieldHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP AForm::getFieldHtml方法的具体用法?PHP AForm::getFieldHtml怎么用?PHP AForm::getFieldHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AForm
的用法示例。
在下文中一共展示了AForm::getFieldHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$grid_settings = array('table_id' => 'report_coupons_grid', 'url' => $this->html->getSecureURL('listing_grid/report_sale/coupons'), 'sortname' => 'date_end', 'columns_search' => false, 'multiselect' => 'false');
$form = new AForm();
$form->setForm(array('form_name' => 'report_coupons_grid_search'));
$this->data['grid_search_form'] = array();
$this->data['grid_search_form']['id'] = 'report_coupons_grid_search';
$this->data['grid_search_form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'report_coupons_grid_search', 'action' => ''));
$this->data['grid_search_form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_go'), 'style' => 'button1'));
$this->view->assign('js_date_format', format4Datepicker($this->language->get('date_format_short')));
$this->data['grid_search_form']['fields']['date_start'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'date_start', 'default' => dateInt2Display(strtotime('-7 day'))));
$this->data['grid_search_form']['fields']['date_end'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'date_end', 'default' => dateInt2Display(time())));
$grid_settings['search_form'] = true;
$grid_settings['colNames'] = array($this->language->get('column_coupon_name'), $this->language->get('column_code'), $this->language->get('column_orders'), $this->language->get('column_total'), $this->language->get('column_discount_total'));
$grid_settings['colModel'] = array(array('name' => 'coupon_name', 'index' => 'coupon_name', 'width' => 100, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'code', 'index' => 'code', 'width' => 100, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'orders', 'index' => 'orders', 'width' => 100, 'align' => 'center'), array('name' => 'total', 'index' => 'total', 'width' => 110, 'align' => 'center'), array('name' => 'discount_total', 'index' => 'discount_total', 'width' => 110, 'align' => 'center'));
$grid = $this->dispatch('common/listing_grid', array($grid_settings));
$this->view->assign('listing_grid', $grid->dispatchGetOutput());
$this->view->assign('search_form', $this->data['grid_search_form']);
$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('report/sale/coupon'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ', 'current' => true));
$this->processTemplate('pages/report/sale/coupons.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例2: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('tool/cache'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ', 'current' => true));
$this->data['sections'] = array(array('id' => 'configuration', 'text' => $this->language->get('text_configuration'), 'description' => $this->language->get('desc_configuration'), 'keywords' => 'settings,store,stores,attribute,attributes,length_class,contents,tax_class,order_status,stock_status,weight_class,storefront_menu,tables'), array('id' => 'layout', 'text' => $this->language->get('text_layouts_blocks'), 'description' => $this->language->get('desc_layouts_blocks'), 'keywords' => 'layout'), array('id' => 'flexyforms', 'text' => $this->language->get('text_flexyforms'), 'description' => $this->language->get('desc_flexyforms'), 'keywords' => 'forms'), array('id' => 'translation', 'text' => $this->language->get('text_translations'), 'description' => $this->language->get('desc_translations'), 'keywords' => 'lang'), array('id' => 'image', 'text' => $this->language->get('text_images'), 'description' => $this->language->get('desc_images'), 'keywords' => 'image,resources'), array('id' => 'product', 'text' => $this->language->get('text_products'), 'description' => $this->language->get('desc_products'), 'keywords' => 'product'), array('id' => 'category', 'text' => $this->language->get('text_categories'), 'description' => $this->language->get('desc_categories'), 'keywords' => 'category'), array('id' => 'manufacturer', 'text' => $this->language->get('text_manufacturers'), 'description' => $this->language->get('desc_manufacturers'), 'keywords' => 'manufacturer'), array('id' => 'localisation', 'text' => $this->language->get('text_localisations'), 'description' => $this->language->get('desc_localisations'), 'keywords' => 'currency,country,zone,language'), array('id' => 'error_log', 'text' => $this->language->get('text_error_log'), 'description' => $this->language->get('desc_error_log'), 'keywords' => 'error_log'));
$form = new AForm('ST');
$form->setForm(array('form_name' => 'cacheFrm'));
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'cacheFrm', 'action' => $this->html->getSecureURL('tool/cache/delete')));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('text_clear_cache'), 'style' => 'button1'));
if (isset($this->error['warning'])) {
$this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
}
if (isset($this->session->data['success'])) {
$this->data['success'] = $this->session->data['success'];
unset($this->session->data['success']);
} else {
$this->data['success'] = '';
}
$this->view->batchAssign($this->data);
$this->view->assign('help_url', $this->gen_help_url());
$this->processTemplate('pages/tool/cache.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例3: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->html->getSecureURL('account/newsletter');
$this->redirect($this->html->getSecureURL('account/login'));
}
$this->document->setTitle($this->language->get('heading_title'));
if ($this->request->is_POST()) {
$this->loadModel('account/customer');
$this->model_account_customer->editNewsletter($this->request->post['newsletter']);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->html->getURL('account/account'));
}
$this->document->resetBreadcrumbs();
$this->document->addBreadcrumb(array('href' => $this->html->getURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getURL('account/account'), 'text' => $this->language->get('text_account'), 'separator' => $this->language->get('text_separator')));
$this->document->addBreadcrumb(array('href' => $this->html->getURL('account/newsletter'), 'text' => $this->language->get('text_newsletter'), 'separator' => $this->language->get('text_separator')));
$form = new AForm();
$form->setForm(array('form_name' => 'newsFrm'));
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'newsFrm', 'action' => $this->html->getSecureURL('account/newsletter')));
$this->data['form']['newsletter'] = $form->getFieldHtml(array('type' => 'radio', 'name' => 'newsletter', 'value' => $this->customer->getNewsletter(), 'options' => array('1' => $this->language->get('text_yes'), '0' => $this->language->get('text_no'))));
$this->data['form']['continue'] = $form->getFieldHtml(array('type' => 'submit', 'icon' => 'fa fa-check', 'name' => $this->language->get('button_continue')));
$this->data['back'] = $this->html->getURL('account/account');
$back = HtmlElementFactory::create(array('type' => 'button', 'name' => 'back', 'text' => $this->language->get('button_back'), 'icon' => 'fa fa-arrow-left', 'style' => 'button'));
$this->data['form']['back'] = $back;
$this->view->batchAssign($this->data);
$this->processTemplate('pages/account/newsletter.tpl');
//init controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例4: main
public function main()
{
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$data['action'] = '';
$form = new AForm();
$form->setForm(array('form_name' => 'checkout'));
$data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'checkout', 'action' => 'https://www.liqpay.com/?do=clickNbuy'));
$xml = '<response>';
$xml .= ' <version>1.2</version>';
$xml .= ' <result_url>' . $this->html->getSecureURL('checkout/success') . '</result_url>';
$xml .= ' <server_url>' . $this->html->getSecureURL('extension/liqpay/callback') . '</server_url>';
$xml .= ' <merchant_id>' . $this->config->get('default_liqpay_merchant') . '</merchant_id>';
$xml .= ' <order_id>' . $this->session->data['order_id'] . '</order_id>';
$xml .= ' <amount>' . $this->currency->format($order_info['total'], $order_info['currency'], $order_info['value'], FALSE) . '</amount>';
$xml .= ' <currency>' . $order_info['currency'] . '</currency>';
$xml .= ' <description>' . $this->config->get('store_name') . ' ' . $order_info['payment_firstname'] . ' ' . $order_info['payment_address_1'] . ' ' . $order_info['payment_address_2'] . ' ' . $order_info['payment_city'] . ' ' . $order_info['email'] . '</description>';
$xml .= ' <sender_phone></sender_phone>';
$xml .= ' <pay_way>' . $this->config->get('default_liqpay_type') . '</pay_way>';
$xml .= '</response>';
$data['form']['xml'] = $form->getFieldHtml(array('type' => 'hidden', 'name' => 'xml', 'value' => base64_encode($xml)));
$data['form']['signature'] = $form->getFieldHtml(array('type' => 'hidden', 'name' => 'signature', 'value' => base64_encode(sha1($this->config->get('default_liqpay_signature') . $xml . $this->config->get('default_liqpay_signature'), TRUE))));
$back = $this->request->get['rt'] != 'checkout/guest_step_3' ? $this->html->getSecureURL('checkout/payment') : $this->html->getSecureURL('checkout/guest_step_2');
$data['form']['back'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'back', 'text' => $this->language->get('button_back'), 'style' => 'button', 'href' => $back));
$data['form']['submit'] = $form->getFieldHtml(array('type' => 'submit', 'name' => $this->language->get('button_confirm')));
$this->view->batchAssign($data);
$this->processTemplate('responses/default_liqpay.tpl');
}
示例5: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb();
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('tool/message_manager'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: '));
$grid_settings = array('table_id' => 'message_grid', 'url' => $this->html->getSecureURL('listing_grid/message_grid'), 'editurl' => $this->html->getSecureURL('listing_grid/message_grid/update'), 'update_field' => $this->html->getSecureURL('listing_grid/message_grid/update_field'), 'sortname' => 'status', 'actions' => array(), 'columns_search' => false, 'sortable' => true, 'multiaction_options' => array('delete' => $this->language->get('text_delete_selected')));
$grid_settings['colNames'] = array($this->language->get('column_status'), $this->language->get('column_title'), $this->language->get('column_create_date'), $this->language->get('column_action'));
$grid_settings['colModel'] = array(array('name' => 'status', 'index' => 'status', 'width' => 50, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'title', 'index' => 'title', 'width' => 250, 'align' => 'left', 'sorttype' => 'string'), array('name' => 'create_date', 'index' => 'create_date', 'width' => 70, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'action', 'index' => 'action', 'width' => 70, 'align' => 'center', 'sorttype' => 'string'));
$form = new AForm('ff');
$grid = $this->dispatch('common/listing_grid', array($grid_settings));
$this->view->assign('listing_grid', $grid->dispatchGetOutput());
$this->view->assign('popup_action', $this->html->getSecureURL('listing_grid/message_grid/update'));
$this->view->assign('notifier', $this->html->getSecureURL('listing_grid/message_grid/getNotify'));
$this->view->assign('status', $this->language->get('text_status'));
$this->view->assign('status_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_status', 'id' => 'msg_status', 'attr' => 'disabled readonly ')));
$this->view->assign('create_date', $this->language->get('text_date'));
$this->view->assign('create_date_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_create_date', 'id' => 'msg_create_date', 'attr' => 'disabled readonly ')));
$this->view->assign('repeats', $this->language->get('text_repeats'));
$this->view->assign('repeat_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_repeat', 'id' => 'msg_repeat', 'attr' => 'disabled readonly ')));
$this->view->assign('delete', $this->language->get('text_delete'));
$this->view->assign('close', $this->language->get('text_close'));
$this->view->assign('confirm', $this->language->get('text_confirm'));
$this->view->batchAssign($this->language->getASet());
$this->view->assign('help_url', $this->gen_help_url());
$this->processTemplate('pages/tool/message_manager.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例6: main
public function main()
{
$fields = array();
$this->load->model('checkout/order');
$this->loadLanguage('default_skrill/default_skrill');
$cancel_url = $this->request->get['rt'] != 'checkout/guest_step_3' ? $this->html->getSecureURL('checkout/payment') : $this->html->getSecureURL('checkout/guest_step_2');
if (is_file(DIR_RESOURCE . $this->config->get('config_logo'))) {
$logo = HTTPS_DIR_RESOURCE . $this->config->get('config_logo');
} else {
$logo = $this->config->get('config_logo');
}
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$products = '';
foreach ($this->cart->getProducts() as $product) {
$products .= $product['quantity'] . ' x ' . $product['name'] . ', ';
}
$this->load->library('encryption');
$encryption = new AEncryption($this->config->get('encryption_key'));
$skrill_url = 'https://pay.skrill.com';
//$skrill_url = 'https://sandbox.dev.skrillws.net/pay';
$fields = array('rid' => '53571612', 'ext_ref_id' => 'abantecart', 'pay_to_email' => $this->config->get('default_skrill_email'), 'recipient_description' => $this->config->get('store_name'), 'transaction_id' => $this->session->data['order_id'] . '_' . UNIQUE_ID, 'return_url' => $this->html->getSecureURL('checkout/success'), 'cancel_url' => $cancel_url, 'status_url' => $this->html->getSecureURL('extension/default_skrill/callback'), 'language' => $this->session->data['language'], 'logo_url' => $logo, 'pay_from_email' => $order_info['email'], 'firstname' => $order_info['payment_firstname'], 'lastname' => $order_info['payment_lastname'], 'address' => $order_info['payment_address_1'], 'address2' => $order_info['payment_address_2'], 'phone_number' => $order_info['telephone'], 'postal_code' => substr($order_info['payment_postcode'], 0, 9), 'city' => $order_info['payment_city'], 'state' => $order_info['payment_zone'], 'country' => $order_info['payment_iso_code_3'], 'amount' => $this->currency->format($order_info['total'], $order_info['currency'], $order_info['value'], FALSE), 'currency' => $order_info['currency'], 'detail1_text' => $products, 'merchant_fields' => 'order_id', 'order_id' => $encryption->encrypt($this->session->data['order_id']));
$form = new AForm();
$form->setForm(array('form_name' => 'checkout'));
$data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'checkout', 'action' => $skrill_url));
foreach ($fields as $key => $value) {
$data['form'][$key] = $form->getFieldHtml(array('type' => 'hidden', 'name' => $key, 'value' => $value));
}
$data['form']['back'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'back', 'text' => $this->language->get('button_back'), 'style' => 'button', 'href' => $back));
$data['form']['submit'] = $form->getFieldHtml(array('type' => 'submit', 'name' => $this->language->get('button_confirm')));
$this->view->batchAssign($data);
$this->processTemplate('responses/default_skrill.tpl');
}
示例7: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb();
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('tool/datasets_manager'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ', 'current' => true));
$grid_settings = array('table_id' => 'dataset_grid', 'url' => $this->html->getSecureURL('listing_grid/datasets_grid'), 'editurl' => $this->html->getSecureURL('listing_grid/datasets_grid/update'), 'update_field' => $this->html->getSecureURL('listing_grid/datasets_grid/update_field'), 'sortname' => 'dataset_id', 'actions' => array('view' => array('text' => $this->language->get('text_show'), 'href' => $this->html->getSecureURL('listing_grid/datasets_grid/info', '&dataset_id=%ID%'))), 'columns_search' => false, 'sortable' => true, 'multiselect' => 'false', 'grid_ready' => 'grid_ready();');
$grid_settings['colNames'] = array($this->language->get('column_id'), $this->language->get('column_name'), $this->language->get('column_key'));
$grid_settings['colModel'] = array(array('name' => 'dataset_id', 'index' => 'dataset_id', 'width' => 30, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'dataset_name', 'index' => 'dataset_name', 'width' => 450, 'align' => 'left', 'sorttype' => 'string'), array('name' => 'dataset_key', 'index' => 'dataset_key', 'width' => 150, 'align' => 'left', 'sorttype' => 'string'));
$form = new AForm('ds');
$grid = $this->dispatch('common/listing_grid', array($grid_settings));
$this->view->assign('listing_grid', $grid->dispatchGetOutput());
$this->view->assign('popup_action', $this->html->getSecureURL('listing_grid/datasets_grid/info'));
$this->view->assign('popup_title', $this->language->get('text_popup_title'));
$this->view->assign('date_added', $this->language->get('text_date'));
$this->view->assign('create_date_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_create_date', 'id' => 'msg_create_date', 'attr' => 'readonly=true')));
$this->view->assign('repeats', $this->language->get('text_repeats'));
$this->view->assign('repeat_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_repeat', 'id' => 'msg_repeat', 'attr' => 'readonly=true')));
//$this->view->assign ( 'delete', $this->language->get ( 'text_delete' ) );
$this->view->assign('confirm', $this->language->get('text_confirm'));
$this->view->batchAssign($this->language->getASet());
$this->view->assign('help_url', $this->gen_help_url());
$this->processTemplate('pages/tool/datasets_manager.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例8: main
public function main()
{
$this->loadModel('tool/developer_tools');
$this->loadLanguage('developer_tools/developer_tools');
$prj_id = func_get_arg(0);
$prj_config = $this->model_tool_developer_tools->getProjectConfig($prj_id);
$this->data['text_layout_xml_tab'] = $this->language->get('text_layout_xml_tab');
$this->data['text_select_template'] = $this->language->get('text_select_template');
$this->data['filepath'] = DIR_EXT . $prj_config['extension_txt_id'] . '/layout.xml';
$this->data['relative_path'] = 'extensions/' . $prj_config['extension_txt_id'] . '/layout.xml';
$exist = file_exists($this->data['filepath']) ? true : false;
if ($exist) {
$this->data['text_view_layout_xml'] = $this->language->get('text_view_layout_xml');
}
$result = $this->db->query("SELECT DISTINCT template_id\n\t\t\t\t\t\t\t\t\tFROM " . DB_PREFIX . "layouts");
foreach ($result->rows as $row) {
$templates[$row['template_id']] = $row['template_id'];
}
$form = new AForm('ST');
$form->setForm(array('form_name' => 'extLayoutFrm', 'update' => ''));
$this->data['form']['id'] = 'extLayoutFrm';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'extLayoutFrm', 'action' => $this->data['action']));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('text_save_layout_xml'), 'style' => 'button1'));
$this->data['form']['template'] = $form->getFieldHtml(array('type' => 'selectbox', 'name' => 'template_id', 'options' => $templates, 'value' => $prj_config['extension_txt_id']));
$this->data['xml_build_url'] = $this->html->getSecureUrl('tool/developer_tools_other/savelayoutxml', '&prj_id=' . $prj_id);
$this->data['text_save_layout_xml'] = $this->language->get('text_save_layout_xml');
$this->view->batchAssign($this->data);
$this->processTemplate('responses/tool/developer_tools_other.tpl');
}
示例9: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$grid_settings = array('table_id' => 'report_purchased_grid', 'url' => $this->html->getSecureURL('listing_grid/report_purchased'), 'sortname' => 'quantity', 'columns_search' => false, 'multiselect' => 'false', 'search_form' => true);
$grid_settings['colNames'] = array($this->language->get('column_name'), $this->language->get('column_model'), $this->language->get('column_quantity'), $this->language->get('column_total'));
$grid_settings['colModel'] = array(array('name' => 'name', 'index' => 'name', 'width' => 300, 'align' => 'left', 'sortable' => false), array('name' => 'model', 'index' => 'model', 'width' => 80, 'align' => 'center', 'sortable' => false), array('name' => 'quantity', 'index' => 'quantity', 'width' => 50, 'align' => 'center', 'sortable' => false), array('name' => 'total', 'index' => 'total', 'width' => 90, 'align' => 'center', 'sortable' => false));
$grid = $this->dispatch('common/listing_grid', array($grid_settings));
$this->view->assign('listing_grid', $grid->dispatchGetOutput());
//prepare the filter form
//Note: External search form needs to be named [grid_name]_search
// In this case it will be auto submited to filter grid
$form = new AForm();
$form->setForm(array('form_name' => 'report_purchased_grid_search'));
$this->data['grid_search_form'] = array();
$this->data['grid_search_form']['id'] = 'report_purchased_grid_search';
$this->data['grid_search_form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'report_purchased_grid_search', 'action' => ''));
$this->data['grid_search_form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_go'), 'style' => 'button1'));
$this->view->assign('js_date_format', format4Datepicker($this->language->get('date_format_short')));
$this->data['grid_search_form']['fields']['date_start'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'date_start', 'default' => dateInt2Display(strtotime('-30 day'))));
$this->data['grid_search_form']['fields']['date_end'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'date_end', 'default' => dateInt2Display(time())));
$this->view->assign('search_form', $this->data['grid_search_form']);
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('report/purchased'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ', 'current' => true));
$this->document->setTitle($this->language->get('heading_title'));
$this->processTemplate('pages/report/purchased.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例10: main
public function main()
{
$this->data = array();
$run_level = $this->request->get['runlevel'];
if (isset($run_level)) {
if (!in_array((int) $run_level, array(1, 2, 3, 4, 5))) {
$this->redirect(HTTP_SERVER . 'index.php?rt=activation' . '&admin_path=' . $this->request->post['admin_path']);
}
if (!$this->session->data['install_step_data'] && (int) $run_level == 1) {
if (filesize(DIR_ABANTECART . 'system/config.php')) {
$this->redirect(HTTP_SERVER . 'index.php?rt=activation');
} else {
$this->redirect(HTTP_SERVER . 'index.php?rt=license');
}
}
echo $this->runlevel((int) $run_level);
return null;
}
if ($this->request->is_POST() && $this->_validate()) {
$this->session->data['install_step_data'] = $this->request->post;
$this->redirect(HTTP_SERVER . 'index.php?rt=install&runlevel=1');
}
$this->data['error'] = $this->error;
$this->data['action'] = HTTP_SERVER . 'index.php?rt=install';
$fields = array('db_driver', 'db_host', 'db_user', 'db_password', 'db_name', 'db_prefix', 'username', 'password', 'password_confirm', 'email', 'admin_path');
$defaults = array('', 'localhost', '', '', '', 'abc_', 'admin', '', '', '', '');
$place_holder = array('Select Database Driver', 'Enter Database Hostname', 'Enter Database Username', 'Enter Password, if any', 'Enter Database Name', 'Add prefix to database tables', 'Enter new admin username', 'Enter Secret Admin Password', 'Repeat the password', 'Provide valid email of administrator', 'Enter your secret admin key');
foreach ($fields as $k => $field) {
if (isset($this->request->post[$field])) {
$this->data[$field] = $this->request->post[$field];
} else {
$this->data[$field] = $defaults[$k];
}
}
$form = new AForm('ST');
$form->setForm(array('form_name' => 'form', 'update' => ''));
$this->data['form']['id'] = 'form';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'editFrm', 'action' => $this->data['action']));
foreach ($fields as $k => $field) {
if ($field != 'db_driver') {
$this->data['form'][$field] = $form->getFieldHtml(array('type' => in_array($field, array('password', 'password_confirm')) ? 'password' : 'input', 'name' => $field, 'value' => $this->data[$field], 'placeholder' => $place_holder[$k], 'required' => in_array($field, array('db_host', 'db_user', 'db_name', 'username', 'password', 'password_confirm', 'email', 'admin_path'))));
} else {
$options = array();
//regular mysql is not supported on PHP 5.5.+
if (extension_loaded('mysql') && version_compare(phpversion(), '5.5.0', '<') == TRUE) {
$options['mysql'] = 'MySQL';
}
if (extension_loaded('mysqli')) {
$options['amysqli'] = 'MySQLi';
}
$this->data['form'][$field] = $form->getFieldHtml(array('type' => 'selectbox', 'name' => $field, 'value' => $this->data[$field], 'options' => $options, 'required' => true));
}
}
$this->view->assign('back', HTTP_SERVER . 'index.php?rt=settings');
$this->addChild('common/header', 'header', 'common/header.tpl');
$this->addChild('common/footer', 'footer', 'common/footer.tpl');
$this->view->batchAssign($this->data);
$this->processTemplate('pages/install.tpl');
}
示例11: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->loadLanguage('catalog/product');
$this->document->setTitle($this->language->get('heading_title'));
$this->loadModel('catalog/product');
$this->loadModel('tool/image');
if (isset($this->request->get['product_id'])) {
$product_info = $this->model_catalog_product->getProduct($this->request->get['product_id']);
if (!$product_info) {
$this->session->data['warning'] = $this->language->get('error_product_not_found');
$this->redirect($this->html->getSecureURL('catalog/product'));
}
}
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
$this->model_catalog_product->updateProductImages($this->request->get['product_id'], $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->html->getSecureURL('catalog/product_images', '&product_id=' . $this->request->get['product_id']));
}
$this->data['product_description'] = $this->model_catalog_product->getProductDescriptions($this->request->get['product_id']);
$this->view->assign('error_warning', $this->error['warning']);
$this->view->assign('success', $this->session->data['success']);
if (isset($this->session->data['success'])) {
unset($this->session->data['success']);
}
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('catalog/product'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: '));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('catalog/product/update', '&product_id=' . $this->request->get['product_id']), 'text' => $this->language->get('text_edit') . ' ' . $this->language->get('text_product') . ' - ' . $this->data['product_description'][$this->session->data['content_language_id']]['name'], 'separator' => ' :: '));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('catalog/product_images', '&product_id=' . $this->request->get['product_id']), 'text' => $this->language->get('tab_media'), 'separator' => ' :: '));
$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
$this->data['active'] = 'images';
//load tabs controller
$tabs_obj = $this->dispatch('pages/catalog/product_tabs', array($this->data));
$this->data['product_tabs'] = $tabs_obj->dispatchGetOutput();
unset($tabs_obj);
$this->data['button_add_image'] = $this->html->buildButton(array('text' => $this->language->get('button_add_image'), 'style' => 'button1'));
$this->data['action'] = $this->html->getSecureURL('catalog/product_images', '&product_id=' . $this->request->get['product_id']);
$this->data['form_title'] = $this->language->get('text_edit') . ' ' . $this->language->get('text_product');
$this->data['update'] = '';
$form = new AForm('HS');
$form->setForm(array('form_name' => 'productFrm', 'update' => $this->data['update']));
$this->data['form']['id'] = 'productFrm';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'productFrm', 'action' => $this->data['action']));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_save'), 'style' => 'button1'));
$this->data['form']['cancel'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'cancel', 'text' => $this->language->get('button_cancel'), 'style' => 'button2'));
$this->view->batchAssign($this->data);
$this->view->assign('help_url', $this->gen_help_url('product_media'));
$this->addChild('pages/catalog/product_summary', 'summary_form', 'pages/catalog/product_summary.tpl');
$this->addChild('responses/common/resource_library/get_resources_html', 'resources_html', 'responses/common/resource_library_scripts.tpl');
$resources_scripts = $this->dispatch('responses/common/resource_library/get_resources_scripts', array('object_name' => 'products', 'object_id' => $this->request->get['product_id'], 'types' => array('image', 'audio', 'video', 'pdf')));
$this->view->assign('resources_scripts', $resources_scripts->dispatchGetOutput());
$this->processTemplate('pages/catalog/product_images.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例12: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->loadModel('user/user');
$this->loadLanguage('user/user');
$this->document->setTitle($this->language->get('text_edit_details'));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('index/edit_details'), 'text' => $this->language->get('text_edit_details'), 'separator' => ' :: ', 'current' => true));
$this->view->assign('success', $this->session->data['success']);
if (isset($this->session->data['success'])) {
unset($this->session->data['success']);
}
if ($this->request->is_POST() && $this->_validate()) {
$this->model_user_user->editUser($this->user->getId(), $this->request->post);
$this->session->data['success'] = $this->language->get('text_success_details');
$this->redirect($this->html->getSecureURL('index/edit_details'));
}
if ($this->request->is_POST() && $this->_validate()) {
$this->redirect($this->html->getSecureURL('index/edit_details'));
}
$this->data['login'] = $this->html->getSecureURL('index/login');
$this->data['error'] = $this->error;
$user_info = $this->model_user_user->getUser($this->user->getId());
$fields = array('firstname', 'lastname', 'email');
foreach ($fields as $f) {
if (isset($this->request->post[$f])) {
$this->data[$f] = $this->request->post[$f];
} else {
$this->data[$f] = $user_info[$f];
}
}
$this->data['action'] = $this->html->getSecureURL('index/edit_details');
$this->data['update'] = $this->html->getSecureURL('listing_grid/user/update_field', '&id=' . $this->user->getId());
$form = new AForm('HS');
$form->setForm(array('form_name' => 'editFrm', 'update' => $this->data['update']));
$this->data['form']['id'] = 'editFrm';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'editFrm', 'attr' => 'data-confirm-exit="true"', 'action' => $this->data['action']));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_save'), 'style' => 'button3'));
foreach ($fields as $f) {
$this->data['form']['fields'][$f] = $form->getFieldHtml(array('type' => 'input', 'name' => $f, 'value' => $this->data[$f], 'required' => true));
}
$this->data['form']['fields']['password'] = $form->getFieldHtml(array('type' => 'passwordset', 'name' => 'password', 'value' => $this->data['password']));
$this->view->batchAssign($this->data);
$this->processTemplate('pages/index/edit_details.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例13: main
public function main()
{
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$order_id = $this->session->data['order_id'];
$description = 'Order #' . $order_id;
$order_id .= '#' . time();
$return_url = $this->html->getSecureURL('checkout/success');
$callback_url = $this->html->getSecureURL('extension/default_liqpay/callback');
$private_key = $this->config->get('default_liqpay_private_key');
$public_key = $this->config->get('default_liqpay_public_key');
$currency = $order_info['currency'];
if ($currency == 'RUR') {
$currency = 'RUB';
}
$amount = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);
$language = $this->language->getCurrentLanguage();
$language_code = $language['code'] == 'ru' ? 'ru' : 'en';
$fields = array();
$fields['version'] = 3;
$fields['public_key'] = $public_key;
$fields['amount'] = $amount;
$fields['currency'] = $currency;
$fields['description'] = $description;
$fields['order_id'] = $order_id;
$fields['result_url'] = $return_url;
$fields['server_url'] = $callback_url;
$fields['type'] = 'buy';
$fields['pay_way'] = 'card,liqpay';
$fields['language'] = $language_code;
$fields['sandbox'] = (int) $this->config->get('default_liqpay_test_mode');
//data - result of base64_encode( $json_string )
//signature - result of base64_encode( sha1( $private_key . $data . $private_key ) )
$params = array();
$params['data'] = base64_encode(json_encode($fields));
$params['signature'] = base64_encode(sha1($private_key . $params['data'] . $private_key, 1));
$form = new AForm();
$form->setForm(array('form_name' => 'checkout'));
$data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'checkout', 'action' => 'https://www.liqpay.com/api/checkout'));
foreach ($params as $k => $val) {
$data['form']['fields'][$k] = $form->getFieldHtml(array('type' => 'hidden', 'name' => $k, 'value' => $val));
}
$back = $this->request->get['rt'] != 'checkout/guest_step_3' ? $this->html->getSecureURL('checkout/payment') : $this->html->getSecureURL('checkout/guest_step_2');
$data['form']['back'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'back', 'text' => $this->language->get('button_back'), 'style' => 'button', 'href' => $back));
$data['form']['submit'] = $form->getFieldHtml(array('type' => 'submit', 'name' => $this->language->get('button_confirm')));
$this->view->batchAssign($data);
$this->processTemplate('responses/default_liqpay.tpl');
}
示例14: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->html->getSecureURL('account/password');
$this->redirect($this->html->getSecureURL('account/login'));
}
$this->document->setTitle($this->language->get('heading_title'));
if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->_validate()) {
$this->loadModel('account/customer');
$this->model_account_customer->editPassword($this->customer->getLoginName(), $this->request->post['password']);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->html->getSecureURL('account/account'));
}
$this->document->resetBreadcrumbs();
$this->document->addBreadcrumb(array('href' => $this->html->getURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getURL('account/account'), 'text' => $this->language->get('text_account'), 'separator' => $this->language->get('text_separator')));
$this->document->addBreadcrumb(array('href' => $this->html->getURL('account/password'), 'text' => $this->language->get('heading_title'), 'separator' => $this->language->get('text_separator')));
$this->view->assign('error_warning', $this->error['warning']);
$this->view->assign('error_current_password', $this->error['current_password']);
$this->view->assign('error_password', $this->error['password']);
$this->view->assign('error_confirm', $this->error['confirm']);
$form = new AForm();
$form->setForm(array('form_name' => 'PasswordFrm'));
$form_open = $form->getFieldHtml(array('type' => 'form', 'name' => 'PasswordFrm', 'action' => $this->html->getSecureURL('account/password')));
$this->view->assign('form_open', $form_open);
$current_password = $form->getFieldHtml(array('type' => 'password', 'name' => 'current_password', 'value' => '', 'required' => true));
$password = $form->getFieldHtml(array('type' => 'password', 'name' => 'password', 'value' => '', 'required' => true));
$confirm = $form->getFieldHtml(array('type' => 'password', 'name' => 'confirm', 'value' => '', 'required' => true));
$submit = $form->getFieldHtml(array('type' => 'submit', 'name' => $this->language->get('button_continue'), 'icon' => 'icon-check'));
$this->view->assign('current_password', $current_password);
$this->view->assign('password', $password);
$this->view->assign('submit', $submit);
$this->view->assign('confirm', $confirm);
$this->view->assign('back', $this->html->getSecureURL('account/account'));
$back = HtmlElementFactory::create(array('type' => 'button', 'name' => 'back', 'text' => $this->language->get('button_back'), 'icon' => 'icon-arrow-left', 'style' => 'button'));
$this->view->assign('button_back', $back);
$this->processTemplate('pages/account/password.tpl');
//init controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例15: main
public function main()
{
$action = func_get_arg(0);
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->loadLanguage('checkout/payment');
if (!$this->config->get('coupon_status')) {
return null;
}
$this->data['coupon_status'] = $this->config->get('coupon_status');
$entereted_cpn = isset($this->request->post['coupon']) ? $this->request->post['coupon'] : $this->session->data['coupon'];
$form = new AForm();
$form->setForm(array('form_name' => 'coupon'));
$this->data['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'coupon', 'action' => $action));
$this->data['coupon'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'coupon', 'value' => $entereted_cpn));
$this->data['submit'] = $form->getFieldHtml(array('type' => 'submit', 'name' => $this->language->get('button_coupon')));
$this->view->batchAssign($this->data);
$this->processTemplate('blocks/coupon_form.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}