| Server IP : 103.82.32.14 / Your IP : 216.73.217.121 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/admin2/ |
Upload File : |
<?php
include '../configchannel.php';
include 'configtotal.php';
if(isset($_POST['MD5']) || isset($_POST['Id']))
{
if(isset($_POST['MD5']) && !empty($_POST['MD5']))
{
$fileNew = $_POST['MD5'];
$dataInsert = array(
'TenBaiHat' => mysql_real_escape_string($_POST['TenBaiHat']),
'Label' => mysql_real_escape_string($_POST['Label']),
'UrlBaiHat' => mysql_real_escape_string($_POST['UrlBaiHat']),
'LinkMP3' => mysql_real_escape_string($_POST['LinkMP3']),
'NoiDungKhang' => mysql_real_escape_string($_POST['NoiDungKhang'])
);
Update('NhacGiayTo', $dataInsert, '`MD5` LIKE "' . $_POST['MD5'] . '"');
}
else
{
$fileNew = md5(mysql_real_escape_string($_POST['TenBaiHat'] . $_POST['Label'] . $_POST['UrlBaiHat']));
$dataInsert = array(
'TenBaiHat' => mysql_real_escape_string($_POST['TenBaiHat']),
'Label' => mysql_real_escape_string($_POST['Label']),
'UrlBaiHat' => mysql_real_escape_string($_POST['UrlBaiHat']),
'LinkMP3' => mysql_real_escape_string($_POST['LinkMP3']),
'NoiDungKhang' => mysql_real_escape_string($_POST['NoiDungKhang']),
'MD5' => $fileNew
);
Update('NhacGiayTo', $dataInsert, '`Id` = ' . $_POST['Id'] . '');
}
// SAVE CONTRACT
if(isset($_FILES['fileContract']['name']))
{
// SAVE CONTRACT
$info = pathinfo($_FILES['fileContract']['name']);
$ext = $info['extension']; // get the extension of the file
$newname = $fileNew . "_contract.".$ext;
$targetContract = 'thuviennhac/'.$newname;
move_uploaded_file( $_FILES['fileContract']['tmp_name'], $targetContract);
}
$_SESSION['thongbao'] = 'EDIT thành công';
Header( "Location: https://rubymedia.studio/admin/thuviennhac.php" );
exit;
}
else if(isset($_POST['TenBaiHat']))
{
$fileNew = md5(mysql_real_escape_string($_POST['TenBaiHat'] . $_POST['Label'] . $_POST['UrlBaiHat']));
$dataInsert = array(
'TenBaiHat' => mysql_real_escape_string($_POST['TenBaiHat']),
'Label' => mysql_real_escape_string($_POST['Label']),
'UrlBaiHat' => mysql_real_escape_string($_POST['UrlBaiHat']),
'LinkMP3' => mysql_real_escape_string($_POST['LinkMP3']),
'NoiDungKhang' => mysql_real_escape_string($_POST['NoiDungKhang']),
'MD5' => $fileNew
);
Insert('NhacGiayTo', $dataInsert);
// SAVE CONTRACT
if(isset($_FILES['fileContract']['name']))
{
// SAVE CONTRACT
$info = pathinfo($_FILES['fileContract']['name']);
$ext = $info['extension']; // get the extension of the file
$newname = $fileNew . "_contract.".$ext;
$targetContract = 'thuviennhac/'.$newname;
move_uploaded_file( $_FILES['fileContract']['tmp_name'], $targetContract);
}
$_SESSION['thongbao'] = 'ADD thành công';
Header( "Location: https://rubymedia.studio/admin/thuviennhac.php" );
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
<meta name="author" content="Coderthemes">
<link rel="shortcut icon" href="assets/images/favicon_1.ico">
<title>Ruby Media</title>
<!--Morris Chart CSS -->
<link href="assets/plugins/custombox/css/custombox.css" rel="stylesheet">
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="assets/css/core.css" rel="stylesheet" type="text/css" />
<link href="assets/css/components.css" rel="stylesheet" type="text/css" />
<link href="assets/css/icons.css" rel="stylesheet" type="text/css" />
<link href="assets/css/pages.css" rel="stylesheet" type="text/css" />
<link href="assets/css/responsive.css" rel="stylesheet" type="text/css" />
<!-- HTML5 Shiv and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script src="assets/js/modernizr.min.js"></script>
<script>
var phantuTruoc = "";
function playAudio(phantu) {
try {
var x = document.getElementById(phantuTruoc);
document.getElementById(phantuTruoc + "_icon").setAttribute("class", "md md-play-arrow");
document.getElementById(phantuTruoc + "_changed").setAttribute("onclick", "playAudio('"+phantuTruoc+"')");
x.pause();
}
catch(err) {
}
phantuTruoc = phantu;
var x = document.getElementById(phantu);
document.getElementById(phantu + "_icon").setAttribute("class", "md md-pause");;
document.getElementById(phantu + "_changed").setAttribute("onclick", "pauseAudio('"+phantu+"')");
x.play();
}
function pauseAudio(phantu) {
var x = document.getElementById(phantu);
document.getElementById(phantu + "_icon").setAttribute("class", "md md-play-arrow");
document.getElementById(phantu + "_changed").setAttribute("onclick", "playAudio('"+phantu+"')");
x.pause();
}
</script>
<script>
function copyText(id)
{
var copyText = document.getElementById(id);
copyText.select();
copyText.setSelectionRange(0, 99999);
document.execCommand("copy");
alert("Đã copy");
}
</script>
</head>
<body class="fixed-left">
<!-- Begin page -->
<div id="wrapper">
<!-- ========== Left Sidebar Start ========== -->
<?php include 'header/taskbar.php'; ?>
<!-- Left Sidebar End -->
<!-- ============================================================== -->
<!-- Start right Content here -->
<!-- ============================================================== -->
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<!-- Page-Title -->
<div class="row">
<div class="col-sm-12">
<h4 class="page-title">THƯ VIỆN NHẠC</h4>
<ol class="breadcrumb">
<li><a href="#">Ruby Media</a></li>
<li class="active">Thư Viên Nhạc</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card-box table-responsive">
<?php if($_SESSION['login']['Admin'] == 1) : ?>
<div class="row">
<div class="col-sm-4">
<a href="#custom-modal" class="btn btn-default btn-md waves-effect waves-light m-b-30" data-animation="fadein" data-plugin="custommodal"
data-overlaySpeed="200" data-overlayColor="#36404a"><i class="md md-add"></i> Thêm Bài Hát</a>
</div>
</div>
<?php endif; ?>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>STT</th>
<th>Bài Hát</th>
<th>MP3</th>
<th>Label</th>
<?php if($_SESSION['login']['Admin'] == 1) : ?>
<th>Nội Dung Kháng</th>
<th>Hợp Đồng</th>
<th>EDIT</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php
$dem = 1;
$result = Select('NhacGiayTo', false, "", "Id DESC");
while($res = mysqli_fetch_array($result)) :
?>
<tr>
<td>
<?php echo $dem++; ?>
</td>
<td>
<audio id="audio_<?php echo $res['Id']; ?>">
<source src="<?php echo $res['LinkMP3']; ?>" type="audio/ogg">
<source src="<?php echo $res['LinkMP3']; ?>" type="audio/mpeg">
</audio>
<a href="<?php echo $res['UrlBaiHat']; ?>" target="_blank"><?php echo $res['TenBaiHat']; ?></a>
</td>
<td>
<?php
if(empty($res['LinkMP3']))
{
echo 'NONE';
}
else
{
?>
<a style="font-size: 15px;" id="audio_<?php echo $res['Id']; ?>_changed" onclick="playAudio('audio_<?php echo $res['Id']; ?>')">
<i data-feather="activity" id="audio_<?php echo $res['Id']; ?>_icon" class="md md-play-arrow"></i>
</a>
<?php
}
?>
</td>
<td>
<?php echo $res['Label']; ?>
</td>
<?php if($_SESSION['login']['Admin'] == 1) : ?>
<td>
<textarea style="width: 0px; height: 0px;" id="copy_<?php echo $res['Id']; ?>" onclick="copyText('copy_<?php echo $res['Id']; ?>')">I bought a license
Here is my license code: <?php echo $res['NoiDungKhang']; ?></textarea>
<span onclick="copyText('copy_<?php echo $res['Id']; ?>')">I bought a license
Here is my license code: <?php echo $res['NoiDungKhang']; ?></span>
</td>
<td>
<?php
$contract = "thuviennhac/" . $res['MD5'] . "_contract.pdf";
if(!file_exists($contract))
{
echo 'NONE';
}
else
{
?>
<a href="<?php echo $contract; ?>">CONTRACT</a>
<?php
}
?>
</td>
<td>
<a href="#custom-modal-<?php echo $res['Id']; ?>" class="table-action-btn" data-animation="fadein" data-plugin="custommodal"
data-overlaySpeed="200" data-overlayColor="#36404a"><i class="md md-edit"></i></a>
<div id="custom-modal-<?php echo $res['Id']; ?>" class="modal-demo">
<button type="button" class="close" onclick="Custombox.close();">
<span>×</span><span class="sr-only">Close</span>
</button>
<h4 class="custom-modal-title">Edit Bài Hát</h4>
<div class="custom-modal-text text-left">
<form role="form" method="POST" enctype="multipart/form-data">
<div class="form-group">
<label for="name">Tên Bài Hát</label>
<input type="text" class="form-control" name="TenBaiHat" value="<?php echo $res['TenBaiHat']; ?>" placeholder="Nhập tên bài hát">
</div>
<div class="form-group">
<label for="position">Nhãn</label>
<input type="text" class="form-control" name="Label" value="<?php echo $res['Label']; ?>" placeholder="Nhập nhãn">
</div>
<div class="form-group">
<label for="position">URL Nhạc</label>
<input type="text" class="form-control" name="UrlBaiHat" value="<?php echo $res['UrlBaiHat']; ?>" placeholder="Nhập Url Nhạc">
</div>
<div class="form-group">
<label for="position">URL Link MP3</label>
<input type="text" class="form-control" name="LinkMP3" value="<?php echo $res['LinkMP3']; ?>" placeholder="Nhập Url Link MP3">
</div>
<div class="form-group">
<label for="position">Nội Dung Kháng</label>
<input type="text" class="form-control" name="NoiDungKhang" value="<?php echo $res['NoiDungKhang']; ?>" placeholder="Nhập Nội Dung Kháng">
</div>
<div class="form-group">
<label class="control-label">Hợp Đồng</label>
<input type="file" class="filestyle" name="fileContract" data-buttonname="btn-white">
</div>
<input type="hidden" value="<?php echo $res['MD5']; ?>" name="MD5"/>
<input type="hidden" value="<?php echo $res['Id']; ?>" name="Id"/>
<button type="submit" class="btn btn-default waves-effect waves-light">Save</button>
<button type="button" class="btn btn-danger waves-effect waves-light m-l-10" onclick="Custombox.close();">Cancel</button>
</form>
</div>
</div>
</td>
<?php endif; ?>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
<?php include 'header/footer.php'; ?>
</div>
<!-- Modal -->
<div id="custom-modal" class="modal-demo">
<button type="button" class="close" onclick="Custombox.close();">
<span>×</span><span class="sr-only">Close</span>
</button>
<h4 class="custom-modal-title">Thêm Bài Hát</h4>
<div class="custom-modal-text text-left">
<form role="form" method="POST" enctype="multipart/form-data">
<div class="form-group">
<label for="name">Tên Bài Hát</label>
<input type="text" class="form-control" name="TenBaiHat" placeholder="Nhập tên bài hát">
</div>
<div class="form-group">
<label for="position">Nhãn</label>
<input type="text" class="form-control" name="Label" placeholder="Nhập nhãn">
</div>
<div class="form-group">
<label for="position">URL Nhạc</label>
<input type="text" class="form-control" name="UrlBaiHat" placeholder="Nhập Url Bài hát">
</div>
<div class="form-group">
<label for="position">URL Link MP3</label>
<input type="text" class="form-control" name="LinkMP3" placeholder="Nhập Url Link MP3">
</div>
<div class="form-group">
<label for="position">Nội Dung Kháng</label>
<input type="text" class="form-control" name="NoiDungKhang" placeholder="Nhập Nội Dung Kháng">
</div>
<div class="form-group">
<label class="control-label">Hợp Đồng</label>
<input type="file" class="filestyle" name="fileContract" id="fileContract" data-buttonname="btn-white">
</div>
<button type="submit" class="btn btn-default waves-effect waves-light">Save</button>
<button type="button" class="btn btn-danger waves-effect waves-light m-l-10" onclick="Custombox.close();">Cancel</button>
</form>
</div>
</div>
<!-- /Right-bar -->
</div>
<!-- END wrapper -->
<script>
var resizefunc = [];
</script>
<!-- jQuery -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/detect.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/waves.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/jquery.nicescroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<!-- Modal-Effect -->
<script src="assets/plugins/custombox/js/custombox.min.js"></script>
<script src="assets/plugins/custombox/js/legacy.min.js"></script>
<script src="assets/plugins/bootstrap-tagsinput/js/bootstrap-tagsinput.min.js"></script>
<script src="assets/plugins/switchery/js/switchery.min.js"></script>
<script type="text/javascript" src="assets/plugins/multiselect/js/jquery.multi-select.js"></script>
<script type="text/javascript" src="assets/plugins/jquery-quicksearch/jquery.quicksearch.js"></script>
<script src="assets/plugins/select2/js/select2.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap-select/js/bootstrap-select.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap-filestyle/js/bootstrap-filestyle.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap-touchspin/js/jquery.bootstrap-touchspin.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap-maxlength/bootstrap-maxlength.min.js" type="text/javascript"></script>
<script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="assets/plugins/datatables/dataTables.bootstrap.js"></script>
<script src="assets/plugins/datatables/dataTables.buttons.min.js"></script>
<script src="assets/plugins/datatables/buttons.bootstrap.min.js"></script>
<script src="assets/plugins/datatables/jszip.min.js"></script>
<script src="assets/plugins/datatables/pdfmake.min.js"></script>
<script src="assets/plugins/datatables/vfs_fonts.js"></script>
<script src="assets/plugins/datatables/buttons.html5.min.js"></script>
<script src="assets/plugins/datatables/buttons.print.min.js"></script>
<script src="assets/plugins/datatables/dataTables.fixedHeader.min.js"></script>
<script src="assets/plugins/datatables/dataTables.keyTable.min.js"></script>
<script src="assets/plugins/datatables/dataTables.responsive.min.js"></script>
<script src="assets/plugins/datatables/responsive.bootstrap.min.js"></script>
<script src="assets/plugins/datatables/dataTables.scroller.min.js"></script>
<script src="assets/plugins/datatables/dataTables.colVis.js"></script>
<script src="assets/plugins/datatables/dataTables.fixedColumns.min.js"></script>
<script src="assets/pages/datatables.init.js"></script>
<script src="assets/js/jquery.core.js"></script>
<script src="assets/js/jquery.app.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#datatable').dataTable();
$('#datatable-keytable').DataTable({keys: true});
$('#datatable-responsive').DataTable();
$('#datatable-colvid').DataTable({
"dom": 'C<"clear">lfrtip',
"colVis": {
"buttonText": "Change columns"
}
});
});
TableManageButtons.init();
</script>
</body>
</html>