/catalog/controller/affiliate/payment.php
https://github.com/smadi/arabian-land · PHP · 146 lines · 115 code · 31 blank · 0 comment · 25 complexity · 14fe8f061df9c82e482024a3de1fe214 MD5 · raw file
- <?php
- class ControllerAffiliatePayment extends Controller {
- private $error = array();
- public function index() {
- if (!$this->affiliate->isLogged()) {
- $this->session->data['redirect'] = $this->url->link('affiliate/payment', '', 'SSL');
- $this->redirect($this->url->link('affiliate/login', '', 'SSL'));
- }
- $this->language->load('affiliate/payment');
- $this->document->setTitle($this->language->get('heading_title'));
-
- $this->load->model('affiliate/affiliate');
-
- if ($this->request->server['REQUEST_METHOD'] == 'POST') {
- $this->model_affiliate_affiliate->editPayment($this->request->post);
-
- $this->session->data['success'] = $this->language->get('text_success');
- $this->redirect($this->url->link('affiliate/account', '', 'SSL'));
- }
- $this->data['breadcrumbs'] = array();
- $this->data['breadcrumbs'][] = array(
- 'text' => $this->language->get('text_home'),
- 'href' => $this->url->link('common/home'),
- 'separator' => false
- );
- $this->data['breadcrumbs'][] = array(
- 'text' => $this->language->get('text_account'),
- 'href' => $this->url->link('affiliate/account', '', 'SSL'),
- 'separator' => $this->language->get('text_separator')
- );
- $this->data['breadcrumbs'][] = array(
- 'text' => $this->language->get('text_payment'),
- 'href' => $this->url->link('affiliate/payment', '', 'SSL'),
- 'separator' => $this->language->get('text_separator')
- );
-
- $this->data['heading_title'] = $this->language->get('heading_title');
-
- $this->data['text_your_payment'] = $this->language->get('text_your_payment');
- $this->data['text_cheque'] = $this->language->get('text_cheque');
- $this->data['text_paypal'] = $this->language->get('text_paypal');
- $this->data['text_bank'] = $this->language->get('text_bank');
-
- $this->data['entry_tax'] = $this->language->get('entry_tax');
- $this->data['entry_payment'] = $this->language->get('entry_payment');
- $this->data['entry_cheque'] = $this->language->get('entry_cheque');
- $this->data['entry_paypal'] = $this->language->get('entry_paypal');
- $this->data['entry_bank_name'] = $this->language->get('entry_bank_name');
- $this->data['entry_bank_branch_number'] = $this->language->get('entry_bank_branch_number');
- $this->data['entry_bank_swift_code'] = $this->language->get('entry_bank_swift_code');
- $this->data['entry_bank_account_name'] = $this->language->get('entry_bank_account_name');
- $this->data['entry_bank_account_number'] = $this->language->get('entry_bank_account_number');
- $this->data['button_continue'] = $this->language->get('button_continue');
- $this->data['button_back'] = $this->language->get('button_back');
-
- $this->data['action'] = $this->url->link('affiliate/payment', '', 'SSL');
- if ($this->request->server['REQUEST_METHOD'] != 'POST') {
- $affiliate_info = $this->model_affiliate_affiliate->getAffiliate($this->affiliate->getId());
- }
- if (isset($this->request->post['tax'])) {
- $this->data['tax'] = $this->request->post['tax'];
- } else {
- $this->data['tax'] = '';
- }
-
- if (isset($this->request->post['payment'])) {
- $this->data['payment'] = $this->request->post['payment'];
- } else {
- $this->data['payment'] = 'cheque';
- }
- if (isset($this->request->post['cheque'])) {
- $this->data['cheque'] = $this->request->post['cheque'];
- } else {
- $this->data['cheque'] = '';
- }
- if (isset($this->request->post['paypal'])) {
- $this->data['paypal'] = $this->request->post['paypal'];
- } else {
- $this->data['paypal'] = '';
- }
- if (isset($this->request->post['bank_name'])) {
- $this->data['bank_name'] = $this->request->post['bank_name'];
- } else {
- $this->data['bank_name'] = '';
- }
- if (isset($this->request->post['bank_branch_number'])) {
- $this->data['bank_branch_number'] = $this->request->post['bank_branch_number'];
- } else {
- $this->data['bank_branch_number'] = '';
- }
- if (isset($this->request->post['bank_swift_code'])) {
- $this->data['bank_swift_code'] = $this->request->post['bank_swift_code'];
- } else {
- $this->data['bank_swift_code'] = '';
- }
- if (isset($this->request->post['bank_account_name'])) {
- $this->data['bank_account_name'] = $this->request->post['bank_account_name'];
- } else {
- $this->data['bank_account_name'] = '';
- }
-
- if (isset($this->request->post['bank_account_number'])) {
- $this->data['bank_account_number'] = $this->request->post['bank_account_number'];
- } else {
- $this->data['bank_account_number'] = '';
- }
-
- $this->data['back'] = $this->url->link('affiliate/account', '', 'SSL');
- if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/affiliate/payment.tpl')) {
- $this->template = $this->config->get('config_template') . '/template/affiliate/payment.tpl';
- } else {
- $this->template = 'default/template/affiliate/payment.tpl';
- }
-
- $this->children = array(
- 'common/column_left',
- 'common/column_right',
- 'common/content_top',
- 'common/content_bottom',
- 'common/footer',
- 'common/header'
- );
-
- $this->response->setOutput($this->render());
- }
- }
- ?>