<?php 
include_once('header.php');
$module=get_modules($_GET['course_id']);
?>
<!-- START SECTION TOP -->
	<section class="section-top">
		<div class="container">
			<div class="col-lg-10 offset-lg-1 text-center">
				<div class="section-top-title wow fadeInRight" data-wow-duration="1s" data-wow-delay="0.3s" data-wow-offset="0">
					<h1>All Course</h1>
					<ul>
						<li><a href="dashboard.php">Dashboard</a></li>
						<li> / My Courses</li>
					</ul>
				</div><!-- //.HERO-TEXT -->
			</div><!--- END COL -->
		</div><!--- END CONTAINER -->
	</section>	
	<!-- END SECTION TOP -->

    <style>
        :root {
            --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --glass-bg: rgba(255, 255, 255, 0.95);
        }

        body {
            font-family: 'Inter', sans-serif;
            background: #f0f2f5;
            color: #2d3436;
            min-height: 100vh;
        }
</style>

<div class="container my-5">
    <div class="row justify-content-center">
        <div class="col-lg-8 position-relative">
            
            <div class="progress-line-container d-none d-md-block">
                <div class="progress-line-fill" style="height: 65%;"></div>
            </div>

            <div class="stack-wrapper">
                
         <?php
		   for($i=0;$i<count($module);$i++)
		   {
		 ?>
                <div class="stack-item mb-4 animate__animated animate__fadeInDown">
                    <div class="d-flex justify-content-between align-items-start">
                        <div>
                            <span class="topic-badge text-success">Completed <i class="bi bi-check-all"></i></span>
                            <h3 class="fw-bold"><?php echo $module[$i]['module_title']; ?></h3>
                            <!--<p class="text-muted">Mastering HTML5 and Modern CSS architectures.</p>-->
                        </div>
                        <div class="text-end">
                            <h4 class="fw-bold text-success">100%</h4>
                        </div>
                    </div>
                    <div class="mt-2">
                    <?php 
						$selsub=executework("SELECT * FROM lms_instructor_lessons where course_id='".$_GET['course_id']."' and module_id='".$module[$i]['id']."' and status=1");		
						while($rowsub=@mysqli_fetch_array($selsub))
						{					
					?>	
                        <a href="test.php?course_id=<?php echo $_GET['course_id']; ?>&module_id=<?php echo $module[$i]['id']; ?>&lesson_id=<?php echo $rowsub['id']; ?>"> <span class="sub-topic-pill"><?php echo $rowsub['lesson_title']; ?></span></a>
                   <?php } ?>
                    </div>
                </div>
		<?php } ?>
               <!-- Progress Pending Start
               
                <div class="stack-item stack-active mb-4 animate__animated animate__fadeInDown" style="animation-delay: 0.2s;">
                    <div class="d-flex justify-content-between align-items-start">
                        <div>
                            <span class="topic-badge">Current Module</span>
                            <h3 class="fw-bold">02. Dynamic Logic (PHP)</h3>
                            <p class="text-muted">Building secure backend systems with PHP 8.x.</p>
                        </div>
                        <div class="text-end">
                            <h4 class="fw-bold text-primary">45%</h4>
                        </div>
                    </div>
                    <div class="progress my-3" style="height: 8px; border-radius: 10px;">
                        <div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 45%"></div>
                    </div>
                    <div class="mt-2">
                        <span class="sub-topic-pill">Array Functions</span>
                        <span class="sub-topic-pill">MySQL PDO</span>
                        <span class="sub-topic-pill text-muted"><i class="bi bi-lock"></i> OOP Basics</span>
                    </div>
                </div>
                
                Progress Pending End 
                
                Locked Module Start

                <div class="stack-item mb-4 animate__animated animate__fadeInDown" style="animation-delay: 0.4s; opacity: 0.7;">
                    <div class="d-flex justify-content-between align-items-start">
                        <div>
                            <span class="topic-badge text-secondary">Up Next</span>
                            <h3 class="fw-bold">03. Deployment & Security</h3>
                            <p class="text-muted">Pushing your project to live production environments.</p>
                        </div>
                    </div>
                    <div class="mt-3">
                        <button class="btn btn-light btn-sm disabled rounded-pill px-4">Locked</button>
                    </div>
                </div>
                
                Locked Module End
                -->

            </div>
        </div>
    </div>
</div>
<?php include_once('footer.php'); ?>