IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-lg-5 col-md-5 col-sm-5">
<div class="card">
<div class="header">
<h2><strong>Student Document</strong></h2>
</div>
<div class="body">
<?php echo Form::open(['url' => 'school/stddocs', 'class' => 'form-horizontal','files'=>true]); ?>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">Select Class</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::select('idClass',$classes,null,['class' => 'form-control show-tick ms select2']); ?>
<?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>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">Select Section</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<select name='idSection' class="form-control show-tick ms"></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>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">Enrollement No</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<select name='idStudent' class="form-control show-tick ms select2"></select>
<?php if($errors->has('idStudent')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idStudent')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<!-- <div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">Student Name</label>
</div>
<div class="col-sm-6">
<p class="form-control-static" id="stdName"></p>
</div>
</div>-->
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">Document Type</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::select('idDocType',$doctypes,null,['class' => 'form-control show-tick ms']); ?>
<?php if($errors->has('idDocType')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idDocType')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">Upload</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::file('document',null,['class' => 'form-control']); ?>
<?php if($errors->has('document')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('document')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-7">
<div class="card">
<div class="header">
<h2><strong>Student Documents</strong></h2>
</div>
<div class="body table-responsive">
<?php echo Form::open(['method' => 'GET', 'action' => ['School\StudentController@getStudentDocForm'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-3 form-control-label">
<label for="classname">Financial Year</label>
</div>
<div class="col-sm-5">
<div class="form-group">
<?php echo Form::select('idFinancialYear',fys(),null,['class' => 'form-control show-tick ms']); ?>
</div>
</div>
<div class="col-sm-2">
<?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
</div>
</div>
<?php echo Form::close(); ?>
<br>
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>S. No.</th>
<th>EC No.</th>
<th>Name</th>
<th>Class</th>
<th>Section</th>
<th>Document Type</th>
<th>Uploaded At</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $stddocs; $__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->ecNo); ?></td>
<td><?php echo e($value->firstName); ?> <?php echo e($value->middleName); ?> <?php echo e($value->lastName); ?></td>
<td><?php echo e($value->className); ?></td>
<td><?php echo e($value->sectionName); ?></td>
<td><?php echo e($value->documentType); ?></td>
<td><?php echo e($value->updated_at); ?></td>
<td>
<a href="<?php echo e(url('school/stddoc/'.$value->idStdDocument.'/view')); ?>" target="_blank" class="btn btn-sm btn-info">View</a>
<a href="#" class="btn btn-sm btn-danger js-sweetalert" data-id="<?php echo e($value->idStdDocument); ?>">Delete</a>
</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).ready(function() {
$('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) {
$('select[name="idSection"]').empty();
$('select[name="idSection"]').append('<option value="">--- Select ---</option>');
$.each(data, function(key, value) {
$('select[name="idSection"]').append('<option value="'+ key +'">'+ value +'</option>');
});
}
});
}else{
$('select[name="idSection"]').empty();
}
});
$('select[name="idSection"]').on('change', function() {
var sectionID = $(this).val();
if(sectionID) {
$.ajax({
url: "<?php echo e(url('/school/section')); ?>"+'/' +sectionID + "/students",
type: "GET",
dataType: "json",
success:function(data) {
$('select[name="idStudent"]').empty();
$('select[name="idStudent"]').append('<option value="">--- Select ---</option>');
$.each(data, function(key, value) {
$('select[name="idStudent"]').append('<option value="'+ key +'">'+ value +'</option>');
});
}
});
}else{
$('select[name="idSection"]').empty();
}
});
$('select[name="idStudent"]').on('change', function() {
var studentID = $(this).val();
if(studentID) {
$.ajax({
url: "<?php echo e(url('/school/students')); ?>"+'/' +studentID,
type: "GET",
dataType: "json",
success:function(data) {
$.each(data, function(key, value) {
$('#stdName').append(value + " ");
});
}
});
}else{
$('select[name="idSection"]').empty();
}
});
});
$(document).on('click', '.js-sweetalert', function (e) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
e.preventDefault();
var id = $(this).data('id');
swal({
title: "Are you sure?",
text: "Are You sure you want to delete this document!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: true
},
function() {
// console.log('here');
$.ajax({
type: "POST",
url: "<?php echo e(url('/school/stddoc/')); ?>" +"/"+id + "/delete",
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Document has been successfully deleted",
type: "success"
},function() {
location.reload();
});
})
.error(function(data) {
swal("Oops", "We couldn't connect to the server!", "error");
});
return false;
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -