IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<!--<div class="card">-->
<div class="body">
<button class="btn btn-raised btn-warning btn-round waves-effect" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">Advance Search</button>
<div class="collapse" id="collapseExample">
<div class="well">
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Advance Search</strong></h2>
</div>
<div class="body">
<?php echo Form::open(['method' => 'GET', 'action' => ['School\Hostel\HosteliteController@create'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-4">
<div class="row clearfix">
<div class="col-sm-3 form-control-label">
<label for="classname">Class</label>
</div>
<div class="col-sm-7">
<div class="form-group">
<div style="border:1px solid #ccc; width:250px; height: 150px; overflow-y: scroll;">
<?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;">
<input type="checkbox" name="classes[]" value="<?php echo e($key); ?>" class="class_ids">
<label><?php echo e($value); ?></label>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="row clearfix">
<div class="col-sm-3 form-control-label">
<label for="classname">Section</label>
</div>
<div class="col-sm-7">
<div class="form-group">
<div id="idSection" style="border:1px solid #ccc; width:250px; height: 150px; overflow-y: scroll;">
</div>
<!--<select name='idSection' id="idSection" class="form-control show-tick ms"></select>-->
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="row clearfix">
<div class="col-sm-3 form-control-label">
<label for="classname">EC No.</label>
</div>
<div class="col-sm-7">
<div class="form-group">
<div id="idStudent" style="border:1px solid #ccc; width:250px; height: 150px; overflow-y: scroll;">
</div>
<!--<select name='idSection' id="idSection" class="form-control show-tick ms"></select>-->
</div>
</div>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php echo Form::submit('SHOW',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--</div>-->
</div>
</div>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<?php echo Form::open(['url' => 'school/hostelites','class' => 'form-horizontal']); ?>
<div class="header">
<h2><strong>Assign Hostel</strong></h2>
<br>
<?php if(count($students)>0): ?>
<?php echo Form::submit('ASSIGN',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<br>
<?php endif; ?>
<?php if($errors->has('student')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('student')); ?></strong>
</label>
<?php endif; ?>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover dataTable js-basic-example">
<thead>
<tr>
<th>Select</th>
<th>EC No.</th>
<th>Name</th>
<th>Father</th>
<th>Class</th>
<th>Section</th>
<th>Select Floor</th>
<th>Select Room</th>
<th>Select Bed</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><input type="checkbox" name="students[<?php echo e($var->idStudent); ?>][idStudent]" value="<?php echo e($var->idStudent); ?>"></td>
<td><?php echo e($var->ecNo); ?></td>
<td><?php echo e($var->firstName); ?> <?php echo e($var->middleName); ?> <?php echo e($var->lastName); ?></td>
<td><?php echo e($var->father_fname); ?> <?php echo e($var->father_lname); ?></td>
<td><?php echo e($var->className); ?></td>
<td><?php echo e($var->sectionName); ?></td>
<!--<td><?php echo e($var->father_mobile); ?></td>-->
<td>
<?php echo Form::select('students['.$var->idStudent.'][idFloor]',$floors,null,['class' => 'form-control show-tick ms','onchange'=>'getRooms(this,'.$var->idStudent.')']); ?>
</td>
<td>
<?php echo Form::select('students['.$var->idStudent.'][idRoom]',[''=>'---Select Room---'],null,['id'=>'room'.$var->idStudent,'class' => 'form-control show-tick ms','onchange'=>'getBeds(this,'.$var->idStudent.')']); ?>
</td>
<td>
<?php echo Form::select('students['.$var->idStudent.'][idBed]',[''=>'---Select Bed---'],null,['id'=>'bed'.$var->idStudent,'class' => 'form-control show-tick ms']); ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
function getRooms(selected,s){
var floorID = selected.value;
if (floorID) {
$.ajax({
url: "<?php echo e(url('/school/floor-rooms')); ?>" + '/' + floorID + "/rooms",
type: "GET",
dataType: "json",
success: function (data) {
$('#room'+s).empty();
$('#room'+s).append('<option value="">--Select--</option>');
$.each(data, function (key, value) {
$('#room'+s).append('<option value="' + key + '">' + value + '</option>');
});
}
});
}
}
function getBeds(selected,s){
var roomID = selected.value;
if (roomID) {
$.ajax({
url: "<?php echo e(url('/school/floor-rooms')); ?>" + '/' + roomID + "/beds",
type: "GET",
dataType: "json",
success: function (data) {
$('#bed'+s).empty();
$('#bed'+s).append('<option value="">--Select--</option>');
$.each(data, function (key, value) {
$('#bed'+s).append('<option value="' + key + '">' + value + '</option>');
});
}
});
}
}
$('.dateselector').datepicker({
autoclose: true,
autoWidth: false,
format: 'dd-mm-yyyy',
endDate: '+0d',
orientation: 'auto'
});
$(document).on('click', '.class_ids', function(){
//var checkAll = this.checked;
var classIds = [];
$("input:checkbox[name='classes[]']:checked").each(function () {
classIds.push($(this).val());
});
if (classIds.length > 0) {
$.ajax({
url: "<?php echo e(url('/school/schclass')); ?>" + '/' + classIds + "/sections",
type: "GET",
dataType: "json",
success:function(data) {
$('#idSection').empty();
$('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><input type="checkbox" class="select-all" id="selectall"><label><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>' + value + '</label></div>');
});
}
});
}
});
$(document).on('click', '.select-all', function(){
var checkAll = this.checked;
if (checkAll === true){
$('.sectionclass').each(function () {
this.checked = checkAll;
});
} else{
$('.sectionclass').each(function () {
this.checked = checkAll;
});
}
});
$(document).on('click', '.sectionclass', function(){
var sectionIds = [];
$("input:checkbox[name='sections[]']:checked").each(function () {
sectionIds.push($(this).val());
});
if (sectionIds.length > 0) {
$.ajax({
url: "<?php echo e(url('/school/sec')); ?>" + '/' + sectionIds + "/students",
type: "GET",
dataType: "json",
success:function(data) {
$('#idStudent').empty();
$('#idStudent').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-allstd" id="selectallstd"></div>');
$.each(data, function(key, value) {
$('#idStudent').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:50px;">' + value + '</label><input type="checkbox" name="students[]" value="' + key + '" class="stdallselect"></div>');
});
}
});
} else{
$('#idStudent').empty();
}
});
$(document).on('click', '.select-allstd', function(){
var checkAllstd = this.checked;
if (checkAllstd === true){
$("input:checkbox[name='students[]']").each(function () {
this.checked = checkAllstd;
});
} else{
$('.stdallselect').each(function () {
this.checked = checkAllstd;
});
}
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -