diff --git a/app/Exports/InvestmentExport.php b/app/Exports/InvestmentExport.php new file mode 100644 index 0000000..85b64cf --- /dev/null +++ b/app/Exports/InvestmentExport.php @@ -0,0 +1,30 @@ +data = $data; + } + + public function collection() + { + return $this->data; + } + + public function headings(): array + { + return ["Product", "Expected Selling Price", "Seller Name", "Email", "Contact", "Listing Status", "Created At"]; + } +} diff --git a/app/Http/Controllers/Admin/AdminProfileController.php b/app/Http/Controllers/Admin/AdminProfileController.php index dc15cbd..cd37588 100644 --- a/app/Http/Controllers/Admin/AdminProfileController.php +++ b/app/Http/Controllers/Admin/AdminProfileController.php @@ -282,7 +282,7 @@ class AdminProfileController extends Controller abort(404); } - $users = User::where(['role' => 0, 'status' => '1'])->get(); + $users = User::where(['role' => false, 'status' => true])->get(); return view('Admin.Pages.manage_sub_admin.update_user_password', compact('users')); } diff --git a/app/Http/Controllers/Admin/DashboardController.php b/app/Http/Controllers/Admin/DashboardController.php index ac799df..8a6fc22 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -195,7 +195,7 @@ class DashboardController extends Controller $userCount = User::users()->count(); $investingUserCount = MonthlyUpdateMaster::distinct('users_id')->count('users_id'); $totalProductCount = Product::count(); - $leads = Lead::with('leadSource')->where('lead_owner', auth()->user()->id)->get(); + $leads = Lead::with('leadSource')->where('lead_owner', auth()->user()->id)->latest()->get(); $tasks = LeadTasksMeeting::where('owner', auth()->user()->id)->tasks()->get(); $meetings = LeadTasksMeeting::where('host', auth()->user()->id)->meetings()->get(); $users = User::admins()->get(); diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php index d9e263a..9b63cd4 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php @@ -289,7 +289,7 @@ class ManageFreeUInvestmentController extends Controller ]); $category_type = $request->category_id; Excel::import(new BondImport($category_type), $request->file('productFile')); - return back()->with('success', 'Bonds Imported Successfully.'); + return redirect()->route('manage.products')->with('success', 'Bonds Imported Successfully.'); } public function viewBond($id) @@ -432,7 +432,7 @@ class ManageFreeUInvestmentController extends Controller ]); $category_type = $request->category_id; Excel::import(new FundImport($category_type), $request->file('productFile')); - return back()->with('success', 'Funds Imported Successfully.'); + return redirect()->route('manage.products')->with('success', 'Funds Imported Successfully.'); } public function viewFund($id) @@ -614,7 +614,7 @@ class ManageFreeUInvestmentController extends Controller ]); $category_type = $request->category_id; Excel::import(new StockFundsRealEstateExchangeImport($category_type), $request->file('productFile')); - return back()->with('success', 'Exchange Imported Successfully.'); + return redirect()->route('manage.products')->with('success', 'Exchange Imported Successfully.'); } public function viewExchange($id) @@ -770,7 +770,7 @@ class ManageFreeUInvestmentController extends Controller ]); $category_type = $request->category_id; Excel::import(new RealEstateImport($category_type), $request->file('productFile')); - return back()->with('success', 'Real Estate Imported Successfully.'); + return redirect()->route('manage.products')->with('success', 'Real Estate Imported Successfully.'); } public function viewRealEstate($id) diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php b/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php index 0487186..abf39af 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php @@ -58,7 +58,7 @@ class FractionalRealEstateController extends Controller $category = Category::find($request->category_id); Excel::import(new FractionalRealEstateImport($category_type), $request->file('productFile')); // return back()->with('success', 'Product Imported Successfully.'); - return back()->with('success', "$category->category_name Imported Successfully."); + return redirect()->route('manage.products')->with('success', "$category->category_name Imported Successfully."); } /** diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestments/VentureCapitalFundController.php b/app/Http/Controllers/Admin/ManageFreeUInvestments/VentureCapitalFundController.php index 6f45b33..bb524e9 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestments/VentureCapitalFundController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestments/VentureCapitalFundController.php @@ -57,7 +57,7 @@ class VentureCapitalFundController extends Controller $category = Category::find($request->category_id); Excel::import(new AlternativeInvestmentFundImport($category_type), $request->file('productFile')); // return back()->with('success', "$category->category_name Imported Successfully."); - return back()->with('success', "$category->category_name Imported Successfully."); + return redirect()->route('manage.products')->with('success', "$category->category_name Imported Successfully."); } /** diff --git a/app/Http/Controllers/Admin/ManageInvestorController.php b/app/Http/Controllers/Admin/ManageInvestorController.php index 1855bc9..656bf70 100644 --- a/app/Http/Controllers/Admin/ManageInvestorController.php +++ b/app/Http/Controllers/Admin/ManageInvestorController.php @@ -272,11 +272,11 @@ class ManageInvestorController extends Controller if ($request->dropdownValue == 'Individual' || $request->dropdownValue == 'HUF' || $request->dropdownValue == 'NRI' || $request->dropdownValue == 'Company' || $request->dropdownValue == 'Partnership' || $request->dropdownValue == 'Others') { $data->where('kyc_type', $request->dropdownValue); }; - $data->latest()->select('*'); + $data->orderBy('updated_at','desc')->select('*'); return Datatables::of($data)->addIndexColumn() // return Datatables::of($data) ->editColumn('created_at', function ($row) { - $formattedDate = $row->created_at->format('d/m/Y'); + $formattedDate = $row->updated_at->format('d/m/Y'); return '
' . $formattedDate . '
'; }) ->editColumn('name', function ($row) { @@ -293,7 +293,7 @@ class ManageInvestorController extends Controller $btn = 'id) . '" class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Detail"> - users_id) . '" class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Invetsor Profile"> + users_id) . '" onclick=returnRedirect("manage_investor_kyc") class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Invetsor Profile"> @@ -304,7 +304,7 @@ class ManageInvestorController extends Controller $btn = 'id) . '" class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Detail"> - users_id) . '" class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Invetsor Profile"> + users_id) . '" onclick=returnRedirect("manage_investor_kyc") class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Invetsor Profile"> @@ -315,7 +315,7 @@ class ManageInvestorController extends Controller $btn = 'id) . '" class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Detail"> - users_id) . '" class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Invetsor Profile"> + users_id) . '" onclick=returnRedirect("manage_investor_kyc") class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="View Invetsor Profile"> diff --git a/app/Http/Controllers/Admin/ManageLeadController.php b/app/Http/Controllers/Admin/ManageLeadController.php index d9a5a25..5a7b60f 100644 --- a/app/Http/Controllers/Admin/ManageLeadController.php +++ b/app/Http/Controllers/Admin/ManageLeadController.php @@ -113,9 +113,12 @@ class ManageLeadController extends Controller ]); } - public function downloadFile($file_name) + public function downloadFile(Request $request ) { - return $this->lead->download($file_name); + // dd($file_name); + $path = $request->query('path'); + // dd("hello",$request->query('path'),$path['path']); + return $this->lead->download($path['path']); } public function editLead($id) diff --git a/app/Http/Controllers/Admin/ManageSubAdminController.php b/app/Http/Controllers/Admin/ManageSubAdminController.php index 7ad01b5..09406e3 100644 --- a/app/Http/Controllers/Admin/ManageSubAdminController.php +++ b/app/Http/Controllers/Admin/ManageSubAdminController.php @@ -58,7 +58,7 @@ class ManageSubAdminController extends Controller if (!$check) { abort(404); } - $subAdmin = User::where(['role' => 2, 'status' => 1])->whereNotIn('id', [auth()->user()->id])->latest()->get(); + $subAdmin = User::where(['role' => 2, 'status' => 1])->whereNotIn('id', [auth()->user()->id])->orderBy('last_login','desc')->get(); // $subAdmin = User::where('status', 1)->whereIn('role', ['1', '2'])->whereNotIn('id', [auth()->user()->id])->latest()->get(); // dd($subAdmin); return view('Admin.sub_admin_list', ['subAdmin' => $subAdmin]); diff --git a/app/Http/Controllers/Admin/OverviewController.php b/app/Http/Controllers/Admin/OverviewController.php index 82c105d..5676a5f 100644 --- a/app/Http/Controllers/Admin/OverviewController.php +++ b/app/Http/Controllers/Admin/OverviewController.php @@ -16,6 +16,8 @@ use Illuminate\Support\Facades\Validator; use App\Models\MarketplaceOtherProductsSeller; use App\Models\MarketplaceFractionalRealEstateSeller; use App\Models\MarketplaceAlternativeInvestmentFundSeller; +use App\Exports\InvestmentExport; +use Excel; class OverviewController extends Controller { @@ -31,7 +33,82 @@ class OverviewController extends Controller $aifMarketPlace = MarketplaceAlternativeInvestmentFundSeller::where('status', 'Approved')->latest()->get(); $freMarketPlace = MarketplaceFractionalRealEstateSeller::where('status', 'Approved')->latest()->get(); $opMarketPlace = MarketplaceOtherProductsSeller::where('status', 'Approved')->latest()->get(); - return view('Admin.Pages.pre_owned_investment.pre_owned_investment', compact('aifMarketPlace', 'freMarketPlace', 'opMarketPlace', 'totalSellerProfile', 'completedTransactions', 'totalInvestmentListed')); + $allMarketPlace = collect(); + foreach($aifMarketPlace as $data) + { + $data->table = 'marketplace_aif_sellers'; + $allMarketPlace->push($data); + } + foreach($freMarketPlace as $data) + { + $data->table = 'marketplace_fre_sellers'; + $allMarketPlace->push($data); + } + + $allMarketPlace = $allMarketPlace->sortByDesc('created_at'); + // dd($allMarketPlace); + return view('Admin.Pages.pre_owned_investment.pre_owned_investment', compact('aifMarketPlace', 'freMarketPlace', 'opMarketPlace', 'totalSellerProfile', 'completedTransactions', 'totalInvestmentListed','allMarketPlace')); + } + + public function downloadInvestment() + { + + // $aifMarketPlace = MarketplaceAlternativeInvestmentFundSeller::with(['seller' => function($query){$query->select('name as SellerName','email as Email','contact_number as Contact')->get();}])->where('status', 'Approved')->latest()->select('name_of_the_aif_fund as Product','expected_sale_per_unit as ExpectedSellingPrice','listing_status as ListingStatus')->get(); + $aifMarketPlace = MarketplaceAlternativeInvestmentFundSeller::with('seller')->where('status', 'Approved')->latest()->get(); + $freMarketPlace = MarketplaceFractionalRealEstateSeller::with('seller')->where('status', 'Approved')->latest()->get(); + // $aifMarketPlace = MarketplaceAlternativeInvestmentFundSeller::with('seller')->where('status', 'Approved')->latest()->get(); + // $freMarketPlace = MarketplaceFractionalRealEstateSeller::with('seller')->where('status', 'Approved')->latest()->get(); + $allMarketPlace = collect(); + $newData = []; + $count = 0; + foreach($aifMarketPlace as $data) + { + // $data['table'] = 'marketplace_aif_sellers'; + // $newData[$count]['Product'] = $data->name_of_the_aif_fund; + // $newData[$count]['ExpectedSellingPrice'] = $data->expected_sale_per_unit ; + // $newData[$count]['SellerName'] = $data->seller->name; + // $newData[$count]['Email'] = $data->seller->email; + // $newData[$count]['Contact'] = $data->seller->contact_number; + // $newData[$count]['ListingStatus'] = $data->listing_status; + // $newData[$count]['CreatedAt'] = $data->created_at->format('F d, o'); + $newData = array( + "Product" => $data->name_of_the_aif_fund, + "ExpectedSellingPrice" => $data->expected_sale_per_unit, + "SellerName" => $data->seller->name, + "Email" => $data->seller->email, + "Contact" => $data->seller->contact_number, + "ListingStatus" => $data->listing_status, + "CreatedAt" => $data->created_at->format('F d, o') + ); + $allMarketPlace->push($newData); + $count++; + } + foreach($freMarketPlace as $data) + { + // $newData[$count]['Product'] = $data->property_name; + // $newData[$count]['ExpectedSellingPrice'] = $data->expected_selling_price ; + // $newData[$count]['SellerName'] = $data->seller->name; + // $newData[$count]['Email'] = $data->seller->email; + // $newData[$count]['Contact'] = $data->seller->contact_number; + // $newData[$count]['ListingStatus'] = $data->listing_status; + // $newData[$count]['CreatedAt'] = $data->created_at->format('F d, o'); + $newData = array( + "Product" => $data->property_name, + "ExpectedSellingPrice" => $data->expected_selling_price , + "SellerName" => $data->seller->name, + "Email" => $data->seller->email, + "Contact" => $data->seller->contact_number, + "ListingStatus" => $data->listing_status, + "CreatedAt" => $data->created_at->format('F d, o') + ); + $allMarketPlace->push($newData); + $count++; + } + // dd($allMarketPlace->sortByDesc('created_at')); + // return $allMarketPlace->sortByDesc('created_at'); + // dd($allMarketPlace); + + return Excel::download(new InvestmentExport($allMarketPlace), 'investmentExport.xlsx'); } public function interestedBuyers($id, $table) diff --git a/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php b/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php index 7126233..f19542d 100644 --- a/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php +++ b/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php @@ -320,7 +320,7 @@ class AlternativeInvestmentFundController extends Controller public function infrastructure($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->infrastructureFund()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->where('type',$type)->infrastructureFund()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -342,7 +342,7 @@ class AlternativeInvestmentFundController extends Controller public function angelFundAllData($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->angelFund()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->where('type',$type)->angelFund()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -364,7 +364,7 @@ class AlternativeInvestmentFundController extends Controller public function privateEquityAllData($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->privateEquityFund()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->where('type',$type)->privateEquityFund()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -386,7 +386,7 @@ class AlternativeInvestmentFundController extends Controller public function debtFundAllData($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->debtFund()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->where('type',$type)->debtFund()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -408,7 +408,7 @@ class AlternativeInvestmentFundController extends Controller public function privateRealEstateFundAllData($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->privateRealEstateFund()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->where('type',$type)->privateRealEstateFund()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -430,7 +430,7 @@ class AlternativeInvestmentFundController extends Controller public function fundForDistressedAssetAllData($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->fundForDistressedAsset()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->where('type',$type)->fundForDistressedAsset()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -452,7 +452,7 @@ class AlternativeInvestmentFundController extends Controller public function hedgeFundAllData($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->hedgeFund()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->where('type',$type)->hedgeFund()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -474,7 +474,7 @@ class AlternativeInvestmentFundController extends Controller public function longOnlyEquityFundAllData($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','product_images')->longOnlyEquityFund()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','product_images')->where('type',$type)->longOnlyEquityFund()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -496,7 +496,7 @@ class AlternativeInvestmentFundController extends Controller public function privateCreditFundAllData($type = 'Open') { try { - return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','product_images')->privateCreditFund()->active()->get())) + return (new test(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','product_images')->where('type',$type)->privateCreditFund()->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { diff --git a/app/Http/Controllers/Frontend/FractionalRealEstateController.php b/app/Http/Controllers/Frontend/FractionalRealEstateController.php index f22a630..cb9c5a5 100644 --- a/app/Http/Controllers/Frontend/FractionalRealEstateController.php +++ b/app/Http/Controllers/Frontend/FractionalRealEstateController.php @@ -51,10 +51,10 @@ class FractionalRealEstateController extends Controller // dd('hello'); } - public function fractData() + public function fractData($type = 'Open') { try { - $product = Product::has('fractional_real_estate')->with('fractional_real_estate.companies')->active()->get(); + $product = Product::has('fractional_real_estate')->with('fractional_real_estate.companies')->where('type',$type)->active()->get(); foreach ($product as $fre) { $fre->fractional_real_estate->property_img = $fre->fractional_real_estate->getRawOriginal('property_image'); } diff --git a/app/Http/Controllers/Frontend/GlobalHedgeFundController.php b/app/Http/Controllers/Frontend/GlobalHedgeFundController.php index ad6c128..68607c3 100644 --- a/app/Http/Controllers/Frontend/GlobalHedgeFundController.php +++ b/app/Http/Controllers/Frontend/GlobalHedgeFundController.php @@ -26,15 +26,15 @@ class GlobalHedgeFundController extends Controller { $hedgeFund = Fund::where('slug',$slug)->first(); $productData = Fund::where('slug','=',$slug)->first(); - $productData = Product::where('id','=',$productData->products_id)->first(); + $productData = Product::with('product_images')->where('id','=',$productData->products_id)->first(); // dd($hedgeFund); return view('Frontend.Pages.hedge-funds.product',compact('hedgeFund','productData')); } - public function hedgeFundAllData() + public function hedgeFundAllData($type = 'Open') { try { - return (new test(Product::has('funds')->with('funds')->funds()->globalHedgeFund()->get())) + return (new test(Product::has('funds')->with('funds')->where('type',$type)->funds()->globalHedgeFund()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { diff --git a/app/Http/Controllers/Frontend/GlobalVentureCapitalFund.php b/app/Http/Controllers/Frontend/GlobalVentureCapitalFund.php index 1cd7a2a..d0a50b9 100644 --- a/app/Http/Controllers/Frontend/GlobalVentureCapitalFund.php +++ b/app/Http/Controllers/Frontend/GlobalVentureCapitalFund.php @@ -32,10 +32,10 @@ class GlobalVentureCapitalFund extends Controller return view('Frontend.Pages.venture-capital-funds.product',compact('ventureCapitalFund','productData')); } - public function ventureCapitalAllData() + public function ventureCapitalAllData($type = 'Open') { try { - return (new test(Product::has('funds')->with('funds')->funds()->globalVentureCapitalFund()->get())) + return (new test(Product::has('funds')->with('funds')->where('type',$type)->funds()->globalVentureCapitalFund()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { diff --git a/app/Http/Controllers/Frontend/HomeController.php b/app/Http/Controllers/Frontend/HomeController.php index 69c492b..22f0e26 100644 --- a/app/Http/Controllers/Frontend/HomeController.php +++ b/app/Http/Controllers/Frontend/HomeController.php @@ -20,6 +20,7 @@ use App\Models\PeerToPeerLending; use App\Models\SecuritizedDebtInstrument; use App\Models\VentureDebt; use App\Http\Controllers\Controller; +use App\Models\UserKyc; use App\Notifications\UserAdmin; use Illuminate\Support\Facades\Validator; use Session; @@ -141,6 +142,21 @@ class HomeController extends Controller return response()->json(['status' => 403, 'message' => "Please contact us"]); } + // $checkUserKycStatus = UserKyc::where('users_id',auth()->guard('users')->user()->id)->where('status','!=','Approved')->exists(); + $checkUserKycStatus = UserKyc::where('users_id',auth()->guard('users')->user()->id)->first(); + // dd($checkUserKycStatus == false ? true:false); + if (!$checkUserKycStatus || $checkUserKycStatus->status != 'Approved') { + if($checkUserKycStatus && $checkUserKycStatus->status != 'Approved') + { + return response()->json(['status' => 401, 'message' => "Your kyc under review.
Please contact us at info@jerichoalternatives.in "]); + } + // else{ + // return response()->json(['status' => 401, 'message' => "Please complete your KYC"]); + // } + return response()->json(['status' => 401, 'message' => "Please complete your KYC"]); + } + + $addLead = Lead::create([ 'users_id' => auth()->guard('users')->user()->id, 'lead_owner' => null, diff --git a/app/Http/Controllers/Frontend/ProfileController.php b/app/Http/Controllers/Frontend/ProfileController.php index 377e155..c2ca6df 100644 --- a/app/Http/Controllers/Frontend/ProfileController.php +++ b/app/Http/Controllers/Frontend/ProfileController.php @@ -37,7 +37,7 @@ class ProfileController extends Controller // 'email' => 'required|unique:users,email,' . $request->id . '', // 'contact_number' => 'required|numeric|digits:10|unique:users,contact_number,' . $request->id . '', 'profile_image' => 'image|mimes:jpeg,jpg,png|max:2000', - 'address' => 'required' + 'address' => 'required|max:255' ], [ 'required' => 'The :attribute field must be required', // 'unique' => 'The :attribute field must be unique', diff --git a/app/Http/Controllers/Frontend/UpdatePasswordController.php b/app/Http/Controllers/Frontend/UpdatePasswordController.php index 5afe1b0..2377823 100644 --- a/app/Http/Controllers/Frontend/UpdatePasswordController.php +++ b/app/Http/Controllers/Frontend/UpdatePasswordController.php @@ -34,6 +34,10 @@ class UpdatePasswordController extends Controller if ($validationMessage) { return response()->json(['status' => 400, 'message' => $validationMessage]); } + if($request->password == $request->newPassword) + { + return response()->json(['status' => 400, 'message' => "Your current password and new password could not be same"]); + } $user = User::find(auth()->guard('users')->user()->id); if (Hash::check($request->password, $user->password)) { $updatePassword = User::where('id', auth()->guard('users')->user()->id)->update([ @@ -43,7 +47,7 @@ class UpdatePasswordController extends Controller \Auth::guard('users')->logout(); return response()->json(['status' => 200, 'message' => 'Password Updated Successfully']); } - return response()->json(['status' => 400, 'message' => 'Could not update password']); + return response()->json(['status' => 400, 'message' => 'Current Password is incorrect']); } public function changePinAPI(Request $request) diff --git a/app/Http/Controllers/GlobalPrivateCreditController.php b/app/Http/Controllers/GlobalPrivateCreditController.php index b3176ed..96d2c85 100644 --- a/app/Http/Controllers/GlobalPrivateCreditController.php +++ b/app/Http/Controllers/GlobalPrivateCreditController.php @@ -31,7 +31,7 @@ class GlobalPrivateCreditController extends Controller return view('Frontend.Pages.venture-capital-funds.product', compact('ventureCapitalFund', 'productData')); } - public function privateCreditAllData($type) + public function privateCreditAllData($type = 'Open') { try { return (new test(Product::has('funds')->with('funds','product_images')->where('type', $type)->funds()->globalPrivateCreditFunds()->get())) diff --git a/app/Http/Requests/StoreAttachmentsRequest.php b/app/Http/Requests/StoreAttachmentsRequest.php index 61a618b..d14f466 100644 --- a/app/Http/Requests/StoreAttachmentsRequest.php +++ b/app/Http/Requests/StoreAttachmentsRequest.php @@ -38,7 +38,7 @@ class StoreAttachmentsRequest extends FormRequest return [ 'lead_id' => 'required', 'url' => 'sometimes|required', - 'filename' => 'sometimes|mimes:jpeg,png,jpg,gif,svg|max:2048', + 'filename' => 'sometimes|mimes:jpeg,png,jpg,gif,svg,pdf|max:2048', 'type' => 'required' ]; } diff --git a/app/Http/Requests/StoreCompanyKYC.php b/app/Http/Requests/StoreCompanyKYC.php index 4d86c36..6a43ca5 100644 --- a/app/Http/Requests/StoreCompanyKYC.php +++ b/app/Http/Requests/StoreCompanyKYC.php @@ -37,15 +37,15 @@ class StoreCompanyKYC extends FormRequest 'tan_allotment_letter' => 'mimes:jpeg,png,jpg,pdf|max:2048', 'List_of_directors_or_authorized_signatories' => 'mimes:jpeg,png,jpg,pdf|max:2048', // 'pan_card_copy_of_authorized_signatory' => ', - 'pan_card_copy_of_authorized_signatory.*' => 'required|mimes:jpeg,png,jpg,pdf|max:2048', + 'pan_card_copy_of_authorized_signatory' => 'required|mimes:jpeg,png,jpg,pdf|max:2048', // 'aadhar_card_copy_of_authorized_signatory' => ', - 'aadhar_card_copy_of_authorized_signatory.*' => 'required|mimes:jpeg,png,jpg,pdf|max:2048', + 'aadhar_card_copy_of_authorized_signatory' => 'required|mimes:jpeg,png,jpg,pdf|max:2048', 'proof_of_address_of_the_company' => 'required|mimes:jpeg,png,jpg,pdf|max:2048', 'latest_income_tax_return_of_the_company_Of_last_2_years' => 'mimes:jpeg,png,jpg,pdf|max:2048', 'copy_of_cml' => 'mimes:jpeg,png,jpg,pdf|max:2048', 'copy_of_audited_balance_sheet_for_the_last_2_f_y' => 'mimes:jpeg,png,jpg,pdf|max:2048', // 'passport_photo_all_authorized_signatories_or_directors' => ', - 'passport_photo_all_authorized_signatories_or_directors.*' => 'required|mimes:jpeg,png,jpg,pdf|max:2048', + 'passport_photo_all_authorized_signatories_or_directors' => 'required|mimes:jpeg,png,jpg,pdf|max:2048', 'true_copy_form_32_or_dir_12_alongwith_roc_fee_payment' => 'mimes:jpeg,png,jpg,pdf|max:2048', 'true_copy_form_no_18_or_inc_22_alongwith_roc_fee_payment' => 'mimes:jpeg,png,jpg,pdf|max:2048', 'cancelled_cheque' => 'required|mimes:jpeg,png,jpg,pdf|max:2048', diff --git a/app/Services/Admin/LeadService.php b/app/Services/Admin/LeadService.php index be92b12..decf316 100644 --- a/app/Services/Admin/LeadService.php +++ b/app/Services/Admin/LeadService.php @@ -107,7 +107,7 @@ class LeadService{ $path; if($request->filename) { - $fileName = $request->lead_id.'-'.time().$request->filename->getClientOriginalExtension(); + $fileName = $request->lead_id.'-'.time().'.'.$request->filename->getClientOriginalExtension(); $path = $request->filename->storeAs('files/manage_leads/attachment_file', $fileName); } if($request->url) @@ -163,6 +163,9 @@ class LeadService{ } public function download($file){ - return \Storage::download('files/' . $file); + // dd($file); + // return $file; + return \Storage::download($file); + // return response()->download(storage_path($file)); } } \ No newline at end of file diff --git a/app/Services/Admin/ManageSubAdminService.php b/app/Services/Admin/ManageSubAdminService.php index 84f3c17..41a277c 100644 --- a/app/Services/Admin/ManageSubAdminService.php +++ b/app/Services/Admin/ManageSubAdminService.php @@ -10,7 +10,8 @@ class ManageSubAdminService { public function getAllAdmin() { - return User::admins()->withTrashed()->latest()->get(); + // return User::admins()->withTrashed()->latest()->get(); + return User::users()->latest()->get(); } public function changeStatus($request) diff --git a/app/helper.php b/app/helper.php index 4c0258e..8e98950 100644 --- a/app/helper.php +++ b/app/helper.php @@ -38,6 +38,7 @@ if (!function_exists('validationErrorMessage')) { function imagePath($path = null) { + $finalPath = "https://staging.jerichoalternatives.in/"; if (env('APP_ENV') == 'production') { $finalPath = "https://jerichoalternatives.in/"; } diff --git a/public/assets/js/FrontendJs/register/registered.js b/public/assets/js/FrontendJs/register/registered.js index 0c8585f..d77203f 100644 --- a/public/assets/js/FrontendJs/register/registered.js +++ b/public/assets/js/FrontendJs/register/registered.js @@ -17,6 +17,14 @@ $(document).ready(function () { // return /^\w+([-+.'][^\s]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(value); // },"Please enter valid email"); + +$.validator.addMethod("customEmail", function(value, element) { + // Regular expression for email validation + return /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,}$/.test(value); + // return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value); +}, "Please enter a valid email address"); + + $("#register_form").validate({ cache: false, rules: { @@ -26,7 +34,7 @@ $(document).ready(function () { email: { required: true, - // EmailRegex: true, + customEmail: true, }, contact_number: { @@ -168,7 +176,7 @@ $(document).ready(function () { email2: { required: true, - // EmailRegex: true, + customEmail: true, }, contact_number2: { diff --git a/public/assets/js/FrontendJs/script.js b/public/assets/js/FrontendJs/script.js index 65bf79f..77dddba 100644 --- a/public/assets/js/FrontendJs/script.js +++ b/public/assets/js/FrontendJs/script.js @@ -37,7 +37,7 @@ window.$('#currently').DataTable({ $("#recipes-popbtn-four").on("click", function () { // var investNowUrl = '{{route("investNow")}}'; $.ajax({ - url : '/invest-now', + url : '/jericho_28_march/invest-now', // url : '{{route("investNow")}}', // url : investNowUrl, type: 'get', @@ -47,7 +47,9 @@ $("#recipes-popbtn-four").on("click", function () { // data : $(this).data('product-id'), dataType : 'json', success: function (result) { + console.log("result",result); // return result.status; + // alert('hello'); if(result.status == 201) { $('#login-pop-up').modal('show'); @@ -56,14 +58,20 @@ $("#recipes-popbtn-four").on("click", function () { $('#blocked-popup').modal('show'); } if(result.status === 200) { - $('#view_details').modal('hide'); - $('#recipes-pop-four').modal('show'); + $('#view_details').modal('hide'); + $('#recipes-pop-four').modal('show'); } if(result.status === 400){ - toastr.warning(result.message); + toastr.warning(result.message); + } + if(result.status == 401) + { + // alert(result.message); + $('#kyc_message').html(result.message); + $('#complete_kyc_modal').modal('show'); } } - }) + }); }); $("#recipes-pop-four-close").on("click", function (){ // console.log("Inside Close Tag") diff --git a/public/assets/uploads/fund_images/202404231201_1711435445_factsheet.jpg b/public/assets/uploads/fund_images/202404231201_1711435445_factsheet.jpg new file mode 100644 index 0000000..e22ed82 Binary files /dev/null and b/public/assets/uploads/fund_images/202404231201_1711435445_factsheet.jpg differ diff --git a/public/assets/uploads/fund_images/202404231201_image.png b/public/assets/uploads/fund_images/202404231201_image.png new file mode 100644 index 0000000..0513644 Binary files /dev/null and b/public/assets/uploads/fund_images/202404231201_image.png differ diff --git a/resources/views/Admin/Pages/manage_chat/chat.blade.php b/resources/views/Admin/Pages/manage_chat/chat.blade.php index 29400b5..0576ec6 100644 --- a/resources/views/Admin/Pages/manage_chat/chat.blade.php +++ b/resources/views/Admin/Pages/manage_chat/chat.blade.php @@ -27,7 +27,7 @@
{{$data->user->name}} - {{$data->created_at->format('d/m/Y')}} + {{$data->created_at->format('d/m/Y h:i a')}}
@if($data->message) diff --git a/resources/views/Admin/Pages/manage_cms/manage_blog/add_new_blog.blade.php b/resources/views/Admin/Pages/manage_cms/manage_blog/add_new_blog.blade.php index 67a2ba3..e31ac6a 100644 --- a/resources/views/Admin/Pages/manage_cms/manage_blog/add_new_blog.blade.php +++ b/resources/views/Admin/Pages/manage_cms/manage_blog/add_new_blog.blade.php @@ -26,7 +26,7 @@ @endforeach - --}} + --}}
-
+
- + + +
-
- -
+ +
+
@@ -57,26 +60,38 @@ + - + @endsection @section('scripts') - + + @endsection @section('scripts') - + -@endsection \ No newline at end of file + @endsection diff --git a/resources/views/Admin/Pages/manage_freeu_investment/manage_freeu_investment.blade.php b/resources/views/Admin/Pages/manage_freeu_investment/manage_freeu_investment.blade.php index 073ab31..8179d89 100644 --- a/resources/views/Admin/Pages/manage_freeu_investment/manage_freeu_investment.blade.php +++ b/resources/views/Admin/Pages/manage_freeu_investment/manage_freeu_investment.blade.php @@ -28,6 +28,7 @@

Manage Products

+
+ @if (count($errors) > 0) +
+ @foreach($errors->all() as $error) + {{ $error }}
+ @endforeach +
+ @endif + @if (Session::has('success')) +
+
+
+ +
{!! Session::get('success') !!}
+
+
+
+ @endif
@@ -501,6 +519,14 @@ @endsection @section('scripts') + + @endsection \ No newline at end of file diff --git a/resources/views/Admin/Pages/manage_investors/view_investors_detail.blade.php b/resources/views/Admin/Pages/manage_investors/view_investors_detail.blade.php index a479560..ac2a783 100644 --- a/resources/views/Admin/Pages/manage_investors/view_investors_detail.blade.php +++ b/resources/views/Admin/Pages/manage_investors/view_investors_detail.blade.php @@ -8,7 +8,8 @@

Investment Dashboard

- Back + {{-- Back --}} + Back
{{--
+ {{-- // back_route = sessionStorage.getItem("returnPage") != null ? {{route('manage_investor_kyc')}} : {{route('manage_investors')}}; --}}
+@endsection +@section('scripts') + @endsection \ No newline at end of file diff --git a/resources/views/Admin/Pages/manage_leads/edit-lead.blade.php b/resources/views/Admin/Pages/manage_leads/edit-lead.blade.php index 630cf7f..611a5a0 100644 --- a/resources/views/Admin/Pages/manage_leads/edit-lead.blade.php +++ b/resources/views/Admin/Pages/manage_leads/edit-lead.blade.php @@ -883,10 +883,16 @@