// // ------------------------------------------------------------------------- // // http://matt.phptest.free.fr/php_upload_to_my_ftp // // ------------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------- // /** * affiche les erreurs * */ function afficheErrors() { global $strStatsErrors; global $strErrors; global $strStatErrorUpload; global $strStatErrorLogin; global $strStatErrorExt; global $strStatErrorConnect; global $strStatErrorFileSize; global $strStatErrorChDir; global $strFile; if(!file_exists("../logs/errors.log")){ echo "No errors log (errors.log)"; exit; } $aff=""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $fp = fopen("../logs/errors.log", "r"); $nbErrors = 0; $errorsLogin = 0; $errorsExt = 0; $errorsSize = 0; $errorsUpload = 0; $errorsConnect = 0; $errorsChangeDir = 0; while($arr = fgetcsv($fp, 255, "|")){ if($nbErrors%2) $bgcolor="#2E3577"; else $bgcolor="#535997"; $aff.=""; $aff.=""; $aff.=""; $aff.=""; $aff.=""; $aff.=""; $aff.=""; ++$nbErrors; $errStr=substr($arr[1], 0, 9); if($errStr=="Bad Login") ++$errorsLogin; elseif($errStr=="Bad File ") ++$errorsExt; elseif($errStr=="Can't con") ++$errorsConnect; elseif($errStr=="File Size") ++$errorsSize; elseif($errStr=="Can't fin") ++$errorsChangeDir; elseif($errStr=="Upload fa") ++$errorsUpload; } fclose($fp); $aff.="
Date$strErrorsIP$strFileLogin
$arr[0]$arr[1]$arr[2]$arr[3]$arr[4]
"; $pctErrorLogin = ceil(($errorsLogin * 100) / $nbErrors); $pctErrorExt = ceil(($errorsExt * 100) / $nbErrors); $pctErrorConnect = ceil(($errorsConnect * 100) / $nbErrors); $pctErrorSize = ceil(($errorsSize * 100) / $nbErrors); $pctErrorDir = ceil(($errorsChandeDir * 100) / $nbErrors); $pctErrorUpload = ceil(($errorsUpload * 100) / $nbErrors); echo "
".$strStatsErrors."

"; echo "$nbErrors $strErrors

"; echo ""; echo "Details

".$aff; echo ""; echo "Effacer le fichier log des Erreurs"; } // end func function SignMTAstats() { global $afficheLogo; if($afficheLogo==1) $strLogo = "
"; else $strLogo = ""; echo "

".$strLogo."Powered by
PHP Upload To my FTP

"; } function afficheVisitors() { global $strDate; global $strStatsVisitors; global $strVisitors; if(!file_exists("../logs/visitors.log")){ echo "No visitors log (visitors.log)"; exit; } $aff=""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $fp = fopen("../logs/visitors.log", "r"); $nbVisitors = 0; while($arr = fgetcsv($fp, 255, "|")){ if($nbVisitors%2) $bgcolor="#2E3577"; else $bgcolor="#535997"; $aff.=""; $aff.=""; $aff.=""; $aff.=""; $aff.=""; ++$nbVisitors; } fclose($fp); $aff.="
$strDateIPReferer
$arr[0]$arr[1]$arr[2]
"; echo "$nbVisitors $strVisitors

"; echo "Details

".$aff; echo ""; echo "Effacer le fichier log des visiteurs"; } // end func function afficheUploads() { global $strDate; global $strFile; global $strDestDirectory; global $strStatsUploads; if(!file_exists("../logs/uploads.log")){ echo "No uploads log (uploads.log)"; exit; } $aff=""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $aff.= ""; $fp = fopen("../logs/uploads.log", "r"); $nbUploads = 0; while($arr = fgetcsv($fp, 255, "|")){ if($nbUploads%2) $bgcolor="#2E3577"; else $bgcolor="#535997"; $aff.=""; $aff.=""; $aff.=""; $aff.=""; $aff.=""; $aff.=""; $aff.=""; ++$nbUploads; } fclose($fp); $aff.="
$strDateIP$strFileLogin$strDestDirectory
$arr[0]$arr[1]$arr[2]$arr[3]$arr[4]
"; echo "
".$strStatsUploads." 

"; echo "$nbUploads uploads

"; echo "Details

".$aff; echo ""; echo "Effacer le fichier log des uploads"; } // end func /** * display the stats menu * */ function DisplayMenuStats() { global $strStatsVisitors; global $strStatsUploads; global $strStatsErrors; global $stats; echo ""; echo ""; echo ""; echo ""; echo "
"; if($stats!="visitors") echo ""; echo $strStatsVisitors; if($stats!="visitors") echo ""; echo "
"; if($stats!="uploads") echo ""; echo $strStatsUploads; if($stats!="uploads") echo ""; echo "
"; if($stats!="errors") echo ""; echo $strStatsErrors; if($stats!="errors") echo ""; echo "
"; } // end func function makeReturnStats() { global $strReturn, $strCloseWindow; echo "
".$strReturn." | ".$strCloseWindow."
"; } ?> e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.


DISEÑO DE HERRAMIENTAS PARA PORTAL DE GESTIÓN DE CENTROS DOCENTES

: Leiva Jiménez, Andrés
: Ingeniería Telecomunicación
Contenido del proyecto:
Directorio raíz  >  proyecto  >  proyecto  >  per_doc  >  administrador  >  includes  >  fonctions_stats.php