Your IP : 127.0.0.1


Current Path : /home/dev2.destoffenstraat.com/app/code/Mrgig/MV/Controller/Adminhtml/Report/
Upload File :
Current File : /home/dev2.destoffenstraat.com/app/code/Mrgig/MV/Controller/Adminhtml/Report/View.php

<?php

namespace Mrgig\MV\Controller\Adminhtml\Report;

class View extends \Magento\Backend\App\Action
{
    protected $_resultPageFactory;

    protected $_coreRegistry = null;

    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\Registry $coreRegistry,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Mrgig\MV\Model\ReportFactory $reportFactory
    ) {
        parent::__construct($context);
        $this->_coreRegistry = $coreRegistry;
        $this->_resultPageFactory = $resultPageFactory;
        $this->reportFactory = $reportFactory;
    }

    public function execute()
    {
        /*$customerId = "169709";
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $apiHelper = $objectManager->get(\Mrgig\MV\Helper\Api::class);
        //$cron1 = $objectManager->get(\Mrgig\MV\Cron\Invoice::class);

        //$apiHelper->getClient($apiHelper->_getApiUrl('get_customer') . $customerId);
        $client = $apiHelper->getClient('https://api.multivers.nl/api/MVL19930/Customer/' . $customerId);

        $response = $apiHelper->_getRequestApi($client);

        $response = $apiHelper->getCustomerById("46802", "60920");
        var_dump($response);
        echo "ff";exit;*/

        $resultRedirect = $this->resultRedirectFactory->create();

        $id = $this->getRequest()->getParam('id');
        $report = $this->reportFactory->create()->load($id);
        if ($report->getId()) {
            $this->_coreRegistry->register('current_report', $report);
            $resultPage = $this->_resultPageFactory->create();
            $resultPage->getConfig()->getTitle()->prepend(__('Report Details'));
            return $resultPage;
        }

        $resultRedirect->setPath('mrgigmv/*/');
        return $resultRedirect;

    }
}