<!--main content start-->
<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <div class="col-sm-12">
                <?= form_open(site_url('galerie/' . $galerie['id'] . '/edit'), 'role="form"'); ?>
                <section class="panel">
                    <header class="panel-heading">
                        Modifer un Album
                        <span class="tools pull-right">
                            <a href="javascript:;" class="fa fa-chevron-down"></a>
                        </span>
                    </header>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="title">Publie :</label>
                                    <input type="radio" value="1" name="galerie[display]" <?php if($galerie['display']){?>checked=""<?php } ?> class="radio-button"> Oui
                                    <input type="radio" value="0" name="galerie[display]" <?php if(!$galerie['display']){?>checked=""<?php } ?> class="radio-button"> Non
                            </div>
                            <div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
                                <div class="form-group<?= (form_error('galerie[title]') ? ' has-error' : ''); ?>">
                                    <label class="control-label" for="title">Titre :</label>
                                    <?= (form_error('galerie[title]') ? form_error('galerie[title]', ' <span class="help-inline"> | ', '</span>') : ''); ?>
                                    <?= form_input('galerie[title]', set_value('galerie[title]', $galerie['title']), 'class="form-control" placeholder="Titre" htmlEscape="true"'); ?>
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
                                <div class="form-group<?= (form_error('galerie[pos]') ? ' has-error' : ''); ?>">
                                    <label class="control-label" for="title">Position :</label>
                                    <?= (form_error('galerie[pos]') ? form_error('galerie[pos]', ' <span class="help-inline"> | ', '</span>') : ''); ?>
                                    <?= form_input('galerie[pos]', set_value('galerie[pos]', $galerie['pos']), 'class="form-control" placeholder="Position" htmlEscape="true"'); ?>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-group<?= (form_error('galerie[date]') ? ' has-error' : ''); ?>">
                                    <label class="control-label" for="title">Date :</label>
                                    <?= (form_error('galerie[date]') ? form_error('galerie[date]', ' <span class="help-inline"> | ', '</span>') : ''); ?>
                                    <?= form_input('galerie[date]', set_value('galerie[date]', $galerie['date']), 'class="form-control datepicker" placeholder="date" autocomplete="off" htmlEscape="true"'); ?>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-group<?= (form_error('galerie[address]') ? ' has-error' : ''); ?>">
                                    <label class="control-label" for="title">Adresse :</label>
                                    <?= (form_error('galerie[address]') ? form_error('galerie[address]', ' <span class="help-inline"> | ', '</span>') : ''); ?>
                                    <?= form_input('galerie[address]', set_value('galerie[address]', $galerie['address']), 'class="form-control" placeholder="Adresse" htmlEscape="true"'); ?>
                                </div>
                            </div>
                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                <div class="form-group<?= (form_error('galerie[description]') ? ' has-error' : ''); ?>">
                                    <label class="control-label" for="title">Description :</label>
                                    <?= (form_error('galerie[description]') ? form_error('galerie[description]', ' <span class="help-inline"> | ', '</span>') : ''); ?>
                                    <?= form_textarea(['name' => 'galerie[description]', 'rows' => '5', 'cols' => '5'], set_value('galerie[description]', $galerie['description']), 'class="form-control" placeholder="Description" htmlEscape="true"'); ?>
                                </div>
                            </div>

                            
                            
                            <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                                <div class="form-group">
                                    <label class="control-label">Miniature :</label>
                                    <div class="fileupload fileupload-new">
                                        <div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
                                            <?php if ($galerie['image']['name']) { ?>
                                                <img src="<?= base_url() . 'assets/uploads/' . $galerie['image']['name']; ?>" alt="" />
                                            <?php } else { ?>
                                                <img src="<?= images_url() . 'no-pic.png'; ?>" alt="" />
                                            <?php } ?>
                                        </div>
                                        <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
                                        <div>
                                            <span class="btn btn-white btn-file" style="border-color: rgba(150, 160, 180, 0.3);">
                                                <span class="fileupload-new thumbnail-load"><i class="fa fa-paper-clip"></i>Changer</span>
                                                <span class="fileupload-exists thumbnail-change"><i class="fa fa-undo"></i>Changer</span>
                                            </span>
                                            <a class="btn btn-danger fileupload-exists thumbnail-delete" data-dismiss="fileupload"><i class="fa fa-trash"></i> Supprimer</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12 update">
                                <div class="form-group">
                                    <label class="control-label">Images :</label>
                                    <div id="mydropzone" class="dropzone dz-clickable"></div>
                                </div>
                                <input id="files" name="files" type="hidden" value="">
                                <input id="file" name="resource" type="hidden" value=""/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right">
                                <?= form_submit('submit', 'Modifier', 'class="btn btn-success btn-sm"'); ?>
                            </div>
                        </div>
                    </div>
                </section>
                <?= form_close(); ?>
            </div>
        </div>
        <!-- page end-->
    </section>
</section>
<!--main content end-->