Ejemplo n.º 1
0
 public static function isLogined()
 {
     if (isset($_COOKIE['log'])) {
         $parts = explode("_", $_COOKIE['log']);
         $imgID = $parts[0];
         $cookie_code = $parts[1];
         $imgAccount = ImgAccountUtil::getImgAccountById($imgID, TRUE);
         if (NULL != $imgAccount && $cookie_code == $imgAccount['cookie_code']) {
             return $imgAccount['id'];
         }
     }
     return FALSE;
 }
Ejemplo n.º 2
0
 function activationAction()
 {
     $v_params['logined'] = LoginChecker::isLogined();
     $v_params['sys_name'] = SysPropertiesUtil::getPropertyValue("sys_name");
     $v_params['sys_slog'] = SysPropertiesUtil::getPropertyValue("sys_slog");
     if (isset($_GET['imgID']) && isset($_GET['acode'])) {
         $imgID = $_GET['imgID'];
         $acode = $_GET['acode'];
         $imgAccount = ImgAccountUtil::getImgAccountById($imgID, FALSE);
         if (NULL != $imgAccount) {
             if ($imgAccount['check_code'] == $acode) {
                 $imgAccount['active'] = 1;
                 $imgAccount['check_code'] = NULL;
                 ImgAccountUtil::updateImgAccount($imgAccount);
                 $v_params['message'] = "Активация прошла успешно";
                 $v_params['message_descr'] = "Теперь вы можете войти в панель управления торговым стендом";
                 Application::fastView('main/sys_message', $v_params);
                 return;
             }
         }
     }
     $v_params['message'] = "Активация не выполнена";
     $v_params['message_descr'] = "Данные запроса не верны";
     Application::fastView('main/sys_message', $v_params);
 }
Ejemplo n.º 3
0
 function orderAction()
 {
     $img_id = $_SESSION['imag_id'];
     $imgAccount = ImgAccountUtil::getImgAccountById($img_id, TRUE);
     $v_params['sys_name'] = SysPropertiesUtil::getPropertyValue("sys_name");
     $v_params['sys_slog'] = SysPropertiesUtil::getPropertyValue("sys_slog");
     if (NULL != $imgAccount) {
         $v_params['logined'] = LoginChecker::isLogined();
         if ($v_params['logined'] == $img_id) {
             $v_params['mysc']['main'] = TRUE;
             $v_params['img_name'] = $imgAccount['img_name'];
             $v_params['img_all_gds_cats_href'] = "/" . IMAG_PREFIX . $img_id . "/" . IMAG_DIR;
             $v_params['img_all_blog_cats_href'] = "/" . IMAG_PREFIX . $img_id . "/" . BLOG_DIR;
             $v_params['img_gds_cats_HTML'] = ImgGdsCatUtil::createTreeHTML($imgAccount['id'], "/" . IMAG_PREFIX . $img_id . "/" . IMAG_DIR . "?" . PROD_CAT_PARAM_NAME . "=");
             $v_params['img_blog_cats_HTML'] = ImgBlogCatUtil::createTreeHTML($imgAccount['id'], "/" . IMAG_PREFIX . $img_id . "/" . BLOG_DIR . "?" . ART_CAT_PARAM_NAME . "=");
             if ($_GET['id']) {
                 $order_id = $_GET['id'];
                 $v_params['order'] = OrderUtil::getOrderById($order_id, $imgAccount['id']);
                 $v_params['order_gdss'] = ImgGdsUtil::getImgGdssForOrder($imgAccount['id'], $order_id);
                 if ($_POST['order_ended'] && count($v_params['order_gdss'])) {
                     if (0 == strcmp("not_ended", $_POST['order_ended'])) {
                         OrderAccountSendedUtil::updateOrderAccountRelation($order_id, $imgAccount['id'], 0);
                         $v_params['order']['sended'] = 0;
                     } else {
                         if (0 == strcmp("ended", $_POST['order_ended'])) {
                             OrderAccountSendedUtil::updateOrderAccountRelation($order_id, $imgAccount['id'], 1);
                             $v_params['order']['sended'] = 1;
                         }
                     }
                 }
                 Application::fastView('imag-admin/order/img_admin_order', $v_params);
                 exit;
             }
         }
     }
     Application::fastView('main/sys_error', $v_params);
 }
Ejemplo n.º 4
0
 function articleAction()
 {
     $img_id = $_SESSION['imag_id'];
     $v_params['sys_name'] = SysPropertiesUtil::getPropertyValue("sys_name");
     $v_params['sys_slog'] = SysPropertiesUtil::getPropertyValue("sys_slog");
     $imgAccount = ImgAccountUtil::getImgAccountById($img_id, TRUE);
     $imgArticle = ImgBlogArtUtil::getImgBlogArtById($img_id, $_REQUEST[ART_PARAM_NAME]);
     if (NULL != $imgAccount && NULL != $imgArticle) {
         $v_params['logined'] = LoginChecker::isLogined();
         $v_params['in_card_count'] = CardCounter::countGDSinCard();
         if ($v_params['logined'] == $img_id) {
             $v_params['mysc']['main'] = TRUE;
         }
         $v_params['img_name'] = $imgAccount['img_name'];
         $v_params['img_slog'] = $imgAccount['img_slog'];
         $v_params['img_all_gds_cats_href'] = "/" . IMAG_PREFIX . $img_id . "/" . IMAG_DIR;
         $v_params['img_gds_cats_HTML'] = ImgGdsCatUtil::createTreeHTML($imgAccount['id'], "/" . IMAG_PREFIX . $img_id . "/" . IMAG_DIR . "?" . PROD_CAT_PARAM_NAME . "=");
         $v_params['img_all_blog_cats_href'] = "/" . IMAG_PREFIX . $img_id . "/" . BLOG_DIR;
         $v_params['img_blog_cats_HTML'] = ImgBlogCatUtil::createTreeHTML($imgAccount['id'], "/" . IMAG_PREFIX . $img_id . "/" . BLOG_DIR . "?" . ART_CAT_PARAM_NAME . "=");
         $v_params['img_blog_url'] = "/" . IMAG_PREFIX . $img_id . "/" . BLOG_DIR . "/";
         $v_params['img_blog_breadcrump_HTML'] = ImgBlogCatUtil::createBreadcrumpHTML($imgAccount['id'], $imgArticle['img_blog_cat_id']);
         $v_params['img_article'] = $imgArticle;
         $v_params['img_blog_art_blocks'] = ImgBlogArtBlockUtil::getImgBlogArtBlocksByArtId($imgArticle['id']);
         Application::fastView('imags/img_article', $v_params);
     } else {
         Application::fastView('main/sys_error', NULL);
     }
 }