public function GetPagesDataArray($hidden = false) { $pagesData = array(); $mainCounter = 0; $subCounter = 0; $database = Mysql::getConnection(); if ($hidden == false) { $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='0' AND pageShow='1' ORDER BY pagePosition ASC;"); } else { if ($hidden == true) { $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='0' ORDER BY pagePosition ASC;"); } } while ($row = $data->fetch_array()) { $pageId = $row["pageId"]; $parentPage = new Page(); $parentPage->GetInfo($pageId); $pagesData[$mainCounter][$subCounter]["pageId"] = $parentPage->pageId; $pagesData[$mainCounter][$subCounter]["pageTitle"] = $parentPage->pageTitle; $pagesData[$mainCounter][$subCounter]["pageType"] = $parentPage->pageType; $subPageData = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='{$parentPage->pageId}' AND pageShow='1' ORDER BY pagePosition ASC;"); while ($subRow = $subPageData->fetch_array()) { $subPageId = $subRow["pageId"]; $subPage = new Page(); $subPage->GetInfo($subPageId); $subCounter++; $pagesData[$mainCounter][$subCounter]["pageId"] = $subPage->pageId; $pagesData[$mainCounter][$subCounter]["pageTitle"] = $subPage->pageTitle; $pagesData[$mainCounter][$subCounter]["pageType"] = $parentPage->pageType; } $subCounter = 0; $mainCounter++; } return $pagesData; }
public function delete() { if ($this->id != null) { $database = Mysql::getConnection(); $database->Query("DELETE FROM " . TABLE_PREFIX . "m_actualities WHERE id='{$this->id}';"); } }
public function testGetConnectionInactive() { $config = ['host' => 'localhost', 'active' => false]; $object = new Mysql($this->string, $this->dateTime, $config); $logger = $this->getMockForAbstractClass('Magento\\Framework\\DB\\LoggerInterface'); $this->assertNull($object->getConnection($logger)); }
public function Register($userNickname, $userPasswd, $userEmail) { $database = Mysql::getConnection(); $userNickname = $database->handler->real_escape_string($userNickname); $userEmail = $database->handler->real_escape_string($userEmail); $userPasswd = $this->PasswdHash($userPasswd); $database->Query("INSERT INTO " . TABLE_PREFIX . "users VALUES ('', '{$userNickname}', '{$userEmail}', '', '{$userPasswd}');"); }
/** * @return bool */ public function delete() { if ($this->id != "") { $database = Mysql::getConnection(); $database->Query("DELETE FROM " . TABLE_PREFIX . "m_gallery WHERE id='{$this->id}';"); return true; } return false; }
public static function Install($template) { require_once ABS_PATH . '/temp/' . $template . '/install.php'; $database = Mysql::getConnection(); $database->Query("INSERT INTO " . TABLE_PREFIX . "templates VALUES ('', '" . $installData['templateName'] . "', '" . $installData['templateAuthor'] . "', '" . $installData['templateVersion'] . "', '0','" . $installData['templateDescription'] . "');"); $debug = new Debug(); $debug->debugType = 0; $debug->debugMessage = Lang::$langData['installTemplate'] . " (" . $template . ")"; $debug->StartDebug(); }
private function TemplateLoader() { $tempFiles = scandir(ABS_PATH . '/temp/'); for ($i = 2; $i < count($tempFiles); $i++) { $database = Mysql::getConnection(); $query = $database->Query("SELECT * FROM " . TABLE_PREFIX . "templates WHERE templateName='{$tempFiles[$i]}';"); if (!$query->num_rows) { Template::Install($tempFiles[$i]); } } }
/** * @return bool */ public function delete() { if ($this->id != "") { $database = Mysql::getConnection(); $database->Query("DELETE FROM " . TABLE_PREFIX . "m_gallery_pictures WHERE id='{$this->id}';"); if (file_exists(ABS_PATH . "/upload/modules/gallery/" . $this->file)) { unlink(ABS_PATH . "/upload/modules/gallery/" . $this->file); } return true; } return false; }
public function GenerateDataArray() { $database = Mysql::getConnection(); if ($this->onlyVisible) { $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageShow='1' AND pageParent='0' ORDER BY pagePosition ASC;"); } else { $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='0' ORDER BY pagePosition ASC;"); } while ($row = $data->fetch_array()) { $pageId = $row["pageId"]; $parentPage = new Page(); $parentPage->GetInfo($pageId); if ($database->Query("SELECT * FROM " . TABLE_PREFIX . "modules WHERE moduleName='simpleRoutes' AND moduleStatus='1';")->num_rows) { $routeQuery = $database->Query("SELECT routeVal FROM " . TABLE_PREFIX . "m_routes WHERE routeParamGET='p={$parentPage->pageId}';"); while ($rData = $routeQuery->fetch_array()) { $pageRoute = $rData["routeVal"]; } } if (isset($pageRoute)) { $this->menu[$this->mainCounter][$this->subCounter]["pageAddress"] = WEBSITE_ADDRESS . substr($pageRoute, 1); } else { $this->menu[$this->mainCounter][$this->subCounter]["pageAddress"] = "index.php?p=" . $parentPage->pageId; } unset($pageRoute); $this->menu[$this->mainCounter][$this->subCounter]["pageId"] = $parentPage->pageId; $this->menu[$this->mainCounter][$this->subCounter]["pageTitle"] = $parentPage->pageTitle; $subPageData = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='{$parentPage->pageId}' ORDER BY pagePosition ASC;"); while ($subRow = $subPageData->fetch_array()) { $subPageId = $subRow["pageId"]; $subPage = new Page(); $subPage->GetInfo($subPageId); $this->subCounter++; if ($database->Query("SELECT * FROM " . TABLE_PREFIX . "modules WHERE moduleName='simpleRoutes' AND moduleStatus='1';")->num_rows) { $routeQuery = $database->Query("SELECT routeVal FROM " . TABLE_PREFIX . "m_routes WHERE routeParamGET='p={$subPage->pageId}';"); while ($rData = $routeQuery->fetch_array()) { $pageRoute = $rData["routeVal"]; } } if (isset($pageRoute)) { $this->menu[$this->mainCounter][$this->subCounter]["pageAddress"] = WEBSITE_ADDRESS . substr($pageRoute, 1); } else { $this->menu[$this->mainCounter][$this->subCounter]["pageAddress"] = "index.php?p=" . $subPage->pageId; } unset($pageRoute); $this->menu[$this->mainCounter][$this->subCounter]["pageId"] = $subPage->pageId; $this->menu[$this->mainCounter][$this->subCounter]["pageTitle"] = $subPage->pageTitle; } $this->subCounter = 0; $this->mainCounter++; } return $this->menu; }
<?php /* * @author: Tomáš Mičulka * @version: 2.0 * @last_update: 15.4.2014 */ defined('IN_INNE') or die("Acces denied!"); $database = Mysql::getConnection(); $getToken = $_GET["token"]; $user = User::getInstance(); if ($user->userToken == $getToken && $user->userPerm == 5) { $moduleId = $database->handler->real_escape_string($_POST["id"]); $module = new Module(); $module->GetInfo($moduleId); if ($module->moduleStatus == 1) { $module->DisableModule(); } else { $module->EnableModule(); } }
public function DeleteRouteGet($paramGet) { $database = Mysql::getConnection(); //$data = $database->Query("SELECT * FROM ".TABLE_PREFIX."m_routes WHERE routeParamGet='$paramGet';"); $database->Query("DELETE FROM " . TABLE_PREFIX . "m_routes WHERE routeParamGet='{$paramGet}';"); }
public function SaveModule() { $database = Mysql::getConnection(); $database->Query("INSERT INTO " . TABLE_PREFIX . "modules VALUES (''," . " '{$this->moduleName}'," . " '{$this->moduleVersion}'," . " '{$this->moduleAuthor}'," . " '{$this->moduleDescription}'," . " '{$this->moduleType}'," . " '{$this->modulePriority}'," . " '{$this->moduleAutoStart}'," . " '{$this->moduleStatus}'," . " '{$this->moduleStyles}'," . " '{$this->moduleIcon}'," . " '{$this->moduleAdmin}'," . " '{$this->moduleAdminMenu}');"); }
public function LogEntry() { $database = Mysql::getConnection(); $details = json_decode(file_get_contents("http://ipinfo.io/")); $clientIp = $details->ip; $clientCity = $details->city; $clientCountry = $details->country; $date = time(); $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "uniqueclients WHERE clientIp='{$clientIp}' AND clientCity='{$clientCity}' AND clientCountry='{$clientCountry}';"); if ($data->num_rows == 0) { $database->Query("INSERT INTO " . TABLE_PREFIX . "uniqueclients VALUES ('', '{$clientIp}', '{$clientCity}', '{$clientCountry}');"); } $database->Query("INSERT INTO " . TABLE_PREFIX . "visits VALUES ('', '{$date}', '{$clientIp}', '{$clientCity}', '{$clientCountry}');"); }