File "notice_board.php"
Full Path: /home/ichhrkpd/public_html/idcm_old/application/views/notice_board.php
File size: 4.87 KB
MIME-type: text/html
Charset: utf-8
<?php
require_once('add_edit_common_notice.php');
$sl =1;
$notice_data = isset($notice_data) ? $notice_data : array();
$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>
Notice Board
</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">All Notices</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_common_notice" >
<i class="fa fa-plus"></i> Add Notices
</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>Description</th>
<th nowrap>Date</th>
<th>Download</th>
<th>Type</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($notice_data as $n){
$file_exists = 'N';
$status = '';
$type = '';
if($n->status == 'A'){
$status = "<span class='badge bg-green'>Active</span>";
}else{
$status = "<span class='badge bg-red'>Inactive</span>";
}
if($n->notice_type == 'C'){
$type = "<span class='badge bg-green'>Notice Board</span>";
}elseif($n->notice_type == 'S'){
$type = "<span class='badge bg-red'>Scroll</span>";
}else{
$type = "<span class='badge bg-yellow'>Both</span>";
}
$folder_name = base_url().'files/notice/';
$down_link = $folder_name . $n->id .'.pdf';
$down_file_name = $n->id.'.pdf';
$physical_link = BASEPATH."../files/notice/$down_file_name";
if(file_exists($physical_link)){
$file_exists = 'Y';
}
?>
<tr>
<td><?php echo $sl; ?></td>
<td><?php echo $n->title; ?></td>
<td><?php echo $n->description; ?></td>
<td nowrap><?php echo date('F d, Y', strtotime($n->org_date)); ?></td>
<td>
<?php if($file_exists == 'Y'){ ?>
<a target='_blank' href="<?php echo $down_link; ?>" download><i class="fa fa-download"></i></a>
<?php }?>
</td>
<td><?php echo $type;?></td>
<td><?php echo $status;?></td>
<td nowrap>
<button class="btn-xs btn-success" type="button"
data-notice_id="<?php echo $n->id; ?>"
data-edit= "Y"
data-toggle="modal"
data-target="#add_edit_common_notice" >
<i class="fa fa-edit"></i> Edit
</button>
</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>