IMMREX7
@extends('schools.school_layout')
@section('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">
{!! 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">
{!! 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">
{!! 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>
{!! 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>
@foreach ($students as $var)
@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";
}
@endphp
<tr>
<td>{{$var->ecNo}}</td>
<td>{{$var->name}}</td>
<td>{{$var->className}}</td>
<td>{{$var->sectionName}}</td>
<td>@if($canPrint == "Y")
<input type="text" id="roll_no_{{$var->idStudent}}" placeholder="Roll No"/><br>
<a target="_blank" href="#" onclick="redirect({{$var->idStudent}})" class="btn btn-success btn-round waves-effect">Print Marksheet</a> @else
@if($canPrint == "P") Partial Data Uploaded @else Data not uploaded @endif @endif</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@stop
@section('script')
<script>
$(document).ready(function() {
$('#studentTable').DataTable({
responsive: true,
});
$('select[name="idClass"]').on('change', function() {
var classID = $(this).val();
if(classID) {
$.ajax({
url: "{{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: "{{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>
@stop
Copyright © 2021 -