Deploy on 2026-06-05 17:47:27

This commit is contained in:
Hamza-Ayed
2026-06-05 17:47:27 +03:00
parent e5074451af
commit f468227019
15 changed files with 415 additions and 225 deletions

View File

@@ -1,10 +1,10 @@
<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']) : 'Independent' ?></p>
<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">Edit</a>
<a href="/admin/contacts/<?= $contact['id'] ?>/edit" class="btn btn-secondary">تعديل</a>
</div>
</div>
@@ -14,58 +14,67 @@
<div class="detail-grid">
<div class="glass-panel">
<h3 style="margin-bottom: 20px;">Contact Details</h3>
<h3 style="margin-bottom: 20px;">تفاصيل جهة الاتصال</h3>
<div class="detail-row">
<span class="detail-label">Email</span>
<span class="detail-label">البريد الإلكتروني</span>
<span><?= $contact['email'] ? $this->escape($contact['email']) : '-' ?></span>
</div>
<div class="detail-row">
<span class="detail-label">Phone</span>
<span class="detail-label">رقم الهاتف</span>
<span><?= $contact['phone'] ? $this->escape($contact['phone']) : '-' ?></span>
</div>
<div class="detail-row">
<span class="detail-label">Position</span>
<span class="detail-label">المسمى الوظيفي</span>
<span><?= $this->escape($contact['position'] ?? '-') ?></span>
</div>
<div class="detail-row">
<span class="detail-label">Organization</span>
<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">Notes</span>
<p style="margin-top: 8px; line-height: 1.6;"><?= $this->escape($contact['notes'] ?? 'No notes') ?></p>
<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;">Interactions (<?= count($interactions) ?>)</h3>
<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">Note</option>
<option value="email">Email</option>
<option value="call">Call</option>
<option value="meeting">Meeting</option>
<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="Add interaction note..." required>
<button type="submit" class="btn btn-primary">Log</button>
<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);">No interactions logged yet.</p>
<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;">
<span class="badge" style="background: rgba(56, 189, 248, 0.2); color: #38bdf8;"><?= $this->escape($interaction['type']) ?></span>
<small style="color: var(--text-muted);"><?= date('M j, g:i a', strtotime($interaction['created_at'])) ?></small>
<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;"><?= $this->escape($interaction['notes']) ?></p>
<p style="margin-top: 8px; line-height: 1.5; text-align: right;"><?= $this->escape($interaction['notes']) ?></p>
</div>
<?php endforeach; ?>
<?php endif; ?>