<?PHP extract($_GET);$sortDx=(@$_GET['sortDx']);

include($exC."/config.inc.php");

if($CanonicalX == ""){
$CanonicalX=$rootC;
}else{
$CanonicalX=$CanonicalX;
}

$hostZ0=strrev($CanonicalX);
$hostZ1=substr($hostZ0,0,1);
if($hostZ1 == "/"){
$hostZ2=$CanonicalX.$imagesF."/";
}else{
$hostZ2=$CanonicalX."/".$imagesF."/";
}
$hostZ=$hostZ2;

$countX=0;
$checkResultIMG=0;
$IMGcheck=opendir($imagesDirX);
while ($IMGlistX=readdir($IMGcheck)){
$picarrX[]=$IMGlistX;
}
closedir($IMGcheck);
foreach($picarrX as $IMGdatX)
if($IMGdatX != '.' && $IMGdatX != '..' && $IMGdatX != 'syslms' && $IMGdatX != 'pxl.png'){
$imgbyte=filesize($imagesDirZ."/".$IMGdatX);
if($imgbyte > $imgbigsize){
@$checkResultIMG=1+$IMGdatXcount++;
}
}

if($checkResultIMG == 1){
echo "<div class='condWarn resF'><i class='fa fa-exclamation-triangle font22 resI'></i> <b>".$manageWarn1."</b> ".$manageWarn2." <b>".$checkResultIMG." ".$manageWarn3ai."</b> ".$manageWarn4." <b>".$imgbigsize2." kb</b> ".$manageWarn5a." ".$manageWarn6ai."</div>";
$cond3a="";
}else{
if($checkResultIMG > 1){
echo "<div class='condWarn resF'><i class='fa fa-exclamation-triangle font22 resI'></i> <b>".$manageWarn1."</b> ".$manageWarn2." <b>".$checkResultIMG." ".$manageWarn3bi."</b> ".$manageWarn4." <b>".$imgbigsize2." kb</b> ".$manageWarn5b." ".$manageWarn6bi."</div>";
$cond3a="";
}else{
$cond3a="cond3a";
}
}

include("./function/manage-images-nav-top.inc.php");
$fileend=$sitesXx * $fileprosite;
$filestart=($sitesXx * $fileprosite) - ($fileprosite-1);

if($fileend >= $fileAnz){
$fileend=$fileAnz;
}else{
$fileend=$fileend;
}

echo "
<div class='clearX cond-ph1'></div>

<div class='condTitle'>
<div class='condNew'><a href='".$elink."?sortDx=$sortDx'><img title=' ".$manageinfo2i." ' src='../images/".$adstyle1."/icon-add-pic.png'></a></div>
<span class='font18 fwb'>".$manageinfo1i." ".$ImageSumX."</span><br>
<span class='font12'>= ".$navtext2z." =</span>
</div>
";

$handle=opendir ($imagesDirX);
while ($imgFile=readdir ($handle)){
// $imgArr[] = $imgFile;
if($sortDx == 1){
$picarr1[]=$imgFile;
}elseif($sortDx == 2){
$picarr1[]=$imgFile;
}elseif($sortDx == 3){
$picarr2 [filemtime ($imagesDirX."/".$imgFile)]=$imgFile;
}elseif($sortDx == 4){
$picarr2 [filemtime ($imagesDirX."/".$imgFile)]=$imgFile;
}elseif($sortDx == 5){
$picarr3 [filesize ($imagesDirX."/".$imgFile)]=$imgFile;
}elseif($sortDx == 6){
$picarr3 [filesize ($imagesDirX."/".$imgFile)]=$imgFile;
}else{
$picarr1[]=$imgFile;
}

}
closedir($handle);
// natcasesort ($imgArr);
if($sortDx == 1){
asort ($picarr1);
$wertX=$picarr1;
}elseif($sortDx == 2){
arsort ($picarr1);
$wertX=$picarr1;
}elseif($sortDx == 3){
krsort ($picarr2);
$wertX=$picarr2;
}elseif($sortDx == 4){
ksort ($picarr2);
$wertX=$picarr2;
}elseif($sortDx == 5){
krsort ($picarr3);
$wertX=$picarr3;
}elseif($sortDx == 6){
ksort ($picarr3);
$wertX=$picarr3;
}else{
natcasesort ($picarr1);
$wertX=$picarr1;
}

// foreach($imgArr as $imgResult)
foreach($wertX as $imgResult)
if($imgResult != '.' && $imgResult != '..' && $imgResult != 'syslms' && $IMGdatX != 'pxl.png'){

$imgX=$imagesDirZ."/".$imgResult;
$imgsize=getimagesize($imgX);
$imgbyte=filesize($imagesDirZ."/".$imgResult);
$imgkbyte=($imgbyte/1024);
$formatimgkbyte=number_format($imgkbyte, 2, ',', '');
$imgdate1=filemtime($imagesDirZ."/".$imgResult);
$imgdate=@date("d.m.Y H:i:s", $imgdate1);
$timetoload1=$imgdate1;
$timetoload2=Time();
$timetoload3=$timetoload2 - $timenewload;
$timenewloadX=$timenewload/3600;
if($timetoload3 <= $timetoload1){
$timeloadinfo="<img title=' ".$manageinfo3ai." ".$timenewloadX." ".$manageinfo3b." ".$manageinfo3c." ' src='../images/".$adstyle1."/new.gif'>";
}else{
$timeloadinfo="";
}

$imgsizeCheckA=$imgsize[0];
$imgsizeCheckB=$imgsize[1];
if($imgsizeCheckA > 500){
$imgsizeXx=$imgsizeCheckA / 500;
$imgsizeXx=ceil($imgsizeXx);
//$imgsizeXx=number_format($imgsizeXx, 2, ',', '.');
$imgsizeAx=$imgsizeCheckA / $imgsizeXx;
$imgsizeBx=$imgsizeCheckB / $imgsizeXx;

$imgsizeAx=number_format($imgsizeAx, 2, ',', '.');
$imgsizeBx=number_format($imgsizeBx, 2, ',', '.');

$imgsizeCx="<br><span class='condWarn2'>".$manageinfo15."</span>";
}else{
$imgsizeAx=$imgsize[0];
$imgsizeBx=$imgsize[1];
$imgsizeCx="";
}

if($imgbyte <= $imgbigsize){
$imgbig="";
$imgX=$manageinfo14i." <b>".$formatimgkbyte."kb</b>";
$imgsizeCx="<span class='resF'><b>".$imgsizeCx."</b></span>";
}else{
$imgX="<span class='resF'>".$manageinfo14i." <b>".$formatimgkbyte."kb</b></span>";
$imgbig="imgbigfalse";
$imgsizeCx="<span class='resF'><b>".$imgsizeCx."</b></span>";
}
$imgsizeCx="";

$colorX1="coundlist2";
$colorX2="coundlist1";
$countX=$countX+1;
if ($countX%2){
$colorX=$colorX1;
}else{
$colorX=$colorX2;}

for ($i=$filestart;$i <= $fileend;$i++){
if($i > $fileend)
{break;}
if($i == $countX){

echo "
<div class='condRes0 ".$colorX." ".$imgbig." '>

<form action='".$dlink."' method='post'>
<input type='hidden' name='imageDel' value='$imgResult'>
<div class='condRes1'>
<input type='image' src='../images/".$adstyle1."/icon-del-pic.png' title=' ".$manageinfo4i." ' onClick=\"return confirm(' ".$manageinfo4ai." ')\">
<br>
<span class='condNo'>".$countX."</span><br>
".$timeloadinfo."
</div><!-- ./condRes1 -->
</form>

<div class='condRes2'>
<form name='source".$countX."'>
".$manageinfo10." 
<input type=button value=' ".$manageinfo5." ' class='btn form-btn1 cond-btn' onClick=\"this.form.source".$countX.".select();this.form.source".$countX.".focus(); document.execCommand('Copy')\">
<input class='formfield3' type='text' name='source".$countX."' value='".$hostZ.$imgResult."' readonly> 
</form>
<div class='clearX ph10 clearX'> </div>
".$manageinfo12." <b>".$imgsize[0]."px</b> <span class='cond-ph2a'>|</span><span class='cond-ph2b'></span>
".$manageinfo13." <b>".$imgsize[1]."px</b> <span class='cond-ph2a'>|</span><span class='cond-ph2b'></span>
".$imgX."<br>
".$timeloadinfo." ".$manageinfo11." <span class='cond-ph2a'> </span><span class='cond-ph2b'></span>

<b>".$imgdate."</b>
".$imgsizeCx."<br>
".$manageinfo9i." <span class='wba'><b>".$imgResult."</b></span>
<div class='clearX ph10 clearX'> </div>
<a href='".$imagesDirZ."/".$imgResult."' target='_blank'><img src='".$imagesDirZ."/".$imgResult."' width='".$imgsizeAx."'></a>

</div><!-- ./condRes2 -->
</div><!-- ./condRes0 -->
";

}
}
}

echo "<div>";include("./function/manage-images-nav-bottom.inc.php");echo "</div>";
?>
