IMMREX7
@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Leave Management</strong></h2>
</div>
<div class="body table-responsive">
{!! Form::open(['method' => 'GET', 'action' => ['School\Hostel\HosteliteLeaveController@index'], 'class' => 'form-horizontal']) !!}
<div class="row clearfix">
<div class="col-sm-2">
</div>
<div class="col-sm-2 form-control-label">
<label for="classname">Financial Year</label>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::select('idFinancialYear',fys(),null,['class' => 'form-control show-tick ms']) !!}
</div>
</div>
<div class="col-sm-2">
{!! Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
</div>
</div>
{!! Form::close() !!}
<br>
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>S.NO.</th>
<th>Name</th>
<th>EC No.</th>
<th>Form Date</th>
<th>To Date</th>
<th>Reason</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
@foreach($leaves as $var)
<tr>
<td>{{ $i }}</td>
<td>{{$var->name}}</td>
<td>{{$var->ecNo}}</td>
<td>{{$var->fromDate}}</td>
<td>{{$var->toDate}}</td>
<td>{{$var->remarks}}</td>
<td>{{$var->status}}</td>
<td>
<button class="btn btn-raised btn-info waves-effect btn-round js-sweetalertsendsms" data-id="{{$var->idHosteliteLeave}}" data-type="confirm">Send Sms</button>
<button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-phone="{{$var->father_mobile}}" data-type="confirm">Call</button>
</td>
</tr>
<?php $i++; ?>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@stop
@section('script')
<script>
$(document).on('click', '.js-sweetalert', function (e) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
e.preventDefault();
var phone = $(this).data('phone');
swal({
title: "Phone No:",
text: phone,
});
});
$(document).on('click', '.js-sweetalertsendsms', function (e) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
e.preventDefault();
var id = $(this).data('id');
var type = $(this).data('type');
var remarks = '';
swal({
title: "Are you sure?",
text: "Send SMS!",
type: "input",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, Send!",
animation: "slide-from-top",
inputPlaceholder: "Enter Message here",
closeOnConfirm: false
},
function(inputValue) {
//added for prompt remarks input
if (inputValue === false) return false;
if (inputValue === "") {
swal.showInputError("Please Add Your Message Here!"); return false
}else{
//end
//console.log('here');
$.ajax({
type: "GET",
url: "{{url('/school/hostel-leaves/')}}" + "/" +id+"/sendsms",
data: {id:id,remarks:inputValue}
})
.done(function(data) {
swal({
title: "Sent",
text: "SMS has been sent successfully",
type: "success"
},function() {
location.reload();
});
})
.error(function(data) {
swal("Oops", "We couldn't connect to the server!", "error");
});
return false;
}
});
});
</script>
@stop
Copyright © 2021 -