本文整理汇总了PHP中CmsDev\sql\db_Skt类的典型用法代码示例。如果您正苦于以下问题:PHP db_Skt类的具体用法?PHP db_Skt怎么用?PHP db_Skt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了db_Skt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ValidateNameExistAndClean
public static function ValidateNameExistAndClean($string)
{
$UserName = new \CmsDev\util\CheckUserName();
$stringValid = $UserName->Fix($string);
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$user = $SKTDB->get_row("SELECT username FROM users WHERE username = " . \GetSQLValueString($stringValid, 'text') . "");
if ($user) {
return 'exist';
} else {
return $stringValid;
}
}
示例2: Render
private function Render()
{
$SKTDB = SKT_DB\db_Skt::connect();
$Language = \THIS_LANG;
$query = $SKTDB->get_results("SELECT ID,LanguageName,Prefix,URL,SID,Hidden FROM language WHERE Hidden='0' ORDER BY LanguageName ASC");
$counter = $SKTDB->get_var("SELECT count(ID) FROM language");
self::connect($query, $counter);
self::set_Language($Language);
if ($this->counter > 1) {
$Render = $this->Nav_Sub_Items_Before;
foreach ($this->query as $Item) {
if ($this->Language == $Item->Prefix) {
$active = ' class="' . $this->Nav_Class_Item_Selected . '"';
} else {
$active = '';
}
$preitem = $this->item_model;
$item = str_replace('[LanguageName]', $Item->LanguageName, $preitem);
$item = str_replace('[URL]', SKT_URL_BASE . $Item->Prefix . '/', $item);
$item = str_replace('[Prefix]', $Item->Prefix, $item);
$item = str_replace('[activeLang]', $active, $item);
if ($Item->Hidden == 0) {
$Render .= $item;
}
}
$Render .= $this->Nav_Sub_Items_After;
}
return $Render;
}
示例3: __construct
private function __construct()
{
$SKT = SKTGLOBALS::getVar('SKT');
$SKTDB = SKTDB\db_Skt::connect();
$Request = new \CmsDev\Url\Request();
$URLName = $Request->byLevel(0);
$RequestReverse = new \CmsDev\Url\Request();
$RequestReverse->reverse(false);
$testLanguage = $RequestReverse->byLevel(0);
$LanguageArray = $SKT['LANGUAGE']['LIST'];
if (in_array($testLanguage, $LanguageArray)) {
$Language = $testLanguage;
} else {
$Language = \LANGUAGE_DEF;
}
if (\SKT_SECTION_PID != '') {
$ProductsValues = $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "products WHERE ProductID = '" . \SKT_SECTION_PID . "'");
}
$SKTDB->query("SELECT * FROM " . \DB_PREFIX . "products WHERE UID != '0' LIMIT 1");
$query = $SKTDB->get_col_info();
if ($ProductsValues) {
foreach ($query as $name) {
$this->{$name} = $ProductsValues->{$name};
}
} else {
foreach ($query as $name) {
$this->{$name} = '';
}
}
}
示例4: getTableEdit
public static function getTableEdit()
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$Language = \CmsDev\Language\CheckLanguage::get();
$query = $SKTDB->get_row("SELECT AdminParams FROM language WHERE Prefix = '" . $Language . "'");
if ($query->AdminParams != '') {
$params = json_decode($query->AdminParams, true);
if (is_array($params)) {
$HTML = '<table><tr><td>Parametro</td><td>Valor</td></tr>';
foreach ($params as $variable => $value) {
if (!is_array($value)) {
$HTML .= '<tr><td>SKT_ADMIN_' . $variable . '</td><td>' . $value . '</td></tr>';
} else {
$NewvalueToArray = \json_encode($value);
$HTML .= '<tr><td>SKT_ADMIN_' . $variable . '</td><td>' . $NewvalueToArray . '</td></tr>';
}
}
$HTML .= '</table>';
return $HTML;
} else {
$ErrorMessageBox = "Error al cargar las variables de sistema en CmsDev\\Language\\getParams(). Puede existir un json mal formado. Verifique la tabla de lenguaje o consulte al Administrador.";
$MessageBox = SKT_INFO\Asistance::get();
$MessageBox->TipError($ErrorMessageBox, true);
//
//$AdminParams=substr($query->AdminParams,strrpos($query->AdminParams,"\"")-200,200);
//echo "<pre>".$AdminParams."</pre>";
}
} else {
self::setParamsFromFile();
}
}
示例5: __construct
private function __construct()
{
if (!defined('DB_PREFIX')) {
define('DB_PREFIX', 'default_');
}
$SKT = SKTGLOBALS::getVar('SKT');
$SKTDB = SKTDB\db_Skt::connect();
$SectionValues = '';
$ParentSectionValues = '';
$Parent_2_SectionValues = '';
$Parent_3_SectionValues = '';
$Parent_4_SectionValues = '';
$Parent_5_SectionValues = '';
// new \_TemplateSite\clean\Config();
// sections // ID Title URLName SID RecycleBin SystemRequired Language Template Order
$SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE URLName = '" . \SKTURL_Here . "'");
if (isset($SectionValues->SID) && $SectionValues->SID != '') {
$ParentSectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$SectionValues->SID}'");
if (isset($ParentSectionValues->SID) && $ParentSectionValues->SID != '') {
$Parent_2_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$ParentSectionValues->SID}'");
if (isset($Parent_2_SectionValues->SID) && $Parent_2_SectionValues->SID != '') {
$Parent_3_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_2_SectionValues->SID}'");
if (isset($Parent_3_SectionValues->SID) && $Parent_3_SectionValues->SID != '') {
$Parent_4_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_3_SectionValues->SID}'");
if (isset($Parent_4_SectionValues->SID) && $Parent_4_SectionValues->SID != '') {
$Parent_5_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_4_SectionValues->SID}'");
}
}
}
}
}
if (!$SectionValues) {
$SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE Language = '" . \SKT_ThisLaguage . "' AND SID = '0' ");
if (!$SectionValues) {
$SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE SID = '0' AND Language = '" . \SKT_ThisLaguage . "'");
}
if (\SKTURL_Here != '' && \SKTURL_Here != trim(\SKTURL_REQUEST_URI, '/') && !\in_array(\SKTURL_Here, $SKT['LANGUAGE']['LIST']) && !\in_array(\SKTURL_Here, $SKT['SITE']['RESTRICTED_URL'])) {
if (!defined("error")) {
define('error', 'error404');
}
}
}
$IDSections = $SectionValues->ID;
$_SESSION['SessionURLSection'] = $SKTDB->get_var("SELECT URLName FROM " . \DB_PREFIX . "sections WHERE ID = '{$IDSections}'");
if (!defined("SectionHidden")) {
define('SectionHidden', $SectionValues->RecycleBin);
}
$SKTDB->query("SELECT * FROM " . \DB_PREFIX . "sections WHERE SID = '0'");
$query = $SKTDB->get_col_info();
foreach ($query as $name) {
$this->{$name} = $SectionValues->{$name};
}
$this->ParentSectionValues = $ParentSectionValues;
$this->Parent_2_SectionValues = $Parent_2_SectionValues;
$this->Parent_3_SectionValues = $Parent_3_SectionValues;
$this->Parent_4_SectionValues = $Parent_4_SectionValues;
$this->Parent_5_SectionValues = $Parent_5_SectionValues;
}
示例6: getQuery
public static function getQuery($param = null)
{
/* @var $param type */
if ($param) {
$SKTDB = \CmsDev\sql\db_Skt::connect();
$QUERY = "CREATE TABLE `lists` (`ID` int(11) NOT NULL, `ListName` varchar(100) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;\r\n TRUNCATE TABLE `lists`;\r\n INSERT INTO `lists` (`ID`, `ListName`) VALUES (29, 'Demo'),(28, 'Inmuebles');\r\n ALTER TABLE `lists` ADD PRIMARY KEY (`ID`);\r\n ALTER TABLE `lists` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=30;";
$insertLink = $SKTDB->query($QUERY);
}
}
示例7: foreach
function __construct()
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$categories = $SKTDB->get_results("SELECT * FROM " . \DB_PREFIX . "categories");
foreach ($categories as $Category) {
$ListNames[$Category->category_id] = $Category->category_name;
}
self::$names = $ListNames;
}
示例8: setParamsFromFile
private static function setParamsFromFile()
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$query = $SKTDB->get_results("SELECT * FROM language ORDER BY LanguageName ASC");
global $SKT;
foreach ($query as $language) {
include 'site/' . $language->Prefix . '.php';
$Setparams = $SKTDB->query(\sprintf("UPDATE language Set SiteParams = %s\r\n\t\tWHERE ID = %s", GetSQLValueString(json_encode($SKT), "text"), GetSQLValueString($language->ID, "int")));
//$MessageBox = SKT_INFO\Asistance::get();
//$MessageBox->TipOk('El archivo Language/site/' . $language->Prefix . '.php, fue cargado correctamente.', true);
}
//self::getParams();
}
示例9: isset
function __construct($user, $SERVER, $POST, $GET)
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$user = $user;
$url = !empty($SERVER['HTTPS']) ? "https://" . $SERVER['SERVER_NAME'] . $SERVER['REQUEST_URI'] : "http://" . $SERVER['SERVER_NAME'] . $SERVER['REQUEST_URI'];
$previousUrl = isset($SERVER['HTTP_REFERER']) ? $SERVER['HTTP_REFERER'] : '0';
$postData = json_encode($POST);
$now = date("Y-m-d H:i:s");
$product = isset($GET['DetailID']) ? $GET['DetailID'] : '';
$search = isset($GET['SearchQuery']) ? $GET['SearchQuery'] : '';
$query = "INSERT INTO userstep" . "(user, previous_page, url_query_string, post_param, date_time, product, search )" . "VALUES (" . GetSQLValueString($user, 'int') . "," . GetSQLValueString($previousUrl, 'text') . "," . GetSQLValueString($url, 'text') . "," . GetSQLValueString($postData, 'text') . "," . GetSQLValueString($now, 'text') . "," . GetSQLValueString($product, 'int') . "," . GetSQLValueString($search, 'text') . ")";
$insert = $SKTDB->query($query);
}
示例10: set
public function set($PositionSelect = null, $SID = null)
{
if ($PositionSelect !== null && $SID !== null) {
$randomID = 'Position' . \md5(\rand(1000, 99999));
$SID = \GetSQLValueString($SID, 'int');
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$total = $SKTDB->get_var("SELECT count(*) FROM " . \DB_PREFIX . "sections WHERE Language = '" . \THIS_LANG . "' AND SID = '{$SID}'");
if (!isset($PositionSelect) or $PositionSelect == null) {
$PositionSelect = 0;
} elseif ($PositionSelect === 'max') {
$PositionSelect = $total + 1;
}
$this->HTML .= '<input name="Position" id="' . $randomID . '" type="text" value="' . $PositionSelect . '" />';
$this->HTML .= '<script type="text/javascript">';
$this->HTML .= '$("#' . $randomID . '").spinner({step: 1,numberFormat: "n", min: 0, max: ' . ($total + 1) . '});';
//$this->HTML .= 'alert("$total =' . $total . ' y $SID =' . $SID . ' y $PositionSelect =' . $PositionSelect . '");';
$this->HTML .= '</script>';
return $this->HTML;
}
}
示例11: level
private function level($IDPage, $SID)
{
$SKTDB = \CmsDev\sql\db_Skt::connect();
$Menu = $SKTDB->get_results("SELECT ID,Title,URLName,SID,Language FROM " . \DB_PREFIX . "sections WHERE SID = '" . $SID . "' ORDER BY Position ASC");
if ($Menu) {
$this->L++;
foreach ($Menu as $Section) {
if ($Section->ID === $IDPage) {
$selected = ' selected="selected"';
} else {
$selected = '';
}
$this->HTML .= '<option value="' . $Section->ID . '" ' . $selected . ' class="L' . $this->L . '"> ' . utf8_encode($Section->URLName) . '</option>';
if ($SKTDB->get_var("SELECT count(*) FROM " . DB_PREFIX . "sections WHERE SID = '" . $Section->ID . "'") > 0) {
$this->HTML .= self::level($IDPage, $Section->ID);
}
}
$this->L = $this->L - 1;
}
}
示例12: set
public static function set($PositionSelect = null, $IDPage = null, $Zone = 0)
{
if ($PositionSelect !== null && $IDPage !== null) {
$rand = rand(2, 654);
$Input = '<input name="Position" id="Position" class="Position' . $rand . ' form-control" type="text" value="[val]" />';
$IDPage = \GetSQLValueString($IDPage, 'int');
$Zone = \GetSQLValueString($Zone, 'int');
$HTML = '';
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$total = $SKTDB->get_var("SELECT count(*) FROM " . \DB_PREFIX . "content WHERE IDZone = '" . $Zone . "' AND IDPage = '{$IDPage}'");
if (!isset($PositionSelect) or $PositionSelect == null) {
$PositionSelect = 0;
} elseif ($PositionSelect === -1) {
$PositionSelect = $total + 1;
}
$HTML .= str_replace('[val]', $PositionSelect, $Input);
$HTML .= '<script type="text/javascript">';
$HTML .= '$(".Position' . $rand . '").spinner({step: 1,numberFormat: "n", min: 0, max: ' . ($total + 1) . '});';
$HTML .= '</script>';
return $HTML;
}
}
示例13: set
public function set($DisplayOnMenuSel = 1, $Encode = 0)
{
$SKTDB = \CmsDev\sql\db_Skt::connect();
$QueryDisplayOnMenu = $SKTDB->get_results("SELECT * FROM " . \DB_PREFIX . "menu");
$this->HTML = '<select name="DisplayOnMenu">';
foreach ($QueryDisplayOnMenu as $DisplayOnMenu) {
$theName = $DisplayOnMenu->Name;
if ($Encode !== 0) {
$theName = $theName;
}
if ($DisplayOnMenuSel == $DisplayOnMenu->ID) {
$this->HTML .= '<option value="' . $DisplayOnMenu->ID . '" selected="selected">' . \CmsDev\skt_Code::Charset($theName) . '</option>';
} else {
$this->HTML .= '<option value="' . $DisplayOnMenu->ID . '">' . \CmsDev\skt_Code::Charset($theName) . '</option>';
}
$CountTotalOnMenu = $SKTDB->get_var("SELECT count(*) FROM " . \DB_PREFIX . "sections WHERE DisplayOnMenu = '" . $DisplayOnMenu->ID . "' AND SID = '" . \SKT_SECTION_ID . "' AND Language = '" . \THIS_LANG . "'");
$this->ArrayCountOnMenu .= 'CountOnMenu[' . $DisplayOnMenu->ID . '] = ' . $CountTotalOnMenu . ';';
}
$this->HTML .= '</select><script type="text/javascript">';
$this->HTML .= $this->ArrayCountOnMenu;
$this->HTML .= '</script>';
return $this->HTML;
}
示例14: Render
protected static function Render($Type = 'All', $SearchTxt = 'Negocios', $limit = 100)
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$SearchTxt = self::DecodeValue(strtolower($SearchTxt));
$Resultssections = $SKTDB->get_results("SELECT * FROM " . DB_PREFIX . "sections AS sections WHERE \r\n\t( sections.RecycleBin = '0' AND sections.SectionType < '3' AND sections.Title like '%{$SearchTxt}%')\r\n\tOR \r\n\t( sections.RecycleBin = '0' AND sections.SectionType < '3' AND sections.Description like '%{$SearchTxt}%' )\r\n\tOR \r\n\t( sections.RecycleBin = '0' AND sections.SectionType < '3' AND sections.URLName like '%{$SearchTxt}%' )\r\n\tOR \r\n\t( sections.RecycleBin = '0' AND sections.SectionType < '3' AND sections.MetaDataTitle like '%{$SearchTxt}%' )\r\n\tOR \r\n\t( sections.RecycleBin = '0' AND sections.SectionType < '3' AND sections.MetaDataDescription like '%{$SearchTxt}%' )\r\n\tOR \r\n\t( sections.RecycleBin = '0' AND sections.SectionType < '3' AND sections.MetaDataKeywords like '%{$SearchTxt}%' )" . "LIMIT " . $limit . "");
$Resultscontent = $SKTDB->get_results("" . "SELECT content.*,sections.ID, sections.URLName " . "FROM " . DB_PREFIX . "content AS content," . DB_PREFIX . "sections AS sections \r\n WHERE \r\n\t( content.RecycleBin = '0' AND content.Content like '%{$SearchTxt}%' AND content.IDPage = sections.ID )\r\n\tOR \r\n\t( content.RecycleBin = '0' AND content.Description like '%{$SearchTxt}%' AND content.IDPage = sections.ID )" . "LIMIT " . $limit . "");
if (!$Resultssections && !$Resultsproducts && !$Resultscontent) {
//echo 'No se encontraron coincidencias en contenidos para "' . $SearchTxt . '"...';
}
if ($Resultssections) {
echo '<h4>Secciones</h4>';
foreach ($Resultssections as $ResultItem) {
if ($ResultItem->SectionType == 1) {
echo '<li id="listItem_' . $ResultItem->ID . '" class="ui-corner-all">
<a href="' . \SKTURL . $ResultItem->URLName . '" class="ui-corner-all" style="vertical-align:middle;">
<img src="_FileSystems/images/' . $ResultItem->SectionImage . '" alt="" style="vertical-align:middle;" />
' . $ResultItem->Title . '
<span>' . $ResultItem->Description . '</span>
</a>
</li>';
}
}
}
}
示例15: GetHowUse
public static function GetHowUse($IDList = '')
{
global $SKT;
echo '<div class="container_16" style="max-width: none; width: 100%;">';
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$NameList = $SKTDB->get_var("SELECT ListName FROM lists WHERE ID = '{$IDList}'");
if ($NameList) {
$Query_Lists_Values_Count = $SKTDB->get_var("SELECT count(ID) FROM lists_values WHERE IDList = '{$IDList}'");
$Query_Lists_Fields = $SKTDB->get_row("SELECT * FROM lists_fields WHERE IDLists = '{$IDList}'");
echo '<div class="grid_4"><table class="table table-striped">
<caption>La Lista <b>"' . $NameList . '"</b> contiene <b>' . $Query_Lists_Values_Count . '</b> elementos ingresados con los siguientes campos:</caption>
<thead>
<tr>
<th scope="col">Nombre</th>
<th scope="col">Tipo</th>
</tr>
</thead>
<tbody>';
$even = true;
if ($Query_Lists_Fields) {
foreach ($Query_Lists_Fields as $Values) {
if (strstr($Values, '|')) {
$Params = explode("|", $Values);
switch ($Params[0]) {
case 0:
$Type = 'Int';
break;
case 1:
$Type = 'Varchar';
break;
case 2:
$Type = 'Text';
break;
case 3:
$Type = 'Link';
break;
case 4:
$Type = 'Enum';
break;
case 5:
$Type = 'HTML';
break;
case 6:
$Type = 'Date';
break;
case 7:
$Type = 'Basic HTML';
break;
default:
$Type = '';
break;
}
if ($even) {
$evenst = 'even';
} else {
$evenst = 'odd';
}
echo '<tr class="' . $evenst . '"><td>' . $Params[1] . '</td><td>(' . $Type . ')</td></tr>';
if ($even) {
$even = false;
} else {
$even = true;
}
}
}
}
echo '<tr><td colspan="2" style=" font-size: 14px; color: #FF1263;">+ Campos Auto-generados</td></tr>';
echo '<tr class="even"><td>ID</td><td>(int)</td></tr>';
echo '<tr class="odd"><td>IDLists</td><td>(int)</td></tr>';
echo '<tr class="even"><td>RecycleBin</td><td>(enum = \'0\',\'1\')</td></tr>';
echo '<tr class="odd"><td>Position</td><td>(int)</td></tr>';
echo '<tr class="odd"><td>datePost</td><td>(date) Patrón: <b>' . date('Y-m-d') . '</b></td></tr>';
echo '</tbody></table></div>';
echo '<div class="grid_12">';
echo '<h1 style="font-size: 14px; color: #FF1263; line-height: normal; margin: 0 0 10px;">Para obtener los resultados de esta lista cuenta con las siguientes opciones:</h1>';
echo '<h2 style="font-size: 16px; color: #06A7EA; line-height: normal; margin: 0 0 10px;">Mediante Servicio Web:</h2>
<h3 style="font-size: 14px; color: #06A7EA; line-height: normal; margin: 0 0 10px;">Template HTML (Ej.: List Servicios)</h3>';
echo '<pre><code class="php">
<?php
$json = \'_Service_/p/Lists/getJSON/Servicios|ASC|ID|3|null|null\';
$data = file_get_contents($json);
$array = json_decode($data);
?>
<div class="container">
<div class="row">
<?php
foreach ($array as $obj) {
$Titulo = $obj->Titulo;
$Descripcion = $obj->Descripcion;
$icono = $obj->icono;
$Link = $obj->Link;
echo \'<div class="col-md-4">
<span class="fa-stack fa-4x">
\' . $icono . \'
</span>
<h4 class="service-heading">\' . $Titulo . \'</h4>
<p class="text-muted">\' . $Descripcion . \'</p>
<a href="\' . $Link . \'">Ver m&aacute;s+</a>
</div>\';
//.........这里部分代码省略.........