PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: edit.php Size: 6.12 KB
/home/ankaservis/public_html/app/views/admin/posts/edit.php

<?php
ob_start();
?>

<div class="bg-white rounded-lg shadow p-6">
    <h2 class="text-2xl font-bold text-anka-gray mb-6">Çözüm Düzenle</h2>

    <form method="POST" action="<?php echo Helper::url('/admin/posts/edit/' . $post['id']); ?>">
        <div class="space-y-4">
            <div>
                <label class="block text-gray-700 font-semibold mb-2">Başlık *</label>
                <input type="text" name="title" value="<?php echo Helper::escape($post['title']); ?>" required class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-anka-orange focus:border-transparent">
            </div>

            <div>
                <label class="block text-gray-700 font-semibold mb-2">Özet</label>
                <textarea name="excerpt" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-anka-orange focus:border-transparent"><?php echo Helper::escape($post['excerpt'] ?? ''); ?></textarea>
                <p class="text-sm text-gray-500 mt-1">Kısa açıklama (opsiyonel)</p>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                <div>
                    <label class="block text-gray-700 font-semibold mb-2">Cihaz Tipi</label>
                    <select name="device_type" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-anka-orange focus:border-transparent">
                        <option value="">Seçiniz (Opsiyonel)</option>
                        <option value="Buzdolabı" <?php echo ($post['device_type'] ?? '') === 'Buzdolabı' ? 'selected' : ''; ?>>Buzdolabı</option>
                        <option value="Çamaşır Makinesi" <?php echo ($post['device_type'] ?? '') === 'Çamaşır Makinesi' ? 'selected' : ''; ?>>Çamaşır Makinesi</option>
                        <option value="Bulaşık Makinesi" <?php echo ($post['device_type'] ?? '') === 'Bulaşık Makinesi' ? 'selected' : ''; ?>>Bulaşık Makinesi</option>
                        <option value="Fırın" <?php echo ($post['device_type'] ?? '') === 'Fırın' ? 'selected' : ''; ?>>Fırın</option>
                        <option value="Ocak" <?php echo ($post['device_type'] ?? '') === 'Ocak' ? 'selected' : ''; ?>>Ocak</option>
                        <option value="Kombi" <?php echo ($post['device_type'] ?? '') === 'Kombi' ? 'selected' : ''; ?>>Kombi</option>
                        <option value="Klima" <?php echo ($post['device_type'] ?? '') === 'Klima' ? 'selected' : ''; ?>>Klima</option>
                        <option value="Televizyon" <?php echo ($post['device_type'] ?? '') === 'Televizyon' ? 'selected' : ''; ?>>Televizyon</option>
                    </select>
                    <p class="text-sm text-gray-500 mt-1">SEO için: URL'de görünecek (örn: /cozum-merkezi/buzdolabi/...)</p>
                </div>
                <div>
                    <label class="block text-gray-700 font-semibold mb-2">Marka</label>
                    <input type="text" name="brand" value="<?php echo Helper::escape($post['brand'] ?? ''); ?>" placeholder="Örn: Bosch, Arçelik, Vestel" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-anka-orange focus:border-transparent">
                    <p class="text-sm text-gray-500 mt-1">SEO için: URL'de görünecek (örn: /cozum-merkezi/buzdolabi/bosch/...)</p>
                </div>
            </div>

            <div>
                <label class="block text-gray-700 font-semibold mb-2">İçerik *</label>
                <textarea id="content" name="content" required><?php echo $post['content']; ?></textarea>
            </div>

            <div>
                <label class="block text-gray-700 font-semibold mb-2">Durum</label>
                <select name="status" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-anka-orange focus:border-transparent">
                    <option value="draft" <?php echo $post['status'] === 'draft' ? 'selected' : ''; ?>>Taslak</option>
                    <option value="published" <?php echo $post['status'] === 'published' ? 'selected' : ''; ?>>Yayınla</option>
                </select>
            </div>

            <div class="flex space-x-4">
                <button type="submit" class="bg-anka-orange hover:bg-orange-600 text-white px-6 py-2 rounded-lg transition">
                    Güncelle
                </button>
                <a href="<?php echo Helper::url('/admin/posts'); ?>" class="bg-gray-300 hover:bg-gray-400 text-gray-800 px-6 py-2 rounded-lg transition">
                    İptal
                </a>
            </div>
        </div>
    </form>
</div>

<script>
$(document).ready(function() {
    $('#content').summernote({
        height: 400,
        lang: 'tr-TR',
        toolbar: [
            ['style', ['style']],
            ['font', ['bold', 'italic', 'underline', 'clear']],
            ['fontname', ['fontname']],
            ['fontsize', ['fontsize']],
            ['color', ['color']],
            ['para', ['ul', 'ol', 'paragraph']],
            ['table', ['table']],
            ['insert', ['link', 'picture', 'video']],
            ['view', ['fullscreen', 'codeview', 'help']]
        ],
        callbacks: {
            onImageUpload: function(files) {
                uploadImage(files[0]);
            }
        }
    });
    
    function uploadImage(file) {
        var formData = new FormData();
        formData.append('image', file);
        
        $.ajax({
            url: '<?php echo Helper::url('/admin/upload-image'); ?>',
            method: 'POST',
            data: formData,
            processData: false,
            contentType: false,
            success: function(response) {
                if (response.success) {
                    $('#content').summernote('insertImage', response.url);
                } else {
                    alert('Resim yükleme hatası: ' + (response.message || 'Bilinmeyen hata'));
                }
            },
            error: function() {
                alert('Resim yüklenirken bir hata oluştu.');
            }
        });
    }
});
</script>

<?php
$content = ob_get_clean();
require_once APP_PATH . '/app/views/admin/layout.php';
?>

Directory Contents

Dirs: 0 × Files: 3

Name Size Perms Modified Actions
5.18 KB lrw-r--r-- 2025-11-17 19:50:54
Edit Download
6.12 KB lrw-r--r-- 2025-11-17 19:50:54
Edit Download
8.19 KB lrw-r--r-- 2025-11-17 19:50:54
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI