From cf0d4ba048e0e054664d4bd84fdd1e8c5f57e8b6 Mon Sep 17 00:00:00 2001 From: sriramv Date: Mon, 19 Jun 2023 16:23:52 +0530 Subject: [PATCH] gwm --- app/Config/Routes.php | 2 +- app/Controllers/Admin_controller.php | 66 +++- app/Views/checkout.php | 87 +++-- app/Views/members_list.php | 54 ++- app/Views/view_member_details.php | 499 +++++++++++++++++++++++++++ 5 files changed, 675 insertions(+), 33 deletions(-) create mode 100644 app/Views/view_member_details.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index e29393a..c958ddb 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -99,7 +99,7 @@ $routes->match(['get','post'],'/booked_slot','Admin_controller::booked_slot'); $routes->match(['get','post'],'/manage_availability','Admin_controller::manage_availability'); $routes->match(['get','post'],'/add_to_cart_package','Admin_controller::add_to_cart_package'); $routes->match(['post'],'/order_details','Admin_controller::order_details'); - +$routes->match(['get'],'/view_member_details/(:any)','Admin_controller::view_member_details/$1'); $routes->match(['get'],'/admin_home','Dashboard::admin_home'); diff --git a/app/Controllers/Admin_controller.php b/app/Controllers/Admin_controller.php index 14ec912..b6319f5 100644 --- a/app/Controllers/Admin_controller.php +++ b/app/Controllers/Admin_controller.php @@ -29,7 +29,7 @@ use App\Models\Zipcode_model; use App\Models\Transaction_model; use App\Models\Country_model; - +use App\Models\Member_model; use DateTime; @@ -71,6 +71,8 @@ class Admin_controller extends BaseController $this->CountryModel = new Country_model(); + $this->MemberModel = new Member_model(); + helper(['form', 'url']); } @@ -1081,7 +1083,69 @@ class Admin_controller extends BaseController } + public function view_member_details($member_id) + { + + + $creditsData = $this->creditsModel->where('member_id',$member_id)->where('is_active',1)->orderBy('id' , 'ASC')->findAll(); + $recent_expiry = $this->creditsModel->select('expiring_date')->selectSum('running_balance', 'no_of_credits')->groupBy('expiring_date')->orderBy('expiring_date', 'asc')->where('member_id',$member_id)->where('is_active',1)->first(); + if($recent_expiry){ + $data['no_of_credits'] = $recent_expiry['no_of_credits']; + $data['expiring_date'] = $recent_expiry['expiring_date']; + }else{ + $data['no_of_credits'] = ''; + $data['expiring_date'] = ''; + } + + + $data['credit_data'] = []; + $data['avaiable_credit'] = 0; + $data['profile'] = $this->MemberModel->select('member.* , zipcode.code as zipcode') + ->join('zipcode', 'member.pincode = zipcode.id', 'left') + ->where('member.id', $member_id) + ->find(); + $data['country'] = $this->CountryModel->findAll(); + foreach ($creditsData as $creditsDataindex => $creditsDataValue) + { + + $data['avaiable_credit'] = $data['avaiable_credit'] + $creditsDataValue['running_balance']; + $creditsDataValue['avaiable_credit'] = $data['avaiable_credit']; + array_push($data['credit_data'] , $creditsDataValue); + } + + + $TransactionData = $this->TransactionModel->where('member_id', $member_id)->where('status', 'success')->findAll(); + $data['TransactionData'] = []; + foreach ($TransactionData as $TransactionDatakey => $TransactionDatavalue) { + $credit_data = $this->creditsModel->where('member_id', $member_id) + ->select('package_name') + ->select('cost') + ->select('credit_points') + ->select('expiring_date') + ->selectSum('credit_points', 'creditPointsSum') + ->selectSum('cost', 'costSum') + ->selectCount('package_name', 'pack_count') + ->groupBy('package_name') + ->where('order_id',$TransactionDatavalue['order_id']) + ->where('is_active',1) + ->findAll(); + $TransactionDatavalue['credit_data'] = $credit_data; + array_push($data['TransactionData'] ,$TransactionDatavalue); + } + $data['gst'] = $this->RuleModel->select('value')->where('rule_key', 3 )->get()->getRow()->value; + $data['pst'] = $this->RuleModel->select('value')->where('rule_key', 4 )->get()->getRow()->value; + $zip = $this->ZipcodeModel->findAll(); + $output = ''; + foreach($zip as $row) + { + $output .= ''; + } + $data['zipcode'] = $output; + + echo view('view_member_details',$data); //dashboard + + } // public function add_to_cart_package() diff --git a/app/Views/checkout.php b/app/Views/checkout.php index 9f08fe1..8e2e183 100644 --- a/app/Views/checkout.php +++ b/app/Views/checkout.php @@ -273,16 +273,16 @@ $web_payment_sdk_url = $_ENV["ENVIRONMENT"] === Environment::PRODUCTION ? "https - - + +
- - + +
@@ -291,24 +291,24 @@ $web_payment_sdk_url = $_ENV["ENVIRONMENT"] === Environment::PRODUCTION ? "https - - + +
- - + +
- - + +
@@ -316,7 +316,7 @@ $web_payment_sdk_url = $_ENV["ENVIRONMENT"] === Environment::PRODUCTION ? "https - "> - +
- - + + @@ -410,7 +411,8 @@ $web_payment_sdk_url = $_ENV["ENVIRONMENT"] === Environment::PRODUCTION ? "https -
+
+
@@ -483,18 +485,18 @@ $web_payment_sdk_url = $_ENV["ENVIRONMENT"] === Environment::PRODUCTION ? "https

$

- +
-

PST (%) :

+

PST :

$

- +
-

GST (%) :

+

GST :

$

@@ -562,12 +564,53 @@ $web_payment_sdk_url = $_ENV["ENVIRONMENT"] === Environment::PRODUCTION ? "https $(document).ready(function() { $("#card-button").removeAttr('disabled'); $('.js-example-basic-single').select2(); + $("#fast-checkout").css('display','none'); + $(".payment-title").css('display','none'); }); $('#card-button').click(function() { - $('#card-button').prop("disabled", true); - $('#loading-spinner-overlay').css('visibility', 'visible'); + //$('#card-button').prop("disabled", true); + // $('#loading-spinner-overlay').css('visibility', 'visible'); }); + + + $('#rememberMe').click(function() { + if ($(this).is(':checked')) { + ValidateForm(); + }else { + $("#fast-checkout").css('display','none'); + $(".payment-title").css('display','none'); + } + + }); + + function ValidateForm() { + var formInvalid = false; + $('#member_address input').each(function() { + if ($(this).val() === '') { + var id = $(this).attr('id'); + var input_id = id+'_span_message'; + + $('#'+input_id+'').html('input required').css('color','red'); + formInvalid = true; + } + }); + + if (formInvalid) + { $('#rememberMe').prop('checked', false);} + else{ $("#fast-checkout").css('display','block'); $(".payment-title").css('display','block');} + + } + + $('#first_name').keyup(function() {$('#first_name_span_message').html(''); if($('#first_name').val().length == 0){uncheck() }}); + $('#last_name').keyup(function() {$('#last_name_span_message').html(''); if($('#last_name').val().length == 0){uncheck() }}); + $('#address').keyup(function() {$('#address_span_message').html(''); if($('#address').val().length == 0){uncheck() } }); + $('#state').keyup(function() {$('#state_span_message').html(''); if($('#state').val().length == 0){uncheck() }}); + $('#city').keyup(function() { $('#city_span_message').html('');if($('#city').val().length == 0){uncheck() }}); + $('#country').keyup(function() {$('#country_span_message').html(''); if($('#country').val().length == 0){uncheck() }}); + $('#pincode').keyup(function() {$('#pincode_span_message').html(''); if($('#pincode').val().length == 0){uncheck() }}); + + function uncheck(){ $('#rememberMe').prop('checked', false); $(".payment-title").css('display','none'); $("#fast-checkout").css('display','none'); } diff --git a/app/Views/members_list.php b/app/Views/members_list.php index cba1094..f75d58b 100644 --- a/app/Views/members_list.php +++ b/app/Views/members_list.php @@ -70,7 +70,7 @@ - + @@ -87,26 +87,62 @@ - -
- + + + --> + + + + + + + + + + + + + +
+
+ +
+
+ + + + +
+
+ +
Credits
+
+
+
+
+ assets/member_images/icon-white.png" alt=""> +
+
+

Credits Avaiable

+ +
+
+ +
+
+
+
Credit Transactions
+ + + +
+
+ + + + + + + + = 0 ; $i--) { ?> + + + + 0) + echo ''; + else + echo ''; + ?> + + + +
DateDescriptionCredit TransactionsCredit Balance
format('M d , Y'); ?> + Credit Expiry

'; + else + echo '

'.$credit_data[$i]['package_name'].'

'; + ?> +

Expiry Date : format('M d , Y'); ?>

+

Order Id :

'.$credit_data[$i]['running_balance'].'
'.$credit_data[$i]['used_points'].'
+ +
+
+
Upcoming Credit Expiry:
+
+ +
+
Credits:
+
+
+
Expiry Date: format('M d , Y'); }?>
+
+ +
+
+
+
+ + + +
+
+
+ + + + + + + + \ No newline at end of file