This commit is contained in:
parent
8087eabd5e
commit
d42004ac9c
|
|
@ -5,7 +5,7 @@
|
|||
<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;
|
||||
|
|
@ -16,88 +16,87 @@
|
|||
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>
|
||||
<h2>Edit Customer Data</h2>
|
||||
|
||||
<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>
|
||||
|
||||
<!-- 新增导航按钮 -->
|
||||
<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 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>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- 搜索邮件地址的输入框和按钮 -->
|
||||
<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>
|
||||
|
||||
<!-- 固定状态栏 -->
|
||||
<!-- Fixed status bar -->
|
||||
<div class="status-bar">
|
||||
<p>Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }} | No Promotion: {{ no_promotion_count }}</p>
|
||||
</div>
|
||||
|
||||
<!-- JavaScript 脚本 -->
|
||||
<!-- JavaScript for navigation functions -->
|
||||
<script>
|
||||
// 跳转到数据库的第一条记录
|
||||
function goToTop() {
|
||||
window.location.href = "/customer/top"; // 跳转到后端“Top”路由
|
||||
window.location.href = "/customer/top";
|
||||
}
|
||||
|
||||
// 跳转到数据库的最后一条记录
|
||||
function goToBottom() {
|
||||
window.location.href = "/customer/bottom"; // 跳转到后端“Bottom”路由
|
||||
window.location.href = "/customer/bottom";
|
||||
}
|
||||
|
||||
// 跳转到指定记录
|
||||
function goToPage() {
|
||||
const pageIndex = document.getElementById('pageIndex').value;
|
||||
if (pageIndex !== '') {
|
||||
|
|
@ -105,7 +104,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
// 搜索邮件地址并跳转
|
||||
function searchByEmail() {
|
||||
const email = document.getElementById('emailSearch').value;
|
||||
if (email) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue