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

Admin Dashboad Updated #33

Merged
merged 1 commit into from
Oct 30, 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
Empty file modified .github/dependabot.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/php.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified Archive.zip
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified app/controllers/Admin/Admin.php
100644 → 100755
Empty file.
15 changes: 15 additions & 0 deletions app/controllers/Admin/Charts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

class Charts {
use Controller;

public function index(string $a = '', string $b = '', string $c = ''):void {
$this->view('admin/chart');
}

public function item(string $a = '', string $b = '', string $c = ''):void {
$this->view('admin/chart');
}}


?>
15 changes: 15 additions & 0 deletions app/controllers/Admin/Customers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

class Customers {
use Controller;

public function index(string $a = '', string $b = '', string $c = ''):void {
$this->view('admin/customer');
}

public function item(string $a = '', string $b = '', string $c = ''):void {
$this->view('admin/customer');
}}


?>
Empty file modified app/controllers/Admin/Dashboard.php
100644 → 100755
Empty file.
15 changes: 15 additions & 0 deletions app/controllers/Admin/Guides.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

class Guides {
use Controller;

public function index(string $a = '', string $b = '', string $c = ''):void {
$this->view('admin/guides');
}

public function item(string $a = '', string $b = '', string $c = ''):void {
$this->view('admin/guides');
}}


?>
15 changes: 15 additions & 0 deletions app/controllers/Admin/Item.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

class Item {
use Controller;

public function index(string $a = '', string $b = '', string $c = ''):void {
$this->view('admin/item');
}

public function item(string $a = '', string $b = '', string $c = ''):void {
$this->view('admin/item');
}}


?>
Empty file modified app/controllers/Admin/Login.php
100644 → 100755
Empty file.
Empty file modified app/controllers/Admin/RentalServices.php
100644 → 100755
Empty file.
Empty file modified app/controllers/Guide.php
100644 → 100755
Empty file.
Empty file modified app/controllers/Login.php
100644 → 100755
Empty file.
Empty file modified app/controllers/Logout.php
100644 → 100755
Empty file.
Empty file modified app/controllers/One.php
100644 → 100755
Empty file.
Empty file modified app/controllers/Post.php
100644 → 100755
Empty file.
Empty file modified app/controllers/Product.php
100644 → 100755
Empty file.
Empty file modified app/controllers/Profile.php
100644 → 100755
Empty file.
Empty file modified app/controllers/Signup.php
100644 → 100755
Empty file.
Empty file modified app/core/declarations.php
100644 → 100755
Empty file.
Empty file modified app/middlewares/AuthMiddleware.php
100644 → 100755
Empty file.
Empty file modified app/middlewares/UserMiddleware.php
100644 → 100755
Empty file.
Empty file modified app/models/Customer.php
100644 → 100755
Empty file.
Empty file modified app/models/Guide.php
100644 → 100755
Empty file.
Empty file modified app/models/RentalService.php
100644 → 100755
Empty file.
Empty file modified app/models/User.php
100644 → 100755
Empty file.
Empty file modified app/views/1/one.view.php
100644 → 100755
Empty file.
Empty file modified app/views/404.view.php
100644 → 100755
Empty file.
36 changes: 36 additions & 0 deletions app/views/admin/chart.view.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
require_once('../app/views/admin/layout/header.php');
require_once('../app/views/admin/layout/sidebar.php');
?>

<div class="table-container">
<canvas id="myChart" style="width:100%;max-width:600px"></canvas>
</div>

<script>
var xValues = ["Rental Services", "Guides", "Registered Customers"];
var yValues = [192, 89, 369];
var barColors = ["green","blue","orange"];

new Chart("myChart", {
type: "bar",
data: {
labels: xValues,
datasets: [{
backgroundColor: barColors,
data: yValues
}]
},
options: {
legend: {display: false},
title: {
display: true,
text: "Wanderlust Users - 2023"
}
}
});
</script>

<?php
require_once('../app/views/admin/layout/footer.php');
?>
Empty file modified app/views/admin/components/navbar.php
100644 → 100755
Empty file.
103 changes: 103 additions & 0 deletions app/views/admin/customer.view.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?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>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sandaruwan</td>
<td>sandaruwan@example.com</td>
<td><span class="status accepted">Accepted</span></td>
<td><button class="view-button">View</button></td>
</tr>
<tr>
<td>Sarani</td>
<td>sarani@example.com</td>
<td><span class="status not-accepted">Not Accepted</span></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">
<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">Sarani Hettiarachchci</h2>
<p id="profile-email">sarani@example.com</p>
<p id="profile-address">Homagama</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>
</div>
</div>


<script>

// 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 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";
}

// 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);
});
});

// 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
require_once('../app/views/admin/layout/footer.php');


?>
Empty file modified app/views/admin/dashboard.view.php
100644 → 100755
Empty file.
103 changes: 103 additions & 0 deletions app/views/admin/guides.view.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?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>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>Lahiru Sandaruwan</td>
<td>lahiru@example.com</td>
<td><span class="status accepted">Accepted</span></td>
<td><button class="view-button">View</button></td>
</tr>
<tr>
<td>Dasun Thathsara</td>
<td>dasun@example.com</td>
<td><span class="status not-accepted">Not Accepted</span></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">
<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">Lahiru Sandaruwan </h2>
<p id="profile-email">lahiru@example.com</p>
<p id="profile-address">Kandy</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>
</div>
</div>


<script>

// 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 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";
}

// 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);
});
});

// 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
require_once('../app/views/admin/layout/footer.php');


?>
Empty file modified app/views/admin/item.view.php
100644 → 100755
Empty file.
Empty file modified app/views/admin/layout/footer.php
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion app/views/admin/layout/header.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Wanderlust</title>
<link rel="stylesheet" type="text/css" href="<?=ROOT_DIR ?>/assets/css/style.css">
<link rel="stylesheet" type="text/css" href="<?=ROOT_DIR ?>/assets/css/admin-style.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
</head>
<body>

Loading