<?php
$conf_basedir	= "../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");
checkAuth('63');	//判断登录和权限

$title = "用户意见反馈管理";


$type_array=array('0'=>'请选择','1'=>'产品功能','2'=>'内容运营','3'=>'资讯相关','4'=>'移动相关','5'=>'其他');

//查询条件组合
$where = " where del_flag = '0' ";
//查询条件1（按照时间）
if($cond1 == '1'){
	if($cond1_val1){
		$begin_time = strtotime($cond1_val1);
		$where .= " and dateline >= '".$begin_time."'";
	}
	if($cond1_val2){
		$end_time = strtotime($cond1_val2)+86400;
		$where .= " and dateline <= '".$end_time."'";
	}
}

//查询条件2（问题状态）
if($cond2_val != ''){
	$where .=" and  esta = ".$cond2_val." ";
}

//按类新搜索
if($cond5_val != ''){
	$where .=" and  type = ".$cond5_val." ";
}
 
//查询条件3（电话/邮箱包含字符串）
$cond3_val = trim($cond3_val);
if($cond3 == '1' && $cond3_val){
	$where .= " and telno like '{$cond3_val}%' ";
}elseif($cond3 == '2' && $cond3_val){
	$where .= " and email like '{$cond3_val}%' ";
}

//查询条件4（排序）
$order = '';
if($orderby != '0' && $orderby != null){
	if($asc_desc == '1'){
		$order .= " order by id desc ";
	}elseif($asc_desc == '2'){
		$order .= " order by id asc  ";
	}
}else{
	$order .= " order by id desc ";
}
 
//获得数据当前页面数据
$sql = "SELECT count(*) FROM  user_feedback ".$where;
//echo $sql;
$rows_all = $dbback->GetOne($sql);
 

$rows_perpage = (intval($disp_rows) <= 0) ? (10) : (intval($disp_rows));
//$rows_perpage = 1;
$total_page = ceil($rows_all / $rows_perpage);
$pg = $page_now;
if ($pg != '' && $pg > $total_page) {
    $pg = $total_page;
}
if ($pg == '' || $pg == 0) {
    $pg = 1;
}
$limitstar = ($pg - 1) * $rows_perpage;

$pages = $total_page ;  //计算总页数
$new_pagenavi = new_pagenavi($pg,$pages,$rows_all);

$sql2 = "SELECT id,esta,message,telno,email,dateline,type,remark FROM  user_feedback ".$where." ".$order." limit ".$limitstar.",".$rows_perpage;
$data_info = $dbback->GetAll($sql2);
 
// echo $sql2;

//引用模版文件
include_once(Template("header"));
include_once(Template("feedback/feedback_manage"));
include_once(Template("footer"));
?>