AnsweredAssumed Answered

Download button in popupview

Question asked by karl el escobar on Apr 9, 2019

Hello been trying to add a download function in a button in popup window but its not working. 

im trying to add a download button that downloads a pdf file but when i press the button it doesnt do anything instead i get a blank page.

ive created a file view.popup.php the code is:

<?php

require_once('include/MVC/View/views/view.popup.php');

class FP_PAYMENTSViewPopup extends ViewPopup
{
    public function __construct()
    {
        parent::__construct();
    }

    public function display()
    {

        global $app_strings;
        $id = BeanFactory::getBean('FP_PAYMENTS', $this->bean->id);
        $url = "index.php?module=FP_PAYMENTS&action=generatePaymentsPdf&record={$id}";
        echo parent::display();
        echo <<<PaymentButton
        <input type="button" class="button" style="width: 150px;" href="#" value="Payment Pdf" onmouseover='hiliteItem(this,"yes");'
        onmouseout='unhiliteItem(this);'
        onclick="SUGAR.ajaxUI.loadContent('{$url}')"
        " />
PaymentButton;
    }
}

pls any experts that can help me find what's wrong ? thanks in advance.

Outcomes