/* Decoded by unphp.net */ ?>b'get(); $heads = Head::all(); return view(\'web.default.pages.apply\',compact(\'data\',\'webinar\',\'heads\')); } public function query() { $webinar=Webinar::where(\'status\', \'active\')->get(); return view(\'web.default.pages.query\',compact(\'webinar\')); } public function query_store(request $request){ $validatedData = $request->validate([ \'fname\' => \'required\', \'email\' => \'required\', \'number\' => \'required\', \'country\' => \'required\', \'program\' => \'required\', ]); $query = new Query(); $query->fname = $request->fname; $query->email = $request->email; $query->number = $request->number; $query->country = $request->country; $query->program = $request->program; $query->save(); return redirect(\'query-applied\'); } public function scholarship_applied(request $request){ return view(\'web.default.pages.thanks\'); } public function query_applied(){ return view(\'web.default.pages.ThanksForm\'); } public function new_apply() { $webinar=Webinar::where(\'status\', \'active\')->get(); $heads = Head::all(); return view(\'web.default.pages.new_apply\',compact(\'webinar\',\'heads\')); } public function storeform(request $request){ $item_id = $request->program; $user = auth()->user(); $validatedData = $request->validate([ \'dob\' => \'required|date\', \'nationality\' => \'required|string\', \'education\' => \'required|string\', \'institute\' => \'required|string\', \'graduation_year\' => \'required|numeric\', \'program\' => \'required|string\', \'declaration\' => \'required|boolean\', ]); $courseApplication = new CourseApplication(); $courseApplication->course_id = auth()->user()->course_id ?? null; $courseApplication->email = auth()->user()->email; $courseApplication->name = auth()->user()->full_name; $courseApplication->phone_no = auth()->user()->mobile; $courseApplication->dob = $request->dob; $courseApplication->nationality = $request->nationality; $courseApplication->postal_address = $request->postal_address; $courseApplication->education = $request->education; $courseApplication->institute = $request->institute; $courseApplication->graduation_year = $request->graduation_year; $courseApplication->exprience = $request->exprience; $courseApplication->current_employment = $request->current_employment; $courseApplication->existing_job_title = $request->existing_job_title; $courseApplication->program = $request->program; $courseApplication->payment = $request->payment; $courseApplication->declaration = $request->declaration; $courseApplication->user_id = Auth::user()->id; if ($request->hasfile(\'certificate\')) { $destination = \'assets/admin/img/\' . $courseApplication->certificate; if (File::exists($destination)) { File::delete($destination); } $file = $request->file(\'certificate\'); $extension = $file->getClientOriginalExtension(); $filename = time() . \'.\' . $extension; $file->move(\'assets/admin/img/\', $filename); $courseApplication->certificate = $filename; } if ($request->hasfile(\'resume\')) { $destination = \'assets/admin/img/\' . $courseApplication->resume; if (File::exists($destination)) { File::delete($destination); } $file = $request->file(\'resume\'); $extension = $file->getClientOriginalExtension(); $filename = time() . \'.\' . $extension; $file->move(\'admin/img/\', $filename); $courseApplication->resume = $filename; } $item_name=\'webinar_id\'; $data = [ \'item_name\' => $item_name, \'item_id\' => $item_id ]; if ($item_name == \'webinar_id\') { $result = $this->storeUserWebinarCart($user, $data); } if ($result != \'ok\') { return $result; } $courseApplication->save(); return redirect(\'/cart\'); } public function storeUserWebinarCart($user, $data) { $admissionFee =Fee::first(); session([\'admission_fee\' => $admissionFee]); $webinar_id = $data[\'item_id\']; $ticket_id = $data[\'ticket_id\'] ?? null; $webinar = Webinar::where(\'id\', $webinar_id) ->where(\'private\', false) ->where(\'status\', \'active\') ->first(); if (!empty($webinar) and !empty($user)) { $checkCourseForSale = checkCourseForSale($webinar, $user); if ($checkCourseForSale != \'ok\') { return $checkCourseForSale; } $activeSpecialOffer = $webinar->activeSpecialOffer(); Cart::updateOrCreate([ \'creator_id\' => $user->id, \'webinar_id\' => $webinar_id, ], [ \'ticket_id\' => $ticket_id, \'special_offer_id\' => !empty($activeSpecialOffer) ? $activeSpecialOffer->id : null, \'created_at\' => time() ]); return \'ok\'; } $toastData = [ \'title\' => trans(\'public.request_failed\'), \'msg\' => trans(\'cart.course_not_found\'), \'status\' => \'error\' ]; return back()->with([\'toast\' => $toastData]); } private function showGiftModal($user) { $gift = Gift::query()->where(\'email\', $user->email) ->where(\'status\', \'active\') ->where(\'viewed\', false) ->where(function ($query) { $query->whereNull(\'date\'); $query->orWhere(\'date\', \'<\', time()); }) ->whereHas(\'sale\') ->first(); if (!empty($gift)) { $gift->update([ \'viewed\' => true ]); $data = [ \'gift\' => $gift ]; $result = (string)view()->make(\'web.default.panel.dashboard.gift_modal\', $data); $result = str_replace(array("\r\n", "\n", " "), \'\', $result); return $result; } return null; } private function getMonthlySalesOrPurchase($user) { $months = []; $data = []; // all 12 months for ($month = 1; $month <= 12; $month++) { $date = Carbon::create(date(\'Y\'), $month); $start_date = $date->timestamp; $end_date = $date->copy()->endOfMonth()->timestamp; $months[] = trans(\'panel.month_\' . $month); if (!$user->isUser()) { $monthlySales = Sale::where(\'seller_id\', $user->id) ->whereNull(\'refund_at\') ->whereBetween(\'created_at\', [$start_date, $end_date]) ->sum(\'total_amount\'); $data[] = round($monthlySales, 2); } else { $monthlyPurchase = Sale::where(\'buyer_id\', $user->id) ->whereNull(\'refund_at\') ->whereBetween(\'created_at\', [$start_date, $end_date]) ->count(); $data[] = $monthlyPurchase; } } return [ \'months\' => $months, \'data\' => $data ]; } public function scholarship_form_one(request $request){ return view(\'web.default.pages.scholarshipFormOne\'); } public function scholarship_form_two(request $request){ return view(\'web.default.pages.scholarshipFormTwo\'); } public function academic_store(request $request){ $validatedData = $request->validate([ \'name\' => \'required\', \'email\' => \'required\', \'phone_number\' => \'required\', \'nationality\' => \'required\', \'current_address\' => \'required\', \'city\' => \'required\', \'country\' => \'required\', \'education\' => \'required\', \'institute\' => \'required\', \'transcript\' => \'required\', \'Question\' => \'required\', ]); $scholarship = new AcademicScholarship(); $scholarship->name = $request->name; $scholarship->user_id = auth()->user()->id; $scholarship->email = $request->email; $scholarship->phone_number = $request->phone_number; $scholarship->nationality = $request->nationality; $scholarship->city = $request->city; $scholarship->current_address = $request->current_address; $scholarship->country = $request->country; $scholarship->education = $request->education; $scholarship->institute = $request->institute; $scholarship->Question = $request->Question; if ($request->hasfile(\'transcript\')) { $destination = \'assets/admin/Scholarship/Academic/transcript\' . $scholarship->transcript; if (File::exists($destination)) { File::delete($destination); } $file = $request->file(\'transcript\'); $extension = $file->getClientOriginalExtension(); $filename = time() . \'.\' . $extension; $file->move(\'assets/admin/Scholarship/Academic/transcript\', $filename); $scholarship->transcript = $filename; } if ($request->hasfile(\'certificate\')) { $destination = \'assets/admin/Scholarship/Academic/certificate\' . $scholarship->certificate; if (File::exists($destination)) { File::delete($destination); } $file = $request->file(\'certificate\'); $extension = $file->getClientOriginalExtension(); $filename = time() . \'.\' . $extension; $file->move(\'assets/admin/Scholarship/Academic/certificate\', $filename); $scholarship->certificate = $filename; } $scholarship->save(); return redirect(\'scholarship-applied\'); } public function form_two_store(request $request){ $validatedData = $request->validate([ \'name\' => \'required\', \'email\' => \'required\', \'phone_number\' => \'required\', \'nationality\' => \'required\', \'dob\' => \'required\', \'country\' => \'required\', \'education\' => \'required\', \'institute\' => \'required\', \'passport\' => \'required\', \'Proof_of_residency\' => \'required\', ]); $scholarship = new CountryScholarship(); $scholarship->name = $request->name; $scholarship->user_id = auth()->user()->id; $scholarship->email = $request->email; $scholarship->phone_number = $request->phone_number; $scholarship->nationality = $request->nationality; $scholarship->dob = $request->dob; $scholarship->country = $request->country; $scholarship->education = $request->education; $scholarship->institute = $request->institute; $scholarship->passport = $request->passport; $scholarship->Proof_of_residency = $request->Proof_of_residency; if ($request->hasfile(\'passport\')) { $destination = \'assets/admin/Scholarship/Country/passport\' . $scholarship->passport; if (File::exists($destination)) { File::delete($destination); } $file = $request->file(\'passport\'); $extension = $file->getClientOriginalExtension(); $filename = time() . \'.\' . $extension; $file->move(\'assets/admin/Scholarship/Country/passport\', $filename); $scholarship->passport = $filename; } if ($request->hasfile(\'Proof_of_residency\')) { $destination = \'assets/admin/Scholarship/Country/ProofOfResidency\' . $scholarship->Proof_of_residency; if (File::exists($destination)) { File::delete($destination); } $file = $request->file(\'Proof_of_residency\'); $extension = $file->getClientOriginalExtension(); $filename = time() . \'.\' . $extension; $file->move(\'assets/admin/Scholarship/Country/ProofOfResidency\', $filename); $scholarship->Proof_of_residency = $filename; } $scholarship->save(); return redirect(\'scholarship-applied\'); } public function saveLearningTime(Request $request) { $user_id = auth()->id(); // Assuming you are using Laravel\'s authentication $course_slug = $request->input(\'course_slug\'); $time_spent_minutes = $request->input(\'time_spent_minutes\'); // Assuming you have a record for each user and course $learningTime = UserLearningTime::where(\'user_id\', $user_id) ->where(\'course_slug\', $course_slug) ->first(); if ($learningTime) { // Update existing record $learningTime->time_spent_minutes += $time_spent_minutes; $learningTime->save(); } else { // Create a new record UserLearningTime::create([ \'user_id\' => $user_id, \'course_slug\' => $course_slug, \'time_spent_minutes\' => $time_spent_minutes, ]); } return response()->json([\'success\' => true]); } }'