OEModule\OphCoCvi\controllers\DefaultController::actionLabelPDFprint PHP Method

actionLabelPDFprint() public method

public actionLabelPDFprint ( $id )
$id
    public function actionLabelPDFprint($id)
    {
        $firstLabel = (int) $_GET['firstLabel'];
        $labelClass = new LabelManager('labels.odt', realpath(__DIR__ . '/..') . '/views/odtTemplate', \Yii::app()->basePath . '/runtime/cache/cvi', 'labels_' . mt_rand() . '.odt');
        if (!$this->checkLabelPrintAccess()) {
            throw new \CHttpException(404);
        }
        $labelAddress = array($this->demographicsData['address'], $this->demographicsData['gp_address'], $this->demographicsData['la_address']);
        $labelClass->fillLabelsInTable('LabelsTable', $labelAddress, $firstLabel);
        $labelClass->saveContentXML();
        $labelClass->generatePDF();
        $labelClass->getPDF();
    }