<?php $__env->startSection("content"); ?>
    <div class="content-header row">
        <div class="content-header-left col-md-6 col-12 mb-2 breadcrumb-new">
            <h3 class="content-header-title mb-0 d-block">Reklam Düzenle</h3>
            <div class="row breadcrumbs-top d-inline-block">
                <div class="breadcrumb-wrapper col-12">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="<?php echo e(url('panel')); ?>">Anasayfa</a>
                        </li>
                        <li class="breadcrumb-item"><a href="<?php echo e(url('panel/reklamlar-yeni')); ?>">Reklamlar</a>
                        </li>
                        <li class="breadcrumb-item active"><?php echo e($reklamDetay->baslik); ?>

                        </li>
                    </ol>
                </div>
            </div>
        </div>
        <div class="content-header-right col-md-6 col-12">
            <div class="dropdown float-md-right">
                <a href="<?php echo e(url('panel/reklamlar-yeni')); ?>" class="btn btn-dark round btn-glow px-2">Geri Dön</a>
            </div>
        </div>
    </div>

    <div class="content-body">
        <div class="row">
            <div id="recent-sales" class="col-12 col-md-12">
                <div class="card">
                    <div class="card-content">
                        <div class="card-body">
                            <form class="form form-horizontal row-separator" action="<?php echo e(url('panel/reklamlar-yeni/duzenle/'.$reklamDetay->id)); ?>" method="post" enctype="multipart/form-data">
                                <?php echo csrf_field(); ?>
                                <div class="form-body">
                                    <h4 class="form-section"><i class="la la-bullhorn"></i> Reklam Bilgileri</h4>
                                    <div class="form-group row">
                                        <label class="col-md-3 label-control" for="konum">Konum</label>
                                        <div class="col-md-9">
                                            <select id="yer_id" name="yer_id" class="form-control">
                                                <?php $__currentLoopData = $kategoriler; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kategori): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($kategori->code); ?>" <?php if($reklamDetay->yer_id == $kategori->code): ?><?php echo e('selected'); ?><?php endif; ?>><?php echo e($kategori->title); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-3 label-control" for="baslik">Başlık:</label>
                                        <div class="col-md-9">
                                            <input type="text" id="baslik" class="form-control" name="baslik" required value="<?php echo e($reklamDetay->baslik); ?>">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-3 label-control" for="link">Reklam Linki:</label>
                                        <div class="col-md-9">
                                            <input type="url" id="link" class="form-control" name="link" value="<?php echo e($reklamDetay->link); ?>">
                                            <small class="text-muted">Bu alan sadece resim reklamlarda yönlendirilmek üzere kullanılmaktadır.</small>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-3 label-control pt-1">Reklam Türü:</label>
                                        <div class="col-md-9">
                                            <div class="d-inline-block custom-control custom-radio mr-1">
                                                <input type="radio" class="custom-control-input" name="tip" id="tip1" value="1" <?php if($reklamDetay->tip == 1): ?> <?php echo e('checked'); ?> <?php endif; ?>>
                                                <label class="custom-control-label" for="tip1">Resim Reklam</label>
                                            </div>
                                            <div class="d-inline-block custom-control custom-radio mr-1">
                                                <input type="radio" class="custom-control-input" name="tip" value="2" id="tip2" <?php if($reklamDetay->tip == 2): ?> <?php echo e('checked'); ?> <?php endif; ?>>
                                                <label class="custom-control-label" for="tip2">Kod Reklam</label>
                                            </div>
                                            <div class="d-inline-block custom-control custom-radio mr-1">
                                                <input type="radio" class="custom-control-input" name="tip" value="3" id="tip3" <?php if($reklamDetay->tip == 3): ?> <?php echo e('checked'); ?> <?php endif; ?>>
                                                <label class="custom-control-label" for="tip3">Flaş Reklam</label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group row" style="display: none">
                                        <label class="col-md-3 label-control">Reklam Boyutu:</label>
                                        <div class="col-md-4">
                                            <div class="input-group">
                                                <input name="genislik" type="number" class="form-control" id="genislik" value="<?php echo e($reklamDetay->genislik); ?>">
                                                <span class="input-group-addon">/</span>
                                                <input name="yukseklik" type="number" class="form-control" id="yukseklik" value="<?php echo e($reklamDetay->yukseklik); ?>">
                                            </div>
                                            <small class="text-muted">Değerler piksel formatında olmalıdır!</small>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-3 label-control">Reklam Görseli:</label>
                                        <div class="col-md-9">
                                            <input type="file" id="resim" name="resim" class="dropify" accept="image/*,.swf" data-default-file="<?php echo e(url('images/reklamlar/'.$reklamDetay->resim)); ?>">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-3 label-control" for="kod">Reklam Kodu:</label>
                                        <div class="col-md-9">
                                            <textarea id="metin" rows="5" class="form-control" name="metin"><?php echo e($reklamDetay->metin); ?></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-3 label-control" for="bitis">Bitiş Tarihi:</label>
                                        <div class="col-md-5">
                                            <div class='input-group'>
                                                <input id="bitis" name="bitis" type='text' class="form-control singledate" autocomplete="off" value="<?php if($reklamDetay->bitis != null): ?> <?php echo e(date('d-m-Y H:i',strtotime($reklamDetay->bitis))); ?> <?php endif; ?>" />
                                                <div class="input-group-append">
                            <span class="input-group-text">
                              <span class="la la-calendar"></span>
                            </span>
                                                </div>
                                            </div>
                                            <small class="text-muted">Reklam bitiş tarihini seçin. Eğer sınırsız süre ise boş bırakınız.</small>
                                        </div>
                                    </div>
                                    <div class="form-group row last">
                                        <label class="sr-only" for="durum">Durum</label>
                                        <div class="col-md-9 offset-md-3">
                                            <label for="durum" class="mr-1 mb-0">Durum</label>
                                            <input type="checkbox" id="durum" name="durum" class="switchery" data-size="sm" <?php if($reklamDetay->durum == 1): ?> <?php echo e('checked'); ?> <?php endif; ?>/>
                                            <label for="donusum" class="mb-0 mr-1 ml-3">Dönüşümlü</label>
                                            <input type="checkbox" id="donusumlu" name="donusumlu" class="switchery" data-size="sm" <?php if($reklamDetay->donusumlu == 1): ?> <?php echo e('checked'); ?> <?php endif; ?> />
                                            <small class="text-muted d-block mt-1">Dönüşümlü özelliği aktif olan reklamlar her sayfa yenilendiğinde bulunduğu bölgede farklı reklam gösterir</small>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-actions right mt-0">
                                    <button type="submit" class="btn btn-success">
                                        <i class="la la-check"></i> Kaydet
                                    </button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush("customJs"); ?>
    <script src="<?php echo e(asset('assets/backend/app-assets/vendors/js/forms/toggle/switchery.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('assets/backend/app-assets/vendors/js/pickers/dateTime/moment-with-locales.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/backend/app-assets/vendors/js/pickers/daterange/daterangepicker.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('assets/backend/app-assets/vendors/js/dropify/js/dropify.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('assets/backend/app-assets/vendors/js/forms/select/select2.full.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('assets/backend/app-assets/vendors/js/forms/select/tr.js')); ?>" type="text/javascript"></script>
    <script>
        // Switchery
        var i = 0;
        if (Array.prototype.forEach) {

            var elems = $('.switchery');
            $.each( elems, function( key, value ) {
                var $size="", $color="",$sizeClass="", $colorCode="";
                $size = $(this).data('size');
                var $sizes ={
                    'lg' : "large",
                    'sm' : "small",
                    'xs' : "xsmall"
                };
                if($(this).data('size')!== undefined){
                    $sizeClass = "switchery switchery-"+$sizes[$size];
                }
                else{
                    $sizeClass = "switchery";
                }

                $color = $(this).data('color');
                var $colors ={
                    'primary' : "#967ADC",
                    'success' : "#37BC9B",
                    'danger' : "#DA4453",
                    'warning' : "#F6BB42",
                    'info' : "#3BAFDA"
                };
                if($color !== undefined){
                    $colorCode = $colors[$color];
                }
                else{
                    $colorCode = "#37BC9B";
                }

                var switchery = new Switchery($(this)[0], { className: $sizeClass, color: $colorCode });
            });
        } else {
            var elems1 = document.querySelectorAll('.switchery');

            for (i = 0; i < elems1.length; i++) {
                var $size = elems1[i].data('size');
                var $color = elems1[i].data('color');
                var switchery = new Switchery(elems1[i], { color: '#37BC9B' });
            }
        }

        $('.singledate').daterangepicker({
                singleDatePicker: true,
                showDropdowns: true,
                timePicker: true,
                timePickerIncrement: 10,
                autoApply : true,
                autoUpdateInput: false,
                locale: {
                    format: 'DD-MM-YYYY HH:mm',
                    firstDay:1,
                    separator: " - ",
                    applyLabel: "Onayla",
                    cancelLabel: "İptal",
                    daysOfWeek: ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"],
                    monthNames: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos","Eylül","Ekim","Kasım","Aralık"]
                },
                timePicker24Hour: true
            },
            function(start_date) {
                this.element.val(start_date.format('DD-MM-YYYY HH:mm'));
            });

        $('.dropify').dropify({
            messages: {
                'default': 'Reklam dosyasını buraya sürükleyin veya tıklayıp yükleyin.',
                'replace': 'Reklam dosyasını değiştirmek için buraya sürükleyin veya tıklayıp yükleyin.',
                'remove':  'Sil',
                'error':   'Hata, lütfen tekrar deneyin!'
            }
        });
        $(".select2").select2({
            placeholder:"Reklam Konumu Seçiniz"
        });
    </script>
<?php $__env->stopPush(); ?>

<?php $__env->startPush("customCss"); ?>
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/backend/app-assets/vendors/css/forms/toggle/switchery.min.css')); ?>">
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/backend/app-assets/vendors/js/dropify/css/dropify.min.css')); ?>">
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/backend/app-assets/vendors/css/pickers/daterange/daterangepicker.css')); ?>">
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/backend/app-assets/vendors/css/forms/selects/select2.min.css')); ?>">
    <style>
        span.select2-selection.select2-selection--single, .select2-search__field {
            outline: none;
        }
        .select2-results__option {
            padding: 3px;
        }
    </style>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('backend.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/yeniistik/public_html/resources/views/backend/reklamlar/duzenle.blade.php ENDPATH**/ ?>