Merge pull request #204 from Ritikeshyadav/RitikeshFreeu

Ritikesh freeu
This commit is contained in:
Ritikeshyadav
2024-05-24 19:33:50 +05:30
committed by GitHub
10 changed files with 75 additions and 21 deletions

View File

@@ -24,6 +24,7 @@ class ManageSellerProfileController extends Controller
->withCount(['aif', 'fre', 'op'])
->latest()
->get();
// dd($sellerProfile->toArray());
return view('Admin.Pages.pre_owned_investment.manage_seller_profile', compact('sellerProfile'));
}

View File

@@ -11,6 +11,7 @@ use App\Models\Iam_App_Resource_Action_Link;
use App\Models\Iam_App_Resources;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Hash;
use Carbon\Carbon;
class ManageSubAdminController extends Controller
{
@@ -58,7 +59,7 @@ class ManageSubAdminController extends Controller
if (!$check) {
abort(404);
}
$subAdmin = User::where(['role' => 2, 'status' => 1])->whereNotIn('id', [auth()->user()->id])->orderBy('last_login','desc')->get();
$subAdmin = User::where(['role' => 2])->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]);
@@ -109,6 +110,8 @@ class ManageSubAdminController extends Controller
'contact_number' => $request->mobile_number,
'password' => Hash::make($request->password),
'role' => $roleType,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
]);
// $addUser = null;
if ($addUser == null) {

View File

@@ -19,8 +19,8 @@ class MarketPlaceController extends Controller
{
$spotlightMarketPlaceListed = $this->spotlightInvestment()['data'];
$featuredMarketplaceListed = $this->featuredInvestments();
// dd($featuredMarketplaceListed);
$nonFeaturedMarketplaceListed = $this->nonFeaturedInvestments();
// dd($nonFeaturedMarketplaceListed);
return view('Frontend.Pages.marketplace.index', compact('spotlightMarketPlaceListed', 'featuredMarketplaceListed', 'nonFeaturedMarketplaceListed'));
}

View File

@@ -24,7 +24,7 @@ class AlternativeInvestmentFund extends Model
public function getTargetIrrAttribute($value)
{
// dd($value);
// dd($);
return $value == null ? '--' : $value.' %';
}

View File

@@ -91,7 +91,7 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model
{
// return MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists() ? 'SOLD' : 'OPEN';
$id = $this->id;
$checkBIDExist = MarketplaceBuyerForm::where('associated_id', $id)->exists();
$checkBIDExist = MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists();
if($checkBIDExist)
{
$buyerData = MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->get();
@@ -105,7 +105,8 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model
$getAIFData = MarketplaceAlternativeInvestmentFundSeller::where('id',$buyerData[0]->associated_id)->first();
$aifData = (int)$getAIFData->no_of_units_you_wish_to_sell;
$remainUnits = $aifData - $totalSellUnits;
if($remainUnits == 0 || $remainUnits < 0)
// if($remainUnits == 0 || $remainUnits < 0)
if($remainUnits <= 0)
{
return 'SOLD';
}else{

View File

@@ -32,13 +32,13 @@ class CompanyService
->editColumn('company_name', function ($row) {
return '<div>' . $row->company_name . '</div>';
})
->editColumn('categories', function ($row) {
$s = '';
foreach ($row->category as $cat) {
$s .= trim($cat->category->pluck('category_name'), '[]"') . ',';
}
return '<div>' . $s . '</div>';
})
// ->editColumn('categories', function ($row) {
// $s = '';
// foreach ($row->category as $cat) {
// $s .= trim($cat->category->pluck('category_name'), '[]"') . ',';
// }
// return '<div>' . $s . '</div>';
// })
->addColumn('action', function ($row) {
$status = $row->status == 1 ? 'checked' : 'null';

View File

@@ -282,7 +282,7 @@
table.search($(this).val()).draw();
});
});
function status(id, status, count = null) {
function status(id, status, count = null) {
let text;
status == 1 ? text = 'de-activate' : text = 'activate';
Swal.fire({

View File

@@ -243,7 +243,7 @@
<th class="min-w-75px w-150px align-top text-left">Date Added</th>
<th class="min-w-125px w-225px align-top">Company Logo</th>
<th class="min-w-50px w-225px align-top">Company Name</th>
<th class="min-w-50px w-150px align-top">Categories</th>
{{-- <th class="min-w-50px w-150px align-top">Categories</th> --}}
<th class="text-center w-200px min-w-100px align-top text-center">Actions</th>
</tr>
<!--end::Table row-->
@@ -489,12 +489,12 @@
data: 'company_name',
name: 'company_name'
},
{
data: 'categories',
name: 'categories',
orderable: false,
searchable: false
},
// {
// data: 'categories',
// name: 'categories',
// orderable: false,
// searchable: false
// },
{
data: 'action',
name: 'action',

View File

@@ -173,6 +173,12 @@
<i class="fa-solid fs-3 fa-pen-to-square"></i>
</a>
<a class="action_icon">
<div class="on-off-toggle">
<input class="on-off-toggle__input is_active" type="checkbox" id="bopis{{$user->id}}" data-id="{{$user->id}}" onclick="status({{$user->id}},{{$user->status}},{{$loop->iteration}})" {{$user->status == 1 ? 'checked':''}}/>
<label for="bopis{{$user->id}}" class="on-off-toggle__slider status{{$loop->iteration}}"></label>
</div>
</a>
{{-- <a id="delete_faq_id" class="action_icon delete"
data-id="{{ $user->id }}"
onclick="deleteFaq({{ $user->id }})">
@@ -936,4 +942,47 @@
});
});
</script>
<script>
function status(id, status, count = null) {
let text;
status == 1 ? text = 'de-activate' : text = 'activate';
Swal.fire({
title: `Do you want to ${text} ?`,
showDenyButton: false,
showCancelButton: true,
confirmButtonText: text.charAt(0).toUpperCase() + text.slice(1),
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: "{{route('status')}}",
type: "POST",
data: {
'id': id,
'status': status
},
headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
},
dataType: "json",
success: function(result) {
if (result.status == 200) {
toastr.success(result.message);
setTimeout(function(){
window.location.reload();
},3000);
}
if (result.status == 400) {
toastr.warning(result.message);
}
},
});
} else {
status == 1 ? attr = true : attr = false;
// alert(status);
$(`.status${count}`).prop("checked", attr);
}
})
}
</script>
@endsection

View File

@@ -80,7 +80,7 @@
<div class="col-md-5 crds-ctns">
<div class="crds-inner">
<h2>Email</h2>
<h3>info@jerichoalternatives.com</h3>
<h3>info@jericoalternatives.com</h3>
</div>
<div class="crds-inner">
<h2>Contact No</h2>