<?php defined('BASEPATH')or exit('NO direct Access is Allowed');?>
<?php
$last = $this->uri->total_segments();
$courseid = $this->uri->segment($last);
 ?>
<div class="content-wrapper">
  <section class="content">
      <div class="row">
          <div class="col-xs-12">
            <div class="box">
              <div class="box-body table-responsive no-padding">
                 <div class="border_full">
                    <h3 class="full_h3"><?=strtoupper($course->course_name);?>
                      <a href="<?=site_url('admin/course/Course');?>" class="course_lists pull-right btn btn-sm btn-social" style="background-color: #ffffff;"><i class="fa fa-list text-green"></i> Course List</a>
                      <a href="<?=site_url('admin/account/Account/teacher_wallet');?>" class="course_lists pull-right btn btn-sm btn-social" style="background-color: #ffffff;"><i class="fa fa-edit text-green"></i>Teacher Wallet</a>
                        <a href="<?=site_url('admin/account/Account/student_wallet');?>" class="course_lists pull-right btn btn-sm btn-social" style="background-color: #ffffff;"><i class="fa fa-edit text-green"></i>Student Wallet</a>
                    </h3>
                    <div class="table-responsive1">
                      <table class="table table-bordered table-responsive" id="">
                        <thead>
                          <tr>
                            <th>Faculty</th>
                            <th>Attendee/Class Strength</th>
                            <th>Class Days</th>
                            <th>Hour Unit Price </th>
                          </tr>
                        </thead>
                        <tbody>
                          <tr>
                            <td><?php echo strtoupper($course->faculty);?></td>
                            <td><?php echo strtoupper($course->attendee_limit." / ".$course->course_student);?></td>
                            <td><?php echo strtoupper($course->week_days); ?></td>
                            <td><i class="fa fa-fw fa-inr"></i> <?php echo strtoupper($course->class_unit_price); ?></td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </div>
               </div>
      		 </div>
           <div class="box">
             <div class="box-body table-responsive no-padding">
               <div class="border_full">
                   <form name="add_name"  method="post" action="<?=site_url("admin/course/Course/edit_course_student/{$courseid}");?>" id="add_name">
                 <h3 class="full_h3">Add/update Student in Course
                     <button type="button" name="add" id="adds" class="pull-right btn btn-sm btn-success">Add More</button>
                         <input type="submit" name="submit" id="submit" class="pull-right btn btn-sm btn-warning final_active_submit" value="Submit" />
                     <!-- <a href="<?=site_url('admin/course/Course');?>" class="course_lists pull-right btn btn-sm btn-social" style="background-color: #ffffff;"><i class="fa fa-fw fa-search  text-green"></i>Search</a>
                     <a href="<?=site_url('admin/account/Account/add_student_money_account');?>" class="course_lists pull-right btn btn-sm btn-social" style="background-color: #ffffff;"><i class="fa fa-edit text-green"></i>Add Student Wallet</a> -->
                 </h3>
                 <div  id="reportsummary">
                   <div id="tableContainer2" class="container-tb">
                     <table class="table-hover" id="dynamic_field">
                         <thead>
                           <tr>
                             <th>Student Name/Id</th>
                             <th>Joining date</th>
                             <th>Status</th>
                             <th>Remarks</th>
                             <th>Student Wallet</th>
                           </tr>
                        </thead>

                         <input type="hidden" value="<?=$course->id;?>" name="course_id">
                         <input type="hidden" value="<?=$course->attendee_limit;?>" name="studnet_limit">
                         <tbody>
                           <?php
                           foreach($course_student_list as $students){
                           ?>
                             <tr>
                                <?php $status = array('1'=>'Active','0'=>'Inactive');?>
                                <?php echo form_hidden('student[]',$students->student_id);?>
                               <?php echo form_hidden('joining_date[]',$students->joining_date);?>
                               <td><?php echo form_dropdown('students_to_show_only',$student,set_value('student_to_show_only',$students->student_id),['class'=>'form-control',
                               'data-placeholder'=>"Select Student",'disabled'=>"disabled",'tabindex'=>"-1", 'aria-hidden'=>"true"]);?></td>
                               <td><?php echo form_input(['name'=>'joining_date','disabled'=>"disabled",'class'=>'form-control',
                               'id'=>'datepicker1','placeholder'=>'Joining Date',
                               'value'=>set_value('joining_date_to_show_only',$students->joining_date),'autocomplete'=>'off']);?></td>
                               <td><?php echo form_dropdown('status[]',$status,set_value('status',$students->status),['class'=>'form-control status_check',
                               'data-placeholder'=>"Select status",'required'=>'required']);?></td>
                               <td>  <?php echo form_textarea(['name'=>'remarks[]','class'=>'form-control','id'=>'','placeholder'=>'Remarks',
                                 'value'=>set_value('remarks',$students->remarks),'rows'=> '1','cols' => '10','autocomplete'=>'off']);?></td>
                                 <td><i class="fa fa-fw fa-inr"></i> <?php if($students->student_wallet!=""){echo $students->student_wallet;}else{echo 0;};?></td>
                             </tr>
                           <?php
                             }
                           ?>
                         </tbody>
                     </table>
                   </div>
                   <?php $count++; //echo  $link; ?>
                 </div>
                   </form>
               </div>
             </div>
           </div>

          </div>
      </div>
  </section>
</div>



<!-- <div class="box">
    <div class="box-header">
    </div>
    <div class="box-body">
        <div class="row">
           <div class="col-md-12">
             <form name="add_name"  method="post" action="<?=site_url("admin/course/Course/edit_course_student/{$courseid}");?>" id="add_name">
              <div class="table-responsive">
                <table class="table table-bordered" id="dynamic_field">
                  <thead>
                </thead>
                  <input type="hidden" value="<?=$course->id;?>" name="course_id">
                  <input type="hidden" value="<?=$course->attendee_limit;?>" name="studnet_limit">
                <tbody>
                  <?php
                  //foreach($course_student_list as $students){
                  ?>
                    <tr>
                       <?php $status = array('1'=>'Active','0'=>'Inactive');?>
                       <?php echo form_hidden('student[]',$students->student_id);?>
                      <?php echo form_hidden('joining_date[]',$students->joining_date);?>
                      <td><?php echo form_dropdown('students_to_show_only',$student,set_value('student_to_show_only',$students->student_id),['class'=>'form-control',
                      'data-placeholder'=>"Select Student",'disabled'=>"disabled",'tabindex'=>"-1", 'aria-hidden'=>"true"]);?></td>
                      <td><?php echo form_input(['name'=>'joining_date','disabled'=>"disabled",'class'=>'form-control',
                      'id'=>'datepicker1','placeholder'=>'Joining Date',
                      'value'=>set_value('joining_date_to_show_only',$students->joining_date),'autocomplete'=>'off']);?></td>
                      <td><?php echo form_dropdown('status[]',$status,set_value('status',$students->status),['class'=>'form-control status_check',
                      'data-placeholder'=>"Select status",'required'=>'required']);?></td>
                      <td>  <?php echo form_textarea(['name'=>'remarks[]','class'=>'form-control','id'=>'','placeholder'=>'Remarks',
                        'value'=>set_value('remarks',$students->remarks),'rows'=> '1','cols' => '10','autocomplete'=>'off']);?></td>
                        <td><?=$students->student_wallet;?></td>
                    </tr>
                  <?php
                  //  }
                  ?>
                </tbody>
                  <button type="button" name="add" id="adds" class="btn btn-success">Add More</button>
                </table>
                <input type="submit" name="submit" id="submit" class="btn btn-info final_active_submit" value="Submit" />
              </div>
            </form>
           </div>
        </div>
    </div>
    <hr />
</div> -->
