File "testimonial.php"
Full Path: /home/ichhrkpd/public_html/idcm_old/application/views/testimonial.php
File size: 7.22 KB
MIME-type: text/html
Charset: utf-8
<?php
$sl =1;
$std_data = isset($std_data) ? $std_data : array();
$msg = isset($msg)?$msg:'';
$msg_type = isset($msg_type)?$msg_type:'';
$this->session->UnsetFlashData();
$examArr = array('1'=>'First Terminal','2'=>'Promotion Test','3'=>'Test Exam');
?>
<!--Delete Publication Modal content-->
<div id="delete_student" class="modal fade" role="dialog">
<div class="modal-dialog">
<!--Delete Publication Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Delete Student's Data</h4>
</div>
<div class="modal-body">
<p>Are you sure to delete this Student's Records?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" name="submit" class="btn btn-danger" id="dconfirm">Delete</button>
</div>
</div>
</div>
</div>
<?php
$count=0;
foreach ($std_data as $s){
$count++;
}
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Testimonial From Database
</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>
<a href="<?php echo base_url().'admin/batches';?>" class="btn-sm btn-info"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back</a>
<span> </span>
<a href="<?php echo base_url().'admin/testimonial_form'?>" class="btn-sm btn-info pull-right"><i class="fa fa-plus" aria-hidden="true"></i> Add Testimonial</a>
</div><!-- /.box-header -->
<div class="box-body"><div class="table-responsive">
<table id="example" class="table table-bordered table-hover">
<thead>
<tr>
<th>Serial No.</th>
<th>Issue Date</th>
<th>Reg. No.</th>
<th>Roll</th>
<th>Name</th>
<th>Father's Name</th>
<th>Mother's Name</th>
<th>HSC GPA</th>
<th>Passing Year</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($std_data as $s){
if($s->status == 'A'){
$status = "<span class='badge bg-green'>Active</span>";
}else{
$status = "<span class='badge bg-red'>Inactive</span>";
}
?>
<tr>
<td><?php echo $s->test_sl; ?></td>
<td><?php echo $s->dois; ?></td>
<td>
<a href='<?php echo base_url().'admin/student_form/batch_id/'.$s->batch_id.'/std_reg/'.$s->std_reg.'/readonly/Y';?>' data-tooltip="tooltip" title="Details.">
<?php echo $s->std_reg; ?>
</a>
</td>
<td><?php echo $s->std_roll; ?></td>
<td><?php echo $s->name; ?></td>
<td><?php echo $s->fname; ?></td>
<td><?php echo $s->mname; ?></td>
<td><?php echo $s->hsc_gpa; ?></td>
<td><?php echo $s->passing_year; ?></td>
<td><?php echo $status; ?></td>
<td nowrap>
<a class="btn-sm btn-success" href='<?php echo base_url().'admin/testimonial_form_edit/serial_no/'. $s->serial_no;?>' data-tooltip="tooltip" title="Details.">
<i class="fa fa-edit"></i> Edit
</a>
<a class="btn-sm btn-info" href='<?php echo base_url().'admin/testimonial_print/std_reg/'. $s->std_reg ;?>' data-tooltip="tooltip" title="Details.">
<i class="fa fa-check-square-o" aria-hidden="true"></i> Print
</a>
<br> <p style='margin-bottom:15px'></p>
<button class="btn-xs btn-danger" type="button"
data-reg_id="<?php echo $s->std_reg; ?>"
data-toggle="modal"
data-target="#delete_student" >
<i class="fa fa-trash"></i> Delete
</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": [],
"pageLength": 500
});
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>
<script>
$('#delete_student').on('shown.bs.modal', function (event) {
var button = $(event.relatedTarget);
var reg_id = button.data('reg_id');
$('#delete_student').find('.modal-footer #dconfirm').on('click', function(){
// alert(reg_id);
$.ajax({
type:"POST",
url:"<?php echo base_url()?>admin/delete_testimonial",
data:{reg_id:reg_id},
dataType:"json",
success:function(response) {
if(response == 's'){
$('#delete_student').modal('hide');
submitUrl = "<?php echo base_url()."admin/testimonial";?>";
window.location = submitUrl;
}else{
alert("Unable to delete.");
}
}
});
});
});
$(document).ready(function() {
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>