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

158 lines
7.4 KiB
PHP

<main class="common_margin" id="main">
<div class="main-wrap">
<div class="classes-section">
<div class="class-head">
<h3 class="common-heading">Today's Classes</h3>
<button class="view-more-link"><a href="<?= base_url(); ?>student/my-calendar">View More</a></button>
</div>
<div class="class-section-main">
<?php if (isset($subject_names) && !empty($subject_names)) { ?>
<?php foreach ($subject_names as $key => $value) {?>
<div class="class-tab">
<div class="class-tab-img">
<?php if(array_key_exists("teacher_name",$value)) { ?>
<img src="<?php echo base_url(); ?>assets_admin/images/teacher-profile/<?= $value['teacher_image']?>">
<?php } else { ?>
<img src="<?php echo base_url(); ?>assets_admin/images/teacher-profile/dummy-user.png">
<?php } ?>
</div>
<div class="class-tab-details">
<?php if(array_key_exists("teacher_name",$value)) { ?>
<h4> <?= $value['teacher_name'] ?> </h4>
<?php } else {
echo '<h4>Unknown Teacher</h4>';
} ?>
<p title="math:Trigonometry"><?= $value['subject_name']?></p>
<?php if($value['class_session'] == 'Active') { ?>
<a target="_blank" href="<?= $value['join_link'] ?>" class="join-class-btn">Join Class</a>
<?php } else { ?>
<p><?= $value['class_time'] ?></p>
<?php } ?>
</div>
</div>
<?php } }else{?>
<?php } ?>
</div>
</div>
<div class="todays-assignments-section">
<div class="class-head">
<h3 class="common-heading">Assignments</h3>
<button class="view-more-link"><a href="<?= base_url(); ?>student/my-assignments">View More</a></button>
</div>
<div class="todays-assignments-main">
<!-- <div class="todays-assignments-tab">
<div class="no_assignment_div">
No Assignments
</div>
</div> -->
<?php if(isset($list_assignmet) && !empty($list_assignmet)){
$i=0;
foreach($list_assignmet as $key=>$value){ $i++;
?>
<div class="todays-assignments-tab" style="overflow:hidden;">
<img src="<?php echo base_url(); ?>assets_admin/images/icons/<?php echo $value['subject_icon'] ?>">
<div class="todays-assignments-tab-details" style="overflow:hidden;overflow-wrap: break-word;">
<h4><?php echo $value['subject_name']; ?></h4>
<p class="dash_subj" style="overflow: hidden;overflow-wrap: break-word;"><?php echo substr($value['title'],0,22) ?></p>
<p style="overflow: hidden;overflow-wrap: break-word;"><?php echo substr($value['remark'],0,150)?></p>
</div>
</div>
<?php if ($i == 4) { break; } } }else{?>
<h4 class="text-info mt-2 ml-3">No Assignment</h4>
<?php } ?>
</div>
</div>
<div class="att-grade-section">
<div class="att-section-wrap">
<div class="class-head">
<h3 class="common-heading">Attendance</h3>
<button class="view-more-link"><a href="<?= base_url(); ?>student/attendance">View More</a></button>
</div>
<div class="att-progress-bar">
<?php
if(!empty($attendece_subject_names) && isset($attendece_subject_names)) {
foreach ($attendece_subject_names as $key => $value) {
if($count[$key]['student_id'] == $value['student_id']) {
?>
<div class="att-row">
<div class="att-subject">
<img src="<?= base_url(); ?>assets_admin/images/icons/<?php echo $value['icon'] ?>">
<h5><?php echo $value['subject_name'] ?></h5>
</div>
<div class="att-bar">
<?php if(isset($count[$key])) {
$per = ($count[$key]['present_count']/$count[$key]['total_count'])*100;
?>
<div class="progress" style="width: <?php echo $per.'%'; ?>;"></div>
<?php } ?>
</div>
<div class="att-number">
<?php if(isset($count[$key])) { ?>
<span><?php echo $count[$key]['present_count'] . '/' . $count[$key]['total_count'] ?></span>
<?php } else {
echo '<span>0/0</span>';
} ?>
</div>
</div>
<?php }
}
}?>
</div>
</div>
<div class="grade-section-wrap">
<div class="class-head">
<h3 class="common-heading">Grade</h3>
<button class="view-more-link"><a href="<?= base_url(); ?>student/my-grades">View More</a></button>
</div>
<?php if (isset($student_results) && !empty($student_results)) {
$total_mark = 0;$total_scored_mark=0;
foreach($student_results as $key=>$value){
$total_mark = $total_mark+$value['total_marks'];
$total_scored_mark = $total_scored_mark+$value['get_marks'];
$scored_percentage = round(($total_scored_mark*(100/$total_mark)), 2);
$grade = student_grade_show($scored_percentage);
}
?>
<div class="grade-view">
<div class="grade-wrap">
<img src="<?php echo base_url(); ?>assets_student/images/grade.png">
<div class="grade-achieved">
<?php
echo $grade['grade_name'];
?>
</div>
</div>
<div class="grade-progress-bar">
<p>Congratulations! You're at <?php echo $scored_percentage ?></p>
<div class="att-bar grade-bar">
<div class="progress " style="width: <?php echo $scored_percentage.'%'; ?>;"></div>
</div>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
</main>