<div class="content">
    <div class="container">


        <?php
        if ($_GET["islem"] == 'duzenle') {
            $yenille = $db->query("select * from addim where id='{$_GET["id"]}'")->fetch(PDO::FETCH_ASSOC);
        }
        ?>

        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">Addım Əlavəsi</h3>
                    </div>
                    <div class="panel-body">
                        <form class="form-horizontal" action="include/fonksiyonlar.php" method="post" enctype="multipart/form-data">
                            <div class="form-group">
                                <label class="col-md-2 control-label">Sıra</label>
                                <div class="col-md-10">
                                    <input type="text" class="form-control" name="sira" value="<?= $yenille["sira"] ?>">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label" for="example-email">Adı</label>
                                <div class="col-md-10">
                                    <input type="text" id="example-email" name="adi" class="form-control" value="<?= $yenille["adi"] ?>">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">Icon şəkli</label>
                                <div class="col-md-10">
                                    <input type="file" class="form-control" name="resim" placeholder="placeholder">
                                </div>
                            </div>
                            <?php if ($_GET["islem"] == 'duzenle') { ?>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">Hazırki İcon</label>
                                    <div class="col-md-10">
                                        <img src="../imgupload/<?= $yenille["resim"] ?>" width="200">
                                    </div>
                                </div>
                            <?php } ?>
                            <input type="hidden" name="lan" value="<?= $dilsec["id"] ?>">
                            <div class="form-group">
                                <label class="col-md-2 control-label" for="example-email">Və ya İcon linki</label>
                                <div class="col-md-10">
                                    <input type="text" id="example-email" name="linki" class="form-control" value="<?= $yenille["linki"] ?>">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-md-2 control-label">Mətni</label>
                                <div class="col-md-10">
                                    <textarea class="form-control ckeditor" rows="5" name="aciklama"><?= $yenille["aciklama"] ?></textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">Vəziyyəti</label>
                                <div class="col-sm-10">
                                    <select class="form-control" name="veziyyeti">
                                        <option value="0" <?php if ($yenille["veziyyeti"] == 0) {
                                                                echo ' selected';
                                                            } ?>>Göstər</option>
                                        <option value="1" <?php if ($yenille["veziyyeti"] == 1) {
                                                                echo ' selected';
                                                            } ?>>Gizlət</option>

                                    </select>

                                </div>
                            </div>

                            <div class="form-group ">
                                <div class="col-sm-offset-11 col-sm-1">
                                    <?php if ($_GET["islem"] == 'duzenle') { ?>
                                        <input type="hidden" name="link" value="../addim-elavesi?islem=duzenle&id=<?= $yenille["id"] ?>">
                                        <input type="hidden" name="id" value="<?= $yenille["id"] ?>">
                                        <button type="submit" name="addim-yenille" class="btn btn-info waves-effect waves-light">Yenilə</button>
                                    <?php } else { ?>
                                        <input type="hidden" name="link" value="../addim-elavesi">
                                        <button type="submit" name="addim-elavesi" class="btn btn-info waves-effect waves-light">Əlavə et</button>
                                    <?php } ?>
                                </div>
                            </div>

                        </form>
                    </div> <!-- panel-body -->
                </div> <!-- panel -->
            </div> <!-- col -->
        </div>

    </div> <!-- container -->

</div>