Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

Commit 11422ed

Browse files
committed
???
1 parent 141c096 commit 11422ed

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

src/app/models/Account.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function getAllAccounts() {
4949
return $stmt->fetchAll(PDO::FETCH_OBJ);
5050
}
5151

52+
<<<<<<< Updated upstream
5253
/**
5354
* Retrieves an account by its ID.
5455
* @param int $id The ID of the account to retrieve.
@@ -76,6 +77,14 @@ public function getAccountById($id) {
7677
public function getAccountByEmail($email) {
7778
$query = "SELECT *
7879
FROM account
80+
=======
81+
82+
public function updateInfo($firstName, $lastName, $email, $phone) {
83+
$query = "UPDATE account
84+
SET first_name = :firstName,
85+
last_name = :lastName,
86+
phone = :phone
87+
>>>>>>> Stashed changes
7988
WHERE email = :email";
8089

8190
$stmt = $this->conn->prepare($query);
@@ -149,6 +158,7 @@ public function updateAccount($id, $firstName, $lastName, $email, $phone, $roleI
149158

150159
return $stmt->execute();
151160
}
161+
<<<<<<< Updated upstream
152162

153163
/**
154164
* Updates the account information for a user based on their email address.
@@ -222,4 +232,7 @@ public function updateAccountPassword($email, $hashedPassword)
222232
$stmt->bindValue(':email', $email, PDO::PARAM_STR);
223233
return $stmt->execute();
224234
}
225-
}
235+
}
236+
=======
237+
}
238+
>>>>>>> Stashed changes

src/app/views/account.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
</div>
4343
</div>
4444
</div>
45+
<<<<<<< Updated upstream
4546

4647
<h2 class="text-pourpre border-bottom pb-2 mb-3">Update account</h2>
4748
<form action="/update-account" method="POST" class="card p-4 shadow-sm">
@@ -84,6 +85,22 @@
8485
</div>
8586
<div class="col-12 mt-4">
8687
<button type="submit" class="btn btn-pourpre text-white px-4">Update</button>
88+
=======
89+
<h2>Update account</h2>
90+
<form action="/update-account" method="POST">
91+
<div class="account-details">
92+
<div>
93+
<label>First name</label>
94+
<input type="text" id="update-first-name" name="first_name">
95+
</div>
96+
<div>
97+
<label>Last name</label>
98+
<input type="text" id="update-last-name" name="last_name">
99+
</div>
100+
<div>
101+
<label>Phone</label>
102+
<input type="text" id="update-phone" name="phone">
103+
>>>>>>> Stashed changes
87104
</div>
88105
</div>
89106
</form>
@@ -107,6 +124,10 @@
107124
document.getElementById('user-email').textContent = data.email;
108125
document.getElementById('user-phone').textContent = data.phone;
109126

127+
document.getElementById('update-first-name').value = data.first_name;
128+
document.getElementById('update-last-name').value = data.last_name;
129+
document.getElementById('update-phone').value = data.phone;
130+
110131
document.getElementById('loading').style.display = 'none';
111132
document.getElementById('account-content').style.display = 'block';
112133
}

0 commit comments

Comments
 (0)