示例#1
0
         $res = $db->Execute($sql);
         $json_array[] = array('elapsed' => userdate($arr_call), 'value' => $res->fields['total']);
     }
     header('Content-Type: application/json');
     echo json_encode($json_array);
     die;
 }
 if ($_GET['act'] == 'get_sms_table_data') {
     if (!isset($_GET['period'])) {
         $period = 'lifetime';
     }
     $period = $_GET['period'];
     //class based implementation
     require '../classes/dashboard/SMS.php';
     $sms = new SMS();
     $sms->setPeriod($period);
     if ($period == 'custom') {
         $sms->setCustomPeriod($_REQUEST['from'], $_REQUEST['to']);
     }
     header('Content-Type: application/json');
     echo json_encode($sms->get_sms_table_data());
     die;
     //non-class based implementation
     $where = " WHERE 1 ";
     if (!$is_su) {
         $where .= " AND gsm_number IN( " . $client_id . " ) \n                {$sms_data_limit_clause} ";
     }
     $rangeArray = getDateRangeFromPeriod($period);
     $calls_date_from = $rangeArray['date_from'];
     $calls_date_to = $rangeArray['date_to'];
     $where .= " AND sms_dt>='{$calls_date_from}' AND sms_dt<='{$calls_date_to}' ";