

<?php if($mode!="create"): ?>
    <div class="form-group row">
        <div class="col-md-4">
            <div class="input-group mb-3">
                <div class="input-group-prepend">
                    <span class="input-group-text">N°</span>
                </div>
                <?php echo html()->text('num_creancier', ($mode!="show")?str_pad($creancier->num_creancier, 5, "0", STR_PAD_LEFT):$creancier->num_creancier)
                    ->placeholder("Numéro de créancier")
                    ->attributes([($mode=="show"?'disabled':''), 'class' => 'form-control']); ?>

            </div>
        </div>
    </div>
<?php endif; ?>

<div class="form-group row" >
    <div class="col-md-5">
        <?php echo html()->label('Nom','nom'); ?>

        <?php echo html()->text('nom', null)->placeholder("Nom")
            ->attributes([($mode=="show"?'disabled':''), 'class' => 'identifiants form-control']); ?>

    </div>

    <div class="col-md-4">
        <?php echo html()->label('Prénom','prenom'); ?>

        <?php echo html()->text('prenom', null)->placeholder("Prénom")
            ->attributes([($mode=="show"?'disabled':''), 'class' => 'identifiants form-control']); ?>

    </div>

    <div class="col-md-3">
        <?php echo html()->label( 'Date de naissance','datepicker_datenaiss'); ?>

        <div class='input-group date' id='datepicker_datenaiss'>
            <?php echo html()->text('datenaiss', null)
                ->placeholder('Date')->attributes([($mode=="show"?'disabled':''),'class' => 'form-control']); ?>

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



<div class="form-group row callout callout-warning">
    <div class="col-md-2">
        <?php echo html()->label( 'N°mandat','idmandat'); ?>

        <?php echo html()->text('idmandat', (isset($mandat->id)?$mandat->id:null))
            ->placeholder("Numéro de mandat")
            ->attributes([( ($mode=="edit") && (!isset($frame) || !$frame) )?'':'readonly', 'class' => 'form-control']); ?>

    </div>
    <div class="col-md-10">
        <?php echo html()->label( 'N°Imputation','idimp_mdt'); ?>

        <?php echo html()->select('idimp_mdt',$imputations,null)
                ->placeholder('A définir')
                ->attributes([($mode=="show"?'disabled':''),'class' => 'form-control']); ?>

    </div>
</div>


<div class="form-group row callout callout-danger">
    <div class="col-md-4">
        <?php echo html()->label( 'Banque','bqcle_creancier'); ?>

        <?php echo html()->select('bqcle_creancier',DB::table('banques')->orderby(db::raw("nom"))->pluck(db::raw("CONCAT(id,' ',nom) as nom"), 'id')->toArray(),null)
                ->placeholder('A définir')
                ->attributes([($mode=="show"?'disabled':''),'class' => 'form-control']); ?>


    </div>
    <div class="col-md-4">
        <?php echo html()->label( 'Compte','compte'); ?>

        <?php echo html()->text('compte', null)->placeholder("Compte")->attributes([($mode=="show"?'disabled':''), 'class' => 'form-control']); ?>

    </div>
    <div class="col-md-2">
        <?php echo html()->label( 'Montant','montant'); ?>

        <?php echo html()->text('montant', null)->placeholder("Montant")->attributes([($mode=="show"?'disabled':''), 'class' => 'form-control']); ?>

    </div>
    <div class="col-md-2">
        <?php echo html()->label( 'Type&nbsp;de&nbsp;paiement','typepmt'); ?>

        <?php echo html()->select('typepmt',['BAN'=>'Banque','ESP' => 'Espèces','CHQ' => 'Chèque','TRE' => 'Trésor'],null)
                ->placeholder('A définir')
                ->attributes([($mode=="show"?'disabled':''),'class' => 'form-control']); ?>

    </div>
</div>


<div class='form-group row'>
    <div class="col-md-12">
        <?php echo html()->label( 'Observations','obs'); ?>

        <?php echo html()->textarea('obs', null)->placeholder('Observations')
            ->attributes([($mode=="show"?'disabled':''), 'class' => 'form-control', 'rows'=>'2']); ?>

    </div>
</div>

<?php if(isset($frame) && $frame): ?>
    <div class='form-group'>
        <?php if($mode=="show"): ?>
            <?php if($user->hasRole("ADMINISTRATEUR") || $user->can("CRE_MAJ")): ?>
                <?php if(!$frame): ?>
                    <a class="btn btn-primary" href="<?php echo url('/creanciers/'.$creancier->id.'/edit'); ?>">Modifier</a>
                <?php endif; ?>
            <?php endif; ?>
        <?php else: ?>
            <?php echo html()->button('Enregistrer')->value('Enregistrer')->type('submit')->attributes(['class' => 'btn btn-primary']); ?>

        <?php endif; ?>
        <?php if(!$frame): ?>
            <a class="btn btn-warning"  href="<?php echo url('creanciers'); ?>">Retour</a>
        <?php endif; ?>
    </div>
<?php else: ?>
    <?php if( ($mode=="show")&& (isset($mandat->id)) && ($creancier->IsModifiable && ($user->hasRole("ADMINISTRATEUR") || $user->can("CRE_MAJ"))) ): ?>
        <a class="btn btn-primary" href="<?php echo url('creancier_edit_avec_mandat/'.$creancier->id.'/'.$mandat->id); ?>" id="btn_modifier">Modifier</a>
    <?php endif; ?>
<?php endif; ?>



<?php /**PATH C:\xampp\htdocs\SYSINFO\cpswf\sipre2\resources\views/tiers/creanciers/content.blade.php ENDPATH**/ ?>