116 lines
4.5 KiB
HTML
116 lines
4.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Edit Customer Data</title>
|
|
<style>
|
|
/* Fixed bottom status bar style */
|
|
.status-bar {
|
|
position: fixed;
|
|
bottom: 0;
|
|
width: 100%;
|
|
background-color: #f1f1f1;
|
|
border-top: 1px solid #ccc;
|
|
padding: 10px;
|
|
text-align: center;
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* Add padding-bottom to avoid content being overlapped by the status bar */
|
|
.content-wrapper {
|
|
padding-bottom: 50px; /* Adjust based on the height of your status bar */
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="content-wrapper">
|
|
<h2>Edit Customer Data</h2>
|
|
|
|
<!-- Main form and content here -->
|
|
<form method="POST" action="/update/{{ index }}">
|
|
{% for domain, info in customer.items() %}
|
|
<h3>Domain: {{ domain }}</h3>
|
|
<p>Customer Industry: <input type="text" name="{{ domain }}_industry" value="{{ info.get('customer industry', '') }}"></p>
|
|
|
|
<h4>Email Addresses</h4>
|
|
<div>
|
|
{% if info.get('email addresses') %}
|
|
{% for email in info['email addresses'] %}
|
|
<div>
|
|
<p>Owner Name: <input type="text" name="{{ domain }}_owner_name_{{ email['idx'] }}" value="{{ email.get("owner's name", '') }}"></p>
|
|
<p>Email Address: <input type="text" name="{{ domain }}_email_address_{{ email['idx'] }}" value="{{ email.get('email address', '') }}"></p>
|
|
<p>Category: <input type="text" name="{{ domain }}_category_{{ email['idx'] }}" value="{{ email.get('category', '') }}"></p>
|
|
<p>Promotion History: <input type="text" name="{{ domain }}_promotion_history_{{ email['idx'] }}" value="{{ email.get('promotion history', []) | join(', ') }}"></p>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<p>No email addresses available.</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
<button type="submit">Save Changes</button>
|
|
</form>
|
|
|
|
<hr>
|
|
<!-- Navigation buttons and search input -->
|
|
<div>
|
|
<button onclick="goToTop()">Go to Top</button>
|
|
<button onclick="goToBottom()">Go to Bottom</button>
|
|
<input type="number" id="pageIndex" placeholder="Enter page number">
|
|
<button onclick="goToPage()">Go to Page</button>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<!-- Search by email functionality -->
|
|
<div>
|
|
<input type="text" id="emailSearch" placeholder="Enter email address">
|
|
<button onclick="searchByEmail()">Search by Email</button>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<!-- Pagination buttons -->
|
|
<div>
|
|
<button {% if is_first %}disabled{% endif %}>
|
|
<a href="{% if not is_first %}{{ url_for('view_customer', index=index-1) }}{% endif %}">Previous</a>
|
|
</button>
|
|
<button {% if is_last %}disabled{% endif %}>
|
|
<a href="{% if not is_last %}{{ url_for('view_customer', index=index+1) }}{% endif %}">Next</a>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Fixed status bar -->
|
|
<div class="status-bar">
|
|
<p>Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }} | No Promotion: {{ no_promotion_count }} | Disqualified Leads: {{ disqualified_lead_count }} | Total Companies: {{ company_count }}</p>
|
|
</div>
|
|
|
|
<!-- JavaScript for navigation functions -->
|
|
<script>
|
|
function goToTop() {
|
|
window.location.href = "/customer/top";
|
|
}
|
|
|
|
function goToBottom() {
|
|
window.location.href = "/customer/bottom";
|
|
}
|
|
|
|
function goToPage() {
|
|
const pageIndex = document.getElementById('pageIndex').value;
|
|
if (pageIndex !== '') {
|
|
window.location.href = `/customer/${pageIndex}`;
|
|
}
|
|
}
|
|
|
|
function searchByEmail() {
|
|
const email = document.getElementById('emailSearch').value;
|
|
if (email) {
|
|
window.location.href = `/search?email=${encodeURIComponent(email)}`;
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|