first commit

This commit is contained in:
cj201199
2024-05-14 12:01:46 +05:30
parent 42ee49b463
commit 4fbc4a8f4f
7 changed files with 69 additions and 16 deletions

View File

@@ -135,6 +135,18 @@ class ManageUserProductController extends Controller
return view('Admin.Pages.manage_investors.manage_user_product.manage_user_add', compact('users', 'aifProductNames', 'freProductNames', 'companies'));
}
public function userProduct(Request $request){
$data = Product::with('alternativeInvestmentFund.companies','categorys')->where('id',$request->id)->first();
// dd($data);
if($data->alternativeInvestmentFund != null){
return response()->json(['status'=>200,'category'=>'aif','data'=>$data]);
}
$data = Product::with('fractional_real_estate','categorys')->where('id',$request->id)->first();
if($data->fractional_real_estate != null){
return response()->json(['status'=>200,'category'=>'fre','data'=>$data]);
}
}
function getAllProductNames($categoriesId)
{
return Product::

View File

@@ -248,12 +248,13 @@ class MarketPlaceController extends Controller
$id = $offering['data']->id;
$userData = array();
$user = ModelsUser::find(auth()->guard('users')->user()->id);
$dataOfBuyerForm = MarketplaceBuyerForm::first();
$userData = (object)[
'name' => $user->name ?? null,
'contact_number' => $user->contact_number ?? null,
'email' => $user->email ?? $user->email,
];
return view('Frontend.Pages.profile.market-list.buyer-form', compact('table', 'id', 'userData'));
return view('Frontend.Pages.profile.market-list.buyer-form', compact('table', 'id', 'userData','dataOfBuyerForm'));
}
//editBuyerForm start by hritik on 5-4-2024

View File

@@ -110,6 +110,14 @@ class Product extends Model
return $this->hasOne(Category::class, 'id', 'categories_id');
}
// public function aif(){
// return $this->hasOne(AlternativeInvestmentFund::class,'id', 'products_id');
// }
public function companies(){
return $this->belongsTo(Company::class,'companies_id',);
}
public function scopeFractionalRealEstate($query)
{
return $query->where('tables_id', 1);

View File

@@ -69,14 +69,14 @@
<span>Investor Name</span>
</label>
<!--begin::Input-->
<input type="text" class="form-control form-control-solid" name="investor_name" />
<input type="text" class="form-control form-control-solid" readonly id="investor_name" name="investor_name" />
</div>
<div class="form-box mb-5">
<label class="fs-6 fw-semibold form-label mt-3">
<span>Select a Product</span>
</label>
<select name="product_id" id="selectProduct1" class="form-select form-select-solid selectProduct" data-form="1" style="height: 100%">
<select name="product_id" id="selectProduct1" class="form-select form-select-solid selectProduct choose_product" data-form="1" style="height: 100%">
<option value="">Select a Product</option>
@foreach($aifProductNames as $data)
<option value="{{$data->id}}">{{$data->product_name}}</option>
@@ -89,7 +89,7 @@
<span>Product/Fund Name</span>
</label>
<!--begin::Input-->
<input type="text" class="form-control form-control-solid product_name_1" name="product_name" readonly />
<input type="text" class="form-control form-control-solid product_name_1" readonly id="product_name" name="product_name" readonly />
</div>
<div class="form-box mb-5">
<label class="fs-6 fw-semibold form-label mt-3">
@@ -103,7 +103,7 @@
<span>Product Category</span>
</label>
<!--begin::Input-->
<input type="text" class="form-control form-control-solid" name="product_category" />
<input type="text" class="form-control form-control-solid" readonly id="product_category" name="product_category" />
</div>
<div class="form-box mb-5">
<label class="fs-6 fw-semibold form-label mt-3">
@@ -184,7 +184,7 @@
<span>Fund Category</span>
</label>
<!--begin::Input-->
<input type="text" class="form-control form-control-solid" name="fund_category" />
<input type="text" class="form-control form-control-solid" readonly id="fund_category" name="fund_category" />
</div>
<div class="form-box mb-5">
<label class="fs-6 fw-semibold form-label mt-3">
@@ -700,14 +700,14 @@
<span>Investor Name</span>
</label>
<!--begin::Input-->
<input type="text" class="form-control form-control-solid" name="investor_name" />
<input type="text" class="form-control form-control-solid" readonly id="invester_name2" name="investor_name" />
</div>
<div class="form-box mb-5">
<label class="fs-6 fw-semibold form-label mt-3">
<span>Product Category</span>
</label>
<!--begin::Input-->
<input type="text" class="form-control form-control-solid" name="product_category" />
<input type="text" class="form-control form-control-solid" readonly id="product_category2" name="product_category" />
</div>
<div class="form-box mb-5">
<label class="fs-6 fw-semibold form-label mt-3">
@@ -715,7 +715,7 @@
</label>
<!--begin::Input-->
<!-- <input type="text" class="form-control form-control-solid" name="product_name" /> -->
<select name="product_id" id="selectProduct5" class="form-select form-select-solid selectProduct" data-form="5" style="height: 100%">
<select name="product_id" id="selectProduct5" class="form-select form-select-solid selectProduct choose_product" data-form="5" style="height: 100%">
<option value="">Select a Product</option>
@foreach($freProductNames as $data)
<option value="{{$data->id}}">{{$data->product_name}}</option>
@@ -727,7 +727,7 @@
<span>Product Name</span>
</label>
<!--begin::Input-->
<input type="text" class="form-control form-control-solid product_name_5" name="product_name" />
<input type="text" readonly class="form-control form-control-solid product_name_5" id="product_name2" name="product_name" />
</div>
<div class="form-box mb-5">
<label class="fs-6 fw-semibold form-label mt-3">
@@ -1099,6 +1099,37 @@
@endsection
@section('scripts')
<script>
$('.choose_product').change(function(){
id = $(this).val();
$.ajax({
url:"{{route('userProduct',"+id")}}",
type:'get',
data: {
'id':id,
},
success:function(result)
{
// console.log(result);
if(result.status == 200 && result.category == 'aif')
{
$('#product_name').val(result.data['alternative_investment_fund']['fund_name']);
$('#fund_category').val(result.data['alternative_investment_fund']['fund_category']);
$('#product_category').val(result.data['categorys']['category_name']);
}
if(result.status == 200 && result.category == 'fre')
{
$('#product_name2').val(result.data['fractional_real_estate']['property_name_and_location']);
$('#product_category2').val(result.data['categorys']['category_name']);
}
}
})
})
$('#user-select').on('change', function() {
$('#investor_name').val($(this).find('option:selected').text());
$('#invester_name2').val($(this).find('option:selected').text());
});
// $('#pan').on
function convertToUpperCase(id)
{

View File

@@ -20,11 +20,11 @@
<div class="container row">
<div class="content" data-aos="fade-right">
<h1 class="invest-header si-hd text-center">Buy your Investment's today!</h1>
<ul class="si-hd_p p-0 d-flex justify-content-between">
{{-- <ul class="si-hd_p p-0 d-flex justify-content-between">
<li>Verified Buyers</li>
<li>Expert Verification</li>
<li>Sell From Your Home</li>
</ul>
</ul> --}}
</div>
<div class="col-md-6 bgn-image" data-aos="fade-left">
{{-- <img src="/public/assets/media/FrontendImages/r-invest.png"> --}}
@@ -101,11 +101,11 @@
</div>
<div class="form-group col-md-6">
<label>City</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="city">
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="city" value="{{$dataOfBuyerForm->city}}">
</div>
<div class="form-group col-md-6">
<label>Country</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="country">
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="country" value="{{$dataOfBuyerForm->country}}">
</div>
<div class="form-group col-md-6">
<label>Contact Number</label>

View File

@@ -5,11 +5,11 @@
<div class="container row">
<div class="content" data-aos="fade-right">
<h1 class="invest-header si-hd text-center">Sell your investment's today!</h1>
<ul class="si-hd_p p-0 d-flex justify-content-between">
{{-- <ul class="si-hd_p p-0 d-flex justify-content-between">
<li>Verified Buyers</li>
<li>Expert Verification</li>
<li>Sell From Your Home</li>
</ul>
</ul> --}}
</div>
<div class="col-md-6 bgn-image" data-aos="fade-left">
{{-- <img src="/public/assets/media/FrontendImages/r-invest.png"> --}}

View File

@@ -601,6 +601,7 @@ Route::middleware([BackendAccess::class])->group(function () {
Route::controller(ManageUserProductController::class)->group(function () {
Route::get("manage-user-product", 'index')->name('manage-user-product');
Route::get("store-user-product", 'storeUserProduct')->name('store-user-product');
Route::get('userProduct/{id}', 'userProduct')->name('userProduct');
Route::get("import-monthly-updates", 'importMonthlyUpdateBlade')->name('import-monthly-updates');
Route::get("monthly-updates/{id}", 'monthlyUpdates')->name('monthly-updates');
Route::post("store-monthly-updates-for-ifa", 'storeMonthlyUpdatesForIFA')->name('store-monthly-updates-for-ifa');