Example #1
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);
 }
Example #2
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);
     }
 }
Example #3
0
 function sitemapAction()
 {
     $v_params['logined'] = LoginChecker::isLogined();
     $v_params['smap']['main'] = TRUE;
     $v_params['sys_name'] = SysPropertiesUtil::getPropertyValue("sys_name");
     $v_params['sys_slog'] = SysPropertiesUtil::getPropertyValue("sys_slog");
     $v_params['in_card_count'] = CardCounter::countGDSinCard();
     $v_params['sys_news_cats_HTML'] = SysNewsCatUtil::createTreeHTML("/" . SYS_BLOG_DIR . "?" . SYS_ART_CAT_PARAM_NAME . "=");
     if (0 != $_GET['code']) {
         $v_params['imags'] = TRUE;
         $region = AddrRegionUtil::getRegionByCode($_GET['code']);
         $v_params['title'] = "Список стендов для региона «" . $region['name'] . "»";
         $v_params['accounts'] = ImgAccountUtil::getImgAccountsByRegionCode($region['code'], TRUE);
     } else {
         $v_params['imags'] = FALSE;
         $v_params['title'] = "Список регионов";
         $v_params['regions'] = AddrRegionUtil::getRegions();
     }
     Application::fastView('main/sys_site_map', $v_params);
 }
Example #4
0
 function newsBlockAction()
 {
     $v_params['sys_name'] = SysPropertiesUtil::getPropertyValue("sys_name");
     $v_params['sys_slog'] = SysPropertiesUtil::getPropertyValue("sys_slog");
     if (LoginChecker::isAdmin()) {
         if (0 == strcmp("add", $_GET['act']) && isset($_GET['corresp'])) {
             $v_params['sys_news_art'] = SysNewsArtUtil::getSysNewsArtById($_GET['corresp']);
             if (isset($_POST['send_block_form'])) {
                 $sysNewsArtBlock['sys_news_art_id'] = $_GET['corresp'];
                 $sysNewsArtBlock['text_content'] = $_POST['text_content'];
                 $sysNewsArtBlock['order_in_art'] = (int) $_POST['order'];
                 $sysNewsArtBlock['image_id'] = (int) $_POST['pict_id'];
                 $sysNewsArtBlock['image_title'] = $_POST['img_desk'];
                 if (0 == $_POST['selected_tab']) {
                     $sysNewsArtBlock['block_type'] = 1;
                 } else {
                     if (1 == $_POST['selected_tab']) {
                         $sysNewsArtBlock['block_type'] = 0;
                     }
                 }
                 SysNewsArtBlockUtil::insertSysNewsArtBlock($sysNewsArtBlock);
                 $snaID = $v_params['sys_news_art']['id'];
                 header("Location: /superAdmin/newsArt?id={$snaID}&act=upd");
             }
             $img_albums = ImgAlbumUtil::getImgAlbumsByAccountID(0);
             $img_album_pictures = ImgPictureUtil::getImgPicturesNoAlbum(0);
             $v_params['img_albums'][] = array("name" => "Без альбома", "pictures" => $img_album_pictures);
             foreach ($img_albums as $img_album) {
                 $img_album_pictures = ImgPictureUtil::getImgPicturesByAlbumId($img_album['id'], 0);
                 $v_params['img_albums'][] = array("name" => $img_album['name'], "pictures" => $img_album_pictures);
             }
             $v_params['act_name'] = "Добавить блок";
             $v_params['num_tab'] = 0;
             Application::fastView('super-admin/news/news_page_block_au', $v_params);
             exit;
         } else {
             if (0 == strcmp("upd", $_GET['act']) && isset($_GET['corresp']) && isset($_GET['id'])) {
                 $v_params['sys_news_art'] = SysNewsArtUtil::getSysNewsArtById($_GET['corresp']);
                 $v_params['ssp_block'] = SysNewsArtBlockUtil::getSysNewsArtBlockById($_GET['id']);
                 $v_params['act_name'] = "Редактировать блок";
                 $img_albums = ImgAlbumUtil::getImgAlbumsByAccountID(0);
                 $img_album_pictures = ImgPictureUtil::getImgPicturesNoAlbum(0);
                 $v_params['img_albums'][] = array("name" => "Без альбома", "pictures" => $img_album_pictures);
                 foreach ($img_albums as $img_album) {
                     $img_album_pictures = ImgPictureUtil::getImgPicturesByAlbumId($img_album['id'], 0);
                     $v_params['img_albums'][] = array("name" => $img_album['name'], "pictures" => $img_album_pictures);
                 }
                 $v_params['num_tab'] = 0;
                 if (0 == $v_params['ssp_block']['block_type']) {
                     $v_params['num_tab'] = 1;
                 }
                 if (isset($_POST['send_block_form'])) {
                     $v_params['ssp_block']['sys_news_art_id'] = $_GET['corresp'];
                     $v_params['ssp_block']['text_content'] = $_POST['text_content'];
                     $v_params['ssp_block']['order_in_art'] = (int) $_POST['order'];
                     $v_params['ssp_block']['image_id'] = (int) $_POST['pict_id'];
                     $v_params['ssp_block']['image_title'] = $_POST['img_desk'];
                     if (0 == $_POST['selected_tab']) {
                         $v_params['ssp_block']['block_type'] = 1;
                     } else {
                         if (1 == $_POST['selected_tab']) {
                             $v_params['ssp_block']['block_type'] = 0;
                         }
                     }
                     SysNewsArtBlockUtil::updateSysNewsArtBlock($v_params['ssp_block']);
                 }
                 Application::fastView('super-admin/news/news_page_block_au', $v_params);
                 exit;
             } else {
                 if (0 == strcmp("del", $_GET['act']) && isset($_GET['corresp']) && isset($_GET['id'])) {
                     $v_params['sys_news_art'] = SysNewsArtUtil::getSysNewsArtById($_GET['corresp']);
                     if (isset($_POST['send_block_form'])) {
                         SysNewsArtBlockUtil::deleteSysNewsArtBlockById($_GET['id']);
                         $snaID = $v_params['sys_news_art']['id'];
                         header("Location: /superAdmin/newsArt?id={$snaID}&act=upd");
                     }
                     $v_params['ssp_block'] = SysNewsArtBlockUtil::getSysNewsArtBlockById($_GET['id']);
                     $v_params['act_name'] = "Удалить блок";
                     Application::fastView('super-admin/news/news_page_block_del', $v_params);
                     exit;
                 }
             }
         }
     } else {
         header("Location: /superAdmin/login");
     }
 }