Your IP : 216.73.216.229


Current Path : /home/jeromecohp/www/aesecure/premium/third/tools/lastmodified/
Upload File :
Current File : /home/jeromecohp/www/aesecure/premium/third/tools/lastmodified/lastmod.php

<?php
   // @file : /premium/third/tools/lastmodified/lastmod.php
   // @version : 2.0.2
   // @author : AVONTURE Christophe - christophe@aesecure.com
   // @copyright : (C) 2013-2015 - Christophe Avonture - all right reserved.
   // @url : http://www.aesecure.com/
   // @package : 2015-02-14 13:37:46
   // @license : This program is a commercial software.  You CAN'T redistribute it and/or modify it.
   // Source code is the property of Christophe Avonture and can't be reused, in whole or in part, in any programs.
?>
<?php
require_once (dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'aesecure.php');
function formatSizeUnits($bytes){
if($bytes >= 1073741824){
$bytes = number_format($bytes / 1073741824, 2).' GB';} elseif($bytes >= 1048576){
$bytes = number_format($bytes / 1048576, 2).' MB';} elseif($bytes >= 1024){
$bytes = number_format($bytes / 1024, 2).' KB';} elseif($bytes > 1){
$bytes = $bytes.' bytes';} elseif($bytes == 1){
$bytes = $bytes.' byte';} else{
$bytes = '0 bytes';} return $bytes;}
$days = (isset($_POST['d'])?substr($_POST['d'],0,2):0);if(($days>0)&&($days<100)){
if(($tmz=ini_get('date.timezone'))=='') $tmz='Europe/Brussels';
date_default_timezone_set($tmz);
$go_back = 0;  $i = 0;  $dir_count = 0;  $date = time();  $one_day = 86400;
$directories_to_read[$dir_count] = $aeSt->siOt().'/';
$go_back = $one_day * $days;$html='<hr/><h3>'.sprintf($aesL->getTools('lastmod-files'),$days).'</h3>';
$files='';
$arr=array();
$diff = $date - $go_back;
while ($i<=$dir_count){
$current_directory = $directories_to_read[$i];
$read_path = opendir($directories_to_read[$i]);
while ($file_name=readdir($read_path)){
if(($file_name!='.')&&($file_name!='..')){
if(is_dir($current_directory.'/'.$file_name)=="dir"){
$d_file_name = $current_directory.$file_name;
$dir_count++;
$directories_to_read[$dir_count] = $d_file_name.'/';} else{
$file_name = $current_directory.$file_name;if((filemtime($file_name))>$diff){
$date_changed=filemtime($file_name);
$arr[]=array(
'filename'=>$file_name,
'lastmod'=>@date("d/m/Y H:i:s",$date_changed),
'filesize'=>formatSizeUnits(filesize($file_name)));}}}}
closedir ($read_path);
$i++;}
if(count($arr)>0){
$root=dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))));echo '<h1>'.$root.'</h1>';
$form=
'<form class="form-inline highlight" role="form">'.'<p>'.$aesL->getTools('lastmod-hidefolder').'</p>'.'<div class="form-group">'.'<div class="input-group">'.'<span class="input-group-addon"><span class="glyphicon glyphicon-folder-open"></span></span>'.'<input type="hidden" id="directory_separator" value="'.htmlentities(DIRECTORY_SEPARATOR).'"/>'.'<input class="form-control" maxsize="25" size="50" type="text" id="folderName" placeholder="'.$aesL->getTools('lastmod-foldersample').'">'.'<button id="hideFiles" type="button" class="btn btn-default">'.$aesL->getTools('lastmod-hide').'</button>'.'</div>'.'</div>'.'</form>';
$name=array();
$lastmod=array();
$filesize=array();foreach ($arr as $key => $row){
$name[$key] = $row['filename'];
$lastmod[$key] = $row['lastmod'];
$filesize[$key] = $row['filesize'];}
array_multisort($lastmod, SORT_DESC,$name, SORT_ASC,$filesize, SORT_ASC,$arr);$html.='<h5>'.sprintf($aesL->getTools('lastmod-number'),count($arr)).'</h5><hr/>'.
$form.
'<ul id="filelist" class="text-info list-unstyled">';
$i=0;foreach ($arr as $item){
$fname=str_replace($root,'',$item['filename']);
$view='<span style="cursor:pointer" class="text-info glyphicon glyphicon-eye-open" id="view'.$i.'"><input type="hidden" id="fname'.$i.'" value="'.$fname.'"/></span>';$html.='<li><span class="glyphicon glyphicon-calendar"></span>&nbsp;'.$item['lastmod'].'&nbsp;&nbsp;'.
$view.'&nbsp;<span class="filename">'.str_replace('/',DIRECTORY_SEPARATOR,$item['filename']).'<span>&nbsp;'.'('.$item['filesize'].')</li>';
$i+=1;}
$html.='</ul>';}
echo $html;
die();}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex, nofollow" />
<meta name="author" content="aeSecure (c) Christophe Avonture" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;" />
<title><?php echo $aesL->getMain('aeSecurePageTitle'); ?></title>
	<script src="../../../../third/bootstrap/js/jquery.min.js"></script>
		<link href="../../../../third/alertify/themes/alertify.core.css" rel="stylesheet" media="screen">
<link href="../../../../third/alertify/themes/alertify.bootstrap.css" rel="stylesheet" media="screen">
<link href="../../../../third/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="../../../../assets/aesecure.css" rel="stylesheet" media="screen">
<link href="lastmod.css" rel="stylesheet" media="screen">
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1><?php echo $aesL->getTools('lastmod-text'); ?></h1>
<p class="lead"><?php echo $aesL->getTools('lastmod-hint'); ?></p>
</div>
<p class="lead text-primary"><?php echo $aesL->getTools('lastmod-explain'); ?></p>
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="nbrdays" class="col-sm-3 control-label"><?php echo $aesL->getTools('lastmod-days'); ?></label>
<div class="col-sm-2"><input type="number" class="form-control" style="width:55px;" value="7" size="3" min="1" max="99" id="days" placeholder="<?php echo $aesL->getMain('days'); ?>"></div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-10"><div id="aeScan" class="btn btn-default"><?php echo $aesL->getMain('scan');?></div></div>
</div>
</form>
<div id="ajaxResult"></div>
</div>
<script type="text/javascript">
<?php
echo 'var aeSecure ={};aeSecure.key="'.$aesC->get('key').'";'.'aeSecure.msgSpecifyFolder="'.str_replace("'", "\'",$aesL->getTools('lastmod-selectfolder')).'";'.'aeSecure.msgNoneFound="'.str_replace("'", "\'",$aesL->getTools('lastmod-nonefound')).'";'.'aeSecure.demo="'.($aesC->mo()?'true':'false').'";'.'aeSecure.token="'.$aesS->get('token',NULL).'";'.'aeSecure.token_value="'.$aesS->get('token_value',NULL).'";';
?>
</script>
<script type="text/javascript" src="../../../../third/bootstrap/js/bootstrap.min.js" defer></script>
<script type="text/javascript" src="../../../../assets/aesecure.js" defer></script>
<script type="text/javascript" src="../../../../third/alertify/lib/alertify.min.js" defer></script>
<script type="text/javascript" src="lastmod.js" defer></script>
</body>
</html>