<?php

$page_name="OS_PROGRAMS";

?>



<?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 mt30">
            <div class="card">
                <form class="form-horizontal" action="<?php echo e(route('program_management')); ?>" method="post">
                    <?php echo e(csrf_field()); ?>

                 <div class="card-header text-center"><b>PROGRAM CREATION</b></div>
                 <div class="card-body p35">
                    <div class="form-group">
                      <label for="program_name">Program Name:</label>         
                      <input type="text" class="form-control" id="program_name" placeholder="Enter program Name" name="program_name" value="<?php echo e(old('program_name')); ?>" >
                        
                       <?php if($errors->has('program_name')): ?>
                            <span class="invalid-feedback">
                                <strong><?php echo e($errors->first('program_name')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>

                    <div class="form-group">        
                      <label for="abbreviation">Abbreviation:</label>
                      <input type="text" class="form-control" id="abbreviation" placeholder="Enter abbreviation" name="abbreviation">
                    </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 btn-sm">SAVE</button>
                 <button type="reset" class="btn btn-warning btn-sm">RESET</button>
                 <a href="<?php echo e(route('program_management').'?d=display'); ?>" class="btn btn-danger btn-sm">CANCEL</a>
                </div>
               </form>

            </div>
        </div>
        
   <?php else: ?>     
        <div class="col-md-12 col-md-push-0 table_scoll" >
            
            <div class="col-md-3 mb20" style="padding-left: 0px;">
              <a href="<?php echo e(route('program_management').'?d=add'); ?>" class="btn btn-primary btn-sm" > <i class="fa fa-plus-square-o" aria-hidden="true"></i> ADD PROGRAM</a>
            </div>  
            
          <?php if(!empty($data[0])){ 
      
            $i=0;
            
            ?>
            <table class="table table-striped table-responsive">
              <thead>
                <tr>
                    <th>SL.No</th>
                    <!--<th>Program Code</th>-->
                    <th>Program Name</th>
                    <th>Program Abbreviation</th>
                    <th>Status</th>
                    <th width="280px">Action</th>
                </tr>
              </thead>
              <tbody>
                <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $program): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <tr>
                    <td><?php echo e(++$i); ?></td>
                  <!--  <td><?php echo e($program->program_code); ?></td>-->
                    <td><?php echo e($program->program_name); ?></td>
                    <td><?php echo e($program->program_abbreviation); ?></td>
                    <td><?php if($program->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('program_delete').'?programe_id='.$program->program_id); ?>" class="btn btn-danger program_delete" style="padding: 2px 4px !important;">
                            <i class="fa fa-trash" aria-hidden="true"></i>
                        </a>-->

                       <?php if($program->is_active==1){ ?>
                         <label> 
                            <a href="<?php echo e(route('program_status').'?programe_id='.$program->program_id); ?>" class="btn btn-danger level_deactivate" style="padding: 2px 4px !important;">Deactivate</a>
                         </label>
                       <?php  }else{  ?>
                         <label > 
                                <a href="<?php echo e(route('program_status').'?programe_id='.$program->program_id); ?>" class="btn btn-success program_activate" style="padding: 2px 4px !important;">Activate</a>
                          </label> 

                        <?php  } ?>  

                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
          
          <?php }else{   ?>
                <div class="col-md-12 text-center data_not_found">
                     No Program 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(); ?>