<?php $__env->startSection('body'); ?>
    <div class="wrapper-content animated fadeInRight form-horizontal">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins ">
                    <div class="ibox-content">
                        <?php if(isset($borderou_arr) && count($borderou_arr)): ?>
                            <button class="btn btn-outline btn-info pull-right fin-borderou"
                                    data-contact-person="<?php echo e(!is_null(request()->get('contact_person')) ? request()->get('contact_person') : (!is_null($fanContactPerson) ? $fanContactPerson->id : '')); ?>">
                                <i class="fa fa-check"></i>Finalizare borderou
                            </button>
                        <?php endif; ?>
                        <h2 class="ibox-title">
                            AWB Borderou
                        </h2>
                    </div>
                    <form action="">
                        <div class="ibox-content">
                            <div class="form-group">
                                <label for="contact_person" class="col-sm-1 control-label">Persoane Fan</label>
                                <div class="col-sm-11">
                                    <select class="form-control" name="contact_person" id="contact_person">
                                        <?php if(!$contactPersonList->isEmpty()): ?>
                                            <?php foreach($contactPersonList as $key => $item): ?>
                                                <option value="<?php echo e($item->id); ?>" <?php echo e(!is_null(request()->get('contact_person')) && request()->get('contact_person') == $item->id ? 'selected' : ($key == 0 ? 'selected' : '')); ?>><?php echo e($item->name); ?></option>
                                            <?php endforeach; ?>
                                        <?php endif; ?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="start_date" class="col-sm-1 control-label">Data crearii</label>
                                <div class="col-sm-11">
                                    <div class="input-group date">
                                        <input name="start_date" id="start_date" type="text" class="form-control"
                                               value="<?php echo e(!is_null(request()->get('start_date')) ? request()->get('start_date') : ''); ?>">
                                        <span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
                                    </div>
                                </div>
                            </div>
                            <div class="btn-controls personal-btn-controls">
                                <button type="submit"
                                        class="btn btn-outline btn-info pull-right">
                                    Filtreza
                                </button>
                                <a href="<?php echo e(url(request()->getPathInfo())); ?>"
                                   class="btn btn-outline btn-info pull-right">
                                    Reseteaza filtru
                                </a>

                            </div>
                        </div>
                    </form>
                    <?php if(isset($borderou_arr) && count($borderou_arr)): ?>
                        <div class="ibox-content">
                            <div class="table-responsive">
                                <?php if(!$errors->any()): ?>
                                    <table class="table borderou">
                                        <thead>
                                        <tr>
                                            <th class="text-center">AWB</th>
                                            <th class="text-center">Destinatar</th>
                                            <th class="text-center">Telefon</th>
                                            <th class="text-center">Plicuri</th>
                                            <th class="text-center">Colete</th>
                                            <th class="text-center">Continut</th>
                                            <th class="text-center">Serviciu</th>
                                            <th class="text-center">Data</th>
                                            <th class="text-center">Centru cost</th>
                                            <th class="text-center">Oras destinatar</th>
                                            <th class="text-center">Cash + TVA</th>
                                            <th class="text-center">Actiuni</th>
                                            <th class="text-right print_all_items_awb">
                                                <button type="button"></button>
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <?php foreach($borderou_arr as $item): ?>
                                            <tr data-id="<?php echo e($item['package']['id']); ?>">
                                                <td><?php echo e(isset($item['AWB']) ? $item['AWB'] : ''); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['Client dest']) ? $item['Client dest'] : ''); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['Telefon dest']) ? $item['Telefon dest'] : ''); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['Plic']) ? $item['Plic'] : 0); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['Colet']) ? $item['Colet'] : 0); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['Continut']) ? $item['Continut'] : ''); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['Tip serviciu']) ? $item['Tip serviciu'] : ''); ?></td>
                                                <td class="text-center"><?php echo e($item['Data AWB'] . ' ' . $item['Ora AWB']); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['Centru Cost']) ? $item['Centru Cost'] : ''); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['Oras dest']) ? $item['Oras dest'] : ''); ?></td>
                                                <td class="text-center"><?php echo e(isset($item['package']['fanCourierTarifAwb']) ? $item['package']['fanCourierTarifAwb'] : ''); ?></td>
                                                <td class="text-center actions">
                                                    <a href="<?php echo e(url('project-registry/edit/' . $item['package']['id'] )); ?>"
                                                       class="edit-borderow-item" target="_blank"
                                                       title="Editeaza AWB-ul"></a>
                                                    <a href="<?php echo e(url('fan-files', $item['package']['fan_courier_file'])); ?>"
                                                       download type="button" class="pdf-borderow-item"
                                                       title="Descarca AWB-ul"></a>
                                                    <span class="print-borderow-item"
                                                          data-fan-courier="<?php echo e(url('fan-files', $item['package']['fan_courier_file'])); ?>"></span>
                                                </td>
                                                <td class="text-right">
                                                    <div class="print-item-block-awb">
                                                        <input type="checkbox" name="print_item"
                                                               class="print_item">
                                                        <input type="hidden" name="package_ids[]"
                                                               value="<?php echo e($item['package']['id']); ?>">
                                                    </div>
                                                </td>
                                            </tr>
                                        <?php endforeach; ?>
                                        </tbody>
                                    </table>
                                <?php else: ?>
                                    <div class="error-boderou-wrap">
                                        <?php echo implode('', $errors->all('<div class="error-borderou"><div>:message</div></div>')); ?>

                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    <?php else: ?>
                        <div class="empty-list"><?php echo e(trans('e.empty_list')); ?></div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

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