<?php
include_once '../session/admin-session.php';
include_once '../classes/class_admin.php';
include_once '../classes/validation.php';
include_once '../classes/common.php';
include_once 'read-configration.php';
ob_start();

$ObjDB = new class_db();
$log = new common();
$objadm = new class_admin();
$val = new validation();

$sub_list = $working_curriculum;

$course_query = "SELECT a.*, b.sub_title, c.name FROM isr_course_content_tbl a, isr_curriculum_tbl b, isr_faculty_tbl c where a.sub_list = '$sub_list' and a.sub_list = b.sub_list and a.sub_code = b.sub_code and a.fac_roll = c.roll order by a.sub_code";
$ObjDB->sproc_name = $course_query;
$sel_course_query = $ObjDB->SelectQuery();
?>
<div class="container-fluid">
                        <div class="row">
                            <div class="col-xl-12 col-xxl-12 col-sm-12">
                                <div class="card">
                                    <div class="card-header">
                                        <h5 class="card-title">Course Content</h5>
                                    </div>
                                    <div class="card-body">

                                        <div class="table-responsive">
                                            <table class="table table-bordered align-middle">
                                                <thead class="table" style="    background: #f3e4c1;">
                                                    <tr>
                                                        <th>#</th>
                                                        <th>Code</th>
                                                        <th>Course Title</th>
                                                        <th>Coordinator</th>
                                                        <th colspan="2" class="text-center">Actions</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php $j=1; while($row = mysqli_fetch_array($sel_course_query)){ 
                                                        
                                                        $sub_code = $row["sub_code"];
    $fac_roll = $row["fac_roll"];
    $fac_name = $row["name"];
    $sub_title = $row["sub_title"];

                                                        
                                                        ?>
                                                              <tr>
                                                        <td><?php echo $j; ?></td>
                                                        <td><?php echo $sub_code; ?></td>
                                                        <td><?php echo $sub_title; ?></td>
                                                        <td><?php echo $fac_name; ?></td>
                                                        <td>
                                                            <FORM METHOD="POST" ACTION="course-content-preview.php">
			<INPUT TYPE="hidden" NAME="sub_code" value="<?php echo $sub_code; ?>">
			<INPUT TYPE="hidden" NAME="sub_list" value="<?php echo $sub_list; ?>">
			<INPUT TYPE="hidden" NAME="fac_roll" value="<?php echo $fac_roll; ?>">
                        <button class="btn btn-outline-secondary btn-sm" style="background: #a9181b;color: #fff;">Preview</button>
                                                            </FORM>
                                                            
                                                        </td>
                                                        <td>
                                                            <button class="btn btn-outline-secondary btn-sm" style="background: #a9181b;
                                                        color: #fff;">Download</button>
                                                        </td>
                                                    </tr>
                                                    <?php } ?>
                                                </tbody>
                                                
                                            </table>
                                        </div>
                                    </div>

                                </div>

                            </div>
                        </div>
                    </div>

<?php
$pagemaincontent = ob_get_contents();
ob_clean();
$PAGENAME = 'course-content-list';
$HTMLTITLE = '';
$HTMLDESCRIPTION = '';
$HTMLKEYWORDS = '';
include("admin-master.php");
?>