1. Go to this page and download the library: Download spojenet/pohoda-sql library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spojenet / pohoda-sql example snippets
$addr = new Adresar(234);
echo $addr->getDataValue('Firma'); // company name
$addr = new Adresar(['ICO' => '69438676']);
echo $addr->getDataValue('Email');
$addr = new Adresar(234, ['database' => 'StwPh_01234567_2020']);
$invoice = new Faktura(1001);
echo $invoice->getDataValue('Cislo'); // document number
echo $invoice->getDataValue('KcCelkem'); // total amount
$lines = new FakturaPolozka();
$rows = $lines->getColumnsFromSQL(['Nazev', 'Mnozstvi', 'KcCena'], ['RefAg' => 1001]);
foreach ($rows as $row) {
echo $row['Nazev'] . ' × ' . $row['Mnozstvi'] . ' = ' . $row['KcCena'] . PHP_EOL;
}
use SpojeNet\PohodaSQL\Agenda;
use SpojeNet\PohodaSQL\DOC;
// Attach a SharePoint link to a bank statement (agenda = Agenda::BANK = 28)
$doc = new DOC();
$doc->setDataValue('RelAgID', Agenda::BANK);
$doc->urlAttachment(
pohodaId: 303, // DOC.RelID – internal Pohoda record ID
url: 'https://sharepoint.example.com/statements/BV2024001.pdf',
name: 'BV2024001.pdf', // display name shown in Pohoda
);
// Attach a link to an issued invoice (agenda = Agenda::ISSUED_INVOICES = 2)
$doc = new DOC();
$doc->setDataValue('RelAgID', Agenda::ISSUED_INVOICES);
$doc->urlAttachment(1001, 'https://portal.example.com/invoice/1001', 'Invoice PDF');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.