Beispiel #1
0
 public function showPdf($user)
 {
     $schoolyear = $this->_loanHelper->schbasPreparationSchoolyearGet();
     $booksToLoan = $this->_loanHelper->loanBooksOfUserGet($user, ['schoolyear' => $schoolyear, 'includeAlreadyLend' => true]);
     $booksToBuy = $this->_loanHelper->selfboughtBooksOfUserGet($user, $schoolyear);
     $booksLend = $this->_loanHelper->lendBooksOfUserGet($user);
     $letterDate = date('d.m.Y H:i');
     $this->_smarty->assign('schoolyear', $schoolyear);
     $this->_smarty->assign('user', $user);
     $this->_smarty->assign('letterDate', $letterDate);
     $this->_smarty->assign('booksToLoan', $booksToLoan);
     $this->_smarty->assign('booksToBuy', $booksToBuy);
     $this->_smarty->assign('booksLend', $booksLend);
     $html = $this->_smarty->fetch(PATH_SMARTY_TPL . '/pdf/schbas-loan-overview.pdf.tpl');
     $schbasPdf = new \Babesk\Schbas\SchbasPdf($user->getId(), '');
     $schbasPdf->create($html);
     $schbasPdf->output();
 }
Beispiel #2
0
 public function showPdf()
 {
     if (!$this->_gradelevel && !$this->_user) {
         die('Either gradelevel or user has to be set');
     }
     $this->_loanHelper = new \Babesk\Schbas\Loan($this->_dataContainer);
     $settingsRepo = $this->_em->getRepository('DM:SystemGlobalSettings');
     $infoRepo = $this->_em->getRepository('DM:SchbasText');
     $userId = $this->_user ? $this->_user->getId() : 0;
     if (!$this->_gradelevel) {
         $this->_gradelevel = $this->getGradelevelForUser($this->_user);
     }
     $bankAccount = $settingsRepo->findOneByName('bank_details')->getValue();
     $bankData = explode('|', $bankAccount);
     // $letterDateIso = $settingsRepo
     // 	->findOneByName('schbasDateCoverLetter')
     // 	->getValue();
     // $letterDate = date('d.m.Y', strtotime($letterDateIso));
     $letterDate = date('d.m.Y');
     list($feeNormal, $feeReduced) = $this->getFees();
     $books = $this->getBooks();
     $textId = $this->_gradelevel;
     $coverLetter = $infoRepo->findOneByDescription('coverLetter');
     $textOne = $infoRepo->findOneByDescription('textOne' . $textId);
     $textTwo = $infoRepo->findOneByDescription('textTwo' . $textId);
     $textThree = $infoRepo->findOneByDescription('textThree' . $textId);
     $this->_smarty->assign('books', $books);
     $this->_smarty->assign('gradelevel', $this->_gradelevel);
     $this->_smarty->assign('letterDate', $letterDate);
     $this->_smarty->assign('coverLetter', $coverLetter);
     $this->_smarty->assign('textOne', $textOne);
     $this->_smarty->assign('textTwo', $textTwo);
     $this->_smarty->assign('textThree', $textThree);
     $this->_smarty->assign('bankData', $bankData);
     $this->_smarty->assign('feeNormal', $feeNormal);
     $this->_smarty->assign('feeReduced', $feeReduced);
     $html = $this->_smarty->fetch(PATH_SMARTY_TPL . '/pdf/schbas-loan-info.pdf.tpl');
     $schbasPdf = new \Babesk\Schbas\SchbasPdf($userId, $this->_gradelevel);
     $schbasPdf->create($html);
     $schbasPdf->output();
 }
    private function showPdfFT($booklist)
    {
        $title = "<h2 align='center'>Lehrb&uuml;cher f&uuml;r Fach " . $_POST['topic'] . '</h2>';
        $books = '<table border="0" bordercolor="#FFFFFF" style="background-color:#FFFFFF" width="100%" cellpadding="0" cellspacing="1">

		<tr style="font-weight:bold; text-align:center;"><th>Klasse</th><th>Titel</th><th>Verlag</th><th>ISBN-Nr.</th><th>Preis</th></tr>';
        $classAssign = array('5' => '05,56', '6' => '56,06,69,67', '7' => '78,07,69,79,67', '8' => '78,08,69,79,89', '9' => '90,91,09,92,69,79,89', '10' => '90,91,10,92', '11' => '12,92,13', '12' => '12,92,13');
        foreach ($booklist as $book) {
            $classKey = "";
            foreach ($classAssign as $key => $value) {
                if (strpos($value, $book->getClass()) !== false) {
                    $classKey .= $key . "/";
                }
            }
            $classKey = rtrim($classKey, "/");
            $books .= '<tr><td>' . $classKey . '</td><td>' . $book->getTitle() . '</td><td>' . $book->getPublisher() . '</td><td>' . $book->getIsbn() . '</td><td align="right">' . $book->getPrice() . ' &euro;</td></tr>';
        }
        $books .= '</table>';
        $books = str_replace('ä', '&auml;', $books);
        $books = str_replace('é', '&eacute;', $books);
        try {
            $schbasPdf = new \Babesk\Schbas\SchbasPdf("Buchliste_Fach_" . $_POST['topic']);
            $schbasPdf->create($title . $books);
            $schbasPdf->output();
        } catch (Exception $e) {
            $this->_interface->DieError('Konnte das PDF nicht erstellen!');
        }
    }
Beispiel #4
0
    private function showParticipationConfirmation()
    {
        $settingsRepo = $this->_em->getRepository('DM:SystemGlobalSettings');
        $user = $this->_em->find('DM:SystemUsers', $_SESSION['uid']);
        $prepSchoolyear = $this->preparationSchoolyearGet();
        $gradeQuery = $this->_em->createQuery('SELECT g FROM DM:SystemGrades g
			INNER JOIN g.attendances a
				WITH a.schoolyear = :schoolyear AND a.user = :user
		');
        $gradeQuery->setParameter('schoolyear', $prepSchoolyear);
        $gradeQuery->setParameter('user', $user);
        $grade = $gradeQuery->getOneOrNullResult();
        if (!$grade) {
            $this->_interface->dieError('Der Schüler ist nicht im nächsten Schuljahr eingetragen. ' . 'Bitte informieren sie die Schule.');
        }
        // $letterDateIso = $settingsRepo
        // 	->findOneByName('schbasDateCoverLetter')
        // 	->getValue();
        // $letterDate = date('d.m.Y', strtotime($letterDateIso));
        $letterDate = date('d.m.Y');
        $schbasDeadlineTransferIso = $settingsRepo->findOneByName('schbasDeadlineTransfer')->getValue();
        $schbasDeadlineTransfer = date('d.m.Y', strtotime($schbasDeadlineTransferIso));
        $schbasDeadlineClaimIso = $settingsRepo->findOneByName('schbasDeadlineClaim')->getValue();
        $schbasDeadlineClaim = date('d.m.Y', strtotime($schbasDeadlineClaimIso));
        $bankAccount = $settingsRepo->findOneByName('bank_details')->getValue();
        $bankData = explode('|', $bankAccount);
        //get loan fees
        $loanHelper = new \Babesk\Schbas\Loan($this->_dataContainer);
        $fees = $loanHelper->loanPriceOfAllBookAssignmentsForUserCalculate($user);
        list($feeNormal, $feeReduced) = $fees;
        $feedback = '';
        $loanChoice = filter_input(INPUT_POST, 'loanChoice');
        $loanFee = filter_input(INPUT_POST, 'loanFee');
        $siblings = filter_input(INPUT_POST, 'siblings');
        $eb_name = filter_input(INPUT_POST, 'eb_name');
        $eb_vorname = filter_input(INPUT_POST, 'eb_vorname');
        $eb_adress = filter_input(INPUT_POST, 'eb_adress');
        $eb_tel = filter_input(INPUT_POST, 'eb_tel');
        if ($loanChoice == 'noLoan') {
            $feedback = 'nl';
        } else {
            if ($loanFee == 'loanSoli') {
                $feedback = 'ls';
            } else {
                if ($loanFee == 'loanNormal') {
                    $feedback = 'ln';
                } else {
                    if ($loanFee == 'loanReduced') {
                        $feedback = 'lr';
                    }
                }
            }
        }
        $this->_smarty->assign('user', $user);
        $this->_smarty->assign('grade', $grade);
        $this->_smarty->assign('schoolyear', $prepSchoolyear->getLabel());
        $this->_smarty->assign('letterDate', $letterDate);
        $this->_smarty->assign('schbasDeadlineClaim', $schbasDeadlineClaim);
        $this->_smarty->assign('bankData', $bankData);
        $this->_smarty->assign('feeNormal', $feeNormal);
        $this->_smarty->assign('feeReduced', $feeReduced);
        $this->_smarty->assign('loanFee', $loanFee);
        $this->_smarty->assign('siblings', $siblings);
        $this->_smarty->assign('loanChoice', $loanChoice);
        $this->_smarty->assign('parentName', $eb_name);
        $this->_smarty->assign('parentForename', $eb_vorname);
        $this->_smarty->assign('parentAddress', $eb_adress);
        $this->_smarty->assign('parentTelephone', $eb_tel);
        $this->_smarty->assign('schbasDeadlineTransfer', $schbasDeadlineTransfer);
        $content = $this->_smarty->fetch(PATH_SMARTY_TPL . '/pdf/schbas-participation-confirmation.pdf.tpl');
        $schbasPdf = new \Babesk\Schbas\SchbasPdf($user->getId(), $grade->getGradelevel());
        $barcode = $user->getId() . ' ' . $feedback;
        $schbasPdf->create($content, $barcode);
        $schbasPdf->output();
    }