<?php
require_once('add_edit_batch.php');
$sl =1;
$batch_data = isset($batch_data) ? $batch_data : array();
$examArr = array('1'=>'First Terminal','2'=>'Promotion Test','3'=>'Test Exam');
$msg = isset($msg)?$msg:'';
$msg_type = isset($msg_type)?$msg_type:'';
$this->session->UnsetFlashData();
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
HSC Batches
</h1>
</section>
<section class="content">
<div class="row">
<?php //GPrint($rtype_data);?>
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"></h3>
<button class="btn btn-primary btn-xs pull-right" type="button"
data-notice_id="N"
data-edit= "N"
data-toggle="modal"
data-target="#add_edit_batch" >
<i class="fa fa-plus"></i> Add Batch
</button>
</div><!-- /.box-header -->
<div class="box-body"><div class="table-responsive">
<table id="example" class="table table-bordered table-hover">
<thead>
<tr>
<th>sl#</th>
<th>Title</th>
<th>Year</th>
<th nowrap>Year No.</th>
<th>Group</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($batch_data as $b){
if($b->status == 'A'){
$status = "<span class='badge bg-green'>Active</span>";
}else{
$status = "<span class='badge bg-red'>Inactive</span>";
}
if($b->batch_group == 'A'){
$batch_group = "<span class='badge bg-green'>Science</span>";
}elseif($b->batch_group == 'B'){
$batch_group = "<span class='badge bg-red'>Arts</span>";
}else{
$batch_group = "<span class='badge bg-yellow'>Commerce</span>";
}
$exam_name = 'First Terminal';
if(isset($examArr[$b->year_no])){
$exam_name = $examArr[$b->year_no];
}
?>
<tr>
<td><?php echo $b->batch_id; ?></td>
<td><?php echo $b->batch_title; ?></td>
<td><?php echo $b->batch_year; ?></td>
<td><?php echo $exam_name; ?></td>
<td><?php echo $batch_group; ?></td>
<td><?php echo $status; ?></td>
<td nowrap>
<button class="btn-xs btn-success" type="button"
data-batch_id="<?php echo $b->batch_id; ?>"
data-edit= "Y"
data-toggle="modal"
data-target="#add_edit_batch" >
<i class="fa fa-edit"></i> Edit
</button>
<a class="btn-sm btn-info" href='<?php echo base_url();?>admin/std_list/batch_id/<?php echo $b->batch_id;?>' data-tooltip="tooltip" title="Details.">
<i class="fa fa-users"></i> Student List
</a>
<a class="btn-sm btn-warning" href='<?php echo base_url();?>admin/batch_subjects/batch_id/<?php echo $b->batch_id;?>' data-tooltip="tooltip" title="Details.">
<i class="fa fa-book"></i> Subjects
</a>
</td>
</tr>
<?php $sl++;}?>
</tbody>
</table></div>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col -->
</div><!-- /.row -->
</section><!-- /.content -->
</div>
<script src="<?php echo base_url();?>lib/bootstrap/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url();?>lib/bootstrap/js/dataTables.bootstrap.min.js"></script>
<script>
$(document).ready(function() {
$('#example').dataTable({
/* Disable initial sort */
"aaSorting": []
});
var toast_msg = '<?php echo $msg;?>';
var msg_type = '<?php echo $msg_type;?>';
if(toast_msg !== null && toast_msg !== '') {
var shortCutFunction = msg_type;
toastr.options = {
positionClass: 'toast-bottom-right'
};
var $toast = toastr[shortCutFunction](toast_msg);
}
} );
</script>