<?php $__env->startSection('content'); ?>
    <?php Fun::lang()?>
    
        <ol class="breadcrumb">
            <li><a href="#"><?php echo e(__('administrator.Dashboard')); ?></a></li>
            <li>CRM</li>
            <li class="active"><?php echo e(__('administrator.meeting_log')); ?></li>
        </ol>
    
    <div class="page">
        <div class="top-content">
            <div class="row">
                <div class="col-sm-12 col-xs-12">
                    <div class="title-add">
                        <div class="pull-left">
                            <h3><?php echo e(__('administrator.meeting_log')); ?> </h3>
                        </div>
                        <div class="pull-right"> 
                                <a href="#" class="button_sm button_success">  <?php echo e(__('administrator.meeting_log')); ?> </a>
                                <a href="<?php echo e(route('appointment.index')); ?>" class="button_sm button_info  bg-olive"> <?php echo e(__('administrator.appointment_log')); ?></a>
                                <a href="<?php echo e(route('call-log.index')); ?>" class="button_sm button_info bg-olive"> <?php echo e(__('administrator.call_log')); ?></a>
                                <a href="<?php echo e(route('lead.index')); ?>" class="button_sm button_info bg-olive"> <?php echo e(__('administrator.lead')); ?></a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="top-content">
            <div class="row">
                <div class="col-sm-12 col-xs-12">
                    <div class="title-add">
                        <?php echo Form::open(array('route' => 'meeting.index','method'=>'GET')); ?>

                        <div class="form-group col-sm-3 col-xs-12">
                            <div class="col-sm-4 col-xs-12 ">
                                <label for="name"><?php echo e(__('administrator.agent')); ?> </label>
                            </div>
                            <div class="col-sm-8">
                                <?php echo Form::select('agent_id',$agent,null, array('placeholder' =>__('administrator.please_select'),'class' => 'form-control  input-sm select2','' )); ?>

                            </div>
                        </div>
                        <div class="form-group col-sm-3 col-xs-12">
                            <div class="col-sm-4 col-xs-12 ">
                                <label for="name"><?php echo e(__('administrator.lead')); ?> </label>
                            </div>
                            <div class="col-sm-8">
                                <?php echo Form::select('leadname',$lead,(@$_GET['leadname']?@$_GET['leadname']:''), array('placeholder' =>__('administrator.please_select'),'class' => 'form-control   input-sm select2','' )); ?>

                            </div>
                        </div>
                        <div class="form-group col-sm-3 col-xs-12">
                            <div class="col-sm-4 col-xs-12 ">
                                <label for="name"><?php echo e(__('administrator.date')); ?> </label>
                            </div>
                            <div class="col-sm-8">
                                <?php echo Form::text('date',(@$_GET['date']?@$_GET['date']:''), array('placeholder' => __('administrator.date'),'class' => 'form-control  input-sm date_picker','' )); ?>

                            </div>
                        </div>
                        <div class="col-sm-1 col-xs-12">
                            <?php echo Form::button(__('administrator.search'), array('type' => 'submit','class'=> 'pull-right btn btn-default',)); ?>

                        </div>
                        <?php echo e(Form::close()); ?>

                    </div>
                </div>
            </div>
        </div>
        <div class="box-body">
            <table id="datatable_products" width="100%" class="table ">
                <thead>
                <tr>
                    <th>#</th>
                    <th><?php echo e(__('administrator.agent')); ?> </th>
                    <th><?php echo e(__('administrator.lead')); ?> </th>
                    <th><?php echo e(__('administrator.subject')); ?> </th>
                    <th><?php echo e(__('administrator.place')); ?> </th>
                    <th><?php echo e(__('administrator.date')); ?> </th>
                    <th><?php echo e(__('administrator.time')); ?> </th>
                    <th><?php echo e(__('administrator.note')); ?> </th>
                    <th width="9%"><?php echo e(__('administrator.status')); ?> </th>
                    <th><?php echo e(__('administrator.action')); ?> </th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
        </div>
    </div>

    <div class="modal fade bs-modal-lg" id="form_delete" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-dm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                    <h3 class="modal-title">Are you sure?</h3>
                </div>
                <br/>
                <form role="form" method="delete" id="delete">
                    <?php echo e(csrf_field()); ?>

                    <div class="row">
                        <div class="col-md-12">
                            <div class="col-md-10">
                                <h4>Are you want to delete?</h4>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" data-dismiss="modal" class="button_danger"><i class="fa fa-close"></i> No</button>
                        <button type="button" class="button_primary deleteRecord" data-toggle="modal"><i class="fa fa-save"></i> OK</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>



<?php $__env->startSection('js'); ?>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#datatable_products').DataTable({
                ordering: false,
                serverSide: true,
                lengthMenu: [[10, 20, 40, 100,200,500,1000], [10, 20, 40, 100,200,500,1000]],
                ajax: "<?php echo e(route('datatable_meeting')); ?>?agent_id=<?php echo e(isset($_GET['agent_id'])?$_GET['agent_id']:'0'); ?>&date=<?php echo e(isset($_GET['date'])?$_GET['date']:'0'); ?>&leadname=<?php echo e(isset($_GET['leadname'])?$_GET['leadname']:'0'); ?>",
                columns:
                    [
                        {data: 'DT_RowIndex','searchable':false},
                        {data: 'agent_name',"name":"users.user_firstname"},
                        {data: 'lead_id',"name":'nso007_crm_leads.name'},
                        {data: 'subject','name':'nso007_crm_task.subject'},
                        {data: 'where','name':'nso007_crm_task.where'},
                        {data: 'date','name':'nso007_crm_task.date'},
                        {data: 'hour','name':'nso007_crm_task.hour'},
                        {data: 'note','name':'nso007_crm_task.note'},
                        {data: 'complete_status'},
                        {data: 'action'},
                    ],

                "initComplete": function(settings, json) {
                }
            });

            $.fn.dataTable.ext.errMode = 'throw';
        });
        $(document).on('click', '.delete_products', function() {
            $('#form_delete').modal('show');
            var id = $(this).data("id");
            $(".deleteRecord").click(function(){
                var token = $("meta[name='csrf-token']").attr("content");
                $.ajax({
                    url: "<?php echo e(route('meeting.delete_meeting')); ?>",
                    type: 'GET',
                    data: {
                        "id": id,
                        "_token": token,
                    },
                    success: function (){
                        $('#form_delete').modal('hide');
                        location.reload();

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




<?php echo $__env->make('adminlte::page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>