| Server IP : 103.82.32.14 / Your IP : 216.73.217.140 Web Server : Apache/2.2.32 (Unix) mod_ssl/2.2.32 OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 System : Linux cloud.lonmanhoabinh.com 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : lonmakmf ( 524) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/rubymnik/public_html/admin/thuviennhac/ |
Upload File : |
<?php
$page = "../";
include '../../configchannel.php';
include '../configtotal.php';
$path = '../../admin2/nhacsanxuat';
if(isset($_POST['fileedit']))
{
file_put_contents($_POST['fileedit'], $_POST['network']);
$_SESSION['thongbao'] = "Edit Thành Công";
Header( "Location: " . $_SERVER['HTTP_REFERER']);
exit;
}
else if(isset($_GET['delete']))
{
unlink($_GET['delete']);
$_SESSION['thongbao'] = "Xóa Thành Công";
Header( "Location: " . $_SERVER['HTTP_REFERER']);
exit;
}
else if(isset($_POST['thumuc']))
{
echo $path . '/' . $_POST['thumuc'];
mkdir($path . '/' . $_POST['thumuc'], 0777);
$_SESSION['thongbao'] = "Thêm Thành Công";
Header( "Location: " . $_SERVER['HTTP_REFERER']);
exit;
}
else if(isset($_POST['tenChuDe']))
{
// SAVE CONTRACT
$files = $_FILES['fileWAV'];
$names = $files['name'];
$types = $files['type'];
$tmp_names = $files['tmp_name'];
$errors = $files['error'];
$sizes = $files['size'];
$folderurl = $_POST['tenChuDe'];
$numitems = count($names);
for ($i = 0; $i < $numitems; $i ++) {
if ($errors[$i] == 0)
{
$numfiles++;
move_uploaded_file($tmp_names[$i], $path . '/' . $folderurl . '/' . $names[$i]);
}
}
$tenfolderok = str_replace("_", " ", $folderurl);
$dataInsert = array(
'ThongTin' => mysql_real_escape_string('Cập nhật ' . $numitems . ' bài hát trong thư mục ' . $tenfolderok),
'NguoiCapNhat' => $_SESSION['login']['id']
);
$idinsert = Insert('ThongTinCapNhat', $dataInsert);
$_SESSION['thongbao'] = "Thêm Thành Công";
Header( "Location: " . $_SERVER['HTTP_REFERER']);
exit;
}
$files = scandir($path);
$listfile = null;
$folder = null;
for($i = 2; $i < count($files); $i++)
{
$pathtrong = '../../admin2/nhacsanxuat/' . $files[$i];
$filestrong = scandir($pathtrong);
$listfileinfolder[] = array("folder" => $files[$i], "path" => $filestrong);
if($_GET['folder'] == $files[$i])
{
$listfile = $filestrong;
$folder = $files[$i];
}
else if($listfile == null)
{
$listfile = $filestrong;
$folder = $files[$i];
}
}
?>
<?php $titlepage = "Thư Viện Nhạc" ?>
<?php $page = "../" ?>
<?php include '../header/taskbar.php'; ?>
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<h4 class="page-title"><?php echo $titlepage; ?></h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<?php
foreach($listfileinfolder as $key => $item)
{
?>
<?php
$tenfolder = str_replace('_update', '<span style="color: #62ff45;"> (ĐANG SẢN XUẤT) </span>', $item['folder']);
$tenfolder = str_replace("_", " ", $tenfolder);
?>
<a href="?folder=<?php echo $item['folder']; ?>" class="badge bg-<?php echo ((isset($_GET['folder']) && $_GET['folder']==$item['folder']) || !isset($_GET['folder']) && $key == 0)? "danger" : "primary" ?>"><?php echo strtoupper($tenfolder); ?></a>
<?php
}
?>
<?php if($_SESSION['login']['Admin'] > 0) : ?>
<span id="themthumuc"><a style="cursor: pointer;" data-animation="fadein" data-overlaySpeed="200" data-overlayColor="#36404a" data-bs-toggle="modal" data-bs-target="#con-close-modal-themthumuc" name="themthumuc" class="badge bg-info"><i class="mdi mdi-border-color"></i> Thêm Thư Mục</a></span>
<div id="con-close-modal-themthumuc" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Thư Mục Âm Nhạc</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form role="form" method="POST" enctype="multipart/form-data">
<div class="modal-body p-4">
<div class="form-group">
<label for="name">Tên Thư Mục</label>
<input type="text" class="form-control" name="thumuc" placeholder="Nhập Tên Thư Mục">
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success waves-effect waves-light">Save</button>
<button type="button" class="btn btn-danger waves-effect waves-light m-l-10" data-bs-dismiss="modal" aria-label="Close">Cancel</button>
</div>
</form>
</div>
</div>
</div><!-- /.modal -->
<span id="tailennhac"><a style="cursor: pointer;" data-animation="fadein" data-overlaySpeed="200" data-overlayColor="#36404a" data-bs-toggle="modal" data-bs-target="#con-close-modal-tailennhac" name="tailennhac" class="badge bg-info"><i class="mdi mdi-border-color"></i> Thêm File</a></span>
<div id="con-close-modal-tailennhac" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Upload File</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form role="form" method="POST" enctype="multipart/form-data">
<div class="modal-body p-4">
<div class="form-group">
<label class="control-label">Danh Sách File WAV</label>
<input type="file" class="form-control" name="fileWAV[]" id="fileWAV" multiple="multiple" data-buttonname="btn-white" accept=".wav">
</div>
<div class="form-group">
<label for="position">Chủ File</label>
<select class="form-select" name="tenChuDe" data-style="btn-white">
<?php
foreach($listfileinfolder as $key => $item)
{
$tenfolderok = str_replace("_", " ", $item['folder']);
echo '<option value="'.$item['folder'].'">'.$tenfolderok.'</option>';
}
?>
</select>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success waves-effect waves-light">Save</button>
<button type="button" class="btn btn-danger waves-effect waves-light m-l-10" data-bs-dismiss="modal" aria-label="Close">Cancel</button>
</div>
</form>
</div>
</div>
</div><!-- /.modal -->
<?php endif; ?>
</div>
<div class="card-body">
<div class="responsive-table-plugin">
<div class="table-rep-plugin">
<div class="table-responsive" data-pattern="priority-columns">
<table id="tech-companies-1" class="table table-striped">
<thead>
<tr>
<th>STT</th>
<th>Bài Hát</th>
<th>Phát Hành</th>
<th>PLAY</th>
<th></th>
</tr>
</thead>
<tbody>
<?php $dem = 1; ?>
<?php for($i = 2; $i < count($listfile); $i++) : ?>
<?php
$filename = str_replace(".mp3", "", str_replace(".wav", "", $listfile[$i]));
$filenameinfo = $folder . '_' . $filename . '.txt';
$ext = pathinfo($listfile[$i], PATHINFO_EXTENSION);
if($ext == "wav" || $ext == "mp3" || $ext == "link") :
$fileupload = filectime('../../admin2/nhacsanxuat/' . $folder . '/' . $listfile[$i]);
$timehientai = time() - $fileupload;
$textlink = null;
if($ext == "link")
{
$textlink = file_get_contents('../../admin2/nhacsanxuat/' . $folder . '/' . $listfile[$i]);
}
?>
<tr>
<td><?php echo $dem++; ?></td>
<td>
<?php if(isset($textlink)) : ?>
<a href="<?php echo $textlink; ?>" target="_blank"><?php echo str_replace(".link", "", str_replace(".wav", "", $listfile[$i])); ?></a>
<?php else : ?>
<a href="https://rubymedia.studio/admin2/nhacsanxuat/<?php echo $folder; ?>/<?php echo $listfile[$i]; ?>" target="_blank"><?php echo str_replace(".mp3", "", str_replace(".wav", "", $listfile[$i])); ?></a>
<?php endif; ?>
<?php
if($timehientai < 86000)
{
echo ' <span style="background: red; color: white; font-weight: bold; text-align: center; ">NEW</span>';
}
?>
</td>
<td>
<?php if(file_exists($filenameinfo)) : ?>
<?php $info = file_get_contents($filenameinfo); ?>
<?php echo $info; ?>
<?php endif; ?>
</td>
<td>
<?php if(isset($textlink)) : ?>
<a href="<?php echo $textlink; ?>">TRUY CẬP THƯ VIỆN MUSIC</a>
<?php $textlink = null; ?>
<?php else : ?>
<audio controls style="height: 30px;margin-bottom: -11px;margin-top: -5px;">
<source src="https://rubymedia.studio/admin2/nhacsanxuat/<?php echo $folder; ?>/<?php echo $listfile[$i]; ?>" type="audio/ogg">
<source src="https://rubymedia.studio/admin2/nhacsanxuat/<?php echo $folder; ?>/<?php echo $listfile[$i]; ?>" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<?php endif; ?>
</td>
<td>
<?php if($_SESSION['login']['Admin'] > 0) : ?>
<?php if(file_exists($filenameinfo)) : ?>
<span id="stopvideo-741624"><a style="cursor: pointer;" data-animation="fadein" data-overlaySpeed="200" data-overlayColor="#36404a" data-bs-toggle="modal" data-bs-target="#con-close-modal-stop-<?php echo $dem; ?>" name="stopvideo" class="badge bg-danger"><i class="mdi mdi-close-circle-outline"></i> DELETE</a></span>
<!-- Danger Alert Modal -->
<div id="con-close-modal-stop-<?php echo $dem; ?>" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content modal-filled bg-danger">
<div class="modal-body p-4">
<div class="text-center">
<i class="dripicons-wrong h1 text-white"></i>
<h4 class="mt-2 text-white">Cảnh Báo!</h4>
<p class="mt-3 text-white">Bạn có thực sự muốn xóa network này không?</p>
<a href="?delete=<?php echo $filenameinfo; ?>" class="btn btn-light my-2">Continue</a>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<?php else : ?>
<span id="stopvideo-741624"><a style="cursor: pointer;" data-animation="fadein" data-overlaySpeed="200" data-overlayColor="#36404a" data-bs-toggle="modal" data-bs-target="#con-close-modal-editvideo-<?php echo $dem; ?>" name="stopvideo" class="badge bg-info"><i class="mdi mdi-border-color"></i> Phát Hành</a></span>
<div id="con-close-modal-editvideo-<?php echo $dem; ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Thông Tin Network Phát Hành</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form role="form" method="POST" enctype="multipart/form-data">
<div class="modal-body p-4">
<div class="form-group">
<label for="name">Nhập Network</label>
<input type="text" class="form-control" name="network" placeholder="Nhập Network Phát Hành">
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="fileedit" value="<?php echo $filenameinfo; ?>">
<button type="submit" class="btn btn-success waves-effect waves-light">Save</button>
<button type="button" class="btn btn-danger waves-effect waves-light m-l-10" data-bs-dismiss="modal" aria-label="Close">Cancel</button>
</div>
</form>
</div>
</div>
</div><!-- /.modal -->
<?php endif; ?>
<?php endif; ?>
</td>
</tr>
<?php endif; endfor;?>
</tbody>
</table>
</div> <!-- end .table-responsive -->
</div> <!-- end .table-rep-plugin-->
</div> <!-- end .responsive-table-plugin-->
</div>
</div> <!-- end card -->
</div> <!-- end col -->
</div>
<!-- end row -->
</div> <!-- container -->
<?php include '../header/footer.php'; ?>