本文整理汇总了PHP中Emails::get_email_table_data方法的典型用法代码示例。如果您正苦于以下问题:PHP Emails::get_email_table_data方法的具体用法?PHP Emails::get_email_table_data怎么用?PHP Emails::get_email_table_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emails
的用法示例。
在下文中一共展示了Emails::get_email_table_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Emails
die;
}
if ($_GET['act'] == 'get_emails_table_data') {
if (!isset($_GET['period'])) {
$period = 'lifetime';
}
$period = $_GET['period'];
//class based implementation
require '../classes/dashboard/Emails.php';
$email = new Emails();
$email->setPeriod($period);
if ($period == 'custom') {
$email->setCustomPeriod($_REQUEST['from'], $_REQUEST['to']);
}
header('Content-Type: application/json');
echo json_encode($email->get_email_table_data());
die;
//non-class based implementation
$where = "";
if (!$is_su) {
$where = " AND client_id = '" . $client_unbouce_id . "' ";
}
$rangeArray = getDateRangeFromPeriod($period);
$date_from = $rangeArray['date_from'];
$date_to = $rangeArray['date_to'];
$where .= " AND email_date>='{$date_from}' AND email_date<='{$date_to}' ";
$json_array = array();
$sql = "SELECT * FROM emails WHERE 1 {$where} ORDER BY email_date DESC ";
$r = $db->Execute($sql);
foreach ($r as $res) {
$json_array[] = $res;