File "testimonial_others-20260225114227.php"
Full Path: /home/ichhrkpd/public_html/idcm_old/application/views/testimonial_others-20260225114227.php
File size: 7.46 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 Non-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>
<form id="contactForm" action="<?php echo base_url()."admin/testimonial_others_form"?>" class="contact-form pull-right" method="post" role="form" >
<select id="std_class" name="std_class" required>
<option value="" selected="selected">Select Class</option>
</select>
<select id="std_group" name="std_group" required>
<option value="" selected="selected">Please select Group</option>
</select>
<button type="submit" name="submit" id="submit" class="btn btn-success" id="confirm">Add Testimonial</button>
</form>
</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>Class</th>
<th>Divison</th>
<th>GPA</th>
<th>Passing Year</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($std_data as $s){
?>
<tr>
<td><?php echo $s->test_sl; ?></td>
<td><?php echo $s->dois; ?></td>
<td><?php echo $s->std_reg; ?></td>
<td><?php echo $s->std_roll; ?></td>
<td><?php echo $s->name; ?></td>
<td><?php echo $s->std_class; ?></td>
<td><?php echo $s->std_division; ?></td>
<td><?php echo $s->gpa; ?></td>
<td><?php echo $s->passing_year; ?></td>
<td nowrap>
<a class="btn-sm btn-success" href='<?php echo base_url().'admin/testimonial_form_others_edit/id/'. $s->id;?>' 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_others/test_sl/'. $s->test_sl ;?>' 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_others",
data:{reg_id:reg_id},
dataType:"json",
success:function(response) {
if(response == 's'){
$('#delete_student').modal('hide');
submitUrl = "<?php echo base_url()."admin/testimonial_others";?>";
window.location = submitUrl;
}else{
alert("Unable to delete.");
}
}
});
});
});
</script>
<script>
let data = [{
item: 'HSC',
subitems: ['Science', 'Arts', 'Commerce']
},
{
item: 'Degree',
subitems: ['BA', 'BSc', 'BBS', 'BSS']
},
];
window.onload = function() {
var itemSel = document.getElementById("std_class");
var subitemSel = document.getElementById("std_group");
for (var x in data) {
itemSel.options[itemSel.options.length] = new Option(data[x].item, x);
}
itemSel.onchange = function() {
//empty
subitemSel.length = 1;
//display correct values
for (var y of data[this.value].subitems) {
subitemSel.options[subitemSel.options.length] = new Option(y, y);
}
}
}
</script>