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

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

$cat ='1';
$cat_inf = mysql_query("SELECT * FROM `downpath` WHERE `id` = '" . $cat . "' LIMIT 1"); 
if(mysql_num_rows($cat_inf)){ 
$cat_inf = mysql_fetch_assoc($cat_inf); 
}else{ 
$cat_inf = array('way' => ''); 
} 
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type` != 1 AND `status` = 1 && `way` LIKE '" . $cat_inf['way'] ."%'"), 0); 
$zap = mysql_query("SELECT * FROM `downfiles` WHERE `type` != 1 AND `status` = 1 && `way` LIKE '" . $cat_inf['way'] ."%' ORDER BY `time` DESC LIMIT 20");
while ($ok = mysql_fetch_array($zap)) { 
echo ($i % 2) ? '' : '';
$i; 
$ok['name'] = str_replace('||||','',$ok['name']); 
$new = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `time` > '" . (time() - 86400) . "' AND `id` = '" . $ok['id'] . "'"), 0); 
echo '<div class="song">

    <div class="row">
        <a href="../songs/' . str_replace(' ', '_', $ok['name']) . '_'.$ok['id'].'.html" class="col-lg-11 col-sm-11 col-10 ">
            <div class="song-type-icons">
                <img class="song-type-icon" src="../icons/type_music.svg" alt="music">
            </div>

            <div class="song-detail">
                <div class="name">'.$ok['name'].'</div>
                <div class="artist">
                    '.$ok['login'].'
                                    </div>
            </div>
        </a>
        <div class="song-download col-lg-1 col-sm-1 col-2 " >
            <a href="../download/files/'.$ok['way'].'"><img src="../icons/download.svg" class="mt-2" alt="download"style="float: right;"></a>
        </div>
    </div>
</div>
<hr>                            ';
}
echo '<span class="clearfix"></span>
        </div>
';
if ($total > $kmess){
echo '<div class="menu" align="center"> ' .
functions::display_pagination('index.php&amp;', $start, $total,
$kmess) . '</div>';
}



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