

<?php $__env->startSection('title'); ?> Journaux <?php $__env->stopSection(); ?>
<?php $__env->startSection('title_card'); ?> Journaux <?php $__env->stopSection(); ?>
<?php $__env->startSection('subtitle_card',"Liste complète"); ?>
<?php $__env->startSection('content'); ?>


    <div class="card">
        <?php if(Session::has('message')): ?>
            <div class="alert alert-warning"><?php echo Session::get('message'); ?></div>
        <?php endif; ?>
        <div class="card-body">
            <table id="_table" width="100%" class="table table-bordered">
                <thead>
                    <tr>
                        <th >nom</th>
                        <th width='1%'>Nom Court</th>
                        <th width='1%'>Nb Ecritures</th>
                        <?php if($user->hasRole("ADMINISTRATEUR") || $user->can("JOU_AJO")): ?>
                            <th width='1px'>
                                <a href="<?php echo url('journaux/create'); ?>" class="btn  btn-sm btn-success">
                                    <span class='fas fa-plus'></span></a> 
                            </th>
                        <?php endif; ?>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $journaux; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $journal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr class="">
                        <td nowrap >
                            <a href="<?php echo url('journaux/'.$journal->id); ?>" >
                                <?php echo $journal->nom; ?>

                            </a>
                        </td>
                        <td nowrap align='center'><?php echo $journal->nom_court; ?></td>
                        <td nowrap align='center' ><?php echo $journal->NbEcritures; ?></td>
                        <?php if($user->hasRole("ADMINISTRATEUR") || $user->can("JOU_SUP")): ?>
                        <td nowrap>
                            <?php if($journal->NbEcritures==0): ?>
                            <?php echo Form::open(['url' => url('journaux/' . $journal->id), 'method' => 'DELETE']); ?>                            
                                <?php echo e(csrf_field()); ?>

                                
                                    <button class="btn btn-danger btn-sm"><span class='fas fa-trash'></span></button>
                            <?php endif; ?>
                        </td>
                        <?php endif; ?>
                        <?php echo Form::close(); ?>

                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
    </div>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('scripts'); ?>
    <?php echo $__env->make("forms.scripts_datatable_btn_nopage", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.dash', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\SYSINFO\cpswf\sipre_new\resources\views/comptabilite/journaux/index.blade.php ENDPATH**/ ?>