/var
/www
/vhosts
/h551219.linp047.arubabusiness.it
/aarteinvernizzi.it
/private
/aarte
/libraries
/Fiere.php
$this->queryBuilder->orderBy('id_fiera', 'DESC');
$records = $this->queryBuilder->get();
$nniArchiviati = $this->queryBuilder->table('v_anni_passati_fiere')->get();
foreach($nniArchiviati as $record) {
$record->isAnno = true;
$record->nome = $record->anno;
$records[] = $record;
}
return $records;
}
/**
* Gets selected fiera
*/
private function getFiera()
{
$this->templateParameters['fiera'] = current($this->queryBuilder->table($this->dbView)->where('slug', $this->routeParameters['fiera'])->get());
$this->templateParameters['itemActions'] = [];
$this->templateParameters['pageTitle'] = $this->templateParameters['fiera']->nome . ' ' .$this->templateParameters['fiera']->anno . ' - ' . $this->translations['frontend']['navigation'][$this->subject];
}
/**
* gets artisti della fiera
*/
protected function getArtistiFiera()
{
return $this->queryBuilder->table('v_fiere_artisti')
->where('slug_fiera', $this->routeParameters['fiera'])
->orderBy('cognome', 'ASC')
->get();
}
/**
* Displays frontend list
*/
protected function execListFrontend()
{
$this->renderTemplate();
}
/var
/www
/vhosts
/h551219.linp047.arubabusiness.it
/aarteinvernizzi.it
/private
/aarte
/libraries
/Fiere.php
$this->queryBuilder->orderBy('id_fiera', 'DESC');
$records = $this->queryBuilder->get();
$nniArchiviati = $this->queryBuilder->table('v_anni_passati_fiere')->get();
foreach($nniArchiviati as $record) {
$record->isAnno = true;
$record->nome = $record->anno;
$records[] = $record;
}
return $records;
}
/**
* Gets selected fiera
*/
private function getFiera()
{
$this->templateParameters['fiera'] = current($this->queryBuilder->table($this->dbView)->where('slug', $this->routeParameters['fiera'])->get());
$this->templateParameters['itemActions'] = [];
$this->templateParameters['pageTitle'] = $this->templateParameters['fiera']->nome . ' ' .$this->templateParameters['fiera']->anno . ' - ' . $this->translations['frontend']['navigation'][$this->subject];
}
/**
* gets artisti della fiera
*/
protected function getArtistiFiera()
{
return $this->queryBuilder->table('v_fiere_artisti')
->where('slug_fiera', $this->routeParameters['fiera'])
->orderBy('cognome', 'ASC')
->get();
}
/**
* Displays frontend list
*/
protected function execListFrontend()
{
$this->renderTemplate();
}
/var
/www
/vhosts
/h551219.linp047.arubabusiness.it
/aarteinvernizzi.it
/private
/aarte
/libraries
/Fiere.php
/**
* Gets selected veduta
*/
private function getVeduta()
{
foreach($this->templateParameters['fiera']->files->vedute as $veduta) {
$id_veduta = $veduta->image_id;
if($id_veduta == $this->routeParameters['imageId']) {
$this->templateParameters['veduta'] = $veduta;
break;
}
}
}
/**
* Displays frontend press
*/
protected function execPress()
{
$this->getFiera();
$this->extractFile($this->templateParameters['fiera'], 'vedute', ['small','full','zoom']);
if(isset($this->routeParameters['imageId'])) {
$this->getVeduta();
}
if(isset($this->routeParameters['imageId'])) {
$num = count($this->templateParameters['fiera']->files->vedute);
for($i=0; $i<$num; $i++) {
if($this->templateParameters['fiera']->files->vedute[$i]->image_id == $this->routeParameters['imageId']) {
$previous = $i == 0 ? ($num - 1) : ($i - 1);
$next = $i == ($num - 1) ? 0 : ($i + 1);
$this->templateParameters['previousItem'] = $this->templateParameters['fiera']->files->vedute[$previous];
$this->templateParameters['nextItem'] = $this->templateParameters['fiera']->files->vedute[$next];
break;
}
}
}
$this->renderTemplate();
}
}
/var
/www
/vhosts
/h551219.linp047.arubabusiness.it
/aarteinvernizzi.it
/private
/aarte
/libraries
/vendor
/phpcraft
/subject
/src
/Subject.php
* @param string $pathToIniFile file path into private/application-name/curent-language/
* @throws InvalidArgumentException if file is not found
**/
public function addApplicationTranslations($key, $pathToIniFile)
{
$path = sprintf('private/%s/locales/%s/%s', $this->application, $this->language, $pathToIniFile);
$this->addTranslations($key, $path);
}
/**
* tries to exec current action
* @throws Exception if there is no method defined to handle action
**/
public function execAction()
{
try {
$this->templateParameters['area'] = $this->area;
$this->templateParameters['areaAuthentication'] = $this->areaAuthentication;
$this->getBackPaths();
$this->{'exec'.ucfirst($this->sanitizeAction($this->action))}();
} catch(Exception $exception) {
throw new Exception(sprintf('no method for handling %s %s %s', $this->area, $this->subject, $this->action));
}
}
/**
* Stores a path to turn back lately
**/
public function execBackPath()
{
$arguments = array(
'backId' => FILTER_SANITIZE_STRING,
'backPath' => array(
'filter' => FILTER_SANITIZE_URL,
'flags' => FILTER_FLAG_PATH_REQUIRED
),
'backLabel' => FILTER_SANITIZE_STRING,
);
$input = filter_input_array(INPUT_POST, $arguments);
$this->cookie->set('backPaths[' . $input['backId'] . '][path]', $input['backPath']);
/var
/www
/vhosts
/h551219.linp047.arubabusiness.it
/aarteinvernizzi.it
/private
/aarte
/libraries
/vendor
/phpcraft
/subject
/src
/SubjectWithCRUD.php
$this->message = $message;
$this->message->setCookie($cookie);
$this->csv = $csv;
$this->dbTable = $dbTable;
$this->dbView = $dbView;
$this->primaryKey = $primaryKey;
$this->postedFieldsDefinition = $postedFieldsDefinition;
$this->exportFields = $exportFields;
}
/**
* Tries to exec current action
*
* @throws Exception if there is no method defined to handle action
**/
public function execAction()
{
$this->templateParameters['primaryKey'] = $this->primaryKey;
$this->templateParameters['sideMenuOpenend'] = $this->isSideMenuOpened();
parent::execAction();
}
/**
* gets list for the table
*
* @param array $fields to be selected
*/
abstract protected function getList($fields = array());
/**
* Displays list table
*/
protected function execList()
{
//get records
$this->templateParameters['records'] = $this->getList();
// form translations
$this->addTranslations('list', sprintf('private/global/locales/%s/list.ini', $this->language));
//render
$this->renderTemplate();
/var
/www
/vhosts
/h551219.linp047.arubabusiness.it
/aarteinvernizzi.it
/private
/aarte
/libraries
/Fiere.php
'action' => 'insertForm',
'label' => $this->translations[$this->area]['operations']['do_insert'] . ' ' . $this->translations[$this->subject]['singular']
]
]);
if(isset($this->routeParameters['key'])) {
$this->templateParameters['key'] = $this->routeParameters['key'];
}
$this->templateParameters['pageTitle'] = $this->translations[$this->subject]['subject_name'];
break;
case 'frontend':
$this->templateParameters['pageTitle'] = $this->translations['frontend']['navigation'][$this->subject];
$this->templateParameters['fiere'] = $this->getListFrontend();
$this->templateParameters['menuItems'] = $this->getFrontendMenuItems();
if(isset($this->routeParameters['fiera'])) {
$this->templateParameters['artisti_esposti'] = $this->getArtistiFiera();
}
$this->checksSubjectItemsMenuState();
break;
}
parent::execAction();
}
/**
* Sets uploadField definitions
* @param array $uploadFieldsDefinitions indexed by field names
**/
protected function setUploadFieldsDefinitions()
{
$uploadFieldsDefinitions = [
'immagine' => [
'validations' => [
[
'type' => 'image',
'options' => [
'allowed' => ['jpg','png'],
],
'message' => $this->translations['form']['upload']['validation_file_images']
]
],
/var
/www
/vhosts
/h551219.linp047.arubabusiness.it
/aarteinvernizzi.it
/private
/aarte
/procedures
/bootstrap.php
if(!in_array(LANGUAGE, $configuration['languages'])) throw new Exception("language not into configured languages");
//load specific area configuration and procedure if needed
if($configuration['areas'][AREA]['configuration']) {
require sprintf('private/%s/configurations/%s.php', APPLICATION, AREA);
}
if($configuration['areas'][AREA]['procedure']) {
require sprintf('private/%s/procedures/%s.php', APPLICATION, AREA);
}
//require subject procedure
$subject = require sprintf('private/%s/procedures/%s/%s.php', APPLICATION, AREA, SUBJECT);
if($subjectHasClass) {
//load specific application and area translations if needed
if($configuration['locale']) {
$subject->addApplicationTranslations('application', 'application.ini');
}
if($configuration['areas'][AREA]['locale']) {
$subject->addApplicationTranslations(AREA, sprintf('%s.ini', AREA));
}
//subject action
$subject->execAction();
}
} else {
}
//output
// set headers
//r($http->response->getHeaders());
foreach ($http->response->getHeaders() as $name => $values) {
foreach ($values as $value) {
@header(sprintf('%s: %s', $name, $value), false);
}
}
//check status code
switch($http->response->getStatusCode()) {
case 200:
break;
default:
@header($_SERVER["SERVER_PROTOCOL"]." " . $http->response->getStatusCode());
break;
}
// output body
/var
/www
/vhosts
/h551219.linp047.arubabusiness.it
/aarteinvernizzi.it
/index.php
<?php
ini_set("display_errors", 1);
error_reporting(E_ALL);
//application name and namesapce
define('APPLICATION','aarte');
define('APPLICATION_NAMESPACE','Aarte');
//bootstrap
require sprintf('private/%s/procedures/bootstrap.php', APPLICATION);