BBnepal-Accounts/application/views/admin/getmarkscardreports2.php
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

328 lines
17 KiB
PHP

<style>
#tbl1 tr th {
font-weight: 600;
font-size: 12px;
}
</style>
<div class="wraper responsive-width">
<main class="" id="main">
<!----admin template section---->
<div class="admin_tempblock">
<div class="admin_tempsec">
<div class="admin_sec">
<div class="">
<div class=" subject_l_full_width ">
<div class="subject_lsec">
<!-- <button style="font-size: 14px;padding: 6px 25px;" class="subject_addbtn ">Back</button> -->
<div class="subject_lhead"><?php echo $title; ?>
</div>
<?php //dd($student_results);
// echo '<pre>';
// print_r($student_results);
?>
<table id="tbl1" style='width:100%;' class="table table-bordered table-striped text-center">
<thead>
<tr>
<!-- <th rowspan="2">SNo</th> -->
<th rowspan="2">Student Name</th>
<th rowspan="2">Roll No </th>
<?php
// if (count($theSubjects) > 0) {
// foreach ($theSubjects as $cs_value) {
//
?>
<!-- // <th colspan="2"><?= $cs_value['subject_name'] ?></th> -->
<?php
// }
// }
?>
<?php if (count($theSubjects) > 0) {
// echo '<pre>';
// print_r($theSubjects);
foreach ($theSubjects as $cs_value) {
?>
<th>
<?php
// echo $cs_value['subject_name'] . ' (Obt. Mark)';
?>
</th>
<th>
<?php
// echo $cs_value['subject_name'] . ' (Grade)';
?>
</th>
<?php
}
}
?>
<th rowspan="2">Total Marks</th>
<th rowspan="2">GPA</th>
<th rowspan="2">Final Grade</th>
<th rowspan="2">Remarks</th>
<th rowspan="2">Percentage (%)</th>
</tr>
<tr>
<?php if (count($theSubjects) > 0) {
// echo '<pre>';
// print_r($theSubjects);
foreach ($theSubjects as $cs_value) {
?>
<!--<th>Th. Mark </th>-->
<!--<th>Th. Grade</th>-->
<!--<th>Pr. Marks</th>-->
<!--<th>Pr. Grade</th>-->
<!-- <th> -->
<!-- <label style="font-weight: 500; font-size: 12px;"> -->
<!-- <?php echo 'Total Mark (' . $cs_value['subject_name'] . ')'; ?> -->
<!-- </label> -->
<!-- </th> -->
<!-- <th> -->
<!-- <label style="font-weight: 500; font-size: 12px;"> -->
<!-- <?php echo 'Subject Grade (' . $cs_value['subject_name'] . ')'; ?> -->
<!-- </label> -->
<!-- </th> -->
<th>
<?php
echo $cs_value['subject_name'] . ' (Obt. Mark)';
?>
</th>
<th>
<?php echo $cs_value['subject_name'] . ' (Grade)'; ?>
</th>
<?php
}
}
?>
</tr>
</thead>
<tbody>
<?php
$total_subjects = (count($theSubjects) * 6);
$sno = 1;
if (count($student_results) > 0) {
foreach ($student_results as $studkey => $student) {
?>
<!-- <th><?= $sno; ?></th> -->
<th><?= $student['student_name'] ?></th>
<th><?= $student['roll_no'] ?></th>
<?php
$theFinalresult = array();
// echo'<pre>;
// print_r($theFinalresult);;
foreach ($theSubjects as $csk => $csv) {
// echo'<pre>';
// print_r($student['subject_results'][$csv['subject_id']['total_full_marks']]);
if (isset($student['subject_results']) && count($student['subject_results']) > 0) {
if (isset($student['subject_results'][$csv['subject_id']]['sub_id']) && ($student['subject_results'][$csv['subject_id']]['sub_id'] == $csv['subject_id'])) {
?>
<td>
<?php echo (isset($student['subject_results'][$csv['subject_id']]['total_obt_marks']) && !empty($student['subject_results'][$csv['subject_id']]['total_obt_marks'])) ? $student['subject_results'][$csv['subject_id']]['total_obt_marks'] : ''; ?>
</td>
<td>
<?php echo (isset($student['subject_results'][$csv['subject_id']]['total_obt_grade']) && !empty($student['subject_results'][$csv['subject_id']]['total_obt_grade'])) ? $student['subject_results'][$csv['subject_id']]['total_obt_grade'] : ''; ?>
</td>
<?php
$theFinalresult[] = array(
'exam_total_obt_marks' => (isset($student['subject_results'][$csv['subject_id']]['exam_total_obt_marks']) && !empty($student['subject_results'][$csv['subject_id']]['exam_total_obt_marks'])) ? $student['subject_results'][$csv['subject_id']]['exam_total_obt_marks'] : '',
'exam_gpa' => (isset($student['subject_results'][$csv['subject_id']]['gpa']) && !empty($student['subject_results'][$csv['subject_id']]['gpa'])) ? $student['subject_results'][$csv['subject_id']]['gpa'] : '',
'remarks_gpa' => (isset($student['subject_results'][$csv['subject_id']]['remarks_gpa']) && !empty($student['subject_results'][$csv['subject_id']]['remarks_gpa'])) ? $student['subject_results'][$csv['subject_id']]['remarks_gpa'] : '',
'exams_total_percentage' => (isset($student['subject_results'][$csv['subject_id']]['exams_total_percentage']) && !empty($student['subject_results'][$csv['subject_id']]['exams_total_percentage'])) ? $student['subject_results'][$csv['subject_id']]['exams_total_percentage'] : '',
'exam_total_obt_grade' => (isset($student['subject_results'][$csv['subject_id']]['total_obt_grade']) && !empty($student['subject_results'][$csv['subject_id']]['total_obt_grade'])) ? $student['subject_results'][$csv['subject_id']]['total_obt_grade'] : '',
);
} else {
echo "
<td><b style='color:red;'>NA</b></td>
<td><b style='color:red;'>NA</b></td>";
}
} else { ?>
<td>-</td>
<td>-</td>
<?php
}
?>
<?php }
if (count($theFinalresult) > 0) {
?>
<td><?php echo (isset($theFinalresult[0]['exam_total_obt_marks']) && !empty($theFinalresult[0]['exam_total_obt_marks'])) ? $theFinalresult[0]['exam_total_obt_marks'] : ''; ?></td>
<td><?php echo (isset($theFinalresult[0]['exam_gpa']) && !empty($theFinalresult[0]['exam_gpa'])) ? $theFinalresult[0]['exam_gpa'] : ''; ?></td>
<td><?php echo (isset($theFinalresult[0]['exam_total_obt_grade']) && !empty($theFinalresult[0]['exam_total_obt_grade'])) ? $theFinalresult[0]['exam_total_obt_grade'] : ''; ?></td>
<td><?php echo (isset($theFinalresult[0]['remarks_gpa']) && !empty($theFinalresult[0]['remarks_gpa'])) ? $theFinalresult[0]['remarks_gpa'] : ''; ?></td>
<td><?php echo (isset($theFinalresult[0]['exams_total_percentage']) && !empty($theFinalresult[0]['exams_total_percentage'])) ? $theFinalresult[0]['exams_total_percentage'] : ''; ?></td>
</tr>
<?php
}
$sno++;
}
} ?>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<?php
$theExportHeader = 'The Markscard Reports';
if (isset($school_info) && !empty($school_info)) {
$theExportHeader = $school_info['school_name'];
}
?>
</div>
<script>
$(document).ready(function() {
var jsTheExportHeader = '<?php echo $theExportHeader; ?>';
$('#tbl1').DataTable({
"lengthMenu": [
[100, 125, 150, -1],
[100, 125, 150, "All"]
],
fixedColumns: {
left: 2,
},
dom: 'lBfrtip',
buttons: [{
extend: 'pdfHtml5',
title: 'Student List',
orientation: 'landscape',
pageSize: 'LEGAL',
exportOptions: {
columns: "thead th:not(.noExport)",
rows: function(indx, rowData, domElement) {
return $(domElement).css("display") != "none";
}
}
},
// {
// extend: 'colvis',
// }
{
extend: 'excelHtml5',
header: true,
footer: true,
title: jsTheExportHeader,
exportOptions: {
columns: "thead th:not(.noExport)",
rows: function(indx, rowData, domElement) {
return $(domElement).css("display") != "none";
}
},
customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('row c[r^="C"]', sheet).attr('s', '2');
}
},
]
});
});
///
// $('#example').DataTable({
// searching: false, paging: false, info: false, ordering: false,
// dom: 'Bfrtip',
// buttons: [
// {
// extend: 'excelHtml5',
// exportOptions: {
// columns: "thead th:not(.noExport)",
// rows: function (indx, rowData, domElement) {
// return $(domElement).css("display") != "none";
// }
// },
// customize: function (xlsx) {
// var sheet = xlsx.xl.worksheets['sheet1.xml'];
// $('row c[r^="C"]', sheet).attr('s', '2');
// }
// },
// {
// extend: 'csvHtml5',
// exportOptions: {
// columns: "thead th:not(.noExport)",
// rows: function (indx, rowData, domElement) {
// return $(domElement).css("display") != "none";
// }
// }
// },
// {
// orientation : 'landscape',
// pageSize: 'A3',
// extend: 'pdfHtml5',
// exportOptions: {
// columns: "thead th:not(.noExport)",
// rows: function (indx, rowData, domElement) {
// return $(domElement).css("display") != "none";
// }
// }
// ,
// customize: function (doc) {
// doc.defaultStyle.alignment = 'center';
// doc.content[1].table.widths = Array(doc.content[1].table.body[0].length + 1).join('*').split('');
// var tblBody = doc.content[1].table.body;
// doc.content[1].layout = {
// hLineWidth: function (i, node) {
// return (i === 0 || i === node.table.body.length) ? 2 : 1;
// },
// };
// },
// }, {
// extend: 'print',
// }
// ]
// });
</script>