Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nirmal #30

Merged
merged 3 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions app/models/RentalService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

class RentalServicesModel {
use Model;

protected string $table = 'rental_services';
protected array $allowedColumns = [
'name',
'address',
'regNo',
'mobile',
'email',
];


}
115 changes: 53 additions & 62 deletions app/views/admin/item.view.php
Original file line number Diff line number Diff line change
@@ -1,108 +1,99 @@
<?php
require_once('../app/views/admin/layout/header.php');
require_once('../app/views/admin/layout/sidebar.php');

?>

<div class="table-container">
<table class="data-table">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Status</th>
<th>Type</th>
<th>Quantity</th>
<th>Price</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>john@example.com</td>
<td><span class="status accepted">Accepted</span></td>
<td>Item 1</td>
<td>Type A</td>
<td>5</td>
<td>$10.00</td>
<td><button class="view-button">View</button></td>
</tr>
<tr>
<td>Jane Smith</td>
<td>jane@example.com</td>
<td><span class="status not-accepted">Not Accepted</span></td>
<td>Item 2</td>
<td>Type B</td>
<td>10</td>
<td>$15.50</td>
<td><button class="view-button">View</button></td>
</tr>
<tr>
<td>Bob Johnson</td>
<td>bob@example.com</td>
<td><span class="status waiting">Waiting</span></td>
<td>Item 3</td>
<td>Type C</td>
<td>3</td>
<td>$8.75</td>
<td><button class="view-button">View</button></td>
</tr>
<!-- Add more rows as needed -->
</tbody>
</table>
</div>

<!-- Modal -->
<div class="rental-services-modal" id="rental-services-modal">
<div class="modal-content">
<!-- Modal -->
<div class="item-details-modal" id="item-details-modal">
<div class="modal-content">
<span class="close">&times;</span>
<div class="profile-info">
<img src="<?php echo ROOT_DIR?>/assets/images/dp.jpg" alt="Profile Image" class="profile-image">
<h2 id="profile-name">Sandali </h2>
<p id="profile-email">sandali@gmail.com</p>
<p id="profile-address">Maharagama</p>
<p id="profile-status" class="accepted">Accepted</p>
<div class="profile-links">
<a href="#" id="link-1">Link 1</a>
<a href="#" id="link-2">Link 2</a>
</div>
<div class="item-info">
<h2 id="item-name">Item Name</h2>
<p id="item-type">Type: Type A</p>
<p id="item-quantity">Quantity: 5</p>
<p id="item-price">Price: $10.00</p>
</div>
</div>
</div>


<script>
// Get the modal
var modal = document.getElementById("item-details-modal");

// Get the modal
var modal = document.getElementById("rental-services-modal");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];

// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// Get all view buttons
var viewButtons = document.querySelectorAll('.view-button');

// Get all view buttons
var viewButtons = document.querySelectorAll('.view-button');

// Function to handle modal display
function openModal(content) {
// document.getElementById("modal-content").innerHTML = content;
modal.style.display = "block";
}
// Function to handle modal display
function openModal(content) {
// document.getElementById("modal-content").innerHTML = content;
modal.style.display = "block";
}

// Add click event listener to view buttons
viewButtons.forEach(function(button) {
button.addEventListener('click', function() {

var name = this.parentElement.parentElement.querySelector('td:first-child').textContent;
var email = this.parentElement.parentElement.querySelector('td:nth-child(2)').textContent;
openModal("Name: " + name + "<br>Email: " + email);
// Add click event listener to view buttons
viewButtons.forEach(function(button) {
button.addEventListener('click', function() {
var name = this.parentElement.parentElement.querySelector('td:first-child').textContent;
var type = this.parentElement.parentElement.querySelector('td:nth-child(2)').textContent;
var quantity = this.parentElement.parentElement.querySelector('td:nth-child(3)').textContent;
var price = this.parentElement.parentElement.querySelector('td:nth-child(4)').textContent;
openModal("Name: " + name + "<br>Type: " + type + "<br>Quantity: " + quantity + "<br>Price: " + price);
});
});
});

// Close the modal when the close button is clicked
span.onclick = function() {
modal.style.display = "none";
}

// Close the modal if the user clicks outside of it
window.onclick = function(event) {
if (event.target == modal) {
// Close the modal when the close button is clicked
span.onclick = function() {
modal.style.display = "none";
}
}

// Close the modal if the user clicks outside of it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>




<?php
<?php
require_once('../app/views/admin/layout/footer.php');


?>
?>
97 changes: 76 additions & 21 deletions app/views/signup.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,59 @@
<?php endif; ?>


<label for="email">Email</label>
<input type="text" name="email" id="email">
<label for="password">Password</label>
<input type="password" name="password" id="password">
<input type="submit" name="submit" value="Signup">
<label for="name">Name</label>
<input type="text" name="name" id="name" required>

<label for="address">Address</label>
<input type="text" name="address" id="address" required>

<label for="email">Email</label>
<input type="text" name="email" id="email" required>

<label for="number">Number</label>
<input type="text" name="number" id="number" required>

<label for="nic">NIC Number</label>
<input type="text" name="nic" id="nic" required>

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

<input type="submit" name="submit" value="Signup">
</form>
<!-- Rental Services -->
<form hidden id="rental-service" action="<?=ROOT_DIR?>/signup" method="post">
<form hidden id="rental-service" action="<?= ROOT_DIR ?>/signup" method="post">
<h2>Rental Services Sign Up</h2>

<?php if(isset($errors)): ?>
<div> <?= implode('<br>', $errors)?> </div>
<?php if (isset($errors)): ?>
<div><?= implode('<br>', $errors) ?></div>
<?php endif; ?>


<label for="email">Email</label>
<input type="text" name="email" id="email">
<label for="password">Password</label>
<input type="password" name="password" id="password">
<input type="submit" name="submit" value="Signup">

</form>
<label for="business_name">Business Name</label>
<input type="text" name="name" id="business_name">

<label for="address">Address</label>
<input type="text" name="address" id="address">

<label for="registration_number">Business Registration Number/NIC</label>
<input type="text" name="regNo" id="registration_number">

<label for="mobile_number">Mobile Number</label>
<input type="text" name="mobile" id="mobile_number">

<label for="email">Email Address</label>
<input type="text" name="email" id="email">

<div class="file-input-container">
<label for="verification_document" class="file-label">Choose Verification Document</label>
<input type="file" name="verification_document" id="verification_document" class="file-input">
</div>
<label for="password">Password</label>
<input type="password" name="password" id="password">

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


<!-- Guide -->
<form hidden id="guide" action="<?=ROOT_DIR?>/signup" method="post">
Expand All @@ -69,12 +99,37 @@
<?php endif; ?>


<label for="email">Email</label>
<input type="text" name="email" id="email">
<label for="password">Password</label>
<input type="password" name="password" id="password">
<input type="submit" name="submit" value="Signup">
<label for="name">Name</label>
<input type="text" name="name" id="name" required>

<label for="address">Address</label>
<input type="text" name="address" id="address" required>

<label for="nic">NIC</label>
<input type="text" name="nic" id="nic" required>

<label for="mobile_number">Mobile Number</label>
<input type="text" name="mobile_number" id="mobile_number" required>

<label for="email">Email Address</label>
<input type="text" name="email" id="email" required>

<label for="gender">Gender</label>
<select name="gender" id="gender" required>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>

<div class="file-input-container">
<label for="verification_document" class="file-label">Choose Verification Document</label>
<input type="file" name="verification_document" id="verification_document" class="file-input">
</div>

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

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

<p>
Expand Down
66 changes: 66 additions & 0 deletions public/assets/css/admin-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,69 @@
.rental-services-modal .profile-links a:hover {
color: #0056b3;
}



/* Item details Modal styles */
.item-details-modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.7);
}

.item-details-modal .modal-content {
background-color: #fefefe;
margin: 10% auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
max-width: 400px;
position: relative;
border-radius: 8px;
}

.item-details-modal .close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
cursor: pointer;
}

.item-details-modal .close:hover,
.item-details-modal .close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}

.item-details-modal .profile-image {
width: 100px;
height: 100px;
object-fit: cover;
border-radius: 50%;
margin-bottom: 20px;
}

.item-details-modal #profile-name {
font-size: 24px;
margin-bottom: 10px;
}

.item-details-modal .profile-links a {
display: block;
margin-bottom: 10px;
color: #007bff;
text-decoration: none;
transition: color 0.3s;
}

.item-details-modal .profile-links a:hover {
color: #0056b3;
}
Loading