
<?php $__env->startSection('content'); ?>
    <?php Fun::lang();?>

    <div class="container-fluid">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <div class="row">
                        <div class="col-sm-12 col-xs-12 col-md-12">
                            <div class="title-add">
                                <div class="pull-left">
                                    <h3><?php echo e(__('administrator.upcoming_task')); ?></h3>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12 col-xs-12 col-md-12"><hr></div>
                        <div class="col-sm-12 col-xs-12 col-md-12">
                            <form class="form_data">
                                    <div class="form-group col-sm-3 col-xs-3 ">
                                        <div class="col-sm-4 col-xs-12 ">
                                            <label><?php echo e(__('administrator.lead_name')); ?> </label>
                                        </div>
                                        <div class="col-sm-8">
                                            <?php echo Form::select('lead_id',[], null, ['placeholder'=>__('administrator.please_select'),'class' => 'form-control search_lead']); ?>

                                        </div>
                                    </div>
                                    <div class="form-group col-sm-3 col-xs-3 ">
                                        <div class="col-sm-4 col-xs-12 ">
                                            <label><?php echo e(__('administrator.task_type')); ?> </label>
                                        </div>
                                        <div class="col-sm-8">
                                            <?php echo Form::select('task_type',getTaskType(), null, ['placeholder'=>__('administrator.please_select'),'class' => 'form-control select2']); ?>

                                        </div>
                                    </div>
                                    <div class="form-group col-sm-3 col-xs-3 ">
                                        <div class="col-sm-4 col-xs-12 ">
                                            <label><?php echo e(__('administrator.from_date')); ?> </label>
                                        </div>
                                        <div class="col-sm-8">
                                            <?php echo Form::text('from_date', null, ['placeholder'=>__('administrator.date'),'class' => 'form-control date_picker','autocomplete'=>'off']); ?>

                                        </div>
                                    </div>
                                    <div class="form-group col-sm-3 col-xs-3 ">
                                        <div class="col-sm-4 col-xs-12 ">
                                            <label><?php echo e(__('administrator.to_date')); ?> </label>
                                        </div>
                                        <div class="col-sm-8">
                                            <?php echo Form::text('to_date', null, ['placeholder'=>__('administrator.date'),'class' => 'form-control date_picker','autocomplete'=>'off']); ?>

                                        </div>
                                    </div>
                                    <div class="form-group col-sm-3 col-xs-3 ">
                                        <div class="col-sm-4 col-xs-12 ">
                                            <label><?php echo e(__('administrator.subject')); ?> </label>
                                        </div>
                                        <div class="col-sm-8">
                                            <?php echo Form::text('subject', null, ['placeholder'=>__('administrator.subject'),'class' => 'form-control']); ?>

                                        </div>
                                    </div>
                                    <div class="form-group col-sm-3 col-xs-3 ">
                                        <div class="col-sm-4 col-xs-12 ">
                                            <label><?php echo e(__('administrator.note')); ?> </label>
                                        </div>
                                        <div class="col-sm-8">
                                            <?php echo Form::text('note', null, ['placeholder'=>__('administrator.note'),'class' => 'form-control']); ?>

                                        </div>
                                    </div>

                            </form>
                        </div>
                    </div>
                </div>
                <div class="box-body table-responsive">
                    <table id="data_table" class="table table-bordered table-striped dataTable">
                        <thead>
                        <tr>
                            <th>N°</th>
                            <th><?php echo e(__('administrator.date')); ?></th>
                            <th><?php echo e(__('administrator.agent')); ?></th>
                            <th><?php echo e(__('administrator.lead')); ?></th>
                            <th><?php echo e(__('administrator.contact')); ?></th>
                            <th><?php echo e(__('administrator.subject')); ?></th>
                            <th><?php echo e(__('administrator.task_type')); ?></th>
                            <th><?php echo e(__('administrator.place')); ?></th>
                            <th><?php echo e(__('administrator.note')); ?></th>
                            <th><?php echo e(__('administrator.action')); ?></th>
                        </tr>

                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script type="text/javascript">
        //  start datatable
        $(document).ready(function () {
            dataTable();
            $('.form_data').on('change', 'select,input', function () {
                dataTable();

            });
        });

        function dataTable() {
            let data = $('.form_data').serialize();

            $('#data_table').DataTable().destroy();
            $('#data_table').DataTable({
                serverSide: true,
                ordering: false,
                searching: false,
                autoWidth: false,
                lengthMenu: tbLeng,
                ajax: {
                    url: "<?php echo e(route('upcoming-task')); ?>?" + data,
                },
                columns:
                    [
                        {data: 'DT_RowIndex'},
                        {data: 'date'},
                        {data: 'agent_id'},
                        {data: 'name'},
                        {data: 'contact'},
                        {data: 'subject'},
                        {data: 'task_type'},
                        {data: 'where'},
                        {data: 'note'},
                        {data: 'action'},
                    ],
                "initComplete": function (settings, json) {

                }

            });
        }

        // end

    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make(branchMenu(), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/crm/upcoming-task/index.blade.php ENDPATH**/ ?>