| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp/htdocs-coblaa/pureFaith/ |
Upload File : |
<?php
include('db.php');
session_start();
$status = $_GET['status'];
//////////////////////////////////////////////////////////
$curr_day = date("d");
$curr_month = date("m");
$curr_year = date("Y");
$curr_hour = date("H");
///////////////////////////////////////////////////////////////
?>
<span style="display:none;">
<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip"));
$city = $geo["geoplugin_city"];
$region = $geo["geoplugin_regionName"];
$country = $geo["geoplugin_countryName"];
/*echo"$user_ip";
echo "City: ".$city."<br>";
echo "Region: ".$region."<br>";
echo "Country: ".$country."<br>";
/*
geoplugin_request
geoplugin_status
geoplugin_credit
geoplugin_city
geoplugin_region
geoplugin_areaCode
geoplugin_dmaCode
geoplugin_countryCode
geoplugin_countryName
geoplugin_continentCode
geoplugin_latitude
geoplugin_longitude
geoplugin_regionCode
geoplugin_regionName
geoplugin_currencyCode
geoplugin_currencySymbol
geoplugin_currencySymbol_UTF8
geoplugin_currencyConverter
*/
if(isset($_SESSION['my_id']))
{
$userId = $_SESSION['my_id'];
}
?>
</span>
<?php
//////////////////////////////////////////////////////////////////// card_div
if($status =="disp_video_list")
{
?>
<div id="card_div" class="card_div" >
<?php
$get_video ="select * from cb_videotb ";
$run_get_video = mysqli_query($con,$get_video);
while($row_get_video = mysqli_fetch_array($run_get_video))
{
$video_id = $row_get_video['id'];
$studioId = $row_get_video['studioId'];
$video_name = $row_get_video['video_name'];
$video_url = $row_get_video['video_url'];
$thumb_url = $row_get_video['thumb_url'];
$studioId = $row_get_video['studioId'];
$getComment_count ="select * from clip_commenttb where videoId='$video_id' ";
$run_getComment_count = mysqli_query($con,$getComment_count);
$check_comm_count = mysqli_num_rows($run_getComment_count);
$get_vidView_count ="select * from clip_videoviewtb where videoId='$video_id'";
$run_get_vidView_count = mysqli_query($con,$get_vidView_count);
$check_get_vidView_count = mysqli_num_rows($run_get_vidView_count);
if($check_get_vidView_count <1){$count_vidView ="Views";}elseif($check_get_vidView_count==1){$count_vidView ="$check_get_vidView_count View";}else{ $count_vidView ="$check_get_vidView_count Views";}
?>
<a href="clip_player?vidid=<?php echo $video_id; ?>&vidname=<?php echo"$video_name "; ?>&vidurl=<?php echo $video_url; ?>&vidalbid=<?php echo $studioId; ?>&vidthumb=<?php echo $thumb_url; ?>&count_vidView=<?php echo $count_vidView; ?>" class="single_trend_div" >
<div class="trend_img_div" ><img src="CB_vid_thumb/<?php echo $thumb_url; ?>" alt="<?php echo"$video_name"; ?>" class="trend_img"/></div>
<span class="play_icon_span" ><img src="main_icon/play_ro.png" class="play_icon"/></span>
<div class="single_view_div" ><span class="view_output" ><?php echo"$count_vidView"; ?></span> <img src="main_icon/comt.png" class="com_icon"/><span class="comt_output" ><?php if($check_comm_count <1){}else{ echo $check_comm_count;} ?></span> </div>
<span class="trend_song_title"><?php echo $video_name;?></span>
<!--span class="trend_song_artis">
toop
</span-->
</a>
<?php } ?>
</div>
<?php
}
//////////////////////////////////////////////////////////////////// disp_recommand_video
if($status =="disp_detail_video")
{
?>
<?php
$cur_play_vid =$_GET['ongoin_vidid'];
$getComment_count ="select * from clip_commenttb where videoId='$cur_play_vid' ";
$run_getComment_count = mysqli_query($con,$getComment_count);
$check_comm_count = mysqli_num_rows($run_getComment_count);
$get_video ="select * from cb_videotb where id='$cur_play_vid' ";
$run_get_video = mysqli_query($con,$get_video);
while($row_get_video = mysqli_fetch_array($run_get_video))
{
$video_id = $row_get_video['id'];
$studioId = $row_get_video['studioId'];
$video_name = $row_get_video['video_name'];
$video_url = $row_get_video['video_url'];
$thumb_url = $row_get_video['thumb_url'];
$studioId = $row_get_video['studioId'];
?>
<input id="detail_vidId" value="<?php echo $video_id; ?>" class="help_input" />
<input id="detail_vidurl" value="<?php echo $video_url; ?>" class="help_input" />
<input id="video_name" value="<?php echo $video_name; ?>" class="help_input" />
<input id="detail_vidCom" value="<?php if($check_comm_count <1){}else{ echo $check_comm_count;} ?>" class="help_input" />
<?php
}
$get_vidView_count ="select * from clip_videoviewtb where videoId='$cur_play_vid'";
$run_get_vidView_count = mysqli_query($con,$get_vidView_count);
$check_get_vidView_count = mysqli_num_rows($run_get_vidView_count);
?>
<input id="vidView_count" value="<?php if($check_get_vidView_count <1){echo"Views";}elseif($check_get_vidView_count==1){echo"$check_get_vidView_count View";}else{ echo"$check_get_vidView_count Views";}?>" classk="help_input" />
<?php
}
////////////////////////////////////////////////////////////////////
if($status =="disp_recommand_video")
{
?>
<div id="card_div" class="card_div" >
<h2 class="main_header_title">Recommended for you</h2><button onclick="close_forYou_div();" class="close_forYou_vidBtn">x</button>
<?php
$get_video ="select * from cb_videotb ";
$run_get_video = mysqli_query($con,$get_video);
while($row_get_video = mysqli_fetch_array($run_get_video))
{
$video_id = $row_get_video['id'];
$studioId = $row_get_video['studioId'];
$video_name = $row_get_video['video_name'];
$video_url = $row_get_video['video_url'];
$thumb_url = $row_get_video['thumb_url'];
$studioId = $row_get_video['studioId'];
$get_vidView_count ="select * from clip_videoviewtb where videoId='$video_id'";
$run_get_vidView_count = mysqli_query($con,$get_vidView_count);
$check_get_vidView_count = mysqli_num_rows($run_get_vidView_count);
if($check_get_vidView_count <1){$count_vidView ="Views";}elseif($check_get_vidView_count==1){$count_vidView ="$check_get_vidView_count View";}else{ $count_vidView ="$check_get_vidView_count Views";}
$getComment_count ="select * from clip_commenttb where videoId='$video_id' ";
$run_getComment_count = mysqli_query($con,$getComment_count);
$check_comm_count = mysqli_num_rows($run_getComment_count);
?>
<div id="<?php echo $video_id; ?>" onClick="show_currentVid(this.id);" class="single_trend_div" >
<input id="detail_vidId" value="<?php echo $video_id; ?>" class="help_input" />
<input id="video_name" value="<?php echo $video_name; ?>" class="help_input" />
<div class="trend_img_div" ><img src="CB_vid_thumb/<?php echo $thumb_url; ?>" alt="<?php echo"$video_name"; ?>" class="trend_img"/></div>
<span class="play_icon_span" ><img src="main_icon/play_ro.png" class="play_icon"/></span>
<div class="vidName_reco" ><?php echo $video_name;?></div>
<div class="single_view_div" ><span class="view_output" ><?php echo"$count_vidView"; ?></span> <img src="main_icon/comt.png" class="com_icon"/><span class="comt_output" ><?php if($check_comm_count <1){}else{ echo $check_comm_count;} ?></span> </div>
<!--span class="trend_song_title">r56<?php echo $video_name;?></span-->
</div>
<?php
} ?>
</div>
<?php
}
/////////////////////////////////////////////////////////////////////
if($status =="mainVidDisp")
{
$studioIdIn = $_GET['studioId'];
if($studioIdIn !==""){
$get_vid = "SELECT * FROM cb_videotb where studioId='$studioIdIn'";
}else{ $get_vid = "SELECT * FROM cb_videotb"; }
$run_get_vid = mysqli_query($con, $get_vid);
while($row_get_vid = mysqli_fetch_array($run_get_vid)) {
$video_name = $row_get_vid['video_name'];
$video_description = $row_get_vid['video_description'];
$video_url = $row_get_vid['video_url'];
$thumb_url = $row_get_vid['thumb_url'];
$studioId = $row_get_vid['studioId'];
$curr_date = $row_get_vid['curr_date'];
?>
<div id="userSingleVid" class="userSingleVid" >
<a href="index?stdLink=<?php echo $studioId; ?>"><span id="singleThumb" class="singleThumb" ><img src="CB_vid_thumb/<?php echo $thumb_url; ?>" class="vid_thumb_img" id="vid_thumb_img" /></span></a>
<span class="singleVidName" ><?php echo $video_name; ?></span>
<span class="vidPostDat" ><span>102 Views</span> <span style="float:right"><?php echo $curr_date; ?></span></span>
</div>
<?php
}
}
/////////////////////////////////////////////////////////////////////
if($status =="insertVid_comment")
{
$comVid_id = $_GET['comVid_id'];
$commentInput = $_GET['commentInput'];
// Use 'iis' assuming your database columns are INT, INT, and STRING.
$stmt = $con->prepare("INSERT INTO clip_commenttb (videoId, userId, clip_comment) VALUES (?, ?, ?)");
if ($stmt) {
// Correctly bind parameters. 'i' for integer, 's' for string.
$stmt->bind_param("iss", $comVid_id, $userId, $commentInput);
if ($stmt->execute()) {
// echo'Comment added successfully.';
} else {
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Database error: ' . $stmt->error]);
}
$stmt->close();
} else {
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Failed to prepare the statement: ' . $con->error]);
}
}
/////////////////////////////////////////////////////////////////////
if($status =="displayVid_comment")
{
$comVid_id = $_GET['comVid_id'];
$getComment ="select * from clip_commenttb where videoId='$comVid_id' order by id desc ";
$run_getComment = mysqli_query($con,$getComment);
while($row_getComment = mysqli_fetch_array($run_getComment))
{
$comment = $row_getComment['clip_comment'];
?>
<div class="singleComm_dispDiv">
<img src="main_icon/avatar3.jpg" class="comProfile" alt="UserProfile" />
<span class="comUsername">Name</span>
<img src="main_icon/more_opton.png" class="comOptionBtn" alt="moreOpt" />
<span class="commentOutput"><?php echo $comment; ?></span>
</div>
<?php
}
}
/////////////////////////////////////////////////////////////////////
if($status =="Vid_comment_count")
{
$comVid_id = $_GET['comVid_id'];
$getComment_count ="select * from clip_commenttb where videoId='$comVid_id' ";
$run_getComment_count = mysqli_query($con,$getComment_count);
$check_comm_count = mysqli_num_rows($run_getComment_count);
if($check_comm_count <1){}else{ echo $check_comm_count;}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="search_video")
{
$incoming_search = $_GET['incoming_search'];
$get_song ="select * from cb_videotb where video_name LIKE '%$incoming_search%' OR video_description LIKE '%$incoming_search%' ";
$run_get_song = mysqli_query($con,$get_song);
while($row_get_video = mysqli_fetch_array($run_get_song))
{
$video_id = $row_get_video['id'];
$studioId = $row_get_video['studioId'];
$video_name = $row_get_video['video_name'];
$video_url = $row_get_video['video_url'];
$thumb_url = $row_get_video['thumb_url'];
$studioId = $row_get_video['studioId'];
$getComment_count ="select * from clip_commenttb where videoId='$video_id' ";
$run_getComment_count = mysqli_query($con,$getComment_count);
$check_comm_count = mysqli_num_rows($run_getComment_count);
$get_vidView_count ="select * from clip_videoviewtb where videoId='$video_id'";
$run_get_vidView_count = mysqli_query($con,$get_vidView_count);
$check_get_vidView_count = mysqli_num_rows($run_get_vidView_count);
if($check_get_vidView_count <1){$count_vidView ="Views";}elseif($check_get_vidView_count==1){$count_vidView ="$check_get_vidView_count View";}else{ $count_vidView ="$check_get_vidView_count Views";}
?>
<!--a href="cob_videos?vidid=<?php echo $video_id; ?>&vidname=<?php echo"$video_name - $artist_name"; ?>&vidurl=<?php echo $video_url; ?>&vidview=<?php echo $check_get_video_view; ?>&vidalbid=<?php echo $vid_album_id; ?>" -->
<a href="clip_player?vidid=<?php echo $video_id; ?>&vidname=<?php echo"$video_name "; ?>&vidurl=<?php echo $video_url; ?>&vidalbid=<?php echo $studioId; ?>&vidthumb=<?php echo $thumb_url; ?>&count_vidView=<?php echo $count_vidView; ?>" >
<div class="song_title_search" ><?php echo $video_name; ?> </div> </a>
<?php
}
}
?>