<?php echo $header; ?><?php echo $column_left; ?>
    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <button type="submit" form="form-category" data-toggle="tooltip" title="Kaydet"
                            class="btn btn-primary"><i class="fa fa-save"></i> Kaydet
                    </button>
                    <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="Etiket Listesine Geri Dön"
                       class="btn btn-default"><i class="fa fa-reply"></i> Etiket Listesine Geri Dön</a></div>
                <h1><?php echo $heading_title; ?></h1>
                <ul class="breadcrumb">
                    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
                        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
                    <?php } ?>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <?php if ($error_warning) { ?>
                <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                </div>
            <?php } ?>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_form; ?></h3>
                </div>
                <div class="panel-body">
                    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-category"
                          class="form-horizontal">
                        <div class="tab-content">
                            <div class="tab-pane active">
                                <ul class="nav nav-tabs" id="language">
                                    <?php foreach ($languages as $language) { ?>

                                        <li><a href="#language<?php echo $language['language_id']; ?>"
                                               data-toggle="tab"><img
                                                        src="//scripts.piyersoft.com/images/language/<?php echo $language['code']; ?>.png"
                                                        title="<?php echo $language['name']; ?>"/> <?php echo $language['name']; ?>
                                            </a></li>

                                    <?php } ?>
                                </ul>
                                <div class="tab-content">
                                    <div class="tab-pane" id="language<?php echo $language['language_id']; ?>">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">Resim</label>
                                            <div class="col-sm-10"><a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="<?php echo $thumb; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
                                                <input type="hidden" name="image" value="<?php echo $image; ?>" id="input-image" />
                                            </div>
                                        </div>
                                        <div class="form-group required">
                                            <label class="col-sm-2 control-label" for="model_name">Model Adı</label>
                                            <div class="col-sm-10">
                                                <input type="text" name="model_name" placeholder="Model Adı"
                                                       class="form-control" required="required"
                                                       value="<?php if (!empty($sticker['model_name'])) echo $sticker['model_name']; ?>"/>
                                            </div>
                                        </div>
                                        <div class="form-group required">
                                            <label class="col-sm-2 control-label" for="sticker_name">Etiket
                                                Adı</label>
                                            <div class="col-sm-10">
                                                <input type="text" name="sticker_name" placeholder="Etiket Adı"
                                                       class="form-control" required="required"
                                                       value="<?php if (!empty($sticker['name'])) echo $sticker['name']; ?>"/>
                                            </div>
                                        </div>
                                        <div class="form-group required">
                                            <label class="col-sm-2 control-label" for="sticker_color">Etiket
                                                Rengi</label>
                                            <div class="col-sm-10 col-md-3">
                                                <input type="color" name="sticker_color" placeholder="Etiket Rengi"
                                                       class="form-control"
                                                       required="required"
                                                       value="<?php if (!empty($sticker['color'])) echo $sticker['color']; ?>"/>
                                            </div>
                                        </div>
                                        <div class="form-group required">
                                            <label class="col-sm-2 control-label" for="text_size">Yazı
                                                Boyutu</label>
                                            <div class="col-sm-10">
                                                <input type="number" name="text_size" placeholder="Yazı Boyutu"
                                                       class="form-control" required="required"
                                                       value="<?php if (!empty($sticker['text_size'])) echo $sticker['text_size']; ?>"/>
                                            </div>
                                        </div>
                                        <div class="form-group required">
                                            <label class="col-sm-2 control-label" for="direction">Etiket
                                                Yönü</label>
                                            <div class="col-sm-10">
                                                <select class="form-control" name="direction" required="required">
                                                    <?php if (!empty($sticker['direction'])) { ?>
                                                        <option <?php if ($sticker['direction'] === "left") { ?> selected <?php } ?>
                                                                value="left">Sol
                                                        </option>
                                                        <option <?php if ($sticker['direction'] === "right") { ?> selected <?php } ?>
                                                                value="right">Sağ
                                                        </option>
                                                    <?php } else { ?>
                                                        <option selected>Etiket Yönünü Seçiniz</option>
                                                        <option value="left">Sol</option>
                                                        <option value="right">Sağ</option>
                                                    <?php } ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group required">
                                            <label class="col-sm-2 control-label" for="finished_at">Bitiş Tarihi</label>
                                            <div class="col-sm-10 col-md-3">
                                                <input type="date" name="finished_at" placeholder="Bitiş Tarihi"
                                                       class="form-control"
                                                       value="<?php if (!empty($sticker['finished_at'])) echo $sticker['finished_at']; ?>"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <script type="text/javascript"> $('#language a:first').tab('show'); </script>
    </div>
<?php echo $footer; ?>