<?php include ("../php/connect.php");?>
<?php include ("../php/content.php");?>
<?php include ("php/nav.php");?>
<?php include ("php/cart.php");?>
<?php include ("php/training.php");?>
<?php include ("php/secure.php");?>
<?php
date_default_timezone_set("America/Chicago");
$Now = date('Y-m-d H:i:s');
$GetIP = $_SERVER['REMOTE_ADDR'];
$ip = $GetIP;
$Page = 'my-access.php';
$UserID = $_SESSION['MM_UserGroup'];
$cid = $_SESSION['MM_UserGroup'];
$todaydate = date('Y-m-d');
// Connects to your Database
//Writes the information to the database
mysqli_query($SMB, "INSERT INTO SMBDU_Tracker (date, IP, page, userID) VALUES ('$Now', '$GetIP','$Page', '$UserID')");
$cid = $_SESSION['MM_UserGroup'];
$query_GetUser = "SELECT * FROM School_Users WHERE id='$cid'";
$GetUser = mysqli_query($SMB, $query_GetUser);
$row_GetUser = mysqli_fetch_assoc($GetUser);
$totalRows_GetUser = mysqli_num_rows($GetUser);
$GetName = $row_GetUser['first_name'];
// Show Total Cart Items
$query_CartItems = "SELECT * FROM School_Cart WHERE cid = '$cid'";
$CartItems = mysqli_query($SMB, $query_CartItems);
$row_CartItems = mysqli_fetch_assoc($CartItems);
$totalRows_CartItems = mysqli_num_rows($CartItems);
// Get My Modules
$query_Get_MyModules = "SELECT * FROM School_OrdersCart WHERE cid='$cid' AND ModuleID > 0 AND end_date >= '$todaydate' ORDER BY id DESC";
$Get_MyModules = mysqli_query($SMB, $query_Get_MyModules);
$totalRows_Get_MyModules = mysqli_num_rows($Get_MyModules);
if($totalRows_Get_MyModules > 0){
$MyModulesSection_Output .= '<section class="bkgLine">
<div class="well-03">
<div class="container">
<div class="row">
<div class="grid_11">
<h3>MY MODULES</h3>
</div>';
while($row_Get_MyModules = mysqli_fetch_assoc($Get_MyModules)){
$Get_MyModules_OrderID = $row_Get_MyModules['OrderID'];
$Get_MyModules_CourseID = $row_Get_MyModules['ModuleID'];
$Get_MyModules_EndDate = strtotime($row_Get_MyModules['end_date']);
$Get_MyModules_Duration = $row_Get_MyModules['duration'];
$Get_MyModules_Now = time();
$Get_MyModules_datediff = $Get_MyModules_EndDate - $Get_MyModules_Now;
$Get_MyModules_DaysLeft = floor($Get_MyModules_datediff / (60 * 60 * 24));
$query_MyModules = "SELECT * FROM School_Modules WHERE id='$Get_MyModules_CourseID'";
$MyModules = mysqli_query($SMB, $query_MyModules);
$totalRows_MyModules = mysqli_num_rows($MyModules);
if($totalRows_MyModules > 0){
while($row_MyModules = mysqli_fetch_assoc($MyModules)){
$MyModules_ID = $row_MyModules['id'];
$MyModules_Name = $row_MyModules['title'];
$MyModules_Description = substr($row_MyModules['description'],0,100).'...';
$MyModules_Price = $row_MyModules['price'];
$MyModules_Img = $row_MyModules['image'];
$MyModules_MID = $row_MyModules['ModuleID'];
$MyModules_Status = $row_MyModules['status'];
$MyModules_Tag = '<div class="ProductTag">Access '.$Get_MyModules_DaysLeft.' Days</div>';
$MyModulesSection_Output .='<div class="grid_4 wow fadeInLeft">
<div class="box-02">
<a class="thumb" href="module-training.php?module='.$MyModules_ID.'">
<img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$MyModules_Img.'" alt=""/>
<span class="thumb_overlay"></span>
</a>
<div class="box-02_cnt">
<h6>Module #'.$MyModules_MID.' - '.$MyModules_Name.'</h6>
<hr>
<p>'.$MyModules_Description.'</p>
</div>
</div>
'.$MyModules_Tag.'
</div>';
}
}
}
$MyModulesSection_Output .= '</div></div></div></section>';
}
else {
$MyModulesSection_Output = '<section class="bkgLine">
<div class="well-03">
<div class="container">
<div class="row">
<div class="grid_11">
<h3>MY MODULES</h3>
<p>You currently have no active modules.</p>
</div></div></div></div></section>';
}
// Get My Courses
$query_Get_MyCourses = "SELECT * FROM School_OrdersCart WHERE cid='$cid' AND CourseID > 0 AND end_date >= '$todaydate' ORDER BY id DESC";
$Get_MyCourses = mysqli_query($SMB, $query_Get_MyCourses);
$totalRows_Get_MyCourses = mysqli_num_rows($Get_MyCourses);
if($totalRows_Get_MyCourses > 0){
$MyCoursesSection_Output .= '<section class="bkgLine">
<div class="well-03">
<div class="container">
<div class="row">
<div class="grid_11">
<h3>MY COMPLETE COURSES</h3>
</div>';
while($row_Get_MyCourses = mysqli_fetch_assoc($Get_MyCourses)){
$Get_MyCourses_OrderID = $row_Get_MyCourses['OrderID'];
$Get_MyCourses_CourseID = $row_Get_MyCourses['CourseID'];
$Get_MyCourses_EndDate = strtotime($row_Get_MyCourses['end_date']);
$Get_MyCourses_Duration = $row_Get_MyCourses['duration'];
$Get_MyCourses_Now = time();
$Get_MyCourses_datediff = $Get_MyCourses_EndDate - $Get_MyCourses_Now;
$Get_MyCourses_DaysLeft = floor($Get_MyCourses_datediff / (60 * 60 * 24));
$query_MyCourses = "SELECT * FROM SMBDU_Courses WHERE id='$Get_MyCourses_CourseID'";
$MyCourses = mysqli_query($SMB, $query_MyCourses);
$totalRows_MyCourses = mysqli_num_rows($MyCourses);
if($totalRows_MyCourses > 0){
while($row_MyCourses = mysqli_fetch_assoc($MyCourses)){
$MyCourses_ID = $row_MyCourses['id'];
$MyCourses_Name = $row_MyCourses['name'];
$MyCourses_Description = substr($row_MyCourses['description'],0,100).'...';
$MyCourses_Price = $row_MyCourses['price'];
$MyCourses_Img = $row_MyCourses['image'];
$MyCourses_Status = $row_MyCourses['status'];
$MyCourses_Tag = '<div class="ProductTag">Access '.$Get_MyCourses_DaysLeft.' Days</div>';
$MyCoursesSection_Output .='<div class="grid_4 wow fadeInLeft">
<div class="box-02">
<a class="thumb" href="course-training.php?course='.$MyCourses_ID.'">
<img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$MyCourses_Img.'" alt=""/>
<span class="thumb_overlay"></span>
</a>
<div class="box-02_cnt">
<h6>'.$MyCourses_Name.'</h6>
<hr>
<p>'.$MyCourses_Description.'</p>
</div>
</div>
'.$MyCourses_Tag.'
</div>';
}
}
}
$MyCoursesSection_Output .= '</div></div></div></section>';
}
else {
$MyCoursesSection_Output = '<section class="bkgLine">
<div class="well-03">
<div class="container">
<div class="row">
<div class="grid_11">
<h3>MY COMPLETE COURSES</h3>
<p>You currently have no current after courses.</p>
</div></div></div></div></section>';
}
//Show Courses and Activity
$query_Test_Courses = "SELECT School_OrdersCart.id, School_OrdersCart.cid, School_OrdersCart.end_date, School_OrdersCart
.product_name, School_OrdersCart.image, School_OrdersCart.CourseID, School_OrdersCart.ModuleID, School_OrdersCart.duration
FROM School_OrdersCart
WHERE School_OrdersCart.cid = '$UserID' AND School_OrdersCart.CourseID > 0
GROUP BY School_OrdersCart.CourseID
ORDER BY School_OrdersCart.end_date DESC";
$Test_Courses = mysqli_query($SMB, $query_Test_Courses);
$totalRows_Test_Courses = mysqli_num_rows($Test_Courses);
if($totalRows_Test_Courses > 0){
$Test_Courses_Output .= '<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td width="70%" align="left" height="40"><strong>Course/Modules</strong></td>
<td width="30%" align="center" ><strong>Test</strong></td>
</tr>';
while($row_Test_Courses = mysqli_fetch_assoc($Test_Courses)){
$Test_Courses_ID = $row_Test_Courses['id'];
$Test_Courses_CID = $row_Test_Courses['cid'];
$Test_Courses_ModuleID = $row_Test_Courses['product_name'];
$Test_Courses_CourseIMG = $row_Test_Courses['image'];
$Test_Courses_Durartion = $row_Test_Courses['duration'];
$Test_Courses_CourseID = $row_Test_Courses['CourseID'];
// Get Tests
$query_Get_Courses_Test = "SELECT SMBDU_CourseModules.cid, SMBDU_CourseModules.mid, School_Modules.id, School_Modules.title, School_Modules.image, School_Modules.test, School_Modules.CE, School_Modules.ModuleID
FROM SMBDU_CourseModules
INNER JOIN School_Modules
ON SMBDU_CourseModules.mid=School_Modules.id
WHERE SMBDU_CourseModules.cid = '$Test_Courses_CourseID' AND School_Modules.test = '1'
GROUP BY SMBDU_CourseModules.mid
ORDER BY School_Modules.ModuleID ASC";
$Get_Courses_Test = mysqli_query($SMB, $query_Get_Courses_Test);
$totalRows_Get_Courses_Test = mysqli_num_rows($Get_Courses_Test);
if($totalRows_Get_Courses_Test > 0){
$Test_Courses_Output .= '<tr>
<td align="left" valign="middle"><a href="course-training.php?course='.$Test_Courses_CourseID.'">
<h3>'.$Test_Courses_ModuleID.'</h3></a></td>
<td align="center"></td>
</tr>';
while($row_Get_Courses_Test = mysqli_fetch_assoc($Get_Courses_Test)){
$Courses_Test_ID = $row_Get_Courses_Test['id'];
$Courses_Test_Title = $row_Get_Courses_Test['title'];
$Courses_Test_IMG = $row_Get_Courses_Test['image'];
$Courses_Test_ModuleID = $row_Get_Courses_Test['ModuleID'];
$Courses_Test_CE = $row_Get_Courses_Test['CE'];
$query_Get_Courses_Test_Segments = "SELECT School_ModuleVideos.mid AS ModuleID, School_ModuleVideos.vid, School_ModuleVideos.sort, School_Media.id AS VID, School_Media.name, School_Media.type
FROM School_ModuleVideos
INNER JOIN School_Media
ON School_ModuleVideos.vid=School_Media.id
WHERE School_ModuleVideos.mid = '$Courses_Test_ID' AND type = 'video'
ORDER BY School_ModuleVideos.sort ASC";
$Get_Courses_Test_Segments = mysqli_query($SMB, $query_Get_Courses_Test_Segments);
$totalRows_Get_Courses_Test_Segments = mysqli_num_rows($Get_Courses_Test_Segments);
if($totalRows_Get_Courses_Test_Segments > 0){
while($row_Get_Courses_Test_Segments = mysqli_fetch_assoc($Get_Courses_Test_Segments)){
$Courses_Test_Segments_ID = $row_Get_Courses_Test_Segments['ModuleID'];
$Courses_Test_Segments_VID = $row_Get_Courses_Test_Segments['VID'];
$Courses_Test_Segments_Name = $row_Get_Courses_Test_Segments['name'];
$query_Get_Courses_Test_Views = "SELECT SMBDU_VideoViews.mid, SMBDU_VideoViews.vid, SMBDU_VideoViews.userID, max(SMBDU_VideoViews.id) as ID, SMBDU_VideoViews.type
FROM SMBDU_VideoViews
WHERE SMBDU_VideoViews.mid = '$Courses_Test_ID' AND SMBDU_VideoViews.userID = '$UserID' AND SMBDU_VideoViews.vid = '$Courses_Test_Segments_VID' AND SMBDU_VideoViews.type = 'end'
GROUP BY SMBDU_VideoViews.vid
ORDER BY ID DESC";
$Get_Courses_Test_Views = mysqli_query($SMB, $query_Get_Courses_Test_Views);
$row_Get_Courses_Test_Views = mysqli_fetch_assoc($Get_Courses_Test_Views);
$totalRows_Get_Courses_Test_Views = mysqli_num_rows($Get_Courses_Test_Views);
if($totalRows_Get_Courses_Test_Views == $totalRows_Get_Courses_Test_Segments){
$TakeTest = 'Test Available';
$TestLink = 'test.php?ModuleID='.$Courses_Test_ID;
}
else {
$TakeTest = 'Complete Module';
$TestLink = 'course-module-training.php?module='.$Courses_Test_ID.'&&course='.$Test_Courses_ID;
}
}}
$Test_Courses_Output .= '<tr>
<td align="left" valign="middle"><h4>#'.$Courses_Test_ModuleID.'-'.$Courses_Test_Title.'</h4></td>
<td align="center"><a href="'.$TestLink.'">'.$TakeTest.'</a></td>
</tr>';
}}
}
$Test_Courses_Output .= '</tbody>
</table>';
}
else {
$Test_Courses_Output .= '';
}
//Show Courses and Activity
$query_Get_Courses = "SELECT School_OrdersCart.id, School_OrdersCart.cid, School_OrdersCart.end_date, School_OrdersCart
.product_name, School_OrdersCart.image, School_OrdersCart.CourseID, School_OrdersCart.ModuleID, School_OrdersCart.duration
FROM School_OrdersCart
WHERE School_OrdersCart.cid = '$UserID' AND School_OrdersCart.CourseID > 0
ORDER BY School_OrdersCart.end_date DESC";
$Get_Courses = mysqli_query($SMB, $query_Get_Courses);
$totalRows_Get_Courses = mysqli_num_rows($Get_Courses);
if($totalRows_Get_Courses > 0){
$My_Courses_Output .= '<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td width="10%" align="left" height="40"><strong>Course</strong></td>
<td width="50%" align="left" > </td>
<td width="20%" align="center" ><strong>PROGRESS</strong></td>
<td width="20%" align="center"><strong>DAYS REMAINING</strong></td>
</tr>';
$Previous_Courses_Output .= '<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td width="10%" align="left" height="40"><strong>Course</strong></td>
<td width="50%" align="left" > </td>
<td width="20%" align="center" ><strong>PROGRESS</strong></td>
<td width="20%" align="center"><strong>DAYS REMAINING</strong></td>
</tr>';
while($row_Get_Courses = mysqli_fetch_assoc($Get_Courses)){
$Courses_ID = $row_Get_Courses['id'];
$Courses_CID = $row_Get_Courses['cid'];
$Courses_ModuleID = $row_Get_Courses['product_name'];
$Courses_CourseIMG = $row_Get_Courses['image'];
$Courses_Durartion = $row_Get_Courses['duration'];
$Courses_CourseID = $row_Get_Courses['CourseID'];
$Courses_EndDate = $row_Get_Courses['end_date'];
$now = time();
$your_date = strtotime("$Courses_EndDate");
$datediff = $your_date - $now;
$GetDays = floor($datediff / (60 * 60 * 24));
// Active Courses
if($Courses_EndDate >= $todaydate){
$query_Get_Courses_Modules = "SELECT SMBDU_CourseModules.cid, SMBDU_CourseModules.mid, School_Modules.id, School_Modules.title, School_Modules.image, School_Modules.ModuleID
FROM SMBDU_CourseModules
INNER JOIN School_Modules
ON SMBDU_CourseModules.mid=School_Modules.id
WHERE SMBDU_CourseModules.cid = '$Courses_CourseID'
GROUP BY SMBDU_CourseModules.mid
ORDER BY School_Modules.ModuleID ASC";
$Get_Courses_Modules = mysqli_query($SMB, $query_Get_Courses_Modules);
$totalRows_Get_Courses_Modules = mysqli_num_rows($Get_Courses_Modules);
if($totalRows_Get_Courses_Modules > 0){
$My_Courses_Output .= '<tr>
<td align="left" height="50"><a href="course-training.php?course='.$Courses_CourseID.'"><img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$Courses_CourseIMG.'" alt="" height="100"/></a></td>
<td align="left" valign="middle"><a href="course-training.php?course='.$Courses_CourseID.'"><h3>'.$Courses_ModuleID.'</h3></a></td>
<td align="center"></td>
<td align="center"><h3>'.$GetDays.' Days Left</h3></td>
</tr>';
while($row_Get_Courses_Modules = mysqli_fetch_assoc($Get_Courses_Modules)){
$Courses_Modules_ID = $row_Get_Courses_Modules['id'];
$Courses_Modules_Title = $row_Get_Courses_Modules['title'];
$Courses_Modules_IMG = $row_Get_Courses_Modules['image'];
$Courses_Modules_ModuleID = $row_Get_Courses_Modules['ModuleID'];
$My_Courses_Output .= '<tr>
<td align="left" height="50"><a href="course-module-training.php?module='.$Courses_Modules_ID.'&&course='.$Courses_ID.'"><img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$Courses_Modules_IMG.'" alt="" height="35"/></a></td>
<td align="left" valign="middle"><a href="course-module-training.php?module='.$Courses_Modules_ID.'&&course='.$Courses_ID.'"><h4>#'.$Courses_Modules_ModuleID.'-'.$Courses_Modules_Title.'</h4></a></td>
<td align="center"></td>
<td align="center"></td>
</tr>';
$query_Get_Courses_Modules_Segments = "SELECT School_ModuleVideos.mid AS ModuleID, School_ModuleVideos.vid, School_ModuleVideos.sort, School_Media.id AS VID, School_Media.name, School_Media.type
FROM School_ModuleVideos
INNER JOIN School_Media
ON School_ModuleVideos.vid=School_Media.id
WHERE School_ModuleVideos.mid = '$Courses_Modules_ID' AND type = 'video'
ORDER BY School_ModuleVideos.sort ASC";
$Get_Courses_Modules_Segments = mysqli_query($SMB, $query_Get_Courses_Modules_Segments);
$totalRows_Get_Courses_Modules_Segments = mysqli_num_rows($Get_Courses_Modules_Segments);
if($totalRows_Get_Courses_Modules_Segments > 0){
while($row_Get_Courses_Modules_Segments = mysqli_fetch_assoc($Get_Courses_Modules_Segments)){
$Courses_Modules_Segments_ID = $row_Get_Courses_Modules_Segments['ModuleID'];
$Courses_Modules_Segments_VID = $row_Get_Courses_Modules_Segments['VID'];
$Courses_Modules_Segments_Name = $row_Get_Courses_Modules_Segments['name'];
$query_Get_Courses_Modules_Views = "SELECT SMBDU_VideoViews.mid, SMBDU_VideoViews.vid, SMBDU_VideoViews.userID, max(SMBDU_VideoViews.id) as ID, SMBDU_VideoViews.type
FROM SMBDU_VideoViews
WHERE SMBDU_VideoViews.mid = '$Courses_Modules_ID' AND SMBDU_VideoViews.userID = '$UserID' AND SMBDU_VideoViews.vid = '$Courses_Modules_Segments_VID'
GROUP BY SMBDU_VideoViews.vid
ORDER BY ID DESC";
$Get_Courses_Modules_Views = mysqli_query($SMB, $query_Get_Courses_Modules_Views);
$totalRows_Get_Courses_Modules_Views = mysqli_num_rows($Get_Courses_Modules_Views);
if($totalRows_Get_Courses_Modules_Views > 0){
while($row_Get_Courses_Modules_Views = mysqli_fetch_assoc($Get_Courses_Modules_Views)){
$Courses_Modules_Views_Type = $row_Get_Courses_Modules_Views['type'];
if($Courses_Modules_Views_Type == 'end'){
$Progress = 'Completed';
$Link = 'training-segment.php?mid='.$Courses_Modules_ID.'&&sid='.$Courses_Modules_Segments_VID.'&&resume=1';
}
if($Courses_Modules_Views_Type == 'play'){
$Progress = 'In Progress';
$Link = 'training-segment.php?mid='.$Courses_Modules_ID.'&&sid='.$Courses_Modules_Segments_VID.'&&resume=1';
}
if($Courses_Modules_Views_Type == 'pause'){
$Progress = 'In Progress';
$Link = 'training-segment.php?mid='.$Courses_Modules_ID.'&&sid='.$Courses_Modules_Segments_VID.'&&resume=1';
}
}}
if($totalRows_Get_Courses_Modules_Views == 0){
$Progress = 'Start Now';
$Link = 'training-segment.php?mid='.$Courses_Modules_ID.'&&sid='.$Courses_Modules_Segments_VID;
}
$My_Courses_Output .= '<tr>
<td align="left" height="50"></td>
<td align="left" valign="middle"><a href="'.$Link.'"><h6>#'.$Courses_Modules_ModuleID.' - '.$Courses_Modules_Segments_Name.'</h6></a></td>
<td align="center"><a href="'.$Link.'">'.$Progress.'</a></td>
<td align="center">'.$GetDays.' Days Left</td>
</tr>';
}}
}}
}
else {
// Previous Courses
$query_Get_Courses_Modules = "SELECT SMBDU_CourseModules.cid, SMBDU_CourseModules.mid, School_Modules.id, School_Modules.title, School_Modules.image, School_Modules.ModuleID
FROM SMBDU_CourseModules
INNER JOIN School_Modules
ON SMBDU_CourseModules.mid=School_Modules.id
WHERE SMBDU_CourseModules.cid = '$Courses_CourseID'
GROUP BY SMBDU_CourseModules.mid
ORDER BY School_Modules.ModuleID ASC";
$Get_Courses_Modules = mysqli_query($SMB, $query_Get_Courses_Modules);
$totalRows_Get_Courses_Modules = mysqli_num_rows($Get_Courses_Modules);
if($totalRows_Get_Courses_Modules > 0){
$Previous_Courses_Output .= '<tr>
<td align="left" height="50"><img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$Courses_CourseIMG.'" alt="" height="100"/></td>
<td align="left" valign="middle"><h3>'.$Courses_ModuleID.'</h3></td>
<td align="center"></td>
<td align="center"><h3>0 Days Left</h3></td>
</tr>';
while($row_Get_Courses_Modules = mysqli_fetch_assoc($Get_Courses_Modules)){
$Courses_Modules_ID = $row_Get_Courses_Modules['id'];
$Courses_Modules_Title = $row_Get_Courses_Modules['title'];
$Courses_Modules_IMG = $row_Get_Courses_Modules['image'];
$Courses_Modules_ModuleID = $row_Get_Courses_Modules['ModuleID'];
$Previous_Courses_Output .= '<tr>
<td align="left" height="50"><img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$Courses_Modules_IMG.'" alt="" height="35"/></td>
<td align="left" valign="middle"><h4>#'.$Courses_Modules_ModuleID.'-'.$Courses_Modules_Title.'</h4></td>
<td align="center"></td>
<td align="center"></td>
</tr>';
$query_Get_Courses_Modules_Segments = "SELECT School_ModuleVideos.mid AS ModuleID, School_ModuleVideos.vid, School_ModuleVideos.sort, School_Media.id AS VID, School_Media.name, School_Media.type
FROM School_ModuleVideos
INNER JOIN School_Media
ON School_ModuleVideos.vid=School_Media.id
WHERE School_ModuleVideos.mid = '$Courses_Modules_ID' AND type = 'video'
ORDER BY School_ModuleVideos.sort ASC";
$Get_Courses_Modules_Segments = mysqli_query($SMB, $query_Get_Courses_Modules_Segments);
$totalRows_Get_Courses_Modules_Segments = mysqli_num_rows($Get_Courses_Modules_Segments);
if($totalRows_Get_Courses_Modules_Segments > 0){
while($row_Get_Courses_Modules_Segments = mysqli_fetch_assoc($Get_Courses_Modules_Segments)){
$Courses_Modules_Segments_ID = $row_Get_Courses_Modules_Segments['ModuleID'];
$Courses_Modules_Segments_VID = $row_Get_Courses_Modules_Segments['VID'];
$Courses_Modules_Segments_Name = $row_Get_Courses_Modules_Segments['name'];
$query_Get_Courses_Modules_Views = "SELECT SMBDU_VideoViews.mid, SMBDU_VideoViews.vid, SMBDU_VideoViews.userID, max(SMBDU_VideoViews.id) as ID, SMBDU_VideoViews.type
FROM SMBDU_VideoViews
WHERE SMBDU_VideoViews.mid = '$Courses_Modules_ID' AND SMBDU_VideoViews.userID = '$UserID' AND SMBDU_VideoViews.vid = '$Courses_Modules_Segments_VID' AND SMBDU_VideoViews.type = 'end'
GROUP BY SMBDU_VideoViews.vid
ORDER BY ID DESC";
$Get_Courses_Modules_Views = mysqli_query($SMB, $query_Get_Courses_Modules_Views);
$totalRows_Get_Courses_Modules_Views = mysqli_num_rows($Get_Courses_Modules_Views);
if($totalRows_Get_Courses_Modules_Views > 0){
while($row_Get_Courses_Modules_Views = mysqli_fetch_assoc($Get_Courses_Modules_Views)){
$Courses_Modules_Views_Type = $row_Get_Courses_Modules_Views['type'];
$Progress = 'Completed';
}}
if($totalRows_Get_Courses_Modules_Views == 0){
$Progress = 'Not Completed';
}
$Previous_Courses_Output .= '<tr>
<td align="left" height="50"></td>
<td align="left" valign="middle"><h6>#'.$Courses_Modules_ModuleID.' - '.$Courses_Modules_Segments_Name.'</h6></td>
<td align="center">'.$Progress.'</td>
<td align="center">0 Days Left</td>
</tr>';
}}
}}
}
}
$My_Courses_Output .= '</tbody>
</table>';
$Previous_Courses_Output .= '</tbody>
</table>';
}
else {
$My_Courses_Output .= '';
$Previous_Courses_Output .= '';
}
//Show Modules and Activity
$query_Get_Modules = "SELECT School_OrdersCart.id, School_OrdersCart.cid, School_OrdersCart.end_date, School_OrdersCart
.product_name, School_OrdersCart.image, School_OrdersCart.ModuleID, School_OrdersCart.duration
FROM School_OrdersCart
WHERE School_OrdersCart.cid = '$UserID' AND School_OrdersCart.ModuleID > 0
ORDER BY School_OrdersCart.end_date DESC";
$Get_Modules = mysqli_query($SMB, $query_Get_Modules);
$totalRows_Get_Modules = mysqli_num_rows($Get_Modules);
if($totalRows_Get_Modules > 0){
$My_Modules_Output .= '<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td width="10%" align="left" height="40"><strong>MODULES</strong></td>
<td width="50%" align="left" > </td>
<td width="20%" align="center" ><strong>PROGRESS</strong></td>
<td width="20%" align="center"><strong>DAYS REMAINING</strong></td>
</tr>';
$Previous_Modules_Output .= '<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td width="10%" align="left" height="40"><strong>MODULES</strong></td>
<td width="50%" align="left" > </td>
<td width="20%" align="center" ><strong>PROGRESS</strong></td>
<td width="20%" align="center"><strong>DAYS REMAINING</strong></td>
</tr>';
while($row_Get_Modules = mysqli_fetch_assoc($Get_Modules)){
$Modules_ID = $row_Get_Modules['id'];
$Modules_CID = $row_Get_Modules['cid'];
$Modules_ProductName = $row_Get_Modules['product_name'];
$Modules_CourseIMG = $row_Get_Modules['image'];
$Modules_Durartion = $row_Get_Modules['duration'];
$Modules_ModuleID = $row_Get_Modules['ModuleID'];
$Modules_EndDate = $row_Get_Modules['end_date'];
$Modules_now = time();
$Modules_your_date = strtotime("$Modules_EndDate");
$Modules_datediff = $Modules_your_date - $Modules_now;
$Modules_GetDays = floor($Modules_datediff / (60 * 60 * 24));
if($Modules_EndDate >= $todaydate){
$query_Get_Purchased_Modules = "SELECT School_Modules.id, School_Modules.title, School_Modules.image, School_Modules.ModuleID
FROM School_Modules
WHERE School_Modules.id = '$Modules_ModuleID'
ORDER BY School_Modules.ModuleID ASC";
$Get_Purchased_Modules = mysqli_query($SMB, $query_Get_Purchased_Modules);
$totalRows_Get_Purchased_Modules = mysqli_num_rows($Get_Purchased_Modules);
if($totalRows_Get_Purchased_Modules > 0){
$My_Modules_Output .= '<tr>
<td align="left" height="50"><a href="course-training.php?course='.$Modules_CourseID.'"><img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$Modules_CourseIMG.'" alt="" height="100"/></a></td>
<td align="left" valign="middle"><a href="module-training.php?module='.$Modules_ModuleID.'"><h3>'.$Modules_ProductName.'</h3></a></td>
<td align="center"></td>
<td align="center"><h3>'.$Modules_GetDays.' Days Left</h3></td>
</tr>';
while($row_Get_Purchased_Modules = mysqli_fetch_assoc($Get_Purchased_Modules)){
$Modules_Modules_ID = $row_Get_Purchased_Modules['id'];
$Modules_Modules_Title = $row_Get_Purchased_Modules['title'];
$Modules_Modules_IMG = $row_Get_Purchased_Modules['image'];
$Modules_Modules_ModuleID = $row_Get_Purchased_Modules['ModuleID'];
$My_Modules_Output .= '<tr>
<td align="left" height="50"></td>
<td align="left" valign="middle"><a href="course-module-training.php?module='.$Modules_Modules_ID.'&&course='.$Modules_ID.'"><h4>#'.$Modules_Modules_ModuleID.'-'.$Modules_Modules_Title.'</h4></a></td>
<td align="center"></td>
<td align="center"></td>
</tr>';
$query_Get_Purchased_Modules_Segments = "SELECT School_ModuleVideos.mid AS ModuleID, School_ModuleVideos.vid, School_ModuleVideos.sort, School_Media.id AS VID, School_Media.name, School_Media.type
FROM School_ModuleVideos
INNER JOIN School_Media
ON School_ModuleVideos.vid=School_Media.id
WHERE School_ModuleVideos.mid = '$Modules_Modules_ID' AND type = 'video'
ORDER BY School_ModuleVideos.sort ASC";
$Get_Purchased_Modules_Segments = mysqli_query($SMB, $query_Get_Purchased_Modules_Segments);
$totalRows_Get_Purchased_Modules_Segments = mysqli_num_rows($Get_Purchased_Modules_Segments);
if($totalRows_Get_Purchased_Modules_Segments > 0){
while($row_Get_Purchased_Modules_Segments = mysqli_fetch_assoc($Get_Purchased_Modules_Segments)){
$Modules_Modules_Segments_ID = $row_Get_Purchased_Modules_Segments['ModuleID'];
$Modules_Modules_Segments_VID = $row_Get_Purchased_Modules_Segments['VID'];
$Modules_Modules_Segments_Name = $row_Get_Purchased_Modules_Segments['name'];
$query_Get_Purchased_Modules_Views = "SELECT SMBDU_VideoViews.mid, SMBDU_VideoViews.vid, SMBDU_VideoViews.userID, max(SMBDU_VideoViews.id) as ID, SMBDU_VideoViews.type
FROM SMBDU_VideoViews
WHERE SMBDU_VideoViews.mid = '$Modules_Modules_ID' AND SMBDU_VideoViews.userID = '$UserID' AND SMBDU_VideoViews.vid = '$Modules_Modules_Segments_VID'
GROUP BY SMBDU_VideoViews.vid
ORDER BY ID DESC";
$Get_Purchased_Modules_Views = mysqli_query($SMB, $query_Get_Purchased_Modules_Views);
$totalRows_Get_Purchased_Modules_Views = mysqli_num_rows($Get_Purchased_Modules_Views);
if($totalRows_Get_Purchased_Modules_Views > 0){
while($row_Get_Purchased_Modules_Views = mysqli_fetch_assoc($Get_Purchased_Modules_Views)){
$Modules_Modules_Views_Type = $row_Get_Purchased_Modules_Views['type'];
if($Modules_Modules_Views_Type == 'end'){
$Progress = 'Completed';
$Link = 'course-training-segment.php?course='.$Course_ID.'&&mid='.$Modules_Modules_ID.'&&sid='.$Modules_Modules_Segments_VID.'&&resume=1';
}
if($Modules_Modules_Views_Type == 'play'){
$Progress = 'In Progress';
$Link = 'course-training-segment.php?course='.$Course_ID.'&&mid='.$Modules_Modules_ID.'&&sid='.$Modules_Modules_Segments_VID.'&&resume=1';
}
if($Modules_Modules_Views_Type == 'pause'){
$Progress = 'In Progress';
$Link = 'course-training-segment.php?course='.$Course_ID.'&&mid='.$Modules_Modules_ID.'&&sid='.$Modules_Modules_Segments_VID.'&&resume=1';
}
}}
if($totalRows_Get_Purchased_Modules_Views == 0){
$Progress = 'Start Now';
$Link = 'course-training-segment.php?course='.$Course_ID.'&&mid='.$Modules_Modules_ID.'&&sid='.$Modules_Modules_Segments_VID;
}
$My_Modules_Output .= '<tr>
<td align="left" height="50"></td>
<td align="left" valign="middle"><a href="'.$Link.'"><h6>#'.$Modules_Modules_ModuleID.' - '.$Modules_Modules_Segments_Name.'</h6></a></td>
<td align="center"><a href="'.$Link.'">'.$Progress.'</a></td>
<td align="center">'.$Modules_GetDays.' Days Left</td>
</tr>';
}}
}}
}
else {
$query_Get_Purchased_Modules = "SELECT School_Modules.id, School_Modules.title, School_Modules.image, School_Modules.ModuleID
FROM School_Modules
WHERE School_Modules.id = '$Modules_ModuleID'
ORDER BY School_Modules.ModuleID ASC";
$Get_Purchased_Modules = mysqli_query($SMB, $query_Get_Purchased_Modules);
$totalRows_Get_Purchased_Modules = mysqli_num_rows($Get_Purchased_Modules);
if($totalRows_Get_Purchased_Modules > 0){
$Previous_Modules_Output .= '<tr>
<td align="left" height="50"><img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$Modules_CourseIMG.'" alt="" height="100"/></td>
<td align="left" valign="middle"><h3>'.$Modules_ProductName.'</h3></td>
<td align="center"></td>
<td align="center"><h3>0 Days Left</h3></td>
</tr>';
while($row_Get_Purchased_Modules = mysqli_fetch_assoc($Get_Purchased_Modules)){
$Modules_Modules_ID = $row_Get_Purchased_Modules['id'];
$Modules_Modules_Title = $row_Get_Purchased_Modules['title'];
$Modules_Modules_IMG = $row_Get_Purchased_Modules['image'];
$Modules_Modules_ModuleID = $row_Get_Purchased_Modules['ModuleID'];
$Previous_Modules_Output .= '<tr>
<td align="left" height="50"><img src="https://www.successfulmedicalbilling.com/admin/school/img/'.$Modules_Modules_IMG.'" alt="" height="35"/></a></td>
<td align="left" valign="middle"><h4>#'.$Modules_Modules_ModuleID.'-'.$Modules_Modules_Title.'</h4></td>
<td align="center"></td>
<td align="center"><strong></td>
</tr>';
$query_Get_Purchased_Modules_Segments = "SELECT School_ModuleVideos.mid AS ModuleID, School_ModuleVideos.vid, School_ModuleVideos.sort, School_Media.id AS VID, School_Media.name, School_Media.type
FROM School_ModuleVideos
INNER JOIN School_Media
ON School_ModuleVideos.vid=School_Media.id
WHERE School_ModuleVideos.mid = '$Modules_Modules_ID' AND type = 'video'
ORDER BY School_ModuleVideos.sort ASC";
$Get_Purchased_Modules_Segments = mysqli_query($SMB, $query_Get_Purchased_Modules_Segments);
$totalRows_Get_Purchased_Modules_Segments = mysqli_num_rows($Get_Purchased_Modules_Segments);
if($totalRows_Get_Purchased_Modules_Segments > 0){
while($row_Get_Purchased_Modules_Segments = mysqli_fetch_assoc($Get_Purchased_Modules_Segments)){
$Modules_Modules_Segments_ID = $row_Get_Purchased_Modules_Segments['ModuleID'];
$Modules_Modules_Segments_VID = $row_Get_Purchased_Modules_Segments['VID'];
$Modules_Modules_Segments_Name = $row_Get_Purchased_Modules_Segments['name'];
$query_Get_Purchased_Modules_Views = "SELECT SMBDU_VideoViews.mid, SMBDU_VideoViews.vid, SMBDU_VideoViews.userID, max(SMBDU_VideoViews.id) as ID, SMBDU_VideoViews.type
FROM SMBDU_VideoViews
WHERE SMBDU_VideoViews.mid = '$Modules_Modules_ID' AND SMBDU_VideoViews.userID = '$UserID' AND SMBDU_VideoViews.vid = '$Modules_Modules_Segments_VID' AND SMBDU_VideoViews.type = 'end'
GROUP BY SMBDU_VideoViews.vid
ORDER BY ID DESC";
$Get_Purchased_Modules_Views = mysqli_query($SMB, $query_Get_Purchased_Modules_Views);
$totalRows_Get_Purchased_Modules_Views = mysqli_num_rows($Get_Purchased_Modules_Views);
if($totalRows_Get_Purchased_Modules_Views > 0){
$Progress = 'Completed';
}
if($totalRows_Get_Purchased_Modules_Views == 0){
$Progress = 'Not Completed';
}
$Previous_Modules_Output .= '<tr>
<td align="left" height="50"></td>
<td align="left" valign="middle"><h6>#'.$Modules_Modules_ModuleID.' - '.$Modules_Modules_Segments_Name.'</h6></td>
<td align="center">'.$Progress.'</td>
<td align="center">0 Days Left</td>
</tr>';
}}
}}
}
}
$My_Modules_Output .= '</tbody>
</table>';
$Previous_Modules_Output .= '</tbody>
</table>';
}
else {
$My_Modules_Output .= '';
$Previous_Modules_Output .= '';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>SMBDU - Successful Medical Billing and Digital University</title>
<meta charset="utf-8">
<meta name="format-detection" content="telephone=no"/>
<link rel="icon" href="../images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../css/grid.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/search.css">
<link rel="stylesheet" href="../css/camera.css">
<link rel="stylesheet" href="../css/contact-form.css">
<link rel="stylesheet" href="../css/jquery.fancybox.css">
<script src="js/jquery-1.8.1.min.js"></script>
<script src="js/jquery.js"></script>
<script src="js/jquery-migrate-1.2.1.js"></script>
<!--[if lt IE 9]>
<html class="lt-ie9">
<div style=' clear: both; text-align:center; position: relative;'>
<a href="http://windows.microsoft.com/en-US/internet-explorer/..">
<img src="../images/ie8-panel/warning_bar_0000_us.jpg" border="0" height="42" width="820"
alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today."/>
</a>
</div>
<script src="js/html5shiv.js"></script>
<![endif]-->
<script src='js/device.min.js'></script>
</head>
<body>
<div class="page">
<!--========================================================
HEADER
=========================================================-->
<header>
<div id="UserHdr"><div class="container">
<div class="row">
<div class="grid_8">
<div class="Welcome">Welcome <?php echo $GetName; ?>!</div>
</div>
<div class="grid_4">
<ul class="list01">
<li><a class="fa-user" href="my-account.php"><span>My Account</span></a></li>
<li><a class="fa-sign-out" href="php/logout.php?logout=Yes"><span>Logout</span></a></li>
</ul>
</div>
</div></div></div>
<div id="stuck_container" class="stuck_container">
<div class="container">
<div class="row">
<div class="grid_8">
<div class="brand">
<a href="./">
<img src="../img/SMB_DigitalUniversity.jpg" alt="SMBDU" height="75"/>
</a>
</div>
</div>
<div class="grid_4">
<ul class="list01">
<li><a class="fa-video-camera" href="my-access.php"><span>MY Courses/Modules</span></a></li>
<li><a class="fa-shopping-cart" href="cart.php"><span><?php echo $totalRows_CartItems; ?> ITEMS</span></a></li>
</ul>
</div>
</div>
<?php echo $HomeNav; ?>
</div>
</div>
</header>
<!--========================================================
CONTENT
=========================================================-->
<main>
<section>
<div class="well-03 bkg-01">
<div class="container">
<div class="grid_11">
<h4>Modules, Tests & CE Credits</h4>
<ul class="tabs">
<li class="active" rel="tab1">Active</li>
<li rel="tab2">Tests</li>
<li rel="tab3">CE Credits</li>
<li rel="tab4">Previous</li>
</ul>
<div class="tab_container">
<h3 class="d_active tab_drawer_heading" rel="tab1">Active Courses/Modules</h3>
<div id="tab1" class="tab_content">
<h2>Active Courses/Modules</h2>
<div class="RedProgress">
<?php echo $My_Courses_Output; ?>
<?php echo $My_Modules_Output; ?>
</div>
</div>
<!-- #tab1 -->
<h3 class="tab_drawer_heading" rel="tab2">Module Tests</h3>
<div id="tab2" class="tab_content">
<h2>Module Tests</h2>
<div class="RedProgress">
<?php echo $Test_Courses_Output; ?>
</div>
</div>
<!-- #tab2 -->
<h3 class="tab_drawer_heading" rel="tab3">CE Credits Earned</h3>
<div id="tab3" class="tab_content">
<h2>CE Credits Earned</h2>
<p>No Earned Credits.</p>
</div>
<!-- #tab3 -->
<h3 class="tab_drawer_heading" rel="tab4">Previous Purchases</h3>
<div id="tab4" class="tab_content">
<h2>Previous Purchases</h2>
<div class="RedProgress">
<?php echo $Previous_Courses_Output; ?>
<?php echo $Previous_Modules_Output; ?>
</div>
</div>
<!-- #tab4 -->
</div>
<!-- .tab_container -->
</div>
</div>
</div>
</section>
</main>
<!--========================================================
FOOTER
=========================================================-->
<footer>
<div class="bkg-02">
<div class="footer-well">
<div class="container">
<div class="row">
<div class="grid_4">
<div class="copyright">
<h6>Copyright</h6>
<a class="footer-brand" href="./"><img src="../images/logo.png" alt="SMBDU" height="50"/></a>
<p>© <span id="copyright-year"></span>
<a href="#">Privacy policy</a></p>
Website: <a rel="nofollow" href="http://www.savvysitedesigns.com" target="_blank">Savvy Site Designs</a>
</div>
</div>
<div class="grid_4">
<div class="about-us">
<h6><?php echo $Footer_LoginHdr; ?></h6>
<?php echo $Footer_LoginContent; ?>
</div>
</div>
<div class="grid_4">
<div class="contact-us">
<h6>Contact Us</h6>
<p><a href="mailto:info@smbdu.com">info@smbdu.com</a></p>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</div>
<script src="js/popup.js"></script>
<script>
$(document).ready(function() {
// Initialize the plugin
$('#my_register').popup();
});
</script>
<script>
$(document).ready(function() {
$('#my_signin').popup({
outline: true, // optional
focusdelay: 400, // optional
vertical: 'top' //optional
});
});
</script>
<script src="js/script.js"></script>
<script>
// tabbed content
// http://www.entheosweb.com/tutorials/css/tabs.asp
$(".tab_content").hide();
$(".tab_content:first").show();
/* if in tab mode */
$("ul.tabs li").click(function() {
$(".tab_content").hide();
var activeTab = $(this).attr("rel");
$("#"+activeTab).fadeIn();
$("ul.tabs li").removeClass("active");
$(this).addClass("active");
$(".tab_drawer_heading").removeClass("d_active");
$(".tab_drawer_heading[rel^='"+activeTab+"']").addClass("d_active");
});
/* if in drawer mode */
$(".tab_drawer_heading").click(function() {
$(".tab_content").hide();
var d_activeTab = $(this).attr("rel");
$("#"+d_activeTab).fadeIn();
$(".tab_drawer_heading").removeClass("d_active");
$(this).addClass("d_active");
$("ul.tabs li").removeClass("active");
$("ul.tabs li[rel^='"+d_activeTab+"']").addClass("active");
});
/* Extra class "tab_last"
to add border to right side
of last tab */
$('ul.tabs li').last().addClass("tab_last");
</script>
</body>
</html> |