<?php
function bb_get_list_message_ads()
{
//Ki?m tra Cookie, n?u ko ??ng nh?p thì tr? v? false
$cookie_username=isset(Configs::$_['user_data']['user_id'])?Configs::$_['user_data']['user_id']:'';
try {
isValidAccessAPI();
} catch (\Exception $e) {
echo responseData($e->getMessage(),'yes');return false;
}
$limit=addslashes(getPost('limit','50'));
$page_no=addslashes(getPost('page_no','1'));
if((int)$page_no > 0)
{
$page_no=(int)$page_no-1;
}
if((int)$page_no<=0)
{
$page_no=0;
}
$offset=(int)$page_no*30;
$queryStr='';
$queryStr.="select a.*,b.subject as title,b.username as author ";
$queryStr.=" from bb_message_ads_data as a join bb_message_data as b ON a.message_id=b.message_id ";
$queryStr.=" order by a.ent_dt desc limit ".$offset.",".$limit;
$db=new Database();
$result=$db->query($queryStr);
return $result;
}
|