Skip to content

Commit

Permalink
Merge pull request #257 from wanderlust-group-project-1/footer
Browse files Browse the repository at this point in the history
Footer
  • Loading branch information
Zaras00 authored Apr 29, 2024
2 parents a8ead59 + 783840a commit a8a8069
Show file tree
Hide file tree
Showing 22 changed files with 441 additions and 78 deletions.
24 changes: 19 additions & 5 deletions app/controllers/Admin/Complains.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,27 @@ public function index(string $a = '', string $b = '', string $c = ''): void

public function listComplains(string $a = '', string $b = '', string $c = ''): void
{
$complain = new RentReturnComplaintModel;
$data['complaints'] = $complain->getAdminRentalComplaints($b);
//who complaints
if($a == 'customer'){
$complaint = new RentComplaintModel;
$data['complaints'] = $complaint->getComplaints (['status' => $b]);
$data['view'] = '-customer';

$this->view('admin/components/complainlist', $data);
}
$this->view('admin/components/complainlist', $data);

}else if($a == 'rentalservice'){
$complain = new RentReturnComplaintModel;
$data['complaints'] = $complain->getAdminRentalComplaints($b);
$data['view'] = '';

$this->view('admin/components/complainlist', $data);
}


}


public function viewComplaint(string $a = '', string $b = '', string $c = ''): void
public function viewRentalComplaint(string $a = '', string $b = '', string $c = ''): void
{
$rentreturncomplaint = new RentReturnComplaintModel;
$complaint = $rentreturncomplaint->getComplaint($a);
Expand Down Expand Up @@ -47,4 +59,6 @@ public function viewComplaint(string $a = '', string $b = '', string $c = ''): v

$this->view('admin/components/complaint', ['complaint' => $complaint, 'order' => $order, 'items' => $items]);
}


}
4 changes: 2 additions & 2 deletions app/models/Rent.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getItems(array $data, $cart) {

// show($cart);
$q->setTable('equipment');
$q->select('equipment.*, rental_services.name As rental_service_name')
$q->select('equipment.*, rental_services.name As rental_service_name ')
->join('rental_services', 'equipment.rentalservice_id', 'rental_services.id')
->join('rental_settings', 'equipment.rentalservice_id', 'rental_settings.rentalservice_id')
->join('locations', 'rental_services.location_id', 'locations.id')
Expand Down Expand Up @@ -172,4 +172,4 @@ public function getUpcomingRentByRentalService($data) {



}
}
31 changes: 24 additions & 7 deletions app/views/admin/complains.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
</button>
<!-- </a> -->
</div>
<div class="flex-d-r mr-5">
<!-- <a href="<?php echo ROOT_DIR ?>/admin/complainsGuides"> -->
<!-- <div class="flex-d-r mr-5">
<a href="<?php echo ROOT_DIR ?>/admin/complainsGuides">
<button type=" submit" class="btn-card" data-id="guide">
Guides
</button>
<!-- </a> -->
</div>
</a>
</div> -->
<div class="flex-d-r mr-5">
<!-- <a href="<?php echo ROOT_DIR ?>/admin/complainsCustomers"> -->
<button type=" submit" class="btn-card" data-id="customer">
Expand Down Expand Up @@ -73,7 +73,7 @@

<div class="section-switch flex-d gap-3 flex-wrap">
<button class="btn-selected" id="pending">Pending</button>
<button class="btn-selected" id="accepted">Accepted</button>
<!-- <button class="btn-selected" id="accepted">Accepted</button> -->
<button class="btn-selected" id="rejected">Rejected</button>
<button class="btn-selected" id="resolved">Resolved</button>

Expand Down Expand Up @@ -149,15 +149,32 @@ function getComplaints(status, user = "customer") {
});


// View Complaint
// View Complaint Rental

$(document).on('click', '#view-button', function() {
var complaintId = $(this).closest('.complaint').attr('data-id');
$.ajax({
headers: {
'Authorization': 'Bearer ' + getCookie('jwt_auth_token')
},
url: '<?= ROOT_DIR ?>/admin/complains/viewComplaint/' + complaintId,
url: '<?= ROOT_DIR ?>/admin/complains/viewRentalComplaint/' + complaintId,
type: 'GET',
success: function(response) {
$('#complaint-data').html(response);
$('#complaint-view-modal').css('display', 'block');
}
});
});

// View Complaint Customer

$(document).on('click', '#view-button-customer', function() {
var complaintId = $(this).closest('.complaint').attr('data-id');
$.ajax({
headers: {
'Authorization': 'Bearer ' + getCookie('jwt_auth_token')
},
url: '<?= ROOT_DIR ?>/admin/complains/viewRentComplaint/' + complaintId,
type: 'GET',
success: function(response) {
$('#complaint-data').html(response);
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/components/complainlist.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>

<div class="complaint-actions flex-d gap-3">
<button class="btn-text-green" id="view-button"><i class="fa fa-list" aria-hidden="true"></i> View</button>
<button class="btn-text-green" id="view-button<?php echo $view;?>"><i class="fa fa-list" aria-hidden="true"></i> View</button>
<!-- if status pending set show -->
<?php if ($complaint->status == 'pending') {
?>
Expand Down
6 changes: 5 additions & 1 deletion app/views/customer/OneGuide.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,5 +466,9 @@ function paymentGateWay(data) {
<script type="text/javascript" src="https://www.payhere.lk/lib/payhere.js"></script>

<?php
require_once('../app/views/layout/footer.php');
require_once('../app/views/layout/footer-main.php');
?>

<?php
require_once('../app/views/layout/footer.php');
?>
4 changes: 4 additions & 0 deletions app/views/customer/checkout.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ function paymentGateWay(data) {

<script type="text/javascript" src="https://www.payhere.lk/lib/payhere.js"></script>

<?php
require_once('../app/views/layout/footer-main.php');
?>

<?php
require_once('../app/views/layout/footer.php');
?>
35 changes: 28 additions & 7 deletions app/views/customer/complaints.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@

</div>

<!-- complaint cancel -->

<div id="cancel-complaint-modal" class="modal">
<!-- <div id="cancel-complaint-modal" class="modal">
<div class="modal-content">
<span class="close">&times;</span>
<h2>Cancel Complaint</h2>
Expand All @@ -41,6 +40,24 @@
<button class="btn btn-danger modal-close" id="cancel-complaint-cancel">No</button>
</div>
</div>
</div> -->

<!-- Confirm cancel modal -->

<div class="modal" id="cancel-complaint-modal">
<div class="modal-content">
<span class="close">&times;</span>
<div class="flex-d-c flex-md-c justify-content-center aligh-items-center gap-3 p-6">
<h2 class="text-center">Cancel Complaint</h2>
<div class="row">
<p>Are you sure you want to cancel this complaint?</p>
</div>
<div class="row flex-d gap-3 mt-3">
<button class="btn-text-green border" id="cancel-complaint-confirm">Yes</button>
<button class="btn-text-red border modal-close" id="cancel-complaint-cancel">No</button>
</div>
</div>
</div>
</div>

<script>
Expand Down Expand Up @@ -99,10 +116,6 @@ function getComplaints(status) {
</div>


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

<!-- mycom-view-button -->
<script>
$(document).on('click', '#mycom-view-button', function() {
Expand Down Expand Up @@ -158,4 +171,12 @@ function getComplaints(status) {
});
});

</script>
</script>

<?php
require_once('../app/views/layout/footer-main.php');
?>

<?php
require_once('../app/views/layout/footer.php');
?>
2 changes: 2 additions & 0 deletions app/views/customer/components/orderlist.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

foreach ($orders as $order) {
?>
<!-- <?show ($orders);?> -->
<div class="card card-normal3" data-id="<?php echo $order->id; ?>">
<div class="row gap-2 order-list">

Expand All @@ -20,6 +21,7 @@
</div>

<div class="col-lg-3 col-md-12">

<div class="text-overflow-ellipsis "> <?php echo $order->equipment_names; ?></div>

</div>
Expand Down
10 changes: 9 additions & 1 deletion app/views/customer/findGuide.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,12 @@
}
});
});
</script>
</script>

<?php
require_once('../app/views/layout/footer-main.php');
?>

<?php
require_once('../app/views/layout/footer.php');
?>
8 changes: 7 additions & 1 deletion app/views/customer/myBookings.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function bookingHTML(userDetails, bookingDetails) {
});
</script>


<script>
$(document).ready(function() {
// Get the modal
Expand Down Expand Up @@ -134,4 +135,9 @@ function bookingHTML(userDetails, bookingDetails) {
});
});
</script>
<?php require_once('../app/views/layout/footer.php'); ?>

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

require_once('../app/views/layout/footer.php');
?>
84 changes: 45 additions & 39 deletions app/views/customer/orders.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,14 @@


<button class="btn-selected active" id="pending">Pending</button>



<button class="btn-selected" id="upcoming">Upcoming</button>
<button class="btn-selected" id="rented">Rented</button>
<button class="btn-selected" id="completed">Completed</button>
<button class="btn-selected" id="unpaid">Unpaid</button>

<button class="btn-selected" id="cancelled">Cancelled</button>
<button class="btn-selected" id="all">All</button>



<!-- not rented yet -->

</div>
<button class="btn-selected" id="upcoming">Upcoming</button>
<button class="btn-selected" id="rented">Rented</button>
<button class="btn-selected" id="completed">Completed</button>
<button class="btn-selected" id="unpaid">Unpaid</button>
<button class="btn-selected" id="cancelled">Cancelled</button>
<button class="btn-selected" id="all">All</button>
<!-- not rented yet -->
</div>


<div class="row gap-2 ">
Expand Down Expand Up @@ -490,8 +482,7 @@ function paymentGateWay(data) {
</div> -->

<!-- View modal -->
<div class="modal" id="order-item-modal" class
>
<div class="modal" id="order-item-modal">
<div class="modal-content">
<span class="close">&times;</span>

Expand All @@ -506,13 +497,15 @@ function paymentGateWay(data) {
<div class="modal" id="confirm-cancel-modal">
<div class="modal-content">
<span class="close">&times;</span>
<div class="flex-d-c flex-md-c justify-content-center aligh-items-center gap-3">
<h2 class="text-center">Cancel Order</h2>
<p>Are you sure you want to cancel this order?</p>
<div class="flex-d gap-3 mt-3">
<button class="btn-text-green border" id="confirm-cancel">Yes</button>
<button class="btn-text-red border modal-close" id="cancel-cancel">No</button>
</div>
<div class="flex-d-c flex-md-c justify-content-center aligh-items-center gap-3 p-6">
<h2 class="text-center">Cancel Order</h2>
<div class="row">
<p>Are you sure you want to cancel this order?</p>
</div>
<div class="row flex-d gap-3 mt-3">
<button class="btn-text-green border" id="confirm-cancel">Yes</button>
<button class="btn-text-red border modal-close" id="cancel-cancel">No</button>
</div>
</div>
</div>
</div>
Expand All @@ -523,14 +516,15 @@ function paymentGateWay(data) {
<div class="modal" id="mark-as-rented-modal">
<div class="modal-content">
<span class="close">&times;</span>
<div class="flex-d-c flex-md-c justify-content-center aligh-items-center gap-3">

<h2 class="text-center">Mark as Rented</h2>
<p>Are you sure you want to mark this order as rented?</p>
<div class="flex-d gap-3 mt-3">
<button class="btn-text-green border" id="mark-as-rented-confirm">Yes</button>
<button class="btn-text-red border modal-close" id="mark-as-rented-cancel">No</button>
</div>
<div class="flex-d-c flex-md-c justify-content-center aligh-items-center gap-3 p-6">
<h2 class="text-center">Mark as Rented</h2>
<div class="row">
<p>Are you sure you want to mark this order as rented?</p>
</div>
<div class="row flex-d gap-3 mt-3">
<button class="btn-text-green border" id="mark-as-rented-confirm">Yes</button>
<button class="btn-text-red border modal-close" id="mark-as-rented-cancel">No</button>
</div>
</div>
</div>
</div>
Expand All @@ -542,18 +536,24 @@ function paymentGateWay(data) {
<div class="modal" id="report-modal">
<div class="modal-content">
<span class="close">&times;</span>
<h2 id="report-order-id">Report for Order ID: </h2>
<form id="report-form">
<div class="form-group">
<div class="flex-d-c flex-md-c justify-content-center aligh-items-center gap-3 p-5">
<div class="row">
<h2 id="report-order-id">Add complaint</h2>
</div>
<form id="report-form" class="ml-4">
<div class="form-group mb-2">
<label for="title">Title</label>
<input type="text" id="report-title" name="title" class="form-control-lg" required>
</div>
<div class="form-group">
<div class="form-group mb-2">
<label for="description">Description</label>
<textarea id="report-description" name="description" class="form-control-lg" required></textarea>
</div>
<button class="btn-text-green border" id="report-submit">Submit</button>
<div class="row mt-5">
<button class="btn-text-green border" id="report-submit">Submit</button>
</div>
</form>
</div>
</div>
</div>

Expand All @@ -572,4 +572,10 @@ function paymentGateWay(data) {



<?php require_once('../app/views/layout/footer.php'); ?>
<?php
require_once('../app/views/layout/footer-main.php');
?>

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

0 comments on commit a8a8069

Please sign in to comment.