<?php

$kuArrIndexAboutTitle = array();
$kuArrIndexAboutList = array();
$kuArrIndexAboutInfo = array();
if(1)// == $frontendIndexShowAbout)
{
    $strSql = "select * from {$configTableHead}menu where menumodule=1 and lang='{$kuWebsiteCurrLanguage}';";
    $arrMenu = $dbInstance->getList($strSql);
    foreach($arrMenu as $menuInfo)
    {
        $strList = '';
        $strMenuTitle = '';
        $menuId = $menuInfo['id'];
        $menuName = $menuInfo['menutitle'];
        $menuUrl = $kuHttpPath."about/index.php?lang='{$kuWebsiteCurrLanguage}'&menuid={$menuId}"; 
        $strMenuTitle = "<span class=\"more\"><a href=\"{$menuUrl}\">{$kuCaptionCommonMore}</a></span><span class='titlename'><a href=\"{$menuUrl}\">{$menuName}</a></span>";
        $kuArrIndexAboutTitle[$menuId] = $strMenuTitle;
        
        $arrContent = array();
        $strOrder = getSqlOrderByOfSortType($frontendSortTypeAbout);
        $strSqlContent = "select * from {$configTableHead}menu where lang='{$kuWebsiteCurrLanguage}' and fatherid={$menuId} order by sortnum asc;";
        $arrContent1 = $dbInstance->getList($strSqlContent);
        foreach($arrContent1 as $contentInfo)
        {
            $contentInfo['linkurl'] = $kuHttpPath."about/index.php?lang={$kuWebsiteCurrLanguage}&menuid={$contentInfo['id']}";
            $strList .= "<li><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['menutitle']}\">{$contentInfo['menutitle']}</a></li>\n";
            array_push($arrContent, $contentInfo);
        }
        $kuArrIndexAboutList[$menuId] = $strList;
        $kuArrIndexAboutInfo[$menuId] = $arrContent;
    }
}
//print_r($kuArrIndexAboutTitle);
//print_r($kuArrIndexAboutList);



$kuArrIndexNewsTitle = array();
$kuArrIndexNewsList = array();
$kuArrIndexNewsInfo = array();
if(1 == $frontendIndexShowNews)
{
    $strSql = "select * from {$configTableHead}menu where menumodule=2 and lang='{$kuWebsiteCurrLanguage}';";
    $arrMenu = $dbInstance->getList($strSql);
    foreach($arrMenu as $menuInfo)
    {
        $strList = '';
        $strMenuTitle = '';
        $menuId = $menuInfo['id'];
        $menuName = $menuInfo['menutitle'];
        $menuUrl = $kuHttpPath."news/index.php?lang='{$kuWebsiteCurrLanguage}'&menuid={$menuId}"; 
        $strMenuTitle = "<span class=\"more\"><a href=\"{$menuUrl}\">{$kuCaptionCommonMore}</a></span><span class='titlename'><a href=\"{$menuUrl}\">{$menuName}</a></span>";
        $kuArrIndexNewsTitle[$menuId] = $strMenuTitle;
        
        $arrContent = array();
        $strOrder = getSqlOrderByOfSortType($kuWebsiteIndexSortTypenews);
        $strSqlContent = "select * from {$configTableHead}news where lang='{$kuWebsiteCurrLanguage}' and (type1={$menuId} or type2={$menuId} or type3={$menuId}) and status=1 and showindex=1 order by {$strOrder} limit 0,$kuWebsiteIndexNumbernews;";
        $arrContent1 = $dbInstance->getList($strSqlContent);
        foreach($arrContent1 as $contentInfo)
        {
            $contentInfo['linkurl'] = $kuHttpPath."news/news.php?lang={$kuWebsiteCurrLanguage}&itemid={$contentInfo['id']}";
            $contentInfo['shorttitle'] = CommTool::cutstrutf8($contentInfo['newstitle'], $kuWebsiteIndexLengthnews);
            $contentInfo['addtime5'] = substr($contentInfo['addtime'], 5, 5);
            $strList .= "<li><span class=\"time\">{$contentInfo['addtime5']}</span><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['newstitle']}\">{$contentInfo['shorttitle']}</a></li>\n";
            array_push($arrContent, $contentInfo);
        }
        $kuArrIndexNewsList[$menuId] = $strList;
        $kuArrIndexNewsInfo[$menuId] = $arrContent;
    }
}
//print_r($kuArrIndexNewsTitle);
//print_r($kuArrIndexNewsList);
    
$kuArrIndexProductTitle = array();
$kuArrIndexProductList = array();
$kuArrIndexProductInfo = array();
if(1 == $frontendIndexShowProduct)
{
    $strSql = "select * from {$configTableHead}menu where menumodule=3 and lang='{$kuWebsiteCurrLanguage}';";
    $arrMenu = $dbInstance->getList($strSql);
    foreach($arrMenu as $menuInfo)
    {
        $strList = '';
        $strMenuTitle = '';
        $menuId = $menuInfo['id'];
        $menuName = $menuInfo['menutitle'];
        $menuUrl = $kuHttpPath."product/index.php?lang='{$kuWebsiteCurrLanguage}'&menuid={$menuId}"; 
        $strMenuTitle = "<span class=\"more\"><a href=\"{$menuUrl}\">{$kuCaptionCommonMore}</a></span><span class='titlename'><a href=\"{$menuUrl}\">{$menuName}</a></span>";
        $kuArrIndexProductTitle[$menuId] = $strMenuTitle;
        
        $arrContent = array();
        $strOrder = getSqlOrderByOfSortType($kuWebsiteIndexSortTypeproduct);
        $strSqlContent = "select * from {$configTableHead}product where lang='{$kuWebsiteCurrLanguage}' and (type1={$menuId} or type2={$menuId} or type3={$menuId}) and status=1 and showindex=1 order by {$strOrder} limit 0,$kuWebsiteIndexNumberproduct;";
        $arrContent1 = $dbInstance->getList($strSqlContent);
        foreach($arrContent1 as $contentInfo)
        {
            $contentInfo['linkurl'] = $kuHttpPath."product/product.php?lang={$kuWebsiteCurrLanguage}&itemid={$contentInfo['id']}";
            $contentInfo['imgurlpre'] = $kuUploadPath.$contentInfo['imgurlpre'];
            $contentInfo['shorttitle'] = CommTool::cutstrutf8($contentInfo['producttitle'], $kuWebsiteIndexLengthproduct);
            $contentInfo['addtime5'] = substr($contentInfo['addtime'], 5, 5);
            $strList .= "<li><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['producttitle']}\" class='aproimg'><img src='{$contentInfo['imgurlpre']}' alt='{$contentInfo['producttitle']}' /></a><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['producttitle']}\" class='aprotitle'>{$contentInfo['shorttitle']}</a></li>\n";
            array_push($arrContent, $contentInfo);
        }
        $kuArrIndexProductList[$menuId] = $strList;
        $kuArrIndexProductInfo[$menuId] = $arrContent;
    }
}

$kuArrIndexImgTitle = array();
$kuArrIndexImgList = array();
$kuArrIndexImgInfo = array();
if(1 == $frontendIndexShowImg)
{
    $strSql = "select * from {$configTableHead}menu where menumodule=4 and lang='{$kuWebsiteCurrLanguage}';";
    $arrMenu = $dbInstance->getList($strSql);
    foreach($arrMenu as $menuInfo)
    {
        $strList = '';
        $strMenuTitle = '';
        $menuId = $menuInfo['id'];
        $menuName = $menuInfo['menutitle'];
        $menuUrl = $kuHttpPath."img/index.php?lang='{$kuWebsiteCurrLanguage}'&menuid={$menuId}"; 
        $strMenuTitle = "<span class=\"more\"><a href=\"{$menuUrl}\">{$kuCaptionCommonMore}</a></span><span class='titlename'><a href=\"{$menuUrl}\">{$menuName}</a></span>";
        $kuArrIndexImgTitle[$menuId] = $strMenuTitle;
        
        $arrContent = array();
        $strOrder = getSqlOrderByOfSortType($kuWebsiteIndexSortTypeimg);
        $strSqlContent = "select * from {$configTableHead}img where lang='{$kuWebsiteCurrLanguage}' and (type1={$menuId} or type2={$menuId} or type3={$menuId}) and status=1 and showindex=1 order by {$strOrder} limit 0,$kuWebsiteIndexNumberimg;";
        $arrContent1 = $dbInstance->getList($strSqlContent);
        foreach($arrContent1 as $contentInfo)
        {
            $contentInfo['linkurl'] = $kuHttpPath."img/img.php?lang={$kuWebsiteCurrLanguage}&itemid={$contentInfo['id']}";
            $contentInfo['imgurlpre'] = $kuUploadPath.$contentInfo['imgurlpre'];
            $contentInfo['shorttitle'] = CommTool::cutstrutf8($contentInfo['imgtitle'], $kuWebsiteIndexLengthimg);
            $contentInfo['addtime5'] = substr($contentInfo['addtime'], 5, 5);
            $strList .= "<li><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['imgtitle']}\">{$contentInfo['shorttitle']}</a></li>\n";
            array_push($arrContent, $contentInfo);
        }
        $kuArrIndexImgList[$menuId] = $strList;
        $kuArrIndexImgInfo[$menuId] = $arrContent;
    }
}
    
$kuArrIndexDownloadTitle = array();
$kuArrIndexDownloadList = array();
$kuArrIndexDownloadInfo = array();
if(1 == $frontendIndexShowDownload)
{
    $strSql = "select * from {$configTableHead}menu where menumodule=5 and lang='{$kuWebsiteCurrLanguage}';";
    $arrMenu = $dbInstance->getList($strSql);
    foreach($arrMenu as $menuInfo)
    {
        $strList = '';
        $strMenuTitle = '';
        $menuId = $menuInfo['id'];
        $menuName = $menuInfo['menutitle'];
        $menuUrl = $kuHttpPath."download/index.php?lang='{$kuWebsiteCurrLanguage}'&menuid={$menuId}"; 
        $strMenuTitle = "<span class=\"more\"><a href=\"{$menuUrl}\">{$kuCaptionCommonMore}</a></span><span class='titlename'><a href=\"{$menuUrl}\">{$menuName}</a></span>";
        $kuArrIndexDownloadTitle[$menuId] = $strMenuTitle;
        
        $arrContent = array();
        $strOrder = getSqlOrderByOfSortType($kuWebsiteIndexSortTypedownload);
        $strSqlContent = "select * from {$configTableHead}download where lang='{$kuWebsiteCurrLanguage}' and (type1={$menuId} or type2={$menuId} or type3={$menuId}) and status=1 and showindex=1 order by {$strOrder} limit 0,$kuWebsiteIndexNumberdownload;";
        $arrContent1 = $dbInstance->getList($strSqlContent);
        foreach($arrContent1 as $contentInfo)
        {
            $contentInfo['linkurl'] = $kuHttpPath."download/download.php?lang={$kuWebsiteCurrLanguage}&itemid={$contentInfo['id']}";
            $contentInfo['fileurl'] = $kuUploadPath.$contentInfo['fileurl'];
            $contentInfo['shorttitle'] = CommTool::cutstrutf8($contentInfo['downloadtitle'], $kuWebsiteIndexLengthdownload);
            $contentInfo['addtime5'] = substr($contentInfo['addtime'], 5, 5);
            $strList .= "<li><span class=\"time\">{$contentInfo['addtime5']}</span><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['downloadtitle']}\">{$contentInfo['shorttitle']}</a></li>\n";
            array_push($arrContent, $contentInfo);
        }
        $kuArrIndexDownloadList[$menuId] = $strList;
        $kuArrIndexDownloadInfo[$menuId] = $arrContent;
    }
}

$kuArrIndexJobTitle = array();
$kuArrIndexJobList = array();
$kuArrIndexJobInfo = array();
if(1 == $frontendIndexShowJob)
{
    $strSql = "select * from {$configTableHead}menu where menumodule=6 and lang='{$kuWebsiteCurrLanguage}';";
    $arrMenu = $dbInstance->getList($strSql);
    foreach($arrMenu as $menuInfo)
    {
        $strList = '';
        $strMenuTitle = '';
        $menuId = $menuInfo['id'];
        $menuName = $menuInfo['menutitle'];
        $menuUrl = $kuHttpPath."job/index.php?lang='{$kuWebsiteCurrLanguage}'&menuid={$menuId}"; 
        $strMenuTitle = "<span class=\"more\"><a href=\"{$menuUrl}\">{$kuCaptionCommonMore}</a></span><span class='titlename'><a href=\"{$menuUrl}\">{$menuName}</a></span>";
        $kuArrIndexJobTitle[$menuId] = $strMenuTitle;
        
        $arrContent = array();
        $strOrder = getSqlOrderByOfSortType($kuWebsiteIndexSortTypejob);
        $strSqlContent = "select * from {$configTableHead}job where lang='{$kuWebsiteCurrLanguage}' and (type1={$menuId} or type2={$menuId} or type3={$menuId}) and status=1 and showindex=1 order by {$strOrder} limit 0,$kuWebsiteIndexNumberjob;";
        $arrContent1 = $dbInstance->getList($strSqlContent);
        foreach($arrContent1 as $contentInfo)
        {
            $contentInfo['linkurl'] = $kuHttpPath."job/job.php?lang={$kuWebsiteCurrLanguage}&itemid={$contentInfo['id']}";
            $contentInfo['shorttitle'] = CommTool::cutstrutf8($contentInfo['jobtitle'], $kuWebsiteIndexLengthjob);
            $contentInfo['addtime5'] = substr($contentInfo['addtime'], 5, 5);
            $strList .= "<li><span class=\"time\">{$contentInfo['addtime5']}</span><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['jobtitle']}\">{$contentInfo['shorttitle']}</a></li>\n";
            array_push($arrContent, $contentInfo);
        }
        $kuArrIndexJobList[$menuId] = $strList;
        $kuArrIndexJobInfo[$menuId] = $arrContent;
    }
}

$kuArrIndexMessageTitle = array();
$kuArrIndexMessageList = array();
$kuArrIndexMessageInfo = array();
if(1 == $frontendIndexShowMessage)
{
    $strSql = "select * from {$configTableHead}menu where menumodule=7 and lang='{$kuWebsiteCurrLanguage}';";
    $arrMenu = $dbInstance->getList($strSql);
    foreach($arrMenu as $menuInfo)
    {
        $strList = '';
        $strMenuTitle = '';
        $menuId = $menuInfo['id'];
        $menuName = $menuInfo['menutitle'];
        $menuUrl = $kuHttpPath."message/index.php?lang='{$kuWebsiteCurrLanguage}'&menuid={$menuId}"; 
        $strMenuTitle = "<span class=\"more\"><a href=\"{$menuUrl}\">{$kuCaptionCommonMore}</a></span><span class='titlename'><a href=\"{$menuUrl}\">{$menuName}</a></span>";
        $kuArrIndexMessageTitle[$menuId] = $strMenuTitle;
        
        $arrContent = array();
        $strOrder = getSqlOrderByOfSortType($kuWebsiteIndexSortTypemessage);
        $strSqlContent = "select * from {$configTableHead}message where lang='{$kuWebsiteCurrLanguage}' and (type1={$menuId} or type2={$menuId} or type3={$menuId}) and status=1 and showindex=1 order by {$strOrder} limit 0,$kuWebsiteIndexNumbermessage;";
        $arrContent1 = $dbInstance->getList($strSqlContent);
        foreach($arrContent1 as $contentInfo)
        {
            $contentInfo['linkurl'] = $kuHttpPath."message/message.php?lang={$kuWebsiteCurrLanguage}&itemid={$contentInfo['id']}";
            $contentInfo['shorttitle'] = CommTool::cutstrutf8($contentInfo['messagetitle'], $kuWebsiteIndexLengthmessage);
            $contentInfo['addtime5'] = substr($contentInfo['addtime'], 5, 5);
            $strList .= "<li><span class=\"time\">{$contentInfo['addtime5']}</span><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['messagetitle']}\">{$contentInfo['shorttitle']}</a></li>\n";
            array_push($arrContent, $contentInfo);
        }
        $kuArrIndexMessageList[$menuId] = $strList;
        $kuArrIndexMessageInfo[$menuId] = $arrContent;
    }
}
    
$kuArrIndexFaqTitle = array();
$kuArrIndexFaqList = array();
$kuArrIndexFaqInfo = array();
if(1 == $frontendIndexShowFaq)
{
    $strSql = "select * from {$configTableHead}menu where menumodule=8 and lang='{$kuWebsiteCurrLanguage}';";
    $arrMenu = $dbInstance->getList($strSql);
    foreach($arrMenu as $menuInfo)
    {
        $strList = '';
        $strMenuTitle = '';
        $menuId = $menuInfo['id'];
        $menuName = $menuInfo['menutitle'];
        $menuUrl = $kuHttpPath."faq/index.php?lang='{$kuWebsiteCurrLanguage}'&menuid={$menuId}"; 
        $strMenuTitle = "<span class=\"more\"><a href=\"{$menuUrl}\">{$kuCaptionCommonMore}</a></span><span class='titlename'><a href=\"{$menuUrl}\">{$menuName}</a></span>";
        $kuArrIndexFaqTitle[$menuId] = $strMenuTitle;
        
        $arrContent = array();
        $strOrder = getSqlOrderByOfSortType($kuWebsiteIndexSortTypefaq);
        $strSqlContent = "select * from {$configTableHead}faq where lang='{$kuWebsiteCurrLanguage}' and (type1={$menuId} or type2={$menuId} or type3={$menuId}) and status=1 and showindex=1 order by {$strOrder} limit 0,$kuWebsiteIndexNumberfaq;";
        $arrContent1 = $dbInstance->getList($strSqlContent);
        foreach($arrContent1 as $contentInfo)
        {
            $contentInfo['linkurl'] = $kuHttpPath."faq/faq.php?lang={$kuWebsiteCurrLanguage}&itemid={$contentInfo['id']}";
            $contentInfo['fileurl'] = $kuUploadPath.$contentInfo['fileurl'];
            $contentInfo['shorttitle'] = CommTool::cutstrutf8($contentInfo['faqtitle'], $kuWebsiteIndexLengthfaq);
            $contentInfo['addtime5'] = substr($contentInfo['addtime'], 5, 5);
            $strList .= "<li><span class=\"time\">{$contentInfo['addtime5']}</span><a href=\"{$contentInfo['linkurl']}\" title=\"{$contentInfo['faqtitle']}\">{$contentInfo['shorttitle']}</a></li>\n";
            array_push($arrContent, $contentInfo);
        }
        $kuArrIndexFaqList[$menuId] = $strList;
        $kuArrIndexFaqInfo[$menuId] = $arrContent;
    }
}

?>