
PK 
<?php
ob_start();
//error_reporting(E_ALL ^ E_NOTICE);
@session_start();
ini_set('allow_url_include',1);
date_default_timezone_set("Asia/Kolkata");
set_time_limit(600);
ini_set('max_execution_time',600);
require_once 'admin/includes/settings/PDODB.php';
include 'admin/includes/modules/functions.php';
$function = new FUNCTIONS();
if(empty($_SESSION['userId'])){
header("Location: index.php");
exit();
}
//print_r($_SESSION['userId']); //exit();
$user = $function->getUsers($_SESSION['userId'],NULL,NULL,1);
//print_r($user[0]['id']); exit();
//$pollQuestion = $function->getPollQuestion($id=NULL,$isActive=1);
/*if(isset($_POST['askQuestionBtn'])){
$question = !empty($_POST['question'])?trim($_POST['question']):"";
$uId = $_SESSION['userId'];
if(!empty($question)){
$pdodb = PDODB::getInstance();
$sql = "INSERT INTO `tb_askquestion` SET uId='".$uId."',question='".$question."'";
$result = $pdodb->query($sql);
PDODB::closeInstance();
if($result==true) {
$askQ_msg = "Your question succesfully submit";
}
}else{
$askQ_msg = "technical error.";
}
}*/
/*if(isset($_POST['feedBackBtn'])){
$rating = !empty($_POST['rating'])?trim($_POST['rating']):"";
$comment = !empty($_POST['comment'])?trim($_POST['comment']):"";
$uId = $_SESSION['userId'];
$pdodb = PDODB::getInstance();
$sql = "INSERT INTO `tb_feedback` SET uId='".$uId."',rating='".$rating."',comment='".$comment."'";
$result = $pdodb->query($sql);
PDODB::closeInstance();
if($result==true) {
$feedBck_msg = "Your Feedback succesfully submit";
}else{
$feedBck_msg = "Technical error. Kindly try again.";
}
}*/
/*if(isset($_POST['pollQuestionBtn'])){
$polloption = !empty($_POST['polloption'])?trim($_POST['polloption']):"";
$q_id = !empty($_POST['q_id'])?trim($_POST['q_id']):"";
$uId = $_SESSION['userId'];
if(!empty($polloption)){
$pdodb = PDODB::getInstance();
$qty = 1;
$sql = "UPDATE `tb_pollquestion` SET max_vote = max_vote + '".$qty."' WHERE id = '".$q_id."'"; //exit;
$result = $pdodb->query($sql);
$sql2 = "UPDATE `tb_polloptions` SET vote_count = vote_count + '".$qty."' WHERE id = '".$polloption."'"; //exit;
$result2 = $pdodb->query($sql2);
$sql3 = "INSERT INTO `tb_polllinglist` SET uid='".$uId."', q_id='".$q_id."', option_id='".$polloption."'";
$result3 = $pdodb->query($sql3);
PDODB::closeInstance();
if($result==true) {
$poll_msg = "succesfully submit";
}else{
$poll_msg = "Try again";
}
}
}*/
?>
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>ARTEMIS Hospitals - LIVE</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <meta http-equiv="refresh" content="50"> -->
<link rel='stylesheet' href='css/bootstrap.min.css'>
<link rel='stylesheet' href='css/style.css'>
<link href="images/favicon.ico" rel="shortcut icon" type="image/png">
<style type="text/css">
body {
background: url('images/bg.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}
.error {color: red;}
.navbar{ background: rgb(255,255,255); box-shadow: rgba(33, 35, 38, 0.1) 0px 10px 10px -10px;}
ul.join-social {
margin: 0;
padding: 0;
}
ul {
list-style: none;
width: auto;
display: inline-block;
vertical-align: middle;}
.join-social li {
display: inline-block;
margin-left: 7px;
vertical-align: middle;
}
.frame{
padding: 3px 15px;
background: #a69837; border-radius: 2px;
text-align: left;
color: #fff;
letter-spacing: 1.5px;
font-size: 16px;
font-weight: bold;
line-height: 24px;
}
.comment-form{
background: #e7e7e7;
padding:1%;
margin-bottom: 1%;
}
.poll-question{
background: #e7e7e7;
padding:1%;
}
.feedbackform{
background: #e7e7e7;
padding:2%;
}
.form-control {
border-color: #e7e7e7;
}
.btn{
background: #a69837;
color: #ffffff;
}
.btn:hover{
background: #000000;
color: #ffffff;
}
.form-check-input {
}
input:checked {
background: #a69837;
}
label{
}
.nav-tabs{
background: #a69837;
color: #ffffff;
}
.nav-link{
color: #ffffff;
}
#feedback-form-wrapper #floating-icon > button {
position: fixed;
right: 0;
top: 50%;
transform: rotate(-90deg) translate(50%, -50%);
transform-origin: right;
}
#feedback-form-wrapper .rating-input-wrapper input[type="radio"] {
display: none;
}
#feedback-form-wrapper .rating-input-wrapper input[type="radio"] ~ span {
cursor: pointer;
}
#feedback-form-wrapper .rating-input-wrapper input[type="radio"]:checked ~ span {
background-color: #4261dc;
color: #fff;
}
#feedback-form-wrapper .rating-labels > label{
font-size: 14px;
color: #777;
}
.logout-btn{
text-decoration: none;
background-color: red;
color: #fff!important;
padding: 10px 20px;
border-radius: 5px;
}
</style>
</head>
<body>
<nav class="navbar">
<div class="container">
<a class="navbar-brand" href="#" target="_blank">
<img src="images/logo.png" alt="" width="150" class="img-fluid">
</a>
<div class="content">
<ul class="join-social">
<li><a class="logout-btn" href="Presentation.pdf" download>Download presentation</a></li>
<li><a class="logout-btn" href="logout.php">Logout</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid py-5">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="frame">LIVE VIDEO</div>
<div class="ratio ratio-16x9">
<iframe src="https://player.castr.com/live_ed443440425811efb232999121a03e72" title="Multistreaming with Restream.io" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-4">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">Ask Question</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Poll</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">Feedback</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
<!-- <div class="frame">ASK QUESTIONS</div>-->
<form class="comment-form" id="askQstndForm" method="POST" action="">
<div class="mb-3">
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="question" name="question" style="height: 130px"></textarea>
<label for="question">Type your comments</label>
</div>
</div>
<div id="message"></div>
<center>
<!-- <button type="submit" id="askQuestionBtn" name="askQuestionBtn" onclick="askQForm();" class="btn btn-lg">Submit</button> -->
<input class="btn btn-lg" type="button" onclick="askQForm();" name="save_contact" value="Submit" />
</center>
</form>
</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
<?php
$pollQuestion = $function->getPollQuestion($id=NULL,$isActive=1);
if (!empty($pollQuestion)) {
$question = $pollQuestion[0]['title'];
$max_vote = $pollQuestion[0]['max_vote'];
$questionOptiondata = $function->getQuestionOption($id=NULL,$q_id=$pollQuestion[0]['id'],$isActive=1);
$pollingdata = $function->getPolllinglist($id=NULL,$uid=$_SESSION['userId'],$q_id=$pollQuestion[0]['id'],$isActive=1);
//print_r($pollingdata[0]['option_id']); //exit;
if ($pollingdata == true) { ?>
<form class="poll-question" style="min-height: 200px;" id="pollForm">
<h4 class="question"><?=(!empty($question))?$question:'';?></h4>
<div class="mb-3">
<?php for($i=0;$i<count($questionOptiondata);$i++){ ?>
<div class="form-check">
<input class="form-check-input" disabled type="radio" name="polloption" id="polloption" value="<?=$questionOptiondata[$i]['id'];?>" <?=($questionOptiondata[$i]['id']==$pollingdata[0]['option_id'])?'checked':'';?>>
<label class="form-check-label" for="exampleRadios1">
<?=$questionOptiondata[$i]['description']." (".$questionOptiondata[$i]['vote_count'].")";?>
</label>
<progress id="file" value="<?=$questionOptiondata[$i]['vote_count'];?>" max="<?=$max_vote;?>"> <?=$questionOptiondata[$i]['vote_count'];?> </progress>
</div>
<?php } ?>
</div>
<h5 class="question">You have already voted for this Poll.</h5>
</form>
<?php } else { ?>
<form class="poll-question" method="POST" id="pollForm">
<h4 class="question"><?=(!empty($question))?$question:'';?></h4>
<div class="mb-3">
<?php for($i=0;$i<count($questionOptiondata);$i++){ ?>
<div class="form-check">
<input class="form-check-input" type="radio" name="polloption" id="polloption" value="<?=$questionOptiondata[$i]['id'];?>">
<label class="form-check-label" for="exampleRadios1">
<?=$questionOptiondata[$i]['description'];?>
</label>
</div>
<?php } ?>
</div>
<p style="color:red; text-align: center;"><?=(!empty($poll_msg))?$poll_msg:'';?></p>
<input type="hidden" value="<?=$pollQuestion[0]['id'];?>" id="q_id" name="q_id" />
<input type="hidden" value="<?=$_SESSION['userId'];?>" id="uid" name="uid" />
<div id="pollQmessage"></div>
<center><button type="submit" name="pollQuestionBtn" class="btn btn-lg" onclick="pollQForm(event);">Submit</button></center>
</form>
<?php } ?>
<?php }else { ?>
<form class="poll-question" style="min-height: 200px;">
<h4 class="question"></h4>
</form>
<?php } ?>
</div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
<form class="feedbackform" method="POST" action="" id="feedbackForm">
<div class="form-group">
<label for="exampleFormControlTextarea1" class="form-label">How likely you would like to rate this session?</label><br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="1">
<label class="form-check-label" for="rating">1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="2">
<label class="form-check-label" for="rating">2</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="3">
<label class="form-check-label" for="rating">3</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="4">
<label class="form-check-label" for="rating">4</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="5">
<label class="form-check-label" for="rating">5</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="6">
<label class="form-check-label" for="rating">6</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="7">
<label class="form-check-label" for="rating">7</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="8">
<label class="form-check-label" for="rating">8</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="9">
<label class="form-check-label" for="rating">9</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="rating" id="rating" value="10">
<label class="form-check-label" for="rating">10</label>
</div>
</div>
<div class="mb-3">
<label for="exampleFormControlTextarea1" class="form-label">Would you like to say something?</label>
<textarea class="form-control" name="comment" id="comment" rows="3"></textarea>
</div>
<div id="feedbackmessage"></div>
<center><input class="btn btn-lg" type="button" onclick="feedBForm();" name="feedBackBtn" value="Submit" /></center>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- partial -->
<script type='text/javascript' src='//code.jquery.com/jquery-1.8.3.js'></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
<script type='text/javascript' src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.js"></script>
<script type='text/javascript' src="//jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
<script src='js/bootstrap.bundle.min.js'></script>
<!-- <script type="text/javascript">
$("#pollQForm").validate({
rules: {
polloption: {
required: true
}
},
messages: {
polloption: {
required: "Please select anyone"
}
},
submitHandler: function(form) {
form.submit();
}
});
</script>
<script type="text/javascript">
$("#askQForm").validate({
rules: {
question: {
required: true
}
},
messages: {
question: {
required: "Please enter your question"
}
},
submitHandler: function(form) {
form.submit();
}
});
</script>
<script type="text/javascript">
$("#feedbackForm").validate({
rules: {
rating: {
required: true
},
comment: {
required: true
}
},
messages: {
rating: {
required: "Please enter your question"
},
comment: {
required: "Please enter"
}
},
submitHandler: function(form) {
form.submit();
}
});
</script> -->
<!-- ajax start -->
<script type="text/javascript">
$(document).ready(function() {
function askQForm() {
var question = $('textarea[name=question]').val().trim();
if (question !== '') {
var formData = {question: question};
$('#message').html('<span style="color: red">Processing form. . . please wait. . .</span>');
$.ajax({
url: "post.php",
type: 'POST',
data: formData,
success: function(response) {
try {
var res = JSON.parse(response);
if (res.success == true) {
document.getElementById("askQstndForm").reset();
$('#message').html('<span id="successmsg" style="color: green">Form submitted successfully</span>');
$("#successmsg").delay(5000).fadeOut(); // Will hide after 5 seconds
} else {
$('#message').html('<span id="failmsg" style="color: red">Form not submitted. Some error in running the database query.</span>');
$("#failmsg").delay(5000).fadeOut(); // Will hide after 5 seconds
}
} catch (e) {
$('#message').html('<span id="failmsg" style="color: red">Error processing response</span>');
$("#failmsg").delay(5000).fadeOut(); // Will hide after 5 seconds
}
},
error: function() {
$('#message').html('<span id="failmsg" style="color: red">Error submitting the form. Please try again later.</span>');
$("#failmsg").delay(5000).fadeOut(); // Will hide after 5 seconds
}
});
} else {
$('#message').html('<span id="requiredmsg" style="color: red">Please type your question</span>');
$("#requiredmsg").delay(5000).fadeOut();
}
}
window.askQForm = askQForm; // Ensure the function is available globally
});
</script>
<script type="text/javascript">
function feedBForm()
{
var comment = $('textarea[name=comment]').val();
var rating = $('input[name=rating]:checked').val(); // Corrected line
if(comment != '' && rating!= '')
{
var formData = {comment: comment, rating: rating};
$('#feedbackmessage').html('<span style="color: red">Processing form. . . please wait. . .</span>');
$.ajax({url: "post.php", type: 'POST', data: formData, success: function(response)
{
var res = JSON.parse(response);
console.log(res);
if(res.success == true){
document.getElementById("feedbackForm").reset();
$('#feedbackmessage').html('<span id="successmsg" style="color: green">Your Feedback succesfully submitted</span>');
$("#successmsg").delay(5000).fadeOut(); // Will hide after 5 seconds
} else{
$('#feedbackmessage').html('<span id="failmsg" style="color: red">Form not submitted. Some error in running the database query.</span>');
$("#failmsg").delay(5000).fadeOut(); // Will hide after 5 seconds
}
}
});
}
else
{
$('#feedbackmessage').html('<span id="reuiredmsg" style="color: red">Please type your question</span>');
$("#reuiredmsg").delay(5000).fadeOut();
}
}
</script>
<script type="text/javascript">
function pollQForm(event) {
event.preventDefault();
var q_id = $('input[name=q_id]').val();
var polloption = $('input[name=polloption]:checked').val();
if(q_id != '' && polloption!= '') {
var formData = {q_id: q_id, polloption: polloption};
$('#pollQmessage').html('<span style="color: red">Processing form. . . please wait. . .</span>');
$.ajax({
url: "post.php",
type: 'POST',
data: formData,
success: function(response) {
var res = JSON.parse(response);
if(res.success == true) {
$('#pollQmessage').html('<span id="successmsg" style="color: green">Your Feedback successfully submitted</span>');
$("#successmsg").delay(5000).fadeOut();
// Reload the poll question
loadPollQuestion();
} else {
$('#pollQmessage').html('<span id="failmsg" style="color: red">Form not submitted. Some error in running the database query.</span>');
$("#failmsg").delay(5000).fadeOut();
}
}
});
} else {
$('#pollQmessage').html('<span id="reuiredmsg" style="color: red">Please select an option</span>');
$("#reuiredmsg").delay(5000).fadeOut();
}
}
function loadPollQuestion() {
$.ajax({
url: 'get_poll_question.php',
type: 'GET',
success: function(response) {
var res = JSON.parse(response);
if (res.success) {
$('#profile').html(res.html);
} else {
$('#profile').html('<form class="poll-question" style="min-height: 200px;"><h4 class="question"></h4></form>');
}
}
});
}
// Call loadPollQuestion every 10 seconds
setInterval(loadPollQuestion, 5000);
</script>
</body>
</html>


PK 99