Skip to content

Commit

Permalink
Merge pull request #69 from wanderlust-group-project-1/sandali
Browse files Browse the repository at this point in the history
customer-profile-pic-change
  • Loading branch information
Sandali-Upekha authored Nov 2, 2023
2 parents 95a8a2b + 994d056 commit ca9c357
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 124 deletions.
24 changes: 23 additions & 1 deletion app/views/admin/layout/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
<span class="menu-title">Dashboard</span>
</a>
</li>

<li class="nav-item">
<a class="nav-link" data-bs-toggle="collapse" href="<?php echo ROOT_DIR ?>/admin/rentalServices" aria-expanded="false" aria-controls="ui-basic">
<i class="ti-palette menu-icon"></i>
<span class="menu-title">Users</span>
<i class="menu-arrow"></i>
</a>
<div class="collapse" id="ui-basic">
<ul class="nav flex-column sub-menu">
<li class="nav-item"> <a class="nav-link" href="pages/ui-features/buttons.html">Buttons</a></li>
<li class="nav-item"> <a class="nav-link" href="pages/ui-features/typography.html">Typography</a></li>
</ul>
</div>
</li>

<li class="nav-item">
<a class="nav-link" data-bs-toggle="collapse" href="<?php echo ROOT_DIR ?>/admin/rentalServices" aria-expanded="false" aria-controls="ui-basic">
<i class="ti-palette menu-icon"></i>
Expand Down Expand Up @@ -76,10 +91,17 @@
</div>
</li>

<li class="nav-item">
<a class="nav-link" href="<?php echo ROOT_DIR ?>/admin/blogs">
<i class="ti-shield menu-icon"></i>
<span class="menu-title">Complaints</span>
</a>
</li>

<li class="nav-item">
<a class="nav-link" data-bs-toggle="collapse" href="charts" aria-expanded="false" aria-controls="ui-basic">
<i class="ti-palette menu-icon"></i>
<span class="menu-title">Charts</span>
<span class="menu-title">Statistics</span>
<i class="menu-arrow"></i>
</a>
<div class="collapse" id="ui-basic">
Expand Down
269 changes: 147 additions & 122 deletions app/views/customer/profile.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

require_once('../app/views/components/navbar.php');
?>
<?php
echo '<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>';
?>

<div>

Expand Down Expand Up @@ -61,173 +64,177 @@
<div class="modal-content">
<span class="close">&times;</span>
<div class="profile-info">
<img src="<?php echo ROOT_DIR ?>/assets/images/1.png" alt="Profile Image" class="profile-image">

<div class="profile-image-wrapper">
<div>
<img src="<?php echo ROOT_DIR ?>/assets/images/1.png" alt="Profile Image" class="profile-image">
<input type="file" id="profile-image-upload" accept="image/*" style="display: none;">
<button for="profile-image-upload" class="change-profile-pic-button">Change Profile Picture</button>
</div>

<form id="customer" action="<?= ROOT_DIR ?>/customer/update" method="post">
<h2>Update Customer Details</h2>
<?php if (isset($errors)) : ?>
<div> <?= implode('<br>', $errors) ?> </div>
<?php endif; ?>
<form id="customer" action="<?= ROOT_DIR ?>/customer/update" method="post">
<h2>Update Customer Details</h2>
<?php if (isset($errors)) : ?>
<div> <?= implode('<br>', $errors) ?> </div>
<?php endif; ?>

<label for="name">Name</label>
<input type="text" name="name" id="name" value="<?= $user->name ?>" required>
<label for="name">Name</label>
<input type="text" name="name" id="name" value="<?= $user->name ?>" required>

<label for="address">Address</label>
<input type="text" name="address" id="address" value="<?= $user->address ?>" required>
<label for="address">Address</label>
<input type="text" name="address" id="address" value="<?= $user->address ?>" required>

<label for="email">Email</label>
<input type="text" name="email" id="email" value="<?= $user->email ?>" required>
<label for="email">Email</label>
<input type="text" name="email" id="email" value="<?= $user->email ?>" required>

<label for="number">Number</label>
<input type="text" name="number" id="number" value="<?= $user->number ?>" required>
<label for="number">Number</label>
<input type="text" name="number" id="number" value="<?= $user->number ?>" required>

<label for="nic">NIC Number</label>
<input type="text" name="nic" id="nic" value="<?= $user->nic ?>" required>
<label for="nic">NIC Number</label>
<input type="text" name="nic" id="nic" value="<?= $user->nic ?>" required>

<!-- <label for="password">Password</label>
<!-- <label for="password">Password</label>
<input type="password" name="password" id="password" required> -->

<input type="submit" name="submit" value="Update">
</form>
<input type="submit" name="submit" value="Update">
</form>



</div>
</div>
</div>
</div>
</div>

<!-- Modal Box -->
<!-- Modal Box -->





<div class="frame2">
<div class="yellow-card">
<div class="upper-card-text">
<div class="text-card-topic">Total Booking</div>
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
<div class="frame2">
<div class="yellow-card">
<div class="upper-card-text">
<div class="text-card-topic">Total Booking</div>
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
</div>
</div>
<div class="number-card">03</div>
</div>
<div class="number-card">03</div>
</div>

<div class="yellow-card">
<div class="upper-card-text">
<div class="text-card-topic">Equipment Booking</div>
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
<div class="yellow-card">
<div class="upper-card-text">
<div class="text-card-topic">Equipment Booking</div>
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
</div>
</div>
<div class="number-card">02</div>
</div>
<div class="number-card">02</div>
</div>

<div class="yellow-card">
<div class="upper-card-text">
<div class="text-card-topic">Guide Booking</div>
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
<div class="yellow-card">
<div class="upper-card-text">
<div class="text-card-topic">Guide Booking</div>
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
</div>
</div>
<div class="number-card">01</div>
</div>
<div class="number-card">01</div>
</div>
</div>>

</div>>


<div class="frame">
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
</div>

<div class="sec3-booking">
<div class="sec3-booking-main">
<div class="text-topic">Recent Booking</div>
<div class="img-2">
<img src="<?php echo ROOT_DIR ?>/assets/images/2.png" alt="">
</div>
<div class="frame">
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
</div>

<div class="div-5">
<div class="div-wrapper-2">
<div class="text-wrapper-2">Booking Type : Equipment Booking</div>
</div>
<div class="div-wrapper-2">
<div class="text-wrapper-2">Name : Glazers Camping</div>
</div>
<div class="div-wrapper-2">
<div class="text-wrapper-2">Date : 20/08/2023</div>
</div>
<div class="div-wrapper-2">
<div class="text-wrapper-2">Time : 10:00</div>
<div class="sec3-booking">
<div class="sec3-booking-main">
<div class="text-topic">Recent Booking</div>
<div class="img-2">
<img src="<?php echo ROOT_DIR ?>/assets/images/2.png" alt="">
</div>
</div>

<div class="div-5">
<div class="div-wrapper-2">
<div class="text-wrapper-2">Booking Type : Equipment Booking</div>
</div>
<div class="div-wrapper-2">
<div class="text-wrapper-2">Name : Glazers Camping</div>
</div>
<div class="div-wrapper-2">
<div class="text-wrapper-2">Date : 20/08/2023</div>
</div>
<div class="div-wrapper-2">
<div class="text-wrapper-2">Time : 10:00</div>
</div>

</div>
</div>
</div>
</div>



<div class="frame">
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
</div>
<div class="frame">
<div class="edit-prof-button">
<button type="submit" class="small-button-middle">
More &gt
</button>
</div>

<div class="text-topic">Booking History</div>

<div class="div-6">
<div class="div-wrapper-3">
<table>
<tr>
<th>Name</th>
<th>Status</th>
<th>Type</th>
<th>Date</th>
<th>Time</th>
</tr>

<tr>
<td>Glazers Camping</td>
<td>Upcoming</td>
<td>Equipment</td>
<td>02/12/2023</td>
<td>10.00</td>
</tr>

<tr>
<td>Glazers Camping</td>
<td>Upcoming</td>
<td>Equipment</td>
<td>02/12/2023</td>
<td>10.00</td>
</tr>

<tr>
<td>Sarath</td>
<td>Done</td>
<td>Guide</td>
<td>01/09/2023</td>
<td>10.00</td>
</tr>

</table>
<div class="text-topic">Booking History</div>

<div class="div-6">
<div class="div-wrapper-3">
<table>
<tr>
<th>Name</th>
<th>Status</th>
<th>Type</th>
<th>Date</th>
<th>Time</th>
</tr>

<tr>
<td>Glazers Camping</td>
<td>Upcoming</td>
<td>Equipment</td>
<td>02/12/2023</td>
<td>10.00</td>
</tr>

<tr>
<td>Glazers Camping</td>
<td>Upcoming</td>
<td>Equipment</td>
<td>02/12/2023</td>
<td>10.00</td>
</tr>

<tr>
<td>Sarath</td>
<td>Done</td>
<td>Guide</td>
<td>01/09/2023</td>
<td>10.00</td>
</tr>

</table>
</div>
</div>
</div>
</div>
</div>



Expand Down Expand Up @@ -317,6 +324,24 @@ function openModal() {
</script>


<!-- changing profile picture -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$('#profile-image-upload').on('change', function(e) {
var file = e.target.files[0];
var reader = new FileReader();

reader.onload = function(e) {
$('#profile-image').attr('src', e.target.result);
};

reader.readAsDataURL(file);
});
});
</script>





Expand Down
Loading

0 comments on commit ca9c357

Please sign in to comment.