
<?php echo $with_navbar=false; ?>

<?php $__env->startSection('title'); ?> Transaction <?php $__env->stopSection(); ?>
<?php $__env->startSection('title_card',"Nouvelle transaction"); ?>
<?php $__env->startSection('content'); ?>

<div class="card">
        <?php if($errors): ?>
            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class='bg-danger alert'><?php echo $error; ?></div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php endif; ?>
        <div class="col-lg-max col-lg-offset-1 container-fluid"> 
            <?php if($mode=='create'): ?>
                <?php echo Form::open(['grandlivre' => 'form', 'url' => '/grand_livre', 'class' => 'form-horizontal']); ?>

            <?php else: ?>
                <?php echo Form::open(['grandlivre' => 'form', 'url' => '/grand_livre_maj/'.$grand_livre_ligne->id, 'class' => 'form-horizontal']); ?>

                <?php echo Form::hidden('id_edit', $id_edit ); ?>

            <?php endif; ?>

            <div class="form-group row">
                <div class='col-md-2'>
                    <?php echo Form::label('date_doc', 'Date'); ?>

                    <div class='input-group date' id='datepicker_date_doc'>
                    <?php echo Form::text('date_doc',date('d/m/Y'), 
                            ['id'=>'date_doc','placeholder' => 'JJ/MM/AAAA', 'class' => 'form-control']); ?>

                        <span class='input-group-addon'>
                            <span class='glyphicon glyphicon-calendar'></span>
                        </span>
                    </div>
                </div>

                <div class='col-md-3'>
                    <?php echo Form::label('journal', 'journal'); ?>

                    <?php echo Form::select('journal',$liste_journaux,"",['placeholder'=>'A définir','class' => 'form-control']); ?> 
                </div>

                <div class='col-md-3'>
                    <?php echo Form::label('piece', 'Piece'); ?>

                    <?php echo Form::text('piece', "", ['class' => 'form-control']); ?>

                </div>
            </div>


            <?php if($mode=='edit'): ?>
            <div class="col-md-12">
                <div class="form-group row">
                    <div class='col-md-12'>
                    <?php echo Form::label('liste', 'Ecritures associées'); ?>

                    </div>
                    <div class='col-md-12'>
                        <?php echo $__env->make("comptabilite.grandlivre.lignes_transaction", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    </div>
                </div>
            </div>
            <?php endif; ?>

            <div class='form-group row'>
                <div class="col-md-12">
                    <?php if($mode!='show'): ?>
                        <?php if($mode=='edit'): ?>
                            <?php echo Form::submit('Enregistrer', ['class' => 'btn btn-primary']); ?>

                        <?php else: ?>
                            <?php echo Form::submit('Créer une nouvelle transaction', ['class' => 'btn btn-primary','onclick'=>'verif_saisie()']); ?>

                        <?php endif; ?>
                    <?php endif; ?>
                    <a class="btn btn-warning"  href="<?php echo url('grand_livre'); ?>">Retour</a>
                </div>
            </div>

            <?php echo Form::close(); ?>

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


<?php $__env->startSection('scripts'); ?>
    <?php echo $__env->make('forms.scripts_datatable', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <script type="text/javascript">
    $(function () {
        $('#datepicker_date_doc').datepicker({
        format: "dd/mm/yyyy",language: "fr",autoclose: true
        });
    });
    </script>


<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.dash', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp7422\htdocs\sysinfo\cpswf\sipre_new\resources\views/comptabilite/grandlivre/create_transaction.blade.php ENDPATH**/ ?>