<?php
defined('_IN_JOHNCMS') or die('Error: restricted access');
$mp = new mainpage();

echo '
<main class="mt-5 pt-5">
    <section class="px-lg-5 row col-12">
        <aside class="pl-2 col-12 col-lg-6 order-2 order-lg-1">

<!-- bagsylar -->
            <section class="favorites mt-5">
                <span class="favorites-span">
                    <img src="'.$home.'/dist/img/mic.svg" width="24"> Aýdymçylar
                </span>
                <a href="'.$home.'/singers" class="favorites-all">
                    <span> Ählisi
                        <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"></path></svg>
                    </span>
                </a>
                <div class="d-flex flex-wrap">';

$req = mysql_query("SELECT * FROM `singers` ORDER BY rand() DESC LIMIT 6");
while ($res = mysql_fetch_array($req)) {
echo '
                                            <a href="'.$home.'/singers/'.$res['url'].'" class="col-2 col-md-2  p-1 ">
                        <img src="'.$home.'/uploads/artist/img/'.$res['foto'].'" alt="'.$res['name'].'" class="favorites-img">
                                            </a>

';
}

echo '
                </div>
            </section>
<!-- bagsylar end-->

<!-- halananlar -->
            <section class="favorites mt-5">
                <span class="favorites-span">
                    <img src="'.$home.'/dist/img/like.svg" width="22"> Halananlar
                </span>
                <a href="'.$home.'/likes" class="favorites-all">
                    <span>
                        Ählisi
                             <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"></path></svg>
                    </span>
                </a>';

$req = mysql_query("SELECT * FROM `yuklemeler` WHERE `cat` = '1' AND `status` = '1' AND `like` >= '6' ORDER BY `time` DESC LIMIT 3");
while ($res = mysql_fetch_array($req)) {

$foto = mysql_query("SELECT * FROM `skreen` WHERE `fid` = '" . $res['id'] . "'");
$surat = mysql_fetch_array($foto);
$likes = mysql_result(mysql_query("SELECT `like` FROM `yuklemeler` WHERE `id` = '" . $res['id'] . "';"), 0);

if(empty($surat['url'])){
$lfoto = ''.$home.'/dist/img/logo.png';
}else{
$lfoto = ''.$home.'/uploads/music/img/'.$surat['url'].'';
}
echo '
                    <aside class="col-12 p-1">
                        <div class="favorites-item">
                                          <a href="'.$home.'/musics/'.$res['link'].'" class="d-flex align-items-center  pl-3 ">
                                          <img src="'.$lfoto.'" alt="'.$res['singer'].' - '.$res['name'].'" style="width:40px;height:40px;">
                                          <span span="" class="d-flex flex-column pl-3">
                                          <span class="music-name"> '.$res['singer'].' - '.$res['name'].' </span>
                                          </span>
                                          <span class="ml-auto pr-3 pr-lg-4">
                                          <img src="'.$home.'/dist/img/like.svg" width="22"> '.$likes.'
                                          </span>
                                          </a>
                                  <hr>
                        </div>
                    </aside>
';
}

echo '

                 </section>
<!-- halananlar end-->
        </aside>

<!-- Slider -->
        <aside class="col-12 col-lg-6 order-1 order-lg-2 p-4 p-lg-0 d-flex align-items-center">
            <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
                <ol class="carousel-indicators">
                                       <li data-target="#carouselExampleIndicators" data-slide-to="5" class="active"></li>
                                       <li data-target="#carouselExampleIndicators" data-slide-to="6" class=""></li>
                                       <li data-target="#carouselExampleIndicators" data-slide-to="7" class=""></li>
                </ol>
                <div class="carousel-inner">
                            <div class="carousel-item active">
                                <img class="d-block w-100 rounded-img" src="'.$home.'/dist/img/slider/1.jpg" alt="Reklama">
                            </div>
                            <div class="carousel-item">
                                <img class="d-block w-100 rounded-img" src="'.$home.'/dist/img/slider/2.jpg" alt="Reklama">
                            </div>
                            <div class="carousel-item">
                                <img class="d-block w-100 rounded-img" src="'.$home.'/dist/img/slider/3.jpg" alt="Reklama">
                            </div>
                </div>
                <a class="carousel-control-prev" href="'.$home.'/#carouselExampleIndicators" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">Yza</span>
                </a>
                <a class="carousel-control-next" href="'.$home.'/#carouselExampleIndicators" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">Öňe</span>
                </a>
            </div>
        </aside>
<!-- Slider  end -->
    </section>
';








echo '
   <div class="row col-12 p-2 p-lg-4">
        <main class="col-12 col-lg-6 p-2 p-xl-5">
            <aside class="d-flex justify-content-between align-items-center">
                <h4 class="music-title ">
                <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><g><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 13.535V3h8v2h-6v12a4 4 0 1 1-2-3.465zM10 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"></path></g></svg>
                     Aýdymlar
                </h4>
                <a href="'.$home.'/musics" class="ml-auto btn-more">Ählisi
                <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"></path></svg>
                </a>
            </aside>

            <section>
';

$req = mysql_query("SELECT * FROM `yuklemeler` WHERE `cat` = '1' AND `status` = '1' ORDER BY `time` DESC LIMIT 10");
while ($res = mysql_fetch_array($req)) {

$foto = mysql_query("SELECT * FROM `skreen` WHERE `fid` = '" . $res['id'] . "'");
$surat = mysql_fetch_array($foto);

echo '
                <div class="card-music d-flex align-items-center my-2 ">
                         ';
if(empty($surat['url'])){
echo '<img src="'.$home.'/dist/img/logo.png" alt="">';
}else{
echo '<img src="'.$home.'/uploads/music/img/'.$surat['url'].'" alt="">';
}
echo '
                    <a href="'.$home.'/musics/'.$res['link'].'">
                        <span class="d-flex flex-column ml-3">
                            <span class="music-name">
                                '.$res['name'].'
                            </span>
                            <span class="music-author pt-1">
                                '.$res['singer'].'
                            </span>
                        </span>
                    </a>
                    <div class="ml-auto">
                        <a href="'.$home.'/yukle/'.$res['link'].'" class="music-download mr-4 ">
                            <svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" size="25" height="25" width="25" xmlns="http://www.w3.org/2000/svg"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
                        </a>
                    </div>
                </div>

';
}

echo '
            </section>
        </main>
';



echo '
        <section class="col-12 col-lg-6 mt-2 mt-md-0 p-2 p-xl-5">

            <div class="d-flex justify-content-between align-items-center">
                <h4 class="music-title ">
                <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M719.4 499.1l-296.1-215A15.9 15.9 0 0 0 398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 0 0 0-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"></path></svg>
                    Klipler
                </h4>
                <a href="'.$home.'/videos" class="ml-auto btn-more">Ählisi
                <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"></path></svg>
                </a>
            </div>
';

$req = mysql_query("SELECT * FROM `yuklemeler` WHERE `cat` = '2' AND `status` = '1' ORDER BY `time` DESC LIMIT 10");
while ($res = mysql_fetch_array($req)) {

$foto = mysql_query("SELECT * FROM `skreen` WHERE `fid` = '" . $res['id'] . "'");
$surat = mysql_fetch_array($foto);

echo '
                <div class="card-music d-flex align-items-center my-2 ">
                            ';
if(empty($surat['url'])){
echo '<img src="'.$home.'/dist/img/logo.png" alt="">';
}else{
echo '<img src="'.$home.'/uploads/video/img/'.$surat['url'].'" alt="">';
}
echo '
                    <a href="'.$home.'/videos/'.$res['link'].'">
                        <span class="d-flex flex-column ml-3">
                            <span class="music-name">
                                '.$res['name'].'
                            </span>
                            <span class="music-author pt-1">
                                '.$res['singer'].'
                            </span>
                        </span>
                    </a>
                    <div class="ml-auto">
                        <a href="'.$home.'/yukle/'.$res['link'].'" class="music-download mr-4 ">
                            <svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" size="25" height="25" width="25" xmlns="http://www.w3.org/2000/svg"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
                        </a>
                    </div>
                </div>

';
}

echo '
        </section>
    </div>
</main>
';



?>