From 98f6571b29914309d035278daa89a0b8d61a003d Mon Sep 17 00:00:00 2001 From: Ritikesh yadav Date: Thu, 16 May 2024 18:45:41 +0530 Subject: [PATCH] fixing changes --- .../Admin/ManageInvestorController.php | 21 +++ .../Controllers/Admin/OverviewController.php | 5 +- app/Mail/ReplyInvestorMail.php | 39 ++++++ ...etplaceAlternativeInvestmentFundSeller.php | 7 +- app/Services/Admin/ContactUsService.php | 7 +- .../view-product/funds.blade.php | 2 +- .../manage_investor_kyc.blade.php | 125 ++++++++++++++++++ .../pending_investment_view.blade.php | 8 +- .../Admin/email/reply-mail-investor.blade.php | 107 +++++++++++++++ .../Pages/handpicked-investment.blade.php | 2 +- routes/web.php | 2 + 11 files changed, 315 insertions(+), 10 deletions(-) create mode 100644 app/Mail/ReplyInvestorMail.php create mode 100644 resources/views/Admin/email/reply-mail-investor.blade.php diff --git a/app/Http/Controllers/Admin/ManageInvestorController.php b/app/Http/Controllers/Admin/ManageInvestorController.php index 656bf70..7031df1 100644 --- a/app/Http/Controllers/Admin/ManageInvestorController.php +++ b/app/Http/Controllers/Admin/ManageInvestorController.php @@ -16,9 +16,16 @@ use App\Models\MonthlyUpdateFractionalRealEstate; use App\Notifications\UserAdmin; use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; +use App\Services\Admin\ContactUsService; class ManageInvestorController extends Controller { + protected $contact; + public function __construct(ContactUsService $contact) + { + $this->contact = $contact; + } + public function index() { $check = checkSidebarAccess('manage-investors'); @@ -30,6 +37,17 @@ class ManageInvestorController extends Controller return view('Admin.Pages.manage_investors.manage_investors', compact('users', 'investingUserCount')); } + public function replyInvestorMail(Request $request){ + // dd($request->all()); + $email = $request->email_send; + // $email = "ritikesh.yadav@wdimails.com"; + $subject = $request->subject; + $reply = $request->reply; + $investorMail = True; + $success = $this->contact->sendMail($email, $subject, $reply, $investorMail); + return response()->json(['status'=>200,'message'=>'success']); + } + public function manage_investor_kyc() { $check = checkSidebarAccess('manage-investors-kyc'); @@ -310,6 +328,9 @@ class ManageInvestorController extends Controller + + + '; } else { $btn = 'id) . '" class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Detail"> diff --git a/app/Http/Controllers/Admin/OverviewController.php b/app/Http/Controllers/Admin/OverviewController.php index 490b930..8bf90dc 100644 --- a/app/Http/Controllers/Admin/OverviewController.php +++ b/app/Http/Controllers/Admin/OverviewController.php @@ -322,14 +322,17 @@ class OverviewController extends Controller if ($table == 1) { $data = MarketplaceFractionalRealEstateSeller::with('seller', 'company')->where('id', $id)->firstOrFail(); + $tableName = 'marketplace_fre_sellers'; } elseif ($table == 2) { $data = MarketplaceAlternativeInvestmentFundSeller::with('seller')->where('id', $id)->firstOrFail(); + $tableName = 'marketplace_aif_sellers'; } elseif ($table == 3) { $data = MarketplaceOtherProductsSeller::with('seller')->where('id', $id)->firstOrFail(); } + $anyOneBuyed = MarketplaceBuyerForm::where(['associated_id'=>$id,'table'=>$tableName])->exists(); // dd($data); - return view('Admin.Pages.pre_owned_investment.pending_investment_view', compact('data', 'table')); + return view('Admin.Pages.pre_owned_investment.pending_investment_view', compact('data', 'table','anyOneBuyed')); } public function listingStatus(Request $request) diff --git a/app/Mail/ReplyInvestorMail.php b/app/Mail/ReplyInvestorMail.php new file mode 100644 index 0000000..005078a --- /dev/null +++ b/app/Mail/ReplyInvestorMail.php @@ -0,0 +1,39 @@ +data = $data; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + $data=$this->data; + + return $this->subject('Reply From Jericho Alternatives')->view('Admin.email.reply-mail-investor',compact('data')); + + // return $this->view('view.name'); + } +} diff --git a/app/Models/MarketplaceAlternativeInvestmentFundSeller.php b/app/Models/MarketplaceAlternativeInvestmentFundSeller.php index 262446a..a84921a 100644 --- a/app/Models/MarketplaceAlternativeInvestmentFundSeller.php +++ b/app/Models/MarketplaceAlternativeInvestmentFundSeller.php @@ -90,7 +90,8 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model public function getSoldStatusAttribute($id) { // return MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists() ? 'SOLD' : 'OPEN'; - $checkBIDExist = MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists(); + $id = $this->id; + $checkBIDExist = MarketplaceBuyerForm::where('associated_id', $id)->exists(); if($checkBIDExist) { $buyerData = MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->get(); @@ -104,7 +105,7 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model $getAIFData = MarketplaceAlternativeInvestmentFundSeller::where('id',$buyerData[0]->associated_id)->first(); $aifData = (int)$getAIFData->no_of_units_you_wish_to_sell; $remainUnits = $aifData - $totalSellUnits; - if($remainUnits <= 0) + if($remainUnits == 0 || $remainUnits < 0) { return 'SOLD'; }else{ @@ -112,7 +113,7 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model } } }else{ - return 'OPEN'; + return 'OPEN end'; } } diff --git a/app/Services/Admin/ContactUsService.php b/app/Services/Admin/ContactUsService.php index bf018b2..441867d 100644 --- a/app/Services/Admin/ContactUsService.php +++ b/app/Services/Admin/ContactUsService.php @@ -6,6 +6,7 @@ use Mail; use App\Models\ContactUs; use App\Models\ContactUsAdvanced; use App\Mail\ReplyContactUsMail; +use App\Mail\ReplyInvestorMail; class ContactUsService { @@ -15,10 +16,14 @@ class ContactUsService return ContactUs::latest()->get(); } - public function sendMail($email, $subject, $reply) + public function sendMail($email, $subject, $reply, $investorMail = null) { $data['subject'] = $subject; $data['message'] = $reply; + if($investorMail) + { + return Mail::to($email)->send(new ReplyInvestorMail($data)); + } return Mail::to($email)->send(new ReplyContactUsMail($data)); } diff --git a/resources/views/Admin/Pages/manage_freeu_investment/view-product/funds.blade.php b/resources/views/Admin/Pages/manage_freeu_investment/view-product/funds.blade.php index 4d936ea..e851270 100644 --- a/resources/views/Admin/Pages/manage_freeu_investment/view-product/funds.blade.php +++ b/resources/views/Admin/Pages/manage_freeu_investment/view-product/funds.blade.php @@ -247,7 +247,7 @@
Close diff --git a/resources/views/Admin/Pages/manage_investors/manage_investor_kyc.blade.php b/resources/views/Admin/Pages/manage_investors/manage_investor_kyc.blade.php index 827b5fe..9510a51 100644 --- a/resources/views/Admin/Pages/manage_investors/manage_investor_kyc.blade.php +++ b/resources/views/Admin/Pages/manage_investors/manage_investor_kyc.blade.php @@ -232,11 +232,136 @@
+ +{{-- reply mail popup start --}} + +{{-- reply mail popup end --}} + @endsection @section('scripts')