From 9dc828eaeae8ab1b591f5b2e61df79d69e06eb4b Mon Sep 17 00:00:00 2001 From: nsavinda Date: Thu, 25 Apr 2024 15:50:55 +0530 Subject: [PATCH 1/5] fix: item view button --- app/views/customer/components/items.view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/customer/components/items.view.php b/app/views/customer/components/items.view.php index dd056ef..46f6867 100644 --- a/app/views/customer/components/items.view.php +++ b/app/views/customer/components/items.view.php @@ -24,7 +24,7 @@ --> - + From 92bfde795b31b0c5cc76700e4c0f11a0ac16521c Mon Sep 17 00:00:00 2001 From: nsavinda Date: Thu, 25 Apr 2024 17:51:30 +0530 Subject: [PATCH 2/5] fix:profile image upload --- app/views/customer/components/orderlist.view.php | 3 ++- app/views/rental/layout/sidebar.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/customer/components/orderlist.view.php b/app/views/customer/components/orderlist.view.php index 983d2ee..f7867b2 100644 --- a/app/views/customer/components/orderlist.view.php +++ b/app/views/customer/components/orderlist.view.php @@ -3,7 +3,8 @@

No Orders

'); foreach ($orders as $order) { diff --git a/app/views/rental/layout/sidebar.php b/app/views/rental/layout/sidebar.php index a2269c5..171a4b7 100755 --- a/app/views/rental/layout/sidebar.php +++ b/app/views/rental/layout/sidebar.php @@ -305,7 +305,7 @@ function toggleSidebar() { alertmsg('Image uploaded successfully','success'); $('#image-upload').css('display', 'none'); - $('.profile-image').attr('src', '/uploads/images/rental_services/' + data.image); + $('.profile-image').attr('src', '/uploads/images/rental_services/' + data.data.image); // $('#profile-image-input').val(''); // $('#image-preview').attr('src', ''); // location.reload(); From 3960f717d6a2b77d1b7722af03baa21861284bb8 Mon Sep 17 00:00:00 2001 From: nsavinda Date: Thu, 25 Apr 2024 18:04:38 +0530 Subject: [PATCH 3/5] fix:equipment file type --- app/views/rental/equipments.view.php | 11 ++++++++++- app/views/rental/layout/sidebar.php | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/rental/equipments.view.php b/app/views/rental/equipments.view.php index 0adf16e..8b1f163 100644 --- a/app/views/rental/equipments.view.php +++ b/app/views/rental/equipments.view.php @@ -216,7 +216,7 @@

Upload Equipment Images

- +
@@ -236,6 +236,15 @@ var imgContainer = $('
', { 'class': 'img-preview-item' }); var img = $('', { 'class': 'image-preview' }).appendTo(imgContainer); + // validate file type + var fileType = file['type']; + var validImageTypes = ['image/jpeg', 'image/png', 'image/jpg', 'image/gif', 'image/webp']; + if (!validImageTypes.includes(fileType)) { + alertmsg('Invalid file type. Please select an image file' , 'error'); + // clear + $('#equipment-image-input').val(''); + return; + } var removeButton = $(' + rent_status == 'rented') { ?> diff --git a/app/views/customer/orders.view.php b/app/views/customer/orders.view.php index 849a861..66d0907 100644 --- a/app/views/customer/orders.view.php +++ b/app/views/customer/orders.view.php @@ -342,6 +342,37 @@ function loadOrders(status = 'all') { }); + // Pay button for unpaid + $(document).on('click','.order-pay-button', function() { + var referenceNo = $(this).closest('button').attr('data-id'); + console.log(referenceNo); + showLoader(); + // open pay modal + $.ajax({ + url: '/api/pay/unpaid', + headers: { + 'Authorization': 'Bearer ' + getCookie('jwt_auth_token') + }, + type: 'POST', + data: JSON.stringify({ + reference_number: referenceNo + }), + contentType: 'application/json', + success: function(data) { + paymentGateWay(data.data); + + }, + error: function(data) { + console.log(data); + alertmsg('Error loading payment details', 'error'); + hideLoader(); + } + + }); + + }); + + function paymentGateWay(data) { console.log("Payment gateway");