IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>View </strong>Uploaded Marks</h2>
</div>
<div class="card-body">
<?php echo Form::open(['method' => 'GET', 'action' => ['School\Exam\ExamPrintMasterController@create'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-2 form-control-label">
<label for="classname">Class</label>
</div>
<div class="col-sm-4">
<div class="form-group">
<?php echo Form::select('idClass',$classes,null,['class' => 'form-control select2 show-tick ms','required'=>'required']); ?>
</div>
</div>
<div class="col-sm-2 form-control-label">
<label for="classname">Section</label>
</div>
<div class="col-sm-4">
<div class="form-group">
<div id="idSection" style="border:1px solid #ccc; width:250px; height: 150px; overflow-y: scroll;">
</div>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-6">
<?php echo Form::submit('View',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<a href="/school/exam-print/master/create" class="btn btn-warning btn-round waves-effect">Reset Filter</a>
<?php echo Form::close(); ?>
</div>
</div>
<table class="table table-hover table-bordered" id="studentTable" style="overflow: auto;">
<thead>
<th>EC No</th>
<th>Student Name</th>
<th>Class</th>
<th>Section</th>
<th>Action</th>
</thead>
<tbody>
<?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php
$marks = \App\MarksheetRoyal::where('idStudent',$var->idStudent)->where('idFinancialYear',$var->idFinancialYear)->count();
$canPrint = "N";
if($marks > 0 ) $canPrint = "P";
if(in_array($var->idClass,[232,233])){
if($marks >= 7 ) $canPrint = "Y";
}else if(in_array($var->idClass,[234,235,236,237,238,239])){
if($marks >= 10 ) $canPrint = "Y";
}else if(in_array($var->idClass,[240])){
if($marks >= 8 ) $canPrint = "Y";
}else if(in_array($var->idClass,[241])){
if($marks >= 8 ) $canPrint = "Y";
}
?>
<tr>
<td><?php echo e($var->ecNo); ?></td>
<td><?php echo e($var->name); ?></td>
<td><?php echo e($var->className); ?></td>
<td><?php echo e($var->sectionName); ?></td>
<td><?php if($canPrint == "Y"): ?>
<input type="text" id="roll_no_<?php echo e($var->idStudent); ?>" placeholder="Roll No"/><br>
<a target="_blank" href="#" onclick="redirect(<?php echo e($var->idStudent); ?>)" class="btn btn-success btn-round waves-effect">Print Marksheet</a> <?php else: ?>
<?php if($canPrint == "P"): ?> Partial Data Uploaded <?php else: ?> Data not uploaded <?php endif; ?> <?php endif; ?></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).ready(function() {
$('#studentTable').DataTable({
responsive: true,
});
$('select[name="idClass"]').on('change', function() {
var classID = $(this).val();
if(classID) {
$.ajax({
url: "<?php echo e(url('/school/class')); ?>"+'/' +classID + "/sections",
type: "GET",
dataType: "json",
success:function(data) {
$('#idSection').empty();
$('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><input type="checkbox" class="select-all" id="selectall"><strong>Select All</label></strong></div>');
$.each(data, function(key, value) {
$('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="sections[]" value="'+key+'" class="sectionclass"><label style="margin-right:100px;">'+value+'</label></div>');
});
}
});
$.ajax({
url: "<?php echo e(url('/school/class')); ?>"+'/' +classID + "/subjects",
type: "GET",
dataType: "json",
success:function(data) {
$('#idSubject').empty();
$('#idSubject').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><input type="checkbox" class="sub-all" id="suball"><strong>Select All</label></strong></div>');
$.each(data, function(key, value) {
$('#idSubject').append('<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="subjects[]" value="'+key+'" class="subclass"><label style="margin-right:100px;">'+value+'</label></div>');
});
}
});
}else{
$('select[name="idSection"]').empty();
$('select[name="idSubject"]').empty();
}
});
});
$(document).on('click', '.sub-all', function(){
var checkAllstd = this.checked;
if(checkAllstd === true){
$("input:checkbox[name='subjects[]']").each(function () {
this.checked = checkAllstd;
});
}else{
$('.subclass').each(function () {
this.checked = checkAllstd;
});
}
});
$(document).on('click', '.select-all', function(){
var checkAllstd = this.checked;
if(checkAllstd === true){
$("input:checkbox[name='sections[]']").each(function () {
this.checked = checkAllstd;
});
}else{
$('.sectionclass').each(function () {
this.checked = checkAllstd;
});
}
});
function redirect(id){
window.open('/school/exam-print/master/'+id+'?rollNo='+$('#roll_no_'+id).val(), '_blank');
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -