Overview

Namespaces

  • FlexiPeeHP
    • Bricks
    • ui
  • None
  • Orderer
  • PHP
  • SpojeNet
    • System
      • ui

Classes

  • DatePeriod
  • FlexiPeeHP\Bricks\Convertor
  • FlexiPeeHP\Bricks\Customer
  • FlexiPeeHP\Bricks\HookReciever
  • FlexiPeeHP\Bricks\ParovacFaktur
  • FlexiPeeHP\Bricks\PotvrzeniUhrady
  • FlexiPeeHP\Bricks\Upominac
  • FlexiPeeHP\Bricks\Upominka
  • FlexiPeeHP\Bricks\WebHookHandler
  • FlexiPeeHP\Bricks\XSLT
  • FlexiPeeHP\ui\AdresarForm
  • FlexiPeeHP\ui\CompanyLogo
  • FlexiPeeHP\ui\ConnectionForm
  • FlexiPeeHP\ui\DownloadInvoiceButton
  • FlexiPeeHP\ui\EmbedResponsive
  • FlexiPeeHP\ui\EmbedResponsiveHTML
  • FlexiPeeHP\ui\EmbedResponsivePDF
  • FlexiPeeHP\ui\KontaktForm
  • FlexiPeeHP\ui\OrderListingItem
  • FlexiPeeHP\ui\OrdersListing
  • FlexiPeeHP\ui\RecordTypeSelect
  • FlexiPeeHP\ui\SearchBox
  • FlexiPeeHP\ui\StatusInfoBox
  • SpojeNet\System\ui\VATSwitch

Interfaces

  • Traversable

Functions

  • apiUrlToLink
  • createYearsFrom
  • exchange
  • logOperationResult
  • Orderer\deleteAllBetween
  • parseCmdline
  • SpojeNet\System\operationsMenu
  • Overview
  • Namespace
  • Class
  • Tree
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 
<?php

namespace Orderer;

include_once '../vendor/autoload.php';

$engine = new FlexiBeeEngine(['config' => '../config.json']);

$oPage = new \Ease\TWB\WebPage('HTML');

$embed    = $oPage->getRequestValue('embed');
$id       = $oPage->getRequestValue('id');
$evidence = $oPage->getRequestValue('evidence');

function deleteAllBetween($beginning, $end, $string)
{
    $beginningPos = strpos($string, $beginning);
    $endPos       = strpos($string, $end);
    if ($beginningPos === false || $endPos === false) {
        return $string;
    }

    $textToDelete = substr($string, $beginningPos,
        ($endPos + strlen($end)) - $beginningPos);

    return str_replace($textToDelete, '', $string);
}
$document = new \FlexiPeeHP\FlexiBeeRO(is_numeric($id) ? intval($id) : $id,
    ['evidence' => $evidence]);

if (!is_null($document->getMyKey())) {
    $documentBody = $document->getInFormat('html');

    $documentBody = str_replace(['src="/', 'href="/'],
        ['src="'.$document->url.'/', 'href="'.$document->url.'/'], $documentBody);
    $documentBody = deleteAllBetween('FLEXIBEE:TOOLBAR:START',
        'FLEXIBEE:TOOLBAR:END', $documentBody);

    if ($embed != 'true') {
        header('Content-Description: File Transfer');
        header('Content-Disposition: attachment; filename='.$document->getEvidence().'_'.$document.'.html');
        header('Content-Type: application/octet-stream');
        header('Content-Transfer-Encoding: binary');
    } else {
        header('Content-Type: text/html');
    }
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('Content-Length: '.strlen($documentBody));
    echo $documentBody;
} else {
    die(_('Wrong call'));
}
FlexiPeeHP-Bricks API documentation generated by ApiGen