Beispiel #1
0
 function execute()
 {
     global $ts_config;
     header('location:' . $ts_config['site_url_admin'] . '?module=Config&action=News');
     die("end");
     if ((int) __post2('type') > 0) {
         $_SESSION[_PLATFORM_]["CLA"]['TopLeftLinkType'] = (int) __post2('type');
     } elseif (!isset($_SESSION[_PLATFORM_]["CLA"]['TopLeftLinkType']) || $_SESSION[_PLATFORM_]["CLA"]['TopLeftLinkType'] == '' || (int) $_SESSION[_PLATFORM_]["CLA"]['TopLeftLinkType'] == 0) {
         $_SESSION[_PLATFORM_]["CLA"]['TopLeftLinkType'] = 1;
     }
     $member_access = $this->acl_access('Member', 'HHMember');
     if ($_SESSION[_PLATFORM_]["CLA"]['TopLeftLinkType'] == 1) {
         if ($member_access) {
             header('location:do?module=HHMember&action=Member&mnl=1');
         } else {
             header('location:do?module=Home&action=Info&mnl=1');
         }
         die('');
     } else {
         if ((int) __post2('type') > 0) {
             header('location:do?module=Home&action=Info&mnl=1');
             die('');
         }
     }
     die;
 }
Beispiel #2
0
 function execute()
 {
     global $ts_config;
     $_Title = 'Forum - Quản lý Bài đăng';
     $_msg = null;
     $captcha = new SimpleCaptcha();
     $formmode = $_POST["formmode"];
     $mode_inpvl = __post('mode_inpvl');
     $captchatxt = __post('captcha');
     $captchaForm = __post('captchaForm');
     $idchk = $_POST["chk"];
     $flagCaptcha = $captcha->CaptchaValidate($captchatxt);
     $flagCaptchaForm = $captcha->CaptchaValidate($captchaForm);
     $id = __post('Id');
     $post_id = __post2('post_id');
     /*===================================*/
     if ($formmode != '') {
         $menu_id = __post("menu_id");
         $title_vi = __post("title_vi");
         $title_en = __post("title_en");
         $short_vi = __post("short_vi");
         $short_en = __post("short_en");
         $content_vi = __post("content_vi");
         $content_en = __post("content_en");
         $keyword_vi = __post("keyword_vi");
         $keyword_en = __post("keyword_en");
         $status = (int) __post("status");
         $show_index = (int) __post("show_index");
         $result_id = $this->form_add($id, $menu_id, $title_vi, $title_en, $short_vi, $short_en, $content_vi, $content_en, $keyword_vi, $keyword_en, $status, $show_index);
         if ((int) $id <= 0) {
             $id = $result_id;
         }
         /*
         			$result = UpLoadMultiFile($ts_config['upload_dir'],'filenew',$gen_name = false,$title='',$max_size=9048576);
         			$file_type_id = 7;
         			foreach($result as $k=>$va){
         				$sSQL = "insert into ntk_new_files(new_id,file_name,file_path,file_type_id,require_login)
         						values(".$id.",'".$va['name']."','".$va['file_name']."',".$file_type_id.",1)
         				";
         				$re = $this->db->query($sSQL, true, "Query failed");
         			}*/
         if ($result_id > 0) {
             $_msg['result'] = 1;
         } else {
             $_msg['result'] = -20;
         }
     }
     $list_form = new XTemplate('Config/PostComment.html');
     $left_menu = $this->rmenu();
     $list_form->assign('slide_bar', $this->slide_bar($left_menu));
     $list_form->assign('tabs', $this->set_tabs());
     $list_form->assign('dialog_title', 'thành viên');
     $CaptchaText = $captcha->CreateText();
     /****** Delete (8) - Export (16) ***********************************/
     $arr_attr_btnmdelete = array('style' => '', 'onclick' => 'sbm_form(8,\'' . $CaptchaText . '\')');
     $inp_btnmdelete = addInput2('button', 'btndelete', $btnmdelete, $arr_attr_btnmdelete, $list_form, 'Xóa');
     $arr_attr_btnmdelete = array('style' => '', 'onclick' => 'sbm_form(9,\'' . $CaptchaText . '\')');
     $inp_btnmdelete = addInput2('button', 'btnactive', $btnmdelete, $arr_attr_btnmdelete, $list_form, 'ACTIVE');
     $arr_attr_btnmdelete = array('style' => '', 'onclick' => 'sbm_form(10,\'' . $CaptchaText . '\')');
     $inp_btnmdelete = addInput2('button', 'btninactive', $btnmdelete, $arr_attr_btnmdelete, $list_form, 'INACTIVE');
     if ($mode_inpvl == 'DELETE' || $mode_inpvl == 'ACTIVE' || $mode_inpvl == 'INACTIVE') {
         $idList = '0';
         foreach ($idchk as $ind => $delvl) {
             $idArr = explode('|', $delvl);
             if ($idArr[1] == $this->md5sum($this->prefix['delete'] . $idArr[0])) {
                 $idList .= ',' . $idArr[0];
             }
         }
         $status_change = -13;
         switch ($mode_inpvl) {
             case 'DELETE':
                 $status_change = -13;
                 break;
             case 'ACTIVE':
                 $status_change = 1;
                 break;
             case 'INACTIVE':
                 $status_change = 0;
                 break;
             default:
                 break;
         }
         if ($idList != '0') {
             $_msg = $this->form_delete($idList, $status_change);
         }
     }
     /****** Delete (8) - Export (16) ***********************************/
     if ($this->acl_per(16)) {
         $arr_attr_btnexport = array('style' => '', 'onclick' => 'sbm_form(16,\'' . $CaptchaText . '\')');
         $inp_btnexport = addInput2('button', 'btnexport', $btnexport, $arr_attr_btnexport, $list_form, 'Xuất Excel');
     }
     /*************************************
      *****************/
     $keyword = __post("keyword");
     $selectkeyword = __post("selectkeyword");
     $Attr_keyword = array('rel1' => '{Require:\'R\',Alert:\'Vui lòng nhập Keyword  \'}', 'style' => '');
     $txt_keyword = addInput('text', 'keyword', $keyword, $Attr_keyword, $list_form);
     $infosk[0] = array('t1.content' => 'Nội dung bình luận');
     $infosk[1] = array('t2.title_vi' => 'Tên bài đăng(vi)');
     $infosk[2] = array('t2.title_en' => 'Tên bài đăng(en)');
     $vlkey = array_keys($infosk[$selectkeyword]);
     //list($vlkey, $vlval) = each();
     $Attr_selectkeyword = array('style' => '');
     $txt_selectkeyword = addSelectList5('selectkeyword', $infosk, NULL, $Attr_selectkeyword, $list_form, $selectkeyword);
     if ($keyword != '' && $vlkey[0] != '') {
         $filter .= ' and ' . $vlkey[0] . " like N'%{$keyword}%'";
     }
     $category_id = (int) __post('category_id');
     $status = __post('status');
     //echo $filter;
     if ($category_id > 0) {
         $filter .= ' and t2.cid = ' . $category_id;
     }
     if ($status != "") {
         $filter .= ' and t1.status = ' . (int) $status;
     }
     if ($post_id > 0) {
         $filter .= " and t1.post_id = " . (int) $post_id;
     }
     //-----------------------------------------//
     $gridview = '';
     $gridview .= $this->PageHeader();
     $gridview .= $this->_AddPageHeader();
     $exportGrid = $this->setHeader();
     $DBList = $this->setList($CaptchaText, $filter, $conpany_list);
     $exportGrid .= $DBList[0];
     $gridview .= $exportGrid;
     $gridview .= $this->setFooter();
     $gridview .= $this->setPaging();
     $arr_info_show_index = array(1 => 'Hiển thị trang chủ', 0 => 'Không hiển thị trang chủ');
     $Attr_show_index = array('rel1' => '{Require:\'R\',Alert:\'Vui lòng chọn trạng thái \'}', 'style' => '');
     $txt_show_index = addSelectList2('show_index', $arr_info_show_index, '-- Trang chủ --', $Attr_show_index, $list_form, $show_index);
     $arr_info_category_id = $this->getListPostCategories();
     $Attr_category_id = array('rel1' => '{Require:\'R\',Alert:\'Vui lòng chọn danh mục \'}', 'style' => 'width:400px;');
     $txt_category_id = addSelectList2('category_id', $arr_info_category_id, '-- Danh mục --', $Attr_category_id, $list_form, $category_id);
     $arr_info_status = array(1 => 'Active', 0 => 'InActive');
     $Attr_status = array('rel1' => '{Require:\'R\',Alert:\'Vui lòng chọn trạng thái \'}', 'style' => '');
     $txt_status = addSelectList2('status', $arr_info_status, '-- Trạng thái --', $Attr_status, $list_form, $status);
     if ($mode_inpvl === 'EXPORT' && $this->acl_per(16)) {
         $this->ExportToExcel(fnStrConvert($_Title), strip_tags($exportGrid, '<table><tr><td><th>'));
         die;
     }
     //-----------------------------------------//
     setMessage($list_form, $_msg);
     $list_form->assign('title', $_Title);
     $list_form->assign('_error_', $error);
     $list_form->assign('gridview', $gridview);
     $list_form->parse('main');
     $this->html = $list_form->out_return('main');
     echo $this->html;
 }
Beispiel #3
0
<?php

session_start();
if (!defined('TSEntry') || !TSEntry) {
    die('Not A Valid Entry Point');
}
// config|_override.php
if (is_file('include/config.php')) {
    require_once 'include/config.php';
    // provides $ts_config
}
// load up the config_override.php file.  This is used to provide default user settings
if (is_file('include/config_override.php')) {
    require_once 'include/config_override.php';
}
require_once 'include/defined.inc.php';
$ts_info = $_SESSION[_PLATFORM_]["CLA"];
require_once 'include/db/DBManagerFactory.php';
$db = DBManagerFactory::getInstance();
$db->resetQueryCount();
require_once 'include/system.function.inc.php';
require_once 'include/function.inc.php';
$cla_nid = __post2("nid");
$cla_site = __post2("site");
$cla_cid = __post2("cid");
require_once 'XTemplate/xtpl.php';
$arParam = explode('/', $_SERVER["REQUEST_URI"]);
$pageUrl = $arParam[count($arParam) - 1];
Beispiel #4
0
 function execute()
 {
     global $ts_config;
     $_Title = 'Quản lý Bài viết';
     $_msg = null;
     $captcha = new SimpleCaptcha();
     $formmode = $_POST["formmode"];
     $mode_inpvl = __post('mode_inpvl');
     $captchatxt = __post('captcha');
     $captchaForm = __post('captchaForm');
     $idchk = $_POST["chk"];
     $flagCaptcha = $captcha->CaptchaValidate($captchatxt);
     $flagCaptchaForm = $captcha->CaptchaValidate($captchaForm);
     $Id = __post2("Id");
     $token = __post2("token");
     if ($Id > 0) {
         if ($token != $this->md5sum('edit' . $Id)) {
             die('Do not have permission to access page!');
         }
     }
     $list_form = new XTemplate('Config/NewsAdd.html');
     if ($mode_inpvl == 'ADD') {
         $menu_id = __post("menu_id");
         $title_vi = __post("title_vi");
         $title_en = __post("title_en");
         $short_vi = __post("short_vi");
         $short_en = __post("short_en");
         $content_vi = __post("content_vi");
         $content_en = __post("content_en");
         $keyword_vi = __post("keyword_vi");
         $keyword_en = __post("keyword_en");
         $status = (int) __post("status");
         $result_id = $this->form_add($Id, $menu_id, $title_vi, $title_en, $short_vi, $short_en, $content_vi, $content_en, $keyword_vi, $keyword_en, $status);
         if ((int) $Id <= 0) {
             $Id = $result_id;
         }
         $result = UpLoadMultiFile($ts_config['upload_dir'], 'filenew', false, '', $max_size = 9048576);
         $file_type_id = 7;
         foreach ($result as $k => $va) {
             if ($va['result'] == 1) {
                 $sSQL = "insert into ntk_new_files(new_id,file_name,file_path,file_type_id,require_login)\n\t\t\t\t\t\tvalues(" . $Id . ",'" . $va['name'] . "','" . $va['file_name'] . "'," . $file_type_id . ",1)\n\t\t\t\t\t";
                 $re = $this->db->query($sSQL, true, "Query failed");
             }
         }
         if ($result_id > 0) {
             $_msg['result'] = 1;
         } else {
             $_msg['result'] = -20;
         }
     }
     if ((int) $Id > 0) {
         $data = $this->getDetail($Id);
         foreach ($data as $key => $value) {
             ${$key} = $value;
         }
         $sSQL = "select * from ntk_new_files where new_id = " . (int) $Id;
         $result = $this->db->query($sSQL, true, "Query failed");
         while ($aR = $this->db->fetchByAssoc($result)) {
             $list_form->assign('file', $aR);
             $list_form->parse('main.file');
         }
     }
     $left_menu = $this->rmenu();
     $list_form->assign('slide_bar', $this->slide_bar($left_menu));
     $list_form->assign('tabs', $this->set_tabs());
     $list_form->assign('dialog_title', 'thành viên');
     $CaptchaText = $captcha->CreateText();
     $arr_info_menu_id = $this->getListNewsCategories();
     $Attr_menu_id = array('rel' => '{Require:\'R\',Alert:\'Vui lòng chọn danh mục \'}', 'style' => 'width:400px;');
     $txt_menu_id = addSelectList2('menu_id', $arr_info_menu_id, NULL, $Attr_menu_id, $list_form, $cid);
     $arr_info_status = array(1 => 'Active', 0 => 'InActive');
     $Attr_status = array('rel' => '{Require:\'R\',Alert:\'Vui lòng chọn trạng thái \'}', 'style' => '');
     $txt_status = addSelectList2('status', $arr_info_status, NULL, $Attr_status, $list_form, $status);
     $Attr_psttitle_vi = array('rel' => '{Require:\'R\',Alert:\'Vui lòng nhập tiêu đề tiếng việt \'}', 'style' => 'width:400px;');
     $txt_psttitle_vi = addInput('text', 'title_vi', $title_vi, $Attr_psttitle_vi, $list_form);
     $Attr_psttitle_en = array('rel1' => '{Require:\'R\',Alert:\'Vui lòng nhập tiêu đề tiếng anh \'}', 'style' => 'width:400px;');
     $txt_psttitle_en = addInput('text', 'title_en', $title_en, $Attr_psttitle_en, $list_form);
     $class_input = 'ckeditor';
     $Attr_short_vi = array('class' => $class_input, 'rel' => '{Require:\'R\',Alert:\'Vui lòng nhập mô tả ngắn tiếng việt  \'}', 'style' => 'width:400px;');
     $txt_short_vi = addTextarea('short_vi', 3, 30, $short_vi, $Attr_short_vi, $list_form);
     $Attr_short_en = array('class' => $class_input, 'rel1' => '{Require:\'R\',Alert:\'Vui lòng nhập role_name  \'}', 'style' => 'width:400px;');
     $txt_short_en = addTextarea('short_en', 3, 30, $short_en, $Attr_short_en, $list_form);
     $Attr_content_vi = array('class' => $class_input, 'rel' => '{Require:\'R\',Alert:\'Vui lòng nhập Nội dung tiếng việt  \'}', 'style' => 'width:400px;');
     $txt_content_vi = addTextarea('content_vi', 3, 30, $content_vi, $Attr_content_vi, $list_form);
     $Attr_content_en = array('class' => $class_input, 'rel1' => '{Require:\'R\',Alert:\'Vui lòng nhập Nội dung tiếng anh  \'}', 'style' => 'width:400px;');
     $txt_content_en = addTextarea('content_en', 3, 30, $content_en, $Attr_content_en, $list_form);
     $Attr_pstkeyword_vi = array('rel' => '{Require:\'R\',Alert:\'Vui lòng nhập từ khóa tiếng việt \'}', 'style' => 'width:400px;');
     $txt_pstkeyword_vi = addInput('text', 'keyword_vi', $keyword_vi, $Attr_pstkeyword_vi, $list_form);
     $Attr_pstkeyword_en = array('rel1' => '{Require:\'R\',Alert:\'Vui lòng nhập từ khóa tiếng anh\'}', 'style' => 'width:400px;');
     $txt_pstkeyword_en = addInput('text', 'keyword_en', $keyword_en, $Attr_pstkeyword_en, $list_form);
     if ($this->acl_per(2)) {
         //$arr_attr_btnadd = array('style'=>'color:blue;','onclick'=>'sbm_form(2,\''.$CaptchaText.'\')');
         $arr_attr_btnadd = array('style' => 'color:blue;', 'onclick' => 'add()');
         $inp_btnadd = addInput2('button', 'btnadd', $btnadd, $arr_attr_btnadd, $list_form, 'LƯU');
     }
     $list_form->assign('Id', $Id);
     $list_form->assign('token', $token);
     //$list_form->parse('main');
     //	$html = $list_form->out_return('main');
     $list_form->assign('title', $_Title);
     $list_form->assign('_error_', $error);
     $list_form->assign('gridview', $gridview);
     $list_form->parse('main');
     $this->html = $list_form->out_return('main');
     echo $this->html;
 }
Beispiel #5
0
				<li><a href="#" class="nav-link" id="holiday_href">Duyệt Nghỉ phép <span class="nav-counter nav-scounter-blue" id="holiday_count">0</span></a></li>
				</ul>

				<?php 
}
?>
			  </div>

			</div>		
		<?php 
echo $cla->siteHeader();
?>
	
		<div style="border:0px solid red;height:40px">
			<div style="width:600px;float:left">
			<?php 
if (is_login()) {
    if (!isset($_SESSION[_PLATFORM_]["CLA"]['MENU']) || __post2('menureload') == 1 || __post2('mnl') == 1) {
        $_SESSION[_PLATFORM_]["CLA"]['MENU'] = $cla->_Menu2(-1, 0, ' class="sf-menu" id="page_menu" style="display:none" ');
    }
    $page_menu = $_SESSION[_PLATFORM_]["CLA"]['MENU'];
    echo $page_menu;
    ?>
			</div>
			<div id="alert_area" style="width:600px;float:right"></div>	
			<?php 
}
?>
		</div>		
	</div>