<?php
ini_set('max_execution_time', 5);
define('_IN_JOHNCMS', 1);
$headmod = 'load_admin';
require_once '../incfiles/core.php';
require_once 'functions.php';
$textl = 'Dolandyryş paneli';
require_once '../incfiles/head.php';
$act = isset($_GET['act']) ? $_GET['act'] : '';

if ($rights == 4 || $rights >= 9) {
    $incf = array(
    'addsinger',
    'upload');
    if (in_array($act, $incf)) {
        include_once 'admin/' . $act . '.php';
        include_once '../incfiles/end.php';
        exit;
    }

            // Проверка прав доступа к файлам и папкам
            function permissions($filez) {
                $filez = @decoct(@fileperms("$filez")) % 1000;
                return $filez;
            }
            $cherr = '';
            // Проверка прав доступа к папкам
            $arr = array(
            	'../uploads/music/file/',
            	'../uploads/music/img/',
            	'../uploads/video/file/',
                '../uploads/video/img/',
                '../uploads/artist/img/',
                '../uploads/artist/file/');
            foreach ($arr as $v) {
                if (permissions($v) < 777) {
                    $cherr = $cherr . '<div class="red">Ýalňyşlyk! - ' . $v .
                        '<br /><span class="gray">777 rugsatnama berildimedik.</span></div>';
                }
            }

            $countf = mysql_query("SELECT COUNT(*) FROM `yuklemeler` WHERE `type` != 1 AND `status` = 0");
            $countf = mysql_result($countf, 0);

echo '<br/><br/>
<div class="profile-img card-artists music-name">
<center><h3>Dolandyryş paneli</h3></center>
<ul>
<li><a href="admin.php?act=barlag">Moderasiýadaky faýllar</a> (' . $countf . ')</li>
<li><a href="admin.php?act=upload">Faýl goşmak</a></li>
<li><a href="admin.php?act=addsinger">Aýdymçy goşmak</a></li>
</ul>
<br/>
</div>

<center><h3>Näsazlyklar:</h3></center>

<div class="card-panel">' . $cherr . '<div class="red">';

            if (!extension_loaded('ffmpeg'))
                echo 'Serweriňiz ffmpeg goldanok! Wideolara awto skrinşotlamada näsazlyk ýüze çykyp biler!<br/>';
            if (!function_exists("imagegif"))
                echo 'Serweriňiz imagegif goldanok! Temalary awto gif skrinşotlamada näsazlyk ýüze çykyp biler!<br/>';
            if (!function_exists("imagejpeg"))
                echo 'Serweriňiz imagejpeg goldanok! Temalary awto jpeg skrinşotlamada näsazlyk ýüze çykyp biler!<br/>';
            if (!function_exists("imagepng"))
                echo 'Serweriňiz imagepng goldanok! Temalary awto png skrinşotlamada näsazlyk ýüze çykyp biler!<br/>';
            echo '</div>';
  
} else {
    header("Location: ../index.php?err");
}
require_once '../incfiles/end.php';
?>