<?php 
include("header.php");
if(!empty($_GET['view_id']))
$view_id = $_GET['view_id'];
elseif(!empty($_POST['view_id']))
$view_id = $_POST['view_id'];
else
$view_id = '';

 $get_data= get_inst_course($view_id,'','','');

?>
<div class="card shadow-lg border-0 mb-4 ml-2">


    <div class="card-header bg-dark text-white d-flex justify-content-between align-items-center">
        <h4 class="mb-0"><i class="bi bi-journal-bookmark"></i> Course Details</h4>

        <div>
            <a href="my_courses.php?mid=<?php echo $view_id ?? "";?>" class="btn btn-warning btn-sm">
                <i class="bi bi-pencil"></i> Edit
            </a>

            <a href="course_report.php" class="btn btn-light btn-sm">
                <i class="bi bi-arrow-left"></i> Back
            </a>
        </div>
    </div>


    <div class="card-body">

        <div class="row">

   
            <div class="col-md-4 text-center">
               <a href="<?php echo $get_data[0]['course_video'] ?? "";?>" > <img src="courses_upload/<?php echo $get_data[0]['course_img']?? "" ?>" class="img-fluid rounded shadow-sm mb-3"> </a>

                <div class="mt-2">
                    <span class="badge bg-info"><?php echo $get_data[0]['course_type'] ?? ""; ?></span>
                    <span class="badge bg-success"><?php echo $get_data[0]['language'] ?? ""; ?></span>
                    <span class="badge bg-warning text-dark"><?php echo $get_data[0]['course_level'] ?? ""; ?></span>
                </div>
            </div>

    
            <div class="col-md-8">

                <h3 class="fw-bold"><?php echo $get_data[0]['course_title'] ?? ""; ?></h3>

                <table class="table table-borderless mt-3">

                    <tr>
                        <th width="160"><i class="bi bi-folder"></i> Category</th>
                        <td><?php echo $get_data[0]['category_title'] ?? "";?></td>
                    </tr>

                    <tr>
                        <th><i class="bi bi-laptop"></i> Course Type</th>
                        <td><?php echo $get_data[0]['course_type'] ?? ""; ?></td>
                    </tr>

                    <tr>
                        <th><i class="bi bi-translate"></i> Language</th>
                        <td><?php  echo $get_data[0]['language'] ?? "";?></td>
                    </tr>

                    <tr>
                        <th><i class="bi bi-bar-chart"></i> Level</th>
                        <td><?php echo  $get_data[0]['course_level'] ?? "";?></td>
                    </tr>

                    <tr>
                        <th><i class="bi bi-calendar-event"></i> Start Date</th>
                        <td><?php echo $get_data[0]['start_date'] ?? "";?></td>
                    </tr>

                    <tr>
                        <th><i class="bi bi-award"></i> Grade</th>
                        <td> <?php  $g = get_grade($get_data[0]['grade'],'','',''); echo $g[0]['grade'] ?? "";?></td>
                    </tr>
                     <tr>
                       <th><i class="bi bi-tag"></i> Price</th>
                        <td>$. <?php echo  $get_data[0]['course_price'] ?? "";?></td>
                    </tr>
                    

                </table>

            </div>

        </div>


        <hr class="my-4">


        <div class="mb-4">
            <h5 class="fw-bold text-primary">
                <i class="bi bi-info-circle"></i> Course Overview
            </h5>
            <div class="p-3 bg-light rounded">
               <?php echo $get_data[0]['course_overview'] ?? "";?>
            </div>
        </div>

 
        <div class="mb-4">
            <h5 class="fw-bold text-primary">
                <i class="bi bi-file-text"></i> Course Details
            </h5>
            <div class="p-3 bg-light rounded">
             <?php echo  $get_data[0]['details'] ?? "";?>
            </div>
        </div>


        <div>
            <h5 class="fw-bold text-primary">
                <i class="bi bi-plus-circle"></i> Additional Information
            </h5>
            <div class="p-3 bg-light rounded">
              <?php  echo $get_data[0]['additional_info'] ?? "";?>
            </div>
        </div>

    </div>

</div>



<?php include("footer.php"); ?>