<?php
define('_IN_JOHNCMS', 1);
require('../incfiles/core.php');
$textl = 'Hitlar';
require('../incfiles/head.php');

//include_once $SERVER['DOCUMENT_ROOT'].'/download/functions.php';
echo '<div class="songs"><h3 class="mb-4">Hitlar</h3>';

$i = 0;
$res = mysql_query("SELECT * FROM `downfiles` WHERE `type`='file' ORDER BY `count` DESC LIMIT 20");
while ($row = mysql_fetch_assoc($res)) {
$row['name'] = str_replace('||||','',$row['name']); 
$new = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `time` > '" . (time() - 86400) . "' AND `id` = '" . $row['id'] . "'"), 0); 
$tf = pathinfo($row['way'], PATHINFO_EXTENSION);

echo '<div class="song">

    <div class="row">
        <a href="../news/' . str_replace(' ', '_', $row['name']) . '_'.$row['id'].'.html" class="col-lg-11 col-sm-11 col-10 ">
            <div class="song-type-icons">';
if ($tf == 'mp4'){
                echo '<img class="song-type-icon" src="../icons/type_video.svg" alt="music">';
}
if ($tf == 'mp3'){
                echo '<img class="song-type-icon" src="../icons/type_music.svg" alt="music">';
}
            echo '</div>

            <div class="song-detail">
                <div class="name">'.$row['name'].'</div>
                <div class="artist">
                    '.$row['login'].'
                                    </div>
            </div>
        </a>
        <div class="song-download col-lg-1 col-sm-1 col-2 " >
            <a href="../download/files/'.$row['way'].'"><img src="../icons/download.svg" class="mt-2" alt="download"style="float: right;"></a>
        </div>
    </div>
</div>
<hr>                            ';


    $i++;
 }
echo '<span class="clearfix"></span>
        </div>
';
if ($total > $kmess){
echo '<div class="menu" align="center"> ' .
functions::display_pagination('index.php&', $start, $total,
$kmess) . '</div>';
}

require('../incfiles/end.php');
?>