<?PHP 

$deletefileX="";
$saveCheck="./../tmp/deleteinfo.inc.php";
if (file_exists($saveCheck)){
include($saveCheck);
include("./../function/autoX-loadingS_delete.inc.php");
}

$checkZ="backupdata.inc.php";
include("./../function/datacheck_copy.inc.php");

include("./../function/timestamp.inc.php");
include("./../".$SYSD."/backupdata.inc.php");

if($checktimebackupdataT == ""){$checktimebackupdataX=0;}else{$checktimebackupdataX=$checktimebackupdataT;}
$checktimeB=$checktimebackupdataX+$timeBx;

if($checktimebackupdataT == ""){
$checktimebackupdata="<span class='resF'>".$backupdata13."</span>";
$checktimebackupIMG="<i class=\"fa fa-times resF\"></i>";
$backupCheckStart=$backupdata2L;
$backupButton="form-btn2";
}else{
if($checktimeB <= $timestamp){
$checktimebackupdata=$checktimebackupdataD."<br><span class='resF'>".$backupdata14."</span>";
$checktimebackupIMG="<i class=\"fa fa-times resF\"></i>";
$backupCheckStart=$backupdata2L;
$backupButton="form-btn2";
}else{
$checktimebackupdata=$checktimebackupdataD;
$checktimebackupIMG="<i class=\"fa fa-check resT\"></i>";
$backupCheckStart=$backupdata1L;
$backupButton="form-btn3";
}
}

$backupFolder=opendir("./../backup/");
if($backupFolder)
$backupSum=0;
$backupinfo=0;
while($file=readdir($backupFolder))
{$backupSum++;}
$backupSum=$backupSum-2;
$backupinfo=$backupSum+1;

$path = "../backup";
function filesize_r($path){
if(!file_exists($path)) return 0;
if(is_file($path)) return filesize($path);
$fileSizeX=0;
foreach(glob($path."/*") as $fn)
$fileSizeX += filesize_r($fn);
$fileSizeX=$fileSizeX/1048576;
$fileSizeX=number_format($fileSizeX, 2, ',', '');
return $fileSizeX;
}

if($backupSum >= 10){$SumInfo="<i class=\"fa fa-times resF\"></i>";}
elseif($backupSum == "8" OR $backupSum == "9"){$SumInfo="<i class=\"fa fa-check resT txt-orange\">";}
elseif($backupSum == 0){$SumInfo="<i class=\"fa fa-info\"></i>";}
else{$SumInfo="<i class=\"fa fa-check resT\"></i>";}

$fileSizeR=0;
$fileSizeQ=$backupMB / 5;
$fileSizeQ=$backupMB - $fileSizeQ;
$fileSizeR=filesize_r($path);
$fileSizeR=str_replace(",",".",$fileSizeR);
if($fileSizeR >= $backupMB){$fileSizeA="<i class=\"fa fa-times resF\"></i>";}
elseif($fileSizeR >= $fileSizeQ){$fileSizeA="<i class=\"fa fa-check resT txt-orange\"></i>";}
elseif($fileSizeR == 0){$fileSizeA="<i class=\"fa fa-info\"></i>";}
else{$fileSizeA="<i class=\"fa fa-check resT\"></i>";}
?>

<div class="box-body">
<table class="col-md-12 table table-bordered table-condensed">
<tr class="trcolor">
<th class="font18"><?PHP echo $areaX;?></th>
<th class="font18 txtR"><?PHP echo $resultX;?></th>
<th class="font18 txtC"><?PHP echo $statusX;?></th>
</tr>

<tr class="menu-out2">
<td><?PHP echo $backupdata01;?>:</td>
<td class="txtR"><?PHP echo $checktimebackupdata;?></td>
<td class="txtC"><?PHP echo $checktimebackupIMG;?></td>
</tr>

<tr class="menu-out2">
<td><?PHP echo $backupdata19;?>:</td>
<td class="txtR"><?PHP echo $backupSum."/".$backupno;?></td>
<td class="txtC"><?PHP echo $SumInfo;?></td>
</tr>

<tr class="menu-out2">
<td><?PHP echo $backupdata20." ".$backupdata20a;?>:</td>
<td class="txtR"><?PHP echo filesize_r($path)." ".$backupdata37;?></td>
<td class="txtC"><?PHP echo $fileSizeA;?></td>
</tr>

<tr class="menu-out2">
<td><?PHP echo $backupdata20." ".$backupdata20b;?>:</td>
<td class="txtR"><?PHP echo $backupMB." ".$backupdata37;?></td>
<td class="txtC"><i class="fa fa-info"></i></td>
</tr>

<tr class="trtrans pointer" onclick="javascript:window.open('backup-data-preax.php', '_parent');">
<td colspan="3" class="txtVM txtC">
<button onclick="#" class="btn <?PHP echo $backupButton;?> font13"><?PHP echo $backupCheckStart;?></button>
</td>
</tr>

</table>
</div>

<div class="ph50"></div>

<div class="box-body wba">
<table class="col-md-12 table table-bordered table-condensed">
<tr class="trcolor">
<th class="font16 txtC"><?PHP echo $backupdata02;?></th>
<th class="font16"><?PHP echo $backupdata03;?></th>
<th class="font16 txtR"><?PHP echo $backupdata04;?></th>
<th class="font16 txtR"><?PHP echo $backupdata05;?></th>
<th class="font16 txtC"><?PHP echo $backupdata06;?></th>
<th class="font16 txtC"><?PHP echo $backupdata07;?></th>
</tr>

<?PHP 
if($backupSum == 0){
echo "
<tr>
<td colspan='6'>".$backupdata11."</td>
</tr>
";
}else{

$handle=opendir ("./../backup/");
while ($file=readdir ($handle)){
$file=strtolower($file);
{
}
$backuparray[]=$file;
}
closedir($handle);
arsort ($backuparray);
foreach($backuparray as $backupfile)
if($backupfile != '.' && $backupfile != '..')
{

$backuptime1=filemtime("./../backup/".$backupfile);
@$backuptimeD=date("d.m.Y", $backuptime1);
@$backuptimeH=date("H:i:s", $backuptime1);
$backupsizeX="./../backup/".$backupfile;
$backupsize=filesize($backupsizeX);
$backupsize=$backupsize/1024;
$backupsizeKB=number_format($backupsize, 2, ',', '.');
$backupsizeMB=$backupsize/1024;
$backupsizeMB=number_format($backupsizeMB, 4, ',', '');

$uptodatetime=$backuptime1+$timeutd;
$uptodatetime=$backuptime1+300;
$tblbackgrdX="";
if($uptodatetime >= $timestamp){
$tblbackgrdX="txt-white bg-green4";
}

echo "
<tr class='menu-out2'>
<td class='txtC txtVM font14 $tblbackgrdX'>".$backuptimeD." ".$backuptimeH."</td>
<td class='txtL txtVM font14 $tblbackgrdX'>".$backupfile."</td>
<td class='txtR txtVM font14 $tblbackgrdX'>".$backupsizeKB."</td>
<td class='txtR txtVM font14 $tblbackgrdX'>".$backupsizeMB."</td>
<td class='txtC txtVM font14'><a href='../download.php?file=$backupfile'>
<div class='vlinkS'>
<i class='hvL fa fa-external-link-square padd-right5'></i>
<span class='hvS'>".$save1."</span>
</div>
</a>
</td>
<td class='txtC txtVM font12 $tblbackgrdX'>
<form action='backup-data-delxx.php' name='form' method='post'>
<input type='hidden' name='backupdelete' value='$backupfile'>
<input type='image' src='../images/".$adstyle1."/icon-false2.gif' alt='$backupdata09' onClick=\"return confirm('$backupdata10')\">
</form>
</td>
</tr>
";
}
}
?>
</table>

<div class="clearX box-footer"><?PHP echo $noguarantee1;?></div>
</div>
