本文整理匯總了PHP中Emails::get_emails_data方法的典型用法代碼示例。如果您正苦於以下問題:PHP Emails::get_emails_data方法的具體用法?PHP Emails::get_emails_data怎麽用?PHP Emails::get_emails_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Emails
的用法示例。
在下文中一共展示了Emails::get_emails_data方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Emails
// Emails
////////////////////////////////////////////////////////////////////////////
if ($_GET['act'] == 'get_emails_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_emails_data());
die;
//non-class based implementation
$where = "";
if (!$is_su) {
$where = " AND client_id = '" . $client_unbouce_id . "' \n ORDER BY email_date DESC";
}
$rangeArray = getDateRangeFromPeriod($period);
$date_from = $rangeArray['date_from'];
$date_to = $rangeArray['date_to'];
$arr_dates = createDateRangeArray($date_from, $date_to);
$json_array = array();
foreach ($arr_dates as $arr_call) {
$sql = "SELECT count(*) as total FROM emails ";
$sql .= "WHERE email_date LIKE '%" . $arr_call . "%' {$where}";
// echo $sql;