81 lines
2.9 KiB
PHP
81 lines
2.9 KiB
PHP
|
<main class="common_margin" id="main">
|
||
|
<div class="main-wrap">
|
||
|
<div class="calendar-section">
|
||
|
<div class="calendar-section-wrap">
|
||
|
<div class="calendar-main">
|
||
|
<div class="class-head">
|
||
|
<h3 class="common-heading">Calendar</h3>
|
||
|
</div>
|
||
|
<div class="calendar-cover" id="calendar">
|
||
|
<div class="calendar-date-year">
|
||
|
<img src="<?= base_url(); ?>assets_student/images/calendar2.png">
|
||
|
</div>
|
||
|
<div id="Datepicker1" onchange = "showsessions($(this).datepicker().val())"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="upcoming-section-wrap">
|
||
|
<div class="class-head">
|
||
|
<h3 class="common-heading"><span><?php echo date("d/m/Y"); ?></span></h3>
|
||
|
</div>
|
||
|
<div class="upcoming-cover">
|
||
|
<?php if($student_sess != ''){ foreach($student_sess as $c) { ?>
|
||
|
<div class="upcoming-tab">
|
||
|
<div class="upcoming-sub-img"><img src="<?= base_url(); ?>assets_admin/images/icons/<?= $c['subject_icon']; ?>"></div>
|
||
|
<div class="upcoming-subject">
|
||
|
<h4><?php echo $c['subject_name']; ?></h4>
|
||
|
<p>By:<span> <?php echo $c['teacher_name']; ?></span></p>
|
||
|
</div>
|
||
|
<?php
|
||
|
$pday = date("l");
|
||
|
$sessionDay = $c['day'];
|
||
|
|
||
|
$s = $c['start'];
|
||
|
// $s = "15:03";
|
||
|
$p = date("H:i");
|
||
|
|
||
|
$mins = (strtotime($s)-strtotime($p)) / 60;
|
||
|
|
||
|
$duration = $c['duration'];
|
||
|
$end = date('H:i', strtotime($s) + ($duration * 60));
|
||
|
|
||
|
?>
|
||
|
<div class="upcoming-date">
|
||
|
<?php if(strtolower($pday) === strtolower($sessionDay) && abs($mins) <= 10)
|
||
|
{ ?>
|
||
|
<div class="my-class-btn-wrap"> <a href = "<?php echo $c['join_link']; ?>"> <button class="join-class-btn">Join Class</button></a></div>
|
||
|
<?php } else { ?>
|
||
|
<span><?php echo ucfirst($c['day']).', '.date('h:i a',strtotime($c['start'])); ?></span>
|
||
|
<?php } ?>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php }
|
||
|
} else { ?>
|
||
|
<div class="upcoming-tab">No Sessions scheduled </div>
|
||
|
<?php } ?>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</main>
|
||
|
|
||
|
<script>
|
||
|
function showsessions(dateval){
|
||
|
// alert(dateval);
|
||
|
$.ajax({
|
||
|
type : 'POST',
|
||
|
url : "<?= base_url(); ?>Student/calenderSessions",
|
||
|
data:{dateval:dateval},
|
||
|
success:function(resposne){
|
||
|
$('.upcoming-section-wrap').html(resposne);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
</script>
|