
 
<?php $__env->startSection('title'); ?> Mise à jour enfant  <?php $__env->stopSection(); ?>
 
<?php $__env->startSection('content'); ?>
 
<div class='col-lg-8 col-lg-offset-1'>
 
    <?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; ?>
 
    <h2><i class='fa fa-user'></i>Enfant : <?php echo $enfant->nom_complet; ?></h2>
 
    <?php echo Form::model($enfant, ['enfant' => 'form', 'url' => '/tiers/enfants/' . $enfant->id, 'method' => 'PUT', 'class' => 'form-horizontal']); ?>

    <?php echo Form::hidden('mode_frame',(isset($beneficiaire)?true:false),['id'=>'mode_frame']); ?>


    <div class="tab-content">
        <br/>

        <div class="form-group">
            <div class="col-xs-3">
            <div class="has-success has-feedback">
                <div class="input-group">
                    <span class="input-group-addon">N°</span>
                    <input readonly="readonly" type="text" class="form-control" name="id" id="id" 
                    value='<?php echo str_pad($enfant->id, 6, "0", STR_PAD_LEFT); ?>' />
                </div>
           </div>
           </div>
        </div>


        <div class='form-group'>
            <div class="col-xs-4">
                <?php echo Form::label('nom', 'NOM'); ?>

                <?php echo Form::text('nom',null, [
                    'class' => 'form-control text-uppercase', 'placeholder'=>'Nom']); ?>

            </div>

            <div class="col-xs-4">
                <?php echo Form::label('prenom', 'PRENOM'); ?>

                <?php echo Form::text('prenom', null, [
                    'class' => 'form-control', 'placeholder'=>'Prénom']); ?>

            </div>
        </div>

        <div class='form-group'>
            <div class="col-xs-3">
                <?php echo Form::label('datenais', 'Date de naissance'); ?>

                <div class='input-group date' id='datepicker_datenais'>
                    <?php echo Form::text('datenais', $enfant->datenais, 
                        ['placeholder' => 'Date de naissance', 'class' => 'form-control']); ?>

                    <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>
                    <script type="text/javascript">
                        $(function () {
                            $('#datepicker_datenais').datepicker({
                                format: "dd/mm/yyyy",
                                language: "fr",
                                autoclose: true
                            });
                        });
                    </script>
                </div>
            </div>


            <div class="col-xs-2">
                <?php echo Form::label('sexe', 'Sexe'); ?>

                <?php echo Form::select(
                    'sexe',
                    ['M'=>'Masculin','F' => 'Feminin'],
                    $enfant->sexe,
                    [
                        'class' => 'selectpicker'
                        ,'data-width' => "100%"
                    ]
                ); ?>

            </div>
        </div>

        <div class='form-group'>
            <div class="col-xs-2">
            <?php echo Form::label('certif', 'Certificat'); ?>

            <br/>
                <?php echo Form::select(
                    'certif',
                    ['0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '9' => '9'],
                    $enfant->certif,
                    [
                        'class' => 'selectpicker'
                        ,'data-width' => "100%"
                    ]
                ); ?>

            </div>
        </div>

        <div class='form-group'>
            <div class="col-md-4">
                <?php echo Form::label('verrou', 'Verrou  '); ?>

                <?php echo Form::checkbox('verrou', null, ['class' => 'form-control']); ?>

            </div>
        </div>


        <fieldset style="padding:5px;">
            <legend class="h2" style="margin:0px;"><small>Responsable parental</small></legend>
            <div class="form-group bg-success" style="padding:10px;margin:5px;">
                <div class="col-xs-2">
                <?php echo Form::label('parents1', 'Réf.'); ?>

                <?php echo Form::text('parents1',null, [
                    'class' => 'form-control','placeholder' => 'Référence']); ?>

                </div>
                <div class="col-xs-5">
                <?php echo Form::label('nom_parent1', 'Nom'); ?>

                <?php echo Form::text('nom_parent1',null, [
                    'class' => 'form-control', 'readonly'=>'true']); ?>

                </div>

                <div class="col-xs-3">
                <?php echo Form::label('compte_p', 'Compte bancaire'); ?>

                <?php echo Form::text('compte_p',null, [
                    'class' => 'form-control','placeholder' => 'Compte bancaire']); ?>

                </div>
            </div>
        </fieldset>
          

        <fieldset style="padding:5px;">
            <legend class="h2" style="margin:0px;"><small>Conjoint</small></legend>
            <div class="form-group bg-info" style="padding:10px;margin:5px;">
                <div class="col-xs-2">
                    <?php echo Form::label('parents2', 'Réf.'); ?>

                    <?php echo Form::text('parents2',null, [
                        'class' => 'form-control','placeholder' => 'Référence']); ?>

                </div>
                <div class="col-xs-5">
                    <?php echo Form::label('nom_parent2', 'Nom'); ?>

                    <?php echo Form::text('nom_parent2',null, [
                        'class' => 'form-control', 'readonly'=>'true']); ?>

                </div>

                <div class="col-xs-3">
                <?php echo Form::label('compte_m', 'Compte bancaire'); ?>

                <?php echo Form::text('compte_m',null, [
                    'class' => 'form-control','placeholder' => 'Compte bancaire']); ?>

                </div>
            </div>
        </fieldset>

            <br/>

        <fieldset style="padding:5px;">
            <legend class="h2" style="margin:0px;"><small>Observations</small></legend>
            <div class="form-group" style="padding:10px;margin:5px;">

                <?php echo Form::textarea('obs', null, [
                    'class' => 'form-control', 'rows'=>'2','placeholder'=>'Observations']); ?>

            </div>
        </fieldset>


     </div>    


     <div class='form-group'>
        <div class="col-sm-9 col-lg-offset-1">
        <?php echo Form::submit('Enregistrer', ['class' => 'btn btn-primary']); ?>

        </div>
    </div>

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

 
</div>
 
 <br> <br>


<script type="text/javascript">
        $(function() {
            $("#responsable").autocomplete({
                source: "<?php echo url('auto_responsable'); ?>",
                minLength: 2,
                select: function(event, ui) {
                    $('#responsable').val(ui.item.value);
                    $('#parents1').val(ui.item.id);
                    $('#parents1_addon').html(ui.item.id);
                },
                close: function(event, ui) {
                    //alert('a');
                }
            });    
        });

        $(function() {
            $("#conjoint").autocomplete({
                source: "<?php echo url('auto_responsable'); ?>",
                minLength: 2,
                select: function(event, ui) {
                    $('#conjoint').val(ui.item.value);
                    $('#parents2').val(ui.item.id);
                    $('#parents2_addon').html(ui.item.id);
                },
                close: function(event, ui) {
                    
                }
            });    
        });
</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\SYSINFO\cpswf\sipre\resources\views/tiers/enfants/edit.blade.php ENDPATH**/ ?>