<?php 
use Carbon\Carbon;
?>



<?php /* Page title */ ?>
<?php $__env->startSection('title'); ?>
Interventi
@parent
<?php $__env->stopSection(); ?>

<?php /* page level styles */ ?>
<?php $__env->startSection('header_styles'); ?>
<?php $__env->stopSection(); ?>
<?php /* breadcrumb */ ?>
<?php $__env->startSection('top'); ?>
    <div class="breadcum">
        <div class="container">
            <ol class="breadcrumb">
                <li>
                    <a href="<?php echo e(route('home')); ?>"> <i class="livicon icon3 icon4" data-name="home" data-size="18" data-loop="true" data-c="#3d3d3d" data-hc="#3d3d3d"></i>Dashboard
                    </a>
                </li>
                <li class="hidden-xs">
                    <i class="livicon icon3" data-name="angle-double-right" data-size="18" data-loop="true" data-c="#01bc8c" data-hc="#01bc8c"></i>
                    <a href="#">Interventi</a>
                </li>
            </ol>
            <div class="pull-right">
                <i class="livicon icon3" data-name="hammer" data-size="20" data-loop="true" data-c="#3d3d3d" data-hc="#3d3d3d"></i> Interventi
            </div>
            
            <!--
                <ol class="breadcrumb">
                    <li>
                        <a href="<?php echo e(route('home')); ?>">
                            <i class="livicon" data-name="home" data-size="14" data-color="#000"></i>
                            Home
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo e(URL::to('admin/intervento')); ?>">
                            Intervento
                        </a>
                    </li>
                    <li class="active">Lista</li>
                </ol>   
            -->
        </div>
    </div>
    <?php $__env->stopSection(); ?>


<?php /* Page content */ ?>
<?php $__env->startSection('content'); ?>
    <!-- Container Section Start -->
    <div class="container-fluid">
        <!--Content Section Start -->
        <h2>Interventi</h2>
        
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
    <?php if(Session::has('ok_message')): ?>
        <div class="alert alert-success"><?php echo e(Session::get('ok_message')); ?></div>
    <?php endif; ?>

    <div>
    <?php echo $__env->make('cliente.intervento.filter', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    </div>
    
    <!--
    <label>
        <a class="btn btn-success" href="/admin/intervento/create"><span class="glyphicon glyphicon-plus-sign"></span> Aggiungi</a>
    </label>
    -->
    
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>Anno</th>
            <th>Nr.</th>
            <th>Data inserimento ticket</th>
            <th>Nr. ticket cliente</th>
            <th>Sede intervento</th>
            <th>Cliente</th>
            <th>Tecnico</th>
            <th>Tipo</th>
            <th>Stato</th>
            <th>Azioni</th>
        </tr>
        </thead>

        <tbody>
            <?php foreach($listaIntervento as $ln): ?>
            <tr>
            <td><?php echo e($ln['anno']); ?></td>
            <td><?php echo e($ln['numero']); ?></td>
            <td><?php echo Carbon::createFromFormat('Y-m-d', $ln['data_inserimento_ticket'])->format('d/m/Y');?></td>
            <td><?php echo e($ln['numero_ticket_cliente']); ?></td>
            <td><?php echo e($ln['sede_intervento']); ?></td>
            <td><?php /* $ln['cliente_id'] */ ?> 
                
                <?php if(!is_null($ln->cliente)): ?> 
                    <?php echo e($ln->cliente->ragione_sociale); ?>

                <?php endif; ?>
            
            </td>
            <td>
                
                <?php if(!is_null($ln->tecnici)): ?> 
                    <?php foreach($ln->tecnici as $tecnico): ?>
                    <?php echo e($tecnico->nome); ?> <?php echo e($tecnico->cognome); ?> <br/>
                    <?php endforeach; ?>
                <?php endif; ?>
            
            </td>            
            <td><?php echo e($ln['intervento_tipo']); ?></td>
            <td><?php echo e($ln['intervento_stato']); ?></td>
            <td>
                
                <a class="btn btn-sm btn-info" href="/cliente/intervento/<?php echo e($ln['id']); ?>" title="Visualizza"><span class="glyphicon glyphicon-search"></span></a>
                <?php
                /*
                <a class="btn btn-sm btn-warning" href="/cliente/intervento/{{$ln['id']}}/edit" title="Modifica"><span class="glyphicon glyphicon-edit"></span></a>
                 * 
                 */
                ?>
                
            </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
</div>
        
        <!-- //Content Section End -->
    </div>
    
<?php $__env->stopSection(); ?>

<?php /* page level scripts */ ?>
<?php $__env->startSection('footer_scripts'); ?>

    <!-- page level js starts-->
    <!--page level js ends-->
    
<?php $__env->stopSection(); ?>

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