</div>
<!--/. PRELOADER END -->
<?php 
if (isset($_GET["course_id"])) {
    $course_id = $_GET["course_id"];
    $course_info = $db->getCourseInfo($course_id);
    if (isset($_POST["save"])) {
        $db->updateCourseInfo($course_id, $_POST["course_name"], $_POST["summary"]);
        $chapter_no = "1";
        $db->updateChapter($course_info["contentTable_name"], "{$chapter_no}", $_POST["chapter_1_name"], $_POST["chapter_1_link"], $_POST["chapter_1_summary"]);
        $db->updateChapter($course_info["contentTable_name"], "2", $_POST["chapter_2_name"], $_POST["chapter_2_link"], $_POST["chapter_2_summary"]);
        $db->updateChapter($course_info["contentTable_name"], "3", $_POST["chapter_3_name"], $_POST["chapter_3_link"], $_POST["chapter_3_summary"]);
        $db->updateChapter($course_info["contentTable_name"], "4", $_POST["chapter_4_name"], $_POST["chapter_4_link"], $_POST["chapter_4_summary"]);
    }
    $course_info = $db->getCourseInfo($course_id);
    $course_data = $db->getCourseData($course_info["contentTable_name"]);
    $row = array();
    $count = 0;
    while ($row[$count] = $course_data->fetch_assoc()) {
        $count++;
    }
}
?>


<?php 
if ($user_profile["role"] == "instructor") {
    ?>
	<div class="container">
  <h2 class="col-sm-4 col-sm-offset-5 "> Edit course data </h2>
  <form role="form" action="course_videos.php?course_id=<?php