<section id="main-content">
    <section class="wrapper">
        <div class="msg">
            <?php if ($this->session->flashdata('flash_msg')) { ?>
                <?php $alert = $this->session->flashdata('flash_msg'); ?>
                <div class="alert alert-<?= $alert['type']; ?> alert-dismissible" role="alert">
                    <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <?= $alert['msg']; ?>
                </div>
            <?php } ?>
        </div>
        <div class="row">
            <div class="col-sm-12">   
                <?= form_open(site_url('profile'), 'role="form"'); ?>
                <section class="panel">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Nom :</label>
                                <div class="form-group<?= (form_error('profile[name]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[name]'], $profile[0]['name'], 'class="form-control" placeholder="Nom et Prénom" htmlEscape="true" readonly'); ?>
                                        <?= form_error('profile[name]'); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Post :</label>
                                <div class="form-group<?= (form_error('profile[post]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[post]'], $profile[0]['post'], 'class="form-control" placeholder="Post" htmlEscape="true"'); ?>
                                        <?= form_error('profile[post]'); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <section class="panel">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Présentation :</label>
                                <div class="form-group<?= (form_error('profile[description]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_textarea(['name' => 'profile[description]', 'rows' => '5', 'cols' => '5', 'class' => 'editablearea form-control'], $profile[0]['description'], 'placeholder="Présentation de la société" htmlEscape="true"'); ?>
                                        <?= form_error('profile[description]'); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Organisation :</label>
                                <div class="form-group<?= (form_error('profile[about]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_textarea(['name' => 'profile[about]', 'rows' => '5', 'cols' => '5', 'class' => 'editablearea form-control'], $profile[0]['about'], 'placeholder="Organisation de la société" htmlEscape="true"'); ?>
                                        <?= form_error('profile[about]'); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <section class="panel">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Address 1 :</label>
                                <div class="form-group<?= (form_error('profile[address1]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[address1]'], $profile[0]['address1'], 'class="form-control" placeholder="Adresse" htmlEscape="true"'); ?>
                                        <?= form_error('profile[address1]'); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Address 2 :</label>
                                <div class="form-group<?= (form_error('profile[address2]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[address2]'], $profile[0]['address2'], 'class="form-control" placeholder="Adresse" htmlEscape="true"'); ?>
                                        <?= form_error('profile[address2]'); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <section class="panel">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Numéro de Téléphone :</label>
                                <div class="form-group<?= (form_error('profile[tel]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[tel]'], $profile[0]['tel'], 'class="form-control" placeholder="Tél" htmlEscape="true"'); ?>
                                        <?= form_error('profile[tel]'); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Fax :</label>
                                <div class="form-group<?= (form_error('profile[fax]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[fax]'], $profile[0]['fax'], 'class="form-control" placeholder="Fax" htmlEscape="true"'); ?>
                                        <?= form_error('profile[fax]'); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Mobile :</label>
                                <div class="form-group<?= (form_error('profile[mobile]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[mobile]'], $profile[0]['mobile'], 'class="form-control" placeholder="Mobile" htmlEscape="true"'); ?>
                                        <?= form_error('profile[mobile]'); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Site web :</label>
                                <div class="form-group<?= (form_error('profile[site_web]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[site_web]'], $profile[0]['site_web'], 'class="form-control" placeholder="Site web" htmlEscape="true"'); ?>
                                        <?= form_error('profile[site_web]'); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Email_contact :</label>
                                <div class="form-group<?= (form_error('profile[email_contact]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[email_contact]'], $profile[0]['email_contact'], 'class="form-control" placeholder="Email" htmlEscape="true"'); ?>
                                        <?= form_error('profile[email_contact]'); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <label class="control-label" for="">Email_notification :</label>
                                <div class="form-group<?= (form_error('profile[email_notification]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_input(['name' => 'profile[email_notification]'], $profile[0]['email_notification'], 'class="form-control" placeholder="Email" htmlEscape="true"'); ?>
                                        <?= form_error('profile[email_notification]'); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <section class="panel">
                    <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="">Maps :</label> <span style="padding-top: 20px; color: #419873;"> id="map-canvas" </span>
                                <div class="form-group<?= (form_error('profile[maps]') ? ' has-error' : ''); ?>">
                                    <div class="col-xs-12">
                                        <?= form_textarea(['name' => 'profile[maps]', 'rows' => '5', 'cols' => '10'], $profile[0]['maps'], 'class="form-control" placeholder="Maps" htmlEscape="true"'); ?>
                                        <?= form_error('profile[maps]'); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <section class="panel">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right">
                                <?= form_submit('submit', 'Enregistrer les modifications', 'class="btn btn-success btn-sm"'); ?>
                            </div>
                        </div>
                    </div>
                </section>
                <?= form_close(); ?>
            </div>
        </div>
    </section>
</section>