Exemplo n.º 1
0
 private function getCreditRequests($customer)
 {
     $this->getLoader()->library('Messaging');
     $this->getLoader()->library('Status');
     $addCreditRequests = Messaging::getSystemMessages(array('systemMessageType' => SYS_MSG_ADD_CREDIT, 'filterCustomerId' => array($customer['customer_id']), 'start' => ($this->parameters['creditRequestsPage'] - 1) * 10, 'limit' => 10));
     //        $this->log->write(print_r($addCreditRequests, true));
     foreach ($addCreditRequests as $addCreditRequest) {
         $this->data['requests'][] = array('requestId' => $addCreditRequest['messageId'], 'amount' => $addCreditRequest['data']->amount, 'comment' => $addCreditRequest['data']->comment, 'currency' => $addCreditRequest['data']->currency, 'status' => Status::getStatus($addCreditRequest['data']->status, $this->config->get('language_id'), true), 'statusId' => $addCreditRequest['data']->status, 'timeAdded' => $addCreditRequest['timeAdded']);
     }
     /// Initialize interface
     $this->data['textAmount'] = $this->language->get('AMOUNT');
     $this->data['textComment'] = $this->language->get('COMMENT');
     $this->data['textRequestId'] = $this->language->get('REQUEST_ID');
     $this->data['textStatus'] = $this->language->get('STATUS');
     $this->data['textTimeAdded'] = $this->language->get('TIME_ADDED');
     $pagination = new Pagination();
     $pagination->total = Messaging::getSystemMessagesCount(SYS_MSG_ADD_CREDIT, $customer['customer_id']);
     $pagination->page = $this->parameters['creditRequestsPage'];
     $pagination->limit = 10;
     $pagination->text = $this->language->get('text_pagination');
     $pagination->url = $this->url->link('sale/customer/transaction', 'creditRequestsPage={page}&transactionsPage=' . $this->parameters['transactionsPage'] . '&token=' . $this->parameters['token'] . '&customerId=' . $this->parameters['customerId'], 'SSL');
     $this->data['creditRequestsPagination'] = $pagination->render();
 }