<?php
$numero_img = 0;
$numero_doc = 0;

?>

<div class="">

    <div class="page-title">

        <div class="title_left">

            <h3>PORTADA</h3>

        </div>

    </div>



    <div class="clearfix"></div>
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>Cambiar Portada</h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form id="form-nueva" data-parsley-validate enctype="multipart/form-data"
                        class="form-horizontal form-label-left">
                        <?php echo csrf_field(); ?>
                        <?php
                        $texto = '';
                        $imagen = '';
                        if ($portada != null) {
                            $texto = $portada->texto;
                            $imagen = $portada->imagen;
                        }
                        
                        ?>

                        <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="texto">Descripción<span
                                    class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" class="form-control" style="resize:none;" id="texto"
                                    name="texto" required class="form-control col-md-7 col-xs-12">
                            </div>
                        </div>

                        <?php if($texto != ''): ?>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="texto">Descripción
                                    actual: </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <label><?php echo e($texto); ?></label>
                                </div>
                            </div>
                        <?php endif; ?>

                        <div class="form-group ceroM">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="imagenT">Imagen
                                principal <span class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <div class="input-group">
                                    <label for="imagen" class="input-group-addon subir" id="basic-addon1">
                                        <i class="fa fa-cloud-upload"></i> Subir imagen
                                    </label>
                                    <input id="imagen" name="imagen" onchange="sacardocumentos('imagen','imagenT');"
                                        required type="file" accept="image/jpeg,image/png,image/webp"
                                        style='display: none;' required />
                                    <input id="imagenT" name="imagenT" type="text" class="form-control"
                                        placeholder="No eligio imagen" aria-describedby="basic-addon1" readonly />
                                </div>
                            </div>
                        </div>
                        <?php if($imagen != ''): ?>
                            <div class="text-center">
                                <div class="col-sm-6 col-md-4 col-xs-12 col-sm-offset-3" style="float: none;">
                                    <div class="thumbnail">
                                        <img class="card-img" src="img/portada/<?php echo e($imagen); ?>"
                                            alt="Imagen principal">
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>

                        <div class="ln_solid"></div>

                        <div class="row">
                            <div class="col-md-3 col-sm-12"></div>
                            <div class="col-md-6 col-sm-12 col-xs-12">
                                <div class="row">
                                    <div class="col-md-6 col-sm-6 col-xs-6"><button type="button"
                                            class="btn btn-success btn-block"
                                            onclick="cargar_portada_inicio(this.form);"><i class="fa fa-pencil"></i>
                                            Guardar</button></div>
                                    <div class="col-md-6 col-sm-6 col-xs-6"><a type="button" href="/admin"
                                            class="btn btn-dark btn-block"><i class="fa fa-times"></i> Cancelar</a>
                                    </div>

                                </div>
                            </div>
                            <div class="col-md-3 col-sm-12"></div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

    </div>
</div>
<?php /**PATH C:\xampp\htdocs\htdocs\petiShop\resources\views/admin/portada/nuevo.blade.php ENDPATH**/ ?>