nagasurendra commited on
Commit
4e9aca1
·
verified ·
1 Parent(s): 23e281c

Update templates/customer_details.html

Browse files
Files changed (1) hide show
  1. templates/customer_details.html +44 -1
templates/customer_details.html CHANGED
@@ -5,6 +5,44 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Customer Details</title>
7
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  </head>
9
  <body>
10
  <div class="container mt-4">
@@ -15,13 +53,18 @@
15
  <h5 class="card-title">Customer Name: {{ customer.name }}</h5>
16
  <p class="card-text"><strong>Email:</strong> {{ customer.email }}</p>
17
  <p class="card-text"><strong>Phone:</strong> {{ customer.phone }}</p>
18
- <p class="card-text"><strong>Referral Code:</strong> {{ customer.referral_code }}</p>
 
 
19
  <p class="card-text"><strong>Reward Points:</strong> {{ customer.reward_points }}</p>
20
 
21
  <!-- Edit Profile Button -->
22
  <a href="/edit_customer" class="btn btn-primary">Edit Profile</a>
23
  </div>
24
  </div>
 
 
 
25
  </div>
26
 
27
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Customer Details</title>
7
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
8
+ <style>
9
+ .back-to-menu {
10
+ display: block;
11
+ margin: 30px auto 10px auto;
12
+ padding: 10px 20px;
13
+ background-color: #ff5722; /* Bright orange button */
14
+ color: #ffffff;
15
+ border: none;
16
+ border-radius: 25px;
17
+ font-size: 1rem;
18
+ font-weight: bold;
19
+ text-align: center;
20
+ text-decoration: none;
21
+ width: 100%;
22
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
23
+ transition: background-color 0.3s ease;
24
+ }
25
+ .back-to-menu:hover {
26
+ background-color: #e64a19;
27
+ text-decoration: none;
28
+ }
29
+ .copy-btn {
30
+ background: none;
31
+ border: none;
32
+ cursor: pointer;
33
+ color: #007bff;
34
+ font-size: 1rem;
35
+ margin-left: 10px;
36
+ }
37
+ </style>
38
+ <script>
39
+ function copyReferralCode() {
40
+ const referralText = document.getElementById("referralCode").innerText;
41
+ navigator.clipboard.writeText(referralText).then(() => {
42
+ alert("Referral Code Copied!");
43
+ }).catch(err => console.error("Failed to copy text: ", err));
44
+ }
45
+ </script>
46
  </head>
47
  <body>
48
  <div class="container mt-4">
 
53
  <h5 class="card-title">Customer Name: {{ customer.name }}</h5>
54
  <p class="card-text"><strong>Email:</strong> {{ customer.email }}</p>
55
  <p class="card-text"><strong>Phone:</strong> {{ customer.phone }}</p>
56
+ <p class="card-text"><strong>Referral Code:</strong> <span id="referralCode">{{ customer.referral_code }}</span>
57
+ <button class="copy-btn" onclick="copyReferralCode()">📋</button>
58
+ </p>
59
  <p class="card-text"><strong>Reward Points:</strong> {{ customer.reward_points }}</p>
60
 
61
  <!-- Edit Profile Button -->
62
  <a href="/edit_customer" class="btn btn-primary">Edit Profile</a>
63
  </div>
64
  </div>
65
+
66
+ <!-- Back to Menu Button -->
67
+ <a href="/menu" class="back-to-menu">Back to Menu</a>
68
  </div>
69
 
70
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>