IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<!--</div>
<div class="row clearfix">-->
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>List Of Exams</strong></h2>
</div>
<div class="body">
<?php echo Form::open(['method' => 'GET', 'action' => ['Teacher\ViewOnlyController@markList'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-3">
<div class="form-group">
<label for="classname"><strong>Select Class</strong></label><br>
<?php echo Form::select('idClass',[''=>'--Select--']+$classes,null,['class' => 'form-control show-tick ms select2','required'=>'required']); ?>
<?php if($errors->has('idClass')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idClass')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label for="classname"><strong>Select Section</strong></label><br>
<input type="checkbox" id="idSectionAll" name="idSectionAll" value="selectall">
<label for="idSectionAll" style="color:green"> Select All </label><br>
<select name="sections[]" multiple="multiple" id="idSection">
</select>
<?php if($errors->has('idSection')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idSection')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>S. No.</th>
<th>Exam Name</th>
<th>Start Date</th>
<th>End Date</th>
<th>Result Publish Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<th scope="row"><?php echo e($i); ?></th>
<td><?php echo e($value->name); ?></td>
<td><?php echo e(Carbon\Carbon::parse($value->from_date)->format('d-M-Y')); ?></td>
<td><?php echo e(Carbon\Carbon::parse($value->to_date)->format('d-M-Y')); ?></td>
<td><?php echo e(Carbon\Carbon::parse($value->publish_date)->format('d-M-Y H:i:s')); ?></td>
<td class="countdown" data-id="<?php echo e($value->idType); ?>"><?php echo e(Carbon\Carbon::parse($value->publish_date)->format('d-M-Y H:i:s')); ?></td>
</tr>
<?php $i++; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
document.querySelectorAll(".countdown").forEach(cd => {
setupCountdown(cd)
})
function setupCountdown(field){
var countDownDate = new Date(field.innerHTML).getTime();
console.log(countDownDate)
var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display the result
field.innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s ";
// If the count down is finished, write some text
if (distance < 0) {
clearInterval(x);
var sections = <?php echo json_encode(Request::get("idSection")); ?>;
field.innerHTML = '<a href="https://online-login.online/teacher/marks-students/'+field.getAttribute('data-id')+'/view?idClass=<?php echo Request::get("idClass"); ?>&idSection[]='+sections.toString()+'" "target="_blank">View Results</a>';
}
}, 1000);
}
$(document).ready(function() {
$('#idSection').multiselect({
listWidth: 200,
cssEven: false,
cssOdd: false,
});
$('select[name="idClass"]').on('change', function() {
var classID = $(this).val();
$.ajax({
url: "<?php echo e(url('/teacher/assign-class')); ?>"+'/' +classID + "/sections",
type: "GET",
dataType: "json",
success:function(data) {
$('#idSectionAll').prop('checked', false);
$('#idSection_checklist ul').empty();
$.each(data, function(key, value) {
$('#idSection_checklist ul').append('<li tabindex="0" class=""><input type="checkbox" value="'+key+'" name="idSection[]" id="idSection_'+key+'"><label for="idSection_'+key+'" class="leaveRoomForCheckbox">'+value+'</label></li>');
});
}
});
});
$("button[data-id=idSection").hide();
$('#idSectionAll').change(function() {
if(this.checked) {
$("#idSection_checklist").addClass('checklistHighlighted');
$("#idSection_checklist ul").children().addClass('checked');
$("#idSection_checklist ul li input[type=checkbox]").each(function(e) {
$(this).prop('checked', true);
});
}else{
$("#idSection_checklist").removeClass('checklistHighlighted');
$("#idSection_checklist ul").children().removeClass('checked');
$("#idSection_checklist ul li input[type=checkbox]").each(function(e) {
$(this).prop('checked', false);
});
}
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('teachers.teacher_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -