コード例 #1
0
 function actVisitPerDay()
 {
     global $ST, $post;
     $cond = " DATE(LOG_TIME) BETWEEN '" . dte($post->get('date_from'), 'Y-m-d') . "' AND '" . dte($post->get('date_to'), 'Y-m-d') . "'";
     $noBotCond = " AND TRIM(USER_AGENT) <> ''";
     foreach ($this->bot as $bot) {
         $noBotCond .= " AND USER_AGENT NOT LIKE  '%{$bot}%' ";
     }
     $noBotCond .= " AND REQUEST_URI NOT LIKE '%admin%' ";
     $q = "SELECT COUNT(DISTINCT REMOTE_ADDR) as c_d, DATE(LOG_TIME) AS d FROM sc_loger\r\n\t\t\t\tWHERE {$cond}  {$noBotCond}\r\n\t\t\t\tGROUP BY d";
     $rs = $ST->select($q);
     $result = array();
     while ($rs->next()) {
         $result[$rs->get('d')] = $rs->get('c_d');
     }
     $diagram = new Diagram();
     $diagram->m_width = 3;
     $diagram->m_maxHeight = 220;
     $i = 0;
     foreach ($result as $k => $v) {
         $diagram->m_x[$i] = $k;
         $diagram->m_y[$i] = $v;
         $diagram->m_desc[$i] = preg_replace('|^\\d+-\\d+-|', '', $k);
         $i++;
     }
     echo $diagram->render();
     exit;
 }