<?php

$imagesDao = new \Dao\GaleriasImages();

$imagesDao->getImagemPorId($conecta, base64_decode(filter_input(INPUT_GET, 'id')));

$galeriasDao = new \Dao\Galerias();

$galeriasDao->getGaleriaPorId($conecta, $imagesDao->fk_id_galeria);

?>

<div class="breadcrumb-holder">

    <div class="container-fluid">

        <ul class="breadcrumb">

            <li class="breadcrumb-item"><a href="./">Home</a></li>

            <li class="breadcrumb-item"><a href="galerias.php">Galerias</a></li>

            <li class="breadcrumb-item"><a href="?p=fotos&id=<?php echo base64_encode($galeriasDao->id); ?>">Fotos</a></li>

            <li class="breadcrumb-item active">Editar Imagem</li>

        </ul><!--/.breadcrumb -->

    </div><!---/.container-fluid -->

</div><!--/.breadcrumb-holder -->

<section class="dashboard-counts section-padding">

    <div class="container-fluid">

        <div class="row">

            <div class="col-lg-12">

                <div class="card">

                    <div class="card-header d-flex align-items-center">

                        <h2 class="h5 display">Editar Imagem</h2>

                    </div><!--/.card-header -->

                    <div class="card-body">

                        <form class="form-horizontal" method="post" action="?p=fotos-salvar" enctype="multipart/form-data">

                            <input type="hidden" name="id" id="id" value="<?php echo $imagesDao->id; ?>">

                            <div class="form-group row">

                                <label class="col-sm-2 form-label">Legenda</label>

                                <div class="col-sm-7">

                                    <input type="text" name="legenda" id="legenda" placeholder="Legenda" value="<?php echo $imagesDao->legenda; ?>" maxlength="250" class="form-control" autofocus>

                                </div>

                            </div>

                            <div class="form-group row">

                                <label class="col-sm-2 form-label">Imagem</label>

                                <div class="col-sm-10">

                                    <img src="<?php echo $pasta . $imagesDao->image; ?>" height="100" alt="" />

                                </div>

                            </div>

                            <div class="form-group row">

                                <label class="col-sm-2"></label>

                                <div class="col-sm-2">

                                    <button class="btn btn-sm btn-primary">

                                        <i class="fa fa-database"></i> Salvar

                                    </button>

                                </div>

                            </div><!--/.form-group -->

                        </form>

                    </div><!--/.card-body -->

                </div><!--/.card -->

            </div><!--/.col-lg-12 -->

        </div><!--/.row -->

    </div><!--/.container-fluid -->

</section><!--/.dashboard-counts -->