示例#1
0
function showWithTabs($postParams)
{
    $smarty = new SmartyExst();
    $todayForm = showTodayThings();
    $futureForm = showFutureThings();
    $lateForm = showLateThings();
    $addForm = addThing($postParams);
    $allForm = showAllTable();
    $smarty->assign("todayForm", $todayForm);
    $smarty->assign("lateForm", $lateForm);
    $smarty->assign("futureForm", $futureForm);
    $smarty->assign("addForm", $addForm);
    $smarty->assign("allForm", $allForm);
    return $smarty->fetch("crm.tpl");
}
示例#2
0
 /**
  * Зарегистрировать нового пользователя в системе
  * 
  * @param string $mail Почта
  * @param string $password Пароль
  * @param string $name Имя
  * @param string $surname Фамилия 
  * @param string $burthday Дата рождения
  * @param bool $gender Пол 
  * @param integer $ip IP
  * @throws UserException Если пользователь уже существует
  * @throws UserException Если неверна дата рождения
  * @throws UserException Не заполнены имя и фамилия
  * @throws UserException Неверный формат почты
  */
 public function register($mail, $password, $name, $surname, $burthday, $gender, $ip)
 {
     if (checkMail($mail)) {
         if ($this->checkIfExsist($mail)) {
             throw new UserException($mail, UserException::USR_ALREADY_EXIST);
         }
         if (!checkDateFormat($burthday)) {
             throw new UserException($mail, UserException::USR_CHECK_BURTHDAY);
         } else {
             if ($name == "" && $surname == "") {
                 throw new UserException($mail, UserException::USR_NAME_EMPTY);
             }
         }
         $textPassword = $password;
         $password = md5($password);
         $date = date("Y-m-d");
         $query = "\r\n                INSERT INTO `SITE_USERS` SET\r\n                    `mail`='{$mail}',\r\n                    `password`='{$password}',\r\n                    `ip`={$ip},\r\n                    `register_date`='{$date}',\r\n                    `name`='{$name}',\r\n                    `second_name`='{$surname}',\r\n                    `gender`={$gender},\r\n                    `burthday`='{$burthday}'\r\n                ";
         $this->_sql->query($query);
         $querySelectId = $this->_sql->selFieldsWhere("SITE_USERS", "`mail`='{$mail}'", "id");
         $arr = $this->_sql->GetRows($querySelectId);
         $id = $arr[0]["id"];
         $activationKey = $this->generateActivationKey(7);
         $insertActivationRowData = array($id, $activationKey);
         $this->_sql->insert("USERS_ACTIVATION_KEYS", $insertActivationRowData);
         $p = new UserMailer();
         $p->mail = $mail;
         $embeddedImages = array("photos/no-photo.jpg", "photos/no-galary.jpg");
         $s = new SmartyExst();
         $s->assign("NAME", "{$name} {$surname}");
         $s->assign("PASS", $textPassword);
         $s->assign("ID", $id);
         $s->assign("KEY", $activationKey);
         $sendString = $s->fetch($this->mailTemplate);
         $p->registerSend($sendString, $embeddedImages);
         return $id;
     } else {
         throw new UserException($mail, UserException::USR_NAME_INCORRECT);
     }
 }
示例#3
0
require_once "engine/modules/user/User.php";
/**
* подключение модуля для работы с шаблонами
* @package SmartyExst.php    
*/
require_once "engine/kernel/SmartyExst.php";
$flag = false;
try {
    $user = new User();
    $UserID = $user->id;
    $flag = true;
} catch (Exception $e) {
    echo " <font color=red>Пользователь не залогинился </font><br/>";
}
$rss = new RssPub();
$smarty = new SmartyExst();
if ($flag) {
    $output["text"] = $smarty->fetch("rss/MainRSS.tpl");
    switch ($data["parameters"][0]) {
        case "DoNew":
            $output["text"] = $smarty->fetch("rss/DoNew.tpl");
            //$arr=$rss->addRSS();
            break;
        case "Del":
            $smarty->assign("arr", $rss->getallRSS());
            $output["text"] = $smarty->fetch("rss/Del.tpl");
            //$arr=$rss->delRSS();
            break;
        case "Show":
            $smarty->assign("arr", $rss->getallRSS());
            $output["text"] = $smarty->fetch("rss/Show.tpl");
示例#4
0
 * @filesource engine/kernel/SmartyExst.php 
 */
require_once SOURCE_PATH . "engine/kernel/SmartyExst.php";
require_once SOURCE_PATH . "engine/libs/time/UTCTime.php";
require_once SOURCE_PATH . "UserSignInOut.php";
require_once SOURCE_PATH . "UserRegister.php";
require_once SOURCE_PATH . "UserFull.php";
require_once SOURCE_PATH . "UserUTCChange.php";
require_once SOURCE_PATH . "UserStatus.php";
require_once "UserDataChange.php";
require_once "AdditionalInfo.php";
require_once SOURCE_PATH . "engine/modules/accessLevelRights/AccessLevelController.php";
require_once "engine/modules/finder/Finder.php";
$r = new UserRegister();
//var_dump($data["urlArray"]);
$smarty = new SmartyExst();
$links = array("enterForm" => "/" . $data["urlArray"][1] . "/", "signInPath" => "/" . $data["urlArray"][1] . "/view/", "signOutPath" => "/" . $data["urlArray"][1] . "/logout/", "enter" => "/" . $data["urlArray"][1] . "/enter/", "register" => "/" . $data["urlArray"][1] . "/register/", "create" => "/" . $data["urlArray"][1] . "/create/", "settings" => "/" . $data["urlArray"][1] . "/settings/");
$smarty->assign("links", $links);
$usersSignInOut = new UserSignInOut();
if (isset($_SESSION["error"])) {
    echo $_SESSION["error"];
    unset($_SESSION["error"]);
}
switch ($data["parameters"][0]) {
    case "activate":
        if (isset($data["parameters"][1])) {
            $smarty->assign("ID", $data["parameters"][1]);
            $output["text"] = $smarty->fetch("users.activate.tpl");
        }
        break;
    case "doactivate":
示例#5
0
<?php

require_once "Finder.php";
$links = array("base" => "/" . $data["urlArray"][1] . "/", "search" => "/" . $data["urlArray"][1] . "/search/");
$smarty = new SmartyExst();
$smarty->assign("links", $links);
$finder = new Finder(time());
session_start();
switch ($data["parameters"][0]) {
    case "search":
        if (!isset($_SESSION["search"])) {
            $_SESSION["search"] = $_POST;
        } else {
            if ($_SESSION["search"] != $_POST && $_POST != NULL) {
                $_SESSION["search"] = $_POST;
            }
        }
        $finder->page = $data["parameters"][1];
        $datS =& $_SESSION["search"];
        switch ($_GET["type"]) {
            case "byData":
                $fUsers = $finder->findByData($datS["name"], $datS["surname"], $datS["gender"], $datS["ageFrom"], $datS["ageTo"], (bool) $datS["isOnline"]);
                $smarty->assign("COUNT", $finder->count);
                $smarty->assign("PAGES", $finder->getPages());
                break;
            case "byMail":
                $fUsers = $finder->findByMail($datS["mail"]);
                break;
            case "byId":
                $fUsers = $finder->findById($datS["id"]);
                break;
示例#6
0
<?php

require_once "Friends.php";
require_once "GroupsCreator.php";
require_once "engine/modules/user/User.php";
require_once "engine/modules/accessLevelRights/AccessLevelController.php";
/**
 * Подключает Smarty с настройками
 * @filesource engine/kernel/SmartyExst.php 
 */
require_once SOURCE_PATH . "engine/kernel/SmartyExst.php";
$friends = new Friends((int) $data["parameters"][0]);
$groups = new GroupsCreator();
$smarty = new SmartyExst();
switch ($data["parameters"][0]) {
    case "delete":
        $friends->deleteFriend((int) $data["parameters"][1]);
        header("Location: /friends/");
        break;
    case "groups":
        $groups = new GroupsCreator();
        if (isset($data["parameters"][1])) {
            switch ($data["parameters"][1]) {
                case "add":
                    $groups->create($_POST["group_name"]);
                    header("Location: /friends/groups/");
                    break;
                case "del":
                    $groups->delete($data["parameters"][2]);
                    header("Location: /friends/groups/");
                case "show":
示例#7
0
function searcher($postParams, $getParams)
{
    $searchPath = "/video/search/";
    $searchStr = $postParams["searchStr"];
    if ($searchStr != "") {
        $searchResult = drawSearchVideoList($searchStr, $getParams);
    } else {
        $searchResult = "";
    }
    $numerator = "12345";
    $smarty = new SmartyExst();
    $smarty->assign("searchResults", $searchResult);
    $smarty->assign("numerator", $numerator);
    return $smarty->fetch("video/video.tpl");
}
示例#8
0
/**
* подключение модуля
* @package SmartyExst.php    
*/
require_once "engine/kernel/SmartyExst.php";
$flag = false;
try {
    $user = new User();
    $UserID = $user->id;
    $flag = true;
} catch (Exception $e) {
    echo " <font color=red>Пользователь не залогинился </font><br/>";
}
$not = new NoticeTopicsPF();
$notADM = new NoticeCategoryPF();
$smarty = new SmartyExst();
if ($flag) {
    $output["text"] = $smarty->fetch("notice/MainNotice.tpl");
    switch ($data["parameters"][0]) {
        case "DoNew":
            $output["text"] = $smarty->fetch("notice/DoNew.tpl");
            break;
        case "GetAllMy":
            $arr = $not->allTopUI(255);
            $smarty->assign("arr", $arr);
            $output["text"] = $smarty->fetch("notice/GetAllMy.tpl");
            break;
        case "DoNewADM":
            $output["text"] = $smarty->fetch("notice/DoNewADM.tpl");
            break;
        case "GetAllADM":
示例#9
0
 /**
  * Отображает сайт на главном шаблоне
  * 
  * @param Sring $templatePath Выводимый модуль в папке engine/templates
  */
 public function view($templatePath)
 {
     $smarty = new SmartyExst();
     //$smarty->caching=true;
     //$smarty->debugging=true;
     //var_dump($out);
     $smarty->assign("TEXT_VAR", $this->_out["text"]);
     $smarty->assign("TITLE", $this->_out["title"]);
     $menu = new LinksList($this->_arr["id"]);
     $smarty->assign("MENU", $menu->makeMenu());
     $smarty->assign("CHILDREN_MENU", $menu->getMenuChildren());
     $smarty->assign("PATH", $menu->getPath());
     $subSections = $menu->getSubSection();
     $smarty->assign("SUB_SECTIONS", $subSections);
     try {
         $smarty->display($templatePath);
     } catch (Exception $ex) {
         echo "PROBLEM SMARTY >> KERNEL >> Can't load {$templatePath}";
     }
 }
示例#10
0
/*
$f=new Friends();          //если надо добавить друга быстро
$f->addFriend(1233);  
*/
/*- - -*/
$flag = false;
try {
    $user = new User();
    $UserID = $user->id;
    $frnd = new Friends($UserID);
    $flag = true;
} catch (Exception $e) {
    echo " <font color=red>Пользователь не залогинился </font><br/>";
}
$mess = new Message();
$smarty = new SmartyExst();
if ($flag) {
    $output["text"] = $smarty->fetch("message/MainMessage.tpl");
    switch ($data["parameters"][0]) {
        case "DoSend":
            $smarty->assign("arr", $frnd->getAllFriends());
            $output["text"] = $smarty->fetch("message/DoSend.tpl");
            // if (isset($_POST["sbmt"])) {$str="NULL";}
            //if (isset($_POST["sv"])) {$state=0;}
            if (isset($_POST["sbmt"])) {
                $mess->saveMes($_POST["mes"], $_POST["sel"], $UserID, 1);
                unset($_POST["sbmt"]);
            }
            if (isset($_POST["sv"])) {
                $mess->saveMes($_POST["mes"], NULL, $UserID, 1);
                unset($_POST["sv"]);