Add complete ScoutIQ system: Crawler (RSS+AI), CRUD Controllers (Organizations, Contacts, Opportunities, Sources), dynamic Views, API routes, CLI collector
This commit is contained in:
59
resources/views/admin/contacts/form.php
Normal file
59
resources/views/admin/contacts/form.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<div class="page-header">
|
||||
<h1><?= $contact ? 'Edit' : 'Add' ?> Contact</h1>
|
||||
</div>
|
||||
|
||||
<div class="glass-panel" style="max-width: 600px;">
|
||||
<form action="/admin/contacts/store" method="POST" class="form-stacked">
|
||||
<?php if ($contact): ?>
|
||||
<input type="hidden" name="id" value="<?= $contact['id'] ?>">
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="_csrf" value="<?= $this->session->getCsrfToken() ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Name *</label>
|
||||
<input type="text" name="name" class="form-control" required value="<?= $contact ? $this->escape($contact['name']) : '' ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Email</label>
|
||||
<input type="email" name="email" class="form-control" value="<?= $contact ? $this->escape($contact['email'] ?? '') : '' ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Phone</label>
|
||||
<input type="text" name="phone" class="form-control" value="<?= $contact ? $this->escape($contact['phone'] ?? '') : '' ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Position / Title</label>
|
||||
<input type="text" name="position" class="form-control" placeholder="e.g. Partner, Director" value="<?= $contact ? $this->escape($contact['position'] ?? '') : '' ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Organization</label>
|
||||
<select name="organization_id" class="form-control">
|
||||
<option value="">No Organization</option>
|
||||
<?php foreach ($organizations as $org): ?>
|
||||
<option value="<?= $org['id'] ?>" <?= ($selectedOrgId == $org['id']) ? 'selected' : '' ?>><?= $this->escape($org['name']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Notes</label>
|
||||
<textarea name="notes" class="form-control" rows="3"><?= $contact ? $this->escape($contact['notes'] ?? '') : '' ?></textarea>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; gap: 12px; margin-top: 10px;">
|
||||
<button type="submit" class="btn btn-primary"><?= $contact ? 'Update' : 'Create' ?> Contact</button>
|
||||
<a href="/admin/contacts" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.form-stacked { display: flex; flex-direction: column; gap: 16px; }
|
||||
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
||||
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
|
||||
</style>
|
||||
67
resources/views/admin/contacts/index.php
Normal file
67
resources/views/admin/contacts/index.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1>Contacts</h1>
|
||||
<p>Manage your network of investor contacts and interactions</p>
|
||||
</div>
|
||||
<a href="/admin/contacts/create" class="btn btn-primary">+ Add Contact</a>
|
||||
</div>
|
||||
|
||||
<?php if ($flashSuccess = $this->session->getFlash('success')): ?>
|
||||
<div class="alert alert-success"><span><?= $this->escape($flashSuccess) ?></span></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="filters-bar">
|
||||
<form method="GET" class="filters-form">
|
||||
<input type="text" name="search" class="form-control" placeholder="Search contacts..." value="<?= $this->escape($search) ?>">
|
||||
<button type="submit" class="btn btn-secondary">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="glass-panel" style="overflow-x: auto;">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Organization</th>
|
||||
<th>Email</th>
|
||||
<th>Interactions</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (empty($contacts)): ?>
|
||||
<tr><td colspan="6" style="text-align: center; padding: 40px; color: var(--text-muted);">No contacts yet.</td></tr>
|
||||
<?php else: ?>
|
||||
<?php foreach ($contacts as $contact): ?>
|
||||
<tr>
|
||||
<td><a href="/admin/contacts/<?= $contact['id'] ?>" style="font-weight: 600;"><?= $this->escape($contact['name']) ?></a></td>
|
||||
<td><?= $this->escape($contact['position'] ?? '-') ?></td>
|
||||
<td><?= $contact['org_name'] ? $this->escape($contact['org_name']) : '-' ?></td>
|
||||
<td><?= $contact['email'] ? $this->escape($contact['email']) : '-' ?></td>
|
||||
<td><?= $contact['interaction_count'] ?? 0 ?></td>
|
||||
<td>
|
||||
<a href="/admin/contacts/<?= $contact['id'] ?>" class="btn btn-sm btn-secondary">View</a>
|
||||
<a href="/admin/contacts/<?= $contact['id'] ?>/edit" class="btn btn-sm btn-secondary">Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php if ($total > $perPage): ?>
|
||||
<div class="pagination">
|
||||
<?php for ($i = 1; $i <= ceil($total / $perPage); $i++): ?>
|
||||
<a href="?page=<?= $i ?>&search=<?= urlencode($search) ?>" class="btn btn-sm <?= $i === $page ? 'btn-primary' : 'btn-secondary' ?>"><?= $i ?></a>
|
||||
<?php endfor; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<style>
|
||||
.data-table { width: 100%; border-collapse: collapse; }
|
||||
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
|
||||
.data-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
|
||||
.data-table tr:hover { background: rgba(255,255,255,0.02); }
|
||||
</style>
|
||||
82
resources/views/admin/contacts/show.php
Normal file
82
resources/views/admin/contacts/show.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<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>
|
||||
</div>
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<a href="/admin/contacts/<?= $contact['id'] ?>/edit" class="btn btn-secondary">Edit</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;">Contact Details</h3>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Email</span>
|
||||
<span><?= $contact['email'] ? $this->escape($contact['email']) : '-' ?></span>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Phone</span>
|
||||
<span><?= $contact['phone'] ? $this->escape($contact['phone']) : '-' ?></span>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Position</span>
|
||||
<span><?= $this->escape($contact['position'] ?? '-') ?></span>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Organization</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- Interactions -->
|
||||
<div class="glass-panel" style="margin-bottom: 20px;">
|
||||
<h3 style="margin-bottom: 16px;">Interactions (<?= 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>
|
||||
</select>
|
||||
<input type="text" name="notes" class="form-control" placeholder="Add interaction note..." required>
|
||||
<button type="submit" class="btn btn-primary">Log</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if (empty($interactions)): ?>
|
||||
<p style="color: var(--text-muted);">No interactions logged yet.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($interactions as $interaction): ?>
|
||||
<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>
|
||||
<p style="margin-top: 8px; line-height: 1.5;"><?= $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>
|
||||
Reference in New Issue
Block a user