<?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.$pdfF."/";
}else{
$hostZ2=$CanonicalX."/".$pdfF."/";
}
$hostZ=$hostZ2;

$countX=0;
$checkResultIMG=0;
$IMGcheck=opendir($pdfDirX);
while ($IMGlistX=readdir($IMGcheck)){
$picarrX[]=$IMGlistX;
}
closedir($IMGcheck);
foreach($picarrX as $IMGdatX)
if($IMGdatX != '.' && $IMGdatX != '..' && $IMGdatX != 'syslms'){
$imgbyte=filesize($pdfDirZ."/".$IMGdatX);
}

$cond3a="cond3a";

include("./function/manage-pdf-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-pdf.png'></a></div>
<span class='font18 fwb'>".$manageinfo1p." ".$PdfSumX."</span><br>
<span class='font12'>= ".$navtext2z." =</span>
</div>
";

$handle=opendir ($pdfDirX);
while ($imgFile=readdir ($handle)){
// $imgArr[] = $imgFile;
if($sortDx == 1){
$picarr1[]=$imgFile;
}elseif($sortDx == 2){
$picarr1[]=$imgFile;
}elseif($sortDx == 3){
$picarr2 [filemtime ($pdfDirX."/".$imgFile)]=$imgFile;
}elseif($sortDx == 4){
$picarr2 [filemtime ($pdfDirX."/".$imgFile)]=$imgFile;
}elseif($sortDx == 5){
$picarr3 [filesize ($pdfDirX."/".$imgFile)]=$imgFile;
}elseif($sortDx == 6){
$picarr3 [filesize ($pdfDirX."/".$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'){

$imgX=$pdfDirZ."/".$imgResult;
$imgsize=getimagesize($imgX);
$imgbyte=filesize($pdfDirZ."/".$imgResult);
$imgkbyte=($imgbyte/1024);
$formatimgkbyte=number_format($imgkbyte, 2, ',', '');
$imgdate1=filemtime($pdfDirZ."/".$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=' ".$manageinfo3ap." ".$timenewloadX." ".$manageinfo3b." ".$manageinfo3c." ' src='../images/".$adstyle1."/new.gif'>";
}else{
$timeloadinfo="";
}

$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." '>

<form action='".$dlink."' method='post'>
<input type='hidden' name='pdfDel' value='$imgResult'>
<div class='condRes1'>
<input type='image' src='../images/".$adstyle1."/icon-del-pdf.gif' title=' ".$manageinfo4p." ' onClick=\"return confirm(' ".$manageinfo4ap." ')\">
<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>
".$manageinfo14p." <b>".$formatimgkbyte."kb</b><br>
".$timeloadinfo." ".$manageinfo11." <b>".$imgdate."</b><br>
".$manageinfo9p." <span class='wba'><b>".$imgResult."</b></span>
<div class='clearX ph5 clearX'> </div>
<a href='".$pdfDirZ."/".$imgResult."' target='_blank' class='vlink1'>".$hostZ.$imgResult."</a>

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

}
}
}

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