コード例 #1
0
ファイル: ajax2.php プロジェクト: mrimran/dashboard
     echo json_encode($data);
     die;
 }
 if ($_GET['act'] == 'get_calls_data_weekday') {
     if (!isset($_GET['period'])) {
         $period = 'lifetime';
     } else {
         $period = $_GET['period'];
     }
     require '../classes/dashboard/Calls.php';
     $calls = new Calls();
     $calls->setPeriod($period);
     if ($period == 'custom') {
         $calls->setCustomPeriod($_REQUEST['from'], $_REQUEST['to']);
     }
     $data = $calls->get_weekday_stats();
     header('Content-Type: application/json');
     echo json_encode($data);
     die;
 }
 ////////////////////////////////////////////////////////////////////////////
 // Get leads statistics data
 ////////////////////////////////////////////////////////////////////////////
 if ($_GET['act'] === 'get_leads_data') {
     if (!isset($_GET['period'])) {
         $period = 'lifetime';
     } else {
         $period = $_GET['period'];
     }
     //class based implementation
     require '../classes/dashboard/Leads.php';