Viewing file: ed008f10b7dedb1d0c92cc2992a64646.php (4.54 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $__env->startSection('title','Edit Group'); ?>
<?php $__env->startSection('extra-css'); ?>
<link rel="stylesheet" href="<?php echo e(asset('plugins/select2/css/select2.min.css')); ?>">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-12 mx-auto col-sm-10">
<!-- Custom Tabs -->
<div class="card mt-3">
<div class="card-header d-flex p-0">
<h2 class="card-title p-3"><a
href="<?php echo e(route('customer.groups.index')); ?>"><?php echo app('translator')->get('customer.groups'); ?></a></h2>
</div><!-- /.card-header -->
<div class="card-body">
<?php if(count($groupContactIds)<200): ?>
<div><h6 class="text-danger d-none"><?php echo app('translator')->get(('customer.group_edit_nb')); ?></h6></div>
<?php else: ?>
<div><h6 class="text-danger"> <span> Can not modify previous contacts. Less than 200 contacts are editable</span></h6></div>
<?php endif; ?>
<form method="post" role="form" id="groupForm" enctype="multipart/form-data"
action="<?php echo e(route('customer.groups.update',[$group])); ?>">
<?php echo csrf_field(); ?>
<?php echo method_field('put'); ?>
<?php echo $__env->make('customer.groups.form', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<button type="submit" class="btn btn-primary"><?php echo app('translator')->get('customer.update'); ?></button>
</form>
<!-- /.tab-content -->
</div><!-- /.card-body -->
</div>
<!-- ./card -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('extra-scripts'); ?>
<script src="<?php echo e(asset('plugins/jquery-validation/jquery.validate.min.js')); ?>"></script>
<script src="<?php echo e(asset('plugins/select2/js/select2.full.min.js')); ?>"></script>
<script !src="">
"use strict";
$('#groupForm').validate({
rules: {
name: {
required: true
}
},
messages: {
name: {required: "Please provide name"},
},
errorElement: 'span',
errorPlacement: function (error, element) {
error.addClass('invalid-feedback');
element.closest('.form-group').append(error);
},
highlight: function (element, errorClass, validClass) {
$(element).addClass('is-invalid');
},
unhighlight: function (element, errorClass, validClass) {
$(element).removeClass('is-invalid');
}
});
<?php if(count($groupContactIds)<200): ?>
$(function () {
let preData=<?php echo json_encode($groupContactIds, 15, 512) ?>;
var selected = [];
for (var s in preData) {
selected.push(preData[s].id);
}
$('.select2').select2({
data:preData,
ajax: {
delay: 500,
url: '<?php echo e(route('customer.contact.get.search')); ?>',
data: function (params) {
// Query parameters will be ?search=[term]&page=[page]
return {
search: params.term,
page: params.page || 1
};
},
cache: true
},
}).val(selected).trigger('change');
});
<?php endif; ?>
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.customer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Pico-SMS-v-2\picosms\resources\views/customer/groups/edit.blade.php ENDPATH**/ ?>
|