<?php

error_reporting(E_ALL);
include('../common.php');
include('../sql.php');
$cache_ret = $AM_CACHE->am_get();
if (!$cache_ret){

$pagesize = $_REQUEST['pagesize'];
$page = $_REQUEST['page'];
$sort = $_REQUEST['sort'];

if ($page=="")
	$page = 0;
if ($pagesize=="")
	$pagesize = 6;

	
$query1 = randomlist_1($page, $pagesize);
$listmov = $_TD->FM($query1);


$query2 = randomlist_2($listmov, $page, $pagesize);
$listmov = $_TD->FM($query2);


$list1 = appmaker_listtackle($listmov);	
	
$arr = array(
		'classpath' => "",
		'keylist' => $list1,
		'count' => count($list1),
		'total' => $pagesize
	);
	

					 
$str = json_encode($arr);

$AM_CACHE->am_set($str);
}else{
	$str = $cache_ret;
}


$callback = $_REQUEST['callback'];
if ($callback=="")
	echo $str;
else
	echo $callback."(".$str.")";


?>