This commit is contained in:
parent
8087eabd5e
commit
d42004ac9c
|
|
@ -5,7 +5,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Edit Customer Data</title>
|
<title>Edit Customer Data</title>
|
||||||
<style>
|
<style>
|
||||||
/* 固定底部状态栏样式 */
|
/* Fixed bottom status bar style */
|
||||||
.status-bar {
|
.status-bar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|
@ -16,88 +16,87 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 14px;
|
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>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h2>Edit Customer Data</h2>
|
<div class="content-wrapper">
|
||||||
|
<h2>Edit Customer Data</h2>
|
||||||
<form method="POST" action="/update/{{ index }}">
|
|
||||||
{% for domain, info in customer.items() %}
|
<!-- Main form and content here -->
|
||||||
<h3>Domain: {{ domain }}</h3>
|
<form method="POST" action="/update/{{ index }}">
|
||||||
<p>Customer Industry: <input type="text" name="{{ domain }}_industry" value="{{ info.get('customer industry', '') }}"></p>
|
{% for domain, info in customer.items() %}
|
||||||
|
<h3>Domain: {{ domain }}</h3>
|
||||||
<h4>Email Addresses</h4>
|
<p>Customer Industry: <input type="text" name="{{ domain }}_industry" value="{{ info.get('customer industry', '') }}"></p>
|
||||||
<div>
|
|
||||||
{% if info.get('email addresses') %}
|
<h4>Email Addresses</h4>
|
||||||
{% for email in info['email addresses'] %}
|
<div>
|
||||||
<div>
|
{% if info.get('email addresses') %}
|
||||||
<p>Owner Name: <input type="text" name="{{ domain }}_owner_name_{{ email['idx'] }}" value="{{ email.get("owner's name", '') }}"></p>
|
{% for email in info['email addresses'] %}
|
||||||
<p>Email Address: <input type="text" name="{{ domain }}_email_address_{{ email['idx'] }}" value="{{ email.get('email address', '') }}"></p>
|
<div>
|
||||||
<p>Category: <input type="text" name="{{ domain }}_category_{{ email['idx'] }}" value="{{ email.get('category', '') }}"></p>
|
<p>Owner Name: <input type="text" name="{{ domain }}_owner_name_{{ email['idx'] }}" value="{{ email.get("owner's name", '') }}"></p>
|
||||||
<p>Promotion History: <input type="text" name="{{ domain }}_promotion_history_{{ email['idx'] }}" value="{{ email.get('promotion history', []) | join(', ') }}"></p>
|
<p>Email Address: <input type="text" name="{{ domain }}_email_address_{{ email['idx'] }}" value="{{ email.get('email address', '') }}"></p>
|
||||||
</div>
|
<p>Category: <input type="text" name="{{ domain }}_category_{{ email['idx'] }}" value="{{ email.get('category', '') }}"></p>
|
||||||
{% endfor %}
|
<p>Promotion History: <input type="text" name="{{ domain }}_promotion_history_{{ email['idx'] }}" value="{{ email.get('promotion history', []) | join(', ') }}"></p>
|
||||||
{% else %}
|
</div>
|
||||||
<p>No email addresses available.</p>
|
{% endfor %}
|
||||||
{% endif %}
|
{% else %}
|
||||||
</div>
|
<p>No email addresses available.</p>
|
||||||
{% endfor %}
|
{% endif %}
|
||||||
<button type="submit">Save Changes</button>
|
</div>
|
||||||
</form>
|
{% endfor %}
|
||||||
|
<button type="submit">Save Changes</button>
|
||||||
<hr>
|
</form>
|
||||||
|
|
||||||
<!-- 新增导航按钮 -->
|
<hr>
|
||||||
<div>
|
<!-- Navigation buttons and search input -->
|
||||||
<!-- 跳转到数据库的第一条记录按钮 -->
|
<div>
|
||||||
<button onclick="goToTop()">Go to Top</button>
|
<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="goToBottom()">Go to Bottom</button>
|
<button onclick="goToPage()">Go to Page</button>
|
||||||
|
</div>
|
||||||
<!-- 跳转到指定页面的输入框和按钮 -->
|
|
||||||
<input type="number" id="pageIndex" placeholder="Enter page number">
|
<hr>
|
||||||
<button onclick="goToPage()">Go to Page</button>
|
|
||||||
|
<!-- 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>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<!-- Fixed status bar -->
|
||||||
|
|
||||||
<!-- 搜索邮件地址的输入框和按钮 -->
|
|
||||||
<div>
|
|
||||||
<input type="text" id="emailSearch" placeholder="Enter email address">
|
|
||||||
<button onclick="searchByEmail()">Search by Email</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<!-- 原有的上一页和下一页按钮 -->
|
|
||||||
<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 class="status-bar">
|
<div class="status-bar">
|
||||||
<p>Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }} | No Promotion: {{ no_promotion_count }}</p>
|
<p>Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }} | No Promotion: {{ no_promotion_count }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- JavaScript 脚本 -->
|
<!-- JavaScript for navigation functions -->
|
||||||
<script>
|
<script>
|
||||||
// 跳转到数据库的第一条记录
|
|
||||||
function goToTop() {
|
function goToTop() {
|
||||||
window.location.href = "/customer/top"; // 跳转到后端“Top”路由
|
window.location.href = "/customer/top";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转到数据库的最后一条记录
|
|
||||||
function goToBottom() {
|
function goToBottom() {
|
||||||
window.location.href = "/customer/bottom"; // 跳转到后端“Bottom”路由
|
window.location.href = "/customer/bottom";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转到指定记录
|
|
||||||
function goToPage() {
|
function goToPage() {
|
||||||
const pageIndex = document.getElementById('pageIndex').value;
|
const pageIndex = document.getElementById('pageIndex').value;
|
||||||
if (pageIndex !== '') {
|
if (pageIndex !== '') {
|
||||||
|
|
@ -105,7 +104,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 搜索邮件地址并跳转
|
|
||||||
function searchByEmail() {
|
function searchByEmail() {
|
||||||
const email = document.getElementById('emailSearch').value;
|
const email = document.getElementById('emailSearch').value;
|
||||||
if (email) {
|
if (email) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue