<?php
include('../common.php');
include('../sql.php');

$versioncode = $_GET['versioncode'];
$count = empty($_GET['count']) ? 20:$_GET['count'];
$imei = $_GET['imei'];
$device_type = $_GET['device_type'];
$os_version = $_GET['os_version'];
$page = empty($_GET['page']) ? 0:$_GET['page'];

$arcid = $_GET['arcid'];

if (empty($arcid)){
	exit();
}else{
	//$sqlwhere .= " and cm_cid=".$arcid;
}

// $querycnt = "Select count(*) totalcnt  
// 		  From ".tname("cm")." feedback where cm_id>-1 ".$sqlwhere;	

$querycnt = feed_back_1($arcid);

$listquerycnt = $_TD->FM($querycnt);
$totalcnt = $listquerycnt[0]['totalcnt'];
		  
		  

//$sqlwhere .= " order by cm_addtime desc limit ".$page*$count.",$count";




// $query = "Select feedback.*  
// 		  From ".tname("cm")." feedback where cm_id>-1 ".$sqlwhere;	

$query = feed_back_2($arcid,$page, $count, $count);

$listmov = $_TD->FM($query);

$listmov = appmaker_commenttackle($listmov);

$caculatecount = count($listmov);

if ($totalcnt<=($page+1)*$count){
$has_more = 'false';
}else{
	$has_more = 'true';
}


$arr = array(
		'message' => 'success',
		'total_number'=> $totalcnt,
		'has_more'=>$has_more,
		'data'=>$listmov
	);
$ret = json_encode($arr);
echo $ret;

?>