<div class="container">
     <div class="col-md-12 info"><center>

    <?php if($saved){
     if($success>0){ ?>
      <center>&#9432; Schedule updated</center>
     <?php }else{ ?>
     <center>&#xf071; Failed.Try again!  </center>
    <?php }} ?>

    </center></div>
		<h3>Update Schedule </h3>
		<form method="post" action="<?php echo base_url('updateschedule') ; ?>" class="validate" enctype="multipart/form-data" data-success="Schedule updated successifully" data-toastr-position="top-right"">
			<input type="hidden" name="scheduleid"  value="<?php echo $schedule->scheduleID;   ?>"/>
			<div class="row">

				<div class="col-sm-12">
					<select name="course" id="demo-category" required>
						<option value="">- Select Course -</option>
						<?php foreach($courses as $course): ?>
						<option value="<?php  echo $course['courseID']; ?>"
						<?php  if($course['courseID']==$schedule->courseID){echo 'SELECTED'; }  ?>	><?php echo $course['courseName'] ;?></option>
					<?php endforeach; ?>
					</select>
				</div>
				<div class="row">
				<div class="col-sm-3 col-sm-12">
					<label for="datefrom" class="btn">From:</label>
					<input type="text" class="form-control datepicker" data-format="yyyy-mm-dd" data-lang="en" data-RTL="false"  name="datefrom" id="datefrom" value="<?php  echo $schedule->startDate ; ?>" placeholder=" From Date " required/>
				</div>
				<div class="col-sm-3 col-sm-12">
					<label for="dateto" class="btn">To:</label>
					<input type="text" class="form-control datepicker" data-format="yyyy-mm-dd" data-lang="en" data-RTL="false" name="dateto" id="dateto" value="<?php  echo $schedule->endDate ;?>" placeholder="To Date " required />
				</div>
			</div>
			<div class="row">
				<div class="col-sm-3 col-sm-12">
					<select name="center" id="demo-category" required>
						<option value="">- Select Center -</option>
<?php foreach($centers as $center):                        ?>

						<option value="<?php  echo $center['centerID'];     ?>"

<?php  if($center['centerID']==$schedule->centerID){echo 'SELECTED'; }  ?>

							><?php echo $center['centerName'] ;     ?></option>


					<?php endforeach; ?>


					</select>
				</div>
				<div class="col-sm-3 col-sm-12">
					<select name="trainer" id="demo-category" >
						<option value="0">- Select Trainer -</option>
						<?php foreach($trainers as $trainer):                        ?>

						<option value="<?php  echo $trainer['userID'];     ?>"

<?php  if($trainer['userID']==$schedule->trainerID){echo 'SELECTED'; }  ?>
							><?php echo $trainer['firstName'].' '.$trainer['secondName'].' '.$trainer['surName'] ;     ?></option>


					<?php endforeach; ?>


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

				<!-- Break -->
				<div class="col-12">
					<input type="submit" value="Update Schedule" class="btn btn-primary" />
				</div>
			</div>
		</form>

	</div>
