| 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/musicyzf/public_html/ |
Upload File : |
<?php
/// 0 Chưa cập nhật bản quyền
/// 1 Có Bản Quyền
/// 2 Không có bản quyền
/// 3 Chặn thế giới
/// 4 kênh chết
include 'config.php';
if(isset($_REQUEST['insert']))
{
$item_array = json_decode($_REQUEST['insert'], true);
$item_array['IdVideoGoc'] = str_replace(" ","",$item_array['IdVideoGoc']);
$row = SelectAll('YoutubeBanQuyen', true, '`IdVideoGoc` LIKE "'.$item_array['IdVideoGoc'].'"');
if($row == 0)
{
$insert_query = "INSERT INTO YoutubeBanQuyen (IdVideoGoc,ChannelVideoGoc,TitleVideoGoc,ViewVideoGoc,IdVideoTest,TrangThaiBanQuyen,NetworkBanQuyen,ThoiGianUpload,NameChannelYoutube,ThoiGianUpdateBQ) VALUES ";
$insert_query .= "('".mysql_real_escape_string($item_array['IdVideoGoc'])."','".mysql_real_escape_string($item_array['ChannelVideoGoc'])."','".mysql_real_escape_string($item_array['TitleVideoGoc'])."','".$item_array['ViewVideoGoc']."','".mysql_real_escape_string($item_array['IdVideoTest'])."','".$item_array['TrangThaiBanQuyen']."','".mysql_real_escape_string($item_array['NetworkBanQuyen'])."','".time()."','".mysql_real_escape_string($item_array['NameChannelYoutube'])."', ".time().");";
mysqli_query($conn, $insert_query);
echo $insert_query;
}
else
{
$TrangThaiBanQuyen = $item_array['TrangThaiBanQuyen'];
$ViewVideoGoc = $item_array['ViewVideoGoc'];
$NetworkBanQuyen = mysql_real_escape_string($item_array['NetworkBanQuyen']);
$IdVideoGoc = $item_array['IdVideoGoc'];
if($TrangThaiBanQuyen == 0)
{
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => 2, 'NetworkBanQuyen' => "", 'ThoiGianUpdateBQ' => time(), 'ViewVideoGoc' => $ViewVideoGoc, 'MixNhacTest' => 0), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
}
else if($TrangThaiBanQuyen == 2)
{
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => 2, 'NetworkBanQuyen' => "", 'ThoiGianUpdateBQ' => time(), 'ViewVideoGoc' => $ViewVideoGoc, 'MixNhacTest' => 1), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "' AND `TrangThaiBanQuyen` != 1");
}
else
{
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => $TrangThaiBanQuyen, 'NetworkBanQuyen' => $NetworkBanQuyen, 'ThoiGianUpdateBQ' => time(), 'ViewVideoGoc' => $ViewVideoGoc, 'MixNhacTest' => 1), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => $TrangThaiBanQuyen, 'NetworkBanQuyen' => $NetworkBanQuyen, 'ThoiGianUpdateBQ' => time(), 'ViewVideoGoc' => $ViewVideoGoc, 'MixNhacTest' => 1), '`TitleVideoGoc` LIKE ' . "'" . mysql_real_escape_string($item_array['TitleVideoGoc']) . "'");
}
}
}
if(isset($_REQUEST['insertBQ']))
{
$item_array_json = json_decode($_REQUEST['insertBQ'], true);
foreach($item_array_json as $key => $item_array)
{
$item_array['IdVideoGoc'] = str_replace(" ","",$item_array['IdVideoGoc']);
$row = SelectAll('YoutubeBanQuyen', true, '`IdVideoGoc` LIKE "'.$item_array['IdVideoGoc'].'"');
if($row == 0)
{
$insert_query = "INSERT INTO YoutubeBanQuyen (IdVideoGoc,ChannelVideoGoc,TitleVideoGoc,ViewVideoGoc,IdVideoTest,TrangThaiBanQuyen,NetworkBanQuyen,ThoiGianUpload,NameChannelYoutube,ThoiGianUpdateBQ) VALUES ";
$insert_query .= "('".mysql_real_escape_string($item_array['IdVideoGoc'])."','".mysql_real_escape_string($item_array['ChannelVideoGoc'])."','".mysql_real_escape_string($item_array['TitleVideoGoc'])."','".$item_array['ViewVideoGoc']."','".mysql_real_escape_string($item_array['IdVideoTest'])."','".$item_array['TrangThaiBanQuyen']."','".mysql_real_escape_string($item_array['NetworkBanQuyen'])."','".time()."','".mysql_real_escape_string($item_array['NameChannelYoutube'])."', ".time().");";
mysqli_query($conn, $insert_query);
echo $insert_query;
}
else
{
$TrangThaiBanQuyen = $item_array['TrangThaiBanQuyen'];
$ViewVideoGoc = $item_array['ViewVideoGoc'];
$NetworkBanQuyen = mysql_real_escape_string($item_array['NetworkBanQuyen']);
$IdVideoGoc = $item_array['IdVideoGoc'];
if($TrangThaiBanQuyen == 0)
{
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => 2, 'NetworkBanQuyen' => "", 'ThoiGianUpdateBQ' => time(), 'ViewVideoGoc' => $ViewVideoGoc, 'MixNhacTest' => 0), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
}
else
{
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => $TrangThaiBanQuyen, 'NetworkBanQuyen' => $NetworkBanQuyen, 'ThoiGianUpdateBQ' => time(), 'ViewVideoGoc' => $ViewVideoGoc, 'MixNhacTest' => 1), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
}
}
}
}
if(isset($_REQUEST['insertVideoMix']))
{
$row = Select('YoutubeVideoDaUpload', true, '`IdVideo` LIKE "'.mysql_real_escape_string($_REQUEST['insertVideoMix']).'"');
if($row == 0)
{
$listVideoUpdate = explode(',', $_REQUEST['videoChecked']);
foreach($listVideoUpdate as $key => $item)
{
Update('YoutubeBanQuyen', array('MixNhacTest' => 1), '`IdVideoGoc` LIKE ' . "'" . $item . "'");
}
$insert_query = "INSERT INTO YoutubeVideoDaUpload (IdVideo,ThoiGianUpload,ThoiGianUpdate) VALUES ";
$insert_query .= "('".mysql_real_escape_string($_REQUEST['insertVideoMix'])."',".time().",".time().");";
mysqli_query($conn, $insert_query);
echo $insert_query;
}
}
if(isset($_REQUEST['updateVideoTimeMix']))
{
$listVideoUpdate = explode(',', $_REQUEST['videoChecked']);
foreach($listVideoUpdate as $key => $item)
{
Update('YoutubeBanQuyen', array('ThoiGianUpdateBQ' => time()), '`IdVideoGoc` LIKE ' . "'" . $item . "'");
}
}
else if(isset($_REQUEST['json_pro']))
{
// Check Lai
$result_network = SelectAll('YoutubeBanQuyen', false);
$count = 1;
while($res = mysqli_fetch_array($result_network))
{
Update('YoutubeBanQuyen', array('Id' => $count), '`IdVideoGoc` LIKE ' . "'" . $res['IdVideoGoc'] . "'");
$count++;
}
}
else if(isset($_REQUEST['update_view']))
{
$IdVideoGoc = $_REQUEST['IdVideoGoc'];
$ViewVideoGoc = $_REQUEST['ViewVideoGoc'];
Update('YoutubeBanQuyen', array('ViewVideoGoc' => $ViewVideoGoc), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
}
else if(isset($_REQUEST['update']))
{
$IdVideoGoc = $_REQUEST['IdVideoGoc'];
$ViewVideoGoc = $_REQUEST['ViewVideoGoc'];
$NetworkBanQuyen = $_REQUEST['NetworkBanQuyen'];
$TrangThaiBanQuyen = 1; // Tự động có bản quyền
if(!isset($_REQUEST['ViewVideoGoc']) && !isset($_REQUEST['NetworkBanQuyen']))
{
Update('YoutubeBanQuyen', array('ThoiGianUpdateBQ' => time()), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
}
if($NetworkBanQuyen == 'DIE')
{
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => $TrangThaiBanQuyen, 'ViewVideoGoc' => $ViewVideoGoc, 'ThoiGianUpdateBQ' => time()), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "' AND `TrangThaiBanQuyen` = 0");
}
else if($NetworkBanQuyen == null || $NetworkBanQuyen == "")
{
$TrangThaiBanQuyen = 2;
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => $TrangThaiBanQuyen, 'ViewVideoGoc' => $ViewVideoGoc, 'ThoiGianUpdateBQ' => time()), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
echo 'success';
}
else if($NetworkBanQuyen == 'block')
{
$TrangThaiBanQuyen = 3;
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => $TrangThaiBanQuyen, 'NetworkBanQuyen' => $NetworkBanQuyen, 'ThoiGianUpdateBQ' => time()), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
echo 'block';
}
else
{
Update('YoutubeBanQuyen', array('TrangThaiBanQuyen' => $TrangThaiBanQuyen, 'NetworkBanQuyen' => $NetworkBanQuyen, 'ViewVideoGoc' => $ViewVideoGoc, 'ThoiGianUpdateBQ' => time()), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
echo 'success';
}
}
else if(isset($_REQUEST['checkBQVideoTimKiemAuto']))
{
$row = Select('YoutubeBanQuyen', true, '`TrangThaiBanQuyen` = 1 AND `IdVideoGoc` LIKE "'.mysql_real_escape_string($_REQUEST['checkBQVideoTimKiemAuto']).'"');
if($row > 0)
{
echo 'true';
}
else
{
echo 'false';
}
}
else if(isset($_REQUEST['GetTracklistYoutubeVideoUploadTracklist']))
{
$row = SelectAll('YoutubeVideoUploadTrackList', true, '`IdVideo` LIKE "'.mysql_real_escape_string($_REQUEST['GetTracklistYoutubeVideoUploadTracklist']).'"');
if($row > 0)
{
$result = mysqli_fetch_assoc(SelectAll('YoutubeVideoUploadTrackList', false, '`IdVideo` LIKE "'.mysql_real_escape_string($_REQUEST['GetTracklistYoutubeVideoUploadTracklist']).'"'));
echo $result['TrackList'];
Update('YoutubeVideoUploadTrackList', array('TimeUpdate' => time()), '`IdVideo` LIKE ' . "'" . $result['IdVideo'] . "'");
}
else
{
echo 'false';
}
}
else if(isset($_REQUEST['GetYoutubeVideoUploadTrackList']))
{
$AccessToken = $_REQUEST['access'];
$row = SelectAll('YoutubeAccessToken', true, '`AccessToken` LIKE "'.mysql_real_escape_string($AccessToken).'"');
if($row > 0)
{
$result = mysqli_fetch_assoc(SelectAll('YoutubeAccessToken', false, '`AccessToken` LIKE ' . "'" . mysql_real_escape_string($AccessToken) . "'"));
$IdAccessToken = $result['Id'];
$time_2hour = (60*60)*2; // 2 tiếng
$time_conlai = time()-$time_2hour;
$row = SelectAll('YoutubeVideoUploadTrackList', false, '((`TimeUpload` < '.$time_conlai.' AND `TimeUpdate` = 0) OR ((`TimeUpdate` < ('.time().'-(`TimeUpdate`-`TimeUpload`))) AND `TimeUpdate` > 0)) AND `AccessToken` = ' . $IdAccessToken);
if($row > 0)
{
$result = SelectAll('YoutubeVideoUploadTrackList', false, '((`TimeUpload` < '.$time_conlai.' AND `TimeUpdate` = 0) OR ((`TimeUpdate` < ('.time().'-(`TimeUpdate`-`TimeUpload`))) AND `TimeUpdate` > 0)) AND `AccessToken` = ' . $IdAccessToken);
while($res = mysqli_fetch_array($result))
{
$list[] = $res['IdVideo'];
if(!isset($_REQUEST['check']))
{
//Update('YoutubeVideoUploadTrackList', array('TimeUpdate' => time()), '`IdVideo` LIKE ' . "'" . $res['IdVideo'] . "'");
}
}
if(isset($list))
{
echo implode(",",$list);
}
else
{
echo "false 2";
}
}
else
{
echo "false 1";
}
}
else
{
echo "false 0";
}
}
else if(isset($_REQUEST['jsonchannel']))
{
$time_1day = ((60*60)*5)*1;
$time_conlai = time()-$time_1day;
$ChannelVideoGoc = $_REQUEST['ChannelVideoGoc'];
$GetALL = '`TrangThaiBanQuyen` = 2 AND `ThoiGianUpload` < '.$time_conlai.' AND ';
if(isset($_REQUEST['GetALL']))
{
$GetALL = '';
}
if($_REQUEST['jsonchannel'] == 'test_mix_nhac') // Test Xem Danh Sách Bài Hát Khi Mix Nhạc Có Bản Quyền Không
{
$GetALL = '`TrangThaiBanQuyen` = 2 AND `MixNhacTest` = 0 AND ';
}
if($_REQUEST['jsonchannel'] == 'tat_ca' || $_REQUEST['jsonchannel'] == 'tatca')
{
$GetALL = '(`TrangThaiBanQuyen` = 2 OR `TrangThaiBanQuyen` = 1 OR `TrangThaiBanQuyen` = 0) AND ';
}
$row = SelectAll('YoutubeBanQuyen', true, $GetALL . '`ChannelVideoGoc` LIKE ' . "'%" . $ChannelVideoGoc . "%'");
if($row > 0)
{
$result = SelectAll('YoutubeBanQuyen', false, $GetALL . '`ChannelVideoGoc` LIKE ' . "'%" . $ChannelVideoGoc . "%'");
while($res = mysqli_fetch_array($result))
{
if($res['ThoiGianUpload'])
$list[] = $res['IdVideoGoc'];
}
if(isset($list))
{
echo implode(",",$list);
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if(isset($_REQUEST['jsonchannel_checkbanquyen'])) // Thực hiện cho việc lấy channel id kênh đang sử dụng access token
{
$ChannelVideoGoc = $_REQUEST['ChannelVideoGoc'];
if(isset($_REQUEST['update_checkbanquyen']))
{
$IdVideoTest = $_REQUEST['IdVideoTest'];
$IdVideoGoc = $_REQUEST['IdVideoGoc'];
Update('YoutubeBanQuyen', array('IdVideoTest' => $IdVideoTest), '`IdVideoGoc` LIKE ' . "'" . $IdVideoGoc . "'");
}
else if(isset($_REQUEST['delete_checkbanquyen']))
{
$IdVideoTest = $_REQUEST['IdVideoTest'];
Delete('YoutubeBanQuyen', '`IdVideoTest` LIKE ' . "'" . $IdVideoTest . "'");
}
else
{
$GetALL = '(`TrangThaiBanQuyen` = 2 OR `TrangThaiBanQuyen` = 1) AND ';
if(isset($_REQUEST['GetALL']))
{
$GetALL = '';
}
$row = SelectAll('YoutubeBanQuyen', true, $GetALL . '`ChannelVideoGoc` LIKE ' . "'%" . $ChannelVideoGoc . "%'");
if($row > 0)
{
$result = SelectAll('YoutubeBanQuyen', false, $GetALL . '`ChannelVideoGoc` LIKE ' . "'%" . $ChannelVideoGoc . "%'");
while($res = mysqli_fetch_array($result))
{
$list[] = array(
'IdVideoGoc' => $res['IdVideoGoc'],
'ChannelVideoGoc' => $res['ChannelVideoGoc'],
'TitleVideoGoc' => $res['TitleVideoGoc'],
'ViewVideoGoc' => $res['ViewVideoGoc'],
'IdVideoTest' => $res['IdVideoTest'],
'TrangThaiBanQuyen' => $res['TrangThaiBanQuyen'],
'NetworkBanQuyen' => $res['NetworkBanQuyen'],
'NameChannelYoutube' => $res['NameChannelYoutube']
);
}
if(isset($list))
{
echo json_encode($list);
}
else
{
echo "false 2";
}
}
else
{
echo "false 1";
}
}
}
else if(isset($_REQUEST['json']))
{
$time_1day = (60*60)*1;
$time_conlai = time()-$time_1day;
$row = SelectAll('YoutubeBanQuyen', true, '((`TrangThaiBanQuyen` = 0 AND `ThoiGianUpdateBQ` < '.$time_conlai.') OR (`TrangThaiBanQuyen` = 2 AND `ThoiGianUpdateBQ` < ('.time().'-(`ThoiGianUpdateBQ`-`ThoiGianUpload`)))) AND `IdVideoTest` != "DIE" LIMIT 50');
if($row > 0)
{
if(isset($_REQUEST['test']))
{
$row2 = SelectAll('YoutubeBanQuyen', true, '((`TrangThaiBanQuyen` = 0 AND `ThoiGianUpdateBQ` < '.$time_conlai.') OR (`TrangThaiBanQuyen` = 2 AND `ThoiGianUpdateBQ` < ('.time().'-(`ThoiGianUpdateBQ`-`ThoiGianUpload`)))) AND `IdVideoTest` != "DIE" LIMIT 50');
echo $row2;
}
$result = SelectAll('YoutubeBanQuyen', false, '((`TrangThaiBanQuyen` = 0 AND `ThoiGianUpdateBQ` < '.$time_conlai.') OR (`TrangThaiBanQuyen` = 2 AND `ThoiGianUpdateBQ` < ('.time().'-(`ThoiGianUpdateBQ`-`ThoiGianUpload`)))) AND `IdVideoTest` != "DIE" LIMIT 50');
while($res = mysqli_fetch_array($result))
{
$list[] = array(
'IdVideoGoc' => $res['IdVideoGoc'],
'ChannelVideoGoc' => $res['ChannelVideoGoc'],
'TitleVideoGoc' => $res['TitleVideoGoc'],
'ViewVideoGoc' => $res['ViewVideoGoc'],
'IdVideoTest' => $res['IdVideoTest'],
'TrangThaiBanQuyen' => $res['TrangThaiBanQuyen'],
'NetworkBanQuyen' => $res['NetworkBanQuyen'],
'NameChannelYoutube' => $res['NameChannelYoutube']
);
}
if(isset($list))
{
echo json_encode($list);
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if(isset($_REQUEST['mixNhacTest']))
{
$time_1day = (60*60)*2;
$time_1day = (60*60)*2;
$time_conlai = time()-$time_1day;
$time_1day_day = (60*60)*24*2;
$time_conlai_day = time()-$time_1day_day;
if($_REQUEST['mixNhacTest'] == 'select')
{
$row = SelectAll('YoutubeVideoDaUpload', true, '((`TrangThaiBanQuyen` = 0 AND `ThoiGianUpload` < '.$time_conlai.') OR (`TrangThaiBanQuyen` != 0 AND `ThoiGianUpdate` < '.$time_conlai_day.')) LIMIT 50');
if($row > 0)
{
$result = SelectAll('YoutubeVideoDaUpload', false, '((`TrangThaiBanQuyen` = 0 AND `ThoiGianUpload` < '.$time_conlai.') OR (`TrangThaiBanQuyen` != 0 AND `ThoiGianUpdate` < '.$time_conlai_day.')) LIMIT 50');
while($res = mysqli_fetch_array($result))
{
$list[] = $res['IdVideo'];
}
if(isset($list))
{
echo json_encode($list);
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if($_REQUEST['mixNhacTest'] == 'update')
{
if(isset($_REQUEST['IdVideo']))
{
$netw = null;
if(isset($_REQUEST['TrangThaiBanQuyen']))
{
$netw = $_REQUEST['TrangThaiBanQuyen'];
}
Update('YoutubeVideoDaUpload', array('ThoiGianUpdate' => time(), 'TrangThaiBanQuyen' => $netw), '`IdVideo` LIKE ' . "'" . $_REQUEST['IdVideo'] . "'");
}
if(isset($_REQUEST['NameVideo']))
{
Update('YoutubeBanQuyen', array('ThoiGianUpdateBQ' => time(), 'TrangThaiBanQuyen' => 1, 'NetworkBanQuyen' => mysql_real_escape_string($_REQUEST['KeyMixNhac'])), '`TitleVideoGoc` LIKE "'.mysql_real_escape_string($_REQUEST['NameVideo']).'"');
}
}
}
else if(isset($_REQUEST['GetNamVideoNCS'])) // Không bản quyền
{
$list_key = split(" ", $_REQUEST['GetNamVideoNCS']);
$str_query = "";
$total = count($list_key)-1;
foreach($list_key as $key => $item)
{
if($key >= $total)
{
$str_query .= "(`TitleVideoGoc` LIKE '%" . mysql_real_escape_string($item) . "%')";
}
else
{
$str_query .= "(`TitleVideoGoc` LIKE '%" . mysql_real_escape_string($item) . "%') AND ";
}
}
$SqlBQ = "`TrangThaiBanQuyen` = 2 AND `MixNhacTest` = 1";
/// Hỗ trợ tool Mix Nhạc V2
if(isset($_REQUEST['tatca']))
{
$SqlBQ = "(`TrangThaiBanQuyen` = 2 OR `TrangThaiBanQuyen` = 1 OR `TrangThaiBanQuyen` = 0)";
}
$row = SelectAll('YoutubeBanQuyen', true, $str_query . ' AND ' . $SqlBQ . '');
if($row > 0)
{
$result = SelectAll('YoutubeBanQuyen', false, $str_query . ' AND ' . $SqlBQ . '');
while($res = mysqli_fetch_array($result))
{
$list[] = $res['IdVideoGoc'];
}
if(isset($list))
{
if(isset($_REQUEST['all_get']))
{
echo implode(",",$list);
}
else
{
$rand = rand(0,count($list)-1);
echo $list[$rand];
}
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if(isset($_REQUEST['GetALLTest']))
{
$row = SelectAll('YoutubeBanQuyen', true, '`NgayDangVideo` IS NULL LIMIT 50');
if($row > 0)
{
$result = SelectAll('YoutubeBanQuyen', false, '`NgayDangVideo` IS NULL LIMIT 50');
while($res = mysqli_fetch_array($result))
{
$list[] = $res['IdVideoGoc'];
}
if(isset($list))
{
echo json_encode($list);
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if(isset($_REQUEST['DeleteVideo']))
{
Delete('YoutubeBanQuyen', '`IdVideoGoc` LIKE "'.mysql_real_escape_string($_REQUEST['DeleteVideo']).'"');
}
else if(isset($_REQUEST['checkVideoBQ']))
{
$row = SelectAll('YoutubeBanQuyen', true, '`IdVideoGoc` LIKE "'.mysql_real_escape_string($_REQUEST['checkVideoBQ']).'"');
if($row > 0)
{
$result = SelectAll('YoutubeBanQuyen', false, '`IdVideoGoc` LIKE "'.mysql_real_escape_string($_REQUEST['checkVideoBQ']).'"');
while($res = mysqli_fetch_array($result))
{
$list[] = $res['TrangThaiBanQuyen'];
}
if(isset($list) && $list[0] == 2)
{
echo "true";
}
else
{
echo "false";
}
}
else
{
echo "0";
}
}
else if(isset($_REQUEST['DeleteVideoTracklistVideo']))
{
Update('YoutubeVideoUploadTrackList', array('Delete' => 1), '`IdVideo` LIKE "'.mysql_real_escape_string($_REQUEST['DeleteVideoTracklistVideo']).'"');
}
else if(isset($_REQUEST['GetNhacMix']))
{
$time_1day = ((60*60)*5)*1;
$time_conlai = time()-$time_1day;
$GetALL = '`TrangThaiBanQuyen` = 0 AND `ThoiGianUpload` < '.$time_conlai.' AND `MixNhacTest` = 0 LIMIT 40';
$row = SelectAll('YoutubeBanQuyen', true, $GetALL);
if($row > 0)
{
$result = SelectAll('YoutubeBanQuyen', false, $GetALL);
while($res = mysqli_fetch_array($result))
{
$list[] = $res['IdVideoGoc'];
}
if(isset($list))
{
echo implode(",",$list);
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if(isset($_REQUEST['GetNhacMixAll']))
{
$time_1day = ((60*60)*5)*1;
$time_conlai = time()-$time_1day;
$time_update = time()-60*60*12; // 12 tiếng
$GetALL = '(`TrangThaiBanQuyen` = 2 AND `ThoiGianUpload` < '.$time_conlai.' AND `MixNhacTest` = 0) AND (`ThoiGianUpdateBQ` < '.$time_update.') ORDER BY `Id` ASC LIMIT 70';
$row = SelectAll('YoutubeBanQuyen', true, $GetALL);
if($row > 0)
{
$result = SelectAll('YoutubeBanQuyen', false, $GetALL);
while($res = mysqli_fetch_array($result))
{
$list[] = $res['IdVideoGoc'];
}
if(isset($list))
{
echo implode(",",$list);
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if(isset($_REQUEST['GetNhacMixAllDesc']))
{
$time_1day = ((60*60)*5)*1;
$time_conlai = time()-$time_1day;
$time_update = time()-60*60*12; // 12 tiếng
$GetALL = '(`TrangThaiBanQuyen` = 2 AND `ThoiGianUpload` < '.$time_conlai.' AND `MixNhacTest` = 0) AND (`ThoiGianUpdateBQ` < '.$time_update.') ORDER BY `Id` DESC LIMIT 70';
$row = SelectAll('YoutubeBanQuyen', true, $GetALL);
if($row > 0)
{
$result = SelectAll('YoutubeBanQuyen', false, $GetALL);
while($res = mysqli_fetch_array($result))
{
$list[] = $res['IdVideoGoc'];
}
if(isset($list))
{
echo implode(",",$list);
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if(isset($_REQUEST['GetNhacKenhCheck']))
{
$AccessToken = $_REQUEST['access'];
$row = SelectAll('YoutubeAccessToken', true, '`AccessToken` LIKE "'.mysql_real_escape_string($AccessToken).'"');
if($row > 0)
{
$result = mysqli_fetch_assoc(SelectAll('YoutubeAccessToken', false, '`AccessToken` LIKE ' . "'" . mysql_real_escape_string($AccessToken) . "'"));
$IdAccessToken = $result['Id'];
$GetALL = '(`TrangThaiCheckChannel` = 0) AND (`AccessToken` = 0 OR `AccessToken` = ' . $IdAccessToken . ') ORDER BY `Id` DESC LIMIT 10';
$row = SelectAll('YoutubeListChannelTest', true, $GetALL);
if($row > 0)
{
$result = SelectAll('YoutubeListChannelTest', false, $GetALL);
while($res = mysqli_fetch_array($result))
{
$list[] = $res['IdChannel'];
}
if(isset($list))
{
echo implode(",",$list);
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else
{
echo "false";
}
}
else if(isset($_REQUEST['UpdateNhacKenhCheck']))
{
Update('YoutubeListChannelTest', array('TrangThaiCheckChannel' => 1), '`IdChannel` LIKE ' . "'" . mysql_real_escape_string($_REQUEST['UpdateNhacKenhCheck']) . "'");
}
else if(isset($_REQUEST['UpdateNhacKenhCheckAccessToken']))
{
$AccessToken = $_REQUEST['access'];
$row = SelectAll('YoutubeAccessToken', true, '`AccessToken` LIKE "'.mysql_real_escape_string($AccessToken).'"');
if($row > 0)
{
$result = mysqli_fetch_assoc(SelectAll('YoutubeAccessToken', false, '`AccessToken` LIKE ' . "'" . mysql_real_escape_string($AccessToken) . "'"));
$IdAccessToken = $result['Id'];
Update('YoutubeListChannelTest', array('AccessToken' => $IdAccessToken), '`IdChannel` LIKE ' . "'" . mysql_real_escape_string($_REQUEST['UpdateNhacKenhCheckAccessToken']) . "'");
}
}
else if(isset($_REQUEST['InsertTracklistVideo']))
{
$item_array = json_decode($_REQUEST['InsertTracklistVideo'], true);
$AccessToken = $item_array['AccessToken'];
$row = SelectAll('YoutubeAccessToken', true, '`AccessToken` LIKE "'.mysql_real_escape_string($AccessToken).'"');
if($row > 0)
{
$result = mysqli_fetch_assoc(SelectAll('YoutubeAccessToken', false, '`AccessToken` LIKE ' . "'" . mysql_real_escape_string($AccessToken) . "'"));
$IdAccessToken = $result['Id'];
$infoInsert = array(
'AccessToken' => $IdAccessToken,
'IdVideo' => $item_array['IdVideo'],
'TrackList' => mysql_real_escape_string($item_array['TrackList']),
'TimeUpload' => time(),
'TimeUpdate' => 0,
);
Insert('YoutubeVideoUploadTrackList', $infoInsert);
}
}
else if(isset($_REQUEST['ImportChannelAccessToken']))
{
$row = SelectAll('YoutubeAccessToken', true, '`EmailChannel` LIKE "%'.mysql_real_escape_string($_REQUEST['ImportChannelAccessToken']).'%"');
if($row > 0)
{
$result = mysqli_fetch_assoc(SelectAll('YoutubeAccessToken', false, '`EmailChannel` LIKE "%'.mysql_real_escape_string($_REQUEST['ImportChannelAccessToken']).'%"'));
echo '[{"Channel":"{\"NameChannel\":\"'.$result['NameChannel'].'\",\"EmailChannel\":\"'.$result['EmailChannel'].'\",\"LinkChannel\":\"'.$result['UrlChannel'].'\",\"IsRunningText\":\"KHÔNG CÓ VIỆC 1\",\"MessageShow\":null,\"TrangThaiChay\":false,\"ClientId\":\"166312872233-gr6jqe0pv3su8qpajfipcp2sl7lcjcf3.apps.googleusercontent.com\",\"ClientSecret\":\"'.$result['GoogleClientSecret'].'\",\"AccessToken\":\"'.$result['GoogleAccessToken'].'\",\"RefreshToken\":\"'.$result['GoogleRefreshToken'].'\",\"LuaChonKieuMix\":1,\"ThayNenVideo\":true,\"ChuDeNenVideo\":2,\"TrangLayNenVideoId\":7,\"TrangLayNenVideoName\":\"Music Cam Cao Phong Image Hour\",\"ChenLogo\":false,\"TenFileLogo\":\"\",\"Description\":\"[sp]copytieude[sp]\",\"Tags\":\"[sp]copytags[sp]\",\"ListTileSpin\":[{\"Title\":\"[sp]tenbaihat[sp]\",\"FindTieuDeNangCao\":null}],\"VideoSapXepTheo\":2,\"IsRunning\":false,\"TimeLayVideoChoSevices\":\"2019-09-08T00:00:00\",\"KieuLayVideoChoSevices\":0,\"GianCachThoiGianUploadBatDau\":0,\"GianCachThoiGianUploadKetThuc\":0,\"SuDungTinhNangPublicVideo\":false,\"ThoiGianPublicVideoBatDau\":0,\"ThoiGianPublicVideoKetThuc\":0,\"ListInfoChannelReup\":[{\"NameChannel\":\"test\",\"UrlChannel\":\"tét\",\"TextDescription\":\"\",\"DanhSachVideoLay\":[\"http://music.camcaophong.biz/YoutubeBanQuyen.php?GetNhacKenhCheck\"],\"SuDungSeverLayVideoKhongBanQuyen\":false,\"NhungVideoDaLayDuocLanTruoc\":null,\"SuDungThumbVideoCu\":false,\"SuDungAddLogoVaoThumb\":false,\"PathLogoThumbVideoCu\":\"\"}],\"LayVideoDuoi10Phut\":true,\"LayVideoTren10Phut\":false,\"KiemTraBanQuyenUpdateSever\":true,\"SuDungMuaView\":false,\"SuDungMuaShare\":false,\"MuaViewSoLuong\":0,\"MuaShareSoLuong\":0,\"DanhSachVideoDaMuaView\":null,\"DanhSachVideoDaMuaShare\":null,\"KiemTraBanQuyenMixNhac\":false,\"SuDungNhacTrenSeverDaGroup\":false,\"SuDungNhacTrenSeverDaGroupIdThuMuc\":2,\"SuDungNhacTrenSeverDaGroupSLBaiNgauNhien\":0,\"SuDungAutoLayThumbYoutube\":false,\"AutoLayThumbYoutube\":null,\"SuDungIntroDauVideo\":false,\"PathFileIntroDauVideo\":null,\"OpacityFileIntroDauVideo\":0,\"SoGiayBatDauOutIntroVideo\":0,\"SoGiaySeOutHetIntroVideo\":0,\"SuDungThoiGianMixNhac\":false,\"SuDungThoiGianMixNhacSoBaiHat\":20,\"SuDungThoiGianMixNhacThoiLuongVideo\":1,\"SuDungThoiGianMixNhacSoLuongVideoToiThieuTaiVe\":15,\"SuDungBaiHatCuoiVideo\":false,\"SuDungBaiHatCuoiVideoUrlBaiHat\":null,\"ThumbSuDung\":false,\"AutoLayThumbYoutubeLamThumb\":null}","Running":"{\"PageDangLayHinhNen\":0,\"UrlTrangDangLayHinhNen\":null,\"TenAnhNenDaDownload\":null,\"HinhNenLayTiepTheo\":0,\"ThoiGianUploadCuoiCung\":\"0001-01-01T00:00:00\",\"NhungTieuDeDaSuDung\":null,\"NhungHinhNenDaLay\":null,\"NhungHinhNenDaLay_LuuTam\":null,\"NhungVideoDaLay_LuuTam\":null,\"NhungVideoDaLay\":null,\"VideoDangLay\":null,\"NextChannelGet\":0,\"InfoUpload\":null,\"ThoiGianUploadTiepTheo\":0,\"TrangThaiChoDoiLamViec\":0,\"ThoiGianLamViecTiepTheo\":\"0001-01-01T00:00:00\",\"DanhSachVideoDaTaiLen\":null,\"TenHinhThumbDaDownload\":null,\"TracklistLuuTam\":null,\"ListUrlTenBaiHat\":null}"}]';
}
}
else if(isset($_REQUEST['test']))
{
$result = SelectAll('YoutubeBanQuyen', false, '`TrangThaiBanQuyen` = 0');
while($res = mysqli_fetch_array($result))
{
$row = SelectAll("YoutubeVideoUploadTrackList", true, "`TrackList` LIKE '%" . mysql_real_escape_string($res['IdVideoGoc']) . "%'");
if($row == 0)
{
Delete('YoutubeBanQuyen', '`IdVideoGoc` LIKE "'.mysql_real_escape_string($res['IdVideoGoc']).'"');
}
}
}
else if(isset($_REQUEST['test2']))
{
$result = SelectAll('YoutubeListChannelTest', false);
$dem = 0;
while($res = mysqli_fetch_array($result))
{
$listtest[] = array
(
'NameChannel' => $res['NameChannel'],
'UrlChannel' => 'https://www.youtube.com/channel/' . $res['IdChannel'],
'TextDescription' => '',
'DanhSachVideoLay' => null,
'SuDungSeverLayVideoKhongBanQuyen' => true,
'NhungVideoDaLayDuocLanTruoc' => null,
'SuDungThumbVideoCu' => true,
'SuDungAddLogoVaoThumb' => true,
'PathLogoThumbVideoCu' => '28244_logo.png'
);
}
echo json_encode($listtest);
}
?>