/home/www/apollonia.hu/apollonia_app/vendor/envms/fluentpdo/src/Queries/Base.php
if ($this->result === false) {
$error = $this->fluent->getPdo()->errorInfo();
$this->message = "SQLSTATE: {$error[0]} - Driver Code: {$error[1]} - Message: {$error[2]}";
if ($this->fluent->exceptionOnError === true) {
throw new Exception($this->message);
}
}
}
/**
* @param array $parameters
* @param int $startTime
* @param int $execTime
*
* @throws Exception
*/
private function executeQuery($parameters, $startTime, $execTime): void
{
if ($this->result->execute($parameters) === true) {
$this->executionTime = microtime(true) - $execTime;
$this->totalTime = microtime(true) - $startTime;
} else {
$error = $this->result->errorInfo();
$this->message = "SQLSTATE: {$error[0]} - Driver Code: {$error[1]} - Message: {$error[2]}";
if ($this->fluent->exceptionOnError === true) {
throw new Exception($this->message);
}
$this->result = false;
}
}
/**
* @param PDOStatement $result
*/
private function setObjectFetchMode(PDOStatement $result): void
{
if ($this->object !== false) {
Arguments
"SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'apollonia_2024.treatments_names.tr_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"
/home/www/apollonia.hu/apollonia_app/vendor/envms/fluentpdo/src/Queries/Base.php
if ($this->result === false) {
$error = $this->fluent->getPdo()->errorInfo();
$this->message = "SQLSTATE: {$error[0]} - Driver Code: {$error[1]} - Message: {$error[2]}";
if ($this->fluent->exceptionOnError === true) {
throw new Exception($this->message);
}
}
}
/**
* @param array $parameters
* @param int $startTime
* @param int $execTime
*
* @throws Exception
*/
private function executeQuery($parameters, $startTime, $execTime): void
{
if ($this->result->execute($parameters) === true) {
$this->executionTime = microtime(true) - $execTime;
$this->totalTime = microtime(true) - $startTime;
} else {
$error = $this->result->errorInfo();
$this->message = "SQLSTATE: {$error[0]} - Driver Code: {$error[1]} - Message: {$error[2]}";
if ($this->fluent->exceptionOnError === true) {
throw new Exception($this->message);
}
$this->result = false;
}
}
/**
* @param PDOStatement $result
*/
private function setObjectFetchMode(PDOStatement $result): void
{
if ($this->object !== false) {
/home/www/apollonia.hu/apollonia_app/vendor/envms/fluentpdo/src/Queries/Base.php
*
* @return PDOStatement
*
* @throws Exception
*/
public function execute()
{
$startTime = microtime(true);
$query = $this->buildQuery();
$parameters = $this->buildParameters();
$this->prepareQuery($query);
if ($this->result !== false) {
$this->setObjectFetchMode($this->result);
$execTime = microtime(true);
$this->executeQuery($parameters, $startTime, $execTime);
$this->debug();
}
return $this->result;
}
/**
* @return Structure
*/
protected function getStructure(): Structure
{
return $this->fluent->getStructure();
}
/**
* Get PDOStatement result
*
* @return ?PDOStatement
*/
public function getResult(): ?PDOStatement
/home/www/apollonia.hu/apollonia_app/vendor/envms/fluentpdo/src/Queries/Select.php
* @throws Exception
*
* @return array|bool - fetched rows
*/
public function fetchAll($index = '', $selectOnly = '')
{
$indexAsArray = strpos($index, '[]');
if ($indexAsArray !== false) {
$index = str_replace('[]', '', $index);
}
if ($selectOnly) {
$this->select($index . ', ' . $selectOnly, true);
}
if ($index) {
return $this->buildSelectData($index, $indexAsArray);
} else {
if (($result = $this->execute()) !== false) {
if ($this->fluent->convertRead === true) {
return Utilities::stringToNumeric($result, $result->fetchAll());
} else {
return $result->fetchAll();
}
}
return false;
}
}
/**
* \Countable interface doesn't break current select query
*
* @throws Exception
*
* @return int
*/
public function count()
{
/home/www/apollonia.hu/apollonia_app/core/database/QueryBuilder.php
public function select($fields=null) {
$this->instance = $this->instance->select($fields);
return $this;
}
public function limit($limit=null,$offset=null) {
if ($offset) {
$this->instance = $this->instance->limit($limit)->offset($offset);
} else {
$this->instance = $this->instance->limit($limit);
}
return $this;
}
public function offset($offset=null) {
$this->instance = $this->instance->offset($offset);
return $this;
}
public function fetchAll() {
return $this->instance->fetchAll();
}
public function getQuery() {
return $this->instance->getQuery();
}
}
/home/www/apollonia.hu/apollonia_app/core/database/Scheme.php
$query = $query->leftJoin("{$this->translatable} ON {$this->translatable}.{$this->table}_id = $this->table.{$this->primary_key}");
$query = $query->groupBy("{$this->primary_key}");
}
foreach ($arr as $key => $value) {
$query = $query->where($key, $value);
}
foreach ($orderby as $value) {
$query = $query->orderBy([$value]);
}
if ($limit) {
if (is_array($limit)) {
$query = $query->limit($limit[0], $limit[1]);
} else {
$query = $query->limit($limit);
}
}
$lines = $query->fetchAll();
if (app('Config')->get('debug')) {
error_log("# SQL QUERY START: " . $query->getQuery());
}
$currs = [];
if ($this->prices) {
$currs = Currency::getAll();
}
$lines = array_map(
function ($line) use ($currs, $select) {
if (logged_in()) {
$line["admin"] = [
"id_field" => $this->getIDField(),
"scheme" => $this->name
];
}
/home/www/apollonia.hu/apollonia_app/app/models/Treatments.php
<?php
namespace app\models;
use core\database\Mysql;
use app\schemes\TreatmentsScheme;
use PDO;
class Treatments extends TreatmentsScheme
{
public static function getPublic()
{
$trs = new Treatments();
$data = $trs->where(["tr_parent_id" => 0,"deleted"=>"no"],["list_order, tr_name"]);
foreach ($data as $key=>$value) {
$value["has_many"]["Treatments"] = self::findByParentID($value["tr_id"]);
$data[$key] = $value;
}
return $data;
}
public static function findByParentID($parent_id) {
$trs = new Treatments();
return $trs->where(["tr_parent_id" => $parent_id,"deleted"=>"no"],["list_order, tr_name"]);
}
public static function findID($id) {
$trs = new Treatments();
return $trs->where(["tr_id" =>$id,"deleted"=>"no"])[0];
}
public static function getKezeles($url)
{
$trs = new Treatments();
$lang = app("Language");
$item = $trs->where(["website_url" => $url, "tr_parent_id" => 0, "lang_id" => $lang->current(),"deleted"=>"no"]);
return isset($item[0]) ? $item[0] : null;
}
/home/www/apollonia.hu/apollonia_app/app/controllers/baseController.php
{
$lang = app("Language");
$isprod = app('Config')->get("environment") === 'production';
View::setVar([
"seo" => [
"website_canonical" => "",
"website_title" => "",
"website_desc" => "",
"website_keyword" => "",
"website_image" => "",
"website_url" => "",
]
]);
$session = app("Session");
View::setVar([
"kezelesek_menu" => Treatments::getPublic(),
"szolgaltatasok_menu" => Services::getPublic(),
"whyus" => WhyUs::getPublic()
]);
if (app('Domain')->defaultLang() != $lang->currentName()) {
redirect("/");
exit;
}
View::setVar(
array(
"domain" => app('Domain')->getUrl(),
"version" => 23,
"page_id" => '',
"session" => $session,
"lang" => $lang->current(),
"lang_name" => $lang->currentName(),
"logged_user" => app('Auth')->getUserData(),
"is_logged" => app('Auth')->logged() == "LOGGED_IN" ? 1 : 0,
"env" => app('Config')->get("environment"),
/home/www/apollonia.hu/apollonia_app/core/http/Route.php
private function saveRoute($method, $route, $opts, $func = null) {
array_push($this->routes, ['method' => $method, 'route' => $route, 'opts' => $opts, 'func' => $func, 'group_opts' => $this->currentgroup_middleware]);
// app("Error")->print("Duplikált elérés", "$path | $method többször van felvéve", array("ellenőrízd az /app/routes.php fájlban"));
// exit();
}
private function beforeLoad() {
$beforeload = array("app\controllers\baseController", "beforeRouteLoad");
if (!class_exists($beforeload[0])) {
app("Error")->print("$class nem találhato", null, array("ellenőrízd, hogy a $folder.$class megtalálható", "helyesen van megadva a class név", "helyesen van megadva a namespace"));
exit;
}
if (method_exists($beforeload[0], $beforeload[1])) {
$inintedclass = dic("app\controllers\baseController");
$inintedclass->beforeRouteLoad($this->params);
}
}
private function afterLoad() {
$beforeload = array("app\controllers\baseController", "afterRouteLoad");
if (!class_exists($beforeload[0])) {
app("Error")->print("$class nem találhato", null, array("ellenőrízd, hogy a $folder.$class megtalálható", "helyesen van megadva a class név", "helyesen van megadva a namespace"));
exit;
}
if (method_exists($beforeload[0], $beforeload[1])) {
$inintedclass = dic("app\controllers\baseController");
$inintedclass->afterRouteLoad($this->params);
}
}
public function dispatch() {
foreach ($this->routes as $route) {
/home/www/apollonia.hu/apollonia_app/core/http/Route.php
$this->urlfound = true;
$middlewares = array();
if (is_array($opts)) {
$middlewares = array_merge($opts, $middlewares);
} else {
$func = $opts;
}
if (is_array($group_opts)) {
$middlewares = array_merge($group_opts, $middlewares);
}
if (count($middlewares) > 0) {
$this->middlewares($middlewares);
}
$this->beforeLoad();
if (is_callable($func)) {
View::setJsVar(["current_route" => join("/", $route)]);
call_user_func_array($func, $this->params);
} else {
$class = explode('@', $func)[0];
$function = explode('@', $func)[1];
$folder = "app\controllers\\";
$action = array($folder . $class, $function);
$beforeaction = array($folder . $class, "beforeLoad");
if (!class_exists($beforeaction[0])) {
app("Error")->print("$class nem találhato", null, array("ellenőrízd, hogy a $folder.$class megtalálható", "helyesen van megadva a class név", "helyesen van megadva a namespace"));
exit;
}
if (method_exists(($folder . $class), "beforeLoad")) {
call_user_func_array($beforeaction, $this->params);
/home/www/apollonia.hu/apollonia_app/core/http/Route.php
}
}
private function afterLoad() {
$beforeload = array("app\controllers\baseController", "afterRouteLoad");
if (!class_exists($beforeload[0])) {
app("Error")->print("$class nem találhato", null, array("ellenőrízd, hogy a $folder.$class megtalálható", "helyesen van megadva a class név", "helyesen van megadva a namespace"));
exit;
}
if (method_exists($beforeload[0], $beforeload[1])) {
$inintedclass = dic("app\controllers\baseController");
$inintedclass->afterRouteLoad($this->params);
}
}
public function dispatch() {
foreach ($this->routes as $route) {
$this->doRoute($route["method"], $route["route"], $route["opts"], $route["func"], $route["group_opts"]);
}
if (!$this->urlfound) {
$this->beforeLoad();
View::notfound();
} else {
$this->afterLoad();
}
}
private function doRoute($method, $route, $opts, $func = null, $group_opts = null) {
if (($_SERVER['REQUEST_METHOD'] == $method || $method == "ALL") && !$this->urlfound) {
$route = $this->urlDiffs($route);
if ($this->url == $route) {
$this->urlfound = true;
/home/www/apollonia.hu/public_html/index.php
<?php
require_once __DIR__ . "/../apollonia_app/bootstrap.php";
$app = \core\system\Container::getInstance();
$app->setProviders($app_config["providers"]);
$app->singleton('core\http\Route', function () {
return new core\http\Route($_SERVER["REQUEST_URI"]);
});
$Route = $app->load('core\http\Route');
require_once CORE_DIR . "system/CoreRoutes.php";
require_once APP_DIR . "routes.php";
$Route->dispatch();