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..24c69d7 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -195,9 +195,10 @@ 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(); + $meetings = LeadTasksMeeting::where('host', (string)auth()->user()->id)->meetings()->get(); + // dd($meetings); $users = User::admins()->get(); return view('Admin.personal-dashboard', compact('companyCount', 'a', 'leads', 'tasks', 'meetings','users','userCount','investingUserCount','totalProductCount')); } diff --git a/app/Http/Controllers/Admin/ManageChatController.php b/app/Http/Controllers/Admin/ManageChatController.php index 5f00e7c..e13f2c0 100644 --- a/app/Http/Controllers/Admin/ManageChatController.php +++ b/app/Http/Controllers/Admin/ManageChatController.php @@ -107,34 +107,69 @@ class ManageChatController extends Controller public function usersDetail(Request $request) { $search = $request->search; - $userData = $this->initialUsers($search); - $data = ''; + // $userData = $this->initialUsers($search); + $userData = $this->getUserList(1)->toArray(); + // $searchResults=[]; + // $count = 0; foreach ($userData as $user) { - $profile_image = $user['profile_image'] != null ? "public/uploads/profile/img/" . $user->getRawOriginal('profile_image') : 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png'; - $user_name = $user['name']; - $user_email = $user['email']; - $user_id = $user['id']; - - $data .= " " . " -
-
-
- Pic - "; - if ($user['total_count']) { - $count = $user['total_count']; - $data .= "$count"; + // dd(strpos(strtolower($user['name']), strtolower($search)) !== false); + // Check if the 'name' field is like the search string + if (strpos(strtolower($user['name']), strtolower($search)) !== false) { + // If the name matches, add the user data to the search results array + $searchResults[] = $user; } - $data .= "
"; - - $data .= "
- $user_name -
$user_email
-
-
-
- "; } + // dd($searchResults); + // dd($searchResults, $search); + // $userData->filter(function($key) use ($search){ + // // return $key->name == "ravindra gawade"; + // if($key->name != null) + // { + // return preg_match("/$search/",$key['name']); + // } + // // return preg_match("/one/","one"); + // }); + // dd($searchResults); + $data = ''; + // if($searchResults) + // { + foreach($searchResults as $user) { + // dd($user['profile_image']); + + // if($user['profile_image'] != null) + // { + // $profile_image = "public/uploads/profile/img/" . $user->getRawOriginal('profile_image'); + // }else{ + // $profile_image = 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png'; + // } + // $profile_image = $user['profile_image'] != null ? "public/uploads/profile/img/" . $user->getRawOriginal('profile_image') : 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png'; + $profile_image = $user['profile_image'] != null ? $user['profile_image'] : 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png'; + $user_name = $user['name']; + $user_email = $user['email']; + $user_id = $user['id']; + + $data .= " " . " +
+
+
+ Pic + "; + if ($user['total_count']) { + $count = $user['total_count']; + $data .= "$count"; + } + $data .= "
"; + + $data .= "
+ $user_name +
$user_email
+
+
+
+ "; + // } + } + // } if ($data) { return $data; 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..bc6169e 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) @@ -176,6 +179,7 @@ class ManageLeadController extends Controller public function convertClosed(Request $request) { $convertClosed = $this->lead->convertActivity($request); + // dd(convertClosed); return $convertClosed ? $this->response('Converted To Closed Activity Succesfully!', 200) : $this->response('Error Converting it to Closed Activity!', 400); 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 aea3d45..1172070 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 { @@ -30,8 +32,84 @@ class OverviewController extends Controller $totalInvestmentListed = MarketplaceAlternativeInvestmentFundSeller::count() + MarketplaceFractionalRealEstateSeller::count() + MarketplaceOtherProductsSeller::count(); $aifMarketPlace = MarketplaceAlternativeInvestmentFundSeller::where('status', 'Approved')->latest()->get(); $freMarketPlace = MarketplaceFractionalRealEstateSeller::where('status', 'Approved')->latest()->get(); + // dd($freMarketPlace); $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) @@ -102,6 +180,54 @@ class OverviewController extends Controller // return response()->json(['status' => 400, 'message' => 'This product has already been Sold']); // } // } + // $checkAlreadySold = MarketplaceBuyerForm::where(['id'=>$buyerId,'status'=>'Sold'])->first(); + // if($checkAlreadySold) + // { + // $marketPlaceId = $checkAlreadySold->associated_id; + // if(MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->exists()) + // { + // $getAIFData = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->first(); + // $oldUnit = (int)$getAIFData->no_of_units_you_wish_to_sell; + // $newUnits = (int)$checkAlreadySold->no_of_units_you_wish_to_buy + $oldUnit; + // $updateUnits = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->update([ + // 'no_of_units_you_wish_to_sell' => $newUnits, + // ]); + + // } + // // elseif(MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->exists()) + // // { + // // $getAIFData = MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->first(); + // // $oldUnit = (int)$getAIFData->no_of_units_you_wish_to_sell; + // // $newUnits = (int)$checkAlreadySold->no_of_units_you_wish_to_buy + $oldUnit; + // // $updateUnits = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->update([ + // // 'no_of_units_you_wish_to_sell' => $newUnits, + // // ]); + + // // } + // }else + + + if($status == 'Sold'){ + $getMarketplaceBuyerUnit = MarketplaceBuyerForm::where('id', $buyerId)->first(); + $marketPlaceId = $getMarketplaceBuyerUnit->associated_id; + $getUnits = (int)$getMarketplaceBuyerUnit->no_of_units_you_wish_to_buy; + if(MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->exists()) + { + $getAIFData = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->first(); + $oldUnit = (int)$getAIFData->no_of_units_you_wish_to_sell; + $newUnits = $oldUnit - (int)$getUnits; + if($newUnits >= 0) + { + $updateUnits = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->update([ + 'no_of_units_you_wish_to_sell' => $newUnits, + ]); + } + else{ + return response()->json(['status' => 400, 'message' => 'Bid units is more than seller units with '.abs($newUnits).' units']); + } + + } + } $alreadySold = MarketplaceBuyerForm::where('id', $buyerId)->update([ 'status' => $status ]); 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/ChatBoxController.php b/app/Http/Controllers/Frontend/ChatBoxController.php index 92da431..d08a091 100644 --- a/app/Http/Controllers/Frontend/ChatBoxController.php +++ b/app/Http/Controllers/Frontend/ChatBoxController.php @@ -12,7 +12,13 @@ class ChatBoxController extends Controller { public function index() { - // dd(Chat::where('user_id', auth()->guard('users')->user()->id)->get()); + $getUnreadChat = Chat::where(['user_id'=>auth()->guard('users')->user()->id,'is_read'=>false])->get(); + $getUnreadChat->each(function($value){ + chat::where(['id'=>$value->id,'user_id'=>auth()->guard('users')->user()->id])->update([ + 'is_read'=>true, + 'read_at'=>now(), + ]); + }); return view('Frontend.Pages.user-chat.index', [ 'chats' => Chat::where('user_id', auth()->guard('users')->user()->id)->get() ]); diff --git a/app/Http/Controllers/Frontend/DashboardController.php b/app/Http/Controllers/Frontend/DashboardController.php index 6723db6..8992f34 100644 --- a/app/Http/Controllers/Frontend/DashboardController.php +++ b/app/Http/Controllers/Frontend/DashboardController.php @@ -57,11 +57,20 @@ class DashboardController extends Controller public function getMarketplaceAIFSellerData() { $id = auth()->guard('users')->user()->id; - $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_aif_sellers'])->get(); - foreach ($market_place_data as $row) { - $row['marketplace_aif_sellers_data'] = MarketplaceAlternativeInvestmentFundSeller::where('id', $row->associated_id)->first(); + // $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_aif_sellers'])->get(); + // foreach ($market_place_data as $row) { + // $row['marketplace_aif_sellers_data'] = MarketplaceAlternativeInvestmentFundSeller::where('id', $row->associated_id)->first(); + // } + // return $market_place_data; + $sellerData = MarketplaceSellerForm::has('aif')->with('aif')->where('users_id',$id)->get(); + // return $sellerData[0]->aif['name_of_the_aif_fund']; + if(count($sellerData->toArray())) + { + $market_place_data = $sellerData[0]->aif->toArray(); + return $market_place_data; } - return $market_place_data; + return $sellerData; + } public function aifSoldInvestment() @@ -103,11 +112,20 @@ class DashboardController extends Controller public function getMarketplaceFRESellerData() { $id = auth()->guard('users')->user()->id; - $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_fre_sellers'])->get(); - foreach ($market_place_data as $row) { - $row['marketplace_fre_sellers_data'] = MarketplaceFractionalRealEstateSeller::where('id', $row->associated_id)->first(); + // $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_fre_sellers'])->get(); + // foreach ($market_place_data as $row) { + // $row['marketplace_fre_sellers_data'] = MarketplaceFractionalRealEstateSeller::where('id', $row->associated_id)->first(); + // } + // return $market_place_data; + $sellerData = MarketplaceSellerForm::has('fre')->with('fre')->where('users_id',$id)->get(); + // dd(count($sellerData->toArray())); + if(count($sellerData->toArray())) + { + $market_place_data = $sellerData[0]->fre->toArray(); + return $market_place_data; } - return $market_place_data; + return $sellerData; + // if($sellerData->toArray()->count()) } public function getMarketplaceOPSellerData() @@ -769,7 +787,7 @@ class DashboardController extends Controller ->join('marketplace_aif_sellers', 'marketplace_buyer_forms.associated_id', 'marketplace_aif_sellers.id') ->alernativeInvestmentFund() ->sold() - ->where('listing_status', '!=', 'Hide') + // ->where('listing_status', '!=', 'Hide') // ->where('marketplace_aif_sellers.listing_status', 'Hide') ->select('name_of_the_aif_fund', 'fund_category', 'fund_strategy', 'type_of_fund', 'total_capital_commitment', 'uncalled_capital_commitment') ->get(); @@ -783,7 +801,7 @@ class DashboardController extends Controller ->join('marketplace_fre_sellers', 'marketplace_buyer_forms.associated_id', 'marketplace_fre_sellers.id') ->fractionalRealEstate() ->sold() - ->where('listing_status', '!=', 'Hide') + // ->where('listing_status', '!=', 'Hide') // ->where('marketplace_fre_sellers.listing_status', 'Hide') ->select('property_name', 'property_address', 'property_grade', 'asset_type', 'fractional_real_estate_platform', 'expected_selling_price') ->get(); 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/MarketPlaceController.php b/app/Http/Controllers/Frontend/MarketPlaceController.php index 8c45272..378150a 100644 --- a/app/Http/Controllers/Frontend/MarketPlaceController.php +++ b/app/Http/Controllers/Frontend/MarketPlaceController.php @@ -111,7 +111,34 @@ class MarketPlaceController extends Controller // dd($request->all()); $offering = $this->viewOfferingData($slug); // dd($offering['data']->id); - $status = MarketplaceBuyerForm::where(['associated_id'=>$offering['data']->id,'status'=>'Sold'])->exists() ? 'SOLD':'OPEN'; + // $status = MarketplaceBuyerForm::where(['associated_id'=>$offering['data']->id,'status'=>'Sold'])->exists() ? 'SOLD':'OPEN'; + $status = ''; + $checkBIDExist = MarketplaceBuyerForm::where('associated_id', $offering['data']->id)->where('status', 'Sold')->exists(); + if($checkBIDExist) + { + $buyerData = MarketplaceBuyerForm::where('associated_id', $offering['data']->id)->where('status', 'Sold')->get(); + // dd($buyerData->toArray()); + if(MarketplaceAlternativeInvestmentFundSeller::where('id',$buyerData[0]->associated_id)->exists()) + { + $totalSellUnits = 0; + $buyerData->each(function($data) use($totalSellUnits){ + return $totalSellUnits += (int)$data->no_of_units_you_wish_to_buy; + }); + $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) + { + $status .= 'SOLD'; + } + $status .= 'OPEN'; + } + elseif(MarketplaceFractionalRealEstateSeller::where('id',$buyerData[0]->associated_id)->exists()){ + $status .= 'SOLD'; + } + }else{ + $status .= 'OPEN'; + } // dd($status); $invested = $offering['invested']; 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/Http/Requests/StoreMeetingRequest.php b/app/Http/Requests/StoreMeetingRequest.php index 9839d49..58ee288 100644 --- a/app/Http/Requests/StoreMeetingRequest.php +++ b/app/Http/Requests/StoreMeetingRequest.php @@ -44,7 +44,8 @@ class StoreMeetingRequest extends FormRequest public function validated(){ return array_merge(parent::validated(), [ 'status' => $this->status ? '1' : '0', - 'created_by' => auth()->user()->id + 'created_by' => auth()->user()->id, + 'Type' => 'Meeting', ]); } } diff --git a/app/Imports/ImportMontlyUpdateAlternativeInvestmentFund.php b/app/Imports/ImportMontlyUpdateAlternativeInvestmentFund.php index b9bdaeb..b58ab51 100644 --- a/app/Imports/ImportMontlyUpdateAlternativeInvestmentFund.php +++ b/app/Imports/ImportMontlyUpdateAlternativeInvestmentFund.php @@ -46,22 +46,22 @@ class ImportMontlyUpdateAlternativeInvestmentFund implements ToCollection, With foreach ($rows as $row) { MonthlyUpdateAlternativeInvestmentFund::create([ - 'custom_id' => $row['custom_id'], - 'commitment_amount' => $row['commitment_amount'], - 'contribution_amount' => $row['contribution_amount'], - 'contribution_called_amount' => $row['contribution_called_amount'], - 'contribution_uncalled_amount' => $row['contribution_uncalled_amount'], - 'date_of_initial_contribution' => $row['date_of_initial_contribution'], - 'face_value_nav_per_unit' => $row['face_valuenav_per_unit'], - 'principal_capital_repaid' => $row['principal_capital_repaid'], - 'gross_income' => $row['gross_income'], - 'total_fees_paid' => $row['total_fees_paid_set_up_management_operating'], - 'net_income' => $row['net_income'], - 'no_of_units_alloted' => $row['no_of_units_alloted'], - 'no_of_units_redeemed' => $row['no_of_units_redeemed'], - 'current_valuation' => $row['current_valuation'], - 'current_nav' => $row['current_nav'], - 'no_of_units_held' => $row['no_of_units_held'], + 'custom_id' => $row['custom_id'] ?? null, + 'commitment_amount' => $row['commitment_amount'] ?? 0, + 'contribution_amount' => $row['contribution_amount'] ?? 0, + 'contribution_called_amount' => $row['contribution_called_amount'] ?? 0, + 'contribution_uncalled_amount' => $row['contribution_uncalled_amount'] ?? 0, + 'date_of_initial_contribution' => $row['date_of_initial_contribution'] ?? 0, + 'face_value_nav_per_unit' => $row['face_valuenav_per_unit'] ?? 0, + 'principal_capital_repaid' => $row['principal_capital_repaid'] ?? 0, + 'gross_income' => $row['gross_income'] ?? 0, + 'total_fees_paid' => $row['total_fees_paid_set_up_management_operating'] ?? 0, + 'net_income' => $row['net_income'] ?? 0, + 'no_of_units_alloted' => $row['no_of_units_alloted'] ?? 0, + 'no_of_units_redeemed' => $row['no_of_units_redeemed'] ?? 0, + 'current_valuation' => $row['current_valuation'] ?? 0, + 'current_nav' => $row['current_nav'] ?? 0, + 'no_of_units_held' => $row['no_of_units_held'] ?? 0, ]); } } diff --git a/app/Imports/ImportMontlyUpdateIndianFinancialAssets.php b/app/Imports/ImportMontlyUpdateIndianFinancialAssets.php index 352e660..d5559b6 100644 --- a/app/Imports/ImportMontlyUpdateIndianFinancialAssets.php +++ b/app/Imports/ImportMontlyUpdateIndianFinancialAssets.php @@ -50,17 +50,17 @@ class ImportMontlyUpdateIndianFinancialAssets implements ToCollection, WithHeadi foreach ($rows as $row) { MonthlyUpdateIndianFinancialAssets::create([ - 'custom_id' => $row['custom_id'], - 'investment_date' => $row['investment_date'], - 'amount_invested' => $row['amount_invested'], - 'total_gross_repaid_amount' => $row['total_gross_repaid_amount'], - 'tenure_in_days' => $row['tenure_days'], - 'principal_payment_frequency' => $row['principal_payment_frequency'], - 'interest_payment_frequency' => $row['interest_payment_frequency'], - 'next_repayment_due_date' => $row['next_repayment_due_date'], - 'maturity_date' => $row['maturity_date'], - 'next_repayment_amount' => $row['next_repayment_amount'], - 'expected_irr' => $row['expected_irr'], + 'custom_id' => $row['custom_id'] ?? null, + 'investment_date' => $row['investment_date'] ?? null, + 'amount_invested' => $row['amount_invested'] ?? null, + 'total_gross_repaid_amount' => $row['total_gross_repaid_amount'] ?? null, + 'tenure_in_days' => $row['tenure_days'] ?? null, + 'principal_payment_frequency' => $row['principal_payment_frequency'] ?? null, + 'interest_payment_frequency' => $row['interest_payment_frequency'] ?? null, + 'next_repayment_due_date' => $row['next_repayment_due_date'] ?? null, + 'maturity_date' => $row['maturity_date'] ?? null, + 'next_repayment_amount' => $row['next_repayment_amount'] ?? null, + 'expected_irr' => $row['expected_irr'] ?? null, ]); } } diff --git a/app/Models/Lead.php b/app/Models/Lead.php index b6cd5cc..f95226c 100644 --- a/app/Models/Lead.php +++ b/app/Models/Lead.php @@ -5,6 +5,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use App\Models\UserKyc; class Lead extends Model { @@ -43,6 +44,10 @@ class Lead extends Model public function calls(){ return $this->hasMany(LeadCall::class, 'leads_id'); } + + public function kyc(){ + return $this->hasMany(UserKyc::class,'users_id'); + } public function owner(){ return $this->belongsTo(User::class, 'lead_owner'); diff --git a/app/Models/MarketplaceAlternativeInvestmentFundSeller.php b/app/Models/MarketplaceAlternativeInvestmentFundSeller.php index cc811d8..84682fa 100644 --- a/app/Models/MarketplaceAlternativeInvestmentFundSeller.php +++ b/app/Models/MarketplaceAlternativeInvestmentFundSeller.php @@ -84,7 +84,30 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model public function getSoldStatusAttribute($id) { - return MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists() ? 'SOLD' : 'OPEN'; + // return MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists() ? 'SOLD' : 'OPEN'; + $checkBIDExist = MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists(); + if($checkBIDExist) + { + $buyerData = MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->get(); + // dd($buyerData->toArray()); + $totalSellUnits = 0; + $buyerData->each(function($data) use($totalSellUnits){ + return $totalSellUnits += (int)$data->no_of_units_you_wish_to_buy; + }); + if(MarketplaceAlternativeInvestmentFundSeller::where('id',$buyerData[0]->associated_id)->exists()) + { + $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) + { + return 'SOLD'; + } + return 'OPEN'; + } + }else{ + return 'OPEN'; + } } public function getDiscountAttribute($id) diff --git a/app/Models/MarketplaceFractionalRealEstateSeller.php b/app/Models/MarketplaceFractionalRealEstateSeller.php index 75a8c75..91e12bd 100644 --- a/app/Models/MarketplaceFractionalRealEstateSeller.php +++ b/app/Models/MarketplaceFractionalRealEstateSeller.php @@ -62,5 +62,23 @@ class MarketplaceFractionalRealEstateSeller extends Model public function getSoldStatusAttribute($id) { return MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists() ? 'SOLD' : 'OPEN'; + // $buyerData = MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->get(); + // $totalSellUnits = 0; + // $buyerData->each(function($data) use($totalSellUnits){ + // return $totalSellUnits += (int)$data->no_of_units_you_wish_to_buy; + // }); + // if(MarketplaceFractionalRealEstateSeller::where('id',$buyerData->associated_id)->exists()) + // { + // $getAIFData = MarketplaceFractionalRealEstateSeller::where('id',$buyerData->associated_id)->first(); + // $aifData = (int)$getAIFData->no_of_units_you_wish_to_sell; + // $remainUnits = $aifData - $totalSellUnits; + // if($remainUnits < 0) + // { + // return 'SOLD'; + // } + // return 'OPEN'; + // }else{ + // return 'OPEN'; + // } } } \ No newline at end of file diff --git a/app/Models/MarketplaceSellerForm.php b/app/Models/MarketplaceSellerForm.php index 7c70f6e..c6c818c 100644 --- a/app/Models/MarketplaceSellerForm.php +++ b/app/Models/MarketplaceSellerForm.php @@ -16,7 +16,8 @@ class MarketplaceSellerForm extends Model } public function aif(){ - return $this->hasMany(MarketplaceAlternativeInvestmentFundSeller::class,'seller_forms_id')->where('listing_status', '!=','Hide'); + // return $this->hasMany(MarketplaceAlternativeInvestmentFundSeller::class,'seller_forms_id')->where('listing_status', '!=','Hide'); + return $this->hasMany(MarketplaceAlternativeInvestmentFundSeller::class,'seller_forms_id'); } public function fre(){ diff --git a/app/Services/Admin/LeadService.php b/app/Services/Admin/LeadService.php index be92b12..96366fc 100644 --- a/app/Services/Admin/LeadService.php +++ b/app/Services/Admin/LeadService.php @@ -12,7 +12,7 @@ use Illuminate\Support\Facades\DB; class LeadService{ public function getAllLeads(){ - return Lead::with('user', 'product.category')->latest()->get(); + return Lead::with('kyc','user', 'product.category')->latest()->get(); } public function totalLead(){ @@ -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) @@ -132,13 +132,13 @@ class LeadService{ } public function convertActivity($request){ - $validator = Validator::make($request->post(), [ - 'task_id' => 'required', - 'table' => 'required' - ], [ - 'required' => 'The :attribute field must be required' - ]); - + // $validator = Validator::make($request->post(), [ + // 'task_id' => 'required', + // 'table' => 'required' + // ], [ + // 'required' => 'The :attribute field must be required' + // ]); + // dd($request); if ($request->table != 'LeadCall') { $convertClosed = LeadTasksMeeting::where('id', $request->task_id)->update([ 'status' => '1', @@ -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..545afae 100644 --- a/app/helper.php +++ b/app/helper.php @@ -36,8 +36,14 @@ if (!function_exists('validationErrorMessage')) { } } +function getUnreadMessage() +{ + return Chat::where(['user_id'=>auth()->guard('users')->user()->id,'is_read'=>false])->count(); +} + function imagePath($path = null) { + $finalPath = "https://staging.jerichoalternatives.in/"; if (env('APP_ENV') == 'production') { $finalPath = "https://jerichoalternatives.in/"; } @@ -45,11 +51,24 @@ function imagePath($path = null) $finalPath = "https://staging.jerichoalternatives.in/"; } if (env('APP_ENV') == 'local') { - $finalPath = "http://localhost/jericho_28_march/"; + $finalPath = "http://localhost/freeu/my-freeu/"; } return $finalPath . $path; } +function getUserActivateStatus() +{ + // return \Auth::user()->id; + if(auth()->guard("users")->user() && auth()->guard("users")->user()->id) + { + return User::where(["id"=>auth()->guard("users")->user()->id,"status"=>true])->exists(); + } + else{ + return false; + } + // return auth()->guard("users")->user()->id; +} + function routeForHandpickedInvestment($categoryId) { // return $categoryId; diff --git a/public/assets/css/FrontendCss/style.css b/public/assets/css/FrontendCss/style.css index d500cee..600b4b1 100644 --- a/public/assets/css/FrontendCss/style.css +++ b/public/assets/css/FrontendCss/style.css @@ -971,7 +971,20 @@ input:focus { border-radius: 5px; font-size: 14px; } - +.admin-profile .dropdown.red_dot { + position: relative; +} +.admin-profile .dropdown.red_dot:before { + position: absolute; + content: ""; + top: 4px; + right: 32px; + background-color: red; + width: 10px; + height: 10px; + z-index: 9; + border-radius: 50px; +} .banner-btn a { padding: 9px 25px; background-color: #ffbd59; @@ -1736,6 +1749,35 @@ p.brown-text { width: 100%; font-weight: 500; } +.admin-profile .dropdown.red_dot { + position: relative; +} +.admin-profile .dropdown.red_dot:before { + position: absolute; + content: ""; + top: 4px; + right: 32px; + background-color: red; + width: 10px; + height: 10px; + z-index: 9; + border-radius: 50px; +} + +.admin-profile a.dropdown-item.red_dot { + position: relative; +} + +.admin-profile a.dropdown-item.red_dot:before { + content: ""; + position: absolute; + right: 23px; + top: 17px; + width: 7px; + height: 7px; + background-color: red; + border-radius: 50px; +} .portfolio .investor-image { width: 46%; @@ -4496,64 +4538,64 @@ span.start { /* */ +/* */ - .chksb p { - font-style: normal; - font-size: 18px; - color: #1B243D; - margin: 0; - font-weight: 600; - } +.chksb p { + font-style: normal; + font-size: 18px; + color: #1b243d; + margin: 0; + font-weight: 600; +} /*======responsive=====*/ @@ -4991,7 +5033,6 @@ span.start { } } @media (max-width: 767px) { - .investor-profile .profile-img img { width: 70px; } @@ -5569,17 +5610,15 @@ span.start { @media (max-width: 420px) { } @media (max-width: 380px) { - .chksb p { font-style: normal; font-size: 14px; - color: #1B243D; + color: #1b243d; margin: 0; font-weight: 600; -} + } } @media (max-width: 360px) { } @media (max-width: 320px) { - } 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_chat/manage_chat.blade.php b/resources/views/Admin/Pages/manage_chat/manage_chat.blade.php index 54e595a..bf53809 100644 --- a/resources/views/Admin/Pages/manage_chat/manage_chat.blade.php +++ b/resources/views/Admin/Pages/manage_chat/manage_chat.blade.php @@ -1,37 +1,49 @@ @extends('Admin.layouts.master') @section('style') - + @endsection -@section('title','Manage Chats') +@section('title', 'Manage Chats') @section('content') -
-
-
-
-
-
-
-
- - - - - - - -
-
-
-
- {{--@foreach($users as $user) +
+
+
+
+
+
+
+
+ + + + + + + +
+
+
+
+ {{-- @foreach ($users as $user)
- @if($user->profile_image) + @if ($user->profile_image) getAttributes()['profile_image']; ?> @@ -39,7 +51,7 @@ @php($img ='https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png') @endif Pic - @if($user->total_count) + @if ($user->total_count) {{$user->total_count}} @endif
@@ -49,193 +61,196 @@
- @endforeach--}} + @endforeach --}} +
+
+
+
+
+
+
+
+ +
+
+
+
-
-
-
-
- -
-
-
-
-
-
-
-
@endsection @section('scripts') - -@endsection \ No newline at end of file + // sending message on click on enter + $('#message').keyup(function(event) { + if (event.keyCode === 13) { + sendMsg(); + } + }); + + + function sendMsg() { + + let msg = $('#message').val(); + + let user_id = $('#user_id').val(); + // alert(user_id); + + $.ajaxSetup({ + + headers: { + + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') + + } + + }); + + $.ajax({ + + cache: false, + + url: "{{ route('send-admin-msg') }}", + + type: "POST", + + data: { + + message: msg, + + user_id: user_id + + }, + + dataType: "json", + + success: function(result) { + + if (result.status == 200) { + + getUser($('#user_id').val()); + + $('#message').val('') + + } + + if (result.status == 400) { + + toastr.warning(result.message); + + } + + }, + + }); + + } + + function getUser(id) { + $('.spanName').each(function() { + $(this).removeClass('active'); + }) + $(`#user_${id}`).addClass('active'); + $('#user_id').val(id); + + + $.ajax({ + + url: "{{ route('get-user-for-chat') }}", + + type: "GET", + + data: { + + id: id, + + }, + + success: function(result) { + + $('.show-user').html(''); + + $('.chat-msgs').html(''); + + $('.show-user').append(result.user); + + $('.chat-msgs').append(result.chat); + + $('#kt_drawer_chat_messenger_footer').removeClass('d-none'); + + if (result.status == 400) { + + toastr.warning(result.message); + + } + + }, + + }); + + } + + function userList() { + let search = $('#search').val(); + if (search) { + return; + } + $.ajax({ + url: "{{ route('get-user-list') }}", + type: "GET", + // dataType : 'json', + success: function(result) { + if (result) { + $('.user_Detail').html('').append(result); + } + }, + }); + } + + +@endsection 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 diff --git a/resources/views/Admin/Pages/manage_investors/manage-partner-platform.blade.php b/resources/views/Admin/Pages/manage_investors/manage-partner-platform.blade.php index 4c0a7f7..f028639 100644 --- a/resources/views/Admin/Pages/manage_investors/manage-partner-platform.blade.php +++ b/resources/views/Admin/Pages/manage_investors/manage-partner-platform.blade.php @@ -24,10 +24,10 @@
- + @foreach( $users as $userdata) - @endforeach
@@ -37,7 +37,8 @@
- + @foreach($company as $companydata) @endforeach @@ -171,8 +172,8 @@ }, messages: { - user_name: "Please enter your name", - partner_name: "Please enter your designation/company name", + user_name: "Please select user", + partner_name: "Please select partner", login: "This field is required", password: "This field is required", 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 c0afd30..827b5fe 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 @@ -237,7 +237,15 @@ @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/add_lead.blade.php b/resources/views/Admin/Pages/manage_leads/add_lead.blade.php index 7b197e9..c2ed495 100644 --- a/resources/views/Admin/Pages/manage_leads/add_lead.blade.php +++ b/resources/views/Admin/Pages/manage_leads/add_lead.blade.php @@ -66,44 +66,22 @@
- - + + +
- {{--
- - -
--}}
- - - + +
-
- - -
-
- - -
-
- - -
-
+
+ + +
+ {{--
+ + +
--}} + + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
@@ -124,10 +134,7 @@
-
- - -
+
@@ -238,13 +245,22 @@ $(this).valid(); } }); + + $.validator.addMethod("customEmail", function(value, element) { + // Regular expression for email validation + return /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,}$/.test(value); + }, "Please enter a valid email address"); $("#add-lead-form").validate({ ignore: [], debug: false, rules: { lead_owner: 'required', users_id : 'required', - products_id : 'required' + products_id : 'required', + // email: { + // required: true, + // customEmail: true, + // }, }, messages: { lead_owner: { @@ -256,6 +272,10 @@ products_id: { required: "Please select product", }, + // email: { + // required: "Please enter email", + // email: 'Please enter a valid email address', + // }, }, submitHandler: function(form) { var formData = new FormData(form); 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 fbda28a..7d77412 100644 --- a/resources/views/Admin/Pages/manage_leads/edit-lead.blade.php +++ b/resources/views/Admin/Pages/manage_leads/edit-lead.blade.php @@ -721,11 +721,128 @@ select#cars {
-
+
- + + + +
+ +
+ + + + + + +
+ +
+ + + + +
+ +
+ + + + + +
+ +
+ + + + {{-- --}} + + + +
+
+ + + + + +
+
+ + + + + +
@@ -837,43 +954,35 @@ select#cars { - - - - - - -
- @csrf - -
- -
- -
- - -
-
-
-

Attachments

-
- -
-

Upload - File

-

Link(URL) -

+
+
+
    + @forelse($lead->attachment as $data) + @if ($data->type == 'Image') +
  • + @php($path = ['path' => $data->path]) + {{-- @dd($path) --}} + {{-- + Download + Filesss --}} + Download + Filesss +
    By {{ $data->admin->name }} At + {{ $data->created_at->format('H:i:s d/m/y') }} +
  • + @else +
  • {{ $data->path }} +
    By {{ $data->admin->name }} At + {{ $data->created_at->format('H:i:s d/m/y') }} +
  • + @endif + @empty +
    No Attachment
    + @endforelse +
+
@@ -1736,9 +1845,9 @@ select#cars { + --> @@ -1806,7 +1915,7 @@ select#cars { - +
@@ -2994,487 +3103,845 @@ select#cars { @endsection @section('scripts') - - + @endsection diff --git a/resources/views/Admin/Pages/pre_owned_investment/transactions.blade.php b/resources/views/Admin/Pages/pre_owned_investment/transactions.blade.php index cb8d2b2..d2b652e 100644 --- a/resources/views/Admin/Pages/pre_owned_investment/transactions.blade.php +++ b/resources/views/Admin/Pages/pre_owned_investment/transactions.blade.php @@ -248,7 +248,7 @@
- +
diff --git a/resources/views/Admin/add-sub-admin.blade.php b/resources/views/Admin/add-sub-admin.blade.php index e1a463e..e524267 100644 --- a/resources/views/Admin/add-sub-admin.blade.php +++ b/resources/views/Admin/add-sub-admin.blade.php @@ -52,7 +52,7 @@ + placeholder="Please enter name" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)"/>
@@ -70,9 +70,9 @@ - + placeholder="Please enter mobile number" oninput="this.value = this.value.replace(/[^0-9]/g, '').replace(/(\..*)\./g, '$1');"/>
diff --git a/resources/views/Admin/personal-dashboard.blade.php b/resources/views/Admin/personal-dashboard.blade.php index 91c8895..7ab4fa1 100644 --- a/resources/views/Admin/personal-dashboard.blade.php +++ b/resources/views/Admin/personal-dashboard.blade.php @@ -701,23 +701,49 @@ $(this).data('status') ? $('#meeting-status').attr('checked', true) : $('#meeting-status').attr('checked', false); $('#manage_commission_edit_2').modal('show'); }) + + // for Subject + $.validator.addMethod("charactersOnly", function(value, element) { + return /^[a-zA-Z]+$/.test(value); + }, "Please enter only alphabetical characters"); + + // for reminder + $.validator.addMethod("numbersOnly", function(value, element) { + return /^[0-9]+$/.test(value); + }, "Please enter only numbers"); + + // for due_date + $.validator.addMethod("validDateFormat", function(value, element) { + // Regular expression to match the date format "YYYY-MM-DD HH:MM:SS" + return /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(value); + }, "Please enter a valid date format (YYYY-MM-DD HH:MM:SS)"); + $("#edit-task").validate({ ignore: [], debug: false, rules: { - subject: 'required', - due_date: 'required', + subject: { + required: true, + charactersOnly: true // Using the custom validation rule for individual characters + }, + due_date: { + required: true, + validDateFormat: true // Using the custom validation rule for date format + }, priority: 'required', owner: 'required', - reminder: 'required' + reminder: { + required: true, + numbersOnly: true // Using the custom validation rule for numbers only + } }, messages: { - subject: "Please enter subject", - due_date: "Please choose due date", + subject: "Please enter subject with only alphabetical characters", + due_date: "Please enter a valid date format (YYYY-MM-DD HH:MM:SS)", priority: 'Please select a priority', owner: 'Please select a owner', - reminder: "Please write a reminder" + reminder: "Please enter only numbers for the reminder" }, submitHandler: function(form) { var formData = new FormData(form); @@ -753,22 +779,31 @@ ignore: [], debug: false, rules: { - location: 'required', + location: { + required: true, + charactersOnly: true // Using the custom validation rule for individual characters + }, from: 'required', to: 'required', host: 'required', priority: 'required', - participants: 'required', - related_to: 'required' + participants: { + required: true, + charactersOnly: true // Using the custom validation rule for individual characters + }, + related_to: { + required: true, + charactersOnly: true // Using the custom validation rule for individual characters + } }, messages: { - location: "Please enter location", + location: "Please enter location with only alphabetical characters", from: "Please choose from date", to: 'Please select a to date', host: 'Please select a host', priority: "Please enter priority", - participants: "Please enter participants", - related_to: "Please enter related to" + participants: "Please enter participants with only alphabetical characters", + related_to: "Please enter related to with only alphabetical characters" }, submitHandler: function(form) { var formData = new FormData(form); diff --git a/resources/views/Admin/sidebar.blade.php b/resources/views/Admin/sidebar.blade.php index c00e2c3..18314c8 100644 --- a/resources/views/Admin/sidebar.blade.php +++ b/resources/views/Admin/sidebar.blade.php @@ -534,7 +534,7 @@
@endif - @if (Auth::user()->checkRoleWithPermission('user-list', 'view')) + {{-- @if (Auth::user()->checkRoleWithPermission('user-list', 'view')) - @endif + @endif --}} @if (Auth::user()->checkRoleWithPermission('update-user-password', 'view'))