<?php include 'header.php'; ?>

<?php include 'sidebar.php'; ?>

<div id="page-wrapper">

    <div class="container-fluid">

		<br/>

         <div class="row">

             <div class="col-lg-12">
				<div class="panel panel-default dash">
					<div class="panel panel-primary">
						<div class="panel-heading">
							<h2 class="sub-header">
								<i class="fa fa-graduation-cap" aria-hidden="true"></i> <?php echo lang('COURSES');?>
							</h2>
						</div>
						<!-- /.panel-heading -->
						<div class="panel-body">
							<div class="table-responsive">
							
								<div class="col-md-12">

									 <form id="editSubjects" method="post" enctype="multipart/form-data" class="form-horizontal" name="editSubjects">
										
										<?php $csrf->echoInputField(); ?>
										
										<fieldset>

										<!-- Text input -->
											<div class="form-group">
												<label class="col-md-2 control-label" for="college_type"><?php echo lang('COURSE_NAME');?></label>
												<div class='col-md-6'>
													<select class="form-control input-md" name="college_type">
													  <option value="<?php
														global $conection;
														$sql = mysqli_query($conection,"select main_course_name from main_course");
														$row = mysqli_fetch_assoc($sql);
														echo $row['main_course_name'];
													?>">
														<?php echo listCourseLists(); ?>
													</select>
												</div>
											</div>
											
										<?php echo editSubjects($_GET['id']); ?>

										<!-- Button -->
										<div class="form-group">
											<label class="col-md-9 control-label" for="singlebutton"></label>
											<div class="col-md-3">
												<input type="submit" name="editSubjects" class="btn save btn-primary" value="<?php echo lang('UPDATE_INFO');?>" />
											</div>
										</div>

										</fieldset>
									</form>
									<?php
	
									  if(isset($_POST['editSubjects']))
									  {
										updateSubjects($_GET['id'],mysqli_real_escape_string($conection, $_POST['college_type']),mysqli_real_escape_string($conection, $_POST['courseName']),mysqli_real_escape_string($conection, $_POST['status']));
									  }

									?>

								</div>    
							</div>
						</div>
					</div>
				</div>
			</div>
        </div>
        <!-- /.row -->

        <div class="copyright">
	        <p>© Copyright 2018  &nbsp;&nbsp;|&nbsp;&nbsp; All Rights Reserved Powered by 
	        <a href="http://www.bluelinecomputers.com/" target="_blank">Blueline Computers</a></p>
	    </div>

    </div>
    <!-- /.container-fluid -->

</div>
<!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->

<?php include 'footer.php'; ?>