91 lines
5.0 KiB
PHP
91 lines
5.0 KiB
PHP
<div class="page-header">
|
|
<div>
|
|
<h1><?= $this->escape($contact['name']) ?></h1>
|
|
<p><?= $contact['position'] ? $this->escape($contact['position']) . ' • ' : '' ?><?= $contact['org_name'] ? $this->escape($contact['org_name']) : 'مستقل' ?></p>
|
|
</div>
|
|
<div style="display: flex; gap: 10px;">
|
|
<a href="/admin/contacts/<?= $contact['id'] ?>/edit" class="btn btn-secondary">تعديل</a>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if ($flashSuccess = $this->session->getFlash('success')): ?>
|
|
<div class="alert alert-success"><span><?= $this->escape($flashSuccess) ?></span></div>
|
|
<?php endif; ?>
|
|
|
|
<div class="detail-grid">
|
|
<div class="glass-panel">
|
|
<h3 style="margin-bottom: 20px;">تفاصيل جهة الاتصال</h3>
|
|
<div class="detail-row">
|
|
<span class="detail-label">البريد الإلكتروني</span>
|
|
<span><?= $contact['email'] ? $this->escape($contact['email']) : '-' ?></span>
|
|
</div>
|
|
<div class="detail-row">
|
|
<span class="detail-label">رقم الهاتف</span>
|
|
<span><?= $contact['phone'] ? $this->escape($contact['phone']) : '-' ?></span>
|
|
</div>
|
|
<div class="detail-row">
|
|
<span class="detail-label">المسمى الوظيفي</span>
|
|
<span><?= $this->escape($contact['position'] ?? '-') ?></span>
|
|
</div>
|
|
<div class="detail-row">
|
|
<span class="detail-label">المنظمة / الجهة</span>
|
|
<span><?= $contact['org_id'] ? '<a href="/admin/organizations/' . $contact['org_id'] . '">' . $this->escape($contact['org_name']) . '</a>' : '-' ?></span>
|
|
</div>
|
|
<div class="detail-row" style="flex-direction: column; align-items: flex-start;">
|
|
<span class="detail-label">ملاحظات</span>
|
|
<p style="margin-top: 8px; line-height: 1.6;"><?= $this->escape($contact['notes'] ?? 'لا توجد ملاحظات') ?></p>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<!-- Interactions -->
|
|
<div class="glass-panel" style="margin-bottom: 20px;">
|
|
<h3 style="margin-bottom: 16px;">التفاعلات (<?= count($interactions) ?>)</h3>
|
|
|
|
<form action="/admin/contacts/<?= $contact['id'] ?>/interaction" method="POST" style="display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px;">
|
|
<input type="hidden" name="_csrf" value="<?= $this->session->getCsrfToken() ?>">
|
|
<div class="form-row" style="display: flex; gap: 10px;">
|
|
<select name="type" class="form-control" style="flex: 0 0 120px;">
|
|
<option value="note">ملاحظة</option>
|
|
<option value="email">بريد إلكتروني</option>
|
|
<option value="call">مكالمة هاتفية</option>
|
|
<option value="meeting">اجتماع</option>
|
|
</select>
|
|
<input type="text" name="notes" class="form-control" placeholder="إضافة تفاصيل التفاعل..." required>
|
|
<button type="submit" class="btn btn-primary">تسجيل</button>
|
|
</div>
|
|
</form>
|
|
|
|
<?php if (empty($interactions)): ?>
|
|
<p style="color: var(--text-muted);">لم يتم تسجيل أي تفاعلات بعد.</p>
|
|
<?php else: ?>
|
|
<?php foreach ($interactions as $interaction): ?>
|
|
<?php
|
|
$interTrans = [
|
|
'note' => 'ملاحظة',
|
|
'email' => 'بريد إلكتروني',
|
|
'call' => 'مكالمة هاتفية',
|
|
'meeting' => 'اجتماع'
|
|
];
|
|
$transType = $interTrans[$interaction['type']] ?? $interaction['type'];
|
|
?>
|
|
<div class="list-item">
|
|
<div style="display: flex; justify-content: space-between; align-items: center; flex-direction: row-reverse;">
|
|
<span class="badge" style="background: rgba(56, 189, 248, 0.2); color: #38bdf8;"><?= $this->escape($transType) ?></span>
|
|
<small style="color: var(--text-muted);"><?= date('Y-m-d H:i', strtotime($interaction['created_at'])) ?></small>
|
|
</div>
|
|
<p style="margin-top: 8px; line-height: 1.5; text-align: right;"><?= $this->escape($interaction['notes']) ?></p>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
|
|
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
|
|
.detail-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
|
|
.list-item { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
|
|
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }
|
|
</style>
|