Initial commit

This commit is contained in:
Senad Uka
2018-06-11 11:09:35 +02:00
commit ed7df7b11f
1954 changed files with 483354 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
/**
* Data manipulation for the terms
*/
class TermsModel{
/**
* get html version form terms and conditions
* @return string html string for terms and conditions
*/
public function getTermsHTML($idTerms){
global $database;
$extraSql = intval($idTerms) === 0 ? "ORDER BY id DESC" : "WHERE id=$idTerms";
$sql = "SELECT html, version
FROM ".TABLES['terms']."
$extraSql
LIMIT 1";
$row = $database->fetchResultArray($sql);
return !empty($row) ? $row[0] : [];
}
/**
* get pdf version for terms and conditions
* @return bloob hex for pdf file
*/
public function pdfTerms($idTerms){
global $database;
$extraSql = intval($idTerms) === 0 ? "ORDER BY id DESC" : "WHERE id=$idTerms";
$sql = "SELECT pdf
FROM ".TABLES['terms']."
$extraSql
LIMIT 1";
$pdf = $database->fetchResultArray($sql);
return !empty($pdf) ? $pdf[0]['pdf'] : 'invalid pdf';
}
}