/home/levsistemas/public_html/dev/baseprojects/_core/model/dao/statement.class.php
$this->connection->rolloverTransaction();
throw new SQLException(1, 7, $parsed);
}
$rset = new ResultSet($result);
}elseif(strtolower($GLOBALS['DBCONN']['data']['drive']) == 'postgre'){
if (!($result = pg_query($this->connection->conn_id, $parsed)))
{
$this->connection->rolloverTransaction();
throw new SQLException(1, 7, $parsed);
}
$rset = new ResultSet($result);
}else{
try {
if (!($result = $this->connection->conn_id->query($parsed))){
$this->connection->rolloverTransaction();
throw new SQLException(mysqli_error($this->connection->conn_id), 7, $parsed);
}
} catch (PDOException $e) {
throw new SQLException($e->getMessage(), 7, $parsed);
}
$rset = new ResultSet($result);
}
return $rset;
}
function executeScalar()
{
/home/levsistemas/public_html/dev/baseprojects/_core/model/dao/statement.class.php
$this->connection->rolloverTransaction();
throw new SQLException(1, 7, $parsed);
}
$rset = new ResultSet($result);
}elseif(strtolower($GLOBALS['DBCONN']['data']['drive']) == 'postgre'){
if (!($result = pg_query($this->connection->conn_id, $parsed)))
{
$this->connection->rolloverTransaction();
throw new SQLException(1, 7, $parsed);
}
$rset = new ResultSet($result);
}else{
try {
if (!($result = $this->connection->conn_id->query($parsed))){
$this->connection->rolloverTransaction();
throw new SQLException(mysqli_error($this->connection->conn_id), 7, $parsed);
}
} catch (PDOException $e) {
throw new SQLException($e->getMessage(), 7, $parsed);
}
$rset = new ResultSet($result);
}
return $rset;
}
function executeScalar()
{
/home/levsistemas/public_html/dev/baseprojects/_core/model/basics/flex.class.php
}
protected function dbLoad($arr = array()) {
$conn = new Connection();
$where = "";
foreach ($arr as $var => $value) {
$where .= ($where == '' ? '' : ' AND ') . "" . $var . " = '{$value}'";
}
$fields = "";
foreach ($this->mapper as $var => $type) {
if (strtolower($type) == 'date' && strtolower($GLOBALS['DBCONN']['data']['drive']) == 'oracle') {
$fields .= ",TO_CHAR({$var},'DD/MM/YYYY HH24:MI:SS') as {$var}";
} else
$fields .= ",{$var}";
}
$fields = substr($fields, 1);
$statement = $conn->prepareStatement("SELECT {$fields} FROM {$this->getTableName(true)} WHERE {$where}");
return $statement->executeReader();
}
public function objLoad() {
$arr = array();
foreach ($this->primaryKey as $pk) {
$arr = array_merge($arr, array($pk => $this->params[$pk]));
}
$rs = $this->dbLoad($arr);
if ($rs->numRows() > 0) {
while ($rs->next()) {
foreach ($this->mapper as $var => $type) {
switch ($type) {
case 'int' : $this->set($var, $rs->getInt($var));
break;
case 'number' : $this->set($var, $rs->getNumber($var));
break;
default : $this->set($var, $rs->getString($var));
/home/levsistemas/public_html/dev/baseprojects/_core/model/basics/flex.class.php
foreach ($this->mapper as $var => $type) {
if (strtolower($type) == 'date' && strtolower($GLOBALS['DBCONN']['data']['drive']) == 'oracle') {
$fields .= ",TO_CHAR({$var},'DD/MM/YYYY HH24:MI:SS') as {$var}";
} else
$fields .= ",{$var}";
}
$fields = substr($fields, 1);
$statement = $conn->prepareStatement("SELECT {$fields} FROM {$this->getTableName(true)} WHERE {$where}");
return $statement->executeReader();
}
public function objLoad() {
$arr = array();
foreach ($this->primaryKey as $pk) {
$arr = array_merge($arr, array($pk => $this->params[$pk]));
}
$rs = $this->dbLoad($arr);
if ($rs->numRows() > 0) {
while ($rs->next()) {
foreach ($this->mapper as $var => $type) {
switch ($type) {
case 'int' : $this->set($var, $rs->getInt($var));
break;
case 'number' : $this->set($var, $rs->getNumber($var));
break;
default : $this->set($var, $rs->getString($var));
break;
}
}
$this->persisted = true;
}
}
}
public function getExtraTab() {
/home/levsistemas/public_html/dev/baseprojects/_core/model/basics/flex.class.php
$classe = get_called_class();
$obj = $classe::load($id);
$tam = 'tam'.ucfirst($nmImage);
Image::deleteImage($classe::$$tam, $id, $obj->getTableName(), $obj->get($nmImage));
$obj->set($nmImage, '');
$obj->save();
unset($obj);
}
public static function deleteFile($id, $nmFile='file'){
$classe = get_called_class();
$obj = $classe::load($id);
File::deleteFile($id, $obj->getTableName(), $obj->get($nmFile));
unset($obj);
}
public static function load($id) {
$classe = get_called_class();
$obj = new $classe(array($id));
$obj->objLoad();
return $obj;
}
public static function loadBy($by, $val){
$classe = get_called_class();
$obj = new $classe();
$rs = self::search([
's' => implode(',', $obj->getPK()),
'w' => "`{$by}` = '{$val}'",
'l' => '0,1'
]);
if(!$rs->next()){
return $obj;
}
return self::load($rs->getInt($obj->getPK()[0]));
}
/home/levsistemas/public_html/dev/baseprojects/_core/view/site/module.blog.php
echo isset($view['gallery']) ? '
<script>
function showGallery(index){
blueimp.Gallery(' . $view['gallery'] . ').slide(index,0);
}
</script>
' : '';
} ?>
<?php } ?>
<?php
$rs = Publicacao::search([
's' => 'id',
'w' => 'ativo = 1 AND id <>' . $id,
]);
$view['publicacoes'] = array();
while ($rs->next()) {
$view['publicacoes'][] = Publicacao::load($rs->getInt('id'));
}
if (count($view['publicacoes']) > 0) { ?>
<section class="posts wrapper-sm bg-light">
<div class="container">
<h2 class="h1 text-primary fw-bold mb-4 mb-xxl-5" data-aos="fade">Blog</h2>
<div id="publicacoes">
</div>
</div>
</section>
<?php } ?>
/home/levsistemas/public_html/dev/baseprojects/_core/view/site/index.php
<?=(isset($view['json-ld']) && count($view['json-ld']) > 0 ? '<script type="application/ld+json">
'.json_encode($view['json-ld']).'
</script>' :'')?>
<?php if(isset($view['og'])) foreach($view['og'] as $k => $v) echo '<meta property="og:'.$k.'" content="'.Utils::replace('/\s+/', ' ', $v).'" />'.PHP_EOL; ?>
<link href="<?=__PATH__?>css/framework.min.css?v=<?=filemtime($defaultPath.'css/framework.min.css')?>" rel="stylesheet">
<?php if(file_exists($defaultPath.'css/style.css')){ ?>
<link href="<?=__PATH__?>css/style.css?v=<?=filemtime($defaultPath.'css/style.css')?>" rel="stylesheet">
<?php } ?>
<?=str_replace('#NONCE#', $HashNonce, html_entity_decode($Config->get('head-scripts'), ENT_QUOTES, $GLOBALS['Charset']))?>
</head>
<body class="<?= $view['page_class'] ?>">
<?php
include("header.php");
include dirname(__FILE__) . "/module." . $view['module'];
include("footer.php");
if(isset($view['thumbs']) && count($view['thumbs']) > 0){ ?>
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" aria-label="image gallery" aria-modal="true" role="dialog" data-start-slideshow="false" data-filter=":even">
<div class="slides" aria-live="off"></div>
<h3 class="title"> </h3>
<a href="javascript:;" class="prev" aria-controls="blueimp-gallery" aria-label="Anterior" aria-keyshortcuts="ArrowLeft"></a>
<a href="javascript:;" class="next" aria-controls="blueimp-gallery" aria-label="Próximo" aria-keyshortcuts="ArrowRight"></a>
<a href="javascript:;" class="close" aria-controls="blueimp-gallery" aria-label="Fechar" aria-keyshortcuts="Escape"></a>
<a href="javascript:;" class="play-pause" aria-controls="blueimp-gallery" aria-label="Play" aria-keyshortcuts="Space" aria-pressed="true" role="button" ></a>
<ol class="indicator"></ol>
</div>
<?php } ?>
<script nonce="<?=$HashNonce?>">
const __PATH__ = '<?= __PATH__ ?>';
const __BASEPATH__ = '<?= __BASEPATH__ ?>';
</script>
/home/levsistemas/public_html/dev/baseprojects/_core/bootstrap.php
$pUrl = explode('/',$url);
if(array_key_exists($pUrl[0], $predefinedPath)){
define("__PATH__", $serverPath.$predefinedPath[$pUrl[0]]['path']);
$folderPath = $predefinedPath[$pUrl[0]]['folder'];
$pagePath = $predefinedPath[$pUrl[0]]['path'];
}else{
define("__PATH__", $serverPath);
$folderPath = $predefinedPath['']['folder'];
$pagePath = $predefinedPath['']['path'];
}
define("__BASEPATH__", $serverPath);
$param = $pagePath != '' ? Utils::replace("#^{$pagePath}?#i",'', $url) : $url;
$request = new Request($param);
$conn = new Connection();
$Config = new Config();
require $cPath.$folderPath.'core.php';
require $vPath.$folderPath.'index.php';
$conn->closeConnection();
/home/levsistemas/public_html/dev/baseprojects/index.php
<?php
global $defaultPath;
$defaultPath = __DIR__."/";
require $defaultPath.'_core/bootstrap.php';