window.location = 'instructor-home.php';";
}
elseif($_SESSION['position'] == 'Advertise'){
echo "";
}
elseif($_SESSION['position'] == 'admin'){
echo "";
}
// Redirect to 'Change Password' page on first login
if(isset($_GET['redirect']) && $_GET['redirect'] == 'change_password'){
echo "";
}
// If Rating Form is submitted do the following
if(isset($_POST['Rate'])){
$nProductId = base64_decode($_POST['product_id']); // Holds Product Id
$nUserId = base64_decode($_POST['user_id']); // Holds User Id
$nRating = $_POST['rating']; // Holds Rating No
$strReview = $_POST['review']; // Holds User Review
if(!empty($_POST['edit_rating'])){ // If Hidden field is set Update the Rating
$nEditRating = base64_decode($_POST['edit_rating']); // Holds Row Id to Update
$stmt = $db->prepare("UPDATE tbl_ratings SET nrat_rating = :rating, srat_review = :review WHERE nrat_id = :rating_id");
$stmt->bindParam(':rating', $nRating);
$stmt->bindParam(':review', $strReview);
$stmt->bindParam(':rating_id', $nEditRating);
if($stmt->execute()){
$feedback = "Your Rating has been saved";
}
else{
$error = "Unable to Update your rating now!";
}
}
else {
$stmt = $db->prepare("INSERT INTO tbl_ratings (nrat_product_id, nrat_user_id, nrat_rating, srat_review)
VALUES(:product_id, :user_id, :rating, :review)");
$stmt->bindParam(':product_id', $nProductId);
$stmt->bindParam(':user_id', $nUserId);
$stmt->bindParam(':rating', $nRating);
$stmt->bindParam(':review', $strReview);
if($stmt->execute()){
$feedback = "Your rating has been saved successfully";
}
else{
$error = "Unable to Save your rating now!";
}
}
}
?>
";
echo "{$strName} was added to your cart!";
echo "
";
}
if($strAction=='exists'){
echo "";
echo "{$strName} already exists in your cart!";
echo "
";
}
?>
prepare("SELECT * FROM tbl_enrollments INNER JOIN tbl_products ON nenr_product_id = nprd_id INNER JOIN tbl_orders ON nenr_order_id = nord_id WHERE nenr_user_id = :user_id");
$stmt->bindParam(':user_id', $nUserId);
$stmt->execute();
if($stmt->rowCount() > 0) {
while ($products = $stmt->fetch()) {
$strStartDate = date("Y-m-d", strtotime($products['senr_start_date']));
$strEndDate = date("Y-m-d", strtotime($products['senr_end_date']));
$strTempCurl = "chat.php?sender=" . base64_encode($_SESSION['user_id']) . "&recipient=" . base64_encode($products['nprd_instructor_id']);
?>
 echo str_replace('../uploads/', 'uploads/thumbs/', $products['sprd_cover_image']); else echo )
"
class="img-responsive">
prepare("SELECT * FROM tbl_ratings WHERE nrat_user_id = :user_id AND nrat_product_id = :product_id");
$stmt1->bindParam(':user_id', $_SESSION['user_id']);
$stmt1->bindParam(':product_id', $products['nenr_product_id']);
$stmt1->execute();
if ($stmt1->rowCount() == 1) {
$rating = $stmt1->fetch();
$nRatingId = $rating['nrat_id'];
$nRating = $rating['nrat_rating'];
$strReview = $rating['srat_review'];
echo $star->getRating("size-3 center-margin", $products['nenr_product_id']);
} else {
?>
Rate this Product
= $strStartDate && $strToday <= $strEndDate) {
$strClass = 'success';
?>
Start Learning
Renew
Chat with Instructor
Give Feedback
Feedback not allowed!
Upload Docs
Valid upto,
Catch up with your peers! Pick a course and start learning
Browse Catalog...";
// }
$stmt1 = $db->prepare("SELECT * FROM tbl_products WHERE nprd_id NOT IN (SELECT nenr_product_id FROM tbl_enrollments INNER JOIN tbl_orders ON nenr_order_id = nord_id WHERE nenr_user_id = :user_id)");
$stmt1->bindParam(':user_id', $nUserId);
$stmt1->execute();
if($stmt1->rowCount() > 0){
// echo "gOTO";
while ($product = $stmt1->fetch()){
// echo $product['nprd_id'];
$strProductImage = "img/dummyproductimage.jpg"; // Holds Placeholder Product image
if($product['sprd_cover_image'] !== NULL){
$strProductImage = str_replace('../uploads/','uploads/thumbs/',$product['sprd_cover_image']);
}
$discount = FALSE; // Holds Discount Status
// Database query for checking Discount
$stmt2 = $db->prepare("SELECT * FROM tbl_discount WHERE ndis_product_id = :product_id AND CURDATE() BETWEEN sdis_start_date AND sdis_end_date AND ndis_approve = 1");
$stmt2->bindParam(':product_id', $product['nprd_id']);
$stmt2->execute();
$nOriginalPrice = $product['sprd_price']; // Holds Original Price
if($stmt2->rowCount() == 1){
$discount = TRUE;
$row = $stmt2->fetch();
$nDiscount = $row['ndis_discount']; // Holds Discount Percent
$nDiscountedPrice = ($nOriginalPrice / 100) * $nDiscount; // Holds Discounted Price
$nDiscountedPrice = $nOriginalPrice - $nDiscountedPrice;
}
?>
getRatings("size-3", $product['nprd_id']); ?>
$nDiscountedPrice $nOriginalPrice $nDiscount% Off";
}
else{
echo " 10000";
echo "Limited Period Offer $nOriginalPrice";
}
?>
getRating("userChoose size-3 rate");
if(isset($feedback)) echo $feedback; elseif(isset($error)) echo $error;
?>