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

55 lines
2.3 KiB
PHP

<main class="common_margin" id="main">
<div class="main-wrap">
<div class="syllabus-wrap">
<div class="syllabus-head">
<h3 class="common-heading">My Classes</h3>
</div>
<div class="check-syllabus-btn ">
<a class="check-syllabus" href="<?php echo base_url(); ?>teacher/view-syllabus">
<img src="<?php echo base_url(); ?>assets_teacher/images/syllabus.png">
<h5>Check Syllabus </h5>
</a>
</div>
<div class="syllabus-main attendance-main">
<?php if (!empty($subjects) && isset($subjects)) {
foreach ($subjects as $value) {
$pday = date("l");
$sessionDay = $value['day'];
$s = $value['start'];
// $s = "15:03";
$p = date("H:i");
$mins = (strtotime($s) - strtotime($p)) / 60;
$duration = $value['duration'];
$end = date('H:i', strtotime($s) + ($duration * 60));
$now = new Datetime("now");
$begintime = new DateTime($s);
$endtime = new DateTime($end);
?>
<div class="start-class-wrap">
<div class="syllabus-tab">
<div class="syllabus-image"><img src="<?= base_url(); ?>assets_admin/images/icons/<?= $value['subject_icon'] ?>"></div>
<h4><?= $value['subject_name'] ?></h4>
<h5><?= $value['classroom_name'] ?></h5>
<?php if (strtolower($pday) === strtolower($sessionDay) && ($now >= $begintime && $now <= $endtime)) { ?>
<div class="start-btn-wrap-st">
<a class="join-class-btn" href="<?= $value['start_link'] ?>" target="_blank">Start</a>
</div>
<?php } else { ?>
<p class="class_time"><?= date('h:i a', strtotime($s)) ?></p>
<?php } ?>
</div>
</div>
<?php }
} else { ?>
<div class="upcoming-tab">No Class scheduled </div>
<?php } ?>
</div>
</div>
</main>
<script>
$(document).ready(function() {
$(".list").removeClass("active");
$(".list-item1").addClass("active");
});
</script>