Exemple #1
0
    function onajaxask()
    {
        $search_conf = unserialize(stripslashes($_COOKIE['search_conf']));
        $tag_arr = $search_conf['tag'];
        $game = $search_conf['game'];
        $page = isset($this->post['page']) ? intval($this->post['page']) : 1;
        $imgType = isset($this->post['imgType']) ? intval($this->post['imgType']) : 0;
        $qtype = isset($this->post['qtype']) ? intval($this->post['qtype']) : 0;
        $pagesize = $this->setting['list_default'];
        $quePage = $page == 0 ? 1 : $page;
        $categoryType = '';
        // 获取咨询 ,建议类型 1 咨询,2建议
        if ($imgType == 2) {
            $categoryType = 1;
            // 咨询类型
            $typeCatogary = '[咨询] ';
        } else {
            if ($imgType == 4) {
                $categoryType = 3;
                // 建议类型
                $typeCatogary = '[建议] ';
            }
        }
        $rownum = $_ENV['question']->front_get_num($tag_arr, $game, $categoryType, $qtype);
        if (empty($rownum)) {
            $question_list = array();
        } else {
            $totalPage = @ceil($rownum / $pagesize);
            $quePage > $totalPage && ($quePage = $totalPage);
            $startindex = ($quePage - 1) * $pagesize;
            $question_list = $_ENV['question']->front_question_show($qtype, $tag_arr, $game, $categoryType, $startindex, $pagesize);
            $questr = ajax_page($rownum, $pagesize, $quePage, "list/ajaxask", $imgType, $qtype);
            $allQtypeList = $_ENV['qtype']->GetAllQType(1, '', 0, 1);
            $allQtypeLiList = '';
            $str = '';
            if (!empty($allQtypeList)) {
                foreach ($allQtypeList as $value) {
                    $qtypeComplain = unserialize($value['complain']);
                    if (intval($qtypeComplain['visiable']) == 1) {
                        $allQtypeLiList .= "<li onclick=\"gotopage('?list/ajaxask',1,{$imgType},{$value['id']})\">{$value['name']}</li>";
                    }
                    if ($value['name'] == "申请理赔") {
                        $allQtypeLiList .= "<li onclick=\"gotopage('?list/ajaxask',1,{$imgType},{$value['id']})\">{$value['name']}</li>";
                    }
                }
            }
        }
        if (!empty($question_list)) {
            $str .= '<dl class="b_top">
                            <dd>
                              	<span class="titlenew1  t_cen">问题描述</span>
                              	<span class="titlenew2">
			 						<span class="listselect_type">问题类型</span>
		 							<ul class="list_select">' . $allQtypeLiList . '</ul>
		 						</span>
                                <span class="titlenew3 color_999">提问时间</span>
		 			            <span class="titlenew4 color_999">回复时间</span>
                                <span class="titlenew5">回复状态</span>
                                <span class="titlenew6">浏览量</span>
                            </dd>
                    </dl>';
            $str .= '<dl id="info' . $imgType . '">';
            foreach ($question_list as $key => $QueList) {
                $qtype = $_ENV['qtype']->GetQType($QueList['qtype']);
                $category = !empty($qtype['name']) ? $qtype['name'] : '其他问题 ';
                if ($QueList['status'] == 1) {
                    // changed
                    $s_class = '<span class="c_f00">回复中</span>';
                } else {
                    $s_class = '<span class="c_090">已回复</span>';
                }
                if (mb_strlen($QueList['time'], 'UTF-8') > 9) {
                    $classAskTime = 'titlenew3 line_h18';
                } else {
                    $classAskTime = 'titlenew3';
                }
                $str .= '<dd>';
                $category = ajax_page_single($category, $pagesize, $quePage, "list/ajaxask", $imgType, $QueList['qtype']);
                $str .= '<span class="titlenew1"><a href="?question/detail/' . $QueList['id'] . '/' . $imgType . '" target="_blank">' . cutstr($typeCatogary . $QueList['description'], $this->count, '..') . '</a></span>';
                $str .= '<span class="titlenew2">' . $category . '</span>';
                $str .= '<span class="' . $classAskTime . '">' . $QueList['time'] . '</span>';
                $str .= '<span class="titlenew4">' . $QueList['Atime'] . '</span>';
                $str .= '<span class="titlenew5">' . $s_class . '</span>';
                $str .= '<span class="titlenew6">' . $QueList['views'] . '</span>';
                $str .= '</dd>';
            }
            $str .= '</dl>';
            $str .= '<div class="pagination">' . $questr . '</div>';
        } else {
            $str .= '<div class="message_box"><s class="ico_warning_5"></s>啊噢,没有相关的问题噢,您可以尝试修改条件重新搜索。</div>';
        }
        echo $str . '<script type="text/javascript">$("#info' . $imgType . ' dd:even").attr("className", "bg_gray");</script>';
    }
Exemple #2
0
    function onajaxdustbin()
    {
        $page = isset($this->post['page']) ? intval($this->post['page']) : 1;
        $imgType = isset($this->post['imgType']) ? intval($this->post['imgType']) : 0;
        $qtype = isset($this->post['qtype']) ? intval($this->post['qtype']) : 0;
        $pagesize = $this->setting['list_default'];
        $dustbinCidType = $_ENV['question']->getType(4);
        // 获取垃圾箱问题分类
        $where = $_ENV['question']->front_getWhere($dustbinCidType, "", $qtype, 'month');
        $rownum = $_ENV['question']->front_getNum($where);
        if (empty($rownum)) {
            $question_list = array();
        } else {
            $quePage = $page == 0 ? 1 : $page;
            $totalPage = @ceil($rownum / $pagesize);
            $quePage > $totalPage && ($quePage = $totalPage);
            $startindex = ($quePage - 1) * $pagesize;
            $question_list = $_ENV['question']->front_get_list($where, $startindex, $pagesize, 2);
            $questr = ajax_page($rownum, $pagesize, $quePage, "index/ajaxdustbin", $imgType, $qtype);
            $str .= '';
            $allQtypeList = $_ENV['qtype']->GetAllQType(1, '', 0, 1);
            $allQtypeLiList = '';
            $str = '';
            if (!empty($allQtypeList)) {
                foreach ($allQtypeList as $value) {
                    $qtypeComplain = unserialize($value['complain']);
                    if (intval($qtypeComplain['visiable']) == 1) {
                        $allQtypeLiList .= "<li onclick=\"gotopage('?index/ajaxdustbin',1,{$imgType},{$value['id']})\">{$value['name']}</li>";
                    }
                    if ($value['name'] == "申请理赔") {
                        $allQtypeLiList .= "<li onclick=\"gotopage('?index/ajaxdustbin',1,{$imgType},{$value['id']})\">{$value['name']}</li>";
                    }
                }
            }
        }
        if (!empty($question_list)) {
            $str .= '<dl class="b_top">
                            <dd>
                              	<span class="title7 t_cen">问题描述</span>
                              	<span class="title6 titlenew2">
    								<span class="listselect_type">问题类型</span>
		 							<ul class="list_select">' . $allQtypeLiList . '</ul>
		 						</span>
                                <span class="titlenew3 color_999">提问时间</span>
                                <span class="title4 color_999">原因</span>
                                <span class="titlenew6">浏览量</span>
                            </dd>
                    </dl>';
            $str .= '<dl id="info' . $imgType . '">';
            foreach ($question_list as $key => $QueList) {
                $qtype = $_ENV['qtype']->GetQType($QueList['qtype']);
                $category = !empty($qtype['name']) ? $qtype['name'] : '其他问题 ';
                if (mb_strlen($QueList['time'], 'UTF-8') > 9) {
                    $classAskTime = 'titlenew3 line_h18';
                } else {
                    $classAskTime = 'titlenew3';
                }
                $str .= '<dd>';
                $category = ajax_page_single($category, $pagesize, $quePage, "index/ajaxdustbin", $imgType, $QueList['qtype']);
                $str .= '<span class="title7"><a href="?question/detail/' . $QueList['id'] . '/' . $imgType . '" target="_blank">' . cutstr('[垃圾箱] ' . $QueList['description'], 28, '..') . '</a></span>';
                $str .= '<span class="title6">' . $category . '</span>';
                $str .= '<span class="' . $classAskTime . '">' . $QueList['time'] . '</span>';
                $str .= '<span class="title4">' . $QueList['comment'] . '</span>';
                $str .= '<span class="titlenew6">' . $QueList['views'] . '</span>';
                $str .= '</dd>';
            }
            $str .= '</dl>';
            $str .= '<div class="pagination">' . $questr . '</div>';
        } else {
            $str .= '<div class="message_box"><s class="ico_warning_5"></s>啊噢,没有相关的问题噢,您可以尝试修改条件重新搜索。</div>';
        }
        echo $str . '<script type="text/javascript">$("#info' . $imgType . ' dd:even").attr("className", "bg_gray");</script>';
    }