     <?php 
	    if(isset($sess_data))
		  echo $sess_data['JSFunction'];
	?>
     <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            Add Penalty
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="#">Penalties</a></li>
            <li class="active">Add Penalty</li>
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">  
                      
             <div class="col-md-12">
             	<div class="box box-success">
                  <div class="box-header with-border">
                   <h3 class="box-title">Penalty Details</h3>
                   <h4 class="box-title pull-right purple"><?php echo date("jS M Y -  g:i:s a"); ?></h4>
                  </div><!-- /.box-header -->
                    <form role="form" class="form-horizontal" name="penalty" action="<?php echo site_url();?>penalties/insert_diversity_penalty" method="post" id="penalty"> 
                    <div class="row">
                    <div class="col-md-8">                   
                    <div class="box-body">
                    <span id="displayMsg" class="green"></span>
                    <div class="form-group">
                    <div class="col-sm-6">
                    <select class="form-control  reg_label" id="select2" name="subject_id">
                      <option></option>
                       <?php
						  if($members ==NULL)
							  {
								  echo "No members to Show";
							  }
						  else
							  {
								  foreach($members as $member)
									  {
										   echo " <option value='".$member['user_id']."'>".$member['name']."</option>";
									  }
							  }				
					?>
                    </select>
                    </div>
                    <div class="col-sm-6">
                    <?php echo form_error('member_name'); ?> 
                    <input type="text" class="form-control" id="demo" name="member_name" value="" readonly>
                    <input type="hidden" id="subject_id" name="subject_id" value="" />
                    </div>
                  </div> 
                      
                        <div class="form-group">
                        <label for="date_time" class="col-sm-6 control-label float-right">Choose Date(for penalty)</label>
                        <div class="col-sm-6">
                        <?php echo form_error('date_time'); ?>                        	
                        <input type="text" class="form-control white_bg" id="date_time" name="date_time" value="<?php echo set_value('date_time'); ?>" required="required" readonly="readonly">
                        </div>
                        </div>
                        <div class="form-group">
                        <label for="reason" class="col-sm-6 control-label float-right">Reason</label>
                        <div class="col-sm-6">
                        <?php echo form_error('reason'); ?>                        	
                         <select class="form-control  reg_label" id="reason" name="reason">
                      		<option></option>
                            <option value="Late Payment">Late Payment</option>                            
                            <option value="Absenteeism">Absenteeism</option>
                         </select>
                        </div>
                        </div>
                        <div class="form-group">
                        <label for="amount" class="col-sm-6 control-label float-right">Amount</label>
                        <div class="col-sm-6">
                        <?php echo form_error('amount'); ?>                        	
                        <input type="text" class="form-control" id="amount" name="amount"  value="<?php echo set_value('amount'); ?>" placeholder="0.00"  required="required">
                        </div>
                        </div>
                        
                      </div><!-- /.box-body -->
                   	<div class="box-footer">
                   	
                    <div class="form-group"></div>
                    <div class="form-group">
                        <div class="col-sm-6">
                        <button type="reset" class="btn btn-danger btn-block">Reset</button>
                        </div>
                        <div class="col-sm-6">
                        <button type="submit" class="btn btn-success btn-block">Submit</button>
                        </div>
                    </div>
                  </div><!-- /.box-footer -->
                  
                </div><!-- /.col-md-8 inside the form -->
                </div><!-- /.row inside the form -->  
                </form>
                 
               </div><!-- /.box -->     
          </div>
              
        </div>   <!-- /.row -->
      </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    
     <!--JS for the add penalty form-->
    <script type="text/javascript">													
		  $("#select2").on("change", function() {
		  $("#subject_id").val( $(this).find("option:selected").val() );
		  $("#demo").val( $(this).find("option:selected").text() );													
		});	
	</script>