<?php

$page_name="OS_LEVELS";

?>



<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="row justify-content-center container_layout">
        
        <div class="col-md-12 mobile_view">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item">
                            <a href="<?php echo e(route('adminhome')); ?>">
                                <i class="material-icons">home</i>
                            </a>
                        </li>
                        <li class="breadcrumb-item"><a href="<?php echo e(route('organizationalstructure')); ?>">Organizational Structure</a></li>
                        <li class="breadcrumb-item active">
                            <a href="<?php echo e(route('program_management')); ?>"> Program Master</a>
                        </li>
                    </ol>
                </nav>
        </div> 
        
        
        
        
        <div class="col-md-12 text-center">
            
            <?php if($errors->has('success_msg')): ?>
                 <div class="alert alert-success alert-dismissible">
                    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                       <strong><?php echo e($errors->first('success_msg')); ?></strong>
                  </div>               
             <?php endif; ?>
            
            <?php if($errors->has('error_msg')): ?>
                 <div class="alert alert-danger alert-dismissible">
                    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                       <strong><?php echo e($errors->first('error_msg')); ?></strong>
                  </div>
                     
             <?php endif; ?>
        </div>
        
     <?php if($data_create==1): ?>     
        
        <div class="col-md-6 col-md-push-3">
            <div class="card">
                 <form class="form-horizontal" action="<?php echo e(route('level_management')); ?>" method="post">
                    <?php echo e(csrf_field()); ?>

                 <div class="card-header text-center"><b>LEVEL CREATION</b></div>
                 <div class="card-body p35">
                    <div class="form-group">
                      <label for="program_name">Level Code:</label>         
                      <input type="text" class="form-control" id="level_code" placeholder="Enter level code" name="level_code" value="<?php if(old('level_code')){ ?> <?php echo e(old('level_code')); ?> <?php }else{ ?><?php echo e($level_code); ?> <?php } ?>" >
                        
                       <?php if($errors->has('level_code')): ?>
                            <span class="invalid-feedback">
                                <strong><?php echo e($errors->first('level_code')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>
                    <div class="form-group">
                      <label for="program_name">Level Name:</label>         
                      <input type="text" class="form-control" id="name" placeholder="Enter level Name" name="name" value="<?php echo e(old('name')); ?>" >
                        
                       <?php if($errors->has('name')): ?>
                            <span class="invalid-feedback">
                                <strong><?php echo e($errors->first('name')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>
                    <div class="form-group">        
                      <label for="abbreviation">Level:</label>
                      <input type="text" class="form-control" id="level" placeholder="Enter level" name="level" value="<?php echo e(old('level')); ?>">
                      <?php if($errors->has('level')): ?>
                            <span class="invalid-feedback">
                                <strong><?php echo e($errors->first('level')); ?></strong>
                            </span>
                      <?php endif; ?>
                    </div>
<!--                    <div class="form-group">        
                      <label for="adminnistrative_expenditure">Adminnistrative Expenditure:</label>
                      <input type="text" class="form-control" id="adminnistrative_expenditure" placeholder="Enter adminnistrative expenditure" name="adminnistrative_expenditure" value="<?php echo e(old('adminnistrative_expenditure')); ?>">
                       <?php if($errors->has('adminnistrative_expenditure')): ?>
                            <span class="invalid-feedback">
                                <strong><?php echo e($errors->first('adminnistrative_expenditure')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>-->
                </div>
                <div class="card-footer text-center">
                 <button type="submit" class="btn btn-success">SAVE</button>
                 <button type="reset" class="btn btn-warning">RESET</button>
                 <a href="<?php echo e(route('level_management').'?d=display'); ?>" class="btn btn-danger">CANCEL</a>
                </div>
               </form>
            </div>
        </div>
        
   <?php else: ?>
        
        <div class="col-md-12 col-md-push-0  table_scoll">
            
            <div class="col-md-2 mb20" style="padding-left: 0px;">
<!--              <a href="<?php echo e(route('level_management').'?d=add'); ?>" class="btn btn-primary btn-sm" style="margin-top: 8px;"> 
                  <i class="fa fa-plus-square-o" aria-hidden="true"></i> ADD LEVEL
              </a>-->
            </div>    
            
            
            
          <?php if(!empty($data[0])){ 
      
            
            
            ?>
            <table class="table table-striped table-responsive">
                <tr>
                    <th>Sl.No</th>
                    <th>Level</th>
                    <th>Level Code</th>
                    <th>Status</th>
                    <th width="280px">Action</th>
                </tr>
            <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $level): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td><?php echo e(++$i); ?></td>
                <td><?php echo e($level->level); ?></td>
                <td><?php echo e($level->level_code); ?></td>
                <td>
                    <?php if( $level->is_active==1){ ?>
                    <label class="label_success"> 
                        <?php echo 'Active'; ?> 
                    </label>
                 <?php  }else{  ?>
                    <label class="label_danger"> 
                
                     <?php  echo 'Deactive'; ?>
                      </label> 
                    
                   <?php  } ?> 
                </td>
                <td>
<!--                    <a href="<?php echo e(route('level_delete').'?level_id='.$level->id); ?>" class="btn btn-danger level_delete" style="padding: 2px 4px !important;">Delete</a>-->
                
                   <?php if($level->is_active==1){ ?>
                     <label> 
                        <a href="<?php echo e(route('level_status').'?level_id='.$level->level_id); ?>" class="btn btn-danger program_deactivate" style="padding: 2px 4px !important;">Deactivate</a>
                     </label>
                   <?php  }else{  ?>
                     <label > 
                            <a href="<?php echo e(route('level_status').'?level_id='.$level->level_id); ?>" class="btn btn-success level_activate" style="padding: 2px 4px !important;">Activate</a>
                      </label> 
                    
                    <?php  } ?>                   
                
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </table>
            <?php echo $data->render(); ?>

          <?php }else{   ?>
               <div class="col-md-12 text-center data_not_found">
                     No Level Found.
                </div>
          <?php } ?>
        </div>
    <?php endif; ?>
        
    </div>
   
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app2', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>