Beispiel #1
0
<?php

if (!isset($GLOBALS['SKT'])) {
    if (session_id() == '') {
        session_start();
    }
    $SKTAJAX = 'AJAX';
    require '../../../../../../Config.php';
    require '../../../../../../db.php';
    require '../../../../Core.php';
}
if (\CmsDev\Security\loginIntent::action('validate') === true) {
    if (isset($_POST['ID'])) {
        $Messenger = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
        $Messenger->GoUpdateData($_POST['ID']);
    }
}
Beispiel #2
0
<?php

$Messenger = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
$Messenger->RenderList();
?>
<div style="display:none;">
    <div id="dialogConfirmDeleteItem">
        <span id="text-dialog-confirm">
            <?php 
echo \SKT_ADMIN_Message_Confirm_Delete_Text;
?>
        </span><br />
        <span id="ItemInfo"></span>
    </div>
</div>
<script type="text/javascript">
    var translations = [];
    translations['Ok'] = SKT_ADMIN_Btn_Acept;
    translations['Create'] = SKT_ADMIN_Btn_Create;
    translations['Cancel'] = SKT_ADMIN_Btn_RestartCancel;
    translations['Delete'] = SKT_ADMIN_Btn_Delete;
    translations['Save'] = SKT_ADMIN_Btn_Save;
    translations['Edit'] = SKT_ADMIN_Btn_Edit;
    $('.TableListElementsSKT div.skt-btn-list-add').click(function () {
        var  Messenger_Add = '/SKTGoTo/' + admd2('CRUD/ViewEditElementsAsList/Lists/Messenger/Add');
        jQuery.ajax({
            'type': 'POST',
            'url':  Messenger_Add,
            'cache': false,
            'data': $('form#colectorskt').serialize(),
            'success': function (html) {
Beispiel #3
0
<?php

if (\CmsDev\Security\loginIntent::action('validate') === true) {
    if (isset($_POST['UserID'])) {
        $ID = $_POST['ID'];
        $UserID = $_POST['UserID'];
        $Owner = isset($_POST['Owner']) ? $_POST['Owner'] : '';
        $Set = isset($_POST['Set']) ? $_POST['Set'] : NULL;
        $Categories = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
        if ($Set === '1') {
            $Categories->SetRead($ID, $UserID, $Owner);
        } else {
            $Categories->SetUnread($ID, $UserID, $Owner);
        }
    }
}
Beispiel #4
0
<?php

if (\CmsDev\Security\loginIntent::action('validate') === true) {
    $Messenger = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
    echo $Messenger->AddToList();
} else {
    echo 'login';
}
Beispiel #5
0
<?php

if (\CmsDev\Security\loginIntent::action('validate') === true) {
    $ID = isset($_POST['ID']) ? $_POST['ID'] : '';
    $Owner = isset($_POST['Owner']) ? $_POST['Owner'] : '';
    if ($ID != '') {
        $Messenger = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
        $Messenger->RemoveFromList($ID, $Owner);
    }
}
Beispiel #6
0
<h2 class=" mt30 mb20 text-color"><i class="skt-icon-icon-email"></i> Mensajes</h2>
<ul class="comments-list  ml30 mr30">
    <?php 
$Messager = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
$MessagerCountNum = $Messager->MessagerCount($User->id);
if ($MessagerCountNum >= 1) {
    $query = $Messager->MessageRead($User->id);
    $BeforeChild = '<ul>';
    $AfterChild = '</ul>';
    $Counter = 1;
    $Owner = 'readTo';
    $TemplateMessageChild = '';
    $Avatar = '_FileSystems/anonimo.png';
    $TemplateItem = '<li [CheckRead] data-id="[id]">
                <div class="toggleMessage"></div>
                <article class="comment comment-line">
                    <div class="comment-author">
                        <img title="[NameFrom]" alt="[NameFrom]" src="[Avatar]" style="width: 35px;">
                    </div>
                    <div class="comment-inner">
                        <a href="javascript:RemoveFromList([id],\'[Owner]\');" class="comment-delete float-right" title="Borrar permanentemente" style="display:block;"> <i class="fa fa-trash-o"></i> </a>
                        <a href="javascript:SetReadUnread([id],\'\',\'[Owner]\');" class="comment-read float-right" title=" Marcar como no leído" style="display:block;"><i class="fa fa-archive"></i> Leído</a>
                        <span class="comment-author-name">
                            <b class="badge">[Counter]</b> <span>Iniciado por: </span><i class="fa fa-user"></i> [NameFrom] <a href="mailto:[EmailFrom]">[EmailFrom]</a>
                            <span>[Messageshort]</span>
                        </span>
                        <span class="comment-time float-right"><i class="fa fa-calendar"></i> [datePost]</span>
                    </div>
                </article>
                <article class="comment">
                    <div class="comment-author">
Beispiel #7
0
<?php

if (\CmsDev\Security\loginIntent::action('validateAdmin') === true) {
    if (isset($_POST['id'])) {
        $ID = $_POST['id'];
        $Company = isset($_POST['Company']) ? $_POST['Company'] : '';
        $RUT = isset($_POST['RUT']) ? $_POST['RUT'] : '';
        $CompanyUrl = isset($_POST['CompanyUrl']) ? $_POST['CompanyUrl'] : '';
        $Description = isset($_POST['Description']) ? $_POST['Description'] : '';
        $category1 = isset($_POST['category1']) ? $_POST['category1'] : '';
        $category2 = isset($_POST['category2']) ? $_POST['category2'] : '';
        $category3 = isset($_POST['category3']) ? $_POST['category3'] : '';
        $category4 = isset($_POST['category4']) ? $_POST['category4'] : '';
        $category5 = isset($_POST['category5']) ? $_POST['category5'] : '';
        $Categories = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
        $Categories->EditItemList($ID, $Company, $RUT, $CompanyUrl, $Description, $category1, $category2, $category3, $category4, $category5);
    }
}
Beispiel #8
0
<?php

if (\CmsDev\Security\loginIntent::action('validate') === true) {
    $Messenger = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
    echo $Messenger->Response();
}
Beispiel #9
0
 private function GenericUser($PreValidate = false, $personMarkupTPL)
 {
     $querySession = '';
     if ($PreValidate === true) {
         $SKTDB = SKT_DB::connect();
         if (isset($_SESSION['UserID'])) {
             $querySession = "user.password = "******" AND";
         } elseif (isset($_SESSION['login'])) {
             $querySession = "user.md5 = " . \GetSQLValueString($_SESSION['login'], 'text') . " AND";
         } else {
             $querySession = '';
         }
         $user_list = $SKTDB->get_row("SELECT *\r\n                    FROM users as user, userprofile as profile \r\n                    WHERE " . $querySession . " profile.IDX = user.id ");
         if ($user_list) {
             $query = $SKTDB->get_col_info();
             foreach ($query as $name) {
                 $this->{$name} = $user_list->{$name};
             }
             $History = new \CmsDev\Info\history($this->IDX, $_SERVER, $_POST, $_GET);
             $GenericUser = $personMarkupTPL;
             $ProfileLink = \SKTServerURL . 'UserProfile';
             if ($this->ClientAuth_picture != '') {
                 $GenericUser = \str_replace('{Avatar}', $this->ClientAuth_picture, $GenericUser);
             }
             if ($this->ClientAuth != '') {
                 $GenericUser = \str_replace('{ServiceProvider}', $this->ClientAuth, $GenericUser);
                 $GenericUser = \str_replace('{NameTitle}', \SKT_ADMIN_TXT_GotoProfileOn . $this->ClientAuth, $GenericUser);
             }
             if ($this->ClientAuth_link != '') {
                 $ProfileLink = $this->ClientAuth_link;
                 $GenericUser = \str_replace('{ProfileLink}', \SKTServerURL . 'UserProfile', $GenericUser);
             }
             if ($this->ClientAuth_name != '') {
                 $GenericUser = \str_replace('{NameText}', $this->ClientAuth_name, $GenericUser);
             }
             $MessagerCount = new \CmsDev\CRUD\ViewEditElementsAsList\Lists\Messenger\_classes();
             $MessagerCountNum = $MessagerCount->MessagerCountUnread($this->IDX);
             $urlRef = $this->CompanyUrl;
             if ($this->Type == 'Customers') {
                 $stringValid = str_replace('%3D', '', \CmsDev\skt_Code::Encode($this->username));
                 $urlRef = $stringValid;
             }
             if ($MessagerCountNum >= 1) {
                 $MessagerShow = '<li><a href="' . \SKTServerURL . 'usr/' . $this->IDX . '/' . $urlRef . '/Messager/" class="sktToolTip skt-icon-icon-email" title="Mensajes"> <span>Tiene <b class="badge">' . $MessagerCountNum . '</b> mensajes sin leer</span></a></li>';
                 $MessagerCountNumTop = '<b class="badge">' . $MessagerCountNum . '</b>';
             } else {
                 $MessagerShow = '<li><a href="' . \SKTServerURL . 'usr/' . $this->IDX . '/' . $urlRef . '/Messager/" class="sktToolTip skt-icon-icon-email" title="Mensajes"><span>Mensajes</span></a></li>';
                 $MessagerCountNumTop = '';
             }
             if (!defined('UserProfileLink')) {
                 define('UserProfileLink', \SKTServerURL . 'usr/' . $this->IDX . '/' . $urlRef . '/');
             }
             if (!defined('PublisherLink')) {
                 define('PublisherLink', \UserProfileLink . 'Publisher/');
             }
             if (!defined('EditLink')) {
                 define('EditLink', \UserProfileLink . 'Edit/');
             }
             if (!defined('DesignLink')) {
                 define('DesignLink', \UserProfileLink . 'Design/');
             }
             if (!defined('ResumenLink')) {
                 define('ResumenLink', \UserProfileLink . 'Resumen/');
             }
             if (!defined('HelpLink')) {
                 define('HelpLink', \UserProfileLink . 'Help/');
             }
             if (!defined('TypeUser')) {
                 define('TypeUser', $this->Type);
             }
             $ReplaceOnTemplate = array('{NameTitle}' => \SKT_ADMIN_TXT_ViewEditProfile, '{NameText}' => $this->username, '{NameLink}' => \UserProfileLink, '{ProfileLink}' => \SKTServerURL . 'usr/' . $this->IDX . '/' . $urlRef . '/', '{Messager}' => $MessagerShow, '{MessagerCountTop}' => $MessagerCountNumTop, '{ProfileText}' => \SKT_ADMIN_TXT_ConfigProfile, '{ProfileTitle}' => \SKT_ADMIN_TXT_ConfigProfile, '{LogoutLink}' => \SKTServerURL . 'UserLogout', '{LogoutText}' => \SKT_ADMIN_TXT_LogoutText, '{LogoutTitle}' => \SKT_ADMIN_TXT_LogoutText, '{ServiceProvider}' => '', '{ServiceProviderIcon}' => '<i class="skt-icon-config"></i>', '{UserLoginLink}' => \SKTServerURL . 'UserLogin', '{UserLoginTitle}' => \SKT_ADMIN_TXT_LoginText, '{UserLoginText}' => \SKT_ADMIN_TXT_LoginText, '{RegisterLink}' => \SKTServerURL . 'UserRegistration', '{RegisterTitle}' => \SKT_ADMIN_TXT_Register, '{RegisterText}' => \SKT_ADMIN_TXT_Register, '{PublisherLink}' => \PublisherLink, '{EditLink}' => \EditLink, '{DesignLink}' => \DesignLink, '{ResumenLink}' => \ResumenLink, '{HelpLink}' => \HelpLink, '{UserID}' => $this->id);
             $GenericUser = $personMarkupTPL = \str_replace(array_keys($ReplaceOnTemplate), array_values($ReplaceOnTemplate), $GenericUser);
         }
     } else {
         $GenericUser = \str_replace('{NameLinkTitle}', \SKT_ADMIN_TXT_ViewEditProfile, $personMarkupTPL);
         $GenericUser = \str_replace('{ProfileText}', \SKT_ADMIN_TXT_ViewEditProfile, $GenericUser);
         $GenericUser = \str_replace('{LogoutLink}', \SKTServerURL . 'UserLogout', $GenericUser);
         $GenericUser = \str_replace('{LogoutText}', \SKT_ADMIN_TXT_LogoutText, $GenericUser);
         $GenericUser = \str_replace('{ServiceProvider}', '', $GenericUser);
         $GenericUser = \str_replace('{ServiceProviderIcon}', '<i class="skt-icon-config"></i>', $GenericUser);
         $GenericUser = \str_replace('{UserLoginLink}', \SKTServerURL . 'UserLogin', $GenericUser);
         $GenericUser = \str_replace('{UserLoginTitle}', \SKT_ADMIN_TXT_LoginText, $GenericUser);
         $GenericUser = \str_replace('{UserLoginText}', \SKT_ADMIN_TXT_LoginText, $GenericUser);
         $GenericUser = \str_replace('{RegisterLink}', \SKTServerURL . 'UserRegistration', $GenericUser);
         $GenericUser = \str_replace('{RegisterTitle}', \SKT_ADMIN_TXT_Register, $GenericUser);
         $GenericUser = \str_replace('{RegisterText}', \SKT_ADMIN_TXT_Register, $GenericUser);
         $personMarkupTPL = $GenericUser;
     }
     return $personMarkupTPL;
 }