Preview: study_material.php
Size: 3.50 KB
/home/jambtst2015/public_html/app/application/views/backend/teacher/study_material.php
<button onclick="showAjaxModal('<?php echo base_url();?>index.php?modal/popup/modal_study_material_add');"
class="btn btn-primary pull-right btn-raised">
<?php echo get_phrase('add_study_material'); ?>
</button>
<div style="clear:both;"></div>
<br>
<table class="table table-bordered table-striped datatable" id="table-2">
<thead>
<tr>
<th>#</th>
<th><?php echo get_phrase('date');?></th>
<th><?php echo get_phrase('title');?></th>
<th><?php echo get_phrase('description');?></th>
<th><?php echo get_phrase('class');?></th>
<th><?php echo get_phrase('download');?></th>
<th><?php echo get_phrase('options');?></th>
</tr>
</thead>
<tbody>
<?php
$count = 1;
foreach ($study_material_info as $row) { ?>
<tr>
<td><?php echo $count++; ?></td>
<td><?php echo date("d M, Y", $row['timestamp']); ?></td>
<td><?php echo $row['title']?></td>
<td><?php echo $row['description']?></td>
<td>
<?php $name = $this->db->get_where('class' , array('class_id' => $row['class_id'] ))->row()->name;
echo $name;?>
</td>
<td>
<a href="<?php echo base_url().'uploads/document/'.$row['file_name']; ?>" class="btn btn-blue btn-icon icon-left">
<i class="entypo-download"></i>
<?php echo get_phrase('download');?>
</a>
</td>
<td>
<a onclick="showAjaxModal('<?php echo base_url();?>index.php?modal/popup/modal_study_material_edit/<?php echo $row['document_id']?>');"
class="btn btn-default btn-sm btn-icon icon-left">
<i class="entypo-pencil"></i>
<?php echo get_phrase('edit');?>
</a>
<a href="<?php echo base_url();?>index.php?teacher/study_material/delete/<?php echo $row['document_id']?>"
class="btn btn-danger btn-sm btn-icon icon-left" onclick="return confirm('Are you sure to delete?');">
<i class="entypo-cancel"></i>
<?php echo get_phrase('delete');?>
</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<script type="text/javascript">
jQuery(window).load(function ()
{
var $ = jQuery;
$("#table-2").dataTable({
"sPaginationType": "bootstrap",
"sDom": "<'row'<'col-xs-3 col-left'l><'col-xs-9 col-right'<'export-data'T>f>r>t<'row'<'col-xs-3 col-left'i><'col-xs-9 col-right'p>>"
});
$(".dataTables_wrapper select").select2({
minimumResultsForSearch: -1
});
// Highlighted rows
$("#table-2 tbody input[type=checkbox]").each(function (i, el)
{
var $this = $(el),
$p = $this.closest('tr');
$(el).on('change', function ()
{
var is_checked = $this.is(':checked');
$p[is_checked ? 'addClass' : 'removeClass']('highlight');
});
});
// Replace Checboxes
$(".pagination a").click(function (ev)
{
replaceCheckboxes();
});
});
</script>
Directory Contents
Dirs: 0 × Files: 34