<include file="Public:top"/>
<script type="text/javascript">
var demo=$("#MyForm").Validform();
</script>
<body>
<div class="head">
<include file="Public:headtop" />
<div class="headwrap clear">
<div class="logo"><a href="__ROOT__"><img src="__PUBLIC__/images/will_07.jpg" /></a></div>
</div>
<div class="menu">
<div class="headwrap">
<span class="cur"><a href="{:U('Problem/index')}">网站帮助</a></span><img src="__PUBLIC__/images/will_21.jpg" />
</div>
</div>
</div>
<!--end head-->
<script type="text/javascript">
$(function(){
$(".exebox,.clickpic").click(function(){
$(this).next().show();
shadow();
});
$(".edittitle span").click(function(){
$(this).parents(".editbox").hide();
$(".wrapbg").remove();
})
})
</script>
<div class="organ">
<div class="organl nobg">
<div class="classify">
<span>问题类别</span>
<ul>
<volist name="cats" id="vo">
<li><a href="{:U('Problem/Cat',array('cid'=>$vo['cat_id']))}">{$vo.name}</a></li>
</volist>
</ul>
</div>
</div>
<!--end organl-->
<div class="organr">
<div class="setbase"><br />
<div class="mesgc">
<span id="my_menu" class="newnav">{$cid|get_problem_cat_name}</span>
<empty name="user">
<span onclick="forbid_submit()" class="newnav">举报不良信息</span>
<else />
<span onclick="display_report_box2()" class="newnav">举报不良信息</span>
</empty>
<div class="memberindex_sixin margintop20">
<if condition="$user.user_id eq ''">
<a onclick="forbid_submit()" href="javascript:;">我要提问</a>
<else />
<a onclick="display_ask_box()" href="javascript:;">我要提问</a>
</if>
</div>
</div>
<div class="mesgcenter" >
<div class="baseset"><br />
<volist name="list" id="vo">
<div class="fabulist indexcenter">
<div class="floatl mrbu">
<a href="#" class="fabuimg"><img src="{$vo.user_id|getAvatar}"></a>
<p><a href="#">{$vo.user_id|getUserName}</a></p>
<p onclick="display_answer_box({$vo.problem_id})"><img src="__PUBLIC__/images/organ/q_11.png" />{$vo.title}</p>
</div>
<div class="fabutext">
<div class="clear"><a href="#" class="indexcentertime">{$vo.addtime|showDate}</a></div>
<div class="clear"><a onclick="display_answer_box({$vo.problem_id})" href="javascript:;" class="indexcentertime blue">回复({$vo.problem_id|get_problem_answer_num})</a></div>
</div>
</div>
</volist>
<br />
<br />
<div class="pages" style="text-align:right;">
{$page}
</div>
<br /><br />
</div>
</div>
</div>
</div>
<!--end organl-->
</div>
<div id="my_box"></div>
<include file="Public:footer"/>
<script type="text/javascript">
function display_ask_box()
{
var url = "{:U('Problem/getAjaxCats')}";
$.get(
url,
function(data)
{
display_ask_box2(data.data);
}
);
}
function display_answer_box(problem_id)
{
var url = "{:U('Problem/getAnswerBoxData')}";
$.get(
url,
{
problem_id:problem_id
},
function(data)
{
display_answer_box2(data.data);
}
);
}
/*提交举报的不良信息*/
function save_report()
{
var arr = new Array();
var url = U("Problem/saveReport",arr,false);
var web = $("#rweb").val();
var content = $("#rcontent").val();
var contact = $("#rcontact").val();
var phone = $("#rphone").val();
/*alert(url);
alert(web);
alert(content);
alert(contact);
alert(phone);*/
$.post(
url,
{
web : web,
content : content,
contact : contact,
phone : phone
},
function(data)
{
alert(data.info);
$("#my_box").html('');
}
);
return false;
}
/*举报不良信息弹出框
*实现了功能,但是cdc已经做了这个。我这个就是多余的了。
*/
function display_report_box2()
{
var box = '<form id="MyForm" onSubmit="return save_report();">';
box += '<div class="editbox" style="display:block">';
box += '<div class="edittitle noborder">';
box += '<h3>举报不良信息</h3><span><img src="__PUBLIC__/images/self_03.jpg" /></span>';
box += '</div>';
box += '<div class="editboxtable">';
box += '<table cellpadding="0" cellspacing="0" border="0" class="indexsetpic">';
box += '<tr>';
box += '<td width="105" style="text-align:right">举报网址:</td>';
box += '<td><input type="text" class="custext" id="rweb" datatype="s1-16" errormsg="标题至少1个字符,最多16个字符!" nullmsg="请填写标题"/></td>';
box += '</tr>';
box += '<tr>';
box += '<td style="text-align:right">举报内容:</td>';
box += '<td><textarea class="tabletextarea" id="rcontent"></textarea></td>';
box += '</tr>';
box += '<tr>';
box += '<td style="text-align:right;vertical-align:top;">举报人:</td>';
box += '<td>';
box += '<input type="text" class="custext" id="rcontact"/>';
box += '</td>';
box += '</tr>';
box += '<tr>';
box += '<td style="text-align:right;vertical-align:top;">联系方法:</td>';
box += '<td>';
box += '<input type="text" class="custext" id="rphone"/>';
box += '</td>';
box += '</tr>';
box += '';
box += '<tr>';
box += '<td></td>';
box += '<td> <input type="submit" value=" 提交 " class="basesubmit"/></td>';
box += '</tr>';
box += '</table>';
box += '<div class="editboxsubmit">';
box += '';
box += '</div>';
box += '</div>';
box += '</div>';
box += '</form>';
$("#my_box").html(box);
var demo=$("#MyForm").Validform();
remove_box();
}
function display_answer_box2(data2)
{
//alert(data2[0]['cat_name']);return false;
var box = '<div class="editbox" style="display:block;height:695px;position:absolute;">';
box += '<div class="edittitle noborder">';
box += '<span><img src="__PUBLIC__/images/self_03.jpg" /></span>';
box += '</div>';
box += '';
box += '<div class="editboxtable questable">';
box += '<div class="questitle">网站帮助</div>';
box += '<div class="ques">';
box += '<div class="questop">';
box += '<span><img src="__PUBLIC__/images/organ/q_11.png" />';
box += data2[0]['title'];
box += '</span>';
box += '<em>问题类别:<a href="javascript:;">';
box += data2[0]['cat_name'];
box += '</a></em>';
box += '</div>';
box += '<p><a href="javascript:;">';
box += data2[0]['user_name'];
box += '</a>|';
box += data2[0]['addtime'];
box += '</p>';
box += '</div><br />';
box += '<div class="questitle">我来帮他解答</div>';
box += '<div class="quseedit">';
box += '<textarea id="content" class="tabletextarea"></textarea><input type="hidden" value="' + data2[0]['problem_id'] + '" id="problem_id" />';
<if condition="$user.user_id eq ''">
box += '<p><input onclick="forbid_submit()" type="button" class="selfsend" value="提交回答" style="font-size:14px"/></p>';
<else />
box += '<p><input onclick="saveAnswer()" type="button" class="selfsend" value="提交回答" style="font-size:14px"/></p>';
</if>
box += '</div>';
box += '';
var data3 = data2[1];
$.each(data3,function(i){
box += '<div class="answerq">';
box += '<a href="#">' + data3[i]['poster'] + '</a>';
box += '<em>' + data3[i]['addtime'] + '</em>';
box += '<p><img src="__PUBLIC__/images/organ/qcheck_11.jpg" />' + data3[i]['content'] + '</p>';
box += '</div>';
});
box += '';
box += '';
box += '</div>';
box += '';
box += '';
box += '';
box += '</div>';
$("#my_box").html(box);
remove_box();
}
function display_ask_box2(data2){
var box = '<div class="editbox" style="display:block;height:435px;">';
box += '<div class="edittitle noborder">';
box += '<h3>我要提问</h3><span><img src="__PUBLIC__/images/self_03.jpg" /></span>';
box += '</div>';
box += '<div class="editboxtable">';
box += '<table cellpadding="0" cellspacing="0" border="0" class="indexsetpic">';
box += '<tr>';
box += '<td width="105" style="text-align:right">问题类别:</td>';
box += '<td><select id="cat_id" name="cat_id">';
$.each(data2,function(i){
box += '<option value="' + data2[i]['cat_id'] + '">' + data2[i]['name'] + '</option>';
});
box += '</select></td>';
box += '</tr>';
box += '<tr>';
box += '<td width="105" style="text-align:right">标题:</td>';
box += '<td><input id="title" type="text" class="custext"/></td>';
box += '</tr>';
box += '<tr>';
box += '<td style="text-align:right">问题内容:</td>';
box += '<td><textarea id="content" class="tabletextarea"></textarea></td>';
box += '</tr>';
box += '';
box += '';
box += '<tr>';
box += '<td></td>';
box += '<td> <input onclick="saveProblem()" type="button" value=" 提交 " class="basesubmit"/></td>';
box += '</tr>';
box += '</table>';
box += '<div class="editboxsubmit">';
box += '';
box += '</div>';
box += '</div>';
box += '</div>';
$("#my_box").html(box);
remove_box();
}
function saveProblem()
{
var url = "{:U('Problem/saveProblem')}";
var cat_id = $("#cat_id").val();
var title = $("#title").val();
var content = $("#content").val();
$.post(url,
{
cat_id:cat_id,
title:title,
content:content
},
function(data)
{
alert(data.info);
hidden_box();
location.reload();
}
);
}
/*保存回答*/
function saveAnswer()
{
var url = "{:U('Problem/saveAnswer')}";
var problem_id = $("#problem_id").val();
var content = $("#content").val();
$.post(url,
{
problem_id:problem_id,
content:content
},
function(data)
{
alert(data.info);
hidden_box();
location.reload();
}
);
}
/**
*关闭弹窗
*/
function remove_box()
{
$(".edittitle span").click(function(){
$(this).parents(".editbox").hide();
$(".wrapbg").remove();
})
}
/**
*弹窗自动消失
*/
function hidden_box()
{
$(".edittitle span").parents(".editbox").hide();
$(".wrapbg").remove();
}
/**
*未登录禁止提交
*/
function forbid_submit()
{
alert("请登录!");
}
</script>