From 044ed27e307adfffaf2ef057d9d0111143380772 Mon Sep 17 00:00:00 2001 From: Sarani Date: Tue, 23 Apr 2024 18:15:14 +0530 Subject: [PATCH 1/3] customer-profile --- app/controllers/Complaints.php | 15 ++- app/models/RentComplaint.php | 10 ++ app/views/customer/complaints.view.php | 13 +- .../components/customercomplaintlist.view.php | 111 ++++++++++++++++++ app/views/customer/orders.view.php | 4 +- app/views/customer/rent.view.php | 64 +++++----- database/sarani/rent_complaint.sql | 62 ++++++++++ .../assets/scss/wl/dashboard/_complaints.scss | 12 ++ .../assets/scss/wl/dashboard/_customer.scss | 5 + public/assets/scss/wl/dashboard/_rowcol.scss | 6 + .../scss/wl/dashboard/common/_colors.scss | 3 + public/assets/scss/wl/dashboard/index.scss | 1 + 12 files changed, 264 insertions(+), 42 deletions(-) create mode 100644 app/views/customer/components/customercomplaintlist.view.php create mode 100644 database/sarani/rent_complaint.sql create mode 100644 public/assets/scss/wl/dashboard/common/_colors.scss diff --git a/app/controllers/Complaints.php b/app/controllers/Complaints.php index 964bf725..ce832fce 100644 --- a/app/controllers/Complaints.php +++ b/app/controllers/Complaints.php @@ -67,11 +67,6 @@ public function returnComplaintsbyCustomer(string $a = '', string $b = '', strin $this->view('customer/components/complaintlist', $data); - - - - - } public function returnComplaintbyCustomer(string $a = '', string $b = '', string $c = ''):void { @@ -108,4 +103,14 @@ public function returnComplaintbyCustomer(string $a = '', string $b = '', string $this->view('customer/components/complaint', ['complaint' => $complaint, 'order' => $order, 'items' => $items]); } + public function rentCompaints(string $a = '', string $b = '', string $c = ''):void { + $rentcomplaint = new RentComplaintModel; + $data = ['customer_id' => UserMiddleware::getUser()['id']]; + $data['complaints'] = $rentcomplaint->getComplaintsByCustomer($data); + show ($data['complaints']); + + $this->view('customer/components/customercomplaintlist', $data); + } + + } \ No newline at end of file diff --git a/app/models/RentComplaint.php b/app/models/RentComplaint.php index 89a1bd49..65a0b378 100644 --- a/app/models/RentComplaint.php +++ b/app/models/RentComplaint.php @@ -22,6 +22,16 @@ public function createComplaint($data) { public function getComplaints(array $data) { return $this->where($data); } + + public function getComplaintsByCustomer(array $data) { + $q = new QueryBuilder; + $q->setTable('rent_complaint'); + $q->select('rent.customer_id as customer_id, rent.id as rent_id, complaint_no as complaint_no, rent_complaint.status as status, rent_complaint.description as description, rent_complaint.created_at as created_at') + ->join('rent', 'rent_complaint.rent_id','rent.id') + ->where('rent.customer_id', $data['customer_id']); + + return $this->query($q->getQuery(), $q->getData()); + } } diff --git a/app/views/customer/complaints.view.php b/app/views/customer/complaints.view.php index caa037c4..1aa45392 100644 --- a/app/views/customer/complaints.view.php +++ b/app/views/customer/complaints.view.php @@ -3,16 +3,15 @@ require_once('../app/views/navbar/customer-navbar.php'); ?> -
-
+
+

Complaints

- - - + +
@@ -33,7 +32,7 @@ function getComplaints(status) { headers:{ 'Authorization': 'Bearer' + getCookie('jwt_auth_token') }, - url: '/complaints/returnComplaintsbyCustomer/' + status, + url: '/complaints/' + status, type: 'GET', success: function(response) { //if complain-list-content in document remove it @@ -46,7 +45,7 @@ function getComplaints(status) { } $(document).ready(function(){ - getComplaints('myComplaints'); + getComplaints('returnComplaintsbyCustomer'); $('.section-switch button').click(function() { $('.section-switch button').removeClass('active'); $(this).addClass('active'); diff --git a/app/views/customer/components/customercomplaintlist.view.php b/app/views/customer/components/customercomplaintlist.view.php new file mode 100644 index 00000000..16a3a4f7 --- /dev/null +++ b/app/views/customer/components/customercomplaintlist.view.php @@ -0,0 +1,111 @@ + +
+ + +

No Complaints

'); + + foreach ($complaints as $complaint) { + ?> + +
+
+
+
Complaint ID: complaint_no ?>
+
Status: status ?>
+
+ +
+
description ?>
+
+ +
+ + + + + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/views/customer/orders.view.php b/app/views/customer/orders.view.php index 21bb5e54..12116538 100644 --- a/app/views/customer/orders.view.php +++ b/app/views/customer/orders.view.php @@ -5,8 +5,8 @@ ?> -
-
+
+
diff --git a/app/views/customer/rent.view.php b/app/views/customer/rent.view.php index 4bab0711..c8e94b49 100644 --- a/app/views/customer/rent.view.php +++ b/app/views/customer/rent.view.php @@ -8,7 +8,7 @@ -
+
@@ -23,37 +23,45 @@
-
+
+
+
+
+ + +
+
+
+ + + + + + + + +
+
+
+ +
+
+
- +
+

Change the duration here

+
+
+ +
- - -
-
- - -
-
-
- - - - - - - - -
-
-
- +
diff --git a/database/sarani/rent_complaint.sql b/database/sarani/rent_complaint.sql new file mode 100644 index 00000000..6c9f5a38 --- /dev/null +++ b/database/sarani/rent_complaint.sql @@ -0,0 +1,62 @@ +-- phpMyAdmin SQL Dump +-- version 5.2.1 +-- https://www.phpmyadmin.net/ +-- +-- Host: mysql-server +-- Generation Time: Apr 23, 2024 at 06:11 AM +-- Server version: 8.2.0 +-- PHP Version: 8.2.8 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Database: `wanderlust` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `rent_complaint` +-- + +CREATE TABLE `rent_complaint` ( + `id` int NOT NULL, + `rent_id` int DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + `description` text, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `status` enum('pending','cancelled','resolved') DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `rent_complaint` +-- +ALTER TABLE `rent_complaint` + ADD PRIMARY KEY (`id`); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `rent_complaint` +-- +ALTER TABLE `rent_complaint` + MODIFY `id` int NOT NULL AUTO_INCREMENT; +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/public/assets/scss/wl/dashboard/_complaints.scss b/public/assets/scss/wl/dashboard/_complaints.scss index f448cd5b..286da745 100644 --- a/public/assets/scss/wl/dashboard/_complaints.scss +++ b/public/assets/scss/wl/dashboard/_complaints.scss @@ -14,6 +14,18 @@ } } +.complaint-body { + .complaint-description { + display: flex; + // justify-content: center; + font-weight: 400; + font-family: sans-serif, 'Poppins'; + font-size: $header4 ; + color: $gray-text; + font-style: italic; + } + } + .modal-content { border-radius: 20px; padding: 10px 20px 10px 10px; diff --git a/public/assets/scss/wl/dashboard/_customer.scss b/public/assets/scss/wl/dashboard/_customer.scss index 815d35ca..fe6d568e 100644 --- a/public/assets/scss/wl/dashboard/_customer.scss +++ b/public/assets/scss/wl/dashboard/_customer.scss @@ -614,3 +614,8 @@ margin: 1px 0; } } +.search-bar { + display: flex; + flex-direction: row; + background-color: $color-white; +} \ No newline at end of file diff --git a/public/assets/scss/wl/dashboard/_rowcol.scss b/public/assets/scss/wl/dashboard/_rowcol.scss index 7ca11fde..b117a718 100644 --- a/public/assets/scss/wl/dashboard/_rowcol.scss +++ b/public/assets/scss/wl/dashboard/_rowcol.scss @@ -47,6 +47,12 @@ } + .col-lg-10{ + flex: 0 0 83.333333%; + max-width: 83.333333%; + width: 83.333333%; + } + .col-lg-12 { flex: 0 0 100%; max-width: 100%; diff --git a/public/assets/scss/wl/dashboard/common/_colors.scss b/public/assets/scss/wl/dashboard/common/_colors.scss new file mode 100644 index 00000000..5df7a761 --- /dev/null +++ b/public/assets/scss/wl/dashboard/common/_colors.scss @@ -0,0 +1,3 @@ +.bg-color-primary { + background-color: $color-lighter; +} \ No newline at end of file diff --git a/public/assets/scss/wl/dashboard/index.scss b/public/assets/scss/wl/dashboard/index.scss index fd0a1a17..efbb4b1f 100644 --- a/public/assets/scss/wl/dashboard/index.scss +++ b/public/assets/scss/wl/dashboard/index.scss @@ -29,6 +29,7 @@ @import "./common/width"; @import "./common/rounded"; @import "./common/position"; +@import "./common/colors"; @import "./navbar/navbar"; From f4df37af71a77b23cd286eea7cd416da8a989eb1 Mon Sep 17 00:00:00 2001 From: Sarani Date: Wed, 24 Apr 2024 14:37:06 +0530 Subject: [PATCH 2/3] customer-comlaints --- app/views/customer/rent.view.php | 79 ++++++++++--------- public/assets/scss/wl/dashboard/_card.scss | 17 ++++ .../assets/scss/wl/dashboard/_customer.scss | 60 +++++++++++++- 3 files changed, 116 insertions(+), 40 deletions(-) diff --git a/app/views/customer/rent.view.php b/app/views/customer/rent.view.php index c8e94b49..504cb1a8 100644 --- a/app/views/customer/rent.view.php +++ b/app/views/customer/rent.view.php @@ -23,49 +23,51 @@
-
-
-
-
- - -
+
+
+
+
+
+
-
- - - - - - - - -
+
+ + + + + + + + + +
+
+
-
-
- -
-

Change the duration here

-
-
- + +
+
+
+ +
+

Change the duration here

+
+
+ +
-
-
-
@@ -77,10 +79,11 @@ + + + + +
- - - - - + + + +
@@ -52,19 +69,8 @@
-
-
-
- -
-

Change the duration here

-
-
- -
-
-
-
+ +
@@ -484,6 +490,8 @@ function setNewDate(start, end) { }); + $('#date-change-phase').text("Selected Date: " + start + " - " + end); + @@ -537,9 +545,9 @@ function setNewDate(start, end) { // function / use jQuery function disableButton(id) { - var button = $(`[data-id=${id}]`).find('#add-to-cart'); - button.text('Added'); - button.prop('disabled', true); + // var button = $(`[data-id=${id}]`).find('#add-to-cart'); + // button.text('Added'); + // button.prop('disabled', true); } // get cart count diff --git a/public/assets/scss/wl/dashboard/_customer.scss b/public/assets/scss/wl/dashboard/_customer.scss index 3b846679..4ecd5247 100644 --- a/public/assets/scss/wl/dashboard/_customer.scss +++ b/public/assets/scss/wl/dashboard/_customer.scss @@ -633,7 +633,7 @@ margin: 1px 0; display: flex; flex-direction: row; justify-content: center; - padding: 0 30rem 0 30rem; + // padding: 0 30rem 0 30rem; max-width: 100%; }