<?php
define('_IN_JOHNCMS', 1);
$headmod = 'mediafile';
require_once '../incfiles/core.php';
require_once 'functions.php';

$viewf = intval($_GET['view']);
$file = mysql_query("SELECT * FROM `downfiles` WHERE `id` = '" . $viewf . "'");
if (mysql_num_rows($file)) {
    $file = mysql_fetch_array($file);
    $dopway = str_replace(basename($file['way']), '', $file['way']);
    $file22 = mysql_query("SELECT * FROM `downfiles` WHERE `pathid` = '" . $viewf .
        "' AND `type` = 1");
    $namee = explode('||||', $file['name']);

$har22 = mysql_query("SELECT * FROM `singer` WHERE `id`='".$file['singer_id']."'");
$har11 = mysql_fetch_assoc($har22);

    $textl = '' . str_replace('_', ' ', $namee[0]) . ' MMUZON.RU-da Ýükle, Diňle, Hiňlen!';
    $titleneym = '' . str_replace('_', ' ', $namee[0]) . '';
    $titleurl = ''.$home.'/download/files/'.$file['way'].'';
    $titleimg = $har11['id'] ? ''.$home.'/files/singer/' . $har11['id'] . '.png' : ''.$home.'/img/singer/mmuzon_ru2.jpg';
    $titledes = '' . str_replace('_', ' ', $namee[0]) . ' MMUZON.RU-da Ýükle, Diňle, Hiňlen!';
    $titlekey = '' . str_replace('_', ' ', $namee[0]) . ' mmuzon.ru, hit aýdymlar, zet-pro2003 & akmyradoffsoft';

$har22 = mysql_query("SELECT * FROM `singer` WHERE `id`='".$file['singer_id']."'");
$har11 = mysql_fetch_assoc($har22);

    require_once '../incfiles/head.php';
if (!$file['size']) {
        $siz = filesize($loadroot.'/'.$file[way]);
        mysql_query("UPDATE `downfiles` set `size` = '" . $siz . "' WHERE `id` = '" . $viewf .
            "'");
    } else {
        $siz = $file['size'];
    }
    $filtime = date("d.m.Y", $file['time']);

    $nadir = $file[pathid];
    $pat = "";
    while ($nadir != "") {

        $dnew = mysql_query("select * from `downpath` where id = '" . $nadir . "';");
        $dnew1 = mysql_fetch_array($dnew);
        $pat = '<a href="dir_' . $dnew1['id'] . '.html" title="' . $dnew1['name'] . '">' .
            $dnew1['name'] . '</a> &gt;  ' . $pat;

        $nadir = $dnew1[refid];

    }

$req = mysql_query("SELECT * FROM `downfiles` WHERE `id`=''.$viewf.''");
$res = mysql_fetch_assoc($req);

    $tf = pathinfo($file['way'], PATHINFO_EXTENSION);

  


        if ($tf == 'mp3') {
       echo '
<section id="app" class="py-4" style="padding-bottom: 2px!important;">
        
    <div class="container detail-page">
        <div>
            <div class="row">
                                            <div class="col-lg-12 col-12">
                    
            <div class="song-name">' . str_replace('_', ' ', $namee[0]) . '</div>
            <div class="song-artist">
                '.$file['login'].'
                            </div>

            <div class="mt-2">Görnüşi: <span class="font-weight-bold">audio</span></div>

            <div class="d-inline-block">
                <div class="mt-1">Alnan sany: <span class="font-weight-bold">' . ending($file['count']) . '</span></div>
                <div class="mt-1">Göwrümi: <span class="font-weight-bold">' . size_convert($siz) .'</span></div>
            </div>

            <a href="../download/loadfile.php?down=' . $file['way'] . '">
                <div class="sign-up float-right">
                    <button type="button" class="btn">
                        ÝÜKLE
                    </button>
                </div>
            </a>
                </div>
            </div>
                    <div>
                <audio controls style="margin: 15px 0 0 0;">
                    <source src="../download/files/' . $file['way'] . '" type="audio/ogg">
                    <source src="../download/files/' . $file['way'] . '" type="audio/mpeg">
                </audio>
            </div>
                </div>
';
}

if ($tf == '3gp' or $tf == 'avi' or $tf == 'mp4') {

echo '<section id="app" class="py-4" style="padding-bottom: 2px!important;">
        
    <div class="container detail-page">
        <div>
            <div class="row">
                                            <div  class="col-lg-8 col-12">
                            <video width="400"  controls>
                                <source src="../download/files/' . $file['way'] . '" type="video/mp4">
                                Your browser does not support HTML5 video.
                            </video>
                        </div>
                    <div class="col-lg-4 col-12">
                    
            <div class="song-name">' . str_replace('_', ' ', $namee[0]) . '</div>
            <div class="song-artist">
                '.$file['login'].'
                            </div>

            <div class="mt-2">Görnüşi: <span class="font-weight-bold">video</span></div>

            <div class="d-inline-block">
                <div class="mt-1">Alnan sany: <span class="font-weight-bold">' . ending($file['count']) . '</span></div>
                <div class="mt-1">Göwrümi: <span class="font-weight-bold">' . size_convert($siz) .'</span></div>
            </div>

            <a href="../download/loadfile.php?down=' . $file['way'] . '">
                <div class="sign-up float-right">
                    <button type="button" class="btn">
                        ÝÜKLE
                    </button>
                </div>
            </a>
                </div>
            </div>
                </div>';

}






}


require_once '../incfiles/end.php';
?>