<?php defined('BASEPATH')or exit('NO direct Access is Allowed');?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://cdn.rawgit.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/master/jquery-ui.multidatespicker.css" rel="stylesheet"/>
<link href="https://code.jquery.com/ui/1.12.1/themes/pepper-grinder/jquery-ui.css" rel="stylesheet"/>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdn.rawgit.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/master/jquery-ui.multidatespicker.js"></script>
<?php
  $last     = $this->uri->total_segments();
  $courseid = $this->uri->segment($last);
  date_default_timezone_set('Asia/Kolkata');
?>

<div class="content-wrapper">
  <section class="content">
      <div class="row">
          <div class="col-xs-12">
              <div class="box">
                  <div class="box-header">
                      <!--<h3 class="box-title">Add Products</h3>-->
                      <?php echo form_open("admin/course/Course/add_class_to_course/{$courseid}",['name'=>'activity_form_add','id'=>'activity_form_add']);?>
                      <?php echo form_hidden('my_array',['name'=>'doaction','id'=>'doaction']);?>
                      <input type="hidden" name="course_id" value="<?=$courseid;?>">
                      <?php echo form_submit(['name'=>'save','value'=>'Save','class'=>'btn btn-default pull-right ',
                      'style'=>'margin-left:5px;background-color: #ffffff;']); ?>
                      <?php echo anchor('admin/course/Course','<i class="fa fa-fw fa-list"></i> Course List',['class'=>'btn btn-default pull-right',
                      'style'=>'background-color: #ffffff;']); ?>
                      <div class="col-md-12" id="respose">
                      <?php if ($this->session->flashdata('failure') == TRUE): ?>
                            <div class="alert alert-error"><?php echo $this->session->flashdata('failure'); ?></div>
                            <?php endif; ?>
                            <?php if ($this->session->flashdata('success') == TRUE): ?>
                            <div class="alert alert-success"><?php echo $this->session->flashdata('success'); ?></div>
                        <?php endif; ?>
                      </div>
                  </div>
                  <!-- /.box-header -->
                  <div class="box-body">
                      <div class="row">
                        <div class="col-md-12">
                             <div class="col-md-3">
                                 <div class="form-group">
                                   <div class="input-group">
                                     <div class="input-group-addon"><i class="fa fa-fw fa-commenting text-red"></i></div>
                                     <?php echo form_input(['name'=>'course_name','class'=>'form-control ','id'=>'','placeholder'=>'Course Name',
                                     'value'=>set_value('course_name',$course->course_name." - ".strtoupper($course->faculty)),'disabled'=>'disabled']);?>
                                   </div>
                                 </div>
                             </div>
                             <div class="col-md-3">
                                 <div class="form-group">
                                   <div class="input-group">
                                     <div class="input-group-addon"><i class="fa fa-fw fa-commenting text-red"></i></div>
                                     <?php echo form_input(['name'=>'course_name','class'=>'form-control ','id'=>'','placeholder'=>'Course Name',
                                     'value'=>set_value('course_info',$course->class_unit_price."Rs. - ".strtoupper($course->course_duration_hours)." Hrs. - ".date("d-M-Y",strtotime($course->course_start_from))),'disabled'=>'disabled']);?>
                                   </div>
                                 </div>
                             </div>
                             <div class="col-md-3">
                                 <div class="form-group">
                                   <div class="input-group">
                                     <div class="input-group-addon"><i class="fa fa-fw fa-commenting text-red"></i></div>
                                     <?php echo form_input(['name'=>'course_name','class'=>'form-control ','id'=>'','placeholder'=>'Course Name',
                                     'value'=>set_value('course_studnet',"Attendee - ".$course->attendee_limit." - ".$course->course_student),'disabled'=>'disabled']);?>
                                   </div>
                                 </div>
                             </div>
                             <div class="col-md-3">
                                 <div class="form-group">
                                   <div class="input-group">
                                     <div class="input-group-addon"><i class="fa fa-fw fa-commenting text-red"></i></div>
                                     <?php echo form_input(['name'=>'course_name','class'=>'form-control ','id'=>'','placeholder'=>'Course Name',
                                     'value'=>set_value('course_weekdays',$course->week_days),'disabled'=>'disabled']);?>
                                   </div>
                                 </div>
                             </div>
                         </div>
                          <div class="col-md-12">
                            <div class="col-md-3">
                              <div class="form-group">
                                <?php echo form_label('Classes from To *','course_end_date',['for'=>'course_duration']);?><?php echo form_error('from_to_class_duration'); ?>
                                <div class="input-group">
                                  <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                  <?php echo form_input(['name'=>'from_to_class_duration','class'=>'form-control','id'=>'reservation','placeholder'=>'Enter Class From To',
                                  'value'=>set_value('from_to_class_duration')]);?>
                                </div>
                              </div>
                            </div>
                            <div class="col-md-3" class="week1">
                                <div class="form-group">
                                  <?php echo form_label('Class Week Days <span style="color:red"> *</span>','week_days',['for'=>'week_days','class'=>'']);?>
                                  <?php echo form_error('week_days[]'); ?>
                                  <?php $days = array('Monday'=>'Monday','Tuesday'=>'Tuesday','Wednesday'=>'Wednesday',
                                  'Thursday'=>'Thursday','Friday'=>'Friday','Saturday'=>'Saturday','Sunday'=>'Sunday');?>
                                  <?php echo form_dropdown('week_days[]',$days,set_value('week_days'),['class'=>'form-control select2 select2-hidden-accessible',
                                  'multiple'=>'','data-placeholder'=>"Select Week Days",'style'=>"width: 100%;",'tabindex'=>"-1", 'aria-hidden'=>"true",'autocomplete'=>'off']);?>
                                </div>
                            </div>
                            <div class="col-md-3" class="customdate1">
                               <div class="form-group">
                                  <?php echo form_label('Custom Date','custom_date',['for'=>'custom_date','class'=>'']);?><?php echo form_error('custom_date'); ?>
                                  <div class="input-group">
                                      <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                      <?php echo form_input(['name'=>'custom_date','class'=>'form-control ','id'=>'mdp-demo','placeholder'=>'Enter Custom Date Multi',
                                      'value'=>set_value('custom_date'),'autocomplete'=>'off']);?><!--  <div id="mdp-demo"></div>-->
                                  </div>
                               </div>
                           </div>
                           <div class="col-md-3">
                             <div class="bootstrap-timepicker"><div class="bootstrap-timepicker-widget dropdown-menu"><table><tbody><tr><td><a href="#" data-action="incrementHour"><i class="glyphicon glyphicon-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><i class="glyphicon glyphicon-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="glyphicon glyphicon-chevron-up"></i></a></td></tr><tr><td><span class="bootstrap-timepicker-hour">08</span></td> <td class="separator">:</td><td><span class="bootstrap-timepicker-minute">45</span></td> <td class="separator">&nbsp;</td><td><span class="bootstrap-timepicker-meridian">AM</span></td></tr><tr><td><a href="#" data-action="decrementHour"><i class="glyphicon glyphicon-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="glyphicon glyphicon-chevron-down"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="toggleMeridian"><i class="glyphicon glyphicon-chevron-down"></i></a></td></tr></tbody></table></div>
                                 <div class="form-group">
                                    <?php echo form_label('Class Time *','class_start_time',['for'=>'class_time']);?><?php echo form_error('class_start_time'); ?>
                                    <div class="input-group">
                                      <div class="input-group-addon"><i class="fa fa-clock-o"></i></div>
                                      <?php echo form_input(['name'=>'class_start_time','class'=>'form-control timepicker','placeholder'=>'Enter class Start Time',
                                     'value'=>set_value('class_start_time',date("g:i a", strtotime($lists->class_start_time))),'autocomplete'=>'off']);?>
                                    </div><!--  -->
                                 </div>
                             </div>
                           </div>

                          </div>
                          <div class="col-md-12">
                            <div class="col-md-3">
                               <div class="form-group">
                                 <?php echo form_label('Duration in Hours *','class_duration',['for'=>'presenter_type']);?><?php echo form_error('class_duration_mins'); ?>
                                 <?php  $course_duration  = array(''=>"Select Course Duration",
                                           '15'=>'15 Min','30'=>'30 Min','45'=>'45 Min','60'=>'1 Hour',
                                           '75'=>'1 Hour 15 min','90'=>'1 Hour 30 min','105'=>'1 Hour 45 min',
                                           '120'=>'2 Hour','135'=>'2 Hour 15 min','150'=>'2 Hour 30 min','165'=>'2 Hour 45 min',
                                           '180'=>'3 Hour','195'=>'3 Hour 15 min','210'=>'3 Hour 30 min','225'=>'3 Hour 45 min',
                                           '240'=>'4 Hour','255'=>'4 Hour 15 min','270'=>'4 Hour 30 min','285'=>'4 Hour 45 min',
                                           '300'=>'5 Hour');$options=array(''=>'Select Presenter','0'=>'Dummy','1'=>'Real');  ?>
                                 <?php echo form_dropdown('class_duration_mins',$course_duration,set_value('class_duration_mins',$lists->class_duration_min),['class'=>'form-control','autocomplete'=>'off']);?>
                               </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                  <?php echo form_label('Extend Duration Mins','extend_duration',['for'=>'extend_duration']);?><?php echo form_error('extend_duration_mins'); ?>
                                  <?php $extend_duration  = array(''=>"Select Extend Duration",'05'=>'05 Min','10'=>'10 Min','15'=>'15 Min','20'=>'20 Min','25'=>'25 Min','30'=>'30 min');?>
                                  <?php echo form_dropdown('extend_duration_mins',$extend_duration,set_value('extend_duration_mins',$lists->class_extend_time_min),['class'=>'form-control','autocomplete'=>'off']);?>
                                </div>
                            </div>

                              <div class="col-md-3">
                                  <div class="form-group">
      								                <?php echo form_label('Faculty *','faculty',['for'=>'faculty']);?><?php echo form_error('faculty'); ?>
                      				         <?php echo form_dropdown('faculty',$faculty,set_value('faculty',$lists->faculty_code),['class'=>'form-control','autocomplete'=>'off']);?>
                                  </div>
                              </div>
                              <div class="col-md-3">
                                  <div class="form-group">
                                    <?php echo form_label('Class Status <span style="color:red"> *</span>','per_class_amount',['for'=>'per_class_amount']);?>
                                    <?php echo form_error('status'); ?>
                                    <?php $status = array('create'=>'Create');//'cancel'=>'Cancel','reschedule'=>'Reschedule',?>
                                    <?php echo form_dropdown('status',$status,set_value('status','create'),['class'=>'form-control select2 select2-hidden-accessible',
                                    'data-placeholder'=>"Select status",'style'=>"width: 100%;",'tabindex'=>"-1", 'aria-hidden'=>"true"]);?>
                                  </div>
                              </div>
                          </div>
                          <div class="col-md-12">
                            <div class="col-md-12">
                                <div class="form-group">
                                  <?php echo form_label('Remarks','per_class_amount',['for'=>'per_class_amount']);?>
                                  <?php echo form_error('remarks'); ?>
                                  <div class="input-group">
                                    <div class="input-group-addon"><i class="fa fa-fw fa-commenting text-red"></i></div>
                                    <?php echo form_textarea(['name'=>'remarks','class'=>'form-control','id'=>'','placeholder'=>'Remarks',
                                    'value'=>set_value('remarks'),'rows'=> '1','cols' => '10','autocomplete'=>'off']);?>
                                  </div>
                                </div>
                            </div>
                          </div>

                      </div>
                  </div>
                  <hr />
                  <?php echo form_submit(['name'=>'save','value'=>'Save','class'=>'btn btn-default pull-right','style'=>'margin-left:5px;background-color: #ffffff;']); ?>
                  <?php echo  form_close();?>
              </div>
          </div>
      </div>
  </section>
</div>
<script>
$(document).ready(function(){
	$(".addCF").click(function(){
		$("#customFields").append('<tr valign="top"><th scope="row"><label for="customFieldName">Custom Field</label></th><td><input type="text" class="code" id="customFieldName" name="customFieldName[]" value="" placeholder="Input Name" /> &nbsp; <input type="text" class="code" id="customFieldValue" name="customFieldValue[]" value="" placeholder="Input Value" /> &nbsp; <a href="javascript:void(0);" class="remCF">Remove</a></td></tr>');
	});
    $("#customFields").on('click','.remCF',function(){
        $(this).parent().parent().remove();
    });
});
</script>
<style>
.SumoSelect {
    display: block;
    position: relative;
    outline: none;
}

</style>
<script>$('#mdp-demo').multiDatesPicker();</script>

<!-- <div class="col-md-3">
    <div class="form-group">
      <?php //echo form_label('Joining Date <span style="color:red"> *</span>','student_amount',['for'=>'student_amount']);?>
      <?php //echo form_error('joining_date'); ?>
      <?php //echo form_input(['name'=>'joining_date','class'=>'form-control','id'=>'datepicker','placeholder'=>'Joining Date',
      //'value'=>set_value('joining_date'),'autocomplete'=>'off']);?>
    </div>
</div> -->
