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><?php if(isset($virtual)): ?>Edit <?php else: ?> Add <?php endif; ?></strong> Virtual Id</h2>
</div>
<div class="body">
<?php if(isset($virtual)): ?>
<?php echo Form::model($virtual, ['method' => 'PATCH', 'action' => ['School\VirtualCardController@update', $virtual->id], 'class' => 'form-horizontal']); ?>
<?php else: ?>
<?php echo Form::open(['url' => 'school/virtual-card', 'class' => 'form-horizontal']); ?>
<?php endif; ?>
<div class="row clearfix">
<div class="col-sm-4 form-control-label required">
<label for="classname">Start Edit Date</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php if(isset($virtual)): ?>
<?php echo Form::text('startDate',Carbon\Carbon::parse($virtual->start_date)->format('d-m-Y'),['class' => 'form-control datepicker','required'=>'required']); ?>
<?php else: ?>
<?php echo Form::text('startDate',null,['class' => 'form-control datepicker','required'=>'required']); ?>
<?php endif; ?>
<?php if($errors->has('fromDate')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('fromDate')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-4 form-control-label required">
<label for="classname">End Date</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php if(isset($virtual)): ?>
<?php echo Form::text('endDate',Carbon\Carbon::parse($virtual->end_date)->format('d-m-Y'),['class' => 'form-control datepicker','required'=>'required']); ?>
<?php else: ?>
<?php echo Form::text('endDate',null,['class' => 'form-control datepicker','required'=>'required']); ?>
<?php endif; ?>
<?php if($errors->has('fromDate')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('fromDate')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php if(isset($virtual)): ?>
<?php echo Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<a href="<?php echo e(url('/school/virtual-card')); ?>" class="btn btn-primary btn-raised btn-round waves-effect">Cancel</a>
<?php else: ?>
<?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php endif; ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
</div>
<?php if(!isset($virtual)): ?>
<div class="col-sm-7">
<div class="card">
<div class="header">
<h2><strong>List Of Sections</strong></h2>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>S. No.</th>
<th>Start Date</th>
<th>End Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php if(isset($virtualcard)): ?>
<?php $__currentLoopData = $virtualcard; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td scope="row"><?php echo e($i); ?></td>
<td><?php echo e(Carbon\Carbon::parse($value->start_date)->format('d-m-Y')); ?></td>
<td><?php echo e(Carbon\Carbon::parse($value->end_date)->format('d-m-Y')); ?></td>
<td>
<a href="<?php echo e(url('school/virtual-card/' . $value->id. '/edit')); ?>" class="btn btn-raised btn-info waves-effect btn-round">Edit </a>
<button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="<?php echo e($value->id); ?>" data-type="confirm">DELETE</button>
<?php if($value->isLinkAllowed == "Y"): ?>
<button class="btn btn-raised btn-warning waves-effect btn-round" onclick="copyLink('<?php echo e($value->link_id); ?>')">Copy Link</button>
<?php else: ?>
<button class="btn btn-raised btn-warning waves-effect btn-round js-link" data-id="<?php echo e($value->id); ?>" data-type="confirm">Generate Link</button>
<?php endif; ?>
</td>
</tr>
<?php $i++; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
function copyLink(ln){
navigator.clipboard.writeText('https://online-login.online/id-card/'+ln);
alert("Link Copied");
}
$(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 master!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: true
},
function() {
// console.log('here');
$.ajax({
type: "DELETE",
url: "<?php echo e(url('school/virtual-card/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Master date has been successfully deleted",
type: "success"
},function() {
location.reload();
});
})
.error(function(data) {
swal("Oops", "We couldn't connect to the server!", "error");
});
return false;
});
});
$(document).on('click', '.js-link', 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 create link as it will be available publically!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, create it!",
closeOnConfirm: true
},
function() {
// console.log('here');
$.ajax({
type: "GET",
url: "<?php echo e(url('school/virtual-link/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Created",
text: "Link has been successfully created",
type: "success"
},function() {
location.reload();
});
})
.error(function(data) {
swal("Oops", "We couldn't connect to the server!", "error");
});
return false;
});
});
$(document).ready(function() {
setTimeout(function(){
$('.datepicker').datepicker({
autoclose: true,
format: 'dd-mm-yyyy',
todayBtn:true,
todayHighlight:true,
orientation: 'auto'
});
}, 100);
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -