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 = "******"");
     if ($user) {
         return 'exist';
     } else {
         return $stringValid;
     }
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 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} = '';
         }
     }
 }
Beispiel #4
0
 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();
     }
 }
Beispiel #5
0
 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;
 }
Beispiel #6
0
 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);
     }
 }
Beispiel #7
0
 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;
 }
Beispiel #8
0
 private function validateMD5($MD5 = 0)
 {
     $SKTDB = SKT_DB::connect();
     $user = $SKTDB->get_row("SELECT * FROM users WHERE md5 = " . \GetSQLValueString($MD5, 'text') . "");
     if ($user) {
         $updateSectionImage = mysql_query(sprintf("UPDATE users Set \r\n\t\t\t\t\t\t\tisactive = %s\r\n\t\t\t\t\t\t\tWHERE md5 = %s", GetSQLValueString(1, "int"), GetSQLValueString($MD5, "text")));
         return true;
     } else {
         $MessageBox = SKT_INFO\Asistance::get();
         $MessageBox->TipError('No se pudo validar el usuario.<br>' . $MD5, true);
         return false;
     }
 }
Beispiel #9
0
 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();
 }
Beispiel #10
0
 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);
 }
Beispiel #11
0
 private static function UserQuery()
 {
     $SKTDB = SKT_DB::connect();
     $USER_EXIST = \CmsDev\Security\loginIntent::action('validateUser');
     if ($USER_EXIST === true) {
         $user_row = $SKTDB->get_row("SELECT *\r\n                    FROM users as user, userprofile as profile \r\n                    WHERE user.md5 = " . \GetSQLValueString($_SESSION['login'], 'text') . " AND profile.IDX = user.id ");
         if ($user_row) {
             return $user_row;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
 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;
     }
 }
Beispiel #13
0
 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 . '">&nbsp;&nbsp;&nbsp;&nbsp;' . 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;
     }
 }
Beispiel #14
0
 public function GetDataSet()
 {
     $SKTDB = SKT_DB::connect();
     $USER_EXIST = \CmsDev\Security\loginIntent::action('validateUser');
     if ($USER_EXIST === true) {
         $user_list = $SKTDB->get_row("SELECT *\r\n                    FROM users as user join userprofile as profile \r\n                    ON user.md5 = " . \GetSQLValueString($_SESSION['login'], 'int') . "\r\n                    WHERE user.id = profile.IDX \r\n            ");
         if ($user_list) {
             $this->user_list = $user_list;
             $this->UserOk = true;
         } else {
             $this->UserOk = false;
             $MessageBox = SKT_INFO\Asistance::get();
             $MessageBox->TipError(\SKT_ADMIN_User_max_attempts . \SKT_ADMIN_User_max_attempts_TXT, true);
         }
     } else {
         $this->UserOk = false;
         $MessageBox = SKT_INFO\Asistance::get();
         $MessageBox->TipError(\SKT_ADMIN_User_max_attempts . \SKT_ADMIN_User_max_attempts_TXT, true);
     }
 }
Beispiel #15
0
 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;
     }
 }
Beispiel #16
0
 public function Render($CC = '', $CCParams = array(), $file = 'Control.php', $location = 0, $CCID = false)
 {
     global $SKT;
     if ($file !== '') {
         $this->file = $file;
     } else {
     }
     $this->file = isset($file) && $file !== '' ? $file : 'Control.php';
     $this->location = isset($location) && $location !== '' ? $location : 0;
     $SKTDB = SKT_DB::connect();
     $this->CC = self::urlResolve($CC);
     if ($this->location === 0) {
         $this->location = \SKTPATH_TemplateSite . 'SKT_Controls' . \DS . $CC . \DS . $this->file;
     }
     $this->location = self::urlResolve($this->location);
     if ($CCID !== false) {
         $contentIDZone = $SKTDB->get_results("SELECT * FROM " . \DB_PREFIX . "content WHERE ID = '" . GetSQLValueString($CCID, "int") . "'");
         $query = $SKTDB->get_col_info($info_type = "name", $col_offset = -1);
         $cols = array();
         foreach ($query as $name) {
             array_push($cols, $name);
         }
         foreach ($contentIDZone as $Zone) {
             $this->TitleZone[$CCID] = \utf8_decode($Zone->Title);
             $this->CSSZone[$CCID] = \utf8_decode($Zone->css_class);
             $this->CustomPropertyZone[$CCID] = \utf8_decode($Zone->CustomProperty);
         }
     }
     if (\is_file($this->location)) {
         include $this->location;
     } else {
         if ($SKT['DEBUG'] === 1) {
             echo '<span style="color:red"><i class="skt-icon-error"></i> "' . $this->CC . '"</span>';
             $MessageBox = SKT_INFO\Asistance::get();
             $MessageBox->TipError('<i class="skt-icon-frown" style="font-size: 2em; vertical-align: sub;"></i> <b>No se encuentra el control</b>: "' . $CC . '" en ' . \LOCAL_DIR . $this->location, true);
         }
     }
 }
Beispiel #17
0
 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;
 }
    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>';
                }
            }
        }
    }
Beispiel #19
0
    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&oacute;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">
                &lt;?php
                    $json = \'_Service_/p/Lists/getJSON/Servicios|ASC|ID|3|null|null\';
                    $data = file_get_contents($json);
                    $array = json_decode($data);
                ?&gt;

                    &lt;div class=&quot;container&quot;&gt;
                        &lt;div class=&quot;row&quot;&gt;
                            &lt;?php
                            foreach ($array as $obj) {
                                $Titulo = $obj-&gt;Titulo;
                                $Descripcion = $obj-&gt;Descripcion;
                                $icono = $obj-&gt;icono;
                                $Link = $obj-&gt;Link;
                                echo \'&lt;div class=&quot;col-md-4&quot;&gt;
                                        &lt;span class=&quot;fa-stack fa-4x&quot;&gt;
                                            \' . $icono . \'
                                        &lt;/span&gt;
                                        &lt;h4 class=&quot;service-heading&quot;&gt;\' . $Titulo . \'&lt;/h4&gt;
                                        &lt;p class=&quot;text-muted&quot;&gt;\' . $Descripcion . \'&lt;/p&gt;
                                        &lt;a href=&quot;\' . $Link . \'&quot;&gt;Ver m&amp;aacute;s+&lt;/a&gt;
                                    &lt;/div&gt;\';
                            }
                            ?&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;

                </code></pre>';
            $json = 'http://localhost:5665/_Service_/p/Lists/getJSON/Demo|ASC|ID|3|null|null';
            $data = file_get_contents($json);
            $array = json_decode($data);
            echo '<div class="container">
                        <div class="row">';
            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>';
            }
            echo '</div>
                    </div>';
            echo '<h2 style="font-size: 16px; color: #06A7EA; line-height: normal; margin: 0 0 10px;">Mediante JQuery (Cliente-Asincr&oacute;nico):</h2>
                <h3 style="font-size: 14px; color: #06A7EA; line-height: normal; margin: 0 0 10px;">Template HTML (Ej.: List Demo)</h3>';
            echo '<pre><code class="xml">
                &lt;!-- HTML del item --&gt;
                &lt;div id="DemoListTemplate" class="display-none"&gt;
                    &lt;div class="Demo"&gt;
                        &lt;div class="Imagen left"&gt;
                            &lt;a href="[URL]"&gt;
                                &lt;img src="[Imagen]" title=""/&gt;
                            &lt;/a&gt;
                        &lt;/div&gt;
                        &lt;div class="Contenido"&gt;
                            &lt;h3&gt;[Titulo]&lt;/h3&gt;
                            &lt;span&gt;[datePost] - ID: [ID]&lt;/span&gt;
                            &lt;p&gt;[Contenido]&lt;/p&gt;
                            &lt;a class="Email" href="mailto:[Email]" title="Contactenos"&gt;[Email]&lt;/a&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;!-- END: HTML del item --&gt;
                
                &lt;div id="DemoList"&gt;&lt;/div&gt;   &lt;!-- Contenedor #DemoList --&gt;
                </code></pre>';
            echo '<h3 style="font-size: 14px; color: #06A7EA; line-height: normal; margin: 0 0 10px;">Script de obtenci&oacute;n de datos</h3>';
            echo '<pre><code data-language="javascript">

    $.ajax({
        dataType: "json",
        /*
        La URL para servicios de listas est&aacute; formada por:
        /_Service_/[PRODUCTION or DEBUG (p,d)]/Lists/[METHOD]/[NAMELIST]|[SORT(ASC,DESC,null)]|[ORDER BY (FIELDNAME,null)]|[LIMIT(int,null)]|[QUERY(WHERE...,null)]|[ID(int,null)]
        */
        url: "/_Service_/p/Lists/getJSON/' . $NameList . '|ASC|datePost|2|null|null",
        cache: true
    }).done(function(data) {
        $.map(data, function(item, index) {
            /* Listamos los valores a reemplazar */
            var reps = {
                "[ID]": item.ID,
                "[IDLists]": item.IDLists,
                "[RecycleBin]": item.RecycleBin,
                "[Position]": item.Position,
                "[datePost]": item.datePost,
                "[Titulo]": item.Titulo,
                "[Contenido]": item.Contenido,
                "[Imagen]": item.Imagen,
                "[URL]": item.Url,
                "[Email]": item.Email
            };
            var itemhtml = $("#DemoListTemplate").html();

            for (var val in reps) {
                itemhtml = itemhtml.split(val).join(reps[val]);
            }
             /* Agregamos los Items al contenedor */
            $("#DemoList").append(itemhtml);

        });

    });

</code></pre>';
            echo '<h3 style="font-size: 14px; color: #06A7EA; line-height: normal; margin: 0 0 10px;">Resultado:</h3>';
            include 'DemoList.php';
            echo '</div><div class="clear"></div>';
            echo '</div>';
        } else {
            echo 'No se encuentra una Lista con el nombre <b>"' . $NameList . '"</b>.<br>';
        }
    }
Beispiel #20
0
 public static function render($IDZone, $NameZone = '', $StyleClass = '')
 {
     $IDZone = static::FixZone($IDZone);
     if ($NameZone === '') {
         $NameZone = static::FixZone($IDZone);
     } else {
         $NameZone = static::FixZone($NameZone);
     }
     $isLogged = SKT_SECURE::action('validateAdmin');
     $SKTDB = SKT_DB::connect();
     $IDSections = \SKT_SECTION_ID;
     $editorCMS = 0;
     $editorcss = "";
     $editorCMS_WrapBefore = "";
     $editorCMS_WrapAfter = "";
     $editorScript_WrapBefore = "";
     $editorScript_WrapAfter = "";
     $total_lock_mod = 0;
     $_SESSION_View_DesignCMS = 0;
     $IDZoneColect = $IDZone . '|' . $NameZone . ',';
     $IDZoneColectObj = \CmsDev\Content\ZoneColect::init();
     $IDZoneColectObj->set($IDZoneColect);
     $DS = DIRECTORY_SEPARATOR;
     if ($isLogged === true) {
         $editorCMS_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper">
     <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all">
         <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a>
             <ul class="">
                 <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '">
                 <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li>
                 <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li>
                 </li><li class="CmsDevEditCMS" rel="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li>
             </ul>
         </div>
     </h3>';
         $editorCMS_WrapAfter = '<div class="clear"></div></div>';
         $editorScript_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper">
     <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all">
         <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a>
             <ul class="">
                 <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"></li>
                 <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li>
                 <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li>
                 <li class="CmsDevEditScript" rel="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li>			
             </ul>
         </div>
     </h3>';
         $editorScript_WrapAfter = '<div class="clear"></div></div>';
         $editorCC_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper">
     <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all">
         <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a>
             <ul class="">
                 <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"></li>
                 <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li>
                 <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li>
                 [FILES] 
                 [CUSTOMIZED]
                 <li class="CmsDevEditCC" rel="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li>
             </ul>
             <form action="" method="post" style="display:none;">
                 <input name="Action" id="Action" type="hidden" value="[Action]" />
                 <input name="ID" type="hidden" value="[ID]" />
                 <input name="IDZone" type="hidden" value="[IDZone]" />
                 <input name="CCFromTemplate" id="CCFromTemplate" type="hidden" value="[CCFromTemplate]" />
                 <textarea name="CustomProperty" id="CustomProperty" />[CustomProperty]</textarea>
             </form>
         </div>
     </h3>';
         $editorCC_WrapAfter = '<div class="clear"></div></div>';
         $editorNote_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper">
     <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all">
         <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a>
             <ul class="">
                 <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"></li>
                 <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li>
                 <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li>
                 <li class="CmsDevEditNote" rel="[ID]" id="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li>
             </ul>
         </div>
     </h3>';
         $editorNote_WrapAfter = '<div class="clear"></div></div>';
         $editorPhoto_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper">
     <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all">
         <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a>
             <ul class="">
                 <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"></li>
                 <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li>
                 <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li>
                 <li class="CmsDevEditPhoto" rel="[ID]" id="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li>
             </ul>
         </div>
     </h3>';
         $editorPhoto_WrapAfter = '<div class="clear"></div></div>';
     }
     if (isset($_POST['View_DesignCMS'])) {
         $_SESSION_View_DesignCMS = $_POST['View_DesignCMS'];
         $_SESSION['View_DesignCMS'] = $_SESSION_View_DesignCMS;
     } else {
         if (isset($_SESSION['View_DesignCMS'])) {
             $_SESSION_View_DesignCMS = $_SESSION['View_DesignCMS'];
         } else {
             $_SESSION_View_DesignCMS = 0;
         }
     }
     if ($isLogged === true) {
         $editorCMS = 1;
         $editorcss = " EditorContainer ui-corner-all EditorActive";
         echo '<div class="ZoneContainer"><h4>' . $NameZone . '</h4></div>';
     }
     $contentIDZoneCount = $SKTDB->get_var("SELECT count(*) FROM " . DB_PREFIX . "content WHERE (IDPage = '{$IDSections}' AND IDZone = '{$IDZone}') OR (IDZone = '{$IDZone}' AND AllPage = '1')");
     if ($contentIDZoneCount >= 1) {
         $contentIDZone = $SKTDB->get_results("SELECT * FROM " . DB_PREFIX . "content WHERE (IDPage = '{$IDSections}' AND IDZone = '{$IDZone}') OR (IDZone = '{$IDZone}' AND AllPage = '1') ORDER BY Position ASC");
         $query = $SKTDB->get_col_info($info_type = "name", $col_offset = -1);
         $cols = array();
         foreach ($query as $name) {
             array_push($cols, $name);
         }
         foreach ($contentIDZone as $Zone) {
             if ($isLogged === true) {
                 $DivWrapBefore = '<div id="E_' . $Zone->ID . '_' . $Zone->IDPage . '_' . $Zone->IDZone . '_' . $Zone->Date . '" rel="' . $Zone->Title . '" class="sktEditorContent ' . $StyleClass . ' ' . $Zone->css_class . '">';
                 if ($Zone->Type == 'html') {
                     $editorSet = $editorCMS_WrapBefore;
                     foreach ($cols as $col) {
                         $editorSet = str_replace('[' . $col . ']', CS::Charset($Zone->{$col}), $editorSet);
                     }
                     $editorSet = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorSet);
                     if ($Zone->RecycleBin == 1) {
                         $editorSet = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorSet);
                         $DivWrapBefore = str_replace("sktEditorContent ", "sktEditorContent SKTRecycled", $DivWrapBefore);
                     }
                     echo $editorSet . $DivWrapBefore;
                     //$Zone->Content = str_replace("[[ZONA]]",LoadMod('CustomArea'.$Zone->ID.$Zone->IDZone),$Zone->Content);
                     echo CS::Charset($Zone->Content);
                     echo '</div>';
                     echo $editorCMS_WrapAfter;
                 }
                 if ($Zone->Type == 'Note') {
                     $editorSet = $editorNote_WrapBefore;
                     if ($Zone->CustomProperty != '') {
                         if (\is_file(\SKTPATH_TemplateSite . $Zone->CustomProperty)) {
                             $NoteTemplate = file_get_contents(\SKTPATH . $Zone->CustomProperty);
                         } elseif (\is_file(\SKTPATH_TemplateSite . $DS . "SKT_Theme_Parts" . $DS . 'Notes' . $DS . $Zone->CustomProperty)) {
                             $NoteTemplate = file_get_contents(\SKTPATH_TemplateSite . $DS . "SKT_Theme_Parts" . $DS . 'Notes' . $DS . $Zone->CustomProperty);
                         }
                     }
                     if ($NoteTemplate != '') {
                         $editorSet .= $NoteTemplate;
                     }
                     foreach ($cols as $col) {
                         $editorSet = str_replace('[' . $col . ']', CS::Charset($Zone->{$col}), $editorSet);
                     }
                     $editorSet = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorSet);
                     if ($Zone->RecycleBin == 1) {
                         $editorSet = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorSet);
                         $DivWrapBefore = str_replace("sktEditorContent ", "sktEditorContent SKTRecycled", $DivWrapBefore);
                     }
                     echo $editorSet . $DivWrapBefore;
                     echo '</div>';
                     echo $editorNote_WrapAfter;
                 }
                 if ($Zone->Type == 'Photo') {
                     $editorSet = $editorPhoto_WrapBefore;
                     foreach ($cols as $col) {
                         $editorSet = str_replace('[' . $col . ']', CS::Charset($Zone->{$col}), $editorSet);
                     }
                     $editorSet = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorSet);
                     if ($Zone->RecycleBin == 1) {
                         $editorSet = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorSet);
                         $DivWrapBefore = str_replace("sktEditorContent ", "sktEditorContent SKTRecycled", $DivWrapBefore);
                     }
                     echo $editorSet . $DivWrapBefore;
                     $fileprop = \SKTPATH_FileSystems . $Zone->CustomProperty;
                     $file = str_replace("/SKTSize/", "", $fileprop);
                     $file = str_replace("/", DIRECTORY_SEPARATOR, $file);
                     $hiperlink = DataTag($file, 'hiperlink');
                     $title = DataTag($file, 'title');
                     $Description = DataTag($file, 'Description');
                     $urlSrc = $Zone->CustomProperty;
                     $ThePhoto = '';
                     if ($hiperlink != '' && $hiperlink != 'null' && $hiperlink != 'undefined') {
                         $ThePhoto .= '<a href="' . $hiperlink . '" title="' . $title . '" target="_blank">';
                         $ThePhoto .= '<img src="' . $urlSrc . '" alt="' . $title . '"  class="img-responsive ' . $StyleClass . '"/><span class="hidden Description">' . $Description . '</span>';
                         $ThePhoto .= '</a>';
                     } else {
                         $ThePhoto .= '<img src="' . $urlSrc . '"  alt="' . $title . '"  class="img-responsive ' . $StyleClass . '"/><span class="hidden Description">' . $Description . '</span>';
                     }
                     if ($Description != '' && $Description != 'null' && $Description != 'undefined') {
                         $ThePhoto = '<figure class="figureDescription">' . $ThePhoto . '</figure>';
                     }
                     echo $ThePhoto;
                     echo '</div>';
                     echo $editorPhoto_WrapAfter;
                 }
                 if ($Zone->Type == 'script') {
                     $editorSet = $editorScript_WrapBefore;
                     foreach ($cols as $col) {
                         $editorSet = str_replace('[' . $col . ']', CS::Charset($Zone->{$col}), $editorSet);
                     }
                     $editorSet = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorSet);
                     if ($Zone->RecycleBin == 1) {
                         $editorSet = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorSet);
                         $DivWrapBefore = str_replace("sktEditorContent ", "sktEditorContent SKTRecycled", $DivWrapBefore);
                     }
                     echo $editorSet . $DivWrapBefore;
                     echo CS::Charset($Zone->Content);
                     echo '</div>';
                     echo $editorScript_WrapAfter;
                 }
                 if ($Zone->Type == 'Anchor') {
                     if ($Zone->RecycleBin == 1) {
                         $editorScript_WrapBefore = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorScript_WrapBefore);
                     }
                     echo str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorScript_WrapBefore) . $DivWrapBefore;
                     echo '<a name="' . CS::Charset($Zone->Content) . '" id="' . CS::Charset($Zone->Content) . '"></a>';
                     echo '</div>';
                     echo $editorScript_WrapAfter;
                 }
                 if ($Zone->Type == 'SKT_Controls') {
                     $editorCCBeforeok_find = array("[TitleZone]", "[Action]", "[CustomProperty]", "[ID]", "[IDZone]", "[CCFromTemplate]");
                     $editorCCBeforeok_replace = array(CS::Charset($Zone->Title), CS::Charset($Zone->Custom), CS::Charset($Zone->CustomProperty), $Zone->ID, $Zone->IDZone, $Zone->CCFromTemplate);
                     $editorCCBeforeRep = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorCC_WrapBefore);
                     $editorCCBeforeok = str_replace($editorCCBeforeok_find, $editorCCBeforeok_replace, $editorCCBeforeRep);
                     if ($Zone->RecycleBin == 1) {
                         $editorCCBeforeok = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorCCBeforeok);
                     }
                     $find = strstr($Zone->Custom, 'File_');
                     $FilesGoTo = '[FILES]';
                     if ($find == true) {
                         $FilesGoTo = '<li class="CmsDevEditFiles" title="' . SKT_ADMIN_Btn_Edit . '"></li>';
                         $editorCCBeforeok = str_replace("CmsDevEditCC", "CmsDevEditCCF", $editorCCBeforeok);
                     }
                     $editorCCBeforeok = str_replace("[FILES]", $FilesGoTo, $editorCCBeforeok);
                     //
                     $find2 = strstr($Zone->Custom, 'Folder_');
                     $FilesGoTo = '';
                     if ($find2 == true) {
                         $FilesGoTo = '<li class="CmsDevEditFiles" title="' . SKT_ADMIN_Btn_Edit . '"></li>';
                         $editorCCBeforeok = str_replace("CmsDevEditCC", "CmsDevEditCCF", $editorCCBeforeok);
                     }
                     $editorCCBeforeok = str_replace("[FILES]", $FilesGoTo, $editorCCBeforeok);
                     //
                     $find3 = strstr($Zone->Custom, 'Customized_');
                     $FilesGoTo = '[CUSTOMIZED]';
                     if ($find3 == true) {
                         $FilesGoTo = '<li class="CmsDevEditCCCustomized" title="' . SKT_ADMIN_Btn_Edit . '"></li>';
                         //$editorCCBeforeok = str_replace("CmsDevEditCC","CmsDevEditCCCustomized",$editorCCBeforeok);
                         $editorCCBeforeok = str_replace("[CUSTOMIZED]", $FilesGoTo, $editorCCBeforeok);
                     }
                     $editorCCBeforeok = str_replace("[CUSTOMIZED]", '', $editorCCBeforeok);
                     //
                     echo $editorCCBeforeok . '<div id="E_' . $Zone->ID . '_' . $Zone->IDPage . '_' . $Zone->IDZone . '_' . $Zone->Date . '" rel="' . $Zone->Title . '" class="SKT_Controls ' . $Zone->css_class . '" ><div class="CustomProperty">' . $Zone->CustomProperty . '</div>';
                     if ($Zone->CCFromTemplate == '') {
                         if (\is_file(\SKTPATH . '/SKT_Controls/' . $Zone->Custom . '/Control.php') && SKT_TEMPLATE_ERROR === '') {
                             include \SKTPATH . '/SKT_Controls/' . $Zone->Custom . '/Control.php';
                         } else {
                             $MessageBox = \CmsDev\Info\Asistance::get();
                             $MessageBox->TipError('No se encuentra el control nativo en: ' . $Zone->Custom . '/Control.php', false);
                             echo 'No se encuentra el control ' . $Zone->Custom;
                         }
                     } else {
                         if (\is_file(\SKTPATH_TemplateSite . '/SKT_Controls/' . $Zone->Custom . '/Control.php') && SKT_TEMPLATE_ERROR === '') {
                             include \SKTPATH_TemplateSite . '/SKT_Controls/' . $Zone->Custom . '/Control.php';
                             //echo "OKIDOKI";
                         } else {
                             $MessageBox = \CmsDev\Info\Asistance::get();
                             $MessageBox->TipError('No se encuentra el control personalizado en: ' . $Zone->CCFromTemplate . $Zone->Custom . '/Control.php', false);
                             echo 'No se encuentra el control personalizado ' . $Zone->Custom;
                         }
                     }
                     echo '</div>';
                     echo $editorCC_WrapAfter;
                 }
             } else {
                 if ($Zone->RecycleBin == 0) {
                     if ($Zone->Type == 'SKT_Controls') {
                         if ($Zone->Title != '') {
                             echo '<h3 class="TitleControl"><span>' . CS::Charset($Zone->Title) . '</span></h3>';
                         }
                         echo '<div class="' . $StyleClass . ' SKT_Controls">';
                         if ($Zone->CCFromTemplate == '') {
                             if (\is_file(\SKTPATH . '/SKT_Controls/' . 'SKT_Controls/' . $Zone->Custom . '/Control.php') && SKT_TEMPLATE_ERROR === '') {
                                 include \SKTPATH . 'SKT_Controls/' . 'SKT_Controls/' . $Zone->Custom . '/Control.php';
                             } else {
                                 $MessageBox = \CmsDev\Info\Asistance::get();
                                 $MessageBox->TipError('No se encuentra el control nativo en: ' . $Zone->CCFromTemplate . $Zone->Custom . '/Control.php', false);
                                 echo 'No se encuentra el control ' . $Zone->Custom;
                             }
                         } else {
                             if (\is_file(\SKTPATH_TemplateSite . 'SKT_Controls/' . $Zone->Custom . '/Control.php') && SKT_TEMPLATE_ERROR === '') {
                                 include \SKTPATH_TemplateSite . 'SKT_Controls/' . $Zone->Custom . '/Control.php';
                             } else {
                                 $MessageBox = \CmsDev\Info\Asistance::get();
                                 $MessageBox->TipError('No se encuentra el control personalizado en: ' . \SKTPATH_TemplateSite . $Zone->Custom . '/Control.php', false);
                                 echo 'No se encuentra el control ' . $Zone->Custom;
                             }
                         }
                         echo '</div>';
                     } elseif ($Zone->Type == 'Anchor') {
                         echo '<h3 class="Anchor EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all"><a name="' . CS::Charset($Zone->Content) . '" id="' . CS::Charset($Zone->Content) . '"></a>' . CS::Charset($Zone->Title) . '<div class="ui-state-default ui-corner-all ScrollTop" onclick="javascript:$.scrollTo(\'#ScrollTop\',800);"><div class="ui-icon ui-icon-circle-arrow-n "></div></div></h3>';
                     } elseif ($Zone->Type == 'Note') {
                         if ($Zone->CustomProperty != '') {
                             $NoteTemplate = file_get_contents($Zone->CustomProperty);
                         }
                         $note_find = array("[Title]", "[Content]", "[Date]", "[Autor]", "[CssClass]");
                         $note_replace = array(CS::Charset($Zone->Title), CS::Charset($Zone->Content), $Zone->Date, CS::Charset($Zone->Autor), CS::Charset($Zone->css_class));
                         $note = str_replace($note_find, $note_replace, $NoteTemplate);
                         echo $note;
                     } elseif ($Zone->Type == 'Photo') {
                         $file = \SKT_URL_BASE . '/' . $Zone->CustomProperty;
                         $file = str_replace("//", "/", $file);
                         $hiperlink = DataTag($file, 'hiperlink');
                         $title = DataTag($file, 'title');
                         $Description = DataTag($file, 'Description');
                         $ThePhoto = '';
                         if ($hiperlink != '' && $hiperlink != 'null' && $hiperlink != 'undefined') {
                             $ThePhoto .= '<a href="' . $hiperlink . '" title="' . $title . '" target="_blank">';
                             $ThePhoto .= '<img src="' . $Zone->CustomProperty . '" alt="' . $title . '"  class="img-responsive ' . $StyleClass . '"/><span class="hidden Description">' . $Description . '</span>';
                             $ThePhoto .= '</a>';
                         } else {
                             $ThePhoto .= '<img src="' . $Zone->CustomProperty . '" alt="' . $title . '"  class="img-responsive ' . $StyleClass . '"/><span class="hidden Description">' . $Description . '</span>';
                         }
                         if ($Description != '' && $Description != 'null' && $Description != 'undefined') {
                             $ThePhoto = '<figure class="figureDescription">' . $ThePhoto . '</figure>';
                         }
                         echo $ThePhoto;
                     } else {
                         if ($Zone->Title != '') {
                             echo '<h3 class="TitleControl"><span>' . CS::Charset($Zone->Title) . '</span></h3>';
                         }
                         echo '<div class="sktEditorContent ' . CS::Charset($Zone->css_class) . '" rel="' . CS::Charset($Zone->Title) . '">' . CS::Charset($Zone->Content) . '</div>';
                     }
                 }
             }
         }
     } else {
     }
     $Zone = '';
 }
Beispiel #21
0
 protected function Remove($ID = '')
 {
     $SKTDB = \CmsDev\Sql\db_Skt::connect();
     $DeleteQuery = $SKTDB->query("DELETE FROM " . \DB_PREFIX . "products WHERE UID = '" . \GetSQLValueString(\str_replace('ID', '', $ID), "int") . "' LIMIT 1");
     if ($DeleteQuery) {
         echo 'ok';
     } else {
         echo \SKT_ADMIN_Message_Update_Error;
     }
 }
Beispiel #22
0
 public function Render($ID = 0)
 {
     $CC = '';
     $SKTDB = \CmsDev\Sql\db_Skt::connect();
     if ($SKT_Controls = $SKTDB->get_row("SELECT Custom FROM " . \DB_PREFIX . "content WHERE ID = '{$ID}'")) {
         $CC = $SKT_Controls->Custom;
     }
     $SelectedIni = '';
     $Select = '<select name="Custom" id="Custom" class="text ui-corner-all" >';
     /* ------------------------------------------------------------------------------------------------- */
     /* ------------------------------    FROM TEMPLATE     --------------------------------------------- */
     $SKTDBTemplate = \LOCAL_DIR . \SKTURL_TemplateSite . '/SKT_Controls/';
     if (file_exists($SKTDBTemplate)) {
         $Select .= '<option value="" disabled="disabled" class="ui-widget-header">From Template</option>';
         $directorio = $SKTDBTemplate;
         if (file_exists($directorio)) {
             $handle = opendir($directorio);
             while ($file = readdir($handle)) {
                 if (!is_dir($file) && $file != ".." && $file != "." && $file != "CustomPropertyURI_for_Files.php") {
                     $Selected = '';
                     $thisCC = $CC;
                     if ($thisCC != 0 || $thisCC != '') {
                         if ($thisCC == $file) {
                             $Selected = 'selected="selected"';
                         } else {
                             $Selected = '';
                         }
                     }
                     $ControlType = '';
                     $find = strstr($file, 'File_');
                     if ($find == true) {
                         $ControlType = 'TypeFiles';
                     }
                     $find2 = strstr($file, 'Folder_');
                     if ($find2 == true) {
                         $ControlType = 'TypeFolder';
                     }
                     $find3 = strstr($file, 'Customized_');
                     if ($find3 == true) {
                         $ControlType = 'Customized';
                     }
                     $fileName = str_replace('File', '', $file);
                     $fileName = str_replace('Folder', '', $fileName);
                     $fileName = str_replace('Customized', '', $fileName);
                     $fileName = str_replace('_', ' ', $fileName);
                     $Select .= '<option class="' . $ControlType . '" ' . $Selected . ' title="' . \SKTURL_TemplateSite . '/SKT_Controls/" value="' . $file . '">' . $fileName . '</option>';
                 }
             }
             closedir($handle);
         }
     }
     /* ------------------------------------------------------------------------------------------------- */
     /* ------------------------------    FROM ROOT     ------------------------------------------------- */
     $directorio = \LOCAL_DIR . 'CmsDev/Modules/';
     if (file_exists($directorio)) {
         $Select .= '<option value="" disabled="disabled" class="ui-widget-header">General</option>';
         $handle = opendir($directorio);
         while ($file = readdir($handle)) {
             if (!is_dir($file) && $file != ".." && $file != "." && $file != "CustomPropertyURI_for_Files.php") {
                 $Selected = '';
                 $thisCC = $CC;
                 if ($thisCC != 0 || $thisCC != '') {
                     if ($thisCC == $file) {
                         $Selected = 'selected="selected"';
                     } else {
                         $Selected = '';
                     }
                 }
                 $ControlType = '';
                 $find = strstr($file, 'File_');
                 if ($find == true) {
                     $ControlType = 'TypeFiles';
                 }
                 $find2 = strstr($file, 'Folder_');
                 if ($find2 == true) {
                     $ControlType = 'TypeFolder';
                 }
                 $find3 = strstr($file, 'Customized_');
                 if ($find3 == true) {
                     $ControlType = 'Customized';
                 }
                 $fileName = str_replace('File_', '', $file);
                 $fileName = str_replace('Folder_', '', $file);
                 $fileName = str_replace('Customized', '', $file);
                 $fileName = str_replace('_', ' ', $fileName);
                 $Select .= '<option class="' . $ControlType . '" ' . $Selected . ' title="" value="' . $file . '">' . $fileName . '</option>';
             }
         }
         closedir($handle);
     }
     $Select .= '</select>';
     return $Select;
 }
Beispiel #23
0
 private static function MakeNewUser($Client = false, $Info = array(), $LevelType = 'Customers')
 {
     $SKTDB = \CmsDev\Sql\db_Skt::connect();
     $new_Google = false;
     $new_Facebook = false;
     $CheckUserName = new \CmsDev\util\CheckUserName();
     $username = Code::Charset(isset($Info['username']) ? $Info['username'] : '');
     $password = md5(isset($Info['password']) ? $Info['password'] : '');
     $email = Code::Charset(isset($Info['email']) ? $Info['email'] : '');
     $isactive = isset($Info['isactive']) ? $Info['isactive'] : 0;
     $activekey = isset($Info['activekey']) ? $Info['activekey'] : 0;
     $resetkey = isset($Info['resetkey']) ? $Info['resetkey'] : 0;
     $cust_no = isset($Info['cust_no']) ? $Info['cust_no'] : 0;
     $md5 = isset($Info['md5']) ? $Info['md5'] : md5($username) . $password;
     $Description = isset($Info['Description']) ? $Info['Description'] : '';
     $Lat = isset($Info['Lat']) ? $Info['Lat'] : '-35';
     $Lon = isset($Info['Lon']) ? $Info['Lon'] : '-54';
     $zoom = isset($Info['zoom']) ? $Info['zoom'] : '12';
     $Type = isset($Info['Type']) ? $Info['Type'] : $LevelType;
     $website = isset($Info['website']) ? $Info['website'] : '';
     $ViewHelp = isset($Info['ViewHelp']) ? $Info['ViewHelp'] : 0;
     $token = isset($Info['token']) ? $Info['token'] : '';
     $Company = isset($Info['Company']) ? $Info['Company'] : $Info["username"];
     $CompanyUrl = isset($Info['CompanyUrl']) ? $Info['CompanyUrl'] : $CheckUserName->Fix($username);
     $Level = isset($Info['level']) ? $Info['level'] : $Type;
     $RUT = isset($Info['RUT']) ? $Info['RUT'] : '';
     $Position = isset($Info['Position']) ? $Info['Position'] : '';
     $Name = isset($Info['Name']) ? $Info['Name'] : '';
     $Surname = isset($Info['Surname']) ? $Info['Surname'] : '';
     $Country = isset($Info['Country']) ? $Info['Country'] : '';
     $City = isset($Info['City']) ? $Info['City'] : '';
     $CP = isset($Info['CP']) ? $Info['CP'] : '';
     $Address = isset($Info['Address']) ? $Info['Address'] : '';
     $From = isset($Info['From']) ? $Info['From'] : '09';
     $To = isset($Info['To']) ? $Info['To'] : '18';
     $Phone = isset($Info['Phone']) ? $Info['Phone'] : '';
     $payment_method = isset($Info['payment_method']) ? $Info['payment_method'] : '';
     $ClientAuth = isset($Info['ClientAuth']) ? $Info['ClientAuth'] : '';
     $ClientAuth_id = isset($Info['ClientAuth_id']) ? $Info['ClientAuth_id'] : '';
     $ClientAuth_link = isset($Info['ClientAuth_link']) ? $Info['ClientAuth_link'] : '';
     $ClientAuth_name = isset($Info['ClientAuth_name']) ? $Info['ClientAuth_name'] : '';
     $ClientAuth_family_name = isset($Info['ClientAuth_family_name']) ? $Info['ClientAuth_family_name'] : '';
     $ClientAuth_given_name = isset($Info['ClientAuth_given_name']) ? $Info['ClientAuth_given_name'] : '';
     $ClientAuth_email = isset($Info['ClientAuth_email']) ? $Info['ClientAuth_email'] : '';
     $ClientAuth_picture = isset($Info['ClientAuth_picture']) ? $Info['ClientAuth_picture'] : '';
     $ClientAuth_locale = isset($Info['ClientAuth_locale']) ? $Info['ClientAuth_locale'] : '';
     $ClientAuth_gender = isset($Info['ClientAuth_gender']) ? $Info['ClientAuth_gender'] : '';
     $category1 = isset($Info['category1']) ? $Info['category1'] : '';
     $category2 = isset($Info['category2']) ? $Info['category2'] : '';
     $category3 = isset($Info['category3']) ? $Info['category3'] : '';
     $category4 = isset($Info['category4']) ? $Info['category4'] : '';
     $category5 = isset($Info['category5']) ? $Info['category5'] : '';
     if ($Client == 'FromGoogle') {
         /* ----------------------------------------------------------------------/// FromGoogle ///-------------- */
         $Name = $Info['name'];
         $Surname = $Info['family_name'];
         $ClientAuth = $Info['ClientAuth'];
         $ClientAuth_id = $Info['id'];
         $ClientAuth_link = $Info['link'];
         $ClientAuth_name = $Info['name'];
         $ClientAuth_family_name = $Info['family_name'];
         $ClientAuth_given_name = $Info['given_name'];
         $ClientAuth_email = $Info['email'];
         $ClientAuth_picture = $Info['picture'];
         $ClientAuth_locale = $Info['locale'];
         $ClientAuth_gender = $Info['gender'];
         $username = Code::Encode($Info['given_name']);
         $password = md5($Info['id']);
         $email = $Info['email'];
         $isactive = 1;
         $md5 = md5($username . $password);
         $Company = $Info['name'];
         $CompanyUrl = $CheckUserName->Fix($Info['name']);
         $Type = 'Customers';
         $user_listQuery = "SELECT *\r\n                    FROM users as user, userprofile as profile\r\n                    WHERE user.id = profile.IDX AND profile.ClientAuth = 'Google' AND profile.ClientAuth_id = " . \GetSQLValueString($Info["id"], 'text') . "";
         $user_list = $SKTDB->get_row($user_listQuery);
         $MessageBox = SKT_INFO\Asistance::get();
         $MessageBox->TipInfo('<b>' . $Name . '.</b><br><pre>' . $user_listQuery . '</pre><pre>' . $user_list->username . '</pre>', false);
         if ($user_list) {
             $_SESSION['UserName'] = $user_list->username;
             $session = md5($user_list->username . $user_list->password);
             $_SESSION['login'] = $session;
             $_SESSION['UserIDU'] = $user_list->id;
             $new_Google = false;
             $header = \SERVER_DIR;
             \CmsDev\Header\refresh::refreshNow(\SITE_SERVER);
             exit;
         } else {
             $new_Google = true;
         }
         /* ------------------------------------------------------------------------------------------------------ */
     } else {
         if ($Client == 'FromFacebook') {
             /* --------------------------------------------------------------------/// FromFacebook ///-------------- */
             /* ------------------------------------------------------------------------------------------------------ */
         } else {
         }
     }
     if ($Client == 'FromSite' || $new_Google == true || $new_Facebook == true) {
         if ($username != '' || !isset($_SESSION['login'])) {
             $test = $SKTDB->get_var("SELECT id FROM users WHERE username = "******"");
             if (!$test) {
                 $insertUserQuery = "INSERT INTO users \r\n                        ( username, password, email, CompanyUrl, isactive, activekey, resetkey, cust_no, Lat, Lon, zoom, md5, Type ) \r\n\t\t\tVALUES (" . GetSQLValueString($username, "text") . "," . GetSQLValueString($password, "text") . "," . GetSQLValueString($email, "text") . "," . GetSQLValueString($CompanyUrl, "text") . "," . GetSQLValueString($isactive, "int") . "," . GetSQLValueString($activekey, "int") . "," . GetSQLValueString($resetkey, "int") . "," . GetSQLValueString($cust_no, "int") . "," . GetSQLValueString($Lat, "text") . "," . GetSQLValueString($Lon, "text") . "," . GetSQLValueString($zoom, "int") . "," . GetSQLValueString($md5, "text") . "," . GetSQLValueString($Type, "text") . ")";
                 $insertUser = $SKTDB->query($insertUserQuery);
                 if ($insertUser) {
                     $FotoPerfil = '';
                     $insertUserID = $SKTDB->insert_id;
                     if (!isset($Info['FotoPerfil']) || $Info['picture'] === '') {
                         $FotoPerfil = \SKT_ACCESS_AVATAR;
                     } else {
                         $FotoPerfil = $Info['FotoPerfil'];
                     }
                     if ($new_Google == true) {
                         $FotoPerfil = $ClientAuth_picture;
                     }
                     $insertProfile = $SKTDB->query("INSERT INTO userprofile \r\n                            (IDX, level, Name, Surname, Company, RUT, Position, Country, City, CP, Address, eFrom, eTo, Phone, payment_method, \r\n                            ClientAuth,ClientAuth_id,ClientAuth_link,ClientAuth_name,ClientAuth_family_name,ClientAuth_given_name,ClientAuth_email,ClientAuth_picture,ClientAuth_locale, ClientAuth_gender)\r\n                            VALUES (" . GetSQLValueString($insertUserID, "int") . "," . GetSQLValueString($Level, "text") . "," . GetSQLValueString(Code::Charset($Name), "text") . "," . GetSQLValueString(Code::Charset($Surname), "text") . "," . GetSQLValueString(Code::Charset($Company), "text") . "," . GetSQLValueString(Code::Charset($RUT), "text") . "," . GetSQLValueString(Code::Charset($Position), "text") . "," . GetSQLValueString(Code::Charset($Country), "text") . "," . GetSQLValueString(Code::Charset($City), "text") . "," . GetSQLValueString(Code::Charset($CP), "text") . "," . GetSQLValueString(Code::Charset($Address), "text") . "," . GetSQLValueString(Code::Charset($From), "text") . "," . GetSQLValueString(Code::Charset($To), "text") . "," . GetSQLValueString(Code::Charset($Phone), "text") . "," . GetSQLValueString(Code::Charset($payment_method), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_id), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_link), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_name), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_family_name), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_given_name), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_email), "text") . "," . GetSQLValueString(Code::Charset($FotoPerfil), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_locale), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_gender), "text") . ")");
                     if ($LevelType == 'Publishers' || $Type == 'Publishers' || $Level == 'Publishers') {
                         $date = date('Y-m-d');
                         $Date_FinishBuild = strtotime('+ 182 day', strtotime($date));
                         $Date_Finish = date('Y-m-d', $Date_FinishBuild);
                         $query = "INSERT INTO user_plan (UID,Limit_Plan,planID,Date_Finish) " . "VALUES (" . GetSQLValueString($insertUserID, "int") . "," . GetSQLValueString("180", "int") . "," . GetSQLValueString("99", "int") . "," . GetSQLValueString($Date_Finish, "date") . ")";
                         $SKTDB->query($query);
                     }
                     if ($insertProfile) {
                         if ($Client == 'FromSite') {
                             $ValidateUserMail = new \CmsDev\Security\ValidateUserMail();
                             echo $ValidateUserMail->User($insertUserID);
                         }
                         if ($new_Google == true || $new_Facebook == true) {
                             $_SESSION['UserName'] = $ClientAuth_id;
                             $session = md5($username . $password);
                             $_SESSION['login'] = $session;
                             $_SESSION['UserIDU'] = $insertUserID;
                             \CmsDev\Header\refresh::refreshNow(SITE_SERVER);
                             exit;
                         }
                     } else {
                         $error = "error";
                     }
                 } else {
                     $error = \SKT_ADMIN_User_Invalid;
                 }
             }
         }
     }
     if ($error != '') {
         $MessageBox = SKT_INFO\Asistance::get();
         $MessageBox->TipError('<b>' . $Name . '.</b> - ' . $error . ', <pre>' . $username . '</pre>', false);
     }
 }
Beispiel #24
0
 public static function new_auto_increment_ID()
 {
     $SKTDB = SKT_DB::connect();
     $NewID = $SKTDB->get_var("SELECT MAX(ID) FROM " . \DB_PREFIX . "sections") + 1;
     return $NewID;
 }
Beispiel #25
0
 private function section()
 {
     $SKT = \CmsDev\util\globals::getVar('SKT');
     $SKTDB = SKTDB\db_Skt::connect();
     $SectionValues = \CmsDev\Content\Section::get();
     $ParentSectionValues = $SectionValues->ParentSectionValues;
     $Parent_2_SectionValues = $SectionValues->Parent_2_SectionValues;
     $Parent_3_SectionValues = $SectionValues->Parent_3_SectionValues;
     $Parent_4_SectionValues = $SectionValues->Parent_4_SectionValues;
     $Parent_5_SectionValues = $SectionValues->Parent_5_SectionValues;
     $query = $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "sections WHERE SID = '0'");
     $query2 = $SKTDB->get_col_info($info_type = "name", $col_offset = -1);
     $cols = array();
     foreach ($query2 as $name) {
         array_push($cols, $name);
     }
     foreach ($cols as $col) {
         $val[$col] = $SectionValues->{$col};
         \define($this->fixdef('SKT_SECTION_' . $col), $SectionValues->{$col});
     }
     if (\is_object($ParentSectionValues)) {
         foreach ($cols as $col) {
             $val['Parent\'][\'' . $col] = $ParentSectionValues->{$col};
             \define($this->fixdef('SKT_PARENT_' . $col), $ParentSectionValues->{$col});
         }
     } else {
         foreach ($cols as $col) {
             \define($this->fixdef('SKT_PARENT_' . $col), '');
         }
     }
     if (\is_object($Parent_2_SectionValues)) {
         foreach ($cols as $col) {
             $val['Parent2\'][\'' . $col] = $Parent_2_SectionValues->{$col};
             \define($this->fixdef('SKT_PARENT2_' . $col), $Parent_2_SectionValues->{$col});
         }
     } else {
         foreach ($cols as $col) {
             \define($this->fixdef('SKT_PARENT2_' . $col), '');
         }
     }
     if (\is_object($Parent_3_SectionValues)) {
         foreach ($cols as $col) {
             $val['Parent3\'][\'' . $col] = $Parent_3_SectionValues->{$col};
             \define($this->fixdef('SKT_PARENT3_' . $col), $Parent_3_SectionValues->{$col});
         }
     } else {
         foreach ($cols as $col) {
             \define($this->fixdef('SKT_PARENT3_' . $col), '');
         }
     }
     if (\is_object($Parent_4_SectionValues)) {
         foreach ($cols as $col) {
             $val['Parent4\'][\'' . $col] = $Parent_4_SectionValues->{$col};
             \define($this->fixdef('SKT_PARENT4_' . $col), $Parent_4_SectionValues->{$col});
         }
     } else {
         foreach ($cols as $col) {
             \define($this->fixdef('SKT_PARENT4_' . $col), '');
         }
     }
     if (\is_object($Parent_5_SectionValues)) {
         foreach ($cols as $col) {
             $val['Parent5\'][\'' . $col] = $Parent_5_SectionValues->{$col};
             \define($this->fixdef('SKT_PARENT5_' . $col), $Parent_5_SectionValues->{$col});
         }
     } else {
         foreach ($cols as $col) {
             \define($this->fixdef('SKT_PARENT5_' . $col), '');
         }
     }
     $count = count($val);
     $p1 = $p2 = $p3 = $p4 = $p5 = 0;
     $SECTION = '';
     if ($count > 0) {
         $this->DevShowParams .= '<h3><a href="#">' . \SKT_ADMIN_DP_Section . '</a></h3><table width="250" border="0" cellspacing="0" cellpadding="0" class="TableInfo"><tr><th scope="row" class="defined">defined</th><td scope="row" class="value">value</td></tr>';
         foreach ($val as $variable => $value) {
             if ($p1 === 0 && strstr($variable, 'Parent')) {
                 $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent Section ' . $val['Parent\'][\'Title'] . '</th></tr>';
                 $p1++;
             } else {
                 if ($p2 === 0 && strstr($variable, 'Parent2')) {
                     $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent (2) Section ' . $val['Parent2\'][\'Title'] . '</th></tr>';
                     $p2++;
                 } else {
                     if ($p3 === 0 && strstr($variable, 'Parent3')) {
                         $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent (3) Section ' . $val['Parent3\'][\'Title'] . '</th></tr>';
                         $p3++;
                     } else {
                         if ($p4 === 0 && strstr($variable, 'Parent4')) {
                             $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent (4) Section ' . $val['Parent4\'][\'Title'] . '</th></tr>';
                             $p4++;
                         } else {
                             if ($p5 === 0 && strstr($variable, 'Parent5')) {
                                 $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent (5) Section ' . $val['Parent5\'][\'Title'] . '</th></tr>';
                                 $p5++;
                             }
                         }
                     }
                 }
             }
             if (!strstr($variable, 'Parent')) {
                 $SECTION = 'SECTION_';
             } else {
                 $SECTION = '';
             }
             $this->DevShowParams .= '<tr><th class="defined" scope="row">SKT_' . $SECTION . $this->fixdef($variable) . '</th><th scope="row" class="value"><span>' . $value . '</span></th></tr>';
         }
         $this->DevShowParams .= '</table>';
     }
 }
Beispiel #26
0
 private function sendMailRegistration($User)
 {
     $SKTDB = SKT_DB::connect();
     $User = $SKTDB->get_row("SELECT *\r\n                    FROM users as user join userprofile as profile \r\n                    ON user.id = " . \GetSQLValueString($User, 'int') . "\r\n                    WHERE user.id = profile.IDX \r\n            ");
     $username = $User->username;
     $activekey = $User->activekey;
     $resetkey = $User->resetkey;
     $md5 = $User->md5;
     $Name = $User->Name;
     $Surname = $User->Surname;
     $Company = $User->Company;
     $RUT = $User->RUT;
     $Position = $User->Position;
     $Address = $User->Address;
     $Phone = $User->Phone;
     $email = $User->email;
     $URLActivate = \SITE_SERVER . "/ValidateUser?codeValidate=" . $md5;
     $code = "";
     $Sitio = SITE_SERVER;
     $TemplateSite = SKT_TEMPLATE;
     $Logo = SERVER_DIR . SKTURL_TemplateSite . '/assets/img/logo.png';
     $Assets = \SITE_SERVER . '/_TemplateSite/NegociosEnRed/mails/assets/';
     //        $UrlProduct = isset($_POST['UrlProduct']) ? $_POST['UrlProduct'] : '';
     //        $UrlProductShort = isset($_POST['UrlProductShort']) ? $_POST['UrlProductShort'] : '';
     //        $NameProduct = isset($_POST['NameProduct']) ? $_POST['NameProduct'] : '';
     //        $description = isset($_POST['description']) ? $_POST['description'] : '';
     //        $idProduct = isset($_POST['idProduct']) ? $_POST['idProduct'] : '';
     //        if ($UrlProductShort != '') {
     //            $Product = '<tr>
     //                <th align="right" valign="middle" nowrap="nowrap" bgcolor="#515050" style="color: #FFF !important;"><strong style="color: #FFF">Interesado en</strong></th>
     //                <td align="left" valign="middle" nowrap="nowrap" bgcolor="#F5F5F5">
     //                  <h3><a href="' . $UrlProduct . '">' . $NameProduct . '</a></h3>
     //                </td>
     //              </tr>';
     //        }
     $Mail_ValidateRegistration = SKTPATH_CmsDev . 'Security' . DS . 'Mail_ValidateRegistration.php';
     $EmailMessagge = \file_get_contents($Mail_ValidateRegistration);
     $find = array('[Assets]', '[Sitio]', '[Logo]', '[URLActivate]', '[code]', '[username]', '[activekey]', '[resetkey]', '[md5]', '[Name]', '[Surname]', '[Company]', '[RUT]', '[Position]', '[Address]', '[Phone]', '[email]');
     $replace = array($Assets, $Sitio, $Logo, $URLActivate, $code, $username, $activekey, $resetkey, $md5, $Name, $Surname, $Company, $RUT, $Position, $Address, $Phone, $email);
     $EmailMessagge = str_replace($find, $replace, $EmailMessagge);
     //-------------------------------------------------------//
     $InfoEMAIL = SKT_SITE_EMAIL;
     $Emailfrom = SKT_SITE_EMAIL;
     $Emailto = $email;
     $EmailSubject = SKT_SITE_NAME . ' - Registro de usuario';
     //-------------------------------------------------------//
     $smtp = new \CmsDev\Security\smtp\smtp();
     $smtp->host_name = "localhost";
     /* Change this variable to the address of the SMTP server to relay, like "smtp.myisp.com" */
     $smtp->host_port = 26;
     /* Change this variable to the port of the SMTP server to use, like 465 */
     $smtp->ssl = 0;
     /* Change this variable if the SMTP server requires an secure connection using SSL */
     $smtp->http_proxy_host_name = '';
     /* Change this variable if you need to connect to SMTP server via an HTTP proxy */
     $smtp->http_proxy_host_port = 3128;
     /* Change this variable if you need to connect to SMTP server via an HTTP proxy */
     $smtp->socks_host_name = '';
     /* Change this variable if you need to connect to SMTP server via an SOCKS server */
     $smtp->socks_host_port = 1080;
     /* Change this variable if you need to connect to SMTP server via an SOCKS server */
     $smtp->socks_version = '5';
     /* Change this variable if you need to connect to SMTP server via an SOCKS server */
     $smtp->start_tls = 0;
     /* Change this variable if the SMTP server requires security by starting TLS during the connection */
     $smtp->localhost = "localhost";
     /* Your computer address */
     $smtp->direct_delivery = 0;
     /* Set to 1 to deliver directly to the recepient SMTP server */
     $smtp->timeout = 10;
     /* Set to the number of seconds wait for a successful connection to the SMTP server */
     $smtp->data_timeout = 0;
     /* Set to the number seconds wait for sending or retrieving data from the SMTP server.
        Set to 0 to use the same defined in the timeout variable */
     $smtp->debug = 0;
     /* Set to 1 to output the communication with the SMTP server */
     $smtp->html_debug = 0;
     /* Set to 1 to format the debug output as HTML */
     $smtp->pop3_auth_host = "";
     /* Set to the POP3 authentication host if your SMTP server requires prior POP3 authentication */
     $smtp->user = "";
     /* Set to the user name if the server requires authetication */
     $smtp->realm = "";
     /* Set to the authetication realm, usually the authentication user e-mail domain */
     $smtp->password = "";
     /* Set to the authetication password */
     $smtp->workstation = "";
     /* Workstation name for NTLM authentication */
     $smtp->authentication_mechanism = "PLAIN";
     /* Specify a SASL authentication method like LOGIN, PLAIN, CRAM-MD5, NTLM, etc..
        Leave it empty to make the class negotiate if necessary */
     if ($smtp->SendMessage($Emailfrom, array($Emailto, $Emailfrom), array("X-Mailer: PHP/" . phpversion() . "", "MIME-Version: 1.0", "Content-type: text/html; charset=iso-8859-1", "Content-Transfer-Encoding: 8bit", "From: {$Emailfrom}", "To: {$Emailto}" . ";" . $Emailfrom, "Subject: " . $EmailSubject, "Date: " . strftime("%a, %d %b %Y %H:%M:%S %Z")), $EmailMessagge)) {
         include 'ValidateUserMessage1.php';
     } else {
         return "no";
     }
 }
Beispiel #27
0
 protected static function Remove($category_id = '')
 {
     $SKTDB = \CmsDev\Sql\db_Skt::connect();
     $DeleteQuery = $SKTDB->query("DELETE FROM " . \DB_PREFIX . "categories WHERE category_id = '" . \GetSQLValueString($category_id, "int") . "' AND category_id !=0 LIMIT 1");
     if ($DeleteQuery) {
         echo 'ok';
     } else {
         echo \SKT_ADMIN_Message_Update_Error;
     }
 }
Beispiel #28
0
 public static function nav($Sections_Menu, $ID = 1, $URLNameParent = '')
 {
     $ShowHidden = " RecycleBin = '0'  AND";
     $SKTDB = \CmsDev\Sql\db_Skt::connect();
     $SectionValues = \CmsDev\Content\Section::get();
     $Language = $SectionValues->Language;
     $LoggedInAdmin = \CmsDev\Security\loginIntent::action('validateAdmin');
     if ($LoggedInAdmin === true) {
         $ShowHidden = "";
     }
     $result = $SKTDB->get_results("SELECT ID,Title,Description,URLName,SID,Position,SectionType,RecycleBin,DisplayOnMenu, LinkActive, Link_ID\r\n            FROM " . \DB_PREFIX . "sections\r\n            WHERE (" . $ShowHidden . " Language = '" . $Language . "' AND SectionType = '1' AND DisplayOnMenu = '" . $Sections_Menu['DisplayMenu'] . "') \r\n               OR (" . $ShowHidden . " Language = '" . $Language . "' AND SectionType = '1' AND DisplayOnMenu = '4')  \r\n            ORDER BY SID, Position, Title", ARRAY_A);
     if ($result) {
         $menu = array('items' => array(), 'parents' => array());
         foreach ($result as $items) {
             $menu['items'][$items['ID']] = $items;
             $menu['parents'][$items['SID']][] = $items['ID'];
         }
         return static::globalNav($ID, $menu, $URLNameParent, $Sections_Menu, false);
     }
 }
Beispiel #29
0
<?php

if (!isset($GLOBALS['SKT'])) {
    if (session_id() == '') {
        session_start();
    }
    $SKTAJAX = 'AJAX';
    require '../../../Config.php';
    require '../../../db.php';
    require '../../Core.php';
}
$SKTDB = \CmsDev\sql\db_Skt::connect();
if (\CmsDev\Security\loginIntent::action('validate', 'Link', 'Edit') === true) {
    echo str_replace('[title]', \SKT_ADMIN_Link_Create, \SKT_ADMIN_AdminWraperOpen);
    $ID = $_POST['ID'];
    $Querylinks = $SKTDB->get_row("SELECT * FROM " . DB_PREFIX . "links WHERE ID = '{$ID}' ");
    $QuerylinksSEC = $SKTDB->get_row("SELECT * FROM " . DB_PREFIX . "sections WHERE Link_ID = '{$ID}' ");
    ?>
    <div class="container_16">
        <div class="CreateContentHtml">
            <div id="server_response_NewlinksData"></div>
            <form action="" method="post" id="NewlinksData">
                <div class="grid_8">
                    <fieldset>
                        <input name="ID" id="ID" type="hidden" value="<?php 
    echo $Querylinks->ID;
    ?>
"  class="text ui-corner-all" />
                        <input name="URLName" id="URLNameNewSection" type="hidden" value="link"  class="text ui-corner-all" />        
                        <label> <span><?php 
    echo \SKT_ADMIN_TXT_Title;
Beispiel #30
0
 protected static function AddResponse()
 {
     $SKTDB = \CmsDev\Sql\db_Skt::connect();
     $insert = $SKTDB->query("INSERT INTO messenger (Type,Parent,IDFrom,IDTo,EmailFrom,NameFrom,readFrom,EmailTo,NameTo,readTo,Message) \r\n\t\tVALUES (" . "0," . \GetSQLValueString($_POST['Parent'], "int") . "," . \GetSQLValueString($_POST['IDFrom'], "int") . "," . \GetSQLValueString($_POST['IDTo'], "int") . "," . \GetSQLValueString($_POST['EmailFrom'], "text") . "," . \GetSQLValueString($_POST['NameFrom'], "text") . "," . "0," . \GetSQLValueString($_POST['EmailTo'], "text") . "," . \GetSQLValueString($_POST['NameTo'], "text") . "," . "0," . \GetSQLValueString($_POST['Message'], "text") . ")");
     if ($insert) {
         echo 'ok';
     } else {
         echo "error";
     }
 }