* @copyright 2003 * @package appl * @subpackage stats */ //------------------------------------------------------------------------------ /** * Requires GSite base class */ require_once 'classes/gsite_object.php'; /** * Requires annu API */ require_once 'php/api_annu.php'; //============================================================================== /** * Main class, subclass of gsiteClass * * @package appl * @subpackage stats */ //============================================================================== class statsClass extends gsiteClass { /** * True if result is an CSV flow * @var boolean */ var $excel_ = false; /** * True if auth is needed * @var boolean */ var $withAuth_ = false; /** * Annu filter for limited authentification * @var string */ var $filter_ = ''; /** * Action to perform (abstract, graph, user, map) * @var string */ var $what_ = ''; /** * Period (days count) for statistics * @var integer */ var $period_ = 0; /** * For which locale we perform the stats ? * @var string */ var $statsLocale_ = ''; /** * Users excluded from stats * @var string */ var $noUsersRaw_ = ''; /** * Users excluded from stats (SQL condition) * @var string */ var $noUsers_ = ''; /** * Users excluded from stats (SQL condition) * @var string */ var $noUsersStats_ = ''; //============================================================================ // CLASS METHODS //============================================================================ //============================================================================ /** * Build a single instance of the class. * * @static * @param array $args application arguments * @return object */ //============================================================================ function & factory ($args = null) { static $S_instance = null; if ($S_instance == null) { $S_instance = new statsClass ($args); } return $S_instance; } //============================================================================ /** * Run the single instance of the class. * * @static * @param array $args application arguments * @return string */ //============================================================================ function run ($args = null) { //-------------------------------------------------------------------------- // Get object. $object =& statsClass::factory ($args); //-------------------------------------------------------------------------- // Check installation (labels). $tables = array (); if (! $object->checkInstall ($tables, $installForm)) return $installForm; //-------------------------------------------------------------------------- // Manage auth. if (! $object->manageAuth ($loginForm)) return $loginForm; //-------------------------------------------------------------------------- // Run engine management. return $object->runStats (); } //============================================================================ /** * Build footer. * * @static * @return string */ //============================================================================ function footer () { $object =& statsClass::factory (); if ($object->what_ == 'map') { $excel = ''; } else { $args = '&fct=excel'; $args .= '&project='.rawurlencode ($object->project_); $args .= '&projectadm='.rawurlencode ($object->projectadm_); $args .= '&stats_auth='.($object->withAuth_ ? 'true' : 'false'); $args .= '&stats_filter='.rawurlencode ($object->filter_); $args .= '&stats_what='.rawurlencode ($object->what_); $args .= '&stats_period='.rawurlencode ($object->period_); $args .= '&stats_locale='.rawurlencode ($object->statsLocale_); $args .= '&stats_nousers='.rawurlencode ($object->noUsersRaw_); $args = "'stats/stats','$args',660,400,'stats_excel'"; $excel = ''. ''. ''; } return gs_manageAuthFooter ('', $excel); } //============================================================================ /** * Class constructor * * The following arguments are used: * * * @global array page arguments * @param array $args arguments */ //============================================================================ function statsClass ($args = null) { //-------------------------------------------------------------------------- // Call parent constructor. parent::gsiteClass ($args); if (empty ($this->application_)) $this->application_ = 'stats'; //-------------------------------------------------------------------------- // We need some arguments, typically from page. But, sometimes, the // application will not be called from a page (portal use, for example). In // this case, the supplied $args arguments array will be used. global $GS_ARGUMENTS; if (empty ($args)) $args = $GS_ARGUMENTS; $this->excel_ = (isset ($args['excel']) ? $args['excel'] == 'true' : false); $this->withAuth_ = (isset ($args['auth']) ? $args['auth'] == 'true' : false); $this->filter_ = (isset ($args['filter']) ? $args['filter'] : ''); $this->what_ = (isset ($args['what']) ? $args['what'] : 'map'); $this->period_ = (isset ($args['period']) ? $args['period'] : 31); $this->statsLocale_ = (isset ($args['locale']) ? $args['locale'] : $this->locale_); if (! empty ($args['no_users'])) { $noUsersArray = explode ('|', $args['no_users']); $this->noUsersRaw_ = $args['no_users']; $this->noUsers_ = ''; $this->noUsersStats_ = ''; while (list ($k, $v) = each ($noUsersArray)) { $this->noUsers_ .= " and U_ID != $v "; $this->noUsersStats_ .= " and SS_USER_ID != $v "; } } else { $this->noUsersRaw_ = ''; } } //============================================================================ /** * Manages user login. Returns true on success (login success, or no login needed). * * @param string $outputText if login is needed, login form (return value) * @return boolean */ //============================================================================ function manageAuth (&$outputText) { require_once 'php/auth_object_login.php'; $loginObj = new authLoginClass (); return $this->manageAuthWithObject ($loginObj, $outputText); } //============================================================================ /** * Manages user login, according to a special object. * * Note that a login process is iniated iff action is admin or $this->withAuth_ * is true. * * @see manageAuth() * @param object $loginObj this object defines the login policy * @param string $outputText if login is needed, login form (return value) * @return boolean */ //============================================================================ function manageAuthWithObject (&$loginObj, &$outputText) { //-------------------------------------------------------------------------- // We need a login ? if (! $this->withAuth_) return true; //-------------------------------------------------------------------------- // We need a login. if (! gs_manageAuthWithObject ($this->db_, $this->link_, $loginObj, $outputText)) return false; //-- Call parent method (updates $userID_, and so one). $authResult = gsiteClass::manageAuth ($outputText); if ($authResult) { //-- We have to use a filter ? if (! empty ($this->filter_) && (! $this->isAdministrator_)) { $users = gsapi_annu_getUsersFromFilter ($this, $this->filter_); $canLogin = false; while (list ($k, $v) = each ($users)) { if ($v->U_ID == $this->userID_) { $canLogin = true; break; } } if (! $canLogin) { $outputText = "\n".''. "\n".' '.$this->label ('adm_not_admin', 'gsite').''. "\n".''; return false; } } } return $authResult; } //============================================================================ /** * Switch action, run stats * * @return string */ //============================================================================ function runStats () { //-------------------------------------------------------------------------- // Build result. switch ($this->what_) { case 'abstract' : return $this->runAbstract (); case 'graph' : return $this->runGraph (); case 'user' : return $this->runUser (); case 'map' : default : return $this->runMap (); } } //============================================================================ /** * Build project map * * @return string */ //============================================================================ function runMap () { //-------------------------------------------------------------------------- // Get meta-project name. $metaPrj = $this->metaProject ($this->projectadm_); //-------------------------------------------------------------------------- // Get projects. $query = "select * from $this->db_.".gsapi_tables ('META_PROJECT'). " where MP_META='$metaPrj'". " order by MP_ORDER"; $resultPrj = $this->query ($query); //-------------------------------------------------------------------------- // For all projects... $text = ''; while ($prjRow = apidb_fetch_object ($resultPrj)) { $text .= $this->runMapForProject ($prjRow->MP_PROJECT); } apidb_free_result ($resultPrj); //-- No meta-project ? if ($text == '') { $text = $this->runMapForProject ($this->projectadm_); } return "\n".''. "\n".' '.$text.''. "\n".''; } //============================================================================ /** * Build map for one project * * @param string $project project name * @return string */ //============================================================================ function runMapForProject ($project) { //-------------------------------------------------------------------------- // Get project look. $query = "select * from $this->db_.".gsapi_tables ('PROJECT')." where GS_PROJECT='$project'"; $prjRes = $this->query ($query); $prjRow = apidb_fetch_object ($prjRes); apidb_free_result ($prjRes); if (empty ($prjRow)) return ''; $look = $prjRow->GS_LOOK_NAME; //-------------------------------------------------------------------------- // Get pages. $query = "select". " M1_ORDER, M1_TEXT". ", M2_ORDER, M2_TEXT". ", D_NAME". ", P_ORDER, P_TITLE, P_INDEX ". ", count(SS_SESSION_ID) as TOTAL". " from". " $this->db_.".gsapi_tables ('MENU_LEVEL_1'). ", $this->db_.".gsapi_tables ('MENU_LEVEL_2'). ", $this->db_.".gsapi_tables ('DOCUMENT'). ", $this->db_.".gsapi_tables ('PAGE'). ", $this->db_.".gsapi_tables ('SESSION_STATS'). " where". " M1_LOOK_NAME='$look'". " and M2_LOOK_NAME='$look'". " and D_PROJECT='$project'". " and M1_LOCALE='$this->statsLocale_'". " and M2_LOCALE='$this->statsLocale_'". " and D_LOCALE='$this->statsLocale_'". " and SS_LOCALE='$this->statsLocale_'". " and M2_PARENT=M1_NAME". " and D_NAME=M2_DOCUMENT". " and P_DOCUMENT=D_INDEX". " and SS_PAGE_ID=P_INDEX". ($this->period_ > 0 ? " and SS_DATE > date_sub(now(), interval $this->period_ day)" : ''). $this->noUsersStats_. " group by SS_PAGE_ID". " order by M1_ORDER, M2_ORDER, P_ORDER"; $result = $this->query ($query); //-------------------------------------------------------------------------- // Store result in temp array. $map = array (); $total = 0; while ($row = apidb_fetch_object ($result)) { if (empty ($map[$row->M1_ORDER])) { $map[$row->M1_ORDER] = array ( 'title' => ($row->M1_TEXT == '' ? '???' : $row->M1_TEXT), 'level2' => array ()); } if (empty ($map[$row->M1_ORDER]['level2'][$row->M2_ORDER])) { $map[$row->M1_ORDER]['level2'][$row->M2_ORDER] = array ( 'title' => ($row->M2_TEXT == '' ? '???' : $row->M2_TEXT), 'pages' => array ()); } if (empty ($map[$row->M1_ORDER]['level2'][$row->M2_ORDER]['pages'][$row->P_ORDER])) { $map[$row->M1_ORDER]['level2'][$row->M2_ORDER]['pages'][$row->P_ORDER] = array ( 'title' => ($row->P_TITLE == '' ? $row->P_INDEX : $row->P_TITLE), 'total' => $row->TOTAL); } $total += $row->TOTAL; } apidb_free_result ($result); //-------------------------------------------------------------------------- // Build HTML. $text = ''; while (list ($k1, $menu1) = each ($map)) { $text2 = ''; while (list ($k2, $menu2) = each ($menu1['level2'])) { $textp = ''; while (list ($kp, $page) = each ($menu2['pages'])) { $textp .= "\n".''. "\n".' '. "\n".' '.gs_htmlentities ($page['title']).''. "\n".' '. "\n".' '.gs_htmlentities ($page['total']).''. "\n".''; } $title = gs_htmlentities ($menu2['title']); if (! empty ($textp)) { $textpdn = 'div_'.$project.'_'.$k1.'_'.$k2; $textp = ''. $textp. "\n".'
'; $textp = ''; $title = ''. $title. ''. $textp; } $text2 .= "\n".''. "\n".' '. "\n".' '.$title.''. "\n".''; } $title = gs_htmlentities ($menu1['title']); if (! empty ($text2)) { $text2dn = 'div_'.$project.'_'.$k1; $text2 = ''. $text2. "\n".'
'; $text2 = ''; $title = ''. $title. ''. $text2; } $text .= "\n".''. "\n".' '. "\n".''. "\n".''. "\n".' '.$title.''. "\n".''; } $text = ''. "\n".' '. "\n".' '. "\n".' '. $text. "\n".'
 '. gs_htmlentities ($prjRow->GS_TITLE). ', '.$this->label ('stats_pages').' : '.$total. ($this->period_ > 0 ? ' ('.$this->label ('stats_days').' : '.$this->period_.')' : ''). '
'; return $text; } //============================================================================ /** * Build abstract * * @return string */ //============================================================================ function runAbstract () { //========================================================================== /** * Convert seconds count to a number of days * * @return string */ //========================================================================== function secToHMS (&$obj, $seconds) { $days = (int)($seconds / 86400); $hours = (int)(($seconds - $days*86400) / 3600); $min = (int)(($seconds - $days*86400 - $hours*3600) / 60); $sec = $seconds - ($days*86400 + $hours*3600 + $min*60); $label = $obj->label ('stats_days'); return (empty ($days) ? sprintf ('%02d:%02d:%02d', $hours, $min, $sec) : sprintf ('%d %s, %02d:%02d:%02d', $days, $label, $hours, $min, $sec)); } //-------------------------------------------------------------------------- // Get meta-project name. $metaPrj = $this->metaProject ($this->projectadm_); //-------------------------------------------------------------------------- // Get and count sessions. $query = "select SS_SESSION_ID". ", count(SS_SESSION_ID) as TOTAL". ", min(SS_DATE) as START". ", max(SS_DATE) as END". " from $this->db_.".gsapi_tables ('SESSION_STATS'). " where SS_PROJECT='$metaPrj'". ($this->period_ > 0 ? " and SS_DATE > date_sub(now(), interval $this->period_ day)" : ''). $this->noUsersStats_. " group by SS_SESSION_ID"; $result = $this->query ($query); $sessionsCount = apidb_num_rows ($result); if ($sessionsCount == 0) { $text = "\n".''. "\n".' '.$this->label ('stats_no_visits').''. "\n".''; } else { $maxPages = 0; $totalPages = 0; $maxDelay = 0; $totalDelay = 0; $minDate = time (); $maxDate = 0; $sessionArray = array (); while ($row = apidb_fetch_object ($result)) { $start = strtotime ($row->START); $end = strtotime ($row->END); $duration = ($end - $start); $totalDelay += $duration; if ($duration > $maxDelay) $maxDelay = $duration; $totalPages += $row->TOTAL; if ($row->TOTAL > $maxPages) $maxPages = $row->TOTAL; if ($start < $minDate) $minDate = $start; if ($end > $maxDate) $maxDate = $end; } $visitsDay = round ($sessionsCount / (($maxDate - $minDate) / 86400)); $medPagesVisit = round ($totalPages/$sessionsCount); $maxDelay = secToHMS ($this, $maxDelay); $medDelay = secToHMS ($this, $totalDelay / $sessionsCount); if ($this->excel_) { $text = ''."\n". ' '."\n". ' '. ''."\n". ' '."\n". ' '."\n". ' '. ''."\n". ' '."\n". ' '."\n". ' '. ''."\n". ''."\n". ' '."\n". ' '."\n". ' '. ''."\n". ' '."\n". ' '."\n". ' '. ''."\n". ' '."\n". ' '."\n". ' '. ''."\n". ' '."\n". ' '."\n". ' '. ''."\n". ' '."\n". ' '."\n". ' '. ''."\n". ' '."\n". '
'.$this->label ('stats_visits_count').''.$sessionsCount.'
'.$this->label ('stats_pages_count').''.$totalPages.'
'.$this->label ('stats_period').''.$this->localizeTimestamp ($minDate).''.$this->localizeTimestamp ($maxDate).'
'.$this->label ('stats_visits_a_day').''.$visitsDay.'
'.$this->label ('stats_max_pages_visit').''.$maxPages.'
'.$this->label ('stats_med_pages_visit').''.$medPagesVisit.'
'.$this->label ('stats_max_delay').''.$maxDelay.'
'.$this->label ('stats_med_delay').''.$medDelay.'
'."\n"; } else { $text = "\n".''. "\n".'  '.$this->label ('stats_visits_count').' : '. "\n".'  '.$sessionsCount.''. "\n".''. "\n".''. "\n".' '. "\n".' '. "\n".''. "\n".''. "\n".'  '.$this->label ('stats_pages_count').' : '. "\n".'  '.$totalPages.''. "\n".''. "\n".''. "\n".' '. "\n".''. "\n".''. "\n".'  '.$this->label ('stats_period').' : '. "\n".'  '. $this->localizeTimestamp ($minDate). ' - '. $this->localizeTimestamp ($maxDate). ' ('.secToHMS ($this, $maxDate - $minDate).')'. ''. "\n".''. "\n".''. "\n".' '. "\n".''. "\n".''. "\n".'  '.$this->label ('stats_visits_a_day').' : '. "\n".'  '.$visitsDay.''. "\n".''. "\n".''. "\n".' '. "\n".''. "\n".''. "\n".'  '.$this->label ('stats_max_pages_visit').' : '. "\n".'  '.$maxPages.''. "\n".''. "\n".''. "\n".' '. "\n".''. "\n".''. "\n".'  '.$this->label ('stats_med_pages_visit').' : '. "\n".'  '.$medPagesVisit.''. "\n".''. "\n".''. "\n".' '. "\n".''. "\n".''. "\n".'  '.$this->label ('stats_max_delay').' : '. "\n".'  '.$maxDelay.''. "\n".''. "\n".''. "\n".' '. "\n".''. "\n".''. "\n".'  '.$this->label ('stats_med_delay').' : '. "\n".'  '.$medDelay.''. "\n".''; } } apidb_free_result ($result); if ($this->excel_) return $text; return "\n".''. "\n".' '. $text. "\n".'
'. "\n".''; } //============================================================================ /** * Build graph * * @return string */ //============================================================================ function runGraph () { //-------------------------------------------------------------------------- // Get meta-project name. $metaPrj = $this->metaProject ($this->projectadm_); //-------------------------------------------------------------------------- // Get and count sessions. $query = "select SS_SESSION_ID". ", count(SS_SESSION_ID) as TOTAL". ", min(SS_DATE) as START". " from $this->db_.".gsapi_tables ('SESSION_STATS'). " where SS_PROJECT='$metaPrj'". ($this->period_ > 0 ? " and SS_DATE > date_sub(now(), interval $this->period_ day)" : ''). $this->noUsersStats_. " group by SS_SESSION_ID"; $result = $this->query ($query); //-------------------------------------------------------------------------- // Store visits in days array. $daysArray = array (); $pagesArray = array (); while ($row = apidb_fetch_object ($result)) { sscanf ($row->START, '%d-%d-%d', &$year, &$month, &$day); $tag = sprintf ('%4d-%02d-%02d', $year, $month, $day); if (empty ($daysArray[$tag])) { $daysArray[$tag] = 1; } else { $daysArray[$tag]++; } if (empty ($pagesArray[$tag])) { $pagesArray[$tag] = $row->TOTAL; } else { $pagesArray[$tag] += $row->TOTAL; } } apidb_free_result ($result); //-- Sort arrays. krsort ($daysArray); krsort ($pagesArray); //-------------------------------------------------------------------------- // Draw graphs. //-- Visits. $graphArray1 = array (); $max1 = 0; while (list ($k, $v) = each ($daysArray)) { if ($v > $max1) $max1 = $v; $graphArray1[] = array ( 'text' => $this->localizeDate ($k), 'value' => $v); } //-- Pages. $graphArray2 = array (); $max2 = 0; while (list ($k, $v) = each ($pagesArray)) { if ($v > $max2) $max2 = $v; $graphArray2[] = array ( 'text' => $this->localizeDate ($k), 'value' => $v); } //-------------------------------------------------------------------------- // Excel. if ($this->excel_) { $graph1 = ''; foreach ($graphArray1 as $g) { $graph1 .= ' '."\n". ' '.$g['text'].''."\n". ' '.$g['value'].''."\n". ' '."\n"; } $graph1 = ''."\n". $graph1. '
'."\n"; $graph2 = ''; foreach ($graphArray2 as $g) { $graph2 .= ' '."\n". ' '.$g['text'].''."\n". ' '.$g['value'].''."\n". ' '."\n"; } $graph2 = ''."\n". $graph2. '
'."\n"; return ''."\n". ' '."\n". ' '."\n". ' '."\n". ' '."\n". ' '."\n". ' '."\n". ' '."\n". ' '."\n". ' '."\n". ' '."\n". '
'.$this->label ('stats_graph_pages').''.$this->label ('stats_graph_visits').'
'.$graph1.''.$graph2.'
'."\n"; } //-------------------------------------------------------------------------- // HTML. $graph1 = $this->htmlGraph ($graphArray1, $max1, 180); $graph2 = $this->htmlGraph ($graphArray2, $max2, 180); return "\n".''. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".'
'.$this->label ('stats_graph_pages').''.$this->label ('stats_graph_visits').'
'.$graph1.''.$graph2.'
'. "\n".''; } //============================================================================ /** * Build graph for an user * * @return string */ //============================================================================ function runUser () { //-------------------------------------------------------------------------- // Get meta-project name. $metaPrj = gs_sessionGetProjectName ($this->db_, $this->link_, $this->projectadm_); //-------------------------------------------------------------------------- // Get and count users. $query = "select U_ID, U_NAME, U_SURNAME, U_LOGIN". ", count(SS_SESSION_ID) as TOTAL". " from $this->db_.SESSION_STATS". " left join $this->db_.annu_USERS on SS_USER_ID=U_ID". " where SS_PROJECT='$metaPrj'". ($this->period_ > 0 ? " and SS_DATE > date_sub(now(), interval $this->period_ day)" : ''). $this->noUsers_. " group by SS_USER_ID". " order by TOTAL desc"; $result = $this->query ($query); $graphArray = array (); $max = 0; while ($row = apidb_fetch_object ($result)) { if (empty ($row->U_ID)) continue; if ($row->TOTAL > $max) $max = $row->TOTAL; $graphArray[] = array ( 'text' => $row->U_NAME.(empty ($row->U_SURNAME) ? '' : ' '.$row->U_SURNAME), 'value' => $row->TOTAL); } apidb_free_result ($result); //-------------------------------------------------------------------------- // Excel. if ($this->excel_) { $graph = ''; foreach ($graphArray as $g) { $graph .= ' '."\n". ' '.$g['text'].''."\n". ' '.$g['value'].''."\n". ' '."\n"; } return ''."\n". ' '."\n". ' '."\n". ' '."\n". ' '."\n". $graph. '
'.$this->label ('stats_graph_pages').''.$this->label ('stats_graph_visits').'
'."\n"; } //-------------------------------------------------------------------------- // HTML. $graph = $this->htmlGraph ($graphArray, $max); return "\n".''. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".'
'. $this->label ('stats_graph_users'). ($this->period_ > 0 ? ' ('.$this->label ('stats_days').' : '.$this->period_.')' : ''). '
'.$graph.'
'. "\n".''; } //============================================================================ /** * Build a vertical HTML bar-graph * * @param array $values values array, with keys value and text * @param integer $max max value * @param integer $size graph width * @param integer $height height of each row * @return string */ //============================================================================ function htmlGraph (&$values, $max, $size = 200, $height = 20) { $text = ''; $style = 'text1'; reset ($values); while (list ($k, $v) = each ($values)) { $width = (int)(($v['value'] / $max) * $size); $text .= "\n".''. "\n".'  '.gs_htmlentities ($v['text']).' '. "\n".'  '.gs_htmlentities ($v['value']).' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".' '. "\n".'
'. "\n".''; $style = ($style == 'text1' ? 'text2' : 'text1'); } return ''. $text. "\n".'
'; } } //------------------------------------------------------------------------------ // $Log: stats_class.php,v $ // Revision 1.4 2007/02/02 15:27:16 bouba // When empty page title put pagendx // // Revision 1.3 2004/05/05 17:48:53 bouba // project bug on excel link // // Revision 1.2 2003/10/28 12:45:01 lc // Use gs_htmlentities // // Revision 1.1 2003/10/28 11:58:07 lc // Initial revision. // //-- End of source ------------------------------------------------------------ ?> * @copyright 2003 * @package appl * @subpackage stats */ //------------------------------------------------------------------------------ /** * Stats main class */ require_once PATH_STD.'/stats/stats_class.php'; //============================================================================== /** * Function to be called to dump document (old method) * * Now, this function only call {@link gusClass::run()} static method. * * @return string */ //============================================================================== function putFrame ($db, $link, $DOCrow, $PAGEresult, $CURRENTPAGErow, $innerTableWidth, $innerTableSpacing) { return statsClass::run (); } //============================================================================== /** * Footer generation (old method) * * Now, this function only call {@link gusClass::footer()} static method. * * @return string */ //============================================================================== function putFooter () { return statsClass::footer (); } //============================================================================== /** * Download Excel file * * This function dump an HTML page who will start the download. * * @global string popup title * @return string */ //============================================================================== function excel () { global $popupTitle; //---------------------------------------------------------------------------- // Build arguments. $args = array (); $args['excel'] = gs_get ('stats_excel'); $args['project'] = gs_get ('project'); $args['projectadm'] = gs_get ('projectadm'); $args['auth'] = gs_get ('stats_auth'); $args['filter'] = gs_get ('stats_filter'); $args['what'] = gs_get ('stats_what'); $args['period'] = gs_get ('stats_period'); $args['locale'] = gs_get ('stats_locale'); $args['no_users'] = gs_get ('stats_nousers'); //---------------------------------------------------------------------------- // Build page. if ($args['excel'] == 'true') { //-------------------------------------------------------------------------- // Start download. $excel = statsClass::run ($args); header ("Content-type: application/vnd.ms-excel"); header ('Content-Disposition: attachment; filename="stats.xls"'); exit ($excel); } else { //-------------------------------------------------------------------------- // HTML page. $object =& statsClass::factory ($args); $popupTitle = $object->label ('stats_download_title', 'stats'); if (! $object->manageAuth ($loginForm)) { return '


'. $object->label ('not_logged', 'gsite'). '

'. '

'; } $url = gs_getServerVar ('REQUEST_URI').'&stats_excel=true'; header ("Refresh: 1;url=$url"); return '


'. ''. $object->label ('stats_download', 'stats'). '

'. '

'; } } //------------------------------------------------------------------------------ // $Log: stats.php,v $ // Revision 1.3 2010-05-04 13:20:42 guillaume // change path to modules // exemple : module/std => PATH_STD // // Revision 1.2 2004-05-05 17:48:53 bouba // project bug on excel link // // Revision 1.1 2003/10/28 11:58:07 lc // Initial revision. // //-- End of source ------------------------------------------------------------ ?> Statistiques générales - ITMO Cancer
itcancer
itcancer






Application not found: stats


Site par ID-Alizés