本文整理匯總了PHP中sms::get_charge_history方法的典型用法代碼示例。如果您正苦於以下問題:PHP sms::get_charge_history方法的具體用法?PHP sms::get_charge_history怎麽用?PHP sms::get_charge_history使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sms
的用法示例。
在下文中一共展示了sms::get_charge_history方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
/* 獲得充值記錄,如果客戶端支持XSLT,則直接發送XML格式的文本到客戶端;
否則在服務器端把XML轉換成XHTML後發送到客戶端。
*/
case 'get_charge_history':
$start_date = isset($_POST['start_date']) ? $_POST['start_date'] : '';
$end_date = isset($_POST['end_date']) ? $_POST['end_date'] : '';
$page_size = isset($_POST['page_size']) ? $_POST['page_size'] : 20;
$page = isset($_POST['page']) ? $_POST['page'] : 1;
$is_xslt_supported = isset($_POST['is_xslt_supported']) ? $_POST['is_xslt_supported'] : 'no';
if ($is_xslt_supported === 'yes') {
$xml = $sms->get_charge_history_by_xml($start_date, $end_date, $page_size, $page);
header('Content-Type: application/xml; charset=utf-8');
//TODO:判斷錯誤信息,鏈上XSLT
echo $xml;
} else {
$result = $sms->get_charge_history($start_date, $end_date, $page_size, $page);
if ($result !== false) {
$smarty->assign('sms_charge_history', $result);
/* 分頁信息 */
$turn_page = array('total_records' => $result['count'], 'total_pages' => intval(ceil($result['count'] / $page_size)), 'page' => $page, 'page_size' => $page_size);
$smarty->assign('turn_page', $turn_page);
$smarty->assign('start_date', $start_date);
$smarty->assign('end_date', $end_date);
assign_query_info();
$smarty->display('sms_charge_history.htm');
} else {
$link[] = array('text' => $_LANG['back_charge_history'], 'href' => 'sms.php?act=display_charge_history_ui');
@($error_detail = $_LANG['server_errors'][$sms->errors['server_errors']['error_no']] . $_LANG['api_errors']['get_history'][$sms->errors['api_errors']['error_no']]);
sys_msg($_LANG['history_query_error'] . $error_detail, 1, $link);
}
}