<?php 
use Carbon\Carbon;
?>

<?php $__env->startSection('content'); ?>

<section class="content-header">
                <h1>Intervento</h1>
                <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('intervento')); ?>">
                            Intervento
                        </a>
                    </li>
                    <li class="active">Lista</li>
                </ol>
            </section>
            <section class="content">

<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; ?>

    <?php echo $__env->make('intervento.filter', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    
    <label>
        <a class="btn btn-success" href="/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>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 echo e($ln['intervento_tipo']); ?></td>
            <td><?php echo e($ln['intervento_stato']); ?></td>
            <td>
                
                <a class="btn btn-sm btn-info" href="/intervento/<?php echo e($ln['id']); ?>" title="Visualizza"><span class="glyphicon glyphicon-search"></span></a>
                <a class="btn btn-sm btn-warning" href="/intervento/<?php echo e($ln['id']); ?>/edit" title="Modifica"><span class="glyphicon glyphicon-edit"></span></a>
                
            <?php echo Form::open([
                'method' => 'DELETE',
                'route' => ['intervento.destroy', $ln['id']],
                'onsubmit' => 'return confirm("Sei sicuro di eliminare il record?");',
                'style' => 'display: inline'
                
            ]); ?>

            <button class="btn btn-sm btn-danger" title="Cancella"><span class="glyphicon glyphicon-remove"></span></button>
            <?php echo Form::close(); ?>                

            </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
</div>
                
            </section>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
</script>
<?php $__env->appendSection(); ?>
<?php echo $__env->make('layouts.main', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>