/**
  * function name: paymentRequest
  * @return mixed
  */
 public function paymentRequest($status = '', $page = 1)
 {
     $paymentReq = new PaymentRequestBaseModel();
     $options = array('status' => $status);
     $this->data['status'] = $status;
     $publisher = Input::has('publisher') ? Input::get('publisher') : '';
     $month = Input::has('month') ? Input::get('month') : 0;
     $year = Input::has('year') ? Input::get('year') : 0;
     $field = Input::has('field') ? Input::get('field') : '';
     $order = Input::has('order') ? Input::get('order') : '';
     $options['publisher'] = $publisher;
     $options['month'] = $month;
     $options['year'] = $year;
     $options['field'] = $field;
     $options['order'] = $order;
     $items = $paymentReq->getItems('', ITEM_PER_PAGE, $page, $options);
     $dataPaging['items'] = $items;
     $dataPaging['options'] = array('publisher' => $publisher, 'month' => $month, 'year' => $year, 'field' => $field, 'order' => $order);
     $dataPaging['total'] = $paymentReq->sumAmountPublisher($options);
     if (Request::ajax()) {
         return View::make('publisher_manager.approve_tools_publisher_manager.paymentRequestPaging', $dataPaging);
     } else {
         $this->data['listItems'] = View::make('publisher_manager.approve_tools_publisher_manager.paymentRequestPaging', $dataPaging);
     }
     $this->layout->content = View::make('publisher_manager.approve_tools_publisher_manager.paymentRequest', $this->data);
 }
 /**
  * function name: paymentRequest
  * @return mixed
  */
 public function paymentRequest($page = 1)
 {
     $pubInfo = Sentry::getUser();
     $uid = $pubInfo->id;
     $paymentReq = new PaymentRequestBaseModel();
     $publisher = new PublisherBaseModel();
     $item = $publisher->getItem($uid);
     if (!$item) {
         return Redirect::to($this->moduleURL . 'show-list');
     }
     $this->data['routeExport'] = "ToolsPublisher";
     $options = array();
     if (Request::ajax()) {
         $dataPaging['items'] = $paymentReq->getItems($item->id, ITEM_PER_PAGE, $page)->lists('id', 'amount', 'created_at');
         return Response::json($dataPaging);
     } else {
         $dataPaging['items'] = $paymentReq->getItems($item->id, ITEM_PER_PAGE, $page);
         $this->data['listItems'] = View::make('advertiser_manager.publisher_advertiser_manager.paymentRequestPaging', $dataPaging);
     }
     $this->layout->content = View::make('advertiser_manager.publisher_advertiser_manager.showPaymentRequest', $this->data);
 }