3v4l.org

run code in 300+ PHP versions simultaneously
<?php // ------------------------------------------------------------------------------------------------- // posbirame vsechna prijata data z formulare (../kalkulace.php) - doplnit if isset // info o zakazce $oid = $_GET['offerIdNo']; $of = $_GET['offerName']; $ev = $_GET['eventName']; $arsum = $_GET['summaryArea']; // ucastnik - dodavatel $supName = $_GET['supplierName']; $supAddr = $_GET['supplierAddress']; $supTel = $_GET['supplierTelContact']; $supEmail = $_GET['supplierEmail']; $supIco = $_GET['supplierIco']; $supDic = $_GET['supplierDic']; $supNote = $_GET['supplierNotes']; // ucastnik - klient $clName = $_GET['clientName']; $clAddr = $_GET['clientAddress']; $clTel = $_GET['clientTelContact']; $clEmail = $_GET['clientEmail']; $clIco = $_GET['clientIco']; $clDic = $_GET['clientDic']; $clNote = $_GET['clientNotes']; // polozky jednotlivych sekci // material polozka $matn = $_GET['materialItemName']; $matup = $_GET['materialUnitPrice']; $matq = $_GET['materialItemQuantity']; $matut = $_GET['materialUnitType']; $matic = $_GET['materialItemCoeff']; $matipnv = $_GET['materialItemPriceNoVat']; $mativ = $_GET['materialItemVat']; $matisv = $_GET['materialItemSumVat']; $matipiv = $_GET['materialPriceInVat']; // montazni prace polozka $servn = $_GET['serviceItemName']; $servup = $_GET['serviceUnitPrice']; $servq = $_GET['serviceItemQuantity']; $servut = $_GET['serviceUnitType']; $servic = $_GET['serviceItemCoeff']; $servipnv = $_GET['serviceItemPriceNoVat']; $serviv = $_GET['serviceItemVat']; $servisv = $_GET['serviceItemSumVat']; $servipiv = $_GET['servicePriceInVat']; // vedlejsi rozpoctove naklady polozka $ocn = $_GET['otherCostsItemName']; $ocup = $_GET['otherCostsUnitPrice']; $ocq = $_GET['otherCostsItemQuantity']; $ocut = $_GET['otherCostsUnitType']; $ocic = $_GET['otherCostsItemCoeff']; $ocipnv = $_GET['otherCostsItemPriceNoVat']; $ociv = $_GET['otherCostsItemVat']; $ocisv = $_GET['otherCostsItemSumVat']; $ocipiv = $_GET['otherCostsPriceInVat']; // celkove sumy sekci bez a vcetne DPH $matAllNoVat = $_GET['materialAllPriceNoVat']; $matAllVat = $_GET['materialAllPriceVat']; $matAllInVat = $_GET['materialAllPriceInVat']; $servAllNoVat = $_GET['serviceAllPriceNoVat']; $servAllVat = $_GET['serviceAllPriceVat']; $servAllInVat = $_GET['serviceAllPriceInVat']; $ocAllNoVat = $_GET['otherCostsPriceNoVat']; $ocAllVat = $_GET['otherCostsPriceVat']; $ocAllInVat = $_GET['otherCostsPriceInVat']; // celkovy rozpocet bez a vcetne DPH $totBudNoVat = $_GET['totalBudgetValueNoVat']; $totBudSVat = $_GET['totalBudgetSumVat']; $totBudInVat = $_GET['totalBudgetValueInVat']; // ------------------------------------------------------------------------------------------------- // pripojime knihovnu tcpdf, s jejiz pomoci budeme vykreslovani ovladat, je doporuceno require_once require_once('tcpdf.php'); // ------------------------------------------------------------------------------------------------- // tridy class pdf extends TCPDF { // hlavicka + funkce pozadi stranky public function Header() { // ziskame aktualni sirku, $bMargin = $this->getBreakMargin(); // automaticky radkujeme, $auto_page_break = $this->AutoPageBreak; // automaticke odsazeni nechceme. $this->SetAutoPageBreak(false, 0); // vlozime soubor s pozadim stranky, $pozadi_uvod = 'body.jpg'; // roztahneme tento obrazek na celou obrazovku $this->Image($pozadi_uvod, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0); } } // ------------------------------------------------------------------------------------------------- // vytvorime novy pdf dokument a prednastavime vlastnosti jako orientace, format A4, kodovani atd. $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator('Patrik Sokol'); $pdf->SetAuthor('SUKUP parkety'); $pdf->SetTitle('Cenova nabidka c. '.$oid); $pdf->SetSubject($of.' - '.$ev); // nastavime okraje $pdf->SetMargins(10, 10, 10); $pdf->SetHeaderMargin(0); $pdf->SetFooterMargin(0); // vratime se k nastaveni automatickeho odsazeni $pdf->SetAutoPageBreak(false, PDF_MARGIN_BOTTOM); // nastavime meritko (velikost) obrazku $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // ------------------------------------------------------------------------------------------------- // nastaveni hlavniho fontu $pdf->SetFont('dejavusans', '', 12); $pdf->SetMargins(20,40); // ************************************************************************************************* // A ZACINAME UVODNI STRANKOU... // pridame novou stranku $pdf->AddPage(); // uvodni informace $uvod = '<span stroke="0.7" fill="true" strokecolor="rgb(89,67,32)" color="white" style="font-weight:bold;font-size:42pt;text-align:center;margin-bottom:100px;">'.$of.'</span><br /><br /><br /><br /><br /> <span stroke="0.5" fill="true" strokecolor="white" color="rgb(0,67,0)" style="font-weight:bold;font-size:32pt;text-align:center;">'.$ev.'</span><br /><br /><br /><br /><br /> <span style="text-align:center">celkova vymera podlahovych ploch:</span> <span style="font-size:32pt;color:maroon;">'.$arsum.'</span> <span style="text-align:center">m<sup>2</sup></span><br /><br /><br /><br /><br />'; $pdf->writeHTML($uvod, true, false, true, false, ''); // zucastneni - dodavatel a klient $ucastnici = '<table style="width:100%;text-align:center;" cellpadding="5"> <tr> <th></th> <th style="font-weight:bold;text-decoration:underline;">Dodavatel:</th> <th style="font-weight:bold;text-decoration:underline;">Objednatel:</th> </tr> <tr> <td style="font-style:italic;font-size:10pt;">jmeno:</td> <td>'.$supName.'</td> <td>'.$clName.'</td> </tr> <tr> <td style="font-style:italic;font-size:10pt;">adresa/sidlo:</td> <td>'.$supAddr.'</td> <td>'.$clAddr.'</td> </tr> <tr> <td style="font-style:italic;font-size:10pt;">tel. kontakt:</td> <td>'.$supTel.'</td> <td>'.$clTel.'</td> </tr> <tr> <td style="font-style:italic;font-size:10pt;">email:</td> <td>'.$supEmail.'</td> <td>'.$clEmail.'</td> </tr> <tr> <td style="font-style:italic;font-size:10pt;">ICO:</td> <td>'.$supIco.'</td> <td>'.$clIco.'</td> </tr> <tr> <td style="font-style:italic;font-size:10pt;">DIC:</td> <td>'.$supDic.'</td> <td>'.$clDic.'</td> </tr> <tr> <td style="font-style:italic;font-size:10pt;">poznamka:</td> <td>'.$supNote.'</td> <td>'.$clNote.'</td> </tr> </table>'; $pdf->writeHTML($ucastnici, true, false, true, false, ''); // ************************************************************************************************* // POKRACUJE VYPIS MATERIALOVYCH POLOZEK $pdf->AddPage(); $pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); // nadpis material $material_uvod = '<span style="font-weight:bold;font-size:28pt;">Rozpis materialu na zakazku:</span>'; $pdf->writeHTML($material_uvod, true, false, true, false, ''); $material_table_ths = '<table><tr><th>nazev</th><th>jedn.cena</th><th>mnozstvi</th><th>jednotka</th><th>koeficient</th></tr><tr><th>celkem bez dph</th><th>dph sazba</th><th>celkem dph</th><th>celkem s dph</th>'; $pdf->writeHTML($material_table_ths, true, false, true, false, ''); $material_vypis_dat = ''; foreach( $matn as $key => $matn ) { $material_vypis_dat = "<table><tr><td>". $matn."</td><td>". $matup[$key]."</td><td>". $matq[$key]."</td><td>". $matut[$key]."</td><td>". $matic[$key]."</td></tr><tr><td>". $matipnv[$key]."</td><td>". $mativ[$key]."</td><td>". $matisv[$key]."</td><td>". $matipiv[$key]."</td></tr></table> <br />"; } $pdf->writeHTML($material_vypis_dat, true, false, true, false, ''); $material_konec = '<span style="font-weight:bold;">konec</span>'; $pdf->writeHTML($material_konec, true, false, true, false, ''); // ************************************************************************************************* // POKRACUJE VYPIS MONTAZNICH PRACI // nadpis montazni prace $montaze_uvod = '<span style="font-weight:bold;font-size:28pt;">Montazni prace spojene se zakazkou:</span>'; $pdf->writeHTML($montaze_uvod, true, false, true, false, ''); $montaze_vypis_dat = ''; foreach( $servn as $key => $servn ) { $montaze_vypis_dat .= "Nazev ".$servn. "Jednotkova cena ".$servup[$key]. "Mnozstvi ".$servq[$key]. "Jednotka ".$servut[$key]. "Koeficient ".$servic[$key]. "Celkem bez DPH ".$servipnv[$key]. "DPH sazba ".$serviv[$key]. "DPH celkem ".$servisv[$key]. "Celkem s DPH ".$servipiv[$key]. "<br /><br />"; } $pdf->writeHTML($montaze_vypis_dat, true, false, true, false, ''); // ************************************************************************************************* // POKRACUJE VYPIS VRN // nadpis vedlejsi rozpoctove naklady $vrn_uvod = '<span style="font-weight:bold;font-size:28pt;">Vedlejsi rozpoctove naklady:</span>'; $pdf->writeHTML($vrn_uvod, true, false, true, false, ''); $vedlejsi_naklady_vypis_dat = ''; foreach( $ocn as $key => $ocn ) { $vedlejsi_naklady_vypis_dat .= "Nazev ".$ocn. "Jednotkova cena ".$ocup[$key]. "Mnozstvi ".$ocq[$key]. "Jednotka ".$ocut[$key]. "Koeficient ".$ocic[$key]. "Celkem bez DPH ".$ocipnv[$key]. "DPH sazba ".$ociv[$key]. "DPH celkem ".$ocisv[$key]. "Celkem s DPH ".$ocipiv[$key]. "<br /><br />"; } $pdf->writeHTML($vedlejsi_naklady_vypis_dat, true, false, true, false, ''); // ************************************************************************************************* // BLIZIME SE KE KONCI, BUDEME VYPLNOVAT SUMY CELKOVEHO ROZPOCTU // pridame stranku $pdf->AddPage(); $finishing = '<table style="width:100%;text-align:center;" cellpadding="5"> <tr> <th></th> <th style="font-weight:bold;text-decoration:underline;">bez DPH:</th> <th></th> <th style="font-weight:bold;text-decoration:underline;">DPH:</th> <th></th> <th style="font-weight:bold;text-decoration:underline;">vc. DPH:</th> <th></th> </tr> <tr> <td style="font-style:italic;font-size:10pt;">material:</td> <td>'.$matAllNoVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> <td>'.$matAlVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> <td>'.$matAllInVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> </tr> <tr> <td style="font-style:italic;font-size:10pt;">montazni prace:</td> <td>'.$servAllNoVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> <td>'.$servAllVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> <td>'.$servAllInVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> </tr> <tr> <td style="font-style:italic;font-size:10pt;">vedlejsi rozpoctove naklady:</td> <td>'.$obcAllNoVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> <td>'.$obcAllVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> <td>'.$obcAllInVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> </tr> </table> <table style="width:100%;text-align:center;font-size:24pt;border-top:1px solid;" cellpadding="5"> <tr> <td style="font-style:italic;font-size:10pt;">celkovy rozpocet:</td> <td>'.$totBudNoVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> <td>'.$totBudSVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> <td>'.$totBudInVat.'</td> <td style="font-style:italic;font-size:10pt;">,- kc</td> </tr> </table>'; $pdf->writeHTML($finishing, true, false, true, false, ''); // ------------------------------------------------------------------------------------------------- // ------------------------------------------------------------------------------------------------- // na samotny zaver si zvolime nazev souboru .pdf, jeho umisteni a zpusob jeho generace (manualne, automaticky, atd). Urcite lze take vytvorit emailovou sablonu, ktera se zasle automaticky $pdf->Output('cenova-nabidka-'.$_POST['offerIdNo'].'.pdf', 'I'); /* NEJAKE NAPOVEDY A POMOCNICI, TEST, SCRIPT, atd... */ /* ?OUTPUT I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF. D: send to the browser and force a file download with the name given by name. F: save to a local server file with the name given by name. S: return the document as a string (name is ignored). FI: equivalent to F + I option FD: equivalent to F + D option E: return the document as base64 mime multi-part email attachment (RFC 2045)*/ /* ?IMAGE image - source, x, y, w, h, type, link, align, resize, dpi, palign, ismask, imgmask, border*/
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "offerIdNo" in /in/3Fd7E on line 7 Warning: Undefined array key "offerName" in /in/3Fd7E on line 8 Warning: Undefined array key "eventName" in /in/3Fd7E on line 9 Warning: Undefined array key "summaryArea" in /in/3Fd7E on line 10 Warning: Undefined array key "supplierName" in /in/3Fd7E on line 12 Warning: Undefined array key "supplierAddress" in /in/3Fd7E on line 13 Warning: Undefined array key "supplierTelContact" in /in/3Fd7E on line 14 Warning: Undefined array key "supplierEmail" in /in/3Fd7E on line 15 Warning: Undefined array key "supplierIco" in /in/3Fd7E on line 16 Warning: Undefined array key "supplierDic" in /in/3Fd7E on line 17 Warning: Undefined array key "supplierNotes" in /in/3Fd7E on line 18 Warning: Undefined array key "clientName" in /in/3Fd7E on line 20 Warning: Undefined array key "clientAddress" in /in/3Fd7E on line 21 Warning: Undefined array key "clientTelContact" in /in/3Fd7E on line 22 Warning: Undefined array key "clientEmail" in /in/3Fd7E on line 23 Warning: Undefined array key "clientIco" in /in/3Fd7E on line 24 Warning: Undefined array key "clientDic" in /in/3Fd7E on line 25 Warning: Undefined array key "clientNotes" in /in/3Fd7E on line 26 Warning: Undefined array key "materialItemName" in /in/3Fd7E on line 29 Warning: Undefined array key "materialUnitPrice" in /in/3Fd7E on line 30 Warning: Undefined array key "materialItemQuantity" in /in/3Fd7E on line 31 Warning: Undefined array key "materialUnitType" in /in/3Fd7E on line 32 Warning: Undefined array key "materialItemCoeff" in /in/3Fd7E on line 33 Warning: Undefined array key "materialItemPriceNoVat" in /in/3Fd7E on line 34 Warning: Undefined array key "materialItemVat" in /in/3Fd7E on line 35 Warning: Undefined array key "materialItemSumVat" in /in/3Fd7E on line 36 Warning: Undefined array key "materialPriceInVat" in /in/3Fd7E on line 37 Warning: Undefined array key "serviceItemName" in /in/3Fd7E on line 39 Warning: Undefined array key "serviceUnitPrice" in /in/3Fd7E on line 40 Warning: Undefined array key "serviceItemQuantity" in /in/3Fd7E on line 41 Warning: Undefined array key "serviceUnitType" in /in/3Fd7E on line 42 Warning: Undefined array key "serviceItemCoeff" in /in/3Fd7E on line 43 Warning: Undefined array key "serviceItemPriceNoVat" in /in/3Fd7E on line 44 Warning: Undefined array key "serviceItemVat" in /in/3Fd7E on line 45 Warning: Undefined array key "serviceItemSumVat" in /in/3Fd7E on line 46 Warning: Undefined array key "servicePriceInVat" in /in/3Fd7E on line 47 Warning: Undefined array key "otherCostsItemName" in /in/3Fd7E on line 49 Warning: Undefined array key "otherCostsUnitPrice" in /in/3Fd7E on line 50 Warning: Undefined array key "otherCostsItemQuantity" in /in/3Fd7E on line 51 Warning: Undefined array key "otherCostsUnitType" in /in/3Fd7E on line 52 Warning: Undefined array key "otherCostsItemCoeff" in /in/3Fd7E on line 53 Warning: Undefined array key "otherCostsItemPriceNoVat" in /in/3Fd7E on line 54 Warning: Undefined array key "otherCostsItemVat" in /in/3Fd7E on line 55 Warning: Undefined array key "otherCostsItemSumVat" in /in/3Fd7E on line 56 Warning: Undefined array key "otherCostsPriceInVat" in /in/3Fd7E on line 57 Warning: Undefined array key "materialAllPriceNoVat" in /in/3Fd7E on line 59 Warning: Undefined array key "materialAllPriceVat" in /in/3Fd7E on line 60 Warning: Undefined array key "materialAllPriceInVat" in /in/3Fd7E on line 61 Warning: Undefined array key "serviceAllPriceNoVat" in /in/3Fd7E on line 62 Warning: Undefined array key "serviceAllPriceVat" in /in/3Fd7E on line 63 Warning: Undefined array key "serviceAllPriceInVat" in /in/3Fd7E on line 64 Warning: Undefined array key "otherCostsPriceNoVat" in /in/3Fd7E on line 65 Warning: Undefined array key "otherCostsPriceVat" in /in/3Fd7E on line 66 Warning: Undefined array key "otherCostsPriceInVat" in /in/3Fd7E on line 67 Warning: Undefined array key "totalBudgetValueNoVat" in /in/3Fd7E on line 69 Warning: Undefined array key "totalBudgetSumVat" in /in/3Fd7E on line 70 Warning: Undefined array key "totalBudgetValueInVat" in /in/3Fd7E on line 71 Warning: require_once(): open_basedir restriction in effect. File(tcpdf.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/3Fd7E on line 76 Warning: require_once(tcpdf.php): Failed to open stream: Operation not permitted in /in/3Fd7E on line 76 Fatal error: Uncaught Error: Failed opening required 'tcpdf.php' (include_path='.:') in /in/3Fd7E:76 Stack trace: #0 {main} thrown in /in/3Fd7E on line 76
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.46 ms | 409 KiB | 8 Q