File manager - Edit - /home/linknsbh/sabel-eltaqwa.com/assets/lfm/files/shares/events/thumbs/app.tar
Back
Rules/IsRoomAvailableRule.php 0000644 00000012730 15213350434 0012213 0 ustar 00 <?php namespace App\Rules; use App\Models\User\HotelBooking\Room; use App\Models\User\HotelBooking\RoomBooking; use Illuminate\Contracts\Validation\Rule; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Auth; class IsRoomAvailableRule implements Rule { private $roomId; private $roomBookedDates; private $bookingInfoId; /** * Create a new rule instance. * * @return void */ public function __construct($id, $bookingId = null) { $this->roomId = $id; $this->bookingInfoId = $bookingId; } /** * Determine if the validation rule passes. * * @param string $attribute * @param mixed $value * @return bool */ public function passes($attribute, $value) { // get arrival & departure date from the string $dateArray = explode(' ', $value); $date1 = $dateArray[0]; $date2 = $dateArray[2]; // get all the dates between the start & end date $allDates = $this->getAllDates($date1, $date2, 'Y-m-d'); // get quantity of the room // dd(Room::query()->findOrFail($this->roomId)->quantity); $quantity = Room::query()->findOrFail($this->roomId)->quantity; // get all the bookings of the room if (Auth::guard('web')->check()) { $bookings = RoomBooking::query()->where('room_id', '=', $this->roomId) ->where('payment_status', '=', 1) ->where('user_id', Auth::guard('web')->user()->id) ->select('arrival_date', 'departure_date') ->get(); } else { $bookings = RoomBooking::query()->where('room_id', '=', $this->roomId) ->where('payment_status', '=', 1) ->where('user_id', getUser()->id) ->select('arrival_date', 'departure_date') ->get(); } $bookedDates = []; // loop through the list of dates, which we have found from the arrival & departure date foreach ($allDates as $date) { $bookingCount = 0; // loop through all the bookings foreach ($bookings as $currentBooking) { $bookingStartDate = Carbon::parse($currentBooking->arrival_date); $bookingEndDate = Carbon::parse($currentBooking->departure_date)->subDay(); $currentDate = Carbon::parse($date); // check for each date, whether the date is present or not in any of the booking date range if ($currentDate->betweenIncluded($bookingStartDate, $bookingEndDate)) { $bookingCount++; } } // if the number of booking of a specific date is same as the room quantity, then mark that date as unavailable if ($bookingCount >= $quantity && !in_array($date, $bookedDates)) { array_push($bookedDates, $date); } } if (!is_null($this->bookingInfoId)) { $booking = RoomBooking::query()->findOrFail($this->bookingInfoId); $arrivalDate = $booking->arrival_date; $departureDate = $booking->departure_date; // get all the dates between the booking arrival date & booking departure date $bookingAllDates = $this->getAllDates($arrivalDate, $departureDate, 'Y-m-d'); // remove dates of this booking from 'bookedDates' array while editing a room booking foreach ($bookingAllDates as $date) { $key = array_search($date, $bookedDates); if ($key !== false) { unset($bookedDates[$key]); } } array_values($bookedDates); } // if 'bookedDates' array has any data, then return validation failed if (count($bookedDates) > 0) { $this->roomBookedDates = $bookedDates; return false; } else { return true; } } /** * Get the validation error message. * * @return string */ public function message() { $allBookedDates = ''; // get the array length $arrLen = count($this->roomBookedDates); foreach ($this->roomBookedDates as $key => $bookedDate) { // checking whether the current index is the last position of the array if (($arrLen - 1) == $key) { $allBookedDates .= $bookedDate; } else { $allBookedDates .= $bookedDate . ', '; } } return 'The room is booked on these following dates: ' . $allBookedDates . '.'; } /** * Get all the dates between the arrival & departure date. * * @param string $arrivalDate * @param string $departureDate * @param string $format * @return array */ public function getAllDates($arrivalDate, $departureDate, $format) { $dates = []; // convert string to timestamps $currentTimestamps = strtotime($arrivalDate); $endTimestamps = strtotime($departureDate); // set an increment value $stepValue = '+1 day'; // push all the timestamps to the 'dates' array by formatting those timestamps into date while ($currentTimestamps < $endTimestamps) { $formattedDate = date($format, $currentTimestamps); array_push($dates, $formattedDate); $currentTimestamps = strtotime($stepValue, $currentTimestamps); } return $dates; } } Rules/ImageMimeTypeRule.php 0000644 00000003344 15213350434 0011677 0 ustar 00 <?php namespace App\Rules; use Illuminate\Contracts\Validation\Rule; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\URL; class ImageMimeTypeRule implements Rule { /** * Create a new rule instance. * * @return void */ public function __construct() { // } /** * Determine if the validation rule passes. * * @param string $attribute * @param mixed $value * @return bool */ public function passes($attribute, $value) { $image = $value; if ( URL::current() == Route::is('admin.advertise.store_advertisement') || URL::current() == Route::is('admin.advertise.update_advertisement') || URL::current() == Route::is('admin.basic_settings.update_login_image')|| URL::current() == Route::is('admin.basic_settings.general_settings.update') ) { $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg', 'gif'); } else { $allowedExtensions = array('jpg', 'jpeg', 'png'); } $fileExtension = $image->getClientOriginalExtension(); if (in_array($fileExtension, $allowedExtensions)) { return true; } else { return false; } } /** * Get the validation error message. * * @return string */ public function message() { if ( URL::current() == Route::is('admin.advertise.store_advertisement') || URL::current() == Route::is('admin.advertise.update_advertisement')|| URL::current() == Route::is('admin.basic_settings.update_login_image')|| URL::current() == Route::is('admin.basic_settings.general_settings.update') ) { return 'Only .jpg, .jpeg, .png, .svg and .gif file is allowed.'; } else { return 'Only .jpg, .jpeg and .png file is allowed.'; } } } Console/Kernel.php 0000644 00000001315 15213350434 0010077 0 ustar 00 <?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * * @var array */ protected $commands = [ // ]; /** * Define the application's command schedule. * * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { } /** * Register the commands for the application. * * @return void */ protected function commands() { $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } } Console/Commands/ExpiredUser.php 0000644 00000001350 15213350434 0012656 0 ustar 00 <?php namespace App\Console\Commands; use App\Models\Membership; use App\Models\User; use Illuminate\Console\Command; use Illuminate\Support\Carbon; class ExpiredUser extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'expire:user'; /** * The console command description. * * @var string */ protected $description = 'Command description'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { } } Events/OrderPlaced.php 0000644 00000001572 15213350434 0010712 0 ustar 00 <?php namespace App\Events; use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Broadcasting\PresenceChannel; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; class OrderPlaced implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; /** * Create a new event instance. * * @return void */ public function __construct() { } /** * Get the channels the event should broadcast on. * * @return \Illuminate\Broadcasting\Channel|array */ public function broadcastOn() { return ['order-placed-channel']; } public function broadcastAs() { return 'order-placed-event'; } } Exceptions/Handler.php 0000644 00000001303 15213350434 0010750 0 ustar 00 <?php namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Throwable; class Handler extends ExceptionHandler { /** * A list of the exception types that are not reported. * * @var array */ protected $dontReport = [ // ]; /** * A list of the inputs that are never flashed for validation exceptions. * * @var array */ protected $dontFlash = [ 'current_password', 'password', 'password_confirmation', ]; /** * Register the exception handling callbacks for the application. * * @return void */ public function register() { $this->reportable(function (Throwable $e) { // }); } } Http/Controllers/MidtransBankNotifyController.php 0000644 00000034415 15213350434 0016323 0 ustar 00 <?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use App\Http\Helpers\UserPermissionHelper; use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; use App\Models\Language; use App\Models\Package; use App\Http\Controllers\Front\CheckoutController; use App\Http\Controllers\User\UserCheckoutController; use Carbon\Carbon; use App\Http\Helpers\MegaMailer; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Controllers\Front\DonationManagement\DonationController; class MidtransBankNotifyController extends Controller { public function bank_notify(Request $request) { $midtrans_payment_type = Session::get('midtrans_payment_type'); if ($midtrans_payment_type == 'membership') { $requestData = Session::get('request'); $currentLang = session()->has('lang') ? (Language::where('code', session()->get('lang'))->first()) : (Language::where('is_default', 1)->first()); $bs = $currentLang->basic_setting; $be = $currentLang->basic_extended; /** Get the payment ID before session clear **/ $token = Session::get('token'); if ($request->status_code == 200 && $token == $request->order_id) { $paymentFor = Session::get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = UserPermissionHelper::uniqidReal(8); $transaction_details = json_encode($request->all()); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new CheckoutController(); $user = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $be, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $user, $password, $amount, $requestData["payment_method"], $requestData['phone'], $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $package->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'discount' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $lastMemb->discount . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'total' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $lastMemb->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'registration_with_premium_package', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); session()->flash('success', __('successful_payment')); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new UserCheckoutController(); $user = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $be, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $user, $password, $amount, $requestData["payment_method"], $user->phone, $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $package->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'membership_extend', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); session()->flash('success', __('successful_payment')); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } else { return redirect()->route('membership.perfect_money.cancel'); } } elseif ($midtrans_payment_type == 'shop_room') { $requestData = Session::get('user_request'); $cancel_url = Session::get('midtrans_cancel_url'); $success_url = Session::get('midtrans_success_url'); $token = Session::get('token'); if ($request->status_code == 200 && $token == $request->order_id) { $txnId = $request->transactionId; $chargeId = $request->transactionId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', __('successful_payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('midtrans_payment_type'); Session::forget('order_details_url'); Session::forget('midtrans_cancel_url'); Session::forget('midtrans_success_url'); return redirect($success_url); } else { return redirect($cancel_url); } } elseif ($midtrans_payment_type == 'course') { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $cancel_url = Session::get('midtrans_cancel_url'); $success_url = Session::get('midtrans_success_url'); $token = Session::get('token'); if ($request->status_code == 200 && $token == $request->order_id) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); Session::forget('midtrans_payment_type'); Session::forget('order_details_url'); Session::forget('midtrans_cancel_url'); Session::forget('midtrans_success_url'); return redirect($success_url); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); Session::forget('midtrans_payment_type'); Session::forget('order_details_url'); Session::forget('midtrans_cancel_url'); Session::forget('midtrans_success_url'); return redirect($cancel_url); } } elseif ($midtrans_payment_type == 'causes') { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $success_url = Session::get('midtrans_success_url'); $cancel_url = Session::get('midtrans_cancel_url'); $token = Session::get('token'); if ($request->status_code == 200 && $token == $request->order_id) { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('causeId'); $request->session()->forget('userId'); $request->session()->forget('arrData'); Session::forget('midtrans_payment_type'); Session::forget('order_details_url'); Session::forget('midtrans_cancel_url'); Session::forget('midtrans_success_url'); return redirect($success_url); } else { // remove all session data $request->session()->forget('causeId'); $request->session()->forget('userId'); $request->session()->forget('arrData'); Session::forget('midtrans_payment_type'); Session::forget('order_details_url'); Session::forget('midtrans_cancel_url'); Session::forget('midtrans_success_url'); return redirect($cancel_url); } } } public function cancel() { $midtrans_payment_type = Session::get('midtrans_payment_type'); if ($midtrans_payment_type == 'membership') { return redirect()->route('membership.perfect_money.cancel'); } elseif ($midtrans_payment_type == 'shop_room') { $cancel_url = Session::get('midtrans_cancel_url'); return redirect($cancel_url); } elseif ($midtrans_payment_type == 'course') { $cancel_url = Session::get('midtrans_cancel_url'); // remove all session data Session::forget('userId'); Session::forget('courseId'); Session::forget('arrData'); Session::forget('midtrans_payment_type'); Session::forget('order_details_url'); Session::forget('midtrans_cancel_url'); Session::forget('midtrans_success_url'); return redirect($cancel_url); } elseif ($midtrans_payment_type == 'causes') { $cancel_url = Session::get('midtrans_cancel_url'); // remove all session data Session::forget('causeId'); Session::forget('userId'); Session::forget('arrData'); Session::forget('midtrans_payment_type'); Session::forget('order_details_url'); Session::forget('midtrans_cancel_url'); Session::forget('midtrans_success_url'); return redirect($cancel_url); } } } Http/Controllers/Payment/PhonePeController.php 0000644 00000023142 15213350434 0015523 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use Carbon\Carbon; use App\Models\Package; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Session; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class PhonePeController extends Controller { private $sandboxCheck; public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url) { $info = OnlineGateway::where('keyword', 'phonepe')->first(); $paydata = json_decode($info->information, true); $cancel_url = $_cancel_url; $notify_url = $_success_url; $this->sandboxCheck = $paydata['sandbox_status']; $clientId = $paydata['merchant_id']; $clientSecret = $paydata['salt_key']; //* Here i completed 1 step which is generating access token in each request $accessToken = $this->getPhonePeAccessToken($clientId, $clientSecret); if (!$accessToken) { return back()->withError(__('Failed to get PhonePe access token') . '.'); } Session::put("request", $request->all()); Session::put('cancel_url', $cancel_url); return $this->initiatePayment($accessToken, $notify_url, $cancel_url, $_amount); } private function getPhonePeAccessToken($clientId, $clientSecret) { return Cache::remember('phonepe_access_token', 3500, function () use ($clientId, $clientSecret) { $tokenUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox/v1/oauth/token' : 'https://api.phonepe.com/apis/identity-manager/v1/oauth/token'; $response = Http::asForm()->post($tokenUrl, [ 'client_id' => $clientId, 'client_secret' => $clientSecret, 'client_version' => 1, 'grant_type' => 'client_credentials' ]); if ($response->successful()) { return $response->json()['access_token']; } return null; }); } public function initiatePayment($accessToken, $successUrl, $cancelUrl, $_amount) { $baseUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox' : 'https://api.phonepe.com/apis/pg'; $endpoint = '/checkout/v2/pay'; // Generate a unique merchantOrderId and store it in the session $merchantOrderId = uniqid(); Session::put('merchantOrderId', $merchantOrderId); Session::put('cancel_url', $cancelUrl); //here we preapare the parameter of the request $payload = [ 'merchantOrderId' => $merchantOrderId, 'amount' => intval($_amount * 100), 'paymentFlow' => [ 'type' => 'PG_CHECKOUT', 'merchantUrls' => [ 'redirectUrl' => $successUrl, 'cancelUrl' => $cancelUrl ] ] ]; try { //after preparing the parameter we send a request to create a payment link $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'O-Bearer ' . $accessToken, ])->post($baseUrl . $endpoint, $payload); $responseData = $response->json(); //after successfully created the payment link of we redirect the user to api responsed redirectUrl if ($response->successful() && isset($responseData['redirectUrl'])) { return redirect()->away($responseData['redirectUrl']); } else { // Handle API errors Session::forget(['merchantOrderId', 'cancel_url']); return back()->with('error', 'Failed to initiate payment' . '.'); } } catch (\Exception $e) { Session::forget(['merchantOrderId', 'cancel_url']); return response()->json([ 'success' => false, 'code' => 'NETWORK_ERROR', 'message' => $e->getMessage() ], 500); } } public function successPayment(Request $request) { $requestData = Session::get('request'); $bs = Basic::first(); $cancel_url = Session::get('cancel_url'); $merchantOrderId = $request->input('merchantOrderId') ?? Session::get('merchantOrderId') ?? uniqid(); $verificationResponse = $this->verifyOrderStatus($merchantOrderId); if ($verificationResponse['success']) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = session()->get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = NULL; if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } return redirect($cancel_url); } } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => session()->get('request')['package_id']])->withInput(session()->get('request')); } } Http/Controllers/Payment/FlutterWaveController.php 0000644 00000026424 15213350434 0016443 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Http\Controllers\Vendor\VendorCheckoutController; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use Illuminate\Support\Facades\Session; use App\Http\Controllers\Controller; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use Illuminate\Http\Request; use App\Models\Language; use App\Models\Package; use Carbon\Carbon; class FlutterWaveController extends Controller { public $public_key; private $secret_key; public function __construct() { $data = OnlineGateway::whereKeyword('flutterwave')->first(); $paydata = $data->convertAutoData(); $this->public_key = $paydata['public_key']; $this->secret_key = $paydata['secret_key']; } public function paymentProcess(Request $request, $_amount, $_email, $_item_number, $_successUrl, $_cancelUrl, $bex) { $cancel_url = $_cancelUrl; $notify_url = $_successUrl; Session::put('request', $request->all()); Session::put('payment_id', $_item_number); // SET CURL $curl = curl_init(); $currency = $bex->base_currency_text; $txref = $_item_number; // ensure you generate unique references per transaction. $PBFPubKey = $this->public_key; // get your public key from the dashboard. $redirect_url = $notify_url; $payment_plan = ""; // this is only required for recurring payments. curl_setopt_array($curl, array( CURLOPT_URL => "https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/hosted/pay", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'amount' => $_amount, 'customer_email' => $_email, 'currency' => $currency, 'txref' => $txref, 'PBFPubKey' => $PBFPubKey, 'redirect_url' => $redirect_url, 'payment_plan' => $payment_plan ]), CURLOPT_HTTPHEADER => [ "content-type: application/json", "cache-control: no-cache" ], )); $response = curl_exec($curl); $err = curl_error($curl); if ($err) { // there was an error contacting the rave API return redirect($cancel_url)->with('error', 'Curl returned error: ' . $err); } $transaction = json_decode($response); if (!$transaction->data && !$transaction->data->link) { // there was an error from the API return redirect($cancel_url)->with('error', 'API returned error: ' . $transaction->message); } return redirect()->to($transaction->data->link); } public function successPayment(Request $request) { $requestData = Session::get('request'); if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $bs = Basic::first(); $success_url = route('membership.flutterwave.cancel'); $cancel_url = route('membership.flutterwave.cancel'); /** Get the payment ID before session clear **/ $payment_id = Session::get('payment_id'); if (isset($request['txref'])) { $ref = $payment_id; $query = array( "SECKEY" => $this->secret_key, "txref" => $ref ); $data_string = json_encode($query); $ch = curl_init('https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $response = curl_exec($ch); curl_close($ch); $resp = json_decode($response, true); if ($resp['status'] == 'error') { return redirect($cancel_url); } if ($resp['status'] = "success") { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentStatus = $resp['data']['status']; $paymentFor = Session::get('paymentFor'); if ($resp['status'] = "success") { $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($resp['data']); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $user = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $user, $password, $amount, "Flutterwave", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', __('successful_payment')); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $user = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $user, $password, $amount, $requestData["payment_method"], $user->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } } return redirect($cancel_url); } return redirect($cancel_url); } public function cancelPayment() { $requestData = Session::get('request'); $paymentFor = Session::get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } Http/Controllers/Payment/MyFatoorahController.php 0000644 00000021223 15213350434 0016234 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use Config; use App\Models\Package; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use Basel\MyFatoorah\MyFatoorah; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class MyFatoorahController extends Controller { private $myfatoorah; public function __construct() { $info = OnlineGateway::where('keyword', 'myfatoorah')->firstOrFail(); $bs = Basic::first(); $information = json_decode($info->information, true); config([ 'myfatoorah.token' => $information['token'] ?? '', 'myfatoorah.DisplayCurrencyIso' => $bs->base_currency_text ?? 'KWD', 'myfatoorah.CallBackUrl' => route('membership.myfatoorah.success'), 'myfatoorah.ErrorUrl' => route('membership.myfatoorah.cancel'), ]); $sandboxMode = isset($information['sandbox_status']) && $information['sandbox_status'] == 1; $this->myfatoorah = MyFatoorah::getInstance($sandboxMode); } public function paymentProcess($request, $_amount, $_cancel_url) { $cancel_url = $_cancel_url; $info = OnlineGateway::where('keyword', 'myfatoorah')->first(); $information = json_decode($info->information, true); $paymentFor = Session::get('paymentFor'); $random_1 = rand(999, 9999); $random_2 = rand(9999, 99999); try { $result = $this->myfatoorah->sendPayment( Auth::guard('vendor')->user()->username, intval($_amount), [ 'CustomerMobile' => $information['sandbox_status'] == 1 ? '56562123544' : Auth::guard('vendor')->user()->phone, 'CustomerReference' => "$random_1", //orderID 'UserDefinedField' => "$random_2", //clientID "InvoiceItems" => [ [ "ItemName" => "Package Purchase or Extends", "Quantity" => 1, "UnitPrice" => intval($_amount) ] ] ] ); } catch (\Exception $e) { // dd($e); } if ($result && $result['IsSuccess'] == true) { Session::put('myfatoorah_payment_type', $paymentFor); Session::put("request", $request->all()); return redirect($result['Data']['InvoiceURL']); } else { return redirect($cancel_url); } } public function successPayment(Request $request) { $requestData = Session::get('request'); $bs = Basic::first(); /** Get the payment ID before session clear **/ if (!empty($request->paymentId)) { $result = $this->myfatoorah->getPaymentStatus('paymentId', $request->paymentId); if ($result && $result['IsSuccess'] == true && $result['Data']['InvoiceStatus'] == "Paid") { // transaction create $after_balance = null; $pre_balance = null; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = session()->get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = null; if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice( $requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb ); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => $expire->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice( $requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb ); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => $expire->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } } } // If paymentId is missing or not paid, redirect to cancel return redirect()->route('payment.cancel'); } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => session()->get('request')['package_id']])->withInput(session()->get('request')); } } Http/Controllers/Payment/PaystackController.php 0000644 00000017127 15213350434 0015752 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use Carbon\Carbon; use App\Models\Package; use App\Models\Language; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Session; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class PaystackController extends Controller { public function __construct() {} /** * Redirect the User to Paystack Payment Page * @return */ public function paymentProcess(Request $request, $_amount, $_email, $_success_url, $bex) { $data = OnlineGateway::whereKeyword('paystack')->first(); $paydata = $data->convertAutoData(); $secret_key = $paydata['key']; $curl = curl_init(); $callback_url = $_success_url; // url to go to after payment curl_setopt_array($curl, array( CURLOPT_URL => "https://api.paystack.co/transaction/initialize", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'amount' => $_amount, 'email' => $_email, 'callback_url' => $callback_url ]), CURLOPT_HTTPHEADER => [ "authorization: Bearer " . $secret_key, //replace this with your own test key "content-type: application/json", "cache-control: no-cache" ], )); $response = curl_exec($curl); $err = curl_error($curl); if ($err) { return redirect()->back()->with('error', $err); } $tranx = json_decode($response, true); Session::put('request', $request->all()); if (!$tranx['status']) { return redirect()->back()->with("error", $tranx['message']); } return redirect($tranx['data']['authorization_url']); } public function successPayment(Request $request) { $requestData = Session::get('request'); $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); if ($request['trxref'] === $request['reference']) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = Session::get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($request['trxref']); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } else { $requestData = Session::get('request'); $paymentFor = Session::get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } } Http/Controllers/Payment/MollieController.php 0000644 00000020753 15213350434 0015413 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Http\Controllers\Front\CheckoutController; use App\Http\Controllers\User\UserCheckoutController; use App\Http\Helpers\UserPermissionHelper; use App\Models\Package; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Controllers\Vendor\VendorCheckoutController; use App\Http\Helpers\MegaMailer; use App\Http\Helpers\VendorPermissionHelper; use App\Models\BasicSettings\Basic; use Mollie\Laravel\Facades\Mollie; use App\Models\Language; use App\Models\Membership; use App\Models\PaymentGateway\OnlineGateway; use Carbon\Carbon; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Config; class MollieController extends Controller { public $public_key; public function __construct() { $data = OnlineGateway::whereKeyword('mollie')->first(); $paydata = $data->convertAutoData(); $this->public_key = $paydata['key']; Config::set('mollie.key', $paydata['key']); } public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url, $_title, $bex) { $notify_url = $_success_url; $payment = Mollie::api()->payments()->create([ 'amount' => [ 'currency' => $bex->base_currency_text, 'value' => '' . sprintf('%0.2f', $_amount) . '', // You must send the correct number of decimals, thus we enforce the use of strings ], 'description' => $_title, 'redirectUrl' => $notify_url, ]); /** add payment ID to session **/ Session::put('request', $request->all()); Session::put('payment_id', $payment->id); Session::put('success_url', $_success_url); $payment = Mollie::api()->payments()->get($payment->id); return redirect($payment->getCheckoutUrl(), 303); } public function successPayment(Request $request) { $requestData = Session::get('request'); $bs = Basic::first(); $cancel_url = Session::get('cancel_url'); $payment_id = Session::get('payment_id'); /** Get the payment ID before session clear **/ $payment = Mollie::api()->payments()->get($payment_id); if ($payment->status == 'paid') { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = Session::get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($payment); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } return redirect($cancel_url); } public function cancelPayment() { $requestData = Session::get('request'); $paymentFor = Session::get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } Http/Controllers/Payment/ToyyibpayController.php 0000644 00000020634 15213350434 0016161 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Models\Package; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class ToyyibpayController extends Controller { public function paymentProcess($request, $_amount, $_success_url, $_cancel_url) { $info = OnlineGateway::where('keyword', 'toyyibpay')->first(); $paydata = json_decode($info->information, true); $ref = uniqid(); session()->put('toyyibpay_ref_id', $ref); session()->put('request', $request->all()); $bill_description = 'Package Purchase via toyyibpay'; $first_name = Auth::guard('vendor')->user()->first_name; $last_name = Auth::guard('vendor')->user()->last_name; $email = Auth::guard('vendor')->user()->email; $phone = Auth::guard('vendor')->user()->phone; $some_data = array( 'userSecretKey' => $paydata['secret_key'], 'categoryCode' => $paydata['category_code'], 'billName' => 'Package Purchase', 'billDescription' => $bill_description, 'billPriceSetting' => 1, 'billPayorInfo' => 1, 'billAmount' => $_amount * 100, 'billReturnUrl' => $_success_url, 'billExternalReferenceNo' => $ref, 'billTo' => $first_name . ' ' . $last_name, 'billEmail' => $email, 'billPhone' => $phone, ); if ($paydata['sandbox_status'] == 1) { $host = 'https://dev.toyyibpay.com/'; // for development environment } else { $host = 'https://toyyibpay.com/'; // for production environment } $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, $host . 'index.php/api/createBill'); // sandbox will be dev. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $response = json_decode($result, true); if (!empty($response[0])) { return redirect($host . $response[0]["BillCode"]); } else { return redirect($_cancel_url); } } public function successPayment(Request $request) { $requestData = session()->get('request'); $ref = session()->get('toyyibpay_ref_id'); $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); if ($request['status_id'] == 1 && $request['order_id'] == $ref) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = session()->get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($request['trxref']); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } } else { $requestData = session()->get('request'); $paymentFor = session()->get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => session()->get('request')['package_id']])->withInput(session()->get('request')); } } Http/Controllers/Payment/RazorpayController.php 0000644 00000024643 15213350434 0016003 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Controllers\Vendor\VendorCheckoutController; use App\Http\Helpers\MegaMailer; use App\Http\Helpers\VendorPermissionHelper; use App\Models\BasicSettings\Basic; use App\Models\Language; use App\Models\Package; use App\Models\PaymentGateway\OnlineGateway; use Carbon\Carbon; use Razorpay\Api\Api; use Illuminate\Support\Facades\Session; use Razorpay\Api\Errors\SignatureVerificationError; class RazorpayController extends Controller { public function __construct() { $data = OnlineGateway::whereKeyword('razorpay')->first(); $paydata = $data->convertAutoData(); $this->keyId = $paydata['key']; $this->keySecret = $paydata['secret']; $this->api = new Api($this->keyId, $this->keySecret); } public function paymentProcess(Request $request, $_amount, $_item_number, $_cancel_url, $_success_url, $_title, $_description, $bs) { $cancel_url = $_cancel_url; $notify_url = $_success_url; $orderData = [ 'receipt' => $_title, 'amount' => $_amount * 100, 'currency' => 'INR', 'payment_capture' => 1 // auto capture ]; $razorpayOrder = $this->api->order->create($orderData); Session::put('request', $request->all()); Session::put('order_payment_id', $razorpayOrder['id']); $displayAmount = $amount = $_amount; $checkout = 'automatic'; if (isset($_GET['checkout']) and in_array($_GET['checkout'], ['automatic', 'manual'], true)) { $checkout = $_GET['checkout']; } $data = [ "key" => $this->keyId, "amount" => $_amount, "name" => $_title, "description" => $_description, "prefill" => [ "name" => $request->name, "email" => $request->address, "contact" => $request->razorpay_phone, ], "notes" => [ "address" => $request->razorpay_address, "merchant_order_id" => $_item_number, ], "theme" => [ "color" => "{{$bs->base_color}}" ], "order_id" => $razorpayOrder['id'], ]; if ($bs->base_currency_text !== 'INR') { $data['display_currency'] = $bs->base_currency_text; $data['display_amount'] = $displayAmount; } $json = json_encode($data); $displayCurrency = $bs->base_currency_text; return view('front.razorpay', compact('data', 'displayCurrency', 'json', 'notify_url')); } public function successPayment(Request $request) { $requestData = Session::get('request'); if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $bs = Basic::first(); /** Get the payment ID before session clear **/ $payment_id = Session::get('order_payment_id'); $success = true; if (empty($request['razorpay_payment_id']) === false) { try { $attributes = array( 'razorpay_order_id' => $payment_id, 'razorpay_payment_id' => $request['razorpay_payment_id'], 'razorpay_signature' => $request['razorpay_signature'] ); $this->api->utility->verifyPaymentSignature($attributes); } catch (SignatureVerificationError $e) { $success = false; } } if ($success === true) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $package = Package::find($requestData['package_id']); $paymentFor = Session::get('paymentFor'); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($request); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Razorpay", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $user = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $user, $password, $amount, $requestData["payment_method"], $user->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', __('successful_payment')); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } $paymentFor = Session::get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } public function cancelPayment() { $requestData = Session::get('request'); $paymentFor = Session::get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } Http/Controllers/Payment/AuthorizenetController.php 0000644 00000021700 15213350434 0016644 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CheckoutController; use App\Http\Controllers\User\UserCheckoutController; use App\Http\Helpers\MegaMailer; use App\Models\BasicSetting; use App\Models\Membership; use App\Models\Package; use Illuminate\Http\Request; use Omnipay\Omnipay; use App\Models\PaymentGateway; use Carbon\Carbon; use Illuminate\Support\Facades\Session; class AuthorizenetController extends Controller { public $gateway; public function __construct() { $data = PaymentGateway::whereKeyword('authorize.net')->first(); $paydata = $data->convertAutoData(); $this->gateway = Omnipay::create('AuthorizeNetApi_Api'); $this->gateway->setAuthName($paydata['login_id']); $this->gateway->setTransactionKey($paydata['transaction_key']); if ($paydata['sandbox_check'] == 1) { $this->gateway->setTestMode(true); } } public function paymentProcess(Request $request, $_amount, $_cancel_url, $_title, $be) { Session::put('request', $request->all()); if ($request->input('opaqueDataDescriptor') && $request->input('opaqueDataValue')) { try { // Generate a unique merchant site transaction ID. $transactionId = rand(100000000, 999999999); $response = $this->gateway->authorize([ 'amount' => $_amount, 'currency' => $be->base_currency_text, 'transactionId' => $transactionId, 'opaqueDataDescriptor' => $request->input('opaqueDataDescriptor'), 'opaqueDataValue' => $request->input('opaqueDataValue'), ])->send(); if ($response->isSuccessful()) { // Captured from the authorization response. $transactionReference = $response->getTransactionReference(); $response = $this->gateway->capture([ 'amount' => $_amount, 'currency' => $be->base_currency_text, 'transactionReference' => $transactionReference, ])->send(); $transaction_id = $response->getTransactionReference(); // Insert transaction data into the database $isPaymentExist = Membership::where('transaction_id', $transaction_id)->first(); if (!$isPaymentExist) { $paymentFor = Session::get('paymentFor'); $package = Package::find($request['package_id']); $transaction_id = $transaction_id; $transaction_details = NULL; if ($paymentFor == "membership") { $amount = $request['price']; $password = $request['password']; $checkout = new CheckoutController(); $user = $checkout->store($request, $transaction_id, $transaction_details, $amount, $be, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($request, "membership", $user, $password, $amount, "Authorize.net", $request['phone'], $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); $bs = BasicSetting::select('website_title')->first(); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $package->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'discount' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $lastMemb->discount . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'total' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $lastMemb->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'registration_with_premium_package', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); session()->flash('success', __('successful_payment')); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $request['price']; $password = uniqid('qrcode'); $checkout = new UserCheckoutController(); $user = $checkout->store($request, $transaction_id, $transaction_details, $amount, $be, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($request, "extend", $user, $password, $amount, $request["payment_method"], $user->phone_number, $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); $bs = BasicSetting::select('website_title')->first(); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $package->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'membership_extend', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); session()->flash('success', __('successful_payment')); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } } else { // not successful $request->session()->flash('error', $response->getMessage()); return redirect($_cancel_url); } } catch (\Exception $e) { $request->session()->flash('error', $e->getMessage()); return redirect($_cancel_url); } } } public function cancelPayment() { $request = Session::get('request'); $paymentFor = Session::get('paymentFor'); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $request['package_type'], 'id' => $request['package_id']])->withInput($request); } else { return redirect()->route('user.plan.extend.checkout', ['package_id' => $request['package_id']])->withInput($request); } } } Http/Controllers/Payment/PaytmController.php 0000644 00000044523 15213350434 0015265 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Http\Controllers\Admin\AdminCheckoutController; use App\Http\Controllers\Front\CheckoutController; use App\Http\Controllers\User\UserCheckoutController; use App\Http\Helpers\UserPermissionHelper; use App\Models\BasicExtended; use App\Models\Package; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Controllers\Vendor\VendorCheckoutController; use App\Http\Helpers\MegaMailer; use App\Http\Helpers\VendorPermissionHelper; use App\Models\BasicSettings\Basic; use App\Models\Language; use App\Models\Membership; use App\Models\PaymentGateway\OnlineGateway; use Carbon\Carbon; use Illuminate\Support\Facades\Session; class PaytmController extends Controller { public function paymentProcess(Request $request, $_amount, $_item_number, $_callback_url) { $data = OnlineGateway::whereKeyword('paytm')->first(); $paydata = $data->convertAutoData(); dd($paydata); $data_for_request = $this->handlePaytmRequest($_item_number, $_amount, $_callback_url); if ($paydata['environment'] == 'local') { $paytm_txn_url = 'https://securegw-stage.paytm.in/theia/processTransaction'; } else { $paytm_txn_url = 'https://securegw.paytm.in/theia/processTransaction'; } $paramList = $data_for_request['paramList']; $checkSum = $data_for_request['checkSum']; Session::put("request", $request->all()); return view('front.paytm', compact('paytm_txn_url', 'paramList', 'checkSum')); } public function handlePaytmRequest($_item_number, $amount, $callback_url) { $data = OnlineGateway::whereKeyword('paytm')->first(); $paydata = $data->convertAutoData(); // Load all functions of encdec_paytm.php and config-paytm.php $this->getAllEncdecFunc(); $checkSum = ""; $paramList = array(); // Create an array having all required parameters for creating checksum. $paramList["MID"] = $paydata['merchant_mid']; $paramList["ORDER_ID"] = $_item_number; $paramList["CUST_ID"] = $_item_number; $paramList["INDUSTRY_TYPE_ID"] = $paydata['industry_type']; $paramList["CHANNEL_ID"] = 'WEB'; $paramList["TXN_AMOUNT"] = $amount; $paramList["WEBSITE"] = $paydata['merchant_website']; $paramList["CALLBACK_URL"] = $callback_url; $paytm_merchant_key = $paydata['merchant_key']; //Here checksum string will return by getChecksumFromArray() function. $checkSum = getChecksumFromArray($paramList, $paytm_merchant_key); return array( 'checkSum' => $checkSum, 'paramList' => $paramList ); } function getAllEncdecFunc() { function encrypt_e($input, $ky) { $key = html_entity_decode($ky); $iv = "@@@@&&&&####$$$$"; $data = openssl_encrypt($input, "AES-128-CBC", $key, 0, $iv); return $data; } function decrypt_e($crypt, $ky) { $key = html_entity_decode($ky); $iv = "@@@@&&&&####$$$$"; $data = openssl_decrypt($crypt, "AES-128-CBC", $key, 0, $iv); return $data; } function pkcs5_pad_e($text, $blocksize) { $pad = $blocksize - (strlen($text) % $blocksize); return $text . str_repeat(chr($pad), $pad); } function pkcs5_unpad_e($text) { $pad = ord($text[strlen($text) - 1]); if ($pad > strlen($text)) return false; return substr($text, 0, -1 * $pad); } function generateSalt_e($length) { $random = ""; srand((float)microtime() * 1000000); $data = "AbcDE123IJKLMN67QRSTUVWXYZ"; $data .= "aBCdefghijklmn123opq45rs67tuv89wxyz"; $data .= "0FGH45OP89"; for ($i = 0; $i < $length; $i++) { $random .= substr($data, (rand() % (strlen($data))), 1); } return $random; } function checkString_e($value) { if ($value == 'null') $value = ''; return $value; } function getChecksumFromArray($arrayList, $key, $sort = 1) { if ($sort != 0) { ksort($arrayList); } $str = getArray2Str($arrayList); $salt = generateSalt_e(4); $finalString = $str . "|" . $salt; $hash = hash("sha256", $finalString); $hashString = $hash . $salt; $checksum = encrypt_e($hashString, $key); return $checksum; } function getChecksumFromString($str, $key) { $salt = generateSalt_e(4); $finalString = $str . "|" . $salt; $hash = hash("sha256", $finalString); $hashString = $hash . $salt; $checksum = encrypt_e($hashString, $key); return $checksum; } function verifychecksum_e($arrayList, $key, $checksumvalue) { $arrayList = removeCheckSumParam($arrayList); ksort($arrayList); $str = getArray2StrForVerify($arrayList); $paytm_hash = decrypt_e($checksumvalue, $key); $salt = substr($paytm_hash, -4); $finalString = $str . "|" . $salt; $website_hash = hash("sha256", $finalString); $website_hash .= $salt; $validFlag = "FALSE"; if ($website_hash == $paytm_hash) { $validFlag = "TRUE"; } else { $validFlag = "FALSE"; } return $validFlag; } function verifychecksum_eFromStr($str, $key, $checksumvalue) { $paytm_hash = decrypt_e($checksumvalue, $key); $salt = substr($paytm_hash, -4); $finalString = $str . "|" . $salt; $website_hash = hash("sha256", $finalString); $website_hash .= $salt; $validFlag = "FALSE"; if ($website_hash == $paytm_hash) { $validFlag = "TRUE"; } else { $validFlag = "FALSE"; } return $validFlag; } function getArray2Str($arrayList) { $findme = 'REFUND'; $findmepipe = '|'; $paramStr = ""; $flag = 1; foreach ($arrayList as $key => $value) { $pos = strpos($value, $findme); $pospipe = strpos($value, $findmepipe); if ($pos !== false || $pospipe !== false) { continue; } if ($flag) { $paramStr .= checkString_e($value); $flag = 0; } else { $paramStr .= "|" . checkString_e($value); } } return $paramStr; } function getArray2StrForVerify($arrayList) { $paramStr = ""; $flag = 1; foreach ($arrayList as $key => $value) { if ($flag) { $paramStr .= checkString_e($value); $flag = 0; } else { $paramStr .= "|" . checkString_e($value); } } return $paramStr; } function redirect2PG($paramList, $key) { $hashString = getchecksumFromArray($paramList, $key); $checksum = encrypt_e($hashString, $key); } function removeCheckSumParam($arrayList) { if (isset($arrayList["CHECKSUMHASH"])) { unset($arrayList["CHECKSUMHASH"]); } return $arrayList; } function getTxnStatus($requestParamList) { return callAPI(PAYTM_STATUS_QUERY_URL, $requestParamList); } function getTxnStatusNew($requestParamList) { return callNewAPI(PAYTM_STATUS_QUERY_NEW_URL, $requestParamList); } function initiateTxnRefund($requestParamList) { $CHECKSUM = getRefundChecksumFromArray($requestParamList, PAYTM_MERCHANT_KEY, 0); $requestParamList["CHECKSUM"] = $CHECKSUM; return callAPI(PAYTM_REFUND_URL, $requestParamList); } function callAPI($apiURL, $requestParamList) { $jsonResponse = ""; $responseParamList = array(); $JsonData = json_encode($requestParamList); $postData = 'JsonData=' . urlencode($JsonData); $ch = curl_init($apiURL); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($postData) ) ); $jsonResponse = curl_exec($ch); $responseParamList = json_decode($jsonResponse, true); return $responseParamList; } function callNewAPI($apiURL, $requestParamList) { $jsonResponse = ""; $responseParamList = array(); $JsonData = json_encode($requestParamList); $postData = 'JsonData=' . urlencode($JsonData); $ch = curl_init($apiURL); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($postData) ) ); $jsonResponse = curl_exec($ch); $responseParamList = json_decode($jsonResponse, true); return $responseParamList; } function getRefundChecksumFromArray($arrayList, $key, $sort = 1) { if ($sort != 0) { ksort($arrayList); } $str = getRefundArray2Str($arrayList); $salt = generateSalt_e(4); $finalString = $str . "|" . $salt; $hash = hash("sha256", $finalString); $hashString = $hash . $salt; $checksum = encrypt_e($hashString, $key); return $checksum; } function getRefundArray2Str($arrayList) { $findmepipe = '|'; $paramStr = ""; $flag = 1; foreach ($arrayList as $key => $value) { $pospipe = strpos($value, $findmepipe); if ($pospipe !== false) { continue; } if ($flag) { $paramStr .= checkString_e($value); $flag = 0; } else { $paramStr .= "|" . checkString_e($value); } } return $paramStr; } function callRefundAPI($refundApiURL, $requestParamList) { $jsonResponse = ""; $responseParamList = array(); $JsonData = json_encode($requestParamList); $postData = 'JsonData=' . urlencode($JsonData); $ch = curl_init($refundApiURL); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $refundApiURL); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $headers = array(); $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $jsonResponse = curl_exec($ch); return json_decode($jsonResponse, true); } } public function paymentStatus(Request $request) { $requestData = Session::get('request'); $bs = Basic::first(); $paymentFor = Session::get('paymentFor'); if ($request["STATUS"] === "TXN_FAILURE") { $paymentFor = Session::get('paymentFor'); session()->flash('warning', $request['RESPMSG']); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } elseif ($request['STATUS'] === 'TXN_SUCCESS') { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($request); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } } } Http/Controllers/Payment/PaytabsController.php 0000644 00000017052 15213350434 0015573 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Models\Package; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; use App\Http\Helpers\VendorPermissionHelper; use App\Http\Controllers\Vendor\VendorCheckoutController; class PaytabsController extends Controller { public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url) { Session::put('request', $request->all()); $paytabInfo = paytabInfo(); $description = 'Package Purchase via paytabs'; try { $response = Http::withHeaders([ 'Authorization' => $paytabInfo['server_key'], // Server Key 'Content-Type' => 'application/json', ])->post($paytabInfo['url'], [ 'profile_id' => $paytabInfo['profile_id'], // Profile ID 'tran_type' => 'sale', 'tran_class' => 'ecom', 'cart_id' => uniqid(), 'cart_description' => $description, 'cart_currency' => $paytabInfo['currency'], // set currency by region 'cart_amount' => round($_amount, 2), 'return' => $_success_url, ]); $responseData = $response->json(); // put some data in session before redirect to paytm url return redirect()->to($responseData['redirect_url']); } catch (\Exception $e) { return redirect($_cancel_url); } } public function successPayment(Request $request) { $requestData = Session::get('request'); $resp = $request->all(); $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); if ($resp['respStatus'] == "A" && $resp['respMessage'] == 'Authorised') { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = session()->get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = NULL; if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } } else { $requestData = session()->get('request'); $paymentFor = session()->get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => session()->get('request')['package_id']])->withInput(session()->get('request')); } } Http/Controllers/Payment/MidtransController.php 0000644 00000020512 15213350434 0015744 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use Midtrans\Snap; use App\Models\Package; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use Midtrans\Config as MidtransConfig; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class MidtransController extends Controller { public function paymentProcess($request, $_amount, $_success_url, $_cancel_url) { Session::put('request', $request->all()); $data = []; $name = Auth::guard('vendor')->user()->first_name . ' ' . Auth::guard('vendor')->user()->last_name; $email = Auth::guard('vendor')->user()->email; $phone = Auth::guard('vendor')->user()->phone; $data['title'] = 'Package Extends via Midtrans'; $paymentMethod = OnlineGateway::where('keyword', 'midtrans')->first(); $paydata = json_decode($paymentMethod->information, true); // will come from database MidtransConfig::$serverKey = $paydata['server_key']; MidtransConfig::$isProduction = $paydata['is_production'] == 0 ? true : false; MidtransConfig::$isSanitized = true; MidtransConfig::$is3ds = true; $token = uniqid(); Session::put('token', $token); $params = [ 'transaction_details' => [ 'order_id' => $token, 'gross_amount' => (int)round($_amount) ], 'customer_details' => [ 'first_name' => $name, 'email' => $email, 'phone' => $phone, ], ]; $snapToken = Snap::getSnapToken($params); // put some data in session before redirect to midtrans url if ( $paydata['is_production'] == 1 ) { $is_production = $paydata['is_production']; } $success_url = route('membership.midtrans.success'); $data['snapToken'] = $snapToken; $data['is_production'] = $is_production; $data['success_url'] = $success_url; $data['_cancel_url'] = $_cancel_url; $data['client_key'] = $paydata['server_key']; Session::put('midtrans_payment_type', 'membership'); return view('payments.midtrans-membership', $data); } public function successPayment(Request $request) { $requestData = Session::get('request'); $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); $token = Session::get('token'); if ($request->status_code == 200 && $token == $request->order_id) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = session()->get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = NULL; if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } } else { $requestData = session()->get('request'); $paymentFor = session()->get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => session()->get('request')['package_id']])->withInput(session()->get('request')); } } Http/Controllers/Payment/MercadopagoController.php 0000644 00000024641 15213350434 0016413 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Models\Package; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Controllers\Vendor\VendorCheckoutController; use App\Http\Helpers\MegaMailer; use App\Http\Helpers\VendorPermissionHelper; use App\Models\BasicSettings\Basic; use App\Models\PaymentGateway\OnlineGateway; use Carbon\Carbon; use Illuminate\Support\Facades\Session; class MercadopagoController extends Controller { private $access_token; private $sandbox; public function __construct() { $data = OnlineGateway::whereKeyword('mercadopago')->first(); $paydata = $data->convertAutoData(); $this->access_token = $paydata['token']; $this->sandbox = $paydata['sandbox_status']; } public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url, $email, $_title, $_description, $bex) { $return_url = $_success_url; $cancel_url = $_cancel_url; $notify_url = $_success_url; $curl = curl_init(); $preferenceData = [ 'items' => [ [ 'id' => uniqid("mercadopago-"), 'title' => $_title, 'description' => $_description, 'quantity' => 1, 'currency_id' => "BRL", //unfortunately mercadopago only support BRL currency 'unit_price' => round($_amount, 2), ] ], 'payer' => [ 'email' => $email, ], 'back_urls' => [ 'success' => $return_url, 'pending' => '', 'failure' => $cancel_url, ], 'notification_url' => $notify_url, 'auto_return' => 'approved', ]; $httpHeader = [ "Content-Type: application/json", ]; $url = "https://api.mercadopago.com/checkout/preferences?access_token=" . $this->access_token; $opts = [ CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode($preferenceData, true), CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => $httpHeader ]; curl_setopt_array($curl, $opts); $response = curl_exec($curl); $payment = json_decode($response, true); $err = curl_error($curl); curl_close($curl); Session::put('request', $request->all()); Session::put('success_url', $_success_url); Session::put('cancel_url', $_cancel_url); if ($this->sandbox == 1) { return redirect($payment['sandbox_init_point']); } else { return redirect($payment['init_point']); } } public function curlCalls($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $paymentData = curl_exec($ch); curl_close($ch); return $paymentData; } public function paycancle() { return redirect()->back()->with('error', 'Payment Cancelled.'); } public function payreturn() { if (Session::has('tempcart')) { $oldCart = Session::get('tempcart'); $tempcart = new Cart($oldCart); $order = Session::get('temporder'); } else { $tempcart = ''; return redirect()->back(); } return view('front.success', compact('tempcart', 'order')); } public function successPayment(Request $request) { $requestData = Session::get('request'); $bs = Basic::first(); //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $success_url = Session::get('success_url'); $cancel_url = Session::get('cancel_url'); $paymentUrl = "https://api.mercadopago.com/v1/payments/" . $request['payment_id'] . "?access_token=" . $this->access_token; $paymentData = $this->curlCalls($paymentUrl); $payment = json_decode($paymentData, true); if ($payment['status'] == 'approved') { $paymentFor = Session::get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($payment); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Mercado Pago", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', __('successful_payment')); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } return redirect($cancel_url); } public function cancelPayment() { $requestData = Session::get('request'); $paymentFor = Session::get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } Http/Controllers/Payment/PerfectMoneyController.php 0000644 00000020327 15213350434 0016567 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Models\Package; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Session; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class PerfectMoneyController extends Controller { public function paymentProcess($request, $_amount, $_success_url, $_cancel_url) { Session::put('request', $request->all()); $paymentMethod = OnlineGateway::where('keyword', 'perfect_money')->first(); $paydata = json_decode($paymentMethod->information, true); $randomNo = substr(uniqid(), 0, 8); $bs = Basic::select('base_currency_text', 'base_currency_rate', 'website_title')->first(); $val['PAYEE_ACCOUNT'] = $paydata['perfect_money_wallet_id'];; $val['PAYEE_NAME'] = $bs->website_title; $val['PAYMENT_ID'] = "$randomNo"; //random id $val['PAYMENT_AMOUNT'] = $_amount; $val['PAYMENT_UNITS'] = "$bs->base_currency_text"; $val['STATUS_URL'] = $_success_url; $val['PAYMENT_URL'] = $_success_url; $val['PAYMENT_URL_METHOD'] = 'GET'; $val['NOPAYMENT_URL'] = $_cancel_url; $val['NOPAYMENT_URL_METHOD'] = 'GET'; $val['SUGGESTED_MEMO'] = "$request->email"; $val['BAGGAGE_FIELDS'] = 'IDENT'; $data['val'] = $val; $data['method'] = 'post'; $data['website_title'] = $bs->website_title; $data['url'] = 'https://perfectmoney.com/api/step1.asp'; Session::put('payment_id', $randomNo); Session::put('amount', $_amount); return view('payments.perfect-money')->with('data', $data); } public function successPayment(Request $request) { $requestData = Session::get('request'); $amo = $request['PAYMENT_AMOUNT']; $track = $request['PAYMENT_ID']; $id = Session::get('payment_id'); $final_amount = Session::get('amount'); $paymentMethod = OnlineGateway::where('keyword', 'perfect_money')->first(); $perfectMoneyInfo = json_decode($paymentMethod->information, true); $bs = Basic::select('base_currency_text', 'base_currency_rate', 'website_title')->first(); if ($request->PAYEE_ACCOUNT == $perfectMoneyInfo['perfect_money_wallet_id'] && $track == $id && $amo == round($final_amount, 2)) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = session()->get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); $transaction_details = NULL; if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } } else { $requestData = session()->get('request'); $paymentFor = session()->get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => session()->get('request')['package_id']])->withInput(session()->get('request')); } } Http/Controllers/Payment/XenditController.php 0000644 00000017760 15213350434 0015431 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Models\Package; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Http; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class XenditController extends Controller { public function paymentProcess($request, $_amount, $_success_url, $_cancel_url, $bs) { $paymentMethod = OnlineGateway::where('keyword', 'xendit')->first(); $paydata = json_decode($paymentMethod->information, true); $external_id = \Str::random(10); $secret_key = 'Basic ' . base64_encode($paydata['secret_key'] . ':'); $data_request = Http::withHeaders([ 'Authorization' => $secret_key ])->post('https://api.xendit.co/v2/invoices', [ 'external_id' => $external_id, 'amount' => $_amount, 'currency' => $bs->base_currency_text, 'success_redirect_url' => $_success_url ]); $response = $data_request->json(); if (isset($response['error_code']) && isset($response['message'])) { session()->flash('warning', $response['message']); return redirect()->back(); } session()->put("request", $request->all()); if (!empty($response['invoice_url'])) { session()->put('cancel_url', $_cancel_url); session()->put('xendit_id', $response['id']); session()->put('secret_key', $secret_key); return redirect($response['invoice_url']); } else { return redirect($_cancel_url); } } public function successPayment(Request $request) { $requestData = session()->get('request'); $xendit_id = session()->get('xendit_id'); $secret_key = session()->get('secret_key'); $paymentMethod = OnlineGateway::where('keyword', 'xendit')->first(); $paydata = json_decode($paymentMethod->information, true); $p_secret_key = 'Basic ' . base64_encode($paydata['secret_key'] . ':'); $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); if (!is_null($xendit_id) && $secret_key == $p_secret_key) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = session()->get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($request['trxref']); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } } else { $requestData = session()->get('request'); $paymentFor = session()->get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => session()->get('request')['package_id']])->withInput(session()->get('request')); } } Http/Controllers/Payment/IyzicoController.php 0000644 00000013040 15213350434 0015427 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Models\Vendor; use Illuminate\Http\Request; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class IyzicoController extends Controller { public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url, $_title, $bex) { //get vendor details for iyzico payment configuration $name = Vendor::where('id', $request->vendor_id)->value('username'); $email = $request->email; $address = $request->address; $city = $request->city; $country = $request->country; $phone = $request->phone; $identity_number = $request->identity_number; $zip_code = $request->zip_code; $paymentMethod = OnlineGateway::where('keyword', 'iyzico')->first(); $paydata = json_decode($paymentMethod->information, true); $options = new \Iyzipay\Options(); $options->setApiKey($paydata['api_key']); $options->setSecretKey($paydata['secret_key']); $basket_id = 'B' . uniqid(999, 99999); $paydata['sandbox_status'] == 1 ? $options->setBaseUrl("https://sandbox-api.iyzipay.com") : $options->setBaseUrl("https://api.iyzipay.com"); $conversion_id = uniqid(9999, 999999); # create request class $iyzipay_request = new \Iyzipay\Request\CreatePayWithIyzicoInitializeRequest(); $iyzipay_request->setLocale(\Iyzipay\Model\Locale::EN); $iyzipay_request->setConversationId($conversion_id); $iyzipay_request->setPrice($_amount); $iyzipay_request->setPaidPrice($_amount); $iyzipay_request->setCurrency(\Iyzipay\Model\Currency::TL); $iyzipay_request->setBasketId($basket_id); $iyzipay_request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT); $iyzipay_request->setCallbackUrl($_success_url); $iyzipay_request->setEnabledInstallments(array(2, 3, 6, 9)); $buyer = new \Iyzipay\Model\Buyer(); $buyer->setId(uniqid()); $buyer->setName($name); $buyer->setSurname($name); $buyer->setGsmNumber($phone); $buyer->setEmail($email); $buyer->setIdentityNumber($identity_number); $buyer->setLastLoginDate(""); $buyer->setRegistrationDate(""); $buyer->setRegistrationAddress($address); $buyer->setIp(""); $buyer->setCity($city); $buyer->setCountry($country); $buyer->setZipCode($zip_code); $iyzipay_request->setBuyer($buyer); $shippingAddress = new \Iyzipay\Model\Address(); $shippingAddress->setContactName($name); $shippingAddress->setCity($city); $shippingAddress->setCountry($country); $shippingAddress->setAddress($address); $shippingAddress->setZipCode($zip_code); $iyzipay_request->setShippingAddress($shippingAddress); $billingAddress = new \Iyzipay\Model\Address(); $billingAddress->setContactName($name); $billingAddress->setCity($city); $billingAddress->setCountry($country); $billingAddress->setAddress($address); $billingAddress->setZipCode($zip_code); $iyzipay_request->setBillingAddress($billingAddress); $q_id = uniqid(999, 99999); $basketItems = array(); $firstBasketItem = new \Iyzipay\Model\BasketItem(); $firstBasketItem->setId($q_id); $firstBasketItem->setName("Purchase Id " . $q_id); $firstBasketItem->setCategory1("Purchase or Booking"); $firstBasketItem->setCategory2(""); $firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL); $firstBasketItem->setPrice($_amount); $basketItems[0] = $firstBasketItem; $iyzipay_request->setBasketItems($basketItems); # make request $payWithIyzicoInitialize = \Iyzipay\Model\PayWithIyzicoInitialize::create($iyzipay_request, $options); $paymentResponse = (array)$payWithIyzicoInitialize; foreach ($paymentResponse as $key => $data) { $paymentInfo = json_decode($data, true); if ($paymentInfo['status'] == 'success') { if (!empty($paymentInfo['payWithIyzicoPageUrl'])) { session()->put('conversation_id', $conversion_id); session()->put('request', $request->all()); return redirect($paymentInfo['payWithIyzicoPageUrl']); } } return redirect($_cancel_url); } } public function successPayment() { $paymentFor = session()->get('paymentFor'); $requestData = session()->get('request'); $requestData['conversation_id'] = session()->get('conversation_id'); $requestData['status'] = 0; $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = "online"; $amount = $requestData['price']; $password = $paymentFor == 'membership' ? ($requestData['password'] ?? null) : uniqid('qrcode'); $checkout = new VendorCheckoutController(); $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); session()->forget(['request', 'paymentFor']); return redirect()->route('success.page'); } public function cancelPayment() { $requestData = session()->get('request'); $paymentFor = session()->get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } Http/Controllers/Payment/InstamojoController.php 0000644 00000021330 15213350434 0016125 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Models\Package; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Controllers\Vendor\VendorCheckoutController; use App\Http\Helpers\Instamojo; use App\Http\Helpers\MegaMailer; use App\Http\Helpers\VendorPermissionHelper; use App\Models\BasicSettings\Basic; use PHPMailer\PHPMailer\Exception; use App\Models\Language; use App\Models\Membership; use App\Models\PaymentGateway\OnlineGateway; use Carbon\Carbon; use Illuminate\Support\Facades\Session; class InstamojoController extends Controller { public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url, $_title, $bex) { $data = OnlineGateway::whereKeyword('instamojo')->first(); $paydata = $data->convertAutoData(); $cancel_url = $_cancel_url; $notify_url = $_success_url; if ($paydata['sandbox_status'] == 1) { $api = new Instamojo($paydata['key'], $paydata['token'], 'https://test.instamojo.com/api/1.1/'); } else { $api = new Instamojo($paydata['key'], $paydata['token']); } try { $response = $api->paymentRequestCreate(array( "purpose" => $_title, "amount" => $_amount, "send_email" => false, "email" => null, "redirect_url" => $notify_url )); $redirect_url = $response['longurl']; Session::put("request", $request->all()); Session::put('payment_id', $response['id']); Session::put('success_url', $notify_url); Session::put('cancel_url', $cancel_url); return redirect($redirect_url); } catch (Exception $e) { return redirect($cancel_url)->with('error', 'Error: ' . $e->getMessage()); } } public function successPayment(Request $request) { $requestData = Session::get('request'); if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $bs = Basic::first(); $success_url = Session::get('success_url'); $cancel_url = Session::get('cancel_url'); /** Get the payment ID before session clear **/ $payment_id = Session::get('payment_id'); if ($request['payment_request_id'] == $payment_id) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = Session::get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($request['payment_request_id']); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } return redirect($cancel_url); } public function cancelPayment() { $requestData = Session::get('request'); $paymentFor = Session::get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } Http/Controllers/Payment/PaypalController.php 0000644 00000023533 15213350434 0015417 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use Auth; use Carbon\Carbon; use PayPal\Api\Item; use PayPal\Api\Payer; use PayPal\Api\Amount; use App\Models\Package; use PayPal\Api\Payment; use PayPal\Api\ItemList; use App\Models\Membership; use PayPal\Api\Transaction; use PayPal\Rest\ApiContext; use Illuminate\Http\Request; use PayPal\Api\RedirectUrls; use App\Http\Helpers\MegaMailer; use PayPal\Api\PaymentExecution; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use PayPal\Auth\OAuthTokenCredential; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Redirect; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class PaypalController extends Controller { private $_api_context; public function __construct() { $data = OnlineGateway::where('keyword', 'paypal')->first(); $paydata = $data->convertAutoData(); $paypal_conf = Config::get('paypal'); $paypal_conf['client_id'] = $paydata['client_id']; $paypal_conf['secret'] = $paydata['client_secret']; $paypal_conf['settings']['mode'] = $paydata['sandbox_status'] == 1 ? 'sandbox' : 'live'; $this->_api_context = new ApiContext( new OAuthTokenCredential( $paypal_conf['client_id'], $paypal_conf['secret'] ) ); $this->_api_context->setConfig($paypal_conf['settings']); } public function paymentProcess(Request $request, $_amount, $_title, $_success_url, $_cancel_url) { $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); // changing the currency before redirect to PayPal if ($bs->base_currency_text !== 'USD') { $rate = floatval($bs->base_currency_rate); $convertedTotal = $_amount / $rate; } $paypalTotal = $bs->base_currency_text === 'USD' ? $_amount : $convertedTotal; $title = $_title; $price = round($paypalTotal, 2); $cancel_url = $_cancel_url; $success_url = $_success_url; $payer = new Payer(); $payer->setPaymentMethod('paypal'); $item_1 = new Item(); $item_1->setName($title) /** item name **/ ->setCurrency("USD") ->setQuantity(1) ->setPrice($price); /** unit price **/ $item_list = new ItemList(); $item_list->setItems(array($item_1)); $amount = new Amount(); $amount->setCurrency("USD") ->setTotal($price); $transaction = new Transaction(); $transaction->setAmount($amount) ->setItemList($item_list) ->setDescription($title . ' Via Paypal'); $redirect_urls = new RedirectUrls(); $redirect_urls->setReturnUrl($success_url) /** Specify return URL **/ ->setCancelUrl($cancel_url); $payment = new Payment(); $payment->setIntent('Sale') ->setPayer($payer) ->setRedirectUrls($redirect_urls) ->setTransactions(array($transaction)); try { $payment->create($this->_api_context); } catch (\Exception $ex) { return redirect($cancel_url)->with('error', $ex->getMessage()); } foreach ($payment->getLinks() as $link) { if ($link->getRel() == 'approval_url') { $redirect_url = $link->getHref(); break; } } Session::put('request', $request->all()); Session::put('amount', $_amount); Session::put('paypal_payment_id', $payment->getId()); if (isset($redirect_url)) { /** redirect to paypal **/ return Redirect::away($redirect_url); } return redirect()->back()->with('error', 'Unknown error occurred'); } public function successPayment(Request $request) { $requestData = Session::get('request'); $bs = Basic::first(); /** Get the payment ID before session clear **/ $payment_id = Session::get('paypal_payment_id'); /** clear the session payment ID **/ $cancel_url = route('membership.paypal.cancel'); if (empty($request['PayerID']) || empty($request['token'])) { return redirect($cancel_url); } $payment = Payment::get($payment_id, $this->_api_context); $execution = new PaymentExecution(); $execution->setPayerId($request['PayerID']); /**Execute the payment **/ $result = $payment->execute($execution, $this->_api_context); if ($result->getState() == 'approved') { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = Session::get('paymentFor'); $response = json_decode($payment, true); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = $payment; if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } return redirect($cancel_url); } public function cancelPayment() { $requestData = Session::get('request'); $paymentFor = Session::get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } Http/Controllers/Payment/YocoController.php 0000644 00000017334 15213350434 0015104 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use App\Models\Package; use App\Models\Membership; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\VendorCheckoutController; class YocoController extends Controller { public function paymentProcess($request, $_amount, $_success_url, $_cancel_url) { $paymentMethod = OnlineGateway::where('keyword', 'yoco')->first(); $paydata = json_decode($paymentMethod->information, true); $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $paydata['secret_key'], ])->post('https://payments.yoco.com/api/checkouts', [ 'amount' => $_amount * 100, 'currency' => 'ZAR', 'successUrl' => $_success_url, 'cancelUrl' => $_cancel_url ]); Session::put('request', $request->all()); $responseData = $response->json(); if (array_key_exists('redirectUrl', $responseData)) { Session::put('yoco_id', $responseData['id']); Session::put('s_key', $paydata['secret_key']); Session::put('amount', $_amount); //redirect for received payment from user return redirect($responseData["redirectUrl"]); } else { return redirect($_cancel_url); } } public function successPayment(Request $request) { $requestData = Session::get('request'); $id = Session::get('yoco_id'); $s_key = Session::get('s_key'); $paymentMethod = OnlineGateway::where('keyword', 'yoco')->first(); $paydata = $paymentMethod->convertAutoData(); $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); if ($id && $paydata['secret_key'] == $s_key) { //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $requestData['vendor_id'], 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $requestData['price'], 'after_balance' => $after_balance, 'admin_profit' => $requestData['price'], 'payment_method' => $requestData['payment_method'], 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = session()->get('paymentFor'); $package = Package::find($requestData['package_id']); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($request['trxref']); if ($paymentFor == "membership") { $amount = $requestData['price']; $password = $requestData['password']; $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $vendor->memberships()->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "membership", $vendor, $password, $amount, "Paypal", $requestData['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $requestData['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $vendor = $checkout->store($requestData, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = Membership::where('vendor_id', $vendor->id)->orderBy('id', 'DESC')->first(); $activation = \Carbon\Carbon::parse($lastMemb->start_date); $expire = \Carbon\Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($requestData, "extend", $vendor, $password, $amount, $requestData["payment_method"], $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => \Carbon\Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->forget('request'); session()->forget('paymentFor'); return redirect()->route('success.page'); } } else { $requestData = session()->get('request'); $paymentFor = session()->get('paymentFor'); session()->flash('warning', __('cancel_payment')); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('vendor.plan.extend.checkout', ['package_id' => session()->get('request')['package_id']])->withInput(session()->get('request')); } } Http/Controllers/Payment/StripeController.php 0000644 00000020374 15213350434 0015437 0 ustar 00 <?php namespace App\Http\Controllers\Payment; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Controllers\Vendor\VendorCheckoutController; use App\Http\Helpers\MegaMailer; use App\Http\Helpers\VendorPermissionHelper; use App\Models\BasicSettings\Basic; use App\Models\Package; use PHPMailer\PHPMailer\Exception; use Cartalyst\Stripe\Laravel\Facades\Stripe; use App\Models\PaymentGateway\OnlineGateway; use App\Models\VendorInfo; use Carbon\Carbon; use Config; use Session; class StripeController extends Controller { public function __construct() { //Set Spripe Keys $stripe = OnlineGateway::where('keyword', 'stripe')->first(); $stripeConf = json_decode($stripe->information, true); Config::set('services.stripe.key', $stripeConf["key"]); Config::set('services.stripe.secret', $stripeConf["secret"]); } public function paymentProcess(Request $request, $_amount, $_title, $_success_url, $_cancel_url) { $bs = Basic::select('base_currency_text', 'base_currency_rate')->first(); // changing the currency before redirect to Stripe if ($bs->base_currency_text !== 'USD') { $rate = floatval($bs->base_currency_rate); $convertedTotal = round(($_amount / $rate), 2); } $stripeTotal = $bs->base_currency_text === 'USD' ? $_amount : $convertedTotal; $title = $_title; $price = $stripeTotal; $price = round($price, 2); $cancel_url = $_cancel_url; Session::put('request', $request->all()); $stripe = Stripe::make(Config::get('services.stripe.secret')); try { $token = $request->stripeToken; if (!isset($token)) { return back()->with('error', 'Token Problem With Your Token.'); } $vendorInfo = VendorInfo::where('vendor_id', $request->vendor_id)->first(); $charge = $stripe->charges()->create([ 'source' => $token, 'currency' => "USD", 'amount' => $price, 'description' => $title, 'receipt_email' => $request->email, 'metadata' => [ 'customer_name' => $vendorInfo != null ? $vendorInfo->name : '', ] ]); if ($charge['status'] == 'succeeded') { $bs = Basic::first(); //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $request->vendor_id, 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $request->price, 'after_balance' => $after_balance, 'admin_profit' => $request->price, 'payment_method' => 'Stripe', 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $paymentFor = Session::get('paymentFor'); $package = Package::find($request->package_id); $transaction_id = VendorPermissionHelper::uniqidReal(8); $transaction_details = json_encode($charge); if ($paymentFor == "membership") { $amount = $request->price; $password = $request->password; $checkout = new VendorCheckoutController(); $user = $checkout->store($request, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($request, "membership", $user, $password, $amount, "Stripe", $request['phone'], $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'discount' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->discount . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'total' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $lastMemb->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'registrationWithPremiumPackage' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', __('successful_payment')); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($paymentFor == "extend") { $amount = $request['price']; $password = uniqid('qrcode'); $checkout = new VendorCheckoutController(); $user = $checkout->store($request, $transaction_id, $transaction_details, $amount, $bs, $password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($request, "extend", $user, $password, $amount, $request["payment_method"], $user->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'package_purchase', 'type' => 'membershipExtend' ]; $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $file_name)); session()->flash('success', 'Your payment has been completed.'); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } } } catch (Exception $e) { return redirect($cancel_url)->with('error', $e->getMessage()); } catch (\Cartalyst\Stripe\Exception\CardErrorException $e) { return redirect($cancel_url)->with('error', $e->getMessage()); } catch (\Cartalyst\Stripe\Exception\MissingParameterException $e) { return redirect($cancel_url)->with('error', $e->getMessage()); } return redirect($cancel_url)->with('error', 'Please Enter Valid Credit Card Informations.'); } public function cancelPayment() { $requestData = Session::get('request'); $paymentFor = Session::get('paymentFor'); session()->flash('error', 'Payment has been canceled'); if ($paymentFor == "membership") { return redirect()->route('front.register.view', ['status' => $requestData['package_type'], 'id' => $requestData['package_id']])->withInput($requestData); } else { return redirect()->route('vendor.plan.extend.checkout', ['package_id' => $requestData['package_id']])->withInput($requestData); } } } Http/Controllers/Controller.php 0000644 00000005731 15213350434 0012633 0 ustar 00 <?php namespace App\Http\Controllers; use PDF; use Mail; use Config; use Illuminate\Mail\Message; use App\Models\BasicSettings\Basic; use Illuminate\Support\Facades\Session; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; public function getCurrencyInfo() { $baseCurrencyInfo = Basic::select('base_currency_symbol', 'base_currency_symbol_position', 'base_currency_text', 'base_currency_text_position', 'base_currency_rate') ->firstOrFail(); return $baseCurrencyInfo; } public function makeInvoice($request, $key, $member, $password, $amount, $payment_method, $phone, $base_currency_symbol_position, $base_currency_symbol, $base_currency_text, $order_id, $package_title, $membership) { $file_name = uniqid($key) . ".pdf"; $pdf = PDF::loadView('pdf.membership', compact('request', 'member', 'password', 'amount', 'payment_method', 'phone', 'base_currency_symbol_position', 'base_currency_symbol', 'base_currency_text', 'order_id', 'package_title', 'membership')); $output = $pdf->output(); @mkdir(public_path('assets/front/invoices/'), 0775, true); file_put_contents(public_path('assets/front/invoices/') . $file_name, $output); return $file_name; } public function sendMailWithPhpMailer($request, $file_name, $bs, $subject, $body, $email, $name) { //larave facade mail if ($bs->smtp_status == 1) { try { $smtp = [ 'transport' => 'smtp', 'host' => $bs->smtp_host, 'port' => $bs->smtp_port, 'encryption' => $bs->encryption, 'username' => $bs->smtp_username, 'password' => $bs->smtp_password, 'timeout' => null, 'auth_mode' => null, ]; Config::set('mail.mailers.smtp', $smtp); } catch (\Exception $e) { session()->flash('error', $e->getMessage()); return back(); } } $data = [ 'to' => $email, 'subject' => $subject, 'body' => $body, 'file_name' => public_path('assets/front/invoices/') . $file_name, ]; try { if ($bs->smtp_status == 1) { Mail::send([], [], function (Message $message) use ($data, $bs) { $fromMail = $bs->from_mail; $fromName = $bs->from_name; $message->to($data['to']) ->subject($data['subject']) ->from($fromMail, $fromName) ->html($data['body'], 'text/html'); $message->attach($data['file_name'], [ 'as' => 'Attachment', 'mime' => 'application/pdf', ]); }); } return; } catch (\Exception $e) { Session::flash('error', __('Something went wrong.')); return back(); } //larave facade mail end } public function currentLang() {} } Http/Controllers/MyFatoorahController.php 0000644 00000010115 15213350434 0014615 0 ustar 00 <?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use App\Http\Controllers\Payment\MyFatoorahController as MembershipMyFatoorahController; use App\Http\Controllers\User\Payment\ShopMyFatoorahController; use App\Http\Controllers\User\CourseManagement\Payment\MyFatoorahController as CourseMyFatoorahController; use App\Http\Controllers\User\DonationManagement\Payment\MyFatoorahController as DonationMyFatoorahController; use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Config; class MyFatoorahController extends Controller { public function callback(Request $request) { $type = Session::get('myfatoorah_payment_type'); if ($type == 'buy_plan') { $data = new MembershipMyFatoorahController(); $data = $data->successPayment($request); Session::forget('myfatoorah_payment_type'); if ($data['status'] == 'success') { return redirect()->route('success.page'); } else { $cancel_url = Session::get('cancel_url'); return redirect($cancel_url); } } elseif ($type == 'shop_room') { try { $data = new ShopMyFatoorahController(); $data = $data->successPayment($request); Session::forget('myfatoorah_payment_type'); $success_url = Session::get('myfatoorah_success_url'); Session::forget('myfatoorah_cancel_url'); Session::forget('myfatoorah_success_url'); Session::forget('myfatoorah_payment_type'); Session::forget('user_midtrans'); return redirect($success_url); } catch (\Exception $th) { $cancel_url = Session::get('myfatoorah_success_url'); Session::forget('myfatoorah_cancel_url'); Session::forget('myfatoorah_success_url'); Session::forget('myfatoorah_payment_type'); Session::forget('user_midtrans'); return redirect($cancel_url); } } elseif ($type == 'course') { try { $data = new CourseMyFatoorahController(); $data = $data->successPayment($request); Session::forget('myfatoorah_payment_type'); $success_url = Session::get('myfatoorah_success_url'); Session::forget('myfatoorah_cancel_url'); Session::forget('myfatoorah_success_url'); Session::forget('myfatoorah_payment_type'); Session::forget('user_midtrans'); return redirect($success_url); } catch (\Exception $th) { $cancel_url = Session::get('myfatoorah_success_url'); Session::forget('myfatoorah_cancel_url'); Session::forget('myfatoorah_success_url'); Session::forget('myfatoorah_payment_type'); Session::forget('user_midtrans'); return redirect($cancel_url); } } elseif ($type == 'donation') { try { $data = new DonationMyFatoorahController(); $data = $data->successPayment($request); Session::forget('myfatoorah_payment_type'); $success_url = Session::get('myfatoorah_success_url'); Session::forget('myfatoorah_cancel_url'); Session::forget('myfatoorah_success_url'); Session::forget('myfatoorah_payment_type'); Session::forget('user_midtrans'); return redirect($success_url); } catch (\Exception $th) { $cancel_url = Session::get('myfatoorah_success_url'); Session::forget('myfatoorah_cancel_url'); Session::forget('myfatoorah_success_url'); Session::forget('myfatoorah_payment_type'); Session::forget('user_midtrans'); return redirect($cancel_url); } } } public function cancel() { return 'cancel'; } } Http/Controllers/Front/ItemController.php 0000644 00000034006 15213350434 0014537 0 ustar 00 <?php namespace App\Http\Controllers\Front; use Academe\AuthorizeNet\Request\Model\Customer; use Carbon\Carbon; use Illuminate\Http\Request; use App\Models\User\Language; use App\Models\User\UserItem; use App\Models\User\UserCoupon; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Models\User\UserItemContent; use App\Models\User\UserShopSetting; use Illuminate\Support\Facades\Auth; use App\Models\User\CustomerWishList; use App\Models\User\UserOfflineGateway; use App\Models\User\UserPaymentGeteway; use App\Models\User\UserShippingCharge; use Illuminate\Support\Facades\Session; class ItemController extends Controller { public function __construct() { $this->middleware('auth:customer')->except('addToCart', 'cart', 'addToWishlist', 'cartitemremove', 'updatecart', 'checkout'); } public function addToCart($domain, $id) { $keywords = getUserKeywords(); $user = getUser(); if (session()->has('user_lang')) { $userCurrentLang = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); } $cart = Session::get('cart'); // $cart = Session::forget('cart'); // $cart = Session::put('cart', null); $data = explode(',,,', $id); $id = (int)$data[0]; $qty = (int)$data[1]; $total = (float)$data[2]; $product_price = (float)$data[4]; $variant = json_decode($data[3], true); $item = UserItem::findOrFail($id); // validations $item_content = UserItemContent::where('item_id', $id)->where('language_id', $userCurrentLang->id)->first(); if ($qty < 1) { return response()->json(['error' => $keywords['quantity_min_error'] ?? __('Quantity should be minimum 1') . '.']); } $pvariant = $item->itemVariations()->where('language_id', $userCurrentLang->id)->get(); if (count($pvariant) == 0) { $stock = false; } else { $stock = true; } if ($item->type == 'physical' && $stock == false && empty($item->stock)) { return response()->json(['error' => $keywords['stock_out_error'] ?? __('Stock Out') . '.']); } if (count($pvariant) > 0 && (count($variant) != count($pvariant))) { return response()->json(['error' => $keywords['variation_empty_error'] ?? __('You can not leave any variation empty. Please Select variation') . '.']); } if (!$item) { abort(404); } $ckey = uniqid(); $successMessage = $keywords['cart_add_success'] ?? __('Item added to cart successfully!') . '.'; // if cart is empty then this the first product if (empty($cart)) { $cart = [ $ckey => [ "id" => $id, "name" => $item_content->title, "qty" => (int)$qty, "variations" => $variant, "product_price" => $product_price, "original_price" => (float)$item->current_price, "total" => $total, "slug" => $item_content->slug ] ]; Session::put('cart', $cart); return response()->json(['message' => $successMessage]); } // if cart not empty then check if this product (with same variation) exist then increment quantity foreach ($cart as $key => $cartItem) { if ($cartItem["id"] == $id && $variant == $cartItem["variations"]) { $cart[$key]['qty'] = (int)$cart[$key]['qty'] + $qty; $cart[$key]['total'] = (float)$cart[$key]['total'] + $total; Session::put('cart', $cart); return response()->json(['message' => $successMessage]); } } // if item not exist in cart then add to cart with quantity = 1 $cart[$ckey] = [ "id" => $id, "name" => $item_content->title, "qty" => (int)$qty, "variations" => $variant, "product_price" => $product_price, "original_price" => (float)$item->current_price, "total" => $total, "slug" => $item_content->slug ]; Session::put('cart', $cart); return response()->json(['message' => $successMessage]); } public function addToWishlist($domain, $id) { $keywords = getUserKeywords(); if (!Auth::guard('customer')->check()) { return response()->json(['error' => $keywords['please_login_first'] ?? __('Please login first!')]); } $user = getUser(); $wishlist = CustomerWishList::where('customer_id', Auth::guard('customer')->user()->id)->where('item_id', $id)->first(); $data = explode(',,,', $id); $id = (int)$data[0]; // if wishlist is empty then this the first Item for this user if (!$wishlist) { CustomerWishList::create([ 'customer_id' => Auth::guard('customer')->user()->id, 'item_id' => $id, ]); return response()->json(['message' => $keywords['item_added_to_wishlist'] ?? __('Item added to wishlist successfully')]); } else { $wishlist->delete(); return response()->json(['message' => $keywords['item_removed_from_wishlist'] ?? __('Item removed from wishlist successfully')]); } } public function cart($domain) { $user = getUser(); $userShop = UserShopSetting::where('user_id', $user->id)->first(); if (!empty($userShop) && ($userShop->is_shop == 0 || $userShop->catalog_mode == 1)) { return redirect()->route('front.user.detail.view', getParam()); } if (session()->has('user_lang')) { $userCurrentLang = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); } if (Session::has('cart')) { $data['cart'] = Session::get('cart'); } else { $data['cart'] = null; } $userBs = BasicSetting::where('user_id', $user->id)->first(); $version = $userBs->theme_version; if ($version == 'dark') { $version = 'default'; } $data['version'] = $version; return view('user-front.cart', $data); } public function cartitemremove($doamin, $uid) { if ($uid) { $keywords = getUserKeywords(); $cart = Session::get('cart'); if (isset($cart[$uid])) { unset($cart[$uid]); Session::put('cart', $cart); } $total = 0; $count = 0; foreach ($cart as $i) { $total += $i['product_price'] * $i['qty']; $count += $i['qty']; } $total = round($total, 2); $message = $keywords['item_removed_successfully'] ?? __('Item removed successfully.') . '.'; return response()->json([ 'message' => $message, 'count' => $count, 'total' => $total ]); } } public function updatecart(Request $request) { $keywords = getUserKeywords(); $cart = Session::get('cart'); $qtys = $request->qty; $i = 0; foreach ($cart as $cartKey => $cartItem) { $total = 0; $cart[$cartKey]["qty"] = (int)$qtys[$i]; // calculate total if (is_array($cartItem["variations"])) { foreach ($cartItem["variations"] as $key => $variant) { $total += (float)$variant["price"]; } } $total += (float)$cartItem["product_price"]; $total = $total * $qtys[$i]; // save total in the cart item $cart[$cartKey]["total"] = $total; $i++; } Session::put('cart', $cart); $message = $keywords['cart_update_success'] ?? __('Cart updated successfully.') . '.'; return response()->json(['message' => $message]); } public function checkout($doamin, Request $request) { $keywords = getUserKeywords(); $user = getUser(); $userShop = UserShopSetting::where('user_id', $user->id)->first(); if (!empty($userShop) && ($userShop->is_shop == 0 || $userShop->catalog_mode == 1)) { return redirect()->route('front.user.detail.view', getParam()); } if (!Auth::guard('customer')->check()) { Session::put('link', route('front.user.checkout', getParam())); return redirect(route('customer.login', getParam(), ['redirected' => 'checkout'])); } if (!Session::get('cart')) { $errorMessage = $keywords['cart_empty_error'] ?? __('Your cart is empty.') . '.'; Session::flash('error', $errorMessage); return back(); } if (session()->has('user_lang')) { $userCurrentLang = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); } if (Session::has('cart')) { $data['cart'] = Session::get('cart'); } else { $data['cart'] = null; } $data['shippings'] = UserShippingCharge::where('user_id', $user->id)->where('language_id', $userCurrentLang->id)->get(); $data['offlines'] = UserOfflineGateway::where('user_id', $user->id)->where('item_checkout_status', 1)->where('user_id', $user->id)->get(); $data['payment_gateways'] = UserPaymentGeteway::where('user_id', $user->id)->where('status', 1)->get(); $data['discount'] = session()->has('user_coupon') && !empty(session()->get('user_coupon')) ? session()->get('user_coupon') : 0; // determining the theme version selected $userBs = BasicSetting::where('user_id', $user->id)->first(); $version = $userBs->theme_version; if ($version == 'dark') { $version = 'default'; } $data['version'] = $version; $stripe = UserPaymentGeteway::where('keyword', 'stripe')->where([['status', 1], ['user_id', $user->id]])->first(); if ($stripe) { $stripe_info = json_decode($stripe->information, true); $data['stripe_key'] = $stripe_info['key']; } else { $stripe_info = []; $data['stripe_key'] = ''; } return view('user-front.checkout', $data); } public function coupon(Request $request) { $keywords = getUserKeywords(); $user = getUser(); $coupon = UserCoupon::where('code', $request->coupon)->where('user_id', $user->id); $userBs = BasicSetting::where('user_id', $user->id)->first(); if ($coupon->count() == 0) { return response()->json([ 'status' => 'error', 'message' => $keywords['coupon_not_valid'] ?? __('Coupon is not valid.') . '.' ]); } else { $coupon = $coupon->first(); if (cartTotal() < $coupon->minimum_spend) { $message = $keywords['coupon_minimum_spend_error'] ?? __('Cart total must be minimum {minimum_spend} {currency}.'); $message = str_replace( ['{minimum_spend}', '{currency}'], [$coupon->minimum_spend, $userBs->base_currency_text], $message ); return response()->json([ 'status' => 'error', 'message' => $message ]); } $start = Carbon::parse($coupon->start_date); $end = Carbon::parse($coupon->end_date); $today = Carbon::now(); // return response()->json($today->greaterThanOrEqualTo($start)); // if coupon is active if ($today->greaterThanOrEqualTo($start) && $today->lessThan($end)) { $cartTotal = cartTotal(); $value = $coupon->value; $type = $coupon->type; if ($type == 'fixed') { if ($value > cartTotal()) { return response()->json([ 'status' => 'error', 'message' => $keywords['coupon_discount_greater_than_cart'] ?? __('Coupon discount is greater than cart total.') . '.' ]); } $couponAmount = $value; } else { $couponAmount = ($cartTotal * $value) / 100; } session()->put('user_coupon', round($couponAmount, 2)); return response()->json([ 'status' => 'success', 'message' => $keywords['coupon_applied_success'] ?? __('Coupon applied successfully.') . '.' ]); } else { return response()->json([ 'status' => 'error', 'message' => $keywords['coupon_not_valid'] ?? __('Coupon is not valid.') . '.' ]); } } } } Http/Controllers/Front/RoomController.php 0000644 00000045522 15213350434 0014562 0 ustar 00 <?php namespace App\Http\Controllers\Front; use App\Http\Controllers\Controller; use App\Models\User\BasicSetting; use App\Models\User\HotelBooking\Coupon; use App\Models\User\HotelBooking\Room; use App\Models\User\HotelBooking\RoomAmenity; use App\Models\User\HotelBooking\RoomBooking; use App\Models\User\HotelBooking\RoomCategory; use App\Models\User\HotelBooking\RoomContent; use App\Models\User\HotelBooking\RoomReview; use App\Models\User\Language; use App\Models\User\UserOfflineGateway; use App\Models\User\UserPaymentGeteway; use Carbon\CarbonPeriod; use Exception; use Illuminate\Http\Request; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Validator; class RoomController extends Controller { public function rooms($username, Request $request) { $user = getUser(); $queryResult['roomRating'] = DB::table('user_room_settings')->select('room_rating_status')->first(); if (session()->has('user_lang')) { $userCurrentLang = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); } $bs = BasicSetting::where('user_id', $user->id)->select('base_currency_symbol')->first(); $num_of_bed = $num_of_bath = $num_of_guests = $min_rent = $max_rent = null; $roomIds = []; $dates = []; if ($request->filled('dates')) { $dateArray = explode(' ', $request->dates); $date1 = $dateArray[0]; $date2 = $dateArray[2]; $dates = $this->displayDates($date1, $date2); $rooms = Room::where('user_id', $user->id)->get(); foreach ($rooms as $key => $room) { foreach ($dates as $key => $date) { $cDate = Carbon::parse($date); $count = RoomBooking::whereDate('arrival_date', '<=', $cDate)->whereDate('departure_date', '>', $cDate)->where('room_id', $room->id)->count(); if ($count >= $room->quantity) { if (!in_array($room->id, $roomIds)) { $roomIds[] = $room->id; } } } } } if ($request->filled('beds')) { $num_of_bed = $request->beds; } if ($request->filled('baths')) { $num_of_bath = $request->baths; } if ($request->filled('guests')) { $num_of_guests = $request->guests; } if ($request->filled('rents')) { $rents = str_replace($bs->base_currency_symbol, ' ', $request->rents); $rentArray = explode(' ', $rents); $min_rent = $rentArray[1]; $max_rent = $rentArray[4]; } $category = $request->category; $sortBy = $request->sort_by; $ammenities = $request->ammenities; $queryResult['Rcategories'] = RoomCategory::where('language_id', $userCurrentLang->id) ->where([['status', 1], ['user_id', $user->id]]) ->orderBy('serial_number', 'asc') ->get(); $queryResult['roomInfos'] = DB::table('user_rooms') ->join('user_room_contents', 'user_rooms.id', '=', 'user_room_contents.room_id') ->join('user_room_categories', 'user_room_contents.room_category_id', '=', 'user_room_categories.id') ->where('user_rooms.status', '=', 1) ->where('user_room_contents.language_id', '=', $userCurrentLang->id) ->when($category, function ($query) use ($category) { return $query->where('user_room_contents.room_category_id', $category); })->when($num_of_guests, function ($query, $num_of_guests) { return $query->where('max_guests', $num_of_guests); })->when($num_of_bed, function ($query, $num_of_bed) { return $query->where('bed', $num_of_bed); })->when($num_of_bath, function ($query, $num_of_bath) { return $query->where('bath', $num_of_bath); })->when(($min_rent && $max_rent), function ($query) use ($min_rent, $max_rent) { return $query->where('rent', '>=', $min_rent)->where('rent', '<=', $max_rent); })->when($ammenities, function ($query, $ammenities) { return $query->where(function ($query) use ($ammenities) { foreach ($ammenities as $key => $amm) { if ($key == 0) { $query->where('user_room_contents.amenities', 'LIKE', "%" . '"' . $amm . '"' . "%"); } else { $query->orWhere('user_room_contents.amenities', 'LIKE', "%" . '"' . $amm . '"' . "%"); } } }); })->when($sortBy, function ($query, $sortBy) { if ($sortBy == 'asc') { return $query->orderBy('user_rooms.id', 'ASC'); } elseif ($sortBy == 'desc') { return $query->orderBy('user_rooms.id', 'DESC'); } elseif ($sortBy == 'price-desc') { return $query->orderBy('rent', 'DESC'); } elseif ($sortBy == 'price-asc') { return $query->orderBy('rent', 'ASC'); } }, function ($query) { return $query->orderBy('user_rooms.id', 'DESC'); }) ->whereNotIn('user_rooms.id', $roomIds) ->paginate(6); $queryResult['currencyInfo'] = BasicSetting::where('user_id', $user->id)->first(); $queryResult['numOfBed'] = Room::where([['status', 1], ['user_id', $user->id]])->max('bed'); $queryResult['numOfBath'] = Room::where([['status', 1], ['user_id', $user->id]])->max('bath'); $maxPrice = Room::where([['status', 1], ['user_id', $user->id]])->max('rent'); $minPrice = Room::where([['status', 1], ['user_id', $user->id]])->where('status', 1)->min('rent'); $maxGuests = Room::where([['status', 1], ['user_id', $user->id]])->where('status', 1)->max('max_guests'); $queryResult['maxPrice'] = $maxPrice; $queryResult['minPrice'] = $minPrice; $queryResult['maxGuests'] = $maxGuests; if ($request->filled('rents')) { $queryResult['maxRent'] = $max_rent; $queryResult['minRent'] = $min_rent; } else { $queryResult['maxRent'] = $maxPrice; $queryResult['minRent'] = $minPrice; } $queryResult['amenities'] = RoomAmenity::where('language_id', $userCurrentLang->id)->get(); return view('user-front.room.index', $queryResult); } public function roomDetails($username, $id, $slug) { $user = getUser(); $keywords = getUserKeywords(); $queryResult['roomRating'] = DB::table('user_room_settings')->where('user_id', $user->id)->select('room_rating_status')->first(); if (session()->has('user_lang')) { $userCurrentLang = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = Language::where([['is_default', 1], ['user_id', $user->id]])->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = Language::where([['is_default', 1], ['user_id', $user->id]])->first(); } $details = RoomContent::join('user_rooms', 'user_rooms.id', 'user_room_contents.room_id') ->where('user_room_contents.language_id', $userCurrentLang->id) ->where('user_room_contents.user_id', $user->id) ->where('user_room_contents.room_id', $id) ->firstOrFail(); $queryResult['details'] = $details; $queryResult['currentLanguageInfo'] = $userCurrentLang; $amms = []; if (!empty(json_decode($details->amenities)) && $details->amenities != '[]') { $ammIds = json_decode($details->amenities, true); $ammenities = RoomAmenity::whereIn('id', $ammIds)->orderBy('serial_number', 'ASC')->get(); foreach ($ammenities as $key => $ammenity) { $amms[] = $ammenity->name; } } $queryResult['amms'] = $amms; $queryResult['reviews'] = RoomReview::where([['room_id', $id], ['user_id', $user->id]])->orderBy('id', 'DESC')->get(); $queryResult['currencyInfo'] = BasicSetting::where('user_id', $user->id)->first(); $bookings = RoomBooking::where('room_id', $id) ->where('user_id', $user->id) ->select('id', 'arrival_date', 'departure_date') ->where('payment_status', 1) ->get(); $qty = Room::findOrFail($id)->quantity; $bookedDates = []; foreach ($bookings as $key => $booking) { // get all dates of a booking date range $dates = []; $dates = $this->displayDates($booking->arrival_date, $booking->departure_date); // loop through the dates foreach ($dates as $key => $date) { $count = 1; foreach ($bookings as $key => $cbooking) { if ($cbooking->id != $booking->id) { $start = Carbon::parse($cbooking->arrival_date); $departure = Carbon::parse($cbooking->departure_date)->subDay(); $cDate = Carbon::parse($date); // check if the date is present in other booking's date ranges if ($cDate->gte($start) && $cDate->lte($departure)) { $count++; } } } // number of booking of a date is equal to room quantity, then mark the date as booked if ($count >= $qty && !in_array($date, $bookedDates)) { $bookedDates[] = $date; } } } $queryResult['bookingDates'] = $bookedDates; $queryResult['onlineGateways'] = UserPaymentGeteway::where([['status', 1], ['user_id', $user->id]])->get(); //authorize.net payment gateway data start $authorizenet = UserPaymentGeteway::where('user_id', $user->id)->whereKeyword('authorize.net')->first(); $anetInfo = json_decode($authorizenet->information); if (!is_null($anetInfo) && $anetInfo->sandbox_check == 1) { $queryResult['anetSource'] = 'https://jstest.authorize.net/v1/Accept.js'; } else { $queryResult['anetSource'] = 'https://js.authorize.net/v1/Accept.js'; } if (!is_null($anetInfo)) { $queryResult['anetClientKey'] = $anetInfo->public_key; $queryResult['anetLoginId'] = $anetInfo->login_id; } else { $queryResult['anetClientKey'] = null; $queryResult['anetLoginId'] = null; } //authorize.net payment gateway data end $queryResult['offlineGateways'] = UserOfflineGateway::where([ ['item_checkout_status', 1], ['user_id', $user->id] ])->orderBy('serial_number', 'asc') ->get()->map(function ($gateway) { return [ 'id' => $gateway->id, 'name' => $gateway->name, 'short_description' => $gateway->short_description, 'instructions' => replaceBaseUrl($gateway->instructions, 'summernote'), 'attachment_status' => $gateway->is_receipt, 'serial_number' => $gateway->serial_number ]; }); $queryResult['latestRooms'] = RoomContent::where([['language_id', $userCurrentLang->id], ['user_id', $user->id]])->with(['room' => function ($query) { $query->where('status', 1); }]) ->where('room_id', '<>', $details->room_id) ->where('room_category_id', $details->room_category_id) ->orderBy('room_id', 'desc') ->limit(3) ->get(); Log::info($queryResult['latestRooms']); $stripe = UserPaymentGeteway::where('keyword', 'stripe')->where([['status', 1], ['user_id', $user->id]])->first(); $queryResult['stripe_key'] = NULL; if (!empty($stripe)) { $stripe_info = json_decode($stripe->information, true); $queryResult['stripe_key'] = $stripe_info['key']; } $queryResult['avgRating'] = RoomReview::where([['room_id', $id], ['user_id', $user->id]])->avg('rating'); $queryResult['stripeError'] = $keywords['Your_card_number_is_incomplete'] ?? __('Your card number is incomplete'); $queryResult['anetCardError'] = $keywords['Please_provide_valid_credit_card_number'] ?? __('Please provide valid credit card number'); $queryResult['anetYearError'] = $keywords['Please_provide_valid_expiration_year'] ?? __('Please provide valid expiration year'); $queryResult['anetMonthError'] = $keywords['Please_provide_valid_expiration_month'] ?? __('Please provide valid expiration month'); $queryResult['anetExpirationDateError'] = $keywords['Expiration_date_must_be_in_the_future'] ?? __('Expiration date must be in the future'); $queryResult['anetCvvInvalidError'] = $keywords['Please_provide_valid_CVV'] ?? __('Please provide valid CVV'); return view('user-front.room.details', $queryResult); } public function displayDates($date1, $date2, $format = 'Y-m-d') { $dates = array(); $current = strtotime($date1); $date2 = strtotime($date2); $stepVal = '+1 day'; while ($current < $date2) { $dates[] = date($format, $current); $current = strtotime($stepVal, $current); } return $dates; } public function applyCoupon($username, Request $request) { $keywords = getUserKeywords(); try { $coupon = Coupon::where('code', $request->coupon)->firstOrFail(); $startDate = Carbon::parse($coupon->start_date); $endDate = Carbon::parse($coupon->end_date); $todayDate = Carbon::now(); $successMsg = $keywords['coupon_applied_success'] ?? __('Coupon applied successfully') . '.'; // check coupon is valid or not if ($todayDate->between($startDate, $endDate) == false) { $errorMsg = $keywords['Sorry_coupon_has_been_expired'] ?? __('Sorry, coupon has been expired') . '.'; return response()->json(['error' => $errorMsg]); } // check coupon is valid or not for this room $roomId = $request->roomId; $roomIds = empty($coupon->rooms) ? '' : json_decode($coupon->rooms); if (!empty($roomIds) && !in_array($roomId, $roomIds)) { $errorMsg = $keywords['This_coupon_can_be_applied_to_this_room'] ?? __('You can not apply this coupon for this room') . '.'; return response()->json(['error' => $errorMsg]); } $request->session()->put('couponCode', $request->coupon); $initTotalRent = str_replace(',', '', $request->initTotal); if ($initTotalRent == '0.00') { $errorMsg = $keywords['First_fillup_the_booking_dates'] ?? __('First, fillup the booking dates') . '.'; return response()->json(['error' => $errorMsg]); } else { if ($coupon->type == 'fixed') { $total = floatval($initTotalRent) - floatval($coupon->value); return response()->json([ 'success' => $successMsg, 'discount' => $coupon->value, 'total' => $total, ]); } else { $initTotalRent = floatval($initTotalRent); $couponVal = floatval($coupon->value); $discount = $initTotalRent * ($couponVal / 100); $total = $initTotalRent - $discount; return response()->json([ 'success' => $successMsg, 'discount' => $discount, 'total' => $total ]); } } } catch (Exception $e) { $errorMsg = $keywords['coupon_not_valid'] ?? __('Coupon is not valid') . '.'; return response()->json(['error' => $errorMsg]); } } public function storeReview($username, Request $request, $id) { $customer = Auth::guard('customer')->user(); $user = getUser(); $booking = RoomBooking::where([['customer_id', $customer->id], ['user_id', $user->id]])->where('room_id', $id)->where('payment_status', 1)->count(); if ($booking == 0) { session()->flash('error', "You had not booked this room yet."); return back(); } $rules = ['rating' => 'required|numeric']; $message = [ 'rating.required' => 'The star rating field is required.' ]; $validator = Validator::make($request->all(), $rules, $message); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $review = RoomReview::where([['customer_id', $customer->id], ['user_id', $user->id]])->where('room_id', $id)->first(); /** * if, room review of auth user does not exist then create a new one. * otherwise, update the existing review of that auth user. */ if ($review == null) { RoomReview::create($request->except('user_id', 'room_id') + [ 'user_id' => $user->id, 'customer_id' => $customer->id, 'room_id' => $id ]); // now, store the average rating of this room $room = Room::findOrFail($id); $room->update(['avg_rating' => $request->rating]); } else { $review->update($request->all()); // now, get the average rating of this room $roomReviews = RoomReview::where('room_id', $id)->get(); $totalRating = 0; foreach ($roomReviews as $roomReview) { $totalRating += $roomReview->rating; } $avgRating = $totalRating / $roomReviews->count(); // finally, store the average rating of this room $room = Room::findOrFail($id); $room->update(['avg_rating' => $avgRating]); } session()->flash('success', 'Review saved successfully!'); return redirect()->back(); } } Http/Controllers/Front/UsercheckoutController.php 0000644 00000044014 15213350434 0016305 0 ustar 00 <?php namespace App\Http\Controllers\Front; use Illuminate\Http\Request; use App\Models\User\Language; use App\Models\User\UserItem; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Models\User\UserItemContent; use App\Models\User\UserItemVariation; use App\Models\User\UserOfflineGateway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Http\Controllers\User\Payment\PaytmController; use App\Http\Controllers\User\Payment\MollieController; use App\Http\Controllers\User\Payment\PaypalController; use App\Http\Controllers\User\Payment\StripeController; use App\Http\Controllers\User\Payment\PaystackController; use App\Http\Controllers\User\Payment\RazorpayController; use App\Http\Controllers\User\Payment\InstamojoController; use App\Http\Controllers\User\Payment\FlutterWaveController; use App\Http\Controllers\User\Payment\MercadopagoController; use App\Http\Controllers\User\Payment\AuthorizenetController; use App\Http\Controllers\User\Payment\PerfectMoneyController; use App\Http\Controllers\User\Payment\PhonePeController; use App\Http\Controllers\User\Payment\XenditController; use App\Http\Controllers\User\Payment\YocoController; use App\Http\Controllers\User\Payment\ToyyibpayController; use App\Http\Controllers\User\Payment\PaytabsController; use App\Http\Controllers\User\Payment\MidtransController; use App\Http\Controllers\User\Payment\IyzicoController; use App\Http\Controllers\User\Payment\MyFatoorahController; use App\Http\Controllers\User\Payment\ShopMyFatoorahController; class UsercheckoutController extends Controller { public function __construct() { $this->middleware('auth:customer'); } public function checkout($domain, Request $request) { if (!Session::has('cart')) { return view('errors.404'); } $user = getUser(); if (session()->has('user_lang')) { $userCurrentLang = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->firstOrFail(); if (empty($userCurrentLang)) { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->firstOrFail(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->firstOrFail(); } $cart = Session::get('cart'); $items = []; $qty = []; $st_errors = []; $variations = []; foreach ($cart as $id => $c_item) { // check stock quantity without variation $item = UserItem::findOrFail($c_item['id']); if ($c_item["variations"] == null) { if ($item->type == 'physical') { if ($item->stock < $c_item['qty']) { $st_errors[] = $c_item["name"]; } } } else { $itemcontent = UserItemContent::where('item_id', $item->id)->where('language_id', $userCurrentLang->id)->first(); $orderderd_variations = $c_item["variations"]; foreach ($orderderd_variations as $vkey => $value) { $db_variations = UserItemVariation::where('variant_name', $vkey)->where('item_id', $itemcontent->item_id)->first(); if ($db_variations) { $db_option = json_decode($db_variations->option_name); $db_stock = json_decode($db_variations->option_stock); foreach ($db_option as $opkey => $opval) { if ($value["name"] == $opval) { if ($db_stock[$opkey] < $c_item['qty']) { $st_errors[] = '"' . $vkey . ':' . ' ' . $value["name"] . '"' . " of " . $c_item["name"]; } } } } } } } if (count($st_errors)) { return redirect()->back()->with('st_errors', $st_errors); } $total = $this->orderTotal($request->shipping_charge); // return $request; if ($this->orderValidation($request)) { return $this->orderValidation($request); } $bs = BasicSetting::where('user_id', $user->id)->firstorFail(); $input = $request->all(); $offline_payment_gateways = UserOfflineGateway::where('user_id', $user->id)->where('item_checkout_status', 1)->pluck('name')->toArray(); $request['status'] = 1; $title = 'Item Checkout'; $request['mode'] = 'online'; $description = 'Item Checkout description'; Session::put('user_paymentFor', 'user_item_order'); if ($request->payment_method == "Paypal") { if (empty($bs->base_currency_rate)) { return redirect()->back()->with('error', __('Base currency rate not found'))->withInput($request->all()); } $amount = round(($total / $bs->base_currency_rate), 2); $paypal = new PaypalController(); $cancel_url = route('customer.itemcheckout.paypal.cancel', getParam()); $success_url = route('customer.itemcheckout.paypal.success', getParam()); return $paypal->paymentProcess($request, $amount, $title, $success_url, $cancel_url); } elseif ($request->payment_method == "Stripe") { $validated = $request->validate([ 'stripeToken' => 'required', ]); if (empty($bs->base_currency_rate)) { return redirect()->back()->with('error', __('Base currency rate not found'))->withInput($request->all()); } $amount = round(($total / $bs->base_currency_rate), 2); $stripe = new StripeController(); $cancel_url = route('customer.itemcheckout.stripe.cancel', getParam()); return $stripe->paymentProcess($request, $amount, $title, NULL, $cancel_url); } elseif ($request->payment_method == "Paytm") { if ($bs->base_currency_text != "INR") { return redirect()->back()->with('error', __('only_paytm_INR'))->withInput($request->all()); } $amount = $total; $item_number = uniqid('paytm-') . time(); $callback_url = route('customer.itemcheckout.paytm.status', getParam()); $paytm = new PaytmController(); return $paytm->paymentProcess($request, $amount, $item_number, $callback_url); } elseif ($request->payment_method == "Paystack") { if ($bs->base_currency_text != "NGN") { return redirect()->back()->with('error', __('only_paystack_NGN'))->withInput($request->all()); } $amount = $total * 100; $email = $request->billing_email; $success_url = route('customer.itemcheckout.paystack.success', getParam()); $payStack = new PaystackController(); return $payStack->paymentProcess($request, $amount, $email, $success_url, $bs); } elseif ($request->payment_method == "Razorpay") { if ($bs->base_currency_text != "INR") { return redirect()->back()->with('error', __('only_razorpay_INR'))->withInput($request->all()); } $amount = $total; $item_number = uniqid('razorpay-') . time(); $cancel_url = route('customer.itemcheckout.razorpay.cancel', getParam()); $success_url = route('customer.itemcheckout.razorpay.success', getParam()); $razorpay = new RazorpayController(); return $razorpay->paymentProcess($request, $amount, $item_number, $cancel_url, $success_url, $title, $description, $bs); } elseif ($request->payment_method == "Instamojo") { if ($bs->base_currency_text != "INR") { return redirect()->back()->with('error', __('only_instamojo_INR'))->withInput($request->all()); } if ($total < 9) { session()->flash('warning', 'Minimum 10 INR required for this payment gateway'); return back()->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.instamojo.success', getParam()); $cancel_url = route('customer.itemcheckout.instamojo.cancel', getParam()); $instaMojo = new InstamojoController(); return $instaMojo->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $bs); } elseif ($request->payment_method == "Mercadopago") { if ($bs->base_currency_text != "BRL") { return redirect()->back()->with('error', __('only_mercadopago_BRL'))->withInput($request->all()); } $amount = $total; $email = $request->billing_email; $success_url = route('customer.itemcheckout.mercadopago.success', getParam()); $cancel_url = route('customer.itemcheckout.mercadopago.cancel', getParam()); $mercadopagoPayment = new MercadopagoController(); return $mercadopagoPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $email, $title, $description, $bs); } elseif ($request->payment_method == "Flutterwave") { $available_currency = array( 'BIF', 'CAD', 'CDF', 'CVE', 'EUR', 'GBP', 'GHS', 'GMD', 'GNF', 'KES', 'LRD', 'MWK', 'NGN', 'RWF', 'SLL', 'STD', 'TZS', 'UGX', 'USD', 'XAF', 'XOF', 'ZMK', 'ZMW', 'ZWD' ); if (!in_array($bs->base_currency_text, $available_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $email = $request->billing_email; $item_number = uniqid('flutterwave-') . time(); $cancel_url = route('customer.itemcheckout.flutterwave.cancel', getParam()); $success_url = route('customer.itemcheckout.flutterwave.success', getParam()); $flutterWave = new FlutterWaveController(); return $flutterWave->paymentProcess($request, $amount, $email, $item_number, $success_url, $cancel_url, $bs); } elseif ($request->payment_method == "Authorize.net") { $validated = $request->validate([ 'anetCardNumber' => 'required', 'anetExpMonth' => 'required', 'anetExpYear' => 'required', 'anetCardCode' => 'required', ]); $available_currency = array('USD', 'CAD', 'CHF', 'DKK', 'EUR', 'GBP', 'NOK', 'PLN', 'SEK', 'AUD', 'NZD'); if (!in_array($bs->base_currency_text, $available_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $cancel_url = route('customer.itemcheckout.anet.cancel', getParam()); $anetPayment = new AuthorizenetController(); return $anetPayment->paymentProcess($request, $amount, $cancel_url, $title, $bs); } elseif ($request->payment_method == "Mollie") { $available_currency = array('AED', 'AUD', 'BGN', 'BRL', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HRK', 'HUF', 'ILS', 'ISK', 'JPY', 'MXN', 'MYR', 'NOK', 'NZD', 'PHP', 'PLN', 'RON', 'RUB', 'SEK', 'SGD', 'THB', 'TWD', 'USD', 'ZAR'); if (!in_array($bs->base_currency_text, $available_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.mollie.success', getParam()); $cancel_url = route('customer.itemcheckout.mollie.cancel', getParam()); $molliePayment = new MollieController(); return $molliePayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $bs); } elseif ($request->payment_method == "PhonePe") { if ($bs->base_currency_text != "INR") { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.phonepe.success', getParam()); $cancel_url = route('customer.itemcheckout.phonepe.cancel', getParam()); $phonePayment = new PhonePeController(); return $phonePayment->paymentProcess($request, $amount, $title, $success_url, $cancel_url); } elseif ($request->payment_method == "Perfect Money") { if ($bs->base_currency_text != "USD") { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.perfect_money.success', getParam()); $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); $perfectMoney = new PerfectMoneyController(); return $perfectMoney->paymentProcess($request, $amount, $title, $success_url, $cancel_url); } elseif ($request->payment_method == "Xendit") { $allowed_currency = array('IDR', 'PHP', 'USD', 'SGD', 'MYR'); if (!in_array($bs->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.xendit.success', getParam()); $xendit = new XenditController(); return $xendit->paymentProcess($request, $amount, $title, $success_url); } elseif ($request->payment_method == "Yoco") { if ($bs->base_currency_text != 'ZAR') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.yoco.success', getParam()); $yoco = new YocoController(); return $yoco->paymentProcess($request, $amount, $title, $success_url); } elseif ($request->payment_method == "Toyyibpay") { if ($bs->base_currency_text != 'RM') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.toyyibpay.success', getParam()); $toyyibpay = new ToyyibpayController(); return $toyyibpay->paymentProcess($request, $amount, $title, $success_url); } elseif ($request->payment_method == "Paytabs") { $paytabInfo = paytabInfo('user', $user->id); if ($bs->base_currency_text != $paytabInfo['currency']) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.paytabs.success', getParam()); $toyyibpay = new PaytabsController(); return $toyyibpay->paymentProcess($request, $amount, $title, $success_url); } elseif ($request->payment_method == "Midtrans") { if ($bs->base_currency_text != 'IDR') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.midtrans.success', getParam()); $toyyibpay = new MidtransController(); return $toyyibpay->paymentProcess($request, $amount, $title, $success_url); } elseif ($request->payment_method == "Iyzico") { if ($bs->base_currency_text != 'TRY') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('customer.itemcheckout.iyzico.success', getParam()); $iyzico = new IyzicoController(); return $iyzico->paymentProcess($request, $amount, $title, $success_url); } elseif ($request->payment_method == "MyFatoorah") { $allowed_currency = array('KWD', 'SAR', 'BHD', 'AED', 'QAR', 'OMR', 'JOD'); if (!in_array($bs->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $total; $success_url = route('myfatoorah.success'); $iyzico = new ShopMyFatoorahController(); return $iyzico->paymentProcess($request, $amount, $title, $success_url); } elseif (in_array($request->payment_method, $offline_payment_gateways)) { $request['mode'] = 'offline'; $request['status'] = 0; $request['receipt_name'] = null; if ($request->has('receipt')) { $filename = time() . '.' . $request->file('receipt')->getClientOriginalExtension(); $directory = public_path("assets/front/img/membership/receipt"); if (!file_exists($directory)) mkdir($directory, 0775, true); @copy($request->file('receipt'), $directory . $filename); $request['receipt_name'] = $filename; } $amount = $total; $transaction_id = UserPermissionHelper::uniqidReal(8); $transaction_details = "offline"; $chargeId = $request->paymentId; $order = $this->saveOrder($request, $transaction_id, $chargeId, 'Pending'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); session()->flash('success', __('successful_payment')); Session::forget('user_request'); Session::forget('user_amount'); return redirect()->route('customer.itemcheckout.offline.success', getParam()); } } public function offlineSuccess() { return view('user-front.offline-success'); } } Http/Controllers/Front/FrontendController.php 0000644 00000262527 15213350434 0015433 0 ustar 00 <?php namespace App\Http\Controllers\Front; use Validator; use Carbon\Carbon; use App\Models\Faq; use App\Models\Seo; use App\Models\Blog; use App\Models\Page; use App\Models\User; use App\Models\Feature; use App\Models\Package; use App\Models\Partner; use App\Models\Process; use App\Models\Language; use App\Models\Bcategory; use App\Models\Subscriber; use App\Models\User\Quote; use App\Models\Testimonial; use Illuminate\Http\Request; use App\Models\BasicExtended; use App\Models\OfflineGateway; use App\Models\PaymentGateway; use App\Models\User\UserVcard; use App\Models\User\HeroSlider; use App\Models\User\QuoteInput; use App\Http\Helpers\MegaMailer; use App\Models\User\UserContact; use App\Models\User\UserFeature; use App\Models\User\BasicSetting; use App\Models\User\HomePageText; use JeroenDesloovere\VCard\VCard; use App\Models\BasicSetting as BS; use Illuminate\Support\Facades\DB; use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\PHPMailer; use App\Models\BasicExtended as BE; use App\Http\Controllers\Controller; use App\Models\User\UserOfferBanner; use Illuminate\Support\Facades\Auth; use App\Models\User\CustomerWishList; use App\Models\User\UserCustomDomain; use App\Models\User\PortfolioCategory; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Models\User\Blog as UserBlog; use App\Models\User\BlogCategory; use App\Models\User\BlogView; use App\Models\User\BookmarkPost; use App\Models\User\CounterInformation; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseCategory; use App\Models\User\CourseManagement\CourseEnrolment; use App\Models\User\DonationManagement\Donation; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\DonationManagement\DonationDetail; use App\Models\User\GalleryCategory; use App\Models\User\GalleryItem; use App\Models\User\HotelBooking\Room; use App\Models\User\HotelBooking\RoomContent; use App\Models\User\Language as UserLanguage; use App\Models\User\UserItemCategory; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Log; use Illuminate\Validation\Rule; class FrontendController extends Controller { use MiscellaneousTrait; public function __construct() { $bs = BS::first(); $be = BE::first(); Config::set('captcha.sitekey', $bs->google_recaptcha_site_key); Config::set('captcha.secret', $bs->google_recaptcha_secret_key); Config::set('mail.host', $be->smtp_host); Config::set('mail.port', $be->smtp_port); Config::set('mail.username', $be->smtp_username); Config::set('mail.password', $be->smtp_password); Config::set('mail.encryption', $be->encryption); Config::set('mail.encryption', $be->encryption); } public function index() { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $lang_id = $currentLang->id; $bs = $currentLang->basic_setting; $be = $currentLang->basic_extended; $data['processes'] = Process::where('language_id', $lang_id)->orderBy('serial_number', 'ASC')->get(); $data['features'] = Feature::where('language_id', $lang_id)->orderBy('serial_number', 'ASC')->get(); $data['featured_users'] = User::where([ ['featured', 1], ['status', 1] ]) ->whereHas('memberships', function ($q) { $q->where('status', '=', 1) ->where('start_date', '<=', Carbon::now()->format('Y-m-d')) ->where('expire_date', '>=', Carbon::now()->format('Y-m-d')); })->get(); $data['templates'] = User::where([ ['preview_template', 1], ['show_home', 1], ['status', 1], ['online_status', 1] ]) ->whereHas('memberships', function ($q) { $q->where('status', '=', 1) ->where('start_date', '<=', Carbon::now()->format('Y-m-d')) ->where('expire_date', '>=', Carbon::now()->format('Y-m-d')); })->orderBy('template_serial_number', 'ASC')->get(); $data['testimonials'] = Testimonial::where('language_id', $lang_id) ->orderBy('serial_number', 'ASC') ->get(); $data['blogs'] = Blog::where('language_id', $lang_id)->orderBy('id', 'DESC')->take(3)->get(); $data['packages'] = Package::query()->where('status', '1')->where('featured', '1')->get(); $data['partners'] = Partner::where('language_id', $lang_id) ->orderBy('serial_number', 'ASC') ->get(); $data['seo'] = Seo::where('language_id', $lang_id)->first(); $terms = []; if (Package::query()->where('status', '1')->where('featured', '1')->where('term', 'monthly')->count() > 0) { $terms[] = 'Monthly'; } if (Package::query()->where('status', '1')->where('featured', '1')->where('term', 'yearly')->count() > 0) { $terms[] = 'Yearly'; } if (Package::query()->where('status', '1')->where('featured', '1')->where('term', 'lifetime')->count() > 0) { $terms[] = 'Lifetime'; } $data['terms'] = $terms; $be = BasicExtended::select('package_features')->firstOrFail(); $allPfeatures = $be->package_features ? $be->package_features : "[]"; $data['allPfeatures'] = json_decode($allPfeatures, true); $data['vcards'] = UserVcard::where('preview_template', 1)->where([['status', 1], ['show_in_home', 1]])->orderBy('template_serial_number', 'ASC')->take(3)->get(); return view('front.index', $data); } public function subscribe(Request $request) { $rules = [ 'email' => 'required|email|unique:subscribers' ]; $bs = BS::first(); $messages = []; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { $errors = $validator->getMessageBag()->toArray(); $errrors['errors'] = $errors; return response()->json($errrors); } $subsc = new Subscriber; $subsc->email = $request->email; $subsc->save(); return "success"; } public function loginView() { return view('front.login'); } public function checkUsername($username) { $count = User::where('username', $username)->count(); $status = $count > 0 ? true : false; return response()->json($status); } public function step1($status, $id) { Session::forget('coupon'); Session::forget('coupon_amount'); if (Auth::check()) { return redirect()->route('user.plan.extend.index'); } $data['status'] = $status; $data['id'] = $id; $package = Package::findOrFail($id); $data['package'] = $package; $hasSubdomain = false; $features = []; if (!empty($package->features)) { $features = json_decode($package->features, true); } if (is_array($features) && in_array('Subdomain', $features)) { $hasSubdomain = true; } $data['hasSubdomain'] = $hasSubdomain; return view('front.step', $data); } public function step2(Request $request) { $data = $request->session()->get('data'); if (session()->has('coupon_amount')) { $data['cAmount'] = session()->get('coupon_amount'); } else { $data['cAmount'] = 0; } $stripe = PaymentGateway::where('keyword', 'stripe')->where('status', 1)->first(); if (is_null($stripe)) { $data['stripe_key'] = null; } else { $stripe_info = json_decode($stripe->information, true); $data['stripe_key'] = $stripe_info['key']; } $data['stripeError'] = __('Your card number is incomplete'); $data['anetCardError'] = __('Please provide valid credit card number'); $data['anetYearError'] = __('Please provide valid expiration year'); $data['anetMonthError'] = __('Please provide valid expiration month'); $data['anetExpirationDateError'] = __('Expiration date must be in the future'); $data['anetCvvInvalidError'] = __('Please provide valid CVV'); $data['successMsgForCoupon'] = __('Coupon applied successfully'); return view('front.checkout', $data); } public function checkout(Request $request) { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $bs = $currentLang->basic_setting; $this->validate($request, [ 'username' => 'required|alpha_num|unique:users', 'email' => 'required|email|unique:users', 'password' => 'required|min:8|confirmed', 'g-recaptcha-response' => Rule::requiredIf(function () use ($bs) { if ($bs->is_recaptcha == 1) { return true; } }) ], [ 'g-recaptcha-response.required' => 'Please verify that you are not a robot.', 'g-recaptcha-response.captcha' => 'Captcha error! try again later or contact site admin.', ]); $seo = Seo::where('language_id', $currentLang->id)->first(); $be = $currentLang->basic_extended; $data['bex'] = $be; $data['username'] = $request->username; $data['email'] = $request->email; $data['password'] = $request->password; $data['status'] = $request->status; $data['id'] = $request->id; $online = PaymentGateway::query()->where('status', 1)->get(); $offline = OfflineGateway::where('status', 1)->get(); $data['offline'] = $offline; $data['payment_methods'] = $online->merge($offline); $data['package'] = Package::query()->findOrFail($request->id); $data['seo'] = $seo; $request->session()->put('data', $data); return redirect()->route('front.registration.step2'); } // packages start public function pricing(Request $request) { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['seo'] = Seo::where('language_id', $currentLang->id)->first(); $data['bex'] = BE::first(); $data['abs'] = BS::first(); $terms = []; if (Package::query()->where('status', '1')->where('term', 'monthly')->count() > 0) { $terms[] = 'Monthly'; } if (Package::query()->where('status', '1')->where('term', 'yearly')->count() > 0) { $terms[] = 'Yearly'; } if (Package::query()->where('status', '1')->where('term', 'lifetime')->count() > 0) { $terms[] = 'Lifetime'; } $data['terms'] = $terms; $be = BasicExtended::select('package_features')->firstOrFail(); $allPfeatures = $be->package_features ? $be->package_features : "[]"; $data['allPfeatures'] = json_decode($allPfeatures, true); return view('front.pricing', $data); } // blog section start public function blogs(Request $request) { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['seo'] = Seo::where('language_id', $currentLang->id)->first(); $data['currentLang'] = $currentLang; $lang_id = $currentLang->id; $category = $request->category; if (!empty($category)) { $data['category'] = Bcategory::findOrFail($category); } $term = $request->term; $data['blogs'] = Blog::when($category, function ($query, $category) { return $query->where('bcategory_id', $category); }) ->when($term, function ($query, $term) { return $query->where('title', 'like', '%' . $term . '%'); }) ->when($currentLang, function ($query, $currentLang) { return $query->where('language_id', $currentLang->id); })->orderBy('serial_number', 'ASC')->paginate(6); return view('front.blogs', $data); } public function blogdetails($slug, $id) { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $lang_id = $currentLang->id; $data['blog'] = Blog::findOrFail($id); $data['bcats'] = Bcategory::where('status', 1)->where('language_id', $lang_id)->orderBy('serial_number', 'ASC')->get(); $data['recentBlogs'] = Blog::where('language_id', $currentLang->id)->take(3)->latest()->get(); return view('front.blog-details', $data); } public function templates() { $data['templates'] = User::where([ ['preview_template', 1], ['status', 1], ['online_status', 1] ]) ->whereHas('memberships', function ($q) { $q->where('status', '=', 1) ->where('start_date', '<=', Carbon::now()->format('Y-m-d')) ->where('expire_date', '>=', Carbon::now()->format('Y-m-d')); })->orderBy('template_serial_number', 'ASC')->paginate(9); return view('front.templates', $data); } public function vcards() { $data['vcards'] = UserVcard::where('preview_template', 1)->where('status', 1)->orderBy('template_serial_number', 'ASC')->paginate(12); return view('front.vcards', $data); } public function contactView() { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['seo'] = Seo::where('language_id', $currentLang->id)->first(); return view('front.contact', $data); } public function faqs() { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['seo'] = Seo::where('language_id', $currentLang->id)->first(); $lang_id = $currentLang->id; $data['faqs'] = Faq::where('language_id', $lang_id) ->orderBy('serial_number', 'ASC') ->get(); return view('front.faq', $data); } public function dynamicPage($slug) { $data['page'] = Page::where('slug', $slug)->firstOrFail(); return view('front.dynamic', $data); } public function users(Request $request) { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['seo'] = Seo::where('language_id', $currentLang->id)->first(); $homeTexts = []; if (!empty($request->designation)) { $homeTexts = HomePageText::when($request->designation, function ($q) use ($request) { return $q->where('designation', 'like', '%' . $request->designation . '%'); })->select('user_id')->get(); } $userIds = []; foreach ($homeTexts as $key => $homeText) { if (!in_array($homeText->user_id, $userIds)) { $userIds[] = $homeText->user_id; } } $data['users'] = null; $users = User::where('online_status', 1) ->whereHas('memberships', function ($q) { $q->where('status', '=', 1) ->where('start_date', '<=', Carbon::now()->format('Y-m-d')) ->where('expire_date', '>=', Carbon::now()->format('Y-m-d')); }) ->when($request->company, function ($q) use ($request) { return $q->where('company_name', 'like', '%' . $request->company . '%'); }) ->when($request->location, function ($q) use ($request) { return $q->where(function ($query) use ($request) { $query->where('city', 'like', '%' . $request->location . '%') ->orWhere('state', 'like', '%' . $request->location . '%') ->orWhere('address', 'like', '%' . $request->location . '%') ->orWhere('country', 'like', '%' . $request->location . '%'); }); }) ->orderBy('id', 'DESC') ->paginate(9); $data['users'] = $users; return view('front.users', $data); } public function userDetailView($domain) { $user = getUser(); $data['user'] = $user; if (Auth::check() && Auth::user()->id != $user->id && $user->online_status != 1) { return redirect()->route('front.index'); } elseif (!Auth::check() && $user->online_status != 1) { return redirect()->route('front.index'); } $package = UserPermissionHelper::userPackage($user->id); if (is_null($package)) { Session::flash('warning', 'User membership is expired'); if (Auth::check()) { return redirect()->route('user-dashboard')->with('error', 'User membership is expired'); } else { return redirect()->route('front.user.view'); } } if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $userBs = \App\Models\User\BasicSetting::where('user_id', $user->id)->first(); $data['home_sections'] = User\HomeSection::where('user_id', $user->id)->first(); $data['home_text'] = User\HomePageText::query() ->where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->first(); $data['portfolios'] = $user->portfolios() ->where('language_id', $userCurrentLang->id) ->where('featured', 1) ->orderBy('serial_number', 'ASC') ->get() ?? collect([]); $data['portfolio_categories'] = $user->portfolioCategories() ->whereHas('portfolios', function ($q) { $q->where('featured', 1); }) ->where('language_id', $userCurrentLang->id) ->where('status', 1) ->orderBy('serial_number', 'ASC') ->get() ?? collect([]); $data['skills'] = $user->skills() ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get() ?? collect([]); $data['counterInformations'] = $user->counterInformations() ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get() ?? collect([]); $data['services'] = $user->services()->where([ ['lang_id', $userCurrentLang->id], ['featured', 1] ]) ->orderBy('serial_number', 'ASC') ->get() ?? collect([]); $data['testimonials'] = $user->testimonials() ->where('lang_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get() ?? collect([]); $blogLimits = 3; $userdefaultLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); $data['videoSectionDetails'] = User\HomePageText::query() ->where([ ['user_id', $user->id], ['language_id', $userdefaultLang->id] ])->select(['video_section_image', 'video_section_title', 'video_section_subtitle', 'video_section_button_url', 'video_section_button_text', 'video_section_url', 'video_section_text'])->first(); if ($userBs->theme == 'home_one') { $blogLimits = 3; } elseif ($userBs->theme == 'home_four' || $userBs->theme == 'home_five' || $userBs->theme == 'home_seven') { $blogLimits = 3; } elseif ($userBs->theme == 'home_six' || $userBs->theme == 'home_eleven') { $blogLimits = 4; } elseif ($userBs->theme == 'home_two' || $userBs->theme == 'home_three') { $blogLimits = 6; } // CHECK permissions if (!empty($user)) { $permissions = UserPermissionHelper::packagePermission($user->id); $permissions = json_decode($permissions, true); } $data['blogs'] = $user->blogs() ->where('language_id', $userCurrentLang->id) ->orderBy('id', 'DESC') ->take($blogLimits) ->get() ?? collect([]); $data['teams'] = $user->teams() ->where('language_id', $userCurrentLang->id) ->where('featured', 1) ->get() ?? collect([]); $data['brands'] = $user->brands() ->get() ?? collect([]); $data['sliders'] = HeroSlider::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->orderBy('serial_number', 'asc') ->get(); if ($userBs->theme == 'home_two') { $data['work_processes'] = User\WorkProcess::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->orderBy('serial_number', 'ASC')->get(); return view('user-front.home.index-2', $data); } elseif ($userBs->theme == 'home_three') { $data['work_processes'] = User\WorkProcess::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->orderBy('serial_number', 'ASC')->get(); $data['contact'] = UserContact::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->first(); $data['faqs'] = User\FAQ::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('featured', 1) ->get(); $data['static'] = User\HeroStatic::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); return view('user-front.home.index-3', $data); } elseif ($userBs->theme == 'home_four') { $data['work_processes'] = User\WorkProcess::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->orderBy('serial_number', 'ASC')->get(); $data['contact'] = UserContact::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->first(); $data['faqs'] = User\FAQ::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('featured', 1) ->get(); $data['static'] = User\HeroStatic::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); $data['portfolioCategories'] = PortfolioCategory::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id)->where('is_featured', 1)->get(); return view('user-front.home.index-4', $data); } elseif ($userBs->theme == 'home_five') { $data['work_processes'] = User\WorkProcess::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->orderBy('serial_number', 'ASC')->get(); $data['contact'] = UserContact::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->first(); $data['faqs'] = User\FAQ::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('featured', 1) ->get(); $data['static'] = User\HeroStatic::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); $data['portfolioCategories'] = PortfolioCategory::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id)->where('is_featured', 1)->get(); return view('user-front.home.index-5', $data); } elseif ($userBs->theme == 'home_six') { $data['work_processes'] = User\WorkProcess::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->orderBy('serial_number', 'ASC')->get(); $data['contact'] = UserContact::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->first(); $data['faqs'] = User\FAQ::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('featured', 1) ->get(); $data['static'] = User\HeroStatic::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); return view('user-front.home.index-6', $data); } elseif ($userBs->theme == 'home_seven') { $data['contact'] = UserContact::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->first(); $data['work_processes'] = User\WorkProcess::where([ ['user_id', $user->id], ['language_id', $userCurrentLang->id] ])->orderBy('serial_number', 'ASC')->get(); $data['faqs'] = User\FAQ::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('featured', 1) ->get(); return view('user-front.home.index-7', $data); } elseif ($userBs->theme == 'home_eight') { if (!empty($permissions) && !in_array('Ecommerce', $permissions)) { $userBs->theme = 'home_one'; $userBs->save(); return redirect()->route('front.user.view'); } $data['sliders'] = HeroSlider::where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->where('user_id', $user->id) ->get(); $data['features'] = UserFeature::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->orderBy('serial_number', 'ASC') ->get(); $data['topbanners'] = UserOfferBanner::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->where('position', 'top') ->orderBy('id', 'DESC') ->get(); $data['bottombanners'] = UserOfferBanner::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->where('position', 'bottom') ->orderBy('id', 'DESC') ->get(); $data['leftbanners'] = UserOfferBanner::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->where('position', 'left') ->orderBy('id', 'DESC') ->get(); $itemlimit = 10; $data['featured_items'] = DB::table('user_items')->where('user_items.user_id', $user->id)->where('user_items.status', 1) ->where('user_items.is_feature', 1) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.id', 'DESC') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->limit($itemlimit) ->get(); $data['new_items'] = DB::table('user_items')->where('user_items.status', 1)->where('user_items.user_id', $user->id) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.id', 'DESC') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->limit($itemlimit) ->get(); $data['rating_items'] = DB::table('user_items')->where('user_items.rating', '>', 0)->where('user_items.status', 1)->where('user_items.user_id', $user->id) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.rating', 'DESC') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->limit($itemlimit) ->get(); $data['special_offer_items'] = DB::table('user_items')->where('user_items.status', 1)->where('user_items.user_id', $user->id) ->where('user_items.special_offer', 1) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.id', 'DESC') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->get(); $data['best_seller_items'] = DB::table('user_order_items') ->leftJoin('user_items', 'user_items.id', '=', 'user_order_items.item_id') ->leftJoin('user_orders', 'user_orders.id', '=', 'user_order_items.user_order_id') ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_order_items.category', '=', 'user_item_categories.id') ->select( 'user_items.id', 'user_items.current_price', 'user_orders.payment_status', 'user_items.rating', 'user_items.previous_price', 'user_item_contents.title', 'user_item_contents.slug', 'user_item_categories.name AS category', 'user_item_categories.id AS category_id', 'user_items.thumbnail', 'user_items.flash', 'user_items.stock', 'user_items.type', 'user_items.start_date', 'user_items.end_date', 'user_items.start_time', 'user_items.end_time', 'user_items.flash_percentage', 'user_order_items.item_id', DB::raw('SUM(user_order_items.qty) as total') ) ->groupBy('user_items.id', 'user_orders.payment_status', 'user_items.flash', 'user_items.stock', 'user_items.type', 'user_items.start_date', 'user_items.start_time', 'user_items.end_time', 'user_items.end_date', 'user_items.flash_percentage', 'user_items.rating', 'user_items.current_price', 'user_item_categories.id', 'user_item_categories.name', 'user_item_contents.title', 'user_item_contents.slug', 'user_items.previous_price', 'user_items.thumbnail', 'user_order_items.item_id') ->where('user_orders.payment_status', '=', 'Completed') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->orderBy('total', 'desc') ->limit($itemlimit) ->get(); $bs = BasicSetting::where('user_id', $user->id)->first(); Config::set('app.timezone', $bs->timezoneinfo->timezone); $data['flash_items'] = DB::table('user_items')->where('user_items.status', 1)->where('user_items.user_id', $user->id) ->where('user_items.flash', 1) ->where('user_items.start_date_time', '<=', Carbon::now()->tz($bs->timezoneinfo->timezone)->format('Y-m-d H:i:s A')) ->where('user_items.end_date_time', '>=', Carbon::now()->tz($bs->timezoneinfo->timezone)->format('Y-m-d H:i:s A')) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.id', 'DESC') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->get(); if (Auth::guard('customer')->check()) { $data['myWishlist'] = CustomerWishList::where('customer_id', Auth::guard('customer')->user()->id)->pluck('item_id')->toArray(); } else { $data['myWishlist'] = []; } return view('user-front.home.index-8', $data); } elseif ($userBs->theme == 'home_nine') { if (!empty($permissions) && !in_array('Hotel Booking', $permissions)) { $userBs->theme = 'home_one'; $userBs->save(); return redirect()->route('front.user.view'); } $data['sliders'] = HeroSlider::where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->where('user_id', $user->id) ->get(); $data['rooms'] = RoomContent::where('user_id', $user->id)->with(['room' => function ($query) { $query->where('status', 1)->where('is_featured', 1); }])->where('language_id', $userCurrentLang->id) ->get(); $data['chooseUsItems'] = DB::table('user_choose_us_items')->where('user_id', $user->id)->where('language_id', $userCurrentLang->id)->orderBy('serial_number')->get(); $data['numOfBed'] = Room::where([['status', 1], ['user_id', $user->id]])->max('bed'); $data['numOfBath'] = Room::where([['status', 1], ['user_id', $user->id]])->max('bath'); $data['numOfGuest'] = Room::where([['status', 1, ['user_id', $user->id]]])->max('max_guests'); return view('user-front.home.index-9', $data); } elseif ($userBs->theme == 'home_ten') { if (!empty($permissions) && !in_array('Course Management', $permissions)) { $userBs->theme = 'home_one'; $userBs->save(); return redirect()->route('front.user.view'); } $data['static'] = User\HeroStatic::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); $data['categories'] = CourseCategory::query()->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('status', 1) ->orderBy('serial_number', 'ASC') ->get(); $data['callToActionInfo'] = User\ActionSection::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); $courses = Course::query() ->join('user_course_informations', 'user_courses.id', '=', 'user_course_informations.course_id') ->join('user_course_categories', 'user_course_categories.id', '=', 'user_course_informations.course_category_id') ->join('user_course_instructors', 'user_course_instructors.id', '=', 'user_course_informations.instructor_id') ->where('user_courses.status', '=', 'published') ->where('user_courses.user_id', '=', $user->id) ->where('user_courses.is_featured', '=', 'yes') ->where('user_course_informations.language_id', '=', $userCurrentLang->id) ->select('user_courses.id', 'user_courses.thumbnail_image', 'user_courses.pricing_type', 'user_courses.previous_price', 'user_courses.current_price', 'user_courses.average_rating', 'user_courses.duration', 'user_course_informations.title', 'user_course_informations.slug', 'user_course_categories.name as categoryName', 'user_course_instructors.image as instructorImage', 'user_course_instructors.name as instructorName') ->orderByDesc('user_courses.id') ->get(); $courses->map(function ($course) use ($user) { $course['enrolmentCount'] = CourseEnrolment::query() ->where('user_id', $user->id) ->where('course_id', '=', $course->id) ->where(function ($query) { $query->where('payment_status', 'completed') ->orWhere('payment_status', 'free'); }) ->count(); }); $data['courses'] = $courses; $data['categories'] = CourseCategory::query()->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('status', 1) ->orderBy('serial_number', 'ASC') ->where('is_featured', '=', 1) ->get(); $data['featuredImage'] = $userBs->features_section_image; $data['features'] = UserFeature::query()->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get(); $userdefaultLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); $data['videoData'] = HomePageText::query() ->where('user_id', $user->id) ->where('language_id', $userdefaultLang->id) ->select('video_section_image', 'video_section_url') ->first(); $data['countInfos'] = CounterInformation::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get(); $data['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo($user->id); return view('user-front.home.index-10', $data); } elseif ($userBs->theme == 'home_eleven') { if (!empty($permissions) && !in_array('Donation Management', $permissions)) { $userBs->theme = 'home_one'; $userBs->save(); return redirect()->route('front.user.view'); } $data['static'] = User\HeroStatic::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); $data['features'] = UserFeature::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->orderBy('serial_number', 'ASC') ->get(); $data['countInfos'] = CounterInformation::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get(); $data['donationCategories'] = $userCurrentLang->donationCategories->where('status', 1)->where('is_featured', 1); $causes = Donation::where('user_id', $user->id)->latest()->take(6)->get(); $causes->map(function ($cause) use ($user, $userCurrentLang) { $title = $cause->contents->where('language_id', $userCurrentLang->id)->first(); if (!empty($title)) { $cause['title'] = $title->title; $cause['slug'] = $title->slug; $cause['iamge'] = $title->image; } $raised_amount = DonationDetail::query() ->where('donation_id', '=', $cause->id) ->where('status', '=', "completed") ->sum('amount'); $goal_percentage = $raised_amount > 0 ? (($raised_amount / $cause->goal_amount) * 100) : 0; $cause['raised_amount'] = $raised_amount > 0 ? round($raised_amount, 2) : 0; $cause['goal_percentage'] = round($goal_percentage, 1); }); $data['causes'] = $causes; return view('user-front.home.index-11', $data); } elseif ($userBs->theme == 'home_twelve') { if (!empty($permissions) && !in_array('Portfolio', $permissions)) { $userBs->theme = 'home_one'; $userBs->save(); return redirect()->route('front.user.view'); } $data['static'] = User\HeroStatic::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); $data['countInfos'] = CounterInformation::query() ->where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get(); $data['job_experiences'] = $user->job_experiences() ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get() ?? collect([]); $data['educations'] = $user->educations() ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get() ?? collect([]); return view('user-front.home.index-12', $data); } elseif ($userBs->theme == 'home_thirteen') { if (!empty($permissions) && !in_array('Blog', $permissions)) { $userBs->theme = 'home_one'; $userBs->save(); return redirect()->route('front.user.view'); } $data['bcategories'] = BlogCategory::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('status', 1) ->orderBy('serial_number') ->get(); $data['sliders'] = UserBlog::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('is_slider', 1) ->orderBy('serial_number') ->get(); $data['featuredBlogs'] = UserBlog::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('is_featured', 1) ->orderBy('serial_number') ->get(); $data['mostViewedblogs'] = UserBlog::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('views', '!=', 0) ->orderByDesc('views') ->limit(5) ->get(); $data['latestPosts'] = UserBlog::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->orderByDesc('created_at') ->limit(6) ->get(); $data['featPostCategories'] = BlogCategory::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('status', 1) ->where('is_featured', 1) ->orderBy('serial_number', 'ASC') ->get(); $data['galleryItems'] = GalleryItem::query() ->where('language_id', $userCurrentLang->id) ->where('is_featured', 1) ->where('user_id', $user->id) ->orderBy('serial_number', 'ASC') ->get(); $data['gallery_bg'] = BasicSetting::where('user_id', $user->id) ->select('gallery_bg') ->first(); if (Auth::guard('customer')->check() == true) { $authUser = Auth::guard('customer')->user(); $data['bookmarkPosts'] = BookmarkPost::query() ->where('user_id', $authUser->id) ->where('author_id', $user->id) ->get(); } return view('user-front.home.index-13', $data); } elseif ($userBs->theme == 'home_fourteen') { if (!empty($permissions) && !in_array('Ecommerce', $permissions)) { $userBs->theme = 'home_one'; $userBs->save(); return redirect()->route('front.user.view'); } $data['static'] = User\HeroStatic::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->first(); $data['features'] = UserFeature::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->orderBy('serial_number', 'ASC') ->get(); $data['featureCategories'] = UserItemCategory::where('language_id', $userCurrentLang->id) ->where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->where('status', 1) ->where('is_feature', 1) ->orderBy('name', 'asc') ->get(); $data['topbanners'] = UserOfferBanner::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->where('position', 'top') ->orderBy('id', 'DESC') ->get(); $data['bottombanners'] = UserOfferBanner::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->where('position', 'bottom') ->orderBy('id', 'DESC') ->get(); $data['leftbanners'] = UserOfferBanner::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->where('position', 'left') ->orderBy('id', 'DESC') ->get(); $data['sliders'] = HeroSlider::where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->where('user_id', $user->id) ->get(); $bs = BasicSetting::where('user_id', $user->id)->first(); Config::set('app.timezone', $bs->timezoneinfo->timezone); $data['flash_items'] = DB::table('user_items')->where('user_items.status', 1)->where('user_items.user_id', $user->id) ->where('user_items.flash', 1) ->where('user_items.start_date_time', '<=', Carbon::now()->tz($bs->timezoneinfo->timezone)->format('Y-m-d H:i:s A')) ->where('user_items.end_date_time', '>=', Carbon::now()->tz($bs->timezoneinfo->timezone)->format('Y-m-d H:i:s A')) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.id', 'DESC') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->get(); $itemlimit = 10; $data['featured_items'] = DB::table('user_items')->where('user_items.user_id', $user->id)->where('user_items.status', 1) ->where('user_items.is_feature', 1) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.id', 'DESC') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->limit($itemlimit) ->get(); $data['rating_items'] = DB::table('user_items')->where('user_items.rating', '>', 0)->where('user_items.status', 1)->where('user_items.user_id', $user->id) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.rating', 'DESC') ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->limit($itemlimit) ->get(); $now = Carbon::now()->tz($bs->timezoneinfo->timezone)->toDateTimeString(); $data['on_sale_items'] = DB::table('user_items') ->where('user_items.status', 1) ->where('user_items.user_id', $user->id) ->where(function ($q) use ($now) { $q->where(function ($q2) use ($now) { $q2->where('user_items.start_date_time', '<=', $now) ->where('user_items.end_date_time', '>=', $now); }) ->orWhere(function ($q3) { $q3->whereColumn('user_items.previous_price', '>', 'user_items.current_price'); }); }) ->join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->where('user_item_contents.language_id', $userCurrentLang->id) ->where('user_item_categories.language_id', $userCurrentLang->id) ->select( 'user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category' ) ->orderBy('user_items.id', 'DESC') ->limit(6) ->get(); if (Auth::guard('customer')->check()) { $data['myWishlist'] = CustomerWishList::where('customer_id', Auth::guard('customer')->user()->id)->pluck('item_id')->toArray(); } else { $data['myWishlist'] = []; } return view('user-front.home.index-14', $data); } else { return view('user-front.home.index-1', $data); } } public function paymentInstruction(Request $request) { $offline = OfflineGateway::where('name', $request->name) ->select('short_description', 'instructions', 'is_receipt') ->first(); return response()->json([ 'description' => $offline->short_description, 'instructions' => $offline->instructions, 'is_receipt' => $offline->is_receipt ]); } public function contactMessage($domain, Request $request) { $keywords = getUserKeywords(); $userId = getUser()->id; $rules = [ 'fullname' => 'required', 'email' => 'required|email:rfc,dns', 'subject' => 'required', 'message' => 'required' ]; $messages = [ 'fullname.required' => $keywords['fullname_required'] ?? __('Full name is required') . '.', 'email.required' => $keywords['email_required'] ?? __('Email is required') . '.', 'email.email' => $keywords['email_invalid'] ?? __('Please enter a valid email address') . '.', 'subject.required' => $keywords['subject_required'] ?? __('Subject is required') . '.', 'message.required' => $keywords['message_required'] ?? __('Message is required') . '.', ]; $ubs = BasicSetting::where('user_id', $userId)->first(); if ($ubs->is_recaptcha == 1) { $rules['g-recaptcha-response'] = 'required|captcha'; $messages = array_merge($messages, [ 'g-recaptcha-response.required' => $keywords['g_recaptcha_response_required'] ?? __('Please verify that you are not a robot') . '.', 'g-recaptcha-response.captcha' => $keywords['g_recaptcha_response_captcha'] ?? __('Captcha error! Try again later or contact site admin') . '.', ]); } $request->validate($rules, $messages); // $request->validate($rules); if (!empty($request->type) && $request->type == 'vcard') { $data['toMail'] = $request->to_mail; $data['toName'] = $request->to_name; } else { $toUser = User::query()->findOrFail($request->id); $data['toMail'] = $toUser->email; $data['toName'] = $toUser->username; } $contact_remainder_message = $keywords['further_contact_use_the_below_information'] ?? __('For further contact with the enquirer please use the below information'); $enquirer_name = $keywords['Enquirer_Name'] ?? __('Enquirer Name'); $enquirer_email = $keywords['Enquirer_Mail'] ?? __('Enquirer Mail'); $data['subject'] = $request->subject; $data['fullname'] = $request->fullname; $data['email'] = $request->email; $data['body'] = "<div>$request->message</div><br> <strong>$contact_remainder_message:</strong><br> <strong>$enquirer_name:</strong> $request->fullname <br> <strong>$enquirer_email:</strong> $request->email <br> "; $mailer = new MegaMailer(); $mailer->mailContactMessage($data); $successMessage = $keywords['Mail_sent_successfully'] ?? __('Mail sent successfully') . '.'; Session::flash('success', $successMessage); return back(); } public function adminContactMessage(Request $request) { $rules = [ 'name' => 'required', 'email' => 'required|email:rfc,dns', 'subject' => 'required', 'message' => 'required' ]; $bs = BS::select('is_recaptcha')->first(); if ($bs->is_recaptcha == 1) { $rules['g-recaptcha-response'] = 'required|captcha'; } $messages = [ 'g-recaptcha-response.required' => 'Please verify that you are not a robot.', 'g-recaptcha-response.captcha' => 'Captcha error! try again later or contact site admin.', ]; $request->validate($rules, $messages); $data['fromMail'] = $request->email; $data['fromName'] = $request->name; $data['subject'] = $request->subject; $data['body'] = "<div>$request->message</div><br> <strong>For further contact with the enquirer please use the below information:</strong><br> <strong>Enquirer Name:</strong> $request->name <br> <strong>Enquirer Mail:</strong> $request->email <br> "; $mailer = new MegaMailer(); $mailer->mailToAdmin($data); Session::flash('success', 'Message sent successfully'); return back(); } public function userServices($domain) { $user = getUser(); $id = $user->id; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['home_text'] = User\HomePageText::query() ->where([ ['user_id', $id], ['language_id', $userCurrentLang->id] ])->first(); $data['services'] = User\UserService::query() ->where('user_id', $id) ->where('lang_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->get(); return view('user-front.service.index', $data); } public function userServiceDetail($domain, $slug, $id) { $data['service'] = User\UserService::query()->findOrFail($id); return view('user-front.service.show', $data); } public function userBlogs(Request $request, $domain) { $user = getUser(); $id = $user->id; $data['user'] = $user; $catid = $request->category; $term = $request->term; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['home_text'] = User\HomePageText::query() ->where([ ['user_id', $id], ['language_id', $userCurrentLang->id] ])->first(); $data['blogs'] = User\Blog::query() ->when($catid, function ($query, $catid) { return $query->where('category_id', $catid); }) ->when($term, function ($query, $term) { return $query->where('title', 'LIKE', '%' . $term . '%'); }) ->where('user_id', $id) ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->paginate(4); $data['blog_categories'] = User\BlogCategory::query() ->where('status', 1) ->orderBy('serial_number', 'ASC') ->where('language_id', $userCurrentLang->id) ->where('user_id', $id) ->get(); $data['allCount'] = User\Blog::query() ->where('user_id', $id) ->where('language_id', $userCurrentLang->id) ->count(); if (Auth::guard('customer')->check() == true) { $authUser = Auth::guard('customer')->user(); $data['bookmarkPosts'] = BookmarkPost::query() ->where('user_id', $authUser->id) ->where('author_id', $user->id) ->get(); } return view('user-front.blog.index', $data); } public function userGallery(Request $request, $domain) { $user = getUser(); $id = $user->id; $data['user'] = $user; $catid = $request->category; $term = $request->term; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['home_text'] = User\HomePageText::query() ->where([ ['user_id', $id], ['language_id', $userCurrentLang->id] ])->first(); $data['items'] = GalleryItem::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->orderBy('serial_number', 'asc') ->get(); $data['galleryCategories'] = GalleryCategory::where('language_id', $userCurrentLang->id) ->where('user_id', $user->id) ->where('status', 1) ->orderBy('serial_number', 'asc') ->get(); return view('user-front.gallery', $data); } public function userBlogDetail(Request $request, $domain, $slug, $id) { $user = getUser(); $userId = $user->id; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['blog'] = UserBlog::query()->findOrFail($id); $data['latestBlogs'] = UserBlog::query() ->where('user_id', $userId) ->where('language_id', $userCurrentLang->id) ->orderBy('id', 'DESC') ->limit(3)->get(); $data['blog_categories'] = User\BlogCategory::query() ->where('status', 1) ->orderBy('serial_number', 'ASC') ->where('language_id', $userCurrentLang->id) ->where('user_id', $userId) ->get(); $data['mostViewedblogs'] = UserBlog::where('user_id', $user->id) ->where('language_id', $userCurrentLang->id) ->where('views', '!=', 0) ->orderByDesc('views') ->limit(5) ->get(); $data['allCount'] = UserBlog::query() ->where('user_id', $userId) ->where('language_id', $userCurrentLang->id) ->count(); $this->viewLog($request, $id, $user->id); return view('user-front.blog.show', $data); } public function makeBookmarkBlog($domain, $id) { $author = getUser(); if (Auth::guard('customer')->check() == false) { Log::info("log not"); return response()->json(['fail' => 'Please login before bookmark this post.']); } else { Log::info("log yes"); $user = Auth::guard('customer')->user(); $bookmarkInfo = $user->bookmarkList()->where('post_id', $id)->first(); if (is_null($bookmarkInfo)) { $bookmarkPost = new BookmarkPost(); $bookmarkPost->user_id = $user->id; $bookmarkPost->post_id = $id; $bookmarkPost->author_id = $author->id; $bookmarkPost->save(); $postBookmarks = $this->countPostBookmark($id); return response()->json([ 'success' => 'Post bookmarked successfully!', 'status' => 'bookmarked', 'postId' => $id, 'totalBookmark' => $postBookmarks ]); } else { $bookmarkInfo->delete(); $postBookmarks = $this->countPostBookmark($id); return response()->json([ 'success' => 'Bookmark removed successfully!', 'status' => 'removed', 'postId' => $id, 'totalBookmark' => $postBookmarks ]); } } } public function viewLog($request, $postId, $authorId) { $postViews = BlogView::where('post_id', $postId)->where('author_id', $authorId)->get(); $ipAddress = $request->getClientIp(); if (count($postViews) > 0) { foreach ($postViews as $view) { if (strcmp($view->ip, $ipAddress) == 0) { return; } } } $postView = new BlogView(); $postView->post_id = $postId; $postView->user_id = Auth::guard('customer')->check() == true ? Auth::guard('customer')->user()->id : null; $postView->author_id = $authorId; $postView->ip = $ipAddress; $postView->save(); // count total views of this post $post = UserBlog::find($postId); $viewCount = BlogView::where('post_id', $postId) ->where('author_id', $authorId) ->count(); $post->update(['views' => $viewCount]); return; } public function countPostBookmark($id) { // count total bookmarks of this post $post = UserBlog::find($id); $bookmarkCount = BookmarkPost::where('post_id', $id)->count(); $post->update(['bookmarks' => $bookmarkCount]); return $post->bookmarks; } public function userPortfolios(Request $request, $domain) { $user = getUser(); $id = $user->id; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['home_text'] = User\HomePageText::query() ->where([ ['user_id', $id], ['language_id', $userCurrentLang->id] ])->first(); $data['portfolio_categories'] = User\PortfolioCategory::query() ->where('status', 1) ->orderBy('serial_number', 'ASC') ->where('language_id', $userCurrentLang->id) ->where('user_id', $id) ->get(); $data['catId'] = $request->category; $data['portfolios'] = User\Portfolio::query() ->where('user_id', $id) ->orderBy('serial_number', 'ASC') ->where('language_id', $userCurrentLang->id) ->get(); return view('user-front.portfolio.index', $data); } public function userPortfolioDetail($domain, $slug, $id) { $user = getUser(); $userId = $user->id; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $portfolio = User\Portfolio::query()->findOrFail($id); $catId = $portfolio->category_id; $data['relatedPortfolios'] = User\Portfolio::where('category_id', $catId)->where('id', '<>', $portfolio->id)->where('user_id', $userId)->orderBy('id', 'DESC')->limit(5); $data['portfolio'] = $portfolio; $data['portfolio_categories'] = User\PortfolioCategory::query() ->where('status', 1) ->where('language_id', $userCurrentLang->id) ->where('user_id', $userId) ->orderBy('serial_number', 'ASC') ->get(); $data['allCount'] = User\Portfolio::where('language_id', $userCurrentLang->id)->where('user_id', $userId)->count(); return view('user-front.portfolio.show', $data); } public function userJobs(Request $request, $domain) { $user = getUser(); $id = $user->id; $data['user'] = $user; $cat_id = $request->category; $term = $request->term; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['home_text'] = User\HomePageText::query() ->where([ ['user_id', $id], ['language_id', $userCurrentLang->id] ])->first(); $data['jobs'] = User\Job::query() ->when($cat_id, function ($query, $cat_id) { return $query->where('jcategory_id', $cat_id); }) ->when($term, function ($query, $term) { return $query->where('title', 'LIKE', '%' . $term . '%'); }) ->where('user_id', $id) ->where('language_id', $userCurrentLang->id) ->orderBy('serial_number', 'ASC') ->paginate(4); $data['job_categories'] = User\Jcategory::query() ->where('status', 1) ->orderBy('serial_number', 'ASC') ->where('language_id', $userCurrentLang->id) ->where('user_id', $id) ->get(); $data['allCount'] = User\Job::query() ->where('user_id', $id) ->where('language_id', $userCurrentLang->id) ->count(); return view('user-front.job.index', $data); } public function userJobDetail($domain, $slug, $id) { $user = getUser(); $userId = $user->id; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['job'] = User\Job::query()->findOrFail($id); $data['latestJobs'] = User\Job::query() ->where('user_id', $userId) ->where('language_id', $userCurrentLang->id) ->orderBy('id', 'DESC') ->limit(3)->get(); $data['job_categories'] = User\Jcategory::query() ->where('status', 1) ->orderBy('serial_number', 'ASC') ->where('language_id', $userCurrentLang->id) ->where('user_id', $userId) ->get(); $data['allCount'] = User\Job::query() ->where('user_id', $userId) ->where('language_id', $userCurrentLang->id) ->count(); return view('user-front.job.show', $data); } public function userTeam($domain) { $user = getUser(); $id = $user->id; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['home_text'] = User\HomePageText::query() ->where([ ['user_id', $id], ['language_id', $userCurrentLang->id] ])->first(); $data['members'] = User\Member::query() ->where('user_id', $id) ->where('language_id', $userCurrentLang->id) ->get(); return view('user-front.team', $data); } public function userFaqs($domain) { $user = getUser(); $id = $user->id; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['home_text'] = User\HomePageText::query() ->where([ ['user_id', $id], ['language_id', $userCurrentLang->id] ])->first(); $data['faqs'] = User\FAQ::query() ->where('user_id', $id) ->where('language_id', $userCurrentLang->id) ->get(); return view('user-front.faqs', $data); } public function quote($domain) { $user = getUser(); if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $bs = User\BasicSetting::where('user_id', $user->id)->first(); if ($bs->is_quote == 0) { return view('errors.404'); } $data['inputs'] = QuoteInput::where([ ['language_id', $userCurrentLang->id], ['user_id', $user->id] ])->orderBy('order_number', 'ASC')->get(); return view('user-front.quote', $data); } public function sendquote(Request $request, $domain) { $user = getUser(); $keywords = getUserKeywords(); if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $quote_inputs = QuoteInput::where([ ['language_id', $userCurrentLang->id], ['user_id', $user->id] ])->get(); $rules = [ 'name' => 'required', 'email' => 'required|email' ]; $messages = [ 'name.required' => $keywords['name_required'] ?? __('Name is required') . '.', 'email.required' => $keywords['email_required'] ?? __('Email is required') . '.', 'email.email' => $keywords['email_invalid'] ?? __('Please enter a valid email address') . '.', ]; $userBs = BasicSetting::where('user_id', $user->id)->first(); if ($userBs->is_recaptcha == 1) { $rules['g-recaptcha-response'] = 'required|captcha'; } $messages = array_merge($messages, [ 'g-recaptcha-response.required' => $keywords['g_recaptcha_response_required'] ?? __('Please verify that you are not a robot') . '.', 'g-recaptcha-response.captcha' => $keywords['g_recaptcha_response_captcha'] ?? __('Captcha error! Try again later or contact site admin') . '.', ]); $allowedExts = array('zip'); foreach ($quote_inputs as $input) { if ($input->required == 1) { $rules["$input->name"][] = 'required'; } // check if input type is 5, then check for zip extension if ($input->type == 5) { $rules["$input->name"][] = function ($attribute, $value, $fail) use ($request, $input, $allowedExts, $keywords) { if ($request->hasFile("$input->name")) { $ext = $request->file("$input->name")->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { $fail($keywords['zip_file_only'] ?? __('Only zip file is allowed.') . '.'); } } }; } } $request->validate($rules, $messages); $fields = []; foreach ($quote_inputs as $key => $input) { $in_name = $input->name; // if the input is file, then move it to 'files' folder if ($input->type == 5) { if ($request->hasFile("$in_name")) { $fileName = uniqid() . '.' . $request->file("$in_name")->getClientOriginalExtension(); $directory = public_path('assets/front/files/'); @mkdir($directory, 0775, true); $request->file("$in_name")->move($directory, $fileName); $fields["$in_name"]['value'] = $fileName; $fields["$in_name"]['type'] = $input->type; } } else { if ($request["$in_name"]) { $fields["$in_name"]['value'] = $request["$in_name"]; $fields["$in_name"]['type'] = $input->type; } } } $jsonfields = json_encode($fields); $jsonfields = str_replace("\/", "/", $jsonfields); $quote = new Quote; $quote->name = $request->name; $quote->email = $request->email; $quote->user_id = $user->id; $quote->fields = $jsonfields; $quote->save(); $subject = $keywords['quote_request_subject'] ?? __('Quote Request Received'); $be = BE::first(); $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; if ($be->is_smtp == 1) { try { //Server settings $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; $mail->SMTPSecure = $be->encryption; $mail->Port = $be->smtp_port; $mail->CharSet = 'UTF-8'; $mail->addReplyTo($request->email); //Recipients $mail->setFrom($be->from_mail, $request->name); $mail->addAddress($user->email); // Add a recipient } catch (Exception $e) { Session::flash('error', $e->getMessage()); return back(); } } else { try { //Recipients $mail->setFrom($be->from_mail, $request->name); $mail->addReplyTo($request->email); $mail->addAddress($user->email); // Add a recipient } catch (Exception $e) { Session::flash('error', $e->getMessage()); return back(); } } $quoteReceivedMsg = $keywords['quote_request_email_body_intro'] ?? __('You have received a new quote request.'); $client_name = $keywords['quote_request_email_body_client_name'] ?? __('Client Name'); $client_mail = $keywords['quote_request_email_body_client_mail'] ?? __('Client Mail'); $message = '<div dir="ltr">' . $quoteReceivedMsg . '.<br/>' . '<strong dir="ltr">' . $client_name . ' - </strong><span dir="ltr">' . $request->name . '</span><br/>' . '<strong dir="ltr">' . $client_mail . ' - </strong><span dir="ltr">' . $request->email . '</span><br>' . '</div>'; if (!empty($fields) && is_array($fields)) { foreach ($fields as $key => $field) { if ($field['type'] != 5) { $message .= "<div><strong dir='ltr'>" . ucwords(str_replace("_", " ", $key)) . " - </strong>"; if (!is_array($field['value'])) { $message .= "<span dir='ltr'>" . $field['value'] . "</span>"; } else { $values = $field['value']; $i = 0; foreach ($values as $key => $value) { $i++; $message .= "<span dir='ltr'>" . $value . "</span>"; if (count($values) > $i) { $message .= ", "; } } } $message .= "</div>"; } } } $message .= "</div>"; // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = $subject; $mail->Body = $message; $mail->send(); $successMessage = $keywords['quote_request_sent_success'] ?? __('Quote request sent successfully'); Session::flash('success', $successMessage); return back(); } public function vcard($domain, $id) { $vcard = UserVcard::where('status', '=', 1)->findOrFail($id); $data['userBs'] = BasicSetting::select('is_recaptcha', 'google_recaptcha_site_key', 'google_recaptcha_secret_key') ->where('user_id', $vcard->user_id)->first(); Config::set('captcha.sitekey', $data['userBs']->google_recaptcha_site_key); Config::set('captcha.secret', $data['userBs']->google_recaptcha_secret_key); $count = $vcard->user->memberships()->where('status', '=', 1) ->where('start_date', '<=', Carbon::now()->format('Y-m-d')) ->where('expire_date', '>=', Carbon::now()->format('Y-m-d')) ->count(); // check if the vcard owner does not have membership if ($count == 0) { return view('errors.404'); } $cFeatures = UserPermissionHelper::packagePermission($vcard->user_id); $cFeatures = json_decode($cFeatures, true); if (empty($cFeatures) || !is_array($cFeatures) || !in_array('vCard', $cFeatures)) { return view('errors.404'); } $parsedUrl = parse_url(url()->current()); $host = $parsedUrl['host']; // if the current host contains the website domain if (strpos($host, env('WEBSITE_HOST')) !== false) { $host = str_replace("www.", "", $host); // if the current URL is subdomain if ($host != env('WEBSITE_HOST')) { $hostArr = explode('.', $host); $username = $hostArr[0]; if (strtolower($vcard->user->username) != strtolower($username) || !cPackageHasSubdomain($vcard->user)) { return view('errors.404'); } } else { $path = explode('/', $parsedUrl['path']); $username = $path[1]; if (strtolower($vcard->user->username) != strtolower($username)) { return view('errors.404'); } } } // if the current host doesn't contain the website domain (meaning, custom domain) else { // Always include 'www.' at the begining of host if (substr($host, 0, 4) == 'www.') { $host = $host; } else { $host = 'www.' . $host; } // if the current package doesn't have 'custom domain' feature || the custom domain is not connected $cdomain = UserCustomDomain::where('requested_domain', '=', $host)->orWhere('requested_domain', '=', str_replace("www.", "", $host))->where('status', 1)->firstOrFail(); $username = $cdomain->user->username; if (!cPackageHasCdomain($vcard->user) || ($username != $vcard->user->username)) { return view('errors.404'); } } $infos = json_decode($vcard->information, true); $prefs = []; if (!empty($vcard->preferences)) { $prefs = json_decode($vcard->preferences, true); } $keywords = json_decode($vcard->keywords, true); $data['vcard'] = $vcard; $data['infos'] = $infos; $data['prefs'] = $prefs; $data['keywords'] = $keywords; if ($vcard->template == 1) { return view('vcard.index1', $data); } elseif ($vcard->template == 2) { return view('vcard.index2', $data); } elseif ($vcard->template == 3) { return view('vcard.index3', $data); } elseif ($vcard->template == 4) { return view('vcard.index4', $data); } elseif ($vcard->template == 5) { return view('vcard.index5', $data); } elseif ($vcard->template == 6) { return view('vcard.index6', $data); } elseif ($vcard->template == 7) { return view('vcard.index7', $data); } elseif ($vcard->template == 8) { return view('vcard.index8', $data); } elseif ($vcard->template == 9) { return view('vcard.index9', $data); } elseif ($vcard->template == 10) { return view('vcard.index10', $data); } } public function vcardImport($domain, $id) { $vcard = UserVcard::findOrFail($id); // define vcard $vcardObj = new VCard(); // add personal data if (!empty($vcard->name)) { $vcardObj->addName($vcard->name); } if (!empty($vcard->company)) { $vcardObj->addCompany($vcard->company); } if (!empty($vcard->occupation)) { $vcardObj->addJobtitle($vcard->occupation); } if (!empty($vcard->email)) { $vcardObj->addEmail($vcard->email); } if (!empty($vcard->phone)) { $vcardObj->addPhoneNumber($vcard->phone, 'WORK'); } if (!empty($vcard->address)) { $vcardObj->addAddress($vcard->address); $vcardObj->addLabel($vcard->address); } if (!empty($vcard->website_url)) { $vcardObj->addURL($vcard->website_url); } $vcardObj->addPhoto(public_path('assets/front/img/user/vcard/' . $vcard->profile_image)); return \Response::make( $vcardObj->getOutput(), 200, $vcardObj->getHeaders(true) ); } public function changeLanguage($lang): \Illuminate\Http\RedirectResponse { session()->put('lang', $lang); app()->setLocale($lang); return redirect()->route('front.index'); } public function changeUserLanguage(Request $request, $domain) { $validLanguages = UserLanguage::where('user_id', getUser()->id) ->pluck('code') ->toArray(); if (in_array($request->code, $validLanguages)) { session()->put('user_lang', $request->code); } return redirect()->route('front.user.detail.view', $domain); } // public function changeUserLanguage(Request $request, $domain): \Illuminate\Http\RedirectResponse // { // dd(getUser()->id); // session()->put('user_lang', $request->code); // return redirect()->route('front.user.detail.view', $domain); // } public function userCPage($param, $slug) { $user = getUser(); $userId = $user->id; if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['page'] = User\Page::query()->where('user_id', $userId)->where('language_id', $userCurrentLang->id)->where('slug', $slug)->firstOrFail(); return view('user-front.custom-page', $data); } } Http/Controllers/Front/CustomerController.php 0000644 00000154331 15213350434 0015446 0 ustar 00 <?php namespace App\Http\Controllers\Front; use App\Constants\Constant; use Config; use User\HomePageText; use App\Models\Customer; use Illuminate\Support\Str; use Illuminate\Http\Request; use App\Models\User\Language; use App\Http\Helpers\Uploader; use App\Models\User\UserOrder; use App\Models\User\UserContact; use App\Models\User\BasicSetting; use Illuminate\Support\Facades\DB; use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\PHPMailer; use App\Http\Controllers\Controller; use App\Http\Helpers\UserPermissionHelper; use App\Models\User\BookmarkPost; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseEnrolment; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\CourseManagement\Lesson; use App\Models\User\CourseManagement\LessonComplete; use App\Models\User\CourseManagement\LessonContent; use App\Models\User\CourseManagement\LessonContentComplete; use App\Models\User\CourseManagement\LessonQuiz; use App\Models\User\CourseManagement\Module; use App\Models\User\CourseManagement\QuizScore; use App\Models\User\UserShopSetting; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use App\Models\User\CustomerWishList; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\DonationManagement\DonationDetail; use App\Models\User\HomePageText as UserHomePageText; use App\Models\User\HotelBooking\RoomBooking; use App\Models\User\UserEmailTemplate; use App\Models\User\UserOfflineGateway; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Carbon; class CustomerController extends Controller { public function __construct() { $user = getUser(); $userBs = BasicSetting::where('user_id', $user->id)->first(); Config::set('captcha.sitekey', $userBs->google_recaptcha_site_key); Config::set('captcha.secret', $userBs->google_recaptcha_secret_key); } public function login($domain, Request $request) { $user = getUser(); // when user have to redirect to check out page after login. return view('user-front.customer.login'); } public function orderdetails($domain, $id) { $user = getUser(); $userShop = UserShopSetting::where('user_id', $user->id)->first(); if (!empty($userShop) && ($userShop->is_shop == 0 || $userShop->catalog_mode == 1)) { return back(); } $data['currentLanguage'] = $this->getUserCurrentLanguage(getUser()->id); $data['defaultLanguage'] = Language::where('is_default', 1)->where('user_id', $user->id)->first(); $bex = UserShopSetting::where('user_id', $user->id)->first(); if ($bex->is_shop == 0) { return back(); } $data['data'] = UserOrder::findOrFail($id); return view('user-front.customer.order_details', $data); } public function onlineSuccess() { Session::forget('user_coupon'); Session::forget('coupon_amount'); return view('user-front.success'); } public function loginSubmit(Request $request, $domain) { $keywords = getUserKeywords(); $messages = [ 'email.required' => $keywords['email_required'] ?? __('Email is required') . '.', 'email.email' => $keywords['email_invalid'] ?? __('Please enter a valid email address') . '.', 'password.required' => $keywords['password_required'] ?? __('Password is required') . '.', ]; // at first, get the url from session which will be redirected after login if ($request->session()->has('link')) { $redirectURL = $request->session()->get('link'); } else { $redirectURL = null; } $rules = [ 'email' => 'required|email', 'password' => 'required' ]; $ubs = BasicSetting::where('user_id', getUser()->id)->first(); if ($ubs->is_recaptcha == 1) { $rules['g-recaptcha-response'] = 'required|captcha'; $messages = array_merge($messages,[ 'g-recaptcha-response.required' => $keywords['g_recaptcha_response_required'] ?? __('Please verify that you are not a robot') . '.', 'g-recaptcha-response.captcha' => $keywords['g_recaptcha_response_captcha'] ?? __('Captcha error! try again later or contact site admin') . '.', ]); } $request->validate($rules, $messages); // get the email and password which has provided by the user $credentials = $request->only('email', 'password', 'user_id'); // login attempt if (Auth::guard('customer')->attempt($credentials)) { $authUser = Auth::guard('customer')->user(); // first, check whether the user's email address verified or not if ($authUser->email_verified_at == null) { $verifyMessage = isset($keywords['please_verify_your_email_address']) ? $keywords['please_verify_your_email_address'] . '!' : __('Please, verify your email address') . '.'; $request->session()->flash('error', $verifyMessage); // logout auth user as condition not satisfied Auth::guard('customer')->logout(); return redirect()->back(); } // second, check whether the user's account is active or not if ($authUser->status == 0) { $deactivatedMessage = $keywords['account_deactivated'] ?? __('Sorry, your account has been deactivated') . '.'; $request->session()->flash('error', $deactivatedMessage); // logout auth user as condition not satisfied Auth::guard('customer')->logout(); return redirect()->back(); } // otherwise, redirect auth user to next url if ($redirectURL == null) { return redirect()->route('customer.dashboard', getParam()); } else { // before, redirect to next url forget the session value $request->session()->forget('link'); return redirect($redirectURL); } } else { $invalidCredentialsMessage = $keywords['invalid_credentials'] ?? __('The provided credentials do not match our records') . '!'; $request->session()->flash('error', $invalidCredentialsMessage); return redirect()->back(); } } public function forgetPassword($domain) { $user = getUser(); return view('user-front.customer.forget-password'); } public function sendMail(Request $request) { $keywords = getUserKeywords(); $rules = [ 'email' => [ 'required', 'email:rfc,dns', ] ]; $messages = [ 'email.required' => $keywords['email_required'] ?? __('Email is required') . '.', 'email.email' => $keywords['email_invalid'] ?? __('Please enter a valid email address') . '.', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $user = Customer::where([['email', $request->email], ['user_id', getUser()->id]])->first(); if (is_null($user)) { $noUserMessage = $keywords['no_user_found'] ?? __('No user found') . '!'; $request->session()->flash('error', $noUserMessage); return redirect()->back(); } // first, get the mail template information from db $mailTemplate = UserEmailTemplate::where('user_id', getUser()->id)->where('email_type', 'reset_password')->first(); $mailSubject = $mailTemplate->email_subject; $mailBody = $mailTemplate->email_body; // second, send a password reset link to user via email $info = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_port', 'encryption', 'smtp_username', 'smtp_password', 'from_mail', 'from_name') ->first(); $websiteInfo = DB::table('user_basic_settings')->where('user_id', getUser()->id) ->select(['website_title', 'from_name', 'email']) ->first(); $name = $user->first_name . ' ' . $user->last_name; $clickHereText = $keywords['click_here'] ?? __('Click Here'); $link = '<a href="' . route('customer.reset_password', getParam()) . '">' . $clickHereText . '</a>'; $mailBody = str_replace('{customer_name}', $name, $mailBody); $mailBody = str_replace('{password_reset_link}', $link, $mailBody); $mailBody = str_replace('{website_title}', $websiteInfo->website_title, $mailBody); // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; // if smtp status == 1, then set some value for PHPMailer if ($info->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $info->smtp_host; $mail->SMTPAuth = true; $mail->Username = $info->smtp_username; $mail->Password = $info->smtp_password; if ($info->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; } $mail->Port = $info->smtp_port; } // finally, add other information and send the mail try { $mail->setFrom($info->from_mail, $websiteInfo->from_name); $mail->addAddress($request->email); $mail->addReplyTo($websiteInfo->email, $websiteInfo->from_name); $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); $successMessage = $keywords['mail_sent_success'] ?? __('A mail has been sent to your email address') . '.'; $request->session()->flash('success', $successMessage); } catch (Exception $e) { $errorMessage = $keywords['mail_send_error'] ?? __('Mail could not be sent') . '!'; $request->session()->flash('error', $errorMessage); } // store user email in session to use it later $request->session()->put('userEmail', $user->email); return redirect()->back(); } public function resetPassword($domain) { $user = getUser(); return view('user-front.customer.reset-password'); } public function resetPasswordSubmit(Request $request, $domain) { $author = getUser(); $keywords = getUserKeywords(); // get the user email from session $emailAddress = $request->session()->get('userEmail'); $rules = [ 'new_password' => 'required|confirmed', 'new_password_confirmation' => 'required' ]; $messages = [ 'new_password.required' => $keywords['new_password_required'] ?? __('New password is required') . '.', 'new_password.confirmed' => $keywords['password_confirmation_failed'] ?? __('Password confirmation failed') . '.', 'new_password_confirmation.required' => $keywords['confirm_new_password_required'] ?? __('The confirm new password field is required') . '.', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } $user = Customer::where('email', $emailAddress)->where('user_id', $author->id)->first(); $user->update([ 'password' => Hash::make($request->new_password) ]); $successMessage = $keywords['password_updated_successfully'] ?? __('Password updated successfully') . '.'; $request->session()->flash('success', $successMessage); return redirect()->route('customer.login', getParam()); } public function signup($domain) { $user = getUser(); return view('user-front.customer.signup', $user); } public function contact(Request $request, $domain) { $user = getUser(); $data['user'] = $user; if (session()->has('user_lang')) { $userCurrentLang = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['contact'] = UserContact::where([ ['user_id', $data['user']->id], ['language_id', $userCurrentLang->id] ])->first(); $data['home_text'] = UserHomePageText::query() ->where([ ['user_id', $data['user']->id], ['language_id', $userCurrentLang->id] ])->first(); return view('user-front.contact', $data); } public function signupSubmit(Request $request, $domain) { $user = getUser(); $keywords = getUserKeywords(); $rules = [ 'username' => [ 'required', 'max:255', function ($attribute, $value, $fail) use ($user, $keywords) { if (Customer::where('username', $value)->where('user_id', $user->id)->count() > 0) { $fail($keywords['username_taken'] ?? __('Username has already been taken') . '.'); } } ], 'email' => ['required', 'email', 'max:255', function ($attribute, $value, $fail) use ($user, $keywords) { if (Customer::where('email', $value)->where('user_id', $user->id)->count() > 0) { $fail($keywords['email_taken'] ?? __('Email has already been taken') . '.'); } }], 'password' => 'required|confirmed', 'password_confirmation' => 'required' ]; $messages = [ 'username.required' => $keywords['username_required'] ?? __('Username is required') . '.', 'username.max' => $keywords['username_max'] ?? __('Username may not be greater than 255 characters') . '.', 'email.required' => $keywords['email_required'] ?? __('Email is required') . '.', 'email.email' => $keywords['email_invalid'] ?? __('Please enter a valid email address') . '.', 'email.max' => $keywords['email_max'] ?? __('Email may not be greater than 255 characters') . '.', 'password.required' => $keywords['password_required'] ?? __('Password is required') . '.', 'password.confirmed' => $keywords['password_confirmation_failed'] ?? __('Password confirmation failed') . '.', 'password_confirmation.required' => $keywords['confirm_password_required'] ?? __('The confirm password field is required') . '.', ]; $ubs = BasicSetting::where('user_id', getUser()->id)->first(); if ($ubs->is_recaptcha == 1) { $rules['g-recaptcha-response'] = 'required|captcha'; $messages = array_merge($messages, [ 'g-recaptcha-response.required' => $keywords['g_recaptcha_response_required'] ?? __('Please verify that you are not a robot') . '.', 'g-recaptcha-response.captcha' => $keywords['g_recaptcha_response_captcha'] ?? __('Captcha error! try again later or contact site admin') . '.', ]); } $request->validate($rules, $messages); $customer = new Customer; $customer->username = $request->username; $customer->email = $request->email; $customer->user_id = $user->id; $customer->password = Hash::make($request->password); // first, generate a random string $randStr = Str::random(20); // second, generate a token $token = md5($randStr . $request->username . $request->email); $customer->verification_token = $token; $customer->save(); // send a mail to user for verify his/her email address if ($ubs->email_verification_status == 1) { $this->sendVerificationMail($request, $token); $emailVerifyMessage = ($keywords['email_verification_sent_part1'] ?? __('We need to verify your email address. We have sent an email to ')) . $request->email . ($keywords['email_verification_sent_part2'] ?? __(' to verify your email address. Please click the link in that email to continue.')); $message = ['sendmail' => $emailVerifyMessage]; } else { $message = []; } return redirect() ->back() ->with($message); } public function sendVerificationMail(Request $request, $token) { $user = getUser(); $keywords = getUserKeywords(); // first get the mail template information from db $mailTemplate = UserEmailTemplate::where('user_id', $user->id) ->where('email_type', 'email_verification') ->first(); $mailSubject = $mailTemplate->email_subject; $mailBody = $mailTemplate->email_body; // second get the website title & mail's smtp information from db $info = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_port', 'encryption', 'smtp_username', 'smtp_password', 'from_mail', 'from_name') ->first(); $websiteInfo = BasicSetting::where('user_id', $user->id)->select('website_title')->first(); $clickHereText = $keywords['click_here'] ?? __('Click Here'); // Create verification link with customizable anchor text $link = '<a href="' . route('customer.signup.verify', ['token' => $token, getParam()]) . '">' . $clickHereText . '</a>'; // replace template's curly-brace string with actual data $mailBody = str_replace('{customer_name}', $request->username, $mailBody); $mailBody = str_replace('{verification_link}', $link, $mailBody); $mailBody = str_replace('{website_title}', $websiteInfo->website_title, $mailBody); $userInfo = BasicSetting::where('user_id', $user->id)->select('email', 'from_name')->first(); $email = $userInfo->email ?? $user->email; $name = $userInfo->from_name ?? $user->username; // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; // if smtp status == 1, then set some value for PHPMailer if ($info->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $info->smtp_host; $mail->SMTPAuth = true; $mail->Username = $info->smtp_username; $mail->Password = $info->smtp_password; if ($info->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; } $mail->Port = $info->smtp_port; } // finally, add other information and send the mail try { $mail->setFrom($info->from_mail, $name); $mail->addReplyTo($email); $mail->addAddress($request->email); $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); $successMessage = $keywords['verification_mail_sent'] ?? __('A verification mail has been sent to your email address') . '.'; $request->session()->flash('success', $successMessage); } catch (\Exception $e) { $errorMessage = $keywords['mail_send_error'] ?? __('Mail could not be sent!') . '.'; $request->session()->flash('error', $errorMessage); } return; } public function signupVerify(Request $request, $domain, $token) { $keywords = getUserKeywords(); try { $user = Customer::where('verification_token', $token)->firstOrFail(); // after verify user email, put "null" in the "verification token" $user->update([ 'email_verified_at' => date('Y-m-d H:i:s'), 'status' => 1, 'verification_token' => null ]); $successMessage = $keywords['email_verified_success'] ?? __('Your email has been verified') . '.'; $request->session()->flash('success', $successMessage); // after email verification, authenticate this user Auth::guard('customer')->login($user); return redirect()->route('customer.dashboard', getParam()); } catch (ModelNotFoundException $e) { $errorMessage = $keywords['email_verification_failed'] ?? __('Could not verify your email!') . '.'; $request->session()->flash('error', $errorMessage); return redirect()->route('customer.signup', getParam()); } } public function redirectToDashboard($domain) { $data['author'] = getUser(); $data['language'] = $this->getUserCurrentLanguage($data['author']->id); $data['authUser'] = Auth::guard('customer')->user(); $data['totalorders'] = UserOrder::where('customer_id', Auth::guard('customer')->user()->id)->orderBy('id', 'DESC')->count(); $data['totalwishlist'] = CustomerWishList::where('customer_id', Auth::guard('customer')->user()->id)->orderBy('id', 'DESC')->count(); $data['orders'] = UserOrder::where('customer_id', Auth::guard('customer')->user()->id)->orderBy('id', 'DESC')->limit(7)->get(); $data['couseCount'] = CourseEnrolment::where('customer_id', Auth::guard('customer')->user()->id)->where('payment_status', 'completed')->count(); $data['roomSetting'] = DB::table('user_room_settings')->where('user_id', $data['author']->id)->first(); $data['roomBookingCount'] = RoomBooking::where('customer_id', Auth::guard('customer')->user()->id)->where('payment_status', 1)->count(); return view('user-front.customer.dashboard', $data); } public function roomBookings() { $authCustomer = Auth::guard('customer')->user(); $data['author'] = getUser(); $queryResult['roomBookingInfos'] = RoomBooking::where('customer_id', $authCustomer->id)->orderBy('id', 'DESC')->get(); $queryResult['langInfo'] = $this->getUserCurrentLanguage($data['author']->id); return view('user-front.customer.room-bookings', $queryResult); } public function roomBookingDetails($username, $id) { $roomBooking = RoomBooking::findOrFail($id); $queryResult['details'] = $roomBooking; $queryResult['userInfo'] = $roomBooking->roomBookedByUser()->firstOrFail(); return view('user-front.customer.room-booking-details', $queryResult); } public function editProfile() { $user = getUser(); $queryResult['authUser'] = Auth::guard('customer')->user(); return view('user-front.customer.edit-profile', $queryResult); } public function updateProfile(Request $request) { $keywords = getUserKeywords(); $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $messages = [ 'image.required' => $keywords['image_required'] ?? __('The image field is required') . '.', ]; $rules = [ 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts, $keywords) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { $fail($keywords['image_invalid_extension'] ?? __('Only png, jpg, jpeg image is allowed') . '.'); } } }, ], ]; $request->validate($rules, $messages); $authUser = Auth::guard('customer')->user(); if ($request->hasFile('image')) { // first, delete the previous image from local storage @unlink(public_path('assets/user/img/users/' . $authUser->image)); // second, set a name for the new image and store it to local storage $proPic = $request->file('image'); $picName = time() . '.' . $proPic->getClientOriginalExtension(); $directory = public_path('assets/user/img/users/'); @mkdir($directory, 0775, true); $proPic->move($directory, $picName); } $authUser->update($request->except('image') + [ 'image' => $request->exists('image') ? $picName : $authUser->image ]); $successMessage = $keywords['profile_update_success'] ?? __('Your profile updated successfully') . '.'; $request->session()->flash('success', $successMessage); return redirect()->back(); } public function slider($domain, Request $request) { $filename = null; $keywords = getUserKeywords(); $rules = [ 'file' => 'mimes:jpg,jpeg,png|required', ]; $messages = [ 'file.mimes' => $keywords['file_mimes'] ?? __('The file must be a JPEG, JPG, or PNG image') . '.', 'file.required' => $keywords['file_required'] ?? __('A file is required') . '.', ]; $request->validate($rules, $messages); if ($request->hasFile('file')) { $filename = Uploader::upload_picture(public_path('assets/user/img/ads/slider-images'), $request->file('file')); } return response()->json([ 'status' => 'success', 'file_id' => $filename, 'message' => $keywords['upload_success'] ?? __('File uploaded successfully') . '.' ]); } public function changePassword() { $data['authUser'] = Auth::guard('customer')->user(); return view('user-front.customer.change-password', $data); } public function updatePassword(Request $request) { $keywords = getUserKeywords(); $rules = [ 'current_password' => [ 'required', function ($attribute, $value, $fail) use ($keywords) { if (!Hash::check($value, Auth::guard('customer')->user()->password)) { $fail($keywords['current_password_incorrect'] ?? __('Your password was not updated, since the provided current password does not match.') . '.'); } } ], 'new_password' => 'required|confirmed', 'new_password_confirmation' => 'required' ]; $messages = [ 'current_password.required' => $keywords['current_password_required'] ?? __('Current password is required') . '.', 'new_password.required' => $keywords['new_password_required'] ?? __('New password is required') . '.', 'new_password.confirmed' => $keywords['new_password_confirmed'] ?? __('Password confirmation failed') . '.', 'new_password_confirmation.required' => $keywords['confirm_new_password_required'] ?? __('The confirm new password field is required') . '.', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } $user = Auth::guard('customer')->user(); $user->update([ 'password' => Hash::make($request->new_password) ]); $successMessage = $keywords['password_updated_successfully'] ?? __('Password updated successfully') . '.'; $request->session()->flash('success', $successMessage); return redirect()->back(); } public function logoutSubmit(Request $request, $domain) { Auth::guard('customer')->logout(); return redirect()->route('customer.login', getParam()); } public function shippingdetails($domain) { $user = getUser(); $userShop = UserShopSetting::where('user_id', $user->id)->first(); if (!empty($userShop) && ($userShop->is_shop == 0 || $userShop->catalog_mode == 1)) { return back(); } $user = Auth::guard('customer')->user(); return view('user-front.customer.shipping_details', compact('user')); } public function shippingupdate(Request $request) { $keywords = getUserKeywords(); $rules = [ "shpping_fname" => 'required', "shpping_lname" => 'required', "shpping_email" => 'required', "shpping_number" => 'required', "shpping_city" => 'required', "shpping_state" => 'required', "shpping_address" => 'required', "shpping_country" => 'required', ]; $messages = [ "shpping_fname.required" => $keywords['shpping_fname_required'] ?? __('First name is required.') . '.', "shpping_lname.required" => $keywords['shpping_lname_required'] ?? __('Last name is required.') . '.', "shpping_email.required" => $keywords['shpping_email_required'] ?? __('Email is required.') . '.', "shpping_number.required" => $keywords['shpping_number_required'] ?? __('Phone number is required.') . '.', "shpping_city.required" => $keywords['shpping_city_required'] ?? __('City is required.') . '.', "shpping_state.required" => $keywords['shpping_state_required'] ?? __('State is required.') . '.', "shpping_address.required" => $keywords['shpping_address_required'] ?? __('Address is required.') . '.', "shpping_country.required" => $keywords['shpping_country_required'] ?? __('Country is required.') . '.', ]; $request->validate($rules, $messages); Auth::guard('customer')->user()->update($request->all()); $successMessage = $keywords['shipping_update_success'] ?? __('Shipping details updated successfully') . '.'; Session::flash('success', $successMessage); return back(); } public function billingdetails() { $user = getUser(); $userShop = UserShopSetting::where('user_id', $user->id)->first(); if (!empty($userShop) && ($userShop->is_shop == 0 || $userShop->catalog_mode == 1)) { return back(); } Auth::guard('customer')->user(); return view('user-front.customer.billing_details', compact('user')); } public function billingupdate(Request $request) { $keywords = getUserKeywords(); $rules = [ "billing_fname" => 'required', "billing_lname" => 'required', "billing_email" => 'required', "billing_number" => 'required', "billing_city" => 'required', "billing_state" => 'required', "billing_address" => 'required', "billing_country" => 'required', ]; $messages = [ "billing_fname.required" => $keywords['billing_fname_required'] ?? __('First name is required') . '.', "billing_lname.required" => $keywords['billing_lname_required'] ?? __('Last name is required') . '.', "billing_email.required" => $keywords['billing_email_required'] ?? __('Email is required') . '.', "billing_number.required" => $keywords['billing_number_required'] ?? __('Phone number is required') . '.', "billing_city.required" => $keywords['billing_city_required'] ?? __('City is required') . '.', "billing_state.required" => $keywords['billing_state_required'] ?? __('State is required') . '.', "billing_address.required" => $keywords['billing_address_required'] ?? __('Address is required') . '.', "billing_country.required" => $keywords['billing_country_required'] ?? __('Country is required') . '.', ]; $request->validate($rules, $messages); Auth::guard('customer')->user()->update($request->all()); $successMessage = $keywords['billing_update_success'] ?? __('Billing details updated successfully') . '.'; Session::flash('success', $successMessage); return back(); } public function customerOrders($domain) { $user = getUser(); $userShop = UserShopSetting::where('user_id', $user->id)->first(); if (!empty($userShop) && ($userShop->is_shop == 0 || $userShop->catalog_mode == 1)) { return back(); } $bex = UserShopSetting::where('user_id', $user->id)->first(); if ($bex->is_shop == 0) { return back(); } $data['orders'] = UserOrder::where('customer_id', Auth::guard('customer')->user()->id)->orderBy('id', 'DESC')->get(); return view('user-front.customer.order', $data); } public function myBookmarks($domain) { $user = getUser(); // $queryResult['bgImg'] = $this->getUserBreadcrumb($user->id); $authUser = Auth::guard('customer')->user(); $queryResult['bookmarks'] = BookmarkPost::where('user_id', $authUser->id) ->where('author_id', $user->id) ->orderBy('id', 'desc') ->get(); if (session()->has('user_lang') && !empty($user)) { $language = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($language)) { $language = Language::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $language->code); } } else { $language = Language::where('is_default', 1)->where('user_id', $user->id)->first(); } $queryResult['language'] = $language; return view('user-front.customer.my-bookmarks', $queryResult); } public function customerWishlist($domain) { $user = getUser(); if (session()->has('user_lang') && !empty($user)) { $data['language'] = Language::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($data['language'])) { $data['language'] = Language::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $data['language']->code); } } else { $data['language'] = Language::where('is_default', 1)->where('user_id', $user->id)->first(); } $data['wishlist'] = CustomerWishList::where('customer_id', Auth::guard('customer')->user()->id) ->with('item.itemContents') ->orderBy('id', 'DESC')->get(); return view('user-front.customer.wishlist', $data); } public function removefromWish($domain, $id) { $keywords = getUserKeywords(); $data['wishlist'] = CustomerWishList::findOrFail($id)->delete(); $message = $keywords['wishlist_item_removed'] ?? __('Item removed from wishlist successfully.') . '.'; return response()->json(['message' => $message]); } public function paymentInstruction(Request $request) { $user = getUser(); $offline = UserOfflineGateway::where('user_id', $user->id)->where('name', $request->name) ->select('short_description', 'instructions', 'is_receipt') ->first(); return response()->json([ 'description' => $offline->short_description, 'instructions' => $offline->instructions ?? '', 'is_receipt' => $offline->is_receipt ]); } public function myCourses($domain) { $user = getUser(); $language = $this->getUserCurrentLanguage($user->id); $customer = Auth::guard('customer')->user(); $enrols = $customer->courseEnrolment()->where(function ($query) { $query->where('payment_status', 'completed') ->orWhere('payment_status', 'free'); })->where('user_id', $user->id)->orderByDesc('id')->get(); $enrols->map(function ($enrol) use ($language, $user) { $course = $enrol->course()->where('user_id', $user->id)->first(); $courseInfo = $course->courseInformation()->where('language_id', $language->id)->where('user_id', $user->id)->first(); if (empty($courseInfo)) { $language = Language::where('is_default', 1)->where('user_id', $user->id)->first(); $courseInfo = $course->courseInformation()->where('language_id', $language->id)->where('user_id', $user->id)->first(); } $enrol['title'] = CourseInformation::query()->where('language_id', '=', $language->id) ->where('user_id', $user->id) ->where('course_id', '=', $course->id) ->pluck('title') ->first(); $enrol['slug'] = CourseInformation::query()->where('language_id', '=', $language->id) ->where('user_id', $user->id) ->where('course_id', '=', $course->id) ->pluck('slug') ->first(); $module = !empty($courseInfo) ? $courseInfo->module()->where('user_id', $user->id)->where('status', 'published')->first() : NULL; $lesson = !empty($module) ? $module->lesson()->where('user_id', $user->id)->where('status', 'published')->first() : NULL; $enrol['lesson_id'] = !empty($lesson) ? $lesson->id : NULL; }); $queryResult['enrolments'] = $enrols; return view('user-front.customer.course_management.my-courses', $queryResult); } public function purchaseHistory() { $user = getUser(); $language = $this->getUserCurrentLanguage($user->id); $customer = Auth::guard('customer')->user(); $enrols = $customer->courseEnrolment()->orderByDesc('id')->get(); $enrols->map(function ($enrol) use ($language, $user) { $course = $enrol->course()->first(); $courseInfo = $course->courseInformation()->where('language_id', $language->id)->first(); if (empty($courseInfo)) { $language = Language::where([ ['is_default', 1], ['user_id', $user->id]]) ->first(); $courseInfo = $course->courseInformation()->where('language_id', $language->id)->first(); } if (!empty($courseInfo)) { $enrol['title'] = $courseInfo->title; $enrol['slug'] = $courseInfo->slug; } }); $queryResult['allPurchase'] = $enrols; return view('user-front.customer.course_management.purchase-history', $queryResult); } public function curriculum(Request $request, $domain, $id) { if (!Auth::guard('customer')->check() && !Auth::guard('web')->check()) { return redirect()->route('customer.login', getParam()); } $user = getUser(); $language = $this->getUserCurrentLanguage($user->id); $defaultLanguage = Language::where('is_default', 1)->where('user_id', $user->id)->first(); if (Auth::guard('customer')->check()) { $enrolCount = CourseEnrolment::where('customer_id', Auth::guard('customer')->user()->id)->where('course_id', $id)->where('user_id', $user->id)->count(); if ($enrolCount == 0) { return redirect()->route('customer.my_courses', getParam()); } } $course = Course::find($id); $queryResult['certificateStatus'] = $course->certificate_status; $courseInfo = $course->courseInformation()->where('language_id', $language->id)->first(); if (empty($courseInfo)) { // $language = Language::where('is_default', 1)->first(); $courseInfo = $course->courseInformation()->where('language_id', $defaultLanguage->id)->first(); } if (!empty($courseInfo)) { $queryResult['courseTitle'] = $courseInfo->title; $modules = $courseInfo->module()->where('status', 'published')->orderBy('serial_number', 'asc')->get(); $lessonId = $request['lesson_id']; // put lesson id into session to use it in middleware $request->session()->put('lessonId', $lessonId); $lesson = Lesson::find($lessonId); if (!empty($lesson)) { $queryResult['lessonTitle'] = $lesson->title; $queryResult['lessonContents'] = $lesson->content()->orderBy('order_no', 'asc')->get(); $queryResult['quizzes'] = $lesson->quiz()->get(); } // update lesson completion status $lessonCompleted = false; // when certificate system is enabled then execute this code if (!empty($lesson)) { if ($course->certificate_status == 1) { $totalVideo = $lesson->content()->where('type', 'video')->count(); $totalQuiz = $lesson->content()->where('type', 'quiz')->count(); if ($course->video_watching == 0 && ($totalVideo > 0 && $totalQuiz == 0)) { // if video watching disabled and, lesson has only video then complete the lesson $lessonCompleted = true; } else if ($course->quiz_completion == 0 && ($totalQuiz > 0 && $totalVideo == 0)) { // if quiz completion disabled and, lesson has only quiz then complete the lesson $lessonCompleted = true; } else if (($course->video_watching == 0 && $course->quiz_completion == 0) && ($totalVideo > 0 && $totalQuiz > 0)) { // if both video watching & quiz completion disabled and, lesson has both video & quiz then complete the lesson $lessonCompleted = true; } else if ($totalVideo == 0 && $totalQuiz == 0) { // if lesson does not have both video & quiz then complete the lesson $lessonCompleted = true; } } else { // when certificate system is disabled then execute this code $lessonCompleted = true; } if (Auth::guard('customer')->check() && $lessonCompleted == true) { $lcCount = LessonComplete::where('customer_id', Auth::guard('customer')->user()->id)->where('lesson_id', $lessonId)->count(); if ($lcCount == 0) { $lc = new LessonComplete(); $lc->user_id = $user->id; $lc->customer_id = Auth::guard('customer')->user()->id; $lc->lesson_id = $lessonId; $lc->save(); } } } $modules->map(function ($module) { $module['lessons'] = $module->lesson()->where('status', 'published')->orderBy('serial_number', 'asc')->get(); }); $queryResult['modules'] = $modules; } return view('user-front.customer.course_management.course-curriculum', $queryResult); } public function downloadFile(Request $request, $domain, $id) { $keywords = getUserKeywords(); $user = getUser(); $bs = BasicSetting::query() ->where('user_id', $user->id) ->first(); $content = LessonContent::query() ->where('user_id', $user->id) ->find($id); try { return Uploader::downloadFile(Constant::WEBSITE_LESSON_CONTENT_FILE, $content->file_unique_name, $content->file_original_name, $bs); } catch (FileNotFoundException $e) { $errorMessage = $keywords['file_not_found_error'] ?? __('Sorry, this file does not exist anymore') . '!'; session()->flash('error', $errorMessage); return redirect()->back(); } } public function checkAns(Request $request, $domain) { $user = getUser(); $id = $request['quizId']; $answers = $request['answers']; $quiz = LessonQuiz::query() ->where('user_id', $user->id) ->find($id); $qas = json_decode($quiz->answers); // find out how many right answer has been selected by admin $rightAnsCount = 0; foreach ($qas as $qa) { if ($qa->rightAnswer == 1) { $rightAnsCount++; } } // find out how many correct answer has been given by user $correctAnsCount = 0; foreach ($answers as $ans) { foreach ($qas as $qa) { if ($ans == $qa->option && $qa->rightAnswer == 1) { $correctAnsCount++; } } } if (($rightAnsCount == $correctAnsCount) && (count($answers) == $rightAnsCount)) { return response()->json(['status' => 'Correct']); } else { return response()->json(['status' => 'Incorrect']); } } public function storeQuizScore(Request $request, $domain) { $keywords = getUserKeywords(); $user = getUser(); $authUser = Auth::guard('customer')->user(); $courseId = $request['courseId']; $lessonId = $request['lessonId']; QuizScore::updateOrCreate( [ 'user_id' => $user->id, 'customer_id' => $authUser->id, 'course_id' => $courseId, 'lesson_id' => $lessonId ], ['score' => $request['score']] ); $message = $keywords['quiz_score_stored'] ?? __('Quiz score stored successfully') . '.'; return response()->json(['message' => $message]); } public function contentCompletion(Request $request, $domain) { $user = getUser(); $customer = Auth::guard('customer')->user(); // update lesson-content completion status $id = $request['id']; $content = LessonContent::find($id); if ($content->type == 'video') { $lccCount1 = LessonContentComplete::where('customer_id', $customer->id)->where('lesson_id', $content->lesson_id)->where('lesson_content_id', $id)->where('type', 'video')->count(); if ($lccCount1 == 0) { $lcc = new LessonContentComplete; $lcc->user_id = $user->id; $lcc->customer_id = $customer->id; $lcc->lesson_id = $content->lesson_id; $lcc->lesson_content_id = $id; $lcc->type = 'video'; $lcc->save(); } } // update lesson completion status $videoCompleted = false; $quizCompleted = false; $lessonCompleted = false; $courseId = (int)$request['courseId']; $course = Course::find($courseId); $lessonId = (int)$request['lessonId']; $lesson = Lesson::find($lessonId); // if video watching enabled then execute this code if ($course->video_watching == 1) { $totalVideo = $lesson->content()->where('type', 'video')->count(); if ($totalVideo > 0) { $totalCompletedVideo = LessonContentComplete::where('lesson_id', $lessonId)->where('customer_id', $customer->id)->where('user_id', $user->id)->where('type', 'video')->count(); if ($totalVideo <= $totalCompletedVideo) { $videoCompleted = true; } } else { $videoCompleted = true; } } // if quiz completion enabled then execute this code if ($course->quiz_completion == 1) { $totalQuiz = $lesson->content()->where('type', 'quiz')->count(); $quizScore = QuizScore::select('score')->where('course_id', $courseId)->where('lesson_id', $lessonId)->where('customer_id', $customer->id)->first(); if ($totalQuiz > 0) { if (!empty($quizScore) && $quizScore->score >= $course->min_quiz_score) { $quizCompleted = true; } } else { $quizCompleted = true; } if ($content->type == 'quiz' && $quizCompleted == true) { $lccCount2 = LessonContentComplete::where('customer_id', $customer->id)->where('lesson_id', $content->lesson_id)->where('lesson_content_id', $id)->where('type', 'quiz')->count(); if ($lccCount2 == 0) { $lcc = new LessonContentComplete(); $lcc->user_id = $user->id; $lcc->customer_id = $customer->id; $lcc->lesson_id = $content->lesson_id; $lcc->lesson_content_id = $id; $lcc->type = 'quiz'; $lcc->save(); } } } if (($course->video_watching == 1 && $course->quiz_completion == 0) && $videoCompleted == true) { // only video watching enabled, and watched all the videos $lessonCompleted = true; } else if (($course->video_watching == 0 && $course->quiz_completion == 1) && $quizCompleted == true) { // only quiz completion enabled, and passed the quizzes $lessonCompleted = true; } else if (($course->video_watching == 1 && $course->quiz_completion == 1) && ($videoCompleted == true && $quizCompleted == true)) { // both video watching & quiz completion enabled, and both is completed $lessonCompleted = true; } else if ($course->video_watching == 0 && $course->quiz_completion == 0) { // both video watching & quiz completion disabled $lessonCompleted = true; } if ($lessonCompleted == true) { $lcCount = LessonComplete::where('customer_id', $customer->id)->where('user_id', $user->id)->where('lesson_id', $lessonId)->count(); if ($lcCount == 0) { $lc = new LessonComplete(); $lc->user_id = $user->id; $lc->customer_id = $customer->id; $lc->lesson_id = $lessonId; $lc->save(); } } return response()->json(['status' => 'Success', 'lessonCompleted' => $lessonCompleted, 'videoCompleted' => $videoCompleted], 200); } public function getCertificate($domain, $id) { $keywords = getUserKeywords(); $user = getUser(); $courseCompleted = false; $language = $this->getUserCurrentLanguage($user->id); $course = Course::query()->where('user_id', $user->id)->find($id); $permissions = UserPermissionHelper::packagePermission($user->id); $permissions = json_decode($permissions, true); $queryResult['certificateStatus'] = $course->certificate_status; // || (!empty($permissions) && !in_array('Course Completion Certificate', $permissions)) if ($course->certificate_status != 1) { return back(); } $courseInfo = CourseInformation::query() ->where('user_id', $user->id) ->where('course_id', $course->id) ->where('language_id', $language->id) ->first(); if (empty($courseInfo)) { $warningMessage = $keywords['no_information_found'] ?? __('No Information Found!') . '.'; Session::flash('warning', $warningMessage); return back(); } $modules = Module::query() ->where('course_information_id', $courseInfo->id) ->where('user_id', $user->id) ->where('status', 'published') ->orderBy('serial_number', 'ASC') ->get(); foreach ($modules as $module) { $lessons = Lesson::query() ->where('module_id', $module->id) ->where('status', 'published') ->orderBy('serial_number', 'ASC') ->get(); foreach ($lessons as $lesson) { if ($lesson->lesson_complete()->where('customer_id', Auth::guard('customer')->user()->id)->count() > 0) { $courseCompleted = true; } else { $courseCompleted = false; break 2; } } } if ($courseCompleted == true) { $queryResult['certificateTitle'] = $course->certificate_title; $certificateText = $course->certificate_text; // get student name $authUser = Auth::guard('customer')->user(); $studentName = $authUser->first_name . ' ' . $authUser->last_name; // get course duration $duration = Carbon::parse($course->duration); $courseDuration = $duration->format('h') . ' hours'; // get course title $courseTitle = $courseInfo->title; // get course completion date $date = Carbon::now(); $completionDate = date_format($date, 'F d, Y'); $certificateText = str_replace('{name}', $studentName, $certificateText); $certificateText = str_replace('{duration}', $courseDuration, $certificateText); $certificateText = str_replace('{title}', $courseTitle, $certificateText); $certificateText = str_replace('{date}', $completionDate, $certificateText); $queryResult['certificateText'] = $certificateText; $queryResult['instructorInfo'] = $courseInfo->instructorInfo() ->where('language_id', $language->id) ->where('user_id', $user->id) ->select('name', 'occupation') ->first(); return view('user-front.customer.course_management.course-certificate', $queryResult); } else { $warningMessage = $keywords['course_completion_required'] ?? __('You have to complete this course to get the certificate.') . '.'; return redirect()->back()->with('warning', $warningMessage); } } public function donations() { $user = getUser(); $language = $this->getUserCurrentLanguage($user->id); $settings = DB::table('user_donation_settings')->where('user_id', $user->id)->first(); if ($settings->is_donation == 0) { return back(); } $donations = DonationDetail::where('customer_id', Auth::guard('customer')->user()->id)->orderBy('id', 'DESC')->get(); $donations->map(function ($donation) use ($language) { $title = DonationContent::where([['donation_id', $donation->donation_id], ['language_id', $language->id]])->select('title', 'slug')->first(); $donation['title'] = $title->title ?? null; $donation['slug'] = $title->slug ?? null; }); return view('user-front.customer.donations', compact('donations')); } } Http/Controllers/Front/ReviewController.php 0000644 00000005467 15213350434 0015113 0 ustar 00 <?php namespace App\Http\Controllers\Front; use Illuminate\Http\Request; use App\Models\User\UserItem; use App\Models\User\ItemReview; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class ReviewController extends Controller { public function __construct() { $this->middleware('setlang'); } public function reviewsubmit(Request $request) { $rules = [ 'review' => 'required', 'comment' => 'required', ]; $messages = [ 'comment.required' => 'Please say something about this item', 'review.required' => 'Please rate this item with stars', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } if ($request->review || $request->comment) { if (ItemReview::where('customer_id', Auth::guard('customer')->user()->id)->where('item_id', $request->item_id)->exists()) { $exists = ItemReview::where('customer_id', Auth::guard('customer')->user()->id)->where('item_id', $request->item_id)->first(); if ($request->review) { $exists->update([ 'review' => $request->review, ]); $avgreview = ItemReview::where('item_id', $request->item_id)->avg('review'); UserItem::find($request->item_id)->update([ 'rating' => $avgreview ]); } if ($request->comment) { $exists->update([ 'comment' => $request->comment, ]); } Session::flash('success', 'Review update successfully'); return back(); } else { $input = $request->all(); $input['customer_id'] = Auth::guard('customer')->user()->id; $data = new ItemReview(); $data->create($input); $avgreview = ItemReview::where('item_id', $request->item_id)->avg('review'); UserItem::find($request->item_id)->update([ 'rating' => $avgreview ]); Session::flash('success', 'Review submit successfully'); return back(); } } else { Session::flash('error', 'Review submit not succesfull'); return back(); } } public function authcheck() { if (!Auth::guard('customer')->user()) { Session::put('link', url()->current()); return redirect(route('customer.login', getParam())); } } } Http/Controllers/Front/RoomBookingController.php 0000644 00000073650 15213350434 0016076 0 ustar 00 <?php namespace App\Http\Controllers\Front; use App\Http\Controllers\Controller; use App\Http\Controllers\User\Payment\AuthorizenetController; use App\Http\Controllers\User\Payment\FlutterWaveController; use App\Http\Controllers\User\Payment\InstamojoController; use App\Http\Controllers\User\Payment\MercadopagoController; use App\Http\Controllers\User\Payment\MollieController; use App\Http\Controllers\User\Payment\OfflineController; use App\Http\Controllers\User\Payment\PaypalController; use App\Http\Controllers\User\Payment\PaystackController; use App\Http\Controllers\User\Payment\PaytmController; use App\Http\Controllers\User\Payment\PerfectMoneyController; use App\Http\Controllers\User\Payment\RazorpayController; use App\Http\Controllers\User\Payment\StripeController; use App\Http\Requests\Front\HotelBooking\RoomBookingRequest; use App\Models\User\BasicSetting; use App\Models\User\HotelBooking\Coupon; use App\Models\User\HotelBooking\Room; use App\Models\User\HotelBooking\RoomAmenity; use App\Models\User\HotelBooking\RoomBooking; use App\Models\User\HotelBooking\RoomContent; use App\Models\User\UserEmailTemplate; use App\Traits\MiscellaneousTrait; use DateTime; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; use PDF; use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\PHPMailer; use App\Http\Controllers\User\Payment\PhonePeController; use App\Http\Controllers\User\Payment\XenditController; use App\Http\Controllers\User\Payment\YocoController; use App\Http\Controllers\User\Payment\ToyyibpayController; use App\Http\Controllers\User\Payment\PaytabsController; use App\Http\Controllers\User\Payment\MidtransController; use App\Http\Controllers\User\Payment\IyzicoController; use App\Http\Controllers\User\Payment\ShopMyFatoorahController; class RoomBookingController extends Controller { use MiscellaneousTrait; public function makeRoomBooking($username, RoomBookingRequest $request) { $user = getUser(); $bs = BasicSetting::where('user_id', $user->id)->firstorFail(); $keywords = getUserKeywords(); $title = "Room Booking"; $calculatedData = $this->calculation($request); $request->merge([ 'subtotal' => $calculatedData['subtotal'], 'discount' => $calculatedData['discount'], 'total' => $calculatedData['total'], 'title' => $title ]); // check whether user is logged in or not (start) $status = DB::table('user_room_settings')->where('user_id', $user->id)->select('room_guest_checkout_status') ->first(); $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); if (($status->room_guest_checkout_status == 0) && (Auth::guard('customer')->check() == false)) { session()->flash('warning', $keywords['Please_login_first'] ?? 'Please login first'); return redirect()->route('customer.login', [getParam(), 'redirectPath' => 'room_details']); } // check whether user is logged in or not (end) $cancel_url = route('front.user.room_booking.cancel', getParam()); if ($request->paymentType == 'none') { session()->flash('error', $keywords['Please_select_a_payment_method'] ?? 'Please select a payment method'. '.'); return redirect()->back()->withInput(); } else if ($request->paymentType == 'paypal') { if (empty($bs->base_currency_rate)) { return redirect()->back()->with('error', $keywords['Base_currency_rate_not_found'] ?? __('Base currency rate not found'))->withInput($request->all()); } $success_url = route('front.user.room_booking.notify', getParam()); $paypal = new PaypalController(); return $paypal->paymentProcess($request, $request['total'], $title, $success_url, $cancel_url); } else if ($request->paymentType == 'stripe') { if (empty($bs->base_currency_rate)) { return redirect()->back()->with('error', $keywords['Base_currency_rate_not_found'] ?? __('Base currency rate not found'))->withInput($request->all()); } $success_url = route('front.user.room_booking.stripe.notify', getParam()); $stripe = new StripeController(); return $stripe->paymentProcess($request, $request['total'], $title, $success_url, $cancel_url); } else if ($request->paymentType == 'paytm') { $callback_url = route('front.user.room_booking.paytm.notify', getParam()); $calculatedData = $this->calculation($request); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', 'Invalid currency for paytm payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Paytm'; $information['type'] = 'online'; $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); Session::put('payment_title', $title); $paytm = new PaytmController(); return $paytm->paymentProcess($request, $request['total'], null, $callback_url, $title); } else if ($request->paymentType == 'instamojo') { // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for instamojo payment.'); } $instamojo = new InstamojoController(); $success_url = route('front.user.room_booking.instamojo.notify', getParam()); return $instamojo->paymentProcess($request, $request['total'], $success_url, $cancel_url, $title, null); } else if ($request->paymentType == 'paystack') { // checking whether the currency is set to 'NGN' or not if ($currencyInfo->base_currency_text !== 'NGN') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for paystack payment.'); } $paystack = new PaystackController(); $success_url = route('front.user.room_booking.instamojo.notify', getParam()); return $paystack->paymentProcess($request, $request['total'], $request['customer_email'], $success_url, null); } else if ($request->paymentType == 'flutterwave') { $available_currency = array('BIF', 'CAD', 'CDF', 'CVE', 'EUR', 'GBP', 'GHS', 'GMD', 'GNF', 'KES', 'LRD', 'MWK', 'NGN', 'RWF', 'SLL', 'STD', 'TZS', 'UGX', 'USD', 'XAF', 'XOF', 'ZMK', 'ZMW', 'ZWD'); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $available_currency)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for flutterwave payment.'); } $success_url = route('front.user.room_booking.flutterwave.notify', getParam()); $flutterwave = new FlutterWaveController(); return $flutterwave->paymentProcess($request, $request['total'], $request['customer_email'], uniqid(5), $success_url, $cancel_url, $currencyInfo); } else if ($request->paymentType == 'mollie') { $available_currency = array('AED', 'AUD', 'BGN', 'BRL', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HRK', 'HUF', 'ILS', 'ISK', 'JPY', 'MXN', 'MYR', 'NOK', 'NZD', 'PHP', 'PLN', 'RON', 'RUB', 'SEK', 'SGD', 'THB', 'TWD', 'USD', 'ZAR'); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $available_currency)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for mollie payment.'); } $success_url = route('front.user.room_booking.mollie.notify', getParam()); $mollie = new MollieController(); return $mollie->paymentProcess($request, $request['total'], $success_url, $cancel_url, $title, $currencyInfo); } else if ($request->paymentType == 'razorpay') { // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for razorpay payment.'); } $success_url = route('front.user.room_booking.razorpay.notify', getParam()); $razorpay = new RazorpayController(); // dd($bs); return $razorpay->paymentProcess($request, $request['total'], uniqid(5), $cancel_url, $success_url, $title, "Paying for Room Booking", $bs); } else if ($request->paymentType == 'mercadopago') { $available_currency = array('ARS', 'BOB', 'BRL', 'CLF', 'CLP', 'COP', 'CRC', 'CUC', 'CUP', 'DOP', 'EUR', 'GTQ', 'HNL', 'MXN', 'NIO', 'PAB', 'PEN', 'PYG', 'USD', 'UYU', 'VEF', 'VES'); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $available_currency)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for mercadopago payment.'); } $success_url = route('front.user.room_booking.mercadopago.notify', getparam()); $mercadopago = new MercadopagoController(); return $mercadopago->paymentProcess($request, $request['total'], $success_url, $cancel_url, $request['customer_email'], $title, "Paying for Room Booking", $bs); } else if ($request->paymentType == 'authorize.net') { $allowedCurrencies = array('USD', 'CAD', 'CHF', 'DKK', 'EUR', 'GBP', 'NOK', 'PLN', 'SEK', 'AUD', 'NZD'); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for authorize.net payment.')->withInput(); } $authorizeNet = new AuthorizenetController(); return $authorizeNet->paymentProcess($request, $request['total'], $cancel_url, $title, $currencyInfo); } else if ($request->paymentType == 'phonepe') { $callback_url = route('front.user.room_booking.phonepe.notify', getParam()); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for phonepe payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'PhonePe'; $information['type'] = 'online'; $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); Session::put('payment_title', $title); $paytm = new PhonePeController(); return $paytm->paymentProcess($request, $request['total'], 'Room Booking', $callback_url, $title); } else if ($request->paymentType == 'perfect_money') { $callback_url = route('front.user.room_booking.perfect_money.notify', getParam()); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'USD') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for perfect money payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Perfect Money'; $information['type'] = 'online'; $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); Session::put('payment_title', $title); $perfect_money = new PerfectMoneyController(); return $perfect_money->paymentProcess($request, $request['total'], null, $callback_url, $title); } else if ($request->paymentType == 'xendit') { $callback_url = route('front.user.room_booking.xendit.notify', getParam()); // checking whether the currency is set to 'INR' or not $allowed_currency = array('IDR', 'PHP', 'USD', 'SGD', 'MYR'); if (!in_array($currencyInfo->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for perfect money payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Xendit'; $information['type'] = 'online'; $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); Session::put('payment_title', $title); $xendit = new XenditController(); return $xendit->paymentProcess($request, $request['total'], 'Room Booking', $callback_url, $title); } else if ($request->paymentType == 'yoco') { $callback_url = route('front.user.room_booking.yoco.notify', getParam()); // checking whether the currency is set to 'ZAR' or not if ($currencyInfo->base_currency_text != 'ZAR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for yoco payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Yoco'; $information['type'] = 'online'; $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); Session::put('payment_title', $title); $yoco = new YocoController(); return $yoco->paymentProcess($request, $request['total'], 'Room Booking', $callback_url, $title); } else if ($request->paymentType == 'toyyibpay') { $callback_url = route('front.user.room_booking.toyyibpay.notify', getParam()); // checking whether the currency is set to 'ZAR' or not if ($currencyInfo->base_currency_text != 'RM') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for toyyibpay payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Toyyibpay'; $information['type'] = 'online'; $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); Session::put('payment_title', $title); $toyyibpay = new ToyyibpayController(); return $toyyibpay->paymentProcess($request, $request['total'], null, $callback_url, $title); } else if ($request->paymentType == 'paytabs') { $callback_url = route('front.user.room_booking.paytabs.notify', getParam()); $paytabInfo = paytabInfo('user', $user->id); // checking whether the currency is set to 'ZAR' or not if ($currencyInfo->base_currency_text != $paytabInfo['currency']) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for paytabs payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Paytabs'; $information['type'] = 'online'; $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); Session::put('payment_title', $title); $paytabs = new PaytabsController(); return $paytabs->paymentProcess($request, $request['total'], 'Room Booking', $callback_url, $title); } else if ($request->paymentType == 'midtrans') { $callback_url = route('front.user.room_booking.midtrans.notify', getParam()); if ($currencyInfo->base_currency_text != 'IDR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for midtrans payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Midtrans'; $information['type'] = 'online'; $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); Session::put('payment_title', $title); $midtrans = new MidtransController(); return $midtrans->paymentProcess($request, $request['total'], 'Room Booking', $callback_url, $title); } else if ($request->paymentType == 'iyzico') { $callback_url = route('front.user.room_booking.iyzico.notify', getParam()); if ($currencyInfo->base_currency_text != 'TRY') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for midtrans payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Iyzico'; $information['type'] = 'online'; Session::put('payment_title', $title); $iyzico = new IyzicoController(); return $iyzico->paymentProcess($request, $request['total'], 'Room Booking', $callback_url, $title); } else if ($request->paymentType == 'myfatoorah') { $allowed_currency = array('KWD', 'SAR', 'BHD', 'AED', 'QAR', 'OMR', 'JOD'); if (!in_array($currencyInfo->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for midtrans payment.'); } $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'MyFatoorah'; $information['type'] = 'online'; Session::put('payment_title', $title); $booking_details = $this->storeData($request, $information); Session::put('bookingId', $booking_details->id); $myfatoorah = new ShopMyFatoorahController(); return $myfatoorah->paymentProcess($request, $request['total'], 'Room Booking'); } else { $offline = new OfflineController(); $offline->bookingProcess($request); $request = 'room-booking'; return view('user-front.offline-success', compact('request')); } } public function calculation(Request $request) { $roomInfo = Room::findOrFail($request->room_id); $subtotal = floatval($roomInfo->rent) * intval($request->nights); if ($request->session()->has('couponCode')) { $coupon_code = $request->session()->get('couponCode'); $coupon = Coupon::where('code', $coupon_code)->first(); if (!is_null($coupon)) { $couponVal = floatval($coupon->value); if ($coupon->type == 'fixed') { $total = $subtotal - $couponVal; $calculatedData = array( 'subtotal' => $subtotal, 'discount' => $couponVal, 'total' => $total ); } else { $discount = $subtotal * ($couponVal / 100); $total = $subtotal - $discount; $calculatedData = array( 'subtotal' => $subtotal, 'discount' => $discount, 'total' => $total ); } } else { $calculatedData = array( 'subtotal' => $subtotal, 'discount' => 0.00, 'total' => $subtotal ); } } else { $calculatedData = array( 'subtotal' => $subtotal, 'discount' => 0.00, 'total' => $subtotal ); } $request->session()->forget('couponCode'); return $calculatedData; } public function storeData(Request $request, $information) { $dateArray = explode(' ', $request->dates); $user = getUser(); $booking_details = RoomBooking::create([ 'booking_number' => time(), 'user_id' => $user->id, 'customer_id' => Auth::guard('customer')->check() == true ? Auth::guard('customer')->user()->id : null, 'customer_name' => $request->customer_name, 'customer_email' => $request->customer_email, 'customer_phone' => $request->customer_phone, 'room_id' => $request->room_id, 'arrival_date' => $dateArray[0], 'departure_date' => $dateArray[2], 'guests' => $request->guests, 'subtotal' => $request->subtotal, 'discount' => $request->discount, 'grand_total' => $request->total, 'currency_symbol' => $information['currency_symbol'], 'currency_symbol_position' => $information['currency_symbol_position'], 'currency_text' => $information['currency_text'], 'currency_text_position' => $information['currency_text_position'], 'payment_method' => $information['method'], 'gateway_type' => $information['type'], 'attachment' => $request->hasFile('attachment') ? $information['attachment'] : null, 'conversation_id' => array_key_exists('conversation_id', $information) ? $information['conversation_id'] : null ]); return $booking_details; } public function generateInvoice($bookingInfo) { $fileName = $bookingInfo->booking_number . '.pdf'; $directory = public_path('assets/invoices/rooms/'); if (!file_exists($directory)) { mkdir($directory, 0775, true); } $fileLocated = $directory . $fileName; PDF::loadView('user-front.room.booking_pdf', compact('bookingInfo'))->save($fileLocated); return $fileName; } public function sendMail($bookingInfo) { // first get the mail template information from db $mailTemplate = UserEmailTemplate::where('user_id', $bookingInfo->user_id)->where('email_type', 'room_booking')->first(); $mailSubject = $mailTemplate->email_subject; $mailBody = replaceBaseUrl($mailTemplate->email_body, 'summernote'); // second get the website title & mail's smtp information from db $basicExtends = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_port', 'encryption', 'smtp_username', 'smtp_password', 'from_mail') ->first(); $basicSettings = DB::table('user_basic_settings')->where('user_id', $bookingInfo->user_id)->select('website_title', 'from_name', 'email')->first(); $date1 = new DateTime($bookingInfo->arrival_date); $date2 = new DateTime($bookingInfo->departure_date); $interval = $date1->diff($date2, true); // get the room category name according to language $language = MiscellaneousTrait::getCustomerCurrentLanguage(); $roomContent = RoomContent::where([['room_id', $bookingInfo->room_id], ['user_id', $bookingInfo->user_id]]) ->where('language_id', $language->id) ->first(); $roomCategoryName = $roomContent->roomCategory->name; $roomRent = ($bookingInfo->currency_text_position == 'left' ? $bookingInfo->currency_text . ' ' : '') . $bookingInfo->grand_total . ($bookingInfo->currency_text_position == 'right' ? ' ' . $bookingInfo->currency_text : ''); // get the amenities of booked room $amenityIds = json_decode($roomContent->amenities); $amenityArray = []; if (!is_null($amenityIds)) { foreach ($amenityIds as $id) { $amenity = RoomAmenity::findOrFail($id); array_push($amenityArray, $amenity->name); } } // now, convert amenity array into comma separated string $amenityString = implode(', ', $amenityArray); // replace template's curly-brace string with actual data $mailBody = str_replace('{customer_name}', $bookingInfo->customer_name, $mailBody); $mailBody = str_replace('{room_name}', $roomContent->title, $mailBody); $mailBody = str_replace('{room_rent}', $roomRent, $mailBody); $mailBody = str_replace('{booking_number}', $bookingInfo->booking_number, $mailBody); $mailBody = str_replace('{booking_date}', date_format($bookingInfo->created_at, 'F d, Y'), $mailBody); $mailBody = str_replace('{number_of_night}', $interval->days, $mailBody); $mailBody = str_replace('{website_title}', $basicSettings->website_title, $mailBody); $mailBody = str_replace('{check_in_date}', $bookingInfo->arrival_date, $mailBody); $mailBody = str_replace('{check_out_date}', $bookingInfo->departure_date, $mailBody); $mailBody = str_replace('{number_of_guests}', $bookingInfo->guests, $mailBody); $mailBody = str_replace('{room_type}', $roomCategoryName, $mailBody); $mailBody = str_replace('{room_amenities}', $amenityString, $mailBody); // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = 'UTF-8'; $mail->Encoding = 'base64'; // if smtp status == 1, then set some value for PHPMailer if ($basicExtends->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $basicExtends->smtp_host; $mail->SMTPAuth = true; $mail->Username = $basicExtends->smtp_username; $mail->Password = $basicExtends->smtp_password; // if ($basicExtends->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // } $mail->Port = 587; } // dd('ok', $basicExtends, $basicSettings, $bookingInfo); // finally add other informations and send the mail try { // Recipients $mail->setFrom($basicExtends->from_mail, $basicSettings->from_name); $mail->addAddress($bookingInfo->customer_email); $mail->AddReplyTo($basicSettings->email); // Attachments (Invoice) $mail->addAttachment(public_path('assets/invoices/rooms/' . $bookingInfo->invoice)); // Content $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); return; } catch (Exception $e) { return redirect()->route('front.user.rooms', getParam())->with('error', 'Mail could not be sent!'); } } public function complete() { return view('user-front.room.paymemt_success'); } public function cancel() { return redirect()->route('front.user.rooms', getParam())->with('error', 'Sorry, an error has occured!'); } } Http/Controllers/Front/DonationManagement/CauseController.php 0000644 00000011626 15213350434 0020454 0 ustar 00 <?php namespace App\Http\Controllers\Front\DonationManagement; use App\Http\Controllers\Controller; use App\Models\User\DonationManagement\Donation; use App\Models\User\DonationManagement\DonationCategories; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\DonationManagement\DonationDetail; use App\Models\User\UserOfflineGateway; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class CauseController extends Controller { use MiscellaneousTrait; public function index(Request $request, $domain) { $user = getUser(); $keyword = $category = null; if ($request->filled('search')) { $keyword = $request->search; } if ($request->filled('category')) { $category = DonationCategories::where('slug', $request['category'])->where('user_id', $user->id)->first()->id; } if ($request->filled('search')) { $keyword = $request['search']; } $currentLang = MiscellaneousTrait::getCustomerCurrentLanguage(); $causes = Donation::query() ->where('user_donations.user_id', $user->id) ->join('user_donation_contents', 'user_donations.id', '=', 'user_donation_contents.donation_id') ->where('user_donation_contents.language_id', '=', $currentLang->id) ->join('user_donation_categories', 'user_donation_categories.id', '=', 'user_donation_contents.donation_category_id') ->when($category, function ($query, $category) { return $query->where('user_donation_contents.donation_category_id', '=', $category); }) ->when($category, function ($query, $category) { return $query->where('user_donation_contents.donation_category_id', '=', $category); }) ->when($keyword, function ($query, $keyword) { return $query->where('user_donation_contents.title', 'like', '%' . $keyword . '%'); }) ->select('user_donations.*', 'user_donation_contents.title', 'user_donation_contents.slug') ->latest()->paginate(10); $causes->map(function ($cause) use ($user, $currentLang) { $raised_amount = DonationDetail::query() ->where('donation_id', '=', $cause->id) ->where('status', '=', "completed") ->sum('amount'); $goal_percentage = $raised_amount > 0 ? (($raised_amount / $cause->goal_amount) * 100) : 0; $cause['raised_amount'] = $raised_amount > 0 ? round($raised_amount, 2) : 0; $cause['goal_percentage'] = round($goal_percentage, 1); }); $data['causes'] = $causes; $categories = DonationCategories::where([['language_id', $currentLang->id], ['user_id', $user->id]])->where('status', 1)->orderBy('serial_number')->get(); $categories->map(function ($category) use ($currentLang) { $category['total'] = $category->donations()->where('language_id', $currentLang->id)->count(); }); $data['categories'] = $categories; $data['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo($user->id); return view('user-front.donation_management.causes', $data); } public function details($domain, $slug) { $user = getUser(); $currentLang = MiscellaneousTrait::getCustomerCurrentLanguage(); $data['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo($user->id); $cause = DonationContent::where([['user_id', $user->id], ['language_id', $currentLang->id]])->where('slug', $slug)->first(); $raised_amount = DonationDetail::query() ->where('donation_id', '=', $cause->donation_id) ->where('status', '=', "completed") ->sum('amount'); $goal_percentage = $raised_amount > 0 ? (($raised_amount / $cause->donation->goal_amount) * 100) : 0; $cause['raised_amount'] = $raised_amount > 0 ? round($raised_amount, 2) : 0; $cause['goal_percentage'] = round($goal_percentage, 1); $data['causeContent'] = $cause; $data['onlineGateways'] = UserPaymentGeteway::query() ->where('user_id', $user->id) ->where('status', 1) ->get(); $data['offlineGateways'] = UserOfflineGateway::query() ->where('user_id', $user->id) ->where('item_checkout_status', 1) ->orderBy('serial_number', 'ASC') ->get(); $stripe = UserPaymentGeteway::where('keyword', 'stripe')->where([['status', 1], ['user_id', $user->id]])->first(); if (is_null($stripe)) { $data['stripe_key'] = null; } else { $stripe_info = json_decode($stripe->information, true); $data['stripe_key'] = $stripe_info['key']; } return view('user-front.donation_management.cause_details', $data); } } Http/Controllers/Front/DonationManagement/DonationController.php 0000644 00000046337 15213350434 0021176 0 ustar 00 <?php namespace App\Http\Controllers\Front\DonationManagement; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Controllers\User\DonationManagement\Payment\AuthorizenetController; use App\Http\Controllers\User\DonationManagement\Payment\FlutterwaveController; use App\Http\Controllers\User\DonationManagement\Payment\InstamojoController; use App\Http\Controllers\User\DonationManagement\Payment\MercadoPagoController; use App\Http\Controllers\User\DonationManagement\Payment\MollieController; use App\Http\Controllers\User\DonationManagement\Payment\OfflineController; use App\Http\Controllers\User\DonationManagement\Payment\PayPalController; use App\Http\Controllers\User\DonationManagement\Payment\PaystackController; use App\Http\Controllers\User\DonationManagement\Payment\PaytmController; use App\Http\Controllers\User\DonationManagement\Payment\PhonePeController; use App\Http\Controllers\User\DonationManagement\Payment\PerfectMoneyController; use App\Http\Controllers\User\DonationManagement\Payment\RazorpayController; use App\Http\Controllers\User\DonationManagement\Payment\StripeController; use App\Http\Controllers\User\DonationManagement\Payment\XenditController; use App\Http\Controllers\User\DonationManagement\Payment\YocoController; use App\Http\Controllers\User\DonationManagement\Payment\ToyyibpayController; use App\Http\Controllers\User\DonationManagement\Payment\PaytabsController; use App\Http\Controllers\User\DonationManagement\Payment\MidtransController; use App\Http\Controllers\User\DonationManagement\Payment\IyzicoController; use App\Http\Controllers\User\DonationManagement\Payment\MyFatoorahController; use App\Models\User\BasicSetting; use App\Models\User\DonationManagement\Donation; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\DonationManagement\DonationDetail; use App\Models\User\UserEmailTemplate; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Validator; use PDF; use PHPMailer\PHPMailer\PHPMailer; class DonationController extends Controller { use MiscellaneousTrait; public function makePayment(Request $request) { $keywords = getUserKeywords(); $customMessages = [ 'gateway.required' => $keywords['select_payment_gateway'] ?? 'Please choose a payment method.', 'name.required' => $keywords['name_required'] ?? 'The name field is required for iyzico payments.', 'phone.required' => $keywords['phone_required_for_iyzico'] ?? 'The phone field is required for iyzico payments.', 'email.required' => $keywords['email'] ?? 'The email field is required for iyzico payments.', 'identity_number.required' => $keywords['identity_number_required'] ?? 'The identity number field is required for iyzico payments.', 'city.required' => $keywords['city_required_for_iyzico'] ?? 'The city field is required for iyzico payments.', 'country.required' => $keywords['country_required_for_iyzico'] ?? 'The country field is required for iyzico payments.', 'address.required' => $keywords['address_required_for_iyzico'] ?? 'The address field is required for iyzico payments.', 'zip_code.required' => $keywords['zip_code_required_for_iyzico'] ?? 'The zip code field is required for iyzico payments.', 'name.max' => $keywords['name_max_255'] ?? 'The name may not be greater than 255 characters.', 'email.email' => $keywords['valid_email_required'] ?? 'Please enter a valid email address.', 'email.max' => $keywords['email_max_255'] ?? 'The email may not be greater than 255 characters.', 'paystack_email.required' => $keywords['paystack_email_required'] ?? 'The paystack email field is required.', 'paystack_email.email' => $keywords['paystack_valid_email'] ?? 'Please enter a valid paystack email address.', 'flutterwave_email.required' => $keywords['flutterwave_email_required'] ?? 'The flutterwave email field is required.', 'flutterwave_email.email' => $keywords['flutterwave_valid_email'] ?? 'Please enter a valid flutterwave email address.', 'razorpay_email.required' => $keywords['razorpay_email_required'] ?? 'The razorpay email field is required.', 'razorpay_email.email' => $keywords['razorpay_valid_email'] ?? 'Please enter a valid razorpay email address.', 'razorpay_phone.required' => $keywords['razorpay_phone_required'] ?? 'The razorpay phone field is required.', 'razorpay_phone.numeric' => $keywords['razorpay_phone_numeric'] ?? 'The razorpay phone must be a number.', 'paytm_email.required' => $keywords['paytm_email_required'] ?? 'The paytm email field is required.', 'paytm_email.email' => $keywords['paytm_valid_email'] ?? 'Please enter a valid paytm email address.', 'paytm_phone.required' => $keywords['paytm_phone_required'] ?? 'The paytm phone field is required.', 'paytm_phone.numeric' => $keywords['paytm_phone_numeric'] ?? 'The paytm phone must be a number.', 'amount.required' => $keywords['amount_required'] ?? 'The amount field is required.', ]; $validator = Validator::make($request->all(), [ 'gateway' => 'required', 'name' => $request->gateway == 'iyzico' ? 'required' : '', 'phone' => $request->gateway == 'iyzico' ? 'required' : '', 'email' => $request->gateway == 'iyzico' ? 'required' : '', 'identity_number' => $request->gateway == 'iyzico' ? 'required' : '', 'city' => $request->gateway == 'iyzico' ? 'required' : '', 'country' => $request->gateway == 'iyzico' ? 'required' : '', 'address' => $request->gateway == 'iyzico' ? 'required' : '', 'zip_code' => $request->gateway == 'iyzico' ? 'required' : '', ], $customMessages); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $setting = DB::table('user_donation_settings')->where('user_id', $user->id)->first(); $causeId = $request->cause_id; if ($setting->donation_guest_checkout == 0 && !Auth::guard('customer')->check()) { return redirect()->route('customer.login', [getParam(), 'redirected' => 'causes']); } if ($request->amount < $request->minimum_amount) { return redirect()->back()->with('error', $keywords['amount_minimum_required'] ?? 'Amount must be minimum ' . $request->minimum_amount . ' ' . $currencyInfo->base_currency_text)->withInput(); } // dd($request->all()); if (!$request->exists('gateway')) { return redirect()->back()->with('error', 'Choose a payment method')->withInput(); } elseif ($request['gateway'] == 'paypal') { $paypal = new PayPalController(); return $paypal->donationProcess($request, $causeId, $user->id); } elseif ($request['gateway'] == 'instamojo') { $paypal = new InstamojoController(); return $paypal->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'paystack') { $validator = Validator::make($request->all(), [ 'name' => $request->has('checkbox') === true ? 'max:255' : 'required', 'email' => $request->has('checkbox') === true ? 'max:255' : 'required|email', 'paystack_email' => $request->has('checkbox') === true ? 'required|email' : 'nullable', 'amount' => 'required', ], $customMessages); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $paystack = new PaystackController(); return $paystack->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'flutterwave') { $validator = Validator::make($request->all(), [ 'name' => $request->has('checkbox') === true ? 'max:255' : 'required', 'email' => $request->has('checkbox') === true ? 'max:255' : 'required|email', 'flutterwave_email' => $request->has('checkbox') === true ? 'required|email' : 'nullable', 'amount' => 'required', ], $customMessages); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $flutterwave = new FlutterwaveController; return $flutterwave->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'razorpay') { $validator = Validator::make($request->all(), [ 'name' => $request->has('checkbox') === true ? 'max:255' : 'required', 'email' => $request->has('checkbox') === true ? 'max:255' : 'required|email', 'razorpay_email' => $request->has('checkbox') === true ? 'required|email' : 'nullable', 'razorpay_phone' => $request->has('checkbox') === true ? 'required|numeric' : 'nullable', 'amount' => 'required', ], $customMessages); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $razorpay = new RazorpayController(); return $razorpay->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'mercadopago') { $mercadopago = new MercadoPagoController(); return $mercadopago->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'mollie') { $mollie = new MollieController(); return $mollie->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'paytm') { $validator = Validator::make($request->all(), [ 'name' => $request->has('checkbox') === true ? 'max:255' : 'required', 'email' => $request->has('checkbox') === true ? 'max:255' : 'required|email', 'paytm_email' => $request->has('checkbox') === true ? 'required|email' : 'nullable', 'paytm_phone' => $request->has('checkbox') === true ? 'required|numeric' : 'nullable', 'amount' => 'required', ], $customMessages); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $paytm = new PaytmController(); return $paytm->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'stripe') { $stripe = new StripeController(); return $stripe->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'authorize.net') { $authorizeNet = new AuthorizenetController(); return $authorizeNet->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'phonepe') { $phonepe = new PhonePeController(); return $phonepe->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'perfect_money') { $perfect_money = new PerfectMoneyController(); return $perfect_money->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'xendit') { $xendit = new XenditController(); return $xendit->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'yoco') { $yoco = new YocoController(); return $yoco->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'toyyibpay') { $toyyibpay = new ToyyibpayController(); return $toyyibpay->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'paytabs') { $toyyibpay = new PaytabsController(); return $toyyibpay->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'midtrans') { $midtrans = new MidtransController(); return $midtrans->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'myfatoorah') { $myfatoorah = new MyFatoorahController(); return $myfatoorah->donationProcess($request, $causeId, $user->id); } else if ($request['gateway'] == 'iyzico') { $iyzico = new IyzicoController(); return $iyzico->donationProcess($request, $causeId, $user->id); } else { $validator = Validator::make($request->all(), [ 'name' => $request->has('checkbox') === true ? 'max:255' : 'required', 'email' => $request->has('checkbox') === true ? 'max:255' : 'required|email', 'amount' => 'required', ], $customMessages); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } $offline = new OfflineController(); return $offline->donationProcess($request, $causeId, $user->id); } } public function store($information, $userId) { $curencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); return $donation = DonationDetail::create([ 'user_id' => $userId, 'customer_id' => Auth::guard('customer')->check() ? Auth::guard('customer')->user()->id : NULL, 'name' => $information['name'], 'email' => $information['email'], 'phone' => $information['phone'], 'amount' => $information['amount'], 'currency' => $curencyInfo->base_currency_text, 'currency_position' => $curencyInfo->base_currency_text_position, 'currency_symbol' => $curencyInfo->base_currency_symbol, 'currency_symbol_position' => $curencyInfo->base_currency_symbol_position, 'payment_method' => $information['paymentMethod'], 'transaction_id' => uniqid(), 'status' => $information['paymentStatus'], 'receipt' => $information['attachmentFile'] ?? null, 'transaction_details' => $information['gatewayType'], 'bex_details' => json_encode($curencyInfo), 'donation_id' => $information['causeId'], 'conversation_id' => array_key_exists('conversation_id', $information) ? $information['conversation_id'] : null, ]); } public function generateInvoice($donation, $userId) { $fileName = $donation->transaction_id . ".pdf"; $directory = public_path(Constant::WEBSITE_DONATION_INVOICE . '/'); if (!file_exists($directory)) { mkdir($directory, 0775, true); } $fileLocated = $directory . $fileName; $language = $this->getUserCurrentLanguage($userId); $cause = Donation::query() ->where('id', $donation->donation_id) ->firstOrFail(); $causeInfo = DonationContent::query() ->where('user_id', $userId) ->where('donation_id', $cause->id) ->where('language_id', $language->id) ->select('title') ->firstOrFail(); PDF::loadView('pdf.donation', compact('donation', 'causeInfo'))->save($fileLocated); return $fileName; } public function sendMail($donationInfo, $userId) { $mailTemplate = UserEmailTemplate::query() ->where('email_type', 'donation') ->where('user_id', $userId) ->first(); $mailSubject = $mailTemplate->email_subject; $mailBody = $mailTemplate->email_body; // second get the website title & mail's smtp info from db $be = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_username', 'smtp_password', 'from_mail', 'from_name') ->first(); $userBs = BasicSetting::query()->where('user_id', $userId) ->select('website_title', 'email', 'from_name') ->first(); $language = $this->getUserCurrentLanguage($userId); $cause = Donation::query() ->where('id', $donationInfo->donation_id) ->firstOrFail(); $causeInfo = DonationContent::query() ->where('user_id', $userId) ->where('donation_id', $cause->id) ->where('language_id', $language->id) ->select('title') ->firstOrFail(); $websiteTitle = $userBs->website_title; $mailBody = str_replace('{donor_name}', $donationInfo->name, $mailBody); $mailBody = str_replace('{cause_name}', $causeInfo->title, $mailBody); $mailBody = str_replace('{website_title}', $websiteTitle, $mailBody); // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = 'UTF-8'; $mail->Encoding = 'base64'; // if smtp status == 1, then set some value for PHPMailer if ($be->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; // if ($be->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // } $mail->Port = 587; } // finally, add other informations and send the mail try { // Recipients $mail->setFrom($be->from_mail, $userBs->from_name); $mail->addReplyTo($userBs->email, $userBs->from_name); $mail->addAddress($donationInfo->email); $path = public_path(Constant::WEBSITE_DONATION_INVOICE . '/' . $donationInfo->invoice); // Attachments (Invoice) $mail->addAttachment($path); // Content $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); @unlink(public_path(Constant::WEBSITE_DONATION_INVOICE) . '/' . $donationInfo->invoice); return; } catch (\Exception $e) { return session()->flash('error', 'Mail could not be sent! Mailer Error: ' . $e); } } public function complete(Request $request) { if ($request->via == 'offline') { $request = $request->via; return view('user-front.offline-success', compact('request')); } else { $request = 'online'; return view('user-front.success', compact('request')); } } public function cancel(Request $request, $domain, $id) { $user = getUser(); $language = $this->getUserCurrentLanguage($user->id); $donation = Donation::query()->where('user_id', $user->id)->findOrFail($id); $donationInfo = DonationContent::query() ->where('donation_id', $donation->id) ->where('user_id', $user->id) ->where('language_id', $language->id) ->firstOrFail(); session()->flash('error', 'Sorry, an error has occurred!'); return redirect()->route('front.user.causesDetails', [getParam(), 'slug' => $donationInfo->slug]); } } Http/Controllers/Front/ShopController.php 0000644 00000021474 15213350434 0014557 0 ustar 00 <?php namespace App\Http\Controllers\Front; use Carbon\Carbon; use Illuminate\Http\Request; use App\Models\User\UserItem; use App\Models\User\ItemReview; use App\Models\User\BasicSetting; use App\Models\BasicSetting as BS; use Illuminate\Support\Facades\DB; use App\Models\BasicExtended as BE; use App\Http\Controllers\Controller; use App\Models\User\UserItemContent; use App\Models\User\UserShopSetting; use Illuminate\Support\Facades\Auth; use App\Models\User\CustomerWishList; use App\Models\User\UserItemCategory; use Illuminate\Support\Facades\Config; use App\Models\User\UserItemSubCategory; use App\Models\User\Language as UserLanguage; use Illuminate\Support\Facades\Log; class ShopController extends Controller { public function __construct() { $bs = BS::first(); $be = BE::first(); } public function shop(Request $request, $domain) { $user = getUser(); $userShop = UserShopSetting::where('user_id', $user->id)->first(); if (!empty($userShop) && ($userShop->is_shop == 0)) { return redirect()->route('front.user.detail.view', getParam()); } if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $cat = UserItemCategory::where('slug', $request->category)->where('language_id', $userCurrentLang->id)->where('user_id', $user->id)->first(); $subcat = UserItemSubCategory::where('slug', $request->subcategory)->where('language_id', $userCurrentLang->id)->where('user_id', $user->id)->first(); $search = $request->search; $minprice = $request->minprice; $maxprice = $request->maxprice; $category_id = $cat->id ?? ''; $subcategory_id = $subcat->id ?? ''; $sale = $request->sale; if ($request->type) { $type = $request->type; } else { $type = 'new'; } $limit = 9; if (Auth::guard('customer')->check()) { $data['myWishlist'] = CustomerWishList::where('customer_id', Auth::guard('customer')->user()->id)->pluck('item_id')->toArray(); } else { $data['myWishlist'] = []; } $bs = BasicSetting::where('user_id', $user->id)->first(); Config::set('app.timezone', $bs->timezoneinfo->timezone); $data['categories'] = UserItemCategory::where('user_id', $user->id)->where('language_id', $userCurrentLang->id)->with('subcategories')->orderBy('name', 'asc')->get(); $data['items'] = DB::table('user_items') ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*') ->when($category_id, function ($query, $category_id) { return $query->where('user_item_contents.category_id', $category_id); }) ->when($subcategory_id, function ($query, $subcategory_id) { return $query->where('user_item_contents.subcategory_id', $subcategory_id); }) ->when($search, function ($query, $search) { return $query->where(function ($query) use ($search) { $query->where('user_item_contents.title', 'like', '%' . $search . '%') ->orWhere('user_item_contents.tags', 'like', '%' . $search . '%'); }); }) ->when($minprice, function ($query, $minprice) { return $query->where('user_items.current_price', '>=', $minprice); }) ->when($maxprice, function ($query, $maxprice) { return $query->where('user_items.current_price', '<=', $maxprice); }) ->when($type, function ($query, $type) { if ($type == 'new') { return $query->orderBy('user_items.id', 'DESC'); } elseif ($type == 'old') { return $query->orderBy('user_items.id', 'ASC'); } elseif ($type == 'high-to-low') { return $query->orderBy('user_items.current_price', 'DESC'); } elseif ($type == 'low-to-high') { return $query->orderBy('user_items.current_price', 'ASC'); } }) ->when($sale, function ($query, $sale) use ($bs) { if ($sale == 'flash') { return $query->where('user_items.start_date_time', '<=', Carbon::now()->tz($bs->timezoneinfo->timezone)->format('Y-m-d H:i:s A')) ->where('user_items.end_date_time', '>=', Carbon::now()->tz($bs->timezoneinfo->timezone)->format('Y-m-d H:i:s A')); } elseif ($sale == 'onsale') { return $query->Where(function ($query) use ($bs) { $query->where('user_items.start_date_time', '<=', Carbon::now()->tz($bs->timezoneinfo->timezone)->format('Y-m-d H:i:s A')) ->where('user_items.end_date_time', '>=', Carbon::now()->tz($bs->timezoneinfo->timezone)->format('Y-m-d H:i:s A')) ->orWhere('user_items.previous_price', '>', 0); }); } elseif ($sale == 'all') { return $query->orderBy('user_items.id', 'DESC'); } }) ->where('user_item_contents.language_id', $userCurrentLang->id) ->where('user_items.status', 1) ->where('user_items.user_id', $user->id) ->paginate($limit); $data['max_price'] = UserItem::where('user_id', $user->id)->where('status', 1)->max('current_price'); $data['min_price'] = UserItem::where('user_id', $user->id)->where('status', 1)->min('current_price'); $data['all_items'] = UserItem::where('user_id', $user->id)->where('status', 1)->count(); return view('user-front.shop', $data); } public function adDetails(Request $request, $domain, $slug) { $user = getUser(); if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); } $defaultLang = UserLanguage::where('is_default', 1)->where('user_id', $user->id)->first(); // $data['ad_details'] = UserItemContent::where('language_id', $userCurrentLang->id)->with('item.sliders', 'variations')->where('slug', $slug)->firstOrFail(); $data['ad_details'] = UserItemContent::where(function($query) use ($userCurrentLang, $defaultLang){ $query->where('language_id', $userCurrentLang->id); if ($userCurrentLang->id !== $defaultLang->id) { $query->orWhere('language_id', $defaultLang->id); } }) ->with('item.sliders', 'variations') ->where('slug', $slug) ->firstOrFail(); $data['relateditems'] = $data['user_items'] = DB::table('user_items')->where('user_items.user_id', '=', $user->id)->where('user_items.status', 1) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_item_contents.*', 'user_item_categories.name AS category') ->where('user_items.id', '!=', $data['ad_details']->item->id) ->where('user_item_categories.language_id', '=', $userCurrentLang->id) ->where('user_item_contents.language_id', '=', $userCurrentLang->id) ->where('user_item_contents.category_id', '=', $data['ad_details']->category_id) ->limit(6) ->get(); $data['user'] = $user; $data['reviews'] = ItemReview::where('item_id', $data['ad_details']->item_id)->orderBy('id', 'desc')->get(); if (Auth::guard('customer')->check()) { $data['myWishlist'] = CustomerWishList::where('customer_id', Auth::guard('customer')->user()->id)->pluck('item_id')->toArray(); } else { $data['myWishlist'] = []; } return view('user-front.item-details', $data); } } Http/Controllers/Front/CourseManagement/EnrolmentController.php 0000644 00000041274 15213350434 0021046 0 ustar 00 <?php namespace App\Http\Controllers\Front\CourseManagement; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Controllers\User\CourseManagement\Payment\AuthorizenetController; use App\Http\Controllers\User\CourseManagement\Payment\FlutterwaveController; use App\Http\Controllers\User\CourseManagement\Payment\InstamojoController; use App\Http\Controllers\User\CourseManagement\Payment\MercadoPagoController; use App\Http\Controllers\User\CourseManagement\Payment\MollieController; use App\Http\Controllers\User\CourseManagement\Payment\OfflineController; use App\Http\Controllers\User\CourseManagement\Payment\PaypalController; use App\Http\Controllers\User\CourseManagement\Payment\PaystackController; use App\Http\Controllers\User\CourseManagement\Payment\PaytmController; use App\Http\Controllers\User\CourseManagement\Payment\RazorpayController; use App\Http\Controllers\User\CourseManagement\Payment\StripeController; use App\Http\Helpers\UserPermissionHelper; use App\Models\User\BasicSetting; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseEnrolment; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\UserEmailTemplate; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use PDF; use PHPMailer\PHPMailer\PHPMailer; use App\Http\Controllers\User\CourseManagement\Payment\PhonePeController; use App\Http\Controllers\User\CourseManagement\Payment\PerfectMoneyController; use App\Http\Controllers\User\CourseManagement\Payment\XenditController; use App\Http\Controllers\User\CourseManagement\Payment\YocoController; use App\Http\Controllers\User\CourseManagement\Payment\ToyyibpayController; use App\Http\Controllers\User\CourseManagement\Payment\PaytabsController; use App\Http\Controllers\User\CourseManagement\Payment\MidtransController; use App\Http\Controllers\User\CourseManagement\Payment\IyzicoController; use App\Http\Controllers\User\CourseManagement\Payment\MyFatoorahController; class EnrolmentController extends Controller { use MiscellaneousTrait; public function enrolment(Request $request, $domain, $id) { $keywords = getUserKeywords(); $request->validate([ 'identity_number' => $request->gateway == 'iyzico' ? 'required' : '', 'zip_code' => $request->gateway == 'iyzico' ? 'required' : '', ]); $user = getUser(); // check whether user is logged in or not if (!Auth::guard('customer')->check()) { return redirect()->route('customer.login', [getParam(), 'redirectPath' => 'course_details']); } else { // check for user's profile information $customer = Auth::guard('customer')->user(); if ( is_null($customer->billing_fname) || is_null($customer->billing_lname) || is_null($customer->billing_email) || is_null($customer->billing_number) || is_null($customer->billing_city) || is_null($customer->billing_state) || is_null($customer->billing_address) || is_null($customer->billing_country) ) { $message = $keywords['Please_complete_your_billing_information'] ?? 'Please complete your billing information'; session()->flash('warning', $message); return redirect()->route('customer.billing-details', getParam()); } } // free course enrolment if ($request->filled('type') && $request['type'] == 'free') { $freeCourseEnrol = new FreeCourseEnrolController(); return $freeCourseEnrol->enrolmentProcess($id, $user->id); } // premium course enrolment $paymentMsg = $keywords['Please_select_a_payment_method'] ?? 'Please select a payment method'; if (!session()->has('discountedPrice') && !$request->exists('gateway')) { session()->flash('error', $paymentMsg); return redirect()->back(); } else if ((session()->has('discountedPrice') && session()->get('discountedPrice') > 0) && !$request->exists('gateway')) { session()->flash('error', $paymentMsg); return redirect()->back(); } else if ($request['gateway'] == 'paypal') { $paypal = new PayPalController(); return $paypal->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'instamojo') { $instamojo = new InstamojoController(); return $instamojo->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'paystack') { $paystack = new PaystackController(); return $paystack->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'flutterwave') { $flutterwave = new FlutterwaveController; return $flutterwave->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'razorpay') { $razorpay = new RazorpayController(); return $razorpay->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'mercadopago') { $mercadopago = new MercadoPagoController(); return $mercadopago->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'mollie') { $mollie = new MollieController(); return $mollie->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'stripe') { $stripe = new StripeController(); return $stripe->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'paytm') { $paytm = new PaytmController(); return $paytm->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'authorize.net') { $authorizeNet = new AuthorizenetController(); return $authorizeNet->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'phonepe') { $phonepe = new PhonePeController(); return $phonepe->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'perfect_money') { $phonepe = new PerfectMoneyController(); return $phonepe->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'xendit') { $phonepe = new XenditController(); return $phonepe->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'yoco') { $phonepe = new YocoController(); return $phonepe->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'toyyibpay') { $toyyibpay = new ToyyibpayController(); return $toyyibpay->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'paytabs') { $paytabs = new PaytabsController(); return $paytabs->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'midtrans') { $midtrans = new MidtransController(); return $midtrans->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'iyzico') { $iyzico = new IyzicoController(); return $iyzico->enrolmentProcess($request, $id, $user->id); } else if ($request['gateway'] == 'myfatoorah') { $myfatoorah = new MyFatoorahController(); return $myfatoorah->enrolmentProcess($request, $id, $user->id); } else { $offline = new OfflineController(); return $offline->enrolmentProcess($request, $id, $user->id); } } public function calculation(Request $request, $courseId, $userId) { $course = Course::query() ->where('id', '=', $courseId) ->where('user_id', $userId) ->where('status', '=', 'published') ->firstOrFail(); $course_price = floatval($course->current_price); if ($request->session()->has('discountedCourse')) { $_course_id = $request->session()->get('discountedCourse'); if ($courseId == $_course_id) { if ($request->session()->has('discount')) { $_discount = $request->session()->get('discount'); } if ($request->session()->has('discountedPrice')) { $_course_new_price = $request->session()->get('discountedPrice'); } } } return [ 'coursePrice' => $course_price, 'discount' => isset($_discount) ? floatval($_discount) : null, 'grandTotal' => isset($_course_new_price) ? floatval($_course_new_price) : $course_price ]; } public function storeData($info, $userId) { $customer = Auth::guard('customer')->user(); return CourseEnrolment::create([ 'user_id' => $userId, 'customer_id' => Auth::guard('customer')->user()->id, 'order_id' => time(), 'billing_first_name' => $customer->billing_fname, 'billing_last_name' => $customer->billing_lname, 'billing_email' => $customer->billing_email, 'billing_contact_number' => $customer->billing_number, 'billing_address' => $customer->billing_address, 'billing_city' => $customer->billing_city, 'billing_state' => $customer->billing_state, 'billing_country' => $customer->billing_country, 'course_id' => $info['courseId'], 'course_price' => array_key_exists('coursePrice', $info) ? $info['coursePrice'] : null, 'discount' => array_key_exists('discount', $info) ? $info['discount'] : null, 'grand_total' => array_key_exists('grandTotal', $info) ? $info['grandTotal'] : null, 'currency_text' => array_key_exists('currencyText', $info) ? $info['currencyText'] : null, 'currency_text_position' => array_key_exists('currencyTextPosition', $info) ? $info['currencyTextPosition'] : null, 'currency_symbol' => array_key_exists('currencySymbol', $info) ? $info['currencySymbol'] : null, 'currency_symbol_position' => array_key_exists('currencySymbolPosition', $info) ? $info['currencySymbolPosition'] : null, 'payment_method' => array_key_exists('paymentMethod', $info) ? $info['paymentMethod'] : null, 'gateway_type' => array_key_exists('gatewayType', $info) ? $info['gatewayType'] : null, 'payment_status' => array_key_exists('paymentStatus', $info) ? $info['paymentStatus'] : null, 'attachment' => array_key_exists('attachmentFile', $info) ? $info['attachmentFile'] : null, 'conversation_id' => array_key_exists('conversation_id', $info) ? $info['conversation_id'] : null ]); } public function generateInvoice($enrolmentInfo, $courseId, $userId) { $fileName = $enrolmentInfo->order_id . '.pdf'; $directory = public_path(Constant::WEBSITE_ENROLLMENT_INVOICE); if (!file_exists($directory)) { mkdir($directory, 0775, true); } $fileLocated = $directory . $fileName; // get course title $language = $this->getUserCurrentLanguage($userId); $course = Course::query()->where('user_id', $userId)->findOrFail($courseId); $courseInfo = CourseInformation::query() ->where('course_id', $course->id) ->where('user_id', $userId) ->where('language_id', $language->id) ->firstOrFail(); $userBs = BasicSetting::query()->select('website_title', 'logo', 'favicon')->where('user_id', $userId)->first(); $width = '50%'; $float = 'left'; PDF::loadView('pdf.enrollment', compact('enrolmentInfo', 'courseInfo', 'userBs', 'width', 'float'))->save($fileLocated); return $fileName; } public function sendMail($enrolmentInfo, $userId) { // first get the mail template info from db $mailTemplate = UserEmailTemplate::query() ->where('email_type', 'course_enrolment') ->where('user_id', $userId) ->first(); $mailSubject = $mailTemplate->email_subject; $mailBody = $mailTemplate->email_body; // second get the website title & mail's smtp info from db $be = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_username', 'smtp_password', 'from_mail', 'from_name') ->first(); $userBs = BasicSetting::query()->where('user_id', $userId) ->select('website_title', 'email', 'from_name') ->first(); $customerName = $enrolmentInfo->billing_first_name . ' ' . $enrolmentInfo->billing_last_name; $orderId = $enrolmentInfo->order_id; $language = $this->getUserCurrentLanguage($userId); $course = Course::query() ->where('id', $enrolmentInfo->course_id) ->firstOrFail(); $courseInfo = CourseInformation::query() ->where('user_id', $userId) ->where('course_id', $course->id) ->where('language_id', $language->id) ->firstOrFail(); $courseTitle = $courseInfo->title; $websiteTitle = $userBs->website_title; $mailBody = str_replace('{customer_name}', $customerName, $mailBody); $mailBody = str_replace('{order_id}', $orderId, $mailBody); $mailBody = str_replace('{title}', $courseTitle, $mailBody); $mailBody = str_replace('{website_title}', $websiteTitle, $mailBody); // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = 'UTF-8'; $mail->Encoding = 'base64'; // if smtp status == 1, then set some value for PHPMailer if ($be->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; // if ($be->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // } $mail->Port = 587; } // finally, add other informations and send the mail try { // Recipients $mail->setFrom($be->from_mail, $userBs->from_name); $mail->addReplyTo($userBs->email, $userBs->from_name); $mail->addAddress($enrolmentInfo->billing_email); $path = public_path(Constant::WEBSITE_ENROLLMENT_INVOICE . '/' . $enrolmentInfo->invoice); // Attachments (Invoice) $mail->addAttachment($path); // Content $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); return; } catch (\Exception $e) { return session()->flash('warning', 'Mail could not be sent! Mailer Error: ' . $e); } } public function complete(Request $request, $domain, $id, $via = null) { $user = getUser(); $language = MiscellaneousTrait::getCustomerCurrentLanguage(); // $queryResult['bgImg'] = $this->getUserBreadcrumb($user->id); $course = Course::query()->where('user_id', $user->id)->findOrFail($id); $queryResult['courseInfo'] = CourseInformation::query() ->where('course_id', $course->id) ->where('user_id', $user->id) ->where('language_id', $language->id) ->firstOrFail(); $queryResult['paidVia'] = $via; // forget all session data before proceed $request->session()->forget('discountedCourse'); $request->session()->forget('discount'); $request->session()->forget('discountedPrice'); return view('user-front.course_management.payment_success', $queryResult); } public function cancel(Request $request, $domain, $id) { $user = getUser(); $language = $this->getUserCurrentLanguage($user->id); $course = Course::query()->where('user_id', $user->id)->findOrFail($id); $courseInfo = CourseInformation::query() ->where('course_id', $course->id) ->where('user_id', $user->id) ->where('language_id', $language->id) ->firstOrFail(); session()->flash('error', 'Sorry, an error has occurred!'); // forget all session data before proceed $request->session()->forget('discountedCourse'); $request->session()->forget('discount'); $request->session()->forget('discountedPrice'); return redirect()->route('front.user.course.details', [getParam(), 'slug' => $courseInfo->slug]); } } Http/Controllers/Front/CourseManagement/CourseController.php 0000644 00000045017 15213350434 0020342 0 ustar 00 <?php namespace App\Http\Controllers\Front\CourseManagement; use App\Http\Controllers\Controller; use App\Models\User\CourseManagement\Coupon; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseCategory; use App\Models\User\CourseManagement\CourseEnrolment; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\CourseManagement\CourseReview; use App\Models\User\Language; use App\Models\User\UserOfflineGateway; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Http\Request; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; class CourseController extends Controller { use MiscellaneousTrait; public function courses(Request $request, $domain) { $user = getUser(); $language = $this->getUserCurrentLanguage($user->id); $type = $category = $min = $max = $keyword = $sort = null; if ($request->filled('type')) { $type = $request['type']; } if ($request->filled('category')) { $category = CourseCategory::where('slug', $request['category'])->where('user_id', $user->id)->first()->id; } if ($request->filled('min') && $request->filled('max')) { $min = $request['min']; $max = $request['max']; } if ($request->filled('keyword')) { $keyword = $request['keyword']; } if ($request->filled('sort')) { $sort = $request['sort']; } $courses = Course::query()->join('user_course_informations', 'user_courses.id', '=', 'user_course_informations.course_id') ->join('user_course_categories', 'user_course_categories.id', '=', 'user_course_informations.course_category_id') ->join('user_course_instructors', 'user_course_instructors.id', '=', 'user_course_informations.instructor_id') ->where('user_courses.status', '=', 'published') ->where('user_course_informations.language_id', '=', $language->id) ->where('user_course_informations.user_id', '=', $user->id) ->when($type, function ($query, $type) { if ($type == 'free') { return $query->where('user_courses.pricing_type', '=', 'free'); } else if ($type == 'premium') { return $query->where('user_courses.pricing_type', '=', 'premium'); } }) ->when($category, function ($query, $category) { return $query->where('user_course_informations.course_category_id', '=', $category); }) ->when(($min && $max), function ($query) use ($min, $max) { return $query->where('user_courses.current_price', '>=', $min)->where('user_courses.current_price', '<=', $max); }) ->when($keyword, function ($query, $keyword) { return $query->where('user_course_informations.title', 'like', '%' . $keyword . '%'); }) ->select('user_courses.id', 'user_courses.thumbnail_image', 'user_courses.pricing_type', 'user_courses.previous_price', 'user_courses.current_price', 'user_courses.average_rating', 'user_courses.duration', 'user_course_informations.title', 'user_course_informations.slug', 'user_course_categories.name as categoryName', 'user_course_categories.slug as categorySlug', 'user_course_instructors.image as instructorImage', 'user_course_instructors.name as instructorName') ->when($sort, function ($query, $sort) { if ($sort == 'new') { return $query->orderBy('user_courses.created_at', 'DESC'); } else if ($sort == 'old') { return $query->orderBy('user_courses.created_at', 'ASC'); } elseif ($sort == 'ascending') { return $query->orderBy('user_courses.current_price', 'ASC'); } elseif ($sort == 'descending') { return $query->orderBy('user_courses.current_price', 'DESC'); } }, function ($query) { return $query->orderByDesc('user_courses.id'); }) ->paginate(9); $courses->map(function ($course) use ($user) { $course['enrolmentCount'] = CourseEnrolment::query() ->where('course_id', '=', $course->id) ->where('user_id', $user->id) ->where(function ($query) { $query->where('payment_status', 'completed') ->orWhere('payment_status', 'free'); }) ->count(); }); $queryResult['courses'] = $courses; $queryResult['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo($user->id); $queryResult['categories'] = CourseCategory::query()->where('user_id', $user->id)->where('language_id', $language->id)->where('status', 1)->orderBy('serial_number', 'asc')->get(); $queryResult['minPrice'] = Course::query()->where('pricing_type', 'premium') ->where('status', 'published') ->where('user_id', $user->id) ->min('current_price'); $queryResult['maxPrice'] = Course::query()->where('pricing_type', 'premium') ->where('status', 'published') ->where('user_id', $user->id) ->max('current_price'); if (empty($queryResult['minPrice'])) { $queryResult['minPrice'] = 0; } if (empty($queryResult['maxPrice'])) { $queryResult['maxPrice'] = 0; } return view('user-front.course_management.courses', $queryResult); } public function details($domain, $slug) { $user = getUser(); $language = $this->getUserCurrentLanguage($user->id); $defaultLanguage = Language::where('is_default', 1)->where('user_id', $user->id)->first(); $courseId = CourseInformation::where('slug', $slug)->where('user_id', $user->id)->firstOrFail()->course_id; $details = Course::query()->join('user_course_informations', 'user_courses.id', '=', 'user_course_informations.course_id') ->join('user_course_categories', 'user_course_categories.id', '=', 'user_course_informations.course_category_id') ->join('user_course_instructors', 'user_course_instructors.id', '=', 'user_course_informations.instructor_id') ->where('user_courses.status', '=', 'published') // ->where('user_course_informations.language_id', '=', $language->id) ->where(function ($query) use ($language, $defaultLanguage) { $query->where('user_course_informations.language_id', '=', $language->id) ->orWhere('user_course_informations.language_id', '=', $defaultLanguage->id); }) ->where('user_course_informations.course_id', '=', $courseId) ->where('user_courses.user_id', '=', $user->id) ->select('user_courses.*', 'user_course_informations.id as courseInfoId', 'user_course_informations.language_id', 'user_course_informations.title', 'user_course_informations.features', 'user_course_informations.description', 'user_course_informations.meta_keywords', 'user_course_informations.meta_description', 'user_course_categories.name as categoryName', 'user_course_instructors.id as instructorId', 'user_course_instructors.image as instructorImage', 'user_course_instructors.name as instructorName', 'user_course_instructors.occupation as instructorJob', 'user_course_instructors.description as instructorDetails') ->firstOrFail(); if (empty($details)) { $deLang = Language::where('is_default', 1)->where('user_id', $user->id)->first(); session()->put('currentLocaleCode', $deLang->code); app()->setLocale($deLang->code); $details = Course::join('course_informations', 'courses.id', '=', 'course_informations.course_id') ->join('course_categories', 'course_categories.id', '=', 'course_informations.course_category_id') ->join('instructors', 'instructors.id', '=', 'course_informations.instructor_id') ->where('courses.status', '=', 'published') ->where('user_course_informations.language_id', '=', $deLang->id) ->where('user_course_informations.course_id', '=', $courseId) ->where('user_courses.user_id', '=', $user->id) ->select('courses.*', 'course_informations.id as courseInfoId', 'course_informations.language_id', 'course_informations.title', 'course_informations.features', 'course_informations.description', 'course_informations.meta_keywords', 'course_informations.meta_description', 'course_categories.name as categoryName', 'instructors.id as instructorId', 'instructors.image as instructorImage', 'instructors.name as instructorName', 'instructors.occupation as instructorJob', 'instructors.description as instructorDetails') ->firstOrFail(); } $queryResult['details'] = $details; $queryResult['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo($user->id); $queryResult['onlineGateways'] = UserPaymentGeteway::query() ->where('user_id', $user->id) ->where('status', 1) ->get(); $queryResult['offlineGateways'] = UserOfflineGateway::query() ->where('user_id', $user->id) ->where('item_checkout_status', 1) ->orderBy('serial_number', 'ASC') ->get(); $categoryId = CourseInformation::query()->where('language_id', $language->id) ->where('user_id', $user->id) ->where('slug', $slug) ->pluck('course_category_id') ->first(); $relatedCourses = Course::query()->join('user_course_informations', 'user_courses.id', '=', 'user_course_informations.course_id') ->join('user_course_categories', 'user_course_categories.id', '=', 'user_course_informations.course_category_id') ->join('user_course_instructors', 'user_course_instructors.id', '=', 'user_course_informations.instructor_id') ->where('user_courses.status', '=', 'published') ->where('user_course_informations.language_id', '=', $language->id) ->where('user_course_informations.course_category_id', '=', $categoryId) ->where('user_course_informations.course_id', '<>', $courseId) ->where('user_courses.user_id', '=', $user->id) ->select('user_courses.id', 'user_courses.thumbnail_image', 'user_courses.pricing_type', 'user_courses.previous_price', 'user_courses.current_price', 'user_courses.average_rating', 'user_courses.duration', 'user_course_informations.title', 'user_course_informations.slug', 'user_course_categories.name as categoryName', 'user_course_instructors.image as instructorImage', 'user_course_instructors.name as instructorName', 'user_course_categories.slug as categorySlug') ->orderByDesc('user_courses.id') ->limit(2) ->get(); $relatedCourses->map(function ($relatedCourse) use ($user) { $relatedCourse['enrolmentCount'] = CourseEnrolment::query() ->where('course_id', '=', $relatedCourse->id) ->where('user_id', $user->id) ->where(function ($query) { $query->where('payment_status', '!=', 'pending') ->where('payment_status', '!=', 'rejected'); }) ->count(); }); $queryResult['relatedCourses'] = $relatedCourses; $course = $queryResult['details']; $queryResult['reviews'] = CourseReview::query() ->where('course_id', $course->id) ->orderByDesc('id') ->get(); //it will be replaced by student id if (Auth::guard('customer')->check()) { $authUser = Auth::guard('customer')->user(); $queryResult['enrolmentInfo'] = CourseEnrolment::query() ->where('customer_id', $authUser->id) ->where('user_id', $user->id) ->where('course_id', $course->id) ->first(); } $queryResult['ratingCount'] = CourseReview::query()->where('course_id', $course->id)->count(); $queryResult['enrolmentCount'] = CourseEnrolment::query() ->where('course_id', $course->id) ->where('user_id', $user->id) ->where(function ($query) { $query->where('payment_status', '!=', 'pending') ->where('payment_status', '!=', 'rejected'); }) ->count(); $stripe = UserPaymentGeteway::where('keyword', 'stripe')->where([['status', 1], ['user_id', $user->id]])->first(); if (is_null($stripe)) { $queryResult['stripe_key'] = null; } else { $stripe_info = json_decode($stripe->information, true); $queryResult['stripe_key'] = $stripe_info['key']; } $queryResult['currentLanguageInfo'] = $language; return view('user-front.course_management.course-details', $queryResult); } public function applyCoupon(Request $request, $domain) { $user = getUser(); $keywords = getUserKeywords(); try { $coupon = Coupon::query()->where('code', $request->coupon)->where('user_id', $user->id)->firstOrFail(); $startDate = Carbon::parse($coupon->start_date); $endDate = Carbon::parse($coupon->end_date); $todayDate = Carbon::now(); $courses = $coupon->courses; $courses = json_decode($courses, true); $courses = !empty($courses) ? $courses : []; if (!in_array($request->id, $courses)) { $message = $keywords['This_coupon_is_not_valid_for_this_course'] ?? __('Coupon is not valid for this course') . '!'; return response()->json([ 'error' => $message ]); } // first, check coupon is valid or not if ($todayDate->between($startDate, $endDate) == false) { $message = $keywords['coupon_not_valid'] ?? __('Coupon is not valid') . '!'; return response()->json(['error' => $message]); } else { $messsage = $keywords['coupon_applied_success'] ?? __('Coupon applied successfully') . '.'; $course = Course::query()->where('user_id', $user->id)->findOrFail($request->id); $coursePrice = floatval($course->current_price); if ($coupon->type == 'fixed') { $reducedPrice = $coursePrice - floatval($coupon->value); $request->session()->put('discountedCourse', $course->id); $request->session()->put('discount', $coupon->value); $request->session()->put('discountedPrice', $reducedPrice); return response()->json([ 'success' => $messsage, 'amount' => $coupon->value, 'newPrice' => $reducedPrice ]); } else { $couponAmount = $coursePrice * ($coupon->value / 100); $couponAmount = round($couponAmount, 2); $reducedPrice = $coursePrice - $couponAmount; $request->session()->put('discountedCourse', $course->id); $request->session()->put('discount', $couponAmount); $request->session()->put('discountedPrice', $reducedPrice); return response()->json([ 'success' => $messsage, 'amount' => $couponAmount, 'newPrice' => $reducedPrice ]); } } } catch (ModelNotFoundException $e) { $message = $keywords['coupon_not_valid'] ?? __('Coupon is not valid') . '.'; return response()->json(['error' => $message]); } } public function storeFeedback(Request $request, $domain, $id) { $rule = ['rating' => 'required']; $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return redirect()->back()->with('error', 'The rating field is required for course review.')->withInput(); } $flag = 0; $user = getUser(); // get to authenticate user $customer = Auth::guard('customer')->user(); // then, get the course enrolments of that user $enrolments = $customer->courseEnrolment() ->where(function ($query) { $query->where('payment_status', '!=', 'pending') ->where('payment_status', '!=', 'rejected'); }) ->get(); if (count($enrolments) > 0) { foreach ($enrolments as $enrolment) { // check whether selected course has enrolled to this user or not if ($enrolment->course_id == $id) { $flag = 1; break; } } if ($flag == 1) { CourseReview::updateOrCreate( [ 'customer_id' => $customer->id, 'course_id' => $id, 'user_id' => $user->id ], [ 'comment' => $request->comment, 'rating' => $request->rating, 'user_id' => $user->id ] ); // now, get the average rating of this course $reviews = CourseReview::query() ->where('course_id', $id) ->where('user_id', $user->id) ->get(); $totalRating = 0; foreach ($reviews as $review) { $totalRating += $review->rating; } $averageRating = $totalRating / $reviews->count(); // finally, store the average rating of this course Course::query()->where('user_id', $user->id)->find($id)->update(['average_rating' => $averageRating]); session()->flash('success', 'Your review submitted successfully.'); } else { session()->flash('error', 'You have not enrolled in this course yet!'); } } else { return redirect()->back()->with('error', 'You have not enrolled in any course yet!'); } return redirect()->back(); } } Http/Controllers/Front/CourseManagement/FreeCourseEnrolController.php 0000644 00000001702 15213350434 0022135 0 ustar 00 <?php namespace App\Http\Controllers\Front\CourseManagement; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class FreeCourseEnrolController extends Controller { public function enrolmentProcess($courseId, $userId) { $enrol = new EnrolmentController(); $arrData = array('courseId' => $courseId, 'paymentStatus' => 'free'); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } } Http/Controllers/Front/CheckoutController.php 0000644 00000101322 15213350434 0015402 0 ustar 00 <?php namespace App\Http\Controllers\Front; use Carbon\Carbon; use App\Models\User; use App\Models\Coupon; use App\Models\Package; use App\Models\Language; use App\Models\User\Menu; use App\Models\Membership; use Illuminate\Http\Request; use App\Models\OfflineGateway; use App\Http\Helpers\MegaMailer; use App\Models\User\HomeSection; use App\Models\User\HomePageText; use App\Models\User\UserPermission; use App\Http\Controllers\Controller; use App\Models\User\UserShopSetting; use App\Models\User\UserEmailTemplate; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use App\Http\Helpers\UserPermissionHelper; use App\Http\Requests\Checkout\CheckoutRequest; use App\Http\Controllers\Payment\PaytmController; use App\Http\Controllers\Payment\MollieController; use App\Http\Controllers\Payment\PaypalController; use App\Http\Controllers\Payment\StripeController; use App\Http\Controllers\Payment\PaystackController; use App\Http\Controllers\Payment\RazorpayController; use App\Http\Controllers\Payment\InstamojoController; use App\Http\Controllers\Payment\FlutterWaveController; use App\Http\Controllers\Payment\MercadopagoController; use App\Http\Controllers\Payment\AuthorizenetController; use App\Http\Controllers\Payment\PaytabsController; use App\Http\Controllers\Payment\PerfectMoneyController; use App\Http\Controllers\Payment\PhonePeController; use App\Http\Controllers\Payment\XenditController; use App\Http\Controllers\Payment\YocoController; use App\Http\Controllers\Payment\ToyyibpayController; use App\Http\Controllers\Payment\MidtransController; use App\Http\Controllers\Payment\IyzicoController; use App\Http\Controllers\Payment\MyFatoorahController; use App\Models\BasicSetting; class CheckoutController extends Controller { public function checkout(CheckoutRequest $request) { $coupon = Coupon::where('code', Session::get('coupon'))->first(); if (!empty($coupon)) { $coupon_count = $coupon->total_uses; if ($coupon->maximum_uses_limit != 999999) { if ($coupon_count == $coupon->maximum_uses_limit) { Session::forget('coupon'); session()->flash('warning', __('This coupon reached maximum limit')); return redirect()->back(); } } } $offline_payment_gateways = OfflineGateway::all()->pluck('name')->toArray(); $currentLang = session()->has('lang') ? (Language::where('code', session()->get('lang'))->first()) : (Language::where('is_default', 1)->first()); $bs = $currentLang->basic_setting; $be = $currentLang->basic_extended; $request['status'] = 1; $request['mode'] = 'online'; $request['receipt_name'] = null; Session::put('paymentFor', 'membership'); $title = "You are purchasing a membership"; $description = "Congratulation you are going to join our membership.Please make a payment for confirming your membership now!"; if ($request->package_type == "trial") { $package = Package::find($request['package_id']); $request['price'] = 0.00; $request['payment_method'] = "-"; $transaction_id = UserPermissionHelper::uniqidReal(8); $transaction_details = "Trial"; $user = $this->store($request->all(), $transaction_id, $transaction_details, $request->price, $be, $request->password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($request->all(), "membership", $user, $request->password, $request['price'], "Trial", $request['phone'], $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $package->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'registration_with_trial_package', 'type' => 'registrationWithTrialPackage' ]; $mailer->mailFromAdmin($data); session()->flash('success', __('successful_payment')); return redirect()->route('membership.trial.success'); } elseif ($request->price == 0) { $package = Package::find($request['package_id']); $request['price'] = 0.00; $request['payment_method'] = "-"; $transaction_id = UserPermissionHelper::uniqidReal(8); $transaction_details = "Free"; $user = $this->store($request->all(), $transaction_id, $transaction_details, $request->price, $be, $request->password); $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $activation = Carbon::parse($lastMemb->start_date); $expire = Carbon::parse($lastMemb->expire_date); $file_name = $this->makeInvoice($request->all(), "membership", $user, $request->password, $request['price'], "Free", $request['phone'], $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $package->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'activation_date' => $activation->toFormattedDateString(), 'expire_date' => Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'registration_with_free_package', 'type' => 'registrationWithFreePackage' ]; $mailer->mailFromAdmin($data); session()->flash('success', __('successful_payment')); return redirect()->route('success.page'); } elseif ($request->payment_method == "Paypal") { $amount = round(($request->price / $be->base_currency_rate), 2); $paypal = new PaypalController(); $cancel_url = route('membership.paypal.cancel'); $success_url = route('membership.paypal.success'); return $paypal->paymentProcess($request, $amount, $title, $success_url, $cancel_url); } elseif ($request->payment_method == "Stripe") { $amount = round(($request->price / $be->base_currency_rate), 2); $stripe = new StripeController(); $cancel_url = route('membership.stripe.cancel'); return $stripe->paymentProcess($request, $amount, $title, NULL, $cancel_url); } elseif ($request->payment_method == "Paytm") { if ($be->base_currency_text != "INR") { return redirect()->back()->with('error', __('only_paytm_INR'))->withInput($request->all()); } $amount = $request->price; $item_number = uniqid('paytm-') . time(); $callback_url = route('membership.paytm.status'); $paytm = new PaytmController(); return $paytm->paymentProcess($request, $amount, $item_number, $callback_url); } elseif ($request->payment_method == "Paystack") { if ($be->base_currency_text != "NGN") { return redirect()->back()->with('error', __('only_paystack_NGN'))->withInput($request->all()); } $amount = round($request->price * 100); $email = $request->email; $success_url = route('membership.paystack.success'); $payStack = new PaystackController(); return $payStack->paymentProcess($request, $amount, $email, $success_url, $be); } elseif ($request->payment_method == "Razorpay") { if ($be->base_currency_text != "INR") { return redirect()->back()->with('error', __('only_razorpay_INR'))->withInput($request->all()); } $amount = $request->price; $item_number = uniqid('razorpay-') . time(); $cancel_url = route('membership.razorpay.cancel'); $success_url = route('membership.razorpay.success'); $razorpay = new RazorpayController(); return $razorpay->paymentProcess($request, $amount, $item_number, $cancel_url, $success_url, $title, $description, $bs, $be); } elseif ($request->payment_method == "Instamojo") { if ($be->base_currency_text != "INR") { return redirect()->back()->with('error', __('only_instamojo_INR'))->withInput($request->all()); } if ($request->price < 9) { session()->flash('warning', __('Minimum 10 INR required for this payment gateway') . '.'); return back()->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.instamojo.success'); $cancel_url = route('membership.instamojo.cancel'); $instaMojo = new InstamojoController(); return $instaMojo->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Mercado Pago") { if ($be->base_currency_text != "BRL") { return redirect()->back()->with('error', __('only_mercadopago_BRL'))->withInput($request->all()); } $amount = $request->price; $email = $request->email; $success_url = route('membership.mercadopago.success'); $cancel_url = route('membership.mercadopago.cancel'); $mercadopagoPayment = new MercadopagoController(); return $mercadopagoPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $email, $title, $description, $be); } elseif ($request->payment_method == "Flutterwave") { $available_currency = array( 'BIF', 'CAD', 'CDF', 'CVE', 'EUR', 'GBP', 'GHS', 'GMD', 'GNF', 'KES', 'LRD', 'MWK', 'NGN', 'RWF', 'SLL', 'STD', 'TZS', 'UGX', 'USD', 'XAF', 'XOF', 'ZMK', 'ZMW', 'ZWD' ); if (!in_array($be->base_currency_text, $available_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = round(($request->price / $be->base_currency_rate), 2); $email = $request->email; $item_number = uniqid('flutterwave-') . time(); $cancel_url = route('membership.flutterwave.cancel'); $success_url = route('membership.flutterwave.success'); $flutterWave = new FlutterWaveController(); return $flutterWave->paymentProcess($request, $amount, $email, $item_number, $success_url, $cancel_url, $be); } elseif ($request->payment_method == "Authorize.net") { $available_currency = array('USD', 'CAD', 'CHF', 'DKK', 'EUR', 'GBP', 'NOK', 'PLN', 'SEK', 'AUD', 'NZD'); if (!in_array($be->base_currency_text, $available_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $cancel_url = route('membership.anet.cancel'); $anetPayment = new AuthorizenetController(); return $anetPayment->paymentProcess($request, $amount, $cancel_url, $title, $be); } elseif ($request->payment_method == "Mollie Payment") { $available_currency = array('AED', 'AUD', 'BGN', 'BRL', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HRK', 'HUF', 'ILS', 'ISK', 'JPY', 'MXN', 'MYR', 'NOK', 'NZD', 'PHP', 'PLN', 'RON', 'RUB', 'SEK', 'SGD', 'THB', 'TWD', 'USD', 'ZAR'); if (!in_array($be->base_currency_text, $available_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = round(($request->price / $be->base_currency_rate), 2); $success_url = route('membership.mollie.success'); $cancel_url = route('membership.mollie.cancel'); $molliePayment = new MollieController(); return $molliePayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "PhonePe") { if ($be->base_currency_text != 'INR') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.phonepe.success'); $cancel_url = route('membership.phonepe.cancel'); $phonepePayment = new PhonePeController(); return $phonepePayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Perfect Money") { if ($be->base_currency_text != 'USD') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.perfect_money.success'); $cancel_url = route('membership.perfect_money.cancel'); $perfectMoneyPayment = new PerfectMoneyController(); return $perfectMoneyPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Xendit") { $allowed_currency = array('IDR', 'PHP', 'USD', 'SGD', 'MYR'); if (!in_array($be->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.xendit.success'); $cancel_url = route('membership.perfect_money.cancel'); $xenditPayment = new XenditController(); return $xenditPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Yoco") { if ($be->base_currency_text != 'ZAR') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.yoco.success'); $cancel_url = route('membership.perfect_money.cancel'); $yocoPayment = new YocoController(); return $yocoPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Toyyibpay") { if ($be->base_currency_text != 'RM') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.toyyibpay.success'); $cancel_url = route('membership.perfect_money.cancel'); $yocoPayment = new ToyyibpayController(); return $yocoPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Paytabs") { $paytabInfo = paytabInfo('admin', null); // changing the currency before redirect to Stripe if ($be->base_currency_text != $paytabInfo['currency']) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.paytabs.success'); $cancel_url = route('membership.perfect_money.cancel'); $paytabPayment = new PaytabsController(); return $paytabPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Midtrans") { if ($be->base_currency_text != 'IDR') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.midtrans.success'); $cancel_url = route('membership.perfect_money.cancel'); $paytabPayment = new MidtransController(); return $paytabPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Iyzico") { if ($be->base_currency_text != 'TRY') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.iyzico.success'); $cancel_url = route('membership.perfect_money.cancel'); $iyzicoPayment = new IyzicoController(); return $iyzicoPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Myfatoorah") { $allowed_currency = array('KWD', 'SAR', 'BHD', 'AED', 'QAR', 'OMR', 'JOD'); if (!in_array($be->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = null; $cancel_url = route('membership.perfect_money.cancel'); $myfatoorahPayment = new MyFatoorahController(); return $myfatoorahPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif (in_array($request->payment_method, $offline_payment_gateways)) { $request['mode'] = 'offline'; $request['status'] = 0; $request['receipt_name'] = null; if ($request->has('receipt')) { $filename = time() . '.' . $request->file('receipt')->getClientOriginalExtension(); $directory = public_path("assets/front/img/membership/receipt"); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('receipt')->move($directory, $filename); $request['receipt_name'] = $filename; } $amount = round(($request->price / $be->base_currency_rate), 2); $transaction_id = UserPermissionHelper::uniqidReal(8); $transaction_details = "offline"; $password = $request->password; $this->store($request, $transaction_id, json_encode($transaction_details), $amount, $be, $password); session()->flash('success', __('successful_payment')); return redirect()->route('membership.offline.success'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store($request, $transaction_id, $transaction_details, $amount, $be, $password) { //dynamic language translate wise menu $deLang = User\Language::firstOrFail(); $deLanguageNames = json_decode($deLang->keywords, true); $menus = '[ {"text":"Home","href":"","icon":"empty","target":"_self","title":"","type":"home"}, {"text":"About","href":"","icon":"empty","target":"_self","title":"","type":"custom","children":[{"text":"Team","href":"","icon":"empty","target":"_self","title":"","type":"team"}, {"text":"Career","href":"","icon":"empty","target":"_self","title":"","type":"career"}, {"text":"FAQ","href":"","icon":"empty","target":"_self","title":"","type":"faq"}]}, {"text":"Services","href":"","icon":"empty","target":"_self","title":"","type":"services"}, {"text":"Portfolios","href":"","icon":"empty","target":"_self","title":"","type":"portfolios"}, {"type":"shop","text":"Shop","href":"","target":"_self"}, {"text":"Blog","href":"","icon":"empty","target":"_self","title":"","type":"blog"}, {"text":"Contact","href":"","icon":"empty","target":"_self","title":"","type":"contact"}]'; $menus = json_decode($menus, true); foreach (array_column($menus, 'text') as $key => $menu) { if ($menu == 'Home' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'About') { $menus[$key]['text'] = array_key_exists('About', $deLanguageNames) ? $deLanguageNames['About'] : 'About'; //if children manus exits if (count($menus[$key]['children']) > 0) { $arrays = $menus[$key]['children']; foreach (array_column($arrays, 'text') as $k => $value) { if ($value == 'Team' && array_key_exists($value, $deLanguageNames)) { $menus[$key]['children'][$k]['text'] = $deLanguageNames[$value]; } if ($value == 'Career' && array_key_exists($value, $deLanguageNames)) { $menus[$key]['children'][$k]['text'] = $deLanguageNames[$value]; } if ($value == 'FAQ' && array_key_exists($value, $deLanguageNames)) { $menus[$key]['children'][$k]['text'] = $deLanguageNames[$value]; } } } //end children manus exits } if ($menu == 'Services' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'Portfolios' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'Shop' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'Blog' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'Contact' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } } $menus = json_encode($menus); if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $bs = $currentLang->basic_setting; $token = md5(time() . $request['username'] . $request['email']); $verification_link = "<a href='" . url('register/mode/' . $request['mode'] . '/verify/' . $token) . "'>" . "<button type=\"button\" class=\"btn btn-primary\">Click Here</button>" . "</a>"; $user = User::where('username', $request['username']); if ($user->count() == 0) { $user = User::create([ 'first_name' => $request['first_name'], 'last_name' => $request['last_name'], 'company_name' => $request['company_name'], 'email' => $request['email'], 'phone' => $request['phone'], 'username' => $request['username'], 'password' => bcrypt($password), 'status' => $request["status"], 'address' => $request["address"] ? $request["address"] : null, 'city' => $request["city"] ? $request["city"] : null, 'state' => $request["district"] ? $request["district"] : null, 'country' => $request["country"] ? $request["country"] : null, 'verification_link' => $token, ]); // $deLang = User\Language::firstOrFail(); $langCount = User\Language::where('user_id', $user->id)->where('is_default', 1)->count(); $adminLangs = Language::get(); if ($langCount == 0) { foreach ($adminLangs as $a_lang) { $language = User\Language::create([ 'name' => $a_lang->name, 'code' => $a_lang->code, 'is_default' => $a_lang->is_default, 'rtl' => $a_lang->rtl, 'user_id' => $user->id, 'keywords' => $a_lang->customer_keywords ]); HomePageText::create([ 'user_id' => $user->id, 'language_id' => $language->id ]); $umenu = new Menu(); $umenu->language_id = $language->id; $umenu->user_id = $user->id; $umenu->menus = $menus; $umenu->save(); } } $ubs = BasicSetting::select('email_verification_status')->first(); if ($ubs->email_verification_status == 1) { $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->first_name, 'customer_name' => $user->first_name, 'verification_link' => $verification_link, 'website_title' => $bs->website_title, 'templateType' => 'email_verification', 'type' => 'emailVerification' ]; $mailer->mailFromAdmin($data); } $package = Package::findOrFail($request['package_id']); if (is_array($request)) { if (array_key_exists('conversation_id', $request)) { $conversation_id = $request['conversation_id']; } else { $conversation_id = null; } } else { $conversation_id = null; } Membership::create([ 'package_price' => $package->price, 'discount' => session()->has('coupon_amount') ? session()->get('coupon_amount') : 0, 'coupon_code' => session()->has('coupon') ? session()->get('coupon') : NULL, 'price' => $amount, 'currency' => $be->base_currency_text ? $be->base_currency_text : "USD", 'currency_symbol' => $be->base_currency_symbol ? $be->base_currency_symbol : $be->base_currency_text, 'payment_method' => $request["payment_method"], 'transaction_id' => $transaction_id ? $transaction_id : 0, 'status' => $request["status"] ? $request["status"] : 0, 'is_trial' => $request["package_type"] == "regular" ? 0 : 1, 'trial_days' => $request["package_type"] == "regular" ? 0 : $request["trial_days"], 'receipt' => $request["receipt_name"] ? $request["receipt_name"] : null, 'transaction_details' => $transaction_details ? $transaction_details : null, 'settings' => json_encode($be), 'package_id' => $request['package_id'], 'user_id' => $user->id, 'start_date' => Carbon::parse($request['start_date']), 'expire_date' => Carbon::parse($request['expire_date']), 'conversation_id' => $conversation_id ]); $features = json_decode($package->features, true); $features[] = "Contact"; UserPermission::create([ 'package_id' => $request['package_id'], 'user_id' => $user->id, 'permissions' => json_encode($features) ]); // create payment gateways $payment_keywords = ['flutterwave', 'razorpay', 'paytm', 'paystack', 'instamojo', 'stripe', 'paypal', 'mollie', 'mercadopago', 'authorize.net', 'phonepe']; foreach ($payment_keywords as $key => $value) { UserPaymentGeteway::create([ 'title' => null, 'user_id' => $user->id, 'details' => null, 'keyword' => $value, 'subtitle' => null, 'name' => ucfirst($value), 'type' => 'automatic', 'information' => null ]); } // create email template $templates = ['email_verification', 'product_order', 'reset_password', 'room_booking', 'room_booking', 'payment_received', 'payment_cancelled', 'course_enrolment', 'course_enrolment_approved', 'course_enrolment_rejected', 'donation', 'donation_approved']; foreach ($templates as $key => $val) { UserEmailTemplate::create([ 'user_id' => $user->id, 'email_type' => $val, 'email_subject' => null, 'email_body' => '<p></p>', ]); } $homeSection = new HomeSection(); $homeSection->user_id = $user->id; $homeSection->save(); User\BasicSetting::create([ 'theme' => 'home_one', 'user_id' => $user->id, 'timezone' => 1 ]); UserShopSetting::create([ 'user_id' => $user->id, 'is_shop' => 1, 'catalog_mode' => 0, 'item_rating_system' => 1, 'tax' => 0, ]); } // coupon update if (Session::has('coupon')) { $coupon = Coupon::where('code', Session::get('coupon'))->first(); $coupon->total_uses = $coupon->total_uses + 1; $coupon->save(); } return $user; } public function onlineSuccess() { Session::forget('coupon'); Session::forget('coupon_amount'); return view('front.success'); } public function offlineSuccess() { Session::forget('coupon'); Session::forget('coupon_amount'); return view('front.offline-success'); } public function trialSuccess() { Session::forget('coupon'); Session::forget('coupon_amount'); return view('front.trial-success'); } public function coupon(Request $request) { if (session()->has('coupon')) { return __('Coupon already applied'); } $coupon = Coupon::where('code', $request->coupon)->first(); if (empty($coupon)) { return __('This coupon does not exist'). '.'; } $coupon_count = $coupon->total_uses; if ($coupon->maximum_uses_limit != 999999) { if ($coupon_count >= $coupon->maximum_uses_limit) { return __('This coupon reached maximum limit') . '.'; } } $start = Carbon::parse($coupon->start_date); $end = Carbon::parse($coupon->end_date); $today = Carbon::parse(Carbon::now()->format('m/d/Y')); $packages = $coupon->packages; $packages = json_decode($packages, true); $packages = !empty($packages) ? $packages : []; if (!in_array($request->package_id, $packages)) { return __('This coupon is not valid for this package'). '.'; } if ($today->greaterThanOrEqualTo($start) && $today->lessThanOrEqualTo($end)) { $package = Package::find($request->package_id); $price = $package->price; if ($coupon->type == 'percentage') { $cAmount = ($price * $coupon->value) / 100; } else { $cAmount = $coupon->value; } Session::put('coupon', $request->coupon); Session::put('coupon_amount', round($cAmount, 2)); return "success"; } else { return __('This coupon does not exist') . '.'; } } } Http/Controllers/User/QuoteController.php 0000644 00000027023 15213350434 0014565 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Models\User\BasicSetting; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\User\Quote; use App\Models\BasicExtended as BE; use App\Models\User\Language; use App\Models\User\QuoteInput; use App\Models\User\QuoteInputOption; use Illuminate\Support\Facades\Auth; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; use Validator; use Session; class QuoteController extends Controller { public function visibility() { $user = Auth::guard('web')->user(); $data['abs'] = BasicSetting::where([ ['user_id', $user->id] ])->first(); return view('user.quote.visibility', $data); } public function updateVisibility(Request $request): \Illuminate\Http\RedirectResponse { $bss = BasicSetting::where('user_id', Auth::id())->get(); foreach ($bss as $bs) { $bs->is_quote = $request->is_quote; $bs->save(); } Session::flash('success', __('Page status updated successfully') . '!'); return back(); } public function form(Request $request) { $user = Auth::guard('web')->user(); $lang = Language::where([ ['code', $request->language], ['user_id', $user->id] ])->firstOrFail(); $data['lang_id'] = $lang->id; $data['abs'] = $lang->basic_setting; $data['inputs'] = QuoteInput::where([ ['language_id', $lang->id], ['user_id', $user->id] ])->orderBy('order_number', 'ASC')->get(); return view('user.quote.form', $data); } public function orderUpdate(Request $request){ $ids = $request->ids; $orders = $request->orders; if (!empty($ids)) { foreach ($request->ids as $key => $id) { $input = QuoteInput::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); $input->order_number = $orders["$key"]; $input->save(); } } } public function formstore(Request $request) { $inname = make_input_name($request->label); $inputs = QuoteInput::where([ ['language_id', $request->language_id], ['user_id', Auth::id()] ])->get(); $rules = [ 'label' => [ 'required', function ($attribute, $value, $fail) use ($inname, $inputs) { foreach ($inputs as $input) { if (strtolower($input->name) == strtolower($inname)) { $fail( __('Input field already exists') . "."); } } }, ], 'placeholder' => 'required_unless:type,3,5', 'type' => 'required', 'options.*' => 'required_if:type,2,3' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $maxOrder = QuoteInput::where([ ['language_id', $request->language_id], ['user_id', Auth::id()] ])->max('order_number'); $input = new QuoteInput; $input->language_id = $request->language_id; $input->user_id = Auth::id(); $input->type = $request->type; $input->label = $request->label; $input->name = $inname; $input->placeholder = $request->placeholder; $input->required = $request->required; $input->order_number = $maxOrder + 1; $input->save(); if ($request->type == 2 || $request->type == 3) { $options = $request->options; foreach ($options as $option) { $op = new QuoteInputOption; $op->quote_input_id = $input->id; $op->name = $option; $op->save(); } } Session::flash('success', __('Input field added successfully') . '!'); return "success"; } public function inputDelete(Request $request): \Illuminate\Http\RedirectResponse { $input = QuoteInput::where('user_id', Auth::user()->id)->where('id', $request->input_id)->firstOrFail(); $input->quote_input_options()->delete(); $input->delete(); Session::flash('success', __('Input field deleted successfully') . '!'); return back(); } public function inputEdit($id) { $data['input'] = QuoteInput::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); if (!empty($data['input']->quote_input_options)) { $options = $data['input']->quote_input_options; $data['options'] = $options; $data['counter'] = count($options); } return view('user.quote.form-edit', $data); } public function inputUpdate(Request $request) { $inname = make_input_name($request->label); $input = QuoteInput::where('user_id', Auth::user()->id)->where('id', $request->input_id)->firstOrFail(); $inputs = QuoteInput::where([ ['language_id', $input->language_id], ['user_id', Auth::id()] ])->get(); $rules = [ 'label' => [ 'required', function ($attribute, $value, $fail) use ($inname, $inputs, $input) { foreach ($inputs as $in) { if (strtolower($in->name) == strtolower($inname) && strtolower($inname) != strtolower($input->name)) { $fail( __('Input field already exists') . "."); } } }, ], 'placeholder' => 'required_unless:type,3,5', 'options' => [ 'required_if:type,2,3', function ($attribute, $value, $fail) use ($request) { if ($request->type == 2 || $request->type == 3) { foreach ($request->options as $option) { if (empty($option)) { $fail(__('All option fields are required') . '.'); } } } }, ] ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input->label = $request->label; $input->name = $inname; // if input is checkbox then placeholder is not required if ($request->type != 3 && $request->type != 5) { $input->placeholder = $request->placeholder; } $input->required = $request->required; $input->save(); if ($request->type == 2 || $request->type == 3) { $input->quote_input_options()->delete(); $options = $request->options; foreach ($options as $option) { $op = new QuoteInputOption; $op->quote_input_id = $input->id; $op->name = $option; $op->save(); } } Session::flash('success', __('Input field updated successfully') . '!'); return "success"; } public function options($id) { return QuoteInputOption::where('quote_input_id', $id)->get(); } public function all() { $data['quotes'] = Quote::where('user_id',Auth::id())->orderBy('id', 'DESC')->paginate(10); return view('user.quote.quote', $data); } public function pending() { $data['quotes'] = Quote::where([ ['status', 0], ['user_id', Auth::id()] ])->orderBy('id', 'DESC')->paginate(10); return view('user.quote.quote', $data); } public function processing() { $data['quotes'] = Quote::where([ ['status', 1], ['user_id', Auth::id()] ])->orderBy('id', 'DESC')->paginate(10); return view('user.quote.quote', $data); } public function completed() { $data['quotes'] = Quote::where([ ['status', 2], ['user_id', Auth::id()] ])->orderBy('id', 'DESC')->paginate(10); return view('user.quote.quote', $data); } public function rejected() { $data['quotes'] = Quote::where([ ['status', 3], ['user_id', Auth::id()] ])->orderBy('id', 'DESC')->paginate(10); return view('user.quote.quote', $data); } public function status(Request $request) { $quote = Quote::where('user_id', Auth::user()->id)->where('id', $request->quote_id)->firstOrFail(); $quote->status = $request->status; $quote->save(); Session::flash('success', __('Status changed successfully') . '!'); return back(); } public function mail(Request $request) { $rules = [ 'email' => 'required', 'subject' => 'required', 'message' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $be = BE::first(); $from = Auth::user()->company_name; $sub = $request->subject; $msg = $request->message; $to = $request->email; // Send Mail $mail = new PHPMailer(true); $mail->CharSet = 'UTF-8'; if ($be->is_smtp == 1) { try { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; $mail->SMTPSecure = $be->encryption; $mail->Port = $be->smtp_port; //Recipients $mail->setFrom($be->from_mail, $from); $mail->addReplyTo(Auth::user()->email, $from); $mail->addAddress($to); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = $msg; $mail->send(); } catch (\Exception $e) { die($e->getMessage()); } } else { try { //Recipients $mail->setFrom($be->from_mail, $from); $mail->addReplyTo(Auth::user()->email, $from); $mail->addAddress($to); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = $msg; $mail->send(); } catch (Exception $e) { } } Session::flash('success', __('Mail sent successfully!')); return "success"; } public function delete(Request $request) { Quote::where('user_id', Auth::user()->id)->where('id', $request->quote_id)->firstOrFail()->delete(); Session::flash('success', __('Quote request deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { Quote::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail()->delete(); } Session::flash('success', __('Quote requests deleted successfully') . '!'); return "success"; } } Http/Controllers/User/UserController.php 0000644 00000045375 15213350434 0014420 0 ustar 00 <?php namespace App\Http\Controllers\User; use App; use Validator; use Carbon\Carbon; use App\Models\User; use App\Models\Package; use App\Models\Customer; use App\Models\Membership; use Illuminate\Http\Request; use App\Models\User\Follower; use App\Models\User\Language; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Models\Language as adminLanguage; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; class UserController extends Controller { public function __construct() { $this->middleware('auth'); } public function userban(Request $request) { $user = Customer::where('id', $request->user_id)->first(); $user->update([ 'status' => $request->status, ]); Session::flash('success', __('Status_update_successfully')); return back(); } public function emailStatus(Request $request) { $bs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); Config::set('app.timezone', $bs->timezoneinfo->timezone); $user = Customer::findOrFail($request->user_id); if ($user->email_verified_at) { $v = null; } else { $v = Carbon::now(); } $user->update([ 'email_verified_at' => $v, ]); Session::flash('success', __('Email status updated for') . ' ' . $user->username); return back(); } public function index() { $user = Auth::guard('web')->user(); $bs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); Config::set('app.timezone', $bs->timezoneinfo->timezone); $deLang = Language::where('user_id', Auth::guard('web')->user()->id) ->where('dashboard_default', 1) ->first(); // If no default language found, set the first language as default if (!$deLang) { $firstLanguage = Language::where('user_id', $user->id) ->orderBy('id', 'asc') ->first(); if ($firstLanguage) { $firstLanguage->dashboard_default = 1; $firstLanguage->save(); $deLang = $firstLanguage; } } $data['user'] = $user; $data['skills'] = $user->skills()->where('language_id', $deLang->id)->count(); $data['portfolios'] = $user->portfolios()->where('language_id', $deLang->id)->count(); $data['services'] = $user->services()->where('lang_id', $deLang->id)->count(); $data['testimonials'] = $user->testimonials()->where('lang_id', $deLang->id)->count(); $data['blogs'] = $user->blogs()->where('language_id', $deLang->id)->count(); $data['counter_informations'] = $user->counterInformations()->where('language_id', $deLang->id)->count(); $data['followers'] = Follower::where('following_id', Auth::guard('web')->user()->id)->count(); $data['followings'] = Follower::where('follower_id', Auth::guard('web')->user()->id)->count(); $data['memberships'] = Membership::query()->where('user_id', Auth::user()->id) ->orderBy('id', 'DESC') ->limit(10)->get(); $data['users'] = []; $followingListIds = Follower::query()->where('follower_id', Auth::guard('web')->user()->id)->pluck('following_id'); if (count($followingListIds) > 0) { $data['users'] = User::whereIn('id', $followingListIds)->limit(10)->get(); } $nextPackageCount = Membership::query()->where([ ['user_id', Auth::guard('web')->user()->id], ['expire_date', '>=', Carbon::now()->toDateString()] ])->whereYear('start_date', '<>', '9999')->where('status', '<>', 2)->count(); //current package $data['current_membership'] = Membership::query()->where([ ['user_id', Auth::guard('web')->user()->id], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->where('status', 1)->whereYear('start_date', '<>', '9999')->first(); if ($data['current_membership']) { $countCurrMem = Membership::query()->where([ ['user_id', Auth::guard('web')->user()->id], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->where('status', 1)->whereYear('start_date', '<>', '9999')->count(); if ($countCurrMem > 1) { $data['next_membership'] = Membership::query()->where([ ['user_id', Auth::guard('web')->user()->id], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->where('status', '<>', 2)->whereYear('start_date', '<>', '9999')->orderBy('id', 'DESC')->first(); } else { $data['next_membership'] = Membership::query()->where([ ['user_id', Auth::guard('web')->user()->id] ])->where(function ($query) use ($data) { $query->where('start_date', '>=', $data['current_membership']->expire_date) ->orWhere('transaction_details', '=', '"offline"'); })->whereYear('start_date', '<>', '9999')->where('status', '<>', 2)->first(); } $data['next_package'] = $data['next_membership'] ? Package::query()->where('id', $data['next_membership']->package_id)->first() : null; } $data['current_package'] = $data['current_membership'] ? Package::query()->where('id', $data['current_membership']->package_id)->first() : null; $data['package_count'] = $nextPackageCount; return view('user.dashboard', $data); } public function registerUsers() { $term = request('term'); $data['current_language'] = Language::where([['dashboard_default', 1], ['user_id', Auth::guard('web')->user()->id]])->firstOrFail(); $data['users'] = Customer::when($term, function ($query, $term) { $query->where('username', 'like', '%' . $term . '%')->orWhere('email', 'like', '%' . $term . '%'); })->where('user_id', Auth::guard('web')->user()->id)->orderBy('id', "DESC")->paginate(10); return view('user.register_customer.index', $data); } public function status(Request $request) { $user = Auth::user(); $user->online_status = $request->value; $user->save(); $msg = ''; if ($request->value == 1) { $msg = __('Profile has been made visible') . "."; } else { $msg = __('Profile has been hidden') . "."; } Session::flash('success', $msg); return "success"; } public function profile() { $user = Auth::user(); return view('user.edit-profile', compact('user')); } public function profileupdate(Request $request) { $img = $request->file('photo'); $allowedExts = array('jpg', 'png', 'jpeg'); $request->validate([ 'first_name' => 'required', 'last_name' => 'required', 'username' => 'required|unique:users,username,' . Auth::user()->id, 'phone' => 'required', 'city' => 'required', 'state' => 'required', 'country' => 'required', 'address' => 'required', 'photo' => [ function ($attribute, $value, $fail) use ($request, $img, $allowedExts) { if ($request->hasFile('photo')) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed") . '.'); } } }, ], ]); //--- Validation Section Ends $input = $request->all(); $data = Auth::user(); if ($file = $request->file('photo')) { $name = time() . $file->getClientOriginalName(); $file->move(public_path('assets/front/img/user/'), $name); if ($data->photo != null) { @unlink(public_path('assets/front/img/user/' . $data->photo)); } $input['photo'] = $name; } $data->update($input); Session::flash('success', __('Updated successfully!')); return "success"; } public function resetform() { return view('user.reset'); } public function reset(Request $request) { $request->validate([ 'current_password' => 'required', 'new_password' => 'required', 'confirmation_password' => 'required', ]); $user = Auth::user(); if ($request->current_password) { if (Hash::check($request->current_password, $user->password)) { if ($request->new_password == $request->confirmation_password) { $input['password'] = Hash::make($request->new_password); } else { return back()->with('err', __('Confirm_password_does_not_match')); } } else { return back()->with('err', __('Current_password_Does_not_match')); } } $user->update($input); Session::flash('success', __('Successfully_change_your_password')); return back(); } public function changePass() { return view('user.changepass'); } public function updatePassword(Request $request) { $validator = Validator::make($request->all(), [ 'old_password' => 'required', 'password' => 'required|confirmed' ]); // if given old password matches with the password of this authenticated user... if (Hash::check($request->old_password, Auth::guard('web')->user()->password)) { $oldPassMatch = 'matched'; } else { $oldPassMatch = 'not_matched'; } if ($validator->fails() || $oldPassMatch == 'not_matched') { if ($oldPassMatch == 'not_matched') { $validator->errors()->add('oldPassMatch', true); } return redirect()->route('user.changePass') ->withErrors($validator); } // updating password in database... $user = App\Models\User::findOrFail(Auth::guard('web')->user()->id); $user->password = bcrypt($request->password); $user->save(); Session::flash('success', __('Password_changed_successfully')); return redirect()->back(); } public function shippingdetails() { $user = Auth::user(); return view('user.shipping_details', compact('user')); } public function shippingupdate(Request $request) { $request->validate([ "shpping_fname" => 'required', "shpping_lname" => 'required', "shpping_email" => 'required', "shpping_number" => 'required', "shpping_city" => 'required', "shpping_state" => 'required', "shpping_address" => 'required', "shpping_country" => 'required', ]); Auth::user()->update($request->all()); Session::flash('success', __('Shipping_Details_Update_Successfully')); return back(); } public function billingdetails() { $user = Auth::user(); return view('user.billing_details', compact('user')); } public function billingupdate(Request $request) { $request->validate([ "billing_fname" => 'required', "billing_lname" => 'required', "billing_email" => 'required', "billing_number" => 'required', "billing_city" => 'required', "billing_state" => 'required', "billing_address" => 'required', "billing_country" => 'required', ]); Auth::user()->update($request->all()); Session::flash('success', __('Billing_Details_Update_Successfully')); return back(); } public function changeTheme(Request $request) { return redirect()->back()->withCookie(cookie()->forever('user-theme', $request->theme)); } public function delete(Request $request) { $user = Customer::findOrFail($request->user_id); // room booking info delete if ($user->roomBookings()->count() > 0) { $user->roomBookings()->delete(); } // room reviews delete if ($user->roomReviews()->count() > 0) { $user->roomReviews()->delete(); } // donation delails delete if ($user->donationDetails()->count() > 0) { $user->donationDetails()->delete(); } // delete course enrolment if ($user->courseEnrolment()->count() > 0) { $user->courseEnrolment()->delete(); } if ($user->quizScore()->count() > 0) { $user->quizScore()->delete(); } if ($user->review()->count() > 0) { $user->review()->delete(); } // deleting customer wishlist, order list and order item list if ($user->customerWishlist()->count()) { $user->customerWishlist()->delete(); } if ($user->customerOrderList()->count()) { $user->customerOrderList()->delete(); } if ($user->customerOrderItemList()->count()) { $user->customerOrderItemList()->delete(); } // user image unlinking @unlink(public_path('assets/user/img/users/' . $user->image)); $user->delete(); Session::flash('success', __('Customer_deleted_successfully')); return back(); } public function changePassCstmr() { return view('user.register_customer.changepass'); } public function updatePasswordCstmr(Request $request) { $id = $request->customer_id; $rules = [ 'password' => 'required|confirmed', 'password_confirmation' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return back()->withErrors($validator->getMessageBag()->toArray())->withInput(); } $user = Customer::where('id', $id)->where('user_id', Auth::guard('web')->user()->id)->firstOrFail(); $user->update([ 'password' => Hash::make($request->password) ]); $request->session()->flash('success', __('Password_changed_successfully')); return back(); } public function view($id) { $data['statuses'] = ([ 1 => 'Approved', 0 => 'Pending', 2 => 'Rejected', ]); $data['current_language'] = Language::where([['dashboard_default', 1], ['user_id', Auth::guard('web')->user()->id]])->firstOrFail(); $data['user'] = Customer::findOrFail($id); // dd($user); return view('user.register_customer.details', $data); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $user = Customer::findOrFail($id); // room booking info delete if ($user->roomBookings()->count() > 0) { $user->roomBookings()->delete(); } // room reviews delete if ($user->roomReviews()->count() > 0) { $user->roomReviews()->delete(); } // donation delails delete if ($user->donationDetails()->count() > 0) { $user->donationDetails()->delete(); } // delete course enrolment if ($user->courseEnrolment()->count() > 0) { $user->courseEnrolment()->delete(); } if ($user->quizScore()->count() > 0) { $user->quizScore()->delete(); } if ($user->review()->count() > 0) { $user->review()->delete(); } if ($user->customerWishlist()->count()) { $user->customerWishlist()->delete(); } if ($user->customerOrderList()->count()) { $user->customerOrderList()->delete(); } if ($user->customerOrderItemList()->count()) { $user->customerOrderItemList()->delete(); } // user image unlinking @unlink(public_path('assets/user/img/users/' . $user->image)); $user->delete(); } Session::flash('success', __('Customer_deleted_successfully')); return 'success'; } public function secretLogin(Request $request) { $customer = Customer::where('id', $request->user_id)->first(); $param = $customer->user->username; if ($customer) { Auth::guard('customer')->login($customer); return redirect()->route('customer.dashboard', $param) ->withSuccess(__('You have Successfully loggedin') . '.'); } return redirect()->route('customer.login', $param)->withSuccess(__('Oppes! You have entered invalid credentials') . '.'); } public function changeLanguage(Request $request) { $user_id = Auth::guard('web')->user()->id; $lang = Language::where([ ['user_id', $user_id], ['code', $request->language] ])->firstOrFail(); Language::where('dashboard_default', 1) ->where('user_id', $user_id) ->update(['dashboard_default' => 0]); $lang->dashboard_default = 1; $lang->save(); // Update session and cookie immediately $code = trim('user_' . $lang->code); Session::put('user_dashboard_lang', $code); Session::put('dashboard_direction', $lang->rtl); app()->setLocale('user_' . $lang->code); // Set cookie for future visits (30 days expiration) Cookie::queue('userDashboardLang', $lang->code, 60 * 24 * 30); // Get the current URL (e.g., https://{root_domain}/user/profile?language=en) $currentUrl = url()->previous(); // Parse the URL and update only the 'language' query parameter $parsed = parse_url($currentUrl); $query = []; if (isset($parsed['query'])) { parse_str($parsed['query'], $query); } $query['language'] = $lang->code; $newQuery = http_build_query($query); $baseUrl = $parsed['scheme'] . '://' . $parsed['host'] . ($parsed['path'] ?? ''); $newUrl = $baseUrl . ($newQuery ? '?' . $newQuery : ''); // Redirect to the modified URL return redirect()->to($newUrl); } } Http/Controllers/User/ActionController.php 0000644 00000005715 15213350434 0014711 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\ActionSection; use App\Models\User\BasicSetting; use App\Models\User\Language; use App\Rules\ImageMimeTypeRule; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; class ActionController extends Controller { public function index(Request $request) { $information['langs'] = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $information['language'] = $information['langs']->where('code', $request->language)->first(); $information['data'] = $information['language']->actionSection()->first(); return view('user.home.action-section', $information); } public function update(Request $request) { $language = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $actionInfo = $language->actionSection()->first(); $themeInfo = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->select('theme')->first(); $rules = []; if (empty($actionInfo)) { $rules['background_image'] = 'required'; } if ($request->hasFile('background_image')) { $rules['background_image'] = new ImageMimeTypeRule(); } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json(['errors' => $validator->errors()]); } // store data in db if (empty($actionInfo)) { $backgroundImageName = Uploader::upload_picture(Constant::WEBSITE_ACTION_SECTION_IMAGE, $request->file('background_image')); $imageName = NULL; ActionSection::create($request->except('language_id', 'background_image') + [ 'language_id' => $language->id, 'background_image' => $backgroundImageName, 'image' => $imageName, 'user_id' => Auth::guard('web')->user()->id ]); session()->flash('success', __('Information added successfully') . '!'); } else { $backgroundImageName = null; $imageName = null; if ($request->hasFile('background_image')) { $backgroundImageName = Uploader::update_picture(Constant::WEBSITE_ACTION_SECTION_IMAGE, $request->file('background_image'), $actionInfo->background_image); } $actionInfo->update($request->except('background_image') + [ 'background_image' => $request->hasFile('background_image') ? $backgroundImageName : $actionInfo->background_image, ]); session()->flash('success', __('Information updated successfully') . '!'); } return "success"; } } Http/Controllers/User/BuyPlanController.php 0000644 00000013016 15213350434 0015037 0 ustar 00 <?php namespace App\Http\Controllers\User; use Session; use App\Models\Package; use App\Models\Language; use App\Models\Membership; use App\Models\BasicSetting; use App\Models\OfflineGateway; use App\Models\PaymentGateway; use Illuminate\Support\Carbon; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Config; use App\Http\Helpers\UserPermissionHelper; use App\Models\BasicExtended; class BuyPlanController extends Controller { public function index() { $abs = BasicSetting::first(); Config::set('app.timezone', $abs->timezone); if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['bex'] = $currentLang->basic_extended; $data['packages'] = Package::where('status', '1')->get(); $nextPackageCount = Membership::query()->where([ ['user_id', Auth::id()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->whereYear('start_date', '<>', '9999')->where('status', '<>', 2)->count(); //current package $data['current_membership'] = Membership::query()->where([ ['user_id', Auth::id()], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->where('status', 1)->whereYear('start_date', '<>', '9999')->first(); if ($data['current_membership']) { $countCurrMem = Membership::query()->where([ ['user_id', Auth::id()], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->where('status', 1)->whereYear('start_date', '<>', '9999')->count(); if ($countCurrMem > 1) { $data['next_membership'] = Membership::query()->where([ ['user_id', Auth::id()], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->where('status', '<>', 2)->whereYear('start_date', '<>', '9999')->orderBy('id', 'DESC')->first(); } else { $data['next_membership'] = Membership::query()->where([ ['user_id', Auth::id()], ['start_date', '>', $data['current_membership']->expire_date] ])->whereYear('start_date', '<>', '9999')->where('status', '<>', 2)->first(); } $data['next_package'] = $data['next_membership'] ? Package::query()->where('id', $data['next_membership']->package_id)->first() : null; } $data['current_package'] = $data['current_membership'] ? Package::query()->where('id', $data['current_membership']->package_id)->first() : null; $data['package_count'] = $nextPackageCount; $be = BasicExtended::first(); $features = json_decode($be->package_features, true); $data['pFeatures'] = $features; return view('user.buy_plan.index', $data); } public function checkout($package_id) { $packageCount = Membership::query()->where([ ['user_id', Auth::id()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->whereYear('start_date', '<>', '9999')->where('status', '<>', 2)->count(); $hasPendingMemb = UserPermissionHelper::hasPendingMembership(Auth::id()); if ($hasPendingMemb) { Session::flash('warning', __('You already have a Pending Membership Request.')); return back(); } if ($packageCount >= 2) { Session::flash('warning', __('You must activate your next package before extending or purchasing'). '.'); return back(); } if (session()->has('lang')) { $currentLang = Language::where('code', session() ->get('lang')) ->first(); } else { $currentLang = Language::where('is_default', 1) ->first(); } $be = $currentLang->basic_extended; $online = PaymentGateway::query()->where('status', 1)->get(); $offline = OfflineGateway::where('status', 1)->get(); $data['offline'] = $offline; $data['payment_methods'] = $online->merge($offline); $data['package'] = Package::query()->findOrFail($package_id); $data['membership'] = Membership::query()->where([ ['user_id', Auth::id()], ['expire_date', '>=', \Carbon\Carbon::now()->format('Y-m-d')] ])->where('status', '<>', 2)->whereYear('start_date', '<>', '9999') ->latest() ->first(); $data['previousPackage'] = null; if (!is_null($data['membership'])) { $data['previousPackage'] = Package::query() ->where('id', $data['membership']->package_id) ->first(); } $stripe = PaymentGateway::where('keyword', 'stripe')->where('status', 1)->first(); // $stripe_info = json_decode($stripe->information, true); // $data['stripe_key'] = $stripe_info['key']; if (is_null($stripe)) { $data['stripe_key'] = null; } else { $stripe_info = json_decode($stripe->information, true); $data['stripe_key'] = $stripe_info['key']; } $data['bex'] = $be; return view('user.buy_plan.checkout', $data); } } Http/Controllers/User/CouponController.php 0000644 00000007235 15213350434 0014736 0 ustar 00 <?php namespace App\Http\Controllers\User; use Session; use Validator; use Illuminate\Http\Request; use App\Models\User\UserCoupon; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; class CouponController extends Controller { public function index(Request $request) { $data['coupons'] = UserCoupon::where('user_id', Auth::guard('web')->user()->id)->orderBy('id', 'DESC')->paginate(10); return view('user.item.order.coupons.index', $data); } public function store(Request $request) { $userId = Auth::guard('web')->user()->id; $rules = [ 'name' => 'required', 'type' => 'required', 'value' => 'required|numeric', 'minimum_spend' => 'nullable|numeric', 'start_date' => 'required', 'end_date' => 'required', ]; $user_coupons = UserCoupon::where('user_id', $userId)->get(); $rules['code'] = [ 'required', function ($attribute, $value, $fail) use ($user_coupons, $request) { foreach ($user_coupons as $coupon) { if ($request->code == $coupon->code) { $fail(__('The code already been taken') . '.'); break; } } } ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['user_id'] = $userId; $data = new UserCoupon(); $data->create($input); Session::flash('success', __('New coupon added successfully ') . '!'); return "success"; } public function edit($id) { $data['coupon'] = UserCoupon::findOrFail($id); return view('user.item.order.coupons.edit', $data); } public function update(Request $request) { $userId = Auth::guard('web')->user()->id; $rules = [ 'name' => 'required', // 'code' => 'required|unique:user_coupons,code,' . $request->coupon_id, 'type' => 'required', 'value' => 'required|numeric', 'minimum_spend' => 'nullable|numeric', 'start_date' => 'required', 'end_date' => 'required', ]; $user_coupons = UserCoupon::where('user_id', $userId)->get(); $rules['code'] = [ 'required', function ($attribute, $value, $fail) use ($user_coupons, $request) { foreach ($user_coupons as $coupon) { if (($request->code == $coupon->code) && ($request->coupon_id != $coupon->id)) { $fail(__('The code already been taken') .''); break; } } } ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->except('_token', 'coupon_id'); $data = UserCoupon::find($request->coupon_id); $data->fill($input)->save(); Session::flash('success', __('Coupon updated successfully') . '!'); return "success"; } public function delete(Request $request) { $coupon = UserCoupon::find($request->coupon_id); $coupon->delete(); $request->session()->flash('success', __('Coupon deleted successfully') . '!'); return back(); } } Http/Controllers/User/FooterController.php 0000644 00000013362 15213350434 0014727 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\FooterQuickLink; use App\Models\User\FooterText; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class FooterController extends Controller { public function footerText(Request $request) { // first, get the language info from db $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); // then, get the footer text info of that language from db $information['data'] = FooterText::where('language_id', $lang->id)->where('user_id', Auth::id())->first(); return view('user.footer.text', $information); } public function updateFooterInfo(Request $request, $language) { $lang = Language::where('code', $language)->where('user_id', Auth::id())->firstOrFail(); $data = FooterText::where('language_id', $lang->id)->where('user_id', Auth::id())->first(); if (is_null($data)) { $data = new FooterText; } $rules = [ 'about_company' => 'nullable', 'copyright_text' => 'nullable', ]; $message = [ 'about_company.required' => 'The about company field is required', 'copyright_text.required' => 'The copy right text field is required', ]; if (is_null($data)) { $rules['logo'] = 'required|mimes:jpeg,jpg,png|max:1000'; } elseif (is_null($data->logo) && !$request->hasFile('logo')) { $rules['logo'] = 'required|mimes:jpeg,jpg,png|max:1000'; } $validator = Validator::make($request->all(), $rules, $message); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $request['image_name'] = $data->logo; if ($request->hasFile('logo')) { $request['image_name'] = Uploader::update_picture('assets/front/img/user/footer/', $request->file('logo'), $data->logo); } if ($request->hasFile('bg_image')) { $request['bg_img_name'] = Uploader::update_picture('assets/front/img/user/footer/', $request->file('bg_image'), $data->bg_image); } $data->language_id = $lang->id; $data->copyright_text = clean($request->copyright_text); $data->logo = $request->image_name; if ($request->color) { $data->footer_color = $request->color; } $data->bg_image = $request->bg_img_name; $data->user_id = Auth::id(); $data->about_company = clean($request->about_company); $data->newsletter_text = clean($request->newsletter_text); $data->save(); $request->session()->flash('success', __('Footer text info updated successfully') . '!'); return 'success'; } public function quickLinks(Request $request) { // first, get the language info from db $language = Language::where('code', $request->language) ->where('user_id', Auth::id()) ->firstOrFail(); // then, get the footer quick link info of that language from db $information['links'] = FooterQuickLink::where('language_id', $language->id) ->where('user_id', Auth::id()) ->orderBy('id', 'desc') ->get(); $information['userLanguages'] = Language::where('user_id', Auth::id())->get(); return view('user.footer.quick_links', $information); } public function storeQuickLink(Request $request) { $rules = [ 'title' => 'required', 'url' => 'required', 'serial_number' => 'required', 'user_language_id' => 'required', ]; $message = [ 'title.required' => 'The title field is required', 'url.required' => 'The url field is required', 'serial_number.required' => 'The serial number field is required', 'user_language_id.required' => 'The language field is required', ]; $validator = Validator::make($request->all(), $rules, $message); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } FooterQuickLink::create($request->except('language_id', 'user_id') + [ 'language_id' => $request->user_language_id, 'user_id' => Auth::id(), ]); $request->session()->flash('success', 'New quick link added successfully!'); return 'success'; } public function updateQuickLink(Request $request) { $rules = [ 'title' => 'required', 'url' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } FooterQuickLink::where('user_id', Auth::user()->id)->where('id', $request->link_id)->firstOrFail()->update($request->all()); $request->session()->flash('success', 'Quick link updated successfully!'); return 'success'; } public function deleteQuickLink(Request $request) { FooterQuickLink::where('user_id', Auth::user()->id)->where('id', $request->link_id)->firstOrFail()->delete(); $request->session()->flash('success', 'Quick link deleted successfully!'); return redirect()->back(); } } Http/Controllers/User/ItemController.php 0000644 00000073173 15213350434 0014375 0 ustar 00 <?php namespace App\Http\Controllers\User; use Carbon\Carbon; use Illuminate\Http\Request; use App\Models\User\Language; use App\Models\User\UserItem; use App\Http\Helpers\Uploader; use App\Models\User\BasicSetting; use App\Models\User\UserItemImage; use Illuminate\Support\Facades\DB; use Mews\Purifier\Facades\Purifier; use App\Http\Controllers\Controller; use App\Models\User\UserItemContent; use App\Models\User\UserShopSetting; use Illuminate\Support\Facades\Auth; use App\Models\User\UserItemCategory; use App\Models\User\UserItemVariation; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Session; use App\Models\User\UserItemSubCategory; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; class ItemController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $lang_id = $lang->id; $title = request('title'); $data['items'] = DB::table('user_items')->where('user_items.user_id', Auth::guard('web')->user()->id) ->Join('user_item_contents', 'user_items.id', '=', 'user_item_contents.item_id') ->join('user_item_categories', 'user_item_contents.category_id', '=', 'user_item_categories.id') ->select('user_items.*', 'user_items.id AS item_id', 'user_item_contents.*', 'user_item_categories.name AS category') ->orderBy('user_items.id', 'DESC') ->when($title, function ($query, $title) { $query->where('user_item_contents.title', 'LIKE', '%' . $title . '%'); }) ->where('user_item_contents.language_id', '=', $lang_id) ->where('user_item_categories.language_id', '=', $lang_id) ->paginate(15); $data['lang_id'] = $lang_id; $data['lang'] = $lang; return view('user.item.index', $data); } public function type(Request $request) { $data['digitalCount'] = UserItem::where('type', 'digital')->where('user_id', Auth::guard('web')->user()->id)->count(); $data['physicalCount'] = UserItem::where('type', 'physical')->where('user_id', Auth::guard('web')->user()->id)->count(); return view('user.item.type', $data); } public function create(Request $request) { $data['lang'] = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $data['languages'] = Language::where('user_id', Auth::guard('web')->user()->id)->get(); return view('user.item.create', $data); } public function getCategory($langid) { $category = UserItemCategory::where('language_id', $langid)->where('user_id', Auth::guard('web')->user()->id)->get(); return $category; } public function store(Request $request) { $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $messages = []; $rules = []; $thumbnailImgURL = $request->thumbnail; $sliderImgURLs = $request->has('image') ? $request->image : []; $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg'); $thumbnailImgExt = $thumbnailImgURL ? $thumbnailImgURL->extension() : null; $sliderImgExts = []; $rules['image'] = [ 'required', function ($attribute, $value, $fail) use ($allowedExtensions, $sliderImgExts) { if (!empty($sliderImgExts)) { foreach ($sliderImgExts as $sliderImgExt) { if (!in_array($sliderImgExt, $allowedExtensions)) { $fail(__('Only .jpg, .jpeg, .png and .svg file is allowed for slider image') . '.'); break; } } } } ]; $rules['thumbnail'] = [ 'required', function ($attribute, $value, $fail) use ($allowedExtensions, $thumbnailImgExt) { if (!in_array($thumbnailImgExt, $allowedExtensions)) { $fail(__('Only .jpg, .jpeg, .png and .svg file is allowed for thumbnail image') . '.'); } } ]; // $messages['image.required'] = __('The slider Image is required') . '.'; $rules['status'] = 'required'; $rules['current_price'] = 'required|numeric'; $rules['previous_price'] = 'nullable|numeric'; foreach ($languages as $language) { $rules[$language->code . '_title'] = 'required'; $rules[$language->code . '_category'] = 'required'; $rules[$language->code . '_subcategory'] = 'required'; $messages[$language->code . '_category.required'] = __('The Category field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_subcategory.required'] = __('The Subcategory field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_title.required'] = __('The Title field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $allowedExts = array('zip'); } // if product type is 'physical' if ($request->type == 'physical') { $rules['sku'] = 'required'; } // if product type is 'digital' if ($request->type == 'digital') { $rules['file_type'] = 'required'; // if 'file upload' is chosen if ($request->has('file_type') && $request->file_type == 'upload') { $allowedExts = array('zip'); $rules['download_file'] = [ 'required', function ($attribute, $value, $fail) use ($request, $allowedExts) { $file = $request->file('download_file'); $ext = $file->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only zip file is allowed') . "!"); } } ]; } // if 'file donwload link' is chosen elseif ($request->has('file_type') && $request->file_type == 'link') { $rules['download_link'] = 'required'; } } $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } if (!empty($sliderImgURLs)) { foreach ($sliderImgURLs as $sliderImgURL) { $n = strrpos($sliderImgURL, "."); $extension = ($n === false) ? "" : substr($sliderImgURL, $n + 1); array_push($sliderImgExts, $extension); } } // slug validations foreach ($languages as $language) { $adContent = UserItemContent::where('language_id', $language->id)->where('slug', make_slug($request[$language->code . '_title'])) ->first(); if ($adContent) { Session::flash('warning', __('This Item Already Exist') . '!'); return "success"; } } // if the type is digital && 'upload file' method is selected, then store the downloadable file if ($request->type == 'digital' && $request->file_type == 'upload') { if ($request->hasFile('download_file')) { $digitalFile = $request->file('download_file'); $filename = time() . '-' . uniqid() . "." . $digitalFile->extension(); $directory = base_path('core/storage/digital_products/'); @mkdir($directory, 0775, true); $digitalFile->move($directory, $filename); } } $item = new UserItem(); // set a name for the thumbnail image and store it to local storage $thumbnailImgName = time() . '.' . $thumbnailImgExt; $thumbnailDir = public_path('assets/front/img/user/items/thumbnail/'); @mkdir($thumbnailDir, 0775, true); @copy($thumbnailImgURL, $thumbnailDir . $thumbnailImgName); $sliderDir = public_path('assets/front/img/user/items/slider-images/'); @mkdir($sliderDir, 0775, true); $item->user_id = Auth::guard('web')->user()->id; $item->stock = $request->stock ?? 0; $item->sku = $request->sku; $item->thumbnail = $thumbnailImgName; $item->status = $request->status; $item->current_price = $request->current_price; $item->previous_price = $request->previous_price ?? 0.00; $item->type = $request->type; $item->download_file = $filename ?? null; $item->download_link = $request->download_link; $item->save(); foreach ($request->image as $value) { UserItemImage::create([ 'item_id' => $item->id, 'image' => $value, ]); } // store varations as json foreach ($languages as $language) { $adContent = new UserItemContent(); $adContent->item_id = $item->id; $adContent->language_id = $language->id; $adContent->category_id = $request[$language->code . '_category']; $adContent->subcategory_id = $request[$language->code . '_subcategory']; $adContent->title = $request[$language->code . '_title']; $adContent->slug = make_slug($request[$language->code . '_title']); $adContent->summary = $request[$language->code . '_summary']; $adContent->tags = $request[$language->code . '_tags']; $adContent->description = Purifier::clean($request[$language->code . '_description']); $adContent->meta_keywords = $request[$language->code . '_keyword']; $adContent->meta_description = $request[$language->code . '_meta_keyword']; $adContent->save(); } Session::flash('success', __('Item added successfully') . '!'); return "success"; } public function edit(Request $request, $id) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $data['languages'] = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $data['item'] = UserItem::findOrFail($id); return view('user.item.edit', $data); } public function update(Request $request) { $item = UserItem::findOrFail($request->item_id); $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg'); if ($request->hasFile('thumbnail')) { $thumbnailImgURL = $request->thumbnail; $thumbnailImgExt = $thumbnailImgURL ? $thumbnailImgURL->extension() : null; $rules['thumbnail'] = function ($attribute, $value, $fail) use ($allowedExtensions, $thumbnailImgExt) { if (!in_array($thumbnailImgExt, $allowedExtensions)) { $fail(__('Only .jpg, .jpeg, .png and .svg file is allowed for thumbnail image') . '.'); } }; } $sliderImgURLs = array_key_exists("image", $request->all()) && count($request->image) > 0 ? $request->image : []; $sliderImgExts = []; // get all the slider images extension if (!empty($sliderImgURLs)) { foreach ($sliderImgURLs as $sliderImgURL) { $n = strrpos($sliderImgURL, "."); $extension = ($n === false) ? "" : substr($sliderImgURL, $n + 1); array_push($sliderImgExts, $extension); } } if (array_key_exists("image", $request->all()) && count($request->image) > 0) { $rules['image'] = function ($attribute, $value, $fail) use ($allowedExtensions, $sliderImgExts) { foreach ($sliderImgExts as $sliderImgExt) { if (!in_array($sliderImgExt, $allowedExtensions)) { $fail(__('Only .jpg, .jpeg, .png and .svg file is allowed for slider image') . '.'); break; } } }; } $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $rules['status'] = 'required'; $rules['current_price'] = 'required|numeric'; $rules['previous_price'] = 'nullable|numeric'; $messages = []; foreach ($languages as $language) { $rules[$language->code . '_title'] = 'required'; $rules[$language->code . '_category'] = 'required'; $rules[$language->code . '_subcategory'] = 'required'; $messages[$language->code . '_category.required'] = __('The category field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_subcategory.required'] = __('The Subcategory field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_title.required'] = __('The Title field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $allowedExts = array('zip'); } // if product type is 'physical' if ($item->type == 'physical') { $rules['sku'] = 'required'; } // if product type is 'digital' if ($item->type == 'digital') { // if 'file upload' is chosen if ($request->has('file_type') && $request->file_type == 'upload') { if (empty($item->download_file)) { $rules['download_file'][] = 'required'; } $rules['download_file'][] = function ($attribute, $value, $fail) use ($item, $request) { $allowedExts = array('zip'); if ($request->hasFile('download_file')) { $file = $request->file('download_file'); $ext = $file->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only zip file is allowed') . "!"); } } }; } // if 'file donwload link' is chosen elseif ($request->has('file_type') && $request->file_type == 'link') { $rules['download_link'] = 'required'; } } $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } foreach ($languages as $language) { $adContent = UserItemContent::where('language_id', $language->id)->where('slug', make_slug($request[$language->code . '_title'])) ->first(); if ($adContent) { if ($adContent->item_id != $request->item_id) { Session::flash('warning', __('This Item Already Exist') . '!'); return "success"; } } } if (!empty($sliderImgURLs)) { foreach ($sliderImgURLs as $sliderImgURL) { $n = strrpos($sliderImgURL, "."); $extension = ($n === false) ? "" : substr($sliderImgURL, $n + 1); array_push($sliderImgExts, $extension); } } // if the type is digital && 'upload file' method is selected, then store the downloadable file if ($request->type == 'digital' && $request->file_type == 'upload') { if ($request->hasFile('download_file')) { $digitalFile = $request->file('download_file'); $filename = time() . '-' . uniqid() . "." . $digitalFile->extension(); $directory = base_path('core/storage/digital_products/'); @mkdir($directory, 0775, true); $digitalFile->move($directory, $filename); } else { $filename = $item->download_file; } } if ($request->hasFile('thumbnail')) { $thumbnailImgURL = $request->thumbnail; // first, delete the previous image from local storage @unlink(public_path('assets/front/img/user/items/thumbnail/' . $item->thumbnail)); // second, set a name for the image and store it to local storage $thumbnailImgName = time() . '.' . $thumbnailImgExt; $thumbnailDir = public_path('assets/front/img/user/items/thumbnail/'); @copy($thumbnailImgURL, $thumbnailDir . $thumbnailImgName); } $item->stock = $request->stock ?? 0; $item->sku = $request->sku; $item->status = $request->status; $item->thumbnail = $request->hasFile('thumbnail') ? $thumbnailImgName : $item->thumbnail; $item->current_price = $request->current_price; $item->previous_price = $request->previous_price ?? 0.00; $item->type = $request->type; $item->download_file = $filename ?? null; $item->download_link = $request->download_link ?? null; $item->save(); if ($request->image) { foreach ($request->image as $value) { UserItemImage::create([ 'item_id' => $item->id, 'image' => $value, ]); } } foreach ($languages as $language) { $adContent = UserItemContent::where('item_id', $request->item_id) ->where('language_id', $language->id)->first(); if (empty($adContent)) { $adContent = new UserItemContent; $adContent->item_id = $request->item_id; $adContent->language_id = $language->id; } $adContent->category_id = $request[$language->code . '_category']; $adContent->subcategory_id = $request[$language->code . '_subcategory']; $adContent->title = $request[$language->code . '_title']; $adContent->slug = make_slug($request[$language->code . '_title']); $adContent->summary = $request[$language->code . '_summary']; $adContent->tags = $request[$language->code . '_tags']; $adContent->description = Purifier::clean($request[$language->code . '_description']); $adContent->meta_keywords = $request[$language->code . '_keyword']; $adContent->meta_description = $request[$language->code . '_meta_keyword']; $adContent->save(); } Session::flash('success', __('Product updated successfully') . '!'); return "success"; } public function feature(Request $request) { $item = UserItem::findOrFail($request->item_id); $item->is_feature = $request->is_feature; $item->save(); if ($request->is_feature == 1) { Session::flash('success', __('Item featured successfully') . '!'); } else { Session::flash('success', __('Item unfeatured successfully') . '!'); } return back(); } public function specialOffer(Request $request) { $item = UserItem::findOrFail($request->item_id); $item->special_offer = $request->special_offer; $item->save(); if ($request->special_offer == 1) { Session::flash('success', __('Item added to Special offer successfully') . '!'); } else { Session::flash('success', __('Item remove from Special offer successfully') . '!'); } return back(); } public function delete(Request $request) { $item = UserItem::findOrFail($request->item_id); @unlink(public_path('assets/front/img/user/items/thumbnail/' . $item->thumbnail)); foreach ($item->sliders as $key => $image) { @unlink(public_path('assets/front/img/user/items/slider-images/' . $image->image)); $image->delete(); } $item->itemContents()->delete(); $item->delete(); Session::flash('success', __('Item deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $item = UserItem::findOrFail($id); @unlink(public_path('assets/front/img/user/items/thumbnail/' . $item->thumbnail)); foreach ($item->sliders as $key => $image) { @unlink(public_path('assets/front/img/user/items/slider-images/' . $image->image)); $image->delete(); } $item->itemContents()->delete(); $item->delete(); } Session::flash('success', __('Product deleted successfully') . '!'); return "success"; } public function variationStore(Request $request) { $variation_helper = $request->variation_helper ?? []; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $variation_counter = is_array($variation_helper) ? array_count_values($variation_helper) : []; $check_var = UserItemVariation::where('item_id', $request->item_id)->delete(); if (!empty($request->variation_helper)) { foreach ($variation_counter as $key => $v_helper) { foreach ($languages as $lkey => $value) { if (!empty($request[$value->code . '_options1' . '_' . $key])) { foreach ($request[$value->code . '_options1' . '_' . $key] as $option) { if (empty($option)) { Session::flash('warning', __('Options are missing') . '.'); return "success"; } } } else { Session::flash('success', __('Variations Updated') . '!'); return "success"; } UserItemVariation::create([ 'item_id' => $request->item_id, 'language_id' => $value->id, 'variant_name' => $request[$value->code . '_variation_' . $key], 'option_name' => json_encode($request[$value->code . '_options1' . '_' . $key]), 'option_price' => json_encode($request['options2' . '_' . $key]), 'option_stock' => json_encode($request['options3' . '_' . $key]), 'indx' => $key ]); } } } // deleting null data UserItemVariation::where('item_id', $request->item_id)->where('variant_name', null)->delete(); Session::flash('success', __('Variations added successfully') . '!'); return "success"; } public function variants($pid) { $variations = DB::table('user_item_variations')->where('item_id', $pid)->orderBy('indx')->get(); $variants = []; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $i = 0; $v_index = 0; foreach ($languages as $lkey => $lvak) { $variants[$lkey][$v_index] = [ $lvak->code . '_varient_name' => $variations->where('language_id', $lvak->id)->first()->variant_name, 'uniqid' => uniqid() ]; $option_prices = json_decode($variations->where('language_id', $lvak->id)->first()->option_price); $option_stocks = json_decode($variations->where('language_id', $lvak->id)->first()->option_stock); $v_index++; } return response()->json($variants); foreach ($variations as $key => $value) { $option_names = json_decode($value->option_name); $option_prices = json_decode($value->option_price); $option_stocks = json_decode($value->option_stock); $j = 0; foreach ($option_names as $okey => $val) { $variants[$i]['options'][$j]['name'] = $val; $variants[$i]['options'][$j]['price'] = $option_prices[$okey]; $variants[$i]['options'][$j]['stock'] = $option_stocks[$okey]; $j++; } $i++; } return response()->json($variants); } public function variations(UserItem $useritem) { $data['language'] = Language::where('user_id', Auth::guard('web')->user()->id)->where('code', request('language'))->first(); $data['item'] = $useritem->itemContents()->where('language_id', $data['language']->id)->first(); $data['item_id'] = $useritem->id; $data['ins'] = UserItemVariation::where('item_id', $useritem->id)->groupBy('indx')->select('indx')->get(); $variations = []; foreach ($data['ins'] as $key => $value) { $variations[] = UserItemVariation::where('item_id', $useritem->id)->where('indx', $value->indx)->get(); } $data['variations'] = $variations; $data['languages'] = Language::where('user_id', Auth::guard('web')->user()->id)->get(); return view('user.item.variation', $data); } public function settings() { $data['shopsettings'] = UserShopSetting::where('user_id', Auth::guard('web')->user()->id)->first(); return view('user.item.settings', $data); } public function updateSettings(Request $request) { $request->validate([ 'is_shop' => 'required', 'tax' => 'required', 'item_rating_system' => 'required', 'catalog_mode' => 'required', ]); $shopsettings = UserShopSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if (!$shopsettings) { $shopsettings = new UserShopSetting(); } $shopsettings->user_id = Auth::guard('web')->user()->id; $shopsettings->is_shop = $request->is_shop; $shopsettings->item_rating_system = $request->item_rating_system; $shopsettings->catalog_mode = $request->catalog_mode; $shopsettings->tax = $request->tax ? $request->tax : 0.00; $shopsettings->save(); Session::flash('success', __('Shop setting updated successfully') . '!'); return "success"; } public function slider(Request $request) { $filename = null; $request->validate([ 'file' => 'mimes:jpg,jpeg,png|required', ]); if ($request->hasFile('file')) { $filename = Uploader::upload_picture('assets/front/img/user/items/slider-images', $request->file('file')); } return response()->json(['status' => 'success', 'file_id' => $filename]); } public function sliderRemove(Request $request) { if (file_exists(public_path('assets/front/img/user/items/slider-images/' . $request->value))) { unlink(public_path('assets/front/img/user/items/slider-images/' . $request->value)); return response()->json(['status' => 200, 'message' => 'success']); } else { return response()->json(['status' => 404, 'message' => 'error']); } } public function dbSliderRemove(Request $request) { $img = UserItemImage::findOrFail($request->id); @unlink(public_path('assets/front/img/user/items/slider-images/' . $img->image)); $img->delete(); return response()->json(['status' => 200, 'message' => 'success']); } public function subcatGetter(Request $request) { $data['subcategories'] = UserItemSubCategory::where('category_id', $request->category_id) ->where('user_id', Auth::guard('web')->user()->id) ->where('status', 1) ->get(); return $data; } public function setFlashSale($id, Request $request) { $rules = [ 'start_date' => 'required', 'start_time' => 'required', 'end_date' => 'required', 'end_time' => 'required', 'flash_percentage' => 'required|numeric', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $item = UserItem::findOrFail($id); $bs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->with('timezoneinfo')->first(); Config::set('app.timezone', $bs->timezoneinfo->timezone); // if ($item->previous_price > 0) { // Session::flash('warning', 'Please remove previous price of this item.'); // return "success"; // } // Config::set('app.timezone', $timezone); $item->start_date = $request->start_date; $item->start_time = $request->start_time; $item->end_date = $request->end_date; $item->end_time = $request->end_time; $item->start_date_time = Carbon::parse($request->start_date . ' ' . $request->start_time)->format('Y-m-d H:i:s A'); $item->end_date_time = Carbon::parse($request->end_date . ' ' . $request->end_time)->format('Y-m-d H:i:s A'); $item->flash_percentage = $request->flash_percentage; $item->flash = 1; $item->save(); Session::flash('success', __('Flash sale information set successfully') . '!'); return "success"; } public function flashRemove(Request $request) { $item = UserItem::findOrFail($request->itemId); $item->start_date = null; $item->start_time = null; $item->end_date = null; $item->end_time = null; $item->flash = null; $item->flash_percentage = null; $item->start_date_time = null; $item->end_date_time = null; $item->save(); Session::flash('success', __('Item has been removed from flash sale') . '!'); return "success"; } } Http/Controllers/User/SkillController.php 0000644 00000007734 15213350434 0014555 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\Language; use App\Models\User\Skill; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class SkillController extends Controller { /** * Display a listing of the resource. * * @return */ public function index(Request $request) { $lang = Language::where([['code', $request->language], ['user_id', Auth::id()]])->firstorFail(); $data['skills'] = Skill::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::id()], ]) ->orderBy('id', 'DESC') ->get(); return view('user.skill.index', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $slug = make_slug($request->title); $rules = [ 'user_language_id' => 'required', 'title' => 'required|max:255', 'percentage' => 'required|numeric|digits_between:1,100', 'color' => 'required|max:20', 'serial_number' => 'required|integer' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['language_id'] = $request->user_language_id; $input['slug'] = $slug; $input['user_id'] = Auth::id(); $skill = new Skill; $skill->create($input); Session::flash('success', __('Skill added successfully') . '!'); return "success"; } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $data['skill'] = Skill::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); return view('user.skill.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { $allowedExts = array('jpg', 'png', 'jpeg'); $slug = make_slug($request->title); $rules = [ 'title' => 'required|max:255', 'percentage' => 'required|numeric|digits_between:1,100', 'color' => 'required|max:20', 'serial_number' => 'required|integer' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $skill = Skill::where('user_id', Auth::user()->id)->where('id', $request->skill_id)->firstOrFail(); $input['slug'] = $slug; $input['user_id'] = Auth::id(); $skill->update($input); Session::flash('success', __('Skill updated successfully') . '!'); return "success"; } public function delete(Request $request) { $skill = Skill::where('user_id', Auth::user()->id)->where('id', $request->skill_id)->firstOrFail(); $skill->delete(); Session::flash('success', __('Skill deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $skill = Skill::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); $skill->delete(); } Session::flash('success', __('Skills deleted successfully') . '!'); return "success"; } } Http/Controllers/User/ContactController.php 0000644 00000006451 15213350434 0015065 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\Language; use App\Models\User\UserContact; use Illuminate\Support\Facades\Validator; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class ContactController extends Controller { public function index(Request $request) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } // first, get the language info from db $language = Language::where([['code', $request->language], ['user_id', $user->id]])->firstorFail(); // then, get the service section heading info of that language from db $information['data'] = UserContact::where('language_id', $language->id) ->where('user_id', $user->id) ->first(); // get all the languages from db return view('user.contact', $information); } public function update(Request $request, $language) { $user = Auth::guard('web')->user(); $lang = Language::where('code', $language) ->where('user_id', $user->id) ->first(); $data = UserContact::where([ ['user_id', $user->id], ['language_id', $lang->id] ])->first(); if (is_null($data)) { $data = new UserContact; } $rules = [ 'contact_form_title' => 'nullable|max:255', 'contact_form_subtitle' => 'nullable|max:255', 'contact_addresses' => 'nullable', 'contact_numbers' => 'nullable', 'contact_mails' => 'nullable|max:255', 'latitude' => 'nullable|max:255', 'longitude' => 'nullable|max:255', 'map_zoom' => 'nullable|max:255', ]; if ( empty($data->contact_form_image) && !$request->hasFile('contact_form_image') ) { $rules['contact_form_image'] = 'required|mimes:jpeg,jpg,png'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } $image = isset($data) ? $data->contact_form_image : null; $request['image_name'] = $image; if ($request->hasFile('contact_form_image')) { $request['image_name'] = Uploader::update_picture('assets/front/img/user/', $request->file('contact_form_image'), $image); } $data->contact_form_image = $request->image_name; $data->contact_form_title = $request->contact_form_title; $data->contact_form_subtitle = $request->contact_form_subtitle; $data->contact_addresses = clean($request->contact_addresses); $data->contact_numbers = $request->contact_numbers; $data->contact_mails = $request->contact_mails; $data->language_id = $lang->id; $data->user_id = $user->id; $data->latitude = $request->latitude; $data->longitude = $request->longitude; $data->map_zoom = $request->map_zoom ? $request->map_zoom : 0; $data->save(); $request->session()->flash('success', __('Contact section updated successfully') . '!'); return back(); } } Http/Controllers/User/CounterInformationController.php 0000644 00000007630 15213350434 0017317 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\CounterInformation; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class CounterInformationController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $data['counterInformations'] = CounterInformation::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::id()], ]) ->orderBy('id', 'DESC') ->get(); return view('user.counter-information.index', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return */ public function store(Request $request) { $rules = [ 'user_language_id' => 'required', 'title' => 'required|max:255', 'count' => 'required|integer', 'serial_number' => 'required|integer' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['language_id'] = $request->user_language_id; $input['user_id'] = Auth::id(); $counterInformation = new CounterInformation; $counterInformation->create($input); Session::flash('success', __('Counter Information added successfully') . '!'); return "success"; } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $data['counterInformation'] = CounterInformation::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); return view('user.counter-information.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * */ public function update(Request $request) { $rules = [ 'title' => 'required|max:255', 'count' => 'required|integer', 'serial_number' => 'required|integer' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $counterInformation = CounterInformation::where('user_id', Auth::user()->id)->where('id', $request->counter_information_id)->firstOrFail(); $slug = make_slug($request->title); $input['slug'] = $slug; $input['user_id'] = Auth::id(); $input['icon'] = $request->icon === null ? $counterInformation->icon : $request->icon; $counterInformation->update($input); Session::flash('success', __('Counter Information updated successfully') . '!'); return "success"; } public function delete(Request $request) { CounterInformation::where('user_id', Auth::user()->id)->where('id', $request->counter_information_id)->firstOrFail()->delete(); Session::flash('success', __('Counter Information deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { CounterInformation::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail()->delete(); } Session::flash('success', __('Counter Information bulk-deleted successfully') . '!'); return "success"; } } Http/Controllers/User/LanguageController.php 0000644 00000050557 15213350434 0015223 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Constants\Constant; use App\Models\User\Language; use App\Models\Language as AdminLanguage; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Controllers\User\CourseManagement\LessonContentController; use App\Http\Helpers\Uploader; use App\Http\Helpers\UserPermissionHelper; use App\Models\Membership; use App\Models\Package; use App\Models\User\CourseManagement\LessonContent; use App\Models\User\Menu; use Exception; use Illuminate\Validation\Rule; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Session; class LanguageController extends Controller { // public function index($lang = false) // { // $data['languages'] = Language::where('user_id', Auth::guard('web')->user()->id)->get(); // return view('user.language.index', $data); // } public function index($lang = false) { $userId = Auth::guard('web')->user()->id; $languages = Language::where('user_id', $userId)->get(); // Check if English language exists $englishLanguage = Language::where('user_id', $userId) ->where('code', 'en') ->first(); if (!$englishLanguage) { $defaults = [ 'user_id' => $userId, 'name' => 'English', 'code' => 'en', 'rtl' => 0, 'keywords' => json_encode([]) ]; // Only set as defaults if no other languages exist $existingLanguages = Language::where('user_id', $userId)->count(); if ($existingLanguages == 0) { $defaults['is_default'] = 1; $defaults['dashboard_default'] = 1; } Language::create($defaults); } $data['languages'] = $languages; return view('user.language.index', $data); } public function store(Request $request) { $userId = Auth::guard('web')->id(); $membership = Membership::query() ->where('user_id', $userId) ->where('expire_date', '>=', now()->toDateString()) ->where('status', '!=', 2) ->whereYear('start_date', '!=', '9999') ->latest() ->first(); if (!$membership) { session()->flash('warning', __('No active membership found')); return 'success'; } $package = Package::findOrFail($membership->package_id); // Calculate language counts efficiently $userLanguageCount = Language::where('user_id', $userId)->count(); $adminLanguageCount = AdminLanguage::count(); $totalLanguages = max(0, $userLanguageCount - $adminLanguageCount); // Check language limit and prepare message if ($package->number_of_languages !== 0 && $totalLanguages >= $package->number_of_languages) { $message_1 = __("You can\'t add more languages") . '. '; $message_2 = __("Your package allows only additional") . ' '; $message = $message_1 . $message_2 . $package->number_of_languages . ' ' . __("languages") . '.'; session()->flash('warning', $message); return 'success'; } $rules = [ 'name' => 'required|max:255', 'code' => [ 'required', function ($attribute, $value, $fail) { $language = Language::where([ ['code', $value], ['user_id', Auth::guard('web')->user()->id] ])->get(); if ($language->count() > 0) { $fail(':attribute' . ' ' . __('already taken')); } }, ], 'direction' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $deLang = Language::first(); $in['name'] = $request->name; $in['code'] = $request->code; $in['rtl'] = $request->direction; $in['keywords'] = $deLang->keywords; $in['user_id'] = Auth::guard('web')->user()->id; if (Language::where([ ['is_default', 1], ['user_id', Auth::guard('web')->user()->id] ])->count() > 0) { $in['is_default'] = 0; } else { $in['is_default'] = 1; } DB::beginTransaction(); try { $language = Language::create($in); Menu::create([ 'user_id' => Auth::guard('web')->user()->id, 'language_id' => $language->id, 'menus' => '[{"text":"Home","href":"","icon":"empty","target":"_self","title":"","type":"home"},{"type":"services","text":"Services","href":"","target":"_self"},{"type":"team","text":"Team","href":"","target":"_self"},{"text":"Blog","href":"","icon":"empty","target":"_self","title":"","type":"blog"},{"text":"Contact","href":"","icon":"empty","target":"_self","title":"","type":"contact"}]', ]); DB::commit(); } catch (Exception $e) { DB::rollback(); return response()->json(['error', $e->getMessage(), $language->id], 401); } Session::flash('success', __('Language added successfully') . '!'); return "success"; } public function edit($id) { if ($id > 0) { $data['language'] = Language::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); } $data['id'] = $id; return view('user.language.edit', $data); } public function update(Request $request) { $language = Language::where('user_id', Auth::guard('web')->user()->id)->where('id', $request->language_id)->firstOrFail(); $rules = [ 'name' => 'required|max:255', 'code' => [ 'required', function ($attribute, $value, $fail) use ($request) { $language = Language::where([ ['code', $value], ['user_id', Auth::guard('web')->user()->id], ['id', '<>', $request->language_id] ])->get(); if ($language->count() > 0) { $fail(':attribute' . ' ' . __('already taken')); } }, ], 'direction' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $language->name = $request->name; $language->code = $request->code; $language->rtl = $request->direction; $language->user_id = Auth::guard('web')->user()->id; $language->save(); Session::flash('success', __('Language updated successfully') . '!'); return "success"; } public function editKeyword($id) { $data['la'] = Language::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); $data['languageKeywords'] = json_decode($data['la']->keywords, true); return view('user.language.edit-keyword', $data); } public function updateKeyword(Request $request, $id) { $lang = Language::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); $keywords = $request->except('_token'); $lang->keywords = json_encode($keywords); $lang->save(); return back()->with('success', __('Updated Successfully') . '!'); } public function delete($id) { $la = Language::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); if ($la->is_default == 1) { return back()->with('warning', __('Default language cannot be deleted!')); } if (session()->get('user_lang') == $la->code) { session()->forget('user_lang'); } if ($la->testimonials()->count() > 0) { $testimonials = $la->testimonials()->get(); foreach ($testimonials as $key => $tstm) { @unlink(public_path('assets/front/img/user/testimonials/' . $tstm->image)); $tstm->delete(); } } // ========================= course information delete start =============================== // course categories delete if ($la->courseCategory()->count() > 0) { $la->courseCategory()->delete(); } // course faqs delete if ($la->courseFaqs()->count() > 0) { $la->courseFaqs()->delete(); } // course information delete if ($la->courseInformation()->count() > 0) { $la->courseInformation()->delete(); } // course information delete if ($la->courseInstructtors()->count() > 0) { $instructors = $la->courseInstructtors()->get(); foreach ($instructors as $key => $ins) { @unlink(public_path(Constant::WEBSITE_INSTRUCTOR_IMAGE . '/' . $ins->image)); $ins->socialPlatform()->delete(); $ins->delete(); } } // course lesson delete if ($la->courseLessons()->count() > 0) { $lessons = $la->courseLessons()->get(); foreach ($lessons as $leson) { // lesson content delete $contents = $leson->content()->get(); if (count($contents) > 0) { foreach ($contents as $cont) { $content = LessonContent::where('user_id', Auth::guard('web')->user()->id)->find($cont->id); $lessonId = $content->lesson_id; $type = $content->type; if (!is_null($content->video_unique_name)) Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $content->video_unique_name); if (!is_null($content->file_unique_name)) Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $content->file_unique_name); $content->delete(); } } $quiz = $leson->quiz()->get(); if (count($quiz) > 0) { foreach ($quiz as $q) { $q->delete(); } } $leson->lesson_complete()->delete(); $leson->lessonContentComplete()->delete(); } $la->courseLessons()->delete(); } // course module delete if ($la->courseModules()->count() > 0) { $la->courseModules()->delete(); } // ========================= course information delete end =============================== // ========================= room information delete start =============================== // room amenities delete if ($la->roomAmenities()->count() > 0) { $la->roomAmenities()->delete(); } // room categories delete if ($la->roomCategories()->count() > 0) { $la->roomCategories()->delete(); } // room content delete if ($la->roomDetails()->count() > 0) { $la->roomDetails()->delete(); } // ========================= room information delete end =============================== // ========================= cause/donation information delete start =============================== // cause content delete if ($la->causeContents()->count() > 0) { $la->causeContents()->delete(); } // cause categories delete if ($la->causeCategories()->count() > 0) { $categories = $la->causeCategories()->get(); foreach ($categories as $key => $cate) { @unlink(public_path(Constant::WEBSITE_CAUSE_CATEGORY_IMAGE . '/' . $cate->image)); $cate->delete(); } } // ========================= cause/donation information delete end =============================== // variation delete if ($la->variations()->count() > 0) { $la->variations()->delete(); } // user_item_contacts delete if ($la->user_item_contacts()->count() > 0) { $la->user_item_contacts()->delete(); } if ($la->skills()->count() > 0) { $la->skills()->delete(); } if ($la->menus()->count() > 0) { $la->menus()->delete(); } if ($la->pages()->count() > 0) { $la->pages()->delete(); } if ($la->services()->count() > 0) { $services = $la->services()->get(); foreach ($services as $key => $service) { @unlink(public_path('assets/front/img/user/services/' . $service->image)); $service->delete(); } } if ($la->seos()->count() > 0) { $la->seos()->delete(); } if ($la->achievements()->count() > 0) { $la->achievements()->delete(); } if ($la->portfolios()->count() > 0) { $portfolios = $la->portfolios()->get(); foreach ($portfolios as $key => $portfolio) { @unlink(public_path('assets/front/img/user/portfolios/' . $portfolio->image)); if ($portfolio->portfolio_images()->count() > 0) { foreach ($portfolio->portfolio_images as $key => $pi) { @unlink(public_path('assets/front/img/user/portfolios/' . $pi->image)); $pi->delete(); } } $portfolio->delete(); } } if ($la->portfolio_categories()->count() > 0) { $la->portfolio_categories()->delete(); } if ($la->home_page_texts()->count() > 0) { $homeTexts = $la->home_page_texts()->get(); foreach ($homeTexts as $key => $homeText) { @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_video_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->testimonial_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->video_section_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->why_choose_us_section_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->why_choose_us_section_video_image)); @unlink(public_path('assets/front/img/work_process/' . $homeText->work_process_section_img)); @unlink(public_path('assets/front/img/work_process/' . $homeText->work_process_section_video_img)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->quote_section_image)); $homeText->delete(); } } if ($la->jobs()->count() > 0) { $la->jobs()->delete(); } if ($la->jcategories()->count() > 0) { $la->jcategories()->delete(); } if ($la->teams()->count() > 0) { $teams = $la->teams()->get(); foreach ($teams as $key => $team) { @unlink(public_path('/assets/front/img/user/team/' . $team->image)); $team->delete(); } } if ($la->quote_inputs()->count() > 0) { $quote_inputs = $la->quote_inputs()->get(); foreach ($quote_inputs as $key => $input) { if ($input->quote_input_options()->count() > 0) { $input->quote_input_options()->delete(); } $input->delete(); } } if ($la->processes()->count() > 0) { $la->processes()->delete(); } if ($la->blog_categories()->count() > 0) { $la->blog_categories()->delete(); } if ($la->blogs()->count() > 0) { $blogs = $la->blogs()->get(); foreach ($blogs as $key => $blog) { @unlink(public_path('assets/front/img/user/blogs/' . $blog->image)); $blog->delete(); } } if ($la->faqs()->count() > 0) { $la->faqs()->delete(); } if ($la->quick_links()->count() > 0) { $la->quick_links()->delete(); } if ($la->footer_texts()->count() > 0) { $la->footer_texts()->delete(); } if ($la->hero_static()->count() > 0) { $static = $la->hero_static; @unlink(public_path('assets/front/img/hero_static/' . $static->img)); $static->delete(); } if ($la->hero_sliders()->count() > 0) { $sliders = $la->hero_sliders()->get(); foreach ($sliders as $key => $slider) { @unlink(public_path('assets/front/img/hero_slider/' . $slider->img)); $slider->delete(); } } // if ($la->itemInfo()->count() > 0) { $la->itemInfo()->delete(); } if ($la->user_item_categories()->count() > 0) { $la->user_item_categories()->delete(); } if ($la->user_item_subcategories()->count() > 0) { $la->user_item_subcategories()->delete(); } if ($la->user_features()->count() > 0) { $user_features = $la->user_features()->get(); foreach ($user_features as $key => $feat) { @unlink(public_path('assets/front/img/user/feature/' . $feat->icon)); $feat->delete(); } } if ($la->user_offer_banners()->count() > 0) { $user_offer_banners = $la->user_offer_banners()->get(); foreach ($user_offer_banners as $key => $banner) { @unlink(public_path('assets/front/img/user/offers/' . $banner->image)); $banner->delete(); } } if ($la->user_shipping_charges()->count() > 0) { $la->user_shipping_charges()->delete(); } // if the the deletable language is the currently selected language in frontend then forget the selected language from session session()->forget('lang'); $la->delete(); return back()->with('success', __('Language Delete Successfully') . '!'); } public function default(Request $request, $id) { Language::where('is_default', 1)->where('user_id', Auth::guard('web')->user()->id)->update(['is_default' => 0]); $lang = Language::find($id); $lang->is_default = 1; $lang->save(); return back()->with('success', $lang->name . ' ' . __('language is set as default') . '.'); } public function dashboardDefault(Request $request, $id) { $user_id = Auth::guard('web')->user()->id; $lang = Language::where('user_id', $user_id)->findOrFail($id); Language::where('dashboard_default', 1) ->where('user_id', $user_id) ->update(['dashboard_default' => 0]); $lang->dashboard_default = 1; $lang->save(); // Update session and cookie immediately $code = trim('user_' . $lang->code); Session::put('user_dashboard_lang', $code); Session::put('dashboard_direction', $lang->rtl); app()->setLocale('user_' . $lang->code); // Set cookie for future visits (30 days expiration) Cookie::queue('userDashboardLang', $lang->code, 60 * 24 * 30); // return back()->with('success', $lang->name . ' ' . __('language is set as default') . '.'); // Redirect to the languages page with the new language code in the URL return redirect()->route('user.language.index', ['language' => $lang->code]) ->with('success', $lang->name . ' ' . __('language is set as default')); } public function rtlcheck($langid) { if ($langid > 0) { $lang = Language::where('user_id', Auth::guard('web')->user()->id)->where('id', $langid)->firstOrFail(); } else { return 0; } return $lang->rtl; } } Http/Controllers/User/PortfolioCategoryController.php 0000644 00000012752 15213350434 0017146 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\Language; use App\Models\User\PortfolioCategory; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Validator; class PortfolioCategoryController extends Controller { /** * Display a listing of the resource. * * @return */ public function index(Request $request) { $lang = Language::where([['code', $request->language], ['user_id', Auth::id()]])->firstorFail(); $data['categories'] = PortfolioCategory::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::id()], ]) ->orderBy('id', 'DESC') ->get(); return view('user.portfolio.bcategory.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $rules = [ 'user_language_id' => 'required', 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $bcategory = new PortfolioCategory(); $bcategory->language_id = $request->user_language_id; $bcategory->name = $request->name; $bcategory->status = $request->status; $bcategory->user_id = Auth::id(); $bcategory->serial_number = $request->serial_number; $bcategory->save(); Session::flash('success', __('Portfolio category added successfully') . '!'); return "success"; } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { $rules = [ 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $bcategory = PortfolioCategory::where('user_id', Auth::user()->id)->where('id', $request->bcategory_id)->firstOrFail(); $bcategory->name = $request->name; $bcategory->status = $request->status; $bcategory->serial_number = $request->serial_number; $bcategory->save(); Session::flash('success', __('Portfolio category updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } public function delete(Request $request) { $bcategory = PortfolioCategory::where('user_id', Auth::user()->id)->where('id', $request->bcategory_id)->firstOrFail(); if ($bcategory->portfolios()->count() > 0) { Session::flash('warning', __('First, delete all the portfolios under this category!')); return back(); } $bcategory->delete(); Session::flash('success', __('Portfolio category deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $bcategory = PortfolioCategory::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); if ($bcategory->portfolios()->count() > 0) { Session::flash('warning', __('First, delete all the portfolios under the selected categories!')); return "success"; } } foreach ($ids as $id) { $bcategory = PortfolioCategory::findOrFail($id); $bcategory->delete(); } Session::flash('success', __('Portfolio categories deleted successfully') . '!'); return "success"; } public function makeFeatured(Request $request) { $bcategory = PortfolioCategory::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail(); if ($bcategory) { $bcategory->is_featured = $request->status; $bcategory->save(); } if ($request->status == 1) { $action = __('Featured'); } else { $action = __('Unfeatured'); } Session::flash('success', __('Portfolio category') . ' ' . $action . ' ' . __('successfully') . '!'); return redirect()->back(); } } Http/Controllers/User/VcardController.php 0000644 00000077022 15213350434 0014533 0 ustar 00 <?php namespace App\Http\Controllers\User; use Illuminate\Http\Request; use App\Models\User\UserVcard; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use App\Models\User\UserVcardProject; use App\Models\User\UserVcardService; use Illuminate\Support\Facades\Session; use App\Http\Helpers\LimitCheckerHelper; use App\Models\User\UserVcardTestimonial; use Illuminate\Support\Facades\Validator; class VcardController extends Controller { public function vcard() { $user = Auth::guard('web')->user(); $data['vcard_limit'] = LimitCheckerHelper::vcardLimitchecker($user->id); $data['vcards'] = UserVcard::where('user_id', $user->id)->orderBy('id', 'DESC')->get(); return view('user.vcard.index', $data); } public function create() { return view('user.vcard.create'); } public function edit($id) { $data['vcard'] = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); return view('user.vcard.edit', $data); } public function services($id) { $vcard = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail();; $services = $vcard->user_vcard_services()->orderBy('id', 'DESC')->get(); $data['vcard'] = $vcard; $data['services'] = $services; return view('user.vcard.services.index', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return */ public function serviceStore(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'user_vcard_id' => 'required', 'title' => 'required|max:255', 'serial_number' => 'required|integer', 'image' => [ 'required', function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/services/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } $input['user_vcard_id'] = $request->user_vcard_id; $service = new UserVcardService(); $service->create($input); Session::flash('success', __('Service added successfully') . '!'); return "success"; } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function serviceUpdate(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'title' => 'required|max:255', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $service = UserVcardService::findOrFail($request->service_id); if ($service->user_vcard->user_id != Auth::guard('web')->user()->id) { return; } $input = $request->all(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/user/services/'), $filename); if (file_exists(public_path('assets/front/img/user/services/' . $service->image))) { @unlink(public_path('assets/front/img/user/services/' . $service->image)); } $input['image'] = $filename; } $service->update($input); Session::flash('success', __('Service updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function serviceDelete(Request $request) { $this->deleteService($request->service_id); Session::flash('success', __('Service deleted successfully') . '!'); return back(); } public function deleteService($id) { $service = UserVcardService::findOrFail($id); @unlink(public_path('assets/front/img/user/services/' . $service->image)); $service->delete(); } public function bulkServiceDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $this->deleteService($id); } Session::flash('success', __('Services deleted successfully') . '!'); return "success"; } public function store(Request $request) { $user = Auth::guard('web')->user(); $vcard_limit = LimitCheckerHelper::vcardLimitchecker($user->id); $vcards = UserVcard::where('user_id', $user->id)->orderBy('id', 'DESC')->get(); if ($vcards->count() >= $vcard_limit) { Session::flash('warning', __('maximum limit exceeded') . '!'); return "success"; } $profileImg = $request->file('profile_image'); $coverImg = $request->file('cover_image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'vcard_name' => 'required|max:255', 'template' => 'required', 'direction' => 'required', 'name' => 'nullable|max:255', 'occupation' => 'nullable|max:255', 'profile_image' => [ 'required', function ($attribute, $value, $fail) use ($profileImg, $allowedExts) { if (!empty($profileImg)) { $ext = $profileImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } $size = $profileImg->getSize(); if ($size > 200000) { return $fail( __('Image size cannot be greater than 200 KB') . "."); } } }, ], 'cover_image' => [ function ($attribute, $value, $fail) use ($coverImg, $allowedExts) { if (!empty($coverImg)) { $ext = $coverImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } } }, ], 'icons.*' => 'required', 'colors.*' => 'required', 'labels.*' => 'required', 'values.*' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $vcard = new UserVcard(); $vcard->user_id = Auth::guard('web')->user()->id; $vcard->vcard_name = $request->vcard_name; $vcard->direction = $request->direction; $vcard->template = $request->template; if ($request->hasFile('profile_image')) { $filename = uniqid() . '.' . $profileImg->getClientOriginalExtension(); $dir = public_path('assets/front/img/user/vcard/'); @mkdir($dir, 0775, true); $request->file('profile_image')->move($dir, $filename); $vcard->profile_image = $filename; } if ($request->hasFile('cover_image')) { $filename = uniqid() . '.' . $coverImg->getClientOriginalExtension(); $dir = public_path('assets/front/img/user/vcard/'); @mkdir($dir, 0775, true); $request->file('cover_image')->move($dir, $filename); $vcard->cover_image = $filename; } $vcard->name = $request->name; $vcard->occupation = $request->occupation; $vcard->company = $request->company; $vcard->email = $request->email; $vcard->phone = $request->phone; $vcard->address = $request->address; $vcard->website_url = $request->website_url; $vcard->introduction = $request->introduction; // language keywords $data = file_get_contents(resource_path('lang/') . 'vcard.json'); $vcard->keywords = $data; $vcard->preferences = '["Call","Whatsapp","Mail","Add to Contact","Share vCard","Information","About Us","Video","Services","Projects","Testimonials","Enquiry Form"]'; $infoArr = []; $labels = $request->labels ? $request->labels : []; $values = $request->values ? $request->values : []; $icons = $request->icons ? $request->icons : []; $colors = $request->colors ? $request->colors : []; $links = $request->links ? $request->links : []; foreach ($labels as $key => $label) { $info = [ 'icon' => $icons["$key"], 'color' => $colors["$key"], 'label' => $labels["$key"], 'link' => in_array($key, $links) ? 1 : 0, 'value' => $values["$key"] ]; $infoArr[] = $info; } $vcard->information = json_encode($infoArr); $vcard->save(); $request->session()->flash('success', __('Vcard added successfully') . '!'); return 'success'; } public function update(Request $request) { $user = Auth::guard('web')->user(); $vcard_limit = LimitCheckerHelper::vcardLimitchecker($user->id); $vcards = UserVcard::where('user_id', $user->id)->orderBy('id', 'DESC')->get(); if ($vcards->count() > $vcard_limit) { Session::flash('warning', __('maximum limit exceeded') . '!'); return "success"; } $profileImg = $request->file('profile_image'); $coverImg = $request->file('cover_image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'vcard_name' => 'required|max:255', 'template' => 'required', 'direction' => 'required', 'name' => 'nullable|max:255', 'occupation' => 'nullable|max:255', 'profile_image' => [ function ($attribute, $value, $fail) use ($profileImg, $allowedExts) { if (!empty($profileImg)) { $ext = $profileImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } $size = $profileImg->getSize(); if ($size > 200000) { return $fail( __('Image size cannot be greater than 200 KB') . "."); } } }, ], 'cover_image' => [ function ($attribute, $value, $fail) use ($coverImg, $allowedExts) { if (!empty($coverImg)) { $ext = $coverImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } } }, ], 'icons.*' => 'required', 'colors.*' => 'required', 'labels.*' => 'required', 'values.*' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $vcard = UserVcard::find($request->vcard_id); if ($vcard->user_id != Auth::guard('web')->user()->id) { return; } $vcard->user_id = Auth::guard('web')->user()->id; $vcard->vcard_name = $request->vcard_name; $vcard->direction = $request->direction; $vcard->template = $request->template; if ($request->hasFile('profile_image')) { $filename = uniqid() . '.' . $profileImg->getClientOriginalExtension(); $dir = public_path('assets/front/img/user/vcard/'); @mkdir($dir, 0775, true); $request->file('profile_image')->move($dir, $filename); $vcard->profile_image = $filename; } if ($request->hasFile('cover_image')) { $filename = uniqid() . '.' . $coverImg->getClientOriginalExtension(); $dir = public_path('assets/front/img/user/vcard/'); @mkdir($dir, 0775, true); $request->file('cover_image')->move($dir, $filename); $vcard->cover_image = $filename; } $vcard->name = $request->name; $vcard->occupation = $request->occupation; $vcard->company = $request->company; $vcard->email = $request->email; $vcard->phone = $request->phone; $vcard->address = $request->address; $vcard->website_url = $request->website_url; $vcard->introduction = $request->introduction; $infoArr = []; $labels = $request->labels ? $request->labels : []; $values = $request->values ? $request->values : []; $icons = $request->icons ? $request->icons : []; $colors = $request->colors ? $request->colors : []; $links = $request->links ? $request->links : []; foreach ($labels as $key => $label) { $info = [ 'icon' => $icons["$key"], 'color' => $colors["$key"], 'label' => $labels["$key"], 'link' => in_array($key, $links) ? 1 : 0, 'value' => $values["$key"] ]; $infoArr[] = $info; } $vcard->information = json_encode($infoArr); $vcard->save(); $request->session()->flash('success', __('Vcard updated successfully') . '!'); return 'success'; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function delete(Request $request) { $this->deleteVcard($request->vcard_id); Session::flash('success', __('Vcard deleted successfully') . '!'); return back(); } public function deleteVcard($id) { $vcard = UserVcard::findOrFail($id); /* ** Services Delete */ $services = $vcard->user_vcard_services()->get(); foreach ($services as $service) { $this->deleteService($service->id); } /* ** Project Delete */ $projects = $vcard->user_vcard_projects()->get(); foreach ($projects as $project) { $this->deleteProject($project->id); } /* ** Testimonial Delete */ $testimonials = $vcard->user_vcard_testimonials()->get(); foreach ($testimonials as $testimonial) { $this->deleteTestimonial($testimonial->id); } @unlink(public_path('assets/front/img/user/vcard/' . $vcard->profile_image)); @unlink(public_path('assets/front/img/user/vcard/' . $vcard->cover_image)); $vcard->delete(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $this->deleteVcard($id); } Session::flash('success', __('Vcards deleted successfully') . '!'); return "success"; } public function information($id) { $vcard = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail();; $information = json_decode($vcard->information, true); return response()->json($information); } public function projects($id) { $vcard = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail();; $projects = $vcard->user_vcard_projects()->orderBy('id', 'DESC')->get(); $data['vcard'] = $vcard; $data['projects'] = $projects; return view('user.vcard.projects.index', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return */ public function projectStore(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'user_vcard_id' => 'required', 'title' => 'required|max:255', 'serial_number' => 'required|integer', 'image' => [ 'required', function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/projects/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } $input['user_vcard_id'] = $request->user_vcard_id; $project = new UserVcardProject(); $project->create($input); Session::flash('success', __('Project added successfully') . '!'); return "success"; } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function projectUpdate(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'title' => 'required|max:255', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $project = UserVcardProject::findOrFail($request->project_id); if ($project->user_vcard->user_id != Auth::guard('web')->user()->id) { return; } $input = $request->all(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/user/projects/'), $filename); if (file_exists(public_path('assets/front/img/user/projects/' . $project->image))) { @unlink(public_path('assets/front/img/user/projects/' . $project->image)); } $input['image'] = $filename; } $project->update($input); Session::flash('success', __('Project updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function projectDelete(Request $request) { $this->deleteProject($request->project_id); Session::flash('success', __('Project deleted successfully') . '!'); return back(); } public function deleteProject($id) { $project = UserVcardProject::findOrFail($id); @unlink(public_path('assets/front/img/user/projects/' . $project->image)); $project->delete(); return; } public function bulkProjectDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $this->deleteProject($id); } Session::flash('success', __('Projects deleted successfully') . '!'); return "success"; } public function testimonials($id) { $vcard = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); $testimonials = $vcard->user_vcard_testimonials()->orderBy('id', 'DESC')->get(); $data['vcard'] = $vcard; $data['testimonials'] = $testimonials; return view('user.vcard.testimonials.index', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return */ public function testimonialStore(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'user_vcard_id' => 'required', 'name' => 'required|max:255', 'serial_number' => 'required|integer', 'rating' => 'required|integer|min:1|max:5', 'comment' => 'nullable', 'image' => [ 'required', function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/testimonials/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } $input['user_vcard_id'] = $request->user_vcard_id; $testimonial = new UserVcardTestimonial(); $testimonial->create($input); Session::flash('success', __('Testimonial added successfully') . '!'); return "success"; } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function testimonialUpdate(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'name' => 'required|max:255', 'serial_number' => 'required|integer', 'rating' => 'required|integer|min:1|max:5', 'comment' => 'nullable', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $testimonial = UserVcardTestimonial::findOrFail($request->testimonial_id); if ($testimonial->user_vcard->user_id != Auth::guard('web')->user()->id) { return; } $input = $request->all(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/user/testimonials/'), $filename); if (file_exists(public_path('assets/front/img/user/testimonials/' . $testimonial->image))) { @unlink(public_path('assets/front/img/user/testimonials/' . $testimonial->image)); } $input['image'] = $filename; } $testimonial->update($input); Session::flash('success', __('Testimonial updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function testimonialDelete(Request $request) { $this->deleteTestimonial($request->testimonial_id); Session::flash('success', __('Testimonial deleted successfully') . '!'); return back(); } public function deleteTestimonial($id) { $testimonial = UserVcardTestimonial::findOrFail($id); @unlink(public_path('assets/front/img/user/testimonials/' . $testimonial->image)); $testimonial->delete(); } public function bulkTestimonialDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $this->deleteTestimonial($id); } Session::flash('success', __('Testimonials deleted successfully') . '!'); return "success"; } public function about($id) { $data['vcard'] = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); return view('user.vcard.about', $data); } public function aboutUpdate(Request $request) { $vcard = UserVcard::find($request->vcard_id); if ($vcard->user_id != Auth::guard('web')->user()->id) { return; } $vcard->video = $request->video; $vcard->about = clean($request->about); $vcard->save(); $request->session()->flash('success', __('About & video updated successfully') . '!'); return 'success'; } public function preferences($id) { $vcard = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); $preferences = []; if (!empty($vcard->preferences)) { $preferences = json_decode($vcard->preferences, true); } $data['vcard'] = $vcard; $data['preferences'] = $preferences; return view('user.vcard.preferences', $data); } public function prefUpdate(Request $request, $vcId) { $vcard = UserVcard::findOrFail($vcId); if ($vcard->user_id != Auth::guard('web')->user()->id) { return; } $preferences = $request->preferences; if (empty($preferences)) { $vcard->preferences = NULL; } else { $vcard->preferences = json_encode($preferences); } $vcard->save(); $request->session()->flash('success', __('Preferences updated successfully') . '!'); return 'success'; } public function color($id) { $vcard = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); $data['vcard'] = $vcard; return view('user.vcard.color', $data); } public function colorUpdate(Request $request, $vcId) { $vcard = UserVcard::findOrFail($vcId); if ($vcard->user_id != Auth::guard('web')->user()->id) { return; } $vcard->base_color = $request->base_color; if ($vcard->template == 6) { $vcard->summary_background_color = $request->summary_background_color; } if ($vcard->template != 5 && $vcard->template != 6 && $vcard->template != 9 && $vcard->template != 10) { $vcard->call_button_color = $request->call_button_color; $vcard->whatsapp_button_color = $request->whatsapp_button_color; $vcard->mail_button_color = $request->mail_button_color; $vcard->add_to_contact_button_color = $request->add_to_contact_button_color; $vcard->share_vcard_button_color = $request->share_vcard_button_color; $vcard->phone_icon_color = $request->phone_icon_color; $vcard->email_icon_color = $request->email_icon_color; $vcard->address_icon_color = $request->address_icon_color; $vcard->website_url_icon_color = $request->website_url_icon_color; } $vcard->save(); $request->session()->flash('success', __('Colors updated successfully') . '.'); return 'success'; } public function keywords($id) { $vcard = UserVcard::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); $keywords = []; if (!empty($vcard->keywords)) { $keywords = json_decode($vcard->keywords, true); } $data['vcard'] = $vcard; $data['vcardKeywords'] = $keywords; return view('user.vcard.keywords', $data); } public function keywordsUpdate(Request $request, $vcId) { $keywords = $request->except("_token"); if (empty($keywords)) { $keywords = []; } $upKeywords = []; foreach ($keywords as $key => $value) { $upKeywords["$key"] = $value; } $upKeywords = json_encode($upKeywords); $vcard = UserVcard::findOrFail($vcId); if ($vcard->user_id != Auth::guard('web')->user()->id) { return; } $vcard->keywords = $upKeywords; $vcard->save(); $request->session()->flash('success', __('Keywords updated successfully') . '!'); return 'success'; } } Http/Controllers/User/SkillCategoryController.php 0000644 00000012445 15213350434 0016246 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\Language; use App\Models\User\SkillCategory; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Validator; class SkillCategoryController extends Controller { /** * Display a listing of the resource. * * @return */ public function index(Request $request) { $data = null; $lang = Language::where('code', $request->userLanguage)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); if (!is_null($lang)) { $data['bcategorys'] = SkillCategory::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::id()], ]) ->orderBy('id', 'DESC') ->paginate(10); } else { $data['bcategorys'] = null; } return view('user.skill.bcategory.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $messages = [ 'lang_id.required' => 'The language field is required', 'name' => 'The name field is required', 'status' => 'The status field is required', 'serial_number' => 'The serial number field is required', ]; $rules = [ 'lang_id' => 'required', 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $bcategory = new SkillCategory(); $bcategory->language_id = $request->lang_id; $bcategory->name = $request->name; $bcategory->status = $request->status; $bcategory->user_id = Auth::id(); $bcategory->serial_number = $request->serial_number; $bcategory->save(); Session::flash('success', 'Skill category added successfully!'); return "success"; } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { $messages = [ 'name' => 'The name field is required', 'status' => 'The status field is required', 'serial_number' => 'The serial number field is required', ]; $rules = [ 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $bcategory = SkillCategory::findOrFail($request->bcategory_id); $bcategory->name = $request->name; $bcategory->status = $request->status; $bcategory->serial_number = $request->serial_number; $bcategory->save(); Session::flash('success', 'Skill category updated successfully!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } public function delete(Request $request) { $bcategory = SkillCategory::findOrFail($request->bcategory_id); if ($bcategory->skills()->count() > 0) { Session::flash('warning', 'First, delete all the skills under this category!'); return back(); } $bcategory->delete(); Session::flash('success', 'Skill category deleted successfully!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $bcategory = SkillCategory::findOrFail($id); if ($bcategory->skills()->count() > 0) { Session::flash('warning', 'First, delete all the skills under the selected categories!'); return "success"; } } foreach ($ids as $id) { $bcategory = SkillCategory::findOrFail($id); $bcategory->delete(); } Session::flash('success', 'Skill categories deleted successfully!'); return "success"; } } Http/Controllers/User/ServiceController.php 0000644 00000017545 15213350434 0015100 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\BasicSetting; use App\Models\User\Language; use App\Models\User\UserService; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Purifier; use Validator; class ServiceController extends Controller { /** * Display a listing of the resource. * * @return */ public function index(Request $request) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } $data = null; $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $data['services'] = UserService::where([ ['lang_id', '=', $lang->id], ['user_id', '=', $user->id], ]) ->orderBy('id', 'DESC') ->get(); return view('user.service.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return */ public function store(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'name' => 'required|max:255', 'user_language_id' => 'required', 'detail_page' => 'required', 'serial_number' => 'required|integer', 'image' => [ 'sometimes', 'required', function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $userBs = BasicSetting::where('user_id', Auth::guard('web')->id())->select('theme')->first(); if ($userBs->theme == 'home_seven' || $userBs->theme == 'home_nine') { $rules['icon'] = 'required'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } if (!isset($request->featured)) $request["featured"] = "0"; $input = $request->all(); $slug = make_slug($request->name); $input['slug'] = $slug; $input['user_id'] = Auth::id(); $input['lang_id'] = $request->user_language_id; $input['icon'] = $request->icon; if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/services/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } $input['content'] = Purifier::clean($request->content); $blog = new UserService(); $blog->create($input); Session::flash('success', __('Service added successfully') . '!'); return "success"; } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $data['service'] = UserService::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); return view('user.service.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'name' => 'required|max:255', 'detail_page' => 'required', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $service = UserService::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail(); $input = $request->all(); $slug = make_slug($request->name); $input['slug'] = $slug; $input['user_id'] = Auth::id(); $input['icon'] = $request->icon; if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/user/services/'), $filename); if (file_exists(public_path('assets/front/img/user/services/' . $service->image))) { @unlink(public_path('assets/front/img/user/services/' . $service->image)); } $input['image'] = $filename; } $input['content'] = Purifier::clean($request->content); $service->update($input); Session::flash('success', __('Service updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function delete(Request $request) { $service = UserService::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail(); if (file_exists(public_path('assets/front/img/user/services/' . $service->image))) { @unlink(public_path('assets/front/img/user/services/' . $service->image)); } $service->delete(); Session::flash('success', __('Service deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $service = UserService::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); if (file_exists(public_path('assets/front/img/user/services/' . $service->image))) { @unlink(public_path('assets/front/img/user/services/' . $service->image)); } $service->delete(); } Session::flash('success', __('Service deleted successfully') . '!'); return "success"; } public function featured(Request $request): \Illuminate\Http\RedirectResponse { $member = UserService::where('user_id', Auth::user()->id)->where('id', $request->service_id)->firstOrFail(); $member->featured = $request->featured; $member->save(); if ($request->featured == 1) { Session::flash('success', __('Featured successfully') . '!'); } else { Session::flash('success', __('Unfeatured successfully') . '!'); } return back(); } } Http/Controllers/User/SocialController.php 0000644 00000004144 15213350434 0014701 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\Social; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; class SocialController extends Controller { public function index() { $data['socials'] = Social::where('user_id', Auth::id()) ->orderBy('id', 'DESC') ->get(); return view('user.settings.social.index', $data); } public function store(Request $request) { $request->validate([ 'icon' => 'required', 'url' => 'required', 'serial_number' => 'required|integer', ]); $social = new Social; $social->icon = $request->icon; $social->url = $request->url; $social->serial_number = $request->serial_number; $social->user_id = Auth::id(); $social->save(); Session::flash('success', __('New link added successfully') . '!'); return back(); } public function edit($id) { $data['social'] = Social::where('user_id', Auth::id())->where('id', $id)->firstOrFail(); return view('user.settings.social.edit', $data); } public function update(Request $request) { $request->validate([ 'icon' => 'required', 'url' => 'required', 'serial_number' => 'required|integer', ]); $social = Social::where('user_id', Auth::id())->where('id', $request->socialid)->firstOrFail(); $social->icon = $request->icon; $social->url = $request->url; $social->serial_number = $request->serial_number; $social->user_id = Auth::id(); $social->save(); Session::flash('success', __('Social link updated successfully') . '!'); return back(); } public function delete(Request $request) { $social = Social::where('user_id', Auth::id())->where('id', $request->socialid)->firstOrFail(); $social->delete(); Session::flash('success', __('Social link deleted successfully') . '!'); return back(); } } Http/Controllers/User/Payment/PhonePeController.php 0000644 00000023237 15213350434 0016446 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Cache; class PhonePeController extends Controller { private $sandboxCheck; public function paymentProcess(Request $request, $_amount, $_title, $_success_url, $_cancel_url) { $user = getUser(); if (!$user) { throw new \Exception('User not found'); } Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); Session::put('payment_title', $_title); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'phonepe']])->first(); $paymentInfo = json_decode($paymentMethod->information, true); if (empty($paymentInfo['merchant_id']) || empty($paymentInfo['salt_key'])) { throw new \Exception('Invalid PhonePe configuration'); } $this->sandboxCheck = $paymentInfo['sandbox_check'] ?? 0; $clientId = $paymentInfo['merchant_id']; $clientSecret = $paymentInfo['salt_key']; $accessToken = $this->getPhonePeAccessToken($clientId, $clientSecret); if (!$accessToken) { return back()->withError('Failed to get PhonePe access token'); } return $this->initiatePayment($accessToken, $_success_url, $_cancel_url, $_amount); } private function getPhonePeAccessToken($clientId, $clientSecret) { return Cache::remember('phonepe_access_token', 3500, function () use ($clientId, $clientSecret) { $tokenUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox/v1/oauth/token' : 'https://api.phonepe.com/apis/identity-manager/v1/oauth/token'; $response = Http::asForm()->post($tokenUrl, [ 'client_id' => $clientId, 'client_secret' => $clientSecret, 'client_version' => 1, 'grant_type' => 'client_credentials' ]); if ($response->successful()) { return $response->json()['access_token']; } return null; }); } public function initiatePayment($accessToken, $successUrl, $cancelUrl, $_amount) { $baseUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox' : 'https://api.phonepe.com/apis/pg'; $endpoint = '/checkout/v2/pay'; // Generate a unique merchantOrderId and store it in the session $merchantOrderId = uniqid(); Session::put('merchantOrderId', $merchantOrderId); Session::put('cancel_url', $cancelUrl); //here we preapare the parameter of the request $payload = [ 'merchantOrderId' => $merchantOrderId, 'amount' => intval($_amount * 100), //you have to multiply the amount by 100 to convert it to paise 'paymentFlow' => [ 'type' => 'PG_CHECKOUT', 'merchantUrls' => [ 'redirectUrl' => $successUrl, 'cancelUrl' => $cancelUrl ] ] ]; try { //after preparing the parameter we send a request to create a payment link $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'O-Bearer ' . $accessToken, ])->post($baseUrl . $endpoint, $payload); $responseData = $response->json(); //after successfully created the payment link of we redirect the user to api responsed redirectUrl if ($response->successful() && isset($responseData['redirectUrl'])) { return redirect()->away($responseData['redirectUrl']); } else { // Handle API errors Session::forget(['merchantOrderId', 'cancel_url']); return back()->with('error', 'Failed to initiate payment: ' . ($responseData['message'] ?? 'Unknown error')); } } catch (\Exception $e) { Session::forget(['merchantOrderId', 'cancel_url']); return response()->json([ 'success' => false, 'code' => 'NETWORK_ERROR', 'message' => $e->getMessage() ], 500); } } public function successPayment(Request $request) { $requestData = Session::get('user_request'); $keywords = getUserKeywords(); $merchantOrderId = $request->input('merchantOrderId') ?? Session::get('merchantOrderId') ?? uniqid(); $verificationResponse = $this->verifyOrderStatus($merchantOrderId); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.phonepe.cancel', getParam()); } if ($verificationResponse['success']) { $txnId = $request->transactionId; $chargeId = $request->transactionId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } $this->clearPaymentSession(); session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } return redirect($cancel_url); } private function verifyOrderStatus($merchantOrderId) { $user = getUser(); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'phonepe']])->first(); $paymentInfo = json_decode($paymentMethod->information, true); $this->sandboxCheck = $paymentInfo['sandbox_check'] ?? 0; try { $accessToken = $this->getPhonePeAccessToken( $paymentInfo['merchant_id'], $paymentInfo['salt_key'] ); if (!$accessToken) { throw new \Exception('Failed to get access token'); } $baseUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox' : 'https://api.phonepe.com/apis/pg'; $endpoint = "/checkout/v2/order/{$merchantOrderId}/status"; $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'O-Bearer ' . $accessToken, ])->get($baseUrl . $endpoint); if ($response->successful()) { $responseData = $response->json(); if ($responseData['state'] === 'COMPLETED') { return [ 'success' => true, 'state' => $responseData['state'], 'amount' => $responseData['amount'] ?? null, 'data' => $responseData, ]; } return [ 'success' => false, 'error' => 'Payment not completed: ' . ($responseData['state'] ?? 'Unknown state'), ]; } else { return [ 'success' => false, 'error' => $response->json() ?? 'Unknown error' ]; } } catch (\Exception $e) { return [ 'success' => false, 'error' => $e->getMessage() ]; } } public function cancelPayment() { $keywords = getUserKeywords(); $this->clearPaymentSession(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.checkout', getParam()); } private function clearPaymentSession() { try { $keys = [ 'user_request', 'user_amount', 'payment_title', 'merchantOrderId', 'cancel_url', 'bookingId' ]; foreach ($keys as $key) { if (Session::has($key)) { Session::forget($key); } } } catch (\Exception $e) { Session::flash('Failed to clear payment session: ' . $e->getMessage()); } } } Http/Controllers/User/Payment/OfflineController.php 0000644 00000005573 15213350434 0016475 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use App\Models\User\UserOfflineGateway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Validator; class OfflineController extends Controller { use MiscellaneousTrait; public function bookingProcess(Request $request) { $offlineMethod = UserOfflineGateway::findOrFail($request->paymentType); // check whether attachment is required or not if ($offlineMethod->attachment_status == 1) { $rules = [ 'attachment' => 'required|mimes:jpg,jpeg,png' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator->errors())->withInput(); } } // store attachment in local storage if ($request->hasFile('attachment')) { $img = $request->file('attachment'); $img_name = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/img/attachments/rooms/'); if (!file_exists($directory)) { mkdir($directory, 0775, true); } $img->move($directory, $img_name); } $roomBooking = new RoomBookingController(); // do calculation $calculatedData = $roomBooking->calculation($request); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(getUser()->id); // $information['subtotal'] = $calculatedData['subtotal']; // $information['discount'] = $calculatedData['discount']; // $information['total'] = $calculatedData['total']; $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = $offlineMethod->name; $information['type'] = 'offline'; $information['attachment'] = $request->hasFile('attachment') ? $img_name : null; // store the room booking information in database $booking_details = $roomBooking->storeData($request, $information); $bookingInfo = RoomBooking::findOrFail($booking_details->id); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); return ; } } Http/Controllers/User/Payment/FlutterWaveController.php 0000644 00000017221 15213350434 0017354 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Illuminate\Http\Request; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Models\User\HotelBooking\RoomBooking; use App\Traits\MiscellaneousTrait; class FlutterWaveController extends Controller { use MiscellaneousTrait; public $public_key; private $secret_key; public function __construct() { $data = UserPaymentGeteway::whereKeyword('flutterwave')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); $this->public_key = $paydata['public_key']; $this->secret_key = $paydata['secret_key']; } public function paymentProcess(Request $request, $_amount, $_email, $_item_number, $_successUrl, $_cancelUrl, $bex) { // dd($request, $_amount, $_email, $_item_number, $_successUrl, $_cancelUrl, $bex); $cancel_url = $_cancelUrl; $notify_url = $_successUrl; Session::put('user_request', $request->all()); Session::put('user_payment_id', $_item_number); // SET CURL $curl = curl_init(); $currency = $bex->base_currency_text; $txref = $_item_number; // ensure you generate unique references per transaction. $PBFPubKey = $this->public_key; // get your public key from the dashboard. $redirect_url = $notify_url; $payment_plan = ""; // this is only required for recurring payments. curl_setopt_array($curl, array( CURLOPT_URL => "https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/hosted/pay", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'amount' => $_amount, 'customer_email' => $_email, 'currency' => $currency, 'txref' => $txref, 'PBFPubKey' => $PBFPubKey, 'redirect_url' => $redirect_url, 'payment_plan' => $payment_plan ]), CURLOPT_HTTPHEADER => [ "content-type: application/json", "cache-control: no-cache" ], )); $response = curl_exec($curl); $err = curl_error($curl); if ($err) { // there was an error contacting the rave API return redirect($cancel_url)->with('error', 'Curl returned error: ' . $err); } $transaction = json_decode($response); // dd($transaction, $this->public_key, $this->secret_key, UserPaymentGeteway::whereKeyword('flutterwave')->where('user_id', getUser()->id)->first()); if (!$transaction->data && !$transaction->data->link) { // there was an error from the API return redirect($cancel_url)->with('error', 'API returned error: ' . $transaction->message); } if ($request['title'] == "Room Booking") { $roomBooking = new RoomBookingController(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(getUser()->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Flutterwave'; $information['type'] = 'online'; $booking_details = $roomBooking->storeData($request, $information); $request->session()->put('bookingId', $booking_details->id); } return redirect()->to($transaction->data->link); } public function successPayment(Request $request) { $requestData = Session::get('user_request'); $user = getUser(); $keywords = getUserKeywords(); $bs = BasicSetting::where('user_id', $user->id)->firstorFail(); $cancel_url = route('customer.itemcheckout.flutterwave.cancel', getParam()); /** Get the payment ID before session clear **/ $payment_id = Session::get('user_payment_id'); if (isset($request['txref'])) { $ref = $payment_id; $query = array( "SECKEY" => $this->secret_key, "txref" => $ref ); $data_string = json_encode($query); $ch = curl_init('https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $response = curl_exec($ch); curl_close($ch); $resp = json_decode($response, true); if ($resp['status'] == 'error') { return redirect($cancel_url); } if ($resp['status'] = "success") { $paymentStatus = $resp['data']['status']; $paymentFor = Session::get('paymentFor'); if ($resp['status'] = "success") { if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); // remove all session data $request->session()->forget('bookingId'); } else { $txnId = UserPermissionHelper::uniqidReal(8); $chargeId = $request->paymentId; $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if (in_array('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } } return redirect($cancel_url); } return redirect($cancel_url); } public function cancelPayment() { $keywords = getUserKeywords(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.pricing', getParam()); } } Http/Controllers/User/Payment/ShopMyFatoorahController.php 0000644 00000015233 15213350434 0020010 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use App\Models\User\UserPaymentGeteway; use Illuminate\Http\Request; use Basel\MyFatoorah\MyFatoorah; use Illuminate\Support\Facades\Config; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Session; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; class ShopMyFatoorahController extends Controller { public $myfatoorah; public function __construct() { if (Session::has('user_midtrans')) { $user = Session::get('user_midtrans'); } else { $user = getUser(); } $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'myfatoorah']])->first(); $paydata = json_decode($paymentMethod->information, true); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); Config::set('myfatorah.token', $paydata['token']); Config::set('myfatorah.DisplayCurrencyIso', $currencyInfo->base_currency_text); Config::set('myfatorah.CallBackUrl', route('myfatoorah.success')); Config::set('myfatorah.ErrorUrl', route('myfatoorah.cancel')); if ($paydata['sandbox_status'] == 1) { $this->myfatoorah = MyFatoorah::getInstance(true); } else { $this->myfatoorah = MyFatoorah::getInstance(false); } } public function paymentProcess(Request $request, $_amount, $_title) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); Session::put('user_midtrans', $user); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'MyFatoorah'; $information['type'] = 'online'; $title = $_title; Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ // if title exists in request then identify as a room booking request if (array_key_exists('title', $request->all()) && $request['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); Session::put('myfatoorah_cancel_url', $cancel_url); Session::put('myfatoorah_success_url', route('customer.success.page', [getParam(), 'room-booking'])); $name = $request->customer_name; $phone = $request->customer_phone; } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); Session::put('myfatoorah_cancel_url', $cancel_url); Session::put('myfatoorah_success_url', route('customer.success.page', [getParam()])); $name = $request->billing_fname . ' ' . $request->billing_lname; $phone = $request->billing_number; } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'myfatoorah']])->first(); $paydata = $paymentMethod->convertAutoData(); $random_1 = rand(999, 9999); $random_2 = rand(9999, 99999); // create a payment request $result = $this->myfatoorah->sendPayment( $name, $_amount, [ 'CustomerMobile' => $paydata['sandbox_status'] == 1 ? '56562123544' : $phone, 'CustomerReference' => "$random_1", //orderID 'UserDefinedField' => "$random_2", //clientID "InvoiceItems" => [ [ "ItemName" => "Product Purchase or Room Booking", "Quantity" => 1, "UnitPrice" => $_amount ] ] ] ); if ($result && $result['IsSuccess'] == true) { $request->session()->put('myfatoorah_payment_type', 'shop_room'); // redirect to payment page for accept customer payment return redirect($result['Data']['InvoiceURL']); } else { // if fail then redirect return redirect($cancel_url); } } // return to success page public function successPayment(Request $request) { $requestData = Session::get('user_request'); if (!empty($request->paymentId)) { $result = $this->myfatoorah->getPaymentStatus('paymentId', $request->paymentId); if ($result && $result['IsSuccess'] == true && $result['Data']['InvoiceStatus'] == "Paid") { if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->payment_status = 1; $bookingInfo->save(); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->invoice = $invoice; $bookingInfo->save(); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); return [ 'status' => 'success' ]; } else { $order = $this->saveOrder($requestData, $request->paymentId, $request->Id, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); return [ 'status' => 'success' ]; } } else { return [ 'status' => 'fail' ]; } } } } Http/Controllers/User/Payment/PaystackController.php 0000644 00000012357 15213350434 0016670 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Carbon\Carbon; use App\Models\Package; use App\Models\Language; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\User\UserPackage; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Http\Controllers\Front\UserCheckoutController; use App\Models\User\HotelBooking\RoomBooking; use App\Traits\MiscellaneousTrait; class PaystackController extends Controller { use MiscellaneousTrait; public function __construct() { } /** * Redirect the User to Paystack Payment Page * @return */ public function paymentProcess(Request $request, $_amount, $_email, $_success_url, $bex) { $data = UserPaymentGeteway::whereKeyword('paystack')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); $secret_key = $paydata['key']; $_amount = intval($_amount * 100); $curl = curl_init(); $callback_url = $_success_url; // url to go to after payment curl_setopt_array($curl, array( CURLOPT_URL => "https://api.paystack.co/transaction/initialize", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'amount' => $_amount, 'email' => $_email, 'callback_url' => $callback_url ]), CURLOPT_HTTPHEADER => [ "authorization: Bearer " . $secret_key, //replace this with your own test key "content-type: application/json", "cache-control: no-cache" ], )); $response = curl_exec($curl); $err = curl_error($curl); if ($err) { return redirect()->back()->with('error', $err); } $tranx = json_decode($response, true); if ($request['title'] == "Room Booking") { $roomBooking = new RoomBookingController(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(getUser()->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Paystack'; $information['type'] = 'online'; $booking_details = $roomBooking->storeData($request, $information); session()->put('bookingId', $booking_details->id); } Session::put('user_request', $request->all()); if (!$tranx['status']) { return redirect()->back()->with("error", $tranx['message']); } return redirect($tranx['data']['authorization_url']); } public function successPayment(Request $request) { $requestData = Session::get('user_request'); $user = getUser(); $keywords = getUserKeywords(); $be = BasicSetting::where('user_id', $user->id)->firstorFail(); if ($request['trxref'] === $request['reference']) { $txnId = UserPermissionHelper::uniqidReal(8); $chargeId = $request->paymentId; if (in_array('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); // remove all session data $request->session()->forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, null, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if (in_array('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } else { session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.pricing', getParam()); } } } Http/Controllers/User/Payment/MollieController.php 0000644 00000012235 15213350434 0016325 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Illuminate\Http\Request; use App\Models\User\BasicSetting; use Mollie\Laravel\Facades\Mollie; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\RoomBookingController; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Config; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Models\User\HotelBooking\RoomBooking; use App\Traits\MiscellaneousTrait; class MollieController extends Controller { use MiscellaneousTrait; public function __construct() { $data = UserPaymentGeteway::whereKeyword('mollie')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); Config::set('mollie.key', $paydata['key']); } public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url, $_title, $bex) { $notify_url = $_success_url; $payment = Mollie::api()->payments()->create([ 'amount' => [ 'currency' => $bex->base_currency_text, 'value' => '' . sprintf('%0.2f', $_amount) . '', // You must send the correct number of decimals, thus we enforce the use of strings ], 'description' => $_title, 'redirectUrl' => $notify_url, ]); if ($_title == "Room Booking") { $roomBooking = new RoomBookingController(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(getUser()->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Mollie'; $information['type'] = 'online'; // store the room booking information in database $roomBooking = new RoomBookingController(); $booking_details = $roomBooking->storeData($request, $information); $request->session()->put('bookingId', $booking_details->id); } /** add payment ID to session **/ Session::put('user_request', $request->all()); Session::put('user_payment_id', $payment->id); Session::put('user_success_url', $_success_url); $payment = Mollie::api()->payments()->get($payment->id); return redirect($payment->getCheckoutUrl(), 303); } public function successPayment(Request $request) { $requestData = Session::get('user_request'); $user = getUser(); $keywords = getUserKeywords(); $bs = BasicSetting::where('user_id', $user->id)->firstorFail(); $cancel_url = Session::get('cancel_url'); $payment_id = Session::get('user_payment_id'); /** Get the payment ID before session clear **/ $payment = Mollie::api()->payments()->get($payment_id); if ($payment->status == 'paid') { if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); // remove all session data $request->session()->forget('bookingId'); } else { $requestData['user_id'] = Auth::guard('customer')->user()->id; $txnId = UserPermissionHelper::uniqidReal(8); $chargeId = $request->paymentId; $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if (in_array('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } return redirect($cancel_url); } public function cancelPayment() { $keywords = getUserKeywords(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.pricing', getParam()); } } Http/Controllers/User/Payment/ToyyibpayController.php 0000644 00000015241 15213350434 0017075 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use Illuminate\Support\Facades\Session; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Http; class ToyyibpayController extends Controller { public function paymentProcess(Request $request, $_amount, $_title, $_success_url) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Toyyibpay'; $information['type'] = 'online'; $title = $_title; $roomBooking = new RoomBookingController(); if (array_key_exists('title', $request->all()) && $request['title'] == "Room Booking") { $bill_title = 'Room Booking'; $bill_description = 'Room Booking via toyyibpay'; $name = $request->customer_name; $customer_email = $request->customer_email; $customer_phone = $request->customer_phone; } else { $bill_title = 'Product Purchase'; $bill_description = 'Product Purchase via toyyibpay'; $name = $request->billing_fname . ' ' . $request->billing_lname; $customer_email = $request->billing_email; $customer_phone = $request->billing_number; } Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'toyyibpay']])->first(); $paydata = json_decode($paymentMethod->information, true); $ref = uniqid(); session()->put('toyyibpay_ref_id', $ref); $some_data = array( 'userSecretKey' => $paydata['secret_key'], 'categoryCode' => $paydata['category_code'], 'billName' => $bill_title, 'billDescription' => $bill_description, 'billPriceSetting' => 1, 'billPayorInfo' => 1, 'billAmount' => $_amount * 100, 'billReturnUrl' => $_success_url, 'billExternalReferenceNo' => $ref, 'billTo' => $name, 'billEmail' => $customer_email, 'billPhone' => $customer_phone, ); if ($paydata['sandbox_status'] == 1) { $host = 'https://dev.toyyibpay.com/'; // for development environment } else { $host = 'https://toyyibpay.com/'; // for production environment } $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, $host . 'index.php/api/createBill'); // sandbox will be dev. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $response = json_decode($result, true); if (!empty($response[0])) { return redirect($host . $response[0]["BillCode"]); } else { if (array_key_exists('title', $request->all()) && $request['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } return redirect($cancel_url); } } // return to success page public function successPayment(Request $request) { $requestData = Session::get('user_request'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } $user = getUser(); $keywords = getUserKeywords(); $ref = session()->get('toyyibpay_ref_id'); if ($request['status_id'] == 1 && $request['order_id'] == $ref) { $txnId = $request->transactionId; $chargeId = $request->transactionId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } else { session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect($cancel_url); } } } Http/Controllers/User/Payment/RazorpayController.php 0000644 00000017305 15213350434 0016716 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Carbon\Carbon; use Razorpay\Api\Api; use App\Models\Package; use App\Models\Language; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\User\UserPackage; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Http\Controllers\Front\CheckoutController; use App\Http\Controllers\Front\RoomBookingController; use Razorpay\Api\Errors\SignatureVerificationError; use App\Http\Controllers\Front\UserCheckoutController; use App\Models\User\HotelBooking\RoomBooking; use App\Traits\MiscellaneousTrait; class RazorpayController extends Controller { use MiscellaneousTrait; private $keyId, $keySecret, $api; public function __construct() { $data = UserPaymentGeteway::whereKeyword('razorpay')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); $this->keyId = $paydata['key']; $this->keySecret = $paydata['secret']; $this->api = new Api($this->keyId, $this->keySecret); } public function paymentProcess(Request $request, $_amount, $_item_number, $_cancel_url, $_success_url, $_title, $_description, $bs) { $cancel_url = $_cancel_url; $notify_url = $_success_url; // dd($notify_url); $orderData = [ 'receipt' => $_title, 'amount' => $_amount * 100, 'currency' => 'INR', 'payment_capture' => 1 // auto capture ]; $razorpayOrder = $this->api->order->create($orderData); Session::put('user_request', $request->all()); Session::put('user_order_payment_id', $razorpayOrder['id']); $displayAmount = $amount = $_amount; $checkout = 'automatic'; // dd($bs, $request->all()); if (isset($_GET['checkout']) and in_array($_GET['checkout'], ['automatic', 'manual'], true)) { $checkout = $_GET['checkout']; } if ($_title == "Room Booking") { $roomBooking = new RoomBookingController(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(getUser()->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Razorpay'; $information['type'] = 'online'; $booking_details = $roomBooking->storeData($request, $information); $request->session()->put('bookingId', $booking_details->id); $data = [ "key" => $this->keyId, "amount" => $_amount, "name" => $_title, "description" => $_description, "prefill" => [ "name" => $request->customer_name, "email" => $request->customer_email, "contact" => $request->customer_phone, ], "notes" => [ "address" => $request->razorpay_address, "merchant_order_id" => $_item_number, ], "theme" => [ "color" => "{{$bs->base_color}}" ], "order_id" => $razorpayOrder['id'], ]; $displayCurrency = $currencyInfo->base_currency_text; } else { $data = [ "key" => $this->keyId, "amount" => $_amount, "name" => $_title, "description" => $_description, "prefill" => [ "name" => $request->billing_fname, "email" => $request->billing_email, "contact" => $request->billing_number, ], "notes" => [ "address" => $request->razorpay_address, "merchant_order_id" => $_item_number, ], "theme" => [ "color" => "{{$bs->base_color}}" ], "order_id" => $razorpayOrder['id'], ]; if ($bs->base_currency_text !== 'INR') { $data['display_currency'] = $bs->base_currency_text; $data['display_amount'] = $displayAmount; } $displayCurrency = $bs->base_currency_text; } $json = json_encode($data); // dd('wait ', $json, $data, $displayCurrency, $notify_url); return view('user-front.razorpay', compact('data', 'displayCurrency', 'json', 'notify_url')); } public function successPayment(Request $request) { $requestData = Session::get('user_request'); $user = getUser(); $be = BasicSetting::where('user_id', $user->id)->firstorFail(); /** Get the payment ID before session clear **/ $payment_id = Session::get('user_order_payment_id'); $success = true; if (empty($request['razorpay_payment_id']) === false) { try { $attributes = array( 'razorpay_order_id' => $payment_id, 'razorpay_payment_id' => $request['razorpay_payment_id'], 'razorpay_signature' => $request['razorpay_signature'] ); $this->api->utility->verifyPaymentSignature($attributes); } catch (SignatureVerificationError $e) { $success = false; } } if ($success === true) { if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); // dd($requestData, $bookingInfo); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); // remove all session data $request->session()->forget('bookingId'); // dd('ok'); } else { $txnId = UserPermissionHelper::uniqidReal(8); $chargeId = $request->paymentId; $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', __('successful_payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if (in_array('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } return redirect()->route('front.user.pricing', getParam()); } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('front.user.pricing', getParam()); } } Http/Controllers/User/Payment/AuthorizenetController.php 0000644 00000010770 15213350434 0017567 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Omnipay\Omnipay; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Session; class AuthorizenetController extends Controller { use MiscellaneousTrait; public $gateway; public function __construct() { $data = UserPaymentGeteway::whereKeyword('Authorize.net')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); $this->gateway = Omnipay::create('AuthorizeNetApi_Api'); $this->gateway->setAuthName($paydata['login_id']); $this->gateway->setTransactionKey($paydata['transaction_key']); if ($paydata['sandbox_check'] == 1) { $this->gateway->setTestMode(true); } } public function paymentProcess(Request $request, $_amount, $_cancel_url, $_title, $be) { $keywords = getUserKeywords(); if ($request->opaqueDataDescriptor && $request->opaqueDataValue) { Session::put('user_request', $request->all()); // Generate a unique merchant site transaction ID. $transactionId = rand(100000000, 999999999); $response = $this->gateway->authorize([ 'amount' => $_amount, 'currency' => $be->base_currency_text, 'transactionId' => $transactionId, 'opaqueDataDescriptor' => $request->opaqueDataDescriptor, 'opaqueDataValue' => $request->opaqueDataValue, ])->send(); $transactionReference = $response->getTransactionReference(); $response = $this->gateway->capture([ 'amount' => $_amount, 'currency' => $be->base_currency_text, 'transactionReference' => $transactionReference, ])->send(); $transaction_id = $response->getTransactionReference(); // Insert transaction data into the database $requestData = Session::get('user_request'); if ($_title == "Room Booking") { $roomBooking = new RoomBookingController(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(getUser()->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Authorize.net'; $information['type'] = 'online'; $booking_details = $roomBooking->storeData($request, $information); $bookingInfo = $booking_details; $bookingInfo->update(['payment_status' => 1]); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); } else { $transaction_id = $transaction_id; $txnId = $transaction_id; $chargeId = $request->paymentId; $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if ($_title == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } else { return redirect($_cancel_url); } } public function cancelPayment() { $keywords = getUserKeywords(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.pricing', getParam()); } } Http/Controllers/User/Payment/PaytmController.php 0000644 00000036617 15213350434 0016210 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Config; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use Anand\LaravelPaytmWallet\Facades\PaytmWallet; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; class PaytmController extends Controller { public function __construct() { $data = UserPaymentGeteway::whereKeyword('paytm')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); Config::set('services.paytm-wallet.env', $paydata['environment']); Config::set('services.paytm-wallet.merchant_id', $paydata['merchant']); Config::set('services.paytm-wallet.merchant_key', $paydata['secret']); Config::set('services.paytm-wallet.merchant_website', $paydata['website']); Config::set('services.paytm-wallet.industry_type', $paydata['industry']); } public function paymentProcess(Request $request, $_amount, $_item_number, $_callback_url, $title = NULL) { $payment = PaytmWallet::with('receive'); // dd($request->all()); if ($title == 'Room Booking') { $payment->prepare([ 'order' => time(), 'user' => uniqid(), 'mobile_number' => $request->customer_phone, 'email' => $request->customer_email, 'amount' => round($_amount, 2), 'callback_url' => $_callback_url ]); } else { $payment->prepare([ 'order' => time(), 'user' => Auth::guard('customer')->user()->id, 'mobile_number' => $request->billing_number, 'email' => $request->billing_email, 'amount' => round($_amount, 2), 'callback_url' => $_callback_url ]); } Session::put("user_request", $request->all()); return $payment->receive(); } public function handlePaytmRequest($_item_number, $amount, $callback_url) { $data = UserPaymentGeteway::whereKeyword('paytm')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); // Load all functions of encdec_paytm.php and config-paytm.php $this->getAllEncdecFunc(); // $this->getConfigPaytmSettings(); $checkSum = ""; $paramList = array(); // Create an array having all required parameters for creating checksum. $paramList["MID"] = $paydata['merchant']; $paramList["ORDER_ID"] = $_item_number; $paramList["CUST_ID"] = $_item_number; $paramList["INDUSTRY_TYPE_ID"] = $paydata['industry']; $paramList["CHANNEL_ID"] = 'WEB'; $paramList["TXN_AMOUNT"] = $amount; $paramList["WEBSITE"] = $paydata['website']; $paramList["CALLBACK_URL"] = $callback_url; $paytm_merchant_key = $paydata['secret']; //Here checksum string will return by getChecksumFromArray() function. $checkSum = getChecksumFromArray($paramList, $paytm_merchant_key); return array( 'checkSum' => $checkSum, 'paramList' => $paramList ); } function getAllEncdecFunc() { function encrypt_e($input, $ky) { $key = html_entity_decode($ky); $iv = "@@@@&&&&####$$$$"; $data = openssl_encrypt($input, "AES-128-CBC", $key, 0, $iv); return $data; } function decrypt_e($crypt, $ky) { $key = html_entity_decode($ky); $iv = "@@@@&&&&####$$$$"; $data = openssl_decrypt($crypt, "AES-128-CBC", $key, 0, $iv); return $data; } function pkcs5_pad_e($text, $blocksize) { $pad = $blocksize - (strlen($text) % $blocksize); return $text . str_repeat(chr($pad), $pad); } function pkcs5_unpad_e($text) { $pad = ord($text[strlen($text) - 1]); if ($pad > strlen($text)) return false; return substr($text, 0, -1 * $pad); } function generateSalt_e($length) { $random = ""; srand((float)microtime() * 1000000); $data = "AbcDE123IJKLMN67QRSTUVWXYZ"; $data .= "aBCdefghijklmn123opq45rs67tuv89wxyz"; $data .= "0FGH45OP89"; for ($i = 0; $i < $length; $i++) { $random .= substr($data, (rand() % (strlen($data))), 1); } return $random; } function checkString_e($value) { if ($value == 'null') $value = ''; return $value; } function getChecksumFromArray($arrayList, $key, $sort = 1) { if ($sort != 0) { ksort($arrayList); } $str = getArray2Str($arrayList); $salt = generateSalt_e(4); $finalString = $str . "|" . $salt; $hash = hash("sha256", $finalString); $hashString = $hash . $salt; $checksum = encrypt_e($hashString, $key); return $checksum; } function getChecksumFromString($str, $key) { $salt = generateSalt_e(4); $finalString = $str . "|" . $salt; $hash = hash("sha256", $finalString); $hashString = $hash . $salt; $checksum = encrypt_e($hashString, $key); return $checksum; } function verifychecksum_e($arrayList, $key, $checksumvalue) { $arrayList = removeCheckSumParam($arrayList); ksort($arrayList); $str = getArray2StrForVerify($arrayList); $paytm_hash = decrypt_e($checksumvalue, $key); $salt = substr($paytm_hash, -4); $finalString = $str . "|" . $salt; $website_hash = hash("sha256", $finalString); $website_hash .= $salt; $validFlag = "FALSE"; if ($website_hash == $paytm_hash) { $validFlag = "TRUE"; } else { $validFlag = "FALSE"; } return $validFlag; } function verifychecksum_eFromStr($str, $key, $checksumvalue) { $paytm_hash = decrypt_e($checksumvalue, $key); $salt = substr($paytm_hash, -4); $finalString = $str . "|" . $salt; $website_hash = hash("sha256", $finalString); $website_hash .= $salt; $validFlag = "FALSE"; if ($website_hash == $paytm_hash) { $validFlag = "TRUE"; } else { $validFlag = "FALSE"; } return $validFlag; } function getArray2Str($arrayList) { $findme = 'REFUND'; $findmepipe = '|'; $paramStr = ""; $flag = 1; foreach ($arrayList as $key => $value) { $pos = strpos($value, $findme); $pospipe = strpos($value, $findmepipe); if ($pos !== false || $pospipe !== false) { continue; } if ($flag) { $paramStr .= checkString_e($value); $flag = 0; } else { $paramStr .= "|" . checkString_e($value); } } return $paramStr; } function getArray2StrForVerify($arrayList) { $paramStr = ""; $flag = 1; foreach ($arrayList as $key => $value) { if ($flag) { $paramStr .= checkString_e($value); $flag = 0; } else { $paramStr .= "|" . checkString_e($value); } } return $paramStr; } function redirect2PG($paramList, $key) { $hashString = getchecksumFromArray($paramList, $key); $checksum = encrypt_e($hashString, $key); } function removeCheckSumParam($arrayList) { if (isset($arrayList["CHECKSUMHASH"])) { unset($arrayList["CHECKSUMHASH"]); } return $arrayList; } function getTxnStatus($requestParamList) { return callAPI(PAYTM_STATUS_QUERY_URL, $requestParamList); } function getTxnStatusNew($requestParamList) { return callNewAPI(PAYTM_STATUS_QUERY_NEW_URL, $requestParamList); } function initiateTxnRefund($requestParamList) { $CHECKSUM = getRefundChecksumFromArray($requestParamList, PAYTM_MERCHANT_KEY, 0); $requestParamList["CHECKSUM"] = $CHECKSUM; return callAPI(PAYTM_REFUND_URL, $requestParamList); } function callAPI($apiURL, $requestParamList) { $jsonResponse = ""; $responseParamList = array(); $JsonData = json_encode($requestParamList); $postData = 'JsonData=' . urlencode($JsonData); $ch = curl_init($apiURL); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($postData) ) ); $jsonResponse = curl_exec($ch); $responseParamList = json_decode($jsonResponse, true); return $responseParamList; } function callNewAPI($apiURL, $requestParamList) { $jsonResponse = ""; $responseParamList = array(); $JsonData = json_encode($requestParamList); $postData = 'JsonData=' . urlencode($JsonData); $ch = curl_init($apiURL); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($postData) ) ); $jsonResponse = curl_exec($ch); $responseParamList = json_decode($jsonResponse, true); return $responseParamList; } function getRefundChecksumFromArray($arrayList, $key, $sort = 1) { if ($sort != 0) { ksort($arrayList); } $str = getRefundArray2Str($arrayList); $salt = generateSalt_e(4); $finalString = $str . "|" . $salt; $hash = hash("sha256", $finalString); $hashString = $hash . $salt; $checksum = encrypt_e($hashString, $key); return $checksum; } function getRefundArray2Str($arrayList) { $findmepipe = '|'; $paramStr = ""; $flag = 1; foreach ($arrayList as $key => $value) { $pospipe = strpos($value, $findmepipe); if ($pospipe !== false) { continue; } if ($flag) { $paramStr .= checkString_e($value); $flag = 0; } else { $paramStr .= "|" . checkString_e($value); } } return $paramStr; } function callRefundAPI($refundApiURL, $requestParamList) { $jsonResponse = ""; $responseParamList = array(); $JsonData = json_encode($requestParamList); $postData = 'JsonData=' . urlencode($JsonData); $ch = curl_init($refundApiURL); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $refundApiURL); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $headers = array(); $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $jsonResponse = curl_exec($ch); return json_decode($jsonResponse, true); } } public function paymentStatus(Request $request) { $keywords = getUserKeywords(); $transaction = PaytmWallet::with('receive'); $response = $transaction->response(); // To get raw response as array $requestData = Session::get('user_request'); $transaction->getResponseMessage(); //Get Response Message If Available //get important parameters via public methods $transaction->getOrderId(); // Get order id $transaction->getTransactionId(); // Get transaction id if ($transaction->isSuccessful()) { $user = getUser(); $title = Session::get('payment_title'); if ($title == "Room Booking") { $bookingId = $request->session()->get('bookingId'); // update the payment status for room booking in database $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); // remove all session data session()->forget('bookingId'); session()->forget('payment_title'); } else { $txnId = UserPermissionHelper::uniqidReal(8); $chargeId = $request->paymentId; $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if ($title == 'Room Booking') { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } else { session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.pricing', getParam()); } } } Http/Controllers/User/Payment/PaytabsController.php 0000644 00000013055 15213350434 0016510 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use Illuminate\Support\Facades\Session; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Http; class PaytabsController extends Controller { public function paymentProcess(Request $request, $_amount, $_title, $_success_url) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Paytabs'; $information['type'] = 'online'; $title = $_title; $roomBooking = new RoomBookingController(); if ($title == "Room Booking") { $description = 'Room booking via paytabs'; } else { $description = 'Product Purchase via paytabs'; } Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paytabInfo = paytabInfo('user', $user->id); try { $response = Http::withHeaders([ 'Authorization' => $paytabInfo['server_key'], // Server Key 'Content-Type' => 'application/json', ])->post( $paytabInfo['url'], [ 'profile_id' => $paytabInfo['profile_id'], // Profile ID 'tran_type' => 'sale', 'tran_class' => 'ecom', 'cart_id' => uniqid(), 'cart_description' => $description, 'cart_currency' => $paytabInfo['currency'], // set currency by region 'cart_amount' => round($_amount, 2), 'return' => $_success_url, ] ); $responseData = $response->json(); // put some data in session before redirect to paytm url return redirect()->to($responseData['redirect_url']); } catch (\Exception $e) { if (array_key_exists('title', $request->all()) && $request['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } return redirect($cancel_url); } } // return to success page public function successPayment(Request $request) { $requestData = Session::get('user_request'); $keywords = getUserKeywords(); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } $resp = $request->all(); if ($resp['respStatus'] == "A" && $resp['respMessage'] == 'Authorised') { $txnId = $request->transactionId; $chargeId = $request->transactionId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } else { session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect($cancel_url); } } } Http/Controllers/User/Payment/MidtransController.php 0000644 00000015275 15213350434 0016674 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use Illuminate\Support\Facades\Session; use App\Models\User\UserPaymentGeteway; use Midtrans\Snap; use Midtrans\Config as MidtransConfig; class MidtransController extends Controller { public function paymentProcess(Request $request, $_amount, $_title, $_success_url) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Midtrans'; $information['type'] = 'online'; $title = $_title; $roomBooking = new RoomBookingController(); $data = []; if ($title == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); $name = $request->billing_fname . ' ' . $request->billing_lname; $phone = $request->billing_number; $email = $request->billing_email; $data['title'] = "Room Booking via midtrans"; $midtrans_success_url = route('customer.success.page', [getParam(), 'room-booking']); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); $name = $request->billing_fname . ' ' . $request->billing_lname; $phone = $request->billing_number; $email = $request->billing_email; $data['title'] = "Product Purchase via midtrans"; $midtrans_success_url = route('customer.success.page', [getParam()]); } Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'midtrans']])->first(); $paydata = $paymentMethod->convertAutoData(); // will come from database MidtransConfig::$serverKey = $paydata['server_key']; MidtransConfig::$isProduction = $paydata['is_production'] == 0 ? true : false; MidtransConfig::$isSanitized = true; MidtransConfig::$is3ds = true; $token = uniqid(); Session::put('token', $token); $params = [ 'transaction_details' => [ 'order_id' => $token, 'gross_amount' => $_amount * 1000, // will be multiplied by 1000 ], 'customer_details' => [ 'first_name' => $name, 'email' => $email, 'phone' => $phone, ], ]; $snapToken = Snap::getSnapToken($params); // put some data in session before redirect to midtrans url if ( $paydata['is_production'] == 1 ) { $is_production = $paydata['is_production']; } $data['snapToken'] = $snapToken; $data['is_production'] = $is_production; $data['success_url'] = $_success_url; $data['_cancel_url'] = $cancel_url; $data['client_key'] = $paydata['server_key']; //put data into session for midtrans bank notify Session::put('user_midtrans', $user); Session::put('midtrans_payment_type', 'shop_room'); Session::put('midtrans_cancel_url', $cancel_url); Session::put('midtrans_success_url', $midtrans_success_url); //dummy url set to session Session::put('order_details_url', route('customer.orders-details', ['id' => 1, getParam()])); return view('payments.midtrans-membership', $data); } // return to success page public function successPayment(Request $request) { $requestData = Session::get('user_request'); $keywords = getUserKeywords(); $token = Session::get('token'); if ($request->status_code == 200 && $token == $request->order_id) { $txnId = $request->transactionId; $chargeId = $request->transactionId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_midtrans'); Session::forget('midtrans_payment_type'); Session::forget('order_details_url'); Session::forget('midtrans_cancel_url'); Session::forget('midtrans_success_url'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } else { session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect(Session::get('midtrans_cancel_url')); } } } Http/Controllers/User/Payment/MercadopagoController.php 0000644 00000016470 15213350434 0017332 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Carbon\Carbon; use App\Models\Package; use App\Models\Language; use Illuminate\Http\Request; use App\Http\Helpers\MegaMailer; use App\Models\User\UserPackage; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Http\Controllers\Front\CheckoutController; use App\Http\Controllers\Front\RoomBookingController; use App\Http\Controllers\Front\UserCheckoutController; use App\Models\User\HotelBooking\RoomBooking; use App\Traits\MiscellaneousTrait; class MercadopagoController extends Controller { use MiscellaneousTrait; private $access_token; private $sandbox; public function __construct() { $data = UserPaymentGeteway::whereKeyword('mercadopago')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); $this->access_token = $paydata['token']; $this->sandbox = $paydata['sandbox_check']; } public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url, $email, $_title, $_description, $bex) { $return_url = $_success_url; $cancel_url = $_cancel_url; $notify_url = $_success_url; // dd($return_url, $cancel_url, $notify_url); $curl = curl_init(); $preferenceData = [ 'items' => [ [ 'id' => uniqid("mercadopago-"), 'title' => $_title, 'description' => $_description, 'quantity' => 1, 'currency_id' => "BRL", //unfortunately mercadopago only support BRL currency 'unit_price' => round($_amount, 2), //5.53 BRL = 1 USD ] ], 'payer' => [ 'email' => $email, ], 'back_urls' => [ 'success' => $return_url, 'pending' => '', 'failure' => $cancel_url, ], 'notification_url' => $notify_url, 'auto_return' => 'approved', ]; $httpHeader = [ "Content-Type: application/json", ]; $url = "https://api.mercadopago.com/checkout/preferences?access_token=" . $this->access_token; $opts = [ CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode($preferenceData, true), CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => $httpHeader ]; curl_setopt_array($curl, $opts); $response = curl_exec($curl); $payment = json_decode($response, true); $err = curl_error($curl); curl_close($curl); // dd($payment); // store room booking information if ($_title == "Room Booking") { $roomBooking = new RoomBookingController(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(getUser()->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'MercadoPago'; $information['type'] = 'online'; $booking_details = $roomBooking->storeData($request, $information); $request->session()->put('bookingId', $booking_details->id); } Session::put('user_request', $request->all()); Session::put('user_success_url', $_success_url); Session::put('user_cancel_url', $_cancel_url); if ($this->sandbox == 1) { return redirect($payment['sandbox_init_point']); } else { return redirect($payment['init_point']); } } public function curlCalls($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $paymentData = curl_exec($ch); curl_close($ch); return $paymentData; } public function paycancle() { return redirect()->back()->with('error', 'Payment Cancelled.'); } public function payreturn() { if (Session::has('tempcart')) { $oldCart = Session::get('tempcart'); $tempcart = new Cart($oldCart); $order = Session::get('temporder'); } else { $tempcart = ''; return redirect()->back(); } return view('front.success', compact('tempcart', 'order')); } public function successPayment(Request $request) { $requestData = Session::get('user_request'); $user = getUser(); $bs = BasicSetting::where('user_id', $user->id)->firstorFail(); $success_url = Session::get('user_success_url'); $cancel_url = Session::get('user_cancel_url'); $paymentUrl = "https://api.mercadopago.com/v1/payments/" . $request['payment_id'] . "?access_token=" . $this->access_token; $paymentData = $this->curlCalls($paymentUrl); $payment = json_decode($paymentData, true); if ($payment['status'] == 'approved') { if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); // remove all session data $request->session()->forget('bookingId'); } else { $txnId = UserPermissionHelper::uniqidReal(8); $chargeId = $request->paymentId; $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', __('successful_payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if (in_array('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } return redirect($cancel_url); } public function cancelPayment() { session()->flash('warning', __('cancel_payment')); return redirect()->route('front.user.pricing', getParam()); } } Http/Controllers/User/Payment/PerfectMoneyController.php 0000644 00000013465 15213350434 0017512 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use App\Models\User\UserPaymentGeteway; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\BasicSetting; use Illuminate\Support\Facades\Session; use App\Models\User\HotelBooking\RoomBooking; class PerfectMoneyController extends Controller { public function paymentProcess(Request $request, $_amount, $_title, $_success_url, $_cancel_url) { /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =============== Booking Info ========== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $userBs = BasicSetting::select('website_title')->where('user_id', $user->id)->first(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $title = $_title; // $_amount = 0.01; //if test $roomBooking = new RoomBookingController(); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Perfect Money'; $information['type'] = 'online'; $memo_name = $request->title == 'Room Booking' ? $request->customer_email : $request->billing_email; if ($request->title == 'Room Booking') { $_cancel_url = route('front.user.room_booking.cancel', getParam()); } Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ============== Payment info ================= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where('keyword', 'perfect_money')->first(); $paydata = $paymentMethod->convertAutoData(); $notify_url = $_success_url; $randomNo = substr(uniqid(), 0, 8); $val['PAYEE_ACCOUNT'] = $paydata['perfect_money_wallet_id'];; $val['PAYEE_NAME'] = $userBs->website_title; $val['PAYMENT_ID'] = "$randomNo"; //random id $val['PAYMENT_AMOUNT'] = $_amount; $val['PAYMENT_UNITS'] = "$currencyInfo->base_currency_text"; $val['STATUS_URL'] = $_success_url; $val['PAYMENT_URL'] = $_success_url; $val['PAYMENT_URL_METHOD'] = 'GET'; $val['NOPAYMENT_URL'] = $_cancel_url; $val['NOPAYMENT_URL_METHOD'] = 'GET'; $val['SUGGESTED_MEMO'] = "$memo_name"; $val['BAGGAGE_FIELDS'] = 'IDENT'; $data['val'] = $val; $data['method'] = 'post'; $data['url'] = 'https://perfectmoney.com/api/step1.asp'; Session::put('payment_id', $randomNo); Session::put('cancel_url', $_cancel_url); Session::put('amount', $_amount); return view('payments.perfect-money', compact('data')); } public function successPayment(Request $request) { $requestData = Session::get('user_request'); $keywords = getUserKeywords(); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } $amo = $request['PAYMENT_AMOUNT']; $track = $request['PAYMENT_ID']; $id = Session::get('payment_id'); $final_amount = Session::get('amount'); $paymentMethod = UserPaymentGeteway::where('keyword', 'perfect_money')->first(); $perfectMoneyInfo = $paymentMethod->convertAutoData(); if ($request->PAYEE_ACCOUNT == $perfectMoneyInfo['perfect_money_wallet_id'] && $track == $id && $amo == round($final_amount, 2)) { $txnId = $request->transactionId; $chargeId = $request->transactionId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } return redirect($cancel_url); } public function cancelPayment() { $keywords = getUserKeywords(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.checkout', getParam()); } } Http/Controllers/User/Payment/XenditController.php 0000644 00000013376 15213350434 0016346 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use App\Models\User\UserPaymentGeteway; use Illuminate\Http\Request; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use Illuminate\Support\Facades\Session; class XenditController extends Controller { public function paymentProcess(Request $request, $_amount, $_title, $_success_url) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Xendit'; $information['type'] = 'online'; $title = $_title; $roomBooking = new RoomBookingController(); Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'xendit']])->first(); $paydata = json_decode($paymentMethod->information, true); $external_id = Str::random(10); $secret_key = 'Basic ' . base64_encode($paydata['secret_key'] . ':'); $data_request = Http::withHeaders([ 'Authorization' => $secret_key ])->post('https://api.xendit.co/v2/invoices', [ 'external_id' => $external_id, 'amount' => $_amount, 'currency' => $currencyInfo->base_currency_text, 'success_redirect_url' => $_success_url ]); $response = $data_request->object(); $response = json_decode(json_encode($response), true); if (!empty($response['success_redirect_url'])) { $request->session()->put('xendit_id', $response['id']); $request->session()->put('secret_key', $secret_key); return redirect($response['invoice_url']); } else { if (array_key_exists('title', $request->all()) && $request['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } return redirect($cancel_url); } } // return to success page public function successPayment(Request $request) { $requestData = Session::get('user_request'); $keywords = getUserKeywords(); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } $user = getUser(); $xendit_id = Session::get('xendit_id'); $secret_key = Session::get('secret_key'); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'xendit']])->first(); $paydata = json_decode($paymentMethod->information, true); $p_secret_key = 'Basic ' . base64_encode($paydata['secret_key'] . ':'); if (!is_null($xendit_id) && $secret_key == $p_secret_key) { $txnId = $request->transactionId; $chargeId = $request->transactionId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } else { $keywords = getUserKeywords(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect($cancel_url); } } } Http/Controllers/User/Payment/IyzicoController.php 0000644 00000021173 15213350434 0016353 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use Illuminate\Support\Facades\Session; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Http; class IyzicoController extends Controller { public function paymentProcess(Request $request, $_amount, $_title, $_success_url) { $user_request = $request->all(); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Iyzico'; $information['type'] = 'online'; $title = $_title; $roomBooking = new RoomBookingController(); $conversion_id = uniqid(9999, 999999); if ($title == "Room Booking") { $information['conversation_id'] = $conversion_id; // store the room booking information in database $booking_details = $roomBooking->storeData($request, $information); Session::put('bookingId', $booking_details->id); $first_name = $user_request['customer_name']; $last_name = $user_request['customer_name']; $email = $user_request['customer_email']; $address = $user_request['address']; $city = $user_request['city']; $country = $user_request['country']; $number = $user_request['customer_phone']; } else { $first_name = $user_request['billing_fname']; $last_name = $user_request['billing_lname']; $email = $user_request['billing_email']; $address = $user_request['billing_address']; $city = $user_request['billing_city']; $country = $user_request['billing_country']; $number = $request['shpping_number']; } $zip_code = $user_request['zip_code']; $identity_number = $user_request['identity_number']; $basket_id = 'B' . uniqid(999, 99999); Session::put('user_request', $user_request); Session::put('user_amount', $_amount); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'iyzico']])->first(); $paydata = json_decode($paymentMethod->information, true); $options = new \Iyzipay\Options(); $options->setApiKey($paydata['api_key']); $options->setSecretKey($paydata['secret_key']); if ($paydata['sandbox_status'] == 1) { $options->setBaseUrl("https://sandbox-api.iyzipay.com"); } else { $options->setBaseUrl("https://api.iyzipay.com"); // production mode } # create request class $request = new \Iyzipay\Request\CreatePayWithIyzicoInitializeRequest(); $request->setLocale(\Iyzipay\Model\Locale::EN); $request->setConversationId($conversion_id); $request->setPrice($_amount); $request->setPaidPrice($_amount); $request->setCurrency(\Iyzipay\Model\Currency::TL); $request->setBasketId($basket_id); $request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT); $request->setCallbackUrl($_success_url); $request->setEnabledInstallments(array(2, 3, 6, 9)); $buyer = new \Iyzipay\Model\Buyer(); $buyer->setId(uniqid()); $buyer->setName($first_name); $buyer->setSurname($last_name); $buyer->setGsmNumber($number); $buyer->setEmail($email); $buyer->setIdentityNumber($identity_number); $buyer->setLastLoginDate(""); $buyer->setRegistrationDate(""); $buyer->setRegistrationAddress($address); $buyer->setIp(""); $buyer->setCity($city); $buyer->setCountry($country); $buyer->setZipCode($zip_code); $request->setBuyer($buyer); $shippingAddress = new \Iyzipay\Model\Address(); $shippingAddress->setContactName($first_name); $shippingAddress->setCity($city); $shippingAddress->setCountry($country); $shippingAddress->setAddress($address); $shippingAddress->setZipCode($zip_code); $request->setShippingAddress($shippingAddress); $billingAddress = new \Iyzipay\Model\Address(); $billingAddress->setContactName($first_name); $billingAddress->setCity($city); $billingAddress->setCountry($country); $billingAddress->setAddress($address); $billingAddress->setZipCode($zip_code); $request->setBillingAddress($billingAddress); $q_id = uniqid(999, 99999); $basketItems = array(); $firstBasketItem = new \Iyzipay\Model\BasketItem(); $firstBasketItem->setId($q_id); $firstBasketItem->setName("Purchase Id " . $q_id); $firstBasketItem->setCategory1("Purchase or Booking"); $firstBasketItem->setCategory2(""); $firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL); $firstBasketItem->setPrice($_amount); $basketItems[0] = $firstBasketItem; $request->setBasketItems($basketItems); # make request $payWithIyzicoInitialize = \Iyzipay\Model\PayWithIyzicoInitialize::create($request, $options); $paymentResponse = (array)$payWithIyzicoInitialize; foreach ($paymentResponse as $key => $data) { $paymentInfo = json_decode($data, true); if ($paymentInfo['status'] == 'success') { if (!empty($paymentInfo['payWithIyzicoPageUrl'])) { Session::put('conversation_id', $conversion_id); return redirect($paymentInfo['payWithIyzicoPageUrl']); } } if (array_key_exists('title', $user_request) && $request['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } return redirect($cancel_url); } } // return to success page public function successPayment(Request $request) { $keywords = getUserKeywords(); $requestData = Session::get('user_request'); if (!empty($requestData)) { $txnId = Session::get('conversation_id'); $chargeId = Session::get('conversation_id'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Pending'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('conversation_id'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } } } Http/Controllers/User/Payment/InstamojoController.php 0000644 00000011560 15213350434 0017047 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Instamojo\Instamojo; use Illuminate\Http\Request; use App\Models\User\BasicSetting; use PHPMailer\PHPMailer\Exception; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Models\User\HotelBooking\RoomBooking; use App\Traits\MiscellaneousTrait; class InstamojoController extends Controller { use MiscellaneousTrait; public function paymentProcess(Request $request, $_amount, $_success_url, $_cancel_url, $_title, $bex) { $data = UserPaymentGeteway::whereKeyword('instamojo')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); $cancel_url = $_cancel_url; $notify_url = $_success_url; if ($paydata['sandbox_check'] == 1) { $api = new Instamojo($paydata['key'], $paydata['token'], 'https://test.instamojo.com/api/1.1/'); } else { $api = new Instamojo($paydata['key'], $paydata['token']); } if ($_title == 'Room Booking') { $roomBooking = new RoomBookingController(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(getUser()->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Instamojo'; $information['type'] = 'online'; $booking_details = $roomBooking->storeData($request, $information); $request->session()->put('bookingId', $booking_details->id); } try { $response = $api->paymentRequestCreate(array( "purpose" => $_title, "amount" => $_amount, "send_email" => false, "email" => null, "redirect_url" => $notify_url )); $redirect_url = $response['longurl']; Session::put("user_request", $request->all()); Session::put('user_payment_id', $response['id']); Session::put('user_success_url', $notify_url); Session::put('user_cancel_url', $cancel_url); return redirect($redirect_url); } catch (Exception $e) { return redirect($cancel_url)->with('error', 'Error: ' . $e->getMessage()); } } public function successPayment(Request $request) { $requestData = Session::get('user_request'); $user = getUser(); $keywords = getUserKeywords(); $be = BasicSetting::where('user_id', $user->id)->firstorFail(); $success_url = Session::get('user_success_url'); $cancel_url = Session::get('user_cancel_url'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); session()->forget('bookingId'); } else { /** Get the payment ID before session clear **/ $txnId = UserPermissionHelper::uniqidReal(8); $chargeId = $request->paymentId; $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if (in_array('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); return redirect($cancel_url); } public function cancelPayment() { $keywords = getUserKeywords(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.pricing', getParam()); } } Http/Controllers/User/Payment/PaypalController.php 0000644 00000017744 15213350434 0016344 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Redirect; use Carbon\Carbon; use PayPal\Api\Item; use PayPal\Api\Payer; use PayPal\Api\Amount; use PayPal\Api\Payment; use PayPal\Api\ItemList; use PayPal\Api\Transaction; use PayPal\Rest\ApiContext; use Illuminate\Http\Request; use PayPal\Api\RedirectUrls; use PayPal\Api\PaymentExecution; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use PayPal\Auth\OAuthTokenCredential; use Illuminate\Support\Facades\Config; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Session; class PaypalController extends Controller { private $_api_context; use MiscellaneousTrait; public function __construct() { $data = UserPaymentGeteway::whereKeyword('paypal')->where('user_id', getUser()->id)->first(); $paydata = $data->convertAutoData(); $paypal_conf = Config::get('paypal'); $paypal_conf['client_id'] = $paydata['client_id'] ?? ''; $paypal_conf['secret'] = $paydata['client_secret'] ?? ''; $paypal_conf['settings']['mode'] = $paydata['sandbox_check'] == 1 ? 'sandbox' : 'live'; $this->_api_context = new ApiContext( new OAuthTokenCredential( $paypal_conf['client_id'], $paypal_conf['secret'] ) ); $this->_api_context->setConfig($paypal_conf['settings']); } public function paymentProcess(Request $request, $_amount, $_title, $_success_url, $_cancel_url) { $title = $_title; $price = $_amount; $price = round($price, 2); $cancel_url = $_cancel_url; $success_url = $_success_url; $roomBooking = new RoomBookingController(); // do calculation // $calculatedData = $roomBooking->calculation($request); // $title = 'Room Booking'; $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'PayPal'; $information['type'] = 'online'; // changing the currency before redirect to PayPal if ($currencyInfo->base_currency_text !== 'USD') { $rate = $currencyInfo->base_currency_rate; $convertedTotal = $price / $rate; } $price = $currencyInfo->base_currency_text === 'USD' ? $price : $convertedTotal; $payer = new Payer(); $payer->setPaymentMethod('paypal'); $item_1 = new Item(); $item_1->setName($title) /** item name **/ ->setCurrency("USD") ->setQuantity(1) ->setPrice($price); /** unit price **/ $item_list = new ItemList(); $item_list->setItems(array($item_1)); $amount = new Amount(); $amount->setCurrency("USD") ->setTotal($price); $transaction = new Transaction(); $transaction->setAmount($amount) ->setItemList($item_list) ->setDescription($title . ' Via Paypal'); $redirect_urls = new RedirectUrls(); $redirect_urls->setReturnUrl($success_url) /** Specify return URL **/ ->setCancelUrl($cancel_url); $payment = new Payment(); $payment->setIntent('Sale') ->setPayer($payer) ->setRedirectUrls($redirect_urls) ->setTransactions(array($transaction)); try { $payment->create($this->_api_context); } catch (\PayPal\Exception\PPConnectionException $ex) { return redirect()->back()->with('error', $ex->getMessage()); } foreach ($payment->getLinks() as $link) { if ($link->getRel() == 'approval_url') { $redirect_url = $link->getHref(); break; } } if ($title == "Room Booking") { // store the room booking information in database $booking_details = $roomBooking->storeData($request, $information); Session::put('bookingId', $booking_details->id); } Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); Session::put('user_paypal_payment_id', $payment->getId()); if (isset($redirect_url)) { /** redirect to paypal **/ return Redirect::away($redirect_url); } return redirect()->back()->with('error', 'Unknown error occurred'); } public function successPayment(Request $request) { $keywords = getUserKeywords(); $requestData = Session::get('user_request'); $amount = Session::get('user_amount'); $user = getUser(); $be = BasicSetting::where('user_id', $user->id)->firstorFail(); /** Get the payment ID before session clear **/ $payment_id = Session::get('user_paypal_payment_id'); /** clear the session payment ID **/ if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.paypal.cancel', getParam()); } if (empty($request['PayerID']) || empty($request['token'])) { return redirect($cancel_url); } $payment = Payment::get($payment_id, $this->_api_context); $execution = new PaymentExecution(); $execution->setPayerId($request['PayerID']); /**Execute the payment **/ $result = $payment->execute($execution, $this->_api_context); if ($result->getState() == 'approved') { $resp = json_decode($payment, true); $txnId = $resp['transactions'][0]['related_resources'][0]['sale']['id']; $chargeId = $request->paymentId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->update(['payment_status' => 1]); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if (in_array('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } return redirect($cancel_url); } public function cancelPayment() { $keywords = getUserKeywords(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect()->route('front.user.checkout', getParam()); } } Http/Controllers/User/Payment/YocoController.php 0000644 00000012631 15213350434 0016015 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\RoomBookingController; use App\Models\User\HotelBooking\RoomBooking; use Illuminate\Support\Facades\Session; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Http; class YocoController extends Controller { public function paymentProcess(Request $request, $_amount, $_title, $_success_url) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Yoco'; $information['type'] = 'online'; $title = $_title; Session::put('user_request', $request->all()); Session::put('user_amount', $_amount); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'yoco']])->first(); $paydata = json_decode($paymentMethod->information, true); $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $paydata['secret_key'], ])->post('https://payments.yoco.com/api/checkouts', [ 'amount' => $_amount * 100, 'currency' => 'ZAR', 'successUrl' => $_success_url ]); $responseData = $response->json(); if (array_key_exists('redirectUrl', $responseData)) { $request->session()->put('yoco_id', $responseData['id']); $request->session()->put('s_key', $paydata['secret_key']); return redirect($responseData["redirectUrl"]); } else { if (array_key_exists('title', $request->all()) && $request['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } return redirect($cancel_url); } } // return to success page public function successPayment(Request $request) { $requestData = Session::get('user_request'); $keywords = getUserKeywords(); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $cancel_url = route('front.user.room_booking.cancel', getParam()); } else { $cancel_url = route('customer.itemcheckout.perfect_money.cancel', getParam()); } $user = getUser(); $id = Session::get('yoco_id'); $s_key = Session::get('s_key'); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'yoco']])->first(); $paydata = json_decode($paymentMethod->information, true); if ($id && $paydata['secret_key'] == $s_key) { $txnId = $request->transactionId; $chargeId = $request->transactionId; if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { $bookingId = $request->session()->get('bookingId'); $bookingInfo = RoomBooking::findOrFail($bookingId); $bookingInfo->payment_status = 1; $bookingInfo->save(); $roomBooking = new RoomBookingController(); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->invoice = $invoice; $bookingInfo->save(); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); Session::forget('bookingId'); } else { $order = $this->saveOrder($requestData, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); if (array_key_exists('title', $requestData) && $requestData['title'] == "Room Booking") { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } else { session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel payment')); return redirect($cancel_url); } } } Http/Controllers/User/Payment/StripeController.php 0000644 00000012177 15213350434 0016357 0 ustar 00 <?php namespace App\Http\Controllers\User\Payment; use Illuminate\Http\Request; use App\Models\User\UserPackage; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\RoomBookingController; use Illuminate\Support\Facades\Config; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use Cartalyst\Stripe\Laravel\Facades\Stripe; use App\Http\Controllers\Front\UserCheckoutController; use App\Models\User\HotelBooking\RoomBooking; use App\Traits\MiscellaneousTrait; class StripeController extends Controller { use MiscellaneousTrait; public function __construct() { //Set Spripe Keys $stripe = UserPaymentGeteway::whereKeyword('stripe')->where('user_id', getUser()->id)->first(); $stripeConf = json_decode($stripe->information, true); Config::set('services.stripe.key', $stripeConf["key"]); Config::set('services.stripe.secret', $stripeConf["secret"]); } public function paymentProcess(Request $request, $_amount, $_title, $_success_url, $_cancel_url) { $keywords = getUserKeywords(); $title = $_title; $price = $_amount; $price = round($price, 2); $cancel_url = $_cancel_url; $user = getUser(); if ($title == 'Room Booking') { $roomBooking = new RoomBookingController(); $calculatedData = $roomBooking->calculation($request); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); if ($currencyInfo->base_currency_text !== 'USD') { $rate = $currencyInfo->base_currency_rate; $convertedTotal = round(($calculatedData['total'] / $rate), 2); } $price = $currencyInfo->base_currency_text === 'USD' ? $calculatedData['total'] : $convertedTotal; } Session::put('user_request', $request->all()); $stripe = Stripe::make(Config::get('services.stripe.secret')); $token = $request['stripeToken']; if (!isset($token)) { return back()->with('error', $keywords['stripe_token_error'] ?? __('Token problem with your payment token.')); } if ($price < .5) { $minAmountMsg = $keywords['minimum_amount_error'] ?? __('Amount must be at least {amount} USD.'); return back()->with('error', str_replace('{amount}', '$0.50', $minAmountMsg)); } $charge = $stripe->charges()->create([ 'card' => $token, 'currency' => "USD", 'amount' => $price, 'description' => $title, ]); if ($charge['status'] == 'succeeded') { $txnId = UserPermissionHelper::uniqidReal(8); $chargeId = $request->paymentId; if ($title == 'Room Booking') { $information['currency_symbol'] = $currencyInfo->base_currency_symbol; $information['currency_symbol_position'] = $currencyInfo->base_currency_symbol_position; $information['currency_text'] = $currencyInfo->base_currency_text; $information['currency_text_position'] = $currencyInfo->base_currency_text_position; $information['method'] = 'Stripe'; $information['type'] = 'online'; // store the room booking information in database $booking_details = $roomBooking->storeData($request, $information); // update the payment status for room booking in database $bookingInfo = RoomBooking::findOrFail($booking_details->id); $bookingInfo->update(['payment_status' => 1]); // generate an invoice in pdf format $invoice = $roomBooking->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $roomBooking->sendMail($bookingInfo); } else { $order = $this->saveOrder($request, $txnId, $chargeId, 'Completed'); $order_id = $order->id; $this->saveOrderedItems($order_id); $this->sendMails($order); } session()->flash('success', $keywords['successful_payment'] ?? __('successful payment')); Session::forget('user_request'); Session::forget('user_amount'); Session::forget('user_paypal_payment_id'); if ($title == 'Room Booking') { return redirect()->route('customer.success.page', [getParam(), 'room-booking']); } return redirect()->route('customer.success.page', [getParam()]); } return redirect($cancel_url)->with('error', $keywords['invalid_card_info'] ?? __('Please enter valid credit card information.')); } public function cancelPayment() { $keywords = getUserKeywords(); session()->flash('warning', $keywords['cancel_payment'] ?? __('cancel_payment')); return redirect()->route('front.user.pricing', getParam()); } } Http/Controllers/User/AdvertisementController.php 0000644 00000010612 15213350434 0016276 0 ustar 00 <?php namespace App\Http\Controllers\User; use Illuminate\Http\Request; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use App\Models\User\UserAdvertisement; use Illuminate\Support\Facades\Auth; class AdvertisementController extends Controller { public function index() { $ads = UserAdvertisement::where('user_id', Auth::guard('web')->user()->id)->orderBy('id', 'desc')->get(); return view('user.advertisement.index', compact('ads')); } public function settings() { $data = BasicSetting::where('user_id', Auth::guard('web')->user()->id) ->select('adsense_publisher_id') ->first(); return view('user.advertisement.settings', compact('data')); } public function updateSettings(Request $request) { $request->validate([ 'adsense_publisher_id' => 'required' ]); BasicSetting::where('user_id', Auth::guard('web')->user()->id)->update(['adsense_publisher_id' => $request->adsense_publisher_id]); $request->session()->flash('success', __('Settings updated successfully') . '!'); return back(); } public function store(Request $request) { $request->validate([ 'url' => 'required_if:ad_type,==,banner', 'ad_slot' => 'required_if:ad_type,==,script', 'image' => 'required_if:ad_type,==,banner|mimes:jpeg,jpg,png,svg,gif' ]); if ($request->hasFile('image')) { // get image extension $imageURL = $request->image; $fileExtension = $imageURL->extension(); // set a name for the image and store it to local storage $imageName = time() . '.' . $fileExtension; $directory = './assets/front/img/user/advertisements/'; @mkdir($directory, 0775, true); @copy($imageURL, $directory . $imageName); } UserAdvertisement::create($request->except('image', 'ad_slot') + [ 'image' => $request->hasFile('image') ? $imageName : null, 'ad_slot' => $request->filled('ad_slot') ? $request->ad_slot : null, 'user_id' => Auth::guard('web')->user()->id ]); $request->session()->flash('success', __('New advertisement added successfully') . '!'); return 'success'; } public function update(Request $request) { $ad = UserAdvertisement::find($request->id); $request->validate([ 'url' => 'required_if:ad_type,==,banner', 'ad_slot' => 'required_if:ad_type,==,script' ]); if ($request->hasFile('image') || $request->ad_type === 'script') { // first, delete the previous image from local storage @unlink(public_path('/assets/front/img/user/advertisements/' . $ad->image)); } if ($request->hasFile('image')) { // get image extension $imageURL = $request->image; $fileExtension = $imageURL->extension(); // set a name for the image and store it to local storage $imageName = time() . '.' . $fileExtension; $directory = public_path('assets/front/img/user/advertisements/'); @copy($imageURL, $directory . $imageName); } $ad->update($request->except('image', 'script') + [ 'image' => $request->hasFile('image') ? $imageName : $ad->image, 'ad_slot' => $request->filled('ad_slot') ? $request->ad_slot : $ad->ad_slot ]); $request->session()->flash('success', __('Advertisement updated successfully') . '!'); return 'success'; } public function destroy($id) { $ad = UserAdvertisement::find($id); if ($ad->ad_type == 'banner') { @unlink(public_path('assets/front/img/user/advertisements/' . $ad->image)); } $ad->delete(); return redirect()->back()->with('success', __('Advertisement deleted successfully') . '!'); } public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $ad = UserAdvertisement::find($id); if ($ad->ad_type == 'banner') { @unlink(public_path('assets/front/img/user/advertisements/' . $ad->image)); } $ad->delete(); } $request->session()->flash('success', __('Advertisements deleted successfully') . '!'); return 'success'; } } Http/Controllers/User/HeroStaticController.php 0000644 00000012046 15213350434 0015534 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\BasicSetting; use App\Models\User\HeroStatic; use App\Models\User\Language; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; class HeroStaticController extends Controller { public function staticVersion(Request $request) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } $language = Language::where('code', $request->language) ->where('user_id', $user->id)->first(); $information['language'] = $language; // then, get the static version info of that language from db $information['data'] = HeroStatic::where('language_id', $language->id)->first(); return view('user.home.hero-section.static-version', $information); } public function updateStaticInfo(Request $request, $language): RedirectResponse { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } $rules = [ 'title' => 'required', 'subtitle' => 'sometimes|required', ]; $lang = Language::where('code', $request->language) ->where('user_id', $user->id) ->firstOrFail(); $data = HeroStatic::where('language_id', $lang->id)->where('user_id', $user->id)->first(); if (empty($data->img) && !$request->hasFile('img')) { $rules['img'] = 'required|mimes:jpeg,jpg,png,svg|max:30000'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } $videoLink = $request->secound_btn_url; if (strpos($videoLink, "&") != false) { $videoLink = substr($videoLink, 0, strpos($videoLink, "&")); $request['secound_btn_url'] = $videoLink; } if ($data) { $imgName = $data->img; $img2Name = $data->img2; $img3Name = $data->img3; if ($request->hasFile('img')) { $imgName = Uploader::update_picture('assets/front/img/hero_static/', $request->file('img'), $data->img); } if ($request->hasFile('img2')) { $img2Name = Uploader::update_picture('assets/front/img/hero_static/', $request->file('img2'), $data->img2); } if ($request->hasFile('img3')) { $img3Name = Uploader::update_picture('assets/front/img/hero_static/', $request->file('img3'), $data->img3); } $data->update([ 'img' => $imgName, 'img2' => $img2Name, 'img3' => $img3Name, 'title' => $request->title, 'subtitle' => $request->subtitle, 'btn_name' => $request->btn_name, 'btn_url' => $request->btn_url, 'hero_text' => $request->hero_text, 'secound_btn_name' => $request->secound_btn_name, 'secound_btn_url' => $request->secound_btn_url, 'designation' => $request->designation, 'lower_subtitle' => $request->lower_subtitle, 'toper_subtitle' => $request->toper_subtitle, 'second_title' => $request->second_title, 'second_subtitle' => $request->second_subtitle, 'third_title' => $request->third_title, 'third_subtitle' => $request->third_subtitle, 'third_btn_name' => $request->third_btn_name, 'third_btn_url' => $request->third_btn_url, ]); } else { $data = new HeroStatic; if ($request->hasFile('img')) { $request['image_name'] = Uploader::update_picture('assets/front/img/hero_static/', $request->file('img'), $data->img); } if ($request->hasFile('img2')) { $request['image_name2'] = Uploader::update_picture('assets/front/img/hero_static/', $request->file('img2'), $data->img2); } if ($request->hasFile('img3')) { $request['image_name3'] = Uploader::update_picture('assets/front/img/hero_static/', $request->file('img3'), $data->img3); } $data->create( $request->except('img', 'img2', 'img3', 'user_id', 'language_id') + [ 'img' => $request->image_name, 'img2' => $request->image_name2, 'img3' => $request->image_name3, 'user_id' => Auth::id(), 'language_id' => $lang->id ] ); } session()->flash('success', __('Static info updated successfully') . '!'); return redirect()->back(); } } Http/Controllers/User/EducationController.php 0000644 00000011134 15213350434 0015377 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\Education; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Mews\Purifier\Facades\Purifier; class EducationController extends Controller { /** * Display a listing of the resource. * * */ public function index(Request $request) { if ($request->has('language')) { $lang = Language::where([ ['code', $request->language], ['user_id', Auth::id()] ])->first(); } else { $lang = Language::where([ ['dashboard_default', 1], ['user_id', Auth::id()] ]) ->first(); } $data['educations'] = Education::query() ->where('language_id', $lang->id) ->where('user_id', Auth::id()) ->get(); return view('user.user_education.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $slug = make_slug($request->degree_name); $rules = [ 'user_language_id' => 'required', 'degree_name' => 'required|max:255', 'serial_number' => 'required|integer' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['slug'] = $slug; $input['user_id'] = Auth::id(); $input['language_id'] = $request->user_language_id; $input['short_description'] = Purifier::clean($request->short_description); $education = new Education(); $education->create($input); Session::flash('success', __('Education added successfully') . '!'); return "success"; } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $data['education'] = Education::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); return view('user.user_education.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { $slug = make_slug($request->degree_name); $rules = [ 'degree_name' => 'required|max:255', 'serial_number' => 'required|integer' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $education = Education::findOrFail($request->id); if ($education->user_id != Auth::user()->id) { return; } $input['slug'] = $slug; $input['user_id'] = Auth::id(); $input['short_description'] = Purifier::clean($request->short_description); $education->update($input); Session::flash('success', __('Education updated successfully') . '!'); return "success"; } public function delete(Request $request) { $education = Education::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail(); $education->delete(); Session::flash('success', __('Education deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $education = Education::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); $education->delete(); } Session::flash('success', __('Education deleted successfully') . '!'); return "success"; } } Http/Controllers/User/ItemOrderController.php 0000644 00000047524 15213350435 0015373 0 ustar 00 <?php namespace App\Http\Controllers\User; use Exception; use Carbon\Carbon; use App\Models\Customer; use App\Mail\ContactMail; use Illuminate\Http\Request; use App\Models\BasicExtended; use App\Models\User\UserOrder; use App\Models\User\BasicSetting; use PHPMailer\PHPMailer\PHPMailer; use App\Exports\PorductOrderExport; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Facades\Excel; use Illuminate\Support\Facades\Config; use App\Models\User\UserOfflineGateway; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Mail; class ItemOrderController extends Controller { public function all(Request $request) { $search = $request->search; $data['orders'] = UserOrder::where('user_id', Auth::guard('web')->user()->id)->when($search, function ($query, $search) { return $query->where('order_number', $search); }) ->orderBy('id', 'DESC')->paginate(10); return view('user.item.order.index', $data); } public function pending(Request $request) { $search = $request->search; $data['orders'] = UserOrder::where('user_id', Auth::guard('web')->user()->id)->when($search, function ($query, $search) { return $query->where('order_number', $search); }) ->where('order_status', 'pending')->orderBy('id', 'DESC')->paginate(10); return view('user.item.order.index', $data); } public function processing(Request $request) { $search = $request->search; $data['orders'] = UserOrder::where('user_id', Auth::guard('web')->user()->id)->where('order_status', 'processing') ->when($search, function ($query, $search) { return $query->where('order_number', $search); }) ->orderBy('id', 'DESC')->paginate(10); return view('user.item.order.index', $data); } public function completed(Request $request) { $search = $request->search; $data['orders'] = UserOrder::where('user_id', Auth::guard('web')->user()->id)->where('order_status', 'completed')->when($search, function ($query, $search) { return $query->where('order_number', $search); }) ->orderBy('id', 'DESC')->paginate(10); return view('user.item.order.index', $data); } public function rejected(Request $request) { $search = $request->search; $data['orders'] = UserOrder::where('user_id', Auth::guard('web')->user()->id)->where('order_status', 'rejected')->when($search, function ($query, $search) { return $query->where('order_number', $search); }) ->orderBy('id', 'DESC')->paginate(10); return view('user.item.order.index', $data); } public function status(Request $request) { $po = UserOrder::find($request->order_id); if (($request->order_status != 'rejected') && ($po->payment_status != 'rejected' && $po->order_status != 'rejected')) { } elseif ($request->order_status == 'rejected' && $po->payment_status != 'rejected' && $po->order_status != 'rejected') { foreach ($po->orderitems as $key => $item) { if ($item->variations == 'null' || empty($item->variations)) { // return item quantity if ($item->item->type == 'physical') { $item->item->stock = $item->item->stock + $item->qty; $item->item->save(); } } else { $db_op_stock = []; // return variation quantity $ordered_variations = (array)json_decode($item->variations); foreach ($ordered_variations as $vkey => $vValue) { $db_variation = $item->item->itemVariations()->where('variant_name', $vkey)->first(); $db_op_name = json_decode($db_variation->option_name); $db_op_stock = json_decode($db_variation->option_stock); $okey = array_search($vValue->name, $db_op_name); $db_op_stock[$okey] = $db_op_stock[$okey] + $item->qty; $db_variation->option_stock = json_encode($db_op_stock); $db_variation->save(); } } } } elseif (($request->order_status != 'rejected') && ($po->payment_status != 'rejected' && $po->order_status == 'rejected')) { foreach ($po->orderitems as $key => $item) { if ($item->variations == 'null' || empty($item->variations)) { if ($item->item->type == 'physical') { $item->item->stock = $item->item->stock - $item->qty; $item->item->save(); } } else { $db_op_stock = []; // stock variation quantity $ordered_variations = (array)json_decode($item->variations); foreach ($ordered_variations as $vkey => $vValue) { $db_variation = $item->item->itemVariations()->where('variant_name', $vkey)->first(); $db_op_name = json_decode($db_variation->option_name); $db_op_stock = json_decode($db_variation->option_stock); $okey = array_search($vValue->name, $db_op_name); $db_op_stock[$okey] = $db_op_stock[$okey] - $item->qty; $db_variation->option_stock = json_encode($db_op_stock); $db_variation->save(); } } } } $ubs= BasicSetting::where('user_id',Auth::user()->id)->first(); $po->order_status = $request->order_status; $po->save(); $user = Customer::findOrFail($po->customer_id); $be = BasicExtended::first(); $sub = 'Order Status Update'; // Send Mail to Buyer $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; if ($be->is_smtp == 1) { try { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; $mail->SMTPSecure = $be->encryption; $mail->Port = $be->smtp_port; //Recipients $mail->setFrom($be->from_mail, $ubs->from_name); $mail->addAddress($user->email, $user->fname); $mail->addReplyTo($ubs->email, $ubs->from_name); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = 'Hello <strong>' . $user->username . '</strong>,<br/><br/> Your order is ' . $request->order_status . '<br/> Order Number:' . $po->order_number . '.<br/> Order details: <a href="' . route('customer.orders-details', ['id' => $po->id, Auth::guard('web')->user()->username]) . '">' . route('customer.orders-details', ['id' => $po->id, Auth::guard('web')->user()->username]) . '</a> <br/><br/> Thank you.'; $mail->send(); } catch (Exception $e) { // die($e->getMessage()); } } else { try { //Recipients $mail->setFrom($be->from_mail, $be->from_name); $mail->addAddress($user->email, $user->fname); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = 'Hello <strong>' . $user->username . '</strong>,<br/><br/> Your order is ' . $request->order_status . '.<br/> Order Number: ' . $po->order_number . '.<br/> Order details: <a href="' . route('customer.orders-details', ['id' => $po->id, Auth::guard('web')->user()->username]) . '">' . route('customer.orders-details', ['id' => $po->id, Auth::guard('web')->user()->username]) . '</a> <br/><br/> Thank you.'; $mail->send(); } catch (Exception $e) { // die($e->getMessage()); } } Session::flash('success', __('Order status changed successfully') . '!'); return back(); } public function paymentStatus(Request $request) { $po = UserOrder::find($request->order_id); if (($request->payment_status != 'rejected') && ($po->order_status != 'rejected' && $po->payment_status != 'rejected')) { } elseif ($request->payment_status == 'rejected' && $po->order_status != 'rejected' && $po->payment_status != 'rejected') { foreach ($po->orderitems as $key => $item) { if ($item->variations == 'null' || empty($item->variations)) { // return item quantity if ($item->item->type == 'physical') { $item->item->stock = $item->item->stock + $item->qty; $item->item->save(); } } else { $db_op_stock = []; // return variation quantity $ordered_variations = (array)json_decode($item->variations); foreach ($ordered_variations as $vkey => $vValue) { $db_variation = $item->item->itemVariations()->where('variant_name', $vkey)->first(); $db_op_name = json_decode($db_variation->option_name); $db_op_stock = json_decode($db_variation->option_stock); $okey = array_search($vValue->name, $db_op_name); $db_op_stock[$okey] = $db_op_stock[$okey] + $item->qty; $db_variation->option_stock = json_encode($db_op_stock); $db_variation->save(); } } } } elseif (($request->payment_status != 'rejected') && ($po->order_status != 'rejected' && $po->payment_status == 'rejected')) { foreach ($po->orderitems as $key => $item) { if ($item->variations == 'null' || empty($item->variations)) { // return item quantity if ($item->item->type == 'physical') { $item->item->stock = $item->item->stock - $item->qty; $item->item->save(); } } else { $db_op_stock = []; // return variation quantity $ordered_variations = (array)json_decode($item->variations); foreach ($ordered_variations as $vkey => $vValue) { $db_variation = $item->item->itemVariations()->where('variant_name', $vkey)->first(); $db_op_name = json_decode($db_variation->option_name); $db_op_stock = json_decode($db_variation->option_stock); $okey = array_search($vValue->name, $db_op_name); $db_op_stock[$okey] = $db_op_stock[$okey] - $item->qty; $db_variation->option_stock = json_encode($db_op_stock); $db_variation->save(); } } } } $po->payment_status = $request->payment_status; $po->save(); $user = Customer::findOrFail($po->customer_id); $be = BasicExtended::first(); $ubs = BasicSetting::where('user_id', Auth::user()->id)->first(); $sub = 'Payment Status Updated'; // Send Mail to Buyer $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; if ($be->is_smtp == 1) { try { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; $mail->SMTPSecure = $be->encryption; $mail->Port = $be->smtp_port; //Recipients $mail->setFrom($be->from_mail, $ubs->from_name); $mail->addAddress($user->email, $user->fname); $mail->addReplyTo($ubs->email,$ubs->from_name); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = 'Hello <strong>' . $user->username . '</strong>,<br/><br/> Your Payment is ' . $request->payment_status . '.<br/> Order Number: ' . $po->order_number . '.<br/> Order details : <a href="' . route('customer.orders-details', ['id' => $po->id, Auth::guard('web')->user()->username]) . '">' . route('customer.orders-details', ['id' => $po->id, Auth::guard('web')->user()->username]) . '</a> <br/><br/> Thank you.'; $mail->send(); } catch (Exception $e) { // die($e->getMessage()); } } else { try { //Recipients $mail->setFrom($be->from_mail, $be->from_name); $mail->addAddress($user->email, $user->fname); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = 'Hello <strong>' . $user->username . '</strong>,<br/><br/> Your Payment is ' . $request->payment_status . '.<br/> Order Number: ' . $po->order_number . '.<br/> Order details: <a href="' . route('customer.orders-details', ['id' => $po->id, Auth::guard('web')->user()->username]) . '">' . route('customer.orders-details', ['id' => $po->id, Auth::guard('web')->user()->username]) . '</a> <br/><br/> Thank you.'; $mail->send(); } catch (Exception $e) { // die($e->getMessage()); } } Session::flash('success', __('Payment status changed successfully') . '!'); return back(); } public function mail(Request $request) { $rules = [ 'email' => 'required', 'subject' => 'required', 'message' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $be = BasicExtended::first(); $from = $be->from_mail; $sub = $request->subject; $msg = $request->message; $to = $request->email; // Mail::to($to)->send(new ContactMail($from, $sub, $msg)); // Send Mail $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; if ($be->is_smtp == 1) { try { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; $mail->SMTPSecure = $be->encryption; $mail->Port = $be->smtp_port; //Recipients $mail->setFrom($from); $mail->addAddress($to); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = $msg; $mail->send(); } catch (Exception $e) { } } else { try { //Recipients $mail->setFrom($from); $mail->addAddress($to); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = $msg; $mail->send(); } catch (Exception $e) { } } Session::flash('success', __('Mail sent successfully!')); return "success"; } public function details($id) { $order = UserOrder::findOrFail($id); return view('user.item.order.details', compact('order')); } public function bulkOrderDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $order = UserOrder::findOrFail($id); @unlink(public_path('assets/front/invoices/' . $order->invoice_number)); @unlink(public_path('assets/front/receipt/' . $order->receipt)); foreach ($order->orderitems as $item) { $item->delete(); } $order->delete(); } Session::flash('success', __('Orders deleted successfully') . '!'); return "success"; } public function orderDelete(Request $request) { $order = UserOrder::findOrFail($request->order_id); @unlink(public_path('assets/front/invoices/' . $order->invoice_number)); @unlink(public_path('assets/front/receipt/' . $order->receipt)); foreach ($order->orderitems as $item) { $item->delete(); } $order->delete(); Session::flash('success', __('Item order deleted successfully') .'!'); return back(); } public function report(Request $request) { $bs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); Config::set('app.timezone', $bs->timezoneinfo->timezone); $fromDate = $request->from_date; $toDate = $request->to_date; $paymentStatus = $request->payment_status; $orderStatus = $request->order_status; $paymentMethod = $request->payment_method; if (!empty($fromDate) && !empty($toDate)) { $orders = UserOrder::where('user_id', Auth::guard('web')->user()->id) ->when($fromDate, function ($query, $fromDate) { return $query->whereDate('created_at', '>=', Carbon::parse($fromDate)); })->when($toDate, function ($query, $toDate) { return $query->whereDate('created_at', '<=', Carbon::parse($toDate)); })->when($paymentMethod, function ($query, $paymentMethod) { return $query->where('method', $paymentMethod); })->when($paymentStatus, function ($query, $paymentStatus) { return $query->where('payment_status', $paymentStatus); })->when($orderStatus, function ($query, $orderStatus) { return $query->where('order_status', $orderStatus); })->select('order_number', 'billing_fname', 'billing_email', 'billing_number', 'billing_city', 'billing_country', 'shpping_fname', 'shpping_email', 'shpping_number', 'shpping_city', 'shpping_country', 'method', 'shipping_method', 'cart_total', 'discount', 'tax', 'shipping_charge', 'total', 'created_at', 'payment_status', 'order_status') ->orderBy('id', 'DESC'); Session::put('item_orders_report', $orders->get()); $data['orders'] = $orders->paginate(10); } else { Session::put('item_orders_report', []); $data['orders'] = []; } $data['onPms'] = UserPaymentGeteway::where('user_id', Auth::guard('web')->user()->id)->where('status', 1)->get(); $data['offPms'] = UserOfflineGateway::where('user_id', Auth::guard('web')->user()->id)->where('item_checkout_status', 1)->get(); return view('user.item.order.report', $data); } public function exportReport() { $orders = Session::get('item_orders_report'); if (empty($orders) || count($orders) == 0) { Session::flash('warning', __('There are no orders to export') . '.'); return back(); } return Excel::download(new PorductOrderExport($orders), 'product-orders.csv'); } } Http/Controllers/User/FAQController.php 0000644 00000004501 15213350435 0014074 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\FAQ; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; class FAQController extends Controller { public function index(Request $request) { // first, get the language info from db $language = Language::where('code', $request->language)->where('user_id', Auth::id())->firstOrFail(); // then, get the faqs of that language from db $information['faqs'] = FAQ::where('language_id', $language->id) ->where('user_id', Auth::id()) ->orderBy('id', 'desc') ->get(); // also, get all the languages from db $information['langs'] = Language::all(); return view('user.faq.index', $information); } public function update(Request $request) { $rules = [ 'question' => 'required', 'answer' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } FAQ::where('user_id', Auth::user()->id)->where('id', $request->faq_id)->firstOrFail()->update($request->all()); $request->session()->flash('success', __('FAQ updated successfully') . '!'); return 'success'; } public function delete(Request $request) { FAQ::where('user_id', Auth::user()->id)->where('id', $request->faq_id)->firstOrFail()->delete(); $request->session()->flash('success', __('FAQ deleted successfully') . '!'); return redirect()->back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { FAQ::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail()->delete(); } $request->session()->flash('success', __('FAQs deleted successfully') . '!'); /** * this 'success' is returning for ajax call. * if return == 'success' then ajax will reload the page. */ return 'success'; } } Http/Controllers/User/WorkProcessController.php 0000644 00000005326 15213350435 0015754 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\Language; use App\Models\User\WorkProcess; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; use Purifier; class WorkProcessController extends Controller { public function create() { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } $data['langs'] = Language::where('user_id', $user->id)->get(); $data['user'] = $user; return view('user.home.work-process-section.create', $data); } public function store(Request $request) { $request->validate([ 'title' => 'required', 'icon' => 'required', 'text' => 'required', 'serial_number' => 'required', 'user_language_id' => 'required' ]); WorkProcess::create($request->except('language_id', 'user_id') + [ 'language_id' => $request->user_language_id, 'user_id' => Auth::id() ]); $request->session()->flash('success', __('Work process added successfully') . '!'); return redirect()->back(); } public function edit(Request $request, $id) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } // first, get the language info from db $information['language'] = Language::where('code', $request->language) ->where('user_id', $user->id) ->first(); $information['workProcessInfo'] = WorkProcess::findOrFail($id); return view('user.home.work-process-section.edit', $information); } public function update(Request $request, $id) { $request->validate([ 'title' => 'required', 'icon' => 'required', 'text' => 'required', 'serial_number' => 'required' ]); $skill = WorkProcess::findOrFail($id); $input = $request->all(); $input['text'] = Purifier::clean($request->text); $skill->update($input); $request->session()->flash('success', __('Work process updated successfully') . '!'); return redirect()->back(); } public function delete(Request $request) { WorkProcess::findOrFail($request->work_process_id)->delete(); $request->session()->flash('success', __('Work process deleted successfully') . '!'); return redirect()->back(); } } Http/Controllers/User/ShopSettingController.php 0000644 00000005301 15213350435 0015733 0 ustar 00 <?php namespace App\Http\Controllers\User; use Session; use Validator; use Illuminate\Http\Request; use App\Models\User\Language; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use App\Models\User\UserShippingCharge; class ShopSettingController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $lang_id = $lang->id; $data['shippings'] = UserShippingCharge::where('user_id', Auth::guard('web')->user()->id) ->where('language_id', $lang_id) ->orderBy('id', 'DESC') ->paginate(10); $data['lang_id'] = $lang_id; return view('user.item.shop_setting.index', $data); } public function store(Request $request) { $rules = [ 'user_language_id' => 'required', 'title' => 'required', 'text' => 'required|max:255', 'charge' => 'required|numeric', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['language_id'] = $request->user_language_id; $input['user_id'] = Auth::guard('web')->user()->id; $data = new UserShippingCharge(); $data->create($input); Session::flash('success', __('Shipping Charge added successfully') . '!'); return "success"; } public function edit($id) { $shipping = UserShippingCharge::findOrFail($id); return view('user.item.shop_setting.edit', compact('shipping')); } public function update(Request $request) { $rules = [ 'title' => 'required', 'text' => 'required|max:255', 'charge' => 'required|numeric', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $data = UserShippingCharge::findOrFail($request->shipping_id); $data->update($request->all()); Session::flash('success', __('Shipping charge update successfully') . '!'); return "success"; } public function delete(Request $request) { $data = UserShippingCharge::findOrFail($request->shipping_id); $data->delete(); Session::flash('success', __('Shipping charge delete successfully') . '!'); return back(); } } Http/Controllers/User/PageController.php 0000644 00000011675 15213350435 0014353 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\User\Page; use App\Models\User\Language; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Mews\Purifier\Facades\Purifier; class PageController extends Controller { public function index(Request $request) { $user = Auth::guard('web')->user(); $lang = Language::where('code', $request->language) ->where('user_id', $user->id) ->firstOrFail(); $lang_id = $lang->id; $data['apages'] = Page::where('language_id', $lang_id) ->where('user_id', $user->id) ->orderBy('id', 'DESC') ->get(); $data['lang_id'] = $lang_id; $data['lang'] = $lang; return view('user.page.index', $data); } public function create() { return view('user.page.create'); } public function store(Request $request) { $slug = make_slug($request->title); $userId = Auth::user()->id; $langId = $request->user_language_id; $rules = [ 'user_language_id' => 'required', 'name' => 'required', 'title' => [ 'required', function ($attribute, $value, $fail) use ($userId, $langId, $slug) { $pages = Page::where('language_id', $langId)->where('user_id', $userId)->get(); foreach ($pages as $key => $page) { if ($page->slug == $slug) { return $fail(__('The title field must be unique') . "."); } } }, ], 'body' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $page = new Page; $page->user_id = $userId; $page->language_id = $langId; $page->name = $request->name; $page->title = $request->title; $page->slug = $slug; $page->body = Purifier::clean($request->body); $page->meta_keywords = $request->meta_keywords; $page->meta_description = $request->meta_description; $page->save(); Session::flash('success', __('Page created successfully') . '!'); return "success"; } public function edit($pageID) { $data['page'] = Page::where('user_id', Auth::user()->id)->where('id', $pageID)->firstOrFail(); return view('user.page.edit', $data); } public function update(Request $request) { $slug = make_slug($request->title); $pageID = $request->pageid; $page = Page::where('user_id', Auth::user()->id)->where('id', $pageID)->firstOrFail(); $userId = Auth::user()->id; $langId = $page->language_id; $rules = [ 'name' => 'required', 'title' => [ 'required', function ($attribute, $value, $fail) use ($userId, $langId, $slug, $pageID) { $pages = Page::where('language_id', $langId)->where('user_id', $userId)->where('id', '<>', $pageID)->get(); foreach ($pages as $key => $page) { if ($page->slug == $slug) { return $fail(__('The title field must be unique') . "."); } } }, ], 'body' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $page->name = $request->name; $page->title = $request->title; $page->slug = $slug; $page->body = Purifier::clean($request->body); $page->meta_keywords = $request->meta_keywords; $page->meta_description = $request->meta_description; $page->save(); Session::flash('success', __('Page updated successfully') . '!'); return "success"; } public function delete(Request $request) { $pageID = $request->pageid; $page = Page::where('user_id', Auth::user()->id)->where('id', $pageID)->firstOrFail(); $page->delete(); Session::flash('success', __('Page deleted successfully') . '!'); return redirect()->back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $page = Page::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); $page->delete(); } Session::flash('success', __('Pages deleted successfully') . '!'); return "success"; } } Http/Controllers/User/UserCheckoutController.php 0000644 00000045423 15213350435 0016101 0 ustar 00 <?php namespace App\Http\Controllers\User; use Carbon\Carbon; use App\Models\User; use App\Models\Package; use App\Models\Language; use App\Models\Membership; use App\Models\BasicSetting; use App\Models\OfflineGateway; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Session; use App\Http\Helpers\UserPermissionHelper; use App\Http\Requests\Checkout\ExtendRequest; use App\Http\Controllers\Payment\PaytmController; use App\Http\Controllers\Payment\MollieController; use App\Http\Controllers\Payment\PaypalController; use App\Http\Controllers\Payment\StripeController; use App\Http\Controllers\Payment\PaystackController; use App\Http\Controllers\Payment\RazorpayController; use App\Http\Controllers\Payment\InstamojoController; use App\Http\Controllers\Payment\FlutterWaveController; use App\Http\Controllers\Payment\MercadopagoController; use App\Http\Controllers\Payment\AuthorizenetController; use App\Http\Controllers\Payment\PerfectMoneyController; use App\Http\Controllers\Payment\PhonePeController; use App\Http\Controllers\Payment\XenditController; use App\Http\Controllers\Payment\YocoController; use App\Http\Controllers\Payment\ToyyibpayController; use App\Http\Controllers\Payment\PaytabsController; use App\Http\Controllers\Payment\MidtransController; use App\Http\Controllers\Payment\IyzicoController; use App\Http\Controllers\Payment\MyFatoorahController; class UserCheckoutController extends Controller { public function checkout(ExtendRequest $request) { $offline_payment_gateways = OfflineGateway::all()->pluck('name')->toArray(); $currentLang = session()->has('lang') ? (Language::where('code', session()->get('lang'))->first()) : (Language::where('is_default', 1)->first()); $bs = $currentLang->basic_setting; $be = $currentLang->basic_extended; $request['status'] = "1"; $request['receipt_name'] = null; $request['email'] = auth()->user()->email; Session::put('paymentFor', 'extend'); $title = __('You are extending your membership') . "."; $descriptionMsg = __('Congratulation you are going to join our membership') . '. ' . __('Please make a payment for confirming your membership now') . '!'; $description = $descriptionMsg; if ($request->price == 0) { $request['price'] = 0.00; $request['payment_method'] = "-"; $transaction_details = "Free"; $password = uniqid('qrcode'); $package = Package::find($request['package_id']); $transaction_id = UserPermissionHelper::uniqidReal(8); $user = $this->store($request->all(), $transaction_id, $transaction_details, $request['price'], $be, $password); $subject = __('You made your membership purchase successful') . "."; $body = __('You made a payment') . '. ' . __('This is a confirmation mail from us') . '. '. __('Please see the invoice attachment below') . '.'; $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $file_name = $this->makeInvoice($request->all(), "extend", $user, $password, $request['price'], $request["payment_method"], $user->phone_number, $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); $this->sendMailWithPhpMailer($request->all(), $file_name, $be, $subject, $body, $user->email, $user->first_name . ' ' . $user->last_name); Session::forget('request'); Session::forget('paymentFor'); return redirect()->route('success.page'); } elseif ($request->payment_method == "Paypal") { $amount = round(($request->price / $be->base_currency_rate), 2); $paypal = new PaypalController; $cancel_url = route('membership.paypal.cancel'); $success_url = route('membership.paypal.success'); return $paypal->paymentProcess($request, $amount, $title, $success_url, $cancel_url); } elseif ($request->payment_method == "Stripe") { $amount = round(($request->price / $be->base_currency_rate), 2); $stripe = new StripeController(); $cancel_url = route('membership.stripe.cancel'); return $stripe->paymentProcess($request, $amount, $title, NULL, $cancel_url); } elseif ($request->payment_method == "Paytm") { if ($be->base_currency_text != "INR") { session()->flash('warning', __('only_paytm_INR')); return back()->withInput($request->all()); } $amount = $request->price; $item_number = uniqid('paytm-') . time(); $callback_url = route('membership.paytm.status'); $paytm = new PaytmController(); return $paytm->paymentProcess($request, $amount, $item_number, $callback_url); } elseif ($request->payment_method == "Paystack") { if ($be->base_currency_text != "NGN") { session()->flash('warning', __('only_paystack_NGN')); return back()->withInput($request->all()); } $amount = $request->price * 100; $email = $request->email; $success_url = route('membership.paystack.success'); $payStack = new PaystackController(); return $payStack->paymentProcess($request, $amount, $email, $success_url, $be); } elseif ($request->payment_method == "Razorpay") { if ($be->base_currency_text != "INR") { session()->flash('warning', $be->base_currency_text . " " . __('is not allowed for Razorpay')); return back($request->all()); } $amount = $request->price; $item_number = uniqid('razorpay-') . time(); $cancel_url = route('membership.razorpay.cancel'); $success_url = route('membership.razorpay.success'); $razorpay = new RazorpayController(); return $razorpay->paymentProcess($request, $amount, $item_number, $cancel_url, $success_url, $title, $description, $bs, $be); } elseif ($request->payment_method == "Instamojo") { if ($be->base_currency_text != "INR") { session()->flash('warning', $be->base_currency_text . " " . __('is not allowed for Instamojo')); return back()->withInput($request->all()); } if ($request->price < 9) { return redirect()->back()->with('error', __('Minimum 10 INR required for this payment gateway') . '.')->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.instamojo.success'); $cancel_url = route('membership.instamojo.cancel'); $instaMojo = new InstamojoController(); return $instaMojo->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Mercado Pago") { if ($be->base_currency_text != "BRL") { session()->flash('warning', __('only_mercadopago_BRL')); return back()->withInput($request->all()); } $amount = $request->price; $email = $request->email; $success_url = route('membership.mercadopago.success'); $cancel_url = route('membership.mercadopago.cancel'); $mercadopagoPayment = new MercadopagoController(); return $mercadopagoPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $email, $title, $description, $be); } elseif ($request->payment_method == "Flutterwave") { $available_currency = array( 'BIF', 'CAD', 'CDF', 'CVE', 'EUR', 'GBP', 'GHS', 'GMD', 'GNF', 'KES', 'LRD', 'MWK', 'NGN', 'RWF', 'SLL', 'STD', 'TZS', 'UGX', 'USD', 'XAF', 'XOF', 'ZMK', 'ZMW', 'ZWD' ); if (!in_array($be->base_currency_text, $available_currency)) { session()->flash('warning', $be->base_currency_text . " " . __('is not allowed for Flutterwave')); return back()->withInput($request->all()); } $amount = $request->price; $email = $request->email; $item_number = uniqid('flutterwave-') . time(); $cancel_url = route('membership.flutterwave.cancel'); $success_url = route('membership.flutterwave.success'); $flutterWave = new FlutterWaveController(); return $flutterWave->paymentProcess($request, $amount, $email, $item_number, $success_url, $cancel_url, $be); } elseif ($request->payment_method == "Authorize.net") { $available_currency = array('USD', 'CAD', 'CHF', 'DKK', 'EUR', 'GBP', 'NOK', 'PLN', 'SEK', 'AUD', 'NZD'); if (!in_array($be->base_currency_text, $available_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $cancel_url = route('membership.anet.cancel'); $anetPayment = new AuthorizenetController(); return $anetPayment->paymentProcess($request, $amount, $cancel_url, $title, $be); } elseif ($request->payment_method == "Mollie Payment") { $available_currency = array('AED', 'AUD', 'BGN', 'BRL', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HRK', 'HUF', 'ILS', 'ISK', 'JPY', 'MXN', 'MYR', 'NOK', 'NZD', 'PHP', 'PLN', 'RON', 'RUB', 'SEK', 'SGD', 'THB', 'TWD', 'USD', 'ZAR'); if (!in_array($be->base_currency_text, $available_currency)) { session()->flash('warning', $be->base_currency_text . " " . __('is not allowed for Mollie') . '.'); return back()->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.mollie.success'); $cancel_url = route('membership.mollie.cancel'); $molliePayment = new MollieController(); return $molliePayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "PhonePe") { if ($be->base_currency_text != 'INR') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.phonepe.success'); $cancel_url = route('membership.phonepe.cancel'); $phonepePayment = new PhonePeController(); return $phonepePayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Perfect Money") { if ($be->base_currency_text != 'USD') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.perfect_money.success'); $cancel_url = route('membership.perfect_money.cancel'); $perfectMoneyPayment = new PerfectMoneyController(); return $perfectMoneyPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Xendit") { $allowed_currency = array('IDR', 'PHP', 'USD', 'SGD', 'MYR'); if (!in_array($be->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.xendit.success'); $cancel_url = route('membership.perfect_money.cancel'); $xenditPayment = new XenditController(); return $xenditPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Yoco") { if ($be->base_currency_text != 'ZAR') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.yoco.success'); $cancel_url = route('membership.perfect_money.cancel'); $yocoPayment = new YocoController(); return $yocoPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Toyyibpay") { if ($be->base_currency_text != 'RM') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.toyyibpay.success'); $cancel_url = route('membership.perfect_money.cancel'); $toyyibpay = new ToyyibpayController(); return $toyyibpay->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Paytabs") { $paytabInfo = paytabInfo('admin', null); // changing the currency before redirect to Stripe if ($be->base_currency_text != $paytabInfo['currency']) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.paytabs.success'); $cancel_url = route('membership.perfect_money.cancel'); $paytabs = new PaytabsController(); return $paytabs->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Midtrans") { if ($be->base_currency_text != 'IDR') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.midtrans.success'); $cancel_url = route('membership.perfect_money.cancel'); $midtrans = new MidtransController(); return $midtrans->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Iyzico") { if ($be->base_currency_text != 'TRY') { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = route('membership.iyzico.success'); $cancel_url = route('membership.perfect_money.cancel'); $iyzico = new IyzicoController(); return $iyzico->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif ($request->payment_method == "Myfatoorah") { // changing the currency before redirect to Stripe $allowed_currency = array('KWD', 'SAR', 'BHD', 'AED', 'QAR', 'OMR', 'JOD'); if (!in_array($be->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', __('invalid_currency'))->withInput($request->all()); } $amount = $request->price; $success_url = null; $cancel_url = route('membership.perfect_money.cancel'); $myfatoorahPayment = new MyFatoorahController(); return $myfatoorahPayment->paymentProcess($request, $amount, $success_url, $cancel_url, $title, $be); } elseif (in_array($request->payment_method, $offline_payment_gateways)) { $request['status'] = "0"; if ($request->hasFile('receipt')) { $filename = time() . '.' . $request->file('receipt')->getClientOriginalExtension(); $directory = public_path("assets/front/img/membership/receipt"); @mkdir($directory, 0775, true); $request->file('receipt')->move($directory, $filename); $request['receipt_name'] = $filename; } $amount = $request->price; $transaction_id = \App\Http\Helpers\UserPermissionHelper::uniqidReal(8); $transaction_details = "offline"; $password = uniqid('qrcode'); $this->store($request, $transaction_id, json_encode($transaction_details), $amount, $be, $password); return view('front.offline-success'); } } public function store($request, $transaction_id, $transaction_details, $amount, $be, $password) { $abs = BasicSetting::first(); Config::set('app.timezone', $abs->timezone); $user = User::query()->find($request['user_id']); $previousMembership = Membership::query() ->select('id', 'package_id', 'is_trial') ->where([ ['user_id', $user->id], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ]) ->where('status', 1) ->orderBy('created_at', 'DESC') ->first(); if (!is_null($previousMembership)) { $previousPackage = Package::query() ->select('term') ->where('id', $previousMembership->package_id) ->first(); if (($previousPackage->term === 'lifetime' || $previousMembership->is_trial == 1) && $transaction_details != '"offline"') { $membership = Membership::find($previousMembership->id); $membership->expire_date = Carbon::parse($request['start_date']); $membership->save(); } } if ($user) { if (is_array($request)) { if (array_key_exists('conversation_id', $request)) { $conversation_id = $request['conversation_id']; } else { $conversation_id = null; } } else { $conversation_id = null; } Membership::create([ 'price' => $request['price'], 'currency' => $be->base_currency_text, 'currency_symbol' => $be->base_currency_symbol, 'payment_method' => $request["payment_method"], 'transaction_id' => $transaction_id, 'status' => $request["status"], 'receipt' => $request["receipt_name"], 'transaction_details' => $transaction_details, 'settings' => json_encode($be), 'package_id' => $request['package_id'], 'user_id' => $user->id, 'start_date' => Carbon::parse($request['start_date']), 'expire_date' => Carbon::parse($request['expire_date']), 'is_trial' => 0, 'trial_days' => 0, 'conversation_id' => $conversation_id ]); } return $user; } } Http/Controllers/User/ForgotController.php 0000644 00000007247 15213350435 0014737 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Models\User; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; use App\Models\Language; use Validator; use Mail; use Session; use DB; use App; use Str; class ForgotController extends Controller { public function __construct() { $this->middleware('web'); $this->middleware('setlang'); } public function showForgotForm() { return view('user.forgot'); } public function forgot(Request $request) { $request->validate([ 'email' => 'required' ]); // Validation Starts if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('dashboard_default', 1)->first(); } $input = $request->all(); $be = $currentLang->basic_extended; if (User::where('email', '=', $request->email)->count() > 0) { // user found $admin = User::where('email', '=', $request->email)->firstOrFail(); $autopass = Str::random(8); $input['password'] = bcrypt($autopass); $admin->update($input); $subject = __("Reset Password Request"); $msg = __("Your New Password is : ") . $autopass; $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; $be->is_smtp = 0; if ($be->is_smtp == 1) { try { //Server settings $mail->isSMTP(); // Send using SMTP $mail->Host = $be->smtp_host; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = $be->smtp_username; // SMTP username $mail->Password = $be->smtp_password; // SMTP password $mail->SMTPSecure = $be->encryption; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged $mail->Port = $be->smtp_port; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above //Recipients $mail->setFrom($be->from_mail, $be->from_name); $mail->addAddress($request->email); // Add a recipient // Content $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = $msg; $mail->send(); } catch (Exception $e) { } } else { try { //Recipients $mail->setFrom($be->from_mail, $be->from_name); $mail->addAddress($request->email); // Add a recipient // Content $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = $msg; $mail->send(); } catch (Exception $e) { die($e->getMessage()); } } Session::flash('success', 'Your Password Reseted Successfully. Please Check your email for new Password.'); return back(); } else { // user not found Session::flash('err', 'No Account Found With This Email.'); return back(); } } } Http/Controllers/User/JcategoryController.php 0000644 00000007715 15213350435 0015426 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Models\User\Jcategory; use App\Models\User\Language; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class JcategoryController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $lang_id = $lang->id; $data['jcategorys'] = Jcategory::where([ ['language_id', $lang_id], ['user_id', Auth::id()] ]) ->orderBy('id', 'DESC') ->paginate(10); return view('user.job.jcategory.index', $data); } public function edit($id) { $data['jcategory'] = Jcategory::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); return view('user.job.jcategory.edit', $data); } public function store(Request $request) { $rules = [ 'user_language_id' => 'required', 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $jcategory = new Jcategory; $jcategory->language_id = $request->user_language_id; $jcategory->name = $request->name; $jcategory->status = $request->status; $jcategory->serial_number = $request->serial_number; $jcategory->user_id = Auth::id(); $jcategory->save(); Session::flash('success', __('Category added successfully') . '!'); return "success"; } public function update(Request $request) { $rules = [ 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $jcategory = Jcategory::where('user_id', Auth::user()->id)->where('id', $request->jcategory_id)->firstOrFail(); $jcategory->name = $request->name; $jcategory->status = $request->status; $jcategory->serial_number = $request->serial_number; $jcategory->save(); Session::flash('success', __('Category updated successfully') . '!'); return "success"; } public function delete(Request $request) { $jcategory = Jcategory::where('user_id', Auth::user()->id)->where('id', $request->jcategory_id)->firstOrFail(); if ($jcategory->jobs()->count() > 0) { Session::flash('warning', __('First, delete all the jobs under this category') . '!'); return back(); } $jcategory->delete(); Session::flash('success', __('Category deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $jcategory = Jcategory::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); if ($jcategory->jobs()->count() > 0) { Session::flash('warning', __('First, delete all the jobs under the selected categories') . '!'); return "success"; } } foreach ($ids as $id) { $jcategory = Jcategory::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); $jcategory->delete(); } Session::flash('success', __('Job categories deleted successfully') . '!'); return "success"; } } Http/Controllers/User/BlogCategoryController.php 0000644 00000021751 15213350435 0016054 0 ustar 00 <?php namespace App\Http\Controllers\User; use Illuminate\Http\Request; use App\Models\User\Language; use App\Models\User\BlogCategory; use App\Http\Controllers\Controller; use App\Models\User\BasicSetting; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class BlogCategoryController extends Controller { /** * Display a listing of the resource. * * @return */ public function index(Request $request) { $lang = Language::where([['code', $request->language], ['user_id', Auth::id()]])->firstorFail(); $data['bcategorys'] = BlogCategory::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::guard('web')->user()->id], ]) ->orderBy('id', 'DESC') ->get(); return view('user.blog.bcategory.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $theme = BasicSetting::where('user_id', Auth::id())->first()->theme; $img = $request->file('image'); $rules = [ 'user_language_id' => 'required', 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; if ($theme == 'home_thirteen') { $imgURL = $request->image; $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg'); $imgExt = $imgURL ? $imgURL->extension() : null; $rules['image'] = [ 'required', function ($attribute, $value, $fail) use ($allowedExtensions, $imgExt) { if (!in_array($imgExt, $allowedExtensions)) { $fail('Only .jpg, .jpeg, .png and .svg file is allowed.'); } } ]; } if ($theme == 'home_thirteen') { $message['image.required'] = ['The image field is required.']; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/blogs/categories/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } else { $filename = null; } $bcategory = new BlogCategory(); $bcategory->language_id = $request->user_language_id; $bcategory->name = $request->name; $bcategory->status = $request->status; $bcategory->user_id = Auth::guard('web')->user()->id; $bcategory->serial_number = $request->serial_number; $bcategory->image = $filename; $bcategory->save(); Session::flash('success', __('Category added successfully') . '!'); return "success"; } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function updateFeatured(Request $request, $id) { $category = BlogCategory::findOrFail($id); if ($request->is_featured == 1) { $category->update(['is_featured' => 1]); Session::flash('success', __('Category featured successfully') . '!'); } else { $category->update(['is_featured' => 0]); Session::flash('success', __('Category unfeatured successfully') . '!'); } return redirect()->back(); } public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { $userId = Auth::id(); // safe get theme $basicSetting = BasicSetting::where('user_id', $userId)->first(); $theme = $basicSetting ? $basicSetting->theme : null; $bcategory = BlogCategory::where('user_id', $userId) ->where('id', $request->bcategory_id) ->firstOrFail(); // base rules $rules = [ 'name' => 'required|string|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; // if category has no image yet, require an image input if ($bcategory->image == null) { $rules['image'] = 'required|image|mimes:jpg,jpeg,png,svg|max:2048'; } // theme-specific: allow image but validate mime types if ($theme === 'home_thirteen') { // if image present, validate; if not present it's optional (we'll keep old image) if ($request->hasFile('image')) { $rules['image'] = 'image|mimes:jpg,jpeg,png,svg|max:2048'; } } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors(), 422); } // start with existing image name — so we don't accidentally clear it $imgName = $bcategory->image; if ($theme === 'home_thirteen' && $request->hasFile('image')) { $image = $request->file('image'); // prepare new filename $imgExt = $image->getClientOriginalExtension(); $imgName = time() . '_' . uniqid() . '.' . $imgExt; $imgDir = public_path('assets/front/img/user/blogs/categories/'); // ensure directory exists if (!file_exists($imgDir)) { @mkdir($imgDir, 0755, true); } // delete old file if exists if ($bcategory->image && file_exists($imgDir . $bcategory->image)) { @unlink($imgDir . $bcategory->image); } // move uploaded file to destination try { $image->move($imgDir, $imgName); } catch (\Exception $e) { // log and return error Log::error('Image move failed: ' . $e->getMessage()); return response()->json(['error' => 'Failed to upload image.'], 500); } } // save fields $bcategory->name = $request->name; $bcategory->status = $request->status; $bcategory->serial_number = $request->serial_number; $bcategory->image = $imgName; $bcategory->save(); Session::flash('success', __('Category Update successfully') . '!'); // if this is used by AJAX, better to return JSON; adjust if non-AJAX flow expected return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } public function delete(Request $request) { $bcategory = BlogCategory::where('user_id', Auth::guard('web')->user()->id)->where('id', $request->bcategory_id)->firstOrFail(); if ($bcategory->blogs()->count() > 0) { Session::flash('warning', __('First, delete all the blogs under this category') . '!'); return back(); } @unlink(public_path('assets/front/img/user/blogs/categories/' . $bcategory->image)); $bcategory->delete(); Session::flash('success', __('Blog category deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $bcategory = BlogCategory::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->firstOrFail(); if ($bcategory->blogs()->count() > 0) { Session::flash('warning', __('First, delete all the blogs under the selected categories') . '!'); return "success"; } } foreach ($ids as $id) { $bcategory = BlogCategory::findOrFail($id); @unlink(public_path('assets/front/img/user/blogs/categories/' . $bcategory->image)); $bcategory->delete(); } Session::flash('success', __('Blog categories deleted successfully') . '!'); return "success"; } } Http/Controllers/User/GalleryCategoryController.php 0000644 00000010773 15213350435 0016572 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\GalleryCategory; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class GalleryCategoryController extends Controller { public function index(Request $request) { // first, get the language info from db $language = Language::where([['code', $request->language], ['user_id', Auth::guard('web')->user()->id]])->firstOrFail(); $information['language'] = $language; // then, get the gallery categories of that language from db $information['categories'] = GalleryCategory::where('language_id', $language->id) ->where('user_id', Auth::id()) ->orderBy('id', 'desc') ->get(); // also, get all the languages from db $information['langs'] = Language::where('user_id', Auth::id())->get(); return view('user.gallery.categories', $information); } public function store(Request $request) { $rules = [ 'user_language_id' => 'required', 'name' => 'required', 'status' => 'required', 'serial_number' => 'required' ]; $message = [ 'user_language_id.required' => 'The language field is required.', 'name.required' => 'The name field is required.', 'status.required' => 'The status field is required.', 'serial_number.required' => 'The serial number field is required.' ]; $validator = Validator::make($request->all(), $rules, $message); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $request['user_id'] = Auth::id(); $request['language_id'] = $request->user_language_id; GalleryCategory::create($request->all()); Session::flash('success', __('Category added successfully') . '!'); return 'success'; } public function update(Request $request) { $rules = [ 'name' => 'required', 'status' => 'required', 'serial_number' => 'required' ]; $messages = [ 'name.required' => 'The name field is required', 'status.required' => 'The status field is required', 'serial_number.required' => 'The serial number field is required', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } GalleryCategory::findOrFail($request->id)->update($request->all()); Session::flash('success', __('Category Update successfully') . '!'); return 'success'; } public function destroy($id) { $category = GalleryCategory::findOrFail($id); if ($category->imgVid()->count() > 0) { Session::flash('warning', __('First delete all the items of those categories') . '!'); return back(); } else { $category->delete(); Session::flash('success', __('Gallery categories deleted successfully') . '!'); return back(); } } public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $category = GalleryCategory::findOrFail($id); if ($category->imgVid()->count() > 0) { Session::flash('warning', __('First delete all the items of those categories') . '!'); return 'success'; } else { $category->delete(); } } Session::flash('success', __('Gallery categories deleted successfully') . '!'); return 'success'; } public function getCategories($id) { if (!is_null($id)) { $categories = GalleryCategory::where('language_id', $id) ->where('user_id', Auth::id()) ->where('status', 1) ->orderByDesc('id') ->get(); return response()->json(['successData' => $categories]); } else { return response()->json(['errorData' => 'Sorry, an error has occurred!'], 400); } } } Http/Controllers/User/TestimonialController.php 0000644 00000014200 15213350435 0015752 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\BasicSetting; use App\Models\User\Language; use App\Models\User\UserTestimonial; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Purifier; use Validator; class TestimonialController extends Controller { /** * Display a listing of the resource. * * @return */ public function index(Request $request) { $lang = Language::where([['code', $request->language], ['user_id', Auth::id()]])->firstorFail(); $data['testimonials'] = UserTestimonial::where([ ['lang_id', '=', $lang->id], ['user_id', '=', Auth::id()], ]) ->orderBy('id', 'DESC') ->get(); return view('user.testimonial.index', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return */ public function store(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $userBs = BasicSetting::where('user_id', Auth::id())->select('theme')->first(); $rules = [ 'name' => 'required|max:255', 'user_language_id' => 'required', 'content' => 'required', 'serial_number' => 'required|integer', ]; if ($userBs->theme != 'home_nine') { $rules += [ 'image' => 'required|mimes:jpg,jpeg,png' ]; } else { $rules += [ 'image' => 'nullable' ]; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['user_id'] = Auth::id(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/testimonials/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } $input['content'] = Purifier::clean($request->content); $input['lang_id'] = $request->user_language_id; $blog = new UserTestimonial(); $blog->create($input); Session::flash('success', __('Testimonial added successfully') . '!'); return "success"; } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $data['testimonial'] = UserTestimonial::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); return view('user.testimonial.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'name' => 'required|max:255', 'content' => 'required', 'serial_number' => 'required|integer', ]; $userBs = BasicSetting::where('user_id', Auth::id())->select('theme')->first(); $service = UserTestimonial::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail(); if ($userBs->theme != 'home_nine' && $img) { $rules += [ 'image' => 'required|mimes:jpg,jpeg,png' ]; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['user_id'] = Auth::id(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/testimonials/'); $request->file('image')->move($directory, $filename); if (file_exists($directory . $service->image)) { @unlink($directory . $service->image); } $input['image'] = $filename; } $input['content'] = Purifier::clean($request->content); $service->update($input); Session::flash('success', __('Testimonial updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function delete(Request $request) { $service = UserTestimonial::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail(); if (file_exists(public_path('assets/front/img/user/testimonials/' . $service->image))) { @unlink(public_path('assets/front/img/user/testimonials/' . $service->image)); } $service->delete(); Session::flash('success', __('Testimonial deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $service = UserTestimonial::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); if (file_exists(public_path('assets/front/img/user/testimonials/' . $service->image))) { @unlink(public_path('assets/front/img/user/testimonials/' . $service->image)); } $service->delete(); } Session::flash('success', __('Testimonial deleted successfully') . '!'); return "success"; } } Http/Controllers/User/FollowerController.php 0000644 00000006603 15213350435 0015263 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User; use App\Models\User\Follower; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; class FollowerController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // } public function follow($id){ $followCheck = Follower::query()->where([ ['follower_id',Auth::id()], ['following_id',$id], ])->first(); if(is_null($followCheck)){ $follow = new Follower(); $follow->follower_id = Auth::id(); $follow->following_id = $id; $follow->save(); Session::flash('success', __('You have followed successfully') . '!'); return redirect()->back(); } else{ return redirect()->back(); } } public function follower(){ $data['users'] = []; $followerListIds = Follower::query()->where('following_id',Auth::id())->pluck('follower_id'); if(count($followerListIds) > 0){ $data['users'] = User::whereIn('id',$followerListIds)->paginate(10); } return view('user.follower.index',$data); } public function following() { $data['users'] = []; $followingListIds = Follower::query()->where('follower_id', Auth::id())->pluck('following_id'); if (count($followingListIds) > 0) { $data['users'] = User::whereIn('id',$followingListIds)->paginate(10); } return view('user.following.index', $data); } public function unfollow($id){ $followCheck = Follower::query() ->where([ ['follower_id',Auth::id()], ['following_id',$id], ])->first(); if(!is_null($followCheck)){ $followCheck->delete(); Session::flash('success', __('You have unfollowed successfully!')); return redirect()->back(); }else{ Session::flash('warning', __('You cannot unfollow the user') . '!'); return redirect()->back(); } } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } } Http/Controllers/User/FeatureController.php 0000644 00000012605 15213350435 0015064 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Constants\Constant; use Illuminate\Http\Request; use App\Models\User\Language; use App\Models\User\UserFeature; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\BasicSetting; use App\Rules\ImageMimeTypeRule; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Illuminate\Validation\Rule; class FeatureController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $lang_id = $lang->id; $data['features'] = UserFeature::where('language_id', $lang_id)->where('user_id', Auth::guard('web')->user()->id)->orderBy('id', 'DESC')->get(); $data['lang_id'] = $lang_id; $data['featuredImage'] = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->select('features_section_image')->first(); return view('user.feature.index', $data); } public function edit($id) { $data['feature'] = UserFeature::findOrFail($id); return view('user.feature.edit', $data); } public function store(Request $request) { $theme = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->select('theme')->first(); $rules = [ 'user_language_id' => 'required', 'icon' => [Rule::when($theme->theme != 'home_ten', 'required')], 'title' => 'required|max:50', 'text' => 'required|max:255', // 'color' => [Rule::when($theme->theme != 'home_ten', 'required')], 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } if ($request->hasFile('icon')) { $file = $request->file('icon'); $name = time() . $file->getClientOriginalName(); $file->move(public_path('assets/front/img/user/feature/'), $name); } $feature = new UserFeature; $feature->user_id = Auth::guard('web')->user()->id; if ($theme->theme != 'home_ten') $feature->icon = $name; $feature->language_id = $request->user_language_id; $feature->title = $request->title; $feature->text = $request->text; $feature->color = $request->color; $feature->serial_number = $request->serial_number; $feature->save(); Session::flash('success', __('Feature added successfully') . '!'); return "success"; } public function update(Request $request) { $request->validate([ 'title' => 'required|max:50', 'text' => 'required|max:255', // 'color' => 'required', 'serial_number' => 'required|integer', ]); $feature = UserFeature::findOrFail($request->feature_id); if ($request->hasFile('icon')) { @unlink(public_path('assets/front/img/user/feature/' . $feature->icon)); $file = $request->file('icon'); $name = time() . $file->getClientOriginalName(); $file->move(public_path('assets/front/img/user/feature/'), $name); } if ($request->icon) { $feature->icon = $name; } $feature->title = $request->title; $feature->text = $request->text; $feature->color = $request->color; $feature->serial_number = $request->serial_number; $feature->save(); Session::flash('success', __('Feature updated successfully') . '!'); return back(); } public function imageUpdate(Request $request) { $data = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->select('features_section_image')->first(); $rules = []; if (!$request->filled('features_section_image') && empty($data->features_section_image)) { $rules['features_section_image'] = 'required'; } if ($request->hasFile('features_section_image')) { $rules['features_section_image'] = new ImageMimeTypeRule(); } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json(['errors' => $validator->errors()]); } if ($request->hasFile('features_section_image')) { $imgName = Uploader::update_picture(Constant::WEBSITE_FEATURE_SECTION_IMAGE, $request->file('features_section_image'), $data->features_section_image); // finally, store the image into db BasicSetting::query()->updateOrInsert( ['user_id' => Auth::guard('web')->user()->id], ['features_section_image' => $imgName] ); session()->flash('success', __('Image updated successfully') . '!'); } return "success"; } public function delete(Request $request) { $feature = UserFeature::findOrFail($request->feature_id); @unlink(public_path('assets/front/img/user/feature/' . $feature->icon)); $feature->delete(); Session::flash('success', __('Feature deleted successfully') . '!'); return back(); } } Http/Controllers/User/MemberController.php 0000644 00000010116 15213350435 0014673 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\Language; use App\Models\User\Member; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class MemberController extends Controller { public function createMember(Request $request) { // first, get the language info from db $information['language'] = Language::where('code', $request->language)->where('user_id', Auth::user()->id)->first(); $data['userLanguages'] = Language::where('user_id', Auth::id())->get(); return view('user.team_section.create', $information); } public function storeMember(Request $request) { $rules = [ 'user_language_id' => 'required', 'name' => 'required', 'rank' => 'required', ]; if (!$request->hasFile('image')) { $rules['image'] = 'required|mimes:jpeg,jpg,png,svg|max:1000'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } if ($request->hasFile('image')) { $request['image_name'] = Uploader::upload_picture('assets/front/img/user/team', $request->file('image')); } Member::create($request->except('language_id', 'image', 'user_id') + [ 'language_id' => $request->user_language_id, 'image' => $request->image_name, 'user_id' => Auth::id() ]); $request->session()->flash('success', __('New member added successfully') . '!'); return redirect()->back(); } public function editMember(Request $request, $id) { // first, get the language info from db $information['language'] = Language::where('code', $request->language)->where('user_id', Auth::user()->id)->first(); $information['memberInfo'] = Member::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); return view('user.team_section.edit', $information); } public function updateMember(Request $request, $id) { $rules = [ 'name' => 'required', 'rank' => 'required', ]; if ($request->hasFile('image')) { $rules['image'] = 'required|mimes:jpeg,jpg,png,svg|max:1000'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } $member = Member::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); $request['image_name'] = $member->image; if ($request->hasFile('image')) { $request['image_name'] = Uploader::update_picture('assets/front/img/user/team', $request->file('image'), $member->image); } $member->update($request->except('image') + [ 'image' => $request->image_name ]); $request->session()->flash('success', __('Member updated successfully') . '!'); return redirect()->back(); } public function deleteMember(Request $request): \Illuminate\Http\RedirectResponse { $member = Member::where('user_id', Auth::user()->id)->where('id', $request->member_id)->firstOrFail(); @unlink(public_path('assets/front/img/user/team/') . $member->image); $member->delete(); $request->session()->flash('success', __('Member deleted successfully') . '!'); return redirect()->back(); } public function featured(Request $request): \Illuminate\Http\RedirectResponse { $member = Member::where('user_id', Auth::user()->id)->where('id', $request->member_id)->firstOrFail(); $member->featured = $request->featured; $member->save(); if ($request->featured == 1) { Session::flash('success', __('Featured successfully') . '!'); } else { Session::flash('success', __('Unfeatured successfully') . '!'); } return back(); } } Http/Controllers/User/JobExperienceController.php 0000644 00000013276 15213350435 0016220 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\JobExperience; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Mews\Purifier\Facades\Purifier; class JobExperienceController extends Controller { /** * Display a listing of the resource. * * @return */ public function index(Request $request) { if ($request->has('language')) { $lang = Language::where([ ['code', $request->language], ['user_id', Auth::id()] ])->first(); } else { $lang = Language::where([ ['dashboard_default', 1], ['user_id', Auth::id()] ])->first(); } $data['job_experiences'] = JobExperience::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::id()], ]) ->orderBy('id', 'DESC') ->get(); return view('user.job_experience.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $rules = [ 'user_language_id' => 'required', 'company_name' => 'required', 'designation' => 'required', 'start_date' => 'required', 'serial_number' => 'required', ]; if (!array_key_exists('is_continue', $request->all())) { $rules['end_date'] = 'required'; $request['is_continue'] = 0; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $newJobExperience = new JobExperience(); $newJobExperience->company_name = $request->company_name; $newJobExperience->designation = $request->designation; $newJobExperience->content = Purifier::clean($request->content); $newJobExperience->start_date = $request->start_date; $newJobExperience->end_date = $request->is_continue === "1" ? null : $request->end_date; $newJobExperience->is_continue = $request->is_continue; $newJobExperience->serial_number = $request->serial_number; $newJobExperience->language_id = $request->user_language_id; $newJobExperience->user_id = Auth::id(); $newJobExperience->save(); Session::flash('success', __('Job experience added successfully') . '!'); return "success"; } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $data['jobExperience'] = JobExperience::query()->where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); return view('user.job_experience.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return */ public function update(Request $request) { $rules = [ 'company_name' => 'required', 'designation' => 'required', 'start_date' => 'required', 'serial_number' => 'required', ]; if (!array_key_exists('is_continue', $request->all())) { $rules['end_date'] = 'required'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $newJobExperience = JobExperience::query()->findOrFail($request->id); if ($newJobExperience->user_id != Auth::user()->id) { return; } $newJobExperience->company_name = $request->company_name; $newJobExperience->designation = $request->designation; $newJobExperience->content = Purifier::clean($request->content); $newJobExperience->start_date = $request->start_date; $newJobExperience->end_date = $request->is_continue === "on" ? null : $request->end_date; $newJobExperience->is_continue = $request->is_continue === "on" ? 1 : 0; $newJobExperience->serial_number = $request->serial_number; $newJobExperience->user_id = Auth::id(); $newJobExperience->save(); Session::flash('success', __('Job experience updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } public function delete(Request $request) { JobExperience::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail()->delete(); Session::flash('success', __('Job experience deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { JobExperience::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail()->delete(); } Session::flash('success', __('Job experience deleted successfully') . '!'); return "success"; } } Http/Controllers/User/GalleryItemController.php 0000644 00000023734 15213350435 0015714 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\BasicSetting; use App\Models\User\GalleryCategory; use App\Models\User\GalleryItem; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class GalleryItemController extends Controller { public function gallerySettings() { $data = BasicSetting::where('user_id', Auth::id()) ->select('gallery_bg', 'gallery_category_status') ->first(); return view('user.gallery.settings', ['data' => $data]); } public function updateGallerySettings(Request $request) { $info = BasicSetting::where('user_id', Auth::id())->select('gallery_bg')->first(); $rules = [ 'gallery_category_status' => 'required', 'gallery_bg' => function ($attribute, $value, $fail) use ($info, $request) { if (empty($info->gallery_bg) && !$request->hasFile('gallery_bg')) { $fail('The gallery background image field is required.'); } } ]; if ($request->hasFile('gallery_bg')) { $rules['gallery_bg'] = 'mimes:jpeg,jpg,png,svg,gif'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator->errors()); } if ($request->hasFile('gallery_bg')) { // first, delete the previous image from local storage @unlink(public_path('assets/front/img/user/gallery/bg/' . $info->gallery_bg)); // second, get image extension $bgImgURL = $request->file('gallery_bg'); $fileExtension = $bgImgURL ? $bgImgURL->getClientOriginalExtension() : null; // third, set a name for the image and store it to local storage $bgImgName = time() . '.' . $fileExtension; $directory = public_path('assets/front/img/user/gallery/bg/'); @mkdir($directory, 0775, true); @copy(str_replace(' ', '%20', $bgImgURL), $directory . $bgImgName); } // store data into db $bs = BasicSetting::where('user_id', Auth::id())->first(); $bs->gallery_bg = $request->hasFile('gallery_bg') ? $bgImgName : $info->gallery_bg; $bs->gallery_category_status = $request->gallery_category_status; $bs->save(); Session::flash('success', __('Gallery settings updated successfully') . '!'); return redirect()->back(); } public function index(Request $request) { // first, get the language info from db $language = Language::where([['code', $request->language], ['user_id', Auth::id()]])->firstorFail(); $information['language'] = $language; // then, get the gallery items of that language from db $information['items'] = GalleryItem::where('language_id', $language->id) ->where('user_id', Auth::id()) ->orderBy('id', 'desc') ->get(); // also, get all the languages from db $information['langs'] = Language::where('user_id', Auth::id())->get(); return view('user.gallery.index', $information); } public function store(Request $request) { $rules = [ 'video_link' => 'required_if:item_type,video', 'user_language_id' => 'required', 'title' => 'required', 'serial_number' => 'required' ]; $img = $request->file('image'); $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg'); $fileExtension = $img ? $img->extension() : null; $rules['image'] = [ 'required', function ($attribute, $value, $fail) use ($allowedExtensions, $fileExtension) { if (!in_array($fileExtension, $allowedExtensions)) { $fail('Only .jpg, .jpeg, .png and .svg file is allowed.'); } } ]; $messages = [ 'user_language_id.required' => 'The language field is required.', 'video_link.required_if' => 'The video link field is required.', 'title.required' => 'The title field is required.', 'serial_number.required' => 'The serial number field is required.', 'image.required' => 'The image field is required.', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/gallery/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } else { $filename = null; } // format video link if ($request->filled('video_link')) { $link = $request->video_link; if (strpos($link, '&') != 0) { $link = substr($link, 0, strpos($link, '&')); } } GalleryItem::create($request->except('item_type', 'image', 'video_link', 'user_id', 'language_id') + [ 'item_type' => $request->item_type == 'image' ? 'image' : 'video', 'image' => $filename, 'video_link' => $request->filled('video_link') ? $link : null, 'user_id' => Auth::id(), 'language_id' => $request->user_language_id ]); Session::flash('success', __('New gallery item added successfully') . '!'); return 'success'; } public function getCategories($code) { if (!is_null($code)) { $language = Language::where('code', $code)->where('user_id', Auth::id())->first(); $categories = GalleryCategory::where('language_id', $language->id) ->where('user_id', Auth::id()) ->where('status', 1) ->orderByDesc('id') ->get(); return response()->json(['successData' => $categories]); } else { return response()->json(['errorData' => 'Sorry, an error has occurred!'], 400); } } public function updateFeatured(Request $request, $id) { $item = GalleryItem::findOrFail($id); if ($request->is_featured == 1) { $item->update(['is_featured' => 1]); Session::flash('success', __('Gallery item featured successfully') . '!'); } else { $item->update(['is_featured' => 0]); Session::flash('success', __('Gallery item unfeatured successfully') . '!'); } return redirect()->back(); } public function update(Request $request) { $rules = [ 'video_link' => 'required_if:edit_item_type,video', 'title' => 'required', 'serial_number' => 'required' ]; if ($request->hasFile('image')) { $imageURL = $request->image; $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg'); $fileExtension = $imageURL ? $imageURL->extension() : null; $rules['image'] = function ($attribute, $value, $fail) use ($allowedExtensions, $fileExtension) { if (!in_array($fileExtension, $allowedExtensions)) { $fail('Only .jpg, .jpeg, .png and .svg file is allowed.'); } }; } $message = [ 'video_link.required_if' => 'The video link field is required.' ]; $validator = Validator::make($request->all(), $rules, $message); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $item = GalleryItem::findOrFail($request->id); if ($request->hasFile('image')) { // first, delete the previous image from local storage @unlink(public_path('assets/front/img/user/gallery/') . $item->image); // second, set a name for the image and store it to local storage $imageName = time() . '.' . $fileExtension; $directory = public_path('./assets/front/img/user/gallery/'); @copy($imageURL, $directory . $imageName); } // format video link if ($request->has('video_link')) { $link = $request->video_link; if (strpos($link, '&') != 0) { $link = substr($link, 0, strpos($link, '&')); } } $item->update($request->except('edit_item_type', 'image', 'video_link', 'user_id') + [ 'item_type' => $request->edit_item_type == 'image' ? 'image' : 'video', 'image' => $request->hasFile('image') ? $imageName : $item->image, 'video_link' => $request->has('video_link') ? $link : $item->video_link, 'user_id' => Auth::id() ]); Session::flash('success', __('Gallery item updated successfully') . '!'); return 'success'; } public function destroy($id) { $item = GalleryItem::findOrFail($id); @unlink(public_path('assets/front/img/user/gallery/' . $item->image)); $item->delete(); return redirect()->back()->with('success', 'Gallery item deleted successfully!'); } public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $item = GalleryItem::findOrFail($id); @unlink(public_path('assets/front/img/user/gallery/' . $item->image)); $item->delete(); } Session::flash('success', __('Gallery items deleted successfully') . '!'); return 'success'; } } Http/Controllers/User/MenuBuilderController.php 0000644 00000002675 15213350435 0015712 0 ustar 00 <?php namespace App\Http\Controllers\User; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\User\Language; use App\Models\User\Menu; use App\Models\User\Page; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Log; class MenuBuilderController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::user()->id)->firstOrFail(); $data['lang_id'] = $lang->id; $data['keywords'] = json_decode($lang->keywords, true); // get previous menus $menu = Menu::where('language_id', $lang->id)->where('user_id', Auth::user()->id)->first(); $data['prevMenu'] = ''; if (!empty($menu)) { $data['prevMenu'] = $menu->menus; } $data['apages'] = Page::where('language_id', $lang->id)->where('user_id', Auth::user()->id)->orderBy('id', 'DESC')->get(); return view('user.menu-builder', $data); } public function update(Request $request) { Menu::where('language_id', $request->language_id)->where('user_id', Auth::user()->id)->delete(); $menu = new Menu; $menu->language_id = $request->language_id; $menu->user_id = Auth::user()->id; $menu->menus = $request->str; $menu->save(); return response()->json(['status' => 'success', 'message' => __('Menu updated successfully') . '!']); } } Http/Controllers/User/PaymentLogController.php 0000644 00000001326 15213350435 0015546 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\Membership; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class PaymentLogController extends Controller { /** * Display a listing of the resource. * * */ public function index(Request $request) { $search = $request->search; $data['memberships'] = Membership::query()->when($search, function ($query, $search) { return $query->where('transaction_id', 'like', '%' . $search . '%'); }) ->where('user_id', Auth::user()->id) ->orderBy('id', 'DESC') ->paginate(10); return view('user.payment_log', $data); } } Http/Controllers/User/BlogController.php 0000644 00000034712 15213350435 0014357 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\Language; use App\Models\User\Blog; use App\Models\User\BlogCategory; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Mews\Purifier\Facades\Purifier; class BlogController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { $lang = Language::where([['code', $request->language], ['user_id', Auth::id()]])->firstOrFail(); $data['blogs'] = Blog::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::guard('web')->user()->id], ]) ->orderBy('id', 'DESC') ->get(); $data['bcats'] = BlogCategory::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::guard('web')->user()->id], ['status', '=', 1] ]) ->orderBy('id', 'DESC') ->get(); return view('user.blog.blog.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $img = $request->file('image'); $img2 = $request->file('image2'); $allowedExts = array('jpg', 'png', 'jpeg'); $slug = make_slug($request->title); $rules = [ 'user_language_id' => 'required', 'title' => 'required|max:255', 'category' => 'required', 'content' => 'required', 'serial_number' => 'required|integer', 'image' => [ 'required', function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], 'image2' => [ 'sometimes', function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['category_id'] = $request->category; $input['language_id'] = $request->user_language_id; $input['slug'] = $slug; $input['user_id'] = Auth::guard('web')->user()->id; if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/blogs/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } if ($request->hasFile('image2')) { $filename2 = time() . '.' . $img2->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/blogs/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('image2')->move($directory, $filename2); $input['image2'] = $filename2; } $input['content'] = Purifier::clean($request->content); $blog = new Blog; $blog->create($input); Session::flash('success', __('Blog added successfully') . '!'); return "success"; } public function updateSliderPost(Request $request) { if ($request->is_slider == 1) { $img = $request->hasFile('slider_post_image') ? $request->file('slider_post_image') : null; $sldPostImgURL = $request->hasFile('slider_post_image') ? $request->slider_post_image : null; $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg'); $sldPostImgExt = $request->hasFile('slider_post_image') ? $sldPostImgURL->extension() : null; $rules = [ 'slider_post_image' => [ 'required', function ($attribute, $value, $fail) use ($allowedExtensions, $sldPostImgExt) { if (!in_array($sldPostImgExt, $allowedExtensions)) { $fail('Only .jpg, .jpeg, .png and .svg file is allowed.'); } } ] ]; $message = [ 'slider_post_image.required' => 'The image field is required.' ]; $validator = Validator::make($request->all(), $rules, $message); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } if ($request->hasFile('slider_post_image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/blogs/slider/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('slider_post_image')->move($directory, $filename); $input['image'] = $filename; } // update data in db $blog = Blog::findOrFail($request->id); $blog->update([ 'is_slider' => 1, 'slider_post_image' => $filename ]); Session::flash('success', __('Post added for slider') . '!'); return 'success'; } else { $blog = Blog::findOrFail($request->id); // first, delete the image @unlink(public_path('assets/front/img/user/blogs/slider/' . $blog->slider_post_image)); // then, update data in db $blog->update([ 'is_slider' => 0, 'slider_post_image' => null ]); Session::flash('success', __('Post removed from slider') . '!'); return response()->json(['data' => 'successful']); } } public function updateFeaturedPost(Request $request) { if ($request->is_featured == 1) { $img = $request->hasFile('featured_post_image') ? $request->file('featured_post_image') : null; $featPostImgURL = $request->hasFile('featured_post_image') ? $request->featured_post_image : null; $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg'); $featPostImgExt = $request->hasFile('featured_post_image') ? $featPostImgURL->extension() : null; $rules = [ 'featured_post_image' => [ 'required', function ($attribute, $value, $fail) use ($allowedExtensions, $featPostImgExt) { if (!in_array($featPostImgExt, $allowedExtensions)) { $fail('Only .jpg, .jpeg, .png and .svg file is allowed.'); } } ] ]; $message = [ 'featured_post_image.required' => 'The image field is required.' ]; $validator = Validator::make($request->all(), $rules, $message); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } if ($request->hasFile('featured_post_image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/blogs/featured/'); if (!file_exists($directory)) mkdir($directory, 0775, true); $request->file('featured_post_image')->move($directory, $filename); $input['image'] = $filename; } // update data in db $blog = Blog::findOrFail($request->id); $blog->update([ 'is_featured' => 1, 'featured_post_image' => $filename ]); Session::flash('success', __('Post featured successfully') . '!'); return 'success'; } else { $blog = Blog::findOrFail($request->id); // first, delete the image @unlink(public_path('assets/front/img/user/blogs/featured/' . $blog->featured_post_image)); // then, update data in db $blog->update([ 'is_featured' => 0, 'featured_post_image' => null ]); Session::flash('success', __('Post unfeatured successfully') . '!'); return response()->json(['data' => 'successful'], 200); } } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $data['blog'] = Blog::findOrFail($id); $data['bcats'] = BlogCategory::where([ ['language_id', '=', $data['blog']->language_id], ['user_id', '=', Auth::guard('web')->user()->id], ['status', '=', 1] ]) ->orderBy('serial_number', 'ASC') ->get(); return view('user.blog.blog.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { $img = $request->file('image'); $img2 = $request->file('image2'); $allowedExts = array('jpg', 'png', 'jpeg'); $slug = make_slug($request->title); $rules = [ 'title' => 'required|max:255', 'category' => 'required', 'content' => 'required', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], 'image2' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $blog = Blog::where('user_id', Auth::user()->id)->where('id', $request->blog_id)->firstOrFail(); $input['category_id'] = $request->category; $input['slug'] = $slug; $input['user_id'] = Auth::guard('web')->user()->id; if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/user/blogs/'), $filename); @unlink(public_path('assets/front/img/user/blogs/' . $blog->image)); $input['image'] = $filename; } if ($request->hasFile('image2')) { $filename2 = time() . '.' . $img2->getClientOriginalExtension(); $request->file('image2')->move(public_path('assets/front/img/user/blogs/'), $filename2); @unlink(public_path('assets/front/img/user/blogs/' . $blog->image2)); $input['image2'] = $filename2; } $input['content'] = Purifier::clean($request->content); $blog->update($input); Session::flash('success', __('Blog updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function getcats($langid) { return BlogCategory::where([ ['language_id', $langid], ['user_id', '=', Auth::guard('web')->user()->id], ['status', '=', 1] ])->get(); } public function delete(Request $request) { $blog = Blog::where('user_id', Auth::user()->id)->where('id', $request->blog_id)->firstOrFail(); if (file_exists(public_path('assets/front/img/user/blogs/' . $blog->image))) { @unlink(public_path('assets/front/img/user/blogs/' . $blog->image)); } $blog->delete(); Session::flash('success', __('Blog deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $blog = Blog::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); if (file_exists(public_path('assets/front/img/user/blogs/' . $blog->image))) { @unlink(public_path('assets/front/img/user/blogs/' . $blog->image)); } $blog->delete(); } Session::flash('success', __('Blogs deleted successfully') . '!'); return "success"; } } Http/Controllers/User/ColorController.php 0000644 00000002131 15213350435 0014540 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\BasicSetting; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; class ColorController extends Controller { public function index() { $data = BasicSetting::where('user_id', Auth::user()->id)->select('base_color', 'secondary_color'); if ($data->count() == 0) { $data = new BasicSetting; $data->user_id = Auth::user()->id; $data->save(); } else { $data = $data->firstOrFail(); } $data['data'] = $data; return view('user.settings.color', $data); } public function update(Request $request) { $data = BasicSetting::where('user_id', Auth::user()->id)->firstOrFail(); $data->base_color = str_replace('#', '', $request->base_color); $data->secondary_color = $request->secondary_color; $data->save(); Session::flash('success', __('Site Colors updated successfully') . '!'); return back(); } } Http/Controllers/User/DonationManagement/Payment/PayPalController.php 0000644 00000016211 15213350435 0022041 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Redirect; use PayPal\Api\Amount; use PayPal\Api\Item; use PayPal\Api\ItemList; use PayPal\Api\Payer; use PayPal\Api\Payment; use PayPal\Api\PaymentExecution; use PayPal\Api\RedirectUrls; use PayPal\Api\Transaction; use PayPal\Auth\OAuthTokenCredential; use PayPal\Exception\PPConnectionException; use PayPal\Rest\ApiContext; class PayPalController extends Controller { use MiscellaneousTrait; private $api_context; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'paypal') ->where('user_id', $user->id) ->first(); $paypalData = json_decode($data->information, true); $paypal_conf = Config::get('paypal'); $paypal_conf['client_id'] = $paypalData['client_id']; $paypal_conf['secret'] = $paypalData['client_secret']; $paypal_conf['settings']['mode'] = $paypalData['sandbox_check'] == 1 ? 'sandbox' : 'live'; $this->api_context = new ApiContext( new OAuthTokenCredential( $paypal_conf['client_id'], $paypal_conf['secret'] ) ); $this->api_context->setConfig($paypal_conf['settings']); } public function donationProcess(Request $request, $causeId, $userId) { $enrol = new DonationController(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // changing the currency before redirect to PayPal if ($currencyInfo->base_currency_text !== 'USD') { $rate = floatval($currencyInfo->base_currency_rate); $convertedTotal = round(($amount / $rate), 2); } $paypalTotal = $currencyInfo->base_currency_text === 'USD' ? $amount : $convertedTotal; $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'PayPal', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Given Donation'; $notifyURL = route('cause_donation.paypal.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); $payer = new Payer(); $payer->setPaymentMethod('paypal'); $item_1 = new Item(); $item_1->setName($title) /** item name **/ ->setCurrency('USD') ->setQuantity(1) ->setPrice($paypalTotal); /** unit price **/ $item_list = new ItemList(); $item_list->setItems(array($item_1)); $amount = new Amount(); $amount->setCurrency('USD') ->setTotal($paypalTotal); $transaction = new Transaction(); $transaction->setAmount($amount) ->setItemList($item_list) ->setDescription($title . ' via PayPal'); $redirect_urls = new RedirectUrls(); $redirect_urls->setReturnUrl($notifyURL) /** Specify return URL **/ ->setCancelUrl($cancelURL); $payment = new Payment(); $payment->setIntent('Sale') ->setPayer($payer) ->setRedirectUrls($redirect_urls) ->setTransactions(array($transaction)); try { $payment->create($this->api_context); } catch (PPConnectionException $ex) { return redirect($cancelURL)->with('error', $ex->getMessage()); } foreach ($payment->getLinks() as $link) { if ($link->getRel() == 'approval_url') { $redirectURL = $link->getHref(); break; } } // put some data in session before redirect to paypal url $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); $request->session()->put('paymentId', $payment->getId()); if (isset($redirectURL)) { /** redirect to paypal **/ return Redirect::away($redirectURL); } } public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $paymentId = $request->session()->get('paymentId'); $urlInfo = $request->all(); if (empty($urlInfo['token']) || empty($urlInfo['PayerID'])) { return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } /** Execute The Payment **/ $payment = Payment::get($paymentId, $this->api_context); $execution = new PaymentExecution(); $execution->setPayerId($urlInfo['PayerID']); $result = $payment->execute($execution, $this->api_context); if ($result->getState() == 'approved') { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/MercadoPagoController.php 0000644 00000015044 15213350435 0023037 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class MercadoPagoController extends Controller { use MiscellaneousTrait; private $token, $sandbox_status; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'mercadopago') ->where('user_id', $user->id) ->first(); $mercadopagoData = json_decode($data->information, true); $this->token = $mercadopagoData['token']; $this->sandbox_status = $mercadopagoData['sandbox_check']; } public function donationProcess(Request $request, $causeId, $userId) { $keywords = getUserKeywords(); $allowedCurrencies = array('ARS', 'BOB', 'BRL', 'CLF', 'CLP', 'COP', 'CRC', 'CUC', 'CUP', 'DOP', 'EUR', 'GTQ', 'HNL', 'MXN', 'NIO', 'PAB', 'PEN', 'PYG', 'USD', 'UYU', 'VEF', 'VES'); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for mercadopago payment.'); } $amount = (int)$request->amount; $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $request->amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'MercadoPago', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Donation'; $notifyURL = route('cause_donate.mercadopago.notify', getParam()); $completeURL = route('front.user.cause_donate.complete', [getParam(), 'donation']); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); $curl = curl_init(); $preferenceData = [ 'items' => [ [ 'id' => uniqid(), 'title' => $title, 'description' => 'Doante via MercadoPago', 'quantity' => 1, 'currency' => $currencyInfo->base_currency_text, 'unit_price' => $amount ] ], 'payer' => [ 'email' => $request->email ], 'back_urls' => [ 'success' => $notifyURL, 'pending' => '', 'failure' => $cancelURL ], 'notification_url' => $notifyURL, 'auto_return' => 'approved' ]; $httpHeader = ['Content-Type: application/json']; $url = 'https://api.mercadopago.com/checkout/preferences?access_token=' . $this->token; $curlOPT = [ CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode($preferenceData, true), CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => $httpHeader ]; curl_setopt_array($curl, $curlOPT); $response = curl_exec($curl); $responseInfo = json_decode($response, true); curl_close($curl); // put some data in session before redirect to mercadopago url $request->session()->put('userId', $userId); $request->session()->put('causeId', $causeId); $request->session()->put('arrData', $arrData); if ($this->sandbox_status == 1) { return redirect($responseInfo['sandbox_init_point']); } else { return redirect($responseInfo['init_point']); } } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $causeId = $request->session()->get('causeId'); $arrData = $request->session()->get('arrData'); $paymentURL = 'https://api.mercadopago.com/v1/payments/' . $request['payment_id'] . '?access_token=' . $this->token; $paymentData = $this->curlCalls($paymentURL); $paymentInfo = json_decode($paymentData, true); if ($paymentInfo['status'] == 'approved') { $cause = new DonationController(); // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $cause->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.complete', getParam()); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } public function curlCalls($url) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $curlData = curl_exec($curl); curl_close($curl); return $curlData; } } Http/Controllers/User/DonationManagement/Payment/PhonePeController.php 0000644 00000023400 15213350435 0022207 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Session; class PhonePeController extends Controller { use MiscellaneousTrait; private $sandboxCheck; public function donationProcess(Request $request, $causeId, $userId) { $user = getUser(); $keywords = getUserKeywords(); $enrol = new DonationController(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if ($currencyInfo->base_currency_text != 'INR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for phonepe payment.'); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'PhonePe', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Given Donation'; $notifyURL = route('cause_donation.phonepe.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'phonepe']])->first(); $paymentInfo = json_decode($paymentMethod->information, true); if (empty($paymentInfo['merchant_id']) || empty($paymentInfo['salt_key'])) { throw new \Exception('Invalid PhonePe configuration'); } $this->sandboxCheck = $paymentInfo['sandbox_check'] ?? 0; $clientId = $paymentInfo['merchant_id']; $clientSecret = $paymentInfo['salt_key']; // put some data in session before redirect to paypal url $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); $accessToken = $this->getPhonePeAccessToken($clientId, $clientSecret); if (!$accessToken) { return back()->withError('Failed to get PhonePe access token'); } return $this->initiatePayment($accessToken, $notifyURL, $cancelURL, $amount); } private function getPhonePeAccessToken($clientId, $clientSecret) { return Cache::remember('phonepe_access_token', 3500, function () use ($clientId, $clientSecret) { $tokenUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox/v1/oauth/token' : 'https://api.phonepe.com/apis/identity-manager/v1/oauth/token'; $response = Http::asForm()->post($tokenUrl, [ 'client_id' => $clientId, 'client_secret' => $clientSecret, 'client_version' => 1, 'grant_type' => 'client_credentials' ]); if ($response->successful()) { return $response->json()['access_token']; } return null; }); } public function initiatePayment($accessToken, $successUrl, $cancelUrl, $_amount) { $baseUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox' : 'https://api.phonepe.com/apis/pg'; $endpoint = '/checkout/v2/pay'; // Generate a unique merchantOrderId and store it in the session $merchantOrderId = uniqid(); Session::put('merchantOrderId', $merchantOrderId); Session::put('cancel_url', $cancelUrl); //here we preapare the parameter of the request $payload = [ 'merchantOrderId' => $merchantOrderId, 'amount' => intval($_amount * 100), //you have to multiply the amount by 100 to convert it to paise 'paymentFlow' => [ 'type' => 'PG_CHECKOUT', 'merchantUrls' => [ 'redirectUrl' => $successUrl, 'cancelUrl' => $cancelUrl ] ] ]; try { //after preparing the parameter we send a request to create a payment link $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'O-Bearer ' . $accessToken, ])->post($baseUrl . $endpoint, $payload); $responseData = $response->json(); //after successfully created the payment link of we redirect the user to api responsed redirectUrl if ($response->successful() && isset($responseData['redirectUrl'])) { return redirect()->away($responseData['redirectUrl']); } else { // Handle API errors $this->clearSession(request()); return back()->with('error', 'Failed to initiate payment: ' . ($responseData['message'] ?? 'Unknown error')); } } catch (\Exception $e) { $this->clearSession(request()); return response()->json([ 'success' => false, 'code' => 'NETWORK_ERROR', 'message' => $e->getMessage() ], 500); } } public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $merchantOrderId = $request->input('merchantOrderId') ?? Session::get('merchantOrderId') ?? uniqid(); $verificationResponse = $this->verifyOrderStatus($merchantOrderId); if ($verificationResponse['success']) { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $this->clearSession($request); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { $this->clearSession($request); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } private function verifyOrderStatus($merchantOrderId) { $user = getUser(); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'phonepe']])->first(); $paymentInfo = json_decode($paymentMethod->information, true); $this->sandboxCheck = $paymentInfo['sandbox_check'] ?? 0; try { $accessToken = $this->getPhonePeAccessToken( $paymentInfo['merchant_id'], $paymentInfo['salt_key'] ); if (!$accessToken) { throw new \Exception('Failed to get access token'); } $baseUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox' : 'https://api.phonepe.com/apis/pg'; $endpoint = "/checkout/v2/order/{$merchantOrderId}/status"; $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'O-Bearer ' . $accessToken, ])->get($baseUrl . $endpoint); if ($response->successful()) { $responseData = $response->json(); if ($responseData['state'] === 'COMPLETED') { return [ 'success' => true, 'state' => $responseData['state'], 'amount' => $responseData['amount'] ?? null, 'data' => $responseData, ]; } return [ 'success' => false, 'error' => 'Payment not completed: ' . ($responseData['state'] ?? 'Unknown state'), ]; } else { return [ 'success' => false, 'error' => $response->json() ?? 'Unknown error' ]; } } catch (\Exception $e) { return [ 'success' => false, 'error' => $e->getMessage() ]; } } private function clearSession(Request $request) { $request->session()->forget('causeId'); $request->session()->forget('userId'); $request->session()->forget('arrData'); $request->session()->forget('merchantOrderId'); $request->session()->forget('cancel_url'); } } Http/Controllers/User/DonationManagement/Payment/OfflineController.php 0000644 00000006465 15213350435 0022247 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Http\Helpers\Uploader; use App\Models\User\CourseManagement\CourseEnrolment; use App\Models\User\UserOfflineGateway; use App\Rules\ImageMimeTypeRule; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; class OfflineController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { $offlineGateway = UserOfflineGateway::query() ->where('user_id', $userId) ->find($request->gateway); // check whether attachment is required or not if ($offlineGateway->is_receipt == 1) { $rules = [ 'attachment' => [ 'required', new ImageMimeTypeRule() ] ]; $validator = Validator::make($request->all(), $rules); session()->flash('gatewayId', $offlineGateway->id); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } } $gname = $offlineGateway->name; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // store attachment in local storage if ($request->hasFile('attachment')) { $user_id = getUser()->id; $attachmentName = Uploader::upload_picture(Constant::WEBSITE_DONATION_ATTACHMENT, $request->file('attachment'), $user_id); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $request->amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => $gname, 'gatewayType' => 'offline', 'paymentStatus' => 'pending', 'attachmentFile' => $request->exists('attachment') ? $attachmentName : null ); $cause = new DonationController(); // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format // $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database // $donationDetails->update(['invoice' => $invoice]); // if ($donationDetails->email) { // // send a mail to the customer with the invoice // $cause->sendMail($donationDetails, $userId); // } return redirect()->route('front.user.cause_donate.complete', [getParam(), 'via' => 'offline']); } } Http/Controllers/User/DonationManagement/Payment/MyFatoorahController.php 0000644 00000015663 15213350435 0022736 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Basel\MyFatoorah\MyFatoorah; use Illuminate\Support\Facades\Config; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\DonationManagement\DonationController; class MyFatoorahController extends Controller { public $myfatoorah; use MiscellaneousTrait; public function __construct() { if (Session::has('user_midtrans')) { $user = Session::get('user_midtrans'); } else { $user = getUser(); } $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'myfatoorah']])->first(); $paydata = json_decode($paymentMethod->information, true); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); Config::set('myfatorah.token', $paydata['token']); Config::set('myfatorah.DisplayCurrencyIso', $currencyInfo->base_currency_text); Config::set('myfatorah.CallBackUrl', route('myfatoorah.success')); Config::set('myfatorah.ErrorUrl', route('myfatoorah.cancel')); if ($paydata['sandbox_status'] == 1) { $this->myfatoorah = MyFatoorah::getInstance(true); } else { $this->myfatoorah = MyFatoorah::getInstance(false); } } public function donationProcess(Request $request, $causeId, $userId) { $enrol = new DonationController(); $keywords = getUserKeywords(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not $allowed_currency = array('KWD', 'SAR', 'BHD', 'AED', 'QAR', 'OMR', 'JOD'); if (!in_array($currencyInfo->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for myfatoorah payment.'); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'MyFatoorah', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $user = getUser(); Session::put('user_midtrans', $user); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); $success_url = route('front.user.cause_donate.complete', [getParam(), 'donation']); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ Session::put('myfatoorah_cancel_url', $cancelURL); Session::put('myfatoorah_success_url', $success_url); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'myfatoorah']])->first(); $paydata = $paymentMethod->convertAutoData(); $random_1 = rand(999, 9999); $random_2 = rand(9999, 99999); if (empty($request["checkbox"])) { $name = $request->name; $phone = $request->phone; } else { $name = 'anonymous@gmail.com'; $phone = '1234567890'; } // create a payment request $result = $this->myfatoorah->sendPayment( $name, $amount, [ 'CustomerMobile' => $paydata['sandbox_status'] == 1 ? '56562123544' : $phone, 'CustomerReference' => "$random_1", //orderID 'UserDefinedField' => "$random_2", //clientID "InvoiceItems" => [ [ "ItemName" => "Product Purchase or Room Booking", "Quantity" => 1, "UnitPrice" => $amount ] ] ] ); if ($result && $result['IsSuccess'] == true) { // put data in session for future use $request->session()->put('myfatoorah_payment_type', 'donation'); $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); // redirect to payment url for accept payment return redirect($result['Data']['InvoiceURL']); } else { // if fail then return to cancel url return redirect($cancelURL); } } // return to success page public function successPayment(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); if (!empty($request->paymentId)) { $result = $this->myfatoorah->getPaymentStatus('paymentId', $request->paymentId); if ($result && $result['IsSuccess'] == true && $result['Data']['InvoiceStatus'] == "Paid") { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); // if successfully completed all process then return for success url return [ 'status' => 'success' ]; } else { // if fail then return for cancel url return [ 'status' => 'fail' ]; } } } } Http/Controllers/User/DonationManagement/Payment/PaystackController.php 0000644 00000011753 15213350435 0022440 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class PaystackController extends Controller { use MiscellaneousTrait; private $api_key; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'paystack') ->where('user_id', $user->id) ->first(); $paystackData = json_decode($data->information, true); $this->api_key = $paystackData['key']; } public function donationProcess(Request $request, $causeId, $userId) { $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $keywords = getUserKeywords(); // checking whether the currency is set to 'NGN' or not if ($currencyInfo->base_currency_text !== 'NGN') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ??'Invalid currency for paystack payment.')->withInput(); } $email = empty($request["checkbox"]) ? $request["email"] : $request["paystack_email"]; $arrData = array( 'causeId' => $causeId, 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => $email, 'amount' => $request->amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Paystack', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('cause_donate.paystack.notify', getParam()); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.paystack.co/transaction/initialize', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode([ 'amount' => intval($request->amount) * 100, 'email' => $email, 'callback_url' => $notifyURL ]), CURLOPT_HTTPHEADER => [ 'authorization: Bearer ' . $this->api_key, 'content-type: application/json', 'cache-control: no-cache' ] )); $response = curl_exec($curl); curl_close($curl); $transaction = json_decode($response, true); // put some data in session before redirect to paystack url $request->session()->put('userId', $userId); $request->session()->put('causeId', $causeId); $request->session()->put('arrData', $arrData); if ($transaction['status'] == true) { return redirect($transaction['data']['authorization_url']); } else { return redirect()->back()->with('error', 'Error: ' . $transaction['message'])->withInput(); } } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $causeId = $request->session()->get('causeId'); $arrData = $request->session()->get('arrData'); $urlInfo = $request->all(); if ($urlInfo['trxref'] === $urlInfo['reference']) { $cause = new DonationController(); // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $cause->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/MollieController.php 0000644 00000011771 15213350435 0022102 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Mollie\Api\MollieApiClient; class MollieController extends Controller { use MiscellaneousTrait; protected $mollie, $key; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'mollie') ->where('user_id', $user->id) ->first(); $mollieData = json_decode($data->information, true); $this->key = $mollieData['key']; $this->mollie = new MollieApiClient(); $this->mollie->setApiKey($this->key); } public function donationProcess(Request $request, $causeId, $userId) { $keywords = getUserKeywords(); $allowedCurrencies = array('AED', 'AUD', 'BGN', 'BRL', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HRK', 'HUF', 'ILS', 'ISK', 'JPY', 'MXN', 'MYR', 'NOK', 'NZD', 'PHP', 'PLN', 'RON', 'RUB', 'SEK', 'SGD', 'THB', 'TWD', 'USD', 'ZAR'); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for mollie payment.')->withInput(); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $request->amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Mollie', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('cause_donate.mollie.notify', getParam()); /** * we must send the correct number of decimals. * thus, we have used sprintf() function for format. */ $payment = $this->mollie->payments->create([ 'amount' => [ 'currency' => $currencyInfo->base_currency_text, 'value' => sprintf('%0.2f', $request->amount) ], 'description' => 'Donate Via Mollie', 'redirectUrl' => $notifyURL ]); // put some data in session before redirect to mollie url $request->session()->put('userId', $userId); $request->session()->put('causeId', $causeId); $request->session()->put('arrData', $arrData); $request->session()->put('paymentId', $payment->id); return redirect($payment->getCheckoutUrl(), 303); } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $causeId = $request->session()->get('causeId'); $arrData = $request->session()->get('arrData'); $paymentId = $request->session()->get('paymentId'); $paymentInfo = $this->mollie->payments->get($paymentId); if ($paymentInfo->isPaid() == true) { $cause = new DonationController(); // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $cause->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/ToyyibpayController.php 0000644 00000014203 15213350435 0022643 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; class ToyyibpayController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $enrol = new DonationController(); $keywords = getUserKeywords(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if ($currencyInfo->base_currency_text != 'RM') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for toyyibpay payment.'); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Toyyibpay', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $user = getUser(); $notifyURL = route('cause_donation.toyyibpay.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [ getParam(), 'id' => $causeId ]); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'toyyibpay']])->first(); $paydata = json_decode( $paymentMethod->information, true ); $ref = uniqid(); session()->put('toyyibpay_ref_id', $ref); $some_data = array( 'userSecretKey' => $paydata['secret_key'], 'categoryCode' => $paydata['category_code'], 'billName' => 'Course Enrolment', 'billDescription' => 'Pay via Course Enrolment', 'billPriceSetting' => 1, 'billPayorInfo' => 1, 'billAmount' => $request->amount * 100, 'billReturnUrl' => $notifyURL, 'billExternalReferenceNo' => $ref, 'billTo' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'billEmail' => empty($request["checkbox"]) ? $request["email"] : "anoymous@gmail.com", 'billPhone' => empty($request["checkbox"]) ? $request["phone"] : "04982409238", ); if ($paydata['sandbox_status'] == 1) { $host = 'https://dev.toyyibpay.com/'; // for development environment } else { $host = 'https://toyyibpay.com/'; // for production environment } $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, $host . 'index.php/api/createBill'); // sandbox will be dev. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $response = json_decode($result, true); if (!empty($response[0])) { // put some data in session before redirect to xendit url $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); return redirect($host . $response[0]["BillCode"]); } else { return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $ref = session()->get('toyyibpay_ref_id'); if ($request['status_id'] == 1 && $request['order_id'] == $ref) { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/RazorpayController.php 0000644 00000014501 15213350435 0022462 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\BasicSetting; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Razorpay\Api\Api; use Razorpay\Api\Errors\SignatureVerificationError; class RazorpayController extends Controller { use MiscellaneousTrait; private $key, $secret, $api; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'razorpay') ->where('user_id', $user->id) ->first(); $razorpayData = json_decode($data->information, true); $this->key = $razorpayData['key']; $this->secret = $razorpayData['secret']; $this->api = new Api($this->key, $this->secret); } public function donationProcess(Request $request, $causeId, $userId) { $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $keywords = getUserKeywords(); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for razorpay payment.')->withInput(); } $name = empty($request["checkbox"]) ? $request["name"] : "anonymous"; $phone = empty($request["checkbox"]) ? $request["phone"] : $request['razorpay_phone']; $email = empty($request["checkbox"]) ? $request["email"] : $request['razorpay_email']; $arrData = array( 'name' => $name, 'email' => $email, 'phone' => $phone, 'causeId' => $causeId, 'amount' => $request->amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Razorpay', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('cause_donate.razorpay.notify', getParam()); // create order data $orderData = [ 'receipt' => 'Given Donation', 'amount' => $request->amount * 100, 'currency' => 'INR', 'payment_capture' => 1 // auto capture ]; $razorpayOrder = $this->api->order->create($orderData); $webInfo = BasicSetting::where('user_id', $userId)->select('website_title')->first(); $buyerName = $name; $buyerEmail = $email; $buyerContact = $phone; // create checkout data $checkoutData = [ 'key' => $this->key, 'amount' => $request->amount, 'name' => $webInfo->website_title, 'description' => 'Donate Via Razorpay', 'prefill' => [ 'name' => $buyerName, 'email' => $buyerEmail, 'contact' => $buyerContact ], 'order_id' => $razorpayOrder->id ]; $jsonData = json_encode($checkoutData); // put some data in session before redirect to razorpay url $request->session()->put('userId', $userId); $request->session()->put('causeId', $causeId); $request->session()->put('arrData', $arrData); $request->session()->put('razorpayOrderId', $razorpayOrder->id); return view('user-front.donation_management.payment.razorpay', [getParam(), 'jsonData' => $jsonData, 'notifyURL' => $notifyURL]); } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $causeId = $request->session()->get('causeId'); $arrData = $request->session()->get('arrData'); $razorpayOrderId = $request->session()->get('razorpayOrderId'); $urlInfo = $request->all(); // assume that the transaction was successful $success = true; /** * either razorpay_order_id or razorpay_subscription_id must be present. * the keys of $attributes array must be followed razorpay convention. */ try { $attributes = [ 'razorpay_order_id' => $razorpayOrderId, 'razorpay_payment_id' => $urlInfo['razorpayPaymentId'], 'razorpay_signature' => $urlInfo['razorpaySignature'] ]; $this->api->utility->verifyPaymentSignature($attributes); } catch (SignatureVerificationError $e) { $success = false; } if ($success === true) { $cause = new DonationController(); // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $cause->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('razorpayOrderId'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('razorpayOrderId'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/AuthorizenetController.php 0000644 00000011572 15213350435 0023341 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Omnipay\Omnipay; class AuthorizenetController extends Controller { use MiscellaneousTrait; public $gateway; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'authorize.net') ->where('user_id', $user->id) ->first(); $paydata = $data->convertAutoData(); $this->gateway = Omnipay::create('AuthorizeNetApi_Api'); $this->gateway->setAuthName($paydata['login_id']); $this->gateway->setTransactionKey($paydata['transaction_key']); if ($paydata['sandbox_check'] == 1) { $this->gateway->setTestMode(true); } } public function donationProcess(Request $request, $causeId, $userId) { $allowedCurrencies = array('BIF', 'CAD', 'CDF', 'CVE', 'EUR', 'GBP', 'GHS', 'GMD', 'GNF', 'KES', 'LRD', 'MWK', 'MZN', 'NGN', 'RWF', 'SLL', 'STD', 'TZS', 'UGX', 'USD', 'XAF', 'XOF', 'ZMK', 'ZMW', 'ZWD'); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $keywords = getUserKeywords(); if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for Authorize Net payment.')->withInput(); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $request->amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Authorize.net', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $amount = (int) $request->amount; if ($request->input('opaqueDataDescriptor') && $request->input('opaqueDataValue')) { try { // Generate a unique merchant site transaction ID. $transactionId = rand(100000000, 999999999); $response = $this->gateway->authorize([ 'amount' => $amount, 'currency' => $currencyInfo->base_currency_text, 'transactionId' => $transactionId, 'opaqueDataDescriptor' => $request->input('opaqueDataDescriptor'), 'opaqueDataValue' => $request->input('opaqueDataValue'), ])->send(); if ($response->isSuccessful()) { // Captured from the authorization response. $transactionReference = $response->getTransactionReference(); $response = $this->gateway->capture([ 'amount' => $amount, 'currency' => $currencyInfo->base_currency_text, 'transactionReference' => $transactionReference, ])->send(); $transaction_id = $response->getTransactionReference(); $cause = new DonationController(); // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $cause->sendMail($donationDetails, $userId); } return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // not successful session()->flash('error', $response->getMessage()); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } catch (\Exception $e) { session()->flash('error', $e->getMessage()); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } } Http/Controllers/User/DonationManagement/Payment/PaytmController.php 0000644 00000011650 15213350435 0021747 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use Anand\LaravelPaytmWallet\Facades\PaytmWallet; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class PaytmController extends Controller { use MiscellaneousTrait; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'paytm') ->where('user_id', $user->id) ->first(); $paytmData = json_decode($data->information, true); config([ // in case you would like to overwrite values inside config/services.php 'services.paytm-wallet.env' => $paytmData['environment'], 'services.paytm-wallet.merchant_id' => $paytmData['secret'], 'services.paytm-wallet.merchant_key' => $paytmData['merchant'], 'services.paytm-wallet.merchant_website' => $paytmData['website'], 'services.paytm-wallet.industry_type' => $paytmData['industry'], 'services.paytm-wallet.channel' => 'WEB', ]); } public function donationProcess(Request $request, $causeId, $userId) { $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $keywords = getUserKeywords(); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for paytm payment.')->withInput(); } $email = empty($request["checkbox"]) ? $request["email"] : $request["paytm_email"]; $phone = empty($request["checkbox"]) ? $request["phone"] : $request['paytm_phone']; $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => $email, 'phone' => $phone, 'causeId' => $causeId, 'amount' => $request->amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Paytm', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('cause_donate.paytm.notify', getParam()); $payment = PaytmWallet::with('receive'); $payment->prepare([ 'order' => time(), 'user' => uniqid(), 'mobile_number' => $phone, 'email' => $email, 'amount' => $request->amount, 'callback_url' => $notifyURL ]); // put some data in session before redirect to paytm url $request->session()->put('userId', $userId); $request->session()->put('causeId', $causeId); $request->session()->put('arrData', $arrData); return $payment->receive(); } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $causeId = $request->session()->get('causeId'); $arrData = $request->session()->get('arrData'); $transaction = PaytmWallet::with('receive'); // this response is needed to check the transaction status $response = $transaction->response(); if ($transaction->isSuccessful()) { $cause = new DonationController(); // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $cause->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('causeId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('causeId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/PaytabsController.php 0000644 00000012465 15213350435 0022265 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; class PaytabsController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { $enrol = new DonationController(); $user = getUser(); $keywords = getUserKeywords(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not $paytabInfo = paytabInfo('user', $user->id); if ($currencyInfo->base_currency_text != $paytabInfo['currency']) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for paytabs payment.'); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Paytabs', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $user = getUser(); $notifyURL = route('cause_donation.paytabs.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paytabInfo = paytabInfo('user', $user->id); $description = 'Course enrolment via paytabs'; try { $response = Http::withHeaders([ 'Authorization' => $paytabInfo['server_key'], // Server Key 'Content-Type' => 'application/json', ])->post( $paytabInfo['url'], [ 'profile_id' => $paytabInfo['profile_id'], // Profile ID 'tran_type' => 'sale', 'tran_class' => 'ecom', 'cart_id' => uniqid(), 'cart_description' => $description, 'cart_currency' => $paytabInfo['currency'], // set currency by region 'cart_amount' => round($amount, 2), 'return' => $notifyURL, ] ); $responseData = $response->json(); // put some data in session before redirect to yoco url $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); return redirect()->to($responseData['redirect_url']); } catch (\Exception $e) { return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $resp = $request->all(); if ($resp['respStatus'] == "A" && $resp['respMessage'] == 'Authorised') { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('causeId'); $request->session()->forget('userId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('causeId'); $request->session()->forget('userId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/FlutterwaveController.php 0000644 00000017531 15213350435 0023171 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use KingFlamez\Rave\Facades\Rave as Flutterwave; class FlutterwaveController extends Controller { use MiscellaneousTrait; protected $key, $secret; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'flutterwave') ->where('user_id', $user->id) ->first(); $flutterwaveData = json_decode($data->information, true); $this->key = $flutterwaveData['public_key']; $this->secret = $flutterwaveData['secret_key']; config([ // in case you would like to overwrite values inside config/services.php 'flutterwave.publicKey' => $this->key, 'flutterwave.secretKey' => $this->secret, 'flutterwave.secretHash' => '', ]); } public function donationProcess(Request $request, $causeId, $userId) { $allowedCurrencies = array('BIF', 'CAD', 'CDF', 'CVE', 'EUR', 'GBP', 'GHS', 'GMD', 'GNF', 'KES', 'LRD', 'MWK', 'MZN', 'NGN', 'RWF', 'SLL', 'STD', 'TZS', 'UGX', 'USD', 'XAF', 'XOF', 'ZMK', 'ZMW', 'ZWD'); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $keywords = getUserKeywords(); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for flutterwave payment.')->withInput(); } $email = empty($request["checkbox"]) ? $request["email"] : $request["flutterwave_email"]; $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => $email, 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $request->amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Flutterwave', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Donate'; $notifyURL = route('cause_donate.flutterwave.notify', getParam()); $cancel_url = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); // // generate a payment reference $paymentId = uniqid(); $curl = curl_init(); $currency = $currencyInfo->base_currency_text; $txref = $paymentId; // ensure you generate unique references per transaction. $PBFPubKey = $this->key; // get your public key from the dashboard. $redirect_url = $notifyURL; $payment_plan = ""; // this curl_setopt_array($curl, array( CURLOPT_URL => "https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/hosted/pay", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'amount' => $request->amount, 'customer_email' => $email, 'currency' => $currency, 'txref' => $txref, 'PBFPubKey' => $PBFPubKey, 'redirect_url' => $redirect_url, 'payment_plan' => $payment_plan ]), CURLOPT_HTTPHEADER => [ "content-type: application/json", "cache-control: no-cache" ], )); $response = curl_exec($curl); $err = curl_error($curl); if ($err) { // there was an error contacting the rave API return redirect($cancel_url)->with('error', 'Curl returned error: ' . $err); } // put some data in session before redirect to flutterwave url $request->session()->put('causeId', $causeId); $request->session()->put('arrData', $arrData); $request->session()->put('userId', $userId); $request->session()->put('paymentId', $paymentId); $transaction = json_decode($response); if ($transaction->status == 'error' || (!$transaction->data && !$transaction->data->link)) { // there was an error from the API return redirect($cancel_url)->with('error', 'API returned error: ' . $transaction->message); } return redirect()->to($transaction->data->link); } public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $cancelUrl = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); $urlInfo = $request->all(); $paymentId = Session::get('paymentId'); if (isset($request['txref'])) { $ref = $paymentId; $query = array( "SECKEY" => $this->secret, "txref" => $ref ); $data_string = json_encode($query); $ch = curl_init('https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $response = curl_exec($ch); curl_close($ch); $resp = json_decode($response, true); if ($resp['status'] == 'error') { return redirect($cancelUrl); } if ($resp['status'] = "success") { $cause = new DonationController; // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $cause->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('causeId'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('causeId'); $request->session()->forget('paymentId'); $request->session()->forget('arrData'); return redirect($cancelUrl); } } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('causeId'); $request->session()->forget('arrData'); return redirect($cancelUrl); } } } Http/Controllers/User/DonationManagement/Payment/MidtransController.php 0000644 00000014352 15213350435 0022440 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; use Midtrans\Snap; use Midtrans\Config as MidtransConfig; class MidtransController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { $enrol = new DonationController(); $keywords = getUserKeywords(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if ($currencyInfo->base_currency_text != 'IDR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for midtrans payment.'); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Midtrans', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $user = getUser(); $notifyURL = route('cause_donation.midtrans.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'midtrans']])->first(); $paydata = $paymentMethod->convertAutoData(); // will come from database MidtransConfig::$serverKey = $paydata['server_key']; MidtransConfig::$isProduction = $paydata['is_production'] == 0 ? true : false; MidtransConfig::$isSanitized = true; MidtransConfig::$is3ds = true; $token = uniqid(); Session::put('token', $token); $params = [ 'transaction_details' => [ 'order_id' => $token, 'gross_amount' => $amount * 1000, // will be multiplied by 1000 ], 'customer_details' => [ 'first_name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous@gmail.com", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "99999999999", ], ]; $snapToken = Snap::getSnapToken($params); // put some data in session before redirect to midtrans url if ( $paydata['is_production'] == 1 ) { $is_production = $paydata['is_production']; } $data['title'] = "Donation via midtrans"; $data['snapToken'] = $snapToken; $data['is_production'] = $is_production; $data['success_url'] = $notifyURL; $data['_cancel_url'] = $cancelURL; $data['client_key'] = $paydata['server_key']; // put some data in session before redirect to xendit url $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); //put data into session for midtrans bank notify Session::put('user_midtrans', $user); Session::put('midtrans_payment_type', 'causes'); Session::put('midtrans_cancel_url', route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId])); Session::put('midtrans_success_url', route('front.user.cause_donate.complete', [getParam(), 'donation'])); return view('payments.midtrans-membership', $data); } // return to success page public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $token = Session::get('token'); if ($request->status_code == 200 && $token == $request->order_id) { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('causeId', $causeId); $request->session()->forget('userId', $userId); $request->session()->forget('arrData', $arrData); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('causeId', $causeId); $request->session()->forget('userId', $userId); $request->session()->forget('arrData', $arrData); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/PerfectMoneyController.php 0000644 00000014015 15213350435 0023253 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use App\Models\User\BasicSetting; use Illuminate\Support\Facades\Session; class PerfectMoneyController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { $user = getUser(); $keywords = getUserKeywords(); $enrol = new DonationController(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if ($currencyInfo->base_currency_text != 'USD') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for phonepe payment.'); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Perfect Money', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Given Donation'; $notifyURL = route('cause_donation.perfect_money.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); $data = UserPaymentGeteway::query() ->where('keyword', 'perfect_money') ->where('user_id', $user->id) ->first(); $paydata = json_decode($data->information, true); $random_id = rand(111, 999); /*--------------------------------------- ========= Payment gatewyay =============== ----------------------------------------*/ $user = getUser(); $userBs = BasicSetting::select('website_title')->where('user_id', $user->id)->first(); $randomNo = substr(uniqid(), 0, 8); $val['PAYEE_ACCOUNT'] = $paydata['perfect_money_wallet_id'];; $val['PAYEE_NAME'] = $userBs->website_title; $val['PAYMENT_ID'] = "$randomNo"; //random id $val['PAYMENT_AMOUNT'] = $amount; // $val['PAYMENT_AMOUNT'] = 0.01; //test amount $val['PAYMENT_UNITS'] = "$currencyInfo->base_currency_text"; $val['STATUS_URL'] = $notifyURL; $val['PAYMENT_URL'] = $notifyURL; $val['PAYMENT_URL_METHOD'] = 'GET'; $val['NOPAYMENT_URL'] = $cancelURL; $val['NOPAYMENT_URL_METHOD'] = 'GET'; $val['SUGGESTED_MEMO'] = empty($request["checkbox"]) ? $request["email"] : "anoymous"; $val['BAGGAGE_FIELDS'] = 'IDENT'; $data['val'] = $val; $data['method'] = 'post'; $data['url'] = 'https://perfectmoney.com/api/step1.asp'; // put some data in session before redirect to paypal url Session::put('payment_id', $randomNo); Session::put('cancel_url', $cancelURL); Session::put('amount', $amount); // Session::put('amount', 0.01); //test amount // put some data in session before redirect to paypal url $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); return view('payments.perfect-money', compact('data')); } public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $amo = $request['PAYMENT_AMOUNT']; $track = $request['PAYMENT_ID']; $id = Session::get('payment_id'); $final_amount = Session::get('amount'); $paymentMethod = UserPaymentGeteway::where('keyword', 'perfect_money')->first(); $perfectMoneyInfo = $paymentMethod->convertAutoData(); if ($request->PAYEE_ACCOUNT == $perfectMoneyInfo['perfect_money_wallet_id'] && $track == $id && $amo == round($final_amount, 2)) { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); Session::forget('payment_id'); Session::forget('amount'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); Session::forget('payment_id'); Session::forget('amount'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/XenditController.php 0000644 00000013435 15213350435 0022113 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; class XenditController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { $enrol = new DonationController(); $keywords = getUserKeywords(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not $allowed_currency = array('IDR', 'PHP', 'USD', 'SGD', 'MYR'); if (!in_array($currencyInfo->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for xendit payment.'); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Xendit', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('cause_donation.xendit.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'xendit']])->first(); $paydata = json_decode($paymentMethod->information, true); $external_id = Str::random(10); $secret_key = 'Basic ' . base64_encode($paydata['secret_key'] . ':'); $data_request = Http::withHeaders([ 'Authorization' => $secret_key ])->post('https://api.xendit.co/v2/invoices', [ 'external_id' => $external_id, 'amount' => $amount, 'currency' => $currencyInfo->base_currency_text, 'success_redirect_url' => $notifyURL ]); $response = $data_request->object(); $response = json_decode(json_encode($response), true); if (!empty($response['success_redirect_url'])) { // put some data in session before redirect to xendit url $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); $request->session()->put('xendit_id', $response['id']); $request->session()->put('secret_key', $secret_key); return redirect($response['invoice_url']); } else { return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $xendit_id = Session::get('xendit_id'); $secret_key = Session::get('secret_key'); $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'xendit']])->first(); $paydata = json_decode($paymentMethod->information, true); $p_secret_key = 'Basic ' . base64_encode($paydata['secret_key'] . ':'); if (!is_null($xendit_id) && $secret_key == $p_secret_key) { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); $request->session()->forget('xendit_id'); $request->session()->forget('secret_key'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('xendit_id'); $request->session()->forget('secret_key'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/IyzicoController.php 0000644 00000017362 15213350435 0022131 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; class IyzicoController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { $enrol = new DonationController(); $keywords = getUserKeywords(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if ($currencyInfo->base_currency_text != 'TRY') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for iyzico payment.'); } $conversion_id = uniqid(9999, 999999); $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Iyzico', 'gatewayType' => 'online', 'paymentStatus' => 'pending', 'conversation_id' => $conversion_id ); $user = getUser(); $notifyURL = route('cause_donation.iyzico.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $first_name = $request["name"]; $last_name = $request["name"]; $email = $request["email"]; $phone = $request["phone"]; $identity_number = $request['identity_number']; $city = $request['city']; $country = $request['country']; $zip_code = $request['zip_code']; $address = $request['address']; $basket_id = 'B' . uniqid(999, 99999); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'iyzico']])->first(); $paydata = json_decode($paymentMethod->information, true); $options = new \Iyzipay\Options(); $options->setApiKey($paydata['api_key']); $options->setSecretKey($paydata['secret_key']); if ($paydata['sandbox_status'] == 1) { $options->setBaseUrl("https://sandbox-api.iyzipay.com"); } else { $options->setBaseUrl("https://api.iyzipay.com"); // production mode } # create request class $request = new \Iyzipay\Request\CreatePayWithIyzicoInitializeRequest(); $request->setLocale(\Iyzipay\Model\Locale::EN); $request->setConversationId($conversion_id); $request->setPrice($amount); $request->setPaidPrice($amount); $request->setCurrency(\Iyzipay\Model\Currency::TL); $request->setBasketId($basket_id); $request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT); $request->setCallbackUrl($notifyURL); $request->setEnabledInstallments(array(2, 3, 6, 9)); $buyer = new \Iyzipay\Model\Buyer(); $buyer->setId(uniqid()); $buyer->setName($first_name); $buyer->setSurname($last_name); $buyer->setGsmNumber($phone); $buyer->setEmail($email); $buyer->setIdentityNumber($identity_number); $buyer->setLastLoginDate(""); $buyer->setRegistrationDate(""); $buyer->setRegistrationAddress($address); $buyer->setIp(""); $buyer->setCity($city); $buyer->setCountry($country); $buyer->setZipCode($zip_code); $request->setBuyer($buyer); $shippingAddress = new \Iyzipay\Model\Address(); $shippingAddress->setContactName($first_name); $shippingAddress->setCity($city); $shippingAddress->setCountry($country); $shippingAddress->setAddress($address); $shippingAddress->setZipCode($zip_code); $request->setShippingAddress($shippingAddress); $billingAddress = new \Iyzipay\Model\Address(); $billingAddress->setContactName($first_name); $billingAddress->setCity($city); $billingAddress->setCountry($country); $billingAddress->setAddress($address); $billingAddress->setZipCode($zip_code); $request->setBillingAddress($billingAddress); $q_id = uniqid(999, 99999); $basketItems = array(); $firstBasketItem = new \Iyzipay\Model\BasketItem(); $firstBasketItem->setId($q_id); $firstBasketItem->setName("Course Id " . $q_id); $firstBasketItem->setCategory1("Course Enrolment"); $firstBasketItem->setCategory2(""); $firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL); $firstBasketItem->setPrice($amount); $basketItems[0] = $firstBasketItem; $request->setBasketItems($basketItems); # make request $payWithIyzicoInitialize = \Iyzipay\Model\PayWithIyzicoInitialize::create($request, $options); $paymentResponse = (array)$payWithIyzicoInitialize; foreach ($paymentResponse as $key => $data) { $paymentInfo = json_decode($data, true); if ($paymentInfo['status'] == 'success') { if (!empty($paymentInfo['payWithIyzicoPageUrl'])) { Session::put('conversation_id', $conversion_id); // put some data in session before redirect to xendit url // put some data in session before redirect to yoco url Session::put('causeId', $causeId); Session::put('userId', $userId); Session::put('arrData', $arrData); return redirect($paymentInfo['payWithIyzicoPageUrl']); } } return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } } Http/Controllers/User/DonationManagement/Payment/InstamojoController.php 0000644 00000011623 15213350435 0022620 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Http\Helpers\Instamojo; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Exception; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class InstamojoController extends Controller { use MiscellaneousTrait; private $api; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'instamojo') ->where('user_id', $user->id) ->first(); $instamojoData = json_decode($data->information, true); // dd($instamojoData); if ($instamojoData['sandbox_check'] == 1) { $this->api = new Instamojo($instamojoData['key'], $instamojoData['token'], 'https://test.instamojo.com/api/1.1/'); } else { $this->api = new Instamojo($instamojoData['key'], $instamojoData['token']); } } public function donationProcess(Request $request, $causeId, $userId) { $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $keywords = getUserKeywords(); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for instamojo payment.')->withInput(); } $amount = $request['amount']; $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Instamojo', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Given Donation'; $notifyURL = route('cause_donate.instamojo.notify', getParam()); try { $response = $this->api->paymentRequestCreate(array( 'purpose' => $title, 'amount' => $amount, 'send_email' => false, 'email' => null, 'redirect_url' => $notifyURL )); // // put some data in session before redirect to instamojo url $request->session()->put('userId', $userId); $request->session()->put('courseId', $causeId); $request->session()->put('arrData', $arrData); $request->session()->put('paymentId', $response['id']); return redirect($response['longurl']); } catch (Exception $e) { return redirect()->back()->with('error', $e)->withInput(); } } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $causeId = $request->session()->get('causeId'); $arrData = $request->session()->get('arrData'); $paymentId = $request->session()->get('paymentId'); $urlInfo = $request->all(); if ($urlInfo['payment_request_id'] == $paymentId) { $enrol = new DonationController(); // store the course enrolment information in database $donationInfo = $enrol->store($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($donationInfo, $userId); // then, update the invoice field info in database $donationInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice if ($donationInfo->email) { $enrol->sendMail($donationInfo, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('causeId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/YocoController.php 0000644 00000012651 15213350435 0021570 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; class YocoController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { $enrol = new DonationController(); $keywords = getUserKeywords(); // do calculation $amount = $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if ($currencyInfo->base_currency_text != 'ZAR') { return redirect()->back()->with('error', $keywords['Invalid_currency'] ?? 'Invalid currency for yoco payment.'); } $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Yoco', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $user = getUser(); $notifyURL = route('cause_donation.yoco.notify', getParam()); $cancelURL = route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'yoco']])->first(); $paydata = json_decode($paymentMethod->information, true); $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $paydata['secret_key'], ])->post('https://payments.yoco.com/api/checkouts', [ 'amount' => $amount * 100, 'currency' => 'ZAR', 'successUrl' => $notifyURL ]); $responseData = $response->json(); if (array_key_exists('redirectUrl', $responseData)) { // put some data in session before redirect to yoco url $request->session()->put('causeId', $causeId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); $request->session()->put('yoco_id', $responseData['id']); $request->session()->put('s_key', $paydata['secret_key']); return redirect($responseData["redirectUrl"]); } else { return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $causeId = $request->session()->get('causeId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $id = Session::get('yoco_id'); $s_key = Session::get('s_key'); $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'yoco']])->first(); $paydata = json_decode($paymentMethod->information, true); if ($id && $paydata['secret_key'] == $s_key) { $donate = new DonationController(); // store the course enrolment information in database $donationDetails = $donate->store($arrData, $userId); // generate an invoice in pdf format $invoice = $donate->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // dd($donationDetails); // send a mail to the customer with the invoice $donate->sendMail($donationDetails, $userId); } // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); $request->session()->forget('yoco_id'); $request->session()->forget('s_key'); return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('cause'); $request->session()->forget('arrData'); $request->session()->forget('yoco_id'); $request->session()->forget('s_key'); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/Payment/StripeController.php 0000644 00000011736 15213350435 0022130 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Controllers\Front\DonationManagement\DonationController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Cartalyst\Stripe\Exception\CardErrorException; use Cartalyst\Stripe\Exception\UnauthorizedException; use Cartalyst\Stripe\Laravel\Facades\Stripe; use Illuminate\Http\Request; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Validator; class StripeController extends Controller { use MiscellaneousTrait; public function donationProcess(Request $request, $causeId, $userId) { // card validation start $rules = [ // 'card_number' => 'required', // 'cvc_number' => 'required', // 'expiry_month' => 'required', 'stripeToken' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } // card validation end $amount = (int) $request->amount; $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // changing the currency before redirect to Stripe if ($currencyInfo->base_currency_text !== 'USD') { $rate = floatval($currencyInfo->base_currency_rate); $convertedTotal = round(($amount / $rate), 2); } $stripeTotal = $currencyInfo->base_currency_text === 'USD' ? $amount : $convertedTotal; $arrData = array( 'name' => empty($request["checkbox"]) ? $request["name"] : "anonymous", 'email' => empty($request["checkbox"]) ? $request["email"] : "anoymous", 'phone' => empty($request["checkbox"]) ? $request["phone"] : "anoymous", 'causeId' => $causeId, 'amount' => $amount, 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Stripe', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); try { // initialize stripe $stripe = new Stripe(); $data = UserPaymentGeteway::query() ->where('keyword', 'stripe') ->where('user_id', $userId) ->first(); $stripeData = json_decode($data->information, true); $secret = $stripeData['secret']; $key = $stripeData['key']; config([ // in case you would like to overwrite values inside config/services.php 'services.stripe.secret' => $secret, 'services.stripe.key' => $key, ]); $stripe = Stripe::make(Config::get('services.stripe.secret')); try { // generate token $token = $request['stripeToken']; if (!isset($token)) { return back()->with('error', 'Token Problem With Your Token.'); } // generate charge $charge = $stripe->charges()->create([ 'card' => $token, 'currency' => 'USD', 'amount' => $stripeTotal ]); if ($charge['status'] == 'succeeded') { $cause = new DonationController(); // store the course enrolment information in database $donationDetails = $cause->store($arrData, $userId); // generate an invoice in pdf format $invoice = $cause->generateInvoice($donationDetails, $userId); // then, update the invoice field info in database $donationDetails->update(['invoice' => $invoice]); if ($donationDetails->email) { // send a mail to the customer with the invoice $cause->sendMail($donationDetails, $userId); } return redirect()->route('front.user.cause_donate.complete', [getParam(), 'donation']); } else { return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } catch (CardErrorException $e) { session()->flash('error', $e->getMessage()); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } catch (UnauthorizedException $e) { session()->flash('error', $e->getMessage()); return redirect()->route('front.user.cause_donate.cancel', [getParam(), 'id' => $causeId]); } } } Http/Controllers/User/DonationManagement/DonationCategoryController.php 0000644 00000011250 15213350435 0022505 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\BasicSetting; use App\Models\User\DonationManagement\DonationCategories; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Validation\Rule; class DonationCategoryController extends Controller { public function index(Request $request) { $information['langs'] = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $information['language'] = $information['langs']->where('code', $request->language)->first(); $information['categories'] = DonationCategories::where([['language_id', $information['language']->id], ['user_id', Auth::guard('web')->user()->id]])->orderBy('serial_number', 'DESC')->paginate(10); return view('user.donation_management.categories.index', $information); } public function store(Request $request) { $user = Auth::guard('web')->user(); $userBs = BasicSetting::query()->select('theme')->where('user_id', $user->id)->first(); $request->validate( [ 'name' => 'required', 'user_language_id' => 'required', 'short_description' => 'required', 'image' => 'required|image|mimes:jpg,png,jpeg,svg', 'icon' => 'required', 'status' => 'required', 'is_featured' => Rule::requiredIf($userBs->theme == 'home_eleven'), 'serial_number' => 'required' ] ); $imageName = ''; if ($request->hasFile('image')) { $imageName = Uploader::upload_picture(Constant::WEBSITE_CAUSE_CATEGORY_IMAGE, $request->image); } DonationCategories::create($request->except('_token', 'image', 'user_language_id') + [ 'language_id' => $request->user_language_id, 'user_id' => $user->id, 'image' => $imageName ?? null, 'slug' => make_slug($request->name) ]); session()->flash('success', __('Donation category added successfully') . '!'); return 'success'; } public function update(Request $request) { $request->validate([ 'name' => 'required', 'short_description' => 'required', 'image' => 'image|mimes:jpg,png,jpeg,svg', 'status' => 'required', 'serial_number' => 'required' ]); $imageName = ''; if ($request->hasFile('image')) { $imageName = Uploader::upload_picture(Constant::WEBSITE_CAUSE_CATEGORY_IMAGE, $request->image); } $category = DonationCategories::find($request->category_id); $category->update($request->except('category_id', 'image') + [ 'image' => $imageName != '' ? $imageName : $category->image, 'slug' => make_slug($request->name) ]); session()->flash('success', __('Donation category added successfully') . '!'); return 'success'; } public function destroy(Request $request) { $id = $request->category_id; $category = DonationCategories::where('user_id', Auth::guard('web')->user()->id)->findOrFail($id); if ($category->donations()->where('user_id', Auth::guard('web')->user()->id)->count() > 0) { return redirect()->back()->with('warning', 'First delete all the causes under to this category!'); } else { $category->delete(); @unlink(public_path(Constant::WEBSITE_CAUSE_CATEGORY_IMAGE . '/' . $category->image)); return redirect()->back()->with('success', __('Cause Category deleted successfully') . '!'); } } public function bulkDestroy(Request $request) { $ids = $request->ids; $errorOccured = false; foreach ($ids as $id) { $category = DonationCategories::where('user_id', Auth::guard('web')->user()->id)->find($id); $courseCount = $category->donations()->where('user_id', Auth::guard('web')->user()->id)->count(); if ($courseCount > 0) { $errorOccured = true; break; } else { $category->delete(); @unlink(public_path(Constant::WEBSITE_CAUSE_CATEGORY_IMAGE . '/' . $category->image)); } } if ($errorOccured == true) { session()->flash('warning', __('First delete all the cause under to this categories') . '!'); } else { session()->flash('success', __('Cause categories deleted successfully') . '!'); } return "success"; } } Http/Controllers/User/DonationManagement/DonationController.php 0000644 00000047050 15213350435 0021016 0 ustar 00 <?php namespace App\Http\Controllers\User\DonationManagement; use App\Constants\Constant; use App\Exports\DonationExport; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Http\Requests\User\DonationManagement\StoreCause; use App\Http\Requests\User\DonationManagement\UpdateCause; use App\Models\User\BasicSetting; use App\Models\User\DonationManagement\Donation; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\DonationManagement\DonationDetail; use App\Models\User\Language; use App\Models\User\UserEmailTemplate; use App\Models\User\UserOfflineGateway; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Carbon\Carbon; use Exception; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; use Mews\Purifier\Facades\Purifier; use PDF; use Maatwebsite\Excel\Facades\Excel; use PHPMailer\PHPMailer\PHPMailer; use WpOrg\Requests\Auth\Basic; class DonationController extends Controller { use MiscellaneousTrait; /** * Display a listing of the resource. * * @return */ public function index(Request $request) { $userId = Auth::guard('web')->user()->id; $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $lang_id = $lang->id; $data['lang_id'] = $lang_id; $data['abx'] = $lang->basic_extra; $donations = DonationContent::where('language_id', $lang->id)->select('id', 'donation_id', 'title', 'slug', 'content')->get(); $donations->map(function ($content) use ($lang) { $raised_amount = DonationDetail::query() ->where('donation_id', '=', $content->donation_id) ->where('status', '=', "completed") ->sum('amount'); $donation['raised_amount'] = $raised_amount > 0 ? round($raised_amount, 2) : 0; }); $data['donations'] = $donations; return view('user.donation_management.donation.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $data['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo(Auth::guard('web')->user()->id); $data['languages'] = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $data['defaultLang'] = $data['languages']->where('dashboard_default', 1)->first(); return view('user.donation_management.donation.create', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(StoreCause $request) { $image = Uploader::upload_picture(Constant::WEBSITE_CAUSE_IMAGE, $request->image); $userId = Auth::guard('web')->user()->id; $donation = Donation::create([ 'user_id' => $userId, 'goal_amount' => $request->goal_amount, 'min_amount' => $request->min_amount, 'custom_amount' => $request->custom_amount, 'image' => $image, ]); $languages = Language::where('user_id', $userId)->get(); foreach ($languages as $language) { $causeContent = new DonationContent(); $causeContent->user_id = $userId; $causeContent->language_id = $language->id; $causeContent->donation_id = $donation->id; $causeContent->donation_category_id = $request[$language->code . '_category_id']; $causeContent->title = $request[$language->code . '_title']; $causeContent->slug = make_slug($request[$language->code . '_title']); $causeContent->content = Purifier::clean($request[$language->code . '_content']); $causeContent->meta_keywords = $request[$language->code . '_meta_keywords']; $causeContent->meta_description = $request[$language->code . '_meta_description']; $causeContent->save(); } session()->flash('success', __('New donation cause created successfully') . '!'); return "success"; } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $userId = Auth::guard('web')->user()->id; $data['donation'] = Donation::findOrFail($id); $languages = Language::query()->where('user_id', $userId)->get(); $data['languages'] = $languages; $data['defaultLang'] = $languages->where('dashboard_default', 1)->first(); $data['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo($userId); return view('user.donation_management.donation.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return */ public function update(UpdateCause $request, $id) { $donation = Donation::where('user_id', Auth::guard('web')->user()->id)->find($id); // store new thumbnail image in storage if ($request->hasFile('image')) { $imageName = Uploader::update_picture(Constant::WEBSITE_CAUSE_IMAGE, $request->file('image'), basename($donation->image)); } // update data in db $donation->update($request->except('image') + [ 'image' => $request->hasFile('image') ? $imageName : $donation->image, ]); $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($languages as $language) { DonationContent::updateOrCreate([ 'id' => $request[$language->code . '_donation_content'], ], [ 'donation_id' => $id, 'user_id' => Auth::guard('web')->user()->id, 'language_id' => $language->id, 'donation_category_id' => $request[$language->code . '_category_id'], 'title' => $request[$language->code . '_title'], 'slug' => make_slug($request[$language->code . '_title']), 'content' => Purifier::clean($request[$language->code . '_content']), 'meta_keywords' => $request[$language->code . '_meta_keywords'], 'meta_description' => $request[$language->code . '_meta_description'] ]); } Session::flash('success', __('Donation updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } public function delete(Request $request) { $donation_details = DonationDetail::query()->where([['donation_id', $request->donation_id], ['user_id', Auth::guard('web')->user()->id]])->get(); foreach ($donation_details as $donation_detail) { if (!is_null($donation_detail->receipt)) { $directory = public_path(Constant::WEBSITE_DONATION_ATTACHMENT . '/' . $donation_detail->receipt); if (file_exists($directory)) { @unlink($directory); } } $donation_detail->delete(); } $donation = Donation::findOrFail($request->donation_id); $donation->contents()->delete(); if (!is_null($donation->image)) { $directory = public_path(Constant::WEBSITE_CAUSE_IMAGE . "/" . $donation->image); if (file_exists($directory)) { @unlink($directory); } } $donation->delete(); Session::flash('success', __('Donation deleted successfully') . '!'); return back(); } public function paymentDelete(Request $request) { $donation_detail = DonationDetail::findOrFail($request->payment_id); if (!is_null($donation_detail->receipt)) { $directory = public_path(Constant::WEBSITE_DONATION_ATTACHMENT) . "/" . $donation_detail->receipt; if (file_exists($directory)) { @unlink($directory); } } $donation_detail->delete(); Session::flash('success', __('Payment deleted successfully') . '!'); return back(); } public function bulkPaymentDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $donation_detail = DonationDetail::findOrFail($id); if (!is_null($donation_detail->receipt)) { $directory = public_path("assets/front/img/donations/receipt/" . $donation_detail->receipt); if (file_exists($directory)) { @unlink($directory); } } $donation_detail->delete(); } Session::flash('success', __('Donations deleted successfully') . '!'); return "success"; } public function bulkDelete(Request $request) { return DB::transaction(function () use ($request) { $ids = $request->ids; foreach ($ids as $id) { $donation_details = DonationDetail::query()->where('donation_id', $id)->get(); foreach ($donation_details as $donation_detail) { if (!is_null($donation_detail->receipt)) { $directory = public_path(Constant::WEBSITE_DONATION_ATTACHMENT . '/' . $donation_detail->receipt); if (file_exists($directory)) { @unlink($directory); } } $donation_detail->delete(); } $donation = Donation::findOrFail($id); if (!is_null($donation->image)) { $directory = public_path(Constant::WEBSITE_CAUSE_IMAGE . "/" . $donation->image); if (file_exists($directory)) { @unlink($directory); } } $this->deleteFromMegaMenu($donation); $donation->delete(); } Session::flash('success', __('Donation deleted successfully') . '!'); return "success"; }); } public function paymentLog(Request $request) { $userId = Auth::guard('web')->user()->id; // $lang = Language::where([['user_id', $userId], ['code', $request->language]])->first(); $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $search = $request->search; $donations = DonationDetail::where('user_id', $userId)->when($search, function ($query, $search) { return $query->where('transaction_id', $search); }) ->orderBy('id', 'DESC') ->paginate(10); $data['donations'] = $donations; return view('user.donation_management.payment.index', $data); } public function paymentLogUpdate(Request $request) { $donation = DonationDetail::query()->findOrFail($request->id); if ($request->status == "success") { if ($donation->email) { $fileName = $this->makeInvoices($donation); $donation->update(['status' => 'completed', 'invoice' => $fileName]); $this->sendMailPHPMailer($donation); } else { $donation->update(['status' => 'completed']); } Session::flash('success', __('Donation payment updated successfully') . '!'); } elseif ($request->status == "rejected") { $donation->update(['status' => 'rejected']); Session::flash('success', __('Donation payment rejected successfully') . '!'); } else { $donation->update(['status' => 'pending']); Session::flash('success', __('Donation payment to pending successfully') . '!'); } return redirect()->back(); } public function makeInvoices($donation) { $userId = Auth::guard('web')->user()->id; $fileName = $donation->transaction_id . ".pdf"; $directory = public_path(Constant::WEBSITE_DONATION_INVOICE . '/'); if (!file_exists($directory)) { mkdir($directory, 0775, true); } $fileLocated = $directory . $fileName; $language = $this->getUserCurrentLanguage($userId); $cause = Donation::query() ->where('id', $donation->donation_id) ->firstOrFail(); $causeInfo = DonationContent::query() ->where('user_id', $userId) ->where('donation_id', $cause->id) ->where('language_id', $language->id) ->select('title') ->firstOrFail(); PDF::loadView('pdf.donation', compact('donation', 'causeInfo'))->save($fileLocated); return $fileName; } public function sendMailPHPMailer($donationInfo) { $userId = Auth::guard('web')->user()->id; $mailTemplate = UserEmailTemplate::query() ->where('email_type', 'donation_approved') ->where('user_id', $userId) ->first(); $mailSubject = $mailTemplate->email_subject; $mailBody = $mailTemplate->email_body; // second get the website title & mail's smtp info from db $be = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_username', 'smtp_password', 'from_mail', 'from_name') ->first(); $userBs = BasicSetting::query()->where('user_id', $userId) ->select('website_title', 'email', 'from_name') ->first(); $language = $this->getUserCurrentLanguage($userId); $cause = Donation::query() ->where('id', $donationInfo->donation_id) ->firstOrFail(); $causeInfo = DonationContent::query() ->where('user_id', $userId) ->where('donation_id', $cause->id) ->where('language_id', $language->id) ->select('title') ->firstOrFail(); $websiteTitle = $userBs->website_title; $mailBody = str_replace('{donor_name}', $donationInfo->name, $mailBody); $mailBody = str_replace('{cause_name}', $causeInfo->title, $mailBody); $mailBody = str_replace('{website_title}', $websiteTitle, $mailBody); // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = 'UTF-8'; $mail->Encoding = 'base64'; // if smtp status == 1, then set some value for PHPMailer if ($be->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; // if ($be->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // } $mail->Port = 587; } // finally, add other informations and send the mail try { // Recipients $mail->setFrom($be->from_mail, $userBs->from_name); $mail->addReplyTo($userBs->email, $userBs->from_name); $mail->addAddress($donationInfo->email); $path = public_path(Constant::WEBSITE_DONATION_INVOICE . '/' . $donationInfo->invoice); // Attachments (Invoice) $mail->addAttachment($path); // Content $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); @unlink(public_path(Constant::WEBSITE_DONATION_INVOICE) . '/' . $donationInfo->invoice); return; } catch (\Exception $e) { return session()->flash('error', __('Mail could not be sent') . '!'); } } public function settings() { $userId = Auth::guard('web')->user()->id; $data['abex'] = DB::table('user_donation_settings')->where('user_id', $userId)->first(); if (is_null($data['abex'])) { DB::table('user_donation_settings')->insert([ 'user_id' => $userId ]); $data['abex'] = DB::table('user_donation_settings')->where('user_id', $userId)->first(); } return view('user.donation_management.settings', $data); } public function updateSettings(Request $request) { $donationSetting = DB::table('user_donation_settings')->where('user_id', Auth::guard('web')->user()->id)->update([ 'donation_guest_checkout' => $request->donation_guest_checkout, 'is_donation' => $request->is_donation ]); session()->flash('success', __('Settings updated successfully') . '!'); return back(); } public function report(Request $request) { $user = Auth::guard('web')->user(); $data['curencyInfo'] = MiscellaneousTrait::getCurrencyInfo($user->id); $currentLang = $this->getUserCurrentLanguage($user->id); $fromDate = $request->from_date; $toDate = $request->to_date; $paymentStatus = $request->payment_status; $paymentMethod = $request->payment_method; if (!empty($fromDate) && !empty($toDate)) { $donations = DonationDetail::where('user_id', $user->id)->when($fromDate, function ($query, $fromDate) { return $query->whereDate('created_at', '>=', Carbon::parse($fromDate)); })->when($toDate, function ($query, $toDate) { return $query->whereDate('created_at', '<=', Carbon::parse($toDate)); })->when($paymentMethod, function ($query, $paymentMethod) { return $query->where('payment_method', $paymentMethod); })->when($paymentStatus, function ($query, $paymentStatus) { return $query->where('status', $paymentStatus); })->select('transaction_id', 'donation_id', 'name', 'email', 'phone', 'amount', 'payment_method', 'status', 'created_at')->orderBy('id', 'DESC'); $_donates = $donations->get(); $_donates->map(function ($donation) use ($currentLang) { $title = $donation->cause->contents()->where('language_id', $currentLang->id)->select('title')->first(); $donation['title'] = $title->title; }); Session::put('donation_report', $_donates); $donations = $donations->paginate(10); $donations->map(function ($donation) use ($currentLang) { $title = $donation->cause->contents()->where('language_id', $currentLang->id)->select('title')->first(); $donation['title'] = $title->title; }); $data['donations'] = $donations; } else { Session::put('donation_report', []); $data['donations'] = []; } $data['onPms'] = UserPaymentGeteway::where([['user_id', $user->id], ['status', 1]])->get(); $data['offPms'] = UserOfflineGateway::where([['user_id', $user->id], ['item_checkout_status', 1]])->get(); return view('user.donation_management.report', $data); } public function exportReport() { $donations = Session::get('donation_report'); if (empty($donations) || count($donations) == 0) { Session::flash('warning', __('There are no donations to export') . '.'); return back(); } return Excel::download(new DonationExport($donations), 'dontaions.csv'); } } Http/Controllers/User/HeroSliderController.php 0000644 00000010225 15213350435 0015525 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\HeroSlider; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class HeroSliderController extends Controller { public function sliderVersion(Request $request) { // first, get the language info from db $language = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); // then, get the slider version info of that language from db $information['sliders'] = HeroSlider::where('language_id', $language->id) ->orderBy('id', 'desc') ->where('user_id', Auth::guard('web')->user()->id) ->get(); return view('user.home.hero-section.slider-version', $information); } public function createSlider(Request $request) { // get the language info from db $language = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $information['language'] = $language; return view('user.home.hero-section.create_slider', $information); } public function storeSliderInfo(Request $request): \Illuminate\Http\RedirectResponse { $request->validate( [ 'title' => 'nullable|max:255', 'subtitle' => 'nullable|max:255', 'btn_name' => 'nullable|max:255', 'btn_url' => 'nullable|max:255', 'serial_number' => 'required', 'slider_img' => 'required|mimes:jpeg,jpg,png,gif|max:30000', 'user_language_id' => 'required', ]); if ($request->hasFile('slider_img')) { $request['image_name'] = Uploader::upload_picture('assets/front/img/hero_slider', $request->file('slider_img')); } HeroSlider::create($request->except('language_id', 'img', 'user_id') + [ 'language_id' => $request->user_language_id, 'img' => $request->image_name, 'user_id' => Auth::guard('web')->user()->id, ]); $request->session()->flash('success', __('New slider added successfully') . '!'); return redirect()->back(); } public function editSlider(Request $request, $id) { // get the language info from db $language = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $information['language'] = $language; // get the slider info from db for update $information['slider'] = HeroSlider::findOrFail($id); return view('user.home.hero-section.edit_slider', $information); } public function updateSliderInfo(Request $request, $id): \Illuminate\Http\RedirectResponse { $request->validate([ 'title' => 'nullable|max:255', 'subtitle' => 'nullable|max:255', 'btn_name' => 'nullable|max:255', 'btn_url' => 'nullable|max:255', 'serial_number' => 'required', ]); $slider = HeroSlider::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); $request['image_name'] = $slider->img; if ($request->hasFile('slider_img')) { $request['image_name'] = Uploader::update_picture('assets/front/img/hero_slider', $request->file('slider_img'), $slider->img); } $slider->update($request->except('img') + [ 'img' => $request->image_name, ]); $request->session()->flash('success', __('Slider info updated successfully') . '!'); return redirect()->back(); } public function deleteSlider(Request $request) { $slider = HeroSlider::findOrFail($request->slider_id); if ( !is_null($slider->img) && file_exists(public_path('assets/front/img/hero_slider/' . $slider->img)) ) { @unlink(public_path('assets/front/img/hero_slider/' . $slider->img)); } $slider->delete(); $request->session()->flash('success', __('Slider deleted successfully') . '!'); return redirect()->back(); } } Http/Controllers/User/PortfolioController.php 0000644 00000025610 15213350435 0015446 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\Language; use App\Models\User\Portfolio; use App\Models\User\PortfolioCategory; use App\Models\User\PortfolioImage; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Purifier; use Validator; class PortfolioController extends Controller { /** * Display a listing of the resource. * * @return */ public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $data['portfolios'] = Portfolio::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::id()], ]) ->orderBy('id', 'DESC') ->get(); $data['categories'] = PortfolioCategory::where([ ['language_id', '=', $lang->id], ['user_id', '=', Auth::id()], ['status', '=', 1] ]) ->orderBy('serial_number', 'ASC') ->get(); return view('user.portfolio.portfolio.index', $data); } public function sliderstore(Request $request) { $img = $request->file('file'); $allowedExts = ['jpg', 'png', 'jpeg']; $rules = [ 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg images are allowed') . "."); } }, ] ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $filename = Uploader::upload_picture('assets/front/img/user/portfolios/', $img); $pi = new PortfolioImage; if (!empty($request->portfolio_id)) { $pi->user_portfolio_id = $request->portfolio_id; } $pi->image = $filename; $pi->user_id = Auth::user()->id; $pi->save(); return response()->json(['status' => 'success', 'file_id' => $pi->id]); } public function sliderrmv(Request $request) { $pi = PortfolioImage::findOrFail($request->fileid); if (!empty($request->type) && $request->type == 'edit') { if (PortfolioImage::where('user_portfolio_id', $pi->user_portfolio_id)->count() == 1) { return "minimum_one"; } } @unlink(public_path('assets/front/img/user/portfolios/' . $pi->image)); $pi->delete(); return $pi->id; } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request */ public function store(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $slug = make_slug($request->title); $rules = [ 'user_language_id' => 'required', 'title' => 'required|max:255', 'category' => 'required', 'content' => 'required', 'serial_number' => 'required|integer', 'status' => 'required', 'client_name' => 'nullable', 'start_date' => 'nullable', 'submission_date' => 'nullable', 'website_link' => 'nullable', 'image' => [ 'required', function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], 'slider_images' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } if (!isset($request->featured)) $request["featured"] = "0"; $input = $request->all(); $input['category_id'] = $request->category; $input['language_id'] = $request->user_language_id; $input['slug'] = $slug; $input['user_id'] = Auth::id(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $directory = public_path('assets/front/img/user/portfolios/'); @mkdir($directory, 0775, true); $request->file('image')->move($directory, $filename); $input['image'] = $filename; } $input['content'] = Purifier::clean($request->content); $portfolio = new Portfolio; $portfolio = $portfolio->create($input); $sliders = $request->slider_images; $pis = PortfolioImage::findOrFail($sliders); foreach ($pis as $key => $pi) { $pi->user_portfolio_id = $portfolio->id; $pi->save(); } $exSliders = PortfolioImage::whereNull('user_portfolio_id')->get(); foreach ($exSliders as $key => $exSlider) { @unlink(public_path('assets/front/img/user/portfolios/' . $exSlider->image)); } Session::flash('success', __('Portfolio added successfully') . '!'); return "success"; } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { $data['portfolio'] = Portfolio::findOrFail($id); $data['categories'] = PortfolioCategory::where([ ['language_id', '=', $data['portfolio']->language_id], ['user_id', '=', Auth::id()], ['status', '=', 1] ]) ->orderBy('serial_number', 'ASC') ->get(); return view('user.portfolio.portfolio.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * */ public function update(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $slug = make_slug($request->title); $rules = [ 'title' => 'required|max:255', 'category' => 'required', 'content' => 'required', 'serial_number' => 'required|integer', 'status' => 'required', 'client_name' => 'nullable', 'start_date' => 'nullable', 'submission_date' => 'nullable', 'website_link' => 'nullable', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $portfolio = Portfolio::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail(); $input['category_id'] = $request->category; $input['slug'] = $slug; $input['user_id'] = Auth::id(); if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/user/portfolios/'), $filename); @unlink(public_path('assets/front/img/user/portfolios/' . $portfolio->image)); $input['image'] = $filename; } if (!isset($request->featured)) $input["featured"] = "0"; $input['content'] = Purifier::clean($request->content); $portfolio->update($input); Session::flash('success', __('Portfolio updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function getcats($langid) { return PortfolioCategory::where([ ['language_id', $langid], ['user_id', '=', Auth::id()], ['status', '=', 1] ]) ->orderBy('serial_number', 'ASC') ->get(); } public function delete(Request $request) { $portfolio = Portfolio::where('user_id', Auth::user()->id)->where('id', $request->id)->firstOrFail(); foreach ($portfolio->portfolio_images as $key => $pi) { @unlink(public_path('assets/front/img/user/portfolios/' . $pi->image)); $pi->delete(); } @unlink(public_path('assets/front/img/user/portfolios/' . $portfolio->image)); $portfolio->delete(); Session::flash('success', __('Portfolio deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $portfolio = Portfolio::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); foreach ($portfolio->portfolio_images as $key => $pi) { @unlink(public_path('assets/front/img/user/portfolios/' . $pi->image)); $pi->delete(); } @unlink(public_path('assets/front/img/user/portfolios/' . $portfolio->image)); $portfolio->delete(); } Session::flash('success', __('Portfolios deleted successfully') . '!'); return "success"; } public function images($portid) { $images = PortfolioImage::where('user_portfolio_id', $portid)->get(); return $images; } public function featured(Request $request): \Illuminate\Http\RedirectResponse { $member = Portfolio::where('user_id', Auth::user()->id)->where('id', $request->portfolio_id)->firstOrFail(); $member->featured = $request->featured; $member->save(); if ($request->featured == 1) { Session::flash('success', __('Featured successfully') . '!'); } else { Session::flash('success', __('Unfeatured successfully') . '!'); } return back(); } } Http/Controllers/User/CssController.php 0000644 00000001714 15213350435 0014220 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\BasicSetting; use Auth; use Illuminate\Http\Request; use Session; class CssController extends Controller { public function index() { $data = BasicSetting::where('user_id', Auth::user()->id)->select('custom_css'); if ($data->count() == 0) { $data = new BasicSetting; $data->user_id = Auth::user()->id; $data->save(); } else { $data = $data->firstOrFail(); } $data['data'] = $data; return view('user.settings.css', $data); } public function update(Request $request) { $css = clean($request->custom_css); $data = BasicSetting::where('user_id', Auth::user()->id)->firstOrFail(); $data->custom_css = $css; $data->save(); Session::flash('success', __('Custom CSS updated successfully') . '!'); return back(); } } Http/Controllers/User/SubdomainController.php 0000644 00000000720 15213350435 0015405 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Http\Helpers\UserPermissionHelper; use Auth; use Illuminate\Http\Request; class SubdomainController extends Controller { public function subdomain() { $userId = Auth::user()->id; $features = UserPermissionHelper::packagePermission($userId); $data['features'] = json_decode($features, true); return view('user.subdomain', $data); } } Http/Controllers/User/GatewayController.php 0000644 00000052260 15213350435 0015073 0 ustar 00 <?php namespace App\Http\Controllers\User; use Validator; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\User\UserOfflineGateway; use Illuminate\Support\Facades\Auth; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Models\User\UserShopSetting; class GatewayController extends Controller { public function index() { $data['paypal'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'paypal']])->first(); $data['stripe'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'stripe']])->first(); $data['paystack'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'paystack']])->first(); $data['paytm'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'paytm']])->first(); $data['flutterwave'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'flutterwave']])->first(); $data['instamojo'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'instamojo']])->first(); $data['mollie'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'mollie']])->first(); $data['razorpay'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'razorpay']])->first(); $data['mercadopago'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'mercadopago']])->first(); $data['anet'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'authorize.net']])->first(); $data['phonepe'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'phonepe']])->first(); $data['perfect_money'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'perfect_money']])->first(); $data['xendit'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'xendit']])->first(); $data['yoco'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'yoco']])->first(); $data['midtrans'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'midtrans']])->first(); $data['myfatoorah'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'myfatoorah']])->first(); $data['iyzico'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'iyzico']])->first(); $data['toyyibpay'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'toyyibpay']])->first(); $data['paytabs'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'paytabs']])->first(); $data['phonepe'] = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'phonepe']])->first(); // dd($data); return view('user.gateways.index', $data); } public function paypalUpdate(Request $request) { $paypal = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'paypal']])->first(); $paypal->status = $request->status; $information = []; $information['client_id'] = $request->client_id; $information['client_secret'] = $request->client_secret; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = __('Pay via your PayPal account') . "."; $paypal->information = json_encode($information); $paypal->save(); $request->session()->flash('success', __('Paypal informations updated successfully') . "!"); return back(); } public function stripeUpdate(Request $request) { $stripe = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'stripe']])->first(); $stripe->status = $request->status; $information = []; $information['key'] = $request->key; $information['secret'] = $request->secret; $information['text'] = __('Pay via your Credit account') . "."; $stripe->information = json_encode($information); $stripe->save(); $request->session()->flash('success', __('Stripe informations updated successfully') . "!"); return back(); } public function paystackUpdate(Request $request) { $paystack = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'paystack']])->first(); $paystack->status = $request->status; $information = []; $information['key'] = $request->key; $information['email'] = $request->email; $information['text'] = __('Pay via your Paystack account') . "."; $paystack->information = json_encode($information); $paystack->save(); $request->session()->flash('success', __('Paystack informations updated successfully') . "!"); return back(); } public function paytmUpdate(Request $request) { $paytm = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'paytm']])->first(); $paytm->status = $request->status; $information = []; $information['environment'] = $request->environment; $information['merchant'] = $request->merchant; $information['secret'] = $request->secret; $information['website'] = $request->website; $information['industry'] = $request->industry; $information['text'] = __('Pay via your paytm account') . "."; $paytm->information = json_encode($information); $paytm->save(); $request->session()->flash('success', __('Paytm informations updated successfully') . "!"); return back(); } public function flutterwaveUpdate(Request $request) { $flutterwave = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'flutterwave']])->first(); $flutterwave->status = $request->status; $information = []; $information['public_key'] = $request->public_key; $information['secret_key'] = $request->secret_key; $information['text'] = __('Pay via your Flutterwave account') . "."; $flutterwave->information = json_encode($information); $flutterwave->save(); $request->session()->flash('success', __('Flutterwave informations updated successfully') . "!"); return back(); } public function instamojoUpdate(Request $request) { $instamojo = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'instamojo']])->first(); $instamojo->status = $request->status; $information = []; $information['key'] = $request->key; $information['token'] = $request->token; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = __('Pay via your Instamojo account') . "."; $instamojo->information = json_encode($information); $instamojo->save(); $request->session()->flash('success', __('Instamojo informations updated successfully') . "!"); return back(); } public function mollieUpdate(Request $request) { $mollie = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'mollie']])->first(); $mollie->status = $request->status; $information = []; $information['key'] = $request->key; $information['text'] = __('Pay via your Mollie Payment account') . "."; $mollie->information = json_encode($information); $mollie->save(); $arr = ['MOLLIE_KEY' => $request->key]; setEnvironmentValue($arr); \Artisan::call('config:clear'); $request->session()->flash('success', __('Mollie Payment informations updated successfully') . "!"); return back(); } public function razorpayUpdate(Request $request) { $razorpay = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'razorpay']])->first(); $razorpay->status = $request->status; $information = []; $information['key'] = $request->key; $information['secret'] = $request->secret; $information['text'] = __('Pay via your Razorpay account') . "."; $razorpay->information = json_encode($information); $razorpay->save(); $request->session()->flash('success', __('Razorpay informations updated successfully') . "!"); return back(); } public function anetUpdate(Request $request) { $anet = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'authorize.net']])->first(); $anet->status = $request->status; $information = []; $information['login_id'] = $request->login_id; $information['transaction_key'] = $request->transaction_key; $information['public_key'] = $request->public_key; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = __('Pay via your Authorize.net account') . "."; $anet->information = json_encode($information); $anet->save(); $request->session()->flash('success', __('Authorize.net informations updated successfully') . "!"); return back(); } public function mercadopagoUpdate(Request $request) { $mercadopago = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'mercadopago']])->first(); $mercadopago->status = $request->status; $information = []; $information['token'] = $request->token; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = __('Pay via your Mercado Pago account') . "."; $mercadopago->information = json_encode($information); $mercadopago->save(); $request->session()->flash('success', __('Mercado Pago informations updated successfully') . "!"); return back(); } public function phonepeUpdate(Request $request) { $phonepe = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'phonepe']])->first(); if (empty($phonepe)) { $phonepe = new UserPaymentGeteway(); $phonepe->name = 'PhonePe'; $phonepe->keyword = 'phonepe'; $phonepe->type = 'automatic'; $phonepe->user_id = Auth::guard('web')->user()->id; } $phonepe->status = $request->status; $information = []; $information['merchant_id'] = $request->merchant_id; $information['salt_key'] = $request->salt_key; $information['salt_index'] = $request->salt_index; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = __('Pay via your PhonePe account') . "."; $phonepe->information = json_encode($information); $phonepe->save(); $request->session()->flash('success', __('PhonePe informations updated successfully') . "!"); return back(); } public function perfectMoneyUpdate(Request $request) { $phonepe = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'perfect_money']])->first(); if (empty($phonepe)) { $phonepe = new UserPaymentGeteway(); $phonepe->name = 'Perfect Money'; $phonepe->keyword = 'perfect_money'; $phonepe->type = 'automatic'; $phonepe->user_id = Auth::guard('web')->user()->id; } $phonepe->status = $request->status; $information = []; $information['perfect_money_wallet_id'] = $request->perfect_money_wallet_id; $information['text'] = __('Pay via your Perfect Money account') . "."; $phonepe->information = json_encode($information); $phonepe->save(); $request->session()->flash('success', __('Perfect Money informations updated successfully') . "!"); return back(); } public function xenditUpdate(Request $request) { $xendit = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'xendit']])->first(); if (empty($xendit)) { $xendit = new UserPaymentGeteway(); $xendit->name = 'Xendit'; $xendit->keyword = 'xendit'; $xendit->type = 'automatic'; $xendit->user_id = Auth::guard('web')->user()->id; } $xendit->status = $request->status; $information = []; $information['secret_key'] = $request->secret_key; $information['text'] = __('Pay via your xendit account') . "."; $xendit->information = json_encode($information); $xendit->save(); $request->session()->flash('success', __('Xendit informations updated successfully') . "!"); return back(); } public function yocoUpdate(Request $request) { $yoco = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'yoco']])->first(); if (empty($yoco)) { $yoco = new UserPaymentGeteway(); $yoco->name = 'Yoco'; $yoco->keyword = 'yoco'; $yoco->type = 'automatic'; $yoco->user_id = Auth::guard('web')->user()->id; } $yoco->status = $request->status; $information = []; $information['secret_key'] = $request->secret_key; $information['text'] = __('Pay via your yoco account') . "."; $yoco->information = json_encode($information); $yoco->save(); $request->session()->flash('success', __('Yoco informations updated successfully') . "!"); return back(); } public function midtransUpdate(Request $request) { $midtrans = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'midtrans']])->first(); if (empty($midtrans)) { $midtrans = new UserPaymentGeteway(); $midtrans->name = 'Midtrans'; $midtrans->keyword = 'midtrans'; $midtrans->type = 'automatic'; $midtrans->user_id = Auth::guard('web')->user()->id; } $midtrans->status = $request->status; $information = []; $information['is_production'] = $request->is_production; $information['server_key'] = $request->server_key; $information['text'] = __('Pay via your midtrans account') . "."; $midtrans->information = json_encode($information); $midtrans->save(); $request->session()->flash('success', __('midtrans informations updated successfully') . "!"); return back(); } public function myfatoorahUpdate(Request $request) { $myfatoorah = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'myfatoorah']])->first(); if (empty($myfatoorah)) { $myfatoorah = new UserPaymentGeteway(); $myfatoorah->name = 'MyFatoorah'; $myfatoorah->keyword = 'myfatoorah'; $myfatoorah->type = 'automatic'; $myfatoorah->user_id = Auth::guard('web')->user()->id; } $myfatoorah->status = $request->status; $information = []; $information['token'] = $request->token; $information['sandbox_status'] = $request->sandbox_status; $information['text'] = __('Pay via your myfatoorah account') . "."; $myfatoorah->information = json_encode($information); $myfatoorah->save(); $request->session()->flash('success', __('myfatoorah informations updated successfully') . "!"); return back(); } public function iyzicoUpdate(Request $request) { $iyzico = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'iyzico']])->first(); if (empty($iyzico)) { $iyzico = new UserPaymentGeteway(); $iyzico->name = 'Iyzico'; $iyzico->keyword = 'iyzico'; $iyzico->type = 'automatic'; $iyzico->user_id = Auth::guard('web')->user()->id; } $iyzico->status = $request->status; $information = []; $information['sandbox_status'] = $request->sandbox_status; $information['api_key'] = $request->api_key; $information['secret_key'] = $request->secret_key; $information['text'] = __('Pay via your iyzico account') . "."; $iyzico->information = json_encode($information); $iyzico->save(); $request->session()->flash('success', __('iyzico informations updated successfully') . "!"); return back(); } public function toyyibpayUpdate(Request $request) { $toyyibpay = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'toyyibpay']])->first(); if (empty($toyyibpay)) { $toyyibpay = new UserPaymentGeteway(); $toyyibpay->name = 'Toyyibpay'; $toyyibpay->keyword = 'toyyibpay'; $toyyibpay->type = 'automatic'; $toyyibpay->user_id = Auth::guard('web')->user()->id; } $toyyibpay->status = $request->status; $information = []; $information['sandbox_status'] = $request->sandbox_status; $information['secret_key'] = $request->secret_key; $information['category_code'] = $request->category_code; $information['text'] = __('Pay via your toyyibpay account') . "."; $toyyibpay->information = json_encode($information); $toyyibpay->save(); $request->session()->flash('success', __('toyyibpay informations updated successfully') . "!"); return back(); } public function paytabsUpdate(Request $request) { $paytabs = UserPaymentGeteway::where([['user_id', Auth::guard('web')->user()->id], ['keyword', 'paytabs']])->first(); if (empty($paytabs)) { $paytabs = new UserPaymentGeteway(); $paytabs->name = 'Paytabs'; $paytabs->keyword = 'paytabs'; $paytabs->type = 'automatic'; $paytabs->user_id = Auth::guard('web')->user()->id; } $paytabs->status = $request->status; $information = []; $information['server_key'] = $request->server_key; $information['profile_id'] = $request->profile_id; $information['country'] = $request->country; $information['api_endpoint'] = $request->api_endpoint; $information['text'] = __('Pay via your paytabs account') . "."; $paytabs->information = json_encode($information); $paytabs->save(); $request->session()->flash('success', __('paytabs informations updated successfully') . "!"); return back(); } public function offline(Request $request) { $userId = Auth::guard('web')->user()->id; $data['ogateways'] = UserOfflineGateway::where('user_id', Auth::guard('web')->user()->id)->orderBy('id', 'DESC')->get(); $data['shopsettings'] = UserShopSetting::where('user_id', $userId)->first(); return view('user.gateways.offline.index', $data); } public function store(Request $request) { $rules = [ 'name' => 'required|max:100', 'short_description' => 'nullable', 'serial_number' => 'required|integer', 'is_receipt' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $in = $request->all(); $in['user_id'] = Auth::guard('web')->user()->id; $in['item_checkout_status'] = 1; UserOfflineGateway::create($in); Session::flash('success', __('Gateway added successfully') . '!'); return "success"; } public function update(Request $request) { $rules = [ 'name' => 'required|max:100', 'short_description' => 'nullable', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $in = $request->except('_token', 'ogateway_id'); UserOfflineGateway::where('id', $request->ogateway_id)->update($in); Session::flash('success', __('Gateway updated successfully') . '!'); return "success"; } public function status(Request $request) { $og = UserOfflineGateway::find($request->ogateway_id); if (!empty($request->type) && $request->type == 'item') { $og->item_checkout_status = $request->item_checkout_status; } $og->save(); Session::flash('success', __('Gateway status changed successfully') . '!'); return back(); } public function delete(Request $request) { $ogateway = UserOfflineGateway::findOrFail($request->ogateway_id); $ogateway->delete(); Session::flash('success', __('Gateway deleted successfully') . '!'); return back(); } } Http/Controllers/User/BrandSectionController.php 0000644 00000005731 15213350435 0016046 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\Brand; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; class BrandSectionController extends Controller { public function brandSection(Request $request) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } // also, get the brand info of that language from db $information['brands'] = Brand::where('user_id', $user->id) ->orderBy('id', 'desc') ->get(); return view('user.home.brand_section.index', $information); } public function storeBrand(Request $request) { $request->validate( [ 'brand_img' => 'required|mimes:jpeg,jpg,png|max:1000', 'brand_url' => 'required', 'serial_number' => 'required' ]); if ($request->hasFile('brand_img')) { $request['image_name'] = Uploader::upload_picture('assets/front/img/user/brands', $request->file('brand_img')); } Brand::create($request->except('brand_img', 'user_id') + [ 'user_id' => Auth::guard('web')->user()->id, 'brand_img' => $request->image_name ]); $request->session()->flash('success', __('New brand added successfully') . '!'); return 'success'; } public function updateBrand(Request $request) { $brand = Brand::where('user_id', Auth::guard('web')->user()->id)->where('id', $request->brand_id)->firstOrFail(); $rules = [ 'brand_url' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $request['image_name'] = $brand->brand_img; if ($request->hasFile('brand_img')) { $request['image_name'] = Uploader::update_picture('assets/front/img/user/brands', $request->file('brand_img'), $brand->brand_img); } $brand->update($request->except('brand_img') + [ 'brand_img' => $request->image_name ]); $request->session()->flash('success', __('Brand info updated successfully') . '!'); return 'success'; } public function deleteBrand(Request $request) { $brand = Brand::where('user_id', Auth::guard('web')->user()->id)->where('id', $request->brand_id)->firstOrFail(); @unlink(public_path('assets/img/brands/' . $brand->brand_img)); $brand->delete(); $request->session()->flash('success', __('Brand deleted successfully') . '!'); return redirect()->back(); } } Http/Controllers/User/BasicController.php 0000644 00000137212 15213350435 0014514 0 ustar 00 <?php namespace App\Http\Controllers\User; // use Response; use App\Models\Timezone; use App\Models\User\SEO; use App\Models\User\Member; use Illuminate\Http\Request; use App\Models\User\Language; use App\Http\Helpers\Uploader; use App\Models\User\HomeSection; use App\Models\User\WorkProcess; use App\Models\User\BasicSetting; use App\Models\BasicSetting as AdminBasicSetting; use App\Models\User\HomePageText; use Illuminate\Support\Facades\DB; use Mews\Purifier\Facades\Purifier; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\Session; use App\Models\Language as AdminLanguage; use Illuminate\Support\Facades\Validator; use App\Http\Helpers\UserPermissionHelper; use App\Services\MasterAiGenerator; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Response; use App\Jobs\GenerateFullWebsiteJob; use App\Http\Helpers\AiPageFilterHelper; use App\Http\Helpers\AiAccessHelper; use App\Models\AiGenerationLog; class BasicController extends Controller { public function themeVersion() { $data = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); return view('user.settings.themes', ['data' => $data]); } public function updateThemeVersion(Request $request) { $userId = Auth::guard('web')->user()->id; $package = UserPermissionHelper::currentPackagePermission($userId); $rules = [ 'theme' => 'required' ]; $generateAi = $request->filled('generate_ai_content') && $request->generate_ai_content == 1; // If AI generation is selected to make these fields required if ($generateAi) { $rules['business_name'] = 'required|string|max:255'; $rules['industry_type'] = 'required|string|max:255'; $rules['business_info'] = 'required|string'; $rules['delete_prev_theme_data'] = 'required|in:0,1'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $data = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); $data->theme = $request->theme; $data->save(); // Only call AI generator if user chose to generate with AI if ($generateAi) { // AI permission & limit check $access = AiAccessHelper::canGenerate($userId, $package); if (!$access['allowed']) { $request->session()->flash('warning', $access['message']); return 'warning'; } // AI Engine package $aiEngine = !empty($package->ai_engine) ? trim($package->ai_engine) : 'pollinations'; // Filter request pages based on package allowed AI pages $packageAiPages = json_decode($package->ai_pages ?? '[]', true); $filteredPages = AiPageFilterHelper::filter( $request->pages ?? [], $packageAiPages ); $isDeleteOldRecords = $request->boolean('delete_prev_theme_data'); // payload array $payload = [ 'user_id' => $userId, 'theme' => trim($request->theme), 'business_name' => trim($request->business_name), 'industry' => trim($request->industry_type), 'business_info' => trim($request->business_info), 'pages' => $filteredPages, 'ai_engine' => $aiEngine, 'delete_old_records' => $isDeleteOldRecords, ]; $aiService = new MasterAiGenerator(); $aiService->generateFullWebsite($payload); // Log usage AFTER success AiGenerationLog::create([ 'user_id' => $userId, 'package_id' => $package->id, 'ai_engine' => $aiEngine ]); session([ 'ai_generating' => [ 'user_id' => $userId, 'started_at' => now()->timestamp ] ]); } $request->session()->flash('success', __('Theme updated successfully') . '!'); return 'success'; } public function favicon(Request $request) { $data['basic_setting'] = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); return view('user.settings.favicon', $data); } public function generalSettings() { $data['timezones'] = Timezone::all(); $data['adminlangs'] = AdminLanguage::all(); $data['data'] = BasicSetting::where('user_id', Auth::guard('web')->user()->id) ->first(); return view('user.settings.general-settings', $data); } public function updateInfo(Request $request) { $user = Auth::guard('web')->user(); $package = UserPermissionHelper::currentPackagePermission($user->id); if (!empty($user)) { $permissions = UserPermissionHelper::packagePermission($user->id); $permissions = json_decode($permissions, true); } $rules = []; $rules['website_title'] = 'required'; $rules['timezone'] = 'required'; $rules['dashboard_language'] = 'required'; if (!empty($permissions) && in_array('Ecommerce', $permissions)) { $rules['base_currency_symbol'] = 'required'; $rules['base_currency_symbol_position'] = 'required'; $rules['base_currency_text'] = 'required'; $rules['base_currency_text_position'] = 'required'; $rules['base_currency_rate'] = 'required|numeric|min:0.00000001'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } BasicSetting::where('user_id', Auth::guard('web')->user()->id)->update([ 'website_title' => $request->website_title, 'timezone' => $request->timezone, 'email_verification_status' => $request->email_verification_status, 'dashboard_language' => $request->dashboard_language, 'base_currency_symbol' => $request->base_currency_symbol, 'base_currency_symbol_position' => $request->base_currency_symbol_position, 'base_currency_text' => $request->base_currency_text, 'base_currency_text_position' => $request->base_currency_text_position, 'base_currency_rate' => $request->base_currency_rate, ]); $request->session()->flash('success', __('Information updated successfully') . '!'); return 'success'; } public function updatefav(Request $request) { $img = $request->file('favicon'); $allowedExts = array('jpg', 'png', 'jpeg', 'ico'); $rules = [ 'favicon' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg, ico image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json([ 'errors' => $validator->errors(), 'id' => 'favicon', 'error' => true ]); } if ($request->hasFile('favicon')) { $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/user/'), $filename); $bss = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if (!is_null($bss)) { if ($bss->favicon) { @unlink(public_path('assets/front/img/user/' . $bss->favicon)); } $bss->favicon = $filename; $bss->user_id = Auth::guard('web')->user()->id; $bss->save(); } else { $bs = new BasicSetting(); $bs->favicon = $filename; $bs->user_id = Auth::guard('web')->user()->id; $bs->save(); } } Session::flash('success', __('Favicon update successfully') . '.'); return "success"; } public function logo(Request $request) { $data['basic_setting'] = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); return view('user.settings.logo', $data); } public function updatelogo(Request $request) { $img = $request->file('file'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json([ 'errors' => $validator->errors(), 'id' => 'logo', 'error' => true ]); } if ($request->hasFile('file')) { $bss = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/user/'), $filename); $bss = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if (!is_null($bss)) { if ($bss->logo) { @unlink(public_path('assets/front/img/user/' . $bss->logo)); } $bss->logo = $filename; $bss->user_id = Auth::guard('web')->user()->id; $bss->save(); } else { $bs = new BasicSetting(); $bs->logo = $filename; $bs->user_id = Auth::guard('web')->user()->id; $bs->save(); } } Session::flash('success', __('Logo update successfully') . '.'); return "success"; } public function breadcrumb(Request $request) { $data['basic_setting'] = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); return view('user.settings.breadcrumb', $data); } public function updateBreadcrumb(Request $request) { $img = $request->file('breadcrumb'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'breadcrumb' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); // Check if validation fails if ($validator->fails()) { return redirect()->back() ->withErrors($validator) ->withInput(); } if ($request->hasFile('breadcrumb')) { $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/user/'), $filename); $bss = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if (!is_null($bss)) { if ($bss->favicon) { @unlink(public_path('assets/front/img/user/' . $bss->breadcrumb)); } $bss->breadcrumb = $filename; $bss->user_id = Auth::guard('web')->user()->id; $bss->save(); } else { $bs = new BasicSetting(); $bs->breadcrumb = $filename; $bs->user_id = Auth::guard('web')->user()->id; $bs->save(); } } Session::flash('success', __('Breadcrumb update successfully') . '.'); return back(); } public function preloader(Request $request) { $data['basic_setting'] = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); return view('user.settings.preloader', $data); } public function updatepreloader(Request $request) { $img = $request->file('file'); $allowedExts = array('jpg', 'png', 'jpeg', 'gif'); $rules = [ 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg, gif image is allowed') . "."); } } }, ], ]; $validator = Validator::make($request->all(), $rules); // Check if validation fails if ($validator->fails()) { return redirect()->back() ->withErrors($validator) ->withInput(); } if ($request->hasFile('file')) { $bss = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/user/'), $filename); $bss = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if (!is_null($bss)) { @unlink(public_path('assets/front/img/user/' . $bss->preloader)); $bss->preloader = $filename; $bss->user_id = Auth::guard('web')->user()->id; $bss->save(); } else { $bs = new BasicSetting(); $bs->preloader = $filename; $bs->user_id = Auth::guard('web')->user()->id; $bs->save(); } } Session::flash('success', __('Preloader updated successfully') . '.'); return back(); } public function homePageTextEdit(Request $request) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } $language = Language::where('code', $request->language) ->where('user_id', $user->id) ->firstorFail(); $text = HomePageText::where('user_id', $user->id)->where('language_id', $language->id); if ($text->count() == 0) { $text = new HomePageText; $text->language_id = $language->id; $text->user_id = Auth::guard('web')->user()->id; $text->save(); } else { $text = $text->first(); } $data['home_setting'] = $text; return view('user.home.edit', $data); } public function homePageTextUpdate(Request $request) { $homeText = HomePageText::query()->where('language_id', $request->language_id)->where('user_id', Auth::guard('web')->user()->id)->firstOrFail(); foreach ($request->types as $key => $type) { if ( $type == 'faq_section_image' || $type == 'testimonial_image' || $type == 'newsletter_image' || $type == 'newsletter_snd_image' || $type == 'about_video_image' || $type == 'counter_section_image' || $type == 'contact_section_image' || $type == 'on_sale_section_image' ) { continue; } $homeText->$type = Purifier::clean($request[$type]); } if ($request->hasFile('skills_image')) { $skillsImage = uniqid() . '.' . $request->file('skills_image')->getClientOriginalExtension(); $request->file('skills_image')->move(public_path('assets/front/img/user/home_settings/'), $skillsImage); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->skills_image)); $homeText->skills_image = $skillsImage; } if ($request->hasFile('newsletter_image')) { $newsletterImage = uniqid() . '.' . $request->file('newsletter_image')->getClientOriginalExtension(); $request->file('newsletter_image')->move(public_path('assets/front/img/user/home_settings/'), $newsletterImage); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->newsletter_image)); $homeText->newsletter_image = $newsletterImage; } if ($request->hasFile('newsletter_snd_image')) { $newsletterImage2 = uniqid() . '.' . $request->file('newsletter_snd_image')->getClientOriginalExtension(); $request->file('newsletter_snd_image')->move(public_path('assets/front/img/user/home_settings/'), $newsletterImage2); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->newsletter_snd_image)); $homeText->newsletter_snd_image = $newsletterImage2; } if ($request->hasFile('testimonial_image')) { $testimonialImage = uniqid() . '.' . $request->file('testimonial_image')->getClientOriginalExtension(); $request->file('testimonial_image')->move(public_path('assets/front/img/user/home_settings/'), $testimonialImage); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->testimonial_image)); $homeText->testimonial_image = $testimonialImage; } if ($request->hasFile('about_video_image')) { $aboutVideoImage = uniqid() . '.' . $request->file('about_video_image')->getClientOriginalExtension(); $request->file('about_video_image')->move(public_path('assets/front/img/user/home_settings/'), $aboutVideoImage); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_video_image)); $homeText->about_video_image = $aboutVideoImage; } if ($request->hasFile('faq_section_image')) { $faqSectionImage = uniqid() . '.' . $request->file('faq_section_image')->getClientOriginalExtension(); $request->file('faq_section_image')->move(public_path('assets/front/img/user/home_settings/'), $faqSectionImage); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->faq_section_image)); $homeText->faq_section_image = $faqSectionImage; } if ($request->hasFile('counter_section_image')) { $counterSectionImg = uniqid() . '.' . $request->file('counter_section_image')->getClientOriginalExtension(); $request->file('counter_section_image')->move(public_path('assets/front/img/user/home_settings/'), $counterSectionImg); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->counter_section_image)); $homeText->counter_section_image = $counterSectionImg; } if ($request->hasFile('on_sale_section_image')) { $onSaleSectionImage = uniqid() . '.' . $request->file('on_sale_section_image')->getClientOriginalExtension(); $request->file('on_sale_section_image')->move(public_path('assets/front/img/user/home_settings/'), $onSaleSectionImage); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->on_sale_section_image)); $homeText->on_sale_section_image = $onSaleSectionImage; } if ($request->hasFile('contact_section_image')) { $contactSecImage = uniqid() . '.' . $request->file('contact_section_image')->getClientOriginalExtension(); $request->file('contact_section_image')->move(public_path('assets/front/img/user/home_settings/'), $contactSecImage); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->contact_section_image)); $homeText->contact_section_image = $contactSecImage; } $homeText->user_id = Auth::guard('web')->user()->id; $homeText->language_id = $request->language_id; $homeText->save(); Session::flash('success', __('Home page text updated successfully') . '.'); return "success"; } public function seo(Request $request) { // first, get the language info from db $language = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstOrFail(); $langId = $language->id; // then, get the seo info of that language from db $seo = SEO::where('language_id', $langId)->where('user_id', Auth::guard('web')->user()->id); if ($seo->count() == 0) { // if seo info of that language does not exist then create a new one SEO::create($request->except('language_id', 'user_id') + [ 'language_id' => $langId, 'user_id' => Auth::guard('web')->user()->id ]); } $information['language'] = $language; // then, get the seo info of that language from db $information['data'] = $seo->first(); // get all the languages from db $information['langs'] = Language::where('user_id', Auth::guard('web')->user()->id)->get(); return view('user.settings.seo', $information); } public function updateSEO(Request $request) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } // first, get the language info from db $language = Language::where('code', '=', $request->language) ->where('user_id', $user->id) ->first(); $langId = $language->id; // then, get the seo info of that language from db $seo = SEO::where('language_id', $langId) ->where('user_id', $user->id) ->first(); // else update the existing seo info of that language $seo->update($request->all()); $request->session()->flash('success', __('SEO Informations updated successfully') . '!'); return redirect()->back(); } public function cookieAlert(Request $request) { $userId = Auth::guard('web')->user()->id; $data['abe'] = BasicSetting::where('user_id', $userId)->first(); return view('user.settings.cookie', $data); } public function updatecookie(Request $request) { $userId = Auth::guard('web')->user()->id; $request->validate([ 'cookie_alert_status' => 'required', 'cookie_alert_text' => 'required', 'cookie_alert_button_text' => 'required|max:25', ]); $be = BasicSetting::query() ->where('user_id', $userId) ->first(); $be->cookie_alert_status = $request->cookie_alert_status; $be->cookie_alert_text = Purifier::clean($request->cookie_alert_text, 'youtube'); $be->cookie_alert_button_text = $request->cookie_alert_button_text; $be->save(); Session::flash('success', __('Cookie alert updated successfully') . '!'); return back(); } public function teamSection(Request $request) { // first, get the language info from db $language = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $information['language'] = $language; // then, get the testimonial section heading info of that language from db $information['data'] = HomePageText::where('language_id', $language->id)->where('user_id', Auth::guard('web')->user()->id)->first(); // also, get the testimonials of that language from db $information['memberInfos'] = Member::where('language_id', $language->id) ->where('user_id', Auth::guard('web')->user()->id) ->orderby('id', 'desc') ->get(); // get all the languages from db $information['langs'] = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->get(); return view('user.team_section.index', $information); } public function updateTeamSection(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $data = HomePageText::where('language_id', $lang->id)->where('user_id', Auth::guard('web')->user()->id)->first(); $data->team_section_title = $request->team_section_title; $data->team_section_subtitle = $request->team_section_subtitle; $data->save(); $request->session()->flash('success', __('Team section updated successfully') . '!'); return redirect()->back(); } public function homePageAbout(Request $request) { $language = Language::where('user_id', Auth::guard('web')->user()->id)->where('code', $request->language)->firstOrFail(); $text = HomePageText::where('user_id', Auth::guard('web')->user()->id)->where('language_id', $language->id); if ($text->count() == 0) { $text = new HomePageText; $text->language_id = $language->id; $text->user_id = Auth::guard('web')->user()->id; $text->save(); } else { $text = $text->first(); } $data['home_setting'] = $text; return view('user.about-section', $data); } public function homePageAboutUpdate(Request $request) { $rules = [ 'about_button_text' => 'nullable|max:50', 'about_snd_button_text' => 'nullable|max:50', 'about_button_url' => 'nullable|max:255', 'about_snd_button_url' => 'nullable|max:255', ]; $request->validate($rules); $homeText = HomePageText::query()->where('language_id', $request->language_id)->where('user_id', Auth::guard('web')->user()->id)->firstOrFail(); foreach ($request->types as $key => $type) { if ($type == 'about_image' || $type == 'about_video_url' || $type == 'about_video_image') { continue; } $homeText->$type = Purifier::clean($request[$type]); } if ($request->hasFile('about_image')) { $aboutImage = uniqid() . '.' . $request->file('about_image')->getClientOriginalExtension(); $request->file('about_image')->move(public_path('assets/front/img/user/home_settings/'), $aboutImage); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_image)); $homeText->about_image = $aboutImage; } if ($request->hasFile('about_video_image')) { $aboutVidImg = uniqid() . '.' . $request->file('about_video_image')->getClientOriginalExtension(); $request->file('about_video_image')->move(public_path('assets/front/img/user/home_settings/'), $aboutVidImg); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_video_image)); $homeText->about_video_image = $aboutVidImg; } if ($request->filled('about_video_url')) { $videoLink = $request->about_video_url; if (strpos($videoLink, "&") != false) { $videoLink = substr($videoLink, 0, strpos($videoLink, "&")); } } else { $videoLink = NULL; } $homeText->about_video_url = $videoLink; $homeText->user_id = Auth::guard('web')->user()->id; $homeText->language_id = $request->language_id; $homeText->save(); Session::flash('success', __('About section updated successfully') . '.'); return "success"; } public function homePageVideo(Request $request) { $language = Language::where([ ['code', $request->language], ['user_id', Auth::id()] ])->firstorFail(); // then, get the testimonial section heading info of that language from db $information['data'] = HomePageText::where('language_id', $language->id)->where('user_id', Auth::guard('web')->user()->id)->first(); return view('user.home.video-section', $information); } public function homePageUpdateVideo(Request $request) { $lang = Language::where('code', '=', $request->language) ->where('user_id', Auth::guard('web')->user()->id) ->first(); $data = HomePageText::where('language_id', $lang->id)->where('user_id', Auth::guard('web')->user()->id)->first(); if (empty($data)) { $data = HomePageText::create([ 'language_id' => $lang->id, 'user_id' => Auth::guard('web')->user()->id ]); } if (empty($data->video_section_image) && !$request->hasFile('video_section_image')) { $rules = [ 'video_section_image' => 'required|mimes:jpeg,jpg,png|max:1000', ]; $request->validate($rules); } $request['image_name'] = $data->video_section_image; if ($request->hasFile('video_section_image')) { $request['image_name'] = Uploader::update_picture('assets/front/img/user/home_settings/', $request->file('video_section_image'), $data->video_section_image); } $videoLink = $request->video_section_url; if (strpos($videoLink, "&") != false) { $videoLink = substr($videoLink, 0, strpos($videoLink, "&")); $request['video_section_url'] = $videoLink; } $data->update($request->except(['video_section_image', 'video_section_text']) + [ 'video_section_image' => $request->image_name, 'video_section_text' => clean($request->video_section_text), ]); $request->session()->flash('success', __('Video section updated successfully') . '!'); return redirect()->back(); } public function whyChooseUsSection(Request $request) { // first, get the language info from db $language = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); // then, get the blog section heading info of that language from db $information['data'] = HomePageText::where('language_id', $language->id)->first(); $userBs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->select('theme')->first(); if ($userBs->theme == 'home_one' || $userBs->theme == 'home_three' || $userBs->theme == 'home_nine') { $information['chooseUsItems'] = DB::table('user_choose_us_items')->where('user_id', Auth::guard('web')->user()->id)->where('language_id', $language->id)->orderBy('serial_number')->get(); } return view("user.home.why-choose-us-section", $information); } public function updateWhyChooseUsSection(Request $request, $language) { $rules = [ 'why_choose_us_section_title' => 'nullable|max:255', 'why_choose_us_section_subtitle' => 'nullable|max:255', 'why_choose_us_section_text' => 'nullable', 'why_choose_us_section_button_text' => 'nullable|max:255', 'why_choose_us_section_button_url' => 'nullable|max:255' ]; $lang = Language::where('code', $language)->where('user_id', Auth::guard('web')->user()->id)->first(); $userBs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); $data = HomePageText::where('language_id', $lang->id)->where('user_id', Auth::guard('web')->user()->id)->first(); $request['video_image_name'] = $data->why_choose_us_section_video_image; $request['image_name'] = $data->why_choose_us_section_image; if (empty($data->why_choose_us_section_image) && !$request->hasFile('why_choose_us_section_image')) { $rules['why_choose_us_section_image'] = 'nullable|mimes:jpeg,jpg,png'; } if (empty($data->why_choose_us_section_video_image) && !$request->hasFile('why_choose_us_section_video_image') && $userBs->theme === 'home_three') { $rules['why_choose_us_section_video_image'] = 'nullable|mimes:jpeg,jpg,png'; } if ($request->hasFile('why_choose_us_section_image')) { $request['image_name'] = Uploader::update_picture('assets/front/img/user/home_settings/', $request->file('why_choose_us_section_image'), $data->why_choose_us_section_image); } if ($userBs->theme === 'home_three') { $rules['why_choose_us_section_video_url'] = 'nullable'; if ($request->hasFile('why_choose_us_section_video_image')) { $request['video_image_name'] = Uploader::update_picture('assets/front/img/user/home_settings/', $request->file('why_choose_us_section_video_image'), $data->why_choose_us_section_video_image); } } $validator = \Illuminate\Support\Facades\Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } $data->update($request->except(['why_choose_us_section_image', 'why_choose_us_section_text', 'why_choose_us_section_video_image', 'why_choose_us_section_video_url']) + [ 'why_choose_us_section_image' => $request->image_name, 'why_choose_us_section_video_image' => $request->video_image_name, 'why_choose_us_section_text' => clean($request->why_choose_us_section_text), 'why_choose_us_section_video_url' => (strpos($request->why_choose_us_section_video_url, "&") != false) ? substr($request->why_choose_us_section_video_url, 0, strpos($request->why_choose_us_section_video_url, "&")) : $request->why_choose_us_section_video_url, ]); $request->session()->flash('success', __('Why choose us section updated successfully') . '!'); return redirect()->back(); } public function whyChooseUsItemStore(Request $request) { $request->validate([ 'user_language_id' => 'required', 'icon' => 'required', 'title' => 'required', 'content' => 'required', 'serial_number' => 'required' ]); try { DB::table('user_choose_us_items')->insert($request->except('_token', 'user_language_id') + [ 'user_id' => Auth::guard('web')->user()->id, 'language_id' => $request->user_language_id, ]); session()->flash('success', __('Why choose us item store successfully') . '!'); // return response()->json(['status' => 'success'], 200); return 'success'; } catch (\Exception $e) { session()->flash('warning', $e->getMessage()); return 'success'; } } public function whyChooseUsItemUpdate(Request $request) { $rules = [ 'icon' => 'required', 'title' => 'required', 'content' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errors = $validator->errors()->toArray(); $response = ['error' => true]; foreach ($errors as $field => $messages) { $response[$field] = $messages; } return response()->json($response); } try { DB::table('user_choose_us_items')->where('id', $request->id)->update($request->except('_token', 'id') + [ 'user_id' => Auth::guard('web')->user()->id ]); session()->flash('success', __('Why choose us item update successfully') . '!'); return 'success'; } catch (\Exception $e) { session()->flash('warning', $e->getMessage()); return redirect()->back(); } } public function whyChooseUsItemDelete(Request $request) { DB::table('user_choose_us_items')->where('id', $request->id)->delete(); session()->flash('success', __('Why choose us item Delete successfully') . '!'); return redirect()->back(); // return 'success'; } public function sections(Request $request) { $data['sections'] = HomeSection::where('user_id', Auth::guard('web')->user()->id)->first(); return view('user.home.sections', $data); } public function updateSection(Request $request) { $fields = $request->except('_token'); $sections = HomeSection::where('user_id', Auth::guard('web')->user()->id)->first(); if (is_null($sections)) { $sections = new HomeSection; $sections->user_id = Auth::guard('web')->user()->id; } foreach ($fields as $key => $value) { if ($request->has("$key")) { $sections["$key"] = $value; } } $sections->save(); Session::flash('success', __('Sections customized successfully') . '!'); return back(); } public function workProcessSection(Request $request) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } // first, get the language info from db $language = Language::where('code', $request->language) ->where('user_id', $user->id) ->first(); // then, get the blog section heading info of that language from db $information['data'] = HomePageText::where('language_id', $language->id) ->where('user_id', $user->id) ->first(); $information['workProcessInfos'] = WorkProcess::where('language_id', $language->id)->orderby('id', 'desc')->get(); $information['language'] = $language; return view('user.home.work-process-section.index', $information); } public function updateWorkProcessSection(Request $request) { $request->validate([ 'work_process_section_title' => 'nullable|max:255', 'work_process_section_subtitle' => 'nullable|max:255', 'work_process_section_text' => 'nullable', ]); $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $data = HomePageText::where('language_id', $lang->id)->where('user_id', Auth::guard('web')->user()->id)->first(); if (empty($data)) { $data = new HomePageText; } $userBs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if ($userBs->theme === 'home_two' || $userBs->theme === 'home_four' || $userBs->theme === 'home_five' || $userBs->theme === 'home_six') { if (empty($data->work_process_section_img) && !$request->hasFile('work_process_section_img')) { $request->validate( ['work_process_section_img' => 'nullable|mimes:jpeg,jpg,png|max:1000'] ); } if (empty($data->work_process_section_video_img) && !$request->hasFile('work_process_section_video_img')) { $request->validate( ['work_process_section_video_img' => 'nullable|mimes:jpeg,jpg,png|max:1000'] ); } if (!$request->hasFile('work_process_section_img')) { $request['image_name'] = $data->work_process_section_img; } if (!$request->hasFile('work_process_section_video_img')) { $request['video_image_name'] = $data->work_process_section_video_img ?? null; } if ($request->hasFile('work_process_section_img')) { $request['image_name'] = Uploader::update_picture('assets/front/img/work_process/', $request->file('work_process_section_img'), $data->work_process_section_img ?? ''); } if ($request->hasFile('work_process_section_video_img')) { $request['video_image_name'] = Uploader::update_picture('assets/front/img/work_process/', $request->file('work_process_section_video_img'), $data->work_process_section_video_img); } $data->work_process_section_img = $request->image_name; $data->work_process_section_video_img = $request->video_image_name; $data->work_process_section_video_url = $request->work_process_section_video_url; $data->user_id = Auth::guard('web')->user()->id; $data->language_id = $lang->id; $data->save(); } $videoLink = $request->work_process_section_video_url; if (!empty($videoLink) && (strpos($videoLink, "&") != false)) { $videoLink = substr($videoLink, 0, strpos($videoLink, "&")); } $data->update($request->except(['work_process_section_text', 'work_process_section_img', 'work_process_section_video_img', 'work_process_section_video_url']) + [ 'work_process_section_text' => clean($request->work_process_section_text), 'work_process_section_video_url' => $videoLink ]); $request->session()->flash('success', __('Work process section updated successfully') . '!'); return redirect()->back(); } public function plugins() { $data = BasicSetting::where('user_id', Auth::guard('web')->user()->id) ->select('is_recaptcha', 'google_recaptcha_site_key', 'google_recaptcha_secret_key', 'whatsapp_status', 'whatsapp_number', 'whatsapp_header_title', 'whatsapp_popup_status', 'whatsapp_popup_message', 'analytics_status', 'measurement_id', 'disqus_status', 'disqus_short_name', 'pixel_status', 'pixel_id', 'tawkto_status', 'tawkto_direct_chat_link') ->first(); return view('user.settings.plugins', compact('data')); } public function updateRecaptcha(Request $request) { $rules = [ 'is_recaptcha' => 'required', 'google_recaptcha_site_key' => 'required', 'google_recaptcha_secret_key' => 'required' ]; $request->validate($rules); BasicSetting::where('user_id', Auth::guard('web')->user()->id)->update( [ 'is_recaptcha' => $request->is_recaptcha, 'google_recaptcha_site_key' => $request->google_recaptcha_site_key, 'google_recaptcha_secret_key' => $request->google_recaptcha_secret_key, ] ); $request->session()->flash('success', __('Recaptcha info updated successfully') . '!'); return back(); } public function updateAnalytics(Request $request) { $rules = [ 'analytics_status' => 'required', 'measurement_id' => 'required' ]; $request->validate($rules); BasicSetting::where('user_id', Auth::guard('web')->user()->id)->update( [ 'analytics_status' => $request->analytics_status, 'measurement_id' => $request->measurement_id ] ); $request->session()->flash('success', __('Analytics info updated successfully') . '!'); return back(); } public function updateWhatsApp(Request $request) { $rules = [ 'whatsapp_status' => 'required', 'whatsapp_number' => 'required', 'whatsapp_header_title' => 'required', 'whatsapp_popup_status' => 'required', 'whatsapp_popup_message' => 'required' ]; $request->validate($rules); BasicSetting::where('user_id', Auth::guard('web')->user()->id)->update( [ 'whatsapp_status' => $request->whatsapp_status, 'whatsapp_number' => $request->whatsapp_number, 'whatsapp_header_title' => $request->whatsapp_header_title, 'whatsapp_popup_status' => $request->whatsapp_popup_status, 'whatsapp_popup_message' => clean($request->whatsapp_popup_message) ] ); $request->session()->flash('success', __('WhatsApp info updated successfully') . '!'); return back(); } public function updateDisqus(Request $request) { $rules = [ 'disqus_status' => 'required', 'disqus_short_name' => 'required' ]; $request->validate($rules); BasicSetting::where('user_id', Auth::guard('web')->user()->id)->update( [ 'disqus_status' => $request->disqus_status, 'disqus_short_name' => $request->disqus_short_name ] ); $request->session()->flash('success', __('Disqus info updated successfully') . '!'); return back(); } public function updatePixel(Request $request) { $rules = [ 'pixel_status' => 'required', 'pixel_id' => 'required' ]; $request->validate($rules); BasicSetting::where('user_id', Auth::guard('web')->user()->id)->update( [ 'pixel_status' => $request->pixel_status, 'pixel_id' => $request->pixel_id ] ); $request->session()->flash('success', __('Facebook Pixel info updated successfully') . '!'); return back(); } public function updateTawkto(Request $request) { $rules = [ 'tawkto_status' => 'required', 'tawkto_direct_chat_link' => 'required' ]; $request->validate($rules); BasicSetting::where('user_id', Auth::guard('web')->user()->id)->update( [ 'tawkto_status' => $request->tawkto_status, 'tawkto_direct_chat_link' => $request->tawkto_direct_chat_link ] ); $request->session()->flash('success', __('Tawk.to info updated successfully') . '!'); return back(); } public function cvUpload() { $data['basic_setting'] = BasicSetting::where('user_id', Auth::id())->first(); return view('user.cv', $data); } public function updateCV(Request $request) { $request->validate([ 'cv' => "required|file|mimes:pdf|max:10000" ]); $file = $request->file('cv'); if ($request->hasFile('cv')) { $filename = uniqid() . '.' . $file->getClientOriginalExtension(); $file->move(public_path('assets/front/img/user/cv/'), $filename); $bss = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if (!is_null($bss)) { if ($bss->favicon) { @unlink(public_path('assets/front/img/user/cv/' . $bss->cv)); } $bss->cv_original = $file->getClientOriginalName(); $bss->cv = $filename; $bss->save(); } else { $bs = new BasicSetting(); $bs->cv_original = $file->getClientOriginalName(); $bs->cv = $filename; $bs->user_id = Auth::guard('web')->user()->id; $bs->save(); } } Session::flash('success', __('Updated successfully') . '!'); return redirect()->back(); } public function deleteCV() { $bs = BasicSetting::where('user_id', Auth::id())->first(); @unlink(public_path('assets/front/img/user/cv/' . $bs->cv)); $bs->cv = NULL; $bs->cv_original = NULL; $bs->save(); Session::flash('success', __('Deleted successfully') . '!'); return back(); } } Http/Controllers/User/NewsletterController.php 0000644 00000000251 15213350435 0015617 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class NewsletterController extends Controller { // } Http/Controllers/User/MailTemplateController.php 0000644 00000005754 15213350435 0016056 0 ustar 00 <?php namespace App\Http\Controllers\User; use Validator; use Illuminate\Http\Request; use App\Models\EmailTemplate; use App\Http\Controllers\Controller; use App\Http\Helpers\UserPermissionHelper; use Illuminate\Support\Facades\Auth; use App\Models\User\UserEmailTemplate; class MailTemplateController extends Controller { public function mailTemplates() { $packagePermissions = json_decode(UserPermissionHelper::packagePermission(Auth::guard('web')->user()->id), true); $courseEmailTemplate = ['course_enrolment', 'course_enrolment_approved', 'course_enrolment_rejected']; $hotelEmailTemplate = ['room_booking']; $donationEmailTemplate = ['donation', 'donation_approved']; $ecommerceEmailTemplate = ['product_order']; $templates = UserEmailTemplate::where('user_id', Auth::guard('web')->user()->id) ->when($courseEmailTemplate, function ($query) use ($packagePermissions, $courseEmailTemplate) { if (!in_array('Course Management', $packagePermissions)) { $query->whereNotIn('email_type', $courseEmailTemplate); } }) ->when($hotelEmailTemplate, function ($query) use ($packagePermissions, $hotelEmailTemplate) { if (!in_array('Hotel Booking', $packagePermissions)) { $query->whereNotIn('email_type', $hotelEmailTemplate); } }) ->when($donationEmailTemplate, function ($query) use ($packagePermissions, $donationEmailTemplate) { if (!in_array('Donation Management', $packagePermissions)) { $query->whereNotIn('email_type', $donationEmailTemplate); } }) ->when($ecommerceEmailTemplate, function ($query) use ($packagePermissions, $ecommerceEmailTemplate) { if (!in_array('Ecommerce', $packagePermissions)) { $query->whereNotIn('email_type', $ecommerceEmailTemplate); } }) ->get(); $data['templates'] = $templates; return view('user.settings.email.templates', $data); } public function editMailTemplate($id) { $templateInfo = UserEmailTemplate::findOrFail($id); return view('user.settings.email.edit-template', compact('templateInfo')); } public function updateMailTemplate(Request $request, $id) { $rules = [ 'email_subject' => 'required', 'email_body' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator->errors()); } UserEmailTemplate::findOrFail($id)->update([ 'email_body' => clean($request->email_body), 'email_subject' => $request->email_subject, ]); $request->session()->flash('success', __('Mail template updated successfully'). '!'); return redirect()->back(); } } Http/Controllers/User/DomainController.php 0000644 00000002753 15213350435 0014703 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\BasicExtended; use App\Models\User\UserCustomDomain; use Auth; use Illuminate\Http\Request; use Session; class DomainController extends Controller { public function domains() { $rcDomain = UserCustomDomain::where('status', '<>', 2)->where('user_id', Auth::user()->id)->orderBy('id', 'DESC')->first(); $data['rcDomain'] = $rcDomain; return view('user.domains', $data); } public function domainrequest(Request $request) { $be = BasicExtended::select('domain_request_success_message', 'cname_record_section_title')->first(); $rules = [ 'custom_domain' => [ 'required', function ($attribute, $value, $fail) use ($be) { // if user request the current domain if (getCdomain(Auth::user()) == $value) { $fail(__('You cannot request your current domain') . '.'); } } ] ]; $request->validate($rules); $cdomain = new UserCustomDomain; $cdomain->user_id = Auth::user()->id; $cdomain->requested_domain = $request->custom_domain; $cdomain->current_domain = getCdomain(Auth::user()); $cdomain->status = 0; $cdomain->save(); $request->session()->flash('domain-success', $be->domain_request_success_message); return back(); } } Http/Controllers/User/CourseManagement/CouponController.php 0000644 00000005173 15213350435 0020173 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Http\Controllers\Controller; use App\Http\Requests\User\CourseManagement\CourseCouponRequest; use App\Models\User\CourseManagement\Coupon; use App\Models\User\CourseManagement\Course; use App\Models\User\Language; use App\Traits\MiscellaneousTrait; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class CouponController extends Controller { use MiscellaneousTrait; public function index() { $information['coupons'] = Coupon::where('user_id', Auth::guard('web')->user()->id)->orderByDesc('id')->get(); $information['courses'] = Course::where('status', 'published')->where('user_id', Auth::guard('web')->user()->id)->get(); $information['deLang'] = Language::where('dashboard_default', 1)->where('user_id', Auth::guard('web')->user()->id)->first(); $information['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo(Auth::guard('web')->user()->id); return view('user.course_management.coupon.index', $information); } public function store(CourseCouponRequest $request) { $startDate = Carbon::parse($request->start_date); $endDate = Carbon::parse($request->end_date); Coupon::create($request->except('start_date', 'end_date', 'courses') + [ 'courses' => json_encode($request->courses), 'user_id' => Auth::guard('web')->user()->id, 'start_date' => date_format($startDate, 'Y-m-d'), 'end_date' => date_format($endDate, 'Y-m-d') ]); session()->flash('success', __('New coupon added successfully') . '!'); return "success"; } public function update(CourseCouponRequest $request) { $startDate = Carbon::parse($request->start_date); $endDate = Carbon::parse($request->end_date); $courses = !empty($request->courses) ? json_encode($request->courses) : NULL; Coupon::where('user_id', Auth::guard('web')->user()->id)->find($request->id)->update( $request->except('start_date', 'end_date', 'courses') + [ 'courses' => $courses, 'start_date' => date_format($startDate, 'Y-m-d'), 'end_date' => date_format($endDate, 'Y-m-d') ] ); session()->flash('success', __('Coupon updated successfully') . '!'); return "success"; } public function destroy($id) { Coupon::where('user_id', Auth::guard('web')->user()->id) ->find($id) ->delete(); return redirect()->back()->with('success', __('Coupon deleted successfully') . '!'); } } Http/Controllers/User/CourseManagement/Payment/MercadoPagoController.php 0000644 00000014711 15213350435 0022524 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class MercadoPagoController extends Controller { use MiscellaneousTrait; private $token, $sandbox_status; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'mercadopago') ->where('user_id', $user->id) ->first(); $mercadopagoData = json_decode($data->information, true); $this->token = $mercadopagoData['token']; $this->sandbox_status = $mercadopagoData['sandbox_check']; } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $allowedCurrencies = array('ARS', 'BOB', 'BRL', 'CLF', 'CLP', 'COP', 'CRC', 'CUC', 'CUP', 'DOP', 'EUR', 'GTQ', 'HNL', 'MXN', 'NIO', 'PAB', 'PEN', 'PYG', 'USD', 'UYU', 'VEF', 'VES'); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', 'Invalid currency for mercadopago payment.'); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'MercadoPago', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Course Enrolment'; $notifyURL = route('course_enrolment.mercadopago.notify', getParam()); $completeURL = route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); $curl = curl_init(); $preferenceData = [ 'items' => [ [ 'id' => uniqid(), 'title' => $title, 'description' => 'Course Enrolment via MercadoPago', 'quantity' => 1, 'currency' => $currencyInfo->base_currency_text, 'unit_price' => $calculatedData['grandTotal'] ] ], 'payer' => [ 'email' => Auth::guard('customer')->user()->email ], 'back_urls' => [ 'success' => $notifyURL, 'pending' => '', 'failure' => $cancelURL ], 'notification_url' => $notifyURL, 'auto_return' => 'approved' ]; $httpHeader = ['Content-Type: application/json']; $url = 'https://api.mercadopago.com/checkout/preferences?access_token=' . $this->token; $curlOPT = [ CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode($preferenceData, true), CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => $httpHeader ]; curl_setopt_array($curl, $curlOPT); $response = curl_exec($curl); $responseInfo = json_decode($response, true); curl_close($curl); // put some data in session before redirect to mercadopago url $request->session()->put('userId', $userId); $request->session()->put('courseId', $courseId); $request->session()->put('arrData', $arrData); if ($this->sandbox_status == 1) { return redirect($responseInfo['sandbox_init_point']); } else { return redirect($responseInfo['init_point']); } } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $courseId = $request->session()->get('courseId'); $arrData = $request->session()->get('arrData'); $paymentURL = 'https://api.mercadopago.com/v1/payments/' . $request['payment_id'] . '?access_token=' . $this->token; $paymentData = $this->curlCalls($paymentURL); $paymentInfo = json_decode($paymentData, true); if ($paymentInfo['status'] == 'approved') { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } public function curlCalls($url) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $curlData = curl_exec($curl); curl_close($curl); return $curlData; } } Http/Controllers/User/CourseManagement/Payment/PhonePeController.php 0000644 00000023233 15213350435 0021700 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use Illuminate\Support\Facades\Session; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Cache; class PhonePeController extends Controller { private $sandboxCheck; public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $customerInfo = Auth::guard('customer')->user(); if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', 'Invalid currency for Phonepe payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'PhonePe', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Course Enrolment'; $_amount = $calculatedData['coursePrice']; $notifyURL = route('course_enrolment.phonepe.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); // new code start $user = getUser(); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'phonepe']])->first(); $paymentInfo = json_decode($paymentMethod->information, true); if (empty($paymentInfo['merchant_id']) || empty($paymentInfo['salt_key'])) { throw new \Exception('Invalid PhonePe configuration'); } $this->sandboxCheck = $paymentInfo['sandbox_check'] ?? 0; $clientId = $paymentInfo['merchant_id']; $clientSecret = $paymentInfo['salt_key']; // put some data in session before redirect to paypal url $request->session()->put('courseId', $courseId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); $accessToken = $this->getPhonePeAccessToken($clientId, $clientSecret); if (!$accessToken) { return back()->withError('Failed to get PhonePe access token'); } return $this->initiatePayment($accessToken, $notifyURL, $cancelURL, $_amount); } private function getPhonePeAccessToken($clientId, $clientSecret) { return Cache::remember('phonepe_access_token', 3500, function () use ($clientId, $clientSecret) { $tokenUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox/v1/oauth/token' : 'https://api.phonepe.com/apis/identity-manager/v1/oauth/token'; $response = Http::asForm()->post($tokenUrl, [ 'client_id' => $clientId, 'client_secret' => $clientSecret, 'client_version' => 1, 'grant_type' => 'client_credentials' ]); if ($response->successful()) { return $response->json()['access_token']; } return null; }); } public function initiatePayment($accessToken, $successUrl, $cancelUrl, $_amount) { $baseUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox' : 'https://api.phonepe.com/apis/pg'; $endpoint = '/checkout/v2/pay'; // Generate a unique merchantOrderId and store it in the session $merchantOrderId = uniqid(); Session::put('merchantOrderId', $merchantOrderId); Session::put('cancel_url', $cancelUrl); //here we preapare the parameter of the request $payload = [ 'merchantOrderId' => $merchantOrderId, 'amount' => intval($_amount * 100), //you have to multiply the amount by 100 to convert it to paise 'paymentFlow' => [ 'type' => 'PG_CHECKOUT', 'merchantUrls' => [ 'redirectUrl' => $successUrl, 'cancelUrl' => $cancelUrl ] ] ]; try { //after preparing the parameter we send a request to create a payment link $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'O-Bearer ' . $accessToken, ])->post($baseUrl . $endpoint, $payload); $responseData = $response->json(); //after successfully created the payment link of we redirect the user to api responsed redirectUrl if ($response->successful() && isset($responseData['redirectUrl'])) { return redirect()->away($responseData['redirectUrl']); } else { // Handle API errors Session::forget(['merchantOrderId', 'cancel_url']); return back()->with('error', 'Failed to initiate payment: ' . ($responseData['message'] ?? 'Unknown error')); } } catch (\Exception $e) { Session::forget(['merchantOrderId', 'cancel_url']); return response()->json([ 'success' => false, 'code' => 'NETWORK_ERROR', 'message' => $e->getMessage() ], 500); } } public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $merchantOrderId = $request->input('merchantOrderId') ?? Session::get('merchantOrderId') ?? uniqid(); $verificationResponse = $this->verifyOrderStatus($merchantOrderId); if ($verificationResponse['success']) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // clear all session data $this->clearSessionData($request); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // clear all session data $this->clearSessionData($request); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } private function verifyOrderStatus($merchantOrderId) { $user = getUser(); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'phonepe']])->first(); $paymentInfo = json_decode($paymentMethod->information, true); $this->sandboxCheck = $paymentInfo['sandbox_check'] ?? 0; try { $accessToken = $this->getPhonePeAccessToken( $paymentInfo['merchant_id'], $paymentInfo['salt_key'] ); if (!$accessToken) { throw new \Exception('Failed to get access token'); } $baseUrl = $this->sandboxCheck ? 'https://api-preprod.phonepe.com/apis/pg-sandbox' : 'https://api.phonepe.com/apis/pg'; $endpoint = "/checkout/v2/order/{$merchantOrderId}/status"; $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'O-Bearer ' . $accessToken, ])->get($baseUrl . $endpoint); if ($response->successful()) { $responseData = $response->json(); if ($responseData['state'] === 'COMPLETED') { return [ 'success' => true, 'state' => $responseData['state'], 'amount' => $responseData['amount'] ?? null, 'data' => $responseData, ]; } return [ 'success' => false, 'error' => 'Payment not completed: ' . ($responseData['state'] ?? 'Unknown state'), ]; } else { return [ 'success' => false, 'error' => $response->json() ?? 'Unknown error' ]; } } catch (\Exception $e) { return [ 'success' => false, 'error' => $e->getMessage() ]; } } private function clearSessionData(Request $request) { $request->session()->forget([ 'userId', 'courseId', 'arrData', 'merchantOrderId', 'cancel_url' ]); } } Http/Controllers/User/CourseManagement/Payment/OfflineController.php 0000644 00000010642 15213350435 0021724 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Helpers\Uploader; use App\Models\User\CourseManagement\CourseEnrolment; use App\Models\User\UserOfflineGateway; use App\Rules\ImageMimeTypeRule; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; class OfflineController extends Controller { use MiscellaneousTrait; public function enrolmentProcess(Request $request, $courseId, $userId) { // check whether this course is already enrolled to authenticate user $authUser = Auth::guard('customer')->user(); $status = CourseEnrolment::query() ->where('customer_id', $authUser->id) ->where('user_id', $userId) ->where('course_id', $courseId) ->pluck('payment_status') ->first(); if (!is_null($status) && $status == 'pending') { session()->flash('warning', 'Your enrolment request for this course is pending.'); return redirect()->back(); } $offlineGateway = UserOfflineGateway::query() ->where('user_id', $userId) ->find($request->gateway); // check whether attachment is required or not if ((session()->has('discountedPrice') && session()->get('discountedPrice') == 0)) { $gname = '-'; } else { if ($offlineGateway->is_receipt == 1) { $rules = [ 'attachment' => [ 'required', new ImageMimeTypeRule() ] ]; $validator = Validator::make($request->all(), $rules); session()->flash('gatewayId', $offlineGateway->id); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } } $gname = $offlineGateway->name; } $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // store attachment in local storage if ($request->hasFile('attachment')) { $user_id = getUser()->id; $attachmentName = Uploader::upload_picture(Constant::WEBSITE_ENROLLMENT_ATTACHMENT, $request->file('attachment'), $user_id); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => $gname, 'gatewayType' => 'offline', 'paymentStatus' => 'pending', 'attachmentFile' => $request->exists('attachment') ? $attachmentName : null ); if ((session()->has('discountedPrice') && session()->get('discountedPrice') == 0)) { $arrData['gatewayType'] = 'online'; $arrData['paymentStatus'] = 'completed'; } // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); if ((session()->has('discountedPrice') && session()->get('discountedPrice') == 0)) { // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId, 'via' => 'coupon100']); } else { return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId, 'via' => 'offline']); } } } Http/Controllers/User/CourseManagement/Payment/MyFatoorahController.php 0000644 00000015421 15213350435 0022413 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Basel\MyFatoorah\MyFatoorah; use Illuminate\Support\Facades\Config; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use Illuminate\Support\Facades\Auth; class MyFatoorahController extends Controller { public $myfatoorah; public function __construct() { if (Session::has('user_midtrans')) { $user = Session::get('user_midtrans'); } else { $user = getUser(); } $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'myfatoorah']])->first(); $paydata = json_decode($paymentMethod->information, true); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); Config::set('myfatorah.token', $paydata['token']); Config::set('myfatorah.DisplayCurrencyIso', $currencyInfo->base_currency_text); Config::set('myfatorah.CallBackUrl', route('myfatoorah.success')); Config::set('myfatorah.ErrorUrl', route('myfatoorah.cancel')); if ($paydata['sandbox_status'] == 1) { $this->myfatoorah = MyFatoorah::getInstance(true); } else { $this->myfatoorah = MyFatoorah::getInstance(false); } } public function enrolmentProcess(Request $request, $courseId, $userId) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); Session::put('user_midtrans', $user); $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $customerInfo = Auth::guard('customer')->user(); $allowed_currency = array('KWD', 'SAR', 'BHD', 'AED', 'QAR', 'OMR', 'JOD'); if (!in_array($currencyInfo->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', 'Invalid currency for yoco payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'MyFatoorah', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); $success_url = route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); Session::put('myfatoorah_cancel_url', $cancelURL); Session::put('myfatoorah_success_url', $success_url); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'myfatoorah']])->first(); $paydata = $paymentMethod->convertAutoData(); $random_1 = rand(999, 9999); $random_2 = rand(9999, 99999); // send request to myfatoorah for create a payment $result = $this->myfatoorah->sendPayment( $customerInfo->username, $calculatedData['grandTotal'], [ 'CustomerMobile' => $paydata['sandbox_status'] == 1 ? '56562123544' : $customerInfo->billing_number, 'CustomerReference' => "$random_1", //orderID 'UserDefinedField' => "$random_2", //clientID "InvoiceItems" => [ [ "ItemName" => "Product Purchase or Room Booking", "Quantity" => 1, "UnitPrice" => $calculatedData['grandTotal'] ] ] ] ); if ($result && $result['IsSuccess'] == true) { // put data into session for future use $request->session()->put('myfatoorah_payment_type', 'course'); $request->session()->put('courseId', $courseId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); //return to payment url return redirect($result['Data']['InvoiceURL']); } else { // if fail then return to cancel url return redirect($cancelURL); } } // return to success page public function successPayment(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); if (!empty($request->paymentId)) { $result = $this->myfatoorah->getPaymentStatus('paymentId', $request->paymentId); if ($result && $result['IsSuccess'] == true && $result['Data']['InvoiceStatus'] == "Paid") { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); // if success all process then return for success url return [ 'status' => 'success' ]; } else { // if fail then return for cancel url return [ 'status' => 'fail' ]; } } } } Http/Controllers/User/CourseManagement/Payment/PaystackController.php 0000644 00000011541 15213350435 0022120 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class PaystackController extends Controller { use MiscellaneousTrait; private $api_key; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'paystack') ->where('user_id', $user->id) ->first(); $paystackData = json_decode($data->information, true); $this->api_key = $paystackData['key']; } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the currency is set to 'NGN' or not if ($currencyInfo->base_currency_text !== 'NGN') { return redirect()->back()->with('error', 'Invalid currency for paystack payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Paystack', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('course_enrolment.paystack.notify', getParam()); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.paystack.co/transaction/initialize', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode([ 'amount' => intval($calculatedData['grandTotal']) * 100, 'email' => Auth::guard('customer')->user()->email, 'callback_url' => $notifyURL ]), CURLOPT_HTTPHEADER => [ 'authorization: Bearer ' . $this->api_key, 'content-type: application/json', 'cache-control: no-cache' ] )); $response = curl_exec($curl); curl_close($curl); $transaction = json_decode($response, true); // put some data in session before redirect to paystack url $request->session()->put('userId', $userId); $request->session()->put('courseId', $courseId); $request->session()->put('arrData', $arrData); if ($transaction['status'] == true) { return redirect($transaction['data']['authorization_url']); } else { return redirect()->back()->with('error', 'Error: ' . $transaction['message'])->withInput(); } } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $courseId = $request->session()->get('courseId'); $arrData = $request->session()->get('arrData'); $urlInfo = $request->all(); if ($urlInfo['trxref'] === $urlInfo['reference']) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/MollieController.php 0000644 00000011600 15213350435 0021556 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Mollie\Api\MollieApiClient; class MollieController extends Controller { use MiscellaneousTrait; protected $mollie, $key; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'mollie') ->where('user_id', $user->id) ->first(); $mollieData = json_decode($data->information, true); $this->key = $mollieData['key']; $this->mollie = new MollieApiClient(); $this->mollie->setApiKey($this->key); } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $allowedCurrencies = array('AED', 'AUD', 'BGN', 'BRL', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HRK', 'HUF', 'ILS', 'ISK', 'JPY', 'MXN', 'MYR', 'NOK', 'NZD', 'PHP', 'PLN', 'RON', 'RUB', 'SEK', 'SGD', 'THB', 'TWD', 'USD', 'ZAR'); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', 'Invalid currency for mollie payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Mollie', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('course_enrolment.mollie.notify', getParam()); /** * we must send the correct number of decimals. * thus, we have used sprintf() function for format. */ $payment = $this->mollie->payments->create([ 'amount' => [ 'currency' => $currencyInfo->base_currency_text, 'value' => sprintf('%0.2f', $calculatedData['grandTotal']) ], 'description' => 'Course Enrolment Via Mollie', 'redirectUrl' => $notifyURL ]); // put some data in session before redirect to mollie url $request->session()->put('userId', $userId); $request->session()->put('courseId', $courseId); $request->session()->put('arrData', $arrData); $request->session()->put('paymentId', $payment->id); return redirect($payment->getCheckoutUrl(), 303); } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $courseId = $request->session()->get('courseId'); $arrData = $request->session()->get('arrData'); $paymentId = $request->session()->get('paymentId'); $paymentInfo = $this->mollie->payments->get($paymentId); if ($paymentInfo->isPaid() == true) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/ToyyibpayController.php 0000644 00000013525 15213350435 0022336 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Auth; class ToyyibpayController extends Controller { public function enrolmentProcess(Request $request, $courseId, $userId) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $customerInfo = Auth::guard('customer')->user(); $notifyURL = route('course_enrolment.toyyibpay.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); if ($currencyInfo->base_currency_text != 'RM') { return redirect()->back()->with('error', 'Invalid currency for toyyibpay payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Toyyibpay', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'toyyibpay']])->first(); $paydata = json_decode( $paymentMethod->information, true ); $ref = uniqid(); session()->put('toyyibpay_ref_id', $ref); $some_data = array( 'userSecretKey' => $paydata['secret_key'], 'categoryCode' => $paydata['category_code'], 'billName' => 'Course Enrolment', 'billDescription' => 'Pay via Course Enrolment', 'billPriceSetting' => 1, 'billPayorInfo' => 1, 'billAmount' => $calculatedData['grandTotal'] * 100, 'billReturnUrl' => $notifyURL, 'billExternalReferenceNo' => $ref, 'billTo' => $customerInfo->billing_fname . ' ' . $customerInfo->billing_lname, 'billEmail' => $customerInfo->billing_email, 'billPhone' => $customerInfo->billing_number, ); if ($paydata['sandbox_status'] == 1) { $host = 'https://dev.toyyibpay.com/'; // for development environment } else { $host = 'https://toyyibpay.com/'; // for production environment } $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, $host . 'index.php/api/createBill'); // sandbox will be dev. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $response = json_decode($result, true); if (!empty($response[0])) { // put some data in session before redirect to xendit url $request->session()->put('courseId', $courseId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); return redirect($host . $response[0]["BillCode"]); } else { return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $ref = session()->get('toyyibpay_ref_id'); if ($request['status_id'] == 1 && $request['order_id'] == $ref) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/RazorpayController.php 0000644 00000014433 15213350435 0022153 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Razorpay\Api\Api; use Razorpay\Api\Errors\SignatureVerificationError; class RazorpayController extends Controller { use MiscellaneousTrait; private $key, $secret, $api; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'razorpay') ->where('user_id', $user->id) ->first(); $razorpayData = json_decode($data->information, true); $this->key = $razorpayData['key']; $this->secret = $razorpayData['secret']; $this->api = new Api($this->key, $this->secret); } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', 'Invalid currency for razorpay payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Razorpay', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('course_enrolment.razorpay.notify', getParam()); // create order data $orderData = [ 'receipt' => 'Course Enrolment', 'amount' => $calculatedData['grandTotal'] * 100, 'currency' => 'INR', 'payment_capture' => 1 // auto capture ]; $razorpayOrder = $this->api->order->create($orderData); $webInfo = DB::table('basic_settings')->select('website_title')->first(); $buyerName = Auth::guard('customer')->user()->first_name . ' ' . Auth::guard('customer')->user()->last_name; $buyerEmail = Auth::guard('customer')->user()->email; $buyerContact = Auth::guard('customer')->user()->contact_number; // create checkout data $checkoutData = [ 'key' => $this->key, 'amount' => $orderData['amount'], 'name' => $webInfo->website_title, 'description' => 'Course Enrolment Via Razorpay', 'prefill' => [ 'name' => $buyerName, 'email' => $buyerEmail, 'contact' => $buyerContact ], 'order_id' => $razorpayOrder->id ]; $jsonData = json_encode($checkoutData); // put some data in session before redirect to razorpay url $request->session()->put('userId', $userId); $request->session()->put('courseId', $courseId); $request->session()->put('arrData', $arrData); $request->session()->put('razorpayOrderId', $razorpayOrder->id); return view('user-front.course_management.payment.razorpay', [getParam(), 'jsonData' => $jsonData, 'notifyURL' => $notifyURL]); } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $courseId = $request->session()->get('courseId'); $arrData = $request->session()->get('arrData'); $razorpayOrderId = $request->session()->get('razorpayOrderId'); $urlInfo = $request->all(); // assume that the transaction was successful $success = true; /** * either razorpay_order_id or razorpay_subscription_id must be present. * the keys of $attributes array must be followed razorpay convention. */ try { $attributes = [ 'razorpay_order_id' => $razorpayOrderId, 'razorpay_payment_id' => $urlInfo['razorpayPaymentId'], 'razorpay_signature' => $urlInfo['razorpaySignature'] ]; $this->api->utility->verifyPaymentSignature($attributes); } catch (SignatureVerificationError $e) { $success = false; } if ($success === true) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('razorpayOrderId'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('razorpayOrderId'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/AuthorizenetController.php 0000644 00000011344 15213350435 0023023 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Omnipay\Omnipay; class AuthorizenetController extends Controller { use MiscellaneousTrait; public $gateway; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'authorize.net') ->where('user_id', $user->id) ->first(); $paydata = $data->convertAutoData(); $this->gateway = Omnipay::create('AuthorizeNetApi_Api'); $this->gateway->setAuthName($paydata['login_id']); $this->gateway->setTransactionKey($paydata['transaction_key']); if ($paydata['sandbox_check'] == 1) { $this->gateway->setTestMode(true); } } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $allowedCurrencies = array('BIF', 'CAD', 'CDF', 'CVE', 'EUR', 'GBP', 'GHS', 'GMD', 'GNF', 'KES', 'LRD', 'MWK', 'MZN', 'NGN', 'RWF', 'SLL', 'STD', 'TZS', 'UGX', 'USD', 'XAF', 'XOF', 'ZMK', 'ZMW', 'ZWD'); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', 'Invalid currency for Authorize Net payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Authorize.net', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); if ($request->input('opaqueDataDescriptor') && $request->input('opaqueDataValue')) { try { // Generate a unique merchant site transaction ID. $transactionId = rand(100000000, 999999999); $response = $this->gateway->authorize([ 'amount' => $calculatedData['grandTotal'], 'currency' => $currencyInfo->base_currency_text, 'transactionId' => $transactionId, 'opaqueDataDescriptor' => $request->input('opaqueDataDescriptor'), 'opaqueDataValue' => $request->input('opaqueDataValue'), ])->send(); if ($response->isSuccessful()) { // Captured from the authorization response. $transactionReference = $response->getTransactionReference(); $response = $this->gateway->capture([ 'amount' => $calculatedData['grandTotal'], 'currency' => $currencyInfo->base_currency_text, 'transactionReference' => $transactionReference, ])->send(); $transaction_id = $response->getTransactionReference(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // not successful session()->flash('error', $response->getMessage()); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } catch (\Exception $e) { session()->flash('error', $e->getMessage()); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } } Http/Controllers/User/CourseManagement/Payment/PaytmController.php 0000644 00000011435 15213350435 0021435 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use Anand\LaravelPaytmWallet\Facades\PaytmWallet; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class PaytmController extends Controller { use MiscellaneousTrait; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'paytm') ->where('user_id', $user->id) ->first(); $paytmData = json_decode($data->information, true); config([ // in case you would like to overwrite values inside config/services.php 'services.paytm-wallet.env' => $paytmData['environment'], 'services.paytm-wallet.merchant_id' => $paytmData['secret'], 'services.paytm-wallet.merchant_key' => $paytmData['merchant'], 'services.paytm-wallet.merchant_website' => $paytmData['website'], 'services.paytm-wallet.industry_type' => $paytmData['industry'], 'services.paytm-wallet.channel' => 'WEB', ]); } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', 'Invalid currency for paytm payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Paytm', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $notifyURL = route('course_enrolment.paytm.notify', getParam()); $payment = PaytmWallet::with('receive'); $payment->prepare([ 'order' => time(), 'user' => uniqid(), 'mobile_number' => Auth::guard('customer')->user()->phone, 'email' => Auth::guard('customer')->user()->email, 'amount' => $calculatedData['grandTotal'], 'callback_url' => $notifyURL ]); // put some data in session before redirect to paytm url $request->session()->put('userId', $userId); $request->session()->put('courseId', $courseId); $request->session()->put('arrData', $arrData); return $payment->receive(); } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $courseId = $request->session()->get('courseId'); $arrData = $request->session()->get('arrData'); $transaction = PaytmWallet::with('receive'); // this response is needed to check the transaction status $response = $transaction->response(); if ($transaction->isSuccessful()) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/PaytabsController.php 0000644 00000012151 15213350435 0021742 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Http; class PaytabsController extends Controller { public function enrolmentProcess(Request $request, $courseId, $userId) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $enrol = new EnrolmentController(); $user = getUser(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $notifyURL = route('course_enrolment.paytabs.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); $paytabInfo = paytabInfo('user', $user->id); if ($currencyInfo->base_currency_text != $paytabInfo['currency']) { return redirect()->back()->with('error', 'Invalid currency for paytabs payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Paytabs', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paytabInfo = paytabInfo('user', $user->id); $description = 'Course enrolment via paytabs'; try { $response = Http::withHeaders([ 'Authorization' => $paytabInfo['server_key'], // Server Key 'Content-Type' => 'application/json', ])->post( $paytabInfo['url'], [ 'profile_id' => $paytabInfo['profile_id'], // Profile ID 'tran_type' => 'sale', 'tran_class' => 'ecom', 'cart_id' => uniqid(), 'cart_description' => $description, 'cart_currency' => $paytabInfo['currency'], // set currency by region 'cart_amount' => round($calculatedData['grandTotal'], 2), 'return' => $notifyURL, ] ); $responseData = $response->json(); // put some data in session before redirect to paytabs url $request->session()->put('courseId', $courseId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); return redirect()->to($responseData['redirect_url']); } catch (\Exception $e) { return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $resp = $request->all(); if ($resp['respStatus'] == "A" && $resp['respMessage'] == 'Authorised') { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/FlutterwaveController.php 0000644 00000017450 15213350435 0022656 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use KingFlamez\Rave\Facades\Rave as Flutterwave; class FlutterwaveController extends Controller { use MiscellaneousTrait; protected $key, $secret; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'flutterwave') ->where('user_id', $user->id) ->first(); $flutterwaveData = json_decode($data->information, true); $this->key = $flutterwaveData['public_key']; $this->secret = $flutterwaveData['secret_key']; config([ // in case you would like to overwrite values inside config/services.php 'flutterwave.publicKey' => $this->key, 'flutterwave.secretKey' => $this->secret, 'flutterwave.secretHash' => '', ]); } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $allowedCurrencies = array('BIF', 'CAD', 'CDF', 'CVE', 'EUR', 'GBP', 'GHS', 'GMD', 'GNF', 'KES', 'LRD', 'MWK', 'MZN', 'NGN', 'RWF', 'SLL', 'STD', 'TZS', 'UGX', 'USD', 'XAF', 'XOF', 'ZMK', 'ZMW', 'ZWD'); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the base currency is allowed or not if (!in_array($currencyInfo->base_currency_text, $allowedCurrencies)) { return redirect()->back()->with('error', 'Invalid currency for flutterwave payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Flutterwave', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Course Enrolment'; $notifyURL = route('course_enrolment.flutterwave.notify', getParam()); $cancel_url = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); // // generate a payment reference $paymentId = uniqid(); $curl = curl_init(); $currency = $currencyInfo->base_currency_text; $txref = $paymentId; // ensure you generate unique references per transaction. $PBFPubKey = $this->key; // get your public key from the dashboard. $redirect_url = $notifyURL; $payment_plan = ""; // this curl_setopt_array($curl, array( CURLOPT_URL => "https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/hosted/pay", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'amount' => $calculatedData['grandTotal'], 'customer_email' => Auth::guard('customer')->user()->email, 'currency' => $currency, 'txref' => $txref, 'PBFPubKey' => $PBFPubKey, 'redirect_url' => $redirect_url, 'payment_plan' => $payment_plan ]), CURLOPT_HTTPHEADER => [ "content-type: application/json", "cache-control: no-cache" ], )); $response = curl_exec($curl); $err = curl_error($curl); if ($err) { // there was an error contacting the rave API return redirect($cancel_url)->with('error', 'Curl returned error: ' . $err); } // put some data in session before redirect to flutterwave url $request->session()->put('courseId', $courseId); $request->session()->put('arrData', $arrData); $request->session()->put('userId', $userId); $request->session()->put('paymentId', $paymentId); $transaction = json_decode($response); if ($transaction->status == 'error' || (!$transaction->data && !$transaction->data->link)) { // there was an error from the API return redirect($cancel_url)->with('error', 'API returned error: ' . $transaction->message); } return redirect()->to($transaction->data->link); } public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $cancelUrl = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); $urlInfo = $request->all(); $paymentId = Session::get('paymentId'); if (isset($request['txref'])) { $ref = $paymentId; $query = array( "SECKEY" => $this->secret, "txref" => $ref ); $data_string = json_encode($query); $ch = curl_init('https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $response = curl_exec($ch); curl_close($ch); $resp = json_decode($response, true); if ($resp['status'] == 'error') { return redirect($cancelUrl); } if ($resp['status'] = "success") { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('paymentId'); $request->session()->forget('arrData'); return redirect($cancelUrl); } } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect($cancelUrl); } } } Http/Controllers/User/CourseManagement/Payment/MidtransController.php 0000644 00000014105 15213350435 0022121 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Midtrans\Snap; use Midtrans\Config as MidtransConfig; class MidtransController extends Controller { public function enrolmentProcess(Request $request, $courseId, $userId) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $customerInfo = Auth::guard('customer')->user(); $notifyURL = route('course_enrolment.midtrans.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); if ($currencyInfo->base_currency_text != 'IDR') { return redirect()->back()->with('error', 'Invalid currency for yoco payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Midtrans', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $user = getUser(); $paymentMethod = UserPaymentGeteway::where([['user_id', $user->id], ['keyword', 'midtrans']])->first(); $paydata = $paymentMethod->convertAutoData(); // will come from database MidtransConfig::$serverKey = $paydata['server_key']; MidtransConfig::$isProduction = $paydata['is_production'] == 0 ? true : false; MidtransConfig::$isSanitized = true; MidtransConfig::$is3ds = true; $token = uniqid(); Session::put('token', $token); $params = [ 'transaction_details' => [ 'order_id' => $token, 'gross_amount' => $calculatedData['grandTotal'] * 1000, // will be multiplied by 1000 ], 'customer_details' => [ 'first_name' => $customerInfo->username, 'email' => $customerInfo->billing_email, 'phone' => $customerInfo->contact_number ? $customerInfo->contact_number : null, ], ]; $snapToken = Snap::getSnapToken($params); // put some data in session before redirect to midtrans url if ( $paydata['is_production'] == 1 ) { $is_production = $paydata['is_production']; } $data['title'] = "Course Enrolment via midtrans"; $data['snapToken'] = $snapToken; $data['is_production'] = $is_production; $data['success_url'] = $notifyURL; $data['_cancel_url'] = $cancelURL; $data['client_key'] = $paydata['server_key']; // put some data in session before redirect to xendit url $request->session()->put('courseId', $courseId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); //put data into session for midtrans bank notify Session::put('user_midtrans', $user); Session::put('midtrans_payment_type', 'course'); Session::put('midtrans_cancel_url', route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId])); Session::put('midtrans_success_url', route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId])); return view('payments.midtrans-membership', $data); } // return to success page public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $token = Session::get('token'); if ($request->status_code == 200 && $token == $request->order_id) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/PerfectMoneyController.php 0000644 00000013356 15213350435 0022747 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Traits\MiscellaneousTrait; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Auth; use App\Models\User\BasicSetting; use Illuminate\Support\Facades\Session; class PerfectMoneyController extends Controller { public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $customerInfo = Auth::guard('customer')->user(); if ($currencyInfo->base_currency_text !== 'USD') { return redirect()->back()->with('error', 'Invalid currency for perfect money payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], // 'coursePrice' => 0.01, //test price 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Perfect Money', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Course Enrolment'; $notifyURL = route('course_enrolment.perfect_money.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'perfect_money']])->first(); $paydata = json_decode($paymentMethod->information, true); /*--------------------------------------- ========= Payment gatewyay =============== ----------------------------------------*/ $user = getUser(); $userBs = BasicSetting::select('website_title')->where('user_id', $user->id)->first(); $randomNo = substr(uniqid(), 0, 8); $val['PAYEE_ACCOUNT'] = $paydata['perfect_money_wallet_id'];; $val['PAYEE_NAME'] = $userBs->website_title; $val['PAYMENT_ID'] = "$randomNo"; //random id $val['PAYMENT_AMOUNT'] = $calculatedData['coursePrice']; // $val['PAYMENT_AMOUNT'] = 0.01; //test amount $val['PAYMENT_UNITS'] = "$currencyInfo->base_currency_text"; $val['STATUS_URL'] = $notifyURL; $val['PAYMENT_URL'] = $notifyURL; $val['PAYMENT_URL_METHOD'] = 'GET'; $val['NOPAYMENT_URL'] = $cancelURL; $val['NOPAYMENT_URL_METHOD'] = 'GET'; $val['SUGGESTED_MEMO'] = "$customerInfo->email"; $val['BAGGAGE_FIELDS'] = 'IDENT'; $data['val'] = $val; $data['method'] = 'post'; $data['url'] = 'https://perfectmoney.com/api/step1.asp'; // put some data in session before redirect to paypal url Session::put('payment_id', $randomNo); Session::put('cancel_url', $cancelURL); Session::put('amount', $calculatedData['coursePrice']); // Session::put('amount', 0.01); //test amount Session::put('courseId', $courseId); Session::put('userId', $userId); Session::put('arrData', $arrData); return view('payments.perfect-money', compact('data')); } public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $amo = $request['PAYMENT_AMOUNT']; $track = $request['PAYMENT_ID']; $id = Session::get('payment_id'); $final_amount = Session::get('amount'); $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'perfect_money']])->first(); $perfectMoneyInfo = $paymentMethod->convertAutoData(); if ($request->PAYEE_ACCOUNT == $perfectMoneyInfo['perfect_money_wallet_id'] && $track == $id && $amo == round($final_amount, 2)) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data Session::forget('userId'); Session::forget('courseId'); Session::forget('arrData'); Session::forget('payment_id'); Session::forget('cancel_url'); Session::forget('amount'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data Session::forget('userId'); Session::forget('courseId'); Session::forget('arrData'); Session::forget('payment_id'); Session::forget('cancel_url'); Session::forget('amount'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/XenditController.php 0000644 00000013153 15213350435 0021575 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; class XenditController extends Controller { public function enrolmentProcess(Request $request, $courseId, $userId) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $customerInfo = Auth::guard('customer')->user(); $notifyURL = route('course_enrolment.xendit.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); $allowed_currency = array('IDR', 'PHP', 'USD', 'SGD', 'MYR'); if (!in_array($currencyInfo->base_currency_text, $allowed_currency)) { return redirect()->back()->with('error', 'Invalid currency for paytm payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Xendit', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'xendit']])->first(); $paydata = json_decode($paymentMethod->information, true); $external_id = Str::random(10); $secret_key = 'Basic ' . base64_encode($paydata['secret_key'] . ':'); $data_request = Http::withHeaders([ 'Authorization' => $secret_key ])->post('https://api.xendit.co/v2/invoices', [ 'external_id' => $external_id, 'amount' => $calculatedData['grandTotal'], 'currency' => $currencyInfo->base_currency_text, 'success_redirect_url' => $notifyURL ]); $response = $data_request->object(); $response = json_decode(json_encode($response), true); if (!empty($response['success_redirect_url'])) { // put some data in session before redirect to xendit url $request->session()->put('courseId', $courseId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); $request->session()->put('xendit_id', $response['id']); $request->session()->put('secret_key', $secret_key); $request->session()->put('userId', $userId); return redirect($response['invoice_url']); } else { return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $xendit_id = Session::get('xendit_id'); $secret_key = Session::get('secret_key'); $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'xendit']])->first(); $paydata = json_decode($paymentMethod->information, true); $p_secret_key = 'Basic ' . base64_encode($paydata['secret_key'] . ':'); if (!is_null($xendit_id) && $secret_key == $p_secret_key) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/IyzicoController.php 0000644 00000021203 15213350435 0021603 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; class IyzicoController extends Controller { public function enrolmentProcess(Request $request, $courseId, $userId) { $profile_status = $this->check_profile(); if ($profile_status == 'incomplete') { Session::flash('warning', 'Please, Complete your billing information before payment using iyzico payment method'); return redirect()->route('customer.billing-details', getParam()); } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $customerInfo = Auth::guard('customer')->user(); $notifyURL = route('course_enrolment.iyzico.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); if ($currencyInfo->base_currency_text != 'TRY') { return redirect()->back()->with('error', 'Invalid currency for iyzico payment.')->withInput(); } $conversation_id = uniqid(9999, 999999); $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Iyzico', 'gatewayType' => 'online', 'paymentStatus' => 'pending', 'conversation_id' => $conversation_id ); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $first_name = $customerInfo->billing_fname; $last_name = $customerInfo->billing_lname; $email = $customerInfo->billing_email; $address = $customerInfo->billing_address; $city = $customerInfo->billing_city; $country = $customerInfo->billing_country; $phone = $customerInfo->billing_number; $zip_code = $request->zip_code; $identity_number = $request->identity_number; $basket_id = 'B' . uniqid(999, 99999); $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'iyzico']])->first(); $paydata = json_decode($paymentMethod->information, true); $options = new \Iyzipay\Options(); $options->setApiKey($paydata['api_key']); $options->setSecretKey($paydata['secret_key']); if ($paydata['sandbox_status'] == 1) { $options->setBaseUrl("https://sandbox-api.iyzipay.com"); } else { $options->setBaseUrl("https://api.iyzipay.com"); // production mode } # create request class $request = new \Iyzipay\Request\CreatePayWithIyzicoInitializeRequest(); $request->setLocale(\Iyzipay\Model\Locale::EN); $request->setConversationId($conversation_id); $request->setPrice($calculatedData['grandTotal']); $request->setPaidPrice($calculatedData['grandTotal']); $request->setCurrency(\Iyzipay\Model\Currency::TL); $request->setBasketId($basket_id); $request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT); $request->setCallbackUrl($notifyURL); $request->setEnabledInstallments(array(2, 3, 6, 9)); $buyer = new \Iyzipay\Model\Buyer(); $buyer->setId(uniqid()); $buyer->setName($first_name); $buyer->setSurname($last_name); $buyer->setGsmNumber($phone); $buyer->setEmail($email); $buyer->setIdentityNumber($identity_number); $buyer->setLastLoginDate(""); $buyer->setRegistrationDate(""); $buyer->setRegistrationAddress($address); $buyer->setIp(""); $buyer->setCity($city); $buyer->setCountry($country); $buyer->setZipCode($zip_code); $request->setBuyer($buyer); $shippingAddress = new \Iyzipay\Model\Address(); $shippingAddress->setContactName($first_name); $shippingAddress->setCity($city); $shippingAddress->setCountry($country); $shippingAddress->setAddress($address); $shippingAddress->setZipCode($zip_code); $request->setShippingAddress($shippingAddress); $billingAddress = new \Iyzipay\Model\Address(); $billingAddress->setContactName($first_name); $billingAddress->setCity($city); $billingAddress->setCountry($country); $billingAddress->setAddress($address); $billingAddress->setZipCode($zip_code); $request->setBillingAddress($billingAddress); $q_id = uniqid(999, 99999); $basketItems = array(); $firstBasketItem = new \Iyzipay\Model\BasketItem(); $firstBasketItem->setId($q_id); $firstBasketItem->setName("Course Id " . $q_id); $firstBasketItem->setCategory1("Course Enrolment"); $firstBasketItem->setCategory2(""); $firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL); $firstBasketItem->setPrice($calculatedData['grandTotal']); $basketItems[0] = $firstBasketItem; $request->setBasketItems($basketItems); # make request $payWithIyzicoInitialize = \Iyzipay\Model\PayWithIyzicoInitialize::create($request, $options); $paymentResponse = (array)$payWithIyzicoInitialize; foreach ($paymentResponse as $key => $data) { $paymentInfo = json_decode($data, true); if ($paymentInfo['status'] == 'success') { if (!empty($paymentInfo['payWithIyzicoPageUrl'])) { Session::put('conversation_id', $conversation_id); // put some data in session before redirect to xendit url Session::put('courseId', $courseId); Session::put('userId', $userId); Session::put('arrData', $arrData); return redirect($paymentInfo['payWithIyzicoPageUrl']); } } return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } private function check_profile() { $customerInfo = Auth::guard('customer')->user(); if ($customerInfo) { if (empty($customerInfo->billing_fname) || empty($customerInfo->billing_email) || empty($customerInfo->billing_city) || empty($customerInfo->billing_country) || empty($customerInfo->billing_address) || empty($customerInfo->billing_number)) { return 'incomplete'; } else { return 'completed'; } } else { return 'incomplete'; } } } Http/Controllers/User/CourseManagement/Payment/InstamojoController.php 0000644 00000012037 15213350435 0022305 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Http\Helpers\Instamojo; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Exception; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class InstamojoController extends Controller { use MiscellaneousTrait; private $api; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'instamojo') ->where('user_id', $user->id) ->first(); $instamojoData = json_decode($data->information, true); if ($instamojoData['sandbox_check'] == 1) { $this->api = new Instamojo($instamojoData['key'], $instamojoData['token'], 'https://test.instamojo.com/api/1.1/'); } else { $this->api = new Instamojo($instamojoData['key'], $instamojoData['token']); } } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // checking whether the currency is set to 'INR' or not if ($currencyInfo->base_currency_text !== 'INR') { return redirect()->back()->with('error', 'Invalid currency for instamojo payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Instamojo', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Course Enrolment'; $notifyURL = route('course_enrolment.instamojo.notify', getParam()); try { $response = $this->api->paymentRequestCreate(array( 'purpose' => $title, 'amount' => $calculatedData['grandTotal'], 'buyer_name' => Auth::guard('customer')->user()->first_name . ' ' . Auth::guard('customer')->user()->last_name, 'send_email' => true, 'email' => Auth::guard('customer')->user()->email, 'phone' => Auth::guard('customer')->user()->contact_number, 'redirect_url' => $notifyURL )); // put some data in session before redirect to instamojo url $request->session()->put('userId', $userId); $request->session()->put('courseId', $courseId); $request->session()->put('arrData', $arrData); $request->session()->put('paymentId', $response['id']); return redirect($response['longurl']); } catch (Exception $e) { return redirect()->back()->with('error', $e)->withInput(); } } public function notify(Request $request) { // get the information from session $userId = $request->session()->get('userId'); $courseId = $request->session()->get('courseId'); $arrData = $request->session()->get('arrData'); $paymentId = $request->session()->get('paymentId'); $urlInfo = $request->all(); if ($urlInfo['payment_request_id'] == $paymentId) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/PaypalController.php 0000644 00000016060 15213350435 0021570 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Redirect; use PayPal\Api\Amount; use PayPal\Api\Item; use PayPal\Api\ItemList; use PayPal\Api\Payer; use PayPal\Api\Payment; use PayPal\Api\PaymentExecution; use PayPal\Api\RedirectUrls; use PayPal\Api\Transaction; use PayPal\Auth\OAuthTokenCredential; use PayPal\Exception\PPConnectionException; use PayPal\Rest\ApiContext; class PayPalController extends Controller { use MiscellaneousTrait; private $api_context; public function __construct() { $user = getUser(); $data = UserPaymentGeteway::query() ->where('keyword', 'paypal') ->where('user_id', $user->id) ->first(); $paypalData = json_decode($data->information, true); $paypal_conf = Config::get('paypal'); $paypal_conf['client_id'] = $paypalData['client_id']; $paypal_conf['secret'] = $paypalData['client_secret']; $paypal_conf['settings']['mode'] = $paypalData['sandbox_check'] == 1 ? 'sandbox' : 'live'; $this->api_context = new ApiContext( new OAuthTokenCredential( $paypal_conf['client_id'], $paypal_conf['secret'] ) ); $this->api_context->setConfig($paypal_conf['settings']); } public function enrolmentProcess(Request $request, $courseId, $userId) { $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // changing the currency before redirect to PayPal if ($currencyInfo->base_currency_text !== 'USD') { $rate = floatval($currencyInfo->base_currency_rate); $convertedTotal = round(($calculatedData['grandTotal'] / $rate), 2); } $paypalTotal = $currencyInfo->base_currency_text === 'USD' ? $calculatedData['grandTotal'] : $convertedTotal; $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'PayPal', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); $title = 'Course Enrolment'; $notifyURL = route('course_enrolment.paypal.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); $payer = new Payer(); $payer->setPaymentMethod('paypal'); $item_1 = new Item(); $item_1->setName($title) /** item name **/ ->setCurrency('USD') ->setQuantity(1) ->setPrice($paypalTotal); /** unit price **/ $item_list = new ItemList(); $item_list->setItems(array($item_1)); $amount = new Amount(); $amount->setCurrency('USD') ->setTotal($paypalTotal); $transaction = new Transaction(); $transaction->setAmount($amount) ->setItemList($item_list) ->setDescription($title . ' via PayPal'); $redirect_urls = new RedirectUrls(); $redirect_urls->setReturnUrl($notifyURL) /** Specify return URL **/ ->setCancelUrl($cancelURL); $payment = new Payment(); $payment->setIntent('Sale') ->setPayer($payer) ->setRedirectUrls($redirect_urls) ->setTransactions(array($transaction)); try { $payment->create($this->api_context); } catch (PPConnectionException $ex) { return redirect($cancelURL)->with('error', $ex->getMessage()); } foreach ($payment->getLinks() as $link) { if ($link->getRel() == 'approval_url') { $redirectURL = $link->getHref(); break; } } // put some data in session before redirect to paypal url $request->session()->put('courseId', $courseId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); $request->session()->put('paymentId', $payment->getId()); if (isset($redirectURL)) { /** redirect to paypal **/ return Redirect::away($redirectURL); } } public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $paymentId = $request->session()->get('paymentId'); $urlInfo = $request->all(); if (empty($urlInfo['token']) || empty($urlInfo['PayerID'])) { return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } /** Execute The Payment **/ $payment = Payment::get($paymentId, $this->api_context); $execution = new PaymentExecution(); $execution->setPayerId($urlInfo['PayerID']); $result = $payment->execute($execution, $this->api_context); if ($result->getState() == 'approved') { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); $request->session()->forget('paymentId'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/YocoController.php 0000644 00000012265 15213350435 0021256 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Session; class YocoController extends Controller { public function enrolmentProcess(Request $request, $courseId, $userId) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); $customerInfo = Auth::guard('customer')->user(); $notifyURL = route('course_enrolment.yoco.notify', getParam()); $cancelURL = route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); if ($currencyInfo->base_currency_text != 'ZAR') { return redirect()->back()->with('error', 'Invalid currency for yoco payment.')->withInput(); } $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Yoco', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Purchase End ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ Payment Gateway Info ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'yoco']])->first(); $paydata = json_decode($paymentMethod->information, true); $response = Http::withHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $paydata['secret_key'], ])->post('https://payments.yoco.com/api/checkouts', [ 'amount' => $calculatedData['grandTotal'] * 100, 'currency' => 'ZAR', 'successUrl' => $notifyURL ]); $responseData = $response->json(); if (array_key_exists('redirectUrl', $responseData)) { // put some data in session before redirect to xendit url $request->session()->put('courseId', $courseId); $request->session()->put('userId', $userId); $request->session()->put('arrData', $arrData); $request->session()->put('yoco_id', $responseData['id']); $request->session()->put('s_key', $paydata['secret_key']); return redirect($responseData["redirectUrl"]); } else { return redirect($cancelURL); } } // return to success page public function notify(Request $request) { // get the information from session $courseId = $request->session()->get('courseId'); $userId = $request->session()->get('userId'); $arrData = $request->session()->get('arrData'); $id = Session::get('yoco_id'); $s_key = Session::get('s_key'); $paymentMethod = UserPaymentGeteway::where([['user_id', $userId], ['keyword', 'yoco']])->first(); $paydata = json_decode($paymentMethod->information, true); if ($id && $paydata['secret_key'] == $s_key) { $enrol = new EnrolmentController(); // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { // remove all session data $request->session()->forget('userId'); $request->session()->forget('courseId'); $request->session()->forget('arrData'); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/Payment/StripeController.php 0000644 00000011330 15213350435 0021603 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Payment; use App\Http\Controllers\Controller; use App\Http\Controllers\Front\CourseManagement\EnrolmentController; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Cartalyst\Stripe\Exception\CardErrorException; use Cartalyst\Stripe\Exception\UnauthorizedException; use Cartalyst\Stripe\Laravel\Facades\Stripe; use Illuminate\Http\Request; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Validator; class StripeController extends Controller { use MiscellaneousTrait; public function enrolmentProcess(Request $request, $courseId, $userId) { // card validation start $rules = [ 'stripeToken' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } // card validation end $enrol = new EnrolmentController(); // do calculation $calculatedData = $enrol->calculation($request, $courseId, $userId); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($userId); // changing the currency before redirect to Stripe if ($currencyInfo->base_currency_text !== 'USD') { $rate = floatval($currencyInfo->base_currency_rate); $convertedTotal = round(($calculatedData['grandTotal'] / $rate), 2); } $stripeTotal = $currencyInfo->base_currency_text === 'USD' ? $calculatedData['grandTotal'] : $convertedTotal; $arrData = array( 'courseId' => $courseId, 'coursePrice' => $calculatedData['coursePrice'], 'discount' => $calculatedData['discount'], 'grandTotal' => $calculatedData['grandTotal'], 'currencyText' => $currencyInfo->base_currency_text, 'currencyTextPosition' => $currencyInfo->base_currency_text_position, 'currencySymbol' => $currencyInfo->base_currency_symbol, 'currencySymbolPosition' => $currencyInfo->base_currency_symbol_position, 'paymentMethod' => 'Stripe', 'gatewayType' => 'online', 'paymentStatus' => 'completed' ); try { // initialize stripe $stripe = new Stripe(); $data = UserPaymentGeteway::query() ->where('keyword', 'stripe') ->where('user_id', $userId) ->first(); $stripeData = json_decode($data->information, true); $secret = $stripeData['secret']; $key = $stripeData['key']; config([ // in case you would like to overwrite values inside config/services.php 'services.stripe.secret' => $secret, 'services.stripe.key' => $key, ]); $stripe = Stripe::make(Config::get('services.stripe.secret')); try { // generate token $token = $request['stripeToken']; if (!isset($token)) { return back()->with('error', 'Token Problem With Your Token.'); } // generate charge $charge = $stripe->charges()->create([ 'card' => $token, 'currency' => 'USD', 'amount' => $stripeTotal ]); if ($charge['status'] == 'succeeded') { // store the course enrolment information in database $enrolmentInfo = $enrol->storeData($arrData, $userId); // generate an invoice in pdf format $invoice = $enrol->generateInvoice($enrolmentInfo, $courseId, $userId); // then, update the invoice field info in database $enrolmentInfo->update(['invoice' => $invoice]); // send a mail to the customer with the invoice $enrol->sendMail($enrolmentInfo, $userId); return redirect()->route('front.user.course_enrolment.complete', [getParam(), 'id' => $courseId]); } else { return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } catch (CardErrorException $e) { session()->flash('error', $e->getMessage()); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } catch (UnauthorizedException $e) { session()->flash('error', $e->getMessage()); return redirect()->route('front.user.course_enrolment.cancel', [getParam(), 'id' => $courseId]); } } } Http/Controllers/User/CourseManagement/LessonController.php 0000644 00000007270 15213350435 0020173 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Models\User\CourseManagement\Lesson; use App\Models\User\CourseManagement\Module; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; use App\Http\Helpers\Uploader; use Illuminate\Support\Facades\DB; class LessonController extends Controller { public function store($id, Request $request) { $module = Module::select('language_id')->find($id); $rules = [ 'title' => 'required', 'status' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } Lesson::create($request->except('module_id') + [ 'module_id' => $id, 'language_id' => $module->language_id, 'user_id' => Auth::guard('web')->user()->id ]); session()->flash('success', __('New lesson added successfully') . '!'); return "success"; } public function update(Request $request) { $lesson = Lesson::where('user_id', Auth::guard('web')->user()->id)->find($request->id); $rules = [ 'title' => 'required', 'status' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $lesson->update($request->all()); session()->flash('success', __('Lesson updated successfully') . '!'); return "success"; } public function destroy($id) { $lesson = Lesson::where('user_id', Auth::guard('web')->user()->id)->find($id); $lessonContents = $lesson->content()->get(); foreach ($lessonContents as $lessonContent) { if ($lessonContent->type == 'video') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $lessonContent->video_unique_name); } else if ($lessonContent->type == 'file') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $lessonContent->file_unique_name); } else if ($lessonContent->type == 'quiz') { $lessonQuizzes = $lessonContent->quiz()->get(); foreach ($lessonQuizzes as $lessonQuiz) { $lessonQuiz->delete(); } } $lessonContent->delete(); } // find out the module of this lesson $module = $lesson->module; $lesson->delete(); // update module's total period $totalLessonPeriod = Lesson::where('user_id', Auth::guard('web')->user()->id)->where('module_id', $module->id)->sum(DB::raw('TIME_TO_SEC(duration)')); $moduleDuration = gmdate('H:i:s', $totalLessonPeriod); $module->update([ 'duration' => $moduleDuration ]); // update course's total period $totalModulePeriod = Module::where('course_information_id', $module->course_information_id)->sum(DB::raw('TIME_TO_SEC(duration)')); $courseDuration = gmdate('H:i:s', $totalModulePeriod); $course = $module->courseInformation->course; $course->update([ 'duration' => $courseDuration ]); return redirect()->back()->with('success', __('Lesson deleted successfully') . '!'); } } Http/Controllers/User/CourseManagement/EnrolmentController.php 0000644 00000030464 15213350435 0020674 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\BasicSetting; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseEnrolment; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\Language; use App\Models\User\UserEmailTemplate; use App\Models\User\UserOfflineGateway; use App\Models\User\UserPaymentGeteway; use Illuminate\Http\Request; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; use Maatwebsite\Excel\Facades\Excel; use App\Exports\EnrolmentsExport; use PDF; use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\PHPMailer; class EnrolmentController extends Controller { public function index(Request $request) { $defaultLang = Language::query()->where('user_id', Auth::guard('web')->user()->id)->where('dashboard_default', 1)->first(); $orderId = $paymentStatus = null; if ($request->filled('order_id')) { $orderId = $request['order_id']; } if ($request->filled('status')) { $paymentStatus = $request['status']; } $courseIds = []; if ($request->filled('course')) { $courseIds = CourseInformation::where('title', 'like', '%' . $request->course . '%')->where('language_id', $defaultLang->id)->pluck('course_id')->toArray(); } $enrolments = CourseEnrolment::where('user_id', Auth::guard('web')->user()->id) ->when($orderId, function ($query, $orderId) { return $query->where('order_id', 'like', '%' . $orderId . '%'); })->when($paymentStatus, function ($query, $paymentStatus) { return $query->where('payment_status', '=', $paymentStatus); }); $enrolments = $enrolments->where(function ($query) use ($courseIds, $request) { if (!empty($courseIds)) { foreach ($courseIds as $key => $courseId) { if ($key == 0) { $query->where('course_id', $courseId); } else { $query->orWhere('course_id', $courseId); } } } elseif (!empty($request->course) && empty($courseIds)) { $query->where('course_id', []); } }); $enrolments = $enrolments->orderByDesc('id')->paginate(10); return view('user.course_management.enrolment.index', compact('enrolments', 'defaultLang')); } public function updatePaymentStatus(Request $request, $id) { $enrolment = CourseEnrolment::where('user_id', Auth::guard('web')->user()->id)->find($id); if ($request['payment_status'] == 'completed') { $enrolment->update([ 'payment_status' => 'completed' ]); $invoice = $this->generateInvoice($enrolment); $enrolment->update([ 'invoice' => $invoice ]); $this->sendMail($request, $enrolment, 'enrolment approved'); } else if ($request['payment_status'] == 'pending') { $enrolment->update([ 'payment_status' => 'pending' ]); } else { $enrolment->update([ 'payment_status' => 'rejected' ]); $this->sendMail($request, $enrolment, 'enrolment rejected'); } return redirect()->back(); } public function generateInvoice($enrolmentInfo) { $userId = Auth::guard('web')->user()->id; // delete previous invoice Uploader::remove(Constant::WEBSITE_ENROLLMENT_INVOICE, $enrolmentInfo->invoice); // generate new invoice $fileName = $enrolmentInfo->order_id . '.pdf'; $directory = public_path(Constant::WEBSITE_ENROLLMENT_INVOICE); if (!file_exists($directory)) { mkdir($directory, 0775, true); } $fileLocated = $directory.'/' . $fileName; $path = public_path(Constant::WEBSITE_ENROLLMENT_INVOICE . '/' . $fileName); // get course title $language = $this->getUserCurrentLanguage(Auth::guard('web')->user()->id); $course = $enrolmentInfo->course()->first(); $courseInfo = $course->courseInformation()->where('language_id', $language->id)->where('user_id', Auth::guard('web')->user()->id)->first(); $userBs = BasicSetting::select('email', 'from_name', 'website_title', 'logo', 'favicon')->where('user_id', $userId)->first(); $width = '50%'; $float = 'left'; PDF::loadView('pdf.enrollment', compact('enrolmentInfo', 'courseInfo', 'userBs', 'width', 'float'))->save($fileLocated); return $fileName; } public function sendMail($request, $enrolmentInfo, $mailFor) { $user = Auth::guard('web')->user(); $userId = $user->id; // first get the mail template info from db if ($mailFor == 'enrolment approved') { $mailTemplate = UserEmailTemplate::where('email_type', 'course_enrolment_approved')->where('user_id', $userId)->first(); } else { $mailTemplate = UserEmailTemplate::where('email_type', 'course_enrolment_rejected')->where('user_id', $userId)->first(); } $mailSubject = $mailTemplate->email_subject; $mailBody = $mailTemplate->email_body; // second get the website title & mail's smtp info from db $be = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_username', 'smtp_password', 'from_mail', 'from_name') ->first(); $userBs = BasicSetting::select('email', 'from_name', 'website_title')->where('user_id', $userId)->first(); $customerName = $enrolmentInfo->billing_first_name . ' ' . $enrolmentInfo->billing_last_name; $orderId = $enrolmentInfo->order_id; $language = Language::where('dashboard_default', 1)->where('user_id', $userId)->first(); $course = Course::where('id', $enrolmentInfo->course_id)->where('user_id', $userId)->firstOrFail(); $courseInfo = $course->courseInformation()->where('language_id', $language->id)->where('user_id', $userId)->firstOrFail(); $courseTitle = $courseInfo->title; $websiteTitle = $userBs->website_title; $mailBody = str_replace('{customer_name}', $customerName, $mailBody); $mailBody = str_replace('{order_id}', $orderId, $mailBody); $mailBody = str_replace('{title}', '<a href="' . route('front.user.course.details', [$user->username, $courseInfo->slug]) . '">' . $courseTitle . '</a>', $mailBody); $mailBody = str_replace('{website_title}', $websiteTitle, $mailBody); // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = 'UTF-8'; $mail->Encoding = 'base64'; // if smtp status == 1, then set some value for PHPMailer if ($be->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; // if ($be->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // } $mail->Port = 587; } // finally add other informations and send the mail try { // Recipients $mail->setFrom($be->from_mail, $userBs->from_name); $mail->addReplyTo($userBs->email, $userBs->from_name); $mail->addAddress($enrolmentInfo->billing_email); // Attachments (Invoice) if (!is_null($enrolmentInfo->invoice) && $mailFor == 'enrolment approved') { $mail->addAttachment(public_path(Constant::WEBSITE_ENROLLMENT_INVOICE . '/' . $enrolmentInfo->invoice)); } // Content $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); $request->session()->flash('success', __('Payment status updated & mail has been sent successfully') . '!'); } catch (Exception $e) { $request->session()->flash('warning', __('Mail could not be sent') . '.'); } return; } public function show($id) { $enrolmentInfo = CourseEnrolment::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); // get course title $language = $this->getUserCurrentLanguage(Auth::guard('web')->user()->id); $course = $enrolmentInfo->course()->first(); $courseInfo = $course->courseInformation()->where('language_id', $language->id)->where('user_id', Auth::guard('web')->user()->id)->first(); $courseTitle = $courseInfo->title; return view('user.course_management.enrolment.details', compact('enrolmentInfo', 'courseTitle')); } public function destroy($id) { $enrolmentInfo = CourseEnrolment::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); // first, delete the attachment Uploader::remove(Constant::WEBSITE_ENROLLMENT_ATTACHMENT, $enrolmentInfo->attachment); // second, delete the invoice Uploader::remove(Constant::WEBSITE_ENROLLMENT_INVOICE, $enrolmentInfo->invoice); $enrolmentInfo->delete(); return redirect()->back()->with('success', __('Enrolment deleted successfully') . '!'); } public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $enrolmentInfo = CourseEnrolment::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); // first, delete the attachment Uploader::remove(Constant::WEBSITE_ENROLLMENT_ATTACHMENT, $enrolmentInfo->attachment); // second, delete the invoice Uploader::remove(Constant::WEBSITE_ENROLLMENT_INVOICE, $enrolmentInfo->invoice); $enrolmentInfo->delete(); } session()->flash('success', __('Enrolments deleted successfully') . '!'); return "success"; } public function report(Request $request) { $fromDate = $request->from_date; $toDate = $request->to_date; $paymentStatus = $request->payment_status; $paymentMethod = $request->payment_method; $deLang = Language::where('dashboard_default', 1)->where('user_id', Auth::guard('web')->user()->id)->first(); if (!empty($fromDate) && !empty($toDate)) { $enrolments = CourseEnrolment::when($fromDate, function ($query, $fromDate) { return $query->whereDate('created_at', '>=', Carbon::parse($fromDate)); })->when($toDate, function ($query, $toDate) { return $query->whereDate('created_at', '<=', Carbon::parse($toDate)); })->when($paymentMethod, function ($query, $paymentMethod) { return $query->where('payment_method', $paymentMethod); })->when($paymentStatus, function ($query, $paymentStatus) { return $query->where('payment_status', '=', $paymentStatus); }) ->where('user_id', Auth::guard('web')->user()->id) ->orderByDesc('id'); Session::put('enrollment_report', $enrolments->get()); $data['enrolments'] = $enrolments->paginate(10); } else { Session::put('enrollment_report', []); $data['enrolments'] = []; } $data['onPms'] = UserPaymentGeteway::where('status', 1)->where('user_id', Auth::guard('web')->user()->id)->get(); $data['offPms'] = UserOfflineGateway::where('item_checkout_status', 1)->where('user_id', Auth::guard('web')->user()->id)->get(); $data['deLang'] = $deLang; $data['abs'] = BasicSetting::select('base_currency_symbol_position', 'base_currency_symbol')->first(); return view('user.course_management.enrolment.report', $data); } public function export() { $enrolments = Session::get('enrollment_report'); if (empty($enrolments) || count($enrolments) == 0) { Session::flash('warning', __('There is no enrolment to export') . '.'); return back(); } return Excel::download(new EnrolmentsExport($enrolments), 'enrolments.csv'); } } Http/Controllers/User/CourseManagement/Instructor/SocialLinkController.php 0000644 00000005737 15213350435 0023142 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Instructor; use App\Http\Controllers\Controller; use App\Models\User\CourseManagement\Instructor\Instructor; use App\Models\User\CourseManagement\Instructor\SocialLink; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; class SocialLinkController extends Controller { public function links($id) { $information['defaultLang'] = Language::where('user_id', Auth::guard('web')->user()->id)->where('dashboard_default', 1)->first(); $information['instructor'] = Instructor::where('user_id', Auth::guard('web')->user()->id)->find($id); $information['socialLinks'] = SocialLink::where('instructor_id', $id) ->where('user_id', Auth::guard('web')->user()->id) ->orderByDesc('id') ->get(); return view('user.course_management.instructor.social-links.index', $information); } public function storeLink($id, Request $request) { $rules = [ 'icon' => 'required', 'url' => 'required|url', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } SocialLink::create($request->except('instructor_id', 'user_id') + [ 'instructor_id' => $id, 'user_id' => Auth::guard('web')->user()->id ]); session()->flash('success', __('New social link added successfully') . '!'); return "success"; } public function editLink($instructor_id, $id) { $information['instructor'] = Instructor::where('user_id', Auth::guard('web')->user()->id)->where('id', $instructor_id)->first(); $information['socialLink'] = SocialLink::where('user_id', Auth::guard('web')->user()->id)->find($id); return view('user.course_management.instructor.social-links.edit', $information); } public function updateLink(Request $request, $id) { $rules = [ 'url' => 'required|url', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } SocialLink::where('user_id', Auth::guard('web')->user()->id)->find($id)->update($request->all()); session()->flash('success', __('Social link updated successfully') . '!'); return "success"; } public function destroyLink($id) { SocialLink::where('user_id', Auth::guard('web')->user()->id)->find($id)->delete(); return redirect()->back()->with('success', __('Social link deleted successfully') . '!'); } } Http/Controllers/User/CourseManagement/Instructor/InstructorController.php 0000644 00000015206 15213350435 0023256 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement\Instructor; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Http\Requests\User\CourseManagement\Instructor\InstructorStoreRequest; use App\Http\Requests\User\CourseManagement\Instructor\InstructorUpdateRequest; use App\Models\User\BasicSetting; use App\Models\User\CourseManagement\Instructor\Instructor; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Mews\Purifier\Facades\Purifier; class InstructorController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Http\Response */ public function index(Request $request) { // first, get the language info from db $information['language'] = Language::query()->where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $information['instructors'] = Instructor::query()->where('language_id', $information['language']->id) ->orderByDesc('id') ->get(); return view('user.course_management.instructor.index', $information); } /** * Show the form for creating a new resource. * * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Http\Response */ public function create() { // get all the languages from db $languages = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $information['languages'] = $languages; $information['defaultLang'] = $languages->where('dashboard_default', 1)->first(); return view('user.course_management.instructor.create', $information); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return string */ public function store(InstructorStoreRequest $request) { $imageName = Uploader::upload_picture(Constant::WEBSITE_INSTRUCTOR_IMAGE, $request->file('image')); Instructor::create($request->except('image', 'description', 'user_language_id', 'user_id') + [ 'image' => $imageName, 'description' => Purifier::clean($request->description), 'user_id' => Auth::guard('web')->user()->id, 'language_id' => $request->user_language_id ]); session()->flash('success', __('New instructor added successfully') . '.'); return "success"; } /** * Update featured status of a specified resource. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\RedirectResponse */ public function updateFeatured(Request $request, $id) { $instructor = Instructor::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); if ($request['is_featured'] == 1) { $instructor->update(['is_featured' => 1]); session()->flash('success', __('Instructor featured successfully') . '!'); } else { $instructor->update(['is_featured' => 0]); session()->flash('success', __('Instructor unfeatured successfully') . '!'); } return redirect()->back(); } /** * Show the form for editing the specified resource. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Contracts\View\View */ public function edit(Request $request, $id) { $information['language'] = Language::query() ->where('user_id', Auth::guard('web')->user()->id) ->where('code', $request['language']) ->first(); $information['instructor'] = Instructor::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); return view('user.course_management.instructor.edit', $information); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return string */ public function update(InstructorUpdateRequest $request, $id) { $instructor = Instructor::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); if ($request->hasFile('image')) { $imageName = Uploader::update_picture(Constant::WEBSITE_INSTRUCTOR_IMAGE, $request->file('image'), $instructor->image); } $instructor->update($request->except('image', 'description') + [ 'image' => $request->hasFile('image') ? $imageName : $instructor->image, 'description' => Purifier::clean($request->description) ]); session()->flash('success', __('Instructor updated successfully') . '!'); return "success"; } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\RedirectResponse */ public function destroy($id) { $instructor = Instructor::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); $courseCount = $instructor->courseList()->count(); if ($courseCount > 0) { return redirect()->back()->with('warning', __('First delete all the courses of this instructor') . '!'); } else { Uploader::remove(Constant::WEBSITE_INSTRUCTOR_IMAGE, $instructor->image); $instructor->delete(); return redirect()->back()->with('success', __('Instructor deleted successfully') . '!'); } } /** * Remove the selected resources from storage. * * @param \Illuminate\Http\Request $request * @return string */ public function bulkDestroy(Request $request) { $ids = $request->ids; $errorOccured = false; foreach ($ids as $id) { $instructor = Instructor::where('user_id', Auth::guard('web')->user()->id)->find($id); $courseCount = $instructor->courseList()->count(); if ($courseCount > 0) { $errorOccured = true; break; } else { Uploader::remove(Constant::WEBSITE_INSTRUCTOR_IMAGE, $instructor->image); $instructor->delete(); } } if ($errorOccured == true) { session()->flash('warning', __('First delete all the courses of those instructors') . '!'); } else { session()->flash('success', __('Instructors deleted successfully') . '!'); } return "success"; } } Http/Controllers/User/CourseManagement/ModuleController.php 0000644 00000020352 15213350435 0020151 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\CourseManagement\Module; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class ModuleController extends Controller { public function index(Request $request, $id) { $information['langs'] = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $information['language'] = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $information['defaultLang'] = Language::where('dashboard_default', 1)->where('user_id', Auth::guard('web')->user()->id)->first(); $information['course'] = Course::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->first(); $information['courseInformation'] = CourseInformation::where('course_id', $id)->where('language_id', $information['language']->id)->where('user_id', Auth::guard('web')->user()->id)->first(); if (!empty($information['courseInformation'])) { $id = $information['courseInformation']->id; $information['modules'] = Module::where('course_information_id', $id) ->orderBy('serial_number', 'ASC') ->get(); } else { Session::flash('warning', __('Please add course contents for') . ' ' . $information['language']->name . ' ' . __('first') . '!'); return back(); } return view('user.course_management.module.index', $information); } public function store($id, Request $request) { $rules = [ 'title' => 'required', 'status' => 'required', 'serial_number' => 'required', 'user_language_id' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $couorseInfo = CourseInformation::where('user_id', Auth::guard('web')->user()->id)->where('course_id', $id)->where('language_id', $request->user_language_id)->first(); if (empty($couorseInfo)) { $lang = Language::where('id', $request->user_language_id)->where('user_id', Auth::guard('web')->user()->id)->first(); Session::flash('warning', __('Please add course contents for') . ' ' . $lang->name . ' ' . __('first') . '!'); return 'warning'; } $courseInfoId = $couorseInfo->id; Module::create($request->except('course_information_id', 'user_language_id') + [ 'course_information_id' => $courseInfoId, 'user_id' => Auth::guard('web')->user()->id, 'language_id' => $request->user_language_id ]); session()->flash('success', __('New module added successfully') . '!'); return "success"; } public function update(Request $request) { $module = Module::query()->where('user_id', Auth::guard('web')->user()->id)->find($request->id); $rules = [ 'title' => 'required', 'status' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $module->update($request->all()); session()->flash('success', __('Module updated successfully') . '!'); return "success"; } public function destroy($id) { $module = Module::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); $lessons = $module->lesson()->get(); foreach ($lessons as $lesson) { $lessonContents = $lesson->content()->get(); foreach ($lessonContents as $lessonContent) { if ($lessonContent->type == 'video') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $lessonContent->video_unique_name); } else if ($lessonContent->type == 'file') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $lessonContent->file_unique_name); } else if ($lessonContent->type == 'quiz') { $lessonQuizzes = $lessonContent->quiz()->get(); foreach ($lessonQuizzes as $lessonQuiz) { $lessonQuiz->delete(); } } $lessonContent->delete(); } $lesson->delete(); } // find out the course of this module $courseInfo = $module->courseInformation; $course = $courseInfo->course; $module->delete(); // update course status (draft) of this module, when no module left $totalModules = Module::query()->where('course_information_id', $courseInfo->id) ->where('user_id', Auth::guard('web')->user()->id) ->where('status', 'published') ->count(); if ($totalModules == 0) { $course->update([ 'status' => 'draft' ]); } // update course's total period $totalModulePeriod = Module::query() ->where('user_id', Auth::guard('web')->user()->id) ->where('course_information_id', $courseInfo->id) ->sum(DB::raw('TIME_TO_SEC(duration)')); $courseDuration = gmdate('H:i:s', $totalModulePeriod); $course->update([ 'duration' => $courseDuration ]); return redirect()->back()->with('success', __('Module deleted successfully') . '!'); } public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $module = Module::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); $lessons = $module->lesson()->get(); foreach ($lessons as $lesson) { $lessonContents = $lesson->content()->get(); foreach ($lessonContents as $lessonContent) { if ($lessonContent->type == 'video') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $lessonContent->video_unique_name); } else if ($lessonContent->type == 'file') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $lessonContent->file_unique_name); } else if ($lessonContent->type == 'quiz') { $lessonQuizzes = $lessonContent->quiz()->get(); foreach ($lessonQuizzes as $lessonQuiz) { $lessonQuiz->delete(); } } $lessonContent->delete(); } $lesson->delete(); } // find out the course of this module $courseInfo = $module->courseInformation; $course = $courseInfo->course; $module->delete(); } // update course status (draft) of this module, when no module left $totalModules = Module::query()->where('user_id', Auth::guard('web')->user()->id)->where('course_information_id', $courseInfo->id)->where('status', 'published')->count(); if ($totalModules == 0) { $course->update([ 'status' => 'draft' ]); } // update course's total period $totalModulePeriod = Module::query()->where('user_id', Auth::guard('web')->user()->id)->where('course_information_id', $courseInfo->id)->sum(DB::raw('TIME_TO_SEC(duration)')); $courseDuration = gmdate('H:i:s', $totalModulePeriod); $course->update([ 'duration' => $courseDuration ]); $request->session()->flash('success', __('Modules deleted successfully') . '!'); return "success"; } } Http/Controllers/User/CourseManagement/CourseController.php 0000644 00000047462 15213350435 0020177 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Http\Requests\User\CourseManagement\CourseStoreRequest; use App\Http\Requests\User\CourseManagement\CourseUpdateRequest; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\Language; use App\Traits\MiscellaneousTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; use Mews\Purifier\Facades\Purifier; class CourseController extends Controller { use MiscellaneousTrait; /** * Display a listing of the resource. * * @return Application|Factory|View */ public function index(Request $request) { $languages = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $information['language'] = $languages->where('code', $request->language)->first(); $information['defaultLang'] = $languages->where('dashboard_default', 1)->first(); $information['courses'] = Course::query() ->join('user_course_informations', 'user_courses.id', '=', 'user_course_informations.course_id') ->join('user_course_instructors', 'user_course_informations.instructor_id', '=', 'user_course_instructors.id') ->join('user_course_categories', 'user_course_categories.id', '=', 'user_course_informations.course_category_id') ->where('user_course_informations.language_id', '=', $information['language']->id) ->where('user_courses.user_id', '=', Auth::guard('web')->user()->id) ->select( 'user_courses.*', 'user_course_informations.id as courseInfoId', 'user_course_informations.title', 'user_course_instructors.name as instructorName', 'user_course_categories.name as category' ) ->orderByDesc('user_courses.id') ->get(); $information['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo(Auth::guard('web')->user()->id); return view('user.course_management.course.index', $information); } /** * Show the form for creating a new resource. * * @return Application|Factory|View|\Illuminate\Http\Response */ public function create() { // get all the languages from db $languages = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $defaultLang = $languages->where('dashboard_default', 1)->first(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo(Auth::guard('web')->user()->id); return view('user.course_management.course.create', compact('languages', 'defaultLang', 'currencyInfo')); } /** * Store a newly created resource in storage. * * @param Request $request * @return string */ public function store(CourseStoreRequest $request) { // store thumbnail image in storage $thumbImgName = Uploader::upload_picture(Constant::WEBSITE_COURSE_THUMBNAIL_IMAGE, $request->file('thumbnail_image')); // format video link $link = $request['video_link']; if (strpos($link, '&') != 0) { $link = substr($link, 0, strpos($link, '&')); } // store cover image in storage $coverImgName = Uploader::upload_picture(Constant::WEBSITE_COURSE_COVER_IMAGE, $request->file('cover_image')); // store data in db $course = Course::create($request->except('thumbnail_image', 'video_link', 'cover_image', 'user_id') + [ 'thumbnail_image' => $thumbImgName, 'video_link' => $link, 'cover_image' => $coverImgName, 'user_id' => Auth::guard('web')->user()->id ]); $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($languages as $language) { $courseInformation = new CourseInformation(); $courseInformation->user_id = Auth::guard('web')->user()->id; $courseInformation->language_id = $language->id; $courseInformation->course_category_id = $request[$language->code . '_category_id']; $courseInformation->course_id = $course->id; $courseInformation->title = $request[$language->code . '_title']; $courseInformation->slug = make_slug($request[$language->code . '_title']); $courseInformation->instructor_id = $request[$language->code . '_instructor_id']; $courseInformation->features = $request[$language->code . '_features']; $courseInformation->description = Purifier::clean($request[$language->code . '_description']); $courseInformation->meta_keywords = $request[$language->code . '_meta_keywords']; $courseInformation->meta_description = $request[$language->code . '_meta_description']; $courseInformation->save(); } session()->flash('success', __('New course added successfully') . '!'); return "success"; } /** * Update status (draft/published) of a specified resource. * * @param Request $request * @param int $id * @return RedirectResponse */ public function updateStatus(Request $request, $id) { $course = Course::find($id); $course->update([ 'status' => $request['status'] ]); session()->flash('success', __('Course status updated successfully') . '!'); return redirect()->back(); } /** * Update featured status of a specified resource. * * @param Request $request * @param int $id * @return RedirectResponse */ public function updateFeatured(Request $request, $id) { $course = Course::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); if ($request['is_featured'] == 'yes') { $course->update(['is_featured' => 'yes']); session()->flash('success', __('Course featured successfully') . '!'); } else { $course->update(['is_featured' => 'no']); session()->flash('success', __('Course removed from featured successfully') . '!'); } return redirect()->back(); } /** * Show the form for editing the specified resource. * * @param int $id * @return Application|Factory|View|\Illuminate\Http\Response */ public function edit($id) { $information['course'] = Course::where('user_id', Auth::guard('web')->user()->id)->find($id); $languages = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $information['languages'] = $languages; $information['defaultLang'] = $languages->where('dashboard_default', 1)->first(); $information['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo(Auth::guard('web')->user()->id); return view('user.course_management.course.edit', $information); } /** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return string */ public function update(CourseUpdateRequest $request, $id) { $course = Course::where('user_id', Auth::guard('web')->user()->id)->find($id); // store new thumbnail image in storage if ($request->hasFile('thumbnail_image')) { $thumbImgName = Uploader::update_picture(Constant::WEBSITE_COURSE_THUMBNAIL_IMAGE, $request->file('thumbnail_image'), basename($course->thumbnail_image)); } // format video link $link = $request['video_link']; if (strpos($link, '&') != 0) { $link = substr($link, 0, strpos($link, '&')); } // store new cover image in storage if ($request->hasFile('cover_image')) { $coverImgName = Uploader::update_picture(Constant::WEBSITE_COURSE_COVER_IMAGE, $request->file('cover_image'), basename($course->cover_image)); } // update data in db $course->update($request->except('thumbnail_image', 'video_link', 'cover_image') + [ 'thumbnail_image' => $request->hasFile('thumbnail_image') ? $thumbImgName : $course->thumbnail_image, 'video_link' => $link, 'cover_image' => $request->hasFile('cover_image') ? $coverImgName : $course->cover_image ]); $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($languages as $language) { CourseInformation::query()->updateOrCreate([ 'course_id' => $id, 'user_id' => Auth::guard('web')->user()->id, 'language_id' => $language->id ], [ 'course_category_id' => $request[$language->code . '_category_id'], 'title' => $request[$language->code . '_title'], 'slug' => make_slug($request[$language->code . '_title']), 'instructor_id' => $request[$language->code . '_instructor_id'], 'features' => $request[$language->code . '_features'], 'description' => Purifier::clean($request[$language->code . '_description']), 'user_id' => Auth::guard('web')->user()->id, 'language_id' => $language->id, 'meta_keywords' => $request[$language->code . '_meta_keywords'], 'meta_description' => $request[$language->code . '_meta_description'] ]); } session()->flash('success', __('Course updated successfully') . '!'); return "success"; } /** * Show the form for editing the thanks page of a specified resource. * * @param int $id * @return Application|Factory|View|\Illuminate\Http\Response */ public function thanksPage($id) { $languages = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $information['course'] = Course::where('user_id', Auth::guard('web')->user()->id)->find($id); $information['defaultLang'] = $languages->where('dashboard_default', 1)->first(); $information['languages'] = $languages; return view('user.course_management.course.thanks-page', $information); } /** * Update the thanks page of specified resource in storage. * * @param Request $request * @param int $id * @return \Illuminate\Http\Response|string */ public function updateThanksPage(Request $request, $id) { $languages = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $rules = $messages = []; foreach ($languages as $language) { $rules[$language->code . '_thanks_page_content'] = 'min:30'; $messages[$language->code . '_thanks_page_content.min'] = __('The content must be at least 30 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; } $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } foreach ($languages as $language) { CourseInformation::query()->updateOrCreate( [ 'course_id' => $id, 'language_id' => $language->id, 'user_id' => Auth::guard('web')->user()->id, ], [ 'course_id' => $id, 'language_id' => $language->id, 'user_id' => Auth::guard('web')->user()->id, 'thanks_page_content' => Purifier::clean($request[$language->code . '_thanks_page_content']) ] ); } session()->flash('success', __('Page content updated successfully') . '!'); return "success"; } /** * Show the certificate settings page of a specified resource. * * @param int $id * @return Application|Factory|View|\Illuminate\Http\Response */ public function certificateSettings($id) { $information['course'] = Course::where('user_id', Auth::guard('web')->user()->id)->find($id); $information['defaultLang'] = Language::where('user_id', Auth::guard('web')->user()->id)->where('dashboard_default', 1)->first(); return view('user.course_management.course.certificate-settings', $information); } /** * Update the certificate settings of specified resource in storage. * * @param Request $request * @param int $id * @return RedirectResponse */ public function updateCertificateSettings(Request $request, $id) { $course = Course::where('user_id', Auth::guard('web')->user()->id)->find($id); $course->update($request->except('certificate_text') + [ 'certificate_text' => Purifier::clean($request['certificate_text']) ]); session()->flash('success', __('Certificate settings updated successfully') . '.'); return redirect()->back(); } /** * Remove the specified resource from storage. * * @param int $id * @return RedirectResponse */ public function destroy($id) { $course = Course::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->first(); // check whether this course has any enrolment or not $totalEnrolment = $course->enrolment()->count(); if ($totalEnrolment > 0) { return redirect()->back()->with('warning', __('First delete all the enrolments of this course') . '!'); } // get all the course information's of this course $courseInformations = $course->courseInformation()->where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($courseInformations as $courseInformation) { // get all the modules of each course-information $modules = $courseInformation->module()->get(); foreach ($modules as $module) { // get all the lessons of each module $lessons = $module->lesson()->get(); foreach ($lessons as $lesson) { // get all the lesson contents of each lesson $lessonContents = $lesson->content()->get(); foreach ($lessonContents as $lessonContent) { // delete lesson content item by checking the 'type' if ($lessonContent->type == 'video') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $lessonContent->video_unique_name); } else if ($lessonContent->type == 'file') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $lessonContent->file_unique_name); } else if ($lessonContent->type == 'quiz') { // get all the lesson quizzes of this lesson-content $lessonQuizzes = $lessonContent->quiz()->get(); foreach ($lessonQuizzes as $lessonQuiz) { $lessonQuiz->delete(); } } $lessonContent->delete(); } $lesson->delete(); } $module->delete(); } $courseInformation->delete(); } Uploader::remove(Constant::WEBSITE_COURSE_THUMBNAIL_IMAGE, $course->thumbnail_image); Uploader::remove(Constant::WEBSITE_COURSE_COVER_IMAGE, $course->cover_image); // get all the faqs of this course $courseFaqs = $course->faq()->get(); foreach ($courseFaqs as $courseFaq) { $courseFaq->delete(); } // get all the reviews of this course $reviews = $course->review()->get(); foreach ($reviews as $review) { $review->delete(); } // get all the quiz-scores of this course $quizScores = $course->quizScore()->get(); foreach ($quizScores as $quizScore) { $quizScore->delete(); } // finally, delete the course $course->delete(); return redirect()->back()->with('success', __('Course deleted successfully') . '!'); } /** * Remove the selected or all resources from storage. * * @param Request $request * @return \Illuminate\Http\Response|string */ public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $course = Course::where('user_id', Auth::guard('web')->user()->id)->where('id', $id)->first(); // check whether this course has any enrolment or not $totalEnrolment = $course->enrolment()->count(); if ($totalEnrolment > 0) { session()->flash('warning', __('First delete all the enrolments of selected courses') . '!'); return "success"; } // get all the course information's of this course $courseInformations = $course->courseInformation()->where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($courseInformations as $courseInformation) { // get all the modules of each course-information $modules = $courseInformation->module()->get(); foreach ($modules as $module) { // get all the lessons of each module $lessons = $module->lesson()->get(); foreach ($lessons as $lesson) { // get all the lesson contents of each lesson $lessonContents = $lesson->content()->get(); foreach ($lessonContents as $lessonContent) { // delete lesson content item by checking the 'type' if ($lessonContent->type == 'video') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $lessonContent->video_unique_name); } else if ($lessonContent->type == 'file') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $lessonContent->file_unique_name); } else if ($lessonContent->type == 'quiz') { // get all the lesson quizzes of this lesson-content $lessonQuizzes = $lessonContent->quiz()->get(); foreach ($lessonQuizzes as $lessonQuiz) { $lessonQuiz->delete(); } } $lessonContent->delete(); } $lesson->delete(); } $module->delete(); } $courseInformation->delete(); } Uploader::remove(Constant::WEBSITE_COURSE_THUMBNAIL_IMAGE, $course->thumbnail_image); Uploader::remove(Constant::WEBSITE_COURSE_COVER_IMAGE, $course->cover_image); // get all the faqs of this course $courseFaqs = $course->faq()->get(); foreach ($courseFaqs as $courseFaq) { $courseFaq->delete(); } // get all the reviews of this course $reviews = $course->review()->get(); foreach ($reviews as $review) { $review->delete(); } // get all the quiz-scores of this course $quizScores = $course->quizScore()->get(); foreach ($quizScores as $quizScore) { $quizScore->delete(); } // finally, delete the course $course->delete(); } session()->flash('success', __('Courses deleted successfully') . '!'); return "success"; } } Http/Controllers/User/CourseManagement/LessonContentController.php 0000644 00000042004 15213350435 0021520 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Constants\Constant; use App\Http\Controllers\Controller; use App\Http\Helpers\Uploader; use App\Http\Helpers\UserPermissionHelper; use App\Models\User\BasicSetting; use App\Models\User\CourseManagement\Lesson; use App\Models\User\CourseManagement\LessonContent; use App\Models\User\CourseManagement\Module; use App\Models\User\Language; use App\Models\User\UserPermission; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Mews\Purifier\Facades\Purifier; class LessonContentController extends Controller { public function contents($id, Request $request) { $lesson = Lesson::where('user_id', Auth::guard('web')->user()->id)->find($id); $information['lesson'] = $lesson; $module = $lesson->module; $courseInfo = $module->courseInformation; $information['module'] = $module; $information['courseInfo'] = $courseInfo; $information['contents'] = $lesson->content()->orderBy('order_no', 'asc')->get(); $information['language'] = Language::query()->where('code', $request->language) ->where('user_id', Auth::guard('web')->user()->id) ->first(); return view('user.course_management.lesson-content.index', $information); } public function uploadVideo(Request $request) { $video_size_limit = UserPermissionHelper::currentPackagePermission(Auth::guard('web')->user()->id)->video_size_limit; $maxSize = intval($video_size_limit); $convertedSize = $maxSize * 1024; $rules = [ 'video' => [ 'required', 'max:' . $convertedSize, function ($attribute, $value, $fail) use ($request) { $video = $request->file('video'); $vidExt = $video->getClientOriginalExtension(); if ($vidExt != 'mp4') { $fail(__("Only .mp4 file is allowed for") . ' ' . $attribute); } } ] ]; // $message = [ // 'video.max' => 'The video must not be greater than ' . $maxSize . ' megabytes.' // ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'error' => $validator->getMessageBag()->toArray() ], 400); } $videoData = Uploader::upload_video(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $request->file('video')); return Response::json([ 'originalName' => $videoData['originalName'], 'uniqueName' => $videoData['uniqueName'], 'duration' => $videoData['duration'] ]); } public function removeVideo(Request $request) { if (empty($request['title'])) { return Response::json(['error' => __('The request has no file name') . '.'], 400); } else { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $request['title']); return Response::json(['success' => __('The file has been deleted') . '.'], 200); } } public function storeVideo(Request $request, $id) { $rule = []; if (empty($request['vid_org']) || empty($request['vid_unq'])) { $rule['video_content'] = 'required'; } $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $unqNames = $request['vid_unq']; $orgNames = $request['vid_org']; $durations = $request['vid_time']; $maxOrderNo = LessonContent::query() ->where('user_id', Auth::guard('web')->user()->id) ->where('lesson_id', $id) ->max('order_no'); for ($i = 0; $i < sizeOf($unqNames); $i++) { $lessonContent = new LessonContent(); $lessonContent->lesson_id = $id; $lessonContent->video_unique_name = $unqNames[$i]; $lessonContent->video_original_name = $orgNames[$i]; $lessonContent->video_duration = $durations[$i]; $lessonContent->type = 'video'; $lessonContent->order_no = $maxOrderNo + 1; $lessonContent->user_id = Auth::guard('web')->user()->id; $lessonContent->save(); } // store lesson's total period $totalPeriod = LessonContent::where([ ['user_id', Auth::guard('web')->user()->id], ['lesson_id', $id], ['type', 'video'] ])->sum(DB::raw('TIME_TO_SEC(video_duration)')); $lessonDuration = gmdate('H:i:s', $totalPeriod); $lesson = Lesson::query()->where('user_id', Auth::guard('web')->user()->id)->find($id); $lesson->update([ 'duration' => $lessonDuration ]); // store module's total period $totalLessonPeriod = Lesson::query()->where('user_id', Auth::guard('web')->user()->id) ->where('module_id', $lesson->module_id) ->sum(DB::raw('TIME_TO_SEC(duration)')); $moduleDuration = gmdate('H:i:s', $totalLessonPeriod); $module = $lesson->module; $module->update([ 'duration' => $moduleDuration ]); // store course's total period $totalModulePeriod = Module::query() ->where('course_information_id', $module->course_information_id) ->sum(DB::raw('TIME_TO_SEC(duration)')); $courseDuration = gmdate('H:i:s', $totalModulePeriod); $course = $module->courseInformation->course; $course->update([ 'duration' => $courseDuration ]); session()->flash('success', __('Video added successfully') . '!'); return "success"; } public function videoPreview(Request $request) { $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'video_preview' => [ 'required', function ($attribute, $value, $fail) use ($request, $allowedExts) { $video = $request->file('video_preview'); $vidExt = $video->getClientOriginalExtension(); if (!in_array($vidExt, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } ] ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'error' => $validator->getMessageBag()->toArray() ], 400); } if ($request->hasFile('video_preview')) { $content = LessonContent::find($request->content_id); $vidPrev = Uploader::update_picture(Constant::WEBSITE_LESSON_CONTENT_VIDEO_PREVIEW, $request->file('video_preview'), basename($content->video_preview)); $content->video_preview = $vidPrev; $content->save(); } Session::flash('success', __('Video preview updated successfully') . '!'); return "success"; } public function uploadFile(Request $request) { $file_size_limit = UserPermissionHelper::currentPackagePermission(Auth::guard('web')->user()->id)->file_size_limit; $maxSize = intval($file_size_limit); $convertedSize = $maxSize * 1024; $rules = [ 'file' => [ 'required', 'max:' . $convertedSize, function ($attribute, $value, $fail) use ($request) { $file = $request->file('file'); $fileExt = $file->getClientOriginalExtension(); $allowedExts = array('txt', 'doc', 'docx', 'pdf', 'zip'); if (!in_array($fileExt, $allowedExts)) { $fail(__("Only .txt, .doc, .docx, .pdf & .zip file is allowed for") . ' ' . $attribute); } } ] ]; // $message = [ // 'file.max' => 'The file must not be greater than ' . $maxSize . ' megabytes.' // ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'error' => $validator->getMessageBag()->toArray() ], 400); } $fileData = Uploader::upload_file(Constant::WEBSITE_LESSON_CONTENT_FILE, $request->file('file')); return Response::json([ 'originalName' => $fileData['originalName'], 'uniqueName' => $fileData['uniqueName'] ]); } public function removeFile(Request $request) { if (empty($request['title'])) { return Response::json(['error' => __('The request has no file name') . '.'], 400); } else { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $request['title']); return Response::json(['success' => __('The file has been deleted') . '.']); } } public function storeFile(Request $request, $id) { $rule = []; if (empty($request['file_org']) || empty($request['file_unq'])) { $rule['file_content'] = 'required'; } $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $unqNames = $request['file_unq']; $orgNames = $request['file_org']; $maxOrderNo = LessonContent::query() ->where('user_id', Auth::guard('web')->user()->id) ->where('lesson_id', $id) ->max('order_no'); for ($i = 0; $i < sizeOf($unqNames); $i++) { $lessonContent = new LessonContent(); $lessonContent->lesson_id = $id; $lessonContent->file_unique_name = $unqNames[$i]; $lessonContent->file_original_name = $orgNames[$i]; $lessonContent->type = 'file'; $lessonContent->order_no = $maxOrderNo + 1; $lessonContent->user_id = Auth::guard('web')->user()->id; $lessonContent->save(); } session()->flash('success', __('File added successfully') . '!'); return "success"; } public function downloadFile($id) { $bs = BasicSetting::query() ->where('user_id', Auth::guard('web')->user()->id) ->first(); $content = LessonContent::query() ->where('user_id', Auth::guard('web')->user()->id) ->find($id); try { return Uploader::downloadFile(Constant::WEBSITE_LESSON_CONTENT_FILE, $content->file_unique_name, $content->file_original_name, $bs); } catch (FileNotFoundException $e) { return redirect()->back()->with('error', __('Sorry, file not found') . '!'); } } public function storeText(Request $request, $id) { $rule = ['text' => 'min:30']; // $message = ['text.min' => 'The text must be at least 30 characters.']; $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return Response::json([ 'error' => $validator->getMessageBag()->toArray() ], 400); } $maxOrderNo = LessonContent::where([ ['lesson_id', $id], ['user_id', Auth::guard('web')->user()->id] ])->max('order_no'); $lessonContent = new LessonContent(); $lessonContent->lesson_id = $id; $lessonContent->text = Purifier::clean($request['text']); $lessonContent->type = 'text'; $lessonContent->order_no = $maxOrderNo + 1; $lessonContent->user_id = Auth::guard('web')->user()->id; $lessonContent->save(); session()->flash('success', __('Text added successfully') . '!'); return "success"; } public function updateText(Request $request) { $rule = ['text' => 'min:30']; // $message = ['text.min' => 'The text must be at least 30 characters.']; $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return Response::json([ 'error' => $validator->getMessageBag()->toArray() ], 400); } $lessonContent = LessonContent::query() ->where('user_id', Auth::guard('web')->user()->id) ->find($request['id']); $lessonContent->update([ 'text' => Purifier::clean($request['text']) ]); $request->session()->flash('success', __('Text updated successfully') . '!'); return "success"; } public function storeCode(Request $request, $id) { $rule = ['code' => 'required']; $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return Response::json([ 'error' => $validator->getMessageBag()->toArray() ], 400); } $maxOrderNo = LessonContent::where([ ['lesson_id', $id], ['user_id', Auth::guard('web')->user()->id] ])->max('order_no'); $lessonContent = new LessonContent(); $lessonContent->lesson_id = $id; $lessonContent->code = $request['code']; $lessonContent->type = 'code'; $lessonContent->order_no = $maxOrderNo + 1; $lessonContent->user_id = Auth::guard('web')->user()->id; $lessonContent->save(); session()->flash('success', __('Code added successfully') . '!'); return "success"; } public function updateCode(Request $request) { $rule = ['code' => 'required']; $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return Response::json([ 'error' => $validator->getMessageBag()->toArray() ], 400); } $lessonContent = LessonContent::query()->where('user_id', Auth::guard('web')->user()->id)->find($request['id']); $lessonContent->update([ 'code' => $request['code'] ]); session()->flash('success', __('Code updated successfully') . '!'); // return Response::json(['status' => 'success'], 200); return "success"; } public function destroyContent($id) { $content = LessonContent::where('user_id', Auth::guard('web')->user()->id)->find($id); $lessonId = $content->lesson_id; $type = $content->type; if (!is_null($content->video_unique_name)) Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $content->video_unique_name); if (!is_null($content->file_unique_name)) Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $content->file_unique_name); $content->delete(); if ($type == 'video') { // update lesson's total period $totalPeriod = LessonContent::where([ ['lesson_id', $lessonId], ['type', $type], ['user_id', Auth::guard('web')->user()->id] ]) ->sum(DB::raw('TIME_TO_SEC(video_duration)')); $lessonDuration = gmdate('H:i:s', $totalPeriod); $lesson = Lesson::query()->where('user_id', Auth::guard('web')->user()->id)->find($lessonId); $lesson->update([ 'duration' => $lessonDuration ]); // update module's total period $totalLessonPeriod = Lesson::query()->where('module_id', $lesson->module_id) ->where('user_id', Auth::guard('web')->user()->id) ->sum(DB::raw('TIME_TO_SEC(duration)')); $moduleDuration = gmdate('H:i:s', $totalLessonPeriod); $module = $lesson->module; $module->update([ 'duration' => $moduleDuration ]); // update course's total period $totalModulePeriod = Module::where('course_information_id', $module->course_information_id) ->where('user_id', Auth::guard('web')->user()->id) ->sum(DB::raw('TIME_TO_SEC(duration)')); $courseDuration = gmdate('H:i:s', $totalModulePeriod); $course = $module->courseInformation->course; $course->update([ 'duration' => $courseDuration ]); } return redirect()->back()->with('success', __('Content deleted successfully') . '!'); } public function sort(Request $request) { $ids = $request['ids']; $orders = $request['orders']; for ($i = 0; $i < sizeof($ids); $i++) { $content = LessonContent::where('user_id', Auth::guard('web')->user()->id)->find($ids[$i]); $content->update([ 'order_no' => $orders[$i] ]); } return response()->json(['status' => __('Lesson contents sorted successfully') . '.'], 200); } } Http/Controllers/User/CourseManagement/LessonQuizController.php 0000644 00000014034 15213350435 0021040 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Http\Controllers\Controller; use App\Models\User\CourseManagement\Lesson; use App\Models\User\CourseManagement\LessonContent; use App\Models\User\CourseManagement\LessonQuiz; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; class LessonQuizController extends Controller { public function create($id) { $defaultLang = Language::where('user_id', Auth::guard('web')->user()->id)->where('dashboard_default', 1)->first(); $lesson = Lesson::where('user_id', Auth::guard('web')->user()->id)->find($id); $module = $lesson->module; $courseInfo = $module->courseInformation; $default = Language::where('user_id', Auth::guard('web')->user()->id)->where('dashboard_default', 1)->first(); return view('user.course_management.lesson-quiz.create', compact('lesson', 'defaultLang', 'courseInfo', 'default', 'module')); } public function store($id, Request $request) { $rules = ['question' => 'required']; if (!$request->filled('right_answers') || !$request->filled('options')) { $rules['answer'] = 'required'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $quizTypeCount = LessonContent::where([ ['lesson_id', $id], ['user_id', Auth::guard('web')->user()->id] ])->where('type', 'quiz') ->count(); $maxOrderNo = LessonContent::where([ ['lesson_id', $id], ['user_id', Auth::guard('web')->user()->id] ])->max('order_no'); if ($quizTypeCount == 0) { $content = new LessonContent(); $content->lesson_id = $id; $content->type = 'quiz'; $content->order_no = $maxOrderNo + 1; $content->user_id = Auth::guard('web')->user()->id; $content->save(); } else { $contentId = LessonContent::where('lesson_id', $id) ->where('type', 'quiz') ->pluck('id') ->first(); } $options = $request['options']; $rightAnswers = $request['right_answers']; $answers = []; foreach ($options as $key => $option) { $ansData = [ 'option' => $option, 'rightAnswer' => in_array($key, $rightAnswers) ? 1 : 0 ]; $answers[$key] = $ansData; } $quiz = new LessonQuiz(); $quiz->lesson_id = $id; $quiz->lesson_content_id = ($quizTypeCount == 0) ? $content->id : $contentId; $quiz->question = $request['question']; $quiz->answers = json_encode($answers); $quiz->user_id = Auth::guard('web')->user()->id; $quiz->save(); session()->flash('success', __('New quiz added successfully') . '!'); return "success"; } public function index($id, Request $request) { $lesson = Lesson::where('user_id', Auth::guard('web')->user()->id)->find($id); $information['lesson'] = $lesson; $information['quizzes'] = $lesson->quiz()->orderByDesc('id')->get(); $information['language'] = Language::where('code', $request->language) ->where('user_id', Auth::guard('web')->user()->id) ->first(); return view('user.course_management.lesson-quiz.index', $information); } public function edit($lessonId, $quizId) { $information['lesson'] = Lesson::where('user_id', Auth::guard('web')->user()->id)->find($lessonId); $information['quiz'] = LessonQuiz::where('user_id', Auth::guard('web')->user()->id)->find($quizId); $module = $information['lesson']->module; $courseInfo = $module->courseInformation; $information['module'] = $module; $information['courseInfo'] = $courseInfo; $default = Language::where('user_id', Auth::guard('web')->user()->id)->where('dashboard_default', 1)->first(); $information['default'] = $default; return view('user.course_management.lesson-quiz.edit', $information); } public function getAns($id) { $quiz = LessonQuiz::where('user_id', Auth::guard('web')->user()->id)->find($id); $answers = json_decode($quiz->answers); return response()->json(['answers' => $answers]); } public function update(Request $request, $id) { $rules = ['question' => 'required']; if (!$request->filled('right_answers') || !$request->filled('options')) { $rules['answer'] = 'required'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $options = $request['options']; $rightAnswers = $request['right_answers']; $answers = []; foreach ($options as $key => $option) { $ansData = [ 'option' => $option, 'rightAnswer' => in_array($key, $rightAnswers) ? 1 : 0 ]; $answers[$key] = $ansData; } $quiz = LessonQuiz::where('user_id', Auth::guard('web')->user()->id)->find($id); $quiz->update($request->except('answers') + [ 'answers' => json_encode($answers) ]); session()->flash('success', __('Quiz updated successfully') . '!'); return "success"; } public function destroy($id) { $quiz = LessonQuiz::where('user_id', Auth::guard('web')->user()->id)->find($id); $content = $quiz->content()->first(); $quiz->delete(); if ($content->quiz()->count() == 0) { $content->delete(); } return redirect()->back()->with('success', __('Quiz deleted successfully') . '!'); } } Http/Controllers/User/CourseManagement/CategoryController.php 0000644 00000007463 15213350435 0020511 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Http\Controllers\Controller; use App\Http\Requests\User\CourseManagement\CourseCategoryRequest; use App\Models\User\BasicSetting; use App\Models\User\CourseManagement\CourseCategory; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class CategoryController extends Controller { public function index(Request $request) { $information['langs'] = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $information['language'] = $information['langs']->where('code', $request->language)->first(); $information['categories'] = CourseCategory::where('language_id', $information['language']->id) ->where('user_id', Auth::guard('web')->user()->id) ->orderByDesc('id') ->get(); $information['themeInfo'] = BasicSetting::where('user_id', Auth::guard('web')->user()->id) ->select('theme') ->first(); return view('user.course_management.category.index', $information); } public function store(CourseCategoryRequest $request) { CourseCategory::create($request->except('language_id', 'slug') + [ 'language_id' => $request->user_language_id, 'slug' => slug_create($request->name), 'user_id' => Auth::guard('web')->user()->id ]); session()->flash('success', __('New course category added successfully') . '!'); return "success"; } public function updateFeatured(Request $request, $id) { $category = CourseCategory::where('user_id', Auth::guard('web')->user()->id)->find($id); if ($request['is_featured'] == '1') { $category->update(['is_featured' => 1]); session()->flash('success', __('Category featured successfully') . '!'); } else { $category->update(['is_featured' => 0]); session()->flash('success', __('Category unfeatured successfully') . '!'); } return redirect()->back(); } public function update(CourseCategoryRequest $request) { $cc = CourseCategory::where('user_id', Auth::guard('web')->user()->id) ->find($request->id); $ins = $request->all(); $ins['slug'] = slug_create($request->name); $cc->update($ins); session()->flash('success', __('Course category updated successfully') . '!'); return "success"; } public function destroy($id) { $category = CourseCategory::where('user_id', Auth::guard('web')->user()->id)->find($id); if ($category->courseInfoList()->where('user_id', Auth::guard('web')->user()->id)->count() > 0) { return redirect()->back()->with('warning', __('First delete all the course under to this category') . '!'); } else { $category->delete(); return redirect()->back()->with('success', __('Course category deleted successfully') . '!'); } } public function bulkDestroy(Request $request) { $ids = $request->ids; $errorOccured = false; foreach ($ids as $id) { $category = CourseCategory::where('user_id', Auth::guard('web')->user()->id)->find($id); $courseCount = $category->courseInfoList()->where('user_id', Auth::guard('web')->user()->id)->count(); if ($courseCount > 0) { $errorOccured = true; break; } else { $category->delete(); } } if ($errorOccured == true) { session()->flash('warning', __('First delete all the course under to this categories') . '!'); } else { session()->flash('success', __('Course categories deleted successfully') . '!'); } return "success"; } } Http/Controllers/User/CourseManagement/CourseFaqController.php 0000644 00000006224 15213350435 0020616 0 ustar 00 <?php namespace App\Http\Controllers\User\CourseManagement; use App\Http\Controllers\Controller; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseFaq; use App\Models\User\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; class CourseFaqController extends Controller { public function index(Request $request, $id) { $information['course'] = Course::where('user_id', Auth::guard('web')->user()->id)->find($id); $langs = Language::query()->where('user_id', Auth::guard('web')->user()->id)->get(); $language = $langs->where('code', $request->language)->first(); $information['defaultLang'] = $langs->where('dashboard_default', 1)->first(); $information['langs'] = $langs; $information['language'] = $language; $information['faqs'] = CourseFaq::where('course_id', $id) ->where('language_id', $language->id) ->where('user_id', Auth::guard('web')->user()->id) ->orderByDesc('id') ->get(); return view('user.course_management.faq.index', $information); } public function store(Request $request, $id) { $rules = [ 'user_language_id' => 'required', 'question' => 'required', 'answer' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } CourseFaq::create($request->except('course_id', 'language_id', 'user_id') + [ 'course_id' => $id, 'language_id' => $request->user_language_id, 'user_id' => Auth::guard('web')->user()->id ]); session()->flash('success', __('New faq added successfully') . '!'); return "success"; } public function update(Request $request) { $rules = [ 'question' => 'required', 'answer' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } CourseFaq::where('user_id', Auth::guard('web')->user()->id)->find($request->id)->update($request->all()); session()->flash('success', __('FAQ updated successfully') . '!'); return "success"; } public function destroy($id) { CourseFaq::where('user_id', Auth::guard('web')->user()->id)->find($id)->delete(); return redirect()->back()->with('success', __('FAQ deleted successfully') . '!'); } public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { CourseFaq::find($id)->delete(); } session()->flash('success', __('FAQs deleted successfully') . '!'); return "success"; } } Http/Controllers/User/HotelBooking/RoomManagementController.php 0000644 00000160722 15213350435 0020772 0 ustar 00 <?php namespace App\Http\Controllers\User\HotelBooking; use App\Http\Controllers\Controller; use App\Http\Controllers\User\MailTemplateController; use App\Http\Helpers\UploadFile; use App\Http\Requests\User\HoteBooking\RoomBookingRequest; use App\Http\Requests\User\HotelBooking\CouponRequest; use App\Http\Requests\User\HotelBooking\UserRoomBookingRequest; use App\Models\User\BasicSetting; use App\Models\User\HotelBooking\Coupon; use App\Models\User\HotelBooking\Room; use App\Models\User\HotelBooking\RoomAmenity; use App\Models\User\HotelBooking\RoomBooking; use App\Models\User\HotelBooking\RoomCategory; use App\Models\User\HotelBooking\RoomContent; use App\Models\User\Language; use App\Models\User\UserEmailTemplate; use App\Models\User\UserOfflineGateway; use App\Models\User\UserPaymentGeteway; use App\Traits\MiscellaneousTrait; use Carbon\Carbon; use DateTime; use Illuminate\Database\Eloquent\Builder; use Illuminate\Http\Request; use Illuminate\Routing\Route; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\URL; use Illuminate\Support\Facades\Validator; use PDF; use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\PHPMailer; class RoomManagementController extends Controller { use MiscellaneousTrait; public function settings() { $data = DB::table('user_room_settings')->select('room_rating_status', 'room_guest_checkout_status', 'room_category_status', 'is_room') ->where('user_id', Auth::guard('web')->user()->id) ->first(); if (is_null($data)) { DB::table('user_room_settings')->insert(['user_id' => Auth::guard('web')->user()->id]); $data = DB::table('user_room_settings')->where('user_id', Auth::guard('web')->user()->id) ->first(); } return view('user.rooms.settings', ['data' => $data]); } public function updateSettings(Request $request) { $rules = [ 'room_category_status' => 'required', 'room_rating_status' => 'required', 'room_guest_checkout_status' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } try { DB::table('user_room_settings')->where('user_id', Auth::guard('web')->user()->id)->update([ 'is_room' => $request->is_room, 'room_category_status' => $request->room_category_status, 'room_rating_status' => $request->room_rating_status, 'room_guest_checkout_status' => $request->room_guest_checkout_status ]); session()->flash('success', __('Room settings updated successfully') . '!'); return 'success'; } catch (\Exception $e) { session()->flash('warning', __('Something went wrong') . '!'); return 'success'; } } public function coupons(Request $request) { $user = Auth::guard('web')->user(); $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); // get the coupons from db $information['coupons'] = Coupon::where('user_id', $user->id)->orderByDesc('id')->get(); // also, get the currency information from db $information['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo($user->id); $rooms = Room::where('user_id', $user->id)->get(); $rooms->map(function ($room) use ($lang) { $room['title'] = $room->roomContent()->where('language_id', $lang->id)->pluck('title')->first(); }); $information['rooms'] = $rooms; return view('user.rooms.coupon.coupons', $information); } public function storeCoupon(CouponRequest $request) { $startDate = Carbon::parse($request->start_date); $endDate = Carbon::parse($request->end_date); if ($request->filled('rooms')) { $rooms = $request->rooms; } Coupon::create($request->except('start_date', 'end_date', 'rooms') + [ 'user_id' => Auth::guard('web')->user()->id, 'start_date' => date_format($startDate, 'Y-m-d'), 'end_date' => date_format($endDate, 'Y-m-d'), 'rooms' => isset($rooms) ? json_encode($rooms) : null ]); session()->flash('success', __('New coupon added successfully') . '!'); return 'success'; } public function updateCoupon(CouponRequest $request) { $startDate = Carbon::parse($request->start_date); $endDate = Carbon::parse($request->end_date); if ($request->filled('rooms')) { $rooms = $request->rooms; } Coupon::find($request->id)->update($request->except('start_date', 'end_date', 'rooms') + [ 'start_date' => date_format($startDate, 'Y-m-d'), 'end_date' => date_format($endDate, 'Y-m-d'), 'rooms' => isset($rooms) ? json_encode($rooms) : null ]); session()->flash('success', __('Coupon updated successfully') . '!'); return 'success'; } public function destroyCoupon($id) { Coupon::find($id)->delete(); return redirect()->back()->with('success', __('Coupon deleted successfully') . '!'); } public function amenities(Request $request) { $user = Auth::guard('web')->user(); $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $information['language'] = $lang; // then, get the room amenities of that language from db $information['amenities'] = RoomAmenity::where([['language_id', $lang->id], ['user_id', $user->id]]) ->orderBy('id', 'desc') ->get(); // also, get all the languages from db $information['langs'] = Language::where('user_id', $user->id)->get(); return view('user.rooms.amenity.amenities', $information); } public function storeAmenity(Request $request, $language) { $rules = [ 'user_language_id' => 'required', 'name' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $user = Auth::guard('web')->user(); $lang = Language::where('code', $language)->first(); RoomAmenity::create($request->except('_token', 'user_language_id') + [ 'user_id' => $user->id, 'language_id' => $request->user_language_id ]); session()->flash('success', __('New room amenity added successfully') . '!'); return 'success'; } public function updateAmenity(Request $request) { $rules = [ 'name' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } try { RoomAmenity::findOrFail($request->amenity_id)->update($request->except('_token', 'amenity_id')); session()->flash('success', __('Room amenity updated successfully') . '!'); } catch (\Exception $e) { session()->flash('warning', $e->getMessage()); } return 'success'; } public function deleteAmenity(Request $request) { $rcs = RoomContent::where('user_id', Auth::guard()->user()->id)->get(); foreach ($rcs as $rc) { $amis = json_decode($rc->amenities); foreach ($amis as $ami) { // dd($ami); if ($ami == $request->amenity_id) { session()->flash('warning', __("You can\'t delete amenity it exixts in rooms") . '.'); return redirect()->back(); } } } RoomAmenity::findOrFail($request->amenity_id)->delete(); session()->flash('success', __('Room amenity deleted successfully') . '!'); return redirect()->back(); } public function bulkDeleteAmenity(Request $request) { $ids = $request->ids; foreach ($ids as $id) { RoomAmenity::findOrFail($id)->delete(); } session()->flash('success', __('Room amenities deleted successfully') . '!'); /** * this 'success' is returning for ajax call. * if return == 'success' then ajax will reload the page. */ return 'success'; } public function categories(Request $request) { $user = Auth::guard('web')->user(); $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $information['language'] = $lang; // then, get the room categories of that language from db $information['roomCategories'] = RoomCategory::where([['language_id', $lang->id], ['user_id', $user->id]]) ->orderBy('id', 'desc') ->paginate(10); // also, get all the languages from db $information['langs'] = Language::where('user_id', $user->id)->get(); return view('user.rooms.categories.categories', $information); } public function storeCategory(Request $request, $language) { $rules = [ 'name' => 'required', 'user_language_id' => 'required', 'status' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $user = Auth::guard('web')->user(); RoomCategory::create($request->except('user_language_id') + [ 'language_id' => $request->user_language_id, 'user_id' => $user->id ]); session()->flash('success', __('New room category added successfully') . '!'); return 'success'; } public function updateCategory(Request $request) { $rules = [ 'name' => 'required', 'status' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } RoomCategory::findOrFail($request->category_id)->update($request->except('_token', 'category_id')); session()->flash('success', __('Room category updated successfully') . '!'); return 'success'; } public function deleteCategory(Request $request) { $roomCategory = RoomCategory::findOrFail($request->category_id); if ($roomCategory->roomContentList()->count() > 0) { session()->flash('warning', __('First delete all the rooms of this category') . '!'); return redirect()->back(); } $roomCategory->delete(); session()->flash('success', __('Room category deleted successfully') . '!'); return redirect()->back(); } public function bulkDeleteCategory(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $roomCategory = RoomCategory::findOrFail($id); if ($roomCategory->roomContentList()->count() > 0) { session()->flash('warning', __('First delete all the rooms of those category') . '!'); /** * this 'success' is returning for ajax call. * here, by returning the 'success' ajax will show the flash error message */ return 'success'; } $roomCategory->delete(); } session()->flash('success', __('Room categories deleted successfully') . '!'); /** * this 'success' is returning for ajax call. * if return == 'success' then ajax will reload the page. */ return 'success'; } public function rooms(Request $request) { $setting = DB::table('user_room_settings')->select('room_rating_status', 'room_guest_checkout_status', 'room_category_status') ->where('user_id', Auth::guard('web')->user()->id) ->first(); if (is_null($setting)) { DB::table('user_room_settings')->insert(['user_id' => Auth::guard('web')->user()->id]); $setting = DB::table('user_room_settings')->where('user_id', Auth::guard('web')->user()->id) ->first(); } $user = Auth::guard('web')->user(); $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); // $languageId = Language::where('dashboard_default', 1)->pluck('id')->first(); $roomContents = RoomContent::with('room') ->where([['language_id', '=', $lang->id], ['user_id', $user->id]]) ->orderBy('room_id', 'desc') ->get(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); return view('user.rooms.rooms', compact('roomContents', 'currencyInfo')); } public function createRoom() { // get all the languages from db $information['languages'] = Language::where('user_id', Auth::guard()->user()->id)->get(); $information['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo(Auth::guard()->user()->id); return view('user.rooms.create_room', $information); } /** * Store a new slider image in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function uploadSliderImage(Request $request) { $rule = [ 'slider_image' => 'required|mimes:png,jpeg,gif,jpg' ]; $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return Response::json([ 'error' => $validator->getMessageBag() ], 400); } $imageName = UploadFile::store('assets/img/rooms/slider-images/', $request->file('slider_image')); return Response::json(['uniqueName' => $imageName], 200); } /** * Remove a slider image from storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function removeSliderImage(Request $request) { $img = $request['imageName']; try { @unlink(public_path('assets/img/rooms/slider-images/' . $img)); return Response::json(['success' => __('The image has been deleted') . '.'], 200); } catch (\Exception $e) { return Response::json(['error' => __('Something went wrong') . '!'], 400); } } /** * Remove 'stored' slider image form storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function detachImage(Request $request) { $id = $request['id']; $key = $request['key']; $room = Room::query()->find($id); $sliderImages = json_decode($room->slider_imgs); if (count($sliderImages) == 1) { return Response::json(['message' => __('Sorry, the last image cannot be delete') . '.'], 400); } else { $image = $sliderImages[$key]; @unlink(public_path('assets/img/rooms/slider-images/' . $image)); array_splice($sliderImages, $key, 1); $room->update([ 'slider_imgs' => json_encode($sliderImages) ]); return Response::json(['message' => __('Slider image removed successfully') . '!'], 200); } } public function storeRoom(Request $request) { $rules = [ 'slider_images' => 'required', 'featured_img' => 'required|mimes:png,jpeg,gif,jpg', 'status' => 'required', 'rent' => 'required', 'quantity' => 'required|numeric', 'bed' => 'required', 'bath' => 'required', 'max_guests' => 'nullable|numeric', ]; $user = Auth::guard('web')->user(); $languages = Language::where('user_id', $user->id)->get(); $bs = DB::table('user_room_settings')->where('user_id', $user->id)->select('room_category_status')->first(); foreach ($languages as $language) { $rules[$language->code . '_title'] = 'required|max:255'; if ($bs->room_category_status == 1) { $rules[$language->code . '_category'] = 'required'; } $rules[$language->code . '_summary'] = 'required'; $rules[$language->code . '_description'] = 'required|min:15'; $messages[$language->code . '_title.required'] = __('The Title field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_title.max'] = __('The title field cannot contain more than 255 characters for') . ' ' . $language->name . ' language'; $messages[$language->code . '_category.required'] = __('The Category field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_summary.required'] = __('The summary field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_description.required'] = __('The description field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_description.min'] = __('The description field atleast have 15 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; } $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $featuredImgName = UploadFile::store('assets/img/rooms/feature-images/', $request->file('featured_img')); DB::beginTransaction(); try { $room = new Room(); $room->user_id = $user->id; $room->slider_imgs = json_encode($request->slider_images); $room->featured_img = $featuredImgName; $room->status = $request->status; $room->bed = $request->bed; $room->bath = $request->bath; $room->rent = $request->rent; $room->max_guests = $request->max_guests; $room->latitude = $request->latitude; $room->longitude = $request->longitude; $room->address = $request->address; $room->phone = $request->phone; $room->email = $request->email; $room->quantity = $request->quantity; $room->save(); foreach ($languages as $language) { $roomContent = new RoomContent(); $roomContent->user_id = $user->id; $roomContent->language_id = $language->id; if ($bs->room_category_status == 1) { $roomContent->room_category_id = $request[$language->code . '_category']; } $roomContent->room_id = $room->id; $roomContent->title = $request[$language->code . '_title']; $roomContent->slug = make_slug($request[$language->code . '_title']); $roomContent->amenities = json_encode($request[$language->code . '_amenities']); $roomContent->summary = $request[$language->code . '_summary']; $roomContent->description = clean($request[$language->code . '_description']); $roomContent->meta_keywords = $request[$language->code . '_meta_keywords']; $roomContent->meta_description = $request[$language->code . '_meta_description']; $roomContent->save(); } DB::commit(); session()->flash('success', __('New room added successfully') . '!'); } catch (\Exception $e) { DB::rollback(); session()->flash('warning', $e->getMessage()); return Response::json([ 'exception' => $e->getMessage() ], 400); } return 'success'; } public function updateFeaturedRoom(Request $request) { $room = Room::findOrfail($request->roomId); if ($room->status == 1) { if ($request->is_featured == 1) { $room->update(['is_featured' => 1]); session()->flash('success', __('Room featured successfully') . '!'); } else { $room->update(['is_featured' => 0]); session()->flash('success', __('Room unfeatured successfully') . '!'); } } else { session()->flash('warning', __('Please change your room status first') . '.'); } return redirect()->back(); } public function editRoom($id) { $user = Auth::guard('web')->user(); // get all the languages from db $information['languages'] = Language::where('user_id', $user->id)->get(); $information['room'] = Room::findOrfail($id); return view('user.rooms.edit_room', $information); } public function getSliderImages($id) { $room = Room::findOrFail($id); $sliderImages = json_decode($room->slider_imgs); $images = []; // concatanate slider image with image location foreach ($sliderImages as $key => $sliderImage) { $data = public_path('assets/img/rooms/slider_images/' . $sliderImage); array_push($images, $data); } return Response::json($images, 200); } public function updateRoom(Request $request, $id) { $rules = [ 'status' => 'required', 'bed' => 'required', 'bath' => 'required', 'rent' => 'required', 'max_guests' => 'nullable|numeric', 'quantity' => 'required|numeric' ]; $featuredImgURL = $request->featured_img; $allowedExtensions = array('jpg', 'jpeg', 'png', 'svg'); $featuredImgExt = pathinfo($featuredImgURL, PATHINFO_EXTENSION); if ($request->filled('featured_img')) { $rules['featured_img'] = function ($attribute, $value, $fail) use ($allowedExtensions, $featuredImgExt) { if (!in_array($featuredImgExt, $allowedExtensions)) { $fail(__('Only .jpg, .jpeg, .png and .svg file is allowed for featured image') . '.'); } }; } $user = Auth::guard('web')->user(); $languages = Language::where('user_id', $user->id)->get(); $bs = DB::table('user_room_settings')->where('user_id', $user->id)->select('room_category_status')->first(); foreach ($languages as $language) { $rules[$language->code . '_title'] = 'required|max:255'; if ($bs->room_category_status == 1) { $rules[$language->code . '_category'] = 'required'; } $rules[$language->code . '_summary'] = 'required'; $rules[$language->code . '_description'] = 'required|min:15'; $messages[$language->code . '_title.required'] = __('The title field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_title.max'] = __('The title field cannot contain more than 255 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; if ($bs->room_category_status == 1) { $messages[$language->code . '_category.required'] = __('The category field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; } $messages[$language->code . '_summary.required'] = __('The summary field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_description.required'] = __('The description field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messages[$language->code . '_description.min'] = __('The description field atleast have 15 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; } $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $room = Room::findOrFail($id); $roomSldImgs = json_decode($room->slider_imgs); // merge slider images with existing images if request has new slider image if ($request->filled('slider_images')) { $prevImages = json_decode($room->slider_imgs); $newImages = $request['slider_images']; $imgArr = array_merge($prevImages, $newImages); } if ($request->hasFile('featured_img')) { $newImage = $request->file('featured_img'); $oldImage = $room->featured_img; $featureImage = UploadFile::update('assets/img/rooms/feature-images/', $newImage, $oldImage); } $room->update([ 'slider_imgs' => isset($imgArr) ? json_encode($imgArr) : $roomSldImgs, 'featured_img' => $request->hasFile('featured_img') ? $featureImage : $room->featured_img, 'status' => $request->status, 'bed' => $request->bed, 'bath' => $request->bath, 'rent' => $request->rent, 'max_guests' => $request->max_guests, 'latitude' => $request->latitude, 'longitude' => $request->longitude, 'address' => $request->address, 'phone' => $request->phone, 'email' => $request->email, 'quantity' => $request->quantity ]); foreach ($languages as $language) { $roomContent = RoomContent::where('room_id', $id) ->where('language_id', $language->id) ->first(); $content = [ 'language_id' => $language->id, 'user_id' => $user->id, 'room_id' => $id, 'room_category_id' => $bs->room_category_status == 1 ? $request[$language->code . '_category'] : $roomContent->room_category_id, 'title' => $request[$language->code . '_title'], 'slug' => make_slug($request[$language->code . '_title']), 'amenities' => json_encode($request[$language->code . '_amenities']), 'summary' => $request[$language->code . '_summary'], 'description' => clean($request[$language->code . '_description']), 'meta_keywords' => $request[$language->code . '_meta_keywords'], 'meta_description' => $request[$language->code . '_meta_description'] ]; if (!empty($roomContent)) { $roomContent->update($content); } else { RoomContent::create($content); } } session()->flash('success', __('Room updated successfully') . '!'); return 'success'; } public function deleteRoom(Request $request) { $room = Room::findOrFail($request->room_id); if ($room->roomBookings()->count()) { $room->update([ 'status' => 0, 'is_featured' => 0 ]); session()->flash("warning", __("Room can't delete. But hide from every where") . "."); } else { if ($room->roomContent()->count()) { $contents = $room->roomContent()->delete(); } if (!is_null($room->slider_imgs)) { $images = json_decode($room->slider_imgs); foreach ($images as $image) { if (file_exists(public_path('assets/img/rooms/slider_images/' . $image))) { unlink(public_path('assets/img/rooms/slider_images/' . $image)); } } } if (!is_null($room->featured_img) && file_exists(public_path('assets/img/rooms/' . $room->featured_img))) { unlink(public_path('assets/img/rooms/' . $room->featured_img)); } $room->delete(); session()->flash('success', __('Room deleted successfully') . '!'); } return redirect()->back(); } public function bulkDeleteRoom(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $room = Room::findOrFail($id); if ($room->roomBookings()->count()) { $room->update([ 'status' => 0, 'is_featured' => 0 ]); session()->flash("warning", __("Room can't delete. But hide from every where") . "."); } else { if ($room->roomContent()->count()) { $contents = $room->roomContent()->delete(); } if (!is_null($room->slider_imgs)) { $images = json_decode($room->slider_imgs); foreach ($images as $image) { if (file_exists(public_path('assets/img/rooms/slider_images/' . $image))) { unlink(public_path('assets/img/rooms/slider_images/' . $image)); } } } if (!is_null($room->featured_img) && file_exists(public_path('assets/img/rooms/' . $room->featured_img))) { unlink(public_path('assets/img/rooms/' . $room->featured_img)); } $room->delete(); session()->flash('success', __('Room deleted successfully') . '!'); } } /** * this 'success' is returning for ajax call. * if return == 'success' then ajax will reload the page. */ return 'success'; } public function bookings(Request $request) { $booking_number = null; $user = Auth::guard('web')->user(); $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); if ($request->filled('booking_no')) { $booking_number = $request['booking_no']; } if (URL::current() == $request->routeIs('user.room_bookings.all_bookings')) { $queryResult['bookings'] = RoomBooking::where('user_id', $user->id)->when($booking_number, function ($query, $booking_number) { return $query->where('booking_number', 'like', '%' . $booking_number . '%'); })->orderBy('id', 'desc') ->paginate(10); } else if (URL::current() == $request->routeIs('user.room_bookings.paid_bookings')) { $queryResult['bookings'] = RoomBooking::where('user_id', $user->id)->when($booking_number, function ($query, $booking_number) { return $query->where('booking_number', 'like', '%' . $booking_number . '%'); })->where('payment_status', 1) ->orderBy('id', 'desc') ->paginate(10); } else if (URL::current() == $request->routeIs('user.room_bookings.unpaid_bookings')) { $queryResult['bookings'] = RoomBooking::where('user_id', $user->id)->when($booking_number, function ($query, $booking_number) { return $query->where('booking_number', 'like', '%' . $booking_number . '%'); })->where('payment_status', 0) ->orderBy('id', 'desc') ->paginate(10); } // $language = Language::query()->where('dashboard_default', '=', 1)->first(); $queryResult['roomInfos'] = $lang->roomDetails()->whereHas('room', function (Builder $query) { $query->where('status', '=', 1); }) ->select('room_id', 'title') ->orderBy('title', 'ASC') ->get(); return view('user.rooms.booking.bookings', $queryResult); } public function updatePaymentStatus(Request $request) { // dd($request->all()); $roomBooking = RoomBooking::findOrFail($request->booking_id); if ($request->payment_status == 1) { $roomBooking->update(['payment_status' => 1]); } else { $roomBooking->update(['payment_status' => 0]); } // delete previous invoice from local storage if ( !is_null($roomBooking->invoice) && file_exists(public_path('assets/invoices/rooms/' . $roomBooking->invoice)) ) { unlink(public_path('assets/invoices/rooms/' . $roomBooking->invoice)); } // then, generate an invoice in pdf format $invoice = $this->generateInvoice($roomBooking); // update the invoice field information in database $roomBooking->update(['invoice' => $invoice]); // finally, send a mail to the customer with the invoice $this->sendMailForPaymentStatus($roomBooking, $request->payment_status); session()->flash('success', __('Payment status updated successfully') . '!'); return redirect()->back(); } public function editBookingDetails($id) { $details = RoomBooking::findOrFail($id); $queryResult['details'] = $details; $user = Auth::guard('web')->user(); // get the difference of two dates, date should be in 'YYYY-MM-DD' format $date1 = new DateTime($details->arrival_date); $date2 = new DateTime($details->departure_date); $queryResult['interval'] = $date1->diff($date2, true); $language = Language::where([['dashboard_default', 1], ['user_id', $user->id]])->first(); /** * to get the room title first get the room info using eloquent relationship * then, get the room content info of that room using eloquent relationship * after that, we can access the room title * also, get the room category using eloquent relationship */ $roomInfo = $details->hotelRoom()->first(); $roomContentInfo = $roomInfo->roomContent()->where('language_id', $language->id)->first(); // dd($roomContentInfo, $language); $queryResult['roomTitle'] = $roomContentInfo->title; $roomCategoryInfo = $roomContentInfo->roomCategory()->first(); $queryResult['roomCategoryName'] = $roomCategoryInfo->name; // get all the booked dates of this room $roomId = $details->room_id; $detailsId = $details->id; $queryResult['bookedDates'] = $this->getBookedDatesOfRoom($roomId, $detailsId); $queryResult['onlineGateways'] = UserPaymentGeteway::query() ->where('user_id', $user->id) ->where('status', '=', 1) ->select('name') ->get(); $queryResult['offlineGateways'] = UserOfflineGateway::query() ->where('item_checkout_status', '=', 1) ->where('user_id', $user->id) ->select('name') ->orderBy('serial_number', 'asc') ->get(); $queryResult['rent'] = $roomInfo->rent; return view('user.rooms.booking.booking_details', $queryResult); } public function updateBooking(UserRoomBookingRequest $request) { $user = Auth::guard('web')->user(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); // update the room booking information in database $dateArray = explode(' ', $request->dates); $onlinePaymentGateway = ['PayPal', 'Stripe', 'Instamojo', 'Paystack', 'Flutterwave', 'Razorpay', 'MercadoPago', 'Mollie', 'Paytm', 'Authorize.net']; $gatewayType = in_array($request->payment_method, $onlinePaymentGateway) ? 'online' : 'offline'; $booking = RoomBooking::query()->findOrFail($request->booking_id); $booking->update([ 'customer_name' => $request->customer_name, 'customer_email' => $request->customer_email, 'customer_phone' => $request->customer_phone, 'arrival_date' => $dateArray[0], 'departure_date' => $dateArray[2], 'guests' => $request->guests, 'subtotal' => $request->subtotal, 'discount' => $request->discount, 'grand_total' => $request->total, 'currency_symbol' => $currencyInfo->base_currency_symbol, 'currency_symbol_position' => $currencyInfo->base_currency_symbol_position, 'currency_text' => $currencyInfo->base_currency_text, 'currency_text_position' => $currencyInfo->base_currency_text_position ?? $currencyInfo->base_currency_symbol_position, 'payment_method' => $request->payment_method, 'gateway_type' => $gatewayType, 'payment_status' => $request->payment_status ]); session()->flash('success', __('Booking information has updated') . '.'); return redirect()->back(); } public function sendMail(Request $request) { $rules = [ 'subject' => 'required', 'message' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $mailInfo = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_username', 'smtp_password', 'from_mail') ->first(); $bs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->select('website_title', 'from_name', 'email')->firstOrFail(); if (is_null($bs->email) || is_null($bs->from_name)) { session()->flash('warning', __("Please set/update your mail information") . '.'); return 'success'; } // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; // if smtp status == 1, then set some value for PHPMailer if ($mailInfo->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $mailInfo->smtp_host; $mail->SMTPAuth = true; $mail->Username = $mailInfo->smtp_username; $mail->Password = $mailInfo->smtp_password; // if ($mailInfo->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // } // $mail->Port = $mailInfo->smtp_port; $mail->Port = 587; } // finally add other informations and send the mail try { // Recipients $mail->setFrom($mailInfo->from_mail, $bs->from_name); $mail->addAddress($request->customer_email); $mail->AddReplyTo($bs->email); // Content $mail->isHTML(true); $mail->Subject = $request->subject; $mail->Body = clean($request->message); $mail->send(); session()->flash('success', __("Mail has been sent") . '!'); /** * this 'success' is returning for ajax call. * if return == 'success' then ajax will reload the page. */ return 'success'; } catch (\Exception $e) { // session()->flash('warning', 'Mail could not be sent!'); session()->flash('warning', $e->getMessage()); /** * this 'success' is returning for ajax call. * if return == 'success' then ajax will reload the page. */ return 'success'; } } public function deleteBooking(Request $request, $id) { $roomBooking = RoomBooking::findOrFail($id); // first, delete the attachment if ( !is_null($roomBooking->attachment) && file_exists(public_path('assets/img/attachments/rooms/' . $roomBooking->attachment)) ) { unlink(public_path('assets/img/attachments/rooms/' . $roomBooking->attachment)); } // second, delete the invoice if ( !is_null($roomBooking->invoice) && file_exists(public_path('assets/invoices/rooms/' . $roomBooking->invoice)) ) { unlink(public_path('assets/invoices/rooms/' . $roomBooking->invoice)); } // finally, delete the room booking record from db $roomBooking->delete(); session()->flash('success', __('Room booking record deleted successfully') . '!'); return redirect()->back(); } public function bulkDeleteBooking(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $roomBooking = RoomBooking::findOrFail($id); // first, delete the attachment if ( !is_null($roomBooking->attachment) && file_exists(public_path('assets/img/attachments/rooms/' . $roomBooking->attachment)) ) { unlink(public_path('assets/img/attachments/rooms/' . $roomBooking->attachment)); } // second, delete the invoice if ( !is_null($roomBooking->invoice) && file_exists(public_path('assets/invoices/rooms/' . $roomBooking->invoice)) ) { unlink(public_path('assets/invoices/rooms/' . $roomBooking->invoice)); } // finally, delete the room booking record from db $roomBooking->delete(); } session()->flash('success', __("Room booking records deleted successfully") . '!'); /** * this 'success' is returning for ajax call. * if return == 'success' then ajax will reload the page. */ return 'success'; } private function generateInvoice($bookingInfo) { $fileName = $bookingInfo->booking_number . '.pdf'; $directory = public_path('/assets/invoices/rooms/'); if (!file_exists($directory)) { mkdir($directory, 0775, true); } $currentLanguageInfo = Language::where('is_default', 1)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $fileLocated = $directory . $fileName; PDF::loadView('user.rooms.pdf.room_booking', compact('bookingInfo', 'currentLanguageInfo'))->save($fileLocated); return $fileName; } private function sendMailForPaymentStatus($roomBooking, $status) { // first get the mail template information from db if ($status == 1) { $mailTemplate = UserEmailTemplate::where('user_id', Auth::guard('web')->user()->id)->where('email_type', 'payment_received')->firstOrFail(); } else { $mailTemplate = UserEmailTemplate::where('email_type', 'payment_cancelled')->firstOrFail(); } $mailSubject = $mailTemplate->email_subject; $mailBody = $mailTemplate->email_body; // second get the website title & mail's smtp information from db $info = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_username', 'smtp_password', 'from_mail') ->first(); $bs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->select('website_title', 'from_name', 'email')->firstOrFail(); // replace template's curly-brace string with actual data $mailBody = str_replace('{customer_name}', $roomBooking->customer_name, $mailBody); $mailBody = str_replace('{website_title}', $bs->website_title, $mailBody); // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; // if smtp status == 1, then set some value for PHPMailer if ($info->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $info->smtp_host; $mail->SMTPAuth = true; $mail->Username = $info->smtp_username; $mail->Password = $info->smtp_password; // if ($info->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // } $mail->Port = 587; } // finally add other informations and send the mail try { // Recipients $mail->setFrom($info->from_mail, $bs->from_name); $mail->addAddress($roomBooking->customer_email); $mail->AddReplyTo($bs->email); // Attachments (Invoice) $mail->addAttachment(public_path('assets/invoices/rooms/' . $roomBooking->invoice)); // Content $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); return; } catch (Exception $e) { return redirect()->back()->with('warning', __('Mail could not be sent') . '!'); } } // room booking from admin panel public function bookedDates(Request $request) { $rule = [ 'room_id' => 'required' ]; $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return response()->json([ 'error' => $validator->getMessageBag() ]); } // get all the booked dates of the selected room $roomId = $request['room_id']; $bookedDates = $this->getBookedDatesOfRoom($roomId); $request->session()->put('bookedDates', $bookedDates); return response()->json([ 'success' => route('user.room_bookings.booking_form', ['room_id' => $roomId]) ]); } public function getBookedDatesOfRoom($id, $bookingId = null) { $quantity = Room::query()->findOrFail($id)->quantity; $bookings = RoomBooking::query()->where('room_id', '=', $id) ->where('payment_status', '=', 1) ->select('arrival_date', 'departure_date') ->get(); $bookedDates = []; foreach ($bookings as $booking) { // get all the dates between the booking arrival date & booking departure date $date_1 = $booking->arrival_date; $date_2 = $booking->departure_date; $allDates = $this->getAllDates($date_1, $date_2, 'Y-m-d'); // loop through the list of dates, which we have found from the booking arrival date & booking departure date foreach ($allDates as $date) { $bookingCount = 0; // loop through all the bookings foreach ($bookings as $currentBooking) { $bookingStartDate = Carbon::parse($currentBooking->arrival_date); $bookingEndDate = Carbon::parse($currentBooking->departure_date); $currentDate = Carbon::parse($date); // check for each date, whether the date is present or not in any of the booking date range if ($currentDate->betweenIncluded($bookingStartDate, $bookingEndDate)) { $bookingCount++; } } // if the number of booking of a specific date is same as the room quantity, then mark that date as unavailable if ($bookingCount >= $quantity && !in_array($date, $bookedDates)) { array_push($bookedDates, $date); } } } if (is_null($bookingId)) { return $bookedDates; } else { $booking = RoomBooking::query()->findOrFail($bookingId); $arrivalDate = $booking->arrival_date; $departureDate = $booking->departure_date; // get all the dates between the booking arrival date & booking departure date $bookingAllDates = $this->getAllDates($arrivalDate, $departureDate, 'Y-m-d'); // remove dates of this booking from 'bookedDates' array while editing a room booking foreach ($bookingAllDates as $date) { $key = array_search($date, $bookedDates); if ($key !== false) { unset($bookedDates[$key]); } } return array_values($bookedDates); } } public function getAllDates($startDate, $endDate, $format) { $dates = []; // convert string to timestamps $currentTimestamps = strtotime($startDate); $endTimestamps = strtotime($endDate); // set an increment value $stepValue = '+1 day'; // push all the timestamps to the 'dates' array by formatting those timestamps into date while ($currentTimestamps <= $endTimestamps) { $formattedDate = date($format, $currentTimestamps); array_push($dates, $formattedDate); $currentTimestamps = strtotime($stepValue, $currentTimestamps); } return $dates; } public function bookingForm(Request $request) { if ($request->session()->has('bookedDates')) { $queryResult['dates'] = $request->session()->get('bookedDates'); } else { $queryResult['dates'] = []; } $user = Auth::guard('web')->user(); $id = $request['room_id']; $queryResult['id'] = $id; $room = Room::query()->find($id); $queryResult['rent'] = $room->rent; $queryResult['currencyInfo'] = MiscellaneousTrait::getCurrencyInfo($user->id); $queryResult['onlineGateways'] = UserPaymentGeteway::where('user_id', $user->id) ->where('status', '=', 1) ->select('name') ->get(); $queryResult['offlineGateways'] = UserOfflineGateway::where('user_id', $user->id) // ->where('room_booking_status', '=', 1) ->select('name') ->orderBy('serial_number', 'asc') ->get(); return view('user.rooms.booking.booking_form', $queryResult); } public function makeBooking(RoomBookingRequest $request) { $user = Auth::guard('web')->user(); $currencyInfo = MiscellaneousTrait::getCurrencyInfo($user->id); // store the room booking information in database $dateArray = explode(' ', $request->dates); $onlinePaymentGateway = ['PayPal', 'Stripe', 'Instamojo', 'Paystack', 'Flutterwave', 'Razorpay', 'MercadoPago', 'Mollie', 'Paytm']; $gatewayType = in_array($request->payment_method, $onlinePaymentGateway) ? 'online' : 'offline'; $bookingInfo = RoomBooking::query()->create([ 'booking_number' => time(), 'user_id' => $user->id, 'customer_id' => null, 'customer_name' => $request->customer_name, 'customer_email' => $request->customer_email, 'customer_phone' => $request->customer_phone, 'room_id' => $request->room_id, 'arrival_date' => $dateArray[0], 'departure_date' => $dateArray[2], 'guests' => $request->guests, 'subtotal' => $request->subtotal, 'discount' => $request->discount, 'grand_total' => $request->total, 'currency_symbol' => $currencyInfo->base_currency_symbol, 'currency_symbol_position' => $currencyInfo->base_currency_symbol_position, 'currency_text' => $currencyInfo->base_currency_text, 'currency_text_position' => $currencyInfo->base_currency_text_position ?? 'left', 'payment_method' => $request->payment_method, 'gateway_type' => $gatewayType, 'payment_status' => $request->payment_status ]); if ($request->payment_status == 1) { // generate an invoice in pdf format $invoice = $this->generateInvoice($bookingInfo); // update the invoice field information in database $bookingInfo->update(['invoice' => $invoice]); // send a mail to the customer with an invoice $this->sendMailForRoomBooking($bookingInfo); } session()->flash('success', __('Room has booked') . '.'); return redirect()->back(); } public function sendMailForRoomBooking($bookingInfo) { // first get the mail template information from db // MailTemplateController::class; $user = Auth::guard('web')->user(); $mailTemplate = UserEmailTemplate::where('user_id', $user->id)->where('email_type', '=', 'room_booking')->first(); $mailSubject = $mailTemplate->mail_subject; $mailBody = replaceBaseUrl($mailTemplate->mail_body, 'summernote'); // second get the website title & mail's smtp information from db $info = DB::table('basic_extendeds') ->select('is_smtp', 'smtp_host', 'smtp_port', 'encryption', 'smtp_username', 'smtp_password', 'from_mail') ->first(); $webinfo = DB::table('user_basic_settings')->where('user_id', $user->id)->select( 'from_name', 'email', 'website_title' )->first(); // get the difference of two dates, date should be in 'YYYY-MM-DD' format $date1 = new DateTime($bookingInfo->arrival_date); $date2 = new DateTime($bookingInfo->departure_date); $interval = $date1->diff($date2, true); // get the room category name according to language $language = Language::where('user_id', $user->id)->where('dashboard_default', '=', 1)->first(); $roomContent = RoomContent::query()->where('language_id', '=', $language->id) ->where('room_id', '=', $bookingInfo->room_id) ->first(); $roomCategoryName = $roomContent->roomCategory->name; $roomRent = ($bookingInfo->currency_text_position == 'left' ? $bookingInfo->currency_text . ' ' : '') . $bookingInfo->grand_total . ($bookingInfo->currency_text_position == 'right' ? ' ' . $bookingInfo->currency_text : ''); // get the amenities of booked room $amenityIds = json_decode($roomContent->amenities); $amenityArray = []; foreach ($amenityIds as $id) { $amenity = RoomAmenity::query()->findOrFail($id); array_push($amenityArray, $amenity->name); } // now, convert amenity array into comma separated string $amenityString = implode(', ', $amenityArray); // replace template's curly-brace string with actual data $mailBody = str_replace('{customer_name}', $bookingInfo->customer_name, $mailBody); $mailBody = str_replace('{room_name}', $roomContent->title, $mailBody); $mailBody = str_replace('{room_rent}', $roomRent, $mailBody); $mailBody = str_replace('{booking_number}', $bookingInfo->booking_number, $mailBody); $mailBody = str_replace('{booking_date}', date_format($bookingInfo->created_at, 'F d, Y'), $mailBody); $mailBody = str_replace('{number_of_night}', $interval->days, $mailBody); $mailBody = str_replace('{website_title}', $webinfo->website_title, $mailBody); $mailBody = str_replace('{check_in_date}', $bookingInfo->arrival_date, $mailBody); $mailBody = str_replace('{check_out_date}', $bookingInfo->departure_date, $mailBody); $mailBody = str_replace('{number_of_guests}', $bookingInfo->guests, $mailBody); $mailBody = str_replace('{room_type}', $roomCategoryName, $mailBody); $mailBody = str_replace('{room_amenities}', $amenityString, $mailBody); // initialize a new mail $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; // if smtp status == 1, then set some value for PHPMailer if ($info->is_smtp == 1) { $mail->isSMTP(); $mail->Host = $info->smtp_host; $mail->SMTPAuth = true; $mail->Username = $info->smtp_username; $mail->Password = $info->smtp_password; if ($info->encryption == 'TLS') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; } $mail->Port = $info->smtp_port; } // finally add other informations and send the mail try { // Recipients $mail->setFrom($info->from_mail, $webinfo->from_name); $mail->addAddress($bookingInfo->customer_email); // Attachments (Invoice) $mail->addAttachment(public_path('assets/invoices/rooms/' . $bookingInfo->invoice)); // Content $mail->isHTML(true); $mail->Subject = $mailSubject; $mail->Body = $mailBody; $mail->send(); return; } catch (Exception $e) { return; } } } Http/Controllers/User/SubscriberController.php 0000644 00000015144 15213350435 0015575 0 ustar 00 <?php namespace App\Http\Controllers\User; use Mail; use Session; use App\Mail\ContactMail; use Illuminate\Http\Request; use App\Models\BasicExtended; use PHPMailer\PHPMailer\SMTP; use App\Models\User\Subscriber; use App\Models\User\BasicSetting; use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\PHPMailer; use App\Http\Controllers\Controller; use Illuminate\Validation\Rule; use Illuminate\Support\Facades\Auth; class SubscriberController extends Controller { public function index(Request $request) { $term = $request->term; $data['subscs'] = Subscriber::where('user_id', Auth::id()) ->when($term, function ($query, $term) { return $query->where('email', 'LIKE', '%' . $term . '%'); })->orderBy('id', 'DESC')->paginate(10); return view('user.subscribers.index', $data); } public function store(Request $request, $domain) { $user = getUser(); $keywords = getUserKeywords(); $ubs = BasicSetting::where('user_id', $user->id)->first(); $rules = [ 'subscriber_email' => [ 'required', function ($attribute, $value, $fail) use ($user, $keywords) { $subscriber = Subscriber::where([ ['email', $value], ['user_id', $user->id] ])->exists(); if ($subscriber) { Session::flash('error', $keywords['email_already_subscribed'] ?? __('This email is already subscribed') . '!'); $fail($keywords['email_already_subscribed_fail'] ?? __('This email is already subscribed for this user.')); } }, ], 'g-recaptcha-response' => [ Rule::requiredIf($ubs && $ubs->is_recaptcha == 1), 'captcha' ], ]; $messages = [ 'subscriber_email.required' => $keywords['email_required'] ?? __('Email is required.') . '.', 'g-recaptcha-response.required' => $keywords['g_recaptcha_response_required'] ?? __('Please verify that you are not a robot.') . '.', 'g-recaptcha-response.captcha' => $keywords['g_recaptcha_response_captcha'] ?? __('Captcha error! Try again later or contact site admin.') . '.', ]; $request->validate($rules, $messages); Subscriber::create([ 'email' => $request->subscriber_email, 'user_id' => $user->id ]); $successMessage = $keywords['subscription_success'] ?? __('You subscribed successfully!') . '.'; Session::flash('success', $successMessage); return back(); } public function mailsubscriber() { return view('user.subscribers.mail'); } public function getMailInformation() { $data['info'] = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->select('email', 'from_name')->first(); return view('user.subscribers.mail-information', $data); } public function storeMailInformation(Request $request) { $request->validate([ 'email' => 'required', 'from_name' => 'required' ]); $info = \App\Models\User\BasicSetting::where('user_id', Auth::id())->first(); $info->email = $request->email; $info->from_name = $request->from_name; $info->save(); Session::flash('success', __('Mail information saved successfully') . '!'); return back(); } public function subscsendmail(Request $request) { $request->validate([ 'subject' => 'required', 'message' => 'required' ]); $sub = $request->subject; $msg = $request->message; $subscs = Subscriber::where('user_id', Auth::id())->get(); if ($subscs->isEmpty()) { Session::flash('warning', __('No subscribers found to send the email') . '.'); return back(); } $info = \App\Models\User\BasicSetting::where('user_id', Auth::id())->select('email', 'from_name')->first(); $email = $info->email ?? Auth::user()->email; $name = $info->from_name ?? Auth::user()->company_name; $settings = BasicSetting::first(); $from = $settings->contact_mail; $be = BasicExtended::first(); $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; if ($be->is_smtp == 1) { try { //Server settings $mail->isSMTP(); // Send using SMTP $mail->Host = $be->smtp_host; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = $be->smtp_username; // SMTP username $mail->Password = $be->smtp_password; // SMTP password $mail->SMTPSecure = $be->encryption; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged $mail->Port = $be->smtp_port; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above $mail->addReplyTo($email); //Recipients $mail->setFrom($be->from_mail, $name); foreach ($subscs as $key => $subsc) { $mail->addBCC($subsc->email); } } catch (Exception $e) { } } else { try { //Recipients $mail->setFrom($be->from_mail, $name); $mail->addReplyTo($email); foreach ($subscs as $key => $subsc) { $mail->addBCC($subsc->email); } } catch (Exception $e) { } } // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = $sub; $mail->Body = $msg; $mail->send(); Session::flash('success', __('Mail sent successfully!')); return back(); } public function delete(Request $request) { Subscriber::findOrFail($request->subscriber_id)->delete(); Session::flash('success', __('Subscriber deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { Subscriber::findOrFail($id)->delete(); } Session::flash('success', __('Subscribers deleted successfully') . '!'); return "success"; } } Http/Controllers/User/ItemSubCategoryController.php 0000644 00000013236 15213350435 0016540 0 ustar 00 <?php namespace App\Http\Controllers\User; use Illuminate\Http\Request; use App\Models\User\Language; use App\Http\Controllers\Controller; use App\Models\User\UserItemCategory; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use App\Models\User\UserItemSubCategory; use Illuminate\Support\Facades\Validator; class ItemSubCategoryController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $lang_id = $lang->id; $data['categories'] = UserItemCategory::where('language_id', $lang_id)->where('status', 1)->where('user_id', Auth::guard('web')->user()->id)->orderBy('name', 'ASC')->get(); $data['itemsubcategories'] = UserItemSubCategory::where('language_id', $lang_id)->where('user_id', Auth::guard('web')->user()->id) ->with('category') ->orderBy('id', 'DESC')->paginate(10); $data['lang_id'] = $lang_id; return view('user.item.subcategory.index', $data); } public function store(Request $request) { $rules = [ 'user_language_id' => 'required', 'name' => 'required|max:255', 'category_id' => 'required', 'status' => 'required', ]; $slug = rawurlencode(make_slug($request->name)); $check_category = UserItemSubCategory::where('user_id', Auth::guard('web')->user()->id)->where('slug', $slug) ->where('language_id', $request->user_language_id)->first(); if (!empty($check_category)) { Session::flash('warning', __('The Subcategory has already Taken') . '!'); return "success"; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $data = new UserItemSubCategory; $input = $request->all(); $input['slug'] = make_slug($request->name); $input['user_id'] = Auth::guard('web')->user()->id; $input['language_id'] = $request->user_language_id; $data->create($input); Session::flash('success', __('Subcategory added successfully') . '!'); return "success"; } public function edit($id) { $data['data'] = UserItemSubCategory::findOrFail($id); $lang = Language::where('code', request('language'))->where('user_id', Auth::guard('web')->user()->id)->first(); $lang_id = $lang->id; $data['categories'] = UserItemCategory::where('language_id', $lang_id)->where('status', 1)->where('user_id', Auth::guard('web')->user()->id)->orderBy('name', 'ASC')->get(); return view('user.item.subcategory.edit', $data); } public function update(Request $request) { $rules = [ 'name' => 'required|max:255', 'status' => 'required', 'category_id' => 'required', ]; $slug = rawurlencode(make_slug($request->name)); $check_category = UserItemSubCategory::where('user_id', Auth::guard('web')->user()->id)->where('slug', $slug) ->where('language_id', $request->user_language_id)->first(); if (!empty($check_category)) { if ($check_category->id != $request->subcategory_id) { Session::flash('warning', __('The Subcategory has already Taken') . '!'); return "success"; } } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $data = UserItemSubCategory::findOrFail($request->subcategory_id); $input = $request->all(); $input['slug'] = make_slug($request->name); $data->update($input); Session::flash('success', __('Subcategory Update successfully') . '!'); return "success"; } public function delete(Request $request) { $category = UserItemSubCategory::findOrFail($request->subcategory_id); if ($category->items()->count() > 0) { Session::flash('warning', __('First, delete all the item under the selected subcategory') . '!'); return back(); } $category->delete(); Session::flash('success', __('Subcategory deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $pcategory = UserItemSubCategory::findOrFail($id); if ($pcategory->items()->count() > 0) { Session::flash('warning', __('First, delete all the item under the selected subcategories') . '!'); return "success"; } } foreach ($ids as $id) { $ItemCategory = UserItemSubCategory::findOrFail($id); $ItemCategory->delete(); } Session::flash('success', __('Item subcategories deleted successfully') . '!'); return "success"; } public function getCategories($id) { if (!is_null($id)) { $categories = UserItemCategory::where('language_id', $id) ->where('user_id', Auth::guard('web')->user()->id) ->where('status', 1) ->orderBy('name', 'asc') ->get(); return response()->json(['successData' => $categories]); } else { return response()->json(['errorData' => __('Sorry, an error has occurred') . '!'], 400); } } } Http/Controllers/User/OrderController.php 0000644 00000002624 15213350435 0014544 0 ustar 00 <?php namespace App\Http\Controllers\User; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\User\UserItem; use App\Models\User\UserOrder; use App\Models\User\UserOrderItem; use App\Models\User\UserShopSetting; use Auth; class OrderController extends Controller { public function __construct() { $this->middleware('auth'); } public function digitalDownload(Request $request, $itemid = null) { if ($itemid) { $itemId = $itemid; $customer = false; } else { $customer = true; $itemId = $request->item_id; } $item = UserItem::find($itemId); if ($customer) { $count = UserOrderItem::where('item_id', $itemId)->where('customer_id', Auth::guard('customer')->user()->id)->get(); } else { $count = UserOrderItem::where('item_id', $itemId)->get(); } // if the auth user didn't purchase the item if ($count->count() == 0) { return back(); } $pathToFile = base_path('core/storage/digital_products/') . $item->download_file; if (file_exists($pathToFile)) { return response()->download($pathToFile, $item->itemContents[0]->slug . '.zip'); } else { $request->session()->flash('error', "No donwloadable file exists!"); return back(); } } } Http/Controllers/User/ItemCategoryController.php 0000644 00000015065 15213350435 0016070 0 ustar 00 <?php namespace App\Http\Controllers\User; use Illuminate\Http\Request; use App\Models\User\Language; use App\Models\User\UserItemCategory; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class ItemCategoryController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->first(); $lang_id = $lang->id; $data['itemcategories'] = UserItemCategory::where('language_id', $lang_id) ->where('user_id', Auth::guard('web')->user()->id) ->orderBy('id', 'DESC') ->paginate(10); $data['lang_id'] = $lang_id; return view('user.item.category.index', $data); } public function store(Request $request) { $slug = rawurlencode(make_slug($request->name)); $check_category = UserItemCategory::where('user_id', Auth::guard('web')->user()->id)->where('slug', $slug) ->where('language_id', $request->user_language_id)->first(); if (!empty($check_category)) { Session::flash('warning', __('The Category has already Taken') . '!'); return "success"; } $rules = [ 'user_language_id' => 'required', 'name' => 'required|max:255', 'status' => 'required', ]; if ($request->hasFile('image')) { $rules['image'] = 'mimes:jpeg,png,svg,jpg'; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $data = new UserItemCategory; $input = $request->all(); $input['slug'] = $slug; $input['user_id'] = Auth::guard('web')->user()->id; $input['language_id'] = $request->user_language_id; if ($request->hasFile('image')) { $file = $request->file('image'); $name = time() . $file->getClientOriginalName(); $file->move(public_path('assets/front/img/user/items/categories/'), $name); $input['image'] = $name; } $data->create($input); Session::flash('success', __('Category added successfully') . '!'); return "success"; } public function edit($id) { $data = UserItemCategory::findOrFail($id); return view('user.item.category.edit', compact('data')); } public function update(Request $request) { $rules = [ 'name' => 'required|max:255', 'status' => 'required', ]; if ($request->hasFile('image')) { $rules['image'] = 'mimes:jpeg,png,svg,jpg'; } $slug = rawurlencode(make_slug($request->name)); $check_category = UserItemCategory::where('user_id', Auth::guard('web')->user()->id)->where('slug', $slug) ->where('language_id', $request->user_language_id)->first(); if (!empty($check_category)) { if ($check_category->id != $request->category_id) { Session::flash('warning', __('The Category has already Taken') . '!'); return "success"; } } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $data = UserItemCategory::findOrFail($request->category_id); $input = $request->all(); $input['slug'] = $slug; if ($request->hasFile('image')) { @unlink(public_path('assets/front/img/user/items/categories/' . $data->image)); $file = $request->file('image'); $name = time() . $file->getClientOriginalName(); $file->move(public_path('assets/front/img/user/items/categories/'), $name); $input['image'] = $name; } else { $input['image'] = $data->image; } $data->update($input); Session::flash('success', __('Category Update successfully') . '!'); return "success"; } public function feature(Request $request) { $category = UserItemCategory::findOrFail($request->category_id); $category->is_feature = $request->is_feature; $category->save(); if ($request->is_feature == 1) { Session::flash('success', __('Category featured successfully') . '!'); } else { Session::flash('success', __('Category unfeatured successfully') . '!'); } return back(); } public function footer(Request $request) { $category = UserItemCategory::findOrFail($request->category_id); $category->is_footer = $request->is_footer; $category->save(); if ($request->is_footer == 1) { Session::flash('success', __('Footer Status Updated Successfully') . '!'); } else { Session::flash('success', __('Footer Status Updated Successfully') . '!'); } return back(); } public function delete(Request $request) { $category = UserItemCategory::findOrFail($request->category_id); if ($category->items()->count() > 0) { Session::flash('warning', __('First, delete all the item under the selected categories') . '!'); return back(); } @unlink(public_path('assets/front/img/user/items/categories/' . $category->image)); $category->delete(); $category->subcategories()->delete(); Session::flash('success', __('Category deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $pcategory = UserItemCategory::findOrFail($id); if ($pcategory->items()->count() > 0) { Session::flash('warning', __('First, delete all the item under the selected categories') . '!'); return "success"; } } foreach ($ids as $id) { $ItemCategory = UserItemCategory::findOrFail($id); @unlink(public_path('assets/front/img/user/items/categories/' . $ItemCategory->image)); $ItemCategory->delete(); $ItemCategory->subcategories()->delete(); } Session::flash('success', __('Item categories deleted successfully') . '!'); return "success"; } } Http/Controllers/User/OfferBannerController.php 0000644 00000012055 15213350435 0015657 0 ustar 00 <?php namespace App\Http\Controllers\User; use Illuminate\Http\Request; use App\Models\User\Language; use App\Http\Controllers\Controller; use App\Models\User\UserOfferBanner; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class OfferBannerController extends Controller { public function index(Request $request) { $user = Auth::guard('web')->user(); if (!$user) { return redirect()->back()->with('error', __('User not authenticated. Please log in') . '.'); } $lang = Language::where('code', $request->language) ->where('user_id', $user->id) ->first(); $lang_id = $lang->id; $data['offers'] = UserOfferBanner::where('language_id', $lang_id) ->where('user_id', $user->id) ->orderBy('id', 'DESC')->get(); $data['lang_id'] = $lang_id; return view('user.offerbanner.index', $data); } public function edit($id) { $data['offer'] = UserOfferBanner::findOrFail($id); return view('user.offerbanner.edit', $data); } public function store(Request $request) { $userBs = \App\Models\User\BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if ($userBs->theme == 'home_fourteen') { $rules = [ 'user_language_id' => 'required', 'image' => 'required', 'position' => 'required', 'url' => 'required', 'btn_name' => 'required', ]; } else { $rules = [ 'user_language_id' => 'required', 'image' => 'required', 'position' => 'required', 'text_1' => 'required|max:100', 'text_2' => 'required|max:100', 'text_3' => 'required|max:100', 'url' => 'required', ]; } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } if ($request->hasFile('image')) { $file = $request->file('image'); $name = time() . $file->getClientOriginalName(); $file->move(public_path('assets/front/img/user/offers/'), $name); } $offer = new UserOfferBanner; $offer->user_id = Auth::guard('web')->user()->id; $offer->image = $name; $offer->language_id = $request->user_language_id; $offer->position = $request->position; $offer->text_1 = $request->text_1; $offer->text_2 = $request->text_2; $offer->text_3 = $request->text_3; $offer->btn_name = $request->btn_name; $offer->url = $request->url; $offer->save(); Session::flash('success', __('Offer Banner added successfully') . '!'); return "success"; } public function update(Request $request) { $userBs = \App\Models\User\BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); if ($userBs->theme == 'home_fourteen') { $rules = [ 'position' => 'required', 'url' => 'required', 'btn_name' => 'required', ]; } else { $rules = [ 'text_1' => 'required|max:100', 'text_2' => 'required|max:100', 'text_3' => 'required|max:100', 'position' => 'required', 'url' => 'required', ]; } $messages = []; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $offer = UserOfferBanner::findOrFail($request->offer_id); if ($request->hasFile('image')) { @unlink(public_path('assets/front/img/user/offers/' . $offer->image)); $file = $request->file('image'); $name = time() . $file->getClientOriginalName(); $file->move(public_path('assets/front/img/user/offers/'), $name); } if ($request->image) { $offer->image = $name; } $offer->position = $request->position; $offer->text_1 = $request->text_1; $offer->text_2 = $request->text_2; $offer->text_3 = $request->text_3; $offer->btn_name = $request->btn_name; $offer->url = $request->url; $offer->save(); Session::flash('success', __('Offer Banner updated successfully') . '!'); return 'success'; } public function delete(Request $request) { $offer = UserOfferBanner::findOrFail($request->offer_id); @unlink(public_path('assets/front/img/user/offers/' . $offer->image)); $offer->delete(); Session::flash('success', __('Offer Banner deleted successfully') . '!'); return back(); } } Http/Controllers/User/JobController.php 0000644 00000014325 15213350435 0014204 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Models\User\Jcategory; use App\Models\User\Job; use App\Models\User\Language; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Validator; use Session; class JobController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->where('user_id', Auth::guard('web')->user()->id)->firstorFail(); $data['jobs'] = Job::where([ ['language_id', $lang->id], ['user_id', Auth::id()] ]) ->orderBy('id', 'DESC') ->get(); return view('user.job.job.index', $data); } public function edit($id) { $data['job'] = Job::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail(); $data['jcats'] = Jcategory::where('status', 1)->where([ ['language_id', $data['job']->language_id], ['user_id', Auth::id()] ])->get(); return view('user.job.job.edit', $data); } public function create() { return view('user.job.job.create'); } public function store(Request $request) { $slug = make_slug($request->title); $rules = [ 'user_language_id' => 'required', 'deadline' => 'required|date', 'jcategory_id' => 'required', 'title' => [ 'required', 'max:255', function ($attribute, $value, $fail) use ($slug) { $jobs = Job::all(); foreach ($jobs as $key => $job) { if (strtolower($slug) == strtolower($job->slug)) { $fail(__('The title field must be unique') . '.'); } } } ], 'vacancy' => 'required|integer', 'employment_status' => 'required|max:255', 'additional_requirements' => 'nullable', 'job_location' => 'required|max:255', 'salary' => 'required', 'email' => 'required|email|max:255', 'benefits' => 'nullable', 'read_before_apply' => 'nullable', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $request['user_id'] = Auth::id(); $in = $request->all(); $in['slug'] = $slug; $in['language_id'] = $request->user_language_id; $in['job_responsibilities'] = clean($request->job_responsibilities); $in['educational_requirements'] = clean($request->educational_requirements); $in['experience_requirements'] = clean($request->experience_requirements); $in['additional_requirements'] = clean($request->additional_requirements); $in['salary'] = clean($request->salary); $in['benefits'] = clean($request->benefits); $in['read_before_apply'] = clean($request->read_before_apply); Job::create($in); Session::flash('success', __('Job posted successfully') . '!'); return "success"; } public function update(Request $request) { $slug = make_slug($request->title); $jobId = $request->job_id; $rules = [ 'deadline' => 'required|date', 'experience' => 'required', 'jcategory_id' => 'required', 'title' => [ 'required', 'max:255', function ($attribute, $value, $fail) use ($slug, $jobId) { $jobs = Job::all(); foreach ($jobs as $key => $job) { if ($job->id != $jobId && strtolower($slug) == strtolower($job->slug)) { $fail(__('The title field must be unique') . '.'); } } } ], 'vacancy' => 'required|integer', 'employment_status' => 'required|max:255', 'job_location' => 'required|max:255', 'salary' => 'required', 'email' => 'required|email|max:255', 'benefits' => 'nullable', 'read_before_apply' => 'nullable', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $job = Job::where('user_id', Auth::user()->id)->where('id', $jobId)->firstOrFail(); $in = $request->all(); $in['slug'] = $slug; $in['job_responsibilities'] = clean($request->job_responsibilities); $in['educational_requirements'] = clean($request->educational_requirements); $in['experience_requirements'] = clean($request->experience_requirements); $in['additional_requirements'] = clean($request->additional_requirements); $in['salary'] = clean($request->salary); $in['benefits'] = clean($request->benefits); $in['read_before_apply'] = clean($request->read_before_apply); $job->fill($in)->save(); Session::flash('success', __('Job details updated successfully') . '!'); return "success"; } public function delete(Request $request) { $job = Job::where('user_id', Auth::user()->id)->where('id', $request->job_id)->firstOrFail(); $job->delete(); Session::flash('success', __('Job deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { Job::where('user_id', Auth::user()->id)->where('id', $id)->firstOrFail()->delete(); } Session::flash('success', __('Jobs deleted successfully') . '!'); return "success"; } public function getcats($langid) { return Jcategory::where([ ['language_id', $langid], ['user_id', Auth::id()] ])->get(); } } Http/Controllers/User/Auth/RegisterController.php 0000644 00000006233 15213350435 0016156 0 ustar 00 <?php namespace App\Http\Controllers\User\Auth; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Helpers\MegaMailer; use App\Models\User; use Auth; use Session; use App\Models\Language; use Config; use App\Models\BasicSetting as BS; use App\Models\BasicExtended as BE; class RegisterController extends Controller { public function __construct() { $this->middleware('setlang'); $bs = BS::first(); $be = BE::first(); Config::set('captcha.sitekey', $bs->google_recaptcha_site_key); Config::set('captcha.secret', $bs->google_recaptcha_secret_key); } public function registerPage() { return view('user.register'); } public function register(Request $request) { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('dashboard_default', 1)->first(); } $bs = $currentLang->basic_setting; $be = $currentLang->basic_extended; $messages = [ 'g-recaptcha-response.required' => 'Please verify that you are not a robot.', 'g-recaptcha-response.captcha' => 'Captcha error! try again later or contact site admin.', ]; $rules = [ 'email' => 'required|email|unique:users', 'username' => 'required|unique:users', 'password' => 'required|confirmed' ]; if ($bs->is_recaptcha == 1) { $rules['g-recaptcha-response'] = 'required|captcha'; } $request->validate($rules, $messages); $user = new User; $input = $request->all(); $input['status'] = 1; $input['password'] = bcrypt($request['password']); $token = md5(time() . $request->name . $request->email); $input['verification_link'] = $token; $user->fill($input)->save(); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'customer_name' => $user->fname, 'verification_link' => "<a href='" . url('register/verify/' . $token) . "'>" . url('register/verify/' . $token) . "</a>", 'website_title' => $bs->website_title, 'templateType' => 'email_verification', 'type' => 'emailVerification' ]; $mailer->mailFromAdmin($data); return back()->with('sendmail', 'We need to verify your email address. We have sent an email to ' . $request->email . ' to verify your email address. Please click link in that email to continue.'); } public function token($mode,$token) { $user = User::where('verification_link', $token)->first(); if (isset($user)) { $user->email_verified = 1; $user->update(); Session::flash('success', toastrMsg('Email Verified Successfully')); if ($mode=== "online"){ Auth::guard('web')->login($user); return redirect()->route('user-dashboard'); }else{ return redirect()->route('user.login'); } } } } Http/Controllers/User/Auth/ForgotPasswordController.php 0000644 00000003163 15213350435 0017354 0 ustar 00 <?php namespace App\Http\Controllers\User\Auth; use App\Http\Controllers\Controller; use App\Models\Language; use App\Models\Seo; use Illuminate\Foundation\Auth\SendsPasswordResetEmails; use Illuminate\Support\Facades\Password; class ForgotPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset emails and | includes a trait which assists in sending these notifications from | your application to your users. Feel free to explore this trait. | */ use SendsPasswordResetEmails; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } /** * Display the form to request a password reset link. * * @return */ public function showLinkRequestForm() { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['seo'] = Seo::where('language_id', $currentLang->id)->first(); return view('front.auth.passwords.email', $data); } /** * Get the broker to be used during password reset. * * @return \Illuminate\Contracts\Auth\PasswordBroker */ public function broker() { return Password::broker('users'); } } Http/Controllers/User/Auth/LoginController.php 0000644 00000005516 15213350435 0015445 0 ustar 00 <?php namespace App\Http\Controllers\User\Auth; use App\Http\Controllers\Controller; use Auth; use Illuminate\Http\Request; use Session; use App\Models\Language; use Config; use App\Models\BasicSetting as BS; use App\Models\BasicExtended as BE; use App\Models\Seo; class LoginController extends Controller { public function __construct() { $this->middleware('guest', ['except' => ['logout', 'userLogout']]); $this->middleware('setlang'); $bs = BS::first(); Config::set('captcha.sitekey', $bs->google_recaptcha_site_key); Config::set('captcha.secret', $bs->google_recaptcha_secret_key); } public function showLoginForm() { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['seo'] = Seo::where('language_id', $currentLang->id)->first(); return view('front.auth.login', $data); } public function login(Request $request) { if (Session::has('link')) { $redirectUrl = Session::get('link'); Session::forget('link'); } else { $redirectUrl = route('user-dashboard'); } //--- Validation Section if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $bs = $currentLang->basic_setting; $be = $currentLang->basic_extended; $rules = [ 'email' => 'required|email', 'password' => 'required' ]; if ($bs->is_recaptcha == 1) { $rules['g-recaptcha-response'] = 'required|captcha'; } $request->validate($rules); //--- Validation Section Ends // Attempt to log the user in if (Auth::guard('web')->attempt(['email' => $request->email, 'password' => $request->password])) { // Check If Email is verified or not if (Auth::guard('web')->user()->email_verified == 0) { Auth::guard('web')->logout(); return back()->with('err', toastrMsg('Your_Email_is_not_Verified')); } if (Auth::guard('web')->user()->status == '0') { Auth::guard('web')->logout(); return back()->with('err', toastrMsg('Your_account_has_been_banned')); } return redirect($redirectUrl); } // if unsuccessful, then redirect back to the login with the form data return back()->with('err', toastrMsg("Credentials_Do_not_Match"). '!')->withInput(); } public function logout() { Auth::guard('web')->logout(); return redirect('/'); } } Http/Controllers/User/Auth/ResetPasswordController.php 0000644 00000003275 15213350435 0017202 0 ustar 00 <?php namespace App\Http\Controllers\User\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Password; use Illuminate\Http\Request; class ResetPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset requests | and uses a simple trait to include this behavior. You're free to | explore this trait and override any methods you wish to tweak. | */ use ResetsPasswords; /** * Where to redirect users after resetting their password. * * @var string */ protected $redirectTo ='user/dashboard'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } public function showResetForm(Request $request, $token = null,$email = null) { return view('front.auth.passwords.reset')->with( ['token' => $token, 'email' => $email] ); } /** * Get the broker to be used during password reset. * * @return \Illuminate\Contracts\Auth\PasswordBroker */ public function broker() { return Password::broker('users'); } /** * Get the guard to be used during password reset. * * @return \Illuminate\Contracts\Auth\StatefulGuard */ protected function guard() { return Auth::guard('web'); } } Http/Controllers/User/QrController.php 0000644 00000021253 15213350435 0014052 0 ustar 00 <?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\User\BasicSetting; use App\Models\User\UserQrCode; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Image; use QrCode; class QrController extends Controller { public function index() { $data['qrcodes'] = UserQrCode::where('user_id', Auth::user()->id)->orderBy('id', 'DESC')->get(); return view('user.qr.index', $data); } public function qrCode() { $bs = BasicSetting::firstOrCreate([ 'user_id' => Auth::user()->id ]); if (empty($bs->qr_image) || !file_exists(public_path('assets/user/img/qr/' . $bs->qr_image))) { $directory = public_path('assets/user/img/qr/'); @mkdir($directory, 0775, true); $fileName = uniqid() . '.png'; QrCode::size(250)->errorCorrection('H') ->color(0, 0, 0) ->format('png') ->style('square') ->eye('square') ->generate(url(Auth::user()->username), $directory . $fileName); $bs->qr_image = $fileName; $bs->qr_url = url(Auth::user()->username); $bs->save(); } $data['abs'] = $bs; return view('user.qr.generate', $data); } public function generate(Request $request) { if (!$request->filled('url')) { return "url_empty"; } $img = $request->file('image'); $type = $request->type; $bs = BasicSetting::where('user_id', Auth::user()->id)->first(); // set default values for all params of qr image, if there is no value for a param $color = hex2rgb($request->color); $directory = public_path('assets/user/img/qr/'); @mkdir($directory, 0775, true); $qrImage = uniqid() . '.png'; // remove previous qr image @unlink($directory . $bs->qr_image); // new QR code init $qrcode = QrCode::size($request->size) ->errorCorrection('H') ->margin($request->margin) ->color($color['red'], $color['green'], $color['blue']) ->format('png') ->style($request->style) ->eye($request->eye_style); if ($type == 'image' && $request->hasFile('image')) { @unlink($directory . $bs->qr_inserted_image); $mergedImage = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move($directory, $mergedImage); } // generating & saving the qr code in folder $qrcode->generate($request->url, $directory . $qrImage); // calculate the inserted image size $qrSize = $request->size; if ($type == 'image') { $imageSize = $request->image_size; $insertedImgSize = ($qrSize * $imageSize) / 100; // inserting image using Image Intervention & saving the qr code in folder if ($request->hasFile('image')) { $qr = Image::make($directory . $qrImage); $logo = Image::make($directory . $mergedImage); $logo->resize(null, $insertedImgSize, function ($constraint) { $constraint->aspectRatio(); }); $logoWidth = $logo->width(); $logoHeight = $logo->height(); $qr->insert($logo, 'top-left', (int) (((($qrSize - $logoWidth) * $request->image_x) / 100)), (int) (((($qrSize - $logoHeight) * $request->image_y) / 100))); $qr->save($directory . $qrImage); } else { if (!empty($bs->qr_inserted_image) && file_exists('./' . $directory . $bs->qr_inserted_image)) { $qr = Image::make($directory . $qrImage); $logo = Image::make($directory . $bs->qr_inserted_image); $logo->resize(null, $insertedImgSize, function ($constraint) { $constraint->aspectRatio(); }); $logoWidth = $logo->width(); $logoHeight = $logo->height(); $qr->insert($logo, 'top-left', (int) (((($qrSize - $logoWidth) * $request->image_x) / 100)), (int) (((($qrSize - $logoHeight) * $request->image_y) / 100))); $qr->save($directory . $qrImage); } } } if ($type == 'text') { $imageSize = $request->text_size; $insertedImgSize = ($qrSize * $imageSize) / 100; $logo = Image::canvas($request->text_width, $insertedImgSize, "#ffffff")->text($request->text, 0, 0, function ($font) use ($request, $insertedImgSize) { $font->file(public_path('assets/front/fonts/Lato-Regular.ttf')); $font->size($insertedImgSize); $font->color('#' . $request->text_color); $font->align('left'); $font->valign('top'); }); $logoWidth = $logo->width(); $logoHeight = $logo->height(); $qr = Image::make($directory . $qrImage); // use callback to define details $qr->insert($logo, 'top-left', (int) (((($qrSize - $logoWidth) * $request->text_x) / 100)), (int) (((($qrSize - $logoHeight) * $request->text_y) / 100))); $qr->save($directory . $qrImage); } $bs->qr_color = $request->color; $bs->qr_size = $request->size; $bs->qr_style = $request->style; $bs->qr_eye_style = $request->eye_style; $bs->qr_image = $qrImage; $bs->qr_type = $type; if ($type == 'image') { if ($request->hasFile('image')) { $bs->qr_inserted_image = $mergedImage; } $bs->qr_inserted_image_size = $imageSize; $bs->qr_inserted_image_x = $request->image_x; $bs->qr_inserted_image_y = $request->image_y; } if ($type == 'text' && !empty($request->text)) { $bs->qr_text = $request->text; $bs->qr_text_color = $request->text_color; $bs->qr_text_size = $request->text_size; $bs->qr_text_x = $request->text_x; $bs->qr_text_y = $request->text_y; } $bs->qr_margin = $request->margin; $bs->qr_url = $request->url; $bs->save(); return asset('assets/user/img/qr/' . $qrImage); } public function save(Request $request) { $rules = [ 'name' => 'required|max:255' ]; $request->validate($rules); $bs = BasicSetting::where('user_id', Auth::user()->id)->first(); $qrcode = new UserQrCode; $qrcode->user_id = Auth::user()->id; $qrcode->name = $request->name; $qrcode->image = $bs->qr_image; $qrcode->url = $bs->qr_url; $qrcode->save(); $this->clearFilters($bs); Session::flash('success', __('QR Code saved successfully') . '!'); return back(); } public function clear() { $bs = BasicSetting::where('user_id', Auth::user()->id)->first(); $this->clearFilters($bs, 'clear'); Session::flash('success', __('Cleared all filters') . '.'); return back(); } public function clearFilters($bs, $type = NULL) { @unlink(public_path('assets/user/img/qr/' . $bs->qr_inserted_image)); if ($type == 'clear') { @unlink(public_path('assets/user/img/qr/' . $bs->qr_image)); } $bs->qr_image = NULL; $bs->qr_color = '000000'; $bs->qr_size = 250; $bs->qr_style = 'square'; $bs->qr_eye_style = 'square'; $bs->qr_margin = 0; $bs->qr_text = NULL; $bs->qr_text_color = '000000'; $bs->qr_text_size = 15; $bs->qr_text_x = 50; $bs->qr_text_y = 50; $bs->qr_inserted_image = NULL; $bs->qr_inserted_image_size = 20; $bs->qr_inserted_image_x = 50; $bs->qr_inserted_image_y = 50; $bs->qr_type = 'default'; $bs->qr_url = NULL; $bs->save(); } public function delete(Request $request) { $qrcode = UserQrCode::find($request->qrcode_id); @unlink(public_path('assets/user/img/qr/' . $qrcode->image)); $qrcode->delete(); Session::flash('success', __('QR Code deleted successfully') . '!'); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $qrcode = UserQrCode::findOrFail($id); @unlink(public_path('assets/user/img/qr/' . $qrcode->image)); $qrcode->delete(); } Session::flash('success', __('QR Codes deleted successfully') . '!'); return "success"; } } Http/Controllers/CronJobController.php 0000644 00000046512 15213350435 0014113 0 ustar 00 <?php namespace App\Http\Controllers; use PDF; use Carbon\Carbon; use App\Models\Vendor; use App\Models\Package; use App\Models\Language; use App\Models\Membership; use App\Models\VendorInfo; use App\Http\Helpers\MegaMailer; use App\Http\Helpers\BasicMailer; use App\Models\Shop\ProductOrder; use App\Models\BasicSettings\Basic; use App\Jobs\SubscriptionExpiredMail; use App\Jobs\SubscriptionReminderMail; use App\Models\Services\ServiceBooking; use App\Models\BasicSettings\MailTemplate; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Models\FeaturedService\ServicePromotion; use App\Http\Controllers\Admin\Transaction\TransactionController; class CronJobController extends Controller { public function expired() { try { $bs = Basic::first(); $expired_members = Membership::whereDate('expire_date', Carbon::now()->subDays(1))->get(); foreach ($expired_members as $key => $expired_member) { if (!empty($expired_member->vendor)) { $vendor = $expired_member->vendor; $current_package = VendorPermissionHelper::userPackage($vendor->id); if (is_null($current_package)) { SubscriptionExpiredMail::dispatch($vendor, $bs); } } } $remind_members = Membership::whereDate('expire_date', Carbon::now()->addDays($bs->expiration_reminder))->get(); foreach ($remind_members as $key => $remind_member) { if (!empty($remind_member->vendor)) { $vendor = $remind_member->vendor; $nextPacakgeCount = Membership::where([ ['vendor_id', $vendor->id], ['start_date', '>', Carbon::now()->toDateString()] ])->where('status', '<>', 2)->count(); if ($nextPacakgeCount == 0) { SubscriptionReminderMail::dispatch($vendor, $bs, $remind_member->expire_date); } } \Artisan::call("queue:work --stop-when-empty"); } } catch (\Exception $e) { } } public function check_payment() { //check iyzico pending payments for membership $iyzico_pending_memberships = Membership::where([['status', 0], ['payment_method', 'Iyzico']])->get(); foreach ($iyzico_pending_memberships as $iyzico_pending_membership) { if (!is_null($iyzico_pending_membership->conversation_id)) { $result = $this->IyzicoPaymentStatus($iyzico_pending_membership->conversation_id); if ($result == 'success') { $this->updateIyzicoPendingMemership($iyzico_pending_membership->id, 1); } else { $this->updateIyzicoPendingMemership($iyzico_pending_membership->id, 2); } } } //check iyzico pending payments for service booking $iyzico_pending_bookings = ServiceBooking::where([['payment_status', 'pending'], ['payment_method', 'Iyzico']])->get(); foreach ($iyzico_pending_bookings as $iyzico_pending_booking) { if (!is_null($iyzico_pending_booking->conversation_id)) { $result = $this->IyzicoPaymentStatus($iyzico_pending_booking->conversation_id); if ($result == 'success') { $this->updateIyzicoPendingBooking($iyzico_pending_booking->id, 'completed'); } else { $this->updateIyzicoPendingBooking($iyzico_pending_booking->id, 'rejected'); } } } //check iyzico pending payments for service featured $iyzico_pending_featureds = ServicePromotion::where([['payment_status', 'pending'], ['payment_method', 'Iyzico']])->get(); foreach ($iyzico_pending_featureds as $iyzico_pending_featured) { if (!is_null($iyzico_pending_featured->conversation_id)) { $result = $this->IyzicoPaymentStatus($iyzico_pending_featured->conversation_id); if ($result == 'success') { $this->updateIyzicoPendingFeatured($iyzico_pending_featured->id, 'completed'); } else { $this->updateIyzicoPendingFeatured($iyzico_pending_featured->id, 'rejected'); } } } //check iyzico pending payments for product purchase $iyzico_pending_orders = ProductOrder::where([['payment_status', 'pending'], ['payment_method', 'Iyzico']])->get(); foreach ($iyzico_pending_orders as $iyzico_pending_order) { if (!is_null($iyzico_pending_order->conversation_id)) { $result = $this->IyzicoPaymentStatus($iyzico_pending_order->conversation_id); if ($result == 'success') { $this->updateIyzicoPendingOrder($iyzico_pending_order->id, 'completed'); } else { $this->updateIyzicoPendingOrder($iyzico_pending_order->id, 'rejected'); } } } } /** * Iyzico Payment Status Check For Membership */ private function IyzicoPaymentStatus($conversation_id) { $paymentMethod = OnlineGateway::where('keyword', 'iyzico')->first(); $paydata = $paymentMethod->convertAutoData(); $options = new \Iyzipay\Options(); $options->setApiKey($paydata['api_key']); $options->setSecretKey($paydata['secret_key']); if ($paydata['sandbox_status'] == 1) { $options->setBaseUrl("https://sandbox-api.iyzipay.com"); } else { $options->setBaseUrl("https://api.iyzipay.com"); // production mode } $request = new \Iyzipay\Request\ReportingPaymentDetailRequest(); $request->setPaymentConversationId($conversation_id); $paymentResponse = \Iyzipay\Model\ReportingPaymentDetail::create($request, $options); $result = (array) $paymentResponse; foreach ($result as $key => $data) { $data = json_decode($data, true); if ($data['status'] == 'success' && !empty($data['payments'])) { if (is_array($data['payments'])) { if ($data['payments'][0]['paymentStatus'] == 1) { return 'success'; } else { return 'not found'; } } else { return 'not found'; } } else { return 'not found'; } } return 'not found'; } /** * update iyzico pending membership */ private function updateIyzicoPendingMemership($id, $status) { $bs = Basic::first(); $membership = Membership::query()->where('id', $id)->first(); $vendor = Vendor::query()->where('id', $membership->vendor_id)->first(); $package = Package::query()->where('id', $membership->package_id)->first(); $count_membership = Membership::query()->where('vendor_id', $membership->vendor_id)->count(); //comparison date $date1 = Carbon::createFromFormat('m/d/Y', \Carbon\Carbon::parse($membership->start_date)->format('m/d/Y')); $date2 = Carbon::createFromFormat('m/d/Y', \Carbon\Carbon::now()->format('m/d/Y')); if ($status == 1) { $member['first_name'] = $vendor->first_name; $member['last_name'] = $vendor->last_name; $member['username'] = $vendor->username; $member['email'] = $vendor->email; $data['payment_method'] = $membership->payment_method; $result = $date1->gte($date2); if ($result) { $data['start_date'] = $membership->start_date; $data['expire_date'] = $membership->expire_date; } else { $data['start_date'] = Carbon::today()->format('d-m-Y'); if ($package->term === "daily") { $data['expire_date'] = Carbon::today()->addDay()->format('d-m-Y'); } elseif ($package->term === "weekly") { $data['expire_date'] = Carbon::today()->addWeek()->format('d-m-Y'); } elseif ($package->term === "monthly") { $data['expire_date'] = Carbon::today()->addMonth()->format('d-m-Y'); } elseif ($package->term === "lifetime") { $data['expire_date'] = Carbon::maxValue()->format('d-m-Y'); } else { $data['expire_date'] = Carbon::today()->addYear()->format('d-m-Y'); } $membership->update(['start_date' => Carbon::parse($data['start_date'])]); $membership->update(['expire_date' => Carbon::parse($data['expire_date'])]); } // if previous membership package is lifetime, then exipre that membership $previousMembership = Membership::query() ->where([ ['vendor_id', $vendor->id], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ]) ->where('status', 1) ->orderBy('created_at', 'DESC') ->first(); if (!is_null($previousMembership)) { $previousPackage = Package::query() ->select('term') ->where('id', $previousMembership->package_id) ->first(); if ($previousPackage->term === 'lifetime' || $previousMembership->is_trial == 1) { $yesterday = Carbon::yesterday()->format('d-m-Y'); $previousMembership->expire_date = Carbon::parse($yesterday); $previousMembership->save(); } } if ($count_membership > 1) { $mailTemplate = 'package_purchase_membership_accepted'; $mailType = 'paymentAcceptedForMembershipExtensionOfflineGateway'; } else { $mailTemplate = 'package_purchase_membership_accepted'; $mailType = 'paymentAcceptedForRegistrationOfflineGateway'; $vendor->update([ 'status' => 1 ]); } $filename = $this->makeInvoice($data, "membership", $member, null, $membership->price, "offline", $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $membership->transaction_id, $package->title, $membership); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $data['start_date'], 'expire_date' => $package->term == "lifetime" ? 'Lifetime' : $data['expire_date'], 'membership_invoice' => $filename, 'website_title' => $bs->website_title, 'templateType' => $mailTemplate, 'type' => $mailType ]; //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $vendor->id, 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $membership->price, 'after_balance' => $after_balance, 'admin_profit' => $membership->price, 'payment_method' => $membership->payment_method, 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $filename)); } elseif ($status == 2) { if ($count_membership > 1) { $mailTemplate = 'package_purchase_membership_rejected'; $mailType = 'paymentRejectedForMembershipExtensionOfflineGateway'; } else { $mailTemplate = 'package_purchase_membership_rejected'; $mailType = 'paymentRejectedForRegistrationOfflineGateway'; } $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_symbol_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_symbol_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'website_title' => $bs->website_title, 'templateType' => $mailTemplate, 'type' => $mailType ]; $mailer->mailFromAdmin($data); } $membership->update(['status' => $status]); } /** * update iyzico pending appointment */ private function updateIyzicoPendingBooking($id, $status) { $language = Language::where('is_default', 1)->first(); $language_id = $language->id; $appointment = ServiceBooking::with(['serviceContent' => function ($q) use ($language_id) { $q->where('language_id', $language_id); }]) ->findOrFail($id); if ($status == 'completed') { $appointment->update([ 'payment_status' => 'completed' ]); //send mail $type = 'service_payment_approved'; payemntStatusMail($type, $id); $arrData = array( 'customer_paid' => $appointment->customer_paid, 'paymentMethod' => $appointment->payment_method, 'currencySymbol' => $appointment->currency_symbol, 'currencySymbolPosition' => $appointment->currency_symbol_position, 'paymentStatus' => $appointment->payment_status, 'vendor_id' => $appointment->vendor_id, ); $transaction = new TransactionController(); $transaction->storeTransaction($arrData); } else { //after reject $appointment->update([ 'payment_status' => 'rejected' ]); //send mail $type = 'service_payment_rejected'; payemntStatusMail($type, $id); } } /** * update iyzico pending featured */ private function updateIyzicoPendingFeatured($id, $status) { $featuredRequest = ServicePromotion::find($id); if (!$featuredRequest) return; // Get default language $language = Language::where('is_default', 1)->first(); $service = $featuredRequest->serviceContent() ->where('language_id', $language->id) ->select('name', 'slug') ->first(); $url = $service ? route('frontend.service.details', ['slug' => $service->slug, 'id' => $featuredRequest->service_id]) : null; $serviceName = $service ? truncateString($service->name, 50) : null; // Basic info $websiteTitle = optional(Basic::select('website_title')->first())->website_title ?? 'Website'; $vendorName = optional(VendorInfo::where('vendor_id', $featuredRequest->vendor_id)->first())->name ?? 'Vendor'; $vendorEmail = optional($featuredRequest->vendor)->email; // Update payment status $paymentStatus = $status; $featuredRequest->payment_status = $paymentStatus; // Generate invoice and save $invoice = $this->generateInvoice($featuredRequest); $featuredRequest->invoice = $invoice; $featuredRequest->save(); // Create transaction if approved if ($status === 'approved') { $transactionData = [ 'vendor_id' => $featuredRequest->vendor_id, 'transaction_type' => 'featured_service', 'pre_balance' => null, 'actual_total' => $featuredRequest->amount, 'after_balance' => null, 'admin_profit' => $featuredRequest->amount, 'payment_method' => $featuredRequest->payment_method, 'currency_symbol' => $featuredRequest->currency_symbol, 'currency_symbol_position' => $featuredRequest->currency_symbol_position, 'payment_status' => $featuredRequest->payment_status, ]; store_transaction($transactionData); } // Mail template type $mailType = $status === 'approved' ? 'featured_request_payment_approved' : 'featured_request_payment_rejected'; $mailTemplate = MailTemplate::where('mail_type', $mailType)->first(); if ($mailTemplate && $vendorEmail) { $replacements = [ '{service_title}' => $url ? "<a href='{$url}'>{$serviceName}</a>" : '', '{amount}' => symbolPrice($featuredRequest->amount), '{username}' => $vendorName, '{website_title}' => $websiteTitle, ]; $mailData = [ 'subject' => $mailTemplate->mail_subject, 'body' => str_replace(array_keys($replacements), array_values($replacements), $mailTemplate->mail_body), 'recipient' => $vendorEmail, 'invoice' => public_path('assets/file/invoices/featured/service/') . $invoice, ]; try { BasicMailer::sendMail($mailData); } catch (\Exception $e) { \Log::error('Failed to send featured service status email: ' . $e->getMessage()); } } } /** * featured service invoice */ public function generateInvoice($requestInfo) { $fileName = $requestInfo->order_number . '.pdf'; $data['orderInfo'] = $requestInfo; $directory = public_path('assets/file/invoices/featured/service/'); @mkdir($directory, 0775, true); $fileLocated = $directory . $fileName; try { PDF::loadView('frontend.services.featured-service.invoice', $data)->save($fileLocated); } catch (\Exception $e) { \Log::error('Invoice PDF generation failed: ' . $e->getMessage()); } return $fileName; } /** * update iyzico pending orders */ private function updateIyzicoPendingOrder($id, $status) { $order = ProductOrder::find($id); if ($status == 'completed') { if ($order->payment_status == 'rejected' && $order->order_status != 'rejected') { $this->changeProductQuantity($order, 'decrease'); } $order->update([ 'payment_status' => 'completed' ]); $statusMsg = 'Your payment is complete.'; // generate an invoice in pdf format $invoice = $this->productInvoice($order); // then, update the invoice field info in database $order->update([ 'invoice' => $invoice ]); //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'transaction_id' => time(), 'vendor_id' => $arrData['vendor_id'] ?? 0, 'transaction_type' => 'product_purchase', 'pre_balance' => $pre_balance, 'actual_total' => $order->grand_total, 'after_balance' => $after_balance, 'admin_profit' => $order->grand_total, 'payment_method' => $order->payment_method, 'currency_symbol' => $order->currency_symbol, 'currency_symbol_position' => $order->currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); } else { if ($order->payment_status != 'rejected' && $order->order_status != 'rejected') { $this->changeProductQuantity($order, 'increase'); } $order->update([ 'payment_status' => 'rejected' ]); $statusMsg = 'Your payment has been rejected.'; } $mailData = []; if (isset($invoice)) { $mailData['invoice'] = public_path('assets/file/invoices/product/') . $invoice; } $mailData['subject'] = 'Notification of payment status'; $mailData['body'] = 'Hi ' . $order->billing_first_name . ' ' . $order->billing_last_name . ',<br/><br/>This email is to notify the payment status of your product purchase. ' . $statusMsg; $mailData['recipient'] = $order->billing_email; $mailData['sessionMessage'] = __('Payment status updated & mail has been sent successfully!'); BasicMailer::sendMail($mailData); } /** * product invoice */ public function productInvoice($orderInfo) { $fileName = $orderInfo->order_number . '.pdf'; $data['orderInfo'] = $orderInfo; $items = $orderInfo->item()->get(); $items->map(function ($item) { $product = $item->productInfo()->first(); $item['price'] = $product->current_price * $item->quantity; }); $data['productList'] = $items; $directory = public_path('assets/file/invoices/product/'); @mkdir($directory, 0775, true); $fileLocated = $directory . $fileName; $data['taxData'] = Basic::select('product_tax_amount')->first(); PDF::loadView('frontend.shop.invoice', $data)->save($fileLocated); return $fileName; } } Http/Controllers/Admin/UserController.php 0000644 00000010120 15213350435 0014507 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Validation\Rule; use App\Models\Admin; use App\Models\Role; use Validator; use Session; class UserController extends Controller { public function index() { $data['users'] = Admin::all(); $data['roles'] = Role::all(); return view('admin.user.index', $data); } public function edit($id) { $data['user'] = Admin::findOrFail($id); $data['roles'] = Role::all(); return view('admin.user.edit', $data); } public function store(Request $request) { $rules = [ 'username' => 'required|max:255|unique:admins', 'email' => 'required|email|max:255|unique:admins', 'first_name' => 'required|max:255', 'last_name' => 'required|max:255', 'password' => 'required|confirmed', 'role_id' => 'required', 'image' => 'required|mimes:jpeg,jpg,png', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $user = new Admin; $input = $request->all(); if ($request->hasFile('image')) { $image = $request->image; $name = uniqid() . '.' . $image->getClientOriginalExtension(); $image->move(public_path('assets/admin/img/propics/'), $name); $input['image'] = $name; } $input['password'] = bcrypt($request['password']); $user->create($input); Session::flash('success', __('User created successfully!')); return "success"; } public function update(Request $request) { $user = Admin::findOrFail($request->user_id); $rules = [ 'username' => [ 'required', 'max:255', Rule::unique('admins')->ignore($user->id), ], 'email' => [ 'required', 'email', 'max:255', Rule::unique('admins')->ignore($user->id), ], 'first_name' => 'required|max:255', 'last_name' => 'required|max:255', 'role_id' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); if ($request->hasFile('image')) { @unlink(public_path('assets/admin/img/propics/' . $user->image)); $image = $request->image; $name = uniqid() . '.' . $image->getClientOriginalExtension(); $image->move(public_path('assets/admin/img/propics/', $name)); $input['image'] = $name; } $user->update($input); Session::flash('success', __('User updated successfully!')); return "success"; } public function delete(Request $request) { if ($request->user_id == 1) { Session::flash('warning', 'You cannot delete the owner!'); return back(); } $user = Admin::findOrFail($request->user_id); @unlink(public_path('assets/admin/img/propics/' . $user->image)); $user->delete(); Session::flash('success', __('User deleted successfully!')); return back(); } public function managePermissions($id) { $data['user'] = Admin::find($id); return view('admin.user.permission.manage', $data); } public function updatePermissions(Request $request) { $permissions = json_encode($request->permissions); $user = Admin::find($request->user_id); $user->permissions = $permissions; $user->save(); Session::flash('success', __("Permissions updated successfully for the user:") . ' '. $user->name); return back(); } } Http/Controllers/Admin/HerosectionController.php 0000644 00000016434 15213350435 0016071 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\BasicExtended; use App\Models\Language; use Validator; use Session; class HerosectionController extends Controller { public function imgtext(Request $request) { $lang = Language::where('code', $request->language)->firstOrFail(); $data['lang_id'] = $lang->id; $data['abe'] = $lang->basic_extended; return view('admin.home.hero.img-text', $data); } public function update(Request $request, $langid) { $sideImg = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'image' => [ function ($attribute, $value, $fail) use ($request, $sideImg, $allowedExts) { if ($request->hasFile('image')) { $ext = $sideImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], 'hero_img2' => [ function ($attribute, $value, $fail) use ($request, $sideImg, $allowedExts) { if ($request->hasFile('hero_img2')) { $ext = $request->file('hero_img2')->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], 'hero_img3' => [ function ($attribute, $value, $fail) use ($request, $sideImg, $allowedExts) { if ($request->hasFile('hero_img3')) { $ext = $request->file('hero_img3')->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], 'hero_img4' => [ function ($attribute, $value, $fail) use ($request, $sideImg, $allowedExts) { if ($request->hasFile('hero_img4')) { $ext = $request->file('hero_img4')->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], 'hero_img5' => [ function ($attribute, $value, $fail) use ($request, $sideImg, $allowedExts) { if ($request->hasFile('hero_img5')) { $ext = $request->file('hero_img5')->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], 'hero_section_title' => 'nullable|max:255', 'hero_section_text' => 'nullable|max:255', 'hero_section_button_text' => 'nullable|max:30', 'hero_section_button_url' => 'nullable', 'hero_section_subtitle' => 'string|nullable', 'hero_section_secound_button_text' => 'string|nullable', 'hero_section_secound_button_url' => 'string|nullable' // 'hero_section_video_url' => 'nullable', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $be = BasicExtended::where('language_id', $langid)->firstOrFail(); $be->hero_section_title = $request->hero_section_title; $be->hero_section_subtitle = $request->hero_section_subtitle; $be->hero_section_text = $request->hero_section_text; $be->hero_section_button_text = $request->hero_section_button_text; $be->hero_section_button_url = $request->hero_section_button_url; $be->hero_section_secound_button_text = $request->hero_section_secound_button_text; $be->hero_section_secound_button_url = $request->hero_section_secound_button_url; // $be->hero_section_video_url = $request->hero_section_video_url; if ($request->hasFile('image')) { @unlink(public_path('assets/front/img/' . $be->hero_img)); $filename = uniqid() . '.' . $sideImg->getClientOriginalExtension(); $sideImg->move(public_path('assets/front/img/'), $filename); $be->hero_img = $filename; } if ($request->hasFile('hero_img2')) { @unlink(public_path('assets/front/img/' . $be->hero_img2)); $filename = uniqid() . '.' . $request->file('hero_img2')->getClientOriginalExtension(); $request->file('hero_img2')->move(public_path('assets/front/img/'), $filename); $be->hero_img2 = $filename; } if ($request->hasFile('hero_img3')) { @unlink(public_path('assets/front/img/' . $be->hero_img3)); $filename = uniqid() . '.' . $request->file('hero_img3')->getClientOriginalExtension(); $request->file('hero_img3')->move(public_path('assets/front/img/'), $filename); $be->hero_img3 = $filename; } if ($request->hasFile('hero_img4')) { @unlink(public_path('assets/front/img/' . $be->hero_img4)); $filename = uniqid() . '.' . $request->file('hero_img4')->getClientOriginalExtension(); $request->file('hero_img4')->move(public_path('assets/front/img/'), $filename); $be->hero_img4 = $filename; } if ($request->hasFile('hero_img5')) { @unlink(public_path('assets/front/img/' . $be->hero_img5)); $filename = uniqid() . '.' . $request->file('hero_img5')->getClientOriginalExtension(); $request->file('hero_img5')->move(public_path('assets/front/img/'), $filename); $be->hero_img5 = $filename; } $be->save(); Session::flash('success', __('Hero Section updated successfully!')); return "success"; } public function video(Request $request) { $data['abe'] = BasicExtended::first(); return view('admin.home.hero.video', $data); } public function videoupdate(Request $request) { $rules = [ 'video_link' => 'required|max:255', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $bes = BasicExtended::all(); $videoLink = $request->video_link; if (strpos($videoLink, "&") != false) { $videoLink = substr($videoLink, 0, strpos($videoLink, "&")); } foreach ($bes as $key => $be) { # code... $be->hero_section_video_link = $videoLink; $be->save(); } Session::flash('success', __('Informations updated successfully!')); return "success"; } } Http/Controllers/Admin/CouponController.php 0000644 00000005574 15213350435 0015055 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\Coupon; use App\Models\Package; use Illuminate\Http\Request; use Validator; use Session; class CouponController extends Controller { public function index(Request $request) { $data['coupons'] = Coupon::orderBy('id', 'DESC')->paginate(10); $data['packages'] = Package::where('status', '1')->get(); return view('admin.packages.coupons.index', $data); } public function store(Request $request) { $rules = [ 'name' => 'required', 'code' => 'required|unique:coupons', 'type' => 'required', 'value' => 'required | numeric', 'start_date' => 'required | date', 'maximum_uses_limit' => 'required | numeric', 'end_date' => 'required | date', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->except('_token'); $input['packages'] = json_encode($request->packages); Coupon::create($input); Session::flash('success', __('Coupon added successfully!')); return "success"; } public function edit($id) { $data['coupon'] = Coupon::findOrFail($id); $data['packages'] = Package::where('status', '1')->get(); $data['selectedPackages'] = !empty($data['coupon']->packages) ? json_decode($data['coupon']->packages, true) : []; return view('admin.packages.coupons.edit', $data); } public function update(Request $request) { $rules = [ 'name' => 'required', 'code' => 'required|unique:coupons,code,' . $request->coupon_id, 'type' => 'required', 'value' => 'required | numeric', 'start_date' => 'required | date', 'end_date' => 'required | date', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->except('_token', 'coupon_id'); $data = Coupon::find($request->coupon_id); $packages = !empty($request->packages) ? json_encode($request->packages) : NULL; $input['packages'] = $packages; $data->fill($input)->save(); Session::flash('success', __('Coupon updated successfully!')); return "success"; } public function delete(Request $request) { $coupon = Coupon::find($request->coupon_id); $coupon->delete(); $request->session()->flash('success', __('Coupon deleted successfully!')); return back(); } } Http/Controllers/Admin/FooterController.php 0000644 00000005676 15213350435 0015053 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\BasicSetting as BS; use App\Models\BasicExtended; use App\Models\Language; use Validator; use Session; use Purifier; class FooterController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->firstOrFail(); $data['lang_id'] = $lang->id; $data['abs'] = $lang->basic_setting; $data['abe'] = $lang->basic_extended; return view('admin.footer.logo-text', $data); } public function update(Request $request, $langid) { $img = $request->file('file'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'footer_text' => 'nullable|max:255', 'copyright_text' => 'nullable', 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed")); } } }, ], 'useful_links_title' => 'nullable|max:50', 'newsletter_title' => 'nullable|max:50' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $bs = BS::where('language_id', $langid)->firstOrFail(); if ($request->hasFile('file')) { @unlink(public_path('assets/front/img/' . $bs->footer_logo)); $filename = uniqid() .'.'. $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/'), $filename); $bs->footer_logo = $filename; } $bs->footer_text = $request->footer_text; $bs->useful_links_title = $request->useful_links_title; $bs->newsletter_title = $request->newsletter_title; $bs->newsletter_subtitle = $request->newsletter_subtitle; $bs->copyright_text = Purifier::clean($request->copyright_text); $bs->save(); Session::flash('success', __('Footer text updated successfully!')); return "success"; } public function removeImage(Request $request) { $type = $request->type; $langid = $request->language_id; $be = BasicExtended::where('language_id', $langid)->firstOrFail(); if ($type == "bottom") { @unlink(public_path("assets/front/img/" . $be->footer_bottom_img)); $be->footer_bottom_img = NULL; $be->save(); } $request->session()->flash('success', __('Image removed successfully!')); return "success"; } } Http/Controllers/Admin/ProcessController.php 0000644 00000011276 15213350435 0015224 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Language; use App\Models\Process; use Validator; use Session; class ProcessController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->first(); $lang_id = $lang->id; $data['processes'] = Process::where('language_id', $lang_id)->orderBy('id', 'DESC')->get(); $data['lang_id'] = $lang_id; return view('admin.home.process.index', $data); } public function edit($id) { $data['process'] = Process::findOrFail($id); return view('admin.home.process.edit', $data); } public function store(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'language_id' => 'required', 'image' => 'required', 'subtitle' => 'required', 'title' => 'required|max:50', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed")); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } if ($request->hasFile('image')) { $main_image = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/process/'), $main_image); $image = $main_image; } else { $image = null; } $process = new Process; $process->image = $image; $process->language_id = $request->language_id; $process->title = $request->title; $process->subtitle = $request->subtitle; $process->serial_number = $request->serial_number; $process->save(); Session::flash('success', __('Process added successfully!')); return "success"; } public function update(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'title' => 'required|max:50', 'subtitle' => 'required', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed")); } } }, ], ]; $request->validate($rules); $process = Process::findOrFail($request->process_id); if ($request->hasFile('image')) { $main_image = time() . '.' . $img->getClientOriginalExtension(); @unlink(public_path('assets/front/img/process/' . $process->image)); $request->file('image')->move(public_path('assets/front/img/process/'), $main_image); $process->image = $main_image; } $process->title = $request->title; $process->subtitle = $request->subtitle; $process->serial_number = $request->serial_number; $process->save(); Session::flash('success', __('Process updated successfully!')); return back(); } public function delete(Request $request) { $process = Process::findOrFail($request->process_id); @unlink(public_path('assets/front/img/process/' . $process->image)); $process->delete(); Session::flash('success', __('Process deleted successfully!')); return back(); } public function removeImage(Request $request) { $type = $request->type; $featId = $request->process_id; $process = Process::findOrFail($featId); if ($type == "process") { @unlink(public_path("assets/front/img/process/" . $process->image)); $process->image = NULL; $process->save(); } $request->session()->flash('success', __('Image removed successfully!')); return "success"; } } Http/Controllers/Admin/ContactController.php 0000644 00000002646 15213350435 0015202 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Models\BasicExtended; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\BasicSetting; use App\Models\Language; use Session; use Validator; class ContactController extends Controller { public function index(Request $request) { if (empty($request->language)) { $data['lang_id'] = 0; $data['abs'] = BasicSetting::firstOrFail(); $data['abe'] = BasicExtended::firstOrFail(); } else { $lang = Language::where('code', $request->language)->firstOrFail(); $data['lang_id'] = $lang->id; $data['abs'] = $lang->basic_setting; $data['abe'] = $lang->basic_extended; } return view('admin.contact', $data); } public function update(Request $request, $langid) { $request->validate([ 'contact_addresses' => 'required', 'contact_numbers' => 'required', 'contact_mails' => 'required' ]); $be = BasicExtended::where('language_id', $langid)->firstOrFail(); $be->contact_addresses = $request->contact_addresses; $be->contact_numbers = $request->contact_numbers; $be->contact_mails = $request->contact_mails; $be->save(); Session::flash('success', __('Contact page updated successfully!')); return back(); } } Http/Controllers/Admin/LanguageController.php 0000644 00000102540 15213350435 0015324 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Requests\Language\StoreRequest; use App\Http\Requests\Language\UpdateRequest; use App\Models\CustomPage\Page; use App\Models\CustomPage\PageContent; use App\Models\Journal\Blog; use App\Models\Journal\BlogInformation; use App\Models\Language; use App\Models\MenuBuilder; use App\Models\Shop\Product; use App\Models\Shop\ProductContent; use App\Models\Shop\ProductOrder; use App\Models\Shop\ProductPurchaseItem; use Illuminate\Http\Request; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\File; class LanguageController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $languages = Language::all(); return view('admin.language.index', compact('languages')); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(StoreRequest $request) { // get all the keywords from the default file of language $data = file_get_contents(resource_path('lang/') . 'default.json'); $adminData = file_get_contents(resource_path('lang/') . 'admin_default.json'); // make a new json file for the new language $fileName = strtolower($request->code) . '.json'; $AdminFileName = 'admin_' . strtolower($request->code) . '.json'; // create the path where the new language json file will be stored $fileLocated = resource_path('lang/') . $fileName; $AdminFileLocated = resource_path('lang/') . $AdminFileName; // finally, put the keywords in the new json file and store the file in lang folder file_put_contents($fileLocated, $data); file_put_contents($AdminFileLocated, $adminData); $in = $request->all(); $in['code'] = strtolower($request->code); // then, store data in db $language = Language::query()->create($in); $data = []; $data[] = [ 'text' => 'Home', "href" => "", "icon" => "empty", "target" => "_self", "title" => "", "type" => "home" ]; $data[] = [ 'text' => 'Vendors', "href" => "", "icon" => "empty", "target" => "_self", "title" => "", "type" => "vendors" ]; $data[] = [ 'text' => 'Shop', "href" => "", "icon" => "empty", "target" => "_self", "title" => "", "type" => "shop" ]; $data[] = [ 'text' => 'Blog', "href" => "", "icon" => "empty", "target" => "_self", "title" => "", "type" => "blog" ]; $data[] = [ 'text' => 'FAQ', "href" => "", "icon" => "empty", "target" => "_self", "title" => "", "type" => "faq" ]; $data[] = [ 'text' => 'About Us', "href" => "", "icon" => "empty", "target" => "_self", "title" => "", "type" => "about-us" ]; $data[] = [ 'text' => 'Contact', "href" => "", "icon" => "empty", "target" => "_self", "title" => "", "type" => "contact" ]; MenuBuilder::create([ 'language_id' => $language->id, 'menus' => json_encode($data, true) ]); // define the path for the language folder $langFolderPath = resource_path('lang/' . $language->code); if (!file_exists($langFolderPath)) { mkdir($langFolderPath, 0755, true); } // define the source path for the existing language files $sourcePath = resource_path('lang/admin_' . $language->code); // Check if the source directory exists if (is_dir($sourcePath)) { $files = scandir($sourcePath); foreach ($files as $file) { // Skip the current and parent directory indicators if ($file !== '.' && $file !== '..') { // Copy each file to the new language folder $sourceFilePath = $sourcePath . '/' . $file; $destinationFilePath = $langFolderPath . '/' . $file; copy($sourceFilePath, $destinationFilePath); } } } //update attributes with current keyword values $validationFilePath = resource_path('lang/admin_' . $language->code . '/validation.php'); //update existing keywords for validation attributes $newKeys = $this->dashboardAttribute(); $this->updateValidationAttribute($newKeys, $adminData, $validationFilePath); Session::flash('success', __('Language added successfully!')); return response()->json(['status' => 'success'], 200); } /** * Make a default language for this system. * * @param int $id * @return \Illuminate\Http\Response */ public function makeDefault($id) { // first, make other languages to non-default language $prevDefLang = Language::query()->where('is_default', '=', 1); $prevDefLang->update(['is_default' => 0]); // second, make the selected language to default language $language = Language::query()->find($id); $language->update(['is_default' => 1]); return back()->with('success', $language->name . ' ' . __('is set as default language.')); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(UpdateRequest $request) { $language = Language::query()->find($request->id); $in = $request->all(); $in['code'] = strtolower($request->code); if ($language->code !== $request->code) { /** * get all the keywords from the previous file, * which was named using previous language code */ $data = file_get_contents(resource_path('lang/') . $language->code . '.json'); $adminData = file_get_contents(resource_path('lang/') . 'admin_' . $language->code . '.json'); // make a new json file for the new language (code) $fileName = strtolower($request->code) . '.json'; $adminFileName = 'admin_' . strtolower($request->code) . '.json'; // create the path where the new language (code) json file will be stored $fileLocated = resource_path('lang/') . $fileName; $adminFileLocated = resource_path('lang/') . $adminFileName; // then, put the keywords in the new json file and store the file in lang folder file_put_contents($fileLocated, $data); file_put_contents($adminFileLocated, $adminData); // define the path for the language folder $langFolderPath = resource_path('lang/' . $request->code); if (!file_exists($langFolderPath)) { mkdir($langFolderPath, 0755, true); } // define the source path for the existing language files $sourcePath = resource_path('lang/admin_' . $request->code); // Check if the source directory exists if (is_dir($sourcePath)) { $files = scandir($sourcePath); foreach ($files as $file) { // Skip the current and parent directory indicators if ($file !== '.' && $file !== '..') { // Copy each file to the new language folder copy($sourcePath . '/' . $file, $langFolderPath . '/' . $file); } } } // now, delete the previous language code file @unlink(resource_path('lang/') . $language->code . '.json'); @unlink(resource_path('lang/') . 'admin_' . $language->code . '.json'); // Delete language folder and its contents $dir = resource_path('lang/') . $language->code; if (is_dir($dir)) { $this->deleteDirectory($dir); } // Load validation attributes $validationFilePath = resource_path('lang/admin_' . $request->code . '/validation.php'); //update existing keywords for validation attributes $newKeys = $this->dashboardAttribute(); $this->updateValidationAttribute($newKeys, $adminData, $validationFilePath); // finally, update the info in db $language->update($in); } else { $language->update($in); } Session::flash('success', __('Language updated successfully!')); return response()->json(['status' => 'success'], 200); } /** * forntend keyword add */ public function addKeyword(Request $request) { $rules = [ 'keyword' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $languages = Language::get(); foreach ($languages as $language) { // get all the keywords of the selected language $jsonData = file_get_contents(resource_path('lang/') . $language->code . '.json'); // convert json encoded string into a php associative array $keywords = json_decode($jsonData, true); $datas = []; $datas[$request->keyword] = $request->keyword; foreach ($keywords as $key => $keyword) { $datas[$key] = $keyword; } //put data $jsonData = json_encode($datas); $fileLocated = resource_path('lang/') . $language->code . '.json'; // put all the keywords in the selected language file file_put_contents($fileLocated, $jsonData); } //for default json // get all the keywords of the selected language $jsonData = file_get_contents(resource_path('lang/') . 'default.json'); // convert json encoded string into a php associative array $keywords = json_decode($jsonData, true); $datas = []; $datas[$request->keyword] = $request->keyword; foreach ($keywords as $key => $keyword) { $datas[$key] = $keyword; } //put data $jsonData = json_encode($datas); $fileLocated = resource_path('lang/') . 'default.json'; // put all the keywords in the selected language file file_put_contents($fileLocated, $jsonData); session()->flash('success', __('A new keyword has been added successfully for all languages!')); return Response::json(['status' => 'success'], 200); } /** * admin keyword add */ public function addAdminKeyword(Request $request) { $rules = [ 'keyword' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } // Get all languages $languages = Language::get(); // Create an associative array for new keywords $newKeyword = $request->keyword; $datas = []; // Update each language file foreach ($languages as $language) { $fileLocated = resource_path('lang/admin_' . $language->code . '.json'); // Check if the language file exists, if not create it by copying from default if (!file_exists($fileLocated)) { $defaultContent = file_get_contents(resource_path('lang/admin_default.json')); file_put_contents($fileLocated, $defaultContent); } // Read the current language file only once $jsonData = file_get_contents($fileLocated); $keywords = json_decode($jsonData, true); // Add the new keyword to the existing keywords $keywords[$newKeyword] = $newKeyword; // Store the updated keywords to write later $datas[$fileLocated] = json_encode($keywords); } // Write all updates at once foreach ($datas as $file => $content) { file_put_contents($file, $content); } // Update the default JSON file as well $defaultFile = resource_path('lang/admin_default.json'); $defaultContent = file_get_contents($defaultFile); $defaultKeywords = json_decode($defaultContent, true); $defaultKeywords[$newKeyword] = $newKeyword; // Write the updated default keywords file_put_contents($defaultFile, json_encode($defaultKeywords)); session()->flash('success', __('A new keyword has been added successfully for all languages!')); return Response::json(['status' => 'success'], 200); } /** * Display all the keywords of specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function editKeyword($id) { $language = Language::query()->findOrFail($id); // get all the keywords of the selected language $jsonData = file_get_contents(resource_path('lang/') . $language->code . '.json'); // convert json encoded string into a php associative array $keywords = json_decode($jsonData); return view('admin.language.edit-keyword', compact('language', 'keywords')); } /** * edit admin keyword page */ public function editAdminKeyword($id) { $language = Language::query()->findOrFail($id); // get all the keywords of the selected language $jsonData = file_get_contents(resource_path('lang/') . 'admin_' . $language->code . '.json'); // convert json encoded string into a php associative array $keywords = json_decode($jsonData); return view('admin.language.edit-admin-keyword', compact('language', 'keywords')); } /** * Update the keywords of specified resource in respective json file. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function updateKeyword(Request $request, $id) { $language = Language::query()->find($id); $arrData = $request['keyValues']; // first, check each key has value or not foreach ($arrData as $key => $value) { if ($value == null) { Session::flash('warning', 'Value is required for "' . $key . '" key.'); return redirect()->back(); } } $jsonData = json_encode($arrData); // Load validation attributes $validationFilePath = resource_path('lang/' . $language->code . '/validation.php'); //update existing attributes $newKeys = $this->frontAttribute(); $this->updateValidationAttribute($newKeys, $jsonData, $validationFilePath); $fileLocated = resource_path('lang/') . $language->code . '.json'; // put all the keywords in the selected language file file_put_contents($fileLocated, $jsonData); Session::flash('success', $language->name . ' ' . __("language's keywords updated successfully!")); return redirect()->back(); } /** * update admin keyword */ public function updateAdminKeyword(Request $request, $id) { $language = Language::query()->find($id); $arrData = $request['keyValues']; // first, check each key has value or not foreach ($arrData as $key => $value) { if ($value == null) { Session::flash('warning', 'Value is required for "' . $key . '" key.'); return redirect()->back(); } } $fileLocated = resource_path('lang/') . 'admin_' . $language->code . '.json'; // Load existing keywords from file $existingData = []; if (file_exists($fileLocated)) { $existingData = json_decode(file_get_contents($fileLocated), true) ?? []; } // Merge existing keywords with new ones (new keys overwrite old ones) $mergedData = array_merge($existingData, $arrData); //update attributes with current keyword values $validationFilePath = resource_path('lang/admin_' . $language->code . '/validation.php'); //update existing keywords for validation attributes $newKeys = $this->dashboardAttribute(); $this->updateValidationAttribute($newKeys, json_encode($arrData), $validationFilePath); // Save the updated data file_put_contents($fileLocated, json_encode($mergedData)); Session::flash('success', $language->name . ' ' . __("language's keywords updated successfully!")); return redirect()->back(); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $language = Language::query()->find($id); if ($language->is_default == 1) { return redirect()->back()->with('warning', __('Default language cannot be delete!')); } else { /** * delete website-menu info */ $websiteMenuInfo = $language->menuInfo()->first(); if (!empty($websiteMenuInfo)) { $websiteMenuInfo->delete(); } /** * delete service-categories info */ $serviceCategories = $language->serviceCategory()->get(); foreach ($serviceCategories as $serviceCategory) { @unlink(public_path('assets/admin/img/category/') . $serviceCategory->image); $serviceCategory->delete(); } /** * delete service-content */ $serviceContents = $language->serviceContent()->get(); foreach ($serviceContents as $serviceContent) { $serviceContent->delete(); } /** * delete staff-content */ $staffContents = $language->staffContent()->get(); foreach ($staffContents as $staffContent) { $staffContent->delete(); } /** * delete product-categories info */ $productCategories = $language->productCategory()->get(); if (count($productCategories) > 0) { foreach ($productCategories as $productCategory) { $productCategory->delete(); } } $shippingCharges = $language->shippingCharge()->get(); foreach ($shippingCharges as $shippingCharge) { $shippingCharge->delete(); } /** * delete product infos */ $productInfos = $language->productContent()->get(); if (count($productInfos) > 0) { foreach ($productInfos as $productData) { $productInfo = $productData; $productData->delete(); // delete the product if, this product does not contain any other product-contents in any other language $otherProductInfos = ProductContent::query()->where('language_id', '<>', $language->id) ->where('product_id', '=', $productInfo->product_id) ->get(); if (count($otherProductInfos) == 0) { $product = Product::query()->find($productInfo->product_id); // delete purchase item records of this product $purchaseInfos = $product->purchase()->get(); if (count($purchaseInfos) > 0) { foreach ($purchaseInfos as $purchaseData) { $purchaseInfo = $purchaseData; $purchaseData->delete(); // delete the order if, this order does not contain any other items $otherPurchaseItems = ProductPurchaseItem::query()->where('product_id', '<>', $product->id) ->where('product_order_id', '=', $purchaseInfo->product_order_id) ->get(); if (count($otherPurchaseItems) == 0) { $order = ProductOrder::query()->find($purchaseInfo->product_order_id); // delete order receipt @unlink(public_path('assets/file/attachments/product/') . $order->receipt); // delete order invoice @unlink(public_path('assets/file/invoices/product/') . $order->invoice); $order->delete(); } } } // delete all the reviews of this product $reviews = $product->review()->get(); if (count($reviews) > 0) { foreach ($reviews as $review) { $review->delete(); } } // delete product featured image $featImg = $product->featured_image; @unlink(public_path('assets/img/products/featured-images/') . $featImg); // delete product slider images $sldImgs = json_decode($product->slider_images); foreach ($sldImgs as $sldImg) { @unlink(public_path('assets/img/products/slider-images/') . $sldImg); } // delete product zip file $zipFile = $product->file; @unlink(public_path('assets/file/products/') . $zipFile); $product->delete(); } } } /** * delete vendor infos */ $vendorInfos = $language->vendorInfo()->get(); foreach ($vendorInfos as $vendorInfo) { $vendorInfo->delete(); } /** * delete banner infos */ $banners = $language->banner()->get(); foreach ($banners as $banner) { @unlink(public_path('assets/img/banners/') . $banner->image); $banner->delete(); } /** * delete workprocess infos */ $workProcess = $language->workProcess()->get(); foreach ($workProcess as $workProces) { $workProces->delete(); } /** * delete about-us-section info */ $aboutUsSecInfo = $language->aboutUsSection()->first(); if (!empty($aboutUsSecInfo)) { $aboutUsSecInfo->delete(); } /** * delete features infos */ $features = $language->featuresInfos()->get(); foreach ($features as $feature) { $feature->delete(); } /** * delete testimonial infos */ $testimonials = $language->testimonial()->get(); if (count($testimonials) > 0) { foreach ($testimonials as $testimonial) { $clientImg = $testimonial->image; @unlink(public_path('assets/img/clients/') . $clientImg); $testimonial->delete(); } } /** * delete footer-content info */ $footerContentInfo = $language->footerContent()->first(); if (!empty($footerContentInfo)) { $footerContentInfo->delete(); } /** * delete footer-quick-links */ $quickLinks = $language->footerQuickLink()->get(); if (count($quickLinks) > 0) { foreach ($quickLinks as $quickLink) { $quickLink->delete(); } } /** * delete custom-page infos */ $customPageInfos = $language->customPageInfo()->get(); if (count($customPageInfos) > 0) { foreach ($customPageInfos as $customPageData) { $customPageInfo = $customPageData; $customPageData->delete(); // delete the custom-page if, this page does not contain any other page-content in any other language $otherPageContents = PageContent::query()->where('language_id', '<>', $language->id) ->where('page_id', '=', $customPageInfo->page_id) ->get(); if (count($otherPageContents) == 0) { $page = Page::query()->find($customPageInfo->page_id); $page->delete(); } } } /** * delete blog-categories info */ $blogCategories = $language->blogCategory()->get(); if (count($blogCategories) > 0) { foreach ($blogCategories as $blogCategory) { $blogCategory->delete(); } } /** * delete blog infos */ $blogInfos = $language->blogInformation()->get(); if (count($blogInfos) > 0) { foreach ($blogInfos as $blogData) { $blogInfo = $blogData; $blogData->delete(); // delete the blog if, this blog does not contain any other blog-information in any other language $otherBlogInfos = BlogInformation::query()->where('language_id', '<>', $language->id) ->where('blog_id', '=', $blogInfo->blog_id) ->get(); if (count($otherBlogInfos) == 0) { $blog = Blog::query()->find($blogInfo->blog_id); @unlink(public_path('assets/img/blogs/') . $blog->image); $blog->delete(); } } } /** * delete faq infos */ $faqs = $language->faq()->get(); if (count($faqs) > 0) { foreach ($faqs as $faq) { $faq->delete(); } } /** * delete popup infos */ $popups = $language->announcementPopup()->get(); if (count($popups) > 0) { foreach ($popups as $popup) { @unlink(public_path('assets/img/popups/') . $popup->image); $popup->delete(); } } $pageNames = $language->pageName()->get(); foreach ($pageNames as $pageName) { $pageName->delete(); } $seoInfos = $language->seoInfo()->get(); foreach ($seoInfos as $seoInfo) { $seoInfo->delete(); } /** * delete cookie-alert info */ $cookieAlertInfo = $language->cookieAlertInfo()->first(); if (!empty($cookieAlertInfo)) { $cookieAlertInfo->delete(); } /** * delete the language json file */ @unlink(resource_path('lang/') . $language->code . '.json'); @unlink(resource_path('lang/') . 'admin_' . $language->code . '.json'); // Delete language folder and its contents $dir = resource_path('lang/') . $language->code; if (is_dir($dir)) { $this->deleteDirectory($dir); } /** * finally, delete the language info from db */ $language->delete(); return redirect()->back()->with('success', __('Language deleted successfully!')); } } /** * Check the specified language is RTL or not. * * @param int $id * @return \Illuminate\Http\Response */ public function checkRTL($langid) { if ($langid > 0) { $lang = Language::where('id', $langid)->first(); } else { return 0; } return $lang->direction; } //dashboard attribute public function dashboardAttribute() { //update existing keys $newKeys = [ 'direction' => 'direction', 'keyword' => 'keyword', 'name' => 'name', 'username' => 'username', 'email' => 'email address', 'first_name' => 'first name', 'last_name' => 'last name', 'password' => 'password', 'password_confirmation' => 'confirm password', 'city' => 'city', 'country' => 'country', 'address' => 'address', 'phone' => 'phone', 'mobile' => 'mobile', 'age' => 'age', 'sex' => 'sex', 'gender' => 'gender', 'day' => 'day', 'month' => 'month', 'year' => 'year', 'hour' => 'hour', 'minute' => 'minute', 'second' => 'second', 'title' => 'title', 'subtitle' => 'subtitle', 'text' => 'text', 'description' => 'description', 'content' => 'content', 'occupation' => 'occupation', 'comment' => 'comment', 'rating' => 'rating', 'terms' => 'terms', 'question' => 'question', 'answer' => 'answer', 'status' => 'status', 'term' => 'term', 'price' => 'price', 'amount' => 'amount', 'date' => 'date', 'latitude' => 'latitude', 'longitude' => 'longitude', 'value' => 'value', 'type' => 'type', 'code' => 'code', 'url' => 'url', 'stock' => 'stock', 'delay' => 'delay', 'image' => 'image', 'language_id' => 'language', 'serial_number' => 'serial number', 'category_id' => 'category', 'slider_images' => 'slider images', 'order_number' => 'order number', 'staff_image' => 'staff image', 'start_time' => 'start time', 'end_time' => 'end time', 'start_date' => 'start date', 'end_date' => 'end date', 'product_tax_amount' => 'product tax amount', 'shipping_charge' => 'shipping charge', 'short_text' => 'short text', 'featured_image' => 'featured image', 'current_price' => 'current price', 'min_limit' => 'min limit', 'max_limit' => 'max limit', 'email_address' => 'email address', 'contact_number' => 'contact number', 'new_password' => 'new password', 'new_password_confirmation' => 'new password confirmation', 'google_adsense_publisher_id' => 'google adsense publisher id', 'ad_type' => 'ad type', 'resolution_type' => 'resolution type', 'button_text' => 'button text', 'button_url' => 'button url', 'background_color_opacity' => 'background color opacity', 'base_currency_symbol' => 'base currency symbol', 'base_currency_symbol_position' => 'base currency symbol position', 'base_currency_text' => 'base currency text', 'base_currency_text_position' => 'base currency text position', 'base_currency_rate' => 'base currency rate', 'website_title' => 'website title', 'secondary_color' => 'secondary color', 'primary_color' => 'primary color', 'preloader' => 'preloader', 'logo' => 'logo', 'favicon' => 'favicon', 'smtp_host' => 'smtp host', 'smtp_port' => 'smtp port', 'encryption' => 'encryption', 'from_name' => 'from name', 'from_mail' => 'from mail', 'smtp_password' => 'smtp password', 'smtp_username' => 'smtp username', 'mail_subject' => 'mail subject', 'subject' => 'subject', 'mail_body' => 'mail body', 'cookie_alert_text' => 'cookie alert text', 'role_id' => 'role_id', "paypal_status" => "paypal status", "paypal_sandbox_status" => "paypal sandbox status", "paypal_client_id" => "paypal client ID", "paypal_client_secret" => "paypal client secret", "instamojo_status" => "instamojo status", "instamojo_sandbox_status" => "instamojo sandbox status", "instamojo_key" => "instamojo API key", "instamojo_token" => "instamojo auth token", "paytm_status" => "paytm status", "paytm_environment" => "paytm environment", "paytm_merchant_key" => "paytm merchant key", "paytm_merchant_mid" => "paytm merchant MID", "paytm_merchant_website" => "paytm merchant website", "paytm_industry_type" => "paytm industry type", "stripe_status" => "stripe status", "stripe_key" => "stripe key", "stripe_secret" => "stripe secret", "flutterwave_status" => "flutterwave status", "flutterwave_public_key" => "flutterwave public key", "flutterwave_secret_key" => "flutterwave secret key", "razorpay_status" => "razorpay status", "razorpay_key" => "razorpay key", "razorpay_secret" => "razorpay secret", "mollie_status" => "mollie status", "mollie_key" => "mollie API key", "paystack_status" => "paystack status", "paystack_key" => "paystack API key", "mercadopago_status" => "mercadopago status", "mercadopago_sandbox_status" => "mercadopago sandbox status", "mercadopago_token" => "mercadopago token", "authorize_net_status" => "Authorize.Net status", "sandbox_check" => "sandbox check", "login_id" => "login ID", "transaction_key" => "transaction key", "public_key" => "public key", "google_map_api_key" => "google map api key", "google_map_radius" => "google map radius", "zoom_account_id" => "zoom account id", "zoom_client_id" => "zoom client id", "zoom_client_secret" => "zoom client secret", "disqus_short_name" => "disqus short name", "tawkto_status" => "tawkto status", "tawkto_direct_chat_link" => "tawkto direct chat link", "calender_id" => "calender id", "whatsapp_number" => "whatsapp number", "whatsapp_header_title" => "whatsapp header title", "whatsapp_popup_message" => "whatsapp popup message", "google_recaptcha_site_key" => "googlerecaptasitekey", "google_recaptcha_status" => "googlerecaptastatus", "google_recaptcha_secret_key" => "googlerecaptasecretkey", "google_client_id" => "googleclientid", "google_client_secret" => "googleclientsecret", "google_login_status" => "googleloginstatus", "current_password" => "current password" ]; return $newKeys; } //front attribute public function frontAttribute() { $newKeys = [ 'name' => 'name', 'first_name' => 'first name', 'gateway' => 'gateway', 'phone' => 'phone', 'address' => 'address', 'email' => 'email address', 'subject' => 'subject', 'message' => 'message', 'username' => 'username', 'password' => 'password', 'password_confirmation' => 'confirm password', 'new_password' => 'new password', 'new_password_confirmation' => 'new confirm password' ]; return $newKeys; } public function updateValidationAttribute($newKeys, $content, $validationFilePath) { try { // Load the existing validation array $validation = include($validationFilePath); // Ensure 'attributes' key exists if (!isset($validation['attributes']) || !is_array($validation['attributes'])) { $validation['attributes'] = []; } } catch (\Exception $e) { session()->flash('warning', __('Please provide a valid language code!')); return; } //update existing keys foreach ($newKeys as $key => $value) { if (!array_key_exists($key, $validation['attributes'])) { $validation['attributes'][$key] = $value; } } // update values which matching keys with new values $decodedContent = json_decode($content, true); if (is_array($decodedContent)) { foreach ($decodedContent as $key => $value) { if (array_key_exists($key, $validation['attributes'])) { $validation['attributes'][$key] = $value; } } } //save the changes in validation attributes array $validationContent = "<?php\n\nreturn " . var_export($validation, true) . ";\n"; file_put_contents($validationFilePath, $validationContent); } //delete a directory recursively private function deleteDirectory($dir) { $files = array_diff(scandir($dir), ['.', '..']); foreach ($files as $file) { $filePath = "$dir/$file"; if (is_dir($filePath)) { $this->deleteDirectory($filePath); } else { @unlink($filePath); } } rmdir($dir); } } Http/Controllers/Admin/TenantLanguageController.php 0000644 00000011454 15213350435 0016501 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Models\Language; use App\Traits\Keywords; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class TenantLanguageController extends Controller { public function editUserKeyword($id) { if ($id > 0) { $la = Language::findOrFail($id); $filePath = resource_path('lang/user_' . $la->code . '.json'); if (!file_exists($filePath)) { $this->userLanguageKeywords(trim($la->code)); } $json = file_get_contents($filePath); $json = json_decode($json, true); if (empty($json)) { return back()->with('warning', __('File Not Found.')); } return view('admin.language.edit-user-keyword', compact('json', 'la')); } elseif ($id == 0) { $json = file_get_contents(resource_path('lang/') . 'user_default.json'); $json = json_decode($json, true); if (empty($json)) { return back()->with('warning', __('File Not Found.')); } return view('admin.language.edit-user-keyword', compact('json')); } } protected function userLanguageKeywords($code) { $user_data = file_get_contents(resource_path('lang/') . 'user_default.json'); $admin_json_file = 'user_' . $code . '.json'; $user_path = resource_path('lang/') . $admin_json_file; File::put($user_path, $user_data); //copy folder $userSourceFolder = resource_path('lang/' . $code); $userNewFolder = resource_path('lang/' . 'user_' . $code); $this->duplicateFolderAndRename($userSourceFolder, $userNewFolder); $userValidationSrc = resource_path('lang/user_' . $code . '/validation.php'); $this->addNameAttributeForUser($userValidationSrc); } public function updateUserDashboardKeyword(Request $request, $id) { $language = Language::query()->find($id); $newkeywordsArr = $request['keys']; if (count($newkeywordsArr) === 0) { return back()->with('alert', __('At Least One Field Should Be Fill-up')); } $existingkeywordsArr = []; $fileLocated = resource_path('lang/') . 'user_' . $language->code . '.json'; if (file_exists($fileLocated)) { $existingkeywordsArr = json_decode(file_get_contents($fileLocated), true) ?? []; } //override json file $requestKeywordsArr = array_merge($existingkeywordsArr, $newkeywordsArr); file_put_contents(resource_path('lang/') . 'user_' . $language->code . '.json', json_encode($requestKeywordsArr)); //override validation attribute file $useruValidationFilePath = resource_path('lang/user_' . $language->code . '/validation.php'); $this->updateNameAttributeForUser($useruValidationFilePath, $requestKeywordsArr); return back()->with('success', __('Updated successfully!')); } protected function updateNameAttributeForUser($validationFilePath, $requestKeywordsArr) { if (file_exists($validationFilePath)) { $validationData = include $validationFilePath; $validationAttributes = $validationData['attributes']; if (is_array($validationAttributes)) { foreach (Keywords::userNameAttribute() as $key => $value) { if (!array_key_exists($key, $validationAttributes)) { $validationAttributes[$key] = $value; } } } foreach ($requestKeywordsArr as $key => $value) { if (array_key_exists($key, $validationAttributes)) { $validationAttributes[$key] = $value; } } $validationData['attributes'] = $validationAttributes; $validationContent = "<?php\n\nreturn " . var_export($validationData, true) . ";\n"; file_put_contents($validationFilePath, $validationContent); } } public function editCustomerKeyword($id) { $la = Language::findOrFail($id); $json = json_decode($la->customer_keywords, true); return view('admin.language.edit-customer-keyword', compact('json', 'la')); } public function updateCustomerKeyword($id, Request $request) { $lang = Language::findOrFail($id); $content = json_encode($request->keys); if ($content === 'null') { return back()->with('alert', __('At Least One Field Should Be Fill-up')); } $lang->customer_keywords = $content; $lang->save(); Session::flash('success', __('Updated successfully!')); return 'success'; } } Http/Controllers/Admin/ProfileController.php 0000644 00000006475 15213350435 0015213 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Validation\Rule; use Auth; use Session; use Hash; use Validator; use App\Models\Admin; class ProfileController extends Controller { public function changePass() { return view('admin.profile.changepass'); } public function editProfile() { $admin = Admin::findOrFail(Auth::guard('admin')->user()->id); return view('admin.profile.editprofile', ['admin' => $admin]); } public function updateProfile(Request $request) { $img = $request->file('profile_image'); $allowedExts = array('jpg', 'png', 'jpeg'); $admin = Admin::findOrFail(Auth::guard('admin')->user()->id); $validatedData = $request->validate([ 'username' => [ 'required', 'max:255', Rule::unique('admins')->ignore($admin->id) ], 'email' => 'required|email|max:255', 'first_name' => 'required|max:255', 'last_name' => 'required|max:255', 'profile_image' => [ function ($attribute, $value, $fail) use ($request, $img, $allowedExts) { if ($request->hasFile('profile_image')) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], ]); $admin->username = $request->username; $admin->email = $request->email; $admin->first_name = $request->first_name; $admin->last_name = $request->last_name; if ($request->hasFile('profile_image')) { @unlink(public_path('assets/admin/img/propics/' . $admin->image)); $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/admin/img/propics/'), $filename); $admin->image = $filename; } $admin->save(); Session::flash('success', __('Profile updated successfully!')); return redirect()->back(); } public function updatePassword(Request $request) { $messages = [ 'password.required' => 'The new password field is required', 'password.confirmed' => "Password does'nt match" ]; $validator = Validator::make($request->all(), [ 'old_password' => 'required', 'password' => 'required|confirmed' ], $messages); // if given old password matches with the password of this authenticated user... if(Hash::check($request->old_password, Auth::guard('admin')->user()->password)) { $oldPassMatch = 'matched'; } else { $oldPassMatch = 'not_matched'; } if ($validator->fails() || $oldPassMatch=='not_matched') { if($oldPassMatch == 'not_matched') { $validator->errors()->add('oldPassMatch', true); } return redirect()->route('admin.changePass') ->withErrors($validator); } // updating password in database... $user = Admin::findOrFail(Auth::guard('admin')->user()->id); $user->password = bcrypt($request->password); $user->save(); Session::flash('success', __('Password changed successfully!')); return redirect()->back(); } } Http/Controllers/Admin/SocialController.php 0000644 00000003235 15213350435 0015014 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Social; use Session; class SocialController extends Controller { public function index() { $data['socials'] = Social::orderBy('id', 'DESC')->get(); return view('admin.basic.social.index', $data); } public function store(Request $request) { $request->validate([ 'icon' => 'required', 'url' => 'required', 'serial_number' => 'required|integer', ]); $social = new Social; $social->icon = $request->icon; $social->url = $request->url; $social->serial_number = $request->serial_number; $social->save(); Session::flash('success', __('New link added successfully!')); return back(); } public function edit($id) { $data['social'] = Social::findOrFail($id); return view('admin.basic.social.edit', $data); } public function update(Request $request) { $request->validate([ 'icon' => 'required', 'url' => 'required', 'serial_number' => 'required|integer', ]); $social = Social::findOrFail($request->socialid); $social->icon = $request->icon; $social->url = $request->url; $social->serial_number = $request->serial_number; $social->save(); Session::flash('success', __('Social link updated successfully!')); return back(); } public function delete(Request $request) { $social = Social::findOrFail($request->socialid); $social->delete(); Session::flash('success', __('Social link deleted successfully!')); return back(); } } Http/Controllers/Admin/CustomDomainController.php 0000644 00000016361 15213350435 0016210 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Helpers\MegaMailer; use App\Models\BasicExtended; use App\Models\BasicSetting; use App\Models\User\UserCustomDomain; use Illuminate\Http\Request; use PHPMailer\PHPMailer\PHPMailer; use Session; use Validator; class CustomDomainController extends Controller { public function texts() { $data['abe'] = BasicExtended::select('domain_request_success_message', 'cname_record_section_title', 'cname_record_section_text')->first(); return view('admin.domains.custom-texts', $data); } public function updateTexts(Request $request) { $rules = [ 'success_message' => 'required|max:255', 'cname_record_section_title' => 'required|max:255', 'cname_record_section_text' => 'required' ]; $request->validate($rules); $be = BasicExtended::first(); $be->domain_request_success_message = clean($request->success_message); $be->cname_record_section_title = $request->cname_record_section_title; $be->cname_record_section_text = clean($request->cname_record_section_text); $be->save(); $request->session()->flash('success', __('Request Texts updated successfully')); return back(); } public function index(Request $request) { $rcDomains = UserCustomDomain::orderBy('id', 'DESC') ->when($request->domain, function ($query) use ($request) { return $query->where(function ($query) use ($request) { $query->where('current_domain', 'LIKE', '%' . $request->domain . '%') ->orWhere('requested_domain', 'LIKE', '%' . $request->domain . '%'); }); }) ->when($request->username, function ($query) use ($request) { return $query->whereHas('user', function ($query) use ($request) { $query->where('username', $request->username); }); }); if (empty($request->type)) { $rcDomains = $rcDomains->paginate(10); } elseif ($request->type == 'pending') { $rcDomains = $rcDomains->where('status', 0)->paginate(10); } elseif ($request->type == 'connected') { $rcDomains = $rcDomains->where('status', 1)->paginate(10); } elseif ($request->type == 'rejected') { $rcDomains = $rcDomains->where('status', 2)->paginate(10); } else { return view('errors.404'); } $data['rcDomains'] = $rcDomains; return view('admin.domains.custom', $data); } public function status(Request $request) { $rcDomain = UserCustomDomain::findOrFail($request->domain_id); $rcDomain->status = $request->status; $rcDomain->save(); // if the requested domain is connected if ($request->status == 1) { if (!empty($rcDomain->user)) { $user = $rcDomain->user; $bs = BasicSetting::firstOrFail(); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'requested_domain' => $rcDomain->requested_domain, 'previous_domain' => !empty($rcDomain->current_domain) ? $rcDomain->current_domain : 'Not Available', 'website_title' => $bs->website_title, 'templateType' => 'custom_domain_connected', 'type' => 'customDomainConnected' ]; $mailer->mailFromAdmin($data); } } elseif ($request->status == 2) { if (!empty($rcDomain->user)) { $user = $rcDomain->user; $currDomCount = $user->custom_domains()->where('status', 1)->count(); if ($currDomCount > 0) { $currDom = $user->custom_domains()->where('status', 1)->orderBy('id', 'DESC')->first()->requested_domain; } $bs = BasicSetting::firstOrFail(); $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'requested_domain' => $rcDomain->requested_domain, 'current_domain' => !empty($currDom) ? $currDom : 'Not Available', 'website_title' => $bs->website_title, 'templateType' => 'custom_domain_rejected', 'type' => 'customDomainRejected' ]; $mailer->mailFromAdmin($data); } } $request->session()->flash('success', __('Status updated successfully')); return back(); } public function mail(Request $request) { $rules = [ 'email' => 'required', 'subject' => 'required', 'message' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $be = BasicExtended::first(); $from = $be->from_mail; $sub = $request->subject; $msg = $request->message; $to = $request->email; // Send Mail $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; if ($be->is_smtp == 1) { try { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; $mail->SMTPSecure = $be->encryption; $mail->Port = $be->smtp_port; //Recipients $mail->setFrom($from); $mail->addAddress($to); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = $msg; $mail->send(); } catch (\Exception $e) { } } else { try { //Recipients $mail->setFrom($from); $mail->addAddress($to); // Content $mail->isHTML(true); $mail->Subject = $sub; $mail->Body = $msg; $mail->send(); } catch (\Exception $e) { } } Session::flash('success', __('Mail sent successfully!')); return "success"; } public function delete(Request $request) { UserCustomDomain::findOrFail($request->domain_id)->delete(); $request->session()->flash('success', __('Custom domain deleted successfully!')); return redirect()->back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { UserCustomDomain::findOrFail($id)->delete(); } $request->session()->flash('success', __('Custom domains deleted successfully!')); return "success"; } } Http/Controllers/Admin/AdvertisementController.php 0000644 00000006616 15213350435 0016422 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Helpers\UploadFile; use App\Http\Requests\Advertisement\StoreRequest; use App\Http\Requests\Advertisement\UpdateRequest; use App\Models\Advertisement; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Validator; class AdvertisementController extends Controller { public function advertiseSettings() { $data = DB::table('basic_settings')->select('google_adsense_publisher_id')->first(); return view('admin.advertisement.settings', ['data' => $data]); } public function updateAdvertiseSettings(Request $request) { $rule = [ 'google_adsense_publisher_id' => 'required' ]; $validator = Validator::make($request->all(), $rule); if ($validator->fails()) { return redirect()->back()->withErrors($validator->errors()); } DB::table('basic_settings')->updateOrInsert( ['uniqid' => 12345], ['google_adsense_publisher_id' => $request->google_adsense_publisher_id] ); session()->flash('success', __('Advertise settings updated successfully!') ); return redirect()->back(); } public function index() { $ads = Advertisement::orderBy('id', 'desc')->get(); return view('admin.advertisement.index', compact('ads')); } public function store(StoreRequest $request) { if ($request->hasFile('image')) { $imageName = UploadFile::store(public_path('assets/img/advertisements/'), $request->file('image')); } Advertisement::create($request->except('image') + [ 'image' => $request->hasFile('image') ? $imageName : null ]); session()->flash('success', __('New advertisement added successfully!') ); return response()->json(['status' => 'success'], 200); } public function update(UpdateRequest $request) { $ad = Advertisement::find($request->id); if ($request->hasFile('image')) { $imageName = UploadFile::update(public_path('assets/img/advertisements/'), $request->file('image'), $ad->image); } if ($request->ad_type == 'adsense') { // if ad type change to google adsense then delete the image from local storage. @unlink(public_path('assets/img/advertisements/') . $ad->image); } $ad->update($request->except('image') + [ 'image' => $request->hasFile('image') ? $imageName : $ad->image ]); session()->flash('success', __('Advertisement updated successfully!') ); return response()->json(['status' => 'success'], 200); } public function previewImage(Request $request) { $id = $request->dataId; $ad = Advertisement::find($id); $imgFile = $ad->image; return $imgFile; } public function destroy($id) { $ad = Advertisement::find($id); if ($ad->ad_type == 'banner') { @unlink(public_path('assets/img/advertisements/') . $ad->image); } $ad->delete(); return redirect()->back()->with('success', __('Advertisement deleted successfully!') ); } public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $ad = Advertisement::find($id); if ($ad->ad_type == 'banner') { @unlink(public_path('assets/img/advertisements/') . $ad->image); } $ad->delete(); } session()->flash('success', __('Advertisements deleted successfully!') ); return response()->json(['status' => 'success'], 200); } } Http/Controllers/Admin/UlinkController.php 0000644 00000004451 15213350435 0014665 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Language; use App\Models\Ulink; use Validator; use Session; class UlinkController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->first(); $lang_id = $lang->id; $data['aulinks'] = Ulink::where('language_id', $lang_id)->get(); $data['lang_id'] = $lang_id; return view('admin.footer.ulink.index', $data); } public function edit($id) { $data['ulink'] = Ulink::findOrFail($id); return view('admin.footer.ulink.edit', $data); } public function store(Request $request) { $rules = [ 'language_id' => 'required', 'name' => 'required|max:255', 'url' => 'required|max:255' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $ulink = new Ulink; $ulink->language_id = $request->language_id; $ulink->name = $request->name; $ulink->url = $request->url; $ulink->save(); Session::flash('success', __('Useful link added successfully!')); return "success"; } public function update(Request $request) { $rules = [ 'name' => 'required|max:255', 'url' => 'required|max:255' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $ulink = Ulink::findOrFail($request->ulink_id); $ulink->name = $request->name; $ulink->url = $request->url; $ulink->save(); Session::flash('success', __('Useful link updated successfully!')); return "success"; } public function delete(Request $request) { $ulink = Ulink::findOrFail($request->ulink_id); $ulink->delete(); Session::flash('success', __('Ulink deleted successfully!')); return back(); } } Http/Controllers/Admin/SitemapController.php 0000644 00000004166 15213350435 0015210 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Spatie\Sitemap\SitemapGenerator; use App\Models\Language; use App\Models\Sitemap; use Illuminate\Support\Facades\Session; class SitemapController extends Controller { public function index(Request $request) { $data['langs'] = Language::all(); $data['sitemaps'] = Sitemap::orderBy('id', 'DESC')->paginate(10); return view('admin.sitemap.index', $data); } public function store(Request $request) { $request->validate([ 'sitemap_url' => 'required|url', ]); $data = new Sitemap(); $input = $request->all(); @mkdir(public_path('assets/front/files'), 0755, true); $filename = 'sitemap' . uniqid() . '.xml'; SitemapGenerator::create($request->sitemap_url)->writeToFile(public_path('assets/front/files/' . $filename)); $input['filename'] = $filename; $input['sitemap_url'] = $request->sitemap_url; $data->fill($input)->save(); Session::flash('success', __('Sitemap Generate Successfully')); return "success"; } public function download(Request $request) { return response()->download(public_path('assets/front/files/' . $request->filename)); } public function update(Request $request) { $data = Sitemap::find($request->id); $input = $request->all(); @unlink(public_path('assets/front/files/' . $data->filename)); $filename = 'sitemap' . uniqid() . '.xml'; SitemapGenerator::create($data->sitemap_url)->writeToFile(public_path('assets/front/files/' . $filename)); $input['filename'] = $filename; $data->update($input); Session::flash('success', __('Feed updated successfully!')); return back(); } public function delete($id) { $sitemap = Sitemap::find($id); @unlink(public_path('assets/front/files/' . $sitemap->filename)); $sitemap->delete(); Session::flash('success', __('Sitemap file deleted successfully!')); return back(); } } Http/Controllers/Admin/UsersVcardsController.php 0000644 00000012512 15213350435 0016044 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Controllers\User\VcardController; use App\Models\User\UserVcard; use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; class UsersVcardsController extends Controller { public function index(Request $request) { $term = $request->term; $vcards = UserVcard::when($term, function ($query, $term) { $query->where('vcard_name', 'like', '%' . $term . '%')->orWhere('email', 'like', '%' . $term . '%'); })->latest()->paginate(10); return view('admin.register_user.vcard.vcards', compact('vcards')); } public function vcardTemplate(Request $request) { if ($request->template == 1) { $prevImg = $request->file('preview_image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'serial_number' => 'required|integer', "template_name" => 'required', 'show_in_home' => 'required|integer', 'preview_image' => [ 'required', function ($attribute, $value, $fail) use ($prevImg, $allowedExts) { if (!empty($prevImg)) { $ext = $prevImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail( __('Only png, jpg, jpeg image is allowed') . "."); } } }, ] ]; $request->validate($rules); } $vcard = UserVcard::where('id', $request->vcard_id)->first(); if ($request->template == 1) { if ($request->hasFile('preview_image')) { @unlink(public_path('assets/front/img/template-previews/vcard/' . $vcard->template_img)); $filename = uniqid() . '.' . $prevImg->getClientOriginalExtension(); $dir = public_path('assets/front/img/template-previews/vcard/'); @mkdir($dir, 0775, true); $request->file('preview_image')->move($dir, $filename); $vcard->template_img = $filename; } $vcard->template_serial_number = $request->serial_number; } else { @unlink(public_path('assets/front/img/template-previews/vcard/' . $vcard->template_img)); $vcard->template_img = NULL; $vcard->template_serial_number = 0; } $vcard->preview_template = $request->template; $vcard->template_name = $request->template_name; $vcard->show_in_home = $request->show_in_home; $vcard->save(); Session::flash('success', __('Status updated successfully') . '!'); return back(); } public function vcardUpdateTemplate(Request $request) { // dd($request->all()); $prevImg = $request->file('preview_image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'serial_number' => 'required|integer', "template_name" => 'required', 'show_in_home' => 'required|integer', 'preview_image' => [ function ($attribute, $value, $fail) use ($prevImg, $allowedExts) { if (!empty($prevImg)) { $ext = $prevImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed') . "."); } } }, ] ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $vcard = UserVcard::where('id', $request->vcard_id)->first(); if ($request->hasFile('preview_image')) { @unlink(public_path('assets/front/img/template-previews/vcard/' . $vcard->template_img)); $filename = uniqid() . '.' . $prevImg->getClientOriginalExtension(); $dir = public_path('assets/front/img/template-previews/vcard/'); @mkdir($dir, 0775, true); $request->file('preview_image')->move($dir, $filename); $vcard->template_img = $filename; } $vcard->template_name = $request->template_name; $vcard->show_in_home = $request->show_in_home; $vcard->template_serial_number = $request->serial_number; $vcard->save(); Session::flash('success', __('Status updated successfully') . '!'); return "success"; } public function changeStatus(Request $request) { $request->validate([ 'status' => 'required|integer' ]); $vcard = UserVcard::find($request->vcard_id); $vcard->status = $request->status; $vcard->save(); Session::flash('success', __('Status updated successfully') . '!'); return back(); } public function destroy(Request $request) { $vcard = new VcardController(); $vcard->deleteVcard($request->vcard_id); Session::flash('success', __('Vcard Deleted Successfully') . '!'); return back(); } } Http/Controllers/Admin/PartnerController.php 0000644 00000013632 15213350435 0015217 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Partner; use App\Models\Language; use Illuminate\Support\Facades\Session; use Validator; class PartnerController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->first(); $lang_id = $lang->id; $data['partners'] = Partner::where('language_id', $lang_id)->orderBy('id', 'DESC')->get(); $data['lang_id'] = $lang_id; return view('admin.home.partner.index', $data); } public function edit($id) { $data['partner'] = Partner::findOrFail($id); return view('admin.home.partner.edit', $data); } public function upload(Request $request) { $img = $request->file('file'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed")); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json(['errors' => $validator->errors(), 'id' => 'partner']); } $filename = time() . '.' . $img->getClientOriginalExtension(); $request->session()->put('partner_image', $filename); $request->file('file')->move(public_path('assets/front/img/partners/'), $filename); return response()->json(['status' => "session_put", "image" => "partner_image", 'filename' => $filename]); } public function store(Request $request) { $rules = [ 'language_id' => 'required', 'image' => 'required', 'url' => 'required|max:255', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $filename = null; if ($request->hasFile('image')) { $directory = public_path("assets/front/img/partners/"); if (!file_exists($directory)) mkdir($directory, 0775, true); $img = $request->file('image'); $filename = time() . '.' . $img->getClientOriginalExtension(); $img->move($directory, $filename); } $partner = new Partner; $partner->language_id = $request->language_id; $partner->url = $request->url; $partner->image = $filename; $partner->serial_number = $request->serial_number; $partner->save(); Session::flash('success', __('Partner added successfully!')); return "success"; } public function uploadUpdate(Request $request, $id) { $img = $request->file('file'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json(['errors' => $validator->errors(), 'id' => 'partner']); } $partner = Partner::findOrFail($id); if ($request->hasFile('file')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->file('file')->move(public_path('assets/front/img/partners/'), $filename); @unlink(public_path('assets/front/img/partners/' . $partner->image)); $partner->image = $filename; $partner->save(); } return response()->json(['status' => "success", "image" => "Partner", 'partner' => $partner]); } public function update(Request $request) { $rules = [ 'url' => 'required|max:255', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $partner = Partner::query()->findOrFail($request->partner_id); if ($request->hasFile('image')) { $img = $request->file('image'); $filename = time() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/partners/'), $filename); @unlink(public_path('assets/front/img/partners/' . $partner->image)); $partner->image = $filename; } $partner->url = $request->url; $partner->serial_number = $request->serial_number; $partner->save(); Session::flash('success', __('Partner updated successfully!')); return "success"; } public function delete(Request $request) { $partner = Partner::findOrFail($request->partner_id); @unlink(public_path('assets/front/img/partners/' . $partner->image)); $partner->delete(); Session::flash('success', __('Partner deleted successfully!')); return back(); } } Http/Controllers/Admin/PageController.php 0000644 00000006746 15213350435 0014470 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Page; use App\Models\Language; use Purifier; use Session; use Validator; class PageController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->first(); $lang_id = $lang->id; $data['apages'] = Page::where('language_id', $lang_id)->orderBy('id', 'DESC')->get(); $data['lang_id'] = $lang_id; return view('admin.page.index', $data); } public function create() { $data['tpages'] = Page::where('language_id', 0)->get(); return view('admin.page.create', $data); } public function store(Request $request) { $slug = make_slug($request->name); $rules = [ 'language_id' => 'required', 'name' => 'required', 'title' => 'required', 'body' => 'required', 'status' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $page = new Page; $page->language_id = $request->language_id; $page->name = $request->name; $page->title = $request->title; $page->slug = $slug; $page->body = Purifier::clean($request->body); $page->status = $request->status; $page->meta_keywords = $request->meta_keywords; $page->meta_description = $request->meta_description; $page->save(); Session::flash('success', __('Page created successfully!')); return "success"; } public function edit($pageID) { $data['page'] = Page::findOrFail($pageID); return view('admin.page.edit', $data); } public function update(Request $request) { $slug = make_slug($request->name); $rules = [ 'name' => 'required', 'title' => 'required', 'body' => 'required', 'status' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $pageID = $request->pageid; $page = Page::findOrFail($pageID); $page->name = $request->name; $page->title = $request->title; $page->slug = $slug; $page->body = Purifier::clean($request->body); $page->status = $request->status; $page->meta_keywords = $request->meta_keywords; $page->meta_description = $request->meta_description; $page->save(); Session::flash('success', __('Page updated successfully!')); return "success"; } public function delete(Request $request) { $pageID = $request->pageid; $page = Page::findOrFail($pageID); $page->delete(); Session::flash('success', __('Page deleted successfully!')); return redirect()->back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $page = Page::findOrFail($id); $page->delete(); } Session::flash('success', __('Pages deleted successfully!')); return "success"; } } Http/Controllers/Admin/DashboardController.php 0000644 00000002642 15213350435 0015472 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use DB; use Auth; use Carbon\Carbon; use App\Models\User; use App\Models\Language; use App\Models\Membership; use App\Models\BasicSetting; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Config; class DashboardController extends Controller { public function __construct() { $abs = BasicSetting::first(); Config::set('app.timezone', $abs->timezone); } public function dashboard() { $data['incomes'] = Membership::select(DB::raw('MONTH(created_at) month'), DB::raw('sum(price) total'))->where('status', 1)->groupBy('month')->whereYear('created_at', date('Y'))->get(); $data['users'] = User::join('memberships', 'users.id', '=', 'memberships.user_id') ->select(DB::raw('MONTH(users.created_at) month'), DB::raw('count(*) total')) ->groupBy('month') ->whereYear('users.created_at', date('Y')) ->where([ ['memberships.status', '=', 1], ['memberships.start_date', '<=', Carbon::now()->format('Y-m-d')], ['memberships.expire_date', '>=', Carbon::now()->format('Y-m-d')] ]) ->get(); $data['defaultLang'] = Language::where('is_default', 1)->first(); return view('admin.dashboard', $data); } public function changeTheme(Request $request) { return redirect()->back()->withCookie(cookie()->forever('admin-theme', $request->theme)); } } Http/Controllers/Admin/IntrosectionController.php 0000644 00000003547 15213350435 0016270 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\BasicSetting as BS; use App\Models\Language; use Purifier; use Validator; use Session; class IntrosectionController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->firstOrFail(); $data['lang_id'] = $lang->id; $data['abs'] = $lang->basic_setting; return view('admin.home.intro-section', $data); } public function update(Request $request, $langid) { // $main_image = $request->file('intro_main_image'); $signature = $request->file('intro_signature'); $video_bg = $request->file('intro_video_image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = []; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $bs = BS::where('language_id', $langid)->firstOrFail(); $input['intro_text'] = Purifier::clean($request->intro_text); $bs->update($input); Session::flash('success', __('data updated successfully!')); return "success"; } public function removeImage(Request $request) { $type = $request->type; $langid = $request->language_id; $bs = BS::where('language_id', $langid)->firstOrFail(); if ($type == "signature") { @unlink(public_path("assets/front/img/" . $bs->intro_signature)); $bs->intro_signature = NULL; $bs->save(); } $request->session()->flash('success', __('Image removed successfully!')); return "success"; } } Http/Controllers/Admin/PopupController.php 0000644 00000011364 15213350435 0014707 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Helpers\UploadFile; use App\Http\Requests\Popup\UpdateRequest; use App\Http\Requests\Popup\StoreRequest; use App\Models\Language; use App\Models\Popup; use Carbon\Carbon; use Illuminate\Http\Request; class PopupController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { //first get the language info from db $language = Language::query()->where('code', '=', $request->language)->firstOrFail(); $information['language'] = $language; $information['popups'] = $language->announcementPopup()->orderByDesc('id')->get(); // also, get all the languages from db $information['langs'] = Language::all(); return view('admin.popup.index', $information); } /** * Show the popup type page to select one of them. * * @return \Illuminate\Http\Response */ public function popupType() { return view('admin.popup.popup-type'); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create($type) { $information['popupType'] = $type; // get all the languages from db $information['languages'] = Language::all(); return view('admin.popup.create', $information); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(StoreRequest $request) { $imageName = UploadFile::store(public_path('assets/img/popups/'), $request->file('image')); Popup::query()->create($request->except('image', 'end_date', 'end_time') + [ 'image' => $imageName, 'end_date' => $request->has('end_date') ? Carbon::parse($request['end_date']) : null, 'end_time' => $request->has('end_time') ? date('h:i', strtotime($request['end_time'])) : null ]); session()->flash('success', __('New popup added successfully!') ); return response()->json(['status' => 'success'], 200); } /** * Update the status of specified resource. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function updateStatus(Request $request, $id) { $popup = Popup::query()->find($id); if ($request->status == 1) { $popup->update(['status' => 1]); session()->flash('success', __('Popup activated successfully!') ); } else { $popup->update(['status' => 0]); session()->flash('success', __('Popup deactivated successfully!') ); } return redirect()->back(); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $popup = Popup::query()->findOrFail($id); return view('admin.popup.edit', compact('popup')); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(UpdateRequest $request, $id) { $popup = Popup::query()->find($id); if ($request->hasFile('image')) { $imageName = UploadFile::update(public_path('assets/img/popups/'), $request->file('image'), $popup->image); } $popup->update($request->except('image', 'end_date', 'end_time') + [ 'image' => $request->hasFile('image') ? $imageName : $popup->image, 'end_date' => $request->has('end_date') ? Carbon::parse($request['end_date']) : null, 'end_time' => $request->has('end_time') ? date('h:i', strtotime($request['end_time'])) : null ]); session()->flash('success', __('Popup updated successfully!') ); return response()->json(['status' => 'success'], 200); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $popup = Popup::query()->find($id); @unlink(public_path('assets/img/popups/') . $popup->image); $popup->delete(); return redirect()->back()->with('success', __('Popup deleted successfully!') ); } /** * Remove the selected or all resources from storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $popup = Popup::query()->find($id); @unlink(public_path('assets/img/popups/') . $popup->image); $popup->delete(); } session()->flash('success', __('Popups deleted successfully!') ); return response()->json(['status' => 'success'], 200); } } Http/Controllers/Admin/TestimonialController.php 0000644 00000015075 15213350435 0016077 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Language; use App\Models\Testimonial; use App\Models\BasicSetting as BS; use App\Models\BasicExtended; use Validator; use Session; class TestimonialController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->firstOrFail(); $data['lang_id'] = $lang->id; $data['abs'] = $lang->basic_setting; $data['abe'] = $lang->basic_extended; $data['testimonials'] = Testimonial::where('language_id', $data['lang_id'])->orderBy('id', 'DESC')->get(); return view('admin.home.testimonial.index', $data); } public function edit($id) { $data['testimonial'] = Testimonial::findOrFail($id); return view('admin.home.testimonial.edit', $data); } public function store(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'language_id' => 'required', 'comment' => 'required', 'name' => 'required|max:50', 'rank' => 'required|max:50', 'rating' => 'required|max:5|integer', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed")); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); if ($request->hasFile('image')) { $main_image = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/testimonials/'), $main_image); $input['image'] = $main_image; } $testimonial = new Testimonial; $testimonial->create($input); Session::flash('success', __('Testimonial added successfully!')); return "success"; } public function update(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'comment' => 'required', 'name' => 'required|max:50', 'rank' => 'required|max:50', 'rating' => 'required|max:5|integer', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $testimonial = Testimonial::findOrFail($request->testimonial_id); if ($request->hasFile('image')) { $main_image = time() . '.' . $img->getClientOriginalExtension(); @unlink(public_path('assets/front/img/testimonials/' . $testimonial->image)); $request->file('image')->move(public_path('assets/front/img/testimonials/'), $main_image); $input['image'] = $main_image; } $testimonial->update($input); Session::flash('success', __('Testimonial updated successfully!')); return "success"; } public function textupdate(Request $request, $langid) { $request->validate([ 'testimonial_section_title' => 'required|max:25' ]); $bs = BS::where('language_id', $langid)->firstOrFail(); $bs->testimonial_title = $request->testimonial_section_title; if ($request->hasFile('testimonial_bg_img')) { $be = BasicExtended::where('language_id', $langid)->firstOrFail(); $filename = time() . '.' . $request->testimonial_bg_img->getClientOriginalExtension(); $request->file('testimonial_bg_img')->move(public_path('assets/front/img/'), $filename); @unlink(public_path('assets/front/img/' . $be->testimonial_bg_img)); $be->testimonial_bg_img = $filename; $be->save(); } $bs->save(); Session::flash('success', __('Text updated successfully!')); return back(); } public function updateImage(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg', 'svg'); $request->validate([ 'iamge' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg, svg image is allowed"); } } }, ], ]); if ($request->hasFile('image')) { $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/testimonials'), $filename); $bss = BS::all(); foreach ($bss as $key => $bs) { @unlink(public_path('assets/front/img/testimonials/' . $bs->favicon)); $bs->testimonial_image = $filename; $bs->save(); } } Session::flash('success', __('Testimonial image update successfully.')); return back(); } public function delete(Request $request) { $testimonial = Testimonial::findOrFail($request->testimonial_id); @unlink(public_path('assets/front/img/testimonials/' . $testimonial->image)); $testimonial->delete(); Session::flash('success', __('Testimonial deleted successfully!')); return back(); } } Http/Controllers/Admin/BcategoryController.php 0000644 00000006662 15213350435 0015530 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Bcategory; use App\Models\Language; use Validator; use Session; class BcategoryController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->first(); $lang_id = $lang->id; $data['bcategorys'] = Bcategory::where('language_id', $lang_id)->orderBy('id', 'DESC')->get(); $data['lang_id'] = $lang_id; return view('admin.blog.bcategory.index', $data); } public function edit($id) { $data['bcategory'] = Bcategory::findOrFail($id); return view('admin.blog.bcategory.edit', $data); } public function store(Request $request) { $rules = [ 'language_id' => 'required', 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $bcategory = new Bcategory; $bcategory->language_id = $request->language_id; $bcategory->name = $request->name; $bcategory->status = $request->status; $bcategory->serial_number = $request->serial_number; $bcategory->save(); Session::flash('success', __('Blog category added successfully!')); return "success"; } public function update(Request $request) { $rules = [ 'name' => 'required|max:255', 'status' => 'required', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $bcategory = Bcategory::findOrFail($request->bcategory_id); $bcategory->name = $request->name; $bcategory->status = $request->status; $bcategory->serial_number = $request->serial_number; $bcategory->save(); Session::flash('success', __('Blog category updated successfully!')); return "success"; } public function delete(Request $request) { $bcategory = Bcategory::findOrFail($request->bcategory_id); if ($bcategory->blogs()->count() > 0) { Session::flash('warning', __('First, delete all the blogs under this category!')); return back(); } $bcategory->delete(); Session::flash('success', __('Blog category deleted successfully!')); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $bcategory = Bcategory::findOrFail($id); if ($bcategory->blogs()->count() > 0) { Session::flash('warning', 'First, delete all the blogs under this category!'); return "success"; } } foreach ($ids as $id) { $bcategory = Bcategory::findOrFail($id); $bcategory->delete(); } Session::flash('success', __('Blog categories deleted successfully!')); return "success"; } } Http/Controllers/Admin/FeatureController.php 0000644 00000010440 15213350435 0015171 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Language; use App\Models\Feature; use Validator; use Session; class FeatureController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->first(); $lang_id = $lang->id; $data['features'] = Feature::where('language_id', $lang_id)->orderBy('id', 'DESC')->get(); $data['lang_id'] = $lang_id; return view('admin.home.feature.index', $data); } public function edit($id) { $data['feature'] = Feature::findOrFail($id); return view('admin.home.feature.edit', $data); } public function store(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ 'language_id' => 'required', // 'icon' => 'required', 'title' => 'required|max:50', 'text' => 'required|max:255', 'serial_number' => 'required|integer', 'image' => [ 'required', function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed")); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $feature = new Feature; // $feature->icon = $request->icon; if ($request->hasFile('image')) { $main_image = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/features/'), $main_image); $feature->image = $main_image; } $feature->language_id = $request->language_id; $feature->title = $request->title; $feature->text = $request->text; $feature->serial_number = $request->serial_number; $feature->save(); Session::flash('success', __('Feature added successfully!')); return "success"; } public function update(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $rules = [ // 'icon' => 'required', 'title' => 'required|max:50', 'text' => 'required|max:255', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail("Only png, jpg, jpeg image is allowed"); } } }, ], ]; $request->validate($rules); $feature = Feature::findOrFail($request->feature_id); // $feature->icon = $request->icon; if ($request->hasFile('image')) { $main_image = time() . '.' . $img->getClientOriginalExtension(); @unlink(public_path('assets/front/img/features/' . $feature->image)); $request->file('image')->move(public_path('assets/front/img/features/'), $main_image); $feature->image = $main_image; } $feature->title = $request->title; $feature->text = $request->text; $feature->serial_number = $request->serial_number; $feature->save(); Session::flash('success', __('Feature updated successfully!')); return back(); } public function delete(Request $request) { $feature = Feature::findOrFail($request->feature_id); @unlink(public_path('assets/front/img/features/' . $feature->image)); $feature->delete(); Session::flash('success', __('Feature deleted successfully!')); return back(); } } Http/Controllers/Admin/ForgetController.php 0000644 00000006262 15213350435 0015033 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Models\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Language; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; use Mail; use Session; class ForgetController extends Controller { public function mailForm() { return view('admin.forget'); } public function sendmail(Request $request) { // check whether the mail exists in database $request->validate([ 'email' => [ 'required', function ($attribute, $value, $fail) { $count = Admin::where('email', $value)->count(); if ($count == 0) { $fail("The email address doesn't exist"); } } ] ]); // change the password with newly created random password $pass = uniqid(); $admin = Admin::where('email', $request->email)->first(); $admin->password = bcrypt($pass); $admin->save(); // send the random (newly created) & username to the mail if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $be = $currentLang->basic_extended; $from = $be->from_mail; $to = $request->email; $subject = "Restore Password & Username"; $username = $admin->username; // Send Mail $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; if ($be->is_smtp == 1) { try { $mail->isSMTP(); $mail->Host = $be->smtp_host; $mail->SMTPAuth = true; $mail->Username = $be->smtp_username; $mail->Password = $be->smtp_password; $mail->SMTPSecure = $be->encryption; $mail->Port = $be->smtp_port; //Recipients $mail->setFrom($from, $be->from_name); $mail->addAddress($to); // Content $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = "<h4>Hello $username,</h4><div><p><strong>Your current username:</strong> $username</p><p><strong>Your new password:</strong>$pass</p></div>"; $mail->send(); } catch (Exception $e) { } } else { try { //Recipients $mail->setFrom($from, $be->from_name); $mail->addAddress($to); // Content $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = "<h4>Hello $username,</h4><div><p><strong>Your current username:</strong> $username</p><p><strong>Your new password:</strong>$pass</p></div>"; $mail->send(); } catch (Exception $e) { } } Session::flash('success', __('New password & current username sent successfully via mail')); return back(); } } Http/Controllers/Admin/RegisterUserController.php 0000644 00000237255 15213350435 0016240 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Carbon\Carbon; use App\Models\User; use App\Models\Package; use App\Models\User\Menu; use App\Models\Membership; use App\Constants\Constant; use App\Models\BasicSetting; use Illuminate\Http\Request; use App\Models\BasicExtended; use App\Models\User\Language; use App\Http\Helpers\Uploader; use App\Models\OfflineGateway; use App\Models\PaymentGateway; use App\Http\Helpers\MegaMailer; use App\Models\User\HomeSection; use App\Models\User\HomePageText; use Illuminate\Support\Facades\DB; use App\Models\User\UserPermission; use App\Http\Controllers\Controller; use App\Models\User\UserShopSetting; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use App\Models\User\UserEmailTemplate; use Illuminate\Support\Facades\Config; use App\Models\User\UserPaymentGeteway; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use App\Http\Helpers\UserPermissionHelper; use App\Models\Language as ModelsLanguage; use App\Models\User\BasicSetting as UserBasicSetting; class RegisterUserController extends Controller { public function __construct() { $abs = BasicSetting::first(); Config::set('app.timezone', $abs->timezone); } public function index(Request $request) { $term = $request->term; $users = User::when($term, function ($query, $term) { $query->where('username', 'like', '%' . $term . '%')->orWhere('email', 'like', '%' . $term . '%'); }) ->orderBy('id', 'DESC') ->paginate(10); $online = PaymentGateway::query()->where('status', 1)->get(); $offline = OfflineGateway::where('status', 1)->get(); $gateways = $online->merge($offline); $packages = Package::query()->where('status', '1')->get(); return view('admin.register_user.index', compact('users', 'gateways', 'packages')); } public function view($id) { $user = User::findOrFail($id); $packages = Package::query()->where('status', '1')->get(); $online = PaymentGateway::query()->where('status', 1)->get(); $offline = OfflineGateway::where('status', 1)->get(); $gateways = $online->merge($offline); return view('admin.register_user.details', compact('user', 'packages', 'gateways')); } public function store(Request $request) { $rules = [ 'username' => 'required|alpha_num|unique:users', 'email' => 'required|email|unique:users', 'password' => 'required|confirmed', 'package_id' => 'required', 'payment_gateway' => 'required', 'online_status' => 'required', ]; $messages = [ 'package_id.required' => 'The package field is required', 'online_status.required' => 'The publicly hidden field is required', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } //dynamic language translate wise menu $deLang = User\Language::firstOrFail(); $deLanguageNames = json_decode($deLang->keywords, true); $menus = '[ {"text":"Home","href":"","icon":"empty","target":"_self","title":"","type":"home"}, {"text":"About","href":"","icon":"empty","target":"_self","title":"","type":"custom","children":[{"text":"Team","href":"","icon":"empty","target":"_self","title":"","type":"team"}, {"text":"Career","href":"","icon":"empty","target":"_self","title":"","type":"career"}, {"text":"FAQ","href":"","icon":"empty","target":"_self","title":"","type":"faq"}]}, {"text":"Services","href":"","icon":"empty","target":"_self","title":"","type":"services"}, {"text":"Portfolios","href":"","icon":"empty","target":"_self","title":"","type":"portfolios"}, {"type":"shop","text":"Shop","href":"","target":"_self"}, {"text":"Blog","href":"","icon":"empty","target":"_self","title":"","type":"blog"}, {"text":"Contact","href":"","icon":"empty","target":"_self","title":"","type":"contact"}]'; $menus = json_decode($menus, true); foreach (array_column($menus, 'text') as $key => $menu) { if ($menu == 'Home' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'About') { $menus[$key]['text'] = array_key_exists('About', $deLanguageNames) ? $deLanguageNames['About'] : 'About'; //if children manus exits if (count($menus[$key]['children']) > 0) { $arrays = $menus[$key]['children']; foreach (array_column($arrays, 'text') as $k => $value) { if ($value == 'Team' && array_key_exists($value, $deLanguageNames)) { $menus[$key]['children'][$k]['text'] = $deLanguageNames[$value]; } if ($value == 'Career' && array_key_exists($value, $deLanguageNames)) { $menus[$key]['children'][$k]['text'] = $deLanguageNames[$value]; } if ($value == 'FAQ' && array_key_exists($value, $deLanguageNames)) { $menus[$key]['children'][$k]['text'] = $deLanguageNames[$value]; } } } //end children manus exits } if ($menu == 'Services' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'Portfolios' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'Shop' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'Blog' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } if ($menu == 'Contact' && array_key_exists($menu, $deLanguageNames)) { $menus[$key]['text'] = $deLanguageNames[$menu]; } } $menus = json_encode($menus); $user = User::where('username', $request['username']); if ($user->count() == 0) { $user = User::create([ 'email' => $request['email'], 'username' => $request['username'], 'password' => bcrypt($request['password']), 'online_status' => $request['online_status'], 'status' => 1, 'email_verified' => 1, ]); UserBasicSetting::create([ 'theme' => 'home_one', 'user_id' => $user->id, 'timezone' => 1, ]); // user shop settings create UserShopSetting::create([ 'user_id' => $user->id, 'is_shop' => 1, 'catalog_mode' => 0, 'item_rating_system' => 1, 'tax' => 0, ]); $homeSection = new HomeSection(); $homeSection->user_id = $user->id; $homeSection->save(); } if ($user) { // $deLang = Language::firstOrFail(); $langCount = Language::where('user_id', $user->id) ->where('is_default', 1) ->count(); $adminLangs = ModelsLanguage::get(); if ($langCount == 0) { $first = true; foreach ($adminLangs as $lang) { $language = Language::create([ 'name' => $lang->name, 'code' => $lang->code, 'is_default' => $first ? 1 : 0, 'dashboard_default' => $first ? 1 : 0, 'rtl' => $lang->rtl, 'user_id' => $user->id, 'keywords' => $lang->customer_keywords, ]); $htext = new HomePageText(); $htext->language_id = $language->id; $htext->user_id = $user->id; $htext->save(); $umenu = new Menu(); $umenu->language_id = $language->id; $umenu->user_id = $user->id; $umenu->menus = $menus; $umenu->save(); $first = false; } } $package = Package::find($request['package_id']); $be = BasicExtended::first(); $bs = BasicSetting::select('website_title')->first(); $transaction_id = UserPermissionHelper::uniqidReal(8); $startDate = Carbon::today()->format('Y-m-d'); if ($package->term === 'monthly') { $endDate = Carbon::today()->addMonth()->format('Y-m-d'); } elseif ($package->term === 'yearly') { $endDate = Carbon::today()->addYear()->format('Y-m-d'); } elseif ($package->term === 'lifetime') { $endDate = Carbon::maxValue()->format('d-m-Y'); } Membership::create([ 'price' => $package->price, 'currency' => $be->base_currency_text ? $be->base_currency_text : 'USD', 'currency_symbol' => $be->base_currency_symbol ? $be->base_currency_symbol : $be->base_currency_text, 'payment_method' => $request['payment_gateway'], 'transaction_id' => $transaction_id ? $transaction_id : 0, 'status' => 1, 'is_trial' => 0, 'trial_days' => 0, 'receipt' => $request['receipt_name'] ? $request['receipt_name'] : null, 'transaction_details' => null, 'settings' => json_encode($be), 'package_id' => $request['package_id'], 'user_id' => $user->id, 'start_date' => Carbon::parse($startDate), 'expire_date' => Carbon::parse($endDate), ]); $package = Package::findOrFail($request['package_id']); $features = json_decode($package->features, true); $features[] = 'Contact'; UserPermission::create([ 'package_id' => $request['package_id'], 'user_id' => $user->id, 'permissions' => json_encode($features), ]); // create payment gateways $payment_keywords = ['flutterwave', 'razorpay', 'paytm', 'paystack', 'instamojo', 'stripe', 'paypal', 'mollie', 'mercadopago', 'authorize.net', 'phonepe']; foreach ($payment_keywords as $key => $value) { UserPaymentGeteway::create([ 'title' => null, 'user_id' => $user->id, 'details' => null, 'keyword' => $value, 'subtitle' => null, 'name' => ucfirst($value), 'type' => 'automatic', 'information' => null, ]); } // create email template $templates = ['email_verification', 'product_order', 'reset_password', 'room_booking', 'payment_received', 'payment_cancelled', 'course_enrolment', 'course_enrolment_approved', 'course_enrolment_rejected', 'donation', 'donation_approved']; foreach ($templates as $key => $val) { UserEmailTemplate::create([ 'user_id' => $user->id, 'email_type' => $val, 'email_subject' => null, 'email_body' => '<p></p>', ]); } $requestData = [ 'start_date' => $startDate, 'expire_date' => $endDate, 'payment_method' => $request['payment_gateway'], ]; $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $file_name = $this->makeInvoice($requestData, 'membership', $user, null, $package->price, $request['payment_gateway'], null, $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); $mailer = new MegaMailer(); $startDate = Carbon::parse($startDate); $endDate = Carbon::parse($endDate); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'package_title' => $package->title, 'package_price' => ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $package->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''), 'activation_date' => $startDate->toFormattedDateString(), 'expire_date' => $endDate->toFormattedDateString(), 'membership_invoice' => $file_name, 'website_title' => $bs->website_title, 'templateType' => 'registration_with_premium_package', 'type' => 'registrationWithPremiumPackage', ]; $mailer->mailFromAdmin($data); } Session::flash('success', __('User added successfully!')); return 'success'; } public function secretLogin(Request $request) { $user = User::where('id', $request->user_id)->first(); if (Auth::guard('web')->login($user, true)) { return redirect()->route('user-dashboard')->withSuccess(__('You have Successfully loggedin')); } return redirect('login')->withSuccess(__('Oppes! You have entered invalid credentials')); } public function userban(Request $request) { $user = User::where('id', $request->user_id)->first(); $user->update([ 'status' => $request->status, ]); Session::flash('success', __('Status update successfully!')); return back(); } public function emailStatus(Request $request) { $user = User::findOrFail($request->user_id); $user->update([ 'email_verified' => $request->email_verified, ]); Session::flash('success', __('Email status updated for'). ' ' . $user->username); return back(); } public function userFeatured(Request $request) { $user = User::where('id', $request->user_id)->first(); $user->featured = $request->featured; $user->save(); Session::flash('success', __('User featured update successfully!')); return back(); } public function changePass($id) { $data['user'] = User::findOrFail($id); return view('admin.register_user.password', $data); } public function updatePassword(Request $request) { $request->validate( [ 'new_password' => 'required', 'confirm_password' => 'required', ], ); $user = User::findOrFail($request->user_id); if ($request->new_password == $request->confirm_password) { $input['password'] = Hash::make($request->new_password); } else { return back()->with('warning', __('Confirm password does not match.')); } $user->update($input); Session::flash('success', __('Password update for'). ' ' . $user->username); return back(); } public function delete(Request $request) { $user = User::findOrFail($request->user_id); $causes = $user->causes()->get(); $causeCategories = $user->causeCategories()->get(); $causesContent = $user->causesContent()->get(); $donationDetails = $user->donationDetails()->get(); DB::table('user_donation_settings') ->where('user_id', $user->id) ->delete(); if (!empty($causes) && count($causes) > 0) { foreach ($causes as $cause) { @unlink(public_path(Constant::WEBSITE_CAUSE_IMAGE . '/' . $cause->image)); $cause->delete(); } } if (!empty($causeCategories) && count($causeCategories) > 0) { foreach ($causeCategories as $cate) { @unlink(public_path(Constant::WEBSITE_CAUSE_CATEGORY_IMAGE . '/' . $cate->image)); $cate->delete(); } } if (!empty($donationDetails) && count($donationDetails) > 0) { foreach ($donationDetails as $donation_detail) { if (!is_null($donation_detail->receipt)) { $directory = public_path(Constant::WEBSITE_DONATION_ATTACHMENT . '/' . $donation_detail->receipt); if (file_exists($directory)) { @unlink($directory); } } if (!is_null($donation_detail->invoice)) { $directory = public_path(Constant::WEBSITE_DONATION_INVOICE . '/' . $donation_detail->invoice); if (file_exists($directory)) { @unlink($directory); } } $donation_detail->delete(); } } if (!empty($causesContent) && count($causesContent) > 0) { foreach ($causesContent as $cont) { $cont->delete(); } } //start course management informnation delete $courses = $user->courses; $instructors = $user->courseInstructtors()->get(); if (!empty($courses) && count($courses) > 0) { foreach ($courses as $course) { // enrollment delete $totalEnrolment = $course->enrolment; foreach ($totalEnrolment as $enrolment) { if (!empty($enrolment->invoice)) { Uploader::remove(Constant::WEBSITE_ENROLLMENT_INVOICE, $enrolment->invoice); } if (!empty($enrolment->attachment)) { Uploader::remove(Constant::WEBSITE_ENROLLMENT_ATTACHMENT, $enrolment->invoice); } $enrolment->delete(); } // get all the course information's of this course $courseInformations = $course ->courseInformation() ->where('user_id', $user->id) ->get(); foreach ($courseInformations as $courseInformation) { // get all the modules of each course-information $modules = $courseInformation->module()->get(); foreach ($modules as $module) { // get all the lessons of each module $lessons = $module->lesson()->get(); foreach ($lessons as $lesson) { // get all the lesson contents of each lesson $lessonContents = $lesson->content()->get(); foreach ($lessonContents as $lessonContent) { // delete lesson content item by checking the 'type' if ($lessonContent->type == 'video') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $lessonContent->video_unique_name); } elseif ($lessonContent->type == 'file') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $lessonContent->file_unique_name); } elseif ($lessonContent->type == 'quiz') { // get all the lesson quizzes of this lesson-content $lessonQuizzes = $lessonContent->quiz()->get(); foreach ($lessonQuizzes as $lessonQuiz) { $lessonQuiz->delete(); } } $lessonContent->delete(); } $lesson->delete(); } $module->delete(); } $courseInformation->delete(); } Uploader::remove(Constant::WEBSITE_COURSE_THUMBNAIL_IMAGE, $course->thumbnail_image); Uploader::remove(Constant::WEBSITE_COURSE_COVER_IMAGE, $course->cover_image); // get all the faqs of this course $courseFaqs = $course->faq()->get(); foreach ($courseFaqs as $courseFaq) { $courseFaq->delete(); } // get all the reviews of this course $reviews = $course->review()->get(); foreach ($reviews as $review) { $review->delete(); } // get all the quiz-scores of this course $quizScores = $course->quizScore()->get(); foreach ($quizScores as $quizScore) { $quizScore->delete(); } // finally, delete the course $course->delete(); } } if (!empty($user->courseCategory()) && $user->courseCategory()->count() > 0) { $user->courseCategory()->delete(); } if (!empty($user->courseCoupon()) && $user->courseCoupon()->count() > 0) { $user->courseCoupon()->delete(); } if (!empty($user->lessonComplete()) && $user->lessonComplete()->count() > 0) { $user->lessonComplete()->delete(); } if (!empty($user->lessonContentComplete()) && $user->lessonContentComplete()->count() > 0) { $user->lessonContentComplete()->delete(); } if (!empty($instructors) && count($instructors) > 0) { foreach ($instructors as $key => $ins) { @unlink(public_path(Constant::WEBSITE_INSTRUCTOR_IMAGE . '/' . $ins->image)); $ins->socialPlatform()->delete(); $ins->delete(); } } //end course management informnation delete // hotel management content delete $rooms = $user->rooms()->get(); $roomBookings = $user->roomBookings()->get(); $roomContents = $user->roomContents(); $roomCategories = $user->roomCategories(); $roomCoupns = $user->roomCoupns(); $roomAmenities = $user->roomAmenities(); $roomReviews = $user->rommReviews(); if (!empty($rooms) && $rooms->count() > 0) { DB::table('user_room_settings') ->where('user_id', $user->id) ->delete(); foreach ($rooms as $room) { if (!is_null($room->slider_imgs)) { $images = json_decode($room->slider_imgs); foreach ($images as $image) { if (file_exists('assets/img/rooms/slider_images/' . $image)) { @unlink('assets/img/rooms/slider_images/' . $image); } } } if (!is_null($room->featured_img) && file_exists('assets/img/rooms/' . $room->featured_img)) { @unlink('assets/img/rooms/' . $room->featured_img); } $room->delete(); } } if ($roomBookings->count() > 0) { foreach ($roomBookings as $roomBooking) { @unlink(public_path('assets/img/attachments/rooms/') . $roomBooking->attachment); @unlink(public_path('assets/invoices/rooms/') . $roomBooking->invoice); $roomBooking->delete(); } } if (!empty($roomContents) && $roomContents->count() > 0) { $roomContents->delete(); } if (!empty($roomCategories) && $roomCategories->count() > 0) { $roomCategories->delete(); } if (!empty($roomCoupns) && $roomCoupns->count() > 0) { $roomCoupns->delete(); } if (!empty($roomAmenities) && $roomAmenities->count() > 0) { $roomAmenities->delete(); } if (!empty($roomReviews) && $roomReviews->count() > 0) { $roomReviews->delete(); } if (!empty($user->testimonials()) && $user->testimonials()->count() > 0) { $testimonials = $user->testimonials()->get(); foreach ($testimonials as $key => $tstm) { @unlink(public_path('assets/front/img/user/testimonials/' . $tstm->image)); $tstm->delete(); } } if (!empty($user->social_media()) && $user->social_media()->count() > 0) { $user->social_media()->delete(); } if (!empty($user->templates()) && $user->templates()->count() > 0) { $user->templates()->delete(); } if (!empty($user->skills()) && $user->skills()->count() > 0) { $user->skills()->delete(); } if (!empty($user->services()) && $user->services()->count() > 0) { $services = $user->services()->get(); foreach ($services as $key => $service) { @unlink('assets/front/img/user/services/' . $service->image); $service->delete(); } } if (!empty($user->subscribers()) && $user->subscribers()->count() > 0) { $user->subscribers()->delete(); } if (!empty($user->seos()) && $user->seos()->count() > 0) { $user->seos()->delete(); } if (!empty($user->portfolios()) && $user->portfolios()->count() > 0) { $portfolios = $user->portfolios()->get(); foreach ($portfolios as $key => $portfolio) { @unlink(public_path('assets/front/img/user/portfolios/' . $portfolio->image)); if ($portfolio->portfolio_images()->count() > 0) { foreach ($portfolio->portfolio_images as $key => $pi) { @unlink(public_path('assets/front/img/user/portfolios/' . $pi->image)); $pi->delete(); } } $portfolio->delete(); } } if (!empty($user->portfolioCategories()) && $user->portfolioCategories()->count() > 0) { $user->portfolioCategories()->delete(); } if (!empty($user->permission()) && $user->permission()->count() > 0) { $user->permission()->delete(); } if (!empty($user->languages()) && $user->languages()->count() > 0) { $user->languages()->delete(); } if (!empty($user->home_page_texts()) && $user->home_page_texts()->count() > 0) { $homeTexts = $user->home_page_texts()->get(); foreach ($homeTexts as $key => $homeText) { @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_video_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->testimonial_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->video_section_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->why_choose_us_section_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->why_choose_us_section_video_image)); @unlink(public_path('assets/front/img/work_process/' . $homeText->work_process_section_img)); @unlink(public_path('assets/front/img/work_process/' . $homeText->work_process_section_video_img)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->quote_section_image)); $homeText->delete(); } } if (!empty($user->home_section()) && $user->home_section()->count() > 0) { $user->home_section()->delete(); } if (!empty($user->jobs()) && $user->jobs()->count() > 0) { $user->jobs()->delete(); } if (!empty($user->jcategories()) && $user->jcategories()->count() > 0) { $user->jcategories()->delete(); } if (!empty($user->teams()) && $user->teams()->count() > 0) { $teams = $user->teams()->get(); foreach ($teams as $key => $team) { @unlink(public_path('/assets/front/img/user/team/' . $team->image)); $team->delete(); } } if (!empty($user->permissions()) && $user->permissions()->count() > 0) { $user->permissions()->delete(); } if (!empty($user->qr_codes()) && $user->qr_codes()->count() > 0) { $qr_codes = $user->qr_codes()->get(); foreach ($qr_codes as $key => $qr) { @unlink(public_path('assets/front/img/user/qr/' . $qr->image)); $qr->delete(); } } if (!empty($user->quotes()) && $user->quotes()->count() > 0) { $user->quotes()->delete(); } if (!empty($user->quote_inputs()) && $user->quote_inputs()->count() > 0) { $quote_inputs = $user->quote_inputs()->get(); foreach ($quote_inputs as $key => $input) { if ($input->quote_input_options()->count() > 0) { $input->quote_input_options()->delete(); } $input->delete(); } } if (!empty($user->services()) && $user->services()->count() > 0) { $services = $user->services()->get(); foreach ($services as $key => $service) { @unlink(public_path('assets/front/img/user/service/' . $service->image)); $service->delete(); } } if (!empty($user->vcards()) && $user->vcards()->count() > 0) { $vcards = $user->vcards()->get(); foreach ($vcards as $key => $vcard) { @unlink(public_path('assets/front/img/user/vcard/' . $vcard->profile_image)); @unlink(public_path('assets/front/img/user/vcard/' . $vcard->cover_image)); if ($vcard->user_vcard_projects()->count() > 0) { foreach ($vcard->user_vcard_projects as $key => $project) { @unlink(public_path('assets/front/img/user/projects/' . $project->image)); $project->delete(); } } if ($vcard->user_vcard_services()->count() > 0) { foreach ($vcard->user_vcard_services as $key => $service) { @unlink(public_path('assets/front/img/user/services/' . $service->image)); $service->delete(); } } if ($vcard->user_vcard_testimonials()->count() > 0) { foreach ($vcard->user_vcard_testimonials as $key => $testimonial) { @unlink(public_path('assets/front/img/user/testimonials/' . $testimonial->image)); $testimonial->delete(); } } $vcard->delete(); } } if (!empty($user->processes()) && $user->processes()->count() > 0) { $user->processes()->delete(); } if (!empty($user->blog_categories()) && $user->blog_categories()->count() > 0) { $user->blog_categories()->delete(); } if (!empty($user->blogs()) && $user->blogs()->count() > 0) { $blogs = $user->blogs()->get(); foreach ($blogs as $key => $blog) { @unlink(public_path('assets/front/img/user/blogs/' . $blog->image)); $blog->delete(); } } if (!empty($user->basic_setting()) && $user->basic_setting()->count() > 0) { $bs = $user->basic_setting; @unlink(public_path('assets/front/img/user/' . $bs->breadcrumb)); @unlink(public_path('assets/front/img/user/' . $bs->logo)); @unlink(public_path('assets/front/img/user/' . $bs->preloader)); @unlink(public_path('assets/front/img/user/' . $bs->favicon)); @unlink(public_path('assets/front/img/user/qr/' . $bs->qr_image)); @unlink(public_path('assets/front/img/user/qr/' . $bs->qr_inserted_image)); $bs->delete(); } if (!empty($user->memberships()) && $user->memberships()->count() > 0) { foreach ($user->memberships as $key => $membership) { @unlink(public_path('assets/front/img/membership/receipt/' . $membership->receipt)); $membership->delete(); } } if (!empty($user->brands()) && $user->brands()->count() > 0) { $brands = $user->brands()->get(); foreach ($brands as $key => $brand) { @unlink(public_path('assets/front/img/user/brands/' . $brand->brand_img)); $brand->delete(); } } if (!empty($user->user_contact()) && $user->user_contact()->count() > 0) { $contact = $user->user_contact; @unlink(public_path('assets/front/img/user/' . $contact->contact_form_image)); $contact->delete(); } if (!empty($user->faqs()) && $user->faqs()->count() > 0) { $user->faqs()->delete(); } if (!empty($user->footer_quick_links()) && $user->footer_quick_links()->count() > 0) { $user->footer_quick_links()->delete(); } if (!empty($user->footer_texts()) && $user->footer_texts()->count() > 0) { $user->footer_texts()->delete(); } if (!empty($user->menus()) && $user->menus()->count() > 0) { $user->menus()->delete(); } if (!empty($user->pages()) && $user->pages()->count() > 0) { $user->pages()->delete(); } if (!empty($user->hero_sliders()) && $user->hero_sliders()->count() > 0) { $sliders = $user->hero_sliders()->get(); foreach ($sliders as $key => $slider) { @unlink(public_path('assets/front/img/hero_slider/' . $slider->img)); $slider->delete(); } } if (!empty($user->hero_static()) && $user->hero_static()->count() > 0) { $static = $user->hero_static; @unlink(public_path('assets/front/img/hero_static/' . $static->img)); $static->delete(); } if (!empty($user->customers()) && $user->customers()->count() > 0) { $customers = $user->customers()->get(); foreach ($customers as $key => $customer) { @unlink(public_path('assets/admin/img/propics/' . $customer->image)); $customer->delete(); } } if (!empty($user->user_features()) && $user->user_features()->count() > 0) { $user_features = $user->user_features()->get(); foreach ($user_features as $key => $feat) { @unlink(public_path('assets/front/img/user/feature/' . $feat->icon)); $feat->delete(); } } if (!empty($user->user_items()) && $user->user_items()->count() > 0) { $user_items = $user->user_items()->get(); foreach ($user_items as $key => $item) { @unlink(public_path('assets/front/img/user/items/thumbnail/' . $item->thumbnail)); foreach ($item->sliders as $key => $image) { @unlink(public_path('assets/front/img/user/items/slider-images/' . $image->image)); $image->delete(); } $item->itemContents()->delete(); $item->delete(); } } if (!empty($user->user_item_categories()) && $user->user_item_categories()->count() > 0) { $user_item_categories = $user->user_item_categories()->get(); foreach ($user_item_categories as $key => $category) { @unlink(public_path('assets/front/img/user/items/categories/' . $category->image)); $category->subcategories()->delete(); } } if (!empty($user->user_offer_banners()) && $user->user_offer_banners()->count() > 0) { $user_offer_banners = $user->user_offer_banners()->get(); foreach ($user_offer_banners as $key => $banner) { @unlink(public_path('assets/front/img/user/offers/' . $banner->image)); } } if (!empty($user->user_coupons()) && $user->user_coupons()->count() > 0) { $user->user_coupons()->delete(); } if (!empty($user->user_item_subcategories()) && $user->user_item_subcategories()->count() > 0) { $user->user_item_subcategories()->delete(); } if (!empty($user->user_offline_gateways()) && $user->user_offline_gateways()->count() > 0) { $user->user_offline_gateways()->delete(); } if (!empty($user->user_orders()) && $user->user_orders()->count() > 0) { $user->user_orders()->delete(); } if (!empty($user->user_payment_gateways()) && $user->user_payment_gateways()->count() > 0) { $user->user_payment_gateways()->delete(); } if (!empty($user->user_shipping_charges()) && $user->user_shipping_charges()->count() > 0) { $user->user_shipping_charges()->delete(); } if (!empty($user->user_shop_settings) && $user->user_shop_settings->count() > 0) { $user->user_shop_settings->delete(); } // assets/front/invoices/', 0775, true @unlink(public_path('assets/front/img/user/' . $user->photo)); $user->delete(); Session::flash('success', __('User deleted successfully!')); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $user = User::findOrFail($id); $causes = $user->causes()->get(); $causeCategories = $user->causeCategories()->get(); $causesContent = $user->causesContent()->get(); $donationDetails = $user->donationDetails()->get(); DB::table('user_donation_settings') ->where('user_id', $user->id) ->delete(); if (count($causes) > 0) { foreach ($causes as $cause) { @unlink(public_path(Constant::WEBSITE_CAUSE_IMAGE . '/' . $cause->image)); $cause->delete(); } } if (count($causeCategories) > 0) { foreach ($causeCategories as $cate) { @unlink(public_path(Constant::WEBSITE_CAUSE_CATEGORY_IMAGE . '/' . $cate->image)); $cate->delete(); } } if (count($donationDetails) > 0) { foreach ($donationDetails as $donation_detail) { if (!is_null($donation_detail->receipt)) { $directory = public_path(Constant::WEBSITE_DONATION_ATTACHMENT . '/' . $donation_detail->receipt); if (file_exists($directory)) { @unlink($directory); } } if (!is_null($donation_detail->invoice)) { $directory = public_path(Constant::WEBSITE_DONATION_INVOICE . '/' . $donation_detail->invoice); if (file_exists($directory)) { @unlink($directory); } } $donation_detail->delete(); } } if (count($causesContent) > 0) { foreach ($causesContent as $cont) { $cont->delete(); } } //start course management informnation delete $courses = $user->courses; $instructors = $user->courseInstructtors()->get(); if (count($courses) > 0) { foreach ($courses as $course) { // enrollment delete $totalEnrolment = $course->enrolment; foreach ($totalEnrolment as $enrolment) { if (!empty($enrolment->invoice)) { Uploader::remove(Constant::WEBSITE_ENROLLMENT_INVOICE, $enrolment->invoice); } if (!empty($enrolment->attachment)) { Uploader::remove(Constant::WEBSITE_ENROLLMENT_ATTACHMENT, $enrolment->invoice); } $enrolment->delete(); } // get all the course information's of this course $courseInformations = $course ->courseInformation() ->where('user_id', $user->id) ->get(); foreach ($courseInformations as $courseInformation) { // get all the modules of each course-information $modules = $courseInformation->module()->get(); foreach ($modules as $module) { // get all the lessons of each module $lessons = $module->lesson()->get(); foreach ($lessons as $lesson) { // get all the lesson contents of each lesson $lessonContents = $lesson->content()->get(); foreach ($lessonContents as $lessonContent) { // delete lesson content item by checking the 'type' if ($lessonContent->type == 'video') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_VIDEO, $lessonContent->video_unique_name); } elseif ($lessonContent->type == 'file') { Uploader::remove(Constant::WEBSITE_LESSON_CONTENT_FILE, $lessonContent->file_unique_name); } elseif ($lessonContent->type == 'quiz') { // get all the lesson quizzes of this lesson-content $lessonQuizzes = $lessonContent->quiz()->get(); foreach ($lessonQuizzes as $lessonQuiz) { $lessonQuiz->delete(); } } $lessonContent->delete(); } $lesson->delete(); } $module->delete(); } $courseInformation->delete(); } Uploader::remove(Constant::WEBSITE_COURSE_THUMBNAIL_IMAGE, $course->thumbnail_image); Uploader::remove(Constant::WEBSITE_COURSE_COVER_IMAGE, $course->cover_image); // get all the faqs of this course $courseFaqs = $course->faq()->get(); foreach ($courseFaqs as $courseFaq) { $courseFaq->delete(); } // get all the reviews of this course $reviews = $course->review()->get(); foreach ($reviews as $review) { $review->delete(); } // get all the quiz-scores of this course $quizScores = $course->quizScore()->get(); foreach ($quizScores as $quizScore) { $quizScore->delete(); } // finally, delete the course $course->delete(); } } if ($user->courseCategory()->count() > 0) { $user->courseCategory()->delete(); } if ($user->courseCoupon()->count() > 0) { $user->courseCoupon()->delete(); } if ($user->lessonComplete()->count() > 0) { $user->lessonComplete()->delete(); } if ($user->lessonContentComplete()->count() > 0) { $user->lessonContentComplete()->delete(); } if (count($instructors) > 0) { foreach ($instructors as $key => $ins) { @unlink(public_path(Constant::WEBSITE_INSTRUCTOR_IMAGE . '/' . $ins->image)); $ins->socialPlatform()->delete(); $ins->delete(); } } //end course management informnation delete // hotel management content delete $rooms = $user->rooms()->get(); $roomBookings = $user->roomBookings()->get(); $roomContents = $user->roomContents(); $roomCategories = $user->roomCategories(); $roomCoupns = $user->roomCoupns(); $roomAmenities = $user->roomAmenities(); $roomReviews = $user->rommReviews(); if ($rooms->count() > 0) { DB::table('user_room_settings') ->where('user_id', $user->id) ->delete(); foreach ($rooms as $room) { if (!is_null($room->slider_imgs)) { $images = json_decode($room->slider_imgs); foreach ($images as $image) { if (file_exists('assets/img/rooms/slider_images/' . $image)) { @unlink('assets/img/rooms/slider_images/' . $image); } } } if (!is_null($room->featured_img) && file_exists('assets/img/rooms/' . $room->featured_img)) { @unlink('assets/img/rooms/' . $room->featured_img); } $room->delete(); } } if ($roomBookings->count() > 0) { foreach ($roomBookings as $roomBooking) { @unlink(public_path('assets/img/attachments/rooms/') . $roomBooking->attachment); @unlink(public_path('assets/invoices/rooms/') . $roomBooking->invoice); $roomBooking->delete(); } } if ($roomContents->count() > 0) { $roomContents->delete(); } if ($roomCategories->count() > 0) { $roomCategories->delete(); } if ($roomCoupns->count() > 0) { $roomCoupns->delete(); } if ($roomAmenities->count() > 0) { $roomAmenities->delete(); } if ($roomReviews->count() > 0) { $roomReviews->delete(); } if ($user->testimonials()->count() > 0) { $testimonials = $user->testimonials()->get(); foreach ($testimonials as $key => $tstm) { @unlink(public_path('assets/front/img/user/testimonials/' . $tstm->image)); $tstm->delete(); } } if ($user->social_media()->count() > 0) { $user->social_media()->delete(); } if ($user->skills()->count() > 0) { $user->skills()->delete(); } if ($user->services()->count() > 0) { $services = $user->services()->get(); foreach ($services as $key => $service) { @unlink(public_path('assets/front/img/user/services/' . $service->image)); $service->delete(); } } if ($user->subscribers()->count() > 0) { $user->subscribers()->delete(); } if ($user->seos()->count() > 0) { $user->seos()->delete(); } if ($user->portfolios()->count() > 0) { $portfolios = $user->portfolios()->get(); foreach ($portfolios as $key => $portfolio) { @unlink(public_path('assets/front/img/user/portfolios/' . $portfolio->image)); if ($portfolio->portfolio_images()->count() > 0) { foreach ($portfolio->portfolio_images as $key => $pi) { @unlink(public_path('assets/front/img/user/portfolios/' . $pi->image)); $pi->delete(); } } $portfolio->delete(); } } if ($user->portfolioCategories()->count() > 0) { $user->portfolioCategories()->delete(); } if ($user->permission()->count() > 0) { $user->permission()->delete(); } if ($user->languages()->count() > 0) { $user->languages()->delete(); } if ($user->home_page_texts()->count() > 0) { $homeTexts = $user->home_page_texts()->get(); foreach ($homeTexts as $key => $homeText) { @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->about_video_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->testimonial_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->video_section_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->why_choose_us_section_image)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->why_choose_us_section_video_image)); @unlink(public_path('assets/front/img/work_process/' . $homeText->work_process_section_img)); @unlink(public_path('assets/front/img/work_process/' . $homeText->work_process_section_video_img)); @unlink(public_path('assets/front/img/user/home_settings/' . $homeText->quote_section_image)); $homeText->delete(); } } if ($user->home_section()->count() > 0) { $user->home_section()->delete(); } if ($user->jobs()->count() > 0) { $user->jobs()->delete(); } if ($user->jcategories()->count() > 0) { $user->jcategories()->delete(); } if ($user->teams()->count() > 0) { $teams = $user->teams()->get(); foreach ($teams as $key => $team) { @unlink(public_path('/assets/front/img/user/team/' . $team->image)); $team->delete(); } } if ($user->permissions()->count() > 0) { $user->permissions()->delete(); } if ($user->qr_codes()->count() > 0) { $qr_codes = $user->qr_codes()->get(); foreach ($qr_codes as $key => $qr) { @unlink(public_path('assets/front/img/user/qr/' . $qr->image)); $qr->delete(); } } if ($user->quotes()->count() > 0) { $user->quotes()->delete(); } if ($user->quote_inputs()->count() > 0) { $quote_inputs = $user->quote_inputs()->get(); foreach ($quote_inputs as $key => $input) { if ($input->quote_input_options()->count() > 0) { $input->quote_input_options()->delete(); } $input->delete(); } } if ($user->services()->count() > 0) { $services = $user->services()->get(); foreach ($services as $key => $service) { @unlink(public_path('assets/front/img/user/service/' . $service->image)); $service->delete(); } } if ($user->vcards()->count() > 0) { $vcards = $user->vcards()->get(); foreach ($vcards as $key => $vcard) { @unlink(public_path('assets/front/img/user/vcard/' . $vcard->profile_image)); @unlink(public_path('assets/front/img/user/vcard/' . $vcard->cover_image)); if ($vcard->user_vcard_projects()->count() > 0) { foreach ($vcard->user_vcard_projects as $key => $project) { @unlink(public_path('assets/front/img/user/projects/' . $project->image)); $project->delete(); } } if ($vcard->user_vcard_services()->count() > 0) { foreach ($vcard->user_vcard_services as $key => $service) { @unlink(public_path('assets/front/img/user/services/' . $service->image)); $service->delete(); } } if ($vcard->user_vcard_testimonials()->count() > 0) { foreach ($vcard->user_vcard_testimonials as $key => $testimonial) { @unlink(public_path('assets/front/img/user/testimonials/' . $testimonial->image)); $testimonial->delete(); } } $vcard->delete(); } } if ($user->processes()->count() > 0) { $user->processes()->delete(); } if ($user->blog_categories()->count() > 0) { $user->blog_categories()->delete(); } if ($user->blogs()->count() > 0) { $blogs = $user->blogs()->get(); foreach ($blogs as $key => $blog) { @unlink(public_path('assets/front/img/user/blogs/' . $blog->image)); $blog->delete(); } } if ($user->basic_setting()->count() > 0) { $bs = $user->basic_setting; @unlink(public_path('assets/front/img/user/' . $bs->breadcrumb)); @unlink(public_path('assets/front/img/user/' . $bs->logo)); @unlink(public_path('assets/front/img/user/' . $bs->preloader)); @unlink(public_path('assets/front/img/user/' . $bs->favicon)); @unlink(public_path('assets/front/img/user/qr/' . $bs->qr_image)); @unlink(public_path('assets/front/img/user/qr/' . $bs->qr_inserted_image)); $bs->delete(); } if ($user->memberships()->count() > 0) { foreach ($user->memberships as $key => $membership) { @unlink(public_path('assets/front/img/membership/receipt/' . $membership->receipt)); $membership->delete(); } } if ($user->brands()->count() > 0) { $brands = $user->brands()->get(); foreach ($brands as $key => $brand) { @unlink(public_path('assets/front/img/user/brands/' . $brand->brand_img)); $brand->delete(); } } if ($user->user_contact()->count() > 0) { $contact = $user->user_contact; @unlink(public_path('assets/front/img/user/' . $contact->contact_form_image)); $contact->delete(); } if ($user->faqs()->count() > 0) { $user->faqs()->delete(); } if ($user->footer_quick_links()->count() > 0) { $user->footer_quick_links()->delete(); } if ($user->footer_texts()->count() > 0) { $user->footer_texts()->delete(); } if ($user->menus()->count() > 0) { $user->menus()->delete(); } if ($user->pages()->count() > 0) { $user->pages()->delete(); } if ($user->hero_sliders()->count() > 0) { $sliders = $user->hero_sliders()->get(); foreach ($sliders as $key => $slider) { @unlink(public_path('assets/front/img/hero_slider/' . $slider->img)); $slider->delete(); } } if ($user->hero_static()->count() > 0) { $static = $user->hero_static; @unlink(public_path('assets/front/img/hero_static/' . $static->img)); $static->delete(); } if ($user->customers()->count() > 0) { $customers = $user->customers()->get(); foreach ($customers as $key => $customer) { @unlink(public_path('assets/admin/img/propics/' . $customer->image)); $customer->delete(); } } if ($user->user_features()->count() > 0) { $user_features = $user->user_features()->get(); foreach ($user_features as $key => $feat) { @unlink(public_path('assets/front/img/user/feature/' . $feat->icon)); $feat->delete(); } } if ($user->user_items()->count() > 0) { $user_items = $user->user_items()->get(); foreach ($user_items as $key => $item) { @unlink(public_path('assets/front/img/user/items/thumbnail/' . $item->thumbnail)); foreach ($item->sliders as $key => $image) { @unlink(public_path('assets/front/img/user/items/slider-images/' . $image->image)); $image->delete(); } $item->itemContents()->delete(); $item->delete(); } } if ($user->user_item_categories()->count() > 0) { $user_item_categories = $user->user_item_categories()->get(); foreach ($user_item_categories as $key => $category) { @unlink(public_path('assets/front/img/user/items/categories/' . $category->image)); $category->subcategories()->delete(); } } if ($user->user_offer_banners()->count() > 0) { $user_offer_banners = $user->user_offer_banners()->get(); foreach ($user_offer_banners as $key => $banner) { @unlink(public_path('assets/front/img/user/offers/' . $banner->image)); } } if ($user->user_coupons()->count() > 0) { $user->user_coupons()->delete(); } if ($user->user_item_subcategories()->count() > 0) { $user->user_item_subcategories()->delete(); } if ($user->user_offline_gateways()->count() > 0) { $user->user_offline_gateways()->delete(); } if ($user->user_orders()->count() > 0) { $user->user_orders()->delete(); } if ($user->user_payment_gateways()->count() > 0) { $user->user_payment_gateways()->delete(); } if ($user->user_shipping_charges()->count() > 0) { $user->user_shipping_charges()->delete(); } if ($user->user_shop_settings) { $user->user_shop_settings->delete(); } @unlink(public_path('assets/front/img/user/' . $user->photo)); $user->delete(); } Session::flash('success', __('Users deleted successfully!')); return 'success'; } public function removeCurrPackage(Request $request) { $userId = $request->user_id; $user = User::findOrFail($userId); $currMembership = UserPermissionHelper::currMembOrPending($userId); $currPackage = Package::select('title')->findOrFail($currMembership->package_id); $nextMembership = UserPermissionHelper::nextMembership($userId); $be = BasicExtended::first(); $bs = BasicSetting::select('website_title')->first(); $today = Carbon::now(); // just expire the current package $currMembership->expire_date = $today->subDay(); $currMembership->modified = 1; if ($currMembership->status == 0) { $currMembership->status = 2; } $currMembership->save(); // if next package exists if (!empty($nextMembership)) { $nextPackage = Package::find($nextMembership->package_id); $nextMembership->start_date = Carbon::parse(Carbon::today()->format('d-m-Y')); if ($nextPackage->term == 'monthly') { $nextMembership->expire_date = Carbon::parse(Carbon::today()->addMonth()->format('d-m-Y')); } elseif ($nextPackage->term == 'yearly') { $nextMembership->expire_date = Carbon::parse(Carbon::today()->addYear()->format('d-m-Y')); } elseif ($nextPackage->term == 'lifetime') { $nextMembership->expire_date = Carbon::parse(Carbon::maxValue()->format('d-m-Y')); } $nextMembership->save(); } $this->sendMail(null, null, $request->payment_method, $user, $bs, $be, 'admin_removed_current_package', null, $currPackage->title); Session::flash('success', __('Current Package removed successfully!')); return back(); } public function sendMail($memb, $package, $paymentMethod, $user, $bs, $be, $mailType, $replacedPackage = null, $removedPackage = null) { if ($mailType != 'admin_removed_current_package' && $mailType != 'admin_removed_next_package') { $transaction_id = UserPermissionHelper::uniqidReal(8); $activation = $memb->start_date; $expire = $memb->expire_date; $info['start_date'] = $activation->toFormattedDateString(); $info['expire_date'] = $expire->toFormattedDateString(); $info['payment_method'] = $paymentMethod; $lastMemb = $user->memberships()->orderBy('id', 'DESC')->first(); $file_name = $this->makeInvoice($info, 'membership', $user, null, $package->price, 'Stripe', $user->phone, $be->base_currency_symbol_position, $be->base_currency_symbol, $be->base_currency_text, $transaction_id, $package->title, $lastMemb); } $mailer = new MegaMailer(); $data = [ 'toMail' => $user->email, 'toName' => $user->fname, 'username' => $user->username, 'website_title' => $bs->website_title, 'templateType' => $mailType, ]; if ($mailType != 'admin_removed_current_package' && $mailType != 'admin_removed_next_package') { $data['package_title'] = $package->title; $data['package_price'] = ($be->base_currency_text_position == 'left' ? $be->base_currency_text . ' ' : '') . $package->price . ($be->base_currency_text_position == 'right' ? ' ' . $be->base_currency_text : ''); $data['activation_date'] = $activation->toFormattedDateString(); $data['expire_date'] = Carbon::parse($expire->toFormattedDateString())->format('Y') == '9999' ? 'Lifetime' : $expire->toFormattedDateString(); $data['membership_invoice'] = $file_name; } if ($mailType != 'admin_removed_current_package' || $mailType != 'admin_removed_next_package') { $data['removed_package_title'] = $removedPackage; } if (!empty($replacedPackage)) { $data['replaced_package'] = $replacedPackage; } $mailer->mailFromAdmin($data); } public function changeCurrPackage(Request $request) { $userId = $request->user_id; $user = User::findOrFail($userId); $currMembership = UserPermissionHelper::currMembOrPending($userId); $nextMembership = UserPermissionHelper::nextMembership($userId); $be = BasicExtended::first(); $bs = BasicSetting::select('website_title')->first(); $selectedPackage = Package::find($request->package_id); // if the user has a next package to activate & selected package is 'lifetime' package if (!empty($nextMembership) && $selectedPackage->term == 'lifetime') { Session::flash('membership_warning', __('To add a Lifetime package as Current Package, You have to remove the next package')); return back(); } // expire the current package $currMembership->expire_date = Carbon::parse(Carbon::now()->subDay()->format('d-m-Y')); $currMembership->modified = 1; if ($currMembership->status == 0) { $currMembership->status = 2; } $currMembership->save(); // calculate expire date for selected package if ($selectedPackage->term == 'monthly') { $exDate = Carbon::now()->addMonth()->format('d-m-Y'); } elseif ($selectedPackage->term == 'yearly') { $exDate = Carbon::now()->addYear()->format('d-m-Y'); } elseif ($selectedPackage->term == 'lifetime') { $exDate = Carbon::maxValue()->format('d-m-Y'); } // store a new membership for selected package $selectedMemb = Membership::create([ 'price' => $selectedPackage->price, 'currency' => $be->base_currency_text, 'currency_symbol' => $be->base_currency_symbol, 'payment_method' => $request->payment_method, 'transaction_id' => uniqid(), 'status' => 1, 'receipt' => null, 'transaction_details' => null, 'settings' => json_encode($be), 'package_id' => $selectedPackage->id, 'user_id' => $userId, 'start_date' => Carbon::parse(Carbon::now()->format('d-m-Y')), 'expire_date' => Carbon::parse($exDate), 'is_trial' => 0, 'trial_days' => 0, ]); // if the user has a next package to activate & selected package is not 'lifetime' package if (!empty($nextMembership) && $selectedPackage->term != 'lifetime') { $nextPackage = Package::find($nextMembership->package_id); // calculate & store next membership's start_date $nextMembership->start_date = Carbon::parse(Carbon::parse($exDate)->addDay()->format('d-m-Y')); // calculate & store expire date for next membership if ($nextPackage->term == 'monthly') { $exDate = Carbon::parse( Carbon::parse(Carbon::parse($exDate)->addDay()->format('d-m-Y')) ->addMonth() ->format('d-m-Y'), ); } elseif ($nextPackage->term == 'yearly') { $exDate = Carbon::parse( Carbon::parse(Carbon::parse($exDate)->addDay()->format('d-m-Y')) ->addYear() ->format('d-m-Y'), ); } else { $exDate = Carbon::parse(Carbon::maxValue()->format('d-m-Y')); } $nextMembership->expire_date = $exDate; $nextMembership->save(); } $currentPackage = Package::select('title')->findOrFail($currMembership->package_id); $this->sendMail($selectedMemb, $selectedPackage, $request->payment_method, $user, $bs, $be, 'admin_changed_current_package', $currentPackage->title); Session::flash('success', __('Current Package changed successfully!')); return back(); } public function addCurrPackage(Request $request) { $userId = $request->user_id; $user = User::findOrFail($userId); $be = BasicExtended::first(); $bs = BasicSetting::select('website_title')->first(); $selectedPackage = Package::find($request->package_id); // calculate expire date for selected package if ($selectedPackage->term == 'monthly') { $exDate = Carbon::now()->addMonth()->format('d-m-Y'); } elseif ($selectedPackage->term == 'yearly') { $exDate = Carbon::now()->addYear()->format('d-m-Y'); } elseif ($selectedPackage->term == 'lifetime') { $exDate = Carbon::maxValue()->format('d-m-Y'); } // store a new membership for selected package $selectedMemb = Membership::create([ 'price' => $selectedPackage->price, 'currency' => $be->base_currency_text, 'currency_symbol' => $be->base_currency_symbol, 'payment_method' => $request->payment_method, 'transaction_id' => uniqid(), 'status' => 1, 'receipt' => null, 'transaction_details' => null, 'settings' => json_encode($be), 'package_id' => $selectedPackage->id, 'user_id' => $userId, 'start_date' => Carbon::parse(Carbon::now()->format('d-m-Y')), 'expire_date' => Carbon::parse($exDate), 'is_trial' => 0, 'trial_days' => 0, ]); $this->sendMail($selectedMemb, $selectedPackage, $request->payment_method, $user, $bs, $be, 'admin_added_current_package'); Session::flash('success', __('Current Package has been added successfully!')); return back(); } public function removeNextPackage(Request $request) { $userId = $request->user_id; $user = User::findOrFail($userId); $be = BasicExtended::first(); $bs = BasicSetting::select('website_title')->first(); $nextMembership = UserPermissionHelper::nextMembership($userId); // set the start_date to unlimited $nextMembership->start_date = Carbon::parse(Carbon::maxValue()->format('d-m-Y')); $nextMembership->modified = 1; $nextMembership->save(); $nextPackage = Package::select('title')->findOrFail($nextMembership->package_id); $this->sendMail(null, null, $request->payment_method, $user, $bs, $be, 'admin_removed_next_package', null, $nextPackage->title); Session::flash('success', __('Next Package removed successfully!')); return back(); } public function changeNextPackage(Request $request) { $userId = $request->user_id; $user = User::findOrFail($userId); $bs = BasicSetting::select('website_title')->first(); $be = BasicExtended::first(); $nextMembership = UserPermissionHelper::nextMembership($userId); $nextPackage = Package::find($nextMembership->package_id); $selectedPackage = Package::find($request->package_id); $prevStartDate = $nextMembership->start_date; // set the start_date to unlimited $nextMembership->start_date = Carbon::parse(Carbon::maxValue()->format('d-m-Y')); $nextMembership->modified = 1; $nextMembership->save(); // calculate expire date for selected package if ($selectedPackage->term == 'monthly') { $exDate = Carbon::parse($prevStartDate)->addMonth()->format('d-m-Y'); } elseif ($selectedPackage->term == 'yearly') { $exDate = Carbon::parse($prevStartDate)->addYear()->format('d-m-Y'); } elseif ($selectedPackage->term == 'lifetime') { $exDate = Carbon::parse(Carbon::maxValue()->format('d-m-Y')); } // store a new membership for selected package $selectedMemb = Membership::create([ 'price' => $selectedPackage->price, 'currency' => $be->base_currency_text, 'currency_symbol' => $be->base_currency_symbol, 'payment_method' => $request->payment_method, 'transaction_id' => uniqid(), 'status' => 1, 'receipt' => null, 'transaction_details' => null, 'settings' => json_encode($be), 'package_id' => $selectedPackage->id, 'user_id' => $userId, 'start_date' => Carbon::parse($prevStartDate), 'expire_date' => Carbon::parse($exDate), 'is_trial' => 0, 'trial_days' => 0, ]); $this->sendMail($selectedMemb, $selectedPackage, $request->payment_method, $user, $bs, $be, 'admin_changed_next_package', $nextPackage->title); Session::flash('success', __('Next Package changed successfully!')); return back(); } public function addNextPackage(Request $request) { $userId = $request->user_id; $hasPendingMemb = UserPermissionHelper::hasPendingMembership($userId); if ($hasPendingMemb) { Session::flash('membership_warning', __('This user already has a Pending Package. Please take an action (change / remove / approve / reject) for that package first.')); return back(); } $currMembership = UserPermissionHelper::userPackage($userId); $currPackage = Package::find($currMembership->package_id); $be = BasicExtended::first(); $user = User::findOrFail($userId); $bs = BasicSetting::select('website_title')->first(); $selectedPackage = Package::find($request->package_id); if ($currMembership->is_trial == 1) { Session::flash('membership_warning', __('If your current package is trial package, then you have to change / remove the current package first.')); return back(); } // if current package is not lifetime package if ($currPackage->term != 'lifetime') { // calculate expire date for selected package if ($selectedPackage->term == 'monthly') { $exDate = Carbon::parse($currMembership->expire_date) ->addDay() ->addMonth() ->format('d-m-Y'); } elseif ($selectedPackage->term == 'yearly') { $exDate = Carbon::parse($currMembership->expire_date) ->addDay() ->addYear() ->format('d-m-Y'); } elseif ($selectedPackage->term == 'lifetime') { $exDate = Carbon::parse(Carbon::maxValue()->format('d-m-Y')); } // store a new membership for selected package $selectedMemb = Membership::create([ 'price' => $selectedPackage->price, 'currency' => $be->base_currency_text, 'currency_symbol' => $be->base_currency_symbol, 'payment_method' => $request->payment_method, 'transaction_id' => uniqid(), 'status' => 1, 'receipt' => null, 'transaction_details' => null, 'settings' => json_encode($be), 'package_id' => $selectedPackage->id, 'user_id' => $userId, 'start_date' => Carbon::parse( Carbon::parse($currMembership->expire_date) ->addDay() ->format('d-m-Y'), ), 'expire_date' => Carbon::parse($exDate), 'is_trial' => 0, 'trial_days' => 0, ]); $this->sendMail($selectedMemb, $selectedPackage, $request->payment_method, $user, $bs, $be, 'admin_added_next_package'); } else { Session::flash('membership_warning', __('If your current package is lifetime package, then you have to change / remove the current package first.')); return back(); } Session::flash('success', __('Next Package has been added successfully!')); return back(); } public function userTemplate(Request $request) { if ($request->template == 1) { $prevImg = $request->file('preview_image'); $allowedExts = ['jpg', 'png', 'jpeg']; $rules = [ 'serial_number' => 'required|integer', 'template_name' => 'required', 'show_home' => 'required|integer', 'preview_image' => [ 'required', function ($attribute, $value, $fail) use ($prevImg, $allowedExts) { if (!empty($prevImg)) { $ext = $prevImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail('Only png, jpg, jpeg image is allowed'); } } }, ], ]; $messages = [ 'show_home.required' => 'Show in home is required', ]; $request->validate($rules, $messages); } $user = User::where('id', $request->user_id)->first(); if ($request->template == 1) { if ($request->hasFile('preview_image')) { @unlink(public_path('assets/front/img/template-previews/' . $user->template_img)); $filename = uniqid() . '.' . $prevImg->getClientOriginalExtension(); $dir = public_path('assets/front/img/template-previews/'); @mkdir($dir, 0775, true); $request->file('preview_image')->move($dir, $filename); $user->template_img = $filename; } $user->template_serial_number = $request->serial_number; } else { @unlink(public_path('assets/front/img/template-previews/' . $user->template_img)); $user->template_img = null; $user->template_serial_number = 0; } $user->preview_template = $request->template; $user->template_name = $request->template_name; $user->show_home = $request->show_home; $user->save(); Session::flash('success', __('Status updated successfully!')); return back(); } public function userUpdateTemplate(Request $request) { $prevImg = $request->file('preview_image'); $allowedExts = ['jpg', 'png', 'jpeg']; $rules = [ 'serial_number' => 'required|integer', 'template_name' => 'required', 'show_home' => 'required|integer', 'preview_image' => [ function ($attribute, $value, $fail) use ($prevImg, $allowedExts) { if (!empty($prevImg)) { $ext = $prevImg->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail('Only png, jpg, jpeg image is allowed'); } } }, ], ]; $messages = [ 'show_home.required' => 'Show in home is required', ]; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $user = User::where('id', $request->user_id)->first(); if ($request->hasFile('preview_image')) { @unlink(public_path('assets/front/img/template-previews/' . $user->template_img)); $filename = uniqid() . '.' . $prevImg->getClientOriginalExtension(); $dir = public_path('assets/front/img/template-previews/'); @mkdir($dir, 0775, true); $request->file('preview_image')->move($dir, $filename); $user->template_img = $filename; } $user->template_serial_number = $request->serial_number; $user->template_name = $request->template_name; $user->show_home = $request->show_home; $user->save(); Session::flash('success', __('Status updated successfully!')); return 'success'; } } Http/Controllers/Admin/RoleController.php 0000644 00000004371 15213350435 0014505 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Admin; use App\Models\Role; use Validator; use Session; class RoleController extends Controller { public function index() { $data['roles'] = Role::all(); return view('admin.role.index', $data); } public function store(Request $request) { $rules = [ 'name' => 'required|max:255', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $role = new Role; $role->name = $request->name; $role->save(); Session::flash('success', __('Role added successfully!')); return "success"; } public function update(Request $request) { $rules = [ 'name' => 'required|max:255', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $role = Role::findOrFail($request->role_id); $role->name = $request->name; $role->save(); Session::flash('success', __('Role updated successfully!')); return "success"; } public function delete(Request $request) { $role = Role::findOrFail($request->role_id); if ($role->admins()->count() > 0) { Session::flash('warning', __('Please delete the users under this role first.')); return back(); } $role->delete(); Session::flash('success', __('Role deleted successfully!')); return back(); } public function managePermissions($id) { $data['role'] = Role::find($id); return view('admin.role.permission.manage', $data); } public function updatePermissions(Request $request) { $permissions = json_encode($request->permissions); $role = Role::find($request->role_id); $role->permissions = $permissions; $role->save(); Session::flash('success', __("Permissions updated successfully for the role:"). ' ' . $role->name); return back(); } } Http/Controllers/Admin/MenuBuilderController.php 0000644 00000002655 15213350435 0016022 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App; use App\Http\Controllers\Controller; use App\Models\Language; use App\Models\MenuBuilder; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; class MenuBuilderController extends Controller { public function index(Request $request) { // first, get the language info from db $language = Language::query()->where('code', '=', $request->language)->firstOrFail(); $information['language'] = $language; //then, get the menus $websiteMenuInfo = $language->menuInfo()->first(); if (is_null($websiteMenuInfo)) { $information['menuData'] = ''; } else { $information['menuData'] = $websiteMenuInfo->menus; } // now, get the custom pages of that language from db $information['customPages'] = DB::table('pages') ->join('page_contents', 'pages.id', '=', 'page_contents.page_id') ->where('page_contents.language_id', $language->id) ->orderByDesc('pages.id') ->get(); $information['langs'] = Language::all(); return view('admin.menu-builder', $information); } public function update(Request $request) { MenuBuilder::query()->updateOrCreate( ['language_id' => $request['languageId']], [ 'language_id' => $request['languageId'], 'menus' => $request['str'] ] ); return response()->json(['message' => __('Website menus updated successfully!')], 200); } } Http/Controllers/Admin/PaymentLogController.php 0000644 00000020675 15213350435 0015670 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Helpers\MegaMailer; use App\Models\BasicSettings\Basic; use App\Models\Membership; use App\Models\Package; use App\Models\Vendor; use Carbon\Carbon; use Illuminate\Database\Eloquent\Builder; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class PaymentLogController extends Controller { /** * Display a listing of the resource. * * */ public function index(Request $request) { $search = $request->search; $username = $request->username; $data['memberships'] = Membership::query()->when($search, function ($query, $search) { return $query->where('transaction_id', 'like', '%' . $search . '%'); })->whereHas('vendor', function (Builder $query) use ($username) { $query->when($username, function ($query, $username) { return $query->where('username', 'like', '%' . $username . '%'); }); }) ->where('vendor_id', '!=', 0) ->orderBy('id', 'DESC') ->paginate(10); return view('admin.subscription_log.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } public function transaction(Request $request) { $search = $request->search; $data['memberships'] = Membership::query() ->where('admin_id', Auth::guard('web')->user()->id) ->when($search, function ($query, $search) { return $query->where('transaction_id', $search); }) ->orderBy('expire_date', 'DESC') ->paginate(10); return view('admin.transaction.index', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * */ public function update(Request $request) { $bs = Basic::first(); $membership = Membership::query()->where('id', $request->id)->first(); $vendor = Vendor::query()->where('id', $membership->vendor_id)->first(); $package = Package::query()->where('id', $membership->package_id)->first(); $count_membership = Membership::query()->where('vendor_id', $membership->vendor_id)->count(); if ($request->status === "1") { $member['first_name'] = $vendor->first_name; $member['last_name'] = $vendor->last_name; $member['username'] = $vendor->username; $member['email'] = $vendor->email; $data['payment_method'] = $membership->payment_method; //comparison date $date1 = Carbon::createFromFormat('m/d/Y', \Carbon\Carbon::parse($membership->start_date)->format('m/d/Y')); $date2 = Carbon::createFromFormat('m/d/Y', \Carbon\Carbon::now()->format('m/d/Y')); $result = $date1->gte($date2); if ($result) { $data['start_date'] = $membership->start_date; $data['expire_date'] = $membership->expire_date; } else { $data['start_date'] = Carbon::today()->format('d-m-Y'); if ($package->term === "daily") { $data['expire_date'] = Carbon::today()->addDay()->format('d-m-Y'); } elseif ($package->term === "weekly") { $data['expire_date'] = Carbon::today()->addWeek()->format('d-m-Y'); } elseif ($package->term === "monthly") { $data['expire_date'] = Carbon::today()->addMonth()->format('d-m-Y'); } elseif ($package->term === "lifetime") { $data['expire_date'] = Carbon::maxValue()->format('d-m-Y'); } else { $data['expire_date'] = Carbon::today()->addYear()->format('d-m-Y'); } $membership->update(['start_date' => Carbon::parse($data['start_date'])]); $membership->update(['expire_date' => Carbon::parse($data['expire_date'])]); } // if previous membership package is lifetime, then exipre that membership $previousMembership = Membership::query() ->where([ ['vendor_id', $vendor->id], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ]) ->where('status', 1) ->orderBy('created_at', 'DESC') ->first(); if (!is_null($previousMembership)) { $previousPackage = Package::query() ->select('term') ->where('id', $previousMembership->package_id) ->first(); if ($previousPackage->term === 'lifetime' || $previousMembership->is_trial == 1) { $yesterday = Carbon::yesterday()->format('d-m-Y'); $previousMembership->expire_date = Carbon::parse($yesterday); $previousMembership->save(); } } if ($count_membership > 1) { $mailTemplate = 'package_purchase_membership_accepted'; $mailType = 'paymentAcceptedForMembershipExtensionOfflineGateway'; } else { $mailTemplate = 'package_purchase_membership_accepted'; $mailType = 'paymentAcceptedForRegistrationOfflineGateway'; $vendor->update([ 'status' => 1 ]); } $filename = $this->makeInvoice($data, "membership", $member, null, $membership->price, "offline", $vendor->phone, $bs->base_currency_symbol_position, $bs->base_currency_symbol, $bs->base_currency_text, $membership->transaction_id, $package->title, $membership); $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_text_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_text_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'activation_date' => $data['start_date'], 'expire_date' => $package->term == "lifetime" ? 'Lifetime' : $data['expire_date'], 'membership_invoice' => $filename, 'website_title' => $bs->website_title, 'templateType' => $mailTemplate, 'type' => $mailType ]; //transaction create $after_balance = NULL; $pre_balance = NULL; $transactionData = [ 'vendor_id' => $vendor->id, 'transaction_type' => 'membership_buy', 'pre_balance' => $pre_balance, 'actual_total' => $membership->price, 'after_balance' => $after_balance, 'admin_profit' => $membership->price, 'payment_method' => $membership->payment_method, 'currency_symbol' => $bs->base_currency_symbol, 'currency_symbol_position' => $bs->base_currency_symbol_position, 'payment_status' => 'completed', ]; store_transaction($transactionData); $mailer->mailFromAdmin($data); @unlink(public_path('assets/front/invoices/' . $filename)); } elseif ($request->status == 2) { if ($count_membership > 1) { $mailTemplate = 'package_purchase_membership_rejected'; $mailType = 'paymentRejectedForMembershipExtensionOfflineGateway'; } else { $mailTemplate = 'package_purchase_membership_rejected'; $mailType = 'paymentRejectedForRegistrationOfflineGateway'; } $mailer = new MegaMailer(); $data = [ 'toMail' => $vendor->email, 'toName' => $vendor->fname, 'username' => $vendor->username, 'package_title' => $package->title, 'package_price' => ($bs->base_currency_symbol_position == 'left' ? $bs->base_currency_text . ' ' : '') . $package->price . ($bs->base_currency_symbol_position == 'right' ? ' ' . $bs->base_currency_text : ''), 'website_title' => $bs->website_title, 'templateType' => $mailTemplate, 'type' => $mailType ]; $mailer->mailFromAdmin($data); } $membership->update(['status' => $request->status]); session()->flash('success', __("Membership status changed successfully!") ); return back(); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } } Http/Controllers/Admin/FaqController.php 0000644 00000004577 15213350435 0014323 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\FAQ; use App\Models\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Validator; class FaqController extends Controller { public function index(Request $request) { // first, get the language info from db $language = Language::query()->where('code', '=', $request->language)->firstOrFail(); $information['language'] = $language; // then, get the faqs of that language from db $information['faqs'] = $language->faq()->orderByDesc('id')->get(); // also, get all the languages from db $information['langs'] = Language::all(); return view('admin.faq.index', $information); } public function store(Request $request) { $rules = [ 'language_id' => 'required', 'question' => 'required|max:255', 'answer' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } FAQ::query()->create($request->all()); session()->flash('success', __('New faq added successfully!')); return Response::json(['status' => 'success'], 200); } public function update(Request $request) { $rules = [ 'question' => 'required|max:255', 'answer' => 'required', 'serial_number' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return Response::json([ 'errors' => $validator->getMessageBag()->toArray() ], 400); } $faq = FAQ::query()->find($request->id); $faq->update($request->all()); session()->flash('success', __('FAQ updated successfully!')); return Response::json(['status' => 'success'], 200); } public function destroy($id) { $faq = FAQ::query()->find($id); $faq->delete(); return redirect()->back()->with('success', __('FAQ deleted successfully!')); } public function bulkDestroy(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $faq = FAQ::query()->find($id); $faq->delete(); } session()->flash('success', __('FAQs deleted successfully!')); return Response::json(['status' => 'success'], 200); } } Http/Controllers/Admin/EmailController.php 0000644 00000004063 15213350435 0014631 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Models\BasicExtended; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\EmailTemplate; use Session; class EmailController extends Controller { public function mailFromAdmin() { $data['abe'] = BasicExtended::first(); return view('admin.basic.email.mail_from_admin', $data); } public function updateMailFromAdmin(Request $request) { $request->validate([ 'from_mail' => 'required_if:is_smtp,1', 'from_name' => 'required_if:is_smtp,1', 'is_smtp' => 'required', 'smtp_host' => 'required_if:is_smtp,1', 'smtp_port' => 'required_if:is_smtp,1', 'encryption' => 'required_if:is_smtp,1', 'smtp_username' => 'required_if:is_smtp,1', 'smtp_password' => 'required_if:is_smtp,1', ]); $bes = BasicExtended::all(); foreach ($bes as $key => $be) { $be->from_mail = $request->from_mail; $be->from_name = $request->from_name; $be->is_smtp = $request->is_smtp; $be->smtp_host = $request->smtp_host; $be->smtp_port = $request->smtp_port; $be->encryption = $request->encryption; $be->smtp_username = $request->smtp_username; $be->smtp_password = $request->smtp_password; $be->save(); } Session::flash('success', __('SMTP configuration updated successfully!')); return back(); } public function mailToAdmin() { $data['abe'] = BasicExtended::first(); return view('admin.basic.email.mail_to_admin', $data); } public function updateMailToAdmin(Request $request) { $request->validate([ 'to_mail' => 'required', ]); $bes = BasicExtended::all(); foreach ($bes as $key => $be) { $be->to_mail = $request->to_mail; $be->save(); } Session::flash('success', __('Mail address updated successfully!')); return back(); } } Http/Controllers/Admin/HomePageTextController.php 0000644 00000002031 15213350435 0016125 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\BasicSetting as BS; use App\Models\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; class HomePageTextController extends Controller { public function index(Request $request) { if (empty($request->language)) { $data['lang_id'] = 0; $data['abs'] = BS::firstOrFail(); } else { $lang = Language::where('code', $request->language)->firstOrFail(); $data['lang_id'] = $lang->id; $data['abs'] = $lang->basic_setting; } return view('admin.home.home-page-text', $data); } public function update(Request $request, $langid) { $bs = BS::where('language_id', $langid)->firstOrFail(); foreach ($request->types as $key => $type) { $bs->$type = $request[$type]; } $bs->save(); Session::flash('success', __('Text updated successfully!')); return "success"; } } Http/Controllers/Admin/CacheController.php 0000644 00000000733 15213350435 0014605 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Artisan; use Session; class CacheController extends Controller { public function clear() { Artisan::call('cache:clear'); Artisan::call('config:clear'); Artisan::call('route:clear'); Artisan::call('view:clear'); Session::flash('success', __('Cache, route, view, config cleared successfully!')); return back(); } } Http/Controllers/Admin/BlogController.php 0000644 00000012514 15213350435 0014465 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Session; use Purifier; use Validator; use App\Models\Blog; use App\Models\Language; use App\Models\Bcategory; use Illuminate\Http\Request; use App\Http\Controllers\Controller; class BlogController extends Controller { public function index(Request $request) { $lang = Language::where('code', $request->language)->first(); $lang_id = $lang->id; $data['lang_id'] = $lang_id; $data['blogs'] = Blog::where('language_id', $lang_id)->orderBy('id', 'DESC')->get(); $data['bcats'] = Bcategory::where('language_id', $lang_id)->where('status', 1)->get(); return view('admin.blog.blog.index', $data); } public function edit($id) { $data['blog'] = Blog::findOrFail($id); $data['bcats'] = Bcategory::where('language_id', $data['blog']->language_id)->where('status', 1)->get(); return view('admin.blog.blog.edit', $data); } public function store(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $slug = make_slug($request->title); $rules = [ 'language_id' => 'required', 'title' => 'required|max:255', 'category' => 'required', 'content' => 'required', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed")); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $input['bcategory_id'] = $request->category; $input['slug'] = $slug; if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->session()->put('blog_image', $filename); $request->file('image')->move(public_path('assets/front/img/blogs/'), $filename); $input['main_image'] = $filename; } $input['content'] = Purifier::clean($request->content); $blog = new Blog; $blog->create($input); Session::flash('success', __('Blog added successfully!')); return "success"; } public function update(Request $request) { $img = $request->file('image'); $allowedExts = array('jpg', 'png', 'jpeg'); $slug = make_slug($request->title); $blog = Blog::findOrFail($request->blog_id); $rules = [ 'title' => 'required|max:255', 'category' => 'required', 'content' => 'required', 'serial_number' => 'required|integer', 'image' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__("Only png, jpg, jpeg image is allowed")); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $input = $request->all(); $blog = Blog::findOrFail($request->blog_id); $input['bcategory'] = $request->category; $input['slug'] = $slug; if ($request->hasFile('image')) { $filename = time() . '.' . $img->getClientOriginalExtension(); $request->file('image')->move(public_path('assets/front/img/blogs/'), $filename); @unlink(public_path('assets/front/img/blogs/' . $blog->main_image)); $input['main_image'] = $filename; } $input['content'] = Purifier::clean($request->content); $blog->update($input); Session::flash('success', __('Blog updated successfully!')); return "success"; } public function delete(Request $request) { $blog = Blog::findOrFail($request->blog_id); @unlink(public_path('assets/front/img/blogs/' . $blog->main_image)); $blog->delete(); Session::flash('success', __('Blog deleted successfully!')); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $blog = Blog::findOrFail($id); @unlink(public_path('assets/front/img/blogs/' . $blog->main_image)); $blog->delete(); } Session::flash('success', __('Blogs deleted successfully!')); return "success"; } public function getcats($langid) { $bcategories = Bcategory::where('language_id', $langid)->where('status', 1)->get(); return $bcategories; } } Http/Controllers/Admin/SubdomainController.php 0000644 00000003661 15213350435 0015526 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Carbon\Carbon; use App\Models\User; use Illuminate\Http\Request; use App\Models\User\BasicSetting; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Config; class SubdomainController extends Controller { public function __construct() { $abs = BasicSetting::first(); Config::set('app.timezone', $abs->timezone); } public function index(Request $request) { $users = User::all(); $userIds = []; foreach ($users as $key => $user) { if (cPackageHasSubdomain($user)) { $userIds[] = $user->id; } } $type = $request->type; $username = $request->username; $subdomains = User::whereHas('memberships', function ($q) { $q->where('status', '=', 1) ->where('start_date', '<=', Carbon::now()->format('Y-m-d')) ->where('expire_date', '>=', Carbon::now()->format('Y-m-d')); })->when($type, function ($query, $type) { if ($type == 'pending') { return $query->where('subdomain_status', 0); } elseif ($type == 'connected') { return $query->where('subdomain_status', 1); } })->when($username, function ($query, $username) { return $query->where('username', 'LIKE', '%' . $username . '%'); })->when(!empty($userIds), function ($query) use ($userIds) { return $query->whereIn('id', $userIds); })->latest()->paginate(10); $data['subdomains'] = $subdomains; return view('admin.subdomains.index', $data); } public function status(Request $request) { $user = User::findOrFail($request->user_id); $user->subdomain_status = $request->status; $user->save(); $request->session()->flash('success', __('Status updated successfully')); return back(); } } Http/Controllers/Admin/GatewayController.php 0000644 00000035572 15213350435 0015214 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Language; use App\Models\OfflineGateway; use App\Models\PaymentGateway; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Session; use Validator; class GatewayController extends Controller { public function index() { $data['paypal'] = PaymentGateway::find(15); $data['stripe'] = PaymentGateway::find(14); $data['paystack'] = PaymentGateway::find(12); $data['paytm'] = PaymentGateway::find(11); $data['flutterwave'] = PaymentGateway::find(6); $data['instamojo'] = PaymentGateway::find(13); $data['mollie'] = PaymentGateway::find(17); $data['razorpay'] = PaymentGateway::find(9); $data['mercadopago'] = PaymentGateway::find(19); $data['anet'] = PaymentGateway::find(20); $data['phonepe'] = PaymentGateway::where('keyword', 'phonepe')->first(); $data['perfect_money'] = PaymentGateway::where('keyword', 'perfect_money')->first(); $data['xendit'] = PaymentGateway::where('keyword', 'xendit')->first(); $data['myfatoorah'] = PaymentGateway::where('keyword', 'myfatoorah')->first(); $data['yoco'] = PaymentGateway::where('keyword', 'yoco')->first(); $data['toyyibpay'] = PaymentGateway::where('keyword', 'toyyibpay')->first(); $data['paytabs'] = PaymentGateway::where('keyword', 'paytabs')->first(); $data['iyzico'] = PaymentGateway::where('keyword', 'iyzico')->first(); $data['midtrans'] = PaymentGateway::where('keyword', 'midtrans')->first(); return view('admin.gateways.index', $data); } public function paypalUpdate(Request $request) { $paypal = PaymentGateway::find(15); $paypal->status = $request->status; $information = []; $information['client_id'] = $request->client_id; $information['client_secret'] = $request->client_secret; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = "Pay via your PayPal account."; $paypal->information = json_encode($information); $paypal->save(); $request->session()->flash('success', __("Paypal informations updated successfully!")); return back(); } public function stripeUpdate(Request $request) { $stripe = PaymentGateway::find(14); $stripe->status = $request->status; $information = []; $information['key'] = $request->key; $information['secret'] = $request->secret; $information['text'] = "Pay via your Credit account."; $stripe->information = json_encode($information); $stripe->save(); $request->session()->flash('success', __("Stripe informations updated successfully!")); return back(); } public function paystackUpdate(Request $request) { $paystack = PaymentGateway::find(12); $paystack->status = $request->status; $information = []; $information['key'] = $request->key; $information['email'] = $request->email; $information['text'] = "Pay via your Paystack account."; $paystack->information = json_encode($information); $paystack->save(); $request->session()->flash('success', __("Paystack informations updated successfully!")); return back(); } public function paytmUpdate(Request $request) { $paytm = PaymentGateway::find(11); $paytm->status = $request->status; $information = []; $information['environment'] = $request->environment; $information['merchant'] = $request->merchant; $information['secret'] = $request->secret; $information['website'] = $request->website; $information['industry'] = $request->industry; $information['text'] = "Pay via your paytm account."; $paytm->information = json_encode($information); $paytm->save(); $request->session()->flash('success', __("Paytm informations updated successfully!")); return back(); } public function flutterwaveUpdate(Request $request) { $flutterwave = PaymentGateway::find(6); $flutterwave->status = $request->status; $information = []; $information['public_key'] = $request->public_key; $information['secret_key'] = $request->secret_key; $information['text'] = "Pay via your Flutterwave account."; $flutterwave->information = json_encode($information); $flutterwave->save(); $request->session()->flash('success', __("Flutterwave informations updated successfully!")); return back(); } public function instamojoUpdate(Request $request) { $instamojo = PaymentGateway::find(13); $instamojo->status = $request->status; $information = []; $information['key'] = $request->key; $information['token'] = $request->token; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = "Pay via your Instamojo account."; $instamojo->information = json_encode($information); $instamojo->save(); $request->session()->flash('success', __("Instamojo informations updated successfully!")); return back(); } public function mollieUpdate(Request $request) { $mollie = PaymentGateway::find(17); $mollie->status = $request->status; $information = []; $information['key'] = $request->key; $information['text'] = "Pay via your Mollie Payment account."; $mollie->information = json_encode($information); $mollie->save(); $arr = ['MOLLIE_KEY' => $request->key]; setEnvironmentValue($arr); \Artisan::call('config:clear'); $request->session()->flash('success', __("Mollie Payment informations updated successfully!")); return back(); } public function razorpayUpdate(Request $request) { $razorpay = PaymentGateway::find(9); $razorpay->status = $request->status; $information = []; $information['key'] = $request->key; $information['secret'] = $request->secret; $information['text'] = "Pay via your Razorpay account."; $razorpay->information = json_encode($information); $razorpay->save(); $request->session()->flash('success', __("Razorpay informations updated successfully!")); return back(); } public function anetUpdate(Request $request) { $anet = PaymentGateway::find(20); $anet->status = $request->status; $information = []; $information['login_id'] = $request->login_id; $information['transaction_key'] = $request->transaction_key; $information['public_key'] = $request->public_key; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = "Pay via your Authorize.net account."; $anet->information = json_encode($information); $anet->save(); $request->session()->flash('success', __("Authorize.net informations updated successfully!")); return back(); } public function mercadopagoUpdate(Request $request) { $mercadopago = PaymentGateway::find(19); $mercadopago->status = $request->status; $information = []; $information['token'] = $request->token; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = "Pay via your Mercado Pago account."; $mercadopago->information = json_encode($information); $mercadopago->save(); $request->session()->flash('success', __("Mercado Pago informations updated successfully!")); return back(); } public function phonepeUpdate(Request $request) { $phonepe = PaymentGateway::where('keyword', 'phonepe')->first(); $phonepe->status = $request->status; $information = []; $information['merchant_id'] = $request->merchant_id; $information['salt_key'] = $request->salt_key; $information['salt_index'] = $request->salt_index; $information['sandbox_check'] = $request->sandbox_check; $information['text'] = "Pay via your PhonePe account."; $phonepe->information = json_encode($information); $phonepe->save(); $request->session()->flash('success', __("PhonePe informations updated successfully!")); return back(); } public function perfect_moneyUpdate(Request $request) { $perfect_money = PaymentGateway::where('keyword', 'perfect_money')->first(); $perfect_money->status = $request->status; $information = []; $information['perfect_money_wallet_id'] = $request->perfect_money_wallet_id; $perfect_money->information = json_encode($information); $perfect_money->save(); $request->session()->flash('success', __("Perfect Money informations updated successfully!")); return back(); } public function xenditUpdate(Request $request) { $xendit = PaymentGateway::where('keyword', 'xendit')->first(); $xendit->status = $request->status; $information = []; $information['secret_key'] = $request->secret_key; $xendit->information = json_encode($information); $xendit->save(); $request->session()->flash('success', __("Xendit informations updated successfully!")); return back(); } public function myfatoorahUpdate(Request $request) { $information = [ 'token' => $request->token, 'sandbox_status' => $request->sandbox_status ]; $data = PaymentGateway::where('keyword', 'myfatoorah')->first(); $data->information = json_encode($information); $data->status = $request->status; $data->save(); $array = [ 'MYFATOORAH_TOKEN' => $request->token, 'MYFATOORAH_CALLBACK_URL' => route('myfatoorah.success'), 'MYFATOORAH_ERROR_URL' => route('myfatoorah.cancel'), ]; setEnvironmentValue($array); Artisan::call('config:clear'); Session::flash('success', __('Updated Myfatoorah Information Successfully')); return back(); } public function yocoUpdate(Request $request) { $yoco = PaymentGateway::where('keyword', 'yoco')->first(); $yoco->status = $request->status; $information = []; $information['secret_key'] = $request->secret_key; $yoco->information = json_encode($information); $yoco->save(); $request->session()->flash('success', __("Yoco informations updated successfully!")); return back(); } public function toyyibpayUpdate(Request $request) { $information['sandbox_status'] = $request->sandbox_status; $information['secret_key'] = $request->secret_key; $information['category_code'] = $request->category_code; $data = PaymentGateway::where('keyword', 'toyyibpay')->first(); $data->information = json_encode($information); $data->status = $request->status; $data->save(); Session::flash('success', __('Updated Toyyibpay Information Successfully')); return redirect()->back(); } public function paytabsUpdate(Request $request) { $information['server_key'] = $request->server_key; $information['profile_id'] = $request->profile_id; $information['country'] = $request->country; $information['api_endpoint'] = $request->api_endpoint; $data = PaymentGateway::where('keyword', 'paytabs')->first(); $data->information = json_encode($information); $data->status = $request->status; $data->save(); Session::flash('success', __('Updated Paytabs Information Successfully')); return redirect()->back(); } public function iyzicoUpdate(Request $request) { $information['sandbox_status'] = $request->sandbox_status; $information['api_key'] = $request->api_key; $information['secret_key'] = $request->secret_key; $data = PaymentGateway::where('keyword', 'iyzico')->first(); $data->information = json_encode($information); $data->status = $request->status; $data->save(); Session::flash('success', __('Updated Iyzico Information Successfully')); return redirect()->back(); } public function midtransUpdate(Request $request) { $information['is_production'] = $request->is_production; $information['server_key'] = $request->server_key; $data = PaymentGateway::where('keyword', 'midtrans')->first(); $data->information = json_encode($information); $data->status = $request->status; $data->save(); Session::flash('success', __('Updated Midtrans Information Successfully')); return redirect()->back(); } public function offline(Request $request) { $data['ogateways'] = OfflineGateway::orderBy('id', 'DESC')->get(); return view('admin.gateways.offline.index', $data); } public function store(Request $request) { $rules = [ 'name' => 'required|max:100', 'short_description' => 'nullable', 'serial_number' => 'required|integer', 'is_receipt' => 'required', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $errmsgs = $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $in = $request->all(); OfflineGateway::create($in); Session::flash('success', __('Gateway added successfully!')); return "success"; } public function update(Request $request) { $rules = [ 'name' => 'required|max:100', 'short_description' => 'nullable', 'serial_number' => 'required|integer', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json($validator->errors()); } $in = $request->except('_token', 'ogateway_id'); OfflineGateway::where('id', $request->ogateway_id)->update($in); Session::flash('success', __('Gateway updated successfully!')); return "success"; } public function status(Request $request) { $og = OfflineGateway::find($request->ogateway_id); $og->status = $request->status; $og->save(); Session::flash('success', __('Gateway status changed successfully!')); return back(); } public function delete(Request $request) { $ogateway = OfflineGateway::findOrFail($request->ogateway_id); $ogateway->delete(); Session::flash('success', __('Gateway deleted successfully!')); return back(); } } Http/Controllers/Admin/BasicController.php 0000644 00000042367 15213350435 0014634 0 ustar 00 <?php namespace App\Http\Controllers\Admin; // use Artisan; use Purifier; use Validator; use App\Models\Seo; use App\Models\Language; use App\Models\Timezone; use App\Models\BasicSetting; use Illuminate\Http\Request; use App\Models\BasicExtended; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Session; use App\Http\Helpers\EnvHelper; use Illuminate\Support\Facades\Artisan; class BasicController extends Controller { public function __construct() { $abs = BasicSetting::first(); Config::set('app.timezone', $abs->timezone); } public function setLocaleAdmin(Request $request) { Session::put('admin_lang', 'admin_' . $request->code); app()->setLocale('admin_' . $request->code); return $request->code; } public function favicon(Request $request) { return view('admin.basic.favicon'); } public function updatefav(Request $request) { $img = $request->file('favicon'); $allowedExts = ['jpg', 'png', 'jpeg', 'ico']; $rules = [ 'favicon' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail('Only png, jpg, jpeg image is allowed'); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json(['errors' => $validator->errors(), 'id' => 'favicon']); } if ($request->hasFile('favicon')) { $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/'), $filename); $bss = BasicSetting::all(); foreach ($bss as $key => $bs) { @unlink(public_path('assets/front/img/' . $bs->favicon)); $bs->favicon = $filename; $bs->save(); } } Session::flash('success', __('Favicon update successfully!')); return back(); } public function logo(Request $request) { return view('admin.basic.logo'); } public function updatelogo(Request $request) { $img = $request->file('file'); $allowedExts = ['jpg', 'png', 'jpeg']; $rules = [ 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail(__('Only png, jpg, jpeg image is allowed')); } } }, ], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { $validator->getMessageBag()->add('error', 'true'); return response()->json(['errors' => $validator->errors(), 'id' => 'logo']); } if ($request->hasFile('file')) { $bss = BasicSetting::all(); $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/'), $filename); foreach ($bss as $key => $bs) { // only remove the the previous image, if it is not the same as default image or the first image is being updated @unlink(public_path('assets/front/img/' . $bs->logo)); $bs->logo = $filename; $bs->save(); } } Session::flash('success', __('Logo update successfully!')); return back(); } public function preloader(Request $request) { return view('admin.basic.preloader'); } public function updatepreloader(Request $request) { $img = $request->file('file'); $allowedExts = ['jpg', 'png', 'jpeg', 'gif']; $rules = [ 'preloader_status' => 'required', 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail('Only gif, png, jpg, jpeg image is allowed'); } } }, ], ]; $request->validate($rules); $bss = BasicSetting::all(); if ($request->hasFile('file')) { $filename = uniqid() . '.' . $img->getClientOriginalExtension(); $img->move(public_path('assets/front/img/'), $filename); } foreach ($bss as $key => $bs) { $bs->preloader_status = $request->preloader_status; if ($request->hasFile('file')) { @unlink(public_path('assets/front/img/' . $bs->preloader)); $bs->preloader = $filename; } $bs->save(); } Session::flash('success', __('Preloader updated successfully!')); return back(); } public function basicinfo() { $data['abs'] = BasicSetting::firstOrFail(); $data['abe'] = BasicExtended::firstOrFail(); $data['timezones'] = Timezone::all(); return view('admin.basic.basicinfo', $data); } public function updatebasicinfo(Request $request) { $request->validate([ 'website_title' => 'required', 'timezone' => 'required', 'base_color' => 'required', 'base_currency_symbol' => 'required', 'base_currency_symbol_position' => 'required', 'base_currency_text' => 'required', 'base_currency_text_position' => 'required', 'base_currency_rate' => 'required|numeric', ]); $bss = BasicSetting::all(); foreach ($bss as $key => $bs) { $bs->website_title = $request->website_title; $bs->timezone = $request->timezone; $bs->email_verification_status = $request->email_verification_status; $bs->base_color = str_replace('#', '', $request->base_color); $bs->save(); } $bes = BasicExtended::all(); foreach ($bes as $key => $be) { $be->base_currency_symbol = $request->base_currency_symbol; $be->base_currency_symbol_position = $request->base_currency_symbol_position; $be->base_currency_text = $request->base_currency_text; $be->base_currency_text_position = $request->base_currency_text_position; $be->base_currency_rate = $request->base_currency_rate; $be->timezone = $request->timezone; $be->save(); } // set timezone in .env if ($request->has('timezone') && $request->filled('timezone')) { $arr = ['TIMEZONE' => $request->timezone]; setEnvironmentValue($arr); \Artisan::call('config:clear'); } Session::flash('success', __('Basic informations updated successfully!')); return back(); } public function updateslider(Request $request, $lang) { $be = BasicExtended::where('language_id', $lang)->firstOrFail(); if ($request->hasFile('slider_shape_img')) { @unlink(public_path('assets/front/img/' . $be->slider_shape_img)); $filename = uniqid() . '.' . $request->slider_shape_img->getClientOriginalExtension(); $request->slider_shape_img->move(public_path('assets/front/img/'), $filename); $be->slider_shape_img = $filename; } if ($request->hasFile('slider_bottom_img')) { @unlink(public_path('assets/front/img/' . $be->slider_bottom_img)); $filename = uniqid() . '.' . $request->slider_bottom_img->getClientOriginalExtension(); $request->slider_bottom_img->move(public_path('assets/front/img/'), $filename); $be->slider_bottom_img = $filename; } $be->save(); Session::flash('success', __('Slider data updated successfully!')); return back(); } public function script() { $data = BasicSetting::first(); return view('admin.basic.scripts', ['data' => $data]); } public function updatescript(Request $request) { $bss = BasicSetting::all(); foreach ($bss as $bs) { $bs->tawkto_property_id = $request->tawkto_property_id; $bs->is_tawkto = $request->is_tawkto; $bs->is_disqus = $request->is_disqus; // $bs->is_user_disqus = $request->is_user_disqus; $bs->disqus_shortname = $request->disqus_shortname; $bs->is_recaptcha = $request->is_recaptcha; $bs->google_recaptcha_site_key = $request->google_recaptcha_site_key; $bs->google_recaptcha_secret_key = $request->google_recaptcha_secret_key; $bs->is_whatsapp = $request->is_whatsapp; $bs->whatsapp_number = $request->whatsapp_number; $bs->whatsapp_header_title = $request->whatsapp_header_title; $bs->whatsapp_popup_message = Purifier::clean($request->whatsapp_popup_message); $bs->whatsapp_popup = $request->whatsapp_popup; // ================= AI CONFIG ================= // ---- OpenAI ---- $bs->openai_api_key = trim($request->openai_api_key ?? ''); $bs->openai_text_model = trim($request->openai_text_model ?? 'gpt-4o'); $bs->openai_image_model = trim($request->openai_image_model ?? 'dall-e-3'); $bs->openai_content_type = $request->openai_content_type ?? 'all'; // ---- Gemini ---- $bs->gemini_api_key = trim($request->gemini_api_key ?? ''); $bs->gemini_text_model = trim($request->gemini_text_model ?? 'gemini-2.0-flash'); $bs->gemini_image_model = trim($request->gemini_image_model ?? 'imagen-4.0-generat-001'); $bs->gemini_content_type = $request->gemini_content_type ?? 'all'; // ---- Pollinations ---- $bs->pollinations_content_type = $request->pollinations_content_type ?? 'all'; // ENV update (API Keys) EnvHelper::setEnvValue('OPENAI_API_KEY', $bs->openai_api_key); EnvHelper::setEnvValue('GEMINI_API_KEY', $bs->gemini_api_key); $bs->save(); } Artisan::call('optimize:clear'); Artisan::call('config:clear'); Artisan::call('cache:clear'); Session::flash('success', __('Plugins updated successfully!')); return back(); } public function maintainance() { $data = BasicSetting::select('maintainance_mode', 'maintenance_img', 'maintenance_status', 'maintainance_text', 'secret_path')->first(); return view('admin.basic.maintainance', ['data' => $data]); } public function updatemaintainance(Request $request) { $img = $request->file('file'); $allowedExts = ['jpg', 'png', 'jpeg']; $rules = [ 'file' => [ function ($attribute, $value, $fail) use ($img, $allowedExts) { if (!empty($img)) { $ext = $img->getClientOriginalExtension(); if (!in_array($ext, $allowedExts)) { return $fail('Only png, jpg, jpeg image is allowed'); } } }, ], 'maintenance_status' => 'required', 'maintainance_text' => 'required', ]; $message = [ 'maintainance_text.required' => 'The maintenance message field is required.', ]; $validator = Validator::make($request->all(), $rules, $message); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } $bs = BasicSetting::first(); // first, get the maintenance image from db if ($request->hasFile('file')) { $filename = uniqid() . '.' . $request->file('file')->getClientOriginalExtension(); @unlink(public_path('assets/front/img/' . $bs->maintenance_img)); $request->file('file')->move(public_path('assets/front/img/'), $filename); } $down = 'down'; if ($request->filled('secret_path')) { $down .= ' --secret=' . $request->secret_path; } if ($request->maintenance_status == 1) { @unlink('core/storage/framework/down'); Artisan::call($down); } else { Artisan::call('up'); } $bs->update([ 'maintenance_img' => $request->hasFile('file') ? $filename : $bs->maintenance_img, 'maintenance_status' => $request->maintenance_status, 'maintainance_text' => clean($request->maintainance_text), 'secret_path' => $request->secret_path, ]); Session::flash('success', __('Maintenance Info updated successfully!')); return redirect()->back(); } public function css(Request $request) { $data['abe'] = BasicExtended::select('custom_css')->first(); return view('admin.basic.css', $data); } public function updateCss(Request $request) { $css = clean($request->custom_css); $datas = BasicExtended::all(); foreach ($datas as $key => $data) { $data->custom_css = $css; $data->save(); } Session::flash('success', __('Custom CSS updated successfully') . '!'); return back(); } public function js(Request $request) { $data['abe'] = BasicExtended::select('custom_js')->first(); return view('admin.basic.js', $data); } public function updateJs(Request $request) { $js = clean($request->custom_js); $datas = BasicExtended::all(); foreach ($datas as $key => $data) { $data->custom_js = $js; $data->save(); } Session::flash('success', __('Custom JS updated successfully') . '!'); return back(); } public function sections(Request $request) { $data['abs'] = BasicSetting::first(); return view('admin.home.sections', $data); } public function updatesections(Request $request) { $bss = BasicSetting::all(); foreach ($bss as $key => $bs) { $bs->update($request->all()); } Session::flash('success', __('Sections customized successfully!')); return back(); } public function cookiealert(Request $request) { $lang = Language::where('code', $request->language)->firstOrFail(); $data['lang_id'] = $lang->id; $data['abe'] = $lang->basic_extended; return view('admin.basic.cookie', $data); } public function updatecookie(Request $request, $langid) { $request->validate([ 'cookie_alert_status' => 'required', 'cookie_alert_text' => 'required', 'cookie_alert_button_text' => 'required|max:25', ]); $be = BasicExtended::where('language_id', $langid)->firstOrFail(); $be->cookie_alert_status = $request->cookie_alert_status; $be->cookie_alert_text = Purifier::clean($request->cookie_alert_text); $be->cookie_alert_button_text = $request->cookie_alert_button_text; $be->save(); Session::flash('success', __('Cookie alert updated successfully!')); return back(); } public function seo(Request $request) { // first, get the language info from db $language = Language::where('code', $request->language)->firstOrFail(); $langId = $language->id; // then, get the seo info of that language from db $seo = Seo::where('language_id', $langId); if ($seo->count() == 0) { // if seo info of that language does not exist then create a new one Seo::create( $request->except('language_id') + [ 'language_id' => $langId, ], ); } $information['language'] = $language; // then, get the seo info of that language from db $information['data'] = $seo->first(); // get all the languages from db $information['langs'] = Language::all(); return view('admin.basic.seo', $information); } public function updateSEO(Request $request) { // first, get the language info from db $langCode = str_replace('admin_', '', session('admin_lang')); if($langCode){ $language = Language::where('code', $langCode)->first(); } else{ $language = Language::where('is_default', 1)->first(); } $langId = $language->id; // then, get the seo info of that language from db $seo = SEO::where('language_id', $langId)->first(); // else update the existing seo info of that language $seo->update($request->all()); $request->session()->flash('success', __('SEO Informations updated successfully!')); return redirect()->back(); } } Http/Controllers/Admin/MailTemplateController.php 0000644 00000002341 15213350435 0016155 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\EmailTemplate; use Illuminate\Http\Request; use Validator; class MailTemplateController extends Controller { public function mailTemplates() { $templates = EmailTemplate::all(); return view('admin.basic.email.mail_templates', compact('templates')); } public function editMailTemplate($id) { $templateInfo = EmailTemplate::findOrFail($id); return view('admin.basic.email.edit_mail_template', compact('templateInfo')); } public function updateMailTemplate(Request $request, $id) { $rules = [ 'email_subject' => 'required', 'email_body' => 'required' ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->back()->withErrors($validator->errors()); } EmailTemplate::findOrFail($id)->update($request->except('email_type', 'email_body') + [ 'email_body' => clean($request->email_body) ]); $request->session()->flash('success', __('Mail template updated successfully!')); return redirect()->back(); } } Http/Controllers/Admin/PackageController.php 0000644 00000012412 15213350435 0015132 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Models\Package; use App\Models\Language; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use App\Models\BasicSettings\Basic; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Response; use App\Http\Requests\Package\PackageStoreRequest; use App\Http\Requests\Package\PackageUpdateRequest; class PackageController extends Controller { public function settings() { $data['abe'] = Basic::first(); return view('admin.packages.settings', $data); } public function updateSettings(Request $request) { $be = Basic::first(); $be->expiration_reminder = $request->expiration_reminder; $be->save(); Session::flash('success', __('Settings updated successfully!')); return back(); } /** * Display a listing of the resource. * * */ public function index(Request $request) { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $search = $request->search; $data['bex'] = $currentLang->basic_extended; $data['packages'] = Package::query()->when($search, function ($query, $search) { return $query->where('title', 'like', '%' . $search . '%'); })->orderBy('created_at', 'DESC')->get(); $data['whatsapp_manager_status'] = DB::table('basic_settings') ->value('whatsapp_manager_status'); return view('admin.packages.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * */ public function store(PackageStoreRequest $request) { try { return DB::transaction(function () use ($request) { Package::create($request->all()); Session::flash('success', __("Package Created Successfully")); return Response::json(['status' => 'success'], 200); }); } catch (\Throwable $e) { return $e; } } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return */ public function edit($id) { if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $data['bex'] = $currentLang->basic_extended; $data['package'] = Package::query()->findOrFail($id); $data['whatsapp_manager_status'] = DB::table('basic_settings') ->value('whatsapp_manager_status'); return view("admin.packages.edit", $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * */ public function update(PackageUpdateRequest $request) { try { if (!array_key_exists('is_trial', $request->all())) { $request['is_trial'] = "0"; $request['trial_days'] = 0; } return DB::transaction(function () use ($request) { Package::query()->findOrFail($request->package_id) ->update($request->all()); Session::flash('success', __("Package Update Successfully")); return Response::json(['status' => 'success'], 200); }); } catch (\Throwable $e) { return $e; } } public function delete(Request $request) { $pacakge_count = Package::get()->count(); if ($pacakge_count <= 1) { Session::flash('warning', __('You have to keep at least one package.')); return back(); } try { return DB::transaction(function () use ($request) { $package = Package::query()->findOrFail($request->package_id); if ($package->memberships()->count() > 0) { foreach ($package->memberships as $key => $membership) { @unlink(public_path('assets/front/img/membership/receipt/') . $membership->receipt); $membership->delete(); } } $package->delete(); Session::flash('success', __('Package deleted successfully!')); return back(); }); } catch (\Throwable $e) { return $e; } } public function bulkDelete(Request $request) { try { return DB::transaction(function () use ($request) { $ids = $request->ids; foreach ($ids as $id) { $package = Package::query()->findOrFail($id); if ($package->memberships()->count() > 0) { foreach ($package->memberships as $key => $membership) { @unlink(public_path('assets/front/img/membership/receipt/') . $membership->receipt); $membership->delete(); } } $package->delete(); } session()->flash('success', __('Package bulk deletion is successful!')); return Response::json(['status' => 'success'], 200); }); } catch (\Throwable $e) { session()->flash('warning', __('Something went wrong!')); return Response::json(['status' => 'success'], 200); } } } Http/Controllers/Admin/SummernoteController.php 0000644 00000001145 15213350435 0015736 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Helpers\UploadFile; use Illuminate\Http\Request; class SummernoteController extends Controller { public function upload(Request $request) { $imageName = UploadFile::store(public_path('assets/img/summernotes/'), $request->file('image')); return url('/') . '/assets/img/summernotes/' . $imageName; } public function remove(Request $request) { @unlink(public_path('assets/img/summernotes/') . $request->image); return response()->json(['data' => 'Image removed successfully!'], 200); } } Http/Controllers/Admin/SubscriberController.php 0000644 00000007163 15213350435 0015711 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; use App\Models\Subscriber; use App\Models\BasicSetting; use App\Models\BasicExtended; use App\Mail\ContactMail; use Session; use Mail; class SubscriberController extends Controller { public function index(Request $request) { $term = $request->term; $data['subscs'] = Subscriber::when($term, function ($query, $term) { return $query->where('email', 'LIKE', '%' . $term . '%'); })->orderBy('id', 'DESC')->paginate(10); return view('admin.subscribers.index', $data); } public function mailsubscriber() { return view('admin.subscribers.mail'); } public function subscsendmail(Request $request) { $request->validate([ 'subject' => 'required', 'message' => 'required' ]); $sub = $request->subject; $msg = $request->message; $subscs = Subscriber::all(); $settings = BasicSetting::first(); $from = $settings->contact_mail; $be = BasicExtended::first(); $mail = new PHPMailer(true); $mail->CharSet = "UTF-8"; if ($be->is_smtp == 1) { try { //Server settings $mail->isSMTP(); // Send using SMTP $mail->Host = $be->smtp_host; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = $be->smtp_username; // SMTP username $mail->Password = $be->smtp_password; // SMTP password $mail->SMTPSecure = $be->encryption; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged $mail->Port = $be->smtp_port; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above //Recipients $mail->setFrom($be->from_mail, $be->from_name); foreach ($subscs as $key => $subsc) { $mail->addBCC($subsc->email); // Add a recipient } } catch (Exception $e) { } } else { try { //Recipients $mail->setFrom($be->from_mail, $be->from_name); foreach ($subscs as $key => $subsc) { $mail->addBCC($subsc->email); // Add a recipient } } catch (Exception $e) { } } // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = $sub; $mail->Body = $msg; $mail->send(); Session::flash('success', __('Mail sent successfully!')); return back(); } public function delete(Request $request) { $subscriber = Subscriber::findOrFail($request->subscriber_id); $subscriber->delete(); Session::flash('success', __('Subscriber deleted successfully!')); return back(); } public function bulkDelete(Request $request) { $ids = $request->ids; foreach ($ids as $id) { $subscriber = Subscriber::findOrFail($id); $subscriber->delete(); } Session::flash('success', __('Subscribers deleted successfully!')); return "success"; } } Http/Controllers/Admin/LoginController.php 0000644 00000002303 15213350435 0014645 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Auth; use App\Models\Language; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Session; class LoginController extends Controller { public function login() { return view('admin.login'); } public function authenticate(Request $request) { if (Session::has('admin_lang')) { $admin_lang = Session::get('admin_lang'); $cd = str_replace('admin_', '', $admin_lang); $default = Language::where('code', $cd)->first(); }else{ $default = Language::where('is_default', 1)->first(); } $this->validate($request, [ 'username' => 'required', 'password' => 'required', ]); if (Auth::guard('admin')->attempt(['username' => $request->username, 'password' => $request->password])) { return redirect()->route('admin.dashboard', ['language' => $default->code]); } return redirect()->back()->with('alert', __('Username and Password Not Matched')); } public function logout() { Auth::guard('admin')->logout(); return redirect()->route('admin.login'); } } Http/Controllers/Auth/RegisterController.php 0000644 00000003543 15213350435 0015241 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\User; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; use Illuminate\Foundation\Auth\RegistersUsers; class RegisterController extends Controller { /* |-------------------------------------------------------------------------- | Register Controller |-------------------------------------------------------------------------- | | This controller handles the registration of new users as well as their | validation and creation. By default this controller uses a trait to | provide this functionality without requiring any additional code. | */ use RegistersUsers; /** * Where to redirect users after registration. * * @var string */ protected $redirectTo = '/home'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } /** * Get a validator for an incoming registration request. * * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'string', 'min:8', 'confirmed'], ]); } /** * Create a new user instance after a valid registration. * * @param array $data * @return \App\User */ protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => Hash::make($data['password']), ]); } } Http/Controllers/Auth/ForgotPasswordController.php 0000644 00000001502 15213350435 0016431 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\SendsPasswordResetEmails; class ForgotPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset emails and | includes a trait which assists in sending these notifications from | your application to your users. Feel free to explore this trait. | */ use SendsPasswordResetEmails; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } } Http/Controllers/Auth/VerificationController.php 0000644 00000002057 15213350435 0016076 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\VerifiesEmails; class VerificationController extends Controller { /* |-------------------------------------------------------------------------- | Email Verification Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling email verification for any | user that recently registered with the application. Emails may also | be re-sent if the user didn't receive the original email message. | */ use VerifiesEmails; /** * Where to redirect users after verification. * * @var string */ protected $redirectTo = '/home'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); $this->middleware('signed')->only('verify'); $this->middleware('throttle:6,1')->only('verify', 'resend'); } } Http/Controllers/Auth/LoginController.php 0000644 00000001657 15213350435 0014531 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; class LoginController extends Controller { /* |-------------------------------------------------------------------------- | Login Controller |-------------------------------------------------------------------------- | | This controller handles authenticating users for the application and | redirecting them to your home screen. The controller uses a trait | to conveniently provide its functionality to your applications. | */ use AuthenticatesUsers; /** * Where to redirect users after login. * * @var string */ protected $redirectTo = '/home'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest')->except('logout'); } } Http/Controllers/Auth/ResetPasswordController.php 0000644 00000001670 15213350435 0016261 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; class ResetPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset requests | and uses a simple trait to include this behavior. You're free to | explore this trait and override any methods you wish to tweak. | */ use ResetsPasswords; /** * Where to redirect users after resetting their password. * * @var string */ protected $redirectTo = '/home'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } } Http/Requests/Home/HomePageStoreRequest.php 0000644 00000001250 15213350435 0014751 0 ustar 00 <?php namespace App\Http\Requests\Home; use Illuminate\Foundation\Http\FormRequest; class HomePageStoreRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'lang_id' => 'required', ]; } public function messages(): array { return [ 'lang_id.required' => 'The language field is required', ]; } } Http/Requests/Checkout/CheckoutRequest.php 0000644 00000003165 15213350435 0014700 0 ustar 00 <?php namespace App\Http\Requests\Checkout; use Illuminate\Foundation\Http\FormRequest; class CheckoutRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { $ruleArray = [ 'first_name' => 'required', 'last_name' => 'required', 'company_name' => 'required', 'username' => 'required', 'password' => 'required', 'email' => 'required|email', 'phone' => 'required', 'country' => 'required', 'price' => 'required', 'payment_method' => $this->price != 0 ? 'required' : '', 'receipt' => $this->is_receipt == 1 ? 'required | mimes:jpeg,jpg,png' : '', 'cardNumber' => 'sometimes|required', 'month' => 'sometimes|required', 'year' => 'sometimes|required', 'cardCVC' => 'sometimes|required', 'identity_number' => $this->payment_method == 'Iyzico' ? 'required' : '', 'zip_code' => $this->payment_method == 'Iyzico' ? 'required' : '', ]; if ($this->payment_method == 'stripe') { $ruleArray['stripeToken'] = 'required'; } return $ruleArray; } public function messages(): array { return [ 'receipt.required' => __('The receipt image field is required'). '.' ]; } } Http/Requests/Checkout/ExtendRequest.php 0000644 00000002250 15213350435 0014354 0 ustar 00 <?php namespace App\Http\Requests\Checkout; use Illuminate\Foundation\Http\FormRequest; class ExtendRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules(): array { return [ 'price' => 'required', 'package_id' => 'required', 'start_date' => 'required', 'expire_date' => 'required', 'payment_method' => $this->price != 0 ? 'required' : '', 'receipt' => $this->is_receipt == 1 ? 'required | mimes:jpeg,jpg,png' : '', 'cardNumber' => 'sometimes|required', 'month' => 'sometimes|required', 'year' => 'sometimes|required', 'cardCVC' => 'sometimes|required', ]; } public function messages(): array { return [ 'receipt.required' => 'The receipt field image is required when instruction required receipt image' ]; } } Http/Requests/Front/HotelBooking/RoomBookingRequest.php 0000644 00000010024 15213350436 0017260 0 ustar 00 <?php namespace App\Http\Requests\Front\HotelBooking; use App\Models\User\HotelBooking\Room; use App\Rules\IsRoomAvailableRule; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; class RoomBookingRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { $maxGuests = Room::query()->findOrFail($this->room_id)->max_guests; $ruleArray = [ 'dates' => [ 'required', new IsRoomAvailableRule($this->room_id) ], 'nights' => 'required|numeric|min:1', 'guests' => ['required', 'numeric', 'min:1', 'max:' . $maxGuests], 'customer_name' => 'required', 'customer_phone' => 'required', 'customer_email' => 'required|email:rfc,dns' ]; if ($this->paymentType == 'stripe') { $ruleArray['stripeToken'] = 'required'; } if ($this->paymentType == 'authorize.net') { $ruleArray['AuthorizeCardNumber'] = 'required'; $ruleArray['AuthorizeCardCode'] = 'required'; $ruleArray['AuthorizeMonth'] = 'required'; $ruleArray['AuthorizeYear'] = 'required'; } if ($this->paymentType == 'iyzico') { $ruleArray['city'] = 'required'; $ruleArray['country'] = 'required'; $ruleArray['zip_code'] = 'required'; $ruleArray['address'] = 'required'; $ruleArray['identity_number'] = 'required'; } return $ruleArray; } public function messages() { $keywords = getUserKeywords(); return [ 'dates.required' => $keywords['dates_required'] ?? 'The dates field is required.', 'nights.required' => $keywords['nights_required'] ?? 'The nights field is required.', 'nights.numeric' => $keywords['nights_numeric'] ?? 'The nights must be a number.', 'nights.min' => $keywords['nights_min'] ?? 'The nights must be at least 1.', 'guests.required' => $keywords['guests_required'] ?? 'The guests field is required.', 'guests.numeric' => $keywords['guests_numeric'] ?? 'The guests must be a number.', 'guests.min' => $keywords['guests_min'] ?? 'The guests must be at least 1.', 'guests.max' => $keywords['guests_max'] ?? 'The guests may not be greater than :max.', 'customer_name.required' => $keywords['name_required'] ?? 'The customer name is required.', 'customer_phone.required' => $keywords['phone_required'] ?? 'The customer phone is required.', 'customer_email.required' => $keywords['email_required'] ?? 'The customer email is required.', 'customer_email.email' => $keywords['email_invalid'] ?? 'The customer email must be a valid email address.', 'stripeToken.required' => $keywords['stripe_token_required'] ?? 'Stripe token is required.', 'AuthorizeCardNumber.required' => $keywords['card_number_required'] ?? 'Card number is required.', 'AuthorizeCardCode.required' => $keywords['card_code_required'] ?? 'Card code is required.', 'AuthorizeMonth.required' => $keywords['month_required'] ?? 'Expiration month is required.', 'AuthorizeYear.required' => $keywords['year_required'] ?? 'Expiration year is required.', 'city.required' => $keywords['city_required'] ?? 'City is required.', 'country.required' => $keywords['country_required'] ?? 'Country is required.', 'zip_code.required' => $keywords['zip_required'] ?? 'Zip code is required.', 'address.required' => $keywords['address_required'] ?? 'Address is required.', 'identity_number.required' => $keywords['id_required'] ?? 'Identity number is required.', ]; } } Http/Requests/User/DonationManagement/StoreCause.php 0000644 00000005470 15213350436 0016562 0 ustar 00 <?php namespace App\Http\Requests\User\DonationManagement; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\Language; use App\Rules\ImageMimeTypeRule; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Auth; class StoreCause extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { $ruleArray = [ 'image' => [ 'required', new ImageMimeTypeRule() ], 'goal_amount' => 'required', 'min_amount' => 'required', ]; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $request = $this->request->all(); foreach ($languages as $language) { $slug = slug_create($request[$language->code . '_title']); $ruleArray[$language->code . '_title'] = [ 'required', 'max:255', function ($attribute, $value, $fail) use ($slug, $language) { $cis = DonationContent::where('language_id', $language->id)->where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($cis as $key => $ci) { if (strtolower($slug) == strtolower($ci->slug)) { $fail(__('The title field must be unique for') . ' ' . $language->name . ' ' . __('language') . '.'); } } } ]; $ruleArray[$language->code . '_category_id'] = 'required'; $ruleArray[$language->code . '_content'] = 'min:30'; } return $ruleArray; } public function messages(): array { $messageArray = []; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($languages as $language) { $messageArray[$language->code . '_title.required'] = __('The Title field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_category_id.required'] = __('The Category field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_title.max'] = __('The title field cannot contain more than 255 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_content.min'] = __('The description must be at least 30 characters for') . ' ' . $language->name . ' ' . __('language') . "."; } return $messageArray; } } Http/Requests/User/DonationManagement/UpdateCause.php 0000644 00000005542 15213350436 0016710 0 ustar 00 <?php namespace App\Http\Requests\User\DonationManagement; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\Language; use App\Rules\ImageMimeTypeRule; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Auth; class UpdateCause extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { $ruleArray = [ 'image' => $this->hasFile('image') ? new ImageMimeTypeRule() : '', 'min_amount' => 'required', 'goal_amount' => 'required' ]; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $id = $this->route('id'); $request = $this->request->all(); foreach ($languages as $language) { $slug = slug_create($request[$language->code . '_title']); $ruleArray[$language->code . '_title'] = [ 'required', 'max:255', function ($attribute, $value, $fail) use ($slug, $id, $language) { $cis = DonationContent::where([['donation_id', '<>', $id], ['language_id', $language->id]])->where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($cis as $key => $ci) { if (strtolower($slug) == strtolower($ci->slug)) { $fail(__('The title field must be unique for') . ' ' . $language->name . ' ' . __('language') . '.'); } } } ]; $ruleArray[$language->code . '_category_id'] = 'required'; $ruleArray[$language->code . '_content'] = 'min:30'; } return $ruleArray; } public function messages(): array { $messageArray = []; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($languages as $language) { $messageArray[$language->code . '_title.required'] = __('The Title field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_category_id.required'] = __('The Category field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_title.max'] = __('The title field cannot contain more than 255 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_content.min'] = __('The description must be at least 30 characters for') . ' ' . $language->name . ' ' . __('language') . "."; } return $messageArray; } } Http/Requests/User/HoteBooking/RoomBookingRequest.php 0000644 00000002172 15213350436 0016737 0 ustar 00 <?php namespace App\Http\Requests\User\HoteBooking; use App\Rules\IsRoomAvailableRule; use Illuminate\Foundation\Http\FormRequest; class RoomBookingRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { if ($this->filled('booking_id')) { $booking_id = $this->booking_id; } else { $booking_id = null; } return [ 'dates' => [ 'required', new IsRoomAvailableRule($this->room_id, $booking_id) ], 'nights' => 'required', 'guests' => 'required|numeric|min:1', 'customer_name' => 'required', 'customer_phone' => 'required', 'customer_email' => 'required|email:rfc,dns', 'payment_method' => 'required', 'payment_status' => 'required' ]; } } Http/Requests/User/CourseManagement/CourseCategoryRequest.php 0000644 00000003131 15213350436 0020471 0 ustar 00 <?php namespace App\Http\Requests\User\CourseManagement; use App\Models\User\CourseManagement\CourseCategory; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Auth; use Illuminate\Validation\Rule; class CourseCategoryRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { $langid = (int)$this->user_language_id; $cc = CourseCategory::where('id', (int)$this->id)->select('language_id')->first(); return [ 'user_language_id' => request()->isMethod('POST') ? 'required' : '', 'icon' => request()->isMethod('POST') ? 'required' : '', 'color' => 'required', 'name' => [ 'required', request()->isMethod('POST') ? Rule::unique('user_course_categories')->where(function ($query) use ($langid) { return $query->where('user_id', Auth::guard('web')->user()->id)->where('language_id', $langid); }) : Rule::unique('user_course_categories')->ignore($this->id)->where(function ($query) use ($cc) { return $query->where('user_id', Auth::guard('web')->user()->id)->where('language_id', $cc->language_id); }) ], 'status' => 'required|numeric', 'serial_number' => 'required|numeric' ]; } } Http/Requests/User/CourseManagement/CourseUpdateRequest.php 0000644 00000007237 15213350436 0020151 0 ustar 00 <?php namespace App\Http\Requests\User\CourseManagement; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\Language; use App\Rules\ImageMimeTypeRule; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Auth; class CourseUpdateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { $ruleArray = [ 'thumbnail_image' => $this->hasFile('thumbnail_image') ? new ImageMimeTypeRule() : '', 'video_link' => 'required|url', 'cover_image' => $this->hasFile('cover_image') ? new ImageMimeTypeRule() : '', 'pricing_type' => 'required', 'current_price' => 'required_if:pricing_type,premium' ]; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $id = $this->route('id'); $request = $this->request->all(); foreach ($languages as $language) { $slug = slug_create($request[$language->code . '_title']); $ruleArray[$language->code . '_title'] = [ 'required', 'max:255', function ($attribute, $value, $fail) use ($slug, $id, $language) { $cis = CourseInformation::where('course_id', '<>', $id)->where('language_id', $language->id)->where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($cis as $key => $ci) { if (strtolower($slug) == strtolower($ci->slug)) { $fail(__('The title field must be unique for') . ' ' . $language->name . ' ' . __('language') . '.'); } } } ]; $ruleArray[$language->code . '_category_id'] = 'required'; $ruleArray[$language->code . '_instructor_id'] = 'required'; $ruleArray[$language->code . '_features'] = 'required'; $ruleArray[$language->code . '_description'] = 'min:30'; } return $ruleArray; } public function messages() { $messageArray = []; // $languages = Language::where(Auth::guard('web')->user()->id)->get(); $languages = Language::all(); $messageArray['current_price.required_if'] = __('The current price is required when pricing type is "Premium"') . '.'; foreach ($languages as $language) { $messageArray[$language->code . '_title.required'] = __('The Title field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_title.max'] = __('The Title field cannot contain more than 255 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_category_id.required'] = __('The Category field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_instructor_id.required'] = __('The instructor field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_features.required'] = __('The features field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_description.min'] = __('The description must be at least 30 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; } return $messageArray; } } Http/Requests/User/CourseManagement/Instructor/InstructorStoreRequest.php 0000644 00000001524 15213350436 0023104 0 ustar 00 <?php namespace App\Http\Requests\User\CourseManagement\Instructor; use App\Rules\ImageMimeTypeRule; use Illuminate\Foundation\Http\FormRequest; class InstructorStoreRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { return [ 'image' => [ 'required', new ImageMimeTypeRule() ], 'user_language_id' => 'required', 'name' => 'required|max:255', 'occupation' => 'required|max:255', 'description' => 'required|min:30' ]; } } Http/Requests/User/CourseManagement/Instructor/InstructorUpdateRequest.php 0000644 00000001412 15213350436 0023226 0 ustar 00 <?php namespace App\Http\Requests\User\CourseManagement\Instructor; use App\Rules\ImageMimeTypeRule; use Illuminate\Foundation\Http\FormRequest; class InstructorUpdateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { return [ 'image' => $this->hasFile('image') ? new ImageMimeTypeRule() : '', 'name' => 'required|max:255', 'occupation' => 'required|max:255', 'description' => 'required|min:30' ]; } } Http/Requests/User/CourseManagement/CourseStoreRequest.php 0000644 00000007142 15213350436 0020016 0 ustar 00 <?php namespace App\Http\Requests\User\CourseManagement; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\Language; use App\Rules\ImageMimeTypeRule; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Auth; class CourseStoreRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { $ruleArray = [ 'thumbnail_image' => [ 'required', new ImageMimeTypeRule() ], 'video_link' => 'required|url', 'cover_image' => [ 'required', new ImageMimeTypeRule() ], 'pricing_type' => 'required', 'current_price' => 'required_if:pricing_type,premium' ]; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $request = $this->request->all(); foreach ($languages as $language) { $slug = slug_create($request[$language->code . '_title']); $ruleArray[$language->code . '_title'] = [ 'required', 'max:255', function ($attribute, $value, $fail) use ($slug, $language) { $cis = CourseInformation::where('language_id', $language->id)->where('user_id', Auth::guard('web')->user()->id)->get(); foreach ($cis as $key => $ci) { if (strtolower($slug) == strtolower($ci->slug)) { $fail(__('The title field must be unique for') . ' ' . $language->name . ' ' . __('language') . '.'); } } } ]; $ruleArray[$language->code . '_category_id'] = 'required'; $ruleArray[$language->code . '_instructor_id'] = 'required'; $ruleArray[$language->code . '_features'] = 'required'; $ruleArray[$language->code . '_description'] = 'min:30'; } return $ruleArray; } public function messages(): array { $messageArray = []; $languages = Language::where('user_id', Auth::guard('web')->user()->id)->get(); $messageArray['current_price.required_if'] = __('The current price is required when pricing type is "Premium"') . '.'; foreach ($languages as $language) { $messageArray[$language->code . '_title.required'] = __('The Title field is required for') . ' ' . $language->name . ' ' .__('language') . '.'; $messageArray[$language->code . '_title.max'] = __('The Title field cannot contain more than 255 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_category_id.required'] = __('The Category field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_instructor_id.required'] = __('The instructor field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_features.required'] = __('The features field is required for') . ' ' . $language->name . ' ' . __('language') . '.'; $messageArray[$language->code . '_description.min'] = __('The description must be at least 30 characters for') . ' ' . $language->name . ' ' . __('language') . '.'; } return $messageArray; } } Http/Requests/User/CourseManagement/CourseCouponRequest.php 0000644 00000001341 15213350436 0020160 0 ustar 00 <?php namespace App\Http\Requests\User\CourseManagement; use Illuminate\Foundation\Http\FormRequest; class CourseCouponRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { return [ 'name' => 'required', 'code' => 'required', 'type' => 'required', 'value' => 'required|numeric', 'start_date' => 'required', 'end_date' => 'required', ]; } } Http/Requests/User/HotelBooking/CouponRequest.php 0000644 00000001411 15213350436 0016124 0 ustar 00 <?php namespace App\Http\Requests\User\HotelBooking; use Illuminate\Foundation\Http\FormRequest; class CouponRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { return [ 'name' => 'required', 'code' => 'required', 'type' => 'required', 'value' => 'required|numeric', 'start_date' => 'required', 'end_date' => 'required', 'serial_number' => 'required|numeric' ]; } } Http/Requests/User/HotelBooking/UserRoomBookingRequest.php 0000644 00000002704 15213350436 0017753 0 ustar 00 <?php namespace App\Http\Requests\User\HotelBooking; use App\Rules\IsRoomAvailableRule; use Illuminate\Foundation\Http\FormRequest; class UserRoomBookingRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { // dd($this->booking_id, $this->room_id); // dd($this->all()); if ($this->filled('booking_id')) { $booking_id = $this->booking_id; } else { $booking_id = null; } return [ 'dates' => [ 'required', new IsRoomAvailableRule($this->room_id, $booking_id) ], 'nights' => 'required', 'guests' => 'required|numeric|min:1', 'customer_name' => 'required', 'customer_phone' => 'required', 'customer_email' => 'required|email:rfc,dns', 'payment_method' => 'required', 'payment_status' => 'required' ]; } /** * Get the validation messages that apply to the request. * * @return array */ public function messages() { return [ 'guests.min' => 'The guests must be at least 1 person.' ]; } } Http/Requests/Plan/PlanStoreRequest.php 0000644 00000002200 15213350436 0014155 0 ustar 00 <?php namespace App\Http\Requests\Plan; use Illuminate\Foundation\Http\FormRequest; class PlanStoreRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'name'=> 'required|max:255', 'image'=> 'required', 'amount'=> 'required', 'term'=> 'required', 'status'=> 'required', 'package_id' => 'required' ]; } public function messages() { return [ 'name.required' => 'The name field is required', 'image.required' => 'The image field is required', 'amount.required' => 'The amount field is required', 'term.required' => 'The term field is required', 'status.required' => 'The status field is required', 'package_id.required' => 'The package field is required', ]; } } Http/Requests/Plan/PlanUpdateRequest.php 0000644 00000000760 15213350436 0014314 0 ustar 00 <?php namespace App\Http\Requests\Plan; use Illuminate\Foundation\Http\FormRequest; class PlanUpdateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return false; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ // ]; } } Http/Requests/Package/PackageStoreRequest.php 0000644 00000002775 15213350436 0015300 0 ustar 00 <?php namespace App\Http\Requests\Package; use Illuminate\Foundation\Http\FormRequest; class PackageStoreRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules(): array { $ruleArray = [ 'title' => 'required|max:255', 'term' => 'required', 'price' => 'required', 'status' => 'required', 'staff_limit' => 'required', 'number_of_service_add' => 'required', 'number_of_service_image' => 'required', 'number_of_appointment' => 'required', 'trial_days' => 'required_if:is_trial,1', 'icon' => 'required', ]; return $ruleArray; } public function messages(): array { return [ 'number_of_service_add' => __('Number of service is required'), 'number_of_service_image' => __('Number of servic image is required.'), 'number_of_appointment' => __('Number of appointment is required.'), 'staff_limit' => __('Staff limit field is required.'), 'icon' => __('Icon field is required.'), 'trial_days' => __('Trial days is required.'), ]; } // public function attributes(): array // { // return [ // 'title' => __('Package Title'), // 'term' => __('term'), // 'price' => __('price'), // 'status' => __('status'), // ]; // } } Http/Requests/Package/PackageUpdateRequest.php 0000644 00000002727 15213350436 0015423 0 ustar 00 <?php namespace App\Http\Requests\Package; use Illuminate\Foundation\Http\FormRequest; class PackageUpdateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules(): array { $ruleArray = [ 'title' => 'required|max:255', 'term' => 'required', 'price' => 'required', 'status' => 'required', 'staff_limit' => 'required', 'number_of_service_add' => 'required', 'number_of_service_image' => 'required', 'number_of_appointment' => 'required', 'trial_days' => $this->is_trial == "1" ? 'required' : '', ]; return $ruleArray; } public function messages(): array { return [ 'number_of_service_add' => __('Number of service is required'), 'number_of_service_image' => __('Number of servic image is required.'), 'number_of_appointment' => __('Number of appointment is required.'), 'staff_limit' => __('Staff limit field is required.'), 'icon' => __('Icon field is required.'), 'trial_days' => __('Trial days is required.'), ]; } public function attributes(): array { return [ 'title' => __('Package Title'), 'term' => __('term'), 'price' => __('price'), 'status' => __('status'), ]; } } Http/Middleware/Demo.php 0000644 00000001141 15213350436 0011134 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; class Demo { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (env('DEMO_MODE') == 'active') { if ($request->isMethod('POST') || $request->isMethod('PUT')) { session()->flash('warning', 'This is Demo version. You can not change anything.'); return redirect()->back(); } } return $next($request); } } Http/Middleware/UserRegisteredUserStatus.php 0000644 00000002062 15213350436 0015252 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class UserRegisteredUserStatus { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle(Request $request, Closure $next) { if (Auth::guard('web')->check() && getUser()->username == Auth::guard('web')->user()->username) { return $next($request); } $userInfo = Auth::guard('customer')->user(); if ($userInfo->status == 0) { Auth::guard('customer')->logout(); $request->session()->flash('error', 'Sorry, your account has been deactivated.'); return redirect()->route('customer.login', getParam()); } elseif (empty(Auth::guard('customer')->user()->email_verified_at)) { Auth::guard('customer')->logout(); $request->session()->flash('error', 'Your email is not verified!'); return redirect()->route('customer.login', getParam()); } return $next($request); } } Http/Middleware/UserWebsiteLanguageMiddleware.php 0000644 00000003212 15213350436 0016154 0 ustar 00 <?php namespace App\Http\Middleware; use App\Models\User\Language; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\View; class UserWebsiteLanguageMiddleware { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next) { if (session()->has('user_midtrans')) { $user = session()->get('user_midtrans'); } else { $user = getUser(); // Make sure this function is available } if (session()->has('user_lang')) { $userCurrentLang = Language::where('code', session()->get('user_lang')) ->where('user_id', $user->id) ->first(); if (empty($userCurrentLang)) { $userCurrentLang = Language::where('is_default', 1) ->where('user_id', $user->id) ->first(); session()->put('user_lang', $userCurrentLang->code); } } else { $userCurrentLang = Language::where('is_default', 1) ->where('user_id', $user->id) ->first(); } if ($userCurrentLang) { app()->setLocale($userCurrentLang->code); // $keywords = json_decode($userCurrentLang->keywords, true); // View::share('keywords', $keywords); } return $next($request); } } Http/Middleware/TrimStrings.php 0000644 00000000526 15213350436 0012543 0 ustar 00 <?php namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; class TrimStrings extends Middleware { /** * The names of the attributes that should not be trimmed. * * @var array */ protected $except = [ 'current_password', 'password', 'password_confirmation', ]; } Http/Middleware/VerifyCsrfToken.php 0000644 00000002713 15213350436 0013341 0 ustar 00 <?php namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; class VerifyCsrfToken extends Middleware { /** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = [ '/get-model', '/shop/purchase-product/razorpay/notify', '/shop/purchase-product/flutterwave/notify', '/shop/purchase-product/paytm/notify', '/services/paytm/payment/notify', '/admin/menu-builder/update-menus', '/push-notification/store-endpoint', 'shop/update-cart', '/*paytm/payment-status*', '/vendor/membership/mercadopago/cancel', '/vendor/membership/mercadopago/success', '*/vendor/membership/razorpay/success', '*/vendor/membership/razorpay/cancel', '/vendor/membership/instamojo/cancel', '/*flutterwave/success', '/vendor/membership/flutterwave/cancel', '/vendor/membership/mollie/cancel', '/membership/paytm/payment-status*', '/membership/mercadopago/cancel', '/membership/razorpay/success', '/membership/razorpay/cancel', '/membership/instamojo/cancel', '/membership/flutterwave/success', '/membership/flutterwave/cancel', '/membership/mollie/cancel', '*/iyzico/success', //use for membership buy '*/paytabs/success', //use for membership buy '*/notify/paytabs', //use for appointment booking '*/notify/iyzico', //use for appointment booking '*/myfatoorah/callback' ]; } Http/Middleware/CheckStatus.php 0000644 00000001243 15213350436 0012474 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Auth; use Session; class CheckStatus { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (Auth::guard('admin')->check() && !empty(Auth::guard('admin')->user()->role_id) && Auth::guard('admin')->user()->status == 0) { Auth::guard('admin')->logout(); Session::flash('warning', 'Your account has been banned by Admin!'); return redirect()->route('admin.login'); } return $next($request); } } Http/Middleware/RedirectIfAuthenticated.php 0000644 00000001662 15213350436 0015003 0 ustar 00 <?php namespace App\Http\Middleware; use App\Providers\RouteServiceProvider; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class RedirectIfAuthenticated { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @param string|null ...$guards * @return mixed */ public function handle(Request $request, Closure $next, ...$guards) { $guards = empty($guards) ? [null] : $guards; foreach ($guards as $guard) { if ($guard == 'admin' && Auth::guard($guard)->check()) { return redirect()->route('admin.dashboard'); } if ($guard == 'web' && Auth::guard($guard)->check()) { return redirect()->route('user.dashboard'); } if ($guard == 'vendor' && Auth::guard($guard)->check()) { return redirect()->route('vendor.dashboard'); } } return $next($request); } } Http/Middleware/AdminLocale.php 0000644 00000001277 15213350436 0012432 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use App\Models\Language; use Illuminate\Http\Request; class AdminLocale { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle(Request $request, Closure $next) { if (session()->has('admin_lang')) { app()->setLocale(session()->get('admin_lang')); } else { $defaultLang = Language::where('is_default', 1)->first(); if (!empty($defaultLang)) { app()->setLocale($defaultLang->code); } } return $next($request); } } Http/Middleware/CheckPermission.php 0000644 00000001512 15213350436 0013340 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; class CheckPermission { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next, $permission) { // if the admin is logged in & he has a role defined then this check will be applied if (Auth::guard('admin')->check() && !empty(Auth::guard('admin')->user()->role)) { $admin = Auth::guard('admin')->user(); $permissions = json_decode($admin->role->permissions, true); if (!in_array($permission, $permissions)) { return redirect()->route('admin.dashboard'); } } return $next($request); } } Http/Middleware/UserStatus.php 0000644 00000001347 15213350436 0012402 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; class UserStatus { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (Auth::guard('web')->check() && !Auth::guard('admin')->check()) { if (Auth::guard('web')->user()->status != 1) { Auth::guard('web')->logout(); Session::flash('error', 'Your account has been banned!'); return redirect(route('front.index')); } } return $next($request); } } Http/Middleware/CheckForMaintenanceMode.php 0000644 00000000537 15213350436 0014714 0 ustar 00 <?php namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware; class CheckForMaintenanceMode extends Middleware { /** * The URIs that should be reachable while maintenance mode is enabled. * * @var array */ protected $except = [ 'admin/*', 'admin' ]; } Http/Middleware/SetUserDashboardMiddleware.php 0000644 00000003207 15213350436 0015455 0 ustar 00 <?php namespace App\Http\Middleware; use App\Models\Language as AdminLanguage; use App\Models\User\BasicSetting; use App\Models\User\Language; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Session; use Symfony\Component\HttpFoundation\Response; class SetUserDashboardMiddleware { /** * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ public function handle(Request $request, Closure $next): Response { $user = Auth::guard('web')->user(); $langCode = BasicSetting::where('user_id', $user->id)->select('dashboard_language') ->first(); if ($langCode && !empty($langCode->dashboard_language)) { $userDashboardLang = AdminLanguage::where('id', $langCode->dashboard_language) ->first(); if (empty($userDashboardLang)) { $userDashboardLang = AdminLanguage::where('is_default', 1) ->first(); } } else { $userDashboardLang = AdminLanguage::where('is_default', 1) ->first(); } // Set sessions and application locale Session::put('user_dashboard_lang', 'user_' . $userDashboardLang->code); Session::put('currentLangCode', $userDashboardLang->code); Session::put('dashboard_direction', $userDashboardLang->rtl); app()->setLocale('user_' . $userDashboardLang->code); return $next($request); } } Http/Middleware/TrustProxies.php 0000644 00000001061 15213350436 0012744 0 ustar 00 <?php namespace App\Http\Middleware; use Fideloper\Proxy\TrustProxies as Middleware; use Illuminate\Http\Request; class TrustProxies extends Middleware { /** * The trusted proxies for this application. * * @var array|string|null */ protected $proxies; /** * The headers that should be used to detect proxies. * * @var int */ protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB; } Http/Middleware/VerifyCsrfMiddleware.php 0000644 00000001460 15213350436 0014334 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Illuminate\Session\TokenMismatchException; use Illuminate\Support\Facades\Config; class VerifyCsrfMiddleware extends \Illuminate\Foundation\Http\Middleware\VerifyCsrfToken { public function handle($request, Closure $next) { if ($this->isReading($request) || $this->excludedRoutes($request) || $this->tokensMatch($request) || $this->runningUnitTests()) { return $this->addCookieToResponse($request, $next($request)); } throw new TokenMismatchException; } protected function excludedRoutes($request) { $routes = Config::get('indipay.remove_csrf_check'); foreach($routes as $route) if ($request->is($route)) return true; return false; } } Http/Middleware/RouteAccess.php 0000644 00000002060 15213350436 0012471 0 ustar 00 <?php namespace App\Http\Middleware; use App\Http\Helpers\UserPermissionHelper; use App\Models\User; use App\Models\User\UserPermission; use Closure; use Illuminate\Http\Request; class RouteAccess { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle(Request $request, Closure $next, $pages) { $user = getUser(); $currentPackage = UserPermissionHelper::userPackage($user->id); $packagePermissions = UserPermissionHelper::packagePermission($user->id); $packagePermissions = json_decode($packagePermissions, true); $permissions = explode("|", $pages); $access = false; foreach ($permissions as $permission) { if (in_array($permission, $packagePermissions)) { $access = true; } } if (!$access) { return redirect()->route('front.user.detail.view', getParam()); } return $next($request); } } Http/Middleware/LfmPath.php 0000644 00000001664 15213350436 0011615 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; class LfmPath { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next) { // set the base path for laravel filemanager if (config('filesystems.disks.public.root') != 'assets/lfm') { config([ 'filesystems.disks.public.root' => 'assets/lfm' ]); } if (config('filesystems.disks.public.url') != url('/') . '/assets/lfm') { config([ 'filesystems.disks.public.url' => url('/') . '/assets/lfm' ]); } return $next($request); } } Http/Middleware/CheckWebsiteOwner.php 0000644 00000001640 15213350436 0013627 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; use App\Http\Helpers\UserPermissionHelper; class CheckWebsiteOwner { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { // this is only for path based URL $author = getUser(); if (!empty($author)) { // if the 'Website Owner' of the 'Autherticated User' does not match with the 'Retrieved Owner', then redirect to home if (Auth::guard('customer')->check() && Auth::guard('customer')->user()->user->username != $author->username) { return redirect()->route('customer.dashboard', Auth::guard('customer')->user()->user->username); } } return $next($request); } } Http/Middleware/SetLangMiddleware.php 0000644 00000001237 15213350436 0013611 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use App\Models\Language; use App; class SetLangMiddleware { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (session()->has('lang')) { app()->setLocale(session()->get('lang')); } else { $defaultLang = Language::where('is_default', 1)->first(); if (!empty($defaultLang)) { app()->setLocale($defaultLang->code); } } return $next($request); } } Http/Middleware/EncryptCookies.php 0000644 00000000424 15213350436 0013214 0 ustar 00 <?php namespace App\Http\Middleware; use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; class EncryptCookies extends Middleware { /** * The names of the cookies that should not be encrypted. * * @var array */ protected $except = [ // ]; } Http/Middleware/CheckPermissionUser.php 0000644 00000002271 15213350436 0014202 0 ustar 00 <?php namespace App\Http\Middleware; use App\Http\Helpers\UserPermissionHelper; use Closure; use Auth; class CheckPermissionUser { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next, $permission) { // dd($permission); // if the admin is logged in & he has a role defined then this check will be applied if (Auth::check()) { $user = Auth::user(); $permissions = UserPermissionHelper::packagePermission($user->id); if (!empty($user)) { $packagePermissions = json_decode($permissions, true); $permissions = explode("|", $permission); $access = false; foreach ($permissions as $permission) { if (in_array($permission, $packagePermissions)) { $access = true; } } if (!$access) { return redirect()->route('user-dashboard'); } } } return $next($request); } } Http/Middleware/Authenticate.php 0000644 00000001402 15213350436 0012666 0 ustar 00 <?php namespace App\Http\Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware; use Illuminate\Support\Facades\Route; class Authenticate extends Middleware { /** * Get the path the user should be redirected to when they are not authenticated. * * @param \Illuminate\Http\Request $request * @return string|null */ protected function redirectTo($request) { if (!$request->expectsJson()) { if (Route::is('admin.*')) { return route('admin.login'); } if (Route::is('user.*')) { return route('user.login'); } if (Route::is('vendor.*')) { return route('vendor.login'); } if (Route::is('staff.*')) { return route('staff.login'); } } } } Http/Kernel.php 0000644 00000005666 15213350436 0007433 0 ustar 00 <?php namespace App\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * * These middleware are run during every request to your application. * * @var array */ protected $middleware = [ \App\Http\Middleware\TrustProxies::class, \Fruitcake\Cors\HandleCors::class, \App\Http\Middleware\PreventRequestsDuringMaintenance::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, ]; /** * The application's route middleware groups. * * @var array */ protected $middlewareGroups = [ 'web' => [ \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, ], 'api' => [ 'throttle:api', \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; /** * The application's route middleware. * * These middleware may be assigned to groups or used individually. * * @var array */ protected $routeMiddleware = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'change.lang' => \App\Http\Middleware\ChangeLanguage::class, 'exists.down' => \App\Http\Middleware\RedirectIfDownFileExists::class, 'account.status' => \App\Http\Middleware\PreventRequestsForDeactivatedAccount::class, 'permission' => \App\Http\Middleware\HasPermission::class, 'certificate.status' => \App\Http\Middleware\EnsureCertificateIsEnable::class, 'Deactive' => \App\Http\Middleware\Deactive::class, 'shop.status' => \App\Http\Middleware\ShopStatusCheck::class, 'limitCheck' => \App\Http\Middleware\LimitCheckMiddleware::class, 'checkPackage' => \App\Http\Middleware\CheckPackage::class, 'staffCheck' => \App\Http\Middleware\StaffPermission::class, 'adminlang' => \App\Http\Middleware\AdminLangMiddleware::class, 'vendorlang' => \App\Http\Middleware\VendorLangMiddleware::class, 'stafflang' => \App\Http\Middleware\StaffLangMiddleware::class, ]; } Http/Helpers/UploadFile.php 0000644 00000001162 15213350436 0011624 0 ustar 00 <?php namespace App\Http\Helpers; class UploadFile { public static function store($directory, $file) { $extension = $file->getClientOriginalExtension(); $fileName = uniqid() . '.' . $extension; @mkdir($directory, 0775, true); $file->move($directory, $fileName); return $fileName; } public static function update($directory, $newFile, $oldFile) { @unlink($directory . $oldFile); $extension = $newFile->getClientOriginalExtension(); $fileName = uniqid() . '.' . $extension; @mkdir($directory, 0775, true); $newFile->move($directory, $fileName); return $fileName; } } Http/Helpers/Uploader.php 0000644 00000007104 15213350436 0011355 0 ustar 00 <?php namespace App\Http\Helpers; use Illuminate\Support\Facades\Auth; // use getId3; class Uploader { public static function upload_picture($directory, $img): string { $file_name = sha1(time() . rand()); $directory = public_path($directory); if (!file_exists($directory)) { if (!mkdir($directory, 0775, true)) { //0777 die('Failed to create folders...'); } } $ext = $img->getClientOriginalExtension(); $newFileName = $file_name . "." . $ext; $img->move($directory, $newFileName); return $newFileName; } public static function update_picture($directory, $img, $old_img): string { $file_name = sha1(time() . rand()); $directory = public_path($directory); if (!file_exists($directory)) { if (!mkdir($directory, 0775, true)) { //0777 die('Failed to create folders...'); } } $ext = $img->getClientOriginalExtension(); $newFileName = $file_name . "." . $ext; $oldImgPath = $directory . '/' . $old_img; if (file_exists($oldImgPath)) @unlink($oldImgPath); $img->move($directory, $newFileName); return $newFileName; } public static function upload_file($directory, $file, $user_id = null) { $user_id = $user_id ?? Auth::guard('web')->user()->id; $file_name = sha1(time() . rand()); $originalName = $file->getClientOriginalName(); $ext = $file->getClientOriginalExtension(); $newFileName = $file_name . "." . $ext; $directory = public_path($directory); if (!file_exists($directory)) { if (!mkdir($directory, 0755, true)) { die('Failed to create folders...'); } } $file->move($directory, $newFileName); return [ 'originalName' => $originalName, 'uniqueName' => $newFileName ]; } public static function remove($directory, $filename): void { $pathToFile = $directory . '/' . $filename; $pathToFile = public_path($pathToFile); if (file_exists($pathToFile)) { @unlink($pathToFile); } } public static function upload_video($directory, $file, $user_id = null) { $user_id = $user_id ?? Auth::guard('web')->user()->id; $file_name = sha1(time() . rand()); $originalName = $file->getClientOriginalName(); $ext = $file->getClientOriginalExtension(); $newFileName = $file_name . "." . $ext; $directory = public_path($directory); if (!file_exists($directory)) { if (!mkdir($directory, 0755, true)) { die('Failed to create folders...'); } } // dd('ok'); $file->move($directory, $newFileName); // get video duration after the video upload $getID3 = new \getID3; $fileInfo = $getID3->analyze($directory . '/' . $newFileName); if (isset($fileInfo['playtime_seconds'])) { $duration = gmdate('H:i:s', $fileInfo['playtime_seconds']); } else { $duration = ''; } return [ 'originalName' => $originalName, 'uniqueName' => $newFileName, 'duration' => $duration ]; } public static function downloadFile($directory, $file_unique_name, $originalName, $bs) { $pathToFile = $directory . '/' . $file_unique_name; $pathToFile = public_path($pathToFile); return response()->download($pathToFile, $originalName); } } Http/Helpers/cacert.pem 0000644 00000751357 15213350436 0011055 0 ustar 00 ## ## Bundle of CA Root Certificates ## ## Certificate data from Mozilla as of: Wed Apr 20 03:12:05 2016 ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates ## file (certdata.txt). This file can be found in the mozilla source tree: ## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt ## ## It contains the certificates in PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with ## an Apache+mod_ssl webserver for SSL client authentication. ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.25. ## SHA1: 5df367cda83086392e1acdf22bfef00c48d5eba6 ## GlobalSign Root CA ================== -----BEGIN CERTIFICATE----- MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== -----END CERTIFICATE----- GlobalSign Root CA - R2 ======================= -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp 9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu 01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== -----END CERTIFICATE----- Verisign Class 3 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQU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9s1+ivbrmAJXx5f j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC /Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== -----END CERTIFICATE----- Entrust.net Premium 2048 Secure Server CA ========================================= -----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= -----END CERTIFICATE----- Baltimore CyberTrust Root ========================= -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp -----END CERTIFICATE----- AddTrust Low-Value Services Root ================================ -----BEGIN CERTIFICATE----- MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU cnVzdCBDbGFzcy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dXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= -----END CERTIFICATE----- AddTrust External Root ====================== -----BEGIN CERTIFICATE----- MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 +iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy 2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= -----END CERTIFICATE----- AddTrust Public Services Root ============================= -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB /zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL +YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= -----END CERTIFICATE----- AddTrust Qualified Certificates Root ==================================== -----BEGIN CERTIFICATE----- MIIEHjCCAwagAwIBAgIBATANBgkqhkiG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4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= -----END CERTIFICATE----- Entrust Root Certification Authority ==================================== -----BEGIN CERTIFICATE----- MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYs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w4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm Mw== -----END CERTIFICATE----- GeoTrust Global CA 2 ==================== -----BEGIN CERTIFICATE----- MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF H4z1Ir+rzoPz4iIprn2DQKi6bA== -----END CERTIFICATE----- GeoTrust Universal CA ===================== -----BEGIN CERTIFICATE----- MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs 7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d 8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmk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6DHpx8Uq79AtoS qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== -----END CERTIFICATE----- Comodo AAA Services root ======================== -----BEGIN CERTIFICATE----- MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm 7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z 8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C 12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== -----END CERTIFICATE----- Comodo Secure Services root =========================== -----BEGIN CERTIFICATE----- MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP 9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm 4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H RR3B7Hzs/Sk= -----END CERTIFICATE----- Comodo Trusted Services root ============================ -----BEGIN CERTIFICATE----- MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAw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FrR4pTqHTI2KpdVGl/IsELm8 VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u -----END CERTIFICATE----- QuoVadis Root CA 3 ================== -----BEGIN CERTIFICATE----- MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1x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k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= -----END CERTIFICATE----- Security Communication Root CA ============================== -----BEGIN CERTIFICATE----- MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw 8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX 5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g 0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ 6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi FL39vmwLAw== -----END CERTIFICATE----- Sonera Class 2 Root CA ====================== -----BEGIN CERTIFICATE----- MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 /Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt 0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH llpwrN9M -----END CERTIFICATE----- UTN USERFirst Hardware Root CA ============================== -----BEGIN CERTIFICATE----- MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM //bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 nfhmqA== -----END CERTIFICATE----- Camerfirma Chambers of Commerce Root ==================================== -----BEGIN CERTIFICATE----- MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UECh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AYD VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 erfutGWaIZDgqtCYvDi1czyL+Nw= -----END CERTIFICATE----- Camerfirma Global Chambersign Root ================================== -----BEGIN CERTIFICATE----- MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6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N1j3hybX2C32 qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b vZ8= -----END CERTIFICATE----- Starfield Class 2 CA ==================== -----BEGIN CERTIFICATE----- MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQ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ACPq4xJD KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 QBFGmh95DmK/D5fs4C8fF5Q= -----END CERTIFICATE----- StartCom Certification Authority ================================ -----BEGIN CERTIFICATE----- MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt 2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z 6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ osmLFqa7L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BAQUFAAOC AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh 3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl 1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro g14= -----END CERTIFICATE----- Taiwan GRCA =========== -----BEGIN CERTIFICATE----- MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1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2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW NY6E0F/6MBr1mmz0DlP5OlvRHA== -----END CERTIFICATE----- DigiCert Assured ID Root CA =========================== -----BEGIN CERTIFICATE----- MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO 9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW /lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF 66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i 8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== -----END CERTIFICATE----- DigiCert Global Root CA ======================= -----BEGIN CERTIFICATE----- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H 4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y 7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm 8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= -----END CERTIFICATE----- DigiCert High Assurance EV Root CA ================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu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CWw9E1CAx2/S6cCZdkGCe vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K -----END CERTIFICATE----- Certplus Class 2 Primary CA =========================== -----BEGIN CERTIFICATE----- MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR 5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD P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BAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ -----END CERTIFICATE----- DST ACES CA X6 ============== -----BEGIN CERTIFICATE----- MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 oKfN5XozNmr6mis= -----END CERTIFICATE----- SwissSign Gold CA - G2 ====================== -----BEGIN CERTIFICATE----- MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp c3NTaWduIEFHMR8wHQ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xyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr 44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ -----END CERTIFICATE----- SwissSign Silver CA - G2 ======================== -----BEGIN CERTIFICATE----- MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG 9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 N0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Iwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx /uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u -----END CERTIFICATE----- GeoTrust Primary Certification Authority ======================================== -----BEGIN CERTIFICATE----- MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG 1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= -----END CERTIFICATE----- thawte Primary Root CA ====================== -----BEGIN CERTIFICATE----- MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 MDAwMDAwW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P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== -----END CERTIFICATE----- VeriSign Class 3 Public Primary Certification Authority - G5 ============================================================ -----BEGIN CERTIFICATE----- MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2R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Z0vPB4zmAve14bRDtUstFJ/5 3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW -----END CERTIFICATE----- COMODO Certification Authority ============================== -----BEGIN CERTIFICATE----- MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH +7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV 4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA 1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN +8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== -----END CERTIFICATE----- Network Solutions Certificate Authority ======================================= -----BEGIN CERTIFICATE----- MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc /Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q 4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey -----END CERTIFICATE----- WellsSecure Public Root Certificate Authority ============================================= -----BEGIN CERTIFICATE----- MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLD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rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ tylv2G0xffX8oRAHh84vWdw+WNs= -----END CERTIFICATE----- COMODO ECC Certification Authority ================================== -----BEGIN CERTIFICATE----- MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X 4QokPB0BBO490o0JlwzgdeT6+3eKKvU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X/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF 0mBWWg== -----END CERTIFICATE----- Security Communication EV RootCA1 ================================= -----BEGIN CERTIFICATE----- MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO /VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK 9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 -----END CERTIFICATE----- OISTE WISeKey Global Root GA CA =============================== -----BEGIN CERTIFICATE----- MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCA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QA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= -----END CERTIFICATE----- Microsec e-Szigno Root CA ========================= -----BEGIN CERTIFICATE----- MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc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r4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU Cm26OWMohpLzGITY+9HPBVZkVw== -----END CERTIFICATE----- Cybertrust Global Root ====================== -----BEGIN CERTIFICATE----- MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW 0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin 89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT 8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi 5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW WL1WMRJOEcgh4LMRkWXbtKaIOM5V -----END CERTIFICATE----- ePKI Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX 12ruOzjjK9SXDrkb5wdJfzcq+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W6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= -----END CERTIFICATE----- T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 ============================================================================================================================= -----BEGIN CERTIFICATE----- MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdG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8QZ5q9w5w wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho -----END CERTIFICATE----- EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 ========================================================================== -----BEGIN CERTIFICATE----- MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58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0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m mxE= -----END CERTIFICATE----- ApplicationCA - Japanese Government =================================== -----BEGIN CERTIFICATE----- MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g /DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL rosot4LKGAfmt1t06SAZf7IbiVQ= -----END CERTIFICATE----- GeoTrust Primary Certification Authority - G3 ============================================= -----BEGIN CERTIFICATE----- MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr 2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt -----END CERTIFICATE----- thawte Primary Root CA - G2 =========================== -----BEGIN CERTIFICATE----- MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== -----END CERTIFICATE----- thawte Primary Root CA - G3 =========================== -----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w ODA0MDIwM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YvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= -----END CERTIFICATE----- GeoTrust Primary Certification Authority - G2 ============================================= -----BEGIN CERTIFICATE----- MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 npaqBA+K -----END CERTIFICATE----- VeriSign Universal Root Certification Authority =============================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YDVR0PAQH/BAQDAgEGMG0G CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 mJO37M2CYfE45k+XmCpajQ== -----END CERTIFICATE----- VeriSign Class 3 Public Primary Certification Authority - G4 ============================================================ -----BEGIN CERTIFICATE----- MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB /zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== -----END CERTIFICATE----- NetLock Arany (Class Gold) Főtanúsítvány ============================================ -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9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31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= -----END CERTIFICATE----- Staat der Nederlanden Root CA - G2 ================================== -----BEGIN CERTIFICATE----- MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ 5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 48r6f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IAaQBtAGkAcwBrAGUA cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 yyqcjg== -----END CERTIFICATE----- Hongkong Post Root CA 1 ======================= -----BEGIN CERTIFICATE----- MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== -----END CERTIFICATE----- SecureSign RootCA11 =================== -----BEGIN CERTIFICATE----- MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw KQYDVQQKEyJKYXBhb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BD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== -----END CERTIFICATE----- Microsec e-Szigno Root CA 2009 ============================== -----BEGIN CERTIFICATE----- MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0Bl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a67c2Pm2G2JwCz02 yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi LXpUq3DDfSJlgnCW -----END CERTIFICATE----- GlobalSign Root CA - R3 ======================= -----BEGIN CERTIFICATE----- MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ 0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r kpeDMdmztcpHWD9f -----END CERTIFICATE----- Autoridad de Certificacion Firmaprofesional CIF A62634068 ========================================================= -----BEGIN CERTIFICATE----- MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY 7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX MbScy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YMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi 6Et8Vcad+qMUu2WFbm5PEn4KPJ2V -----END CERTIFICATE----- Izenpe.com ========== -----BEGIN CERTIFICATE----- MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ 03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU +zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK 0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57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xOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== -----END CERTIFICATE----- Chambers of Commerce Root - 2008 ================================ -----BEGIN CERTIFICATE----- MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ ikilTWh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awk0lgH 3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF 9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ -----END CERTIFICATE----- Global Chambersign Root - 2008 ============================== -----BEGIN CERTIFICATE----- MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpc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YWRkcmVzcyBhdCB3d3cuY2FtZXJm aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp 1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG /5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg 9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z 09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B -----END CERTIFICATE----- Go Daddy Root Certificate Authority - G2 ======================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIB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OrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 -----END CERTIFICATE----- Starfield Root Certificate Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx 4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 -----END CERTIFICATE----- Starfield Services Root Certificate Authority - G2 ================================================== -----BEGIN CERTIFICATE----- MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 -----END CERTIFICATE----- AffirmTrust Commercial ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv 0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= -----END CERTIFICATE----- AffirmTrust Networking ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0Fm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6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB /wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC 6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK +4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== -----END CERTIFICATE----- AffirmTrust Premium ECC ======================= -----BEGIN CERTIFICATE----- MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X 57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM eQ== -----END CERTIFICATE----- Certum Trusted Network CA ========================= -----BEGIN CERTIFICATE----- MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= -----END CERTIFICATE----- Certinomis - Autorité Racine ============================= -----BEGIN CERTIFICATE----- MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw J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DX/nyNTt7buFHAAQCva R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ vgt2Fl43N+bYdJeimUV5 -----END CERTIFICATE----- Root CA Generalitat Valenciana ============================== -----BEGIN CERTIFICATE----- MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1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HAA OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt +GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= -----END CERTIFICATE----- TWCA Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP 4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG 9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== -----END CERTIFICATE----- Security Communication RootCA2 ============================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkg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k4q7D7SzIKiGGUzE3eeml0a E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw 0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D 5EI= -----END CERTIFICATE----- Hellenic Academic and Research Institutions RootCA 2011 ======================================================= -----BEGIN CERTIFICATE----- MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmV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zNzvoc7dIsXRSZMFpGD /md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N 7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 -----END CERTIFICATE----- Actalis Authentication Root CA ============================== -----BEGIN CERTIFICATE----- MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8Vq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CPLy64Lo7yFIrM6bV8+2ydDKXhlg== -----END CERTIFICATE----- Trustis FPS Root CA =================== -----BEGIN CERTIFICATE----- MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P 8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl iB6XzCGcKQENZetX2fNXlrtIzYE= -----END CERTIFICATE----- StartCom Certification Authority ================================ -----BEGIN CERTIFICATE----- MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 NjM3WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt 2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z 6+hsTX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jo/n3JR5 fPGFf59Jb2vKXfuM/gTFwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWm N3PH/UvSTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst0OcN Org+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNcpRJvkrKTlMeIFw6T tn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA 2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8= -----END CERTIFICATE----- StartCom Certification Authority G2 =================================== -----BEGIN CERTIFICATE----- MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp dHkgRzIwggIiMA0GCSqGSIb3DQEB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aP4NK75t98biGC wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN rJgWVqA= -----END CERTIFICATE----- Buypass Class 3 Root CA ======================= -----BEGIN CERTIFICATE----- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR 5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh 7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH 2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV /afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz 6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi Cp/HuZc= -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 3 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w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7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== -----END CERTIFICATE----- EE Certification Centre Root CA =============================== -----BEGIN CERTIFICATE----- MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2 rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw 93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU 3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM dcGWxZ0= -----END CERTIFICATE----- TURKTRUST Certificate Services Provider Root 2007 ================================================= -----BEGIN CERTIFICATE----- MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK poRq0Tl9 -----END CERTIFICATE----- D-TRUST Root Class 3 CA 2 2009 ============================== -----BEGIN CERTIFICATE----- M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jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm 2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= -----END CERTIFICATE----- D-TRUST Root Class 3 CA 2 EV 2009 ================================= -----BEGIN CERTIFICATE----- MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T 7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ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kxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNy YWl6LnN1c2NlcnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1 n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo 5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq 3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5 poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km -----END CERTIFICATE----- China Internet Network Information Center EV Certificates Root ============================================================== -----BEGIN CERTIFICATE----- MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV BA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Rdpg065lYZ1Tg3TC rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX 5OfNeOI5wSsSnqaeG8XmDtkx2Q== -----END CERTIFICATE----- Swisscom Root EV CA 2 ===================== -----BEGIN CERTIFICATE----- MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaCNYGu+HuB5ur+rPQa m3Rc6I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bHzMVTdDypVP1y+E9Tmgt2BLdqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNV HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ 04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85 YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ a7+h89n07eLw4+1knj0vllJPgFOL -----END CERTIFICATE----- CA Disig Root R2 ================ -----BEGIN CERTIFICATE----- MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp ZyBSb290IFIyMB4XDTEyM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grdLQABDzfuBSO6N+pjWxn kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M 8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg /eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= -----END CERTIFICATE----- TeliaSonera Root CA v1 ====================== -----BEGIN CERTIFICATE----- MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlR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qhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx 0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= -----END CERTIFICATE----- E-Tugra Certification Authority =============================== -----BEGIN CERTIFICATE----- MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx QDA+BgNVBAoMN0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3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G C7TbO6Orb1wdtn7os4I07QZcJA== -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 2 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR 3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN 9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== -----END CERTIFICATE----- Atos TrustedRoot 2011 ===================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcN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4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KOTk0k+17kBL5yG6YnLUlamXrXXAkg t3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOtzCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZI hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3 GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP +V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh 3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6 O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0 FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV hMJKzRwuJIczYOXD -----END CERTIFICATE----- QuoVadis Root CA 2 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1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ePIlUnwEsBbTuZDdQdm2NnL9Du DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX 0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 PpxxVJkES/1Y+Zj0 -----END CERTIFICATE----- DigiCert Assured ID Root G2 =========================== -----BEGIN CERTIFICATE----- MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH 35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv 0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo IhNzbM8m9Yop5w== -----END CERTIFICATE----- DigiCert Assured ID Root G3 =========================== -----BEGIN CERTIFICATE----- MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy 1vUhZscv6pZjamVFkpUBtA== -----END CERTIFICATE----- DigiCert Global Root G2 ======================= -----BEGIN CERTIFICATE----- MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO 3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu 5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl MrY= -----END CERTIFICATE----- DigiCert Global Root G3 ======================= -----BEGIN CERTIFICATE----- MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw MDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5k aWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0C AQYFK4EEACIDYgAE3afZu4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aNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFOBNv9ybQV0T6GTwp+kVpOGBwboxMA0GCSqGSIb3DQEBCwUA A4ICAQBqinA4WbbaixjIvirTthnVZil6Xc1bL3McJk6jfW+rtylNpumlEYOnOXOvEESS5iVdT2H6 yAa+Tkvv/vMx/sZ8cApBWNromUuWyXi8mHwCKe0JgOYKOoICKuLJL8hWGSbueBwj/feTZU7n85iY r83d2Z5AiDEoOqsuC7CsDCT6eiaY8xJhEPRdF/d+4niXVOKM6Cm6jBAyvd0zaziGfjk9DgNyp115 j0WKWa5bIW4xRtVZjc8VX90xJc/bYNaBRHIpAlf2ltTW/+op2znFuCyKGo3Oy+dCMYYFaA6eFN0A kLppRQjbbpCBhqcqBT/mhDn4t/lXX0ykeVoQDF7Va/81XwVRHmyjdanPUIPTfPRm94KNPQx96N97 qA4bLJyuQHCH2u2nFoJavjVsIE4iYdm8UXrNemHcSxH5/mc0zy4EZmFcV5cjjPOGG0jfKq+nwf/Y jj4Du9gqsPoUJbJRa4ZDhS4HIxaAjUz7tGM7zMN07RujHv41D198HRaG9Q7DlfEvr10lO1Hm13ZB ONFLAzkopR6RctR9q5czxNM+4Gm2KHmgCY0c0f9BckgG/Jou5yD5m6Leie2uPAmvylezkolwQOQv T8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR12KvxAmLBsX5VYc8T1yaw15zLKYs4SgsO kI26oQ== -----END CERTIFICATE----- COMODO RSA Certification Authority ================================== -----BEGIN CERTIFICATE----- MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGl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A1UdEwEB/wQFMAMBAf8w DQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvlwFTPoCWOAvn9sKIN9SCYPBMt rFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+ nq6PK7o9mfjYcwlYRm6mnPTXJ9OV2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSg tZx8jb8uk2IntznaFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwW sRqZCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I LaZRfyHBNVOFBkpdn627G190 -----END CERTIFICATE----- USERTrust RSA Certification Authority ===================================== -----BEGIN CERTIFICATE----- MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCB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2kMVn54CVVeW FPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KOVWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ 7l8wXEskEVX/JJpuXior7gtNn3/3ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQ Eg9zKC7F4iRO/Fjs8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM 8WcRiQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYzeSf7dNXGi FSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 -----END CERTIFICATE----- USERTrust ECC Certification Authority ===================================== -----BEGIN CERTIFICATE----- MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnN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UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= -----END CERTIFICATE----- GlobalSign ECC Root CA - R5 =========================== -----BEGIN CERTIFICATE----- MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 -----END CERTIFICATE----- Staat der Nederlanden Root CA - G3 ================================== -----BEGIN CERTIFICATE----- MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBa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RUrfrHkleu yjWcLhL75LpdINyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwpLiniyMMB8jPq KqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8Ipf3YF3qKS9Ysr1YvY2WTxB1 v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixpgZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA 8KCWAg8zxXHzniN9lLf9OtMJgwYh/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b 8KKaa8MFSu1BYBQw0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0r mj1AfsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq4BZ+Extq 1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk= -----END CERTIFICATE----- Staat der Nederlanden EV Root CA ================================ -----BEGIN CERTIFICATE----- MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmV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UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq 5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi 5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== -----END CERTIFICATE----- IdenTrust Commercial Root CA 1 ============================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ mNKvcbO0U59Oh++SvL3sTz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RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe 2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R cGzM7vRX+Bi6hG6H -----END CERTIFICATE----- IdenTrust Public Sector Root CA 1 ================================= -----BEGIN CERTIFICATE----- MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlSbdsHyo+1W/CD80/HLaXI rcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF/YTLNiCBWS2ab21ISGHKTN9T0a9SvESf qy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoS mJxZZoY+rfGwyj4GD3vwEUs3oERte8uojHH01bWR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XwsBOxonbRJRBD0ckscZOf85muQ 3Wl9af0AVqW3rLatt8o+Ae+c -----END CERTIFICATE----- Entrust Root Certification Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoT DUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMx OTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25s eTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwggEi MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP /vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXz HHfV1IWNcCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKU s/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4y TGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRx AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ6 0B7vfec7aVHUbI2fkBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5Z iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO e4pIb4tF9g== -----END CERTIFICATE----- Entrust Root Certification Authority - EC1 ========================================== -----BEGIN CERTIFICATE----- MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6Z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aYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su -----END CERTIFICATE----- TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5 ========================================================= -----BEGIN CERTIFICATE----- MIIEJzCCAw+gAwIBAgIHAI4X/iQggTANBgkqhkiG9w0BAQsFADCBsTELMAkGA1UEBhMCVFIxDzAN BgNVBAcMBkFua2FyYTFNMEsGA1UECgxEVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4xQjBABgNVBAMMOVTDnFJLVFJVU1Qg RWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSBINTAeFw0xMzA0MzAw ODA3MDFaFw0yMzA0MjgwODA3MDFaMIGxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMU0w SwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnE n2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBFbGVrdHJvbmlrIFNlcnRp ZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEApCUZ4WWe60ghUEoI5RHwWrom/4NZzkQqL/7hzmAD/I0Dpe3/a6i6zDQGn1k19uwsu537 jVJp45wnEFPzpALFp/kRGml1bsMdi9GYjZOHp3GXDSHHmflS0yxjXVW86B8BSLlg/kJK9siArs1m ep5Fimh34khon6La8eHBEJ/rPCmBp+EyCNSgBbGM+42WAA4+Jd9ThiI7/PS98wl+d+yG6w8z5UNP 9FR1bSmZLmZaQ9/LXMrI5Tjxfjs1nQ/0xVqhzPMggCTTV+wVunUlm+hkS7M0hO8EuPbJbKoCPrZV 4jI3X/xml1/N1p7HIL9Nxqw/dV8c7TKcfGkAaZHjIxhT6QIDAQABo0IwQDAdBgNVHQ4EFgQUVpkH HtOsDGlktAxQR95DLL4gwPswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI hvcNAQELBQADggEBAJ5FdnsXSDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPo BP5yCccLqh0lVX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nfpeYVhDfwwvJl lpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CFYv4HAqGEVka+lgqaE9chTLd8 B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW+qtB4Uu2NQvAmxU= -----END CERTIFICATE----- TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6 ========================================================= -----BEGIN CERTIFICATE----- MIIEJjCCAw6gAwIBAgIGfaHyZeyKMA0GCSqGSIb3DQEBCwUAMIGxMQswCQYDVQQGEwJUUjEPMA0G A1UEBwwGQW5rYXJhMU0wSwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZ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cpu54Rvl0EpABZeTeIT6lnAY2c6RPuY/ATTMHKm9ocJV612ph1jmv3XZch4gyt1 O6VbuA1df74jrlZVlFjvH4GMKrLN5ptjnhi85WsGtAuYSyher4hYyw== -----END CERTIFICATE----- Certinomis - Root CA ==================== -----BEGIN CERTIFICATE----- MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjETMBEGA1UEChMK Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAbBgNVBAMTFENlcnRpbm9taXMg LSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMzMTAyMTA5MTcxOFowWjELMAkGA1UEBhMCRlIx EzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMR0wGwYDVQQDExRD ZXJ0aW5vbWlzIC0gUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANTMCQos P5L2fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4kkjW4znuzuRZWJflLieY6pOo d5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9n+ws+hQVWZUKxkd8aRi5pwP5ynap z8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDFTKWrteoB4owuZH9kb/2jJZOLyKIOSY00 8B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb5nPJWqHZZkCqqU2mNAKthH6yI8H7KsZn9DS2sJVqM09x RLWtwHkziOC/7aOgFLScCbAK42C++PhmiM1b8XcF4LVzbsF9Ri6OSyemzTUK/eVNfaoqoynHWmgE 6OXWk6RiwsXm9E/G+Z8ajYJJGYrKWUM66A0ywfRMEwNvbqY/kXPLynNvEiCL7sCCeN5LLsJJwx3t FvYk9CcbXFcx3FXuqB5vbKziRcxXV4p1VxngtViZSTYxPDMBbRZKzbgqg4SGm/lg0h9tkQPTYKbV PZrdd5A9NaSfD171UkRpucC63M9933zZxKyGIjK8e2uR73r4F2iw4lNVYC2vPsKD2NkJK/DAZNuH i5HMkesE/Xa0lZrmFAYb1TQdvtj/dBxThZngWVJKYe2InmtJiUZ+IFrZ50rlau7SZRFDAgMBAAGj YzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I 6tNxIqSSaHh02TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/0KGRHCwPT5iV WVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWwF6YSjNRieOpWauwK0kDDPAUw Pk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZSg081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAX lCOotQqSD7J6wWAsOMwaplv/8gzjqh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJ y29SWwNyhlCVCNSNh4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9 Iff/ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8Vbtaw5Bng DwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwjY/M50n92Uaf0yKHxDHYi I0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nM cyrDflOR1m749fPH0FFNjkulW+YZFzvWgQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVr hkIGuUE= -----END CERTIFICATE----- OISTE WISeKey Global Root GB CA =============================== -----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIQdrEgUn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qqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEui HZeeevJuQHHfaPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= -----END CERTIFICATE----- Certification Authority of WoSign G2 ==================================== -----BEGIN CERTIFICATE----- MIIDfDCCAmSgAwIBAgIQayXaioidfLwPBbOxemFFRDANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQG EwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxLTArBgNVBAMTJENlcnRpZmljYXRpb24g QXV0aG9yaXR5IG9mIFdvU2lnbiBHMjAeFw0xNDExMDgwMDU4NThaFw00NDExMDgwMDU4NThaMFgx CzAJBgNVBAYTAkNOMRowGAYDVQQKExFXb1NpZ24gQ0EgTGltaXRlZDEtMCsGA1UEAxMkQ2VydGlm aWNhdGlvbiBBdXRob3JpdHkgb2YgV29TaWduIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvsXEoCKASU+/2YcRxlPhuw+9YH+v9oIOH9ywjj2X4FA8jzrvZjtFB5sg+OPXJYY1kBai XW8wGQiHC38Gsp1ij96vkqVg1CuAmlI/9ZqD6TRay9nVYlzmDuDfBpgOgHzKtB0TiGsOqCR3A9Du W/PKaZE1OVbFbeP3PU9ekzgkyhjpJMuSA93MHD0JcOQg5PGurLtzaaNjOg9FD6FKmsLRY6zLEPg9 5k4ot+vElbGs/V6r+kHLXZ1L3PR8du9nfwB6jdKgGlxNIuG12t12s9R23164i5jIFFTMaxeSt+BK v0mUYQs4kI9dJGwlezt52eJ+na2fmKEG/HgUYFf47oB3sQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU+mCp62XF3RYUCE4MD42b4Pdkr2cwDQYJKoZI hvcNAQELBQADggEBA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BLZpD67 oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCPoky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul 4+vJhaAlIDf7js4MNIThPIGyd05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6 +/NNIxuZMzSgLvWpCz/UXeHPhJ/iGcJfitYgHuNztw== -----END CERTIFICATE----- Certum Trusted Network CA 2 =========================== -----BEGIN CERTIFICATE----- MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UE BhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsTHkNlcnR1 bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29y ayBDQSAyMCIYDzIwMTExMDA2MDgzOTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQ TDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENl cnRpZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENB IDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWADGSdhhuWZGc/IjoedQF9 7/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+o CgCXhVqqndwpyeI1B+twTUrWwbNWuKFBOJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40b Rr5HMNUuctHFY9rnY3lEfktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2p uTRZCr+ESv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYm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WLYLztxRLX is7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7 zAYspsbiDrW5viSP -----END CERTIFICATE----- Http/Helpers/EnvHelper.php 0000644 00000001422 15213350436 0011467 0 ustar 00 <?php namespace App\Http\Helpers; class EnvHelper { public static function setEnvValue(string $key, ?string $value): void { $value = $value ?? ''; $path = base_path('.env'); if (!file_exists($path) || !is_writable($path)) { return; } $env = file_get_contents($path); $safeValue = str_replace('"', '\"', trim($value)); // if contains spaces, wrap with quotes if (preg_match('/\s/', $safeValue)) { $safeValue = "\"{$safeValue}\""; } // key exists -> replace if (preg_match("/^{$key}=.*/m", $env)) { $env = preg_replace("/^{$key}=.*/m", "{$key}={$safeValue}", $env); } else { // key not exists -> add new line $env .= PHP_EOL . "{$key}={$safeValue}"; } file_put_contents($path, $env); } } Http/Helpers/LimitCheckerHelper.php 0000644 00000001220 15213350436 0013276 0 ustar 00 <?php namespace App\Http\Helpers; use Carbon\Carbon; use App\Models\Package; use App\Models\Membership; use App\Models\BasicSetting; use Illuminate\Support\Facades\Config; class LimitCheckerHelper { public static function vcardLimitchecker(int $user_id) { $bs = BasicSetting::first(); Config::set('app.timezone', $bs->timezone); $id = Membership::query()->where([ ['user_id', '=', $user_id], ['expire_date', '>=', Carbon::now()->format('Y-m-d')] ])->pluck('package_id')->first(); $package = Package::query()->findOrFail($id); return $package->number_of_vcards; } } Http/Helpers/Instamojo.php 0000644 00000026143 15213350436 0011551 0 ustar 00 <?php namespace App\Http\Helpers; class Instamojo { const version = '1.1'; protected $curl; protected $endpoint = 'https://www.instamojo.com/api/1.1/'; protected $api_key = null; protected $auth_token = null; /** * @param string $api_key * @param string $auth_token is available on the d * @param string $endpoint can be set if you are working on an alternative server. * @return array AuthToken object. */ public function __construct($api_key, $auth_token = null, $endpoint = null) { $this->api_key = (string) $api_key; $this->auth_token = (string) $auth_token; if (!is_null($endpoint)) { $this->endpoint = (string) $endpoint; } } public function __destruct() { if (!is_null($this->curl)) { curl_close($this->curl); } } /** * @return array headers with Authentication tokens added */ private function build_curl_headers() { $headers = array("X-Api-key: $this->api_key"); if ($this->auth_token) { $headers[] = "X-Auth-Token: $this->auth_token"; } return $headers; } /** * @param string $path * @return string adds the path to endpoint with. */ private function build_api_call_url($path) { if (strpos($path, '/?') === false and strpos($path, '?') === false) { return $this->endpoint . $path . '/'; } return $this->endpoint . $path; } private function getParamsArray($limit, $page) { $params = array(); if (!is_null($limit)) { $params['limit'] = $limit; } if (!is_null($page)) { $params['page'] = $page; } return $params; } /** * @param string $method ('GET', 'POST', 'DELETE', 'PATCH') * @param string $path whichever API path you want to target. * @param array $data contains the POST data to be sent to the API. * @return array decoded json returned by API. */ private function api_call($method, $path, array $data = null) { $path = (string) $path; $method = (string) $method; $data = (array) $data; $headers = $this->build_curl_headers(); $request_url = $this->build_api_call_url($path); $options = array(); $options[CURLOPT_HTTPHEADER] = $headers; $options[CURLOPT_RETURNTRANSFER] = true; if ($method == 'POST') { $options[CURLOPT_POST] = 1; $options[CURLOPT_POSTFIELDS] = http_build_query($data); } else if ($method == 'DELETE') { $options[CURLOPT_CUSTOMREQUEST] = 'DELETE'; } else if ($method == 'PATCH') { $options[CURLOPT_POST] = 1; $options[CURLOPT_POSTFIELDS] = http_build_query($data); $options[CURLOPT_CUSTOMREQUEST] = 'PATCH'; } else if ($method == 'GET' or $method == 'HEAD') { if (!empty($data)) { /* Update URL to container Query String of Paramaters */ $request_url .= '?' . http_build_query($data); } } $options[CURLOPT_URL] = $request_url; $options[CURLOPT_SSL_VERIFYPEER] = true; $options[CURLOPT_CAINFO] = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'cacert.pem'; $this->curl = curl_init(); $setopt = curl_setopt_array($this->curl, $options); $response = curl_exec($this->curl); $headers = curl_getinfo($this->curl); $error_number = curl_errno($this->curl); $error_message = curl_error($this->curl); $response_obj = json_decode($response, true); if ($error_number != 0) { if ($error_number == 60) { throw new \Exception("Something went wrong. cURL raised an error with number: $error_number and message: $error_message. " . "Please check http://stackoverflow.com/a/21114601/846892 for a fix." . PHP_EOL); } else { throw new \Exception("Something went wrong. cURL raised an error with number: $error_number and message: $error_message." . PHP_EOL); } } if ($response_obj['success'] == false) { $message = json_encode($response_obj['message']); throw new \Exception($message . PHP_EOL); } return $response_obj; } /** * @return string URL to upload file or cover image asynchronously */ public function getUploadUrl() { $result = $this->api_call('GET', 'links/get_file_upload_url', array()); return $result['upload_url']; } /** * @param string $file_path * @return string JSON returned when the file upload is complete. */ public function uploadFile($file_path) { $upload_url = $this->getUploadUrl(); $file_path = realpath($file_path); $file_name = basename($file_path); $ch = curl_init(); $data = array('fileUpload' => $this->getCurlValue($file_path, $file_name)); curl_setopt($ch, CURLOPT_URL, $upload_url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); return curl_exec($ch); } public function getCurlValue($file_path, $file_name, $content_type = '') { // http://stackoverflow.com/a/21048702/846892 // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax // See: https://wiki.php.net/rfc/curl-file-upload if (function_exists('curl_file_create')) { return curl_file_create($file_path, $content_type, $file_name); } // Use the old style if using an older version of PHP $value = "@{$file_path};filename=$file_name"; if ($content_type) { $value .= ';type=' . $content_type; } return $value; } /** * Uploads any file or cover image mentioned in $link and * updates it with the json required by the API. * @param array $link * @return array $link updated with uploaded file information if applicable. */ public function uploadMagic(array $link) { if (!empty($link['file_upload'])) { $file_upload_json = $this->uploadFile($link['file_upload']); $link['file_upload_json'] = $file_upload_json; unset($link['file_upload']); } if (!empty($link['cover_image'])) { $cover_image_json = $this->uploadFile($link['cover_image']); $link['cover_image_json'] = $cover_image_json; unset($link['cover_image']); } return $link; } /** * Authenticate using username and password of a user. * Automatically updates the auth_token value. * @param array $args contains username=>USERNAME and password=PASSWORD * @return array AuthToken object. */ public function auth(array $args) { $response = $this->api_call('POST', 'auth', $args); $this->auth_token = $response['auth_token']['auth_token']; return $this->auth_token; } /** * @return array list of Link objects. */ public function linksList($limit, $path) { $response = $this->api_call('GET', 'links', $this->getParamsArray($limit, $path)); return $response['links']; } /** * @return array single Link object. */ public function linkDetail($slug) { $response = $this->api_call('GET', 'links/' . $slug, array()); return $response['link']; } /** * @return array single Link object. */ public function linkCreate(array $link) { if (empty($link['currency'])) { $link['currency'] = 'INR'; } $link = $this->uploadMagic($link); $response = $this->api_call('POST', 'links', $link); return $response['link']; } /** * @return array single Link object. */ public function linkEdit($slug, array $link) { $link = $this->uploadMagic($link); $response = $this->api_call('PATCH', 'links/' . $slug, $link); return $response['link']; } /** * @return array single Link object. */ public function linkDelete($slug) { $response = $this->api_call('DELETE', 'links/' . $slug, array()); return $response; } /** * @return array list of Payment objects. */ public function paymentsList($limit = null, $page = null) { $response = $this->api_call('GET', 'payments', $this->getParamsArray($limit, $page)); return $response['payments']; } /** * @param string payment_id as provided by paymentsList() or Instamojo's webhook or redirect functions. * @return array single Payment object. */ public function paymentDetail($payment_id) { $response = $this->api_call('GET', 'payments/' . $payment_id, array()); return $response['payment']; } ///// Request a Payment ///// /** * @param array single PaymentRequest object. * @return array single PaymentRequest object. */ public function paymentRequestCreate(array $payment_request) { $response = $this->api_call('POST', 'payment-requests', $payment_request); return $response['payment_request']; } /** * @param string id as provided by paymentRequestCreate, paymentRequestsList, webhook or redirect. * @return array single PaymentRequest object. */ public function paymentRequestStatus($id) { $response = $this->api_call('GET', 'payment-requests/' . $id, array()); return $response['payment_request']; } /** * @param string id as provided by paymentRequestCreate, paymentRequestsList, webhook or redirect. * @param string payment_id as received with the redirection URL or webhook. * @return array single PaymentRequest object. */ public function paymentRequestPaymentStatus($id, $payment_id) { $response = $this->api_call('GET', 'payment-requests/' . $id . '/' . $payment_id, array()); return $response['payment_request']; } /** * @param array datetime_limits containing datetime data with keys 'max_created_at', 'min_created_at', * 'min_modified_at' and 'max_modified_at' in ISO 8601 format(optional). * @return array containing list of PaymentRequest objects. * For more information on the allowed date formats check the * docs: https://www.instamojo.com/developers/request-a-payment-api/#toc-filtering-payment-requests */ public function paymentRequestsList($limit = null, $page = null, $max_created_at = null, $min_created_at = null, $max_modified_at = null, $min_modified_at = null) { $endpoint = 'payment-requests'; $params = array(); if (!is_null($max_created_at)) { $params['max_created_at'] = $max_created_at; } if (!is_null($min_created_at)) { $params['min_created_at'] = $min_created_at; } if (!is_null($min_modified_at)) { $params['min_modified_at'] = $min_modified_at; } if (!is_null($$max_modified_at)) { $params['max_modified_at'] = $max_modified_at; } $response = $this->api_call('GET', 'payment-requests', array_merge($params, $this->getParamsArray($limit, $page))); return $response['payment_requests']; } ///// Refunds ///// /** * @param array single Refund object. * @return array single Refund object. */ public function refundCreate(array $refund) { $response = $this->api_call('POST', 'refunds', $refund); return $response['refund']; } /** * @param string id as provided by refundCreate or refundsList. * @return array single Refund object. */ public function refundDetail($id) { $response = $this->api_call('GET', 'refunds/' . $id, array()); return $response['refund']; } /** * @return array containing list of Refund objects. */ public function refundsList($limit, $path) { $response = $this->api_call('GET', 'refunds', $this->getParamsArray($limit, $path)); return $response['refunds']; } } Http/Helpers/MegaMailer.php 0000644 00000012215 15213350436 0011604 0 ustar 00 <?php namespace App\Http\Helpers; use App\Models\BasicSettings\Basic; use App\Models\BasicSettings\MailTemplate; use App\Models\Language; use Config; use Illuminate\Mail\Message; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Session; class MegaMailer { public function mailFromAdmin($data) { $temp = MailTemplate::where('mail_type', '=', $data['templateType'])->first(); $body = $temp->mail_body; if (array_key_exists('username', $data)) { $body = preg_replace("/{username}/", $data['username'], $body); } if (array_key_exists('replaced_package', $data)) { $body = preg_replace("/{replaced_package}/", $data['replaced_package'], $body); } if (array_key_exists('removed_package_title', $data)) { $body = preg_replace("/{removed_package_title}/", $data['removed_package_title'], $body); } if (array_key_exists('package_title', $data)) { $body = preg_replace("/{package_title}/", $data['package_title'], $body); } if (array_key_exists('package_price', $data)) { $body = preg_replace("/{package_price}/", $data['package_price'], $body); } if (array_key_exists('discount', $data)) { $body = preg_replace("/{discount}/", $data['discount'], $body); } if (array_key_exists('total', $data)) { $body = preg_replace("/{total}/", $data['total'], $body); } if (array_key_exists('activation_date', $data)) { $body = preg_replace("/{activation_date}/", $data['activation_date'], $body); } if (array_key_exists('expire_date', $data)) { $body = preg_replace("/{expire_date}/", $data['expire_date'], $body); } if (array_key_exists('last_day_of_membership', $data)) { $body = preg_replace("/{last_day_of_membership}/", $data['last_day_of_membership'], $body); } if (array_key_exists('login_link', $data)) { $body = preg_replace("/{login_link}/", $data['login_link'], $body); } if (array_key_exists('customer_name', $data)) { $body = preg_replace("/{customer_name}/", $data['customer_name'], $body); } if (array_key_exists('verification_link', $data)) { $body = preg_replace("/{verification_link}/", $data['verification_link'], $body); } if (array_key_exists('website_title', $data)) { $body = preg_replace("/{website_title}/", $data['website_title'], $body); } if (session()->has('lang')) { $currentLang = Language::where('code', session()->get('lang'))->first(); } else { $currentLang = Language::where('is_default', 1)->first(); } $be = Basic::first(); //laravel facade mailer if ($be->smtp_status == 1) { try { $smtp = [ 'transport' => 'smtp', 'host' => $be->smtp_host, 'port' => $be->smtp_port, 'encryption' => $be->encryption, 'username' => $be->smtp_username, 'password' => $be->smtp_password, 'timeout' => null, 'auth_mode' => null, ]; Config::set('mail.mailers.smtp', $smtp); } catch (\Exception $e) { Session::flash('error', $e->getMessage()); return back(); } } if ($be->smtp_status == 1) { try { if (array_key_exists('mail_subject', $data)) { $mail_subject = $data['mail_subject']; } else { $mail_subject = $temp->mail_subject; } Mail::send([], [], function (Message $message) use ($data, $be, $body, $mail_subject) { $fromMail = $be->from_mail; $fromName = $be->from_name; $message->to($data['toMail']) ->subject($mail_subject) ->from($fromMail, $fromName) ->html($body, 'text/html'); if (array_key_exists('membership_invoice', $data)) { $message->attach(public_path('assets/front/invoices/' . $data['membership_invoice']), [ 'as' => 'Invoice', 'mime' => 'application/pdf', ]); } }); } catch (\Exception $e) { Session::flash('error', $e->getMessage()); return back(); } } //laravel facade mailer end } public function mailToAdmin($data) { $be = Basic::first(); if ($be->smtp_status == 1) { try { $smtp = [ 'transport' => 'smtp', 'host' => $be->smtp_host, 'port' => $be->smtp_port, 'encryption' => $be->encryption, 'username' => $be->smtp_username, 'password' => $be->smtp_password, 'timeout' => null, 'auth_mode' => null, ]; Config::set('mail.mailers.smtp', $smtp); } catch (\Exception $e) { Session::flash('error', $e->getMessage()); return back(); } } try { if ($be->smtp_status == 1) { Mail::send([], [], function (Message $message) use ($data, $be) { $fromMail = $be->from_mail; $fromName = $be->from_name; $message->to($be->to_mail) ->subject($data['subject']) ->from($fromMail, $fromName) ->html($data['body'], 'text/html'); }); } } catch (\Exception $e) { Session::flash('error', $e->getMessage()); return back(); } } } Http/Helpers/Helper.php 0000644 00000036241 15213350436 0011025 0 ustar 00 <?php use Carbon\Carbon; use App\Models\Language; use App\Models\Staff\Staff; use App\Models\Advertisement; use App\Http\Helpers\BasicMailer; use App\Models\Admin\Transaction; use App\Models\Services\Services; use App\Models\Staff\StaffPlugin; use App\Models\BasicSettings\Basic; use App\Models\Services\ServiceImage; use App\Models\Services\ServiceBooking; use App\Models\Services\ServiceContent; use App\Models\BasicSettings\MailTemplate; use App\Http\Helpers\VendorPermissionHelper; use App\Models\PaymentGateway\OnlineGateway; use App\Http\Controllers\Vendor\Staff\ZoomController; use App\Http\Controllers\FrontEnd\MiscellaneousController; use App\Http\Controllers\FrontEnd\GoogleCalendarController; use App\Http\Controllers\Staff\GoogleCalendarController as StaffCalendarController; if (!function_exists('createSlug')) { function createSlug($string) { $slug = preg_replace('/\s+/u', '-', trim($string)); $slug = str_replace('/', '', $slug); $slug = str_replace('?', '', $slug); $slug = str_replace(',', '', $slug); return mb_strtolower($slug); } } if (!function_exists('truncateString')) { function truncateString($string, $maxLength) { return strlen($string) > $maxLength ? mb_substr($string, 0, $maxLength, 'UTF-8') . '...' : $string; } } if (!function_exists('make_input_name')) { function make_input_name($string) { return preg_replace('/\s+/u', '_', trim($string)); } } if (!function_exists('replaceBaseUrl')) { function replaceBaseUrl($html, $type) { $startDelimiter = 'src=""'; if ($type == 'summernote') { $endDelimiter = '/assets/img/summernote'; } elseif ($type == 'pagebuilder') { $endDelimiter = '/assets/img'; } $startDelimiterLength = strlen($startDelimiter); $endDelimiterLength = strlen($endDelimiter); $startFrom = $contentStart = $contentEnd = 0; while (false !== ($contentStart = strpos($html, $startDelimiter, $startFrom))) { $contentStart += $startDelimiterLength; $contentEnd = strpos($html, $endDelimiter, $contentStart); if (false === $contentEnd) { break; } $html = substr_replace($html, url('/'), $contentStart, $contentEnd - $contentStart); $startFrom = $contentEnd + $endDelimiterLength; } return $html; } } if (!function_exists('setEnvironmentValue')) { function setEnvironmentValue(array $values) { $envFile = app()->environmentFilePath(); $str = file_get_contents($envFile); if (count($values) > 0) { foreach ($values as $envKey => $envValue) { $str .= "\n"; // In case the searched variable is in the last line without \n $keyPosition = strpos($str, "{$envKey}="); $endOfLinePosition = strpos($str, "\n", $keyPosition); $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition); // If key does not exist, add it if (!$keyPosition || !$endOfLinePosition || !$oldLine) { $str .= "{$envKey}={$envValue}\n"; } else { $str = str_replace($oldLine, "{$envKey}={$envValue}", $str); } } } $str = substr($str, 0, -1); if (!file_put_contents($envFile, $str)) return false; return true; } } if (!function_exists('showAd')) { function showAd($resolutionType) { $ad = Advertisement::where('resolution_type', $resolutionType)->inRandomOrder()->first(); $adsenseInfo = Basic::query()->select('google_adsense_publisher_id')->first(); if (!is_null($ad)) { if ($resolutionType == 1) { $maxWidth = '300px'; $maxHeight = '250px'; } else if ($resolutionType == 2) { $maxWidth = '300px'; $maxHeight = '600px'; } else { $maxWidth = '728px'; $maxHeight = '90px'; } if ($ad->ad_type == 'banner') { $markUp = '<a href="' . url($ad->url) . '" target="_blank" onclick="adView(' . $ad->id . ')" class="ad-banner"> <img data-src="' . asset('assets/img/advertisements/' . $ad->image) . '" alt="advertisement" style="width: ' . $maxWidth . '; height: ' . $maxHeight . ';" class="lazyload blur-up"> </a>'; return $markUp; } else { $markUp = '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=' . $adsenseInfo->google_adsense_publisher_id . '" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display: block;" data-ad-client="' . $adsenseInfo->google_adsense_publisher_id . '" data-ad-slot="' . $ad->slot . '" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>'; return $markUp; } } else { return; } } } if (!function_exists('onlyDigitalItemsInCart')) { function onlyDigitalItemsInCart() { $cart = session()->get('productCart'); if (!empty($cart)) { foreach ($cart as $key => $cartItem) { if ($cartItem['type'] != 'digital') { return false; } } } return true; } } if (!function_exists('onlyDigitalItems')) { function onlyDigitalItems($order) { $oitems = $order->orderitems; foreach ($oitems as $key => $oitem) { if ($oitem->item->type != 'digital') { return false; } } return true; } } if (!function_exists('get_href')) { function get_href($data) { $link_href = ''; if ($data->type == 'home') { $link_href = route('index'); } else if ($data->type == 'vendors') { $link_href = route('frontend.vendors'); } else if ($data->type == 'shop') { $link_href = route('shop.products'); } else if ($data->type == 'cart') { $link_href = route('shop.cart'); } else if ($data->type == 'checkout') { $link_href = route('shop.checkout'); } else if ($data->type == 'blog') { $link_href = route('blog'); } else if ($data->type == 'faq') { $link_href = route('faq'); } else if ($data->type == 'contact') { $link_href = route('contact'); } else if ($data->type == 'about-us') { $link_href = route('about_us'); } else if ($data->type == 'custom') { /** * this menu has created using menu-builder from the admin panel. * this menu will be used as drop-down or to link any outside url to this system. */ if ($data->href == '') { $link_href = '#'; } else { $link_href = $data->href; } } else { // this menu is for the custom page which has been created from the admin panel. $link_href = route('dynamic_page', ['slug' => $data->type]); } return $link_href; } } if (!function_exists('format_price')) { function format_price($value): string { $bs = Basic::first(); if ($bs->base_currency_symbol_position == 'left') { return $bs->base_currency_symbol . $value; } else { return $value . $bs->base_currency_symbol; } } } if (!function_exists('symbolPrice')) { function symbolPrice($price) { $basic = Basic::where('uniqid', 12345)->select('base_currency_symbol_position', 'base_currency_symbol')->first(); if ($basic->base_currency_symbol_position == 'left') { $data = $basic->base_currency_symbol . round($price, 2); return str_replace(' ', '', $data); } elseif ($basic->base_currency_symbol_position == 'right') { $data = round($price, 2) . $basic->base_currency_symbol; return str_replace(' ', '', $data); } } } if (!function_exists('checkWishList')) { function checkWishList($service_id, $user_id) { $check = App\Models\Services\Wishlist::where('service_id', $service_id) ->where('user_id', $user_id) ->first(); if ($check) { return true; } else { return false; } } } if (!function_exists('vendorTotalAddedService')) { function vendorTotalAddedService($vendor_id) { $total = Services::where('vendor_id', $vendor_id)->count(); return $total; } } if (!function_exists('zoomCreate')) { function zoomCreate($data) { if ($data['zoom_status'] == 1) { $permission = $data['vendor_id'] != 0 ? VendorPermissionHelper::packagePermission($data['vendor_id']) : null; if (!$permission || $permission->zoom_meeting_status == 1) { (new ZoomController())->createMeeting($data); } } } } if (!function_exists('calendarEventCreate')) { function calendarEventCreate($data) { $staffCalender = StaffPlugin::where('staff_id', $data['staff_id'])->select('google_calendar', 'calender_id')->first(); if ($data['calender_status'] == 1) { $permission = $data['vendor_id'] != 0 ? VendorPermissionHelper::packagePermission($data['vendor_id']) : null; if (!$permission || $permission->calendar_status == 1) { (new GoogleCalendarController())->createEvent($data); if (!empty($staffCalender)) { if (!empty($staffCalender->google_calendar) && !empty($staffCalender->calender_id)) { (new StaffCalendarController())->createEvent($data); } } } } } } if (!function_exists('vendorTotalAddedStaff')) { function vendorTotalAddedStaff($vendor_id) { $total = Staff::where('vendor_id', $vendor_id)->whereNull('role')->get()->count(); return $total; } } if (!function_exists('vendorTotalSliderImage')) { function vendorTotalSliderImage($serviceId) { $total = ServiceImage::where('service_id', $serviceId)->count(); return $total; } } if (!function_exists('store_transaction')) { function store_transaction($data) { $prev_admin_profit = DB::table('basic_settings')->pluck('admin_profit')->first(); if ($data['transaction_type'] == 'featured_service_reject') { $admin_profit = $data['actual_total'] - $prev_admin_profit; $refundAmount = $data['actual_total']; } else { $admin_profit = $data['actual_total'] + $prev_admin_profit; $refundAmount = 0; } //admin profit update on basic_settings start DB::table('basic_settings')->updateOrInsert( ['uniqid' => 12345], [ 'admin_profit' => $admin_profit, ] ); $actaulTotal = null; Transaction::create([ 'transaction_id' => time(), 'actual_total' => $data['transaction_type'] == 'featured_service_reject' ? $actaulTotal : $data['actual_total'], 'transaction_type' => $data['transaction_type'], 'vendor_id' => $data['vendor_id'], 'payment_status' => $data['payment_status'], 'payment_method' => $data['payment_method'], 'pre_balance' => $data['pre_balance'], 'admin_profit' => $data['transaction_type'] == 'featured_service_reject' ? $actaulTotal : $data['admin_profit'], 'featured_refund' => $refundAmount, 'after_balance' => $data['after_balance'], 'currency_symbol' => $data['currency_symbol'], 'currency_symbol_position' => $data['currency_symbol_position'], ]); } } //check service id's from appointment if (!function_exists('checkService')) { function checkService($id) { $hasService = Services::where('id', $id) ->whereHas('appointment', function ($query) { $query->where('order_status', 'pending'); }) ->count(); return $hasService; } } if (!function_exists('checkMembersipExpireDate')) { function checkMembersipExpireDate($vendor_id) { $currentPackage = VendorPermissionHelper::packagePermission($vendor_id); if ($currentPackage != '[]' && $vendor_id != 0) { $nextPackage = VendorPermissionHelper::nextPackage($vendor_id); if ($nextPackage == null) { $membership = VendorPermissionHelper::currMembOrPending($vendor_id); } else { $membership = VendorPermissionHelper::nextMembership($vendor_id); } $expireDate = $membership->expire_date; return $expireDate; } } } //appoitntment payment confirmation mail if (!function_exists('payemntStatusMail')) { function payemntStatusMail($type, $id) { $misc = new MiscellaneousController(); $language = $misc->getLanguage(); $booking = ServiceBooking::select('id', 'service_id', 'currency_symbol', 'customer_paid', 'customer_name', 'customer_email', 'start_date', 'end_date', 'created_at', 'booking_date')->findOrFail($id); // get the mail template info from db $mailTemplate = MailTemplate::query()->where('mail_type', '=', $type)->first(); $mailData['subject'] = $mailTemplate->mail_subject; $mailBody = $mailTemplate->mail_body; $serviceInfo = ServiceContent::query() ->where('service_id', $booking->service_id) ->where('language_id', $language->id) ->select('name', 'slug') ->firstOrFail(); //service title with ther details link $url = route('frontend.service.details', ['slug' => $serviceInfo->slug, 'id' => $booking->service_id]); $serviceName = truncateString($serviceInfo->name, 50); // get the website title info from db $info = Basic::select('website_title')->first(); $price = $booking->currency_symbol . $booking->customer_paid; $appointmentTime = $booking->start_date . ' to ' . $booking->end_date; // replacing with actual data $mailBody = str_replace('{service_title}', "<a href=" . $url . ">$serviceName</a>", $mailBody); $mailBody = str_replace('{customer_name}', $booking->customer_name, $mailBody); $mailBody = str_replace('{booking_date}', date_format($booking->created_at, 'M d, Y'), $mailBody); $mailBody = str_replace('{appointment_date}', Carbon::parse($booking->booking_date)->format('M d, Y'), $mailBody); $mailBody = str_replace('{appointment_time}', $appointmentTime, $mailBody); $mailBody = str_replace('{website_title}', $info->website_title, $mailBody); $mailBody = str_replace('{price}', $price, $mailBody); $mailData['body'] = $mailBody; $mailData['recipient'] = $booking->customer_email; BasicMailer::sendMail($mailData); return; } } if (!function_exists('getAttributes')) { function getAttributes($datas) {} } if (!function_exists('paytabInfo')) { function paytabInfo() { $paytabs = OnlineGateway::where('keyword', 'paytabs')->first(); $paytabsInfo = json_decode($paytabs->information, true); if ($paytabsInfo['country'] == 'global') { $currency = 'USD'; } elseif ($paytabsInfo['country'] == 'sa') { $currency = 'SAR'; } elseif ($paytabsInfo['country'] == 'uae') { $currency = 'AED'; } elseif ($paytabsInfo['country'] == 'egypt') { $currency = 'EGP'; } elseif ($paytabsInfo['country'] == 'oman') { $currency = 'OMR'; } elseif ($paytabsInfo['country'] == 'jordan') { $currency = 'JOD'; } elseif ($paytabsInfo['country'] == 'iraq') { $currency = 'IQD'; } else { $currency = 'USD'; } return [ 'server_key' => $paytabsInfo['server_key'], 'profile_id' => $paytabsInfo['profile_id'], 'url' => $paytabsInfo['api_endpoint'], 'currency' => $currency, ]; } } if (!function_exists('custom_format_price')) { function custom_format_price($amount, $text, $position) { $formattedAmount = number_format((float) $amount, 2, '.', ','); if ($position === 'left') { return $text . $formattedAmount; } else { return $formattedAmount . $text; } } } if (!function_exists('vendor_api_default_language')) { function vendor_api_default_language() { return Language::where('is_default', 1)->first(); } } Http/Helpers/UserPermissionHelper.php 0000644 00000013154 15213350436 0013733 0 ustar 00 <?php namespace App\Http\Helpers; use Exception; use Carbon\Carbon; use App\Models\Package; use App\Models\Membership; use App\Models\BasicSetting; use Illuminate\Support\Facades\Config; class UserPermissionHelper { public static function packagePermission(int $userId) { $bs = BasicSetting::first(); Config::set('app.timezone', $bs->timezone); $currentPackage = Membership::query()->where([ ['user_id', '=', $userId], ['status', '=', 1], ['start_date', '<=', Carbon::now()->format('Y-m-d')], ['expire_date', '>=', Carbon::now()->format('Y-m-d')] ])->first(); $package = isset($currentPackage) ? Package::query()->find($currentPackage->package_id) : null; return $package ? $package->features : collect([]); } public static function uniqidReal($lenght = 13) { // uniqid gives 13 chars, but you could adjust it to your needs. if (function_exists("random_bytes")) { $bytes = random_bytes(ceil($lenght / 2)); } elseif (function_exists("openssl_random_pseudo_bytes")) { $bytes = openssl_random_pseudo_bytes(ceil($lenght / 2)); } else { throw new Exception("no cryptographically secure random function available"); } return substr(bin2hex($bytes), 0, $lenght); } public static function currentPackagePermission(int $userId) { $bs = BasicSetting::first(); Config::set('app.timezone', $bs->timezone); $currentPackage = Membership::query()->where([ ['user_id', '=', $userId], ['status', '=', 1], ['start_date', '<=', Carbon::now()->format('Y-m-d')], ['expire_date', '>=', Carbon::now()->format('Y-m-d')] ])->first(); return isset($currentPackage) ? Package::query()->findOrFail($currentPackage->package_id) : null; } public static function userPackage(int $userId) { $bs = BasicSetting::first(); Config::set('app.timezone', $bs->timezone); return Membership::query()->where([ ['user_id', '=', $userId], ['status', '=', 1], ['start_date', '<=', Carbon::now()->format('Y-m-d')], ['expire_date', '>=', Carbon::now()->format('Y-m-d')] ])->first(); } public static function currPackageOrPending($userId) { $currentPackage = Self::currentPackagePermission($userId); if (!$currentPackage) { $currentPackage = Membership::query()->where([ ['user_id', '=', $userId], ['status', 0] ])->whereYear('start_date', '<>', '9999')->orderBy('id', 'DESC')->first(); $currentPackage = isset($currentPackage) ? Package::query()->findOrFail($currentPackage->package_id) : null; } return isset($currentPackage) ? $currentPackage : null; } public static function currMembOrPending($userId) { $currMemb = Self::userPackage($userId); if (!$currMemb) { $currMemb = Membership::query()->where([ ['user_id', '=', $userId], ['status', 0], ])->whereYear('start_date', '<>', '9999')->orderBy('id', 'DESC')->first(); } return isset($currMemb) ? $currMemb : null; } public static function hasPendingMembership($userId) { $count = Membership::query()->where([ ['user_id', '=', $userId], ['status', 0] ])->whereYear('start_date', '<>', '9999')->count(); return $count > 0 ? true : false; } public static function nextPackage(int $userId) { $bs = BasicSetting::first(); Config::set('app.timezone', $bs->timezone); $currMemb = Membership::query()->where([ ['user_id', $userId], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->where('status', '<>', 2)->whereYear('start_date', '<>', '9999'); $nextPackage = null; if ($currMemb->first()) { $countCurrMem = $currMemb->count(); if ($countCurrMem > 1) { $nextMemb = $currMemb->orderBy('id', 'DESC')->first(); } else { $nextMemb = Membership::query()->where([ ['user_id', $userId], ['start_date', '>', $currMemb->first()->expire_date] ])->whereYear('start_date', '<>', '9999')->where('status', '<>', 2)->first(); } $nextPackage = $nextMemb ? Package::query()->where('id', $nextMemb->package_id)->first() : null; } return $nextPackage; } public static function nextMembership(int $userId) { $bs = BasicSetting::first(); Config::set('app.timezone', $bs->timezone); $currMemb = Membership::query()->where([ ['user_id', $userId], ['start_date', '<=', Carbon::now()->toDateString()], ['expire_date', '>=', Carbon::now()->toDateString()] ])->where('status', '<>', 2)->whereYear('start_date', '<>', '9999'); $nextMemb = null; if ($currMemb->first()) { $countCurrMem = $currMemb->count(); if ($countCurrMem > 1) { $nextMemb = $currMemb->orderBy('id', 'DESC')->first(); } else { $nextMemb = Membership::query()->where([ ['user_id', $userId], ['start_date', '>', $currMemb->first()->expire_date] ])->whereYear('start_date', '<>', '9999')->where('status', '<>', 2)->first(); } } return $nextMemb; } } Http/Helpers/CheckFlashItem.php 0000644 00000004302 15213350436 0012411 0 ustar 00 <?php namespace App\Http\Helpers; use Carbon\Carbon; use App\Models\User\UserItem; use App\Models\User\BasicSetting; use Illuminate\Support\Facades\Auth; use App\Models\User\UserItemVariation; use Illuminate\Support\Facades\Config; class CheckFlashItem { public static function isFlashItem(int $itemId) { if (Auth::guard('web')->user()) { $user = Auth::guard('web')->user(); } else { $user = getUser(); } $item = UserItem::findOrFail($itemId); $timezone = BasicSetting::where('user_id', $user->id)->with('timezoneinfo')->first(); $timezone = $timezone->timezoneinfo->timezone; Config::set('app.timezone', $timezone); if (($item->start_date_time <= Carbon::now()->tz($timezone)->format('Y-m-d H:i:s A')) && ($item->end_date_time >= Carbon::now()->tz($timezone)->format('Y-m-d H:i:s A'))) { return 1; } else { return 0; } // if (Carbon::parse($item->start_date) <= Carbon::now()->format('Y-m-d') && Carbon::parse($item->end_date) >= Carbon::now()->format('Y-m-d')) { // $now = Carbon::now()->tz($timezone)->format('g:i A'); // $endtime = Carbon::parse($item->end_date . ' ' . $item->end_time)->format('g:i A'); // if ($now < $endtime) { // return 1; // } else { // return 0; // } // } else { // return 0; // } } public static function checkstock(int $itemstock, $variations) { if (count($variations) == 0) { if ($itemstock > 0) { $stock = true; } else { $stock = false; } $variations = null; } else { $stock = true; $tstock = ''; if (count($variations)) { foreach ($variations as $varkey => $varvalue) { $tstock = array_sum(json_decode($varvalue->option_stock)); if ($tstock == 0) { $stock = false; } } } else { $stock = true; } } return $stock; } } Http/Helpers/AiAccessHelper.php 0000644 00000002574 15213350436 0012423 0 ustar 00 <?php namespace App\Http\Helpers; use App\Models\AiGenerationLog; use App\Models\Package; class AiAccessHelper { /** * Check if package has AI feature */ public static function hasAiFeature(Package $package): bool { $features = json_decode($package->features ?? '[]', true); return is_array($features) && in_array('One-Click AI Website Setup', $features); } /** * Count how many times user used AI */ public static function usageCount(int $userId, ?int $packageId = null): int { return AiGenerationLog::where('user_id', $userId) ->when($packageId, fn($q) => $q->where('package_id', $packageId)) ->count(); } /** * Can user generate AI now? */ public static function canGenerate(int $userId, Package $package): array { // Feature check if (!self::hasAiFeature($package)) { return [ 'allowed' => false, 'message' => __('Your current package does not include AI Website Generation') . '.' ]; } $limit = (int) ($package->ai_generate_limit ?? 0); // unlimited if ($limit === 999999) { return ['allowed' => true]; } $used = self::usageCount($userId, $package->id); if ($used >= $limit) { return [ 'allowed' => false, 'message' => __('You have reached your AI generation limit') . '.' ]; } return ['allowed' => true]; } } Http/Helpers/AiPageFilterHelper.php 0000644 00000002540 15213350436 0013235 0 ustar 00 <?php namespace App\Http\Helpers; class AiPageFilterHelper { /** * Filter request pages based on package allowed AI pages * * @param array|null * @param array|null * @return array */ public static function filter(?array $requestPages, ?array $packageAiPages): array { if (!is_array($requestPages) || !is_array($packageAiPages)) { return []; } // label map $pageMap = [ 'home' => 'Home Page', 'about' => 'About Page', 'services' => 'Services Page', 'team' => 'Team Page', 'career' => 'Career Page', 'faq' => 'FAQ Page', 'gallery' => 'Gallery Page', 'blog' => 'Blog Page', 'portfolios' => 'Portfolio Page', 'contact' => 'Contact Page', 'shop' => 'Shop Page', 'courses' => 'Course Page', 'rooms' => 'Room Page', 'causes' => 'Cause Page', ]; // normalize request pages $requestPages = array_map( fn($p) => strtolower(trim($p)), $requestPages ); // allowed slugs from package $allowedSlugs = []; foreach ($pageMap as $slug => $label) { if (in_array($label, $packageAiPages, true)) { $allowedSlugs[] = $slug; } } // final filtered pages return array_values(array_intersect($requestPages, $allowedSlugs)); } } Models/Popup.php 0000644 00000001234 15213350436 0007605 0 ustar 00 <?php namespace App\Models; use App\Models\Language; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Popup extends Model { use HasFactory; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'language_id', 'type', 'image', 'name', 'background_color', 'background_color_opacity', 'title', 'text', 'button_text', 'button_color', 'button_url', 'end_date', 'end_time', 'delay', 'serial_number', 'status' ]; public function popupLang() { return $this->belongsTo(Language::class); } } Models/EmailTemplate.php 0000644 00000000442 15213350436 0011225 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class EmailTemplate extends Model { use HasFactory; protected $fillable = ['email_type', 'email_subject', 'email_body']; public $timestamps = false; } Models/Partner.php 0000644 00000000761 15213350436 0010121 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; class Partner extends BaseModel implements HasMedia { use HasFactory, InteractsWithMedia; protected $fillable = [ 'name' ]; const IMAGE = 'partner_img'; public function getImageAttribute() { $url = $this->getFirstMediaUrl(self::IMAGE); return $url ? $url : getAppLogoUrl(); } } Models/Bcategory.php 0000644 00000000521 15213350436 0010417 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Bcategory extends Model { public $timestamps = false; protected $fillable = [ "language_id", "name", "status", "serial_number", ]; public function blogs() { return $this->hasMany('App\Models\Blog'); } } Models/User.php 0000644 00000002570 15213350436 0007424 0 ustar 00 <?php namespace App\Models; use App\Models\Shop\ProductOrder; use Laravel\Sanctum\HasApiTokens; use App\Models\Shop\ProductReview; use App\Models\Services\ServiceReview; use App\Models\Services\ServiceBooking; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Database\Eloquent\Factories\HasFactory; class User extends Authenticatable { use HasFactory, Notifiable, HasApiTokens; /** * The attributes that aren't mass assignable. * * @var array */ protected $guarded = []; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; public function productOrder() { return $this->hasMany(ProductOrder::class, 'user_id', 'id'); } public function productReview() { return $this->hasMany(ProductReview::class, 'user_id', 'id'); } public function serviceBooking() { return $this->hasMany(ServiceBooking::class, 'user_id', 'id'); } public function serviceReview() { return $this->hasMany(ServiceReview::class, 'user_id', 'id'); } public function fcmTokens() { return $this->hasMany(\App\Models\FcmToken::class); } } Models/Feature.php 0000644 00000002012 15213350436 0010070 0 ustar 00 <?php namespace App\Models; use App\Models\Contracts\JsonResourceful; use App\Traits\HasJsonResourcefulData; use Illuminate\Database\Eloquent\Factories\HasFactory; use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; class Feature extends BaseModel implements HasMedia, JsonResourceful { use HasFactory, InteractsWithMedia, HasJsonResourcefulData; protected $fillable = [ 'title', 'description', 'points', ]; const IMAGE = 'feature_image'; public function getImageAttribute() { $url = $this->getFirstMediaUrl(self::IMAGE); return $url ? $url : asset('images/default/feature-1.png'); } public function prepareLinks(): array { return [ // ]; } public function prepareAttributes(): array { return [ 'image' => $this->image, 'title' => $this->title, 'points' => $this->points, 'description' => $this->description, ]; } } Models/BasicExtended.php 0000644 00000000451 15213350436 0011204 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class BasicExtended extends Model { protected $table = 'basic_extendeds'; public $timestamps = false; public function language() { return $this->belongsTo('App\Models\Language'); } } Models/Faq.php 0000644 00000001152 15213350436 0007210 0 ustar 00 <?php namespace App\Models; use App\Models\Contracts\JsonResourceful; use App\Traits\HasJsonResourcefulData; use Illuminate\Database\Eloquent\Factories\HasFactory; class Faq extends BaseModel implements JsonResourceful { use HasFactory, HasJsonResourcefulData; protected $fillable = [ 'title', 'description', ]; public function prepareLinks(): array { return [ // ]; } public function prepareAttributes(): array { return [ 'title' => $this->title, 'description' => $this->description, ]; } } Models/Customer.php 0000644 00000007753 15213350436 0010317 0 ustar 00 <?php namespace App\Models; use App\Traits\HasJsonResourcefulData; use App\Traits\Multitenantable; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Facades\Auth; use Stancl\Tenancy\Database\Concerns\BelongsToTenant; /** * App\Models\Customer * * @property int $id * @property string $name * @property string $email * @property string $phone * @property string $country * @property string $city * @property string $address * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * * @method static \Illuminate\Database\Eloquent\Builder|Customer newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Customer newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Customer query() * @method static \Illuminate\Database\Eloquent\Builder|Customer whereAddress($value) * @method static \Illuminate\Database\Eloquent\Builder|Customer whereCity($value) * @method static \Illuminate\Database\Eloquent\Builder|Customer whereCountry($value) * @method static \Illuminate\Database\Eloquent\Builder|Customer whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Customer whereEmail($value) * @method static \Illuminate\Database\Eloquent\Builder|Customer whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Customer whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|Customer wherePhone($value) * @method static \Illuminate\Database\Eloquent\Builder|Customer whereUpdatedAt($value) * * @property string|null $dob * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Quotation[] $quotations * @property-read int|null $quotations_count * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Sale[] $sales * @property-read int|null $sales_count * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\SaleReturn[] $salesReturns * @property-read int|null $sales_returns_count * * @method static \Illuminate\Database\Eloquent\Builder|Customer whereDob($value) * * @mixin \Eloquent */ class Customer extends BaseModel { use HasFactory, HasJsonResourcefulData, BelongsToTenant, Multitenantable; protected $table = 'customers'; const JSON_API_TYPE = 'customers'; protected $fillable = [ 'tenant_id', 'name', 'email', 'phone', 'country', 'city', 'address', 'dob', ]; public static function rules(): array { return [ 'name' => 'required', 'email' => 'required|email|unique:customers,email,NULL,id,tenant_id,' . Auth::user()->tenant_id, 'phone' => 'required|string', 'country' => 'required', 'city' => 'required', 'address' => 'required', 'dob' => 'nullable|date', ]; } public function prepareLinks(): array { return [ 'self' => route('customers.show', $this->id), ]; } public function prepareAttributes(): array { $fields = [ 'name' => $this->name, 'email' => $this->email, 'phone' => $this->phone, 'country' => $this->country, 'city' => $this->city, 'address' => $this->address, 'dob' => $this->dob, 'created_at' => $this->created_at, ]; return $fields; } public function prepareCustomers(): array { $fields = [ 'id' => $this->id, 'name' => $this->name, ]; return $fields; } public function sales(): HasMany { return $this->hasMany(Sale::class, 'customer_id', 'id'); } public function quotations(): HasMany { return $this->hasMany(Quotation::class, 'customer_id', 'id'); } public function salesReturns(): HasMany { return $this->hasMany(SaleReturn::class, 'customer_id', 'id'); } } Models/Membership.php 0000644 00000001474 15213350436 0010603 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Membership extends Model { use HasFactory; protected $fillable = [ 'package_price', 'discount', 'coupon_code', 'price', 'currency', 'currency_symbol', 'payment_method', 'transaction_id', 'status', 'is_trial', 'trial_days', 'receipt', 'transaction_details', 'settings', 'package_id', 'vendor_id', 'start_date', 'expire_date', ]; public function vendor() { return $this->belongsTo(Vendor::class, 'vendor_id'); } public function package() { return $this->belongsTo(Package::class, 'package_id'); } } Models/Timezone.php 0000644 00000000263 15213350436 0010275 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Timezone extends Model { use HasFactory; } Models/Menu.php 0000644 00000000303 15213350436 0007402 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Menu extends Model { public function language() { return $this->belongsTo('App\Models\Language'); } } Models/PaymentGateway.php 0000644 00000001614 15213350436 0011443 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class PaymentGateway extends Model { protected $fillable = ['title', 'details', 'subtitle', 'name', 'type', 'information', 'keyword']; public $timestamps = false; public function convertAutoData() { return json_decode($this->information, true); } public function getAutoDataText() { $text = $this->convertAutoData(); return end($text); } public function showKeyword() { $data = $this->keyword == null ? 'other' : $this->keyword; return $data; } public function showForm() { $show = ''; $data = $this->keyword == null ? 'other' : $this->keyword; $values = ['paypal']; if (in_array($data, $values)) { $show = 'no'; } else { $show = 'yes'; } return $show; } } Models/User/ItemReview.php 0000644 00000000617 15213350436 0011504 0 ustar 00 <?php namespace App\Models\User; use App\Models\Customer; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class ItemReview extends Model { use HasFactory; protected $fillable = ['customer_id', 'item_id', 'review', 'comment']; public function customer() { return $this->hasOne(Customer::class, 'id', 'customer_id'); } } Models/User/CounterInformation.php 0000644 00000001014 15213350436 0013241 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CounterInformation extends Model { use HasFactory; protected $table = 'user_counter_informations'; public $timestamps = false; protected $fillable = [ "title", "icon", "serial_number", "language_id", "user_id", "count" ]; public function language() { return $this->belongsTo(Language::class); } } Models/User/UserEmailTemplate.php 0000644 00000000426 15213350436 0013004 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserEmailTemplate extends Model { use HasFactory; protected $fillable = ['user_id', 'email_body', 'email_subject', 'email_type']; } Models/User/Follower.php 0000644 00000000341 15213350436 0011207 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Follower extends Model { public $table = "followers"; protected $fillable = [ 'follower_id', 'following_id' ]; } Models/User/ActionSection.php 0000644 00000001303 15213350436 0012157 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class ActionSection extends Model { use HasFactory; public $table = "user_action_sections"; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'language_id', 'user_id', 'background_image', 'first_title', 'second_title', 'first_button', 'first_button_url', 'second_button', 'second_button_url', 'image' ]; public function language() { return $this->belongsTo(Language::class, 'language_id'); } } Models/User/UserItemContent.php 0000644 00000001267 15213350436 0012516 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserItemContent extends Model { use HasFactory; protected $table = 'user_item_contents'; protected $guarded = []; public function item() { return $this->belongsTo(UserItem::class, 'item_id', 'id'); } public function category() { return $this->belongsTo(UserItemCategory::class); } public function subcategory() { return $this->belongsTo(UserItemSubCategory::class); } public function variations() { return $this->hasMany(UserItemVariation::class, 'item_id'); } } Models/User/GalleryCategory.php 0000644 00000001152 15213350436 0012514 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Auth; class GalleryCategory extends Model { use HasFactory; protected $table = 'user_gallery_categories'; protected $fillable = ['language_id', 'user_id', 'name', 'status', 'serial_number']; public function categoryLang() { return $this->belongsTo(Language::class)->where('user_id', Auth::id()); } public function imgVid() { return $this->hasMany(GalleryItem::class)->where('user_id', Auth::id()); } } Models/User/Jcategory.php 0000644 00000000561 15213350436 0011351 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Jcategory extends Model { public $table = "user_jcategories"; protected $fillable = [ 'language_id', 'name', 'status', 'serial_number', 'user_id' ]; public function jobs() { return $this->hasMany(Job::class); } } Models/User/UserPaymentGeteway.php 0000644 00000000714 15213350436 0013224 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserPaymentGeteway extends Model { use HasFactory; protected $fillable = ['title', 'user_id', 'details', 'keyword', 'subtitle', 'name', 'type', 'information']; protected $table = 'user_payment_gateways'; public function convertAutoData() { return json_decode($this->information, true); } } Models/User/BlogCategory.php 0000644 00000001037 15213350436 0012002 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class BlogCategory extends Model { public $table = "user_blog_categories"; protected $fillable = [ "language_id", "name", "status", "serial_number", "user_id", "is_featured", "image", ]; public function blogs() { return $this->hasMany('App\Models\User\Blog','category_id'); } public function language() { return $this->belongsTo(Language::class,'language_id'); } } Models/User/HeroSlider.php 0000644 00000001020 15213350436 0011451 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class HeroSlider extends Model { use HasFactory; protected $table = "user_hero_sliders"; protected $fillable = [ 'user_id', 'language_id', 'img', 'title', 'subtitle', 'btn_name', 'btn_url', 'serial_number' ]; public function sliderVersionLang() { return $this->belongsTo(Language::class); } } Models/User/QuoteInput.php 0000644 00000001072 15213350436 0011535 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class QuoteInput extends Model { protected $table ='user_quote_inputs'; protected $fillable = [ 'language_id', 'user_id', 'type', 'label', 'name', 'placeholder', 'required', 'active', 'order_number' ]; public function quote_input_options() { return $this->hasMany(QuoteInputOption::class); } public function language() { return $this->belongsTo(Language::class); } } Models/User/QuoteInputOption.php 0000644 00000000611 15213350436 0012724 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class QuoteInputOption extends Model { protected $table ='user_quote_input_options'; protected $fillable = [ 'type', 'label', 'name', 'placeholder', 'required' ]; public function quote_input() { return $this->belongsTo(QuoteInput::class); } } Models/User/GalleryItem.php 0000644 00000001367 15213350436 0011645 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Auth; class GalleryItem extends Model { use HasFactory; protected $table = 'user_gallery_items'; protected $fillable = [ 'language_id', 'user_id', 'gallery_category_id', 'item_type', 'image', 'video_link', 'title', 'serial_number', 'is_featured' ]; public function itemLang() { return $this->belongsTo(Language::class)->where('user_id', Auth::id()); } public function itemCategory() { return $this->belongsTo(GalleryCategory::class, 'gallery_category_id', 'id'); } } Models/User/UserVcard.php 0000644 00000001173 15213350436 0011320 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserVcard extends Model { use HasFactory; public function user() { return $this->belongsTo('App\Models\User'); } public function user_vcard_services() { return $this->hasMany('App\Models\User\UserVcardService'); } public function user_vcard_projects() { return $this->hasMany('App\Models\User\UserVcardProject'); } public function user_vcard_testimonials() { return $this->hasMany('App\Models\User\UserVcardTestimonial'); } } Models/User/ContactMessage.php 0000644 00000000441 15213350436 0012317 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class ContactMessage extends Model { public $table = "user_contact_messages"; protected $fillable = [ 'fullname', 'email', 'subject', 'message', 'user_id' ]; } Models/User/SkillCategory.php 0000644 00000000624 15213350436 0012176 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class SkillCategory extends Model { public $table = "user_skill_categories"; protected $fillable = [ "language_id", "name", "status", "serial_number", "user_id", ]; public function skills() { return $this->hasMany('App\Models\User\Skill','category_id'); } } Models/User/UserVcardTestimonial.php 0000644 00000000706 15213350436 0013532 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserVcardTestimonial extends Model { use HasFactory; protected $fillable= [ 'user_vcard_id', 'image', 'name', 'rating', 'comment', 'serial_number', ]; public function user_vcard() { return $this->belongsTo('App\Models\User\UserVcard'); } } Models/User/UserVcardProject.php 0000644 00000000760 15213350436 0012650 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserVcardProject extends Model { use HasFactory; protected $fillable= [ 'user_vcard_id', 'image', 'title', 'external_link_status', 'external_link', 'short_details', 'serial_number', ]; public function user_vcard() { return $this->belongsTo('App\Models\User\UserVcard'); } } Models/User/UserVcardService.php 0000644 00000000760 15213350436 0012642 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserVcardService extends Model { use HasFactory; protected $fillable= [ 'user_vcard_id', 'image', 'title', 'external_link_status', 'external_link', 'short_details', 'serial_number', ]; public function user_vcard() { return $this->belongsTo('App\Models\User\UserVcard'); } } Models/User/UserShopSetting.php 0000644 00000000335 15213350436 0012527 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserShopSetting extends Model { use HasFactory; protected $guarded = []; } Models/User/UserPermission.php 0000644 00000000375 15213350436 0012414 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class UserPermission extends Model { public $table = "user_permissions"; protected $fillable = [ 'permissions', 'package_id', 'user_id' ]; } Models/User/Portfolio.php 0000644 00000001563 15213350436 0011402 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Portfolio extends Model { public $table = "user_portfolios"; protected $fillable = [ 'title', 'slug', 'image', 'content', 'serial_number', 'status', 'client_name', 'start_date', 'submission_date', 'website_link', 'featured', 'language_id', 'category_id', 'user_id', 'meta_keywords', 'meta_description', ]; public function bcategory() { return $this->belongsTo('App\Models\User\PortfolioCategory','category_id'); } public function language() { return $this->belongsTo(Language::class); } public function portfolio_images() { return $this->hasMany('App\Models\User\PortfolioImage', 'user_portfolio_id'); } } Models/User/WorkProcess.php 0000644 00000000640 15213350436 0011701 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class WorkProcess extends Model { public $table = "user_work_processes"; protected $fillable = [ 'icon', 'title', 'text', 'serial_number', 'user_id', 'language_id', ]; public function language() { return $this->belongsTo(Language::class, 'language_id'); } } Models/User/Brand.php 0000644 00000000713 15213350436 0010447 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Brand extends Model { use HasFactory; protected $table = "user_brands"; protected $fillable = [ 'user_id', 'language_id', 'brand_img', 'brand_url', 'serial_number' ]; public function brandLang() { return $this->belongsTo(Language::class); } } Models/User/Menu.php 0000644 00000000531 15213350436 0010323 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Menu extends Model { use HasFactory; public $table = "user_menus"; protected $guarded = []; public function user() { return $this->belongsTo('App\Models\User', 'user_id'); } } Models/User/UserQrCode.php 0000644 00000000272 15213350436 0011435 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserQrCode extends Model { use HasFactory; } Models/User/UserFeature.php 0000644 00000000544 15213350436 0011655 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserFeature extends Model { use HasFactory; protected $fillable = [ "user_id", "language_id", 'color', 'icon', 'title', 'text', 'serial_number', ]; } Models/User/UserItemCategory.php 0000644 00000001277 15213350436 0012662 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserItemCategory extends Model { use HasFactory; protected $fillable = ['name', 'image', 'language_id', 'status', 'slug', 'user_id', 'is_feature']; protected $table = 'user_item_categories'; public function items() { return $this->hasMany(UserItemContent::class, 'category_id', 'id'); } public function subcategories() { return $this->hasMany(UserItemSubCategory::class, 'category_id', 'id')->where('status', 1); } public function language() { return $this->belongsTo(Language::class); } } Models/User/FAQ.php 0000644 00000000725 15213350436 0010033 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class FAQ extends Model { use HasFactory; protected $table = 'user_faqs'; protected $fillable = [ 'user_id', 'language_id', 'question', 'answer', 'featured', 'serial_number' ]; public function faqLang() { return $this->belongsTo(Language::class); } } Models/User/HeroStatic.php 0000644 00000001504 15213350436 0011465 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class HeroStatic extends Model { use HasFactory; protected $table = "user_hero_statics"; protected $fillable = [ 'language_id', 'user_id', 'img', 'title', 'subtitle', 'btn_name', 'btn_url', 'hero_text', 'secound_btn_name', 'secound_btn_url', 'designation', 'lower_subtitle', 'toper_subtitle', 'img2', 'second_title', 'second_subtitle', 'img3', 'third_title', 'third_subtitle', 'third_btn_name', 'third_btn_url' ]; public function staticVersionLang() { return $this->belongsTo(Language::class); } } Models/User/Job.php 0000644 00000001551 15213350437 0010135 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Job extends Model { public $table="user_jobs"; protected $fillable = [ 'jcategory_id', 'language_id', 'user_id', 'title', 'slug', 'vacancy', 'deadline', 'experience', 'job_responsibilities', 'employment_status', 'educational_requirements', 'experience_requirements', 'additional_requirements', 'job_location', 'salary', 'benefits', 'read_before_apply', 'email', 'serial_number', 'meta_keywords', 'meta_description' ]; public function jcategory() { return $this->belongsTo(Jcategory::class); } public function language() { return $this->belongsTo(Language::class); } } Models/User/Blog.php 0000644 00000001355 15213350437 0010310 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Blog extends Model { public $table = "user_blogs"; protected $fillable = [ "title", "slug", "image", "image2", "content", "serial_number", "language_id", "category_id", "user_id", "meta_keywords", "meta_description", "is_slider", "slider_post_image", "is_featured", "featured_post_image", "views" ]; public function bcategory() { return $this->belongsTo('App\Models\User\BlogCategory','category_id'); } public function language() { return $this->belongsTo(Language::class,'language_id'); } } Models/User/UserShippingCharge.php 0000644 00000000501 15213350437 0013147 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserShippingCharge extends Model { use HasFactory; protected $fillable = [ 'language_id', 'user_id', 'title', 'text', 'charge' ]; } Models/User/Subscriber.php 0000644 00000000342 15213350437 0011523 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Subscriber extends Model { protected $table = 'user_subscribers'; protected $fillable = [ 'email', 'user_id' ]; } Models/User/HomeSection.php 0000644 00000000413 15213350437 0011634 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class HomeSection extends Model { use HasFactory; public $timestamps = false; protected $table = 'user_home_sections'; } Models/User/UserService.php 0000644 00000001016 15213350437 0011656 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class UserService extends Model { public $table = "user_services"; protected $fillable= [ 'image', 'slug', 'name', 'content', 'serial_number', 'featured', 'detail_page', 'user_id', 'lang_id', 'meta_keywords', 'meta_description', 'icon', ]; public function language() { return $this->belongsTo(Language::class,'lang_id'); } } Models/User/BasicSetting.php 0000644 00000001305 15213350437 0011777 0 ustar 00 <?php namespace App\Models\User; use App\Models\Timezone; use Illuminate\Database\Eloquent\Model; class BasicSetting extends Model { public $table = "user_basic_settings"; protected $fillable = [ 'favicon', 'logo', 'cv', 'base_color', 'theme', 'user_id', 'timezone', 'breadcrumb', 'cookie_alert_status', 'cookie_alert_text', 'cookie_alert_button_text', 'website_title', ]; public function language() { return $this->hasMany('App\Models\User\Language', 'user_id'); } public function timezoneinfo() { return $this->belongsTo(Timezone::class,'timezone'); } } Models/User/Page.php 0000644 00000000633 15213350437 0010277 0 ustar 00 <?php namespace App\Models\User; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Page extends Model { use HasFactory; protected $table = 'user_pages'; public function language() { return $this->belongsTo(Language::class); } public function user() { return $this->belongsTo(User::class); } } Models/User/UserCustomDomain.php 0000644 00000000507 15213350437 0012664 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserCustomDomain extends Model { use HasFactory; protected $table = 'user_custom_domains'; public function user() { return $this->belongsTo('App\Models\User'); } } Models/User/CustomerWishList.php 0000644 00000000520 15213350437 0012706 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CustomerWishList extends Model { use HasFactory; protected $fillable = ['customer_id','item_id']; public function item() { return $this->belongsTo(UserItem::class); } } Models/User/SEO.php 0000644 00000003160 15213350437 0010047 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class SEO extends Model { use HasFactory; protected $table = 'user_seos'; public $timestamps = false; protected $fillable = [ 'user_id', 'language_id', 'home_meta_keywords', 'home_meta_description', 'services_meta_keywords', 'services_meta_description', 'blogs_meta_keywords', 'blogs_meta_description', 'portfolios_meta_keywords', 'portfolios_meta_description', 'jobs_meta_keywords', 'jobs_meta_description', 'team_meta_keywords', 'team_meta_description', 'faqs_meta_keywords', 'faqs_meta_description', 'contact_meta_keywords', 'contact_meta_description', 'shop_meta_keywords', 'shop_meta_description', 'item_details_meta_keywords', 'item_details_meta_description', 'cart_meta_keywords', 'cart_meta_description', 'checkout_meta_keywords', 'checkout_meta_description', 'meta_description_signup', 'meta_keyword_signup', 'meta_description_login', 'meta_keyword_login', 'meta_description_course_details', 'meta_keyword_course_details', 'meta_description_course', 'meta_keyword_course', 'meta_keyword_rooms', 'meta_description_rooms', 'meta_keyword_room_details', 'meta_description_room_details' ]; public function language() { return $this->belongsTo(Language::class); } } Models/User/Language.php 0000644 00000016773 15213350437 0011162 0 ustar 00 <?php namespace App\Models\User; use App\Models\BasicExtended; use App\Models\User\CourseManagement\CourseCategory; use App\Models\User\CourseManagement\CourseFaq; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\CourseManagement\Instructor\Instructor; use App\Models\User\CourseManagement\Lesson; use App\Models\User\CourseManagement\LessonContent; use App\Models\User\CourseManagement\LessonQuiz; use App\Models\User\CourseManagement\Module; use App\Models\User\DonationManagement\DonationCategories; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\HotelBooking\RoomAmenity; use App\Models\User\HotelBooking\RoomCategory; use App\Models\User\HotelBooking\RoomContent; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Auth; class Language extends Model { public $table = "user_languages"; protected $fillable = [ 'id', 'name', 'is_default', 'dashboard_default', 'code', 'rtl', 'user_id', 'keywords' ]; public function itemInfo() { return $this->hasMany(UserItemContent::class, 'language_id'); } public function user_item_categories() { return $this->hasMany(UserItemCategory::class, 'language_id'); } public function user_features() { return $this->hasMany(UserFeature::class, 'language_id'); } public function user_item_subcategories() { return $this->hasMany(UserItemSubCategory::class, 'language_id'); } public function user_offer_banners() { return $this->hasMany(UserOfferBanner::class, 'language_id'); } public function user_shipping_charges() { return $this->hasMany(UserShippingCharge::class, 'language_id'); } public function services() { return $this->hasMany('App\Models\User\UserService', 'lang_id'); } public function variations() { return $this->hasMany('App\Models\User\UserItemVariation', 'language_id'); } public function user_item_contacts() { return $this->hasMany('App\Models\User\UserItemContent', 'language_id'); } public function contacts() { return $this->hasOne('App\Models\User\UserContact', 'language_id')->where('user_id', Auth::id()); } public function quick_links() { return $this->hasMany('App\Models\User\FooterQuickLink', 'language_id')->where('user_id', Auth::id()); } public function footer_texts() { return $this->hasMany('App\Models\User\FooterText', 'language_id')->where('user_id', Auth::id()); } public function hero_static() { return $this->hasOne('App\Models\User\HeroStatic', 'language_id')->where('user_id', Auth::id()); } public function hero_sliders() { return $this->hasMany('App\Models\User\HeroSlider', 'language_id')->where('user_id', Auth::id()); } public function faqs() { return $this->hasMany('App\Models\User\FAQ', 'language_id')->where('user_id', Auth::id()); } public function testimonials() { return $this->hasMany('App\Models\User\UserTestimonial', 'lang_id')->where('user_id', Auth::id()); } public function blogs() { return $this->hasMany('App\Models\User\Blog')->where('user_id', Auth::id()); } public function blog_categories() { return $this->hasMany('App\Models\User\BlogCategory')->where('user_id', Auth::id()); } public function skills() { return $this->hasMany('App\Models\User\Skill')->where('user_id', Auth::id()); } public function achievements() { return $this->hasMany('App\Models\User\CounterInformation')->where('user_id', Auth::id()); } public function portfolios() { return $this->hasMany('App\Models\User\Portfolio')->where('user_id', Auth::id()); } public function pages() { return $this->hasMany('App\Models\User\Page')->where('user_id', Auth::id()); } public function menus() { return $this->hasMany('App\Models\User\Menu')->where('user_id', Auth::id()); } public function portfolio_categories() { return $this->hasMany('App\Models\User\PortfolioCategory')->where('user_id', Auth::id()); } public function seos() { return $this->hasMany('App\Models\User\SEO', 'language_id')->where('user_id', Auth::id()); } public function jobs() { return $this->hasMany('App\Models\User\Job', 'language_id')->where('user_id', Auth::id()); } public function jcategories() { return $this->hasMany('App\Models\User\Jcategory', 'language_id')->where('user_id', Auth::id()); } public function home_page_texts() { return $this->hasMany('App\Models\User\HomePageText', 'language_id')->where('user_id', Auth::id()); } public function processes() { return $this->hasMany('App\Models\User\WorkProcess', 'language_id')->where('user_id', Auth::id()); } public function teams() { return $this->hasMany('App\Models\User\Member', 'language_id')->where('user_id', Auth::id()); } public function quote_inputs() { return $this->hasMany('App\Models\User\QuoteInput', 'language_id')->where('user_id', Auth::id()); } public function roomDetails() { return $this->hasMany(RoomContent::class, 'language_id', 'id')->where('user_id', Auth::id()); } public function roomCategories() { return $this->hasMany(RoomCategory::class, 'language_id', 'id')->where('user_id', Auth::id()); } public function roomAmenities() { return $this->hasMany(RoomAmenity::class, 'language_id', 'id')->where('user_id', Auth::id()); } public function courseCategory() { return $this->hasMany(CourseCategory::class, 'language_id', 'id')->where('user_id', Auth::id()); } public function courseFaqs() { return $this->hasMany(CourseFaq::class, 'language_id', 'id')->where('user_id', Auth::id()); } public function courseInformation() { return $this->hasMany(CourseInformation::class, 'language_id', 'id')->where('user_id', Auth::id()); } public function courseInstructtors() { return $this->hasMany(Instructor::class, 'language_id', 'id')->where('user_id', Auth::id()); } public function courseLessons() { return $this->hasMany(Lesson::class, 'language_id', 'id')->where('user_id', Auth::id()); } // public function courseLessonContents() // { // return $this->hasMany(LessonContent::class, 'language_id', 'id')->where('user_id', Auth::id()); // } // public function courseLessonQuiz() // { // return $this->hasMany(LessonQuiz::class, 'language_id', 'id')->where('user_id', Auth::id()); // } public function courseModules() { return $this->hasMany(Module::class, 'language_id', 'id')->where('user_id', Auth::id()); } public function actionSection() { return $this->hasOne(ActionSection::class, 'language_id'); } public function causeContent() { return $this->hasOne(DonationContent::class, 'language_id', 'id'); } public function causeContents() { return $this->hasMany(DonationContent::class, 'language_id', 'id'); } public function causeCategories() { return $this->hasMany(DonationCategories::class, 'language_id', 'id'); } public function donationCategories() { return $this->hasMany(DonationCategories::class, 'language_id', 'id'); } } Models/User/PortfolioImage.php 0000644 00000000721 15213350437 0012341 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class PortfolioImage extends Model { use HasFactory; protected $table = 'user_portfolio_images'; public $timestamps = false; protected $fillable = ['user_portfolio_id', 'image', 'user_id']; public function portfolio() { return $this->belongsTo('App\Models\User\Portfolio', 'user_portfolio_id'); } } Models/User/FooterText.php 0000644 00000001061 15213350437 0011522 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class FooterText extends Model { use HasFactory; protected $table = "user_footer_texts"; protected $fillable = [ 'language_id', 'user_id', 'logo', 'bg_image', 'about_company', 'newsletter_text', 'copyright_text', 'footer_color' ]; public function footerTextLang() { return $this->belongsTo(Language::class, 'language_id'); } } Models/User/UserItem.php 0000644 00000001150 15213350437 0011153 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserItem extends Model { use HasFactory; protected $guarded = []; protected $table = 'user_items'; public function itemContents() { return $this->hasMany(UserItemContent::class, 'item_id', 'id'); } public function sliders() { return $this->hasMany(UserItemImage::class, 'item_id', 'id'); } public function itemVariations() { return $this->hasMany(UserItemVariation::class, 'item_id', 'id'); } } Models/User/UserCoupon.php 0000644 00000000565 15213350437 0011531 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserCoupon extends Model { use HasFactory; protected $fillable = [ 'user_id', 'name', 'code', 'type', 'value', 'minimum_spend', 'start_date', 'end_date', ]; } Models/User/UserOfflineGateway.php 0000644 00000000550 15213350437 0013164 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserOfflineGateway extends Model { use HasFactory; protected $fillable = ['id', 'user_id', 'name', 'short_description', 'instructions', 'serial_number', 'status', 'is_receipt', 'receipt', 'item_checkout_status']; } Models/User/BookmarkPost.php 0000644 00000001135 15213350437 0012034 0 ustar 00 <?php namespace App\Models\User; use App\Models\Customer; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class BookmarkPost extends Model { use HasFactory; protected $table = 'user_bookmark_posts'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['user_id', 'post_id', 'author_id']; public function bookmarkedByCustomer() { return $this->belongsTo(Customer::class); } public function post() { return $this->belongsTo(Blog::class); } } Models/User/BlogView.php 0000644 00000001003 15213350437 0011131 0 ustar 00 <?php namespace App\Models\User; use App\Models\Blog; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class BlogView extends Model { use HasFactory; protected $fillable = ['post_id', 'user_id', 'ip', 'author_id']; protected $table = 'user_blog_views'; public function post() { return $this->belongsTo(Blog::class); } public function viewByUser() { return $this->belongsTo(User::class); } } Models/User/HomePageText.php 0000644 00000007324 15213350437 0011761 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class HomePageText extends Model { public $table = 'user_home_page_texts'; protected $fillable = [ 'language_id', 'user_id', 'about_image', 'about_keyword', 'about_title', 'about_subtitle', 'about_content', 'about_video_image', 'about_video_url', 'about_button_text', 'about_button_url', 'about_snd_button_text', 'about_snd_button_url', 'technical_image', 'technical_keyword', 'technical_title', 'technical_content', 'service_keyword', 'skills_title', 'skills_subtitle', 'skills_content', 'service_title', 'service_subtitle', 'experience_keyword', 'experience_title', 'achievement_image', 'achievement_keyword', 'achievement_title', 'portfolio_keyword', 'portfolio_title', 'portfolio_subtitle', 'view_all_portfolio_text', 'testimonial_keyword', 'testimonial_title', 'testimonial_subtitle', 'testimonial_image', 'team_section_title', 'team_section_subtitle', 'blog_keyword', 'blog_title', 'blog_subtitle', 'view_all_blog_text', 'contact_title', 'contact_title', 'contact_subtitle', 'contact_button_text', 'video_section_image', 'video_section_title', 'video_section_subtitle', 'video_section_text', 'video_section_button_text', 'video_section_button_url', 'video_section_url', 'why_choose_us_section_image', 'why_choose_us_section_title', 'why_choose_us_section_subtitle', 'why_choose_us_section_text', 'why_choose_us_section_button_text', 'why_choose_us_section_button_url', 'why_choose_us_section_video_image', 'why_choose_us_section_video_url', 'work_process_section_title', 'work_process_section_subtitle', 'work_process_section_text', 'work_process_section_img', 'work_process_section_video_img', 'work_process_section_video_url', 'quote_section_title', 'quote_section_subtitle', 'counter_section_image', 'work_process_btn_txt', 'work_process_btn_url', 'contact_section_title', 'contact_section_subtitle', 'feature_item_title', 'new_item_title', 'newsletter_title', 'newsletter_subtitle', 'bestseller_item_title', 'special_item_title', 'flashsale_item_title', 'featured_course_section_title', 'newsletter_image', 'newsletter_snd_image', 'featured_section_subtitle', 'featured_section_title', 'category_section_title', 'category_section_subtitle', 'causes_section_title', 'causes_section_subtitle', 'job_education_title', 'job_education_subtitle', 'donor_title', 'featured_category_item_section_title', 'flash_sale_title', 'latest_item_section_title', 'on_sale_section_title', 'on_sale_section_image', 'on_sale_section_subtitle', 'on_sale_section_section_button_name', 'on_sale_section_section_button_link', 'faq_section_title', 'faq_section_subtitle', 'contact_section_image', 'contact_section_title', 'contact_section_subtitle', 'rooms_section_title', 'rooms_section_subtitle', 'rooms_section_content', ]; public function language() { return $this->belongsTo('App\Models\User\Language', 'language_id'); } } Models/User/DonationManagement/DonationCategories.php 0000644 00000000640 15213350437 0016752 0 ustar 00 <?php namespace App\Models\User\DonationManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class DonationCategories extends Model { use HasFactory; public $table = 'user_donation_categories'; protected $guarded = []; public function donations(){ return $this->hasMany(DonationContent::class, 'donation_category_id','id'); } } Models/User/DonationManagement/DonationDetail.php 0000644 00000001506 15213350437 0016071 0 ustar 00 <?php namespace App\Models\User\DonationManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class DonationDetail extends Model { use HasFactory; protected $table = "user_donation_details"; protected $fillable = [ 'user_id', 'customer_id', 'name', 'email', 'phone', 'amount', 'currency', 'currency_position', 'currency_symbol', 'currency_symbol_position', 'transaction_id', 'status', 'invoice', 'receipt', 'transaction_details', 'bex_details', 'donation_id', 'payment_method', 'conversation_id' ]; public function cause() { return $this->belongsTo(Donation::class, 'donation_id', 'id'); } } Models/User/DonationManagement/Donation.php 0000644 00000001020 15213350437 0014735 0 ustar 00 <?php namespace App\Models\User\DonationManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Donation extends Model { use HasFactory; protected $table = "user_donations"; protected $fillable = [ 'user_id', 'goal_amount', 'min_amount', 'custom_amount', 'image', 'language_id' ]; public function contents() { return $this->hasMany(DonationContent::class, 'donation_id', 'id'); } } Models/User/DonationManagement/DonationContent.php 0000644 00000001031 15213350437 0016272 0 ustar 00 <?php namespace App\Models\User\DonationManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class DonationContent extends Model { use HasFactory; protected $table = "user_donation_contents"; protected $guarded = []; public function donation() { return $this->belongsTo(Donation::class, 'donation_id', 'id'); } public function category() { return $this->belongsTo(DonationCategories::class, 'donation_category_id', 'id'); } } Models/User/JobExperience.php 0000644 00000001077 15213350437 0012150 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class JobExperience extends Model { use HasFactory; public $table = "user_job_experiences"; protected $fillable = [ 'company_name', 'designation', 'content', 'start_date', 'end_date', 'is_continue', 'serial_number', 'language_id', 'user_id', ]; public function language() { return $this->belongsTo(Language::class, 'language_id'); } } Models/User/PortfolioCategory.php 0000644 00000000673 15213350437 0013102 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class PortfolioCategory extends Model { public $table = "user_portfolio_categories"; protected $fillable = [ "language_id", "name", "status", "serial_number", "user_id", "is_featured", ]; public function portfolios() { return $this->hasMany('App\Models\User\Portfolio','category_id'); } } Models/User/UserContact.php 0000644 00000001073 15213350437 0011654 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class UserContact extends Model { public $table = "user_contacts"; protected $fillable = [ 'contact_form_image', 'contact_form_title', 'contact_form_subtitle', 'contact_addresses', 'contact_numbers', 'contact_mails', 'latitude', 'longitude', 'map_zoom', 'user_id', 'language_id', ]; public function language() { return $this->belongsTo(Language::class, 'language_id'); } } Models/User/FooterQuickLink.php 0000644 00000000752 15213350437 0012476 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class FooterQuickLink extends Model { use HasFactory; protected $table = "user_footer_quick_links"; protected $fillable = [ 'language_id', 'user_id', 'title', 'url', 'serial_number' ]; public function quickLinkLang() { return $this->belongsTo(Language::class, 'language_id'); } } Models/User/UserOrderItem.php 0000644 00000000427 15213350437 0012155 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserOrderItem extends Model { use HasFactory; public function item() { return $this->belongsTo(UserItem::class); } } Models/User/UserItemSubCategory.php 0000644 00000001153 15213350437 0013326 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserItemSubCategory extends Model { use HasFactory; protected $fillable = [ 'user_id', 'language_id', 'category_id', 'name', 'slug', 'status' ]; protected $table = 'user_item_sub_categories'; public function category() { return $this->belongsTo(UserItemCategory::class); } public function items() { return $this->hasMany(UserItemContent::class, 'subcategory_id', 'id'); } } Models/User/Education.php 0000644 00000000663 15213350437 0011341 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Education extends Model { use HasFactory; public $table = "user_educations"; protected $fillable = [ 'degree_name', 'slug', 'short_description', 'start_date', 'end_date', 'serial_number', 'user_id', 'language_id' ]; } Models/User/Quote.php 0000644 00000000462 15213350437 0010520 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Quote extends Model { protected $table = 'user_quotes'; protected $fillable = [ 'id', 'name', 'email', 'fields', 'status', 'created_at', 'updated_at' ]; } Models/User/UserItemImage.php 0000644 00000000541 15213350437 0012121 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserItemImage extends Model { use HasFactory; protected $table = 'user_item_images'; protected $guarded = []; public function item() { return $this->belongsTo(UserItem::class); } } Models/User/UserItemVariation.php 0000644 00000000646 15213350437 0013041 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserItemVariation extends Model { use HasFactory; protected $guarded = []; public function itemContenet() { return $this->belongsTo(UserItemContent::class); } public function language() { return $this->belongsTo(Language::class); } } Models/User/Social.php 0000644 00000000375 15213350437 0010640 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Social extends Model { public $table = "user_socials"; protected $fillable = [ 'icon', 'url', 'serial_number', 'user_id' ]; } Models/User/CourseManagement/LessonComplete.php 0000644 00000001123 15213350437 0015607 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class LessonComplete extends Model { use HasFactory; protected $table = 'user_lesson_complete'; public $timestamps = false; public function user() { return $this->belongsTo('App\Models\User'); } public function customer() { return $this->belongsTo('App\Models\Customer'); } public function lesson() { return $this->belongsTo('App\Models\User\Curriculum\Lesson'); } } Models/User/CourseManagement/CourseEnrolment.php 0000644 00000002742 15213350437 0016007 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use App\Models\Customer; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CourseEnrolment extends Model { use HasFactory; protected $table = 'user_course_enrolments'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'user_id', 'customer_id', 'order_id', 'billing_first_name', 'billing_last_name', 'billing_email', 'billing_contact_number', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'course_id', 'course_price', 'discount', 'grand_total', 'currency_text', 'currency_text_position', 'currency_symbol', 'currency_symbol_position', 'payment_method', 'gateway_type', 'payment_status', 'attachment', 'invoice', 'conversation_id' ]; public function customer() { return $this->belongsTo(Customer::class, 'customer_id'); } public function userInfo() { return $this->belongsTo(User::class, 'user_id', 'id'); } public function course() { return $this->belongsTo(Course::class, 'course_id', 'id'); } public function courseInfos() { return $this->hasMany(CourseInformation::class, 'course_id'); } } Models/User/CourseManagement/CourseFaq.php 0000644 00000001303 15213350437 0014543 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CourseFaq extends Model { use HasFactory; protected $table = 'user_course_faqs'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'course_id', 'language_id', 'user_id', 'question', 'answer', 'serial_number' ]; public function course() { return $this->belongsTo(Course::class, 'course_id'); } public function language() { return $this->belongsTo(Language::class, 'language_id'); } } Models/User/CourseManagement/LessonContentComplete.php 0000644 00000001505 15213350437 0017146 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use App\Models\Customer; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class LessonContentComplete extends Model { use HasFactory; protected $table = 'user_lesson_content_complete'; public $timestamps = false; protected $fillable = [ 'lesson_id', 'user_id', 'customer_id', 'lesson_content_id', 'type' ]; public function user() { return $this->belongsTo(User::class, 'user_id', 'id'); } public function customer() { return $this->belongsTo(Customer::class, 'user_id', 'id'); } public function lesson_content() { return $this->belongsTo(LessonContent::class, 'lesson_content_id', 'id'); } } Models/User/CourseManagement/Instructor/Instructor.php 0000644 00000001712 15213350437 0017207 0 ustar 00 <?php namespace App\Models\User\CourseManagement\Instructor; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\Language; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Instructor extends Model { use HasFactory; protected $table = 'user_course_instructors'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'language_id', 'user_id', 'image', 'name', 'occupation', 'description', 'is_featured' ]; public function instructorLang() { return $this->belongsTo(Language::class, 'language_id'); } public function socialPlatform() { return $this->hasMany(SocialLink::class, 'instructor_id'); } public function courseList() { return $this->hasMany(CourseInformation::class, 'instructor_id'); } } Models/User/CourseManagement/Instructor/SocialLink.php 0000644 00000001175 15213350437 0017066 0 ustar 00 <?php namespace App\Models\User\CourseManagement\Instructor; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class SocialLink extends Model { use HasFactory; use HasFactory; protected $table = 'user_course_instructor_social_links'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'instructor_id', 'user_id', 'icon', 'url', 'serial_number' ]; public function instructor() { return $this->belongsTo(Instructor::class, 'instructor_id'); } } Models/User/CourseManagement/Course.php 0000644 00000002454 15213350437 0014123 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Course extends Model { use HasFactory; protected $table = 'user_courses'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'user_id', 'thumbnail_image', 'video_link', 'cover_image', 'pricing_type', 'previous_price', 'current_price', 'status', 'is_featured', 'average_rating', 'duration', 'certificate_status', 'video_watching', 'quiz_completion', 'certificate_title', 'certificate_text', 'min_quiz_score' ]; public function courseInformation() { return $this->hasMany(CourseInformation::class); } public function faq() { return $this->hasMany(CourseFaq::class); } public function enrolment() { return $this->hasMany(CourseEnrolment::class, 'course_id', 'id'); } public function review() { return $this->hasMany(CourseReview::class, 'course_id', 'id'); } public function quizScore() { return $this->hasMany(QuizScore::class, 'course_id', 'id'); } } Models/User/CourseManagement/Coupon.php 0000644 00000001002 15213350437 0014112 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Coupon extends Model { use HasFactory; protected $table = 'user__course_coupons'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'user_id', 'name', 'code', 'type', 'value', 'start_date', 'end_date', 'courses' ]; } Models/User/CourseManagement/Lesson.php 0000644 00000002104 15213350437 0014116 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Lesson extends Model { use HasFactory; protected $table = 'user_lessons'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'module_id', 'language_id', 'user_id', 'title', 'status', 'serial_number', 'duration', 'completion_status' ]; public function module() { return $this->belongsTo(Module::class, 'module_id'); } public function content() { return $this->hasMany(LessonContent::class, 'lesson_id'); } public function quiz() { return $this->hasMany(LessonQuiz::class); } public function lesson_complete() { return $this->hasMany(LessonComplete::class, 'lesson_id', 'id'); } public function lessonContentComplete(){ return $this->hasMany(LessonContentComplete::class, 'lesson_id', 'id'); } } Models/User/CourseManagement/CourseCategory.php 0000644 00000001442 15213350437 0015615 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CourseCategory extends Model { use HasFactory; protected $table = 'user_course_categories'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'language_id', 'user_id', 'icon', 'color', 'name', 'status', 'serial_number', 'is_featured', 'slug' ]; public function categoryLang() { return $this->belongsTo(Language::class, 'language_id'); } public function courseInfoList() { return $this->hasMany(CourseInformation::class, 'course_category_id', 'id'); } } Models/User/CourseManagement/LessonContent.php 0000644 00000001602 15213350437 0015453 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class LessonContent extends Model { use HasFactory; protected $table = 'user_lesson_contents'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'lesson_id', 'user_id', 'video_unique_name', 'video_original_name', 'video_duration', 'file_unique_name', 'file_original_name', 'text', 'code', 'type', 'order_no', 'completion_status', 'video_preview' ]; public function lesson() { return $this->belongsTo(Lesson::class, 'lesson_id'); } public function quiz() { return $this->hasMany(LessonQuiz::class, 'lesson_content_id'); } } Models/User/CourseManagement/LessonQuiz.php 0000644 00000001204 15213350437 0014767 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class LessonQuiz extends Model { use HasFactory; protected $table = 'user_lesson_quizzes'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['user_id', 'lesson_id', 'question', 'answers']; public function lesson() { return $this->belongsTo(Lesson::class, 'lesson_id'); } public function content() { return $this->belongsTo(LessonContent::class, 'lesson_content_id', 'id'); } } Models/User/CourseManagement/QuizScore.php 0000644 00000001300 15213350437 0014574 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class QuizScore extends Model { use HasFactory; protected $table = 'user_quiz_scores'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'user_id', 'customer_id', 'course_id', 'lesson_id', 'score' ]; public function user() { return $this->belongsTo(User::class, 'user_id', 'id'); } public function course() { return $this->belongsTo(Course::class, 'course_id', 'id'); } } Models/User/CourseManagement/Module.php 0000644 00000001356 15213350437 0014110 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Module extends Model { use HasFactory; protected $table = 'user_course_modules'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'user_id', 'language_id', 'course_information_id', 'title', 'status', 'serial_number', 'duration' ]; public function courseInformation() { return $this->belongsTo(CourseInformation::class, 'course_information_id'); } public function lesson() { return $this->hasMany(Lesson::class); } } Models/User/CourseManagement/CourseInformation.php 0000644 00000002610 15213350437 0016323 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use App\Models\User\CourseManagement\Instructor\Instructor; use App\Models\User\Language; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CourseInformation extends Model { use HasFactory; protected $table = 'user_course_informations'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'language_id', 'user_id', 'course_category_id', 'course_id', 'title', 'slug', 'instructor_id', 'features', 'description', 'meta_keywords', 'meta_description', 'thanks_page_content' ]; public function language() { return $this->belongsTo(Language::class, 'language_id'); } public function courseCategory() { return $this->belongsTo(CourseCategory::class, 'course_category_id'); } public function course() { return $this->belongsTo(Course::class, 'course_id'); } public function instructor() { return $this->belongsTo(Instructor::class, 'instructor_id'); } public function instructorInfo() { return $this->belongsTo(Instructor::class, 'instructor_id'); } public function module() { return $this->hasMany(Module::class); } } Models/User/CourseManagement/CourseReview.php 0000644 00000001517 15213350437 0015304 0 ustar 00 <?php namespace App\Models\User\CourseManagement; use App\Models\Customer; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CourseReview extends Model { use HasFactory; protected $table = 'user_course_reviews'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'user_id', 'customer_id', 'course_id', 'comment', 'rating' ]; public function userInfo() { return $this->belongsTo(User::class, 'user_id'); } public function customerInfo() { return $this->belongsTo(Customer::class, 'customer_id'); } public function courseInfo() { return $this->belongsTo(Course::class, 'course_id', 'id'); } } Models/User/Skill.php 0000644 00000000645 15213350437 0010504 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class Skill extends Model { public $table = "user_skills"; protected $fillable = [ "icon", "title", "slug", "percentage", "color", "serial_number", "language_id", "user_id", ]; public function language() { return $this->belongsTo(Language::class); } } Models/User/HotelBooking/RoomContent.php 0000644 00000001142 15213350437 0014252 0 ustar 00 <?php namespace App\Models\User\HotelBooking; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class RoomContent extends Model { use HasFactory; public $table = 'user_room_contents'; protected $guarded = []; public function room() { return $this->belongsTo(Room::class, 'room_id', 'id'); } public function roomCategory() { return $this->belongsTo(RoomCategory::class, 'room_category_id', 'id'); } public function roomContentLang() { return $this->belongsTo('App\Models\Language'); } } Models/User/HotelBooking/RoomAmenity.php 0000644 00000000571 15213350437 0014253 0 ustar 00 <?php namespace App\Models\User\HotelBooking; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class RoomAmenity extends Model { use HasFactory; public $table = 'user_room_amenities'; protected $guarded = []; public function amenityLang() { return $this->belongsTo('App\Models\Language'); } } Models/User/HotelBooking/RoomBooking.php 0000644 00000001021 15213350437 0014224 0 ustar 00 <?php namespace App\Models\User\HotelBooking; use App\Models\Customer; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class RoomBooking extends Model { use HasFactory; public $table = 'user_room_bookings'; protected $guarded = []; public function hotelRoom() { return $this->belongsTo(Room::class, 'room_id', 'id'); } public function roomBookedByUser() { return $this->belongsTo(Customer::class, 'customer_id', 'id'); } } Models/User/HotelBooking/Room.php 0000644 00000001604 15213350437 0012722 0 ustar 00 <?php namespace App\Models\User\HotelBooking; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Room extends Model { use HasFactory; public $table = 'user_rooms'; protected $guarded = []; public function roomContent() { return $this->hasMany(RoomContent::class, 'room_id', 'id'); } public function roomBookings() { return $this->hasMany(RoomBooking::class, 'room_id', 'id'); } public function roomReview() { return $this->hasMany('App\Models\RoomManagement\RoomReview'); } /** * scope a query to only those rooms whose status is show. * * @param \Illuminate\Database\Eloquent\Builder $query * @return \Illuminate\Database\Eloquent\Builder */ public function scopeStatus($query) { return $query->where('status', 1); } } Models/User/HotelBooking/RoomCategory.php 0000644 00000000777 15213350437 0014432 0 ustar 00 <?php namespace App\Models\User\HotelBooking; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class RoomCategory extends Model { use HasFactory; public $table = 'user_room_categories'; protected $guarded = []; public function roomCategoryLang() { return $this->belongsTo('App\Models\Language'); } public function roomContentList() { return $this->hasMany(RoomContent::class, 'room_category_id', 'id'); } } Models/User/HotelBooking/Coupon.php 0000644 00000000413 15213350437 0013246 0 ustar 00 <?php namespace App\Models\User\HotelBooking; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Coupon extends Model { use HasFactory; public $table = 'user_room_coupons'; protected $guarded = []; } Models/User/HotelBooking/RoomReview.php 0000644 00000001026 15213350437 0014102 0 ustar 00 <?php namespace App\Models\User\HotelBooking; use App\Models\Customer; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class RoomReview extends Model { use HasFactory; public $table = 'user_room_reviews'; protected $guarded = []; public function roomReviewedByCustomer() { return $this->belongsTo(Customer::class, 'customer_id', 'id'); } public function reviewOfRoom() { return $this->belongsTo(Room::class, 'room_id', 'id'); } } Models/User/Member.php 0000644 00000001163 15213350437 0010631 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Member extends Model { use HasFactory; protected $table = "user_members"; public $timestamps = false; protected $fillable = [ 'language_id', 'user_id', 'name', 'rank', 'image', 'facebook', 'twitter', 'instagram', 'linkedin', 'featured' ]; public function memberLang(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Language::class); } } Models/User/UserOfferBanner.php 0000644 00000000666 15213350437 0012457 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserOfferBanner extends Model { use HasFactory; public $table = 'user_offer_banners'; protected $fillable = [ 'user_id', 'language_id', 'position', 'url', 'image', 'btn_name', 'text_1', 'text_2', 'text_3', ]; } Models/User/UserOrder.php 0000644 00000000434 15213350437 0011334 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class UserOrder extends Model { use HasFactory; public function orderitems() { return $this->hasMany(UserOrderItem::class); } } Models/User/UserTestimonial.php 0000644 00000000652 15213350437 0012553 0 ustar 00 <?php namespace App\Models\User; use Illuminate\Database\Eloquent\Model; class UserTestimonial extends Model { public $table = "user_testimonials"; protected $fillable= [ 'image', 'occupation', 'name', 'content', 'serial_number', 'user_id', 'lang_id' ]; public function language() { return $this->belongsTo(Language::class,'lang_id'); } } Models/Coupon.php 0000644 00000000470 15213350437 0007747 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Coupon extends Model { use HasFactory; protected $fillable = ['name', 'code', 'type', 'value', 'start_date', 'end_date', 'packages', 'maximum_uses_limit', 'total_uses']; } Models/Blog.php 0000644 00000001046 15213350437 0007367 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Blog extends Model { public $timestamps = true; protected $fillable = [ "language_id", "bcategory_id", "title", "slug", "main_image", "content", "meta_keywords", "meta_description", "serial_number", ]; public function bcategory() { return $this->belongsTo('App\Models\Bcategory'); } public function language() { return $this->belongsTo('App\Models\Language'); } } Models/Scategory.php 0000644 00000000475 15213350437 0010451 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Scategory extends Model { public $timestamps = false; public function services() { return $this->hasMany('App\Service'); } public function language() { return $this->belongsTo('App\Models\Language'); } } Models/Subscriber.php 0000644 00000000451 15213350437 0010606 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Subscriber extends Model { use HasFactory; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['email_id']; } Models/BasicSetting.php 0000644 00000002354 15213350437 0011066 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class BasicSetting extends Model { public $timestamps = false; protected $fillable = [ "language_id", 'intro_subtitle', 'intro_title', 'intro_text', 'intro_main_image', 'team_section_title', 'team_section_subtitle', 'feature_section', 'process_section', 'templates_section', 'featured_users_section', 'pricing_section', 'partners_section', 'intro_section', 'testimonial_section', 'news_section', 'top_footer_section', 'copyright_section', 'footer_text', 'copyright_text', 'footer_logo', 'maintainance_mode', 'maintainance_text', 'maintenance_img', 'maintenance_status', 'secret_path', 'testimonial_image', 'partners_section_title', 'partners_section_subtitle', 'vcard_section', 'vcard_section_title', 'vcard_section_subtitle', 'intro_button_name', 'intro_button_url', 'adsense_publisher_id' ]; public function language() { return $this->belongsTo('App\Models\Language'); } } Models/Page.php 0000644 00000000304 15213350437 0007354 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Page extends Model { public function language() { return $this->belongsTo('App\Models\Language'); } } Models/PaymentInvoice.php 0000644 00000000677 15213350437 0011447 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class PaymentInvoice extends Model { /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ "order_id", "client_id", "InvoiceId", "InvoiceStatus", "InvoiceValue", "Currency", "InvoiceDisplayValue", "TransactionId", "TransactionStatus", "PaymentGateway", "PaymentId", "CardNumber" ]; } Models/Role.php 0000644 00000012313 15213350437 0007404 0 ustar 00 <?php namespace App\Models; use Illuminate\Support\Str; use App\Traits\Multitenantable; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Auth; use App\Traits\HasJsonResourcefulData; use Spatie\Permission\Models\Role as roleModal; use Stancl\Tenancy\Database\Concerns\BelongsToTenant; use Illuminate\Database\Eloquent\Factories\HasFactory; /** * App\Models\Role * * @property int $id * @property string $name * @property string|null $display_name * @property string $guard_name * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property-read \Illuminate\Database\Eloquent\Collection|\Spatie\Permission\Models\Permission[] $permissions * @property-read int|null $permissions_count * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $users * @property-read int|null $users_count * * @method static \Illuminate\Database\Eloquent\Builder|Role newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Role newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Role permission($permissions) * @method static \Illuminate\Database\Eloquent\Builder|Role query() * @method static \Illuminate\Database\Eloquent\Builder|Role whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Role whereDisplayName($value) * @method static \Illuminate\Database\Eloquent\Builder|Role whereGuardName($value) * @method static \Illuminate\Database\Eloquent\Builder|Role whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Role whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|Role whereUpdatedAt($value) * * @mixin \Eloquent */ class Role extends roleModal { use HasFactory, HasJsonResourcefulData, BelongsToTenant, Multitenantable; protected $table = 'roles'; const JSON_API_TYPE = 'roles'; public $guard_name = 'web'; protected $fillable = [ 'name', 'tenant_id', 'display_name', 'guard_name', ]; const SUPER_ADMIN = 'superadmin'; const ADMIN = 'admin'; public static function rules(): array { return [ 'name' => 'required|unique:roles,name,NULL,id,tenant_id,' . Auth::user()->tenant_id, 'permissions' => 'required', ]; } public function prepareLinks(): array { return [ 'self' => route('roles.show', $this->id), ]; } public function prepareAttributes(): array { $fields = [ 'name' => $this->name, 'display_name' => $this->display_name, 'is_default' => $this->name === self::SUPER_ADMIN || $this->name === self::ADMIN, 'permissions' => $this->permissions, 'created_at' => $this->created_at, ]; if ($this->relationLoaded('permissions')) { $assignedPermissions = $this->permissions->keyBy('id'); $assignedPermissionIds = $assignedPermissions->keys()->all(); $allChildPermissions = Permission::whereIn('name', function ($query) { $query->select(DB::raw("DISTINCT name")) ->from('permissions') ->where('name', 'regexp', '^(edit|create|view|delete)_'); })->get()->keyBy('name'); $managePermissions = $this->permissions->filter(function ($permission) { return Str::startsWith($permission->name, 'manage_'); }); $groupedPermissions = $managePermissions->map(function ($permission) use ($assignedPermissionIds, $assignedPermissions, $allChildPermissions) { $module = Str::after($permission->name, 'manage_'); $actions = ['edit', 'create', 'view', 'delete']; $childPermissions = collect($actions)->map(function ($action) use ($module, $assignedPermissionIds, $assignedPermissions, $allChildPermissions) { $permissionName = "{$action}_{$module}"; $perm = $allChildPermissions->get($permissionName); if (!$perm) return null; $isAssigned = in_array($perm->id, $assignedPermissionIds); $data = [ 'id' => $perm->id, 'name' => $permissionName, 'selected' => $isAssigned, ]; if ($isAssigned && isset($assignedPermissions[$perm->id]->pivot)) { $data['pivot'] = [ 'role_id' => $assignedPermissions[$perm->id]->pivot->role_id, 'permission_id' => $assignedPermissions[$perm->id]->pivot->permission_id, ]; } return $data; })->filter(); return [ 'id' => $permission->id, 'name' => $permission->name, 'display_name' => $permission->display_name, 'guard_name' => $permission->guard_name, 'child_permissions' => $childPermissions->values(), ]; }); $fields['permissions'] = $groupedPermissions->values(); } return $fields; } } Models/Language.php 0000644 00000007052 15213350437 0010232 0 ustar 00 <?php namespace App\Models; use App\Models\FAQ; use App\Models\Popup; use App\Models\MenuBuilder; use App\Models\HomePage\Banner; use App\Models\Footer\QuickLink; use App\Models\BasicSettings\SEO; use App\Models\Staff\StaffContent; use App\Models\Shop\ProductContent; use App\Models\Shop\ShippingCharge; use App\Models\Footer\FooterContent; use App\Models\Journal\BlogCategory; use App\Models\Shop\ProductCategory; use App\Models\BasicSettings\AboutUs; use App\Models\CustomPage\PageContent; use App\Models\Journal\BlogInformation; use App\Models\Services\ServiceContent; use Illuminate\Database\Eloquent\Model; use App\Models\Services\ServiceCategory; use App\Models\BasicSettings\CookieAlert; use App\Models\BasicSettings\PageHeading; use App\Models\Services\ServiceSubCategory; use App\Models\HomePage\Testimony\Testimonial; use App\Models\HomePage\Methodology\WorkProcess; use Illuminate\Database\Eloquent\Factories\HasFactory; class Language extends Model { use HasFactory; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['name', 'code', 'direction', 'is_default']; public function faq() { return $this->hasMany(FAQ::class); } public function customPageInfo() { return $this->hasMany(PageContent::class); } public function footerContent() { return $this->hasOne(FooterContent::class); } public function footerQuickLink() { return $this->hasMany(QuickLink::class); } public function announcementPopup() { return $this->hasMany(Popup::class); } public function blogCategory() { return $this->hasMany(BlogCategory::class); } public function blogInformation() { return $this->hasMany(BlogInformation::class); } public function menuInfo() { return $this->hasOne(MenuBuilder::class, 'language_id', 'id'); } public function aboutSection() { return $this->belongsTo(AboutUs::class); } public function workProcess() { return $this->hasMany(WorkProcess::class, 'language_id', 'id'); } public function features() { return $this->hasMany(Features::class, 'language_id', 'id'); } public function testimonial() { return $this->hasMany(Testimonial::class, 'language_id', 'id'); } public function serviceCategory() { return $this->hasMany(ServiceCategory::class, 'language_id', 'id'); } public function serviceSubCategory() { return $this->hasMany(ServiceSubCategory::class, 'language_id', 'id'); } /** */ public function aboutUsSection() { return $this->hasOne(AboutUs::class, 'language_id', 'id'); } public function featuresInfos() { return $this->hasMany(Features::class, 'language_id', 'id'); } public function shippingCharge() { return $this->hasMany(ShippingCharge::class); } public function serviceContent() { return $this->hasMany(ServiceContent::class, 'language_id', 'id'); } public function productCategory() { return $this->hasMany(ProductCategory::class); } public function staffContent() { return $this->hasMany(StaffContent::class); } public function productContent() { return $this->hasMany(ProductContent::class); } public function vendorInfo() { return $this->hasOne(VendorInfo::class); } public function banner() { return $this->hasOne(Banner::class); } public function pageName() { return $this->hasOne(PageHeading::class); } public function seoInfo() { return $this->hasOne(SEO::class); } public function cookieAlertInfo() { return $this->hasOne(CookieAlert::class); } } Models/Package.php 0000644 00000001240 15213350437 0010033 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; class Package extends Model { use HasFactory; protected $fillable = [ 'title', 'price', 'term', 'is_trial', 'trial_days', 'status', 'icon', 'number_of_service_add', 'number_of_service_image', 'number_of_appointment', 'staff_limit', 'recommended', 'zoom_meeting_status', 'calendar_status', 'custom_features', 'support_ticket_status', 'staff_status', 'whatsapp_manager_status' ]; public function memberships() { return $this->hasMany(Membership::class); } } Models/Process.php 0000644 00000000462 15213350437 0010123 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Process extends Model { use HasFactory; public $timestamps = false; public function language() { return $this->belongsTo('App\Models\Language'); } } Models/Ulink.php 0000644 00000000444 15213350437 0007567 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Ulink extends Model { public $timestamps = false; protected $fillable = ['id', 'name', 'language_id', 'url']; public function language() { return $this->belongsTo('App\Models\Language'); } } Models/AiGenerationLog.php 0000644 00000000432 15213350437 0011511 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class AiGenerationLog extends Model { use HasFactory; protected $fillable = [ 'user_id', 'package_id', 'ai_engine' ]; } Models/Seo.php 0000644 00000001515 15213350437 0007233 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Seo extends Model { use HasFactory; public $timestamps = false; protected $fillable = ['language_id', 'home_meta_keywords', 'home_meta_description', 'profiles_meta_keywords', 'profiles_meta_description', 'pricing_meta_keywords', 'pricing_meta_description', 'blogs_meta_keywords', 'blogs_meta_description', 'faqs_meta_keywords', 'faqs_meta_description', 'contact_meta_keywords', 'contact_meta_description', 'login_meta_keywords', 'login_meta_description', 'forget_password_meta_keywords', 'forget_password_meta_description', 'checkout_meta_keywords', 'checkout_meta_description', 'vcard_template_description', 'vcard_template_keywords', 'website_template_description', 'website_template_keywords']; } Models/Admin.php 0000644 00000001552 15213350437 0007536 0 ustar 00 <?php namespace App\Models; use App\Models\RolePermission; use Illuminate\Auth\Authenticatable; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Admin extends Model implements AuthenticatableContract { use HasFactory, Authenticatable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'role_id', 'first_name', 'last_name', 'image', 'username', 'email', 'password', 'status', 'address', 'details', 'lang_code' ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = ['password']; public function role() { return $this->belongsTo(RolePermission::class, 'role_id', 'id'); } } Models/Sitemap.php 0000644 00000000304 15213350437 0010102 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Sitemap extends Model { protected $fillable = ['sitemap_url','filename']; protected $table = 'sitemaps'; } Models/Social.php 0000644 00000000206 15213350437 0007713 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Social extends Model { public $timestamps = false; } Models/Testimonial.php 0000644 00000001733 15213350437 0010777 0 ustar 00 <?php namespace App\Models; use App\Models\Contracts\JsonResourceful; use App\Traits\HasJsonResourcefulData; use Illuminate\Database\Eloquent\Factories\HasFactory; use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; class Testimonial extends BaseModel implements HasMedia, JsonResourceful { use HasFactory, InteractsWithMedia, HasJsonResourcefulData; protected $fillable = [ 'name', 'description', ]; const IMAGE = 'testimonial_image'; public function getImageAttribute() { $url = $this->getFirstMediaUrl(self::IMAGE); return $url ? $url : asset('images/default/testimonial-4.png'); } public function prepareLinks(): array { return [ // ]; } public function prepareAttributes(): array { return [ 'image' => $this->image, 'name' => $this->name, 'description' => $this->description, ]; } } Models/OfflineGateway.php 0000644 00000000361 15213350437 0011407 0 ustar 00 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class OfflineGateway extends Model { protected $fillable = ['id', 'name', 'short_description', 'instructions', 'serial_number', 'status', 'is_receipt', 'receipt']; } Exports/PorductOrderExport.php 0000644 00000005336 15213350437 0012551 0 ustar 00 <?php namespace App\Exports; use App\BasicExtra; use App\ProductOrder; use App\Models\User\BasicSetting; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\FromCollection; class PorductOrderExport implements FromCollection, WithHeadings, WithMapping { public $orders; public function __construct($orders) { $this->orders = $orders; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->orders; } public function map($order): array { $bex = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->first(); return [ $order->order_number, $order->billing_fname, $order->billing_email, $order->billing_number, $order->billing_city, $order->billing_country, $order->shpping_fname, $order->shpping_email, $order->shpping_number, $order->shpping_city, $order->shpping_country, $order->method, !empty($order->shipping_method) ? $order->shipping_method : '-', $order->payment_status, $order->order_status, ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $order->cart_total . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $order->discount . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $order->tax . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $order->shipping_charge . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $order->total . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), $order->created_at ]; } public function headings(): array { return [ 'Order Number', 'Billing Name', 'Billing Email', 'Billing Phone', 'Billing City', 'Billing Country', 'Shipping Name', 'Shipping Email', 'Shipping Phone', 'Shipping City', 'Shipping Country', 'Gateway', 'Shipping Method', 'Payment Status', 'Order Status', 'Cart Total', 'Discount', 'Tax', 'Shipping Charge', 'Total', 'Date' ]; } } Exports/EventBookingExport.php 0000644 00000002520 15213350437 0012517 0 ustar 00 <?php namespace App\Exports; use App\BasicExtra; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; class EventBookingExport implements FromCollection, WithHeadings, WithMapping { public $bookings; public function __construct($bookings) { $this->bookings = $bookings; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->bookings; } public function map($booking): array { $bex = BasicExtra::firstOrFail(); return [ $booking->transaction_id, $booking->name, $booking->email, $booking->phone, !empty($booking->event) ? $booking->event->title : '-', ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $booking->amount . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), $booking->quantity, $booking->payment_method, $booking->status, $booking->created_at ]; } public function headings(): array { return [ 'Ticket ID', 'Name', 'Email', 'Phone', 'Event', 'Amount', 'Quantity', 'Gateway', 'Status', 'Date' ]; } } Exports/DonationExport.php 0000644 00000002772 15213350437 0011711 0 ustar 00 <?php namespace App\Exports; use App\BasicExtra; use App\Models\User\BasicSetting; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; class DonationExport implements FromCollection, WithHeadings, WithMapping { public $donations; public function __construct($donations) { $this->donations = $donations; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->donations; } public function map($donation): array { $bex = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->firstOrFail(); return [ $donation->transaction_id, $donation->name ? $donation->name : '-', $donation->email ? $donation->email : '-', $donation->phone ? $donation->phone : '-', !empty($donation->title) ? $donation->title : '-', ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $donation->amount . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), $donation->payment_method, $donation->status, $donation->created_at ]; } public function headings(): array { return [ 'Donation ID', 'Name', 'Email', 'Phone', 'Event', 'Amount', 'Gateway', 'Payment Status', 'Date' ]; } } Exports/EnrollExport.php 0000644 00000002554 15213350437 0011367 0 ustar 00 <?php namespace App\Exports; use App\BasicExtra; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; class EnrollExport implements FromCollection, WithHeadings, WithMapping { public $enrolls; public function __construct($enrolls) { $this->enrolls = $enrolls; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->enrolls; } public function map($enroll): array { $bex = BasicExtra::firstOrFail(); return [ $enroll->order_number, $enroll->user ? $enroll->user->username : '-', $enroll->first_name ? $enroll->first_name : '-', $enroll->email, !empty($enroll->course) ? $enroll->course->title : '-', ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $enroll->current_price . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), $enroll->payment_method, $enroll->payment_status, $enroll->created_at ]; } public function headings(): array { return [ 'Order Number', 'Username', 'Name', 'Email', 'Course', 'Price', 'Gateway', 'Payment Status', 'Date' ]; } } Exports/EnrolmentsExport.php 0000644 00000004017 15213350437 0012256 0 ustar 00 <?php namespace App\Exports; use App\Models\User\BasicSetting; use App\Models\User\Language; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; class EnrolmentsExport implements FromCollection, WithHeadings, WithMapping { public $enrols; public function __construct($enrols) { $this->enrols = $enrols; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->enrols; } public function map($enrol): array { $bs = BasicSetting::where('user_id', Auth::guard('web')->user()->id)->firstOrFail(); $deLang = Language::where('user_id', Auth::guard('web')->user()->id)->where('is_default', 1)->first(); return [ $enrol->order_id, $enrol->course->courseInformation()->where('language_id', $deLang->id)->pluck('title')->first(), ($bs->base_currency_symbol_position == 'left' ? $bs->base_currency_symbol : '') . $enrol->course_price . ($bs->base_currency_symbol_position == 'right' ? $bs->base_currency_symbol : ''), ($bs->base_currency_symbol_position == 'left' ? $bs->base_currency_symbol : '') . (empty($enrol->discount) ? 0 : $enrol->discount) . ($bs->base_currency_symbol_position == 'right' ? $bs->base_currency_symbol : ''), ($bs->base_currency_symbol_position == 'left' ? $bs->base_currency_symbol : '') . $enrol->grand_total . ($bs->base_currency_symbol_position == 'right' ? $bs->base_currency_symbol : ''), $enrol->billing_first_name, $enrol->billing_email, $enrol->billing_contact_number, $enrol->billing_city, $enrol->billing_state, $enrol->billing_country, $enrol->payment_method, $enrol->payment_status, $enrol->created_at ]; } public function headings(): array { return [ 'Order Number', 'Course', 'Course Price', 'Discount', 'Total', 'Name', 'Email', 'Phone', 'City', 'State', 'Country', 'Gateway', 'Payment Status', 'Date' ]; } } Exports/PackageOrderExport.php 0000644 00000003332 15213350437 0012456 0 ustar 00 <?php namespace App\Exports; use App\BasicExtra; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; class PackageOrderExport implements FromCollection, WithHeadings, WithMapping { public $pos; public $bex; public function __construct($pos) { $this->pos = $pos; $this->bex = BasicExtra::firstOrFail(); } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->pos; } public function map($po): array { if ($po->status == 0) { $status = 'Pending'; } elseif ($po->status == 1) { $status = 'Processing'; } elseif ($po->status == 2) { $status = 'Completed'; } elseif ($po->status == 3) { $status = 'Rejected'; } if ($po->payment_status == 0) { $paymentStatus = 'Pending'; } elseif ($po->payment_status == 1) { $paymentStatus = 'Completed'; } return [ $po->order_number, $po->name, $po->email, $po->package_title, ($this->bex->base_currency_symbol_position == 'left' ? $this->bex->base_currency_symbol : '') . $po->package_price . ($this->bex->base_currency_symbol_position == 'right' ? $this->bex->base_currency_symbol : ''), $po->payment_method, $status, $paymentStatus, $po->created_at ]; } public function headings(): array { return [ 'Order Number', 'Name', 'Email', 'Package', 'Amount', 'Gateway', 'Order Status', 'Payment Status', 'Date' ]; } } Jobs/GenerateFullWebsiteJob.php 0000644 00000011004 15213350437 0012504 0 ustar 00 <?php namespace App\Jobs; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use App\Services\MasterAiGenerator; use App\Models\User; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; class GenerateFullWebsiteJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public $tries = 3; public $timeout = 600; // 10 মিনিট protected $userId; protected $theme; protected $businessName; protected $industry; protected $businessInfo; protected $pages; protected $userEmail; protected $userName; public function __construct( $userId, $theme, $businessName, $industry, $businessInfo = '', $pages = [] ) { $this->userId = $userId; $this->theme = $theme; $this->businessName = $businessName; $this->industry = $industry; $this->businessInfo = $businessInfo; $this->pages = $pages; // ইউজারের ইমেইল ও নাম সেট করুন $user = User::find($userId); if ($user) { $this->userEmail = $user->email; $this->userName = $user->name; } } public function handle() { Log::info('Starting AI website generation job', [ 'user_id' => $this->userId, 'business' => $this->businessName ]); try { $aiService = new MasterAiGenerator(); // আপনার মূল জেনারেশন লজিক কল করুন $result = $aiService->generateFullWebsite( $this->userId, $this->theme, $this->businessName, $this->industry, $this->businessInfo, $this->pages ); Log::info('AI website generation completed', [ 'user_id' => $this->userId, 'result' => $result ]); // ✅ সাকসেস মেইল পাঠান $this->sendSuccessEmail(); } catch (\Exception $e) { Log::error('AI website generation failed', [ 'user_id' => $this->userId, 'error' => $e->getMessage() ]); // ✅ এরর মেইল পাঠান $this->sendErrorEmail($e->getMessage()); throw $e; } } public function failed(\Throwable $exception) { Log::critical('AI website generation job failed after all retries', [ 'user_id' => $this->userId, 'error' => $exception->getMessage() ]); // ✅ সব রিট্রাই ফেইল হলে মেইল $this->sendFailedEmail($exception->getMessage()); } private function sendSuccessEmail() { if (!$this->userEmail) return; $data = [ 'userName' => $this->userName, 'businessName' => $this->businessName, 'theme' => $this->theme, 'generatedTime' => now()->format('F j, Y, g:i a') ]; Mail::send('emails.website_generated', $data, function ($message) { $message->to($this->userEmail) ->subject('✅ Your Website Has Been Generated Successfully!'); }); } private function sendErrorEmail($errorMessage) { if (!$this->userEmail) return; $data = [ 'userName' => $this->userName, 'businessName' => $this->businessName, 'errorMessage' => $errorMessage, 'time' => now()->format('F j, Y, g:i a') ]; Mail::send('emails.website_generation_error', $data, function ($message) { $message->to($this->userEmail) ->subject('⚠️ Website Generation Failed'); }); } private function sendFailedEmail($errorMessage) { if (!$this->userEmail) return; $data = [ 'userName' => $this->userName, 'businessName' => $this->businessName, 'errorMessage' => $errorMessage, 'time' => now()->format('F j, Y, g:i a') ]; Mail::send('emails.website_generation_failed', $data, function ($message) { $message->to($this->userEmail) ->subject('❌ Website Generation Failed After Multiple Attempts'); }); } } Jobs/SubscriptionExpiredMail.php 0000644 00000002273 15213350437 0012771 0 ustar 00 <?php namespace App\Jobs; use App\Http\Helpers\MegaMailer; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldBeUnique; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; class SubscriptionExpiredMail implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public $vendor; public $bs; /** * Create a new job instance. * * @return void */ public function __construct($vendor, $bs) { $this->vendor = $vendor; $this->bs = $bs; } /** * Execute the job. * * @return void */ public function handle() { $mailer = new MegaMailer(); $data = [ 'toMail' => $this->vendor->email, 'toName' => $this->vendor->fname, 'username' => $this->vendor->username, 'website_title' => $this->bs->website_title, 'templateType' => 'membership_expired', 'login_link' => '<a href="' . route('vendor.login') . '">Login</a>' ]; $mailer->mailFromAdmin($data); } } Jobs/IyzicoPendingMembership.php 0000644 00000002074 15213350437 0012747 0 ustar 00 <?php namespace App\Jobs; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldBeUnique; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use App\Models\User; use App\Models\Package; use App\Models\Language; use App\Models\Membership; use App\Models\BasicSetting; use Illuminate\Http\Request; use Illuminate\Support\Carbon; use App\Http\Helpers\MegaMailer; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Config; class IyzicoPendingMembership implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public $id; public $status; /** * Create a new job instance. * * @return void */ public function __construct($id, $status) { $this->id = $id; $this->status = $status; } /** * Execute the job. * * @return void */ public function handle() { } } Jobs/RunServiceJob.php 0000644 00000010263 15213350437 0010677 0 ustar 00 <?php namespace App\Jobs; use App\Services\MasterAiGenerator; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Cache; class RunServiceJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; protected string $serviceClass; protected array $data; public function __construct(string $serviceClass, array $data) { $this->serviceClass = $serviceClass; $this->data = $data; } public function handle() { if (empty($this->data['user_id'])) { return; } $contextData = [ 'user_id' => $this->data['user_id'] ?? null, 'theme' => $this->data['theme'] ?? '', 'business_name' => $this->data['business_name'] ?? '', 'industry' => $this->data['industry'] ?? '', 'business_info' => $this->data['business_info'] ?? '', 'pages' => $this->data['pages'] ?? [], 'ai_engine' => $this->data['ai_engine'] ?? 'pollinations', 'is_delete_old_records' => $this->data['is_delete_old_records'] ?? true, 'run_id' => $this->data['run_id'] ?? null, ]; $ai = new MasterAiGenerator(); $ai->setContext($contextData); // class exists check if (!class_exists($this->serviceClass)) { return; } $service = new $this->serviceClass($ai); $service->generate(); // ================== COMPLETE TRACK ================== $runId = $this->data['run_id'] ?? null; if (!$runId) return; $completed = Cache::increment("ai_run_completed:{$runId}"); $expected = (int) Cache::get("ai_run_expected:{$runId}", 0); // last job check + prevent duplicate mail if ($expected > 0 && $completed >= $expected) { // only one worker will win this if (Cache::add("ai_run_mail_lock:{$runId}", 1, now()->addMinutes(30))) { try { $userId = (int) ($this->data['user_id']); $theme = (string) ($this->data['theme']); $user = \App\Models\User::find($userId); if (!$user) { return; } if (session()->has('lang')) { $currentLang = \App\Models\Language::where('code', session()->get('lang'))->first(); } else { $currentLang = \App\Models\Language::where('is_default', 1)->first(); } $bs = $currentLang?->basic_setting; $websiteTitle = $bs->website_title ?? __('Website'); $subject = $websiteTitle . ' - ' . __('AI Generation Completed'); $body = " <p>" . __('Hello') . " {$user->fname},</p> <p>" . __('Your AI website generation has completed successfully') . '.' . "</p> <p><b>" . __('Theme') . ":</b> {$theme}</p> <p>" . __('You can now review your website') . '.' . "</p> <p>" . __('Thanks') . ",<br>{$websiteTitle}</p> "; $mailer = new \App\Http\Helpers\MegaMailer(); $mailer->mailSimpleFromAdmin([ 'toMail' => $user->email, 'toName' => $user->fname, 'subject' => $subject, 'body' => $body, ]); //cleanup Cache::forget("ai_run_expected:{$runId}"); Cache::forget("ai_run_completed:{$runId}"); Cache::forget("ai_run_mail_lock:{$runId}"); } catch (\Throwable $e) { Cache::forget("ai_run_mail_lock:{$runId}"); } } } } public function failed(\Throwable $e) { Log::error('RunServiceJob failed', [ 'service' => $this->serviceClass, 'error' => $e->getMessage(), ]); } } Jobs/SubscriptionReminderMail.php 0000644 00000002526 15213350437 0013137 0 ustar 00 <?php namespace App\Jobs; use App\Http\Helpers\MegaMailer; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldBeUnique; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; class SubscriptionReminderMail implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public $vendor; public $bs; public $expire_date; /** * Create a new job instance. * * @return void */ public function __construct($vendor, $bs, $expire_date) { $this->vendor = $vendor; $this->bs = $bs; $this->expire_date = $expire_date; } /** * Execute the job. * * @return void */ public function handle() { $mailer = new MegaMailer(); $data = [ 'toMail' => $this->vendor->email, 'toName' => $this->vendor->username, 'username' => $this->vendor->username, 'last_day_of_membership' => $this->expire_date, 'login_link' => '<a href="' . route('vendor.login') . '">Login</a>', 'website_title' => $this->bs->website_title, 'templateType' => 'membership_expiry_reminder' ]; $mailer->mailFromAdmin($data); } } Services/MasterAiGenerator.php 0000644 00000066110 15213350437 0012423 0 ustar 00 <?php namespace App\Services; use App\Http\Helpers\UserPermissionHelper; use App\Jobs\RunServiceJob; use App\Jobs\SendAiDoneMailJob; use App\Services\AiWebsite\BasicSettingService; use App\Services\AiWebsite\Blog\BlogCategoryService; use App\Services\AiWebsite\Blog\BlogFeaturedImageService; use App\Services\AiWebsite\Blog\BlogService; use App\Services\AiWebsite\Blog\BlogSliderImageService; use App\Services\AiWebsite\ContactService; use App\Services\AiWebsite\CourseManagement\ActionSectionService; use App\Services\AiWebsite\CourseManagement\CourseCategoryService; use App\Services\AiWebsite\CourseManagement\CourseCouponService; use App\Services\AiWebsite\CourseManagement\CourseService; use App\Services\AiWebsite\CourseManagement\InstructorService; use App\Services\AiWebsite\DonationManagement\DonationCategoryService; use App\Services\AiWebsite\DonationManagement\DonationCauseService; use App\Services\AiWebsite\FAQService; use App\Services\AiWebsite\GalleryManagement\GalleryCategoryService; use App\Services\AiWebsite\GalleryManagement\GalleryItemService; use App\Services\AiWebsite\HomePage\BrandService; use App\Services\AiWebsite\HomePage\CounterInformationService; use App\Services\AiWebsite\HomePage\FooterQuickLinkService; use App\Services\AiWebsite\HomePage\FooterTextService; use App\Services\AiWebsite\HomePage\HeroSliderService; use App\Services\AiWebsite\HomePage\HomePageTextService; use App\Services\AiWebsite\HomePage\JobCategoryService; use App\Services\AiWebsite\HomePage\JobService; use App\Services\AiWebsite\HomePage\MemberService; use App\Services\AiWebsite\HomePage\SkillService; use App\Services\AiWebsite\HomePage\TestimonialService; use App\Services\AiWebsite\HotelManagement\RoomAmenityService; use App\Services\AiWebsite\HotelManagement\RoomCategoryService; use App\Services\AiWebsite\HotelManagement\RoomCouponService; use App\Services\AiWebsite\HotelManagement\RoomService; use App\Services\AiWebsite\OfferBannerService; use App\Services\AiWebsite\PortfolioCategoryService; use App\Services\AiWebsite\PortfolioService; use App\Services\AiWebsite\PortfolioSliderImageService; use App\Services\AiWebsite\SEOService; use App\Services\AiWebsite\ShopManagement\CouponService; use App\Services\AiWebsite\ShopManagement\ItemCategoryService; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use App\Services\GeminiTokenService; use App\Services\AiWebsite\ShopManagement\ItemService; use App\Services\AiWebsite\ShopManagement\ItemSubCategoryService; use App\Services\AiWebsite\ShopManagement\ShippingChargeService; use App\Services\AiWebsite\SocialService; use App\Services\AiWebsite\UserFeatureService; use App\Services\AiWebsite\UserServiceService; use App\Services\AiWebsite\WhyChooseUsItemService; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Cache; use Throwable; class MasterAiGenerator { protected $userId; protected $theme; protected $businessName; protected $industry; protected $businessInfo; protected $aiEngine; protected $pages = []; protected $defaultLanguageId; protected $isDeleteOldRecords; protected string $runId = ''; public function __construct() { } public function getDefaultLanguageId() { if ($this->defaultLanguageId) { return $this->defaultLanguageId; } $this->defaultLanguageId = \App\Models\User\Language::where('user_id', $this->userId) ->where('is_default', 1) ->value('id'); if (!$this->defaultLanguageId) { $this->defaultLanguageId = \App\Models\User\Language::where('user_id', $this->userId) ->value('id'); } return $this->defaultLanguageId ?: 1; } public function generateFullWebsite(array $data) { $this->userId = (int) $data['user_id']; $this->theme = $data['theme'] ?? ''; $this->businessName = $data['business_name'] ?? ''; $this->industry = $data['industry'] ?? ''; $this->businessInfo = !empty($data['business_info']) ? $data['business_info'] : "A professional {$this->industry} company offering high-quality services to clients worldwide."; $this->aiEngine = $data['ai_engine']; $this->pages = is_array($data['pages'] ?? null) ? $data['pages'] : []; $this->isDeleteOldRecords = ($data['delete_old_records'] === true || $data['delete_old_records'] === 1 || $data['delete_old_records'] === '1'); $this->generateWithThrottling(); return "AI Website Generated Successfully for {$this->businessName}"; } private function payload(): array { return [ 'user_id' => $this->getUserId(), 'theme' => $this->theme, 'business_name' => $this->businessName, 'industry' => $this->industry, 'business_info' => $this->businessInfo, 'pages' => $this->pages, 'ai_engine' => $this->aiEngine, 'is_delete_old_records' => $this->isDeleteOldRecords, 'run_id' => $this->runId, ]; } public function setContext(array $data): void { $this->userId = (int) ($data['user_id'] ?? 0); $this->theme = (string) ($data['theme'] ?? ''); $this->businessName = (string) ($data['business_name'] ?? ''); $this->industry = (string) ($data['industry'] ?? ''); $this->businessInfo = (string) ($data['business_info'] ?? ''); $this->pages = is_array($data['pages'] ?? null) ? $data['pages'] : []; $this->aiEngine = (string) ($data['ai_engine'] ?? 'pollinations'); $this->isDeleteOldRecords = $data['is_delete_old_records']; $this->runId = (string) ($data['run_id'] ?? ''); } private function generateWithThrottling() { $delay = 0; $runId = (string) Str::uuid(); $this->runId = $runId; // prevent same user parallel run // $lock = Cache::lock("ai_generate_lock:user:{$this->userId}", 600); // if (!$lock->get()) { // \Log::warning("AI generation already running for user {$this->userId}"); // return; // } // try { $jobs = []; // ====================== COMMON FOR ALL THEMES ====================== $commonServices = [ HeroSliderService::class, CounterInformationService::class, FooterTextService::class, FooterQuickLinkService::class, BasicSettingService::class, SocialService::class, SEOService::class, ]; foreach ($commonServices as $service) { $jobs[] = $service; dispatch(new RunServiceJob($service, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // Home Page Text if (in_array('home', $this->pages)) { $jobs[] = HomePageTextService::class; dispatch(new RunServiceJob(HomePageTextService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // ====================== PAGE-BASED SERVICES ====================== if (in_array('services', $this->pages)) { $jobs[] = UserServiceService::class; dispatch(new RunServiceJob(UserServiceService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } if (in_array('faq', $this->pages)) { $jobs[] = FAQService::class; dispatch(new RunServiceJob(FAQService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } if (in_array('team', $this->pages)) { $jobs[] = MemberService::class; dispatch(new RunServiceJob(MemberService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } if (in_array('career', $this->pages)) { $jobs[] = JobCategoryService::class; dispatch(new RunServiceJob(JobCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = JobService::class; dispatch(new RunServiceJob(JobService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } if (in_array('portfolios', $this->pages)) { $jobs[] = PortfolioCategoryService::class; dispatch(new RunServiceJob(PortfolioCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = PortfolioService::class; dispatch(new RunServiceJob(PortfolioService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = PortfolioSliderImageService::class; dispatch(new RunServiceJob(PortfolioSliderImageService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } if (in_array('blog', $this->pages)) { $jobs[] = BlogCategoryService::class; dispatch(new RunServiceJob(BlogCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = BlogService::class; dispatch(new RunServiceJob(BlogService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = BlogSliderImageService::class; dispatch(new RunServiceJob(BlogSliderImageService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = BlogFeaturedImageService::class; dispatch(new RunServiceJob(BlogFeaturedImageService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } if (in_array('shop', $this->pages)) { $jobs[] = ShippingChargeService::class; dispatch(new RunServiceJob(ShippingChargeService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = CouponService::class; dispatch(new RunServiceJob(CouponService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = ItemCategoryService::class; dispatch(new RunServiceJob(ItemCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = ItemSubCategoryService::class; dispatch(new RunServiceJob(ItemSubCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = ItemService::class; dispatch(new RunServiceJob(ItemService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } if (in_array('contact', $this->pages)) { $jobs[] = ContactService::class; dispatch(new RunServiceJob(ContactService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } if (in_array('gallery', $this->pages)) { $jobs[] = GalleryCategoryService::class; dispatch(new RunServiceJob(GalleryCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = GalleryItemService::class; dispatch(new RunServiceJob(GalleryItemService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // ====================== THEME-SPECIFIC SERVICES ====================== // Brand $brandExcluded = ['home_four', 'home_five', 'home_seven', 'home_ten', 'home_eleven', 'home_thirteen', 'home_fourteen']; if (!in_array($this->theme, $brandExcluded)) { $jobs[] = BrandService::class; dispatch(new RunServiceJob(BrandService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // Skill if (in_array($this->theme, ['home_one', 'home_four', 'home_five', 'home_six', 'home_tweleve', 'home_thirteen'])) { $jobs[] = SkillService::class; dispatch(new RunServiceJob(SkillService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // Testimonial if (!in_array($this->theme, ['home_eight', 'home_fourteen'])) { $jobs[] = TestimonialService::class; dispatch(new RunServiceJob(TestimonialService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // Why Choose Us if (in_array($this->theme, ['home_one', 'home_nine'])) { $jobs[] = WhyChooseUsItemService::class; dispatch(new RunServiceJob(WhyChooseUsItemService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // Offer Banner if (in_array($this->theme, ['home_eight', 'home_fourteen'])) { $jobs[] = OfferBannerService::class; dispatch(new RunServiceJob(OfferBannerService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // User Features if (in_array($this->theme, ['home_eight', 'home_ten', 'home_eleven', 'home_fourteen'])) { $jobs[] = UserFeatureService::class; dispatch(new RunServiceJob(UserFeatureService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // Hotel (home_nine + rooms page) if ($this->theme === 'home_nine' && in_array('rooms', $this->pages)) { $jobs[] = RoomCouponService::class; dispatch(new RunServiceJob(RoomCouponService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = RoomAmenityService::class; dispatch(new RunServiceJob(RoomAmenityService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = RoomCategoryService::class; dispatch(new RunServiceJob(RoomCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = RoomService::class; dispatch(new RunServiceJob(RoomService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // Course (home_ten + courses page) if ($this->theme === 'home_ten' && in_array('courses', $this->pages)) { $jobs[] = ActionSectionService::class; dispatch(new RunServiceJob(ActionSectionService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = InstructorService::class; dispatch(new RunServiceJob(InstructorService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = CourseCategoryService::class; dispatch(new RunServiceJob(CourseCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = CourseService::class; dispatch(new RunServiceJob(CourseService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = CourseCouponService::class; dispatch(new RunServiceJob(CourseCouponService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // Donation (home_eleven + causes page) if ($this->theme === 'home_eleven' && in_array('causes', $this->pages)) { $jobs[] = DonationCategoryService::class; dispatch(new RunServiceJob(DonationCategoryService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; $jobs[] = DonationCauseService::class; dispatch(new RunServiceJob(DonationCauseService::class, $this->payload())) ->onQueue('ai') ->delay(now()->addSeconds($delay)); $delay += 5; } // ====================== INIT COUNTERS ====================== $totalJobs = count($jobs); Cache::put("ai_run_expected:{$runId}", $totalJobs, now()->addHours(2)); Cache::put("ai_run_completed:{$runId}", 0, now()->addHours(2)); } // Helper methods — Service public function getUserId() { return $this->userId; } public function getTheme() { return $this->theme; } public function getBusinessName() { return $this->businessName; } public function getIndustry() { return $this->industry; } public function getBusinessInfo() { return $this->businessInfo; } public function getAiEngine() { return $this->aiEngine; } public function getPages() { return $this->pages; } public function getThemeName() { return $this->config[$this->theme]['name'] ?? ucwords(str_replace('_', ' ', $this->theme)); } public function isDeleteOldRecords() { return $this->isDeleteOldRecords ?? false; } // ====== ai config helper function ====== private function configAll(): array { return \App\Services\AiProviderConfig::get(); } // fetch specific ai engine information private function engineConfig(): array { $cfg = $this->configAll(); return $cfg[$this->aiEngine] ?? []; } private function canGenerateText(): bool { $ct = strtolower((string) ($this->engineConfig()['content_type'] ?? 'all')); return in_array($ct, ['all', 'text'], true); } private function canGenerateImage(): bool { $ct = strtolower((string) ($this->engineConfig()['content_type'] ?? 'all')); return in_array($ct, ['all', 'image'], true); } // Text Generation public function generateText($prompt) { if (!$this->canGenerateText()) { return ''; } if ($this->aiEngine === 'gemini') { return $this->geminiText($prompt); } elseif ($this->aiEngine === 'pollinations') { return $this->pollinationsText($prompt); } elseif ($this->aiEngine === 'openai') { return $this->openAiText($prompt); } return ''; } // Image Generation public function generateImage($prompt, $width = 1920, $height = 925, $customPath = null) { if (!$this->canGenerateImage()) { return 'default.jpg'; } if ($this->aiEngine === 'gemini') { $result = $this->geminiImage($prompt, $width, $height, $customPath); return $result; } elseif ($this->aiEngine === 'pollinations') { $result = $this->pollinationsImage($prompt, $width, $height, $customPath); return $result; } elseif ($this->aiEngine === 'openai') { $result = $this->openAiImage($prompt, $width, $height, $customPath); return $result; } return 'default.jpg'; } // Google Gemini Text Generation private function geminiText($prompt) { if (!$this->canGenerateText()) return ''; $cfg = $this->configAll()['gemini'] ?? []; $apiKey = (string) ($cfg['api_key'] ?? env('GEMINI_API_KEY')); $model = (string) ($cfg['text_model'] ?? 'gemini-2.0-flash'); if (empty($apiKey)) return ''; $finalPrompt = $this->buildPromptWithLanguage($prompt); try { $endpoint = "https://generativelanguage.googleapis.com/v1beta/models/{$model}:generateContent"; $response = Http::timeout(60) ->withHeaders(['x-goog-api-key' => $apiKey]) ->post($endpoint, [ 'contents' => [ ['parts' => [['text' => $finalPrompt]]] ] ]); if ($response->successful()) { $data = $response->json(); $text = $data['candidates'][0]['content']['parts'][0]['text'] ?? null; return $text ? trim($text) : ''; } } catch (\Exception $e) { return ""; } return ''; } // Pollinations Text Generation private function pollinationsText($prompt) { try { $finalPrompt = $this->buildPromptWithLanguage($prompt); $url = "https://text.pollinations.ai/" . urlencode($finalPrompt); $response = Http::timeout(180) ->connectTimeout(30) ->retry(3, 5000) ->get($url); if ($response->successful()) { return trim($response->body()); } } catch (\Exception $e) { return "Pollinations Error: " . $prompt; } return ''; } private function openAiText(string $prompt): string { if (!$this->canGenerateText()) return ''; $cfg = $this->configAll()['openai'] ?? []; $apiKey = (string) ($cfg['api_key'] ?? env('OPENAI_API_KEY')); $model = (string) ($cfg['text_model'] ?? 'gpt-4o'); if (empty($apiKey)) return ''; $finalPrompt = $this->buildPromptWithLanguage($prompt); try { $response = Http::withHeaders([ 'Authorization' => 'Bearer ' . $apiKey, 'Content-Type' => 'application/json', ])->timeout(60)->post('https://api.openai.com/v1/chat/completions', [ 'model' => $model, 'messages' => [ ['role' => 'user', 'content' => $finalPrompt], ], 'temperature' => 0.7, ]); if ($response->successful()) { return (string) ($response->json()['choices'][0]['message']['content'] ?? ''); } return ''; } catch (\Throwable $e) { return ''; } } // Gemini Image Generation private function geminiImage($prompt, $width, $height, $path) { try { if (!$this->canGenerateImage()) { return 'default.jpg'; } $cfg = \App\Services\AiProviderConfig::get()['gemini'] ?? []; if (empty($apiKey)) { return 'default.jpg'; } // Correct endpoint for Imagen REST $apiKey = trim((string) ($cfg['api_key'] ?? env('GEMINI_API_KEY'))); $model = (string) ($cfg['image_model'] ?? 'imagen-4.0-generat-001'); $endpoint = "https://generativelanguage.googleapis.com/v1beta/models/{$model}:predict?key=" . $apiKey; $aspectRatio = $this->aspectRatioFromSize($width, $height); $response = Http::timeout(180) ->withHeaders(['Content-Type' => 'application/json']) ->post($endpoint, [ "instances" => [ ["prompt" => $prompt] ], "parameters" => [ "sampleCount" => 1, "aspectRatio" => $aspectRatio, ] ]); if (!$response->successful()) { return 'default.jpg'; } $json = $response->json(); $base64 = $json['predictions'][0]['bytesBase64Encoded'] ?? null; if (!$base64) { return 'default.jpg'; } $imageBinary = base64_decode($base64); if ($imageBinary === false) { return 'default.jpg'; } $fullPath = public_path($path); if (!file_exists($fullPath)) { mkdir($fullPath, 0775, true); } $filename = 'ai_' . time() . '_' . \Illuminate\Support\Str::random(8) . '.jpg'; $result = file_put_contents($fullPath . $filename, $imageBinary); if ($result === false) { return 'default.jpg'; } return $filename; } catch (\Exception $e) { \Log::error('Gemini Image Generation Error: ' . $e->getMessage()); return 'default.jpg'; } } private function pollinationsImage($prompt, $width, $height, $path) { try { $enhancedPrompt = $prompt; $encoded = urlencode($enhancedPrompt); $url = "https://image.pollinations.ai/prompt/{$encoded}?" . http_build_query([ 'width' => $width, 'height' => $height, 'model' => 'NanoBanana', 'enhance' => 'true', 'nologo' => 'true', 'private' => 'false', 'seed' => rand(1000, 9999), ]); $response = Http::timeout(180) ->connectTimeout(30) ->retry(3, 5000) ->get($url); if ($response->successful()) { $fullPath = public_path($path); // Ensure directory exists if (!file_exists($fullPath)) { mkdir($fullPath, 0775, true); } $filename = 'ai_' . time() . '_' . Str::random(8) . '.jpg'; // Delete old file if exists if (file_exists($fullPath . $filename)) { @unlink($fullPath . $filename); } // Save the file $result = file_put_contents($fullPath . $filename, $response->body()); if ($result === false) { return 'default.jpg'; } return $filename; } return 'default.jpg'; } catch (\Exception $e) { return 'default.jpg'; } } public function openAiImage($prompt, $width, $height, $path) { if (!$this->canGenerateImage()) return 'default.jpg'; $cfg = $this->configAll()['openai'] ?? []; $apiKey = (string) ($cfg['api_key'] ?? ''); $model = (string) ($cfg['image_model'] ?? 'dall-e-3'); if (empty($apiKey)) return 'default.jpg'; try { $size = $this->getNearestOpenAiSize($width, $height); $response = Http::withHeaders([ 'Authorization' => 'Bearer ' . $apiKey, 'Content-Type' => 'application/json', ])->timeout(180) ->post('https://api.openai.com/v1/images/generations', [ 'model' => $model, 'prompt' => $prompt, 'n' => 1, 'size' => $size, ]); if ($response->successful()) { $imageUrl = $response->json()['data'][0]['url']; $imageResponse = Http::timeout(60)->get($imageUrl); if ($imageResponse->successful()) { $fullPath = public_path($path); if (!file_exists($fullPath)) { mkdir($fullPath, 0775, true); } $filename = 'ai_' . time() . '_' . \Illuminate\Support\Str::random(8) . '.jpg'; $saved = file_put_contents($fullPath . '/' . $filename, $imageResponse->body()); if ($saved !== false) { return $filename; } } return 'default.jpg'; } return 'default.jpg'; } catch (\Exception $e) { \Log::error('OpenAI Image Error: ' . $e->getMessage()); return 'default.jpg'; } } // Helper function nearest size select for open ai private function getNearestOpenAiSize($width, $height) { // Aspect ratio calculate if ($height == 0) $height = 1; $ratio = $width / $height; $options = [ '1024x1024' => 1.0, '1536x1024' => 1.5, '1024x1536' => 0.6667, ]; $best = '1024x1024'; $minDiff = PHP_INT_MAX; foreach ($options as $size => $optRatio) { $diff = abs($ratio - $optRatio); if ($diff < $minDiff) { $minDiff = $diff; $best = $size; } } return $best; } private function buildPromptWithLanguage(string $prompt): string { $language = \App\Models\User\Language::where([ ['user_id', $this->userId], ['is_default', 1], ])->first(); $languageName = $language?->name ?? 'English'; $forceInstruction = "Reply only in {$languageName}, do not use English or any other language: "; $finalPrompt = $forceInstruction . $prompt; return $finalPrompt; } //aspectratio generate for gemini private function aspectRatioFromSize($width, $height) { if (!$width || !$height) return '1:1'; $ratio = $width / $height; if (abs($ratio - 1) < 0.1) return '1:1'; if ($ratio > 1.7) return '16:9'; if ($ratio > 1.2) return '4:3'; if ($ratio < 0.6) return '9:16'; return '3:4'; } } Services/AiProviderConfig.php 0000644 00000002575 15213350437 0012246 0 ustar 00 <?php namespace App\Services; use App\Models\BasicSetting; use Illuminate\Support\Facades\Cache; class AiProviderConfig { public static function get(): array { return Cache::remember('ai_provider_config', 60, function () { $s = BasicSetting::first(); return [ 'openai' => [ 'enabled' => (int) ($s->is_openai ?? 0) === 1, 'api_key' => (string) ($s->openai_api_key ?? ''), 'text_model' => (string) ($s->openai_text_model ?? 'gpt-4o'), 'image_model' => (string) ($s->openai_image_model ?? 'dall-e-3'), 'content_type' => strtolower((string) ($s->openai_content_type ?? 'all')), ], 'gemini' => [ 'enabled' => (int) ($s->is_gemini ?? 0) === 1, 'api_key' => (string) ($s->gemini_api_key ?? ''), 'text_model' => (string) ($s->gemini_text_model ?? 'gemini-2.0-flash'), 'image_model' => (string) ($s->gemini_image_model ?? 'imagen-3'), 'content_type' => strtolower((string) ($s->gemini_content_type ?? 'all')), ], 'pollinations' => [ 'enabled' => (int) ($s->is_pollinations ?? 0) === 1, 'content_type' => strtolower((string) ($s->pollinations_content_type ?? 'all')), ], ]; }); } public static function forgetCache(): void { Cache::forget('ai_provider_config'); } } Services/AiWebsite/GalleryManagement/GalleryCategoryService.php 0000644 00000010567 15213350437 0020742 0 ustar 00 <?php namespace App\Services\AiWebsite\GalleryManagement; use App\Models\User\GalleryCategory; use App\Services\MasterAiGenerator; class GalleryCategoryService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); GalleryCategory::where('user_id', $userId)->delete(); } $categoryData = $this->getCategoryData(); foreach ($categoryData as $index => $data) { $name = $this->ai->generateText($data['name_prompt']); GalleryCategory::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'name' => $this->extractCleanTitle($name), 'status' => 1, 'serial_number' => $index + 1, ]); } } private function getCategoryData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; if ($this->ai->getTheme() == 'home_thirteen') { return [ [ 'name_prompt' => "2-3 words ONLY. Gallery for venue/environment photos. Examples: Our Space, Elegant Venue, Premium Setting Use: {$baseContext} NO office/team. Just name.", ], [ 'name_prompt' => "2-3 words ONLY. Gallery for people/experience photos. Examples: Guest Moments, Client Stories, Special People Use: {$baseContext} NO generic team. Just name.", ], [ 'name_prompt' => "Return ONLY ONE gallery category name. Max 2-3 words, no commas, no list, no quotes. This is for events and celebrations photos. Good examples: Event Highlights, Special Moments, Celebration Gallery. Bad examples: Momentos,Festivities,Highlight,zest,Joy,Revel,Soirée,Celebrate,Fiesta,Fête. Business context: {$baseContext}", ], [ 'name_prompt' => "2-3 words ONLY. Gallery for featured work/showcase. Examples: Signature Work, Highlight Collection, Premium Showcase Use: {$baseContext} NO projects. Just name.", ], ]; } else { return [ [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a gallery category name for office/workplace photos in {$industry}. Examples: Office Space, Workplace Environment, Our Office, Work Culture Output: Just the category name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a gallery category name for team/employee photos. Examples: Our Team, Team Members, Company Culture, People Output: Just the category name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a gallery category name for events and celebrations. Examples: Company Events, Celebrations, Special Occasions, Event Highlights Output: Just the category name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a gallery category name for projects/work samples in {$industry}. Examples: Our Projects, Project Gallery, Work Samples, Client Work Output: Just the category name, nothing else. Context: {$baseContext}", ], ]; } } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/GalleryManagement/GalleryItemService.php 0000644 00000013443 15213350437 0020057 0 ustar 00 <?php namespace App\Services\AiWebsite\GalleryManagement; use App\Models\User\GalleryItem; use App\Models\User\GalleryCategory; use App\Services\MasterAiGenerator; class GalleryItemService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/gallery/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // Delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldItems = GalleryItem::where('user_id', $userId)->get(); foreach ($oldItems as $item) { if ($item->image && file_exists(public_path($this->imageStoragePath . $item->image))) { @unlink(public_path($this->imageStoragePath . $item->image)); } } GalleryItem::where('user_id', $userId)->delete(); } // Get gallery categories $categories = GalleryCategory::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->get(); if ($categories->isEmpty()) { $categoryService = new GalleryCategoryService($this->ai); $categoryService->generate(); $categories = GalleryCategory::where('user_id', $this->ai->getUserId())->get(); } // Generate 1 image per category $serialNumber = 1; foreach ($categories as $category) { $data = $this->getItemData($category); $title = $this->ai->generateText($data['title_prompt']); $cleanTitle = $this->extractCleanTitle($title); // Generate image $image = $this->ai->generateImage( $data['image_prompt'], 1200, 800, $this->imageStoragePath ); GalleryItem::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'gallery_category_id' => $category->id, 'title' => $cleanTitle, 'item_type' => 'image', 'image' => $image, 'video_link' => null, 'serial_number' => $serialNumber, 'is_featured' => ($serialNumber <= 3) ? 1 : 0, ]); $serialNumber++; } } private function getItemData($category) { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $categoryName = $category->name; $baseContext = "{$businessName} operates in {$industry} industry. Gallery category: {$categoryName}"; // Detect if category likely contains people/team photos $categoryLower = strtolower($categoryName); $hasPeople = ( strpos($categoryLower, 'team') !== false || strpos($categoryLower, 'people') !== false || strpos($categoryLower, 'staff') !== false || strpos($categoryLower, 'employee') !== false || strpos($categoryLower, 'office') !== false || strpos($categoryLower, 'workspace') !== false || strpos($categoryLower, 'meeting') !== false ); // Quality enhancers $humanQualityEnhancer = ", professional corporate photography, shot with 85mm portrait lens f/2.8, natural realistic faces, diverse group of professional men and women clearly visible, proper human proportions, complete faces with all features intact, realistic skin tones and textures, natural expressions, individual distinct facial features for each person, both male and female professionals present, clear gender diversity, full head and shoulders visible, no cropped heads, studio quality lighting, sharp focus on faces"; $humanNegativePrompt = ", CRITICAL AVOID: missing heads, cropped faces, headless people, blurry faces, identical faces, uniform gender, all male or all female only, plastic skin, doll-like appearance, distorted proportions, synthetic look, airbrushed faces, cloned people, unrealistic features"; $productQualityEnhancer = ", professional product photography, studio lighting, sharp focus, high detail, clean composition, vibrant accurate colors, commercial quality"; $productNegativePrompt = ", AVOID: blurry, low quality, distorted, poor lighting, cluttered background"; return [ 'title_prompt' => "You must return ONLY 4-8 words. No formatting, no explanation. Generate a descriptive photo title for {$categoryName} gallery in {$industry} business. Make it specific and engaging. Examples for Office: Modern Open Space Work Environment, Creative Team Collaboration Area Examples for Team: Diverse Professional Team Meeting, Annual Company Celebration Event Examples for Products: Premium Product Display Showcase, Latest Collection Launch Event Output: Just the title, nothing else. Context: {$baseContext}", 'image_prompt' => $hasPeople ? "Professional corporate photography of {$categoryName} in {$industry} business context, diverse group showing both male and female professionals working together in modern office environment, realistic people with complete faces and heads fully visible, natural business setting, professional attire, contemporary workplace, multiple people of different genders clearly distinguishable, natural poses and interactions" . $humanQualityEnhancer . $humanNegativePrompt : "Create premium gallery image for '{$categoryName}' of {$baseContext}. " . "High-quality professional aesthetic, clean modern design, " . "industry-appropriate visuals, realistic setting. " . $productQualityEnhancer . $productNegativePrompt ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Here is|Sure|Options:|Choose from:)[:\s]*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•\d\.]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/FAQService.php 0000644 00000010654 15213350437 0012655 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\FAQ; use App\Services\MasterAiGenerator; class FAQService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old FAQ records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); FAQ::where('user_id', $userId)->delete(); } $faqData = $this->getFAQData(); foreach ($faqData as $index => $data) { $question = $this->ai->generateText($data['question_prompt']); $answer = $this->ai->generateText($data['answer_prompt']); FAQ::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'question' => $this->extractCleanText($question), 'answer' => $this->extractCleanText($answer), 'featured' => $data['featured'], 'serial_number' => $index + 1, ]); } } private function getFAQData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'question_prompt' => "You must return ONLY ONE question of 8-12 words. No formatting, no explanation. Generate a common FAQ question about the services offered by {$businessName} in {$industry}. Format as a natural question with question mark. Examples: What services does your company provide?, How can you help my business? Output: Just the question, nothing else. Context: {$baseContext}", 'answer_prompt' => "You must return EXACTLY 40-50 words. No formatting, no explanation. Write a clear, helpful answer about the services offered by {$businessName}. Include: key services, unique approach, value proposition. Use professional, friendly tone. Be specific and informative. Output: Plain text only, 40-50 words. Context: {$baseContext}", 'featured' => 1, ], [ 'question_prompt' => "You must return ONLY ONE question of 8-12 words. No formatting, no explanation. Generate a FAQ question about pricing or cost for {$industry} services. Format as a natural question with question mark. Examples: How much do your services cost?, What are your pricing plans? Output: Just the question, nothing else. Context: {$baseContext}", 'answer_prompt' => "You must return EXACTLY 40-50 words. No formatting, no explanation. Write an informative answer about pricing approach for {$businessName}. Include: pricing structure, factors affecting cost, consultation availability. Be transparent and helpful without giving exact prices. Output: Plain text only, 40-50 words. Context: {$baseContext}", 'featured' => 0, ], [ 'question_prompt' => "You must return ONLY ONE question of 8-12 words. No formatting, no explanation. Generate a FAQ question about project timeline or delivery for {$industry} services. Format as a natural question with question mark. Examples: How long does a typical project take?, What is your turnaround time? Output: Just the question, nothing else. Context: {$baseContext}", 'answer_prompt' => "You must return EXACTLY 40-50 words. No formatting, no explanation. Write a practical answer about project timelines for {$businessName}. Include: typical timeframes, factors affecting duration, commitment to deadlines. Be realistic and professional. Output: Plain text only, 40-50 words. Context: {$baseContext}", 'featured' => 1, ], ]; } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/ShopManagement/ItemSubCategoryService.php 0000644 00000007525 15213350437 0020225 0 ustar 00 <?php namespace App\Services\AiWebsite\ShopManagement; use App\Models\User\UserItemSubCategory; use App\Models\User\UserItemCategory; use App\Services\AiWebsite\ShopManagement\ItemCategoryService; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; class ItemSubCategoryService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); UserItemSubCategory::where('user_id', $userId)->delete(); } // Get all item categories $categories = UserItemCategory::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->get(); if ($categories->isEmpty()) { // Generate categories first if none exist $categoryService = new ItemCategoryService($this->ai); $categoryService->generate(); $categories = UserItemCategory::where('user_id', $this->ai->getUserId())->get(); } // Generate subcategories for each category foreach ($categories as $category) { $subCategoryData = $this->getSubCategoryData($category); $createdForThisCategory = 0; foreach ($subCategoryData as $data) { if ($createdForThisCategory >= 2) break; $name = $this->ai->generateText($data['name_prompt']); $cleanName = $this->extractCleanTitle($name); $slug = rawurlencode(Str::slug($cleanName)); // Check if slug already exists $exists = UserItemSubCategory::where('user_id', $this->ai->getUserId()) ->where('slug', $slug) ->where('language_id', $this->ai->getDefaultLanguageId()) ->exists(); if ($exists) { $slug = $slug . '-' . time() . '-' . rand(100, 999); } UserItemSubCategory::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'category_id' => $category->id, 'name' => $cleanName, 'slug' => $slug, 'status' => 1, ]); $createdForThisCategory++; } } } private function getSubCategoryData($category) { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $categoryName = $category->name; $baseContext = "{$businessName} operates in {$industry} industry. Parent category: {$categoryName}"; return [ [ 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a subcategory name under '{$categoryName}' category for {$industry} e-commerce. Think of specific product types within this category. Examples for Electronics: Smartphones, Laptops, Cameras Examples for Fashion: Men Clothing, Women Shoes, Accessories Examples for Home Decor: Living Room, Bedroom, Kitchen Output: Just the subcategory name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate another different subcategory name under '{$categoryName}' category. Make it different from the first subcategory. Focus on variety. Output: Just the subcategory name, nothing else. Context: {$baseContext}", ], ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/ShopManagement/CouponService.php 0000644 00000005744 15213350437 0016423 0 ustar 00 <?php namespace App\Services\AiWebsite\ShopManagement; use App\Models\User\UserCoupon; use App\Services\MasterAiGenerator; use Carbon\Carbon; use Illuminate\Support\Str; class CouponService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); UserCoupon::where('user_id', $userId)->delete(); } $couponData = $this->getCouponData(); foreach ($couponData as $data) { $name = $this->ai->generateText($data['name_prompt']); UserCoupon::create([ 'user_id' => $this->ai->getUserId(), 'name' => $this->extractCleanTitle($name), 'code' => $data['code'], 'type' => $data['type'], 'value' => $data['value'], 'minimum_spend' => $data['minimum_spend'], 'start_date' => $data['start_date'], 'end_date' => $data['end_date'], ]); } } private function getCouponData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; $today = Carbon::now(); $businessShort = strtoupper(substr(str_replace(' ', '', $businessName), 0, 3)); return [ [ 'name_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a fixed amount coupon name. Examples: Flat Discount Coupon, Money Off Deal, Fixed Savings Offer Output: Just the coupon name, nothing else. Context: {$baseContext}", 'code' => $businessShort . 'SAVE' . rand(10, 99), 'type' => 'fixed', 'value' => 20, 'minimum_spend' => 100, 'start_date' => $today->format('Y-m-d'), 'end_date' => $today->copy()->addMonths(2)->format('Y-m-d'), ], [ 'name_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a big purchase coupon name. Examples: Big Order Discount, Large Purchase Reward, Bulk Buy Savings Output: Just the coupon name, nothing else. Context: {$baseContext}", 'code' => 'BIGORDER' . rand(10, 99), 'type' => 'percentage', 'value' => 30, 'minimum_spend' => 500, 'start_date' => $today->format('Y-m-d'), 'end_date' => $today->copy()->addMonths(6)->format('Y-m-d'), ], ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/ShopManagement/ItemCategoryService.php 0000644 00000010714 15213350437 0017545 0 ustar 00 <?php namespace App\Services\AiWebsite\ShopManagement; use App\Models\User\UserItemCategory; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; class ItemCategoryService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/items/categories/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldCategories = UserItemCategory::where('user_id', $userId)->get(); foreach ($oldCategories as $category) { if ($category->image && file_exists(public_path($this->imageStoragePath . $category->image))) { @unlink(public_path($this->imageStoragePath . $category->image)); } } UserItemCategory::where('user_id', $userId)->delete(); } $categoryData = $this->getCategoryData(); foreach ($categoryData as $index => $data) { $name = $this->ai->generateText($data['name_prompt']); $cleanName = $this->extractCleanTitle($name); $slug = rawurlencode(Str::slug($cleanName)); // Check if slug already exists $exists = UserItemCategory::where('user_id', $this->ai->getUserId()) ->where('slug', $slug) ->where('language_id', $this->ai->getDefaultLanguageId()) ->exists(); if ($exists) { $slug = $slug . '-' . time() . '-' . rand(100, 999); } // Generate category image $image = $this->ai->generateImage( $data['image_prompt'], 400, 400, $this->imageStoragePath ); UserItemCategory::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'name' => $cleanName, 'slug' => $slug, 'image' => $image, 'status' => 1, 'is_feature' => $data['is_feature'], ]); } } private function getCategoryData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; // Detect if industry is digital/service-based $digitalKeywords = ['software', 'digital', 'technology', 'consulting', 'marketing', 'agency', 'saas', 'web', 'app']; $isDigital = false; foreach ($digitalKeywords as $keyword) { if (stripos($industry, $keyword) !== false) { $isDigital = true; break; } } return [ [ 'name_prompt' => "Return ONLY 2-3 words. No formatting. Generate a product category name for {$industry}. Examples for physical: Electronics, Fashion, Home Goods Examples for digital: Digital Products, Software Tools, Online Services Output: Category name only. Context: {$baseContext}", 'image_prompt' => $this->getImagePrompt($industry, $isDigital, 'primary'), 'is_feature' => 1, ], [ 'name_prompt' => "Return ONLY 2-3 words. No formatting. Generate a different product category for {$industry}. Examples: Premium Services, Best Sellers, New Arrivals Output: Category name only. Context: {$baseContext}", 'image_prompt' => $this->getImagePrompt($industry, $isDigital, 'secondary'), 'is_feature' => 1, ], ]; } private function getImagePrompt($industry, $isDigital, $type) { if ($isDigital) { return "Digital product icon for {$industry}, flat vector illustration, NO HUMANS, NO FACES, abstract geometric shapes, modern tech style, clean gradient background, minimalist digital asset icon, professional UI design, screen/interface elements"; } else { return "Physical product icon for {$industry}, isometric 3D object, NO PEOPLE, NO FACES, realistic product illustration, clean white background, professional e-commerce photography style, single object focus, commercial catalog image"; } } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/ShopManagement/ShippingChargeService.php 0000644 00000007230 15213350437 0020043 0 ustar 00 <?php namespace App\Services\AiWebsite\ShopManagement; use App\Models\User\UserShippingCharge; use App\Services\MasterAiGenerator; class ShippingChargeService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); UserShippingCharge::where('user_id', $userId)->delete(); } $shippingData = $this->getShippingData(); foreach ($shippingData as $data) { $title = $this->ai->generateText($data['title_prompt']); $text = $this->ai->generateText($data['text_prompt']); UserShippingCharge::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'title' => $this->extractCleanTitle($title), 'text' => $this->extractCleanText($text), 'charge' => $data['charge'], ]); } } private function getShippingData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'title_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a shipping method name for standard/regular delivery. Examples: Standard Shipping, Regular Delivery, Standard Post Output: Just the shipping method name, nothing else.", 'text_prompt' => "You must return EXACTLY 7-10 words. No formatting, no explanation. Write a brief description for standard shipping option. Include: delivery timeframe, service type, coverage area. Use clear, customer-friendly language. Output: Plain text only, 20-25 words. Example: Delivered within 5-7 business days to your doorstep. Available nationwide. Perfect for regular orders with no rush.", 'charge' => 5.00, ], [ 'title_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a shipping method name for express/fast delivery. Examples: Express Shipping, Fast Delivery, Priority Shipping Output: Just the shipping method name, nothing else.", 'text_prompt' => "You must return EXACTLY 7-10 words. No formatting, no explanation. Write a brief description for express shipping option. Include: quick delivery timeframe, priority handling, service features. Use persuasive, customer-friendly language. Output: Plain text only, 20-25 words. Example: Get your order in 2-3 business days with priority handling. Expedited processing and faster delivery for urgent needs.", 'charge' => 15.00, ], ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/ShopManagement/ItemService.php 0000644 00000030432 15213350437 0016046 0 ustar 00 <?php namespace App\Services\AiWebsite\ShopManagement; use App\Models\User\UserItem; use App\Models\User\UserItemContent; use App\Models\User\UserItemImage; use App\Models\User\UserItemCategory; use App\Models\User\UserItemSubCategory; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; use Illuminate\Support\Facades\Log; class ItemService { protected $ai; protected $thumbnailPath = 'assets/front/img/user/items/thumbnail/'; protected $sliderPath = 'assets/front/img/user/items/slider-images/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate($productType = 'physical') { //delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldSliderImages = UserItemImage::whereHas('item', function ($q) use ($userId) { $q->where('user_id', $userId); })->get(); foreach ($oldSliderImages as $sliderImage) { if ($sliderImage->image && file_exists(public_path($this->sliderPath . $sliderImage->image))) { @unlink(public_path($this->sliderPath . $sliderImage->image)); } } $oldItems = UserItem::where('user_id', $userId)->get(); foreach ($oldItems as $item) { if ($item->thumbnail && file_exists(public_path($this->thumbnailPath . $item->thumbnail))) { @unlink(public_path($this->thumbnailPath . $item->thumbnail)); } } UserItemImage::whereHas('item', function ($q) use ($userId) { $q->where('user_id', $userId); })->delete(); UserItemContent::whereHas('item', function ($q) use ($userId) { $q->where('user_id', $userId); })->delete(); UserItem::where('user_id', $userId)->delete(); } // Get categories and subcategories $categories = UserItemCategory::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->get(); if ($categories->isEmpty()) { $categoryService = new ItemCategoryService($this->ai); $categoryService->generate(); $categories = UserItemCategory::where('user_id', $this->ai->getUserId())->get(); } $itemData = $this->getItemData($categories, $productType); foreach ($itemData as $data) { $title = $this->ai->generateText($data['title_prompt']); $cleanTitle = $this->extractCleanTitle($title); $categoryName = $data['category_name']; $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); // Fallback if title is empty if (empty($cleanTitle) || strlen($cleanTitle) < 3) { $cleanTitle = $data['category_name']; } $slug = Str::slug($cleanTitle); if (empty($slug)) { $slug = 'product-' . time() . '-' . rand(100, 999); } // Check if slug already exists $exists = UserItemContent::where('language_id', $this->ai->getDefaultLanguageId()) ->where('slug', $slug) ->exists(); if ($exists) { $slug = $slug . '-' . time() . '-' . rand(100, 999); } // Generate product content $summary = $this->ai->generateText($data['summary_prompt']); $description = $this->ai->generateText($data['description_prompt']); $tags = $this->ai->generateText($data['tags_prompt']); $metaKeywords = $this->ai->generateText($data['meta_keywords_prompt']); $metaDescription = $this->ai->generateText($data['meta_description_prompt']); $thumbnailPrompt = "Professional e-commerce product photography of {$cleanTitle}. Category: {$categoryName}. This product is sold by {$businessName}, a trusted {$industry}. A real, tangible consumer product with high-quality physical materials such as metal, plastic, fabric, leather, or wood as appropriate for the item. Isolated and perfectly centered on a pure white background. Studio-grade lighting with soft shadows and natural reflections. Ultra-detailed surface textures, edges, stitching, buttons, or components clearly visible. Front or 3/4 angle view with sharp focus and clean composition. Premium marketplace-ready style suitable for top e-commerce platforms. 4K ultra-high resolution. CRITICAL: Physical product only. No digital screens, no UI, no software visuals, no text overlays, no logos, no humans, no hands, no faces."; // Generate thumbnail image $thumbnail = $this->ai->generateImage( $thumbnailPrompt, 800, 800, $this->thumbnailPath ); // Create main item $item = UserItem::create([ 'user_id' => $this->ai->getUserId(), 'thumbnail' => $thumbnail, 'status' => 1, 'is_feature' => 1, 'special_offer' => 1, 'current_price' => $data['current_price'], 'previous_price' => $data['previous_price'], 'stock' => $data['stock'], 'sku' => $data['sku'], 'type' => 'physical', 'download_file' => $data['download_file'] ?? null, 'download_link' => $data['download_link'] ?? null, ]); // 4. Generate slider images with actual product title $sliderPrompts = [ "Macro close-up shot of {$cleanTitle}. Category: {$categoryName}. Product from {$businessName}, a trusted {$industry}. Show real physical build quality with ultra-detailed materials, textures, stitching, seams, edges, buttons, or components relevant to this category. Studio lighting, sharp focus, white or soft neutral background. High realism, premium marketplace-quality visual. 4K ultra-high resolution. CRITICAL: Physical product only. No digital content, no screens, no UI, no text overlays, no logos, no humans, no hands, no faces.", "Lifestyle product shot of {$cleanTitle}. Category: {$categoryName}. Product from {$businessName}, a trusted {$industry}. Product placed naturally in a clean, modern environment suitable for this category (tabletop, shelf, room setting, or styled surface). Natural daylight, realistic shadows, elegant and premium composition. Product remains the only focus. High realism, marketplace-ready quality. 4K ultra-high resolution. CRITICAL: Physical product only. No people, no hands, no faces, no digital screens, no UI, no text overlays, no logos." ]; // Generate slider images for ($i = 0; $i < 2; $i++) { $sliderImage = $this->ai->generateImage( $sliderPrompts[$i], 1200, 1200, $this->sliderPath ); UserItemImage::create([ 'item_id' => $item->id, 'image' => $sliderImage, ]); } // Create item content UserItemContent::create([ 'item_id' => $item->id, 'language_id' => $this->ai->getDefaultLanguageId(), 'category_id' => $data['category_id'], 'subcategory_id' => $data['subcategory_id'], 'title' => $cleanTitle, 'slug' => $slug, 'summary' => $this->extractCleanText($summary), 'description' => $this->extractCleanText($description), 'tags' => $this->extractCleanText($tags), 'meta_keywords' => $this->extractCleanText($metaKeywords), 'meta_description' => $this->extractCleanText($metaDescription), ]); } } private function getItemData($categories, $productType) { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "Business Name: {$businessName} Industry: {$industry} Business Overview: {$businessInfo} We focus on quality, value, fast delivery, and excellent customer education through detailed guides and support."; $items = []; $selectedCategories = $categories->take(2); foreach ($selectedCategories as $categoryIndex => $category) { $subcategory = UserItemSubCategory::where('category_id', $category->id) ->where('user_id', $this->ai->getUserId()) ->inRandomOrder() ->first(); $subcategoryId = $subcategory?->id; $subcategoryName = $subcategory?->name ?? $category->name; $currentPrice = rand(29, 199); $previousPrice = $currentPrice + rand(20, 80); $items[] = [ 'category_id' => $category->id, 'category_name' => $category->name, 'subcategory_id' => $subcategoryId, 'subcategory_name' => $subcategoryName, 'title_prompt' => "Output ONLY a realistic, attractive product name in 4-8 words. NO explanations, NO quotes, NO prefixes. CRITICAL: This is a real, tangible product sold by {$businessName}, a premium multi-category e-commerce brand. Category: {$category->name}" . ($subcategoryName !== $category->name ? " > Subcategory: {$subcategoryName}" : "") . " Use premium, market-friendly naming words suitable for this category, such as: Premium, Pro, Classic, Modern, Essential, Smart, Stylish, Durable, Advanced Business Context: {$baseContext} NOW OUTPUT ONLY THE PRODUCT NAME:", 'summary_prompt' => "Write a compelling product summary in exactly 30-40 words. Start directly with the text. No title or intro phrase. Highlight quality, design, usability, and real-life benefits that matter to customers shopping in this category. Category: {$category->name} Business Context: {$baseContext}", 'description_prompt' => "Write a detailed, professional product description in 150-200 words using persuasive e-commerce language. Focus on: - Product build quality, materials, or fabric (as relevant) - Key features and practical benefits - Everyday use cases - Who this product is ideal for - Why buying from {$businessName} adds value and trust Include clear sections: - Key Features - Who It's For - Why Choose {$businessName} End with a confident but friendly call to action. Category: {$category->name} Business Context: {$baseContext}", 'tags_prompt' => "Generate exactly 6-8 relevant product tags as a comma-separated list. No explanation. Use buyer-intent search terms appropriate for this product category. Category: {$category->name} Business: {$businessName}", 'meta_keywords_prompt' => "Output exactly 6-8 SEO keywords as a comma-separated list. No extra text. Target high-intent keywords related to the product and its category. Include patterns like: best [product], premium [product], buy [product] online Category: {$category->name}", 'meta_description_prompt' => "Write an SEO-optimized meta description in 140-155 characters (including spaces). Start directly. Make it persuasive and include {$businessName}. Example style: Shop premium quality products at {$businessName}. Trusted quality, fair pricing, fast delivery & great customer support. Category: {$category->name} Business Context: {$baseContext}", 'current_price' => $currentPrice, 'previous_price' => $previousPrice, 'stock' => rand(15, 100), 'sku' => 'NXG-' . str_pad($category->id, 3, '0', STR_PAD_LEFT) . str_pad(($categoryIndex + 1), 3, '0', STR_PAD_LEFT), 'download_file' => null, 'download_link' => null, ]; } return $items; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:|Choose from:)[:\s]*/i', '', $text); $text = preg_replace('/[*_`~\[\]#]/', '', $text); $text = preg_replace('/^[\s\-•\d\.]+/', '', $text); $lines = explode("\n", $text); $text = trim($lines[0]); $text = trim($text, '"\''); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly)[:\s]*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/PortfolioCategoryService.php 0000644 00000005204 15213350437 0015714 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\PortfolioCategory; use App\Services\MasterAiGenerator; class PortfolioCategoryService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); PortfolioCategory::where('user_id', $userId)->delete(); } $categoryData = $this->getCategoryData(); foreach ($categoryData as $index => $data) { $name = $this->ai->generateText($data['name_prompt']); PortfolioCategory::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'name' => $this->extractCleanTitle($name), 'status' => 1, 'is_featured' => $data['is_featured'], 'serial_number' => $index + 1, ]); } } private function getCategoryData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'name_prompt' => "Return ONLY 2-3 words. Output must be a primary service category for {$industry}. Avoid generic terms like 'All' or 'Projects'. Context: {$baseContext}", 'is_featured' => 1, ], [ 'name_prompt' => "Return ONLY 2-3 words. Output must be a specialized niche or unique service in {$industry}. IMPORTANT: Do not repeat or use synonyms of the main service. Context: {$baseContext}", 'is_featured' => 1, ], [ 'name_prompt' => "Return ONLY 2-3 words. Output must be a creative, modern, or 'Expertise' oriented category name for {$industry}. Ensure this is distinct and does not overlap with previous service names.Context: {$baseContext}", 'is_featured' => 0, ], [ 'name_prompt' => "Return ONLY 2-3 words. Output must be a category name focusing on 'Custom Solutions' or 'Signature Works' for {$industry}. It must be completely unique from the other categories.Context: {$baseContext}", 'is_featured' => 0, ], ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/UserServiceService.php 0000644 00000032370 15213350437 0014504 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\UserService; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; class UserServiceService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/services/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldServices = UserService::where('user_id', $userId)->get(); foreach ($oldServices as $service) { if ($service->image && file_exists(public_path($this->imageStoragePath . $service->image))) { @unlink(public_path($this->imageStoragePath . $service->image)); } } UserService::where('user_id', $userId)->delete(); } $theme = $this->ai->getTheme(); $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a business in {$industry}. {$businessInfo}"; $serviceData = $this->getServiceData($theme, $baseContext); foreach ($serviceData as $index => $data) { // Title first $cleanName = $this->generateValidServiceTitle( $data['name_prompt'], $data['fallback_name'] ?? 'Professional Services' ); // Build prompts with title $contentPrompt = $this->buildContentPromptByTheme($theme, $cleanName, $baseContext); $metaPrompt = $this->buildMetaPromptByTheme($theme, $cleanName, $baseContext); // Generate content/meta with retry if mismatch $content = $this->generateContentWithGuard($contentPrompt, $cleanName); $metaDescription = $this->ai->generateText($metaPrompt); $serviceInput = [ 'user_id' => $this->ai->getUserId(), 'lang_id' => $this->ai->getDefaultLanguageId(), 'name' => $cleanName, 'slug' => Str::slug($cleanName) . '-' . time() . '-' . rand(100, 999), 'content' => $this->extractCleanText($content), 'serial_number' => $index + 1, 'featured' => $data['featured'] ?? 0, 'detail_page' => 1, 'meta_keywords' => $cleanName . ', ' . $industry . ', ' . $businessName, 'meta_description' => $this->extractCleanText($metaDescription), ]; if (in_array($theme, ['home_seven', 'home_nine'])) { $iconPrompt = "You are an expert in Font Awesome icons. Based ONLY on this service name: \"{$cleanName}\" Return strictly ONE most relevant Font Awesome 6 icon class. Rules: - Output format: fas fa-home / far fa-gem etc. - Use 'fas' by default. - No quotes, no extra text. Now return the best icon for: \"{$cleanName}\""; $generatedIcon = $this->ai->generateText($iconPrompt); $serviceInput['icon'] = $this->extractCleanIcon($generatedIcon); } $imagePrompt = $this->buildImagePromptByTheme($theme, $cleanName); $image = $this->ai->generateImage( $imagePrompt, 101, 101, $this->imageStoragePath ); $serviceInput['image'] = $image; UserService::create($serviceInput); } } private function getServiceData(string $theme, string $baseContext): array { $businessName = $this->ai->getBusinessName(); $itMarketingThemes = ['home_one', 'home_two', 'home_three', 'home_four', 'home_six', 'home_twelve']; $isITMarketing = in_array($theme, $itMarketingThemes); $isHotel = ($theme === 'home_nine'); $isNGO = ($theme === 'home_eleven'); $nameGuardRules = "Return ONLY 2-6 words and ONLY a SERVICE/OFFERING name (noun phrase). DO NOT use the business name '{$businessName}'. DO NOT use brand-like words (studio, agency, momentum, creative, media, pulse, pixel). DO NOT write slogans. Must be a service people can buy."; if ($isITMarketing) { return [ [ 'name_prompt' => "{$nameGuardRules} Generate an IT/Web + Digital Marketing primary service. Examples: Website Design & Development, Digital Marketing Strategy, Lead Generation, Conversion Optimization. Context: {$baseContext}", 'fallback_name' => 'Website Design & Development', 'featured' => 1, ], [ 'name_prompt' => "{$nameGuardRules} Generate a paid social advertising service. Examples: Social Media Ads, Facebook & Instagram Ads, TikTok Ads Campaigns, LinkedIn Lead Ads. Context: {$baseContext}", 'fallback_name' => 'Social Media Ads', 'featured' => 1, ], [ 'name_prompt' => "{$nameGuardRules} Generate a Google ads / PPC service. Examples: Google Ads Management, PPC Campaign Optimization, Search Ads Strategy. Context: {$baseContext}", 'fallback_name' => 'Google Ads Management', 'featured' => 1, ], ]; } if ($isHotel) { return [ [ 'name_prompt' => "{$nameGuardRules} Generate a hotel core service. Examples: Room Reservations, Suite Accommodation, Luxury Room Booking. Context: {$baseContext}", 'fallback_name' => 'Room Reservations', 'featured' => 1, ], [ 'name_prompt' => "{$nameGuardRules} Generate a dining service. Examples: Restaurant Dining, In-Room Dining, Catering Services. Context: {$baseContext}", 'fallback_name' => 'Restaurant Dining', 'featured' => 1, ], [ 'name_prompt' => "{$nameGuardRules} Generate events/banquet service. Examples: Event Hosting, Wedding Services, Conference Hall Booking. Context: {$baseContext}", 'fallback_name' => 'Event Hosting', 'featured' => 1, ], ]; } if ($isNGO) { return [ [ 'name_prompt' => "{$nameGuardRules} Generate an NGO core program/service. Examples: Community Relief, Food Distribution, Emergency Support. Context: {$baseContext}", 'fallback_name' => 'Community Relief', 'featured' => 1, ], [ 'name_prompt' => "{$nameGuardRules} Generate donation/fundraising service. Examples: Donation Management, Fundraising Campaigns, Donor Engagement. Context: {$baseContext}", 'fallback_name' => 'Donation Management', 'featured' => 1, ], [ 'name_prompt' => "{$nameGuardRules} Generate education/skills service. Examples: Skills Training, Education Support, Youth Development. Context: {$baseContext}", 'fallback_name' => 'Education Support', 'featured' => 1, ], ]; } return [ [ 'name_prompt' => "{$nameGuardRules} Generate a primary service relevant to the business. Examples: Professional Consulting, Customer Support. Context: {$baseContext}", 'fallback_name' => 'Professional Consulting', 'featured' => 1, ], [ 'name_prompt' => "{$nameGuardRules} Generate a secondary service relevant to the business. Examples: Strategy & Planning, Project Support. Context: {$baseContext}", 'fallback_name' => 'Strategy & Planning', 'featured' => 1, ], ]; } private function buildContentPromptByTheme(string $theme, string $serviceName, string $baseContext): string { $guard = "Rules: - Must mention the exact service name \"{$serviceName}\" in the FIRST sentence. - Write ONLY about this service. - No bullet lists. No headings. No quotes."; if ($theme === 'home_nine') { return "Return EXACTLY 120-150 words. Hotel service description for: {$serviceName}. Mention guest experience, quality standards, and the service process. {$guard} Context: {$baseContext}"; } if ($theme === 'home_eleven') { return "Return EXACTLY 120-150 words. Charity/NGO service description for: {$serviceName}. Mention beneficiaries, transparency, implementation process, and impact. {$guard} Context: {$baseContext}"; } return "Return EXACTLY 120-150 words. Professional service description for: {$serviceName}. Include benefits, process steps, and measurable outcomes/ROI where relevant. {$guard} Context: {$baseContext}"; } private function buildMetaPromptByTheme(string $theme, string $serviceName, string $baseContext): string { return "Return exactly 140-155 characters. SEO meta description ONLY for the service: {$serviceName}. No quotes. No extra text. Context: {$baseContext}"; } private function buildImagePromptByTheme(string $theme, string $serviceName): string { if ($theme === 'home_nine') { return "Simple flat line icon for '{$serviceName}', hotel & hospitality style, minimalist clean 2D vector, full canvas fill, no shadows, no gradients, professional UI icon"; } if ($theme === 'home_eleven') { return "Simple flat line icon for '{$serviceName}', charity & community support style, minimalist clean 2D vector, full canvas fill, no shadows, no gradients, professional UI icon"; } return "Simple flat line icon for '{$serviceName}', minimalist clean 2D vector, full canvas fill, no shadows, no gradients, professional UI icon"; } private function generateContentWithGuard(string $prompt, string $serviceName): string { for ($i = 0; $i < 3; $i++) { $text = $this->ai->generateText($prompt); $clean = $this->extractCleanText($text); // Ensure service name appears if (stripos($clean, $serviceName) !== false) { return $text; } } return $this->ai->generateText($prompt); } private function generateValidServiceTitle(string $namePrompt, string $fallback): string { for ($try = 0; $try < 4; $try++) { $name = $this->ai->generateText($namePrompt); $cleanName = $this->extractCleanTitle($name); if (!$this->isInvalidServiceTitle($cleanName)) { return $cleanName; } } return $fallback; } private function isInvalidServiceTitle(string $title): bool { $t = strtolower(trim($title)); if ($t === '') return true; $businessName = strtolower(trim($this->ai->getBusinessName() ?? '')); if ($businessName && str_contains($t, $businessName)) return true; $blacklist = ['studio', 'agency', 'momentum', 'creative', 'media', 'pulse', 'pixel', 'slogan']; foreach ($blacklist as $bad) { if (str_contains($t, $bad)) return true; } if (str_word_count($t) < 2) return true; // if ends with common service nouns, accept even if keyword missing $allowEndings = [ 'services', 'service', 'management', 'ads', 'advertising', 'development', 'design', 'seo', 'optimization', 'analytics', 'strategy', 'campaigns', 'support', 'booking', 'dining', 'events', 'training', 'care', 'program', 'relief', 'reservations' ]; foreach ($allowEndings as $end) { if (preg_match('/\b' . preg_quote($end, '/') . '\b/', $t)) { return false; } } // If contains at least one service-ish token, accept $serviceTokens = [ 'lead', 'generation', 'conversion', 'website', 'web', 'marketing', 'content', 'social', 'google', 'tracking', 'reporting', 'branding', 'identity', 'reservation', 'room', 'banquet', 'donation', 'fundraising', 'community', 'education', 'health', 'aid' ]; foreach ($serviceTokens as $k) { if (str_contains($t, $k)) return false; } return true; } private function extractCleanTitle($text) { $text = trim($text); $text = preg_replace('/^(service name|title)\s*:\s*/i', '', $text); $text = preg_replace('/^["“”\'`]+|["“”\'`]+$/u', '', $text); $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } private function extractCleanText($text) { //remove only the prefix words, not the whole line $text = preg_replace('/^(Here are|Here is|Sure|Certainly)\s*[:,\-]?\s*/i', '', trim($text)); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } private function extractCleanIcon($text) { $text = preg_replace('/[\+\._,]/', ' ', strtolower(trim($text))); $text = preg_replace('/[^a-z0-9\-\s]/', '', $text); $text = preg_replace('/\s+/', ' ', $text); if (preg_match('/\b(fas|far|fab|fal|fad)?\s*(fa\-[a-z0-9\-]+)/', $text, $matches)) { $style = $matches[1] ?: 'fas'; $icon = $matches[2]; $clean = $style . ' ' . $icon; return $clean; } return 'fas fa-star'; } } Services/AiWebsite/UserFeatureService.php 0000644 00000012715 15213350437 0014500 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\UserFeature; use App\Models\User\Language; use App\Services\MasterAiGenerator; class UserFeatureService { protected $ai; protected $iconPath = 'assets/front/img/user/feature/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(int $count = 3) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldFeatures = UserFeature::where('user_id', $userId)->get(); foreach ($oldFeatures as $feature) { if ($feature->icon && file_exists(public_path($this->iconPath . $feature->icon))) { @unlink(public_path($this->iconPath . $feature->icon)); } } UserFeature::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $defaultLangId = $this->ai->getDefaultLanguageId(); $theme = $this->ai->getThemeName(); $language = Language::where('id', $defaultLangId) ->where('user_id', $userId) ->first(); if (!$language) { return; } $themeName = $theme->theme ?? null; $definitions = $this->getFeatureDefinitions($count); $serial = 1; foreach ($definitions as $def) { $rawTitle = $this->ai->generateText($def['title_prompt']); $rawText = $this->ai->generateText($def['text_prompt']); $title = $this->cleanLine($rawTitle, 50); $text = $this->cleanLine($rawText, 255); $iconFilename = null; if ($themeName != 'home_ten') { $iconPrompt = $this->getIconImagePrompt($title); $iconFilename = $this->ai->generateImage( $iconPrompt, 64, 64, $this->iconPath ); } UserFeature::create([ 'user_id' => $userId, 'language_id' => $language->id, 'color' => $def['color'], 'icon' => $iconFilename, 'title' => $title, 'text' => $text, 'serial_number' => $serial++, ]); } } private function getFeatureDefinitions(int $count): array { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $info = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a {$industry} business. Highlight core benefits / features for the website feature section."; $base = [ [ 'color' => '2563eb', 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a short feature title about speed or efficiency. Examples: Fast Project Delivery, Lightning-Quick Support, Optimized Performance Output: Just the title text, nothing else. Context: {$baseContext}", 'text_prompt' => "You must return 18-25 words. No formatting, no explanation. Describe how {$businessName} helps clients move faster or work more efficiently. Focus on: time savings, streamlined process, quick results. Output: Plain text only, 18-25 words. Context: {$baseContext}", ], [ 'color' => '16a34a', 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a feature title about reliability or security. Examples: Reliable Trusted Service, Enterprise-Grade Security, Always-On Reliability Output: Just the title text, nothing else. Context: {$baseContext}", 'text_prompt' => "You must return 18-25 words. No formatting, no explanation. Describe how {$businessName} ensures safety, stability or trust for customers. Focus on: reliability, data/security, long-term partnership. Output: Plain text only, 18-25 words. Context: {$baseContext}", ], [ 'color' => 'f97316', 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a feature title about support or team. Examples: Dedicated Expert Team, Personal Customer Support, Human-Centered Service Output: Just the title text, nothing else. Context: {$baseContext}", 'text_prompt' => "You must return 18-25 words. No formatting, no explanation. Describe how {$businessName}'s team supports clients. Focus on: expert guidance, responsive help, long-term support. Output: Plain text only, 18-25 words. Context: {$baseContext}", ], ]; $result = []; for ($i = 0; $i < min($count, count($base)); $i++) { $result[] = $base[$i]; } return $result; } private function getIconImagePrompt(string $title): string { return "Create a simple flat icon illustration for a website feature section. The icon must visually represent this feature title: \"{$title}\". Style: minimal, solid shapes, no text, transparent or white background, works at 64x64 pixels."; } private function cleanLine(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } } Services/AiWebsite/ContactService.php 0000644 00000013213 15213350437 0013633 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\UserContact; use App\Services\MasterAiGenerator; class ContactService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/'; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; } public function generate() { $contactData = $this->getContactData(); $title = $this->ai->generateText($contactData['title_prompt']); $subtitle = $this->ai->generateText($contactData['subtitle_prompt']); $addresses = $this->ai->generateText($contactData['addresses_prompt']); $numbers = $this->ai->generateText($contactData['numbers_prompt']); $mails = $this->ai->generateText($contactData['mails_prompt']); // Generate contact form image $image = $this->ai->generateImage( $contactData['image_prompt'], 453, 570, $this->imageStoragePath ); UserContact::updateOrCreate( [ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), ], [ 'contact_form_image' => $image, 'contact_form_title' => $this->extractCleanTitle($title), 'contact_form_subtitle' => $this->extractCleanTitle($subtitle), 'contact_addresses' => $this->extractCleanText($addresses), 'contact_numbers' => $this->extractCleanText($numbers), 'contact_mails' => $this->extractCleanText($mails), 'latitude' => $contactData['latitude'], 'longitude' => $contactData['longitude'], 'map_zoom' => $contactData['map_zoom'], ] ); } private function getContactData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; // Generate realistic coordinates (you can adjust based on region) $latitude = number_format(rand(23000000, 24000000) / 1000000, 6); $longitude = number_format(rand(90000000, 91000000) / 1000000, 6); return [ 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a welcoming contact section title for {$businessName}. Examples: Get In Touch, Contact Us Today, Reach Out Now, Let's Connect Output: Just the title, nothing else. Context: {$baseContext}", 'subtitle_prompt' => "You must return EXACTLY 7-8 words. No formatting, no explanation. Write an inviting contact section subtitle encouraging visitors to reach out. Include: availability, response commitment, friendly tone. Examples: We're here to help and answer any questions you might have. We look forward to hearing from you Output: Plain text only, 7-8 words. Context: {$baseContext}", 'addresses_prompt' => "You must return realistic business addresses separated by semicolons. No formatting. Generate 1-2 professional office addresses for {$businessName} in {$industry}. Format: Street Address, City, State/Region ZIP Examples: 123 Business Avenue, New York, NY 10001; 456 Corporate Drive, Los Angeles, CA 90001 Use realistic but fictional addresses. Separate multiple addresses with semicolons. Output: Addresses only, separated by semicolons. Context: {$baseContext}", 'numbers_prompt' => "You must return realistic business phone numbers separated by commas. No formatting. Generate 1-2 professional contact numbers for {$businessName}. Include different departments if applicable (Sales, Support, Main Office). Format: +1 (XXX) XXX-XXXX or similar professional format Examples: +1 (555) 123-4567, +1 (555) 123-4568 Use realistic but fictional numbers. Separate with commas. Output: Phone numbers only, separated by commas.", 'mails_prompt' => "You must return realistic business email addresses separated by commas. No formatting. Generate 1-2 professional email addresses for {$businessName}. Include different purposes (info, support, sales). Format: departmentname@companyname.com Examples: info@company.com, support@company.com, sales@company.com Use lowercase. Base emails on the business name. Separate with commas. Output: Email addresses only, separated by commas. Business name: {$businessName}", 'image_prompt' => "Professional office scene for {$industry} contact page: modern reception desk with computer and phone, friendly professional environment, contemporary business interior, clean organized workspace, natural window lighting, plants and professional decor, welcoming atmosphere, corporate photography style, high resolution, MANDATORY: zero text, zero words, zero typography, zero letters visible anywhere, completely text-free image, visual only", 'latitude' => $latitude, 'longitude' => $longitude, 'map_zoom' => 15, ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/SocialService.php 0000644 00000003410 15213350437 0013450 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\Social; use App\Services\MasterAiGenerator; class SocialService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); Social::where('user_id', $userId)->delete(); } $socialData = $this->getSocialData(); foreach ($socialData as $index => $data) { Social::create([ 'user_id' => $this->ai->getUserId(), 'icon' => $data['icon'], 'url' => $data['url'], 'serial_number' => $index + 1, ]); } } private function getSocialData() { $businessName = $this->ai->getBusinessName(); // Generate clean business name for social URLs $businessHandle = strtolower(str_replace([' ', '.', ',', '&'], '', $businessName)); if (strlen($businessHandle) > 20) { $words = explode(' ', $businessName); $businessHandle = strtolower($words[0]); } return [ [ 'icon' => 'fab fa-facebook-f', 'url' => 'https://www.facebook.com/' . $businessHandle, ], [ 'icon' => 'fab fa-twitter', 'url' => 'https://twitter.com/' . $businessHandle, ], [ 'icon' => 'fab fa-linkedin-in', 'url' => 'https://www.linkedin.com/company/' . $businessHandle, ], [ 'icon' => 'fab fa-instagram', 'url' => 'https://www.instagram.com/' . $businessHandle, ], [ 'icon' => 'fab fa-youtube', 'url' => 'https://www.youtube.com/@' . $businessHandle, ], ]; } } Services/AiWebsite/SEOService.php 0000644 00000034145 15213350437 0012675 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\SEO; use App\Services\MasterAiGenerator; class SEOService { protected $ai; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; } public function generate() { $seoData = $this->getSEOData(); $seoFields = []; // Generate meta keywords and descriptions for all pages foreach ($seoData as $pageKey => $data) { $keywords = $this->ai->generateText($data['keywords_prompt']); $description = $this->ai->generateText($data['description_prompt']); // Determine column names based on page $columnNames = $this->getColumnNames($pageKey); $seoFields[$columnNames['keywords']] = $this->extractCleanText($keywords); $seoFields[$columnNames['description']] = $this->extractCleanText($description); } SEO::updateOrCreate( [ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), ], $seoFields ); } // Helper method to get correct column names private function getColumnNames($pageKey) { $reverseFormatPages = [ 'signup', 'login', 'course_details', 'course', 'rooms', 'room_details' ]; if (in_array($pageKey, $reverseFormatPages)) { return [ 'keywords' => 'meta_keyword_' . $pageKey, 'description' => 'meta_description_' . $pageKey, ]; } return [ 'keywords' => $pageKey . '_meta_keywords', 'description' => $pageKey . '_meta_description', ]; } private function getSEOData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ 'home' => [ 'keywords_prompt' => "You must return ONLY 8-10 SEO keywords separated by commas. No formatting. Generate primary SEO keywords for the home page of {$businessName}. Include: business name, industry, main services, location-related if applicable, brand keywords. Examples: business name, industry type, main service, best service provider, professional company Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the home page. Include: business name, what you do, main value proposition, call to action. Make it compelling and keyword-rich. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'services' => [ 'keywords_prompt' => "You must return ONLY 7-10 SEO keywords separated by commas. No formatting. Generate SEO keywords for the services page. Focus on: service types, industry services, professional services, service-related terms. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the services page. Highlight: range of services, expertise, quality, client benefits. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'blogs' => [ 'keywords_prompt' => "You must return ONLY 7-9 SEO keywords separated by commas. No formatting. Generate SEO keywords for the blog page. Include: industry blog, insights, articles, news, tips, resources. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the blog page. Mention: industry insights, expert articles, latest news, valuable content. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'portfolios' => [ 'keywords_prompt' => "You must return ONLY 7-9 SEO keywords separated by commas. No formatting. Generate SEO keywords for the portfolio page. Include: portfolio, projects, work samples, case studies, client work. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the portfolio page. Highlight: successful projects, quality work, client satisfaction, results. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'jobs' => [ 'keywords_prompt' => "You must return ONLY 7-9 SEO keywords separated by commas. No formatting. Generate SEO keywords for the careers/jobs page. Include: careers, jobs, employment, opportunities, hiring, join team. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the careers page. Mention: job opportunities, career growth, team culture, apply now. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'team' => [ 'keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for the team page. Include: team members, leadership, experts, professionals, about team. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the team page. Highlight: experienced team, expert professionals, leadership, qualifications. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'faqs' => [ 'keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for the FAQ page. Include: FAQ, questions, answers, help, support, common queries. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the FAQ page. Mention: common questions, helpful answers, quick solutions, support. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'contact' => [ 'keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for the contact page. Include: contact us, get in touch, reach out, customer support, location. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the contact page. Include: contact information, reach us, get support, available to help. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'shop' => [ 'keywords_prompt' => "You must return ONLY 7-9 SEO keywords separated by commas. No formatting. Generate SEO keywords for the shop/products page. Include: online shop, products, buy online, e-commerce, store, shopping. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the shop page. Mention: quality products, online shopping, best prices, shop now. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'item_details' => [ 'keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for product details pages. Include: product details, specifications, buy product, product features. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for product detail pages. Highlight: detailed information, features, specifications, purchase. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'cart' => [ 'keywords_prompt' => "You must return ONLY 5-7 SEO keywords separated by commas. No formatting. Generate SEO keywords for the shopping cart page. Include: shopping cart, my cart, cart items, checkout, purchase. Output: Comma-separated keywords only.", 'description_prompt' => "You must return EXACTLY 140-150 characters. No formatting. Write an SEO meta description for the cart page. Output: Plain text only, 140-150 characters.", ], 'checkout' => [ 'keywords_prompt' => "You must return ONLY 5-7 SEO keywords separated by commas. No formatting. Generate SEO keywords for the checkout page. Include: checkout, secure payment, complete order, buy now. Output: Comma-separated keywords only.", 'description_prompt' => "You must return EXACTLY 140-150 characters. No formatting. Write an SEO meta description for the checkout page. Output: Plain text only, 140-150 characters.", ], 'signup' => [ 'keywords_prompt' => "You must return ONLY 5-7 SEO keywords separated by commas. No formatting. Generate SEO keywords for the signup page. Include: sign up, register, create account, join, membership. Output: Comma-separated keywords only.", 'description_prompt' => "You must return EXACTLY 140-150 characters. No formatting. Write an SEO meta description for the signup page. Output: Plain text only, 140-150 characters.", ], 'login' => [ 'keywords_prompt' => "You must return ONLY 5-7 SEO keywords separated by commas. No formatting. Generate SEO keywords for the login page. Include: login, sign in, member login, access account, user login. Output: Comma-separated keywords only.", 'description_prompt' => "You must return EXACTLY 140-150 characters. No formatting. Write an SEO meta description for the login page. Output: Plain text only, 140-150 characters.", ], 'course' => [ 'keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for courses page. Include: courses, online learning, training, education, classes. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the courses page. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'course_details' => [ 'keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for course details pages. Include: course details, curriculum, enroll, online course, learning. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for course detail pages. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'rooms' => [ 'keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for rooms/accommodations page. Include: rooms, accommodation, booking, hotel rooms, stay. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for the rooms page. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], 'room_details' => [ 'keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for room details pages. Include: room details, amenities, book room, accommodation features. Output: Comma-separated keywords only. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 60-70 characters. No formatting. Write an SEO meta description for room detail pages. Output: Plain text only, 60-70 characters. Context: {$baseContext}", ], ]; } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/HotelManagement/RoomService.php 0000644 00000023037 15213350437 0016231 0 ustar 00 <?php namespace App\Services\AiWebsite\HotelManagement; use App\Models\User\HotelBooking\Room; use App\Models\User\HotelBooking\RoomCategory; use App\Models\User\HotelBooking\RoomAmenity; use App\Models\User\HotelBooking\RoomContent; use App\Models\User\Language; use App\Services\MasterAiGenerator; use Illuminate\Support\Facades\DB; class RoomService { protected $ai; protected $featuredPath = 'assets/img/rooms/feature-images/'; protected $sliderPath = 'assets/img/rooms/slider-images/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(int $count = 2) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldRooms = Room::where('user_id', $userId)->get(); foreach ($oldRooms as $room) { // featured image if ($room->featured_img && file_exists(public_path($this->featuredPath . $room->featured_img))) { @unlink(public_path($this->featuredPath . $room->featured_img)); } // slider images (json array) if ($room->slider_imgs) { $sliderImages = json_decode($room->slider_imgs, true); if (is_array($sliderImages)) { foreach ($sliderImages as $sliderImage) { if ($sliderImage && file_exists(public_path($this->sliderPath . $sliderImage))) { @unlink(public_path($this->sliderPath . $sliderImage)); } } } } } RoomContent::whereHas('room', function ($q) use ($userId) { $q->where('user_id', $userId); })->delete(); Room::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $defaultLangId = $this->ai->getDefaultLanguageId(); // default language object $defaultLang = Language::where('id', $defaultLangId) ->where('user_id', $userId) ->first(); if (!$defaultLang) { return; } $categories = RoomCategory::where('user_id', $userId) ->where('language_id', $defaultLangId) ->get(); $amenities = RoomAmenity::where('user_id', $userId) ->where('language_id', $defaultLangId) ->get(); for ($i = 1; $i <= $count; $i++) { $config = $this->getBaseRoomConfig($i); DB::beginTransaction(); try { // featured image $featuredImg = $this->ai->generateImage( $config['featured_prompt'], 3840, 2560, $this->featuredPath ); // slider images $sliderFiles = []; foreach ($config['slider_prompts'] as $prompt) { $sliderFiles[] = $this->ai->generateImage( $prompt, 770, 600, $this->sliderPath ); } // main room row $room = Room::create([ 'user_id' => $userId, 'slider_imgs' => json_encode($sliderFiles), 'featured_img' => $featuredImg, 'status' => 1, 'bed' => $config['bed'], 'bath' => $config['bath'], 'rent' => $config['rent'], 'max_guests' => $config['max_guests'], 'latitude' => $config['latitude'], 'longitude' => $config['longitude'], 'address' => $config['address'], 'phone' => $config['phone'], 'email' => $config['email'], 'quantity' => $config['quantity'], ]); // only default language content $contentDef = $this->getContentDefinition($room, $defaultLang); $rawTitle = $this->ai->generateText($contentDef['title_prompt']); $title = $this->extractCleanTitle($rawTitle); $rawSummary = $this->ai->generateText($contentDef['summary_prompt']); $summary = $this->extractCleanText($rawSummary); $rawDesc = $this->ai->generateText($contentDef['description_prompt']); $description = $this->extractCleanText($rawDesc); $rawMetaKw = $this->ai->generateText($contentDef['meta_keywords_prompt']); $metaKeywords = $this->extractCleanText($rawMetaKw); $rawMetaDesc = $this->ai->generateText($contentDef['meta_description_prompt']); $metaDescription = $this->extractCleanText($rawMetaDesc); $langAmenities = $this->pickRandomAmenities($amenities); RoomContent::create([ 'user_id' => $userId, 'language_id' => $defaultLangId, 'room_id' => $room->id, 'room_category_id' => $categories->isNotEmpty() ? $categories->random()->id : null, 'title' => $title, 'slug' => make_slug($title), 'amenities' => json_encode($langAmenities), 'summary' => $summary, 'description' => $description, 'meta_keywords' => $metaKeywords, 'meta_description' => $metaDescription, ]); DB::commit(); } catch (\Exception $e) { DB::rollBack(); } } } private function getBaseRoomConfig(int $index): array { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $info = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a hotel / accommodation business in {$industry}. {$info}"; $bed = rand(1, 3); $bath = rand(1, 2); $maxGuests = max(2, $bed * 2); $rent = rand(40, 200); $quantity = rand(3, 15); $latitude = 23.7 + (mt_rand(-50, 50) / 1000); $longitude = 90.4 + (mt_rand(-50, 50) / 1000); return [ 'bed' => $bed, 'bath' => $bath, 'max_guests' => $maxGuests, 'rent' => $rent, 'quantity' => $quantity, 'latitude' => $latitude, 'longitude' => $longitude, 'address' => "{$businessName} Hotel, Main Street, City", 'phone' => '+8801' . rand(300000000, 999999999), 'email' => 'booking@' . str_replace(' ', '', strtolower($businessName)) . '.com', 'featured_prompt' => "High quality hotel room photography, {$bed} bed, modern interior, cozy lighting, clean and comfortable, {$industry} style, professional booking website image", 'slider_prompts' => [ "Wide angle shot of hotel room interior, bright and welcoming, {$industry} accommodation, professional photography", "Close-up details of bed, linens and decor, cozy atmosphere, premium comfort", "Bathroom view with modern fixtures, clean and stylish, hotel booking image", "Window or balcony view from room, attractive scenery, natural light, inviting stay", ], ] + compact('baseContext'); } private function getContentDefinition(Room $room, Language $language): array { $businessName = $this->ai->getBusinessName(); $baseContext = "Hotel: {$businessName}. Room ID {$room->id}. Language: {$language->name}."; return [ 'title_prompt' => "You must return ONLY 4-8 words. No formatting, no explanation. Generate a compelling hotel room title for booking page. Examples: Deluxe King Room With City View, Cozy Standard Room For Two, Family Suite With Balcony Output: Just the title text, nothing else. Context: {$baseContext}", 'summary_prompt' => "You must return EXACTLY 25-35 words. No formatting, no explanation. Write a short summary for this hotel room focusing on key benefits: size, comfort, view, main amenities. Output: Plain text only, 25-35 words. Context: {$baseContext}", 'description_prompt' => "You must return EXACTLY 120-160 words. No formatting, no explanation. Write a detailed room description for booking page. Include: layout, bed type, bathroom, view, main amenities, ideal guests, stay experience. Output: Plain text only, 120-160 words. Context: {$baseContext}", 'meta_keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for this hotel room. Include: room type, bed type, view, hotel name, booking keywords. Output: Comma-separated keywords only. Context: {$baseContext}", 'meta_description_prompt' => "You must return EXACTLY 145-155 characters. No formatting. Write an SEO meta description for this room. Mention: room type, key benefit, ideal guests, call to book. Output: Plain text only, 145-155 characters. Context: {$baseContext}", ]; } private function pickRandomAmenities($amenities): array { if ($amenities->isEmpty()) { return []; } $count = min(rand(4, 8), $amenities->count()); return $amenities->random($count)->pluck('id')->values()->toArray(); } private function extractCleanTitle(string $text): string { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = trim($text); if (strlen($text) > 255) { $text = substr($text, 0, 255); } return $text; } private function extractCleanText(string $text): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly)/i', '', $text); $text = preg_replace('/[*_#`~\[\]"<>]/', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/HotelManagement/RoomAmenityService.php 0000644 00000005573 15213350437 0017565 0 ustar 00 <?php namespace App\Services\AiWebsite\HotelManagement; use App\Models\User\HotelBooking\RoomAmenity; use App\Services\MasterAiGenerator; class RoomAmenityService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } /** * Generate multiple room amenities for current user & default language. */ public function generate() { // Delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); RoomAmenity::where('user_id', $userId)->delete(); } $definitions = $this->getAmenityDefinitions(); foreach ($definitions as $index => $def) { $rawName = $this->ai->generateText($def['name_prompt']); $name = $this->extractCleanName($rawName); RoomAmenity::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'name' => $name, 'serial_number' => $index + 1, ]); } } /** * Define which amenities to generate + prompt text. */ private function getAmenityDefinitions(): array { $businessName = $this->ai->getBusinessName(); $baseContext = "{$businessName} is a hotel / accommodation business. Generate guest‑friendly, simple amenity names."; return [ [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a short amenity name for free wireless internet in hotel rooms. Examples: Free WiFi, High-Speed WiFi, Complimentary WiFi Output: Just the amenity name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a short amenity name for 24/7 room service or reception. Examples: 24/7 Room Service, 24-Hour Reception, Concierge Service Output: Just the amenity name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a short amenity name for guest parking. Examples: Free Parking, Secure Parking, Onsite Parking Output: Just the amenity name, nothing else. Context: {$baseContext}", ], ]; } private function extractCleanName(string $text): string { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = trim($text); if (strlen($text) > 50) { $text = substr($text, 0, 50); } return $text; } } Services/AiWebsite/HotelManagement/RoomCouponService.php 0000644 00000011604 15213350437 0017412 0 ustar 00 <?php namespace App\Services\AiWebsite\HotelManagement; use App\Models\User\HotelBooking\Coupon; use App\Services\MasterAiGenerator; use Carbon\Carbon; class RoomCouponService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } /** * Generate multiple room coupons for current user. */ public function generate() { // Delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); Coupon::where('user_id', $userId)->delete(); } $definitions = $this->getCouponDefinitions(); $serial = 1; foreach ($definitions as $def) { $codeRaw = $this->ai->generateText($def['code_prompt']); $nameRaw = $this->ai->generateText($def['name_prompt']); $code = $this->extractCode($codeRaw); $name = $this->extractCleanText($nameRaw); if (Coupon::where('user_id', $this->ai->getUserId())->where('code', $code)->exists()) { $code .= strtoupper(rand(10, 99)); } $start = Carbon::now()->addDays($def['start_offset_days'])->format('Y-m-d'); $end = Carbon::now()->addDays($def['end_offset_days'])->format('Y-m-d'); Coupon::create([ 'user_id' => $this->ai->getUserId(), 'name' => $name, 'code' => $code, 'type' => $def['type'], 'value' => $def['value'], 'start_date' => $start, 'end_date' => $end, 'rooms' => $def['rooms'] ? json_encode($def['rooms']) : null, 'serial_number' => $serial, ]); $serial++; } } private function getCouponDefinitions(): array { $businessName = $this->ai->getBusinessName(); $baseContext = "{$businessName} is a hotel or accommodation business. Generate guest‑friendly, clear coupon info."; return [ [ 'name_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a hotel coupon name for early bird bookings. Examples: Early Bird Room Discount, Book Early Save More, Advance Booking Offer Output: Just the name text, nothing else. Context: {$baseContext}", 'code_prompt' => "You must return ONLY ONE coupon code of 6-10 characters, uppercase letters and numbers, no spaces. Examples: EARLY20, ADVANCE15, BOOKAHEAD10 Output: Just the code, nothing else.", 'type' => 'fixed', 'value' => 15, 'start_offset_days' => 0, 'end_offset_days' => 60, 'rooms' => null, ], [ 'name_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a hotel coupon name for weekend stays. Examples: Weekend Getaway Deal, Stay More Save More, Weekend Special Offer Output: Just the name text, nothing else. Context: {$baseContext}", 'code_prompt' => "You must return ONLY ONE coupon code of 6-10 characters, uppercase letters and numbers, no spaces. Examples: WEEKEND20, GETAWAY15, STAYFRI Output: Just the code, nothing else.", 'type' => 'percentage', 'value' => 20, 'start_offset_days' => 0, 'end_offset_days' => 45, 'rooms' => null, ], [ 'name_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a hotel coupon name for long stays with a free night. Examples: Stay 3 Nights Pay 2, Long Stay Free Night, Extended Stay Reward Output: Just the name text, nothing else. Context: {$baseContext}", 'code_prompt' => "You must return ONLY ONE coupon code of 6-10 characters, uppercase letters and numbers, no spaces. Examples: STAY3PAY2, LONGSTAY, FREEDAY Output: Just the code, nothing else.", 'type' => 'night_free', 'value' => 5, 'start_offset_days' => 0, 'end_offset_days' => 90, 'rooms' => null, ], ]; } private function extractCode(string $text): string { $text = strtoupper(trim($text)); // remove spaces and non A-Z0-9 $text = preg_replace('/[^A-Z0-9]/', '', $text); if (strlen($text) > 10) { $text = substr($text, 0, 10); } if ($text === '') { $text = 'ROOM' . rand(1000, 9999); } return $text; } private function extractCleanText(string $text): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]"<>]/', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/HotelManagement/RoomCategoryService.php 0000644 00000005442 15213350437 0017727 0 ustar 00 <?php namespace App\Services\AiWebsite\HotelManagement; use App\Models\User\HotelBooking\RoomCategory; use App\Services\MasterAiGenerator; class RoomCategoryService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } /** * Generate multiple room categories for current user + default language. */ public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); RoomCategory::where('user_id', $userId)->delete(); } $defs = $this->getCategoryDefinitions(); foreach ($defs as $index => $def) { $rawName = $this->ai->generateText($def['name_prompt']); $name = $this->extractCleanName($rawName); RoomCategory::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'name' => $name, 'status' => 1, 'serial_number' => $index + 1, ]); } } private function getCategoryDefinitions(): array { $businessName = $this->ai->getBusinessName(); $baseContext = "{$businessName} is a hotel / accommodation business. Generate clear, guest‑friendly room category names."; return [ [ 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a standard entry-level hotel room category name. Examples: Standard Room, Classic Room, Comfort Room Output: Just the category name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a slightly upgraded room category name. Examples: Superior Room, Premium Room, Comfort Plus Room Output: Just the category name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a deluxe room category name. Examples: Deluxe Room, Deluxe City View, Deluxe King Room Output: Just the category name, nothing else. Context: {$baseContext}", ], ]; } private function extractCleanName(string $text): string { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = trim($text); if (strlen($text) > 60) { $text = substr($text, 0, 60); } return $text; } } Services/AiWebsite/PortfolioSliderImageService.php 0000644 00000004401 15213350437 0016322 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\Portfolio; use App\Models\User\PortfolioImage; use App\Services\MasterAiGenerator; class PortfolioSliderImageService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/portfolios/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(): void { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldSliderImages = PortfolioImage::whereHas('portfolio', function ($query) use ($userId) { $query->where('user_id', $userId); })->get(); foreach ($oldSliderImages as $sliderImage) { if ($sliderImage->image && file_exists(public_path($this->imageStoragePath . $sliderImage->image))) { @unlink(public_path($this->imageStoragePath . $sliderImage->image)); } } PortfolioImage::whereHas('portfolio', function ($query) use ($userId) { $query->where('user_id', $userId); })->delete(); } $portfolios = Portfolio::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->get(); foreach ($portfolios as $portfolio) { $imagePrompts = [ "Additional image for portfolio titled '{$portfolio->title}'. The image should complement the main image and reflect the portfolio's theme and content. Ensure the image is high-quality and visually appealing.", "Another supplementary image for the portfolio '{$portfolio->title}'. This image should provide a different perspective or highlight another aspect of the portfolio's subject matter. Maintain consistency with the overall style and tone of the portfolio.", ]; for ($i = 0; $i < 2; $i++) { // Generate image using AI $sliderImage = $this->ai->generateImage( $imagePrompts[$i], 1200, 800, $this->imageStoragePath ); // Save to database PortfolioImage::create([ 'user_portfolio_id' => $portfolio->id, 'image' => $sliderImage, ]); } } } } Services/AiWebsite/HomePage/CounterInformationService.php 0000644 00000012774 15213350437 0017565 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\CounterInformation; use App\Services\MasterAiGenerator; class CounterInformationService { protected $ai; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; } public function generate() { // Delete previous counter information records for this user CounterInformation::where('user_id', $this->ai->getUserId())->delete(); $counterData = $this->getCounterData(); $theme = $this->ai->getTheme(); $limit = ($theme === 'home_nine') ? 3 : count($counterData); $counterData = array_slice($counterData, 0, $limit); foreach ($counterData as $index => $data) { $count = $this->ai->generateText($data['count_prompt']); $title = $this->ai->generateText($data['title_prompt']); $cleanTitle = $this->extractCleanTitle($title); // Generate icon class based on the generated title using AI $iconPrompt = "Based on this counter title: '{$cleanTitle}', return ONLY a Font Awesome 5 icon class that best represents this title. Return format: 'fas fa-icon-name'. No explanation, no extra text, just the icon class. Examples: - For 'Years Experience': fas fa-award - For 'Happy Customers': fas fa-smile - For 'Global Reach': fas fa-globe - For 'Positive Reviews': fas fa-star - For 'Team Members': fas fa-users - For 'Community Engagement': fas fa-comments Now return the icon class for: '{$cleanTitle}'"; $icon = $this->ai->generateText($iconPrompt); CounterInformation::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'count' => $this->extractNumber($count), 'title' => $cleanTitle, 'icon' => $this->extractIconClass($icon), 'serial_number' => $index + 1, ]); } } private function getCounterData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'count_prompt' => "You must return ONLY a single number between 10-50. No text, no explanation, just the number. Generate a realistic number representing years of experience for {$businessName}. Context: {$baseContext}", 'title_prompt' => "You must return ONLY ONE label phrase of 2-3 words. Do not provide multiple options or suggestions. Choose the SINGLE BEST label for a years of experience counter for {$businessName}. Output format: Just the phrase, nothing else. No bullets, no 'Here are', no options. Good examples: Years Experience, Years Serving, Industry Leader Context: {$baseContext}", ], [ 'count_prompt' => "You must return ONLY a single number between 500-5000. No text, no explanation, just the number. Generate a realistic number representing happy customers or completed projects for {$businessName}. Context: {$baseContext}", 'title_prompt' => "You must return ONLY ONE label phrase of 2-3 words. Do not provide multiple options or suggestions. Choose the SINGLE BEST label for a happy customers counter for {$businessName}. Output format: Just the phrase, nothing else. No bullets, no 'Here are', no options. Good examples: Happy Customers, Satisfied Clients, Completed Projects Context: {$baseContext}", ], [ 'count_prompt' => "You must return ONLY a single number between 20-150. No text, no explanation, just the number. Generate a realistic number representing countries served by {$businessName}. Context: {$baseContext}", 'title_prompt' => "You must return ONLY ONE label phrase of 2-3 words. Do not provide multiple options or suggestions. Choose the SINGLE BEST label for a countries counter for {$businessName}. Output format: Just the phrase, nothing else. No bullets, no 'Here are', no options. Good examples: Countries Served, Global Reach, Countries Worldwide Context: {$baseContext}", ], [ 'count_prompt' => "You must return ONLY a single number between 100-2000. No text, no explanation, just the number. Generate a realistic number representing positive reviews or testimonials for {$businessName}. Context: {$baseContext}", 'title_prompt' => "You must return ONLY ONE label phrase of 2-3 words. Do not provide multiple options or suggestions. Choose the SINGLE BEST label for a positive reviews counter for {$businessName}. Output format: Just the phrase, nothing else. No bullets, no 'Here are', no options. Good examples: Positive Reviews, Five Star Ratings, Happy Testimonials Context: {$baseContext}", ], ]; } private function extractIconClass($text) { $text = trim($text); if (preg_match('/(fa[srlb]\s+fa-[\w-]+)/', $text, $matches)) { return $matches[1]; } return 'fas fa-check-circle'; } private function extractNumber($text) { preg_match('/\d+/', $text, $matches); return isset($matches[0]) ? (int) $matches[0] : 0; } private function extractCleanTitle($text) { // Remove common AI formatting patterns $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/^\*+\s*/', '', $text); $text = preg_replace('/^-\s*/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/HomePage/HomePageTextService.php 0000644 00000224537 15213350437 0016274 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\HomePageText; use App\Services\MasterAiGenerator; class HomePageTextService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/home_settings/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldHomeText = HomePageText::where('user_id', $userId) ->where('language_id', $this->ai->getDefaultLanguageId()) ->first(); if ($oldHomeText) { $imageFields = [ 'about_image', 'about_video_image', 'testimonial_image', 'video_section_image', 'why_choose_us_section_image', 'why_choose_us_section_video_image', 'work_process_section_img', 'work_process_section_video_img', 'contact_section_image', 'newsletter_image', 'newsletter_snd_image', 'counter_section_image', 'on_sale_section_image', ]; foreach ($imageFields as $field) { if ($oldHomeText->$field && file_exists(public_path($this->imageStoragePath . $oldHomeText->$field))) { @unlink(public_path($this->imageStoragePath . $oldHomeText->$field)); } } } HomePageText::where('user_id', $userId) ->where('language_id', $this->ai->getDefaultLanguageId()) ->delete(); } // Delete existing or update $homeText = HomePageText::updateOrCreate( [ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId() ], $this->generateAllFields() ); return $homeText; } private function generateAllFields() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $theme = $this->ai->getTheme(); $pages = $this->ai->getPages(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; $qualityEnhancer = ", shot with professional DSLR camera, 85mm portrait lens, hyperrealistic facial details, sharp focus on eyes, natural skin texture with pores, individual unique faces, detailed iris and pupils, realistic human imperfections, studio quality lighting"; $negativePrompt = ", AVOID: soft blurry faces, plastic skin, airbrushed look, cloned faces, synthetic appearance, uniform features, doll-like skin, low detail eyes"; $withoutPeople = ", professional photography, sharp focus, high resolution, studio lighting, clean composition, realistic details, vibrant colors, modern design aesthetic, AVOID: blurry, low quality, distorted, poor lighting, artificial appearance, cluttered composition"; $videoImageDimensions = match ($theme) { 'home_one' => ['width' => 730, 'height' => 667], 'home_seven' => ['width' => 1920, 'height' => 597], 'home_ten' => ['width' => 1170, 'height' => 650], default => ['width' => 1920, 'height' => 597], }; $aboutImageDimensions = match ($theme) { 'home_one' => ['width' => 654, 'height' => 556], 'home_two' => ['width' => 470, 'height' => 565], 'home_three' => ['width' => 580, 'height' => 690], 'home_six' => ['width' => 620, 'height' => 600], 'home_nine' => ['width' => 570, 'height' => 745], 'home_eleven' => ['width' => 555, 'height' => 660], 'home_twelve' => ['width' => 570, 'height' => 508], 'home_thirteen' => ['width' => 240, 'height' => 240], default => ['width' => 570, 'height' => 508], }; $fields = []; // About Section if (in_array($theme, ['home_one', 'home_two', 'home_three', 'home_six', 'home_nine', 'home_eleven', 'home_twelve', 'home_thirteen'])) { if (in_array('about', $pages)) { $aboutImagePrompt = "Realistic about us image for {$businessName}, {$industry} business. " . "{$businessInfo} " . "Show a warm, trustworthy atmosphere in a real working environment, natural colors, friendly expression, professional look" . $qualityEnhancer . $negativePrompt; if ($theme === 'home_nine') { $aboutImagePrompt = "Portrait oriented realistic lifestyle image for a hotel business. " . "A confident guest walking inside a luxury hotel room, pulling a suitcase, " . "single person, only one subject, no other people in background," . "natural candid moment, modern premium interior, " . "bright window light, warm neutral tones, calm trustworthy mood, " . "high-end hospitality photography" . $qualityEnhancer . $negativePrompt; } $aboutFields = [ 'about_title' => $this->ai->generateText( "You are a professional brand copywriter. " . "Using the details below, write a strong main heading for the About Us section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 4 to 5 words (maximum 45 characters, including spaces). " . "- Make it clear, confident, and benefit-focused. " . "- Use simple, clean language with no special characters, symbols, colons, periods, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'about_subtitle' => $this->ai->generateText( "You are a professional marketing copywriter. " . "Write an engaging subheading for the About Us section of {$businessName}, " . "which operates in the {$industry} industry. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 6 to 8 words (maximum 70 characters, including spaces). " . "- Emphasize how the business helps its customers. " . "- Keep the tone friendly and professional. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), 'about_content' => $this->ai->generateText( "You are a skilled website copywriter. " . "Write a concise, compelling 'About Us' paragraph for the homepage of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 35 to 50 words (maximum 320 characters, including spaces). " . "- Write in third person (use 'they' / the company name, not 'I' or 'we'). " . "- Clearly describe what the business does and the main benefits for customers. " . "- Keep the tone warm, trustworthy, and professional. " . "- Do not include any headings, bullet points, quotes, or explanation text. " . "Return only the final paragraph text." ), 'about_video_url' => 'https://www.youtube.com/watch?v=default', 'about_button_text' => 'Learn More About Us', 'about_button_url' => '/about', 'about_image' => $this->ai->generateImage( $aboutImagePrompt, $aboutImageDimensions['width'], $aboutImageDimensions['height'], $this->imageStoragePath ), 'about_video_image' => $this->ai->generateImage( "professional video thumbnail featuring diverse business team in {$industry} workspace, mixed gender group collaborating at modern office, prominent circular play button icon centered as overlay, cinematic video preview composition" . $qualityEnhancer . $negativePrompt, 800, 450, $this->imageStoragePath ), ]; if ($theme === 'home_eleven') { $aboutFields = array_merge($aboutFields, [ 'about_snd_button_text' => 'Future Plans', 'about_snd_button_url' => 'example.com/future-plans', ]); } $fields = array_merge($fields, $aboutFields); } } // Services Section if (in_array($theme, ['home_one', 'home_two', 'home_three', 'home_four', 'home_five', 'home_six', 'home_seven', 'home_nine', 'home_twelve'])) { $fields = array_merge( $fields, [ 'service_title' => $this->ai->generateText( "Act as a professional website copywriter. " . "Write a clear main heading for the Services section " . "of the website for {$businessName}, a {$industry} business. " . "Use only 2 to 4 words, maximum 25 characters. " . "Focus on what the company offers to clients. " . "Use simple, clean language with no special characters, symbols, colons, periods, or punctuation marks. " . "Do not add any explanation, quotes, or formatting. " . "Return only the final plain text heading." ), 'service_subtitle' => $this->ai->generateText( "You are a skilled marketing copywriter. " . "Write an engaging subheading for the Services section of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 4 to 6 words (maximum 40 characters, including spaces). " . "- Emphasize how the business helps its customers. " . "- Keep the tone friendly and professional. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), ] ); } // Skill section if (in_array($theme, ['home_one', 'home_twelve'])) { $fields = array_merge( $fields, [ 'skills_title' => $this->ai->generateText( "You are a professional brand copywriter. " . "Write a short, compelling main heading for the Skills or Our Expertise section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 30 characters, including spaces). " . "- Make it clear, confident, and capability-focused. " . "- Emphasize expertise, strengths, or competencies. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'skills_subtitle' => $this->ai->generateText( "You are a professional marketing copywriter. " . "Write an engaging subheading for the Skills or Our Expertise section of {$businessName}, " . "which operates in the {$industry} industry. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 4 to 6 words (maximum 70 characters, including spaces). " . "- Emphasize how the company’s skills help its customers. " . "- Keep the tone friendly and professional. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), 'skills_content' => $this->ai->generateText( "You are a skilled website copywriter. " . "Write a concise, compelling 'About Us' paragraph for the homepage of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 35 to 50 words (maximum 320 characters, including spaces). " . "- Write in third person (use 'they' / the company name, not 'I' or 'we'). " . "- Clearly describe what the business does and the main benefits for customers. " . "- Keep the tone warm, trustworthy, and professional. " . "- Do not include any headings, bullet points, quotes, or explanation text. " . "Return only the final paragraph text." ), ] ); } // Portfolio Section if (in_array($theme, ['home_one', 'home_two', 'home_three', 'home_four', 'home_five', 'home_six', 'home_seven', 'home_twelve'])) { $fields = array_merge($fields, [ 'portfolio_title' => $this->extractCleanTitle( $this->ai->generateText( "You must return ONLY a plain text heading of 2-4 words. No formatting, no explanation. Generate a compelling portfolio section heading for {$businessName} in {$industry} industry. Output format: Plain text only, no asterisks, no bold, no special characters. Do NOT use markdown formatting like **text** or __text__. Good examples: Our Projects, Featured Work, Success Stories, Portfolio Showcase Context: {$baseContext}" ) ), 'portfolio_subtitle' => $this->ai->generateText( "You are a skilled marketing copywriter. " . "Write an engaging subheading for the Portfolio section of {$businessName}, " . "which operates in the {$industry} industry. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 5 to 7 words (maximum 70 characters, including spaces). " . "- Explain what makes their portfolio or projects valuable to clients. " . "- Keep the tone professional, confident, and benefit-focused. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), 'view_all_portfolio_text' => $this->ai->generateText( "You are a UX copywriter. " . "Write a short call-to-action button text for a link to the full portfolio page. " . "Requirements: " . "- Use only 2 to 4 words (maximum 30 characters, including spaces). " . "- Be action-oriented and clear. " . "- Examples: 'View All Projects', 'See Our Work', 'Explore Portfolio', 'View Portfolio'. " . "- Do not use quotation marks or any explanation text. " . "Return only the final button text." ), ]); } // Testimonial Section if (in_array($theme, ['home_one', 'home_two', 'home_three', 'home_four', 'home_five', 'home_six', 'home_seven', 'home_eleven', 'home_nine', 'home_twelve'])) { $fields = array_merge( $fields, [ 'testimonial_title' => $this->ai->generateText( "You are a professional copywriter. " . "Write a compelling main heading for the Client Testimonials or What Our Clients Say section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 4 words (maximum 20 characters, including spaces). " . "- Emphasize trust, satisfaction, and social proof. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'testimonial_subtitle' => $this->ai->generateText( "You are a skilled marketing copywriter. " . "Write an engaging subheading for the Client Testimonials section of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 6 to 8 words (maximum 70 characters, including spaces). " . "- Highlight why customer feedback matters and what makes their testimonials valuable. " . "- Keep the tone warm, professional, and inviting. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), ] ); } if (in_array($theme, ['home_one', 'home_six', 'home_ten'])) { if ($theme === 'home_ten') { $prompt = "minimalist seamless white background pattern, very soft light gray small dots evenly scattered across canvas, subtle abstract texture, flat 2D design, no people, no objects, no text, ultra clean modern website background, low contrast, perfect for hero section overlay, 1920x814 aspect ratio"; $width = 1920; $height = 814; } elseif ($theme === 'home_six') { $prompt = "professional law firm website background, elegant office interior, justice scale and law books on desk, serious and trustworthy atmosphere, dark blue and gold accents, minimal hero section" . $qualityEnhancer . $negativePrompt; $width = 1920; $height = 918; } else { $prompt = "professional testimonials section background image, {$industry} workplace, satisfied happy clients smiling, modern office environment, warm friendly atmosphere, diverse team collaboration" . $qualityEnhancer . $negativePrompt; $width = 661; $height = 700; } $fields = array_merge( $fields, [ 'testimonial_image' => $this->ai->generateImage( $prompt, $width, $height, $this->imageStoragePath ), ] ); } // Team Section for all theme $fields = array_merge( $fields, [ 'team_section_title' => $this->ai->generateText( "You are a professional brand copywriter. " . "Write a short, compelling main heading for the Our Team or Meet the Team section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 3 to 4 words (maximum 30 characters, including spaces). " . "- Emphasize professionalism, expertise, and the people behind the brand. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'team_section_subtitle' => $this->ai->generateText( "You are a skilled marketing copywriter. " . "Write an engaging subheading for the professional team section of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 5 to 7 words (maximum 70 characters, including spaces). " . "- Highlight experience, dedication, and how the team helps clients. " . "- Keep the tone warm, trustworthy, and professional. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), ] ); // Blog Section if (in_array($theme, ['home_one', 'home_two', 'home_four', 'home_five', 'home_six', 'home_seven', 'home_eleven', 'home_twelve'])) { $fields = array_merge( $fields, [ 'blog_title' => $this->ai->generateText( "You are a professional web copywriter. " . "Write a short, catchy main heading for the Blog or Latest Articles section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it clear and easy to scan. " . "- Emphasize learning, insights, or updates. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'blog_subtitle' => $this->ai->generateText( "You are a skilled marketing copywriter. " . "Write an engaging subheading for the Blog or Latest Articles section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 8 to 9 words (maximum 70 characters, including spaces). " . "- Emphasize value, insights, and thought leadership. " . "- Keep the tone professional, informative, and engaging. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), 'view_all_blog_text' => $this->ai->generateText( "You are a UX copywriter. " . "Write a short call-to-action button text for a link to the full blog or articles page. " . "Requirements: " . "- Use only 2 to 4 words (maximum 30 characters, including spaces). " . "- Be action-oriented, clear, and inviting. " . "- Examples: 'Read All Articles', 'View All Posts', 'Explore Blog', 'Browse Articles'. " . "- Do not use quotation marks or any explanation text. " . "Return only the final button text." ), ] ); } // Video Section if (in_array($theme, ['home_one', 'home_two', 'home_four', 'home_five', 'home_seven', 'home_nine', 'home_ten', 'home_thirteen'])) { $fields = array_merge($fields, [ 'video_section_title' => $this->ai->generateText( "You must return ONLY ONE title of 2-3 words maximum. No explanation, no options. Generate a powerful, catchy video section heading for {$businessName} in {$industry} industry. Output format: Just 2-3 words, nothing else. Good examples: Our Story, Company Journey, Meet Our Team, Behind Scenes, Our Vision Context: {$baseContext}" ), 'video_section_subtitle' => $this->ai->generateText( "You must return ONLY ONE subtitle of 5-6 words maximum. No explanation, no options. Generate an engaging video section subtitle that highlights the company story of {$businessName}. Output format: Just 5-6 words, nothing else. Use simple, inspiring language. Good examples: Discover our journey to success, Learn about our passionate team, See how we make difference Context: {$baseContext}" ), 'video_section_text' => $this->ai->generateText( "You must return EXACTLY 2 sentences. No more, no less. Write a compelling introduction for the company video of {$businessName}. First sentence: Describe what viewers will see in the video (1 sentence). Second sentence: Explain why they should watch it (1 sentence). Keep each sentence under 20 words. Use engaging, professional tone. Context: {$baseContext}" ), 'video_section_button_text' => 'Watch Our Story', 'video_section_button_url' => '/about', 'video_section_url' => 'https://www.youtube.com/watch?v=default', ]); if ($theme === 'home_ten') { $fields = array_merge( $fields, [ 'video_section_image' => $this->ai->generateImage( "Young professional man giving thumbs up, holding real estate brochure, light blue shirt, modern office background, two colleagues blurred in background, bright natural lighting, corporate photography, sharp focus on front person, professional DSLR quality" . $qualityEnhancer . $negativePrompt, $videoImageDimensions['width'], $videoImageDimensions['height'], $this->imageStoragePath ), ] ); }elseif($theme === 'home_nine'){ $fields = array_merge( $fields, [ 'video_section_image' => $this->ai->generateImage( "Luxurious modern tropical villa on a lush hillside overlooking the ocean, infinity swimming pool in the foreground reflecting the sky, traditional red-orange tiled roofs with white walls, large floor-to-ceiling sliding glass doors opening to spacious outdoor terrace with modern furniture and seating area, open-concept indoor-outdoor living, warm golden hour sunset lighting with soft clouds, dense green jungle and palm trees in the background, high-end resort style like Thailand or Bali, bright natural atmosphere, professional architectural photography, ultra sharp focus, highly detailed, cinematic composition" . $qualityEnhancer . $negativePrompt, $videoImageDimensions['width'], $videoImageDimensions['height'], $this->imageStoragePath ), ] ); } else { $fields = array_merge( $fields, [ 'video_section_image' => $this->ai->generateImage( "Professional business team of 3 diverse people waving at camera, modern office background with geometric patterns, bright and welcoming atmosphere, corporate photography style, {$industry} workplace setting" . $qualityEnhancer . $negativePrompt, $videoImageDimensions['width'], $videoImageDimensions['height'], $this->imageStoragePath ), ] ); } } // Why Choose Us Section if (in_array($theme, ['home_one', 'home_three', 'home_nine'])) { $fields = array_merge( $fields, [ 'why_choose_us_section_title' => $this->extractCleanTitle( $this->ai->generateText( "You must return ONLY a plain text heading of 2-3 words maximum. No formatting, no explanation. Generate a compelling 'Why Choose Us' section title for {$businessName}. Output format: Plain text only, no asterisks, no markdown, no special characters. Good examples: Why Choose Us, Our Advantage, Why Us, Choose Excellence Context: {$baseContext}" ) ), 'why_choose_us_section_subtitle' => $this->extractCleanTitle( $this->ai->generateText( "You must return ONLY a plain text subtitle of 4-5 words maximum. No formatting, no explanation. Generate a subtitle explaining the competitive advantage of {$businessName} in {$industry}. Output format: Plain text only, 4-5 words, no punctuation at the end. Good examples: Experience you can trust, Quality that sets apart, Excellence in every detail Context: {$baseContext}" ) ), 'why_choose_us_section_text' => $this->extractCleanTitle( $this->ai->generateText( "You must return EXACTLY 30-35 words. Count carefully. No formatting, no explanation. Write a compelling paragraph about what makes {$businessName} unique and the best choice in {$industry}. Focus on: competitive advantages, unique value proposition, and customer benefits. Output format: Plain text paragraph, exactly 30-35 words total. Context: {$baseContext}" ) ), 'why_choose_us_section_button_text' => 'Discover More', 'why_choose_us_section_button_url' => '/services', 'why_choose_us_section_video_url' => 'https://www.youtube.com/watch?v=default', 'why_choose_us_section_image' => $this->ai->generateImage( "flat illustration style professional person in orange business attire in thinking pose with hand on chin, clean white background with decorative abstract shapes and question marks floating around, thumbs up and thumbs down icons in circular frames at top corners, minimalist modern illustration design, {$industry} professional character, simple geometric decorative elements, vector art style, friendly approachable illustration", 395, 430, $this->imageStoragePath ), 'why_choose_us_section_video_image' => $this->ai->generateImage( "Corporate video thumbnail showing {$industry} expertise and professionalism, business presentation scene with play button overlay, clean modern design, professional quality" . $qualityEnhancer . $negativePrompt, 800, 450, $this->imageStoragePath ), ] ); } // Work Process Section if (in_array($theme, ['home_two', 'home_three', 'home_four', 'home_five', 'home_six', 'home_seven'])) { $fields = array_merge($fields, [ 'work_process_section_title' => $this->ai->generateText("Write work process section title"), 'work_process_section_subtitle' => $this->ai->generateText("Write subtitle about company workflow"), 'work_process_section_text' => $this->ai->generateText("Write 2 sentences about {$businessName} work methodology"), 'work_process_btn_txt' => 'Learn Our Process', 'work_process_btn_url' => '/how-it-works', 'work_process_section_video_url' => 'https://www.youtube.com/watch?v=default', 'work_process_section_img' => $this->ai->generateImage( "work process visualization, {$industry} workflow diagram, professional team collaboration", 1000, 600, $this->imageStoragePath ), 'work_process_section_video_img' => $this->ai->generateImage( "work process video thumbnail, step-by-step methodology", 800, 450, $this->imageStoragePath ), ]); } // Quote Section if (in_array($theme, ['home_three', 'home_four', 'home_five', 'home_six', 'home_seven'])) { $fields = array_merge( $fields, [ 'quote_section_title' => $this->ai->generateText( "Write a motivational section title for a quote block in 4-5 words only. Industry: {$industry}. Business name: {$businessName}. Context: {$baseContext}. Use a professional, inspiring tone." ), 'quote_section_subtitle' => $this->ai->generateText( "Write an inspiring subtitle for the quote section in 20-25 words. Industry: {$industry}. Business name: {$businessName}. Context: {$baseContext}. Address the audience to encourage positive action and engagement." ), ] ); } // FAQ Section if (in_array($theme, ['home_three', 'home_four', 'home_five', 'home_seven'])) { $fields = array_merge($fields, [ 'faq_section_title' => $this->ai->generateText( "You are a professional web copywriter. " . "Write a short, clear main heading for the FAQ or Frequently Asked Questions section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 15 characters, including spaces). " . "- Make it simple, direct, and easy to understand. " . "- Examples: Common Questions, Your Questions, FAQ, Questions Answered. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'faq_section_subtitle' => $this->ai->generateText( "You are a skilled marketing copywriter. " . "Write an engaging subheading for the FAQ section of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 5 to 6 words (maximum 30 characters, including spaces). " . "- Emphasize helpfulness and encourage users to find answers. " . "- Keep the tone friendly, supportive, and professional. " . "- Examples: Find quick answers to your common questions, Get the information you need right here. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), ]); } // Contact Section if (in_array($theme, ['home_three', 'home_six', 'home_seven'])) { $fields = array_merge( $fields, [ 'contact_section_title' => $this->ai->generateText( "You are a professional web copywriter. " . "Write a short, clear main heading for the Contact Us section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it simple, direct, and inviting. " . "- Examples: Get In Touch, Contact Us, Reach Out, Connect Today. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'contact_section_subtitle' => $this->ai->generateText( "You are a skilled marketing copywriter. " . "Write an engaging subheading for the Contact Us section of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Write EXACTLY 7 to 9 words with proper spacing between each word. " . "- Maximum 45 characters including spaces. " . "- Each word must be separated by a single space. " . "- Emphasize accessibility, responsiveness, and willingness to help. " . "- Keep the tone warm, welcoming, and professional. " . "- Good examples: We are here to answer your questions | Ready to help you get started today | Let us help you achieve your goals. " . "- Bad examples: WeAreHereToHelp | ContactUsToday | GetInTouchNow. " . "- Use proper sentence structure with spaces between words. " . "- Do not use special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "- Each word should start with a capital letter if needed, but maintain natural spacing. " . "Return only the final plain text subheading with proper word spacing." ), ] ); } if (in_array($theme, ['home_three', 'home_four', 'home_five', 'home_six', 'home_seven', 'home_twelve'])) { $fields = array_merge( $fields, [ 'contact_section_image' => $this->ai->generateImage( "professional customer service representative with headset smiling warmly, modern office environment, {$industry} business setting, friendly and welcoming atmosphere, bright professional lighting, corporate reception desk background and white background" . $qualityEnhancer . $negativePrompt, 755, 1220, $this->imageStoragePath ), ] ); } // Newsletter Section if (in_array($theme, ['home_eight', 'home_ten', 'home_eleven', 'home_thirteen'])) { $fields = array_merge($fields, [ 'newsletter_title' => $this->ai->generateText( "You are a professional email marketing copywriter. " . "Write a short, clear main heading for the Newsletter Subscription or Email Signup section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 4 words (maximum 30 characters, including spaces). " . "- Make it inviting and engagement-focused. " . "- Examples: Join Our Newsletter, Stay Updated, Subscribe Today, Get Updates. " . "- Use simple, clear language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'newsletter_subtitle' => $this->ai->generateText( "You are a skilled email marketing copywriter. " . "Write an engaging subheading for the Newsletter Subscription section of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 8 to 10 words (maximum 75 characters, including spaces). " . "- Emphasize benefits like exclusive updates, tips, offers, or insights. " . "- Keep the tone friendly, encouraging, and value-focused. " . "- Examples: Get exclusive updates and special offers delivered weekly | Subscribe for insights tips and news you love. " . "- Use simple, clear language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), ]); } if ($theme === 'home_ten') { $qualityEnhancer = ", shot with professional Canon EOS R5 camera, 85mm f/1.4 portrait lens, " . "shallow depth of field with creamy bokeh background, " . "golden hour warm lighting from side, " . "soft sunset glow on face, beautiful rim lighting, " . "hyperrealistic skin texture with natural pores, " . "sharp focus on eyes and face, perfectly sharp eyelashes, " . "professional color grading with warm tones, " . "cinematic photography style, editorial quality, 8k resolution"; $negativePrompt = ", NEGATIVE: blurry face, soft focus on subject, harsh lighting, " . "overexposed face, underexposed shadows, flat lighting, " . "cluttered sharp background, no background blur, " . "plastic skin, airbrushed look, artificial smooth skin, " . "bad eyes, distorted facial features, asymmetrical face, " . "low resolution, jpeg artifacts, pixelated, " . "cartoon style, 3D render, painting, illustration, " . "unnatural colors, oversaturated, desaturated, cold tones"; $newsletterImagePrompt = "Professional graduation portrait photography: " . "beautiful young South Asian female graduate with long flowing brown hair, " . "wearing black graduation gown and black mortarboard cap, " . "standing on university campus pathway, " . "elegant over-the-shoulder pose looking back at camera, " . "body turned 45 degrees away with head turned towards camera, " . "natural confident smile showing teeth, genuine happy expression, " . "warm golden hour sunset lighting creating soft glow on face, " . "side lighting with beautiful rim light on hair, " . "university campus buildings softly blurred in background, " . "warm orange and pink tones in blurred background bokeh, " . "autumn leaves and campus architecture out of focus, " . "subject in sharp focus with creamy smooth background blur, " . "professional editorial style portrait photography, " . "warm color palette with golden and orange hues" . $qualityEnhancer . $negativePrompt; $fields = array_merge($fields, [ 'newsletter_image' => $this->ai->generateImage( $newsletterImagePrompt, 520, 640, $this->imageStoragePath ), ]); } elseif ($theme === 'home_thirteen') { $fields = array_merge($fields, [ 'newsletter_image' => $this->ai->generateImage( "small newsletter icon illustration for blog website, envelope and paper, minimal flat design, blog and article reading theme, simple recognizable newsletter badge" . $withoutPeople, 112, 85, $this->imageStoragePath ), ]); } if ($theme === 'home_ten') { $negativePrompt = ", NEGATIVE: blurry face, soft focus on face, blurry mouth, unclear lips, " . "multiple heads, deformed mouth, distorted lips, asymmetrical lips, " . "deformed eyes, asymmetrical eyes, crossed eyes, lazy eye, " . "bad teeth, crooked teeth, missing teeth, yellow teeth, " . "closed mouth, lips pressed together, mouth covered, " . "extra limbs, mutated hands, fused fingers, extra fingers, " . "low resolution, jpeg artifacts, watermark, text overlay, logo, " . "artificial lighting, overexposed face, underexposed face, harsh shadows on face, " . "plastic skin, waxy skin, smooth plastic texture, airbrushed skin, " . "painting style, 3D render, cartoon style, anime, illustration, drawing, " . "blurry teeth, transparent teeth, fake smile, forced expression"; $newsletterBgImagePrompt = "Professional editorial photograph: " . "Portrait of 2 university students walking towards camera, " . "beautiful South Asian female student in center focus wearing turquoise casual top, " . "handsome male student beside her in denim shirt holding coffee cup, " . "both looking directly at camera with genuine natural smiles, " . "perfect white teeth visible, detailed lips with natural texture, " . "well-defined mouth corners, symmetrical smile lines, " . "clear dental structure, healthy tooth enamel, " . "photorealistic lip details with natural gloss, " . "modern university campus with blue glass building in soft background blur, " . "warm afternoon sunlight from left side, " . "shot on Canon EOS R5, 85mm f/1.4 lens, " . "hyperrealistic facial details, perfect eye contact, " . "sharp focus on faces especially mouth area, " . "natural skin texture with pores, visible facial hair detail, " . "professional color grading, 8k resolution" . $negativePrompt; $fields = array_merge($fields, [ 'newsletter_snd_image' => $this->ai->generateImage( $newsletterBgImagePrompt, 476, 880, $this->imageStoragePath ), ]); } if ($theme === 'home_ten') { $studentBannerPrompt = "the website hero banner showing four school children learning together around a laptop compuwiter, " . "two boys and two girls sitting in a bright modern classroom, colorful casual clothes, " . "happy focused expressions, large windows with soft daylight in background, " . "clean education technology concept, e-learning and online courses, " . "flat turquoise abstract shape decorations on left and right edges of banner, " . "high-quality professional photography, warm and friendly atmosphere, " . "no text on image"; $studentBannerPrompt .= $qualityEnhancer . $negativePrompt; $fields = array_merge($fields, [ 'counter_section_image' => $this->ai->generateImage( $studentBannerPrompt, 1920, 531, $this->imageStoragePath ), ]); } elseif ($theme === 'home_six') { $fields = array_merge($fields, [ 'counter_section_image' => $this->ai->generateImage( "professional law firm achievements banner, clean dark blue background, subtle courthouse and justice scale icons, highlighted statistics such as cases won, years of experience, satisfied clients, and awards, elegant badges and trust seals, serious and trustworthy legal theme", 412, 235, $this->imageStoragePath ), ]); } // Donation / Charity Sections if (in_array($theme, ['home_eleven'])) { $fields = array_merge( $fields, [ 'featured_section_title' => $this->ai->generateText( "You are a professional web copywriter. " . "Write a short, catchy main heading for the Featured Items or Featured Services section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it clear, attention-grabbing, and highlight-focused. " . "- Examples: Featured Services, Top Picks, Our Highlights, Best Selections. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'featured_section_subtitle' => $this->ai->generateText( "You are a skilled marketing copywriter. " . "Write an engaging subheading for the Featured Items or Featured Services section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 7 to 9 words (maximum 70 characters, including spaces). " . "- Emphasize quality, value, and what makes these items or services special. " . "- Keep the tone professional, compelling, and benefit-focused. " . "- Examples: Discover our most popular and trusted solutions | Explore the best we have to offer today. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), 'donor_title' => $this->ai->generateText( "You are a professional nonprofit website copywriter. " . "Write a short, clear main heading for the Our Donors or Supporters section " . "of the website for {$businessName}, a {$industry} organization. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it appreciative, respectful, and recognition-focused. " . "- Examples: Our Supporters, Valued Donors, Thank Supporters, Generous Partners. " . "- Use simple, clear language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'causes_section_title' => $this->ai->generateText( "You are a professional nonprofit website copywriter. " . "Write a short, clear main heading for the Our Causes or Social Causes section " . "of the website for {$businessName}, a {$industry} organization. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it compassionate, purposeful, and mission-focused. " . "- Examples: Our Causes, Making Impact, Help Communities, Support Change. " . "- Use simple, clear language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'causes_section_subtitle' => $this->ai->generateText( "You are a skilled nonprofit marketing copywriter. " . "Write an engaging subheading for the Causes section of {$businessName}, " . "a {$industry} organization. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 7 to 9 words (maximum 70 characters, including spaces). " . "- Emphasize impact, community support, and the difference donations make. " . "- Keep the tone inspiring, compassionate, and action-oriented. " . "- Examples: Join us in making real change today | Support causes that transform lives every day. " . "- Use simple, clear language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), 'category_section_title' => $this->ai->generateText( "You are a professional e-commerce copywriter. " . "Write a short, clear main heading for the Product Categories or Browse Categories section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it clear and easy to understand. " . "- Examples: Shop Categories, Browse Products, Our Collections, Product Range. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'category_section_subtitle' => $this->ai->generateText( "You are a skilled e-commerce copywriter. " . "Write an engaging subheading for the Product Categories section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 6 to 8 words (maximum 60 characters, including spaces). " . "- Encourage customers to explore different product categories. " . "- Keep the tone friendly, inviting, and shopping-focused. " . "- Examples: Find exactly what you are looking for | Explore our wide range of products today. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), ] ); } // E-commerce Section Titles if (in_array($theme, ['home_eight'])) { $fields = array_merge( $fields, [ 'feature_item_title' => $this->ai->generateText( "You are a professional e-commerce copywriter. " . "Write a 2 or 3 word headline for the Featured Items or Featured Products section of {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Maximum 25 characters including spaces. " . "- Make it attention-grabbing and premium-feeling. " . "- Good examples: Featured Items, Top Picks, Staff Favorites, Handpicked Selection. " . "- Use simple, clear English only, with no punctuation or special characters. " . "Return only the final plain text heading." ), 'new_item_title' => $this->ai->generateText( "Act as an e-commerce product copywriter for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Write a 2 or 3 word headline for a New Arrivals or Latest Products section. " . "Requirements: " . "- Maximum 25 characters including spaces. " . "- Communicate freshness and newness. " . "- Good examples: New Arrivals, Just Added, Fresh Stock, Latest Products. " . "- Use simple, clear English with no punctuation or special characters. " . "Return only the final plain text heading." ), 'bestseller_item_title' => $this->ai->generateText( "You are an e-commerce marketing writer for {$businessName}, operating in the {$industry} industry. " . "Business details: {$businessInfo}. " . "Write a 2 or 3 word headline for a Bestsellers or Popular Products section. " . "Requirements: " . "- 25 characters max including spaces. " . "- Use strong social proof words. " . "- Good examples: Best Sellers, Top Rated, Customer Favorites, Most Popular. " . "- Use simple, clear words. No punctuation or special characters. " . "Return only the headline." ), 'toprated_item_title' => $this->ai->generateText( "You are a professional e-commerce copywriter. " . "Write a short, clear heading for the Top Rated or Highly Rated Products section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Emphasize quality, ratings, and customer satisfaction. " . "- Examples: Top Rated, Highest Rated, Best Reviews, Customer Choice. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'special_item_title' => $this->ai->generateText( "You are a creative e-commerce copywriter for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Write a 2 or 3 word section title for Special Offers or Exclusive Deals. " . "Requirements: " . "- 25 characters max including spaces. " . "- Make it sound exclusive or premium. " . "- Good examples: Special Offers, Exclusive Deals, Limited Edition, Premium Selection. " . "- No punctuation or special characters. " . "Return only the headline." ), 'flashsale_item_title' => $this->ai->generateText( "You are an e-commerce copywriter for {$businessName} in the {$industry} industry. " . "Business details: {$businessInfo}. " . "Write a 2 or 3 word title for a Flash Sale or Limited Time Deals section. " . "Requirements: " . "- 25 characters max including spaces. " . "- Create a sense of urgency. " . "- Good examples: Flash Sale, Lightning Deals, Quick Deals, Time Limited. " . "- Do not use punctuation or special characters. " . "Return only the headline." ), ] ); } if (in_array($theme, ['home_thirteen'])) { $fields = array_merge($fields, [ 'featured_section_title' => $this->ai->generateText( "You are a professional web copywriter. " . "Write a short, catchy main heading for the Featured Items or Featured Services section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it clear, attention-grabbing, and highlight-focused. " . "- Examples: Featured Services, Top Picks, Our Highlights, Best Selections. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'latest_item_section_title' => $this->ai->generateText( "You are a conversion-focused e-commerce copywriter for {$businessName} operating in {$industry}. " . "Business details: {$businessInfo}. " . "Write a 2 or 3 word section title for Latest Items or Recent Additions. " . "Requirements: " . "- 25 characters max including spaces. " . "- Clearly communicate recency and newness. " . "- Good examples: Latest Items, Recent Additions, New Stock, Fresh Picks. " . "- Use only clear English without punctuation or special characters. " . "Return only the headline." ), 'featured_category_item_section_title' => $this->ai->generateText( "You are a professional e-commerce copywriter for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Write a 2 to 4 word heading for a Featured Categories or Top Collections section. " . "Requirements: " . "- Maximum 30 characters including spaces. " . "- Highlight curated categories or collections. " . "- Good examples: Featured Categories, Top Collections, Popular Sections, Category Highlights. " . "- No punctuation or special characters allowed. " . "Return only the text." ), 'causes_section_title' => $this->ai->generateText( "You are a professional nonprofit website copywriter. " . "Write a short, clear main heading for the Our Causes or Social Causes section " . "of the website for {$businessName}, a {$industry} organization. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it compassionate, purposeful, and mission-focused. " . "- Examples: Our Causes, Making Impact, Help Communities, Support Change. " . "- Use simple, clear language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), ]); } // On Sale Section if (in_array($theme, ['home_fourteen'])) { $fields = array_merge($fields, [ 'flash_sale_title' => $this->ai->generateText( "You are an e-commerce copywriter for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Write a 2 or 3 word alternative title for a Flash Sale section. " . "Requirements: " . "- Maximum 25 characters including spaces. " . "- Make it sound urgent and irresistible. " . "- Good examples: Hot Deals, Today Only, Deal Zone, Flash Offers. " . "- Use no punctuation or special symbols. " . "Return only the headline." ), 'featured_item_section_title' => $this->ai->generateText( "You are a professional web copywriter. " . "Write a short, catchy main heading for the Featured Items or Featured Services section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it clear, attention-grabbing, and highlight-focused. " . "- Examples: Featured Services, Top Picks, Our Highlights, Best Selections. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'featured_category_item_section_title' => $this->ai->generateText( "You are a professional e-commerce copywriter for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Write a 2 to 4 word heading for a Featured Categories or Top Collections section. " . "Requirements: " . "- Maximum 30 characters including spaces. " . "- Highlight curated categories or collections. " . "- Good examples: Featured Categories, Top Collections, Popular Sections, Category Highlights. " . "- No punctuation or special characters allowed. " . "Return only the text." ), 'toprated_item_title' => $this->ai->generateText( "You are a professional e-commerce copywriter. " . "Write a short, clear heading for the Top Rated or Highly Rated Products section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Emphasize quality, ratings, and customer satisfaction. " . "- Examples: Top Rated, Highest Rated, Best Reviews, Customer Choice. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'counter_section_image' => $this->ai->generateImage( "statistics and achievements background, {$industry} success metrics visualization", 1920, 600, $this->imageStoragePath ), 'on_sale_section_title' => $this->ai->generateText( "You are a professional e-commerce copywriter. " . "Write a short, attention-grabbing heading for the On Sale or Discount Products section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it exciting and sale-focused. " . "- Examples: On Sale Now, Big Discounts, Save Today, Deal Zone. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'on_sale_section_subtitle' => $this->ai->generateText( "You are a skilled e-commerce copywriter. " . "Write an engaging subheading for the On Sale section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 6 to 8 words (maximum 60 characters, including spaces). " . "- Create urgency and highlight savings or value. " . "- Keep the tone exciting and action-oriented. " . "- Examples: Grab amazing deals before they are gone | Save big on selected items today only. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), 'on_sale_section_section_button_name' => 'Shop Now', 'on_sale_section_section_button_link' => '/shop', 'on_sale_section_image' => $this->ai->generateImage( "eye-catching on sale promotion banner for {$industry} products, vibrant discount offer design, sale badge and percentage symbols, modern e-commerce promotional banner style, exciting shopping deals theme, bold red and yellow accent colors, clearance sale atmosphere, professional retail marketing design", 1200, 600, $this->imageStoragePath ), 'category_section_title' => $this->ai->generateText( "You are a professional e-commerce copywriter. " . "Write a short, clear main heading for the Product Categories or Browse Categories section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it clear and easy to understand. " . "- Examples: Shop Categories, Browse Products, Our Collections, Product Range. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), ]); } // Featured Course Section if (in_array($theme, ['home_ten'])) { $fields = array_merge( $fields, [ 'featured_course_section_title' => $this->ai->generateText( "You are a professional educational platform copywriter. " . "Write a short, clear main heading for the Featured Courses or Popular Courses section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it clear, educational-focused, and appealing to learners. " . "- Examples: Featured Courses, Top Courses, Popular Learning, Best Classes. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'category_section_title' => $this->ai->generateText( "You are a professional e-commerce copywriter. " . "Write a short, clear main heading for the Product Categories or Browse Categories section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it clear and easy to understand. " . "- Examples: Shop Categories, Browse Products, Our Collections, Product Range. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), ] ); } // Job Section if (in_array($theme, ['home_twelve'])) { $fields = array_merge( $fields, [ 'job_education_title' => $this->ai->generateText( "You are a professional career website copywriter. " . "Write a short, clear main heading for the Job Opportunities or Career Openings section " . "of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it professional, inviting, and career-focused. " . "- Examples: Career Opportunities, Join Team, Open Positions, Work Here. " . "- Use simple, clear language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'job_education_subtitle' => $this->ai->generateText( "You are a skilled HR and recruitment copywriter. " . "Write an engaging subheading for the Career Opportunities section of {$businessName}, " . "a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 7 to 9 words (maximum 70 characters, including spaces). " . "- Emphasize growth, opportunity, and company culture. " . "- Keep the tone professional, welcoming, and motivational. " . "- Examples: Build your future with our talented team | Explore exciting roles and advance your career. " . "- Use simple, clear language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), ] ); } // Rooms Section if (in_array($theme, ['home_nine'])) { $fields = array_merge( $fields, [ 'rooms_section_title' => $this->ai->generateText( "You are a professional hotel website copywriter. " . "Write a short, clear main heading for the Rooms or Accommodation section of the website for {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use only 2 to 3 words (maximum 25 characters, including spaces). " . "- Make it welcoming and easy to understand. " . "- Examples: Our Rooms, Room Types, Guest Rooms, Luxury Suites, Accommodation. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text heading." ), 'rooms_section_subtitle' => $this->ai->generateText( "You are a skilled hotel website copywriter. " . "Write an engaging subheading for the Rooms section of {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 7 to 9 words (maximum 70 characters, including spaces). " . "- Emphasize comfort, amenities, and the unique features of the rooms. " . "- Keep the tone inviting, relaxing, and guest-focused. " . "- Examples: Experience comfort and luxury in every suite | Discover rooms designed for your relaxation | Enjoy modern amenities and stylish interiors. " . "- Use simple, clean language with no special characters, symbols, colons, commas, periods, hyphens, or other punctuation marks. " . "- Do not use quotation marks, formatting, or any explanation text. " . "Return only the final plain text subheading." ), 'rooms_section_content' => $this->ai->generateText( "You are a skilled hotel website copywriter. " . "Write a concise and inviting paragraph for the Rooms section content of {$businessName}, a {$industry} business. " . "Business details: {$businessInfo}. " . "Requirements: " . "- Use 20 to 30 words (maximum 200 characters, including spaces). " . "- Describe the room options, mention comfort, amenities, and why guests will enjoy staying. " . "- Write in third person (use 'they' or 'the hotel name', not 'I' or 'we'). " . "- Keep the tone warm, relaxing, and professional. " . "- Do not include any headings, bullet points, quotes, or explanation text. " . "Return only the final paragraph text." ), ] ); } return $fields; } private function extractCleanTitle($text) { // Remove common AI formatting patterns $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/^\*+\s*/', '', $text); $text = preg_replace('/\*+/', '', $text); $text = preg_replace('/__/', '', $text); $text = preg_replace('/^-\s*/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); $text = preg_replace('/[*_#`~]/', '', $text); return trim($text); } } Services/AiWebsite/HomePage/FooterTextService.php 0000644 00000012561 15213350437 0016035 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\FooterText; use App\Services\MasterAiGenerator; class FooterTextService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/footer/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldFooter = FooterText::where('user_id', $userId) ->where('language_id', $this->ai->getDefaultLanguageId()) ->first(); if ($oldFooter) { // Logo if ($oldFooter->logo && file_exists(public_path($this->imageStoragePath . $oldFooter->logo))) { @unlink(public_path($this->imageStoragePath . $oldFooter->logo)); } // Background image if ($oldFooter->bg_image && file_exists(public_path($this->imageStoragePath . $oldFooter->bg_image))) { @unlink(public_path($this->imageStoragePath . $oldFooter->bg_image)); } } FooterText::where('user_id', $userId) ->where('language_id', $this->ai->getDefaultLanguageId()) ->delete(); } $footerData = $this->getFooterData(); $aboutCompany = $this->ai->generateText($footerData['about_company_prompt']); $copyrightText = $this->ai->generateText($footerData['copyright_prompt']); $newsletterText = $this->ai->generateText($footerData['newsletter_prompt']); // Generate footer logo $logo = $this->ai->generateImage( $footerData['logo_prompt'], 146, 40, $this->imageStoragePath ); // Generate footer background image $bgImage = $this->ai->generateImage( $footerData['bg_image_prompt'], 1920, 400, $this->imageStoragePath ); FooterText::updateOrCreate( [ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), ], [ 'about_company' => $this->extractCleanText($aboutCompany), 'copyright_text' => $this->extractCleanText($copyrightText), 'newsletter_text' => $this->extractCleanText($newsletterText), 'logo' => $logo, 'bg_image' => $bgImage, 'footer_color' => '2C3E50', ] ); } private function getFooterData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $currentYear = date('Y'); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ 'about_company_prompt' => "You must return EXACTLY 12-15 words. No formatting, no explanation. Write a compelling 'About Company' footer text for {$businessName}. Describe: company mission, core values, and what makes the business unique in {$industry}. Use professional, concise language. Write in third person. Output: Plain text only, 12-15 words total. Context: {$baseContext}", 'copyright_prompt' => "You must return ONLY ONE copyright line. No formatting, no explanation. Generate a professional copyright text for {$businessName}. Format: © {$currentYear} [Company Name]. All Rights Reserved. Keep it simple and professional. Output: Just the copyright line, nothing else. Example: © {$currentYear} {$businessName}. All Rights Reserved.", 'newsletter_prompt' => "You must return EXACTLY 15-20 words. No formatting, no explanation. Write an engaging newsletter subscription text for {$businessName}. Encourage: email signup, staying updated, receiving exclusive content. Use inviting, action-oriented language. Output: Plain text only, 15-20 words. Good examples: Subscribe to our newsletter for latest updates and exclusive offers, Stay connected with our latest news and industry insights Context: {$baseContext}", 'logo_prompt' => "Professional minimalist logo design for {$businessName} representing {$industry} business, STYLE: clean modern geometric symbol or abstract lettermark based on company initials, simple distinctive shape with bold lines, flat 2D vector design, contemporary corporate identity, COMPOSITION: either iconic symbol only OR company name text with integrated icon mark, single or dual color scheme, professional brand mark, CRITICAL REQUIREMENTS: minimal design, NO photorealistic images, NO complex illustrations, NO 3D effects, scalable logo suitable for 200x60 pixel display, works on both light and dark backgrounds, memorable and recognizable at small sizes, vector-style clean edges", 'bg_image_prompt' => "Professional footer background pattern for {$industry} business website, subtle geometric design, dark elegant theme, modern corporate style, abstract professional texture, low opacity background suitable for text overlay", ]; } private function extractCleanText($text) { // Remove common AI response patterns $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/HomePage/TestimonialService.php 0000644 00000013651 15213350437 0016223 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\UserTestimonial; use App\Services\MasterAiGenerator; class TestimonialService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/testimonials/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate($includeImage = true) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldTestimonials = UserTestimonial::where('user_id', $userId)->get(); foreach ($oldTestimonials as $testimonial) { if ($testimonial->image && file_exists(public_path($this->imageStoragePath . $testimonial->image))) { @unlink(public_path($this->imageStoragePath . $testimonial->image)); } } UserTestimonial::where('user_id', $userId)->delete(); } $testimonialData = $this->getTestimonialData(); foreach ($testimonialData as $index => $data) { $name = $this->ai->generateText($data['name_prompt']); $content = $this->ai->generateText($data['content_prompt']); $testimonialInput = [ 'user_id' => $this->ai->getUserId(), 'lang_id' => $this->ai->getDefaultLanguageId(), 'name' => $this->extractCleanTitle($name), 'content' => $this->extractCleanTitle($content), 'occupation' => $data['occupation'], 'serial_number' => $index + 1, ]; // Generate image only if theme requires it if ($includeImage) { $image = $this->ai->generateImage( $data['image_prompt'], 300, 300, $this->imageStoragePath ); $testimonialInput['image'] = $image; } UserTestimonial::create($testimonialInput); } } private function getTestimonialData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional client name for a testimonial. Examples: John Anderson, Sarah Mitchell, Michael Chen, Emma Rodriguez Output: Just the name, nothing else.", 'content_prompt' => "You must return EXACTLY 15-20 words. No formatting, no quotes. Write a genuine, enthusiastic testimonial from a satisfied client of {$businessName}. Focus on: excellent service quality, professional team, and positive results. Use first-person perspective (I, we, our). Be specific and authentic. Output: Plain text only, 15-20 words. Context: {$baseContext}", 'occupation' => $this->generateOccupation($industry, 'CEO'), 'image_prompt' => "Professional headshot photo of a business CEO, confident and friendly expression, corporate attire, clean white or neutral background, high quality portrait photography, professional lighting", ], [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional client name for a testimonial. Output: Just the name, nothing else.", 'content_prompt' => "You must return EXACTLY 15-20 words. No formatting, no quotes. Write a genuine testimonial from a client praising {$businessName}'s expertise in {$industry}. Highlight: timely delivery, innovative solutions, and excellent communication. Use first-person perspective. Be specific and credible. Output: Plain text only, 15-20 words. Context: {$baseContext}", 'occupation' => $this->generateOccupation($industry, 'Marketing Director'), 'image_prompt' => "Professional business portrait of a marketing director, approachable smile, modern business casual attire, clean background, corporate photography style, natural professional lighting", ], [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional client name for a testimonial. Output: Just the name, nothing else.", 'content_prompt' => "You must return EXACTLY 15-20 words. No formatting, no quotes. Write an authentic testimonial praising {$businessName}'s customer service and reliability. Mention: responsive support, problem-solving ability, and long-term partnership value. Use first-person perspective. Sound genuine and detailed. Output: Plain text only, 15-20 words. Context: {$baseContext}", 'occupation' => $this->generateOccupation($industry, 'Operations Manager'), 'image_prompt' => "Professional headshot of a business operations manager, confident and professional demeanor, formal business attire, neutral clean background, high-end corporate portrait style", ], ]; } private function generateOccupation($industry, $defaultTitle) { $titles = [ 'CEO & Founder', 'Marketing Director', 'Operations Manager', 'Product Manager', 'Business Owner', 'Project Lead', 'Chief Technology Officer', 'Creative Director', 'Head of Digital', 'Managing Director' ]; return $titles[array_rand($titles)]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/HomePage/JobCategoryService.php 0000644 00000005263 15213350437 0016143 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\Jcategory; use App\Services\MasterAiGenerator; class JobCategoryService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { $categoryData = $this->getCategoryData(); // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); Jcategory::where('user_id', $userId)->delete(); } foreach ($categoryData as $index => $data) { $name = $this->ai->generateText($data['name_prompt']); Jcategory::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'name' => $this->extractCleanTitle($name), 'status' => 1, 'serial_number' => $index + 1, ]); } } private function getCategoryData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a job category name for technical/development positions in {$industry}. Examples: Software Development, IT & Technology, Engineering, Technical Services Output: Just the category name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a job category name for marketing positions in {$industry}. Examples: Marketing & Sales, Digital Marketing, Business Development Output: Just the category name, nothing else. Context: {$baseContext}", ], [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a job category name for design/creative positions in {$industry}. Examples: Design & Creative, UI UX Design, Creative Services Output: Just the category name, nothing else. Context: {$baseContext}", ], ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/HomePage/BrandService.php 0000644 00000004505 15213350437 0014757 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\Brand; use App\Services\MasterAiGenerator; use Illuminate\Support\Facades\Auth; class BrandService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/brands/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldBrands = Brand::where('user_id', $userId)->get(); foreach ($oldBrands as $brand) { if ($brand->brand_img && file_exists(public_path($this->imageStoragePath . $brand->brand_img))) { @unlink(public_path($this->imageStoragePath . $brand->brand_img)); } } Brand::where('user_id', $userId)->delete(); } $brandData = $this->getBrandData(); foreach ($brandData as $index => $data) { $brandImage = $this->ai->generateImage( $data['image_prompt'], 400, 150, $this->imageStoragePath ); Brand::create([ 'user_id' => $this->ai->getUserId(), 'brand_img' => $brandImage, 'brand_url' => $data['url'], 'serial_number' => $index + 1, ]); } } private function getBrandData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'image_prompt' => "Professional minimalist logo design for a partner brand in {$industry} industry, clean and modern style, white background, high quality corporate branding, simple geometric shapes", 'url' => '#', ], [ 'image_prompt' => "Premium tech company logo design related to {$industry} sector, modern typography, professional business branding, white or light background, clean minimalist style", 'url' => '#', ], [ 'image_prompt' => "Corporate brand logo for {$industry} partner company, elegant and professional design, simple icon with text, white background, business quality branding", 'url' => '#', ], ]; } } Services/AiWebsite/HomePage/JobService.php 0000644 00000034654 15213350437 0014453 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\Job; use App\Models\User\Jcategory; use App\Services\AiWebsite\HomePage\JobCategoryService; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; use Carbon\Carbon; class JobService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old job records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); Job::where('user_id', $userId)->delete(); } // Get first available job category $category = Jcategory::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->first(); if (!$category) { // Generate categories first if none exist $categoryService = new JobCategoryService($this->ai); $categoryService->generate(); $category = Jcategory::where('user_id', $this->ai->getUserId())->first(); } $jobData = $this->getJobData($category->id); foreach ($jobData as $index => $data) { $title = $this->ai->generateText($data['title_prompt']); $cleanTitle = $this->extractCleanTitle($title); $responsibilities = $this->ai->generateText($data['responsibilities_prompt']); $education = $this->ai->generateText($data['education_prompt']); $experienceReq = $this->ai->generateText($data['experience_req_prompt']); $additional = $this->ai->generateText($data['additional_prompt']); $benefits = $this->ai->generateText($data['benefits_prompt']); $readBefore = $this->ai->generateText($data['read_before_prompt']); Job::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'jcategory_id' => $data['category_id'], 'title' => $cleanTitle, 'slug' => Str::slug($cleanTitle) . '-' . time() . '-' . rand(100, 999), 'vacancy' => $data['vacancy'], 'deadline' => $data['deadline'], 'experience' => $data['experience'], 'employment_status' => $data['employment_status'], 'job_location' => $data['job_location'], 'salary' => $data['salary'], 'email' => $data['email'], 'job_responsibilities' => $this->extractCleanText($responsibilities), 'educational_requirements' => $this->extractCleanText($education), 'experience_requirements' => $this->extractCleanText($experienceReq), 'additional_requirements' => $this->extractCleanText($additional), 'benefits' => $this->extractCleanText($benefits), 'read_before_apply' => $this->extractCleanText($readBefore), 'serial_number' => $index + 1, 'meta_keywords' => $cleanTitle . ', ' . $data['employment_status'] . ', ' . $data['job_location'], 'meta_description' => substr($this->extractCleanText($responsibilities), 0, 155), ]); } } private function getJobData($categoryId) { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; // Generate deadlines 30-60 days from now $deadline1 = Carbon::now()->addDays(45)->format('Y-m-d'); $deadline2 = Carbon::now()->addDays(40)->format('Y-m-d'); $deadline3 = Carbon::now()->addDays(50)->format('Y-m-d'); return [ [ 'category_id' => $categoryId, 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a professional job title for a senior position in {$industry}. Examples: Senior Software Engineer, Marketing Manager, UX Design Lead Output: Just the job title, nothing else. Context: {$baseContext}", 'vacancy' => rand(2, 5), 'deadline' => $deadline1, 'experience' => '3-5 years', 'employment_status' => 'Full Time', 'job_location' => 'Remote / Hybrid', 'salary' => 'Competitive (Based on Experience)', 'email' => 'careers@' . strtolower(str_replace(' ', '', $businessName)) . '.com', 'responsibilities_prompt' => "You must return EXACTLY 60-80 words in bullet point format. No formatting symbols. Write key job responsibilities for a senior position in {$industry}. Include: leadership duties, technical/strategic tasks, team collaboration, project management. Format: Write as plain text with line breaks, no asterisks or dashes. Context: {$baseContext}", 'education_prompt' => "You must return EXACTLY 25-35 words. No formatting. Write educational requirements for a senior position. Include: degree level, relevant fields, certifications. Output: Plain text only. Context: {$baseContext}", 'experience_req_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write experience requirements for 3-5 years experience level. Include: relevant industry experience, technical skills, proven track record. Output: Plain text only. Context: {$baseContext}", 'additional_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write additional requirements like soft skills, technical proficiencies, language skills. Output: Plain text only. Context: {$baseContext}", 'benefits_prompt' => "You must return EXACTLY 40-50 words in list format. No formatting symbols. Write employee benefits for this position. Include: health insurance, paid leave, professional development, flexible work. Format: Plain text with line breaks, no bullets. Context: {$baseContext}", 'read_before_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write application instructions and what candidates should prepare. Include: required documents, application process, timeline. Output: Plain text only.", ], [ 'category_id' => $categoryId, 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a professional job title for a mid-level position in {$industry}. Examples: Project Manager, Digital Marketing Specialist, Frontend Developer Output: Just the job title, nothing else. Context: {$baseContext}", 'vacancy' => rand(3, 6), 'deadline' => $deadline2, 'experience' => '2-4 years', 'employment_status' => 'Full Time', 'job_location' => 'On-site', 'salary' => 'Negotiable', 'email' => 'hr@' . strtolower(str_replace(' ', '', $businessName)) . '.com', 'responsibilities_prompt' => "You must return EXACTLY 60-80 words in bullet point format. No formatting symbols. Write key job responsibilities for a mid-level position in {$industry}. Include: day-to-day tasks, collaboration, deliverables, quality standards. Format: Write as plain text with line breaks, no asterisks or dashes. Context: {$baseContext}", 'education_prompt' => "You must return EXACTLY 25-35 words. No formatting. Write educational requirements for a mid-level position. Include: degree requirements, relevant fields. Output: Plain text only. Context: {$baseContext}", 'experience_req_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write experience requirements for 2-4 years experience level. Include: relevant experience, demonstrated skills, project involvement. Output: Plain text only. Context: {$baseContext}", 'additional_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write additional requirements focusing on technical and communication skills. Output: Plain text only. Context: {$baseContext}", 'benefits_prompt' => "You must return EXACTLY 40-50 words in list format. No formatting symbols. Write employee benefits package. Include: insurance, bonuses, training opportunities, work-life balance perks. Format: Plain text with line breaks, no bullets. Context: {$baseContext}", 'read_before_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write clear application instructions. Output: Plain text only.", ], [ 'category_id' => $categoryId, 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a professional job title for a junior position in {$industry}. Examples: Junior Developer, Marketing Assistant, Customer Support Executive Output: Just the job title, nothing else. Context: {$baseContext}", 'vacancy' => rand(4, 8), 'deadline' => $deadline3, 'experience' => '1-2 years', 'employment_status' => 'Full Time', 'job_location' => 'Hybrid', 'salary' => 'As per company policy', 'email' => 'jobs@' . strtolower(str_replace(' ', '', $businessName)) . '.com', 'responsibilities_prompt' => "You must return EXACTLY 60-80 words in bullet point format. No formatting symbols. Write key job responsibilities for a junior position in {$industry}. Include: learning opportunities, support tasks, basic duties, team assistance. Format: Write as plain text with line breaks, no asterisks or dashes. Context: {$baseContext}", 'education_prompt' => "You must return EXACTLY 25-35 words. No formatting. Write educational requirements for a junior position. Include: minimum degree, fresh graduates welcome. Output: Plain text only. Context: {$baseContext}", 'experience_req_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write experience requirements for 1-2 years or fresh graduates. Include: internships count, willingness to learn, basic skills. Output: Plain text only. Context: {$baseContext}", 'additional_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write additional requirements focusing on attitude, learning ability, teamwork. Output: Plain text only. Context: {$baseContext}", 'benefits_prompt' => "You must return EXACTLY 40-50 words in list format. No formatting symbols. Write benefits emphasizing growth opportunities and learning. Include: training programs, mentorship, career growth, standard benefits. Format: Plain text with line breaks, no bullets. Context: {$baseContext}", 'read_before_prompt' => "You must return EXACTLY 30-40 words. No formatting. Write welcoming application instructions for junior candidates. Output: Plain text only.", ], ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/HomePage/FooterQuickLinkService.php 0000644 00000006441 15213350437 0017003 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\FooterQuickLink; use App\Services\MasterAiGenerator; class FooterQuickLinkService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // Delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); FooterQuickLink::where('user_id', $userId)->delete(); } $quickLinkData = $this->getQuickLinkData(); foreach ($quickLinkData as $index => $data) { $title = $this->ai->generateText($data['title_prompt']); FooterQuickLink::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'title' => $this->extractCleanTitle($title), 'url' => $data['url'], 'serial_number' => $index + 1, ]); } } private function getQuickLinkData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'title_prompt' => "You must return ONLY 1-2 words. No formatting, no explanation. Generate a quick link title for 'About' page. Examples: About Us, Our Story, Company Info, Who We Are Output: Just 1-2 words, nothing else.", 'url' => '/about', ], [ 'title_prompt' => "You must return ONLY 1-2 words. No formatting, no explanation. Generate a quick link title for services page for {$industry} business. Examples: Our Services, Services, What We Do, Solutions Output: Just 1-2 words, nothing else. Context: {$baseContext}", 'url' => '/services', ], [ 'title_prompt' => "You must return ONLY 1-2 words. No formatting, no explanation. Generate a quick link title for portfolio/projects page. Examples: Portfolio, Our Work, Projects, Case Studies Output: Just 1-2 words, nothing else.", 'url' => '/portfolio', ], [ 'title_prompt' => "You must return ONLY 1-2 words. No formatting, no explanation. Generate a quick link title for contact page. Examples: Contact Us, Contact, Get in Touch, Reach Us Output: Just 1-2 words, nothing else.", 'url' => '/contact', ], [ 'title_prompt' => "You must return ONLY 1-2 words. No formatting, no explanation. Generate a quick link title for careers/jobs page. Examples: Careers, Join Us, Jobs, Work With Us Output: Just 1-2 words, nothing else.", 'url' => '/careers', ], ]; } private function extractCleanTitle($text) { // Remove common AI response patterns $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/HomePage/HeroSliderService.php 0000644 00000014456 15213350437 0015777 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\HeroSlider; use App\Services\MasterAiGenerator; class HeroSliderService { protected $ai; protected $imageStoragePath = 'assets/front/img/hero_slider/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldSliders = HeroSlider::where('user_id', $userId)->get(); foreach ($oldSliders as $slider) { if ($slider->img && file_exists(public_path($this->imageStoragePath . $slider->img))) { unlink(public_path($this->imageStoragePath . $slider->img)); } } HeroSlider::where('user_id', $userId)->delete(); } $width = 1920; $height = 925; $prompts = $this->getPrompts(); foreach ($prompts as $index => $prompt) { $title = $this->ai->generateText($prompt['text_prompt']); $subtitle = $this->ai->generateText($prompt['subtitle_prompt']); $image = $this->ai->generateImage($prompt['image_prompt'], $width, $height, $this->imageStoragePath); HeroSlider::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'img' => $image, 'title' => $title, 'subtitle' => $subtitle, 'btn_name' => $index === 0 ? 'Get Started Today' : 'Contact Our Team', 'btn_url' => $index === 0 ? '/register' : '/contact', 'serial_number' => $index + 1, ]); } } private function getPrompts() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $theme = $this->ai->getTheme(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; $commonTexts = [ [ 'text_prompt' => "Write a bold, attention-grabbing 2-3 word hero slider title for {$businessName} that instantly communicates excellence and trust. Context: {$baseContext}", 'subtitle_prompt' => "Write a powerful 6-7 word subtitle highlighting the core benefit and unique value. Context: {$baseContext}", ], [ 'text_prompt' => "Create an emotional hero title (2-3 words) focused on customer success and long-term partnership. Context: {$baseContext}", 'subtitle_prompt' => "Write a benefit-driven subtitle (6-7 words) mentioning reliability, expertise, and why businesses trust this company. Context: {$baseContext}", ], ]; // Theme-specific image prompts $imagePrompts = []; if ($theme === 'home_nine') { $imagePrompts = [ "Luxurious modern tropical villa on a lush hillside at golden hour sunset, infinity swimming pool in foreground reflecting warm sky, elegant red-orange tiled roofs with clean white walls, expansive floor-to-ceiling sliding glass doors fully open to outdoor living area with modern lounge furniture, dense green jungle and palm trees surrounding, high-end Bali or Phuket resort architecture, bright natural lighting with soft clouds, ultra realistic architectural photography, sharp focus, highly detailed, cinematic composition, 8k resolution, professional DSLR quality", "Stunning ocean-view luxury villa exterior at dusk, private infinity pool with underwater lights glowing, contemporary tropical design with warm wood accents and large open terrace, comfortable outdoor seating and dining area, lush tropical landscaping, soft ambient lighting from villa interior spilling out, serene and inviting atmosphere, photorealistic, high detail, sharp focus, golden hour mixed with early evening lights, professional real estate photography style" ]; } elseif ($theme === 'home_eight') { $imagePrompts = [ "Modern minimalist office interior with large windows overlooking city skyline at sunset, sleek glass desk with MacBook and creative tools, diverse team of young professionals collaborating happily, warm natural light mixed with modern LED accents, clean lines and neutral tones, high-tech creative agency vibe, ultra sharp, photorealistic corporate photography, cinematic depth of field", "Futuristic {$industry} workspace with open-plan layout, collaborative team of professionals brainstorming at glass whiteboard, large digital screens displaying data visualizations, plants and natural wood elements, bright daylight from floor-to-ceiling windows, innovative and energetic atmosphere, professional architectural photography, highly detailed, sharp focus" ]; } else { $imagePrompts = [ "ultra high definition corporate photography 1920x925, professional business team of 2 people (1 men in navy suits, 1 women in gray blazers) sitting at conference table, DSLR camera quality, macro lens facial details, individual unique faces with distinct features, realistic skin pores and texture, sharp eyes with detailed iris, natural human imperfections, professional studio lighting, depth of field with sharp focus on faces, photorealistic portrait quality, Canon EOS R5 style, 50mm f/1.8, hyperrealistic human faces, detailed eye reflection, natural skin blemishes, individual unique facial structure, sharp eyelashes --avoid: soft focus, airbrushed skin, plastic appearance, clone faces, uniform features, blurry eyes, synthetic look", "1920x925 ultra HD corporate photography, modern {$industry} office, professional business meeting, 1 male executives in navy suits with short hair and 1 female executives in blazers with long hair, sitting around conference table, realistic human faces with clear features, detailed facial anatomy, natural skin tones, sharp focus, professional lighting, photorealistic quality, --avoid blurry, asymmetrical faces, distorted anatomy, cloned face, poorly drawn features" ]; } // Build final prompts array $sliderPrompts = []; foreach ($commonTexts as $index => $text) { $sliderPrompts[] = [ 'text_prompt' => $text['text_prompt'], 'subtitle_prompt' => $text['subtitle_prompt'], 'image_prompt' => $imagePrompts[$index] ?? $imagePrompts[0], ]; } return $sliderPrompts; } } Services/AiWebsite/HomePage/SkillService.php 0000644 00000006675 15213350437 0015021 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\Skill; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; class SkillService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); Skill::where('user_id', $userId)->delete(); } $skillData = $this->getSkillData(); foreach ($skillData as $index => $data) { $title = $this->ai->generateText($data['title_prompt']); $cleanTitle = $this->extractCleanTitle($title); Skill::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'icon' => $data['icon'], 'title' => $cleanTitle, 'slug' => Str::slug($cleanTitle), 'percentage' => $data['percentage'], 'color' => $data['color'], 'serial_number' => $index + 1, ]); } } private function getSkillData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; $colors = ['FF6B6B', '4ECDC4', '45B7D1', 'FFA07A', '98D8C8', 'F7DC6F']; return [ [ 'title_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a primary skill name for {$industry} industry. Examples: Web Development, Digital Marketing, Project Management, UI UX Design Context: {$baseContext}", 'icon' => 'fas fa-code', 'percentage' => rand(85, 98), 'color' => $colors[0], ], [ 'title_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a core technical skill for {$industry} business. Examples: Data Analysis, Cloud Solutions, Mobile Development, API Integration Context: {$baseContext}", 'icon' => 'fas fa-chart-line', 'percentage' => rand(80, 95), 'color' => $colors[1], ], [ 'title_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a strategic skill for {$industry} company. Examples: Business Strategy, Brand Identity, SEO Optimization, Content Creation Context: {$baseContext}", 'icon' => 'fas fa-lightbulb', 'percentage' => rand(75, 92), 'color' => $colors[2], ], [ 'title_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a customer-facing skill for {$industry} sector. Examples: Client Relations, Customer Support, Quality Assurance, User Experience Context: {$baseContext}", 'icon' => 'fas fa-users', 'percentage' => rand(85, 97), 'color' => $colors[3], ], ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/HomePage/MemberService.php 0000644 00000022513 15213350437 0015137 0 ustar 00 <?php namespace App\Services\AiWebsite\HomePage; use App\Models\User\Member; use App\Services\MasterAiGenerator; class MemberService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/team/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldMembers = Member::where('user_id', $userId)->get(); foreach ($oldMembers as $member) { if ($member->image && file_exists(public_path($this->imageStoragePath . $member->image))) { @unlink(public_path($this->imageStoragePath . $member->image)); } } Member::where('user_id', $userId)->delete(); } $memberData = $this->getMemberData(); foreach ($memberData as $index => $data) { $name = $this->ai->generateText($data['name_prompt']); $rank = $this->ai->generateText($data['rank_prompt']); // Generate professional team member photo $image = $this->ai->generateImage( $data['image_prompt'], 400, 400, $this->imageStoragePath ); Member::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'name' => $this->extractCleanTitle($name), 'rank' => $this->extractCleanTitle($rank), 'image' => $image, 'facebook' => $data['facebook'], 'twitter' => $data['twitter'], 'instagram' => $data['instagram'], 'linkedin' => $data['linkedin'], 'featured' => $data['featured'], ]); } } private function getMemberData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; $qualityEnhancer = ", shot with professional DSLR camera, 85mm portrait lens, hyperrealistic facial details, sharp focus on eyes, natural skin texture with pores, individual unique faces, detailed iris and pupils, realistic human imperfections, studio quality lighting"; $negativePrompt = ", AVOID: soft blurry faces, plastic skin, airbrushed look, cloned faces, synthetic appearance, uniform features, doll-like skin, low detail eyes"; return [ [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional name for a CEO/Founder. Examples: David Anderson, Sarah Mitchell, Michael Chen, Emma Thompson Output: Just the name, nothing else.", 'rank_prompt' => "You must return ONLY a job title (2-4 words). No formatting, no explanation. Generate a CEO/Founder title for {$industry} company. Examples: CEO & Founder, Chief Executive Officer, Founder & President Output: Just the title, nothing else. Context: {$baseContext}", 'image_prompt' => "Professional corporate headshot of a CEO, confident executive appearance, formal business suit, neutral clean background, high-end professional photography, studio lighting, sharp focus" . $qualityEnhancer . $negativePrompt, 'facebook' => 'https://facebook.com', 'twitter' => 'https://twitter.com', 'instagram' => 'https://instagram.com', 'linkedin' => 'https://linkedin.com', 'featured' => 1, ], [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional name for a CTO/Technology lead. Output: Just the name, nothing else.", 'rank_prompt' => "You must return ONLY a job title (2-4 words). No formatting, no explanation. Generate a CTO/Technology title for {$industry} company. Examples: Chief Technology Officer, CTO, Head of Technology, Technology Director Output: Just the title, nothing else. Context: {$baseContext}", 'image_prompt' => "Professional business portrait of a CTO, intelligent and innovative appearance, smart business casual attire, modern office background, professional corporate photography, natural lighting" . $qualityEnhancer . $negativePrompt, 'facebook' => 'https://facebook.com', 'twitter' => 'https://twitter.com', 'instagram' => 'https://instagram.com', 'linkedin' => 'https://linkedin.com', 'featured' => 1, ], [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional name for a Marketing Director. Output: Just the name, nothing else.", 'rank_prompt' => "You must return ONLY a job title (2-4 words). No formatting, no explanation. Generate a Marketing leadership title for {$industry} company. Examples: Marketing Director, Head of Marketing, CMO, Chief Marketing Officer Output: Just the title, nothing else. Context: {$baseContext}", 'image_prompt' => "Professional headshot of a marketing director, creative and approachable expression, stylish business attire, clean professional background, corporate portrait photography, soft lighting" . $qualityEnhancer . $negativePrompt, 'facebook' => 'https://facebook.com', 'twitter' => 'https://twitter.com', 'instagram' => 'https://instagram.com', 'linkedin' => 'https://linkedin.com', 'featured' => 1, ], [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional name for an Operations Manager. Output: Just the name, nothing else.", 'rank_prompt' => "You must return ONLY a job title (2-4 words). No formatting, no explanation. Generate an Operations leadership title for {$industry} company. Examples: Operations Manager, Head of Operations, Operations Director, COO Output: Just the title, nothing else. Context: {$baseContext}", 'image_prompt' => "Professional business photo of operations manager, competent and organized demeanor, professional business clothing, neutral office background, high quality corporate headshot, professional lighting" . $qualityEnhancer . $negativePrompt, 'facebook' => 'https://facebook.com', 'twitter' => 'https://twitter.com', 'instagram' => 'https://instagram.com', 'linkedin' => 'https://linkedin.com', 'featured' => 0, ], [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional name for a Creative Director. Output: Just the name, nothing else.", 'rank_prompt' => "You must return ONLY a job title (2-4 words). No formatting, no explanation. Generate a Creative leadership title for {$industry} company. Examples: Creative Director, Head of Design, Chief Creative Officer, Design Lead Output: Just the title, nothing else. Context: {$baseContext}", 'image_prompt' => "Professional portrait of creative director, artistic and professional appearance, modern casual business style, contemporary office setting, creative industry photography, natural professional lighting" . $qualityEnhancer . $negativePrompt, 'facebook' => 'https://facebook.com', 'twitter' => 'https://twitter.com', 'instagram' => 'https://instagram.com', 'linkedin' => 'https://linkedin.com', 'featured' => 0, ], [ 'name_prompt' => "You must return ONLY a realistic full name (2-3 words). No formatting, no explanation. Generate a professional name for a Customer Success Manager. Output: Just the name, nothing else.", 'rank_prompt' => "You must return ONLY a job title (2-4 words). No formatting, no explanation. Generate a Customer Success title for {$industry} company. Examples: Customer Success Manager, Head of Customer Experience, Client Relations Director Output: Just the title, nothing else. Context: {$baseContext}", 'image_prompt' => "Professional headshot of customer success manager, friendly and trustworthy expression, professional business attire, clean background, corporate quality photography, warm professional lighting" . $qualityEnhancer . $negativePrompt, 'facebook' => 'https://facebook.com', 'twitter' => 'https://twitter.com', 'instagram' => 'https://instagram.com', 'linkedin' => 'https://linkedin.com', 'featured' => 0, ], ]; } private function extractCleanTitle($text) { // Remove common AI response patterns $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/DonationManagement/DonationCategoryService.php 0000644 00000016642 15213350437 0021272 0 ustar 00 <?php namespace App\Services\AiWebsite\DonationManagement; use App\Models\User\DonationManagement\DonationCategories; use App\Models\User\Language; use App\Models\User\BasicSetting; use App\Services\MasterAiGenerator; use App\Constants\Constant; class DonationCategoryService { protected $ai; protected $imagePath = 'assets/tenant/image/cause/category/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(int $count = 4) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldCategories = DonationCategories::where('user_id', $userId)->get(); foreach ($oldCategories as $category) { if ($category->image && file_exists(public_path($this->imagePath . $category->image))) { @unlink(public_path($this->imagePath . $category->image)); } } DonationCategories::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $defaultLangId = $this->ai->getDefaultLanguageId(); $language = Language::where('id', $defaultLangId) ->where('user_id', $userId) ->first(); if (!$language) { return; } $userBs = BasicSetting::query() ->select('theme') ->where('user_id', $userId) ->first(); $theme = $userBs->theme ?? null; $definitions = $this->getCategoryDefinitions($count); $serial = 1; foreach ($definitions as $def) { $imageName = $this->ai->generateImage( $def['image_prompt'], 600, 400, $this->imagePath, ); $rawName = $this->ai->generateText($def['name_prompt']); $rawShort = $this->ai->generateText($def['short_prompt']); $name = $this->cleanLine($rawName, 80); $shortDesc = $this->cleanText($rawShort, 200); $slug = make_slug($name); $isFeaturedFlag = $def['is_featured'] && $theme === 'home_eleven' ? 1 : 0; DonationCategories::create([ 'language_id' => $language->id, 'user_id' => $userId, 'name' => $name, 'short_description' => $shortDesc, 'icon' => $def['icon'], 'status' => 1, 'is_featured' => $isFeaturedFlag, 'serial_number' => $serial++, 'image' => $imageName, 'slug' => $slug, ]); } } private function getCategoryDefinitions(int $count): array { $businessName = $this->ai->getBusinessName(); $baseContext = "{$businessName} runs donation campaigns for social impact. Generate clear, donor‑friendly cause categories."; $base = [ [ 'icon' => 'fas fa-graduation-cap', 'is_featured' => true, 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a donation category name for education support. Examples: Education For All, Children’s Education, School Support Output: Just the name, nothing else. Context: {$baseContext}", 'short_prompt' => "You must return 8-10 words. No formatting, no explanation. Write a short description for an education-related donation category. Focus on: helping children study, access to schools, learning materials. Output: Plain text only, 8-10 words. Context: {$baseContext}", 'image_prompt' => "Donation campaign banner for education, children learning in classroom, hopeful atmosphere, charity illustration or photo, warm colors", ], [ 'icon' => 'fas fa-heartbeat', 'is_featured' => true, 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a donation category name for healthcare and medical aid. Examples: Health & Medical Aid, Emergency Medical Help, Save Lives Fund Output: Just the name, nothing else. Context: {$baseContext}", 'short_prompt' => "You must return 8-10 words. No formatting, no explanation. Write a short description for a health and medical support donation category. Focus on: treatments, medicines, emergency care. Output: Plain text only, 8-10 words. Context: {$baseContext}", 'image_prompt' => "Charity campaign image for medical aid, doctors helping patients, hospital or clinic context, caring and compassionate tone", ], [ 'icon' => 'fas fa-utensils', 'is_featured' => true, 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a donation category name for food & hunger relief. Examples: Hunger Relief, Feed The Hungry, Food Support Output: Just the name, nothing else. Context: {$baseContext}", 'short_prompt' => "You must return 8-10 words. No formatting, no explanation. Write a short description for a food and hunger relief donation category. Focus on: meals, vulnerable families, regular food support. Output: Plain text only, 8-10 words. Context: {$baseContext}", 'image_prompt' => "Donation banner showing food distribution, volunteers serving meals, humanitarian aid scene, hopeful tone", ], [ 'icon' => 'fas fa-globe', 'is_featured' => true, 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a donation category name for environment and clean water. Examples: Clean Water Project, Environment & Climate, Safe Drinking Water Output: Just the name, nothing else. Context: {$baseContext}", 'short_prompt' => "You must return 8-10 words. No formatting, no explanation. Write a short description for an environment or clean water donation category. Focus on: safe water, community projects, nature protection. Output: Plain text only, 8-10 words. Context: {$baseContext}", 'image_prompt' => "Charity campaign illustration for clean water and environment, children with water pumps, nature elements, positive impact visual", ], ]; $result = []; for ($i = 0; $i < min($count, count($base)); $i++) { $result[] = $base[$i]; } return $result; } private function cleanLine(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } private function cleanText(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } } Services/AiWebsite/DonationManagement/DonationCauseService.php 0000644 00000017260 15213350437 0020552 0 ustar 00 <?php namespace App\Services\AiWebsite\DonationManagement; use App\Models\User\DonationManagement\Donation; use App\Models\User\DonationManagement\DonationContent; use App\Models\User\DonationManagement\DonationCategories; use App\Models\User\Language; use App\Services\MasterAiGenerator; class DonationCauseService { protected $ai; protected $imagePath = 'assets/tenant/image/cause/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(int $count = 3) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldDonations = Donation::where('user_id', $userId)->get(); foreach ($oldDonations as $donation) { if ($donation->image && file_exists(public_path($this->imagePath . $donation->image))) { @unlink(public_path($this->imagePath . $donation->image)); } } DonationContent::whereHas('donation', function ($q) use ($userId) { $q->where('user_id', $userId); })->delete(); Donation::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $defaultLangId = $this->ai->getDefaultLanguageId(); $language = Language::where('id', $defaultLangId) ->where('user_id', $userId) ->first(); if (!$language) { return; } $categories = DonationCategories::where('user_id', $userId) ->where('language_id', $defaultLangId) ->get(); if ($categories->isEmpty()) { return; } $defs = $this->getCauseDefinitions($count); foreach ($defs as $def) { $imageName = $this->ai->generateImage( $def['image_prompt'], 800, 500, $this->imagePath ); $goal = $def['goal_amount']; $min = $def['min_amount']; $custom = $def['custom_amount']; $donation = Donation::create([ 'user_id' => $userId, 'goal_amount' => $goal, 'min_amount' => $min, 'custom_amount' => $custom, 'image' => $imageName, ]); $prompts = $this->getContentPrompts(); $rawTitle = $this->ai->generateText($prompts['title_prompt']); $title = $this->cleanLine($rawTitle, 120); $slug = make_slug($title); $rawContent = $this->ai->generateText($prompts['content_prompt']); $content = $this->cleanText($rawContent, 900); $rawMetaKw = $this->ai->generateText($prompts['meta_keywords_prompt']); $metaKw = $this->cleanText($rawMetaKw, 200); $rawMetaDs = $this->ai->generateText($prompts['meta_description_prompt']); $metaDs = $this->cleanText($rawMetaDs, 200); DonationContent::create([ 'user_id' => $userId, 'language_id' => $defaultLangId, 'donation_id' => $donation->id, 'donation_category_id' => $categories->random()->id, 'title' => $title, 'slug' => $slug, 'content' => $content, 'meta_keywords' => $metaKw, 'meta_description' => $metaDs, ]); } } private function getCauseDefinitions(int $count): array { $base = [ [ 'goal_amount' => 5000, 'min_amount' => 10, 'custom_amount' => 10, 'image_prompt' => "Photorealistic charity image, sharp focus on children's clear faces with detailed eyes and natural skin texture, South Asian children in bright classroom smiling hopefully, individual unique facial features visible, shot on Canon EOS R5 85mm f/1.8 portrait lens, 8K UHD hyperrealistic, crisp iris details, soft natural daylight, donation banner style, warm hopeful tones", ], [ 'goal_amount' => 8000, 'min_amount' => 20, 'custom_amount' => 30, 'image_prompt' => "Hyperrealistic medical fundraising hero image, doctor's face ultra sharp with clear eyes and realistic skin pores, helping smiling patient in modern hospital, distinct facial features on both, professional Canon 50mm lens f/1.4 shot, 4K detailed textures, natural hospital lighting, urgent yet positive mood, perfect focus on faces", ], [ 'goal_amount' => 3000, 'min_amount' => 5, 'custom_amount' => 80, 'image_prompt' => "Realistic food donation banner, volunteers' faces highly detailed with sharp eyes and natural expressions while distributing meals to grateful families, warm skin tones visible, shot with professional DSLR 85mm lens, 8K resolution crisp details, humanitarian charity style, soft golden hour lighting, clear individual facial identities", ], ]; return array_slice($base, 0, $count); } private function getContentPrompts(): array { $businessName = $this->ai->getBusinessName(); $baseContext = "{$businessName} is running a fundraising campaign for people in need."; $titleVariations = [ "urgent and emotional appeal", "hopeful and inspiring tone", "story-driven and personal", "direct and action-oriented", "community-focused and warm", "crisis response style", "long-term impact focused", "children and education centered", "medical emergency style", "hunger and basic needs" ]; $style = $titleVariations[array_rand($titleVariations)]; $extraKeywords = [ "children in poverty", "life-saving surgery", "disaster victims", "hungry families", "clean water project", "orphan education", "cancer patients", "refugee support", "elderly care", "animal rescue" ]; $keyword = $extraKeywords[array_rand($extraKeywords)]; return [ 'title_prompt' => "Generate a UNIQUE and compelling donation cause title in 6-10 words only. Style: {$style} Focus on: {$keyword} Make it different from these previous titles: Help Children Go To School, Provide Medical Treatment, Feed Hungry Families Context: {$baseContext} Rules: - ONLY the title - No quotes, no numbering, no explanation - Must be emotional and clickable Example: Save a Child's Dream of Education Today Output only the title:", 'content_prompt' => "Write a 140-200 word fundraising story. Focus area: {$keyword} Tone: {$style} Include real emotional story, specific need, exact use of funds, urgency. Context: {$baseContext} Output plain text only.", 'meta_keywords_prompt' => "Generate 6-8 SEO keywords including: donation, charity, {$keyword}", 'meta_description_prompt' => "Write 145-155 char meta description. Include urgency about {$keyword}. Context: {$baseContext}", ]; } private function cleanLine(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } private function cleanText(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } } Services/AiWebsite/WhyChooseUsItemService.php 0000644 00000012022 15213350437 0015274 0 ustar 00 <?php namespace App\Services\AiWebsite; use Illuminate\Support\Facades\DB; use App\Services\MasterAiGenerator; class WhyChooseUsItemService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // Delete old Why Choose Us item records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); DB::table('user_choose_us_items') ->where('user_id', $userId) ->delete(); } $items = $this->getItemDefinitions(); foreach ($items as $index => $def) { $rawTitle = $this->ai->generateText($def['title_prompt']); $rawContent = $this->ai->generateText($def['content_prompt']); $title = $this->extractCleanTitle($rawTitle); $content = $this->extractCleanText($rawContent); DB::table('user_choose_us_items')->insert([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'icon' => $def['icon'], 'title' => $title, 'content' => $content, 'serial_number' => $index + 1, 'created_at' => now(), 'updated_at' => now(), ]); } } /** * Prompt definitions for each Why Choose Us item. */ private function getItemDefinitions(): array { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'icon' => 'fas fa-award', 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a strong benefit-based title for a 'Why Choose Us' item highlighting experience and proven results for {$businessName} in {$industry}. Examples: Years Of Proven Experience, Trusted Industry Experts, Consistent Quality Results Output: Just the title text, nothing else. Context: {$baseContext}", 'content_prompt' => "You must return EXACTLY 10-15 words. No formatting, no explanation. Write a short paragraph explaining why {$businessName}'s experience and track record make it a reliable choice in {$industry}. Focus on: years in business, successful projects, client satisfaction. Output: Plain text only, 10-15 words. Context: {$baseContext}", ], [ 'icon' => 'fas fa-users-cog', 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a benefit-based title for a 'Why Choose Us' item about expert, dedicated team. Examples: Expert Dedicated Team, Skilled Professionals Only, Passionate Industry Specialists Output: Just the title text, nothing else. Context: {$baseContext}", 'content_prompt' => "You must return EXACTLY 10-15 words. No formatting, no explanation. Write a short paragraph describing the expertise, skills, and dedication of {$businessName}'s team. Mention: qualified professionals, diverse skills, client-focused mindset. Output: Plain text only, 10-15 words. Context: {$baseContext}", ], [ 'icon' => 'fas fa-handshake', 'title_prompt' => "You must return ONLY 3-5 words. No formatting, no explanation. Generate a title for a 'Why Choose Us' item about client-focused service and support. Examples: Client First Approach, Reliable Ongoing Support, Your Success Our Priority Output: Just the title text, nothing else. Context: {$baseContext}", 'content_prompt' => "You must return EXACTLY 10-15 words. No formatting, no explanation. Write a paragraph showing how {$businessName} cares about clients, supports them, and builds long-term relationships. Emphasize: communication, responsiveness, understanding client needs. Output: Plain text only, 10-15 words. Context: {$baseContext}", ], ]; } private function extractCleanTitle(string $text): string { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = trim($text); if (strlen($text) > 60) { $text = substr($text, 0, 60); } return $text; } private function extractCleanText(string $text): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]">]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/BasicSettingService.php 0000644 00000013552 15213350437 0014625 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\BasicSetting; use App\Services\MasterAiGenerator; class BasicSettingService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldSetting = BasicSetting::where('user_id', $userId)->first(); if ($oldSetting) { // Favicon if ($oldSetting->favicon && file_exists(public_path($this->imageStoragePath . $oldSetting->favicon))) { @unlink(public_path($this->imageStoragePath . $oldSetting->favicon)); } // Logo if ($oldSetting->logo && file_exists(public_path($this->imageStoragePath . $oldSetting->logo))) { @unlink(public_path($this->imageStoragePath . $oldSetting->logo)); } // Breadcrumb if ($oldSetting->breadcrumb && file_exists(public_path($this->imageStoragePath . $oldSetting->breadcrumb))) { @unlink(public_path($this->imageStoragePath . $oldSetting->breadcrumb)); } } // BasicSetting::where('user_id', $userId)->delete(); } $settingData = $this->getSettingData(); // Generate website title $websiteTitle = $this->ai->generateText($settingData['website_title_prompt']); $cleanWebsiteTitle = $this->extractCleanTitle($websiteTitle); // Generate favicon $favicon = $this->ai->generateImage( $settingData['favicon_prompt'], 64, 64, $this->imageStoragePath ); // Generate logo $logo = $this->ai->generateImage( $settingData['logo_prompt'], 200, 60, $this->imageStoragePath ); // Generate breadcrumb $breadcrumb = $this->ai->generateImage( $settingData['breadcrumb_prompt'], 1920, 400, $this->imageStoragePath ); // Generate cookie alert text $cookieAlertText = $this->ai->generateText($settingData['cookie_alert_text_prompt']); $cookieButtonText = $this->ai->generateText($settingData['cookie_button_text_prompt']); BasicSetting::updateOrCreate( [ 'user_id' => $this->ai->getUserId(), ], [ 'website_title' => $cleanWebsiteTitle, 'favicon' => $favicon, 'logo' => $logo, 'breadcrumb' => $breadcrumb, 'cookie_alert_status' => 1, 'cookie_alert_text' => $this->extractCleanText($cookieAlertText), 'cookie_alert_button_text' => $this->extractCleanTitle($cookieButtonText), ] ); } private function getSettingData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ 'website_title_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a professional website title for {$businessName}. Format options: - [Business Name] | [Tagline] - [Business Name] - [Industry] [Service Type] - [Business Name] | [Key Value Proposition] Examples: - TechFlow Solutions | Digital Innovation - Creative Agency - Marketing & Design - ProBuild Construction | Quality You Trust - DataCore Analytics - Business Intelligence Make it SEO-friendly, memorable, and professional. Output: Just the website title, nothing else. Context: {$baseContext}", 'favicon_prompt' => "Professional favicon icon for {$businessName} in {$industry} industry, simple minimalist logo design, 64x64 pixel format, recognizable brand symbol, clean icon suitable for browser tab", 'logo_prompt' => "Professional company logo for {$businessName}, modern {$industry} business branding, clean and memorable design, horizontal layout suitable for website header, high-quality corporate logo, 200x60 pixel format", 'breadcrumb_prompt' => "Professional website breadcrumb background banner for {$industry} business, modern elegant design, subtle pattern or gradient, professional corporate style, suitable for page headers, 1920x400 pixel format", 'cookie_alert_text_prompt' => "You must return EXACTLY 25-35 words. No formatting, no explanation. Write a clear, friendly cookie consent message for website visitors. Explain: cookies improve experience, user agreement, privacy respect. Use simple, transparent language. Examples: We use cookies to enhance your browsing experience and analyze site traffic. By continuing to use our website, you agree to our use of cookies. Output: Plain text only, 25-35 words. Context: {$baseContext}", 'cookie_button_text_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a cookie consent button text. Examples: Accept Cookies, I Agree, Got It, Accept All Output: Just the button text, nothing else.", ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/Blog/BlogFeaturedImageService.php 0000644 00000003530 15213350437 0016432 0 ustar 00 <?php namespace App\Services\AiWebsite\Blog; use App\Models\User\Blog; use App\Services\MasterAiGenerator; class BlogFeaturedImageService { protected $ai; protected $featuredImageStoragePath = 'assets/front/img/user/blogs/featured/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(): void { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $blogsWithFeatured = Blog::where('user_id', $userId) ->whereNotNull('featured_post_image') ->get(); foreach ($blogsWithFeatured as $blog) { if ($blog->featured_post_image && file_exists(public_path($this->featuredImageStoragePath . $blog->featured_post_image))) { @unlink(public_path($this->featuredImageStoragePath . $blog->featured_post_image)); } } Blog::where('user_id', $userId) ->update([ 'is_featured' => 0, 'featured_post_image' => null, ]); } $blogs = Blog::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->get(); foreach ($blogs as $blog) { $prompt = "Professional high-quality photograph for {$blog->title}, clean overhead flat lay composition, natural lighting, vibrant colors, sharp focus, {$this->ai->getIndustry()} theme, editorial magazine style, minimalist aesthetic, no text overlays, no graphic elements, pure photography"; $featuredImage = $this->ai->generateImage( $prompt, 800, 600, $this->featuredImageStoragePath ); $blog->update([ 'is_featured' => 1, 'featured_post_image' => $featuredImage, ]); } } } Services/AiWebsite/Blog/BlogSliderImageService.php 0000644 00000003524 15213350437 0016120 0 ustar 00 <?php namespace App\Services\AiWebsite\Blog; use App\Models\User\Blog; use App\Services\MasterAiGenerator; class BlogSliderImageService { protected $ai; protected $sliderImageStoragePath = 'assets/front/img/user/blogs/slider/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(): void { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $blogsWithSlider = Blog::where('user_id', $userId) ->whereNotNull('slider_post_image') ->get(); foreach ($blogsWithSlider as $blog) { if ($blog->slider_post_image && file_exists(public_path($this->sliderImageStoragePath . $blog->slider_post_image))) { @unlink(public_path($this->sliderImageStoragePath . $blog->slider_post_image)); } } Blog::where('user_id', $userId) ->update([ 'is_slider' => 0, 'slider_post_image' => null, ]); } $blogs = Blog::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->get(); foreach ($blogs as $blog) { $prompt = "Professional widescreen photograph for {$blog->title}, cinematic panoramic composition, natural dramatic lighting, high-end editorial magazine style, {$this->ai->getIndustry()} industry theme, vibrant rich colors, sharp focus, hero banner quality, no text overlays, no graphic elements, pure photography only"; $sliderImage = $this->ai->generateImage( $prompt, 1920, 800, $this->sliderImageStoragePath ); $blog->update([ 'is_slider' => 1, 'slider_post_image' => $sliderImage, ]); } } } Services/AiWebsite/Blog/BlogService.php 0000644 00000020031 15213350437 0014002 0 ustar 00 <?php namespace App\Services\AiWebsite\Blog; use App\Models\User\Blog; use App\Models\User\BlogCategory; use App\Services\AiWebsite\Blog\BlogCategoryService; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; class BlogService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/blogs/'; protected $sliderImageStoragePath = 'assets/front/img/user/blogs/slider/'; protected $featuredImageStoragePath = 'assets/front/img/user/blogs/featured/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldBlogs = Blog::where('user_id', $userId)->get(); foreach ($oldBlogs as $blog) { if ($blog->image && file_exists(public_path($this->imageStoragePath . $blog->image))) { @unlink(public_path($this->imageStoragePath . $blog->image)); } if ($blog->image2 && file_exists(public_path($this->imageStoragePath . $blog->image2))) { @unlink(public_path($this->imageStoragePath . $blog->image2)); } if ($blog->slider_post_image && file_exists(public_path($this->sliderImageStoragePath . $blog->slider_post_image))) { @unlink(public_path($this->sliderImageStoragePath . $blog->slider_post_image)); } if ($blog->featured_post_image && file_exists(public_path($this->featuredImageStoragePath . $blog->featured_post_image))) { @unlink(public_path($this->featuredImageStoragePath . $blog->featured_post_image)); } } Blog::where('user_id', $userId)->delete(); } // Get blog categories $categories = BlogCategory::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->get(); if ($categories->isEmpty()) { $categoryService = new BlogCategoryService($this->ai); $categoryService->generate(); $categories = BlogCategory::where('user_id', $this->ai->getUserId())->get(); } // Generate 2 blogs per category $blogData = $this->getBlogData($categories); foreach ($blogData as $index => $data) { $title = $this->ai->generateText($data['title_prompt']); $cleanTitle = $this->extractCleanTitle($title); $slug = Str::slug($cleanTitle); // Check if slug already exists $exists = Blog::where('user_id', $this->ai->getUserId()) ->where('slug', $slug) ->exists(); if ($exists) { $slug = $slug . '-' . time() . '-' . rand(100, 999); } // Generate blog content $content = $this->ai->generateText($data['content_prompt']); $metaKeywords = $this->ai->generateText($data['meta_keywords_prompt']); $metaDescription = $this->ai->generateText($data['meta_description_prompt']); // Generate main blog image $image = $this->ai->generateImage( $data['image_prompt'], 1200, 800, $this->imageStoragePath ); // Generate second image $image2 = $this->ai->generateImage( $data['image2_prompt'], 800, 600, $this->imageStoragePath ); Blog::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'category_id' => $data['category_id'], 'title' => $cleanTitle, 'slug' => $slug, 'content' => $this->extractCleanText($content), 'image' => $image, 'image2' => $image2, 'serial_number' => $index + 1, 'meta_keywords' => $this->extractCleanText($metaKeywords), 'meta_description' => $this->extractCleanText($metaDescription), 'is_slider' => 0, 'slider_post_image' => null, 'is_featured' => 0, 'featured_post_image' => null, 'views' => rand(50, 500), ]); } } private function getBlogData($categories) { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; $blogs = []; // Generate 1 blog per category foreach ($categories as $categoryIndex => $category) { $blogNumber = $categoryIndex + 1; $isSlider = ($blogNumber <= 3); $isFeatured = ($blogNumber <= 4); $blogs[] = [ 'category_id' => $category->id, 'title_prompt' => "You must return ONLY 8-12 words. No formatting, no explanation. Generate an engaging, click-worthy blog post title for {$category->name} category in {$industry} industry. Make it informative, interesting, and SEO-friendly. Examples: 10 Essential Tips for Digital Marketing Success in 2025, How AI is Transforming the Future of Business, Complete Guide to Building Your First Mobile App Output: Just the blog title, nothing else. Context: {$baseContext}", 'content_prompt' => "You must return EXACTLY 400-500 words. No formatting, no explanation. Write a comprehensive, informative blog post about the title topic for {$category->name} category. Structure: Introduction (50 words), Main content with 3-4 key points (300 words), Conclusion with call-to-action (50 words). Include: actionable insights, industry expertise, practical examples, current trends, expert perspective. Use professional, engaging, educational tone. Write in paragraphs. Output: Plain text only, 400-500 words total. Context: {$baseContext}", 'meta_keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate relevant SEO keywords for this {$category->name} blog post. Focus on: main topic keywords, industry terms, trending phrases, long-tail keywords. Output: Comma-separated keywords only.", 'meta_description_prompt' => "You must return EXACTLY 140-155 characters. No formatting. Write an SEO meta description for this blog post. Include: main benefit, topic summary, call to read. Output: Plain text only, 140-155 characters.", 'image_prompt' => "Professional blog featured image for {$category->name} article, modern editorial design, relevant to {$industry} topic, high-quality blog header image, engaging visual content, professional photography or illustration, 1200x800 aspect ratio", 'image2_prompt' => "Supporting blog content image for {$category->name} post, infographic style or conceptual illustration, {$industry} context, professional quality, informative visual design, complementary to main image", 'slider_image_prompt' => "Eye-catching blog slider banner for {$category->name} featured article, wide panoramic format hero image, {$industry} theme, professional editorial design, engaging and clickable visual, 1920x800 landscape", 'featured_image_prompt' => "Prominent featured blog post thumbnail for {$category->name}, attention-grabbing design, {$industry} related visual, high-quality square or landscape format, professional blog card image", 'is_slider' => $isSlider ? 1 : 0, 'is_featured' => $isFeatured ? 1 : 0, ]; } return $blogs; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/AiWebsite/Blog/BlogCategoryService.php 0000644 00000010113 15213350437 0015500 0 ustar 00 <?php namespace App\Services\AiWebsite\Blog; use App\Models\User\BlogCategory; use App\Services\MasterAiGenerator; class BlogCategoryService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/blogs/categories/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { //delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldCategories = BlogCategory::where('user_id', $userId)->get(); foreach ($oldCategories as $category) { if ($category->image && file_exists(public_path($this->imageStoragePath . $category->image))) { @unlink(public_path($this->imageStoragePath . $category->image)); } } BlogCategory::where('user_id', $userId)->delete(); } $theme = $this->ai->getTheme(); $categoryData = $this->getCategoryData(); foreach ($categoryData as $index => $data) { // Generate category name $name = $this->ai->generateText($data['name_prompt']); $cleanName = $this->extractCleanTitle($name); $categoryInput = [ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'name' => $cleanName, 'status' => 1, 'is_featured' => $data['is_featured'], 'serial_number' => $index + 1, ]; // Generate image only for theme thirteen if ($theme == 'home_thirteen') { $imagePrompt = str_replace( ['{category_name}', '{industry}'], [$cleanName, $this->ai->getIndustry()], $data['image_prompt'] ); $image = $this->ai->generateImage( $imagePrompt, 202, 120, $this->imageStoragePath ); $categoryInput['image'] = $image; } else { $categoryInput['image'] = null; } BlogCategory::create($categoryInput); } } private function getCategoryData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; return [ [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a blog category name related to industry news and updates for {$industry}. Examples: Industry News, Latest Updates, Business Insights, Market Trends Output: Just the category name, nothing else. Context: {$baseContext}", // Natural photographic style for industry news 'image_prompt' => "Professional high-quality photograph representing \"{category_name}\" in {industry} industry, natural lighting, modern business setting, realistic photo, professional photography, clean composition, editorial style", 'is_featured' => 1, ], [ 'name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a blog category name for tips and guides in {$industry}. Examples: Tips Guides, How To, Expert Advice, Best Practices Output: Just the category name, nothing else. Context: {$baseContext}", // Natural photographic style for tips/guides 'image_prompt' => "Natural photograph showing \"{category_name}\" concept in {industry} context, realistic scene, professional quality image, good lighting, authentic moment, editorial photography style", 'is_featured' => 1, ], ]; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } } Services/AiWebsite/CourseManagement/CourseCouponService.php 0000644 00000011072 15213350437 0020122 0 ustar 00 <?php namespace App\Services\AiWebsite\CourseManagement; use App\Models\User\CourseManagement\Coupon; use App\Models\User\CourseManagement\Course; use App\Services\MasterAiGenerator; use Carbon\Carbon; use Illuminate\Support\Str; class CourseCouponService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } /** * Current user er jonno 2 ta course coupon create korbe. */ public function generate(int $count = 2) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); Coupon::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $courses = Course::where('user_id', $userId)->pluck('id')->all(); if (empty($courses)) { return; } $defs = $this->getCouponDefinitions($courses); // just first $count ta use korbo foreach (array_slice($defs, 0, $count) as $def) { $nameRaw = $this->ai->generateText($def['name_prompt']); $codeRaw = $this->ai->generateText($def['code_prompt']); $name = $this->cleanText($nameRaw, 80); $code = $this->cleanCode($codeRaw); if (Coupon::where('user_id', $userId)->where('code', $code)->exists()) { $code .= strtoupper(Str::random(2)); } $start = Carbon::now()->addDays($def['start_offset'])->format('Y-m-d'); $end = Carbon::now()->addDays($def['end_offset'])->format('Y-m-d'); Coupon::create([ 'user_id' => $userId, 'name' => $name, 'code' => $code, 'type' => $def['type'], 'value' => $def['value'], 'start_date' => $start, 'end_date' => $end, 'courses' => json_encode($def['courses']), ]); } } private function getCouponDefinitions(array $courseIds): array { $businessName = $this->ai->getBusinessName(); $baseContext = "{$businessName} sells online courses. Generate student‑friendly coupon offers."; // choto subset course nibo shuffle($courseIds); $firstCourses = array_slice($courseIds, 0, min(3, count($courseIds))); shuffle($courseIds); $secondCourses = array_slice($courseIds, 0, min(3, count($courseIds))); return [ [ 'name_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a course coupon name for a percentage discount. Examples: Summer Learning Sale, Limited-Time Course Discount, Skill Boost Offer Output: Just the name, nothing else. Context: {$baseContext}", 'code_prompt' => "You must return ONLY ONE coupon code of 6-10 characters, uppercase letters and numbers, no spaces. Examples: LEARN20, SAVE25, COURSE15 Output: Just the code, nothing else.", 'type' => 'percentage', 'value' => 20, 'start_offset' => 0, 'end_offset' => 30, 'courses' => $firstCourses, ], [ 'name_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a course coupon name for fixed amount savings. Examples: Flat 10 Off Courses, Save On Premium Classes, Instant Course Savings Output: Just the name, nothing else. Context: {$baseContext}", 'code_prompt' => "You must return ONLY ONE coupon code of 6-10 characters, uppercase letters and numbers, no spaces. Examples: FLAT10, SAVE5NOW, DEAL15 Output: Just the code, nothing else.", 'type' => 'fixed', 'value' => 10, 'start_offset' => 0, 'end_offset' => 45, 'courses' => $secondCourses, ], ]; } private function cleanText(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } private function cleanCode(string $text): string { $text = strtoupper(trim($text)); $text = preg_replace('/[^A-Z0-9]/', '', $text); if ($text === '') { $text = 'COURSE' . rand(100, 999); } if (strlen($text) > 10) { $text = substr($text, 0, 10); } return $text; } } Services/AiWebsite/CourseManagement/InstructorService.php 0000644 00000014434 15213350437 0017657 0 ustar 00 <?php namespace App\Services\AiWebsite\CourseManagement; use App\Models\User\Language; use App\Services\MasterAiGenerator; use App\Models\User\CourseManagement\Instructor\Instructor; class InstructorService { protected $ai; protected $imagePath = 'assets/tenant/image/instructors/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(int $count = 2) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldInstructors = Instructor::where('user_id', $userId)->get(); foreach ($oldInstructors as $instructor) { if ($instructor->image && file_exists(public_path($this->imagePath . $instructor->image))) { @unlink(public_path($this->imagePath . $instructor->image)); } } Instructor::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $defaultLangId = $this->ai->getDefaultLanguageId(); $language = Language::where('id', $defaultLangId) ->where('user_id', $userId) ->first(); if (!$language) { return; } $definitions = $this->getInstructorDefinitions($count); foreach ($definitions as $def) { $imageName = $this->ai->generateImage( $def['image_prompt'], 370, 370, $this->imagePath ); $rawName = $this->ai->generateText($def['name_prompt']); $rawOccupation = $this->ai->generateText($def['occupation_prompt']); $rawDescription = $this->ai->generateText($def['description_prompt']); $name = $this->extractSingleLine($rawName, 60); $occupation = $this->extractSingleLine($rawOccupation, 80); $description = $this->extractCleanHtmlSafe($rawDescription, 600); Instructor::create([ 'language_id' => $language->id, 'user_id' => $userId, 'image' => $imageName, 'name' => $name, 'occupation' => $occupation, 'description' => $description, 'is_featured' => $def['is_featured'] ? 1 : 0, ]); } } /** * Different instructor profiles config. */ private function getInstructorDefinitions(int $count): array { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $info = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} offers {$industry}-related courses and training. {$info}"; $qualityEnhancer = ", shot with professional DSLR camera, 85mm portrait lens, hyperrealistic facial details, sharp focus on eyes, natural skin texture with pores, individual unique faces, detailed iris and pupils, realistic human imperfections, studio quality lighting"; $negativePrompt = ", AVOID: soft blurry faces, plastic skin, airbrushed look, cloned faces, synthetic appearance, uniform features, doll-like skin, low detail eyes"; $base = [ [ 'is_featured' => true, 'name_prompt' => "You must return ONLY a realistic full name. No formatting, no explanation. Examples: Sarah Ahmed, David Johnson, Mehedi Hasan Output: Just the name, nothing else.", 'occupation_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a course instructor title for {$industry}. Examples: Senior Data Science Instructor, Full-Stack Web Development Mentor, Digital Marketing Strategist Output: Just the title, nothing else. Context: {$baseContext}", 'description_prompt' => "You must return 90-130 words. No formatting, no explanation. Write a short instructor bio in third person. Include: years of experience, area of expertise, teaching style, what students can expect. Tone: professional, friendly, encouraging. Output: Plain text only, 90-130 words. Context: {$baseContext}", 'image_prompt' => "Professional headshot of course instructor, neutral background, friendly expression, studio lighting, realistic photo style, {$industry} educator" . $qualityEnhancer . $negativePrompt, ], [ 'is_featured' => true, 'name_prompt' => "You must return ONLY a realistic full name. No formatting, no explanation. Output: Just the name, nothing else.", 'occupation_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a niche instructor role for {$industry}. Examples: UI UX Design Coach, Cloud Computing Expert, SEO and Content Trainer Output: Just the title, nothing else. Context: {$baseContext}", 'description_prompt' => "You must return 90-130 words. No formatting, no explanation. Write an expert instructor bio. Focus on: specialization, real-world projects, tools/technologies used, benefits for learners. Output: Plain text only, 90-130 words. Context: {$baseContext}", 'image_prompt' => "Professional portrait of specialist instructor, half-body shot, office or classroom background, realistic photography, {$industry} trainer" . $qualityEnhancer . $negativePrompt, ], ]; $result = []; for ($i = 0; $i < $count; $i++) { $result[] = $base[$i % count($base)]; } return $result; } private function extractSingleLine(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } private function extractCleanHtmlSafe(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } } Services/AiWebsite/CourseManagement/CourseService.php 0000644 00000027675 15213350437 0016756 0 ustar 00 <?php namespace App\Services\AiWebsite\CourseManagement; use App\Models\User\CourseManagement\Course; use App\Models\User\CourseManagement\CourseCategory; use App\Models\User\CourseManagement\CourseInformation; use App\Models\User\Language; use App\Models\User\CourseManagement\Instructor\Instructor; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; class CourseService { protected $ai; protected $thumbPath = 'assets/tenant/image/courses/thumbnails/'; protected $coverPath = 'assets/tenant/image/courses/covers/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(int $count = 3) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldCourses = Course::where('user_id', $userId)->get(); foreach ($oldCourses as $course) { // Thumbnail image if ($course->thumbnail_image && $course->thumbnail_image !== 'default.jpg' && file_exists(public_path($this->thumbPath . $course->thumbnail_image))) { @unlink(public_path($this->thumbPath . $course->thumbnail_image)); } // Cover image if ($course->cover_image && $course->cover_image !== 'default.jpg' && file_exists(public_path($this->coverPath . $course->cover_image))) { @unlink(public_path($this->coverPath . $course->cover_image)); } } CourseInformation::whereHas('course', function ($q) use ($userId) { $q->where('user_id', $userId); })->delete(); Course::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $defaultLangId = $this->ai->getDefaultLanguageId(); $language = Language::where('id', $defaultLangId) ->where('user_id', $userId) ->first(); if (!$language) { return; } $categories = CourseCategory::where('user_id', $userId) ->where('language_id', $defaultLangId) ->get(); $instructors = Instructor::where('user_id', $userId) ->where('language_id', $defaultLangId) ->get(); if ($categories->isEmpty() || $instructors->isEmpty()) { return; } // slug => category map $categoryMap = $categories->keyBy('slug'); $definitions = $this->getCourseDefinitions($count); foreach ($definitions as $def) { $category = $categoryMap[$def['category_slug']] ?? $categories->random(); $pricing = $def['pricing_type']; $current = $pricing === 'free' ? 0 : $def['current_price']; $previous = $pricing === 'free' ? 0 : $def['previous_price']; $course = Course::create([ 'user_id' => $userId, 'thumbnail_image' => 'default.jpg', 'video_link' => $this->fakeVideoLink(), 'cover_image' => 'default.jpg', 'pricing_type' => $pricing, 'previous_price' => $previous, 'current_price' => $current, 'status' => 'published', 'is_featured' => $def['is_featured'] ? 'yes' : 'no', 'average_rating' => $def['average_rating'], 'duration' => $def['duration'], 'certificate_status' => 1, 'video_watching' => 80, 'quiz_completion' => 60, 'certificate_title' => $def['certificate_title'], 'certificate_text' => $def['certificate_text'], 'min_quiz_score' => 60, ]); $infoPrompts = $this->getCourseInfoPrompts($course, $language, $category); $rawTitle = $this->ai->generateText($infoPrompts['title_prompt']); $title = $this->extractLine($rawTitle, 100); $slug = make_slug($title); if ( CourseInformation::where('user_id', $userId) ->where('language_id', $language->id) ->where('slug', $slug) ->exists() ) { $slug .= '-' . time() . '-' . rand(10, 99); } $rawDesc = $this->ai->generateText($infoPrompts['description_prompt']); $desc = $this->extractText($rawDesc, 800); $rawMetaKw = $this->ai->generateText($infoPrompts['meta_keywords_prompt']); $metaKw = $this->extractText($rawMetaKw, 200); $rawMetaDs = $this->ai->generateText($infoPrompts['meta_description_prompt']); $metaDs = $this->extractText($rawMetaDs, 200); $rawThanks = $this->ai->generateText($infoPrompts['thanks_prompt']); $thanks = $this->extractText($rawThanks, 400); $features = $this->ai->generateText($infoPrompts['features_prompt']); $features = $this->extractText($features, 400); $thumbPrompt = $this->buildThumbPrompt($title, $def, $category); $coverPrompt = $this->buildCoverPrompt($title, $def, $category); $thumbName = $this->ai->generateImage( $thumbPrompt, 370, 250, $this->thumbPath ); $coverName = $this->ai->generateImage( $coverPrompt, 1920, 550, $this->coverPath ); $course->update([ 'thumbnail_image' => $thumbName, 'cover_image' => $coverName, ]); CourseInformation::create([ 'language_id' => $language->id, 'user_id' => $userId, 'course_category_id' => $category->id, 'course_id' => $course->id, 'title' => $title, 'slug' => $slug, 'instructor_id' => $instructors->random()->id, 'features' => $features, 'description' => $desc, 'meta_keywords' => $metaKw, 'meta_description' => $metaDs, 'thanks_page_content' => $thanks, ]); } } private function getCourseDefinitions(int $count): array { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $info = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} provides {$industry}-related courses and training. {$info}"; $base = [ [ 'pricing_type' => 'premium', 'current_price' => 59, 'previous_price' => 99, 'is_featured' => true, 'average_rating' => 4.7, 'duration' => '08:30:00', 'certificate_title' => 'Certificate of Completion', 'certificate_text' => 'This certificate is awarded for successfully completing the full course and assessments.', 'category_slug' => 'programming-development', ], [ 'pricing_type' => 'premium', 'current_price' => 29, 'previous_price' => 49, 'is_featured' => true, 'average_rating' => 4.5, 'duration' => '04:15:00', 'certificate_title' => 'Professional Skills Certificate', 'certificate_text' => 'Awarded to learners who complete all modules and pass the final quiz with required score.', 'category_slug' => 'marketing-business', ], [ 'pricing_type' => 'free', 'current_price' => 0, 'previous_price' => 0, 'is_featured' => false, 'average_rating' => 4.3, 'duration' => '02:00:00', 'certificate_title' => 'Introductory Course Certificate', 'certificate_text' => 'Provides recognition for successfully completing this introductory course.', 'category_slug' => 'data-analytics', ], ]; $result = []; for ($i = 0; $i < $count; $i++) { $result[] = $base[$i % count($base)]; } return $result; } private function buildThumbPrompt(string $title, array $def, CourseCategory $category): string { return "flat 2D online course thumbnail icon for \"{$title}\" in {$category->name} category, " . "single large clear symbol or pictogram in the center representing the topic, " . "no real text, no small UI elements, minimal shapes, bold outline, " . "high contrast simple background, clean 16:9 composition, " . "sharp vector style, edges and icon clearly defined, not blurry"; } private function buildCoverPrompt(string $title, array $def, CourseCategory $category): string { return "wide hero banner background for \"{$title}\" course in {$category->name} category, " . "large clear symbolic illustration or icon group on one side, " . "the other side kept mostly empty with smooth gradient for overlay text, " . "no real readable text drawn in the image, no logos, " . "simple shapes, clean lines, high contrast between icon and background, " . "1920x550 layout, modern e-learning style, not busy, not cluttered"; } private function getCourseInfoPrompts(Course $course, Language $language, CourseCategory $category): array { $businessName = $this->ai->getBusinessName(); $baseContext = "Provider: {$businessName}. Course ID: {$course->id}. Language: {$language->name}. " . "This course belongs to the '{$category->name}' category."; return [ 'title_prompt' => "You must return ONLY 5-9 words. No formatting, no explanation. Generate a clear, compelling online course title that clearly fits the '{$category->name}' category. The topic must be strongly related to {$category->name}. Output: Just the title, nothing else. Context: {$baseContext}", 'description_prompt' => "You must return 140-200 words. No formatting, no explanation. Write a high-converting online course description for the '{$category->name}' course. Include: who this course is for, main skills learned, key modules, outcomes and benefits. Tone: friendly, professional, motivating. Output: Plain text only, 140-200 words. Context: {$baseContext}", 'features_prompt' => "You must return 5-7 short bullet-style features separated by semicolons. No bullet characters, no formatting. Focus on features relevant to {$category->name}. Output: Just the feature items separated by semicolons. Context: {$baseContext}", 'meta_keywords_prompt' => "You must return ONLY 6-8 SEO keywords separated by commas. No formatting. Generate SEO keywords for this {$category->name} online course. Include: topic, level, main tool/skill, course type. Output: Comma-separated keywords only. Context: {$baseContext}", 'meta_description_prompt' => "You must return EXACTLY 145-155 characters. No formatting. Write an SEO meta description for this {$category->name} course. Highlight: target audience, main benefit, call to enroll. Output: Plain text only, 145-155 characters. Context: {$baseContext}", 'thanks_prompt' => "You must return 60-100 words. No formatting, no explanation. Write a friendly thank you message for the course thank-you page after enrollment. Include: gratitude, what to do next, how to start lessons. Output: Plain text only, 60-100 words. Context: {$baseContext}", ]; } private function fakeVideoLink(): string { $id = Str::random(11); return "https://www.youtube.com/watch?v={$id}"; } private function extractLine(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } private function extractText(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly|Options:)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } } Services/AiWebsite/CourseManagement/CourseCategoryService.php 0000644 00000011200 15213350437 0020425 0 ustar 00 <?php namespace App\Services\AiWebsite\CourseManagement; use App\Models\User\CourseManagement\CourseCategory; use App\Models\User\Language; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; class CourseCategoryService { protected $ai; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate(int $count = 4) { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); CourseCategory::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $defaultLangId = $this->ai->getDefaultLanguageId(); $language = Language::where('id', $defaultLangId) ->where('user_id', $userId) ->first(); if (!$language) { return; } $count = 4; $defs = $this->getCategoryDefinitions(); for ($index = 0; $index < $count; $index++) { $def = $defs[$index]; $rawName = $this->ai->generateText($def['name_prompt']); $name = $this->extractName($rawName); if (!$name || strlen($name) < 3) { continue; } $exists = CourseCategory::where('user_id', $userId) ->where('language_id', $language->id) ->where('name', $name) ->exists(); if ($exists) { continue; } $slug = slug_create($name); if ( CourseCategory::where('user_id', $userId) ->where('language_id', $language->id) ->where('slug', $slug) ->exists() ) { $slug = $slug . '-' . time() . '-' . rand(10, 99); } CourseCategory::create([ 'language_id' => $language->id, 'user_id' => $userId, 'icon' => $def['icon'], 'color' => $def['color'], 'name' => $name, 'status' => 1, 'serial_number' => $index + 1, 'is_featured' => $def['is_featured'] ? 1 : 0, 'slug' => $slug, ]); } } private function getCategoryDefinitions(): array { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $info = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} runs {$industry}-related online courses and training. {$info}"; return [ [ 'icon' => 'fas fa-code', 'color' => '2563eb', 'is_featured' => true, 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a course category name for programming / development. Examples: Web Development, Programming & Coding, Software Development Output: Just the name, nothing else. Context: {$baseContext}", ], [ 'icon' => 'fas fa-bullhorn', 'color' => 'ef4444', 'is_featured' => true, 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a course category name for marketing and business. Examples: Digital Marketing, Business & Entrepreneurship, Sales & Branding Output: Just the name, nothing else. Context: {$baseContext}", ], [ 'icon' => 'fas fa-chart-line', 'color' => '22c55e', 'is_featured' => true, 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a course category name for data / analytics / AI. Examples: Data Science, Analytics & BI, AI & Machine Learning Output: Just the name, nothing else. Context: {$baseContext}", ], [ 'icon' => 'fas fa-palette', 'color' => 'a855f7', 'is_featured' => true, 'name_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a course category name for design and creative skills. Examples: Graphic Design, UI UX Design, Creative Arts Output: Just the name, nothing else. Context: {$baseContext}", ], ]; } private function extractName(string $text): string { $text = preg_replace('/^(Here are|Here is|Options:|Sure|Certainly)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > 60) { $text = substr($text, 0, 60); } return $text; } } Services/AiWebsite/CourseManagement/ActionSectionService.php 0000644 00000012742 15213350437 0020245 0 ustar 00 <?php namespace App\Services\AiWebsite\CourseManagement; use App\Models\User\ActionSection; use App\Models\User\Language; use App\Models\User\BasicSetting; use App\Services\MasterAiGenerator; use App\Constants\Constant; class ActionSectionService { protected $ai; protected $bgPath = 'assets/tenant/image/action-section/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // Delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldSections = ActionSection::where('user_id', $userId)->get(); foreach ($oldSections as $section) { if ($section->background_image && file_exists(public_path($this->bgPath . $section->background_image))) { @unlink(public_path($this->bgPath . $section->background_image)); } } ActionSection::where('user_id', $userId)->delete(); } $userId = $this->ai->getUserId(); $defaultLangId = $this->ai->getDefaultLanguageId(); $language = Language::where('id', $defaultLangId) ->where('user_id', $userId) ->first(); if (!$language) { return; } $existing = ActionSection::where('user_id', $userId) ->where('language_id', $language->id) ->first(); $data = $this->getContentDefinition(); // generate background image $backgroundImage = $this->ai->generateImage( $data['background_prompt'], 1920, 540, $this->bgPath ); // texts $firstTitleRaw = $this->ai->generateText($data['first_title_prompt']); $secondTitleRaw = $this->ai->generateText($data['second_title_prompt']); $firstBtnRaw = $this->ai->generateText($data['first_button_prompt']); $secondBtnRaw = $this->ai->generateText($data['second_button_prompt']); $firstTitle = $this->extractCleanLine($firstTitleRaw, 80); $secondTitle = $this->extractCleanLine($secondTitleRaw, 140); $firstButton = $this->extractCleanLine($firstBtnRaw, 25); $secondButton = $this->extractCleanLine($secondBtnRaw, 25); $payload = [ 'language_id' => $language->id, 'user_id' => $userId, 'background_image' => $backgroundImage, 'first_title' => $firstTitle, 'second_title' => $secondTitle, 'first_button' => $firstButton, 'first_button_url' => $data['first_button_url'], 'second_button' => $secondButton, 'second_button_url' => $data['second_button_url'], 'image' => null, ]; if ($existing) { // update $existing->update($payload); } else { // create ActionSection::create($payload); } } private function getContentDefinition(): array { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $info = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a {$industry} business. {$info}"; return [ 'background_prompt' => "minimal website call-to-action background for online course platform, soft solid pastel color with very subtle texture, on the right side a simple flat illustration of one student using a laptop inside a circular or rounded shape, NO buttons, NO text, NO logos, NO UI elements, left side completely empty clean space for overlay headline and buttons, flat 2D vector style, high resolution, not blurry, not noisy, AVOID: detailed UI, small icons, real screenshots, hard-to-read text", 'first_title_prompt' => "You must return ONLY 5-6 words. No formatting, no explanation. Generate a strong headline for an online course call-to-action section. Focus on enrolling more students and highlighting transformation. Examples: Start Learning In-Demand Skills Today, Launch Your Career With Expert-Led Courses, Master New Skills With Flexible Online Classes Output: Just the headline text, nothing else. Context: {$baseContext}", 'second_title_prompt' => "You must return EXACTLY 6-10 words. No formatting, no explanation. Write a short supporting line under the CTA headline. Explain main benefit, reduce hesitation, encourage action. Output: Plain text only, 6-10 words. Context: {$baseContext}", 'first_button_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a primary CTA button text. Examples: Get Started, Book Now, Contact Us, Learn More Output: Just the button text, nothing else. Context: {$baseContext}", 'second_button_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a secondary CTA button text. Examples: View Pricing, See Plans, Watch Demo, Explore More Output: Just the button text, nothing else. Context: {$baseContext}", 'first_button_url' => '/contact', 'second_button_url' => '/services', ]; } private function extractCleanLine(string $text, int $maxLen): string { $text = preg_replace('/^(Here are|Here is|Sure|Certainly)/i', '', $text); $text = preg_replace('/[*_#`~\[\]<>]/', '', $text); $text = preg_replace('/\r?\n.*/s', '', $text); $text = preg_replace('/\s+/', ' ', $text); $text = trim($text); if (strlen($text) > $maxLen) { $text = substr($text, 0, $maxLen); } return $text; } } Services/AiWebsite/OfferBannerService.php 0000644 00000017442 15213350437 0014437 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\UserOfferBanner; use App\Models\User\BasicSetting; use App\Services\MasterAiGenerator; class OfferBannerService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/offers/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // Delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldBanners = UserOfferBanner::where('user_id', $userId)->get(); foreach ($oldBanners as $banner) { if ($banner->image && file_exists(public_path($this->imageStoragePath . $banner->image))) { @unlink(public_path($this->imageStoragePath . $banner->image)); } } UserOfferBanner::where('user_id', $userId)->delete(); } $theme = $this->ai->getTheme(); $bannerData = $this->getBannerData(); foreach ($bannerData as $index => $data) { $bannerInput = [ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'position' => $data['position'], 'url' => $data['url'], ]; // Generate banner image $image = $this->ai->generateImage( $data['image_prompt'], 1200, 400, $this->imageStoragePath ); $bannerInput['image'] = $image; // Generate content based on theme if ($theme == 'home_fourteen') { $btnName = $this->ai->generateText($data['btn_name_prompt']); $bannerInput['btn_name'] = $this->extractCleanTitle($btnName); $bannerInput['text_1'] = null; $bannerInput['text_2'] = null; $bannerInput['text_3'] = null; } else { $text1 = $this->ai->generateText($data['text_1_prompt']); $text2 = $this->ai->generateText($data['text_2_prompt']); $text3 = $this->ai->generateText($data['text_3_prompt']); $bannerInput['text_1'] = $this->extractCleanTitle($text1); $bannerInput['text_2'] = $this->extractCleanTitle($text2); $bannerInput['text_3'] = $this->extractCleanTitle($text3); $bannerInput['btn_name'] = null; } UserOfferBanner::create($bannerInput); } } private function getBannerData() { $businessName = $this->ai->getBusinessName(); $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "{$businessName} is a leading {$industry} company. {$businessInfo}"; $banners = []; // Position 1 - Main promotional offer $banners[] = [ 'position' => 1, 'url' => '/services', 'text_1_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a catchy headline for a promotional banner announcing a special offer. Make it attention-grabbing and exciting. Examples: Limited Time Special Offer, Exclusive Deal For You, Amazing Discount Inside Output: Just the text, nothing else. Context: {$baseContext}", 'text_2_prompt' => "You must return ONLY 5-8 words. No formatting, no explanation. Generate a secondary text describing the offer benefit or urgency. Examples: Get Up To 50 Percent Off, Save Big On Premium Services, Don't Miss This Opportunity Output: Just the text, nothing else. Context: {$baseContext}", 'text_3_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a call-to-action phrase for the offer banner. Examples: Shop Now, Claim Offer, Get Started, Learn More Output: Just the CTA text, nothing else.", 'btn_name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a button text for the promotional banner. Examples: Grab Deal, Shop Now, Claim Offer, Get Started Output: Just the button text, nothing else.", 'image_prompt' => "Promotional offer banner design for {$industry} business, eye-catching sale advertisement, vibrant colors, modern e-commerce banner style, special deal promotion, professional marketing design", ]; // Position 2 - Seasonal or service highlight $banners[] = [ 'position' => 2, 'url' => '/shop', 'text_1_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a headline for a seasonal or new arrival banner. Examples: New Collection Just Arrived, Spring Season Sale, Fresh Products Available Output: Just the text, nothing else. Context: {$baseContext}", 'text_2_prompt' => "You must return ONLY 5-8 words. No formatting, no explanation. Generate descriptive text about new products or seasonal offerings. Examples: Discover Latest Trends And Styles, Explore Our Newest Product Range, Quality Products For Every Need Output: Just the text, nothing else. Context: {$baseContext}", 'text_3_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a call-to-action for exploring new products. Examples: Explore Now, View Collection, See More, Browse All Output: Just the CTA text, nothing else.", 'btn_name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a button text for new arrivals. Examples: View Now, Explore Collection, Shop Latest Output: Just the button text, nothing else.", 'image_prompt' => "New arrival banner design for {$industry} products, modern fresh style, seasonal collection promotion, attractive product showcase banner, professional e-commerce design", ]; // Position 3 - Free shipping or value proposition $banners[] = [ 'position' => 3, 'url' => '/contact', 'text_1_prompt' => "You must return ONLY 3-6 words. No formatting, no explanation. Generate a headline highlighting a business benefit or value. Examples: Free Shipping On Orders, Quality Service Guaranteed, Premium Support Available Output: Just the text, nothing else. Context: {$baseContext}", 'text_2_prompt' => "You must return ONLY 5-8 words. No formatting, no explanation. Generate supporting text about the business advantage. Examples: Fast Delivery To Your Doorstep, Expert Team Ready To Help, Satisfaction Guaranteed Or Money Back Output: Just the text, nothing else. Context: {$baseContext}", 'text_3_prompt' => "You must return ONLY 2-4 words. No formatting, no explanation. Generate a call-to-action for engagement. Examples: Learn More, Contact Us, Get Details, Find Out Output: Just the CTA text, nothing else.", 'btn_name_prompt' => "You must return ONLY 2-3 words. No formatting, no explanation. Generate a button text for customer engagement. Examples: Contact Now, Learn More, Get Info Output: Just the button text, nothing else.", 'image_prompt' => "Value proposition banner for {$industry} business, trust and quality message, customer benefit highlight, professional service banner, modern corporate design style", ]; return $banners; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); // Limit to 100 characters as per validation if (strlen($text) > 100) { $text = substr($text, 0, 100); } return trim($text); } } Services/AiWebsite/PortfolioService.php 0000644 00000012520 15213350437 0014215 0 ustar 00 <?php namespace App\Services\AiWebsite; use App\Models\User\Portfolio; use App\Models\User\PortfolioCategory; use App\Models\User\PortfolioImage; use App\Services\MasterAiGenerator; use Illuminate\Support\Str; use Carbon\Carbon; class PortfolioService { protected $ai; protected $imageStoragePath = 'assets/front/img/user/portfolios/'; protected $isDeleteOldRecords; public function __construct(MasterAiGenerator $ai) { $this->ai = $ai; $this->isDeleteOldRecords = $this->ai->isDeleteOldRecords(); } public function generate() { // delete old records if ($this->isDeleteOldRecords) { $userId = $this->ai->getUserId(); $oldPortfolios = Portfolio::where('user_id', $userId)->get(); foreach ($oldPortfolios as $portfolio) { if ($portfolio->image && file_exists(public_path($this->imageStoragePath . $portfolio->image))) { @unlink(public_path($this->imageStoragePath . $portfolio->image)); } } Portfolio::where('user_id', $userId)->delete(); } // Get first available portfolio category $category = PortfolioCategory::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->first(); if (!$category) { // Generate categories first if none exist $categoryService = new PortfolioCategoryService($this->ai); $categoryService->generate(); $category = PortfolioCategory::where('user_id', $this->ai->getUserId())->first(); } // Get all categories for variety $categories = PortfolioCategory::where('user_id', $this->ai->getUserId()) ->where('language_id', $this->ai->getDefaultLanguageId()) ->get(); $portfolioData = $this->getPortfolioData($categories); $industry = $this->ai->getIndustry(); foreach ($portfolioData as $index => $data) { $title = $this->ai->generateText($data['title_prompt']); $cleanTitle = $this->extractCleanTitle($title); $content = $this->ai->generateText($data['content_prompt']); $clientName = $this->ai->generateText($data['client_name_prompt']); $categoryName = $data['category_name']; $dynamicImagePrompt = "A high-quality professional showcase image for a project titled '{$cleanTitle}'. Category: {$categoryName}. Industry: {$industry}. The image should be a modern, clean, and polished visual representation of the final work, suitable for a top-tier business portfolio, ultra-realistic, professional lighting."; // Generate main portfolio image $mainImage = $this->ai->generateImage( $dynamicImagePrompt, 1200, 800, $this->imageStoragePath ); // Create portfolio $portfolio = Portfolio::create([ 'user_id' => $this->ai->getUserId(), 'language_id' => $this->ai->getDefaultLanguageId(), 'category_id' => $data['category_id'], 'title' => $cleanTitle, 'slug' => Str::slug($cleanTitle) . '-' . time() . '-' . rand(100, 999), 'content' => $this->extractCleanText($content), 'image' => $mainImage, 'featured' => $data['featured'], 'status' => 1, 'client_name' => $this->extractCleanTitle($clientName), 'start_date' => $data['start_date'], 'submission_date' => $data['submission_date'], 'website_link' => $data['website_link'], 'serial_number' => $index + 1, ]); } } private function getPortfolioData($categories) { $industry = $this->ai->getIndustry(); $businessInfo = $this->ai->getBusinessInfo(); $baseContext = "Industry: {$industry}. Info: {$businessInfo}"; $portfolios = []; foreach ($categories as $index => $category) { $startDate = Carbon::now()->subMonths(rand(3, 12))->format('Y-m-d'); $submissionDate = Carbon::parse($startDate)->addMonths(rand(2, 4))->format('Y-m-d'); $portfolios[] = [ 'category_id' => $category->id, 'category_name' => $category->name, 'title_prompt' => "Return ONLY a 4-6 word professional project title for the '{$category->name}' category in the {$industry} industry. No extra text.", 'content_prompt' => "Write a professional 150-word description for a {$category->name} project in the {$industry} sector. Context: {$baseContext}", 'client_name_prompt' => "Generate a 2-3 word realistic company name for a client in the {$industry} sector.", 'featured' => ($index < 3) ? 1 : 0, 'start_date' => $startDate, 'submission_date' => $submissionDate, 'website_link' => 'https://example-project-' . ($index + 1) . '.com', ]; } return $portfolios; } private function extractCleanTitle($text) { $text = preg_replace('/^(Here are|Options:|Choose from:).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]]/', '', $text); $text = preg_replace('/^[\s\-•]+/', '', $text); $text = preg_replace('/\n.*$/s', '', $text); return trim($text); } private function extractCleanText($text) { $text = preg_replace('/^(Here are|Here is|Sure|Certainly).*/i', '', $text); $text = preg_replace('/[*_#`~\[\]""]/', '', $text); $text = preg_replace('/^[\s\-•]+/m', '', $text); $text = preg_replace('/\s+/', ' ', $text); return trim($text); } } Services/GeminiTokenService.php 0000644 00000005326 15213350437 0012603 0 ustar 00 <?php namespace App\Services; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Log; use Exception; class GeminiTokenService { protected $apiKey; protected $model; protected $maxInputTokens; public function __construct() { $this->apiKey = env('GEMINI_API_KEY'); $this->model = env('GEMINI_MODEL', 'gemini-2.0-flash'); $this->maxInputTokens = config('ai.gemini.max_input_tokens', 1000); } /** * Count tokens for given prompt * @param string $prompt * @return int */ public function countTokens(string $prompt): int { if (!$this->apiKey) { Log::warning('Gemini API key not configured'); return 0; } try { $response = Http::timeout(30) ->withHeaders(['x-goog-api-key' => $this->apiKey]) ->post("https://generativelanguage.googleapis.com/v1beta/models/{$this->model}:countTokens", [ 'contents' => [ ['parts' => [['text' => $prompt]]] ] ]); if ($response->successful()) { $data = $response->json(); return $data['totalTokens'] ?? 0; } Log::error('Gemini token counting failed', [ 'status' => $response->status(), 'body' => $response->body() ]); } catch (Exception $e) { Log::error('Gemini token counting exception: ' . $e->getMessage()); } return 0; } /** * Validate if prompt is within token limits * @param string $prompt * @return array */ public function validateTokenLimit(string $prompt): array { $tokenCount = $this->countTokens($prompt); if ($tokenCount === 0) { Log::warning('Token counting returned 0, proceeding with caution'); return [ 'valid' => true, 'token_count' => 0, 'max_tokens' => $this->maxInputTokens, 'message' => 'Token count unavailable, proceeding' ]; } $isValid = $tokenCount <= $this->maxInputTokens; return [ 'valid' => $isValid, 'token_count' => $tokenCount, 'max_tokens' => $this->maxInputTokens, 'message' => $isValid ? "Token count within limit: {$tokenCount}/{$this->maxInputTokens}" : "Token limit exceeded: {$tokenCount}/{$this->maxInputTokens}" ]; } /** * Calculate estimated tokens (fallback method without API call) * Rough estimate: 1 token ≈ 4 characters */ public function estimateTokens(string $text): int { return (int) ceil(strlen($text) / 4); } /** * Get max input token limit */ public function getMaxInputTokens(): int { return $this->maxInputTokens; } /** * Set custom max input tokens */ public function setMaxInputTokens(int $tokens): self { $this->maxInputTokens = $tokens; return $this; } } Traits/MiscellaneousTrait.php 0000644 00000007013 15213350437 0012336 0 ustar 00 <?php namespace App\Traits; use App\Models\BasicSettings\PageHeading; use App\Models\Language; use App\Models\User\Language as UserLanguage; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\URL; trait MiscellaneousTrait { public static function getLanguage() { // get the current locale of this system if (Session::has('currentLocaleCode')) { $locale = Session::get('currentLocaleCode'); } if (empty($locale)) { $language = Language::where('is_default', 1)->first(); } else { $language = Language::where('code', $locale)->first(); } if (empty($language)) { $language = Language::where('is_default', 1)->first(); } return $language; } public static function getCustomerCurrentLanguage() { // get the current locale of this system if (Session::has('user_midtrans')) { $user = Session::get('user_midtrans'); } else { $user = getUser(); } if (session()->has('user_lang')) { $userCurrentLang = UserLanguage::where('code', session()->get('user_lang'))->where('user_id', $user->id)->first(); if (empty($userCurrentLang)) { $userCurrentLang = UserLanguage::where('dashboard_default', 1)->where('user_id', $user->id)->first(); session()->put( 'user_lang', $userCurrentLang->code ); } } else { $userCurrentLang = UserLanguage::where('dashboard_default', 1)->where('user_id', $user->id)->first(); } return $userCurrentLang; } // public static function getBreadcrumb() // { // $breadcrumb = DB::table('basic_settings')->select('breadcrumb') // ->where('uniqid', '=', 12345) // ->first(); // return $breadcrumb; // } // public static function getPageHeading($language) // { // if (URL::current() == Route::is('rooms')) { // $pageHeading = PageHeading::select('rooms_title') // ->where('language_id', $language->id) // ->first(); // } else if (URL::current() == Route::is('services')) { // $pageHeading = PageHeading::select('services_title') // ->where('language_id', $language->id) // ->first(); // } else if (URL::current() == Route::is('blogs')) { // $pageHeading = PageHeading::select('blogs_title') // ->where('language_id', $language->id) // ->first(); // } else if (URL::current() == Route::is('gallery')) { // $pageHeading = PageHeading::select('gallery_title') // ->where('language_id', $language->id) // ->first(); // } else if (URL::current() == Route::is('packages')) { // $pageHeading = PageHeading::select('packages_title') // ->where('language_id', $language->id) // ->first(); // } else if (URL::current() == Route::is('faqs')) { // $pageHeading = PageHeading::select('faqs_title') // ->where('language_id', $language->id) // ->first(); // } else if (URL::current() == Route::is('contact')) { // $pageHeading = PageHeading::select('contact_us_title') // ->where('language_id', $language->id) // ->first(); // } // return $pageHeading; // } public static function getCurrencyInfo($userId) { $baseCurrencyInfo = DB::table('user_basic_settings')->where('user_id', $userId) ->select('base_currency_symbol', 'base_currency_symbol_position', 'base_currency_text', 'base_currency_text_position', 'base_currency_rate') ->first(); return $baseCurrencyInfo; } } Traits/Keywords.php 0000644 00000112524 15213350440 0010334 0 ustar 00 <?php namespace App\Traits; trait Keywords { public static function adminNameAttribute() { return [ "language" => "language", "contact_form_title" => "contact form title", "contact_info_title" => "contact info title", "contact_addresses" => "contact addresses", "contact_text" => "contact text", "contact_numbers" => "contact numbers", "contact_mails" => "contact mails", "pass_token" => "pass token", "password" => "password", "email" => "email", "website_title" => "website title", "year" => "year", "timezone" => "timezone", "base_color" => "base color", "base_color2" => "base color2", "base_currency_symbol" => "base currency symbol", "base_currency_symbol_position" => "base currency symbol position", "base_currency_text" => "base currency text", "base_currency_text_position" => "base currency text position", "base_currency_rate" => "base currency rate", "file" => "file", "cookie_alert_status" => "cookie alert status", "cookie_alert_text" => "cookie alert text", "favicon" => "favicon", "maintenance_status" => "maintenance status", "maintainance_text" => "maintainance text", "secret_path" => "secret path", "preloader_status" => "preloader status", "is_recaptcha" => "is recaptcha", "google_recaptcha_site_key" => "google recaptcha site key", "google_recaptcha_secret_key" => "google recaptcha secret key", "is_disqus" => "is disqus", "is_user_disqus" => "is user disqus", "disqus_shortname" => "disqus shortname", "is_tawkto" => "is tawkto", "tawkto_chat_link" => "tawkto chat link", "is_whatsapp" => "is whatsapp", "whatsapp_number" => "whatsapp number", "whatsapp_header_title" => "whatsapp header title", "whatsapp_popup_message" => "whatsapp popup message", "whatsapp_popup" => "whatsapp popup", "home_meta_keywords" => "home meta keywords", "home_meta_description" => "home meta description", "blogs_meta_keywords" => "blogs meta keywords", "blogs_meta_description" => "blogs meta description", "profiles_meta_keywords" => "profiles meta keywords", "profiles_meta_description" => "profiles meta description", "pricing_meta_keywords" => "pricing meta keywords", "pricing_meta_description" => "pricing meta description", "faqs_meta_keywords" => "faqs meta keywords", "faqs_meta_description" => "faqs meta description", "contact_meta_keywords" => "contact meta keywords", "contact_meta_description" => "contact meta description", "forget_password_meta_keywords" => "forget password meta keywords", "checkout_meta_keywords" => "checkout meta keywords", "checkout_meta_description" => "checkout meta description", "email_type" => "email type", "email_subject" => "email subject", "email_body" => "email body", "is_smtp" => "is smtp", "smtp_host" => "smtp host", "encryption" => "encryption", "smtp_username" => "smtp username", "smtp_password" => "smtp password", "from_mail" => "from mail", "from_name" => "from name", "to_mail" => "to mail", "icon" => "icon", "url" => "url", "serial_number" => "serial number", "name" => "name", "image" => "image", "title" => "title", "content" => "content", "domain" => "domain", "meta_description" => "meta_description", "language_id" => "language id", "category" => "category", "type" => "type", "answer" => "answer", "success_message" => "success message", "cname_record_section_title" => "cname record section title", "cname_record_section_text" => "cname record section text", "meta_keywords" => "meta keywords", "question" => "question", "footer_text" => "footer text", "useful_links_title" => "useful links title", "newsletter_title" => "newsletter title", "newsletter_subtitle" => "newsletter subtitle", "copyright_text" => "copyright text", "status" => "status", "ulink_id" => "ulink_id", "sandbox_check" => "sandbox check", "client_secret" => "client secret", "key" => "key", "secret" => "secret", "environment" => "environment", "website" => "website", "industry" => "industry", "token" => "token", "secret_key" => "secret key", "login_id" => "login ", "transaction_key" => "transaction key", "public_key" => "public key", "short_description" => "short description", "instructions" => "instructions", "is_receipt" => "is receipt", "work_process_title" => "work process title", "work_process_subtitle" => "work process subtitle", "preview_templates_title" => "preview templates title", "preview_templates_subtitle" => "preview templates subtitle", "featured_users_title" => "featured users title", "featured_users_subtitle" => "featured users subtitle", "partner_title" => "partner title", "partner_subtitle" => "partner subtitle", "pricing_title" => "pricing title", "pricing_subtitle" => "pricing subtitle", "testimonial_title" => "testimonial title", "testimonial_subtitle" => "testimonial subtitle", "blog_title" => "blog title", "blog_subtitle" => "blog subtitle", "intro_title" => "intro title", "intro_subtitle" => "intro subtitle", "intro_text" => "intro text", "intro_img" => "intro img", "intro_section_button_text" => "intro section button text", "intro_section_button_url" => "intro section button url", "intro_section_video_url" => "intro section video url", "home_section" => "home section", "process_section" => "process section", "featured_users_section" => "featured users section", "intro_section" => "intro section", "pricing_section" => "pricing section", "partners_section" => "partners section", "testimonial_section" => "testimonial section", "news_section" => "news section", "top_footer_section" => "top footer section", "copyright_section" => "copyright section", "hero_section_title" => "hero section title", "hero_section_text" => "hero section text", "hero_section_button_text" => "hero section button text", "hero_section_button_url" => "hero section button url", "text" => "text", "comment" => "comment", "rank" => "rank", "direction" => "direction", "code" => "code", "keyword" => "keyword", "term" => "term", "features" => "templatem section", "room_categories_limit" => "room categoriesm limit", "template_section" => "template section", "room_limit" => "room limit", "room_booking_limit" => "room booking limit", "language_limit" => "language limit", "package_categories_limit" => "package categories limit", "package_limit" => "package limit", "package_booking_limit" => "package booking limit", "featured" => "featured", "is_trial" => "trial", "trial_days" => "trial days", "recommended" => "recommended", "expiration_reminder" => "expiration reminder", "maximum_uses_limit" => "maximum uses limit", "start_date" => "start date", "end_date" => "end date", "body" => "body", "background_image" => "background image", "background_color" => "background color", "background_opacity" => "background opacity", "button_text" => "button text", "button_color" => "button color", "delay" => "delay", "button_url" => "button url", "old_password" => "old password", "first_name" => "first name", "payment_method" => "payment method", "company_name" => "company name", "phone" => "phone", "state" => "state", "city" => "city", "country" => "country", "address" => "address", "amount_status" => "amount status", "amount" => "amount", "new_password" => "new password", "confirm_password" => "confirm password", "preview_image" => "preview image", "filename" => "filename", "sitemap_url" => "sitemap url", "message" => "message", "zip_file" => "zip file", "search" => "search", "reply" => "reply", "is_ticket" => "ticket", "role_id" => "role", "min_limit" => "min limit", "withdraw_payment_method_id" => "withdraw payment method", "fixed_charge" => "fixed charge", "percentage_charge" => "percentage charge", "max_limit" => "maxlimit", "required" => "required", "label" => "label", "placeholder" => "placeholder", "subject" => "subject", "options" => "options", "language" => "language", "URL" => "URL", "expiration_reminder" => "expiration_reminderreminder days", "value" => "value", "password" => "password", "password_confirmation" => "password_confirmation", "subtitle" => "subtitle", "rating" => "rating", "adsense_publisher_id" => "adsense publisher", "smtp_port" => "smtp port", "user_keyword" => "user keyword", "front_keyword" => "front keyword", "last_name" => "last_name", "username" => "username", ]; } public static function adminFrontendValidationAttribute() { return [ "language" => "language", "contact_form_title" => "contact form title", "contact_info_title" => "contact info title", "contact_addresses" => "contact addresses", "contact_text" => "contact text", "contact_numbers" => "contact numbers", "contact_mails" => "contact mails", "pass_token" => "pass token", "password" => "password", "email" => "email", "website_title" => "website title", "year" => "year", "timezone" => "timezone", "base_color" => "base color", "base_color2" => "base color2", "base_currency_symbol" => "base currency symbol", "base_currency_symbol_position" => "base currency symbol position", "base_currency_text" => "base currency text", "base_currency_text_position" => "base currency text position", "base_currency_rate" => "base currency rate", "file" => "file", "cookie_alert_status" => "cookie alert status", "cookie_alert_text" => "cookie alert text", "favicon" => "favicon", "maintenance_status" => "maintenance status", "maintainance_text" => "maintainance text", "secret_path" => "secret path", "preloader_status" => "preloader status", "is_recaptcha" => "is recaptcha", "google_recaptcha_site_key" => "google recaptcha site key", "google_recaptcha_secret_key" => "google recaptcha secret key", "is_disqus" => "is disqus", "is_user_disqus" => "is user disqus", "disqus_shortname" => "disqus shortname", "is_tawkto" => "is tawkto", "tawkto_chat_link" => "tawkto chat link", "is_whatsapp" => "is whatsapp", "whatsapp_number" => "whatsapp number", "whatsapp_header_title" => "whatsapp header title", "whatsapp_popup_message" => "whatsapp popup message", "whatsapp_popup" => "whatsapp popup", "home_meta_keywords" => "home meta keywords", "home_meta_description" => "home meta description", "blogs_meta_keywords" => "blogs meta keywords", "blogs_meta_description" => "blogs meta description", "profiles_meta_keywords" => "profiles meta keywords", "profiles_meta_description" => "profiles meta description", "pricing_meta_keywords" => "pricing meta keywords", "pricing_meta_description" => "pricing meta description", "faqs_meta_keywords" => "faqs meta keywords", "faqs_meta_description" => "faqs meta description", "contact_meta_keywords" => "contact meta keywords", "contact_meta_description" => "contact meta description", "forget_password_meta_keywords" => "forget password meta keywords", "checkout_meta_keywords" => "checkout meta keywords", "checkout_meta_description" => "checkout meta description", "email_type" => "email type", "email_subject" => "email subject", "email_body" => "email body", "is_smtp" => "is smtp", "smtp_host" => "smtp host", "encryption" => "encryption", "smtp_username" => "smtp username", "smtp_password" => "smtp password", "from_mail" => "from mail", "from_name" => "from name", "to_mail" => "to mail", "icon" => "icon", "url" => "url", "serial_number" => "serial number", "name" => "name", "image" => "image", "title" => "title", "content" => "content", "domain" => "domain", "meta_description" => "meta_description", "language_id" => "language id", "category" => "category", "type" => "type", "answer" => "answer", "success_message" => "success message", "cname_record_section_title" => "cname record section title", "cname_record_section_text" => "cname record section text", "meta_keywords" => "meta keywords", "question" => "question", "footer_text" => "footer text", "useful_links_title" => "useful links title", "newsletter_title" => "newsletter title", "newsletter_subtitle" => "newsletter subtitle", "copyright_text" => "copyright text", "status" => "status", "ulink_id" => "ulink_id", "sandbox_check" => "sandbox check", "client_secret" => "client secret", "key" => "key", "secret" => "secret", "environment" => "environment", "website" => "website", "industry" => "industry", "token" => "token", "secret_key" => "secret key", "login_id" => "login ", "transaction_key" => "transaction key", "public_key" => "public key", "short_description" => "short description", "instructions" => "instructions", "is_receipt" => "is receipt", "work_process_title" => "work process title", "work_process_subtitle" => "work process subtitle", "preview_templates_title" => "preview templates title", "preview_templates_subtitle" => "preview templates subtitle", "featured_users_title" => "featured users title", "featured_users_subtitle" => "featured users subtitle", "partner_title" => "partner title", "partner_subtitle" => "partner subtitle", "pricing_title" => "pricing title", "pricing_subtitle" => "pricing subtitle", "testimonial_title" => "testimonial title", "testimonial_subtitle" => "testimonial subtitle", "blog_title" => "blog title", "blog_subtitle" => "blog subtitle", "intro_title" => "intro title", "intro_subtitle" => "intro subtitle", "intro_text" => "intro text", "intro_img" => "intro img", "intro_section_button_text" => "intro section button text", "intro_section_button_url" => "intro section button url", "intro_section_video_url" => "intro section video url", "home_section" => "home section", "process_section" => "process section", "featured_users_section" => "featured users section", "intro_section" => "intro section", "pricing_section" => "pricing section", "partners_section" => "partners section", "testimonial_section" => "testimonial section", "news_section" => "news section", "top_footer_section" => "top footer section", "copyright_section" => "copyright section", "hero_section_title" => "hero section title", "hero_section_text" => "hero section text", "hero_section_button_text" => "hero section button text", "hero_section_button_url" => "hero section button url", "text" => "text", "comment" => "comment", "rank" => "rank", "direction" => "direction", "code" => "code", "keyword" => "keyword", "term" => "term", "features" => "templatem section", "room_categories_limit" => "room categoriesm limit", "template_section" => "template section", "room_limit" => "room limit", "room_booking_limit" => "room booking limit", "language_limit" => "language limit", "package_categories_limit" => "package categories limit", "package_limit" => "package limit", "package_booking_limit" => "package booking limit", "featured" => "featured", "is_trial" => "trial", "trial_days" => "trial days", "recommended" => "recommended", "expiration_reminder" => "expiration reminder", "maximum_uses_limit" => "maximum uses limit", "start_date" => "start date", "end_date" => "end date", "body" => "body", "background_image" => "background image", "background_color" => "background color", "background_opacity" => "background opacity", "button_text" => "button text", "button_color" => "button color", "delay" => "delay", "button_url" => "button url", "old_password" => "old password", "first_name" => "first name", "payment_method" => "payment method", "company_name" => "company name", "phone" => "phone", "state" => "state", "city" => "city", "country" => "country", "address" => "address", "amount_status" => "amount status", "amount" => "amount", "new_password" => "new password", "confirm_password" => "confirm password", "preview_image" => "preview image", "filename" => "filename", "sitemap_url" => "sitemap url", "message" => "message", "zip_file" => "zip file", "search" => "search", "reply" => "reply", "is_ticket" => "ticket", "role_id" => "role", "min_limit" => "min limit", "withdraw_payment_method_id" => "withdraw payment method", "fixed_charge" => "fixed charge", "percentage_charge" => "percentage charge", "max_limit" => "maxlimit", "required" => "required", "label" => "label", "placeholder" => "placeholder", "subject" => "subject", "options" => "options", "language" => "language", "URL" => "URL", "first_name" => "first name", "last_name" => "last name", "company_name" => "company name", "username" => "username", "price" => "price", "receipt" => "receipt", "cardNumber" => "card Number", "month" => "month", "cardCVC" => "cardCVC", "identity_number" => "identity number", "zip_code" => "zip code", "stripeToken" => "stripeToken", ]; } public static function userNameAttribute() { return [ "language" => "language", "contact_form_title" => "contact form title", "contact_info_title" => "contact info title", "contact_addresses" => "contact addresses", "contact_text" => "contact text", "contact_numbers" => "contact numbers", "contact_mails" => "contact mails", "pass_token" => "pass token", "password" => "password", "email" => "email", "website_title" => "website title", "year" => "year", "timezone" => "timezone", "base_color" => "base color", "base_color2" => "base color2", "base_currency_symbol" => "base currency symbol", "base_currency_symbol_position" => "base currency symbol position", "base_currency_text" => "base currency text", "base_currency_text_position" => "base currency text position", "base_currency_rate" => "base currency rate", "file" => "file", "cookie_alert_status" => "cookie alert status", "cookie_alert_text" => "cookie alert text", "favicon" => "favicon", "maintenance_status" => "maintenance status", "maintainance_text" => "maintainance text", "secret_path" => "secret path", "preloader_status" => "preloader status", "is_recaptcha" => "is recaptcha", "google_recaptcha_site_key" => "google recaptcha site key", "google_recaptcha_secret_key" => "google recaptcha secret key", "is_disqus" => "is disqus", "is_user_disqus" => "is user disqus", "disqus_shortname" => "disqus shortname", "is_tawkto" => "is tawkto", "tawkto_chat_link" => "tawkto chat link", "is_whatsapp" => "is whatsapp", "whatsapp_number" => "whatsapp number", "whatsapp_header_title" => "whatsapp header title", "whatsapp_popup_message" => "whatsapp popup message", "whatsapp_popup" => "whatsapp popup", "home_meta_keywords" => "home meta keywords", "home_meta_description" => "home meta description", "blogs_meta_keywords" => "blogs meta keywords", "blogs_meta_description" => "blogs meta description", "profiles_meta_keywords" => "profiles meta keywords", "profiles_meta_description" => "profiles meta description", "pricing_meta_keywords" => "pricing meta keywords", "pricing_meta_description" => "pricing meta description", "faqs_meta_keywords" => "faqs meta keywords", "faqs_meta_description" => "faqs meta description", "contact_meta_keywords" => "contact meta keywords", "contact_meta_description" => "contact meta description", "forget_password_meta_keywords" => "forget password meta keywords", "checkout_meta_keywords" => "checkout meta keywords", "checkout_meta_description" => "checkout meta description", "email_type" => "email type", "email_subject" => "email subject", "email_body" => "email body", "is_smtp" => "is smtp", "smtp_host" => "smtp host", "encryption" => "encryption", "smtp_username" => "smtp username", "smtp_password" => "smtp password", "from_mail" => "from mail", "from_name" => "from name", "to_mail" => "to mail", "icon" => "icon", "url" => "url", "serial_number" => "serial number", "name" => "name", "image" => "image", "title" => "title", "content" => "content", "domain" => "domain", "meta_description" => "meta_description", "language_id" => "language id", "category" => "category", "type" => "type", "answer" => "answer", "success_message" => "success message", "cname_record_section_title" => "cname record section title", "cname_record_section_text" => "cname record section text", "meta_keywords" => "meta keywords", "question" => "question", "footer_text" => "footer text", "useful_links_title" => "useful links title", "newsletter_title" => "newsletter title", "newsletter_subtitle" => "newsletter subtitle", "copyright_text" => "copyright text", "status" => "status", "ulink_id" => "ulink_id", "sandbox_check" => "sandbox check", "client_secret" => "client secret", "key" => "key", "secret" => "secret", "environment" => "environment", "website" => "website", "industry" => "industry", "token" => "token", "secret_key" => "secret key", "login_id" => "login ", "transaction_key" => "transaction key", "public_key" => "public key", "short_description" => "short description", "instructions" => "instructions", "is_receipt" => "is receipt", "work_process_title" => "work process title", "work_process_subtitle" => "work process subtitle", "preview_templates_title" => "preview templates title", "preview_templates_subtitle" => "preview templates subtitle", "featured_users_title" => "featured users title", "featured_users_subtitle" => "featured users subtitle", "partner_title" => "partner title", "partner_subtitle" => "partner subtitle", "pricing_title" => "pricing title", "pricing_subtitle" => "pricing subtitle", "testimonial_title" => "testimonial title", "testimonial_subtitle" => "testimonial subtitle", "blog_title" => "blog title", "blog_subtitle" => "blog subtitle", "intro_title" => "intro title", "intro_subtitle" => "intro subtitle", "intro_text" => "intro text", "intro_img" => "intro img", "intro_section_button_text" => "intro section button text", "intro_section_button_url" => "intro section button url", "intro_section_video_url" => "intro section video url", "home_section" => "home section", "process_section" => "process section", "featured_users_section" => "featured users section", "intro_section" => "intro section", "pricing_section" => "pricing section", "partners_section" => "partners section", "testimonial_section" => "testimonial section", "news_section" => "news section", "top_footer_section" => "top footer section", "copyright_section" => "copyright section", "hero_section_title" => "hero section title", "hero_section_text" => "hero section text", "hero_section_button_text" => "hero section button text", "hero_section_button_url" => "hero section button url", "text" => "text", "comment" => "comment", "rank" => "rank", "direction" => "direction", "code" => "code", "keyword" => "keyword", "term" => "term", "features" => "templatem section", "room_categories_limit" => "room categoriesm limit", "template_section" => "template section", "room_limit" => "room limit", "room_booking_limit" => "room booking limit", "language_limit" => "language limit", "package_categories_limit" => "package categories limit", "package_limit" => "package limit", "package_booking_limit" => "package booking limit", "featured" => "featured", "is_trial" => "trial", "trial_days" => "trial days", "recommended" => "recommended", "expiration_reminder" => "expiration reminder", "maximum_uses_limit" => "maximum uses limit", "start_date" => "start date", "end_date" => "end date", "body" => "body", "background_image" => "background image", "background_color" => "background color", "background_opacity" => "background opacity", "button_text" => "button text", "button_color" => "button color", "delay" => "delay", "button_url" => "button url", "old_password" => "old password", "first_name" => "first name", "payment_method" => "payment method", "company_name" => "company name", "phone" => "phone", "state" => "state", "city" => "city", "country" => "country", "address" => "address", "amount_status" => "amount status", "amount" => "amount", "new_password" => "new password", "confirm_password" => "confirm password", "preview_image" => "preview image", "filename" => "filename", "sitemap_url" => "sitemap url", "message" => "message", "zip_file" => "zip file", "search" => "search", "reply" => "reply", "is_ticket" => "ticket", "role_id" => "role", "min_limit" => "min limit", "withdraw_payment_method_id" => "withdraw payment method", "fixed_charge" => "fixed charge", "percentage_charge" => "percentage charge", "max_limit" => "maxlimit", "required" => "required", "label" => "label", "placeholder" => "placeholder", "subject" => "subject", "options" => "options", "language" => "language", "URL" => "URL", "expiration_reminder" => "expiration_reminderreminder days", "value" => "value", "password" => "password", "password_confirmation" => "password_confirmation", "subtitle" => "subtitle", "rating" => "rating", "adsense_publisher_id" => "adsense publisher", "smtp_port" => "smtp port", "user_keyword" => "user keyword", "front_keyword" => "front keyword", "last_name" => "last_name", "username" => "username", "custom_domain" => "custom_domain", "catalog_mode" => "catalog_mode", "item_rating_system" => "item_rating_system", "tax" => "tax", "is_shop" => "is_shop", "charge" => "charge", "user_language_id" => "user_language_id", "category_id" => "category_id", "current_price" => "current_price", "previous_price" => "previous_price", "download_link" => "download_link", "maximum_uses_limit" => "maximum_uses_limit", "minimum_spend" => "minimum_spend", "thumbnail" => "thumbnail", "sku" => "sku", "download_file" => "download_file", "flash_percentage" => "flash_percentage", "start_time" => "start_time", "end_time" => "end_time", "room_category_status" => "room_category_status", "room_rating_status" => "room_rating_status", "room_guest_checkout_status" => "room_guest_checkout_status", "slider_image" => "slider_image", "slider_images" => "slider_images", "featured_img" => "featured_img", "quantity" => "quantity", "rent" => "rent", "bed" => "bed", "max_guests" => "max_guests", "bath" => "bath", "room_id" => "room_id", "description" => "description", "occupation" => "occupation", "video_link" => "video_link", "thumbnail_image" => "thumbnail_image", "pricing_type" => "pricing_type", "cover_image" => "cover_image", "premium" => "premium", "video" => "video", "video_content" => "video_content", "file_content" => "file_content", "video_preview" => "video_preview", "goal_amount" => "goal_amount", "min_amount" => "min_amount", "custom_amount" => "custom_amount", "shpping_fname" => "shpping_fname", "shpping_lname" => "shpping_lname", "shpping_email" => "shpping_email", "shpping_number" => "shpping_number", "shpping_city" => "shpping_city", "shpping_state" => "shpping_state", "shpping_address" => "shpping_address", "shpping_country" => "shpping_country", "billing_fname" => "billing_fname", "billing_lname" => "billing_lname", "billing_email" => "billing_email", "billing_number" => "billing_number", "billing_city" => "billing_city", "billing_state" => "billing_state", "billing_address" => "billing_address", "cookie_alert_button_text" => "cookie_alert_button_text", "about_button_text" => "about_button_text", "about_snd_button_text" => "about_snd_button_text", "about_button_url" => "about_button_url", "about_snd_button_url" => "about_snd_button_url", "video_section_image" => "video_section_image", "why_choose_us_section_title" => "why_choose_us_section_title", "why_choose_us_section_subtitle" => "why_choose_us_section_subtitle", "why_choose_us_section_button_text" => "why_choose_us_section_button_text", "why_choose_us_section_button_url" => "why_choose_us_section_button_url", "why_choose_us_section_video_image" => "why_choose_us_section_video_image", "why_choose_us_section_image" => "why_choose_us_section_image", "work_process_section_subtitle" => "work_process_section_subtitle", "work_process_section_title" => "work_process_section_title", "work_process_section_img" => "work_process_section_img", "work_process_section_video_img" => "work_process_section_video_img", "analytics_status" => "analytics_status", "measurement_id" => "measurement_id", "whatsapp_popup_status" => "whatsapp_popup_status", "whatsapp_status" => "whatsapp_status", "disqus_status" => "disqus_status", "disqus_short_name" => "disqus_short_name", "pixel_status" => "pixel_status", "pixel_id" => "pixel_id", "tawkto_status" => "tawkto_status", "tawkto_direct_chat_link" => "tawkto_direct_chat_link", "cv" => "cv", "slider_img" => "slider_img", "img" => "img", "count" => "count", "features_section_image" => "features_section_image", "background_image" => "background_image", "brand_img" => "brand_img", "brand_url" => "brand_url", "percentage" => "percentage", "position" => "position", "text_1" => "text_1", "text_2" => "text_2", "text_3" => "text_3", "ad_slot" => "ad_slot", "detail_page" => "detail_page", "designation" => "designation", "degree_name" => "degree_name", "rank" => "rank", "jcategory_id" => "jcategory_id", "deadline" => "deadline", "vacancy" => "vacancy", "employment_status" => "employment_status", "job_location" => "job_location", "salary" => "salary", "contact_form_image" => "contact_form_image", "contact_form_subtitle" => "contact_form_subtitle", "latitude" => "latitude", "longitude" => "longitude", "map_zoom" => "map_zoom", "body" => "body", "template_name" => "template_name", "show_in_home" => "show_in_home", "user_vcard_id" => "user_vcard_id", "vcard_name" => "vcard_name", "template" => "template", "profile_image" => "profile_image", "icons" => "icons", "colors" => "colors", "labels" => "labels", "values" => "values", ]; } } Libraries/I18N/I18N_Arabic.php 0000644 00000041357 15213350440 0011577 0 ustar 00 <?php namespace App\Libraries\I18N; use ReflectionMethod; /** * ---------------------------------------------------------------------- * * Copyright (c) 2006-2016 Khaled Al-Shamaa. * * http://www.ar-php.org * * PHP Version 5 * * ---------------------------------------------------------------------- * * LICENSE * * This program is open source product; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License (LGPL) * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>. * * ---------------------------------------------------------------------- * * Class Name: PHP and Arabic Language * * Filename: Arabic.php * * Original Author(s): Khaled Al-Sham'aa <khaled@ar-php.org> * * Purpose: Set of PHP classes developed to enhance Arabic web * applications by providing set of tools includes stem-based searching, * translitiration, soundex, Hijri calendar, charset detection and * converter, spell numbers, keyboard language, Muslim prayer time, * auto-summarization, and more... * * ---------------------------------------------------------------------- * * @desc Set of PHP classes developed to enhance Arabic web * applications by providing set of tools includes stem-based searching, * translitiration, soundex, Hijri calendar, charset detection and * converter, spell numbers, keyboard language, Muslim prayer time, * auto-summarization, and more... * * @category I18N * @package I18N_Arabic * @author Khaled Al-Shamaa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Shamaa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @version 4.0 released in Jan 8, 2016 * @link http://www.ar-php.org */ /** * Core PHP and Arabic language class * * @category I18N * @package I18N_Arabic * @author Khaled Al-Shamaa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Shamaa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ class I18N_Arabic { private $_inputCharset = 'utf-8'; private $_outputCharset = 'utf-8'; private $_compatible = array(); private $_lazyLoading = array(); private $_useAutoload; private $_useException; private $_compatibleMode; /** * @ignore */ public $myObject; /** * @ignore */ public $myClass; /** * @ignore */ public $myFile; /** * Load selected library/Arabic class you would like to use its functionality * * @param string $library [AutoSummarize|CharsetC|CharsetD|Date|Gender| * Glyphs|Identifier|KeySwap|Numbers|Query|Salat| * Soundex|StrToTime|WordTag|CompressStr|Mktime| * Transliteration|Stemmer|Standard|Normalise] * @param boolean $useAutoload True to use Autoload (default is false) * @param boolean $useException True to use Exception (default is false) * @param boolean $compatibleMode True to support old naming style before * version 3.0 (default is true) * * @desc Load selected library/class you would like to use its functionality * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function __construct( $library, $useAutoload=false, $useException=false, $compatibleMode=true ) { $this->_useAutoload = $useAutoload; $this->_useException = $useException; $this->_compatibleMode = $compatibleMode; $xml = simplexml_load_file(dirname(__FILE__).'/Arabic/data/config.xml'); foreach ($xml->xpath("//compatible/case") as $case) { $this->_compatible["{$case['old']}"] = (string)$case; } foreach ($xml->xpath("//lazyLoading/case") as $case) { $this->_lazyLoading["{$case['method']}"] = (string)$case; } /* Set internal character encoding to UTF-8 */ mb_internal_encoding("utf-8"); if ($this->_useAutoload) { // It is critical to remember that as soon as spl_autoload_register() is // called, __autoload() functions elsewhere in the application may fail // to be called. This is safer initial call (PHP 5 >= 5.1.2): if (false === spl_autoload_functions()) { if (function_exists('__autoload')) { spl_autoload_register('__autoload', false); } } spl_autoload_extensions('.php,.inc,.class'); spl_autoload_register('I18N_Arabic::autoload', false); } if ($this->_useException) { set_error_handler('I18N_Arabic::myErrorHandler'); } if ($library) { if ($this->_compatibleMode && array_key_exists($library, $this->_compatible) ) { $library = $this->_compatible[$library]; } $this->load($library); } } /** * Include file that include requested class * * @param string $className Class name * * @return null * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public static function autoload($className) { include self::getClassFile($className); } /** * Error handler function * * @param int $errno The level of the error raised * @param string $errstr The error message * @param string $errfile The filename that the error was raised in * @param int $errline The line number the error was raised at * * @return boolean FALSE * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public static function myErrorHandler($errno, $errstr, $errfile, $errline) { if ($errfile == __FILE__ || file_exists( dirname(__FILE__).DIRECTORY_SEPARATOR.'Arabic'. DIRECTORY_SEPARATOR.basename($errfile) ) ) { $msg = '<b>Arabic Class Exception:</b> '; $msg .= $errstr; $msg .= " in <b>$errfile</b>"; $msg .= " on line <b>$errline</b><br />"; throw new ArabicException($msg, $errno); } // If the function returns false then the normal error handler continues return false; } /** * Load selected Arabic library and create an instance of its class * * @param string $library Library name * * @return null * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function load($library) { if ($this->_compatibleMode && array_key_exists($library, $this->_compatible) ) { $library = $this->_compatible[$library]; } $this->myFile = $library; $this->myClass = 'App\Libraries\I18N\Arabic\I18N_Arabic_' . $library; $class = 'App\Libraries\I18N\Arabic\I18N_Arabic_' . $library; /* if (!$this->_useAutoload) { include self::getClassFile($this->myFile); } */ $this->myObject = new $class(); $this->{$library} = &$this->myObject; } /** * Magic method __call() allows to capture invocation of non existing methods. * That way __call() can be used to implement user defined method handling that * depends on the name of the actual method being called. * * @param string $methodName Method name * @param array $arguments Array of arguments * * @method Call a method from loaded sub class and take care of needed * character set conversion for both input and output values. * * @return The value returned from the __call() method will be returned to * the caller of the method. * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function __call($methodName, $arguments) { if ($this->_compatibleMode && array_key_exists($methodName, $this->_compatible) ) { $methodName = $this->_compatible[$methodName]; } // setMode & getMode [Date*|Query], setLang [Soundex*|CompressStr] if ('I18N_Arabic_'.$this->_lazyLoading[$methodName] != $this->myClass) { $this->load($this->_lazyLoading[$methodName]); } // Create an instance of the ReflectionMethod class $method = new ReflectionMethod($this->myClass, $methodName); $params = array(); $parameters = $method->getParameters(); foreach ($parameters as $parameter) { $name = $parameter->getName(); $value = array_shift($arguments); if (is_null($value) && $parameter->isDefaultValueAvailable()) { $value = $parameter->getDefaultValue(); } if ($methodName == 'decompress' || ($methodName == 'search' && $name == 'bin') || ($methodName == 'length' && $name == 'bin') ) { $params[$name] = $value; } else { $params[$name] = iconv($this->getInputCharset(), 'utf-8', $value); } } $value = call_user_func_array(array(&$this->myObject, $methodName), $params); if ($methodName == 'tagText') { $outputCharset = $this->getOutputCharset(); foreach ($value as $key=>$text) { $value[$key][0] = iconv('utf-8', $outputCharset, $text[0]); } } elseif ($methodName == 'compress' || $methodName == 'getPrayTime' || $methodName == 'str2graph' ) { } else { $value = iconv('utf-8', $this->getOutputCharset(), $value); } return $value; } /** * Garbage collection, release child objects directly * * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function __destruct() { $this->_inputCharset = null; $this->_outputCharset = null; $this->myObject = null; $this->myClass = null; } /** * Set charset used in class input Arabic strings * * @param string $charset Input charset [utf-8|windows-1256|iso-8859-6] * * @return TRUE if success, or FALSE if fail * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function setInputCharset($charset) { $flag = true; $charset = strtolower($charset); $charsets = array('utf-8', 'windows-1256', 'cp1256', 'iso-8859-6'); if (in_array($charset, $charsets)) { if ($charset == 'windows-1256') { $charset = 'cp1256'; } $this->_inputCharset = $charset; } else { $flag = false; } return $flag; } /** * Set charset used in class output Arabic strings * * @param string $charset Output charset [utf-8|windows-1256|iso-8859-6] * * @return boolean TRUE if success, or FALSE if fail * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function setOutputCharset($charset) { $flag = true; $charset = strtolower($charset); $charsets = array('utf-8', 'windows-1256', 'cp1256', 'iso-8859-6'); if (in_array($charset, $charsets)) { if ($charset == 'windows-1256') { $charset = 'cp1256'; } $this->_outputCharset = $charset; } else { $flag = false; } return $flag; } /** * Get the charset used in the input Arabic strings * * @return string return current setting for class input Arabic charset * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function getInputCharset() { if ($this->_inputCharset == 'cp1256') { $charset = 'windows-1256'; } else { $charset = $this->_inputCharset; } return $charset; } /** * Get the charset used in the output Arabic strings * * @return string return current setting for class output Arabic charset * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function getOutputCharset() { if ($this->_outputCharset == 'cp1256') { $charset = 'windows-1256'; } else { $charset = $this->_outputCharset; } return $charset; } /** * Get sub class file path to be included (mapping between class name and * file name/path become independent now) * * @param string $class Sub class name * * @return string Sub class file path * @author Khaled Al-Shamaa <khaled@ar-php.org> */ protected static function getClassFile($class) { $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Arabic'; $file = $dir . DIRECTORY_SEPARATOR . $class . '.php'; return $file; } /** * Send/set output charset in several output media in a proper way * * @param string $mode [http|html|mysql|mysqli|pdo|text_email|html_email] * @param resource $conn The MySQL connection handler/the link identifier * * @return string header formula if there is any (in cases of html, * text_email, and html_email) * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public function header($mode = 'http', $conn = null) { $mode = strtolower($mode); $head = ''; switch ($mode) { case 'http': header('Content-Type: text/html; charset=' . $this->_outputCharset); break; case 'html': $head .= '<meta http-equiv="Content-type" content="text/html; charset='; $head .= $this->_outputCharset . '" />'; break; case 'text_email': $head .= 'MIME-Version: 1.0\r\nContent-type: text/plain; charset='; $head .= $this->_outputCharset . '\r\n'; break; case 'html_email': $head .= 'MIME-Version: 1.0\r\nContent-type: text/html; charset='; $head .= $this->_outputCharset . '\r\n'; break; case 'mysql': if ($this->_outputCharset == 'utf-8') { mysql_set_charset('utf8'); } elseif ($this->_outputCharset == 'windows-1256') { mysql_set_charset('cp1256'); } break; case 'mysqli': if ($this->_outputCharset == 'utf-8') { $conn->set_charset('utf8'); } elseif ($this->_outputCharset == 'windows-1256') { $conn->set_charset('cp1256'); } break; case 'pdo': if ($this->_outputCharset == 'utf-8') { $conn->exec('SET NAMES utf8'); } elseif ($this->_outputCharset == 'windows-1256') { $conn->exec('SET NAMES cp1256'); } break; } return $head; } /** * Get web browser chosen/default language using ISO 639-1 codes (2-letter) * * @return string Language using ISO 639-1 codes (2-letter) * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public static function getBrowserLang() { $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); // ar, en, etc... return $lang; } /** * There is still a lack of original, localized, high-quality content and * well-structured Arabic websites; This method help in tag HTML result pages * from Arabic forum to enable filter it in/out. * * @param string $html The HTML content of the page in question * * @return boolean True if the input HTML is belong to a forum page * @author Khaled Al-Shamaa <khaled@ar-php.org> */ public static function isForum($html) { $forum = false; if (strpos($html, 'vBulletin_init();') !== false) { $forum = true; } return $forum; } } /** * Arabic Exception class defined by extending the built-in Exception class. * * @category I18N * @package I18N_Arabic * @author Khaled Al-Shamaa <khaled@ar-php.org> * @copyright 2006-2013 Khaled Al-Shamaa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ /** class ArabicException extends Exception { public function __construct($message, $code=0) { parent::__construct($message, $code); } } */ Libraries/I18N/Arabic/LGPL 0000644 00000016727 15213350440 0011013 0 ustar 00 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. Libraries/I18N/Arabic/CharsetD.php 0000644 00000012745 15213350440 0012534 0 ustar 00 <?php /** * ---------------------------------------------------------------------- * * Copyright (c) 2006-2016 Khaled Al-Sham'aa. * * http://www.ar-php.org * * PHP Version 5 * * ---------------------------------------------------------------------- * * LICENSE * * This program is open source product; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License (LGPL) * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>. * * ---------------------------------------------------------------------- * * Class Name: Detect Arabic String Character Set * * Filename: CharsetD.php * * Original Author(s): Khaled Al-Sham'aa <khaled@ar-php.org> * * Purpose: This class will return Arabic character set that used for * a given Arabic string passing into this class, those available * character sets that can be detected by this class includes * the most popular three: Windows-1256, ISO 8859-6, and UTF-8. * * ---------------------------------------------------------------------- * * Detect Arabic String Character Set * * The last step of the Information Retrieval process is to display the found * documents to the user. However, some difficulties might occur at that point. * English texts are usually written in the ASCII standard. Unlike the English * language, many languages have different character sets, and do not have one * standard. This plurality of standards causes problems, especially in a web * environment. * * This PHP class will return Arabic character set that used for a given * Arabic string passing into this class, those available character sets that can * be detected by this class includes the most popular three: Windows-1256, * ISO 8859-6, and UTF-8. * * Example: * <code> * include('./I18N/Arabic.php'); * $obj = new I18N_Arabic('CharsetD'); * * $charset = $obj->getCharset($text); * </code> * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ /** * This PHP class detect Arabic string character set * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ class I18N_Arabic_CharsetD { /** * Loads initialize values * * @ignore */ public function __construct() { } /** * Count number of hits for the most frequented letters in Arabic language * (Alef, Lam and Yaa), then calculate association ratio with each of * possible character set (UTF-8, Windows-1256 and ISO-8859-6) * * @param String $string Arabic string in unknown format * * @return Array Character set as key and string association ratio as value * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function guess($string) { // The most frequent Arabic letters are Alef, Lam, and Yeh $charset['windows-1256'] = substr_count($string, chr(199)); $charset['windows-1256'] += substr_count($string, chr(225)); $charset['windows-1256'] += substr_count($string, chr(237)); $charset['iso-8859-6'] = substr_count($string, chr(199)); $charset['iso-8859-6'] += substr_count($string, chr(228)); $charset['iso-8859-6'] += substr_count($string, chr(234)); $charset['utf-8'] = substr_count($string, chr(216).chr(167)); $charset['utf-8'] += substr_count($string, chr(217).chr(132)); $charset['utf-8'] += substr_count($string, chr(217).chr(138)); $total = $charset['windows-1256'] + $charset['iso-8859-6'] + $charset['utf-8'] + 1; $charset['windows-1256'] = round($charset['windows-1256'] * 100 / $total); $charset['iso-8859-6'] = round($charset['iso-8859-6'] * 100 / $total); $charset['utf-8'] = round($charset['utf-8'] * 100 / $total); return $charset; } /** * Find the most possible character set for given Arabic string in unknown * format * * @param String $string Arabic string in unknown format * * @return String The most possible character set for given Arabic string in * unknown format[utf-8|windows-1256|iso-8859-6] * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function getCharset($string) { if (preg_match('/<meta .* charset=([^\"]+)".*>/sim', $string, $matches)) { $value = $matches[1]; } else { $charset = $this->guess($string); arsort($charset); $value = key($charset); } return $value; } } Libraries/I18N/Arabic/KeySwap.php 0000644 00000032666 15213350440 0012426 0 ustar 00 <?php /** * ---------------------------------------------------------------------- * * Copyright (c) 2006-2016 Khaled Al-Sham'aa * * http://www.ar-php.org * * PHP Version 5 * * ---------------------------------------------------------------------- * * LICENSE * * This program is open source product; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License (LGPL) * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>. * * ---------------------------------------------------------------------- * * Class Name: Arabic Keyboard Swapping Language * * Filename: KeySwap.php * * Original Author(s): Khaled Al-Sham'aa <khaled@ar-php.org> * * Purpose: Convert keyboard language programmatically (English - Arabic) * * ---------------------------------------------------------------------- * * Arabic Keyboard Swapping Language * * PHP class to convert keyboard language between English and Arabic * programmatically. This function can be helpful in dual language forms when * users miss change keyboard language while they are entering data. * * If you wrote an Arabic sentence while your keyboard stays in English mode by * mistake, you will get a non-sense English text on your PC screen. In that case * you can use this class to make a kind of magic conversion to swap that odd text * by original Arabic sentence you meant when you type on your keyboard. * * Please note that magic conversion in the opposite direction (if you type English * sentences while your keyboard stays in Arabic mode) is also available in this * class, but it is not reliable as much as previous case because in Arabic keyboard * we have some keys provide a short-cut to type two chars in one click (those keys * include: b, B, G and T). * * Well, we try in this class to come over this issue by suppose that user used * optimum way by using short-cut keys when available instead of assemble chars * using stand alone keys, but if (s)he does not then you may have some typo chars * in converted text. * * Example: * <code> * include('./I18N/Arabic.php'); * $obj = new I18N_Arabic('KeySwap'); * * $str = "Hpf lk hgkhs hglj'vtdkK Hpf hg`dk dldg,k f;gdjil Ygn ,p]hkdm ..."; * * echo "<p><u><i>Before:</i></u><br />$str<br /><br />"; * * $text = $obj->swapEa($str); * * echo "<u><i>After:</i></u><br />$text<br /><br />"; * </code> * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ /** * This PHP class convert keyboard language programmatically (English - Arabic) * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ class I18N_Arabic_KeySwap { private $_transliteration = array(); private $_arLogodd; private $_enLogodd; private $_arKeyboard; private $_enKeyboard; private $_frKeyboard; /** * Loads initialize values * * @ignore */ public function __construct() { $xml = simplexml_load_file(dirname(__FILE__).'/data/charset/arabizi.xml'); foreach ($xml->transliteration->item as $item) { $index = $item['id']; $this->_transliteration["$index"] = (string)$item; } $xml = simplexml_load_file(dirname(__FILE__).'/data/ArKeySwap.xml'); foreach ($xml->arabic->key as $key) { $index = (int)$key['id']; $this->_arKeyboard[$index] = (string)$key; } foreach ($xml->english->key as $key) { $index = (int)$key['id']; $this->_enKeyboard[$index] = (string)$key; } foreach ($xml->french->key as $key) { $index = (int)$key['id']; $this->_frKeyboard[$index] = (string)$key; } $this->_arLogodd = file(dirname(__FILE__).'/data/ar-logodd.php'); $this->_enLogodd = file(dirname(__FILE__).'/data/en-logodd.php'); } /** * Make conversion to swap that odd Arabic text by original English sentence * you meant when you type on your keyboard (if keyboard language was * incorrect) * * @param string $text Odd Arabic string * * @return string Normal English string * @author Khaled Al-Sham'aa */ public function swapAe($text) { $output = $this->_swapCore($text, 'ar', 'en'); return $output; } /** * Make conversion to swap that odd English text by original Arabic sentence * you meant when you type on your keyboard (if keyboard language was * incorrect) * * @param string $text Odd English string * * @return string Normal Arabic string * @author Khaled Al-Sham'aa */ public function swapEa($text) { $output = $this->_swapCore($text, 'en', 'ar'); return $output; } /** * Make conversion to swap that odd Arabic text by original French sentence * you meant when you type on your keyboard (if keyboard language was * incorrect) * * @param string $text Odd Arabic string * * @return string Normal French string * @author Khaled Al-Sham'aa */ public function swapAf($text) { $output = $this->_swapCore($text, 'ar', 'fr'); return $output; } /** * Make conversion to swap that odd French text by original Arabic sentence * you meant when you type on your keyboard (if keyboard language was * incorrect) * * @param string $text Odd French string * * @return string Normal Arabic string * @author Khaled Al-Sham'aa */ public function swapFa($text) { $output = $this->_swapCore($text, 'fr', 'ar'); return $output; } /** * Make conversion between different keyboard maps to swap odd text in * one language by original meaningful text in another language that * you meant when you type on your keyboard (if keyboard language was * incorrect) * * @param string $text Odd string * @param string $in Input language [ar|en|fr] * @param string $out Output language [ar|en|fr] * * @return string Normal string * @author Khaled Al-Sham'aa */ private function _swapCore($text, $in, $out) { $output = ''; $text = stripslashes($text); $max = mb_strlen($text); switch ($in) { case 'ar': $inputMap = $this->_arKeyboard; break; case 'en': $inputMap = $this->_enKeyboard; break; case 'fr': $inputMap = $this->_frKeyboard; break; } switch ($out) { case 'ar': $outputMap = $this->_arKeyboard; break; case 'en': $outputMap = $this->_enKeyboard; break; case 'fr': $outputMap = $this->_frKeyboard; break; } for ($i=0; $i<$max; $i++) { $chr = mb_substr($text, $i, 1); $key = array_search($chr, $inputMap); if ($key === false) { $output .= $chr; } else { $output .= $outputMap[$key]; } } return $output; } /** * Calculate the log odd probability that inserted string from keyboard * is in English language * * @param string $str Inserted string from the keyboard * * @return float Calculated score for input string as English language * @author Khaled Al-Sham'aa */ protected function checkEn($str) { $lines = $this->_enLogodd; $logodd = array(); $line = array_shift($lines); $line = rtrim($line); $second = preg_split("/\t/", $line); $temp = array_shift($second); foreach ($lines as $line) { $line = rtrim($line); $values = preg_split("/\t/", $line); $first = array_shift($values); for ($i=0; $i<28; $i++) { $logodd["$first"]["{$second[$i]}"] = $values[$i]; } } $str = mb_strtolower($str); $max = mb_strlen($str, 'UTF-8'); $rank = 0; for ($i=1; $i<$max; $i++) { $first = mb_substr($str, $i-1, 1, 'UTF-8'); $second = mb_substr($str, $i, 1, 'UTF-8'); if (isset($logodd["$first"]["$second"])) { $rank += $logodd["$first"]["$second"]; } else { $rank -= 10; } } return $rank; } /** * Calculate the log odd probability that inserted string from keyboard * is in Arabic language * * @param string $str Inserted string from the keyboard * * @return float Calculated score for input string as Arabic language * @author Khaled Al-Sham'aa */ protected function checkAr($str) { $lines = $this->_arLogodd; $logodd = array(); $line = array_shift($lines); $line = rtrim($line); $second = preg_split("/\t/", $line); $temp = array_shift($second); foreach ($lines as $line) { $line = rtrim($line); $values = preg_split("/\t/", $line); $first = array_shift($values); for ($i=0; $i<37; $i++) { $logodd["$first"]["{$second[$i]}"] = $values[$i]; } } $max = mb_strlen($str, 'UTF-8'); $rank = 0; for ($i=1; $i<$max; $i++) { $first = mb_substr($str, $i-1, 1, 'UTF-8'); $second = mb_substr($str, $i, 1, 'UTF-8'); if (isset($logodd["$first"]["$second"])) { $rank += $logodd["$first"]["$second"]; } else { $rank -= 10; } } return $rank; } /** * This method will automatically detect the language of content supplied * in the input string. It will return the suggestion of correct inserted text. * The accuracy of the automatic language detection increases with the amount * of text entered. * * @param string $str Inserted string from the keyboard * * @return string Fixed string language and letter case to the better guess * @author Khaled Al-Sham'aa */ public function fixKeyboardLang($str) { preg_match_all("/([\x{0600}-\x{06FF}])/u", $str, $matches); $arNum = count($matches[0]); $nonArNum = mb_strlen(str_replace(' ', '', $str), 'UTF-8') - $arNum; $capital = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; $small = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; if ($arNum > $nonArNum) { $arStr = $str; $enStr = $this->swapAe($str); $isAr = true; } else { $arStr = $this->swapEa($str); $enStr = $str; $strCaps = strtr($str, $capital, $small); $arStrCaps = $this->swapEa($strCaps); $isAr = false; } $enRank = $this->checkEn($enStr); $arRank = $this->checkAr($arStr); if ($arNum > $nonArNum) { $arCapsRank = $arRank; } else { $arCapsRank = $this->checkAr($arStrCaps); } if ($enRank > $arRank && $enRank > $arCapsRank) { if ($isAr) { $fix = $enStr; } else { preg_match_all("/([A-Z])/u", $enStr, $matches); $capsNum = count($matches[0]); preg_match_all("/([a-z])/u", $enStr, $matches); $nonCapsNum = count($matches[0]); if ($capsNum > $nonCapsNum && $nonCapsNum > 0) { $enCapsStr = strtr($enStr, $capital, $small); $fix = $enCapsStr; } else { $fix = ''; } } } else { if ($arCapsRank > $arRank) { $arStr = $arStrCaps; $arRank = $arCapsRank; } if (!$isAr) { $fix = $arStr; } else { $fix = ''; } } return $fix; } } Libraries/I18N/Arabic/Query.php 0000644 00000051732 15213350440 0012143 0 ustar 00 <?php /** * ---------------------------------------------------------------------- * * Copyright (c) 2006-2016 Khaled Al-Sham'aa. * * http://www.ar-php.org * * PHP Version 5 * * ---------------------------------------------------------------------- * * LICENSE * * This program is open source product; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License (LGPL) * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>. * * ---------------------------------------------------------------------- * * Class Name: Arabic Queary Class * * Filename: Query.php * * Original Author(s): Khaled Al-Sham'aa <khaled@ar-php.org> * * Purpose: Build WHERE condition for SQL statement using MySQL REGEXP and * Arabic lexical rules * * ---------------------------------------------------------------------- * * Arabic Queary Class * * PHP class build WHERE condition for SQL statement using MySQL REGEXP and * Arabic lexical rules. * * With the exception of the Qur'an and pedagogical texts, Arabic is generally * written without vowels or other graphic symbols that indicate how a word is * pronounced. The reader is expected to fill these in from context. Some of the * graphic symbols include sukuun, which is placed over a consonant to indicate that * it is not followed by a vowel; shadda, written over a consonant to indicate it is * doubled; and hamza, the sign of the glottal stop, which can be written above or * below (alif) at the beginning of a word, or on (alif), (waaw), (yaa'), * or by itself on the line elsewhere. Also, common spelling differences regularly * appear, including the use of (haa') for (taa' marbuuta) and (alif maqsuura) * for (yaa'). These features of written Arabic, which are also seen in Hebrew as * well as other languages written with Arabic script (such as Farsi, Pashto, and * Urdu), make analyzing and searching texts quite challenging. In addition, Arabic * morphology and grammar are quite rich and present some unique issues for * information retrieval applications. * * There are essentially three ways to search an Arabic text with Arabic queries: * literal, stem-based or root-based. * * A literal search, the simplest search and retrieval method, matches documents * based on the search terms exactly as the user entered them. The advantage of this * technique is that the documents returned will without a doubt contain the exact * term for which the user is looking. But this advantage is also the biggest * disadvantage: many, if not most, of the documents containing the terms in * different forms will be missed. Given the many ambiguities of written Arabic, the * success rate of this method is quite low. For example, if the user searches * for (kitaab, book), he or she will not find documents that only * contain (`al-kitaabu, the book). * * Stem-based searching, a more complicated method, requires some normalization of * the original texts and the queries. This is done by removing the vowel signs, * unifying the hamza forms and removing or standardizing the other signs. * Additionally, grammatical affixes and other constructions which attach directly * to words, such as conjunctions, prepositions, and the definite article, should be * identified and removed. Finally, regular and irregular plural forms need to be * identified and reduced to their singular forms. Performing this type of stemming * leads to more successful searches, but can be problematic due to over-generation * or incorrect generation of stems. * * A third method for searching Arabic texts is to index and search for the root * forms of each word. Since most verbs and nouns in Arabic are derived from * triliteral (or, rarely, quadriliteral) roots, identifying the underlying root of * each word theoretically retrieves most of the documents containing a given search * term regardless of form. However, there are some significant challenges with this * approach. Determining the root for a given word is extremely difficult, since it * requires a detailed morphological, syntactic and semantic analysis of the text to * fully disambiguate the root forms. The issue is complicated further by the fact * that not all words are derived from roots. For example, loan words (words * borrowed from another language) are not based on root forms, although there are * even exceptions to this rule. For example, some loans that have a structure * similar to triliteral roots, such as the English word film, are handled * grammatically as if they were root-based, adding to the complexity of this type * of search. Finally, the root can serve as the foundation for a wide variety of * words with related meanings. The root (k-t-b) is used for many words related * to writing, including (kataba, to write), (kitaab, book), (maktab, * office), and (kaatib, author). But the same root is also used for regiment/ * battalion, (katiiba). As a result, searching based on root forms results in * very high recall, but precision is usually quite low. * * While search and retrieval of Arabic text will never be an easy task, relying on * linguistic analysis tools and methods can help make the process more successful. * Ultimately, the search method you choose should depend on how critical it is to * retrieve every conceivable instance of a word or phrase and the resources you * have to process search returns in order to determine their true relevance. * * Source: Volume 13 Issue 7 of MultiLingual Computing & * Technology published by MultiLingual Computing, Inc., 319 North First Ave., * Sandpoint, Idaho, USA, 208-263-8178, Fax: 208-263-6310. * * Example: * <code> * include('./I18N/Arabic.php'); * $obj = new I18N_Arabic('Query'); * * $dbuser = 'root'; * $dbpwd = ''; * $dbname = 'test'; * * try { * $dbh = new PDO('mysql:host=localhost;dbname='.$dbname, $dbuser, $dbpwd); * * // Set the error reporting attribute * $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); * * $dbh->exec("SET NAMES 'utf8'"); * * if ($_GET['keyword'] != '') { * $keyword = @$_GET['keyword']; * $keyword = str_replace('\"', '"', $keyword); * * $obj->setStrFields('headline'); * $obj->setMode($_GET['mode']); * * $strCondition = $Arabic->getWhereCondition($keyword); * } else { * $strCondition = '1'; * } * * $StrSQL = "SELECT `headline` FROM `aljazeera` WHERE $strCondition"; * * $i = 0; * foreach ($dbh->query($StrSQL) as $row) { * $headline = $row['headline']; * $i++; * if ($i % 2 == 0) { * $bg = "#f0f0f0"; * } else { * $bg = "#ffffff"; * } * echo "<tr bgcolor=\"$bg\"><td>$headline</td></tr>"; * } * * // Close the databse connection * $dbh = null; * * } catch (PDOException $e) { * echo $e->getMessage(); * } * </code> * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ /** * This PHP class build WHERE condition for SQL statement using MySQL REGEXP and * Arabic lexical rules * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ class I18N_Arabic_Query { private $_fields = array(); private $_lexPatterns = array(); private $_lexReplacements = array(); private $_mode = 0; /** * Loads initialize values */ public function __construct() { $xml = simplexml_load_file(dirname(__FILE__).'/data/ArQuery.xml'); foreach ($xml->xpath("//preg_replace[@function='__construct']/pair") as $pair) { array_push($this->_lexPatterns, (string)$pair->search); array_push($this->_lexReplacements, (string)$pair->replace); } } /** * Setting value for $_fields array * * @param array $arrConfig Name of the fields that SQL statement will search * them (in array format where items are those * fields names) * * @return object $this to build a fluent interface * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function setArrFields($arrConfig) { if (is_array($arrConfig)) { // Get _fields array $this->_fields = $arrConfig; } return $this; } /** * Setting value for $_fields array * * @param string $strConfig Name of the fields that SQL statement will search * them (in string format using comma as delimated) * * @return object $this to build a fluent interface * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function setStrFields($strConfig) { if (is_string($strConfig)) { // Get _fields array $this->_fields = explode(',', $strConfig); } return $this; } /** * Setting $mode propority value that refer to search mode * [0 for OR logic | 1 for AND logic] * * @param integer $mode Setting value to be saved in the $mode propority * * @return object $this to build a fluent interface * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function setMode($mode) { if (in_array($mode, array('0', '1'))) { // Set search mode [0 for OR logic | 1 for AND logic] $this->_mode = $mode; } return $this; } /** * Getting $mode propority value that refer to search mode * [0 for OR logic | 1 for AND logic] * * @return integer Value of $mode properity * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function getMode() { // Get search mode value [0 for OR logic | 1 for AND logic] return $this->_mode; } /** * Getting values of $_fields Array in array format * * @return array Value of $_fields array in Array format * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function getArrFields() { $fields = $this->_fields; return $fields; } /** * Getting values of $_fields array in String format (comma delimated) * * @return string Values of $_fields array in String format (comma delimated) * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function getStrFields() { $fields = implode(',', $this->_fields); return $fields; } /** * Build WHERE section of the SQL statement using defind lex's rules, search * mode [AND | OR], and handle also phrases (inclosed by "") using normal * LIKE condition to match it as it is. * * @param string $arg String that user search for in the database table * * @return string The WHERE section in SQL statement * (MySQL database engine format) * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function getWhereCondition($arg) { $sql = ''; //$arg = mysql_real_escape_string($arg); $search = array("\\", "\x00", "\n", "\r", "'", '"', "\x1a"); $replace = array("\\\\","\\0","\\n", "\\r", "\'", '\"', "\\Z"); $arg = str_replace($search, $replace, $arg); // Check if there are phrases in $arg should handle as it is $phrase = explode("\"", $arg); if (count($phrase) > 2) { // Re-init $arg variable // (It will contain the rest of $arg except phrases). $arg = ''; for ($i = 0; $i < count($phrase); $i++) { $subPhrase = $phrase[$i]; if ($i % 2 == 0 && $subPhrase != '') { // Re-build $arg variable after restricting phrases $arg .= $subPhrase; } elseif ($i % 2 == 1 && $subPhrase != '') { // Handle phrases using reqular LIKE matching in MySQL $this->wordCondition[] = $this->getWordLike($subPhrase); } } } // Handle normal $arg using lex's and regular expresion $words = preg_split('/\s+/', trim($arg)); foreach ($words as $word) { //if (is_numeric($word) || strlen($word) > 2) { // Take off all the punctuation //$word = preg_replace("/\p{P}/", '', $word); $exclude = array('(', ')', '[', ']', '{', '}', ',', ';', ':', '?', '!', '،', '؛', '؟'); $word = str_replace($exclude, '', $word); $this->wordCondition[] = $this->getWordRegExp($word); //} } if (!empty($this->wordCondition)) { if ($this->_mode == 0) { $sql = '(' . implode(') OR (', $this->wordCondition) . ')'; } elseif ($this->_mode == 1) { $sql = '(' . implode(') AND (', $this->wordCondition) . ')'; } } return $sql; } /** * Search condition in SQL format for one word in all defind fields using * REGEXP clause and lex's rules * * @param string $arg String (one word) that you want to build a condition for * * @return string sub SQL condition (for internal use) * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ protected function getWordRegExp($arg) { $arg = $this->lex($arg); //$sql = implode(" REGEXP '$arg' OR ", $this->_fields) . " REGEXP '$arg'"; $sql = ' REPLACE(' . implode(", 'ـ', '') REGEXP '$arg' OR REPLACE(", $this->_fields) . ", 'ـ', '') REGEXP '$arg'"; return $sql; } /** * Search condition in SQL format for one word in all defind fields using * normal LIKE clause * * @param string $arg String (one word) that you want to build a condition for * * @return string sub SQL condition (for internal use) * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ protected function getWordLike($arg) { $sql = implode(" LIKE '$arg' OR ", $this->_fields) . " LIKE '$arg'"; return $sql; } /** * Get more relevant order by section related to the user search keywords * * @param string $arg String that user search for in the database table * * @return string sub SQL ORDER BY section * @author Saleh AlMatrafe <saleh@saleh.cc> */ public function getOrderBy($arg) { // Check if there are phrases in $arg should handle as it is $phrase = explode("\"", $arg); if (count($phrase) > 2) { // Re-init $arg variable // (It will contain the rest of $arg except phrases). $arg = ''; for ($i = 0; $i < count($phrase); $i++) { if ($i % 2 == 0 && $phrase[$i] != '') { // Re-build $arg variable after restricting phrases $arg .= $phrase[$i]; } elseif ($i % 2 == 1 && $phrase[$i] != '') { // Handle phrases using reqular LIKE matching in MySQL $wordOrder[] = $this->getWordLike($phrase[$i]); } } } // Handle normal $arg using lex's and regular expresion $words = explode(' ', $arg); foreach ($words as $word) { if ($word != '') { $wordOrder[] = 'CASE WHEN ' . $this->getWordRegExp($word) . ' THEN 1 ELSE 0 END'; } } $order = '((' . implode(') + (', $wordOrder) . ')) DESC'; return $order; } /** * This method will implement various regular expressin rules based on * pre-defined Arabic lexical rules * * @param string $arg String of one word user want to search for * * @return string Regular Expression format to be used in MySQL query statement * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ protected function lex($arg) { $arg = preg_replace($this->_lexPatterns, $this->_lexReplacements, $arg); return $arg; } /** * Get most possible Arabic lexical forms for a given word * * @param string $word String that user search for * * @return string list of most possible Arabic lexical forms for a given word * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ protected function allWordForms($word) { $wordForms = array($word); $postfix1 = array('كم', 'كن', 'نا', 'ها', 'هم', 'هن'); $postfix2 = array('ين', 'ون', 'ان', 'ات', 'وا'); $len = mb_strlen($word); if (mb_substr($word, 0, 2) == 'ال') { $word = mb_substr($word, 2); } $wordForms[] = $word; $str1 = mb_substr($word, 0, -1); $str2 = mb_substr($word, 0, -2); $str3 = mb_substr($word, 0, -3); $last1 = mb_substr($word, -1); $last2 = mb_substr($word, -2); $last3 = mb_substr($word, -3); if ($len >= 6 && $last3 == 'تين') { $wordForms[] = $str3; $wordForms[] = $str3 . 'ة'; $wordForms[] = $word . 'ة'; } if ($len >= 6 && ($last3 == 'كما' || $last3 == 'هما')) { $wordForms[] = $str3; $wordForms[] = $str3 . 'كما'; $wordForms[] = $str3 . 'هما'; } if ($len >= 5 && in_array($last2, $postfix2)) { $wordForms[] = $str2; $wordForms[] = $str2.'ة'; $wordForms[] = $str2.'تين'; foreach ($postfix2 as $postfix) { $wordForms[] = $str2 . $postfix; } } if ($len >= 5 && in_array($last2, $postfix1)) { $wordForms[] = $str2; $wordForms[] = $str2.'ي'; $wordForms[] = $str2.'ك'; $wordForms[] = $str2.'كما'; $wordForms[] = $str2.'هما'; foreach ($postfix1 as $postfix) { $wordForms[] = $str2 . $postfix; } } if ($len >= 5 && $last2 == 'ية') { $wordForms[] = $str1; $wordForms[] = $str2; } if (($len >= 4 && ($last1 == 'ة' || $last1 == 'ه' || $last1 == 'ت')) || ($len >= 5 && $last2 == 'ات') ) { $wordForms[] = $str1; $wordForms[] = $str1 . 'ة'; $wordForms[] = $str1 . 'ه'; $wordForms[] = $str1 . 'ت'; $wordForms[] = $str1 . 'ات'; } if ($len >= 4 && $last1 == 'ى') { $wordForms[] = $str1 . 'ا'; } $trans = array('أ' => 'ا', 'إ' => 'ا', 'آ' => 'ا'); foreach ($wordForms as $word) { $normWord = strtr($word, $trans); if ($normWord != $word) { $wordForms[] = $normWord; } } $wordForms = array_unique($wordForms); return $wordForms; } /** * Get most possible Arabic lexical forms of user search keywords * * @param string $arg String that user search for * * @return string list of most possible Arabic lexical forms for given keywords * @author Khaled Al-Sham'aa <khaled@ar-php.org> */ public function allForms($arg) { $wordForms = array(); $words = explode(' ', $arg); foreach ($words as $word) { $wordForms = array_merge($wordForms, $this->allWordForms($word)); } $str = implode(' ', $wordForms); return $str; } } Libraries/I18N/Arabic/Examples/CharsetD.php 0000644 00000003570 15213350440 0014306 0 ustar 00 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Detect Arabic String Character Set</title> <meta http-equiv="Content-Type" content="text/html;charset=windows-1256" /> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> </head> <body> <div class="Paragraph"> <h2>Example Output:</h2> <?php /** * Example of Detect Arabic String Character Set * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ error_reporting(E_STRICT); $time_start = microtime(true); $text = '��� ���� ������ ������'; require '../../Arabic.php'; $Arabic = new I18N_Arabic('CharsetD'); $charset = $Arabic->getCharset($text); echo "$text ($charset) <br/>"; print_r($Arabic->guess($text)); ?> </div><br /> <div class="Paragraph"> <h2>Example Code:</h2> <?php $code = <<< END <?php \$text = '��� ���� ������ ������'; require '../../Arabic.php'; \$Arabic = new I18N_Arabic('CharsetD'); \$charset = \$Arabic->getCharset(\$text); echo "\$text (\$charset) <br/>"; print_r(\$Arabic->guess(\$text)); END; highlight_string($code); $time_end = microtime(true); $time = $time_end - $time_start; echo "<hr />Total execution time is $time seconds<br />\n"; echo 'Amount of memory allocated to this script is ' . memory_get_usage() . ' bytes'; $included_files = get_included_files(); echo '<h4>Names of included or required files:</h4><ul>'; foreach ($included_files as $filename) { echo "<li>$filename</li>"; } echo '</ul>'; ?> <a href="../Docs/I18N_Arabic/_Arabic---CharsetD.php.html" target="_blank">Related Class Documentation</a> </div> </body> </html> Libraries/I18N/Arabic/Examples/KeySwap.php 0000644 00000012434 15213350440 0014173 0 ustar 00 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Convert keyboard language programmatically (English - Arabic)</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> </head> <body> <div class="Paragraph" dir="rtl"> <h2 dir="ltr">Example Output 1 (a):</h2> <?php /** * Example of Convert keyboard language programmatically (English - Arabic) * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ error_reporting(E_STRICT); $time_start = microtime(true); require '../../Arabic.php'; $Arabic = new I18N_Arabic('KeySwap'); $str = "Hpf lk hgkhs hglj'vtdkK Hpf hg`dk dldg,k f;gdjil Ygn ,p]hkdm hgHl,v tb drt,k ljv]]dk fdk krdqdk>"; echo "<u><i>Before - English Keyboard:</i></u><br />$str<br /><br />"; $text = $Arabic->swapEa($str); echo "<u><i>After:</i></u><br />$text<br /><br />"; ?> </div><br /> <div class="Paragraph"> <h2>Example Code 1 (a):</h2> <?php $code = <<< END <?php require '../../Arabic.php'; \$Arabic = new I18N_Arabic('KeySwap'); \$str = "Hpf lk hgkhs hglj'vtdkK Hpf hg`dk dldg,k f;gdjil Ygn ,p]hkdm hgHl,v tb drt,k ljv]]dk fdk krdqdk>"; echo "<u><i>Before - English Keyboard:</i></u><br />\$str<br /><br />"; \$text = \$Arabic->swapEa(\$str); echo "<u><i>After:</i></u><br />\$text<br /><br />"; ?> END; highlight_string($code); ?> </div> <br /> <div class="Paragraph" dir="rtl"> <h2 dir="ltr">Example Output 1 (b):</h2> <?php $str = 'Hpf lk hgkhs hgljùvtdkK Hpf hg²dk dldg;k fmgdjil Ygn ;p$hkd, hgHl;v tb drt;k ljv$$dk fdk krdadk/'; echo "<u><i>Before - French Keyboard:</i></u><br />$str<br /><br />"; $text = $Arabic->swapFa($str); echo "<u><i>After:</i></u><br />$text<br /><br /><b>جبران خليل جبران</b>"; ?> </div><br /> <div class="Paragraph"> <h2>Example Code 1 (b):</h2> <?php $code = <<< END <?php require '../../Arabic.php'; \$Arabic = new I18N_Arabic('KeySwap'); \$str = 'Hpf lk hgkhs hgljùvtdkK Hpf hg²dk dldg;k fmgdjil Ygn ;p\$hkd, hgHl;v tb drt;k ljv\$\$dk fdk krdadk/'; echo "<u><i>Before - French Keyboard:</i></u><br />\$str<br /><br />"; \$text = \$Arabic->swapFa(\$str); echo "<u><i>After:</i></u><br />\$text<br /><br /><b>جبران خليل جبران</b>"; ?> END; highlight_string($code); ?> </div> <br /> <div class="Paragraph"> <h2 dir="ltr">Example Output 2:</h2> <?php $str = "ِىغ هىفثممهلثىف بخخم ؤشى ةشنث فاهىلس لاهللثق ةخقث ؤخةحمثء شىي ةخقث رهخمثىفز ÷ف فشنثس ش فخعؤا خب لثىهعس شىي ش مخف خب ؤخعقشلث فخ ةخرث هى فاث خححخسهفث يهقثؤفهخىز"; echo "<u><i>Before:</i></u><br />$str<br /><br />"; $text = $Arabic->swapAe($str); echo "<u><i>After:</i></u><br />$text<br /><br /><b>Albert Einstein</b>"; ?> </div><br /> <div class="Paragraph"> <h2>Example Code 2:</h2> <?php $code = <<< END <?php require '../../Arabic.php'; \$Arabic = new I18N_Arabic('KeySwap'); \$str = "ِىغ هىفثممهلثىف بخخم ؤشى ةشنث فاهىلس لاهللثق ةخقث ؤخةحمثء شىي ةخقث رهخمثىفز ÷ف فشنثس ش فخعؤا خب لثىهعس شىي ش مخف خب ؤخعقشلث فخ ةخرث هى فاث خححخسهفث يهقثؤفهخىز"; echo "<u><i>Before:</i></u><br />\$str<br /><br />"; \$text = \$Arabic->swapAe(\$str); echo "<u><i>After:</i></u><br />\$text<br /><br /><b>Albert Einstein</b>"; ?> END; highlight_string($code); ?> </div> <br /> <div class="Paragraph"> <h2 dir="ltr">Example Output 3:</h2> <?php $examples = array("ff'z g;k fefhj", "FF'Z G;K FEFHJ", 'ٍمخصمغ لاعف سعقثمغ', 'sLOWLY BUT SURELY'); foreach ($examples as $example) { $fix = $Arabic->fixKeyboardLang($example); echo '<font color="red">' . $example . '</font> => '; echo '<font color="blue">' . $fix . '</font><br />'; } ?> </div><br /> <div class="Paragraph"> <h2>Example Code 3:</h2> <?php $code = <<< END <?php require '../../Arabic.php'; \$Arabic = new I18N_Arabic('KeySwap'); \$examples = array("ff'z g;k fefhj", "FF'Z G;K FEFHJ", 'ٍمخصمغ لاعف سعقثمغ', 'sLOWLY BUT SURELY'); foreach (\$examples as \$example) { \$fix = \$Arabic->fixKeyboardLang(\$example); echo '<font color="red">' . \$example . '</font> => '; echo '<font color="blue">' . \$fix . '</font><br />'; } ?> END; highlight_string($code); $time_end = microtime(true); $time = $time_end - $time_start; echo "<hr />Total execution time is $time seconds<br />\n"; echo 'Amount of memory allocated to this script is ' . memory_get_usage() . ' bytes'; $included_files = get_included_files(); echo '<h4>Names of included or required files:</h4><ul>'; foreach ($included_files as $filename) { echo "<li>$filename</li>"; } echo '</ul>'; ?> <a href="../Docs/I18N_Arabic/_Arabic---KeySwap.php.html" target="_blank">Related Class Documentation</a> </div> </body> </html> Libraries/I18N/Arabic/Examples/Query.php 0000644 00000013743 15213350440 0013721 0 ustar 00 <?php /** * Example of Arabic Query Class * * @category I18N * @package I18N_Arabic * @author Khaled Al-Sham'aa <khaled@ar-php.org> * @copyright 2006-2016 Khaled Al-Sham'aa * * @license LGPL <http://www.gnu.org/licenses/lgpl.txt> * @link http://www.ar-php.org */ error_reporting(E_STRICT); $time_start = microtime(true); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Arabic Query Class</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> </head> <body> <div class="Paragraph" dir="rtl"> <h2 dir="ltr">Example Output:</h2> <font face="Tahoma" size="2"> <table border="0" width="100%" dir="ltr"> </tr> <td align="center"> <font face="Tahoma" size="2">Example database table contains 574 headline from <a href="http://www.aljazeera.net" target=_blank>Aljazeera.net</a> news channel website presented at 2003.</font> </td> </tr> </table><hr /> <form action="Query.php" method="GET" name="search"> إبحث عن (Search for): <input type="text" name="keyword" value="<?php echo $_GET['keyword']; ?>"> <input type="submit" value="بحث (Go)" name="submit" /> (مثال: فلسطينيون)<br /> <blockquote><blockquote><blockquote> <input type="radio" name="mode" value="0" checked /> أي من الكلمات (Any word) <input type="radio" name="mode" value="1" /> كل الكلمات (All words) </blockquote></blockquote></blockquote> </form> <?php if (isset($_GET['keyword'])) { ?> <hr /> نتائج البحث عن (Search for) <b><?php echo $keyword; ?></b>:<br /> <table cellpadding="5" cellspacing="2" align="center" width="80%"> <tr> <td bgcolor="#004488" align="center"> <font color="#ffffff" size="2"> <b>الخبر كما ورد في موقع الجزيرة<br /> Headline at Aljazeera.net</b> </font> </td> </tr> <?php include '../../Arabic.php'; $Arabic = new I18N_Arabic('Query'); echo $Arabic->allForms('فلسطينيون'); $dbuser = 'root'; $dbpwd = ''; $dbname = 'test'; try { $dbh = new PDO('mysql:host=localhost;dbname='.$dbname, $dbuser, $dbpwd); // Set the error reporting attribute $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->exec("SET NAMES 'utf8'"); if ($_GET['keyword'] != '') { $keyword = @$_GET['keyword']; $keyword = str_replace('\"', '"', $keyword); $Arabic->setStrFields('headline'); $Arabic->setMode($_GET['mode']); $strCondition = $Arabic->getWhereCondition($keyword); $strOrderBy = $Arabic->getOrderBy($keyword); } else { $strCondition = '1'; } $StrSQL = "SELECT `headline` FROM `aljazeera` WHERE $strCondition ORDER BY $strOrderBy"; $i = 0; foreach ($dbh->query($StrSQL) as $row) { $headline = $row['headline']; $i++; if ($i % 2 == 0) { $bg = "#f0f0f0"; } else { $bg = "#ffffff"; } echo"<tr bgcolor=\"$bg\"><td><font size=\"2\">$headline</font></td></tr>"; } // Close the databse connection $dbh = null; } catch (PDOException $e) { echo $e->getMessage(); } ?> </table> <?php } ?> <hr /> صيغة الإستعلام <span dir="ltr">(SQL Query Statement)</span> <br /><textarea dir="ltr" align="left" cols="80" rows="4"><?php echo $StrSQL; ?></textarea> </div><br /> <div class="Paragraph"> <h2>Example Code:</h2> <?php $code = <<< END <?php require '../../Arabic.php'; \$Arabic = new I18N_Arabic('Query'); echo \$Arabic->allForms('فلسطينيون'); \$dbuser = 'root'; \$dbpwd = ''; \$dbname = 'test'; try { \$dbh = new PDO('mysql:host=localhost;dbname='.\$dbname, \$dbuser, \$dbpwd); // Set the error reporting attribute \$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \$dbh->exec("SET NAMES 'utf8'"); if (\$_GET['keyword'] != '') { \$keyword = @\$_GET['keyword']; \$keyword = str_replace('\"', '"', \$keyword); \$Arabic->setStrFields('headline'); \$Arabic->setMode(\$_GET['mode']); \$strCondition = \$Arabic->getWhereCondition(\$keyword); \$strOrderBy = \$Arabic->getOrderBy(\$keyword); } else { \$strCondition = '1'; } \$StrSQL = "SELECT `headline` FROM `aljazeera` WHERE \$strCondition ORDER BY \$strOrderBy"; \$i = 0; foreach (\$dbh->query(\$StrSQL) as \$row) { \$headline = \$row['headline']; \$i++; if (\$i % 2 == 0) { \$bg = "#f0f0f0"; } else { \$bg = "#ffffff"; } echo"<tr bgcolor=\"\$bg\"><td><font size=\"2\">\$headline</font></td></tr>"; } // Close the databse connection \$dbh = null; } catch (PDOException \$e) { echo \$e->getMessage(); } END; highlight_string($code); $time_end = microtime(true); $time = $time_end - $time_start; echo "<hr />Total execution time is $time seconds<br />\n"; echo 'Amount of memory allocated to this script is ' . memory_get_usage() . ' bytes'; $included_files = get_included_files(); echo '<h4>Names of included or required files:</h4><ul>'; foreach ($included_files as $filename) { echo "<li>$filename</li>"; } echo '</ul>'; ?> <a href="../Docs/I18N_Arabic/_Arabic---Query.php.html" target="_blank">Related Class Documentation</a> </div> </body> </html> Libraries/I18N/Arabic/Examples/ArQuery_DB/ArQuery.sql 0000644 00000224175 15213350440 0016154 0 ustar 00 Create table aljazeera( ID INT AUTO_INCREMENT , headline VARCHAR (255), date VARCHAR (10), PRIMARY KEY (ID))ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=575; INSERT INTO aljazeera VALUES (1,'بوش يهيئ الأميركيين والعالم لحرب وشيكة على العراق','1/29/2003'); INSERT INTO aljazeera VALUES (2,'شارون يدعو لتشكيل حكومة وحدة وطنية موسعة','1/29/2003'); INSERT INTO aljazeera VALUES (3,'عشرات الشهداء ومئات الجرحى نتيجة التصعيد الإسرائيلي','1/29/2003'); INSERT INTO aljazeera VALUES (4,'كوريا الشمالية: واشنطن تعد خطة اجتياح لأراضينا','1/29/2003'); INSERT INTO aljazeera VALUES (5,'وزير الأوقاف: المتعاطفون مع بن لادن قلة في الكويت','1/29/2003'); INSERT INTO aljazeera VALUES (6,'واشنطن تدين هجوما مزعوما للجيش السوداني بالجنوب ','1/29/2003'); INSERT INTO aljazeera VALUES (7,'القوات الأميركية تتوقع مواجهة طويلة مع أنصار حكمتيار ','1/29/2003'); INSERT INTO aljazeera VALUES (8,'قتيلان في اشتباك للقوات التركية مع مسلحين أكراد ','1/29/2003'); INSERT INTO aljazeera VALUES (9,'جيش ساحل العاج يرفض إعطاء وزارتين للمتمردين ','1/29/2003'); INSERT INTO aljazeera VALUES (10,'وفاة 12 بسبب أوبئة الفيضانات في موزمبيق ','1/29/2003'); INSERT INTO aljazeera VALUES (11,'CIA تحقق في صلة القاعدة بحادثة الريسين ببريطانيا ','1/29/2003'); INSERT INTO aljazeera VALUES (12,'رئيس وزراء إيطاليا يمنى بهزيمة كبيرة في محاكمة فساد ','1/29/2003'); INSERT INTO aljazeera VALUES (13,'الفرنسيون يطالبون باريس بفيتو ضد الحرب على العراق ','1/29/2003'); INSERT INTO aljazeera VALUES (14,'انتخاب كوري جنوبي مديرا لمنظمة الصحة العالمية ','1/29/2003'); INSERT INTO aljazeera VALUES (15,'دراسة: المحمول يشتت رؤية سائقي السيارات ','1/29/2003'); INSERT INTO aljazeera VALUES (16,'رواد مكوك الفضاء كولومبيا يقفون حدادا على موتى تشالنجر ','1/29/2003'); INSERT INTO aljazeera VALUES (17,'سول تشتبه بضلوع قراصنة صينيين في هجوم الإنترنت ','1/29/2003'); INSERT INTO aljazeera VALUES (18,'العراقيون يهربون من تراجيديا الحرب إلى الكوميديا ','1/29/2003'); INSERT INTO aljazeera VALUES (19,'نيلسون مانديلا يدخل تاريخ السينما العالمية ','1/29/2003'); INSERT INTO aljazeera VALUES (20,'الحكومة المصرية تجري تغييرا في سعر صرف الجنيه ','1/29/2003'); INSERT INTO aljazeera VALUES (21,'كوريا الجنوبية تحس بوطأة أسعار النفط على الاقتصاد ','1/29/2003'); INSERT INTO aljazeera VALUES (22,'المدرب فان غال يعلن رحيله عن برشلونة ','1/29/2003'); INSERT INTO aljazeera VALUES (23,'ثنائية للهلال بمرمى قطر في افتتاح بطولة الأندية الخليجية ','1/29/2003'); INSERT INTO aljazeera VALUES (24,'كتب: القاعدة.. الإخوة الإرهابيون ','1/29/2003'); INSERT INTO aljazeera VALUES (25,'كتب: الانتفاضة والمجتمع الإسرائيلي ','1/29/2003'); INSERT INTO aljazeera VALUES (26,'بغداد تتهم واشنطن بتلفيق الاتهامات لتبرير الحرب','2/6/2003'); INSERT INTO aljazeera VALUES (27,'السعودية تقترح الإطاحة بصدام لتجنب الحرب ','2/6/2003'); INSERT INTO aljazeera VALUES (28,'بيان باول أمام مجلس الأمن يرفع أسعار الذهب والنفط ','2/6/2003'); INSERT INTO aljazeera VALUES (29,'استشهاد ثلاثة فلسطينيين ومواجهات في نابلس ورام الله ','2/6/2003'); INSERT INTO aljazeera VALUES (30,'موعد انعقاد القمة العربية يشكك في جديتها وجدواها ','2/6/2003'); INSERT INTO aljazeera VALUES (31,'الصليب الأحمر يعد لمساعدة 400 ألف لاجئ عراقي ','2/6/2003'); INSERT INTO aljazeera VALUES (32,'كوريا الشمالية تستأنف نشاطها النووي وواشنطن تحذر ','2/6/2003'); INSERT INTO aljazeera VALUES (33,'مصرع ثلاثة جنود أفغان في اشتباكات بقندهار ','2/6/2003'); INSERT INTO aljazeera VALUES (34,'الاتحاد الأفريقي يعارض شن حرب على العراق ','2/6/2003'); INSERT INTO aljazeera VALUES (35,'مجلس الأمن يؤيد تدخلا أفريقيا فرنسيا بساحل العاج ','2/6/2003'); INSERT INTO aljazeera VALUES (36,'يهودي يعترف بالتخطيط لتفجير مسجد في أميركا ','2/6/2003'); INSERT INTO aljazeera VALUES (37,'إسرائيل تتعرف على جثة رائدها وواشنطن تؤبن الضحايا ','2/6/2003'); INSERT INTO aljazeera VALUES (38,'الاتحاد الأوروبي يصعد لهجته ويحذر العراق بعواقب وخيمة ','2/6/2003'); INSERT INTO aljazeera VALUES (39,'روسيا وباكستان تفتحان صحفة جديدة من العلاقات ','2/6/2003'); INSERT INTO aljazeera VALUES (40,'علماء بريطانيون وهولنديون يستكشفون وظائف الجينات ','2/6/2003'); INSERT INTO aljazeera VALUES (41,'منافس جديد يهدد عرش الفياغرا ','2/6/2003'); INSERT INTO aljazeera VALUES (42,'فيروس سلامر انتشر عبر العالم في عشر دقائق ','2/6/2003'); INSERT INTO aljazeera VALUES (43,'تسرب مياه الصرف الصحي يهدد سواحل تل أبيب ','2/6/2003'); INSERT INTO aljazeera VALUES (44,'أوروبا تقترح تحريرا جزئيا لسوق الخدمات ','2/6/2003'); INSERT INTO aljazeera VALUES (45,'النفط يرتفع مع تراجع المخزونات الأميركية ','2/6/2003'); INSERT INTO aljazeera VALUES (46,'إقبال كبير على مسرحية بريطانية تسخر من بوش وبلير ','2/6/2003'); INSERT INTO aljazeera VALUES (47,'أكاديمي: آراء فرانكلين قد تفيد واضعي السياسة الأميركية ','2/6/2003'); INSERT INTO aljazeera VALUES (48,'الوحدة يهزم الجزيرة في الدوري الإماراتي ','2/6/2003'); INSERT INTO aljazeera VALUES (49,'أحمد صلاح حسني يعود إلى النادي الأهلي ','2/6/2003'); INSERT INTO aljazeera VALUES (50,'كتب: نساء يواجهن الحرب ','2/6/2003'); INSERT INTO aljazeera VALUES (51,'كتب: فرنسا منذ عام 1945 ','2/6/2003'); INSERT INTO aljazeera VALUES (52,'اتفاق مصري بحريني على قمة عربية عادية مطلع مارس','2/20/2003'); INSERT INTO aljazeera VALUES (53,'مصرع نحو 300 من الحرس الثوري بتحطم طائرة إيرانية ','2/20/2003'); INSERT INTO aljazeera VALUES (54,'صدام يجدد رغبة بلاده في تجنب الحرب ','2/20/2003'); INSERT INTO aljazeera VALUES (55,'إسرائيل ترفض بمؤتمر لندن إعادة أموال الفلسطينيين ','2/20/2003'); INSERT INTO aljazeera VALUES (56,'الإفراج عن صحفيين أردنيين وسجن ثالث ','2/20/2003'); INSERT INTO aljazeera VALUES (57,'العراق ينفي منعه الإيرانيين من زيارة العتبات المقدسة ','2/20/2003'); INSERT INTO aljazeera VALUES (58,'واشنطن تقدم عرضا نهائيا لأنقرة بشأن العراق وتنتظر الرد ','2/20/2003'); INSERT INTO aljazeera VALUES (59,'واشنطن تطالب بكين بمزيد من التعاون في مكافحة الإرهاب ','2/20/2003'); INSERT INTO aljazeera VALUES (60,'الجيش العاجي يرفض منح وزارتين للمتمردين ','2/20/2003'); INSERT INTO aljazeera VALUES (61,'المعارك في ليبيريا تجبر 30 ألفا على النزوح ','2/20/2003'); INSERT INTO aljazeera VALUES (62,'حكومة شافيز والمعارضة توقعان إعلانا للسلام ','2/20/2003'); INSERT INTO aljazeera VALUES (63,'حكومة بوليفيا تستقيل إثر احتجاجات شعبية ','2/20/2003'); INSERT INTO aljazeera VALUES (64,'فرنسا تشيد بانسحاب القوات السورية الجزئي من لبنان ','2/20/2003'); INSERT INTO aljazeera VALUES (65,'بريطانيا تحث رعاياها بعدد من دول المنطقة على المغادرة ','2/20/2003'); INSERT INTO aljazeera VALUES (66,'دراسة تخفق في معرفة أسباب مرض حرب الخليج ','2/20/2003'); INSERT INTO aljazeera VALUES (67,'بريطانيا تدعو شركات الأدوية لمساعدة الدول الفقيرة ','2/20/2003'); INSERT INTO aljazeera VALUES (68,'جهاز للتنبؤ بالانهيارات الجليدية ','2/20/2003'); INSERT INTO aljazeera VALUES (69,'الصين تستعد لإرسال رواد للفضاء الخريف المقبل ','2/20/2003'); INSERT INTO aljazeera VALUES (70,'النفط يهبط والرياض تؤيد تجميد نظام الحصص ','2/20/2003'); INSERT INTO aljazeera VALUES (71,'برلين: الحرب على العراق ذات دوافع نفطية ','2/20/2003'); INSERT INTO aljazeera VALUES (72,'كتاب ألمان يؤلفون ويطبعون كتابا في 12 ساعة ','2/20/2003'); INSERT INTO aljazeera VALUES (73,'اكتشاف بقايا معبد فرعوني في الصحراء الغربية ','2/20/2003'); INSERT INTO aljazeera VALUES (74,'مانشستر يونايتد يهزم يوفنتوس في دوري أبطال أوروبا ','2/20/2003'); INSERT INTO aljazeera VALUES (75,'موريسمو وكابرياتي للدور الثالث من دورة دبي التنسية ','2/20/2003'); INSERT INTO aljazeera VALUES (76,'كتب: المستشرقون البريطانيون في القرن العشرين ','2/20/2003'); INSERT INTO aljazeera VALUES (77,'كتب: البرابرة والحضارة في العلاقات الدولية','2/20/2003'); INSERT INTO aljazeera VALUES (78,'تجدد القصف على بغداد و22 قتيلا في غارات البصرة ','3/30/2003'); INSERT INTO aljazeera VALUES (79,'استشهاد فلسطيني وجرح آخرين في الضفة والقطاع ','3/30/2003'); INSERT INTO aljazeera VALUES (80,'رمضان يتوعد الغزاة بالمزيد من الهجمات ','3/30/2003'); INSERT INTO aljazeera VALUES (81,'التنديد بالحرب يتواصل مع استمرار عمليات غزو العراق ','3/30/2003'); INSERT INTO aljazeera VALUES (82,'الصحاف: تحرك عربي لمقاضاة بوش كمجرم حرب ','3/30/2003'); INSERT INTO aljazeera VALUES (83,'جنود أميركيون: لماذا لم نصل إلى بغداد حتى الآن ؟ ','3/30/2003'); INSERT INTO aljazeera VALUES (84,'تركيا تهدد باجتياح شمال العراق للدفاع عن مصالحها ','3/30/2003'); INSERT INTO aljazeera VALUES (85,'مقتل جنديين أميركيين في كمين جنوبي أفغانستان ','3/30/2003'); INSERT INTO aljazeera VALUES (86,'كينيا تعلن اسمي أسيريها في العراق ','3/30/2003'); INSERT INTO aljazeera VALUES (87,'أوباسانجو يأمر قوات الأمن بإنهاء العنف جنوبي نيجيريا ','3/30/2003'); INSERT INTO aljazeera VALUES (88,'بوش يعترف بشراسة المقاومة العراقية ','3/30/2003'); INSERT INTO aljazeera VALUES (89,'الأميركيون يتوقعون حربا طويلة قد تستغرق عاما ','3/30/2003'); INSERT INTO aljazeera VALUES (90,'كوك يدعو لسحب القوات البريطانية من الحرب ','3/30/2003'); INSERT INTO aljazeera VALUES (91,'شيراك وبلير يتفقان على العمل المشترك في مرحلة ما بعد الحرب ','3/30/2003'); INSERT INTO aljazeera VALUES (92,'حكومة بلير تلتقي بشركات بريطانية بشأن العقود بالعراق ','3/30/2003'); INSERT INTO aljazeera VALUES (93,'روسيا تستعد لحماية مصالحها بالعراق بعد الحرب ','3/30/2003'); INSERT INTO aljazeera VALUES (94,'ناسا تضع أقمار تجسس لمراقبة الرحلات الفضائية ','3/30/2003'); INSERT INTO aljazeera VALUES (95,'حرب أخرى بشأن العراق تشتعل على الإنترنت ','3/30/2003'); INSERT INTO aljazeera VALUES (96,'سنغافورة تحتجز الآلاف لاحتواء فيروس رئوي ','3/30/2003'); INSERT INTO aljazeera VALUES (97,'هونغ كونغ تأمر بالحجر الصحي لمرضى فيروس رئوي ','3/30/2003'); INSERT INTO aljazeera VALUES (98,'مثقفون سعوديون يرفضون تلبية دعوة للسفير الأميركي ','3/30/2003'); INSERT INTO aljazeera VALUES (99,'أمسية أدبية لكاتبة ألمانية ومصرية تندد بالحرب ','3/30/2003'); INSERT INTO aljazeera VALUES (100,'القنابل الأميركية لم تحل دون استمرار الدوري العراقي ','3/30/2003'); INSERT INTO aljazeera VALUES (101,'أهلي جدة إلى نهائي كأس ولي العهد السعودي ','3/30/2003'); INSERT INTO aljazeera VALUES (102,'كتب: تجارة السلاح ','3/30/2003'); INSERT INTO aljazeera VALUES (103,'كتب: عولمة الهوية الثقافية لبلدان العالم الثالث','3/30/2003'); INSERT INTO aljazeera VALUES (104,'انفجارات وإطلاق نار بمجمع للقصور الرئاسية في بغداد ','4/8/2003'); INSERT INTO aljazeera VALUES (105,'طائرات الغزو تقصف مكتب الجزيرة وأبو ظبي في بغداد ','4/8/2003'); INSERT INTO aljazeera VALUES (106,'بوش وبلير يبحثان بإيرلندا الوضع في العراق ','4/8/2003'); INSERT INTO aljazeera VALUES (107,'قطر تدعو لوقف سريع للحرب على العراق ','4/8/2003'); INSERT INTO aljazeera VALUES (108,'إعلان نتائج الانتخابات البلدية في قطر ','4/8/2003'); INSERT INTO aljazeera VALUES (109,'شهيدان فلسطينيان وتوغل إسرائيلي في جنين ','4/8/2003'); INSERT INTO aljazeera VALUES (110,'أكراد تركيا يستغلون خلاف أنقرة وواشنطن لدعم قضيتهم ','4/8/2003'); INSERT INTO aljazeera VALUES (111,'الأمم المتحدة وأفغانستان توقعان اتفاقية لنزع أسلحة المقاتلين ','4/8/2003'); INSERT INTO aljazeera VALUES (112,'شرطة زيمبابوي تفرج عن قيادي معارض وتعتقل آخر ','4/8/2003'); INSERT INTO aljazeera VALUES (113,'تدمير قريتين في أعمال عنف عرقية بجنوب نيجيريا ','4/8/2003'); INSERT INTO aljazeera VALUES (114,'أميركا تريد محاكمة مسؤولين عراقيين أمام محاكمها ','4/8/2003'); INSERT INTO aljazeera VALUES (115,'الشرطة الأميركية تفرق مظاهرة مناهضة للحرب بالرصاص ','4/8/2003'); INSERT INTO aljazeera VALUES (116,'فيشر: آمل في انهيار النظام العراقي قريبا ','4/8/2003'); INSERT INTO aljazeera VALUES (117,'أثينا: انضمام تركيا للاتحاد الأوروبي مرهون بتوحيد قبرص ','4/8/2003'); INSERT INTO aljazeera VALUES (118,'البنك الدولي يبحث إجراءات حصول مصر على قرض ','4/8/2003'); INSERT INTO aljazeera VALUES (119,'غموض الموقف إزاء استئناف النفط من دلتا النيجر ','4/8/2003'); INSERT INTO aljazeera VALUES (120,'باكستان تعلن الحرب على مواقع الإنترنت الإباحية ','4/8/2003'); INSERT INTO aljazeera VALUES (121,'موسكو تؤكد حاجة محطة الفضاء الدولية لتمويل إضافي ','4/8/2003'); INSERT INTO aljazeera VALUES (122,'شراء الأدوية عبر الإنترنت يعرض المستهلكين للخطر ','4/8/2003'); INSERT INTO aljazeera VALUES (123,'منظمة الصحة تدعو لبذل جهود للحد من وفيات الأطفال ','4/8/2003'); INSERT INTO aljazeera VALUES (124,'الفيتوري: ما يجري في العراق مخاض ميلاد جديد للأمة ','4/8/2003'); INSERT INTO aljazeera VALUES (125,'العراق حاضر في ندوة الحوار الإسلامي المسيحي بالدوحة ','4/8/2003'); INSERT INTO aljazeera VALUES (126,'رايكونن يحرز لقب جائزة البرازيل الكبرى ','4/8/2003'); INSERT INTO aljazeera VALUES (127,'لاكورونيا يفوز على سوسيداد في الدوري الإسباني ','4/8/2003'); INSERT INTO aljazeera VALUES (128,'كتب: خطة غزو العراق ','4/8/2003'); INSERT INTO aljazeera VALUES (129,'كتب: الحرب غير المقدسة.. الإرهاب باسم الإسلام','4/8/2003'); INSERT INTO aljazeera VALUES (130,'تصاعد الهجمات ضد القوات الأميركية في العراق ','5/27/2003'); INSERT INTO aljazeera VALUES (131,'إسرائيل تواصل التصعيد وإرجاء لقاء شارون وعباس ','5/27/2003'); INSERT INTO aljazeera VALUES (132,'المؤتمر الأوروبي المتوسطي يدعم خارطة الطريق ','5/27/2003'); INSERT INTO aljazeera VALUES (133,'روسيا والصين تحثان بيونغ يانغ لوقف تطوير أسلحة نووية ','5/27/2003'); INSERT INTO aljazeera VALUES (134,'14 قتيلا في هجوم مسلح غرب الجزائر ','5/27/2003'); INSERT INTO aljazeera VALUES (135,'السلطات الموريتانية تعتقل عاملين في معهد إسلامي سعودي ','5/27/2003'); INSERT INTO aljazeera VALUES (136,'الحكومة الأسترالية تسعى لحظر حزب الله ','5/27/2003'); INSERT INTO aljazeera VALUES (137,'فاجبايي يتعهد بتحسين العلاقات مع باكستان ','5/27/2003'); INSERT INTO aljazeera VALUES (138,'واشنطن تغلق سفارتها في كينيا بسبب مخاوف أمنية ','5/27/2003'); INSERT INTO aljazeera VALUES (139,'بدء التصويت على دستور جديد في رواندا ','5/27/2003'); INSERT INTO aljazeera VALUES (140,'مخاوف أميركية من هجمات على مؤتمر بالأردن ','5/27/2003'); INSERT INTO aljazeera VALUES (141,'الرئيس الأرجنتيني يؤدي اليمين ويرث أعباء الاقتصاد ','5/27/2003'); INSERT INTO aljazeera VALUES (142,'الاتحاد الأوروبي يسابق الزمن لصياغة الدستور ','5/27/2003'); INSERT INTO aljazeera VALUES (143,'مناهضو العولمة يتظاهرون ضد مشاركة بوش بقمة الثماني ','5/27/2003'); INSERT INTO aljazeera VALUES (144,'أميركا تجدد الضغط لتخفيف ديون العراق ','5/27/2003'); INSERT INTO aljazeera VALUES (145,'العراق يتأهب لبيع كميات نفطية ','5/27/2003'); INSERT INTO aljazeera VALUES (146,'البحرين تخطط لإصدار تأشيرات إلكترونية مطلع 2004 ','5/27/2003'); INSERT INTO aljazeera VALUES (147,'اليابان تعتزم إطلاق قمري تجسس في سبتمبر المقبل ','5/27/2003'); INSERT INTO aljazeera VALUES (148,'ابتكار لقاح محتمل ضد السارس ووفيات وإصابات بتايوان ','5/27/2003'); INSERT INTO aljazeera VALUES (149,'شبح جنون البقر يطارد صناعة اللحوم الكندية ','5/27/2003'); INSERT INTO aljazeera VALUES (150,'بدء أعمال مؤتمر عالمي لصحافة المجلات في باريس ','5/27/2003'); INSERT INTO aljazeera VALUES (151,'المخرج الفائز في مهرجان كان توقع مشاعر مناهضة لأميركا ','5/27/2003'); INSERT INTO aljazeera VALUES (152,'كليسترز للدور الثاني من الرولان غاروس وخروج بهية ','5/27/2003'); INSERT INTO aljazeera VALUES (153,'مصر تتقدم رسميا لاستضافة مونديال 2010 ','5/27/2003'); INSERT INTO aljazeera VALUES (154,'كتب: سفر الموت: من أفغانستان إلى العراق ','5/27/2003'); INSERT INTO aljazeera VALUES (155,'كتب: الإمبراطورية: محاولة حول تفكك النظام الأميركي','5/27/2003'); INSERT INTO aljazeera VALUES (156,'انفجار يستهدف حافلة لقوات إيساف قرب كابل ','6/7/2003'); INSERT INTO aljazeera VALUES (157,'مصرع وجرح 9 باصطدام طائرة بمبنى في لوس أنجلوس ','6/7/2003'); INSERT INTO aljazeera VALUES (158,'حماس ترفض محاورة عباس والجهاد تدعو لاجتماع للفصائل ','6/7/2003'); INSERT INTO aljazeera VALUES (159,'أميركا تراجع حملتها الإعلامية في العالمين العربي والإسلامي ','6/7/2003'); INSERT INTO aljazeera VALUES (160,'بريمر يلتقى سياسيي العراق والحكيم يرفض مجلس الدستور ','6/7/2003'); INSERT INTO aljazeera VALUES (161,'الخرطوم سلمت الرياض 17 سعوديا اعتقلوا غربي السودان ','6/7/2003'); INSERT INTO aljazeera VALUES (162,'أستراليا تنفي تزوير معلومات استخبارية بشأن أسلحة العراق ','6/7/2003'); INSERT INTO aljazeera VALUES (163,'إيران تنفي انتهاك معاهدة الأسلحة النووية ','6/7/2003'); INSERT INTO aljazeera VALUES (164,'تأجيل محادثات السلام الليبيرية والمتمردون يدخلون العاصمة ','6/7/2003'); INSERT INTO aljazeera VALUES (165,'زيمبابوي تتوعد بسحق تحرك المعارضة وتعتقل زعيمها ','6/7/2003'); INSERT INTO aljazeera VALUES (166,'انتقادات واسعة لآشكروفت بانتهاك الحقوق المدنية ','6/7/2003'); INSERT INTO aljazeera VALUES (167,'كندا تتهم الجماعات الإسلامية بتهديدها ','6/7/2003'); INSERT INTO aljazeera VALUES (168,'قتيل في تبادل إطلاق نار مع الشرطة قرب مطار هيثرو بلندن ','6/7/2003'); INSERT INTO aljazeera VALUES (169,'الدوما الروسي يقر عفوا جزئيا عن المقاتلين الشيشان ','6/7/2003'); INSERT INTO aljazeera VALUES (170,'تأرجح الدولار أمام الين ومخاوف من تدخل ياباني ','6/7/2003'); INSERT INTO aljazeera VALUES (171,'القطرية تسير رحلات جوية إلى العراق ','6/7/2003'); INSERT INTO aljazeera VALUES (172,'روسيا تطلق قمرا صناعيا عسكريا ','6/7/2003'); INSERT INTO aljazeera VALUES (173,'إنشاء منظمة عربية لتقنية الاتصال في تونس ','6/7/2003'); INSERT INTO aljazeera VALUES (174,'استمرار التحذير من مرض سارس ','6/7/2003'); INSERT INTO aljazeera VALUES (175,'وقود السيارات مسؤول عن حالات الربو الحادة ','6/7/2003'); INSERT INTO aljazeera VALUES (176,'استقالة مدير تحرير صحيفة نيويورك تايمز ','6/7/2003'); INSERT INTO aljazeera VALUES (177,'وفاة ممثل كويتي وهو يقوم بدور جندي عراقي ','6/7/2003'); INSERT INTO aljazeera VALUES (178,'فيريرو يقصي كوستا ويواجه فيركيرك بنهائي رولان غاروس ','6/7/2003'); INSERT INTO aljazeera VALUES (179,'مواجهة عراقية كويتية في السوبر العربية الثانية للأندية ','6/7/2003'); INSERT INTO aljazeera VALUES (180,'كتب: النشيد الختامي الطويل.. كيبلنغ في ظل الإمبراطورية ','6/7/2003'); INSERT INTO aljazeera VALUES (181,'كتب: السياسة والحكم: النظم السلطانية بين الأصول وسنن الواقع','6/7/2003'); INSERT INTO aljazeera VALUES (182,'دعوات لاستقالة عباس واستمرار المقاومة ','6/11/2003'); INSERT INTO aljazeera VALUES (183,'القوات الأميركية تعتقل مئات العراقيين في بغداد ','6/11/2003'); INSERT INTO aljazeera VALUES (184,'بليكس: أميركيون قذرون حاولوا توجيه تقاريرنا عن العراق ','6/11/2003'); INSERT INTO aljazeera VALUES (185,'الشرطة الإيرانية تفرق تظاهرة مناهضة للحكومة ','6/11/2003'); INSERT INTO aljazeera VALUES (186,'القوات الموريتانية تطارد فلول المتمردين بعد انقلاب فاشل ','6/11/2003'); INSERT INTO aljazeera VALUES (187,'اتهام فرنسي و17 شخصا في التورط بتفجيرات الدار البيضاء ','6/11/2003'); INSERT INTO aljazeera VALUES (188,'محاولة اغتيال الرنتيسي.. عرض متجدد لسياسة قديمة ','6/11/2003'); INSERT INTO aljazeera VALUES (189,'طهران تتحدى واشنطن وتؤكد عدم إخفائها برامج نووية ','6/11/2003'); INSERT INTO aljazeera VALUES (190,'مسلحون يقتلون مسؤولا كبيرا في الشرطة الباكستانية ','6/11/2003'); INSERT INTO aljazeera VALUES (191,'القتال يتجدد في ليبيريا مع وصول وسطاء إقليميين ','6/11/2003'); INSERT INTO aljazeera VALUES (192,'البحرية الأميركية تكثف وجودها قبالة القرن الأفريقي ','6/11/2003'); INSERT INTO aljazeera VALUES (193,'مجلس الأمن يبحث استثناء الأميركيين من الجنائية الدولية ','6/11/2003'); INSERT INTO aljazeera VALUES (194,'نواب أميركيون يطالبون بعقد جلسات استماع بشأن العراق ','6/11/2003'); INSERT INTO aljazeera VALUES (195,'هيئة بريطانية تطلب حظر الذبح وفقا للشريعة الإسلامية ','6/11/2003'); INSERT INTO aljazeera VALUES (196,'إطلاق سراح الموظفين الدوليين المختطفين بجورجيا ','6/11/2003'); INSERT INTO aljazeera VALUES (197,'إضرابات وشغب في فرنسا بسبب خطة لإصلاح المعاشات ','6/11/2003'); INSERT INTO aljazeera VALUES (198,'القطرية تعدل عن تسيير رحلات للعراق ','6/11/2003'); INSERT INTO aljazeera VALUES (199,'التصحر يهدد الإنتاج الغذائي لمليار نسمة في العالم ','6/11/2003'); INSERT INTO aljazeera VALUES (200,'ناسا تبحث عن المياه في المريخ برجلين آليين ','6/11/2003'); INSERT INTO aljazeera VALUES (201,'الرنين المغناطيسي يساعد في التنبؤ بالجلطات ','6/11/2003'); INSERT INTO aljazeera VALUES (202,'سارس يواصل حصد الضحايا رغم انحسار الإصابات ','6/11/2003'); INSERT INTO aljazeera VALUES (203,'منعم الفقير: نحاول التقريب بين الثقافة الدانماركية والعربية ','6/11/2003'); INSERT INTO aljazeera VALUES (204,'مجلس الشعب المصري يستنكر تشويه تمثال نفرتيتي في برلين ','6/11/2003'); INSERT INTO aljazeera VALUES (205,'سلطنة عمان تشارك ببعثة كبيرة في آسياد 2006 ','6/11/2003'); INSERT INTO aljazeera VALUES (206,'أرازي إلى الدور الثاني من دورة كوينز التنسية ','6/11/2003'); INSERT INTO aljazeera VALUES (207,'كتب: الأديان والمذاهب بالعراق ','6/11/2003'); INSERT INTO aljazeera VALUES (208,'كتب: النشيد الختامي الطويل.. كيبلنغ في ظل الإمبراطورية','6/11/2003'); INSERT INTO aljazeera VALUES (209,'مقتل أميركيين وثلاثة عراقيين في بغداد ','6/18/2003'); INSERT INTO aljazeera VALUES (210,'غالبية العراقيين يرون أن الحرب للاحتلال والمصالح ','6/18/2003'); INSERT INTO aljazeera VALUES (211,'باول يبدأ جولة بالمنطقة لبحث تنفيذ خارطة الطريق ','6/18/2003'); INSERT INTO aljazeera VALUES (212,'المستقلون يحصدون غالبية المقاعد بانتخابات الأردن ','6/18/2003'); INSERT INTO aljazeera VALUES (213,'بلير يلوذ ببوش مع بدء تحقيق بشأن غزو العراق ','6/18/2003'); INSERT INTO aljazeera VALUES (214,'ارتفاع عدد متهمي تفجيرات الدار البيضاء إلى 100 ','6/18/2003'); INSERT INTO aljazeera VALUES (215,'السعودية تعتقل 12 شخصا في مكة ','6/18/2003'); INSERT INTO aljazeera VALUES (216,'واشنطن تسلم طوكيو جنديا أميركيا متهما بقضية اغتصاب ','6/18/2003'); INSERT INTO aljazeera VALUES (217,'مشرف: التقدم في محادثات السلام يتوقف على الهند ','6/18/2003'); INSERT INTO aljazeera VALUES (218,'أنان يرحب بوقف إطلاق النار في ليبيريا ','6/18/2003'); INSERT INTO aljazeera VALUES (219,'الأمم المتحدة تدعو لتقاسم السلطة في بونيا بالكونغو ','6/18/2003'); INSERT INTO aljazeera VALUES (220,'الكونغرس الأميركي يناقش أسلحة الدمار العراقية ','6/18/2003'); INSERT INTO aljazeera VALUES (221,'اقتراح بمشاركة قوات أميركية في محاربة حماس ','6/18/2003'); INSERT INTO aljazeera VALUES (222,'زوران ليليتش: لاعلاقة لميلوسوفيتش بمذبحة سربنيتشا ','6/18/2003'); INSERT INTO aljazeera VALUES (223,'اليونان تشدد الإجراءات الأمنية قبيل القمة الأوروبية ','6/18/2003'); INSERT INTO aljazeera VALUES (224,'المصرف العربي يقدم 134 مليون دولار للتنمية بأفريقيا ','6/18/2003'); INSERT INTO aljazeera VALUES (225,'الدولار يسجل ارتفاعا مقابل اليورو والين ','6/18/2003'); INSERT INTO aljazeera VALUES (226,'البنتاغون ينتقل للجيل التالي للإنترنت ','6/18/2003'); INSERT INTO aljazeera VALUES (227,'افتتاح معرض لوبورجيه للطيران بفرنسا ','6/18/2003'); INSERT INTO aljazeera VALUES (228,'سدس الأميركيين مصابون بالاكتئاب ','6/18/2003'); INSERT INTO aljazeera VALUES (229,'مؤتمر في اليابان لنشر الوعي بالطب التقليدي ','6/18/2003'); INSERT INTO aljazeera VALUES (230,'أحمد شوقي وطه حسين أحياء بميادين القاهرة ','6/18/2003'); INSERT INTO aljazeera VALUES (231,'مهرجان الإسكندرية للأغنية يكرم عددا من الفنانين العالميين ','6/18/2003'); INSERT INTO aljazeera VALUES (232,'بيكهام إلى صفوف الريال مقابل 25 مليون يورو ','6/18/2003'); INSERT INTO aljazeera VALUES (233,'العيناوي يبلغ الدور الثاني لدورة نوتنغهام التنسية ','6/18/2003'); INSERT INTO aljazeera VALUES (234,'كتب: بناء مجتمع من المواطنين ','6/18/2003'); INSERT INTO aljazeera VALUES (235,'كتب: زكريا موسوي.. صناعة إرهابي','6/18/2003'); INSERT INTO aljazeera VALUES (236,'المقاومة تستقبل باول بقتل مستوطن ','6/20/2003'); INSERT INTO aljazeera VALUES (237,'إصابة جندي أميركي في هجوم على بالأعظمية ','6/20/2003'); INSERT INTO aljazeera VALUES (238,'جنود أميركيون يعترفون بقل مدنيين وأسرى عراقيين ','6/20/2003'); INSERT INTO aljazeera VALUES (239,'وفاة نحناح زعيم حركة مجتمع السلم الجزائرية ','6/20/2003'); INSERT INTO aljazeera VALUES (240,'الخرطوم تطلق سراح معارضين وتصر على إسلامية العاصمة ','6/20/2003'); INSERT INTO aljazeera VALUES (241,'اعتقال عبد حمود يثير تساؤلات بشأن مصير صدام ','6/20/2003'); INSERT INTO aljazeera VALUES (242,'إيران تتمسك ببرنامجها النووي وأوروبا تحذر ','6/20/2003'); INSERT INTO aljazeera VALUES (243,'الصين تعتقل أميركيا ونيوزيلنديا بتهمة التحريض ','6/20/2003'); INSERT INTO aljazeera VALUES (244,'الكونغو توقع اتفاقا لوقف إطلاق النار مع المتمردين ','6/20/2003'); INSERT INTO aljazeera VALUES (245,'متمردو ليبيريا يتهمون الحكومة بخرق الهدنة ','6/20/2003'); INSERT INTO aljazeera VALUES (246,'آشكروفت يعلن اعتقال سائق أميركي على صلة بالقاعدة ','6/20/2003'); INSERT INTO aljazeera VALUES (247,'فرض حظر التجول على مدينة أميركية ','6/20/2003'); INSERT INTO aljazeera VALUES (248,'القمة الأوروبية تبحث مسودة أول دستور للاتحاد ','6/20/2003'); INSERT INTO aljazeera VALUES (249,'انتخاب بيريز رئيسا مؤقتا لحزب العمل الإسرائيلي ','6/20/2003'); INSERT INTO aljazeera VALUES (250,'القطرية تتعاقد على شراء 32 طائرة إيرباص ','6/20/2003'); INSERT INTO aljazeera VALUES (251,'أميركا تمنح نصف عقود إعمار العراق لشركات محلية ','6/20/2003'); INSERT INTO aljazeera VALUES (252,'20 مليون دولار للسياحة في الفضاء ','6/20/2003'); INSERT INTO aljazeera VALUES (253,'قهوة طبيعية بدون كافيين ','6/20/2003'); INSERT INTO aljazeera VALUES (254,'تايوان: لا إصابات أو وفيات بسارس لليوم الخامس ','6/20/2003'); INSERT INTO aljazeera VALUES (255,'التدخين يسبب الفقر والوفاة في الدول النامية ','6/20/2003'); INSERT INTO aljazeera VALUES (256,'الثقافة العربية تفقد العالم السوداني عبد الله الطيب ','6/20/2003'); INSERT INTO aljazeera VALUES (257,'سلسلة هاري بوتر تدخل الجزء السادس ','6/20/2003'); INSERT INTO aljazeera VALUES (258,'كليسترز لنصف نهائي دورة زهرتوغنبوش ','6/20/2003'); INSERT INTO aljazeera VALUES (259,'الكاميرون تفاجئ البرازيل في بطولة القارات ','6/20/2003'); INSERT INTO aljazeera VALUES (260,'كتب: بناء مجتمع من المواطنين ','6/20/2003'); INSERT INTO aljazeera VALUES (261,'كتب: زكريا موسوي.. صناعة إرهابي','6/20/2003'); INSERT INTO aljazeera VALUES (262,'الأقصى تتهم الاحتلال باغتيال أحد كوادرها بعد هجوم القدس ','8/4/2003'); INSERT INTO aljazeera VALUES (263,'إصابة جنديين بهجوم على طريق بغداد بعقوبة ','8/4/2003'); INSERT INTO aljazeera VALUES (264,'مركز سعودي للحوار ومكافحة التطرف ','8/4/2003'); INSERT INTO aljazeera VALUES (265,'انتحار رئيس شركة هيونداي أسان الكورية الجنوبية ','8/4/2003'); INSERT INTO aljazeera VALUES (266,'تشييع كادر حزب الله في بيروت الجنوبية ','8/4/2003'); INSERT INTO aljazeera VALUES (267,'طلاب سودانيون غاضبون يحرقون جامعتهم ','8/4/2003'); INSERT INTO aljazeera VALUES (268,'انتخابات برلمانية في كوريا الشمالية ','8/4/2003'); INSERT INTO aljazeera VALUES (269,'عرفات: زيارة شارون للهند مصدر قلق لباكستان ','8/4/2003'); INSERT INTO aljazeera VALUES (270,'قائد قوة إيكواس في ليبيريا اليوم ','8/4/2003'); INSERT INTO aljazeera VALUES (271,'رئيس النيجر ينفي بيع اليورانيوم للعراق ','8/4/2003'); INSERT INTO aljazeera VALUES (272,'واشنطن تنوي إعادة استجواب البيومي ','8/4/2003'); INSERT INTO aljazeera VALUES (273,'أميركا توقف الترانزيت بمطاراتها لدواع أمنية ','8/4/2003'); INSERT INTO aljazeera VALUES (274,'اعتقال شخصين يشتبه بتورطهما في هجوم موزدوك ','8/4/2003'); INSERT INTO aljazeera VALUES (275,'ثلاثة قتلى في هجوم مسلح بإقليم كوسوفو ','8/4/2003'); INSERT INTO aljazeera VALUES (276,'تسع طائرات إيرانية خارج الخدمة بسبب الحظر ','8/4/2003'); INSERT INTO aljazeera VALUES (277,'مسؤول عراقي يستبعد خصخصة الشركات الكبرى قريبا ','8/4/2003'); INSERT INTO aljazeera VALUES (278,'رحلة كبرى لاستكشاف المحيط الجنوبي ','8/4/2003'); INSERT INTO aljazeera VALUES (279,'ناسا متفائلة باستقرار ثقب الأوزون ','8/4/2003'); INSERT INTO aljazeera VALUES (280,'البنتاغون يحقق في احتمال إصابة جنوده بسارس ','8/4/2003'); INSERT INTO aljazeera VALUES (281,'الأمهات بحاجة لتثقيف أعمق بأهمية الرضاعة الطبيعية ','8/4/2003'); INSERT INTO aljazeera VALUES (282,'وفاة الممثلة ترنتينيان بسبب ضربات في الرأس ','8/4/2003'); INSERT INTO aljazeera VALUES (283,'أقزام الفراعنة لقوا الاحترام ونظراؤهم اليونانيون منبوذون ','8/4/2003'); INSERT INTO aljazeera VALUES (284,'يوفنتوس يهزم ميلانو ويفوز بالسوبر الإيطالية ','8/4/2003'); INSERT INTO aljazeera VALUES (285,'ثلاثة فرق عربية إلى قبل نهائي الطائرة الأفريقية ','8/4/2003'); INSERT INTO aljazeera VALUES (286,'كتب: الاستشراق جنسيا ','8/4/2003'); INSERT INTO aljazeera VALUES (287,'كتب: مفارقة القوة الأميركية','8/4/2003'); INSERT INTO aljazeera VALUES (288,'باول يجدد قلق واشنطن تجاه الجدار الإسرائيلي ','8/8/2003'); INSERT INTO aljazeera VALUES (289,'الأردن يرفض ربط الهجوم باستقبال ابنتي صدام ','8/8/2003'); INSERT INTO aljazeera VALUES (290,'هجوم جديد للمقاومة ببغداد ومقتل جنديين أميركيين ','8/8/2003'); INSERT INTO aljazeera VALUES (291,'الأميركيون يعترفون باستخدام النابالم بالعراق ','8/8/2003'); INSERT INTO aljazeera VALUES (292,'الرياض تجدد انتقادها تقرير الكونغرس الأميركي ','8/8/2003'); INSERT INTO aljazeera VALUES (293,'إسلاميو الأردن يهددون حكومة أبو الراغب ','8/8/2003'); INSERT INTO aljazeera VALUES (294,'إيران تنفي استعانتها بعلماء نوويين أجانب ','8/8/2003'); INSERT INTO aljazeera VALUES (295,'بوتو تعتزم استئناف حكم صدر بحقها بسويسرا ','8/8/2003'); INSERT INTO aljazeera VALUES (296,'تايلور يستقيل وواشنطن تصر على محاكمته ','8/8/2003'); INSERT INTO aljazeera VALUES (297,'المحكمة توجه التهمة لخمسة متهمين بتفجير مومباسا ','8/8/2003'); INSERT INTO aljazeera VALUES (298,'رايس تدعو لتحول ديمقراطي أكبر في الشرق الأوسط ','8/8/2003'); INSERT INTO aljazeera VALUES (299,'حكم مخفف لعربي أميركي اعترف بالتآمر مع طالبان ','8/8/2003'); INSERT INTO aljazeera VALUES (300,'مقتل ثلاثة جنود روس بسقوط مروحية بالشيشان ','8/8/2003'); INSERT INTO aljazeera VALUES (301,'تشييع جثمان كيلي مع تفاقم أزمة حكومة بلير ','8/8/2003'); INSERT INTO aljazeera VALUES (302,'الدولار يسجل أعلى مستوياته أمام اليورو ','8/8/2003'); INSERT INTO aljazeera VALUES (303,'نفط أوبك يتجاوز النطاق المستهدف إلى 28.88 دولارا ','8/8/2003'); INSERT INTO aljazeera VALUES (304,'الألماس المصنع سيعوض ندرته الطبيعية ','8/8/2003'); INSERT INTO aljazeera VALUES (305,'ولادة مهرة مستنسخة في إيطاليا ','8/8/2003'); INSERT INTO aljazeera VALUES (306,'أول حالة وفاة بإيطاليا لها علاقة بجنون البقر ','8/8/2003'); INSERT INTO aljazeera VALUES (307,'شركة بريطانية تطرح دواء رخيصا للملاريا ','8/8/2003'); INSERT INTO aljazeera VALUES (308,'المناهج الدراسية بالعراق خالية من آثار صدام ','8/8/2003'); INSERT INTO aljazeera VALUES (309,'معرض يوثق علاقة الصورة بالسينما بمكتبة الإسكندرية ','8/8/2003'); INSERT INTO aljazeera VALUES (310,'أغاسي يتأهل للدور الثالث لبطولة مونتريال للتنس ','8/8/2003'); INSERT INTO aljazeera VALUES (311,'تونس تهزم مصر وتتوج بطلة للطائرة الأفريقية','8/8/2003'); INSERT INTO aljazeera VALUES (312,'هجوم على فندق ببغداد وواشنطن تعزز قواتها ','9/27/2003'); INSERT INTO aljazeera VALUES (313,'الرباعية تعتبر التصعيد الإسرائيلي دفاعا عن النفس ','9/27/2003'); INSERT INTO aljazeera VALUES (314,'بوش وبوتين يبحثان علاقات روسيا النووية مع إيران ','9/27/2003'); INSERT INTO aljazeera VALUES (315,'الدستور الجديد بين مهلة باول وطموحات العراقيين ','9/27/2003'); INSERT INTO aljazeera VALUES (316,'العفو الدولية تدين قتل القوات الأميركية للمدنيين العراقيين ','9/27/2003'); INSERT INTO aljazeera VALUES (317,'محادثات السلام السودانية تستأنف الشهر المقبل ','9/27/2003'); INSERT INTO aljazeera VALUES (318,'إضراب يشل بنغلاديش واعتقال 50 معارضا ','9/27/2003'); INSERT INTO aljazeera VALUES (319,'الوكالة الدولية للطاقة الذرية تؤجل زيارتها لطهران ','9/27/2003'); INSERT INTO aljazeera VALUES (320,'إريتريا تطالب بفرض عقوبات دولية على إثيوبيا ','9/27/2003'); INSERT INTO aljazeera VALUES (321,'مقتل 15 في معركة بين متمردي ساحل العاج ','9/27/2003'); INSERT INTO aljazeera VALUES (322,'احتمال وقف ملاحقة موسوي والادعاء يطالب بالاستئناف ','9/27/2003'); INSERT INTO aljazeera VALUES (323,'أميركا تتصدر دول العالم في تصدير الأسلحة ','9/27/2003'); INSERT INTO aljazeera VALUES (324,'نصف البريطانيين يفضلون استقالة بلير ','9/27/2003'); INSERT INTO aljazeera VALUES (325,'شرودر يهدد بالتنحي بشأن تصويت على إصلاحات صحية ','9/27/2003'); INSERT INTO aljazeera VALUES (326,'اليابان تمنح ليبيا قروضا بقيمة 3.6 مليارات دولار ','9/27/2003'); INSERT INTO aljazeera VALUES (327,'المكسيك تبقي صادراتها النفطية دون تغيير ','9/27/2003'); INSERT INTO aljazeera VALUES (328,'أردني يبتكر نظاما للترميز اللوني لفرز حقائب المسافرين ','9/27/2003'); INSERT INTO aljazeera VALUES (329,'استنساخ فئران يحسن من نوعية تجارب المعامل ','9/27/2003'); INSERT INTO aljazeera VALUES (330,'وكالات صحة أميركية تستعد لعودة محتملة لسارس ','9/27/2003'); INSERT INTO aljazeera VALUES (331,'اختتام المؤتمر الـ 13 لمكافحة الإيدز في أفريقيا ','9/27/2003'); INSERT INTO aljazeera VALUES (332,'إدوارد سعيد.. هل غاب حقا؟ ','9/27/2003'); INSERT INTO aljazeera VALUES (333,'باليه زوربا اليوناني في سنوية مكتبة الإسكندرية ','9/27/2003'); INSERT INTO aljazeera VALUES (334,'الزمالك يحلق منفردا على قمة الدوري المصري ','9/27/2003'); INSERT INTO aljazeera VALUES (335,'أرسنال يعزز موقعه على قمة الدوري الإنجليزي ','9/27/2003'); INSERT INTO aljazeera VALUES (336,'كتب: أين الخطأ؟.. التأثير الغربي واستجابة المسلمين ','9/27/2003'); INSERT INTO aljazeera VALUES (337,'كتب: الآسيويون في بريطانيا.. أربعمائة عام من التاريخ','9/27/2003'); INSERT INTO aljazeera VALUES (338,'مجلس الأمن يتبنى بالإجماع المشروع الأميركي بشأن العراق ','10/16/2003'); INSERT INTO aljazeera VALUES (339,'فريق من الـFBI يبدأ التحقيق في انفجار غزة ','10/16/2003'); INSERT INTO aljazeera VALUES (340,'سوريا تدعو قواتها للرد على أي عدوان إسرائيلي ','10/16/2003'); INSERT INTO aljazeera VALUES (341,'أنان يحذر من تصاعد العداء بين الغرب والمسلمين ','10/16/2003'); INSERT INTO aljazeera VALUES (342,'الغالبية تعتبر حكومة الصدر تصعيدا شيعيا ضد الاحتلال ','10/16/2003'); INSERT INTO aljazeera VALUES (343,'مظاهرة في دمشق مناهضة للأميركيين ','10/16/2003'); INSERT INTO aljazeera VALUES (344,'استسلام قائد جيش عدن الإسلامي باليمن ','10/16/2003'); INSERT INTO aljazeera VALUES (345,'كوريا الشمالية مستعدة لكشف برامج تسلحها النووية ','10/16/2003'); INSERT INTO aljazeera VALUES (346,'باكستان تنفي مساعدة ليبيا على تطوير أسلحة نووية ','10/16/2003'); INSERT INTO aljazeera VALUES (347,'متمردو ليبيريا يشرعون قريبا في نزع السلاح ','10/16/2003'); INSERT INTO aljazeera VALUES (348,'لجنة الحدود مع إريتريا ترفض انتقادات إثيوبيا ','10/16/2003'); INSERT INTO aljazeera VALUES (349,'أولبرايت تنتقد سياسة بوش في العلاقات الدولية ','10/16/2003'); INSERT INTO aljazeera VALUES (350,'واشنطن تحتاج إلى طرق جديدة للتجسس ','10/16/2003'); INSERT INTO aljazeera VALUES (351,'اعتقال 550 مهاجرا أفريقيا حاولوا الوصول لإسبانيا ','10/16/2003'); INSERT INTO aljazeera VALUES (352,'محامو المعتقلين الفرنسيين في غوانتانامو يشتكون لمجلس الأمن ','10/16/2003'); INSERT INTO aljazeera VALUES (353,'قطر وإكسون موبيل توقعان اتفاق غاز بـ 12 مليار دولار ','10/16/2003'); INSERT INTO aljazeera VALUES (354,'انفجار في خط أنابيب كركوك غرب بغداد ','10/16/2003'); INSERT INTO aljazeera VALUES (355,'بريطانيا تعلن نتائج تجارب على المحاصيل المعدلة وراثيا ','10/16/2003'); INSERT INTO aljazeera VALUES (356,'عودة أول مركبة فضاء صينية مأهولة إلى الأرض ','10/16/2003'); INSERT INTO aljazeera VALUES (357,'لجنة أميركية توصي بإعادة زراعة السليكون بالثدي ','10/16/2003'); INSERT INTO aljazeera VALUES (358,'التوأمان المصريان يبدآن بالخروج من الغيبوبة ','10/16/2003'); INSERT INTO aljazeera VALUES (359,'قصة سقوط بغداد.. كتاب جديد لأحمد منصور ','10/16/2003'); INSERT INTO aljazeera VALUES (360,'الجزيرة تطلق خدمة موبايل الإخبارية ','10/16/2003'); INSERT INTO aljazeera VALUES (361,'ترجي تونس يخسر أمام هلال السودان بالبطولة العربية ','10/16/2003'); INSERT INTO aljazeera VALUES (362,'الكويت بطلا للأندية الخليجية لكرة السلة ','10/16/2003'); INSERT INTO aljazeera VALUES (363,'كتب: العولمة والنمو والفقر.. بناء اقتصاد عالمي شامل ','10/16/2003'); INSERT INTO aljazeera VALUES (364,'كتب: قلب إيطاليا المظلم.. رحلات إيطالية عبر الزمان والمكان','10/16/2003'); INSERT INTO aljazeera VALUES (365,'مقتل أميركي بهجوم على فندق ينزل فيه ولفويتز ببغداد ','10/26/2003'); INSERT INTO aljazeera VALUES (366,'استشهاد ثلاثة غداة انسحاب الاحتلال من غزة ','10/26/2003'); INSERT INTO aljazeera VALUES (367,'إيران تؤكد أنها لم توقف تخصيب اليورانيوم ','10/26/2003'); INSERT INTO aljazeera VALUES (368,'الإخوان ينتقدون استبعادهم من الحوار الوطني بمصر ','10/26/2003'); INSERT INTO aljazeera VALUES (369,'الحكومة الأردنية الجديدة تؤدي اليمين القانونية ','10/26/2003'); INSERT INTO aljazeera VALUES (370,'خالد نزار يصف بوتفليقة بالطفل المدلل ','10/26/2003'); INSERT INTO aljazeera VALUES (371,'الصحفيون المصريون يدينون تصريحات السفير الأميركي ','10/26/2003'); INSERT INTO aljazeera VALUES (372,'إيران ترفض إعلان أسماء عناصر القاعدة بمعتقلاتها ','10/26/2003'); INSERT INTO aljazeera VALUES (373,'متمردو سريلانكا يقترحون اقتساما مؤقتا للسلطة ','10/26/2003'); INSERT INTO aljazeera VALUES (374,'متمردو ليبيريا يطالبون بتنحية رئيس الإدارة الانتقالية ','10/26/2003'); INSERT INTO aljazeera VALUES (375,'شيراك قلق من الوضع في ساحل العاج ','10/26/2003'); INSERT INTO aljazeera VALUES (376,'عشرات القتلى بكولومبيا أثناء استفتاء على الإصلاحات ','10/26/2003'); INSERT INTO aljazeera VALUES (377,'الاحتلال الأميركي للعراق يعاني من نقص المعلومات ','10/26/2003'); INSERT INTO aljazeera VALUES (378,'تراجع تأييد البريطانيين لبلير في حرب العراق ','10/26/2003'); INSERT INTO aljazeera VALUES (379,'مؤتمر مدريد يخفق في تحقيق الهدف الأميركي ','10/26/2003'); INSERT INTO aljazeera VALUES (380,'شركة يمنية توقع عقد شبكة للمحمول بالسودان ','10/26/2003'); INSERT INTO aljazeera VALUES (381,'مجموعة الـ20 تبحث سبل مكافحة تمويل الإرهاب ','10/26/2003'); INSERT INTO aljazeera VALUES (382,'الاتحاد الأوروبي يضع قواعد للتحقيق في جرائم الإنترنت ','10/26/2003'); INSERT INTO aljazeera VALUES (383,'عاصفة مغناطيسية شمسية تؤثر على مرافق الطاقة ','10/26/2003'); INSERT INTO aljazeera VALUES (384,'منظمة الصحة العالمية تقر عقاقير لعلاج الإيدز ','10/26/2003'); INSERT INTO aljazeera VALUES (385,'كينيا تنتج بكتريا لمكافحة البعوض ','10/26/2003'); INSERT INTO aljazeera VALUES (386,'رمسيس الأول يعود إلى القاهرة من واشنطن ','10/26/2003'); INSERT INTO aljazeera VALUES (387,'صحفي فرنسي يجاهر بازدرائه للإسلام ','10/26/2003'); INSERT INTO aljazeera VALUES (388,'مواجهة مصرية نيجيرية في تصفيات أولمبياد أثينا ','10/26/2003'); INSERT INTO aljazeera VALUES (389,'بنفيكا البرتغالي يدشن ملعبا جديدا ','10/26/2003'); INSERT INTO aljazeera VALUES (390,'كتب: تقرير التنمية الإنسانية العربية للعام 2003 ','10/26/2003'); INSERT INTO aljazeera VALUES (391,'كتب: مواقف وتحديات في العالم العربي','10/26/2003'); INSERT INTO aljazeera VALUES (392,'بوش يحمل بعثيين وأجانب مسؤولية الهجمات بالعراق ','10/29/2003'); INSERT INTO aljazeera VALUES (393,'عرفات يكلف قريع تشكيل حكومة موسعة ','10/29/2003'); INSERT INTO aljazeera VALUES (394,'حزب الله ملتزم بإعادة أسراه بالتفاوض أو بغيره ','10/29/2003'); INSERT INTO aljazeera VALUES (395,'ملف مثقل بالتحديات بانتظار خليفة محاضر محمد ','10/29/2003'); INSERT INTO aljazeera VALUES (396,'المهدي يقترح التحكيم لإنجاح محادثات السلام السودانية ','10/29/2003'); INSERT INTO aljazeera VALUES (397,'محكمة كويتية تخفف حكم الإعدام بحق سامي المطيري ','10/29/2003'); INSERT INTO aljazeera VALUES (398,'تركيا تحتفل بالذكرى الثمانين وسط جدل حول العلمانية ','10/29/2003'); INSERT INTO aljazeera VALUES (399,'مقتل اثنين من عناصر المخابرات الأميركية بأفغانستان ','10/29/2003'); INSERT INTO aljazeera VALUES (400,'هراري وجوهانسبرغ تنفيان تدهور صحة موغابي ','10/29/2003'); INSERT INTO aljazeera VALUES (401,'رواندا تنفي وجود قوات لها في الكونغو الديمقراطية ','10/29/2003'); INSERT INTO aljazeera VALUES (402,'البيت الأبيض يرفض فرض عقوبات على ماليزيا ','10/29/2003'); INSERT INTO aljazeera VALUES (403,'واشنطن تكشف نظامها الجديد لدخول الزائرين ','10/29/2003'); INSERT INTO aljazeera VALUES (404,'عائلات ضحايا طائرة أوتا يطلبون تدخل فرنسا لدى ليبيا ','10/29/2003'); INSERT INTO aljazeera VALUES (405,'الليكود يواجه اختبارا لشعبيته في الانتخابات البلدية ','10/29/2003'); INSERT INTO aljazeera VALUES (406,'تجدد الخلافات بين الكويت وإيران حول حقل الدرة ','10/29/2003'); INSERT INTO aljazeera VALUES (407,'روسيا تسعى لإحياء صفقات نفطية مع العراق ','10/29/2003'); INSERT INTO aljazeera VALUES (408,'توقعات بارتفاع الطلب على طائرات التجسس ','10/29/2003'); INSERT INTO aljazeera VALUES (409,'عودة مركبة الفضاء الروسية سويوز إلى الأرض ','10/29/2003'); INSERT INTO aljazeera VALUES (410,'إثيوبيا توزع أدوية الإيدز مجانا على الفقراء ','10/29/2003'); INSERT INTO aljazeera VALUES (411,'أدوية الاكتئاب قد تدفع للانتحار ','10/29/2003'); INSERT INTO aljazeera VALUES (412,'كتاب مصر والأردن يتضامنون مع صنع الله إبراهيم ','10/29/2003'); INSERT INTO aljazeera VALUES (413,'السلطات اليمنية تحبط محاولة لسرقة آثار ','10/29/2003'); INSERT INTO aljazeera VALUES (414,'العيناوي يودع بطولة باريس للتنس ','10/29/2003'); INSERT INTO aljazeera VALUES (415,'منتخب ليبيا يبدأ معسكرا تدريبيا في الدوحة ','10/29/2003'); INSERT INTO aljazeera VALUES (416,'كتب: كلاب من قش','10/29/2003'); INSERT INTO aljazeera VALUES (417,'العراقيون السنة يحتفلون بالعيد اليوم ','11/24/2003'); INSERT INTO aljazeera VALUES (418,'واشنطن تعلن دعمها للحكومة الجديدة في جورجيا ','11/24/2003'); INSERT INTO aljazeera VALUES (419,'إسرائيل تبعد ثلاثة فلسطينيين والسلطة تجمع السلاح ','11/24/2003'); INSERT INTO aljazeera VALUES (420,'مصادرة أجهزة كمبيوتر لمشتبه به في تفجيرات إسطنبول ','11/24/2003'); INSERT INTO aljazeera VALUES (421,'مليونا مصل يشهدون ختم القرآن بالحرمين الشريفين ','11/24/2003'); INSERT INTO aljazeera VALUES (422,'انتحار معتقل سعودي رفض اليمن منحه اللجوء ','11/24/2003'); INSERT INTO aljazeera VALUES (423,'مصرع خمسة جنود أميركيين في تحطم مروحية بأفغانستان ','11/24/2003'); INSERT INTO aljazeera VALUES (424,'سلطات ميانمار تفرج عن خمسة معارضين ','11/24/2003'); INSERT INTO aljazeera VALUES (425,'الأمم المتحدة تواجه صعوبات في نزع أسلحة الليبيريين ','11/24/2003'); INSERT INTO aljazeera VALUES (426,'أنغليكانية أوغندا تعلن القطيعة مع نظيرتها الأميركية ','11/24/2003'); INSERT INTO aljazeera VALUES (427,'FBI يدقق في حسابات السفارة السعودية بواشنطن ','11/24/2003'); INSERT INTO aljazeera VALUES (428,'مساع أميركية لترهيب إيران من الطموح النووي ','11/24/2003'); INSERT INTO aljazeera VALUES (429,'مقتل 28 طالبا أجنبيا في حريق بموسكو ','11/24/2003'); INSERT INTO aljazeera VALUES (430,'رافاران يطالب بنص تشريعي بشأن الحجاب في فرنسا ','11/24/2003'); INSERT INTO aljazeera VALUES (431,'الكويت تلمح إلى عرض قضية الدرة على محكمة العدل ','11/24/2003'); INSERT INTO aljazeera VALUES (432,'ثاني أكبر شركة سياحة بأوروبا تخفض الوظائف والنفقات ','11/24/2003'); INSERT INTO aljazeera VALUES (433,'شبان البرازيل يتجهون لزيادة استهلاك القهوة ','11/24/2003'); INSERT INTO aljazeera VALUES (434,'تطوير حاسة شم إلكترونية تحاكي الكلاب المدربة ','11/24/2003'); INSERT INTO aljazeera VALUES (435,'أمير سعودي يتبرع لإنشاء مراكز لغسيل الكلى ','11/24/2003'); INSERT INTO aljazeera VALUES (436,'الأردن يجري أربع جراحات متطورة لديسك الرقبة ','11/24/2003'); INSERT INTO aljazeera VALUES (437,'كاتبة مصرية تدعو العرب إلى ترجمة الأدب الأفغاني ','11/24/2003'); INSERT INTO aljazeera VALUES (438,'الثقافة والهوية في مؤتمر اتحاد الكتاب العرب بالقاهرة ','11/24/2003'); INSERT INTO aljazeera VALUES (439,'الريال يتخطى البسيط ويتصدر الدوري الإسباني ','11/24/2003'); INSERT INTO aljazeera VALUES (440,'رباعية لروما بمرمى بولونيا في الدوري الإيطالي ','11/24/2003'); INSERT INTO aljazeera VALUES (441,'كتب: احتلال مدني.. سياسات العمارة الإسرائيلية ','11/24/2003'); INSERT INTO aljazeera VALUES (442,'كتب: أرض البدانة','11/24/2003'); INSERT INTO aljazeera VALUES (443,'الفصائل تشترط التزاما إسرائيليا لإعلان الهدنة ','12/4/2003'); INSERT INTO aljazeera VALUES (444,'هجوم بالرمادي واليابان تدرس إرسال قواتها للعراق ','12/4/2003'); INSERT INTO aljazeera VALUES (445,'باول يدعو المغرب العربي لتعزيز الديمقراطية ','12/4/2003'); INSERT INTO aljazeera VALUES (446,'طه والميرغني يبحثان عملية السلام بالسودان ','12/4/2003'); INSERT INTO aljazeera VALUES (447,'أووربا لا ترى بديلا عن خارطة الطريق ','12/4/2003'); INSERT INTO aljazeera VALUES (448,'اليمن يحبط مخططا يستهدف منشآت حكومية ','12/4/2003'); INSERT INTO aljazeera VALUES (449,'قرار للجمعية العامة يطالب إسرائيل بإخلاء الجولان ','12/4/2003'); INSERT INTO aljazeera VALUES (450,'رمسفليد يشيد بالتطورات الحاصلة في أفغانستان ','12/4/2003'); INSERT INTO aljazeera VALUES (451,'القضاء يفصل في قضية باعشير الشهر المقبل ','12/4/2003'); INSERT INTO aljazeera VALUES (452,'اتهام الجيش البوروندي بقتل 23 مدنيا في بوجمبورا ','12/4/2003'); INSERT INTO aljazeera VALUES (453,'ملكة بريطانيا تصل نيجيريا لافتتاح قمة الكومنولث ','12/4/2003'); INSERT INTO aljazeera VALUES (454,'باول متفائل بمباحثات جديدة لحل الأزمة الكورية ','12/4/2003'); INSERT INTO aljazeera VALUES (455,'أنان: دور أميركا الريادي لا غنى عنه ','12/4/2003'); INSERT INTO aljazeera VALUES (456,'باول يدعو الأطلسي لدور أكبر في العراق ','12/4/2003'); INSERT INTO aljazeera VALUES (457,'بلير واثق من وجود أسلحة دمار شامل بالعراق ','12/4/2003'); INSERT INTO aljazeera VALUES (458,'مستشار بوتين ينفي أي علاقة للكرملين بمتاعب يوكوس ','12/4/2003'); INSERT INTO aljazeera VALUES (459,'إيران تبيع شركة إسمنت حكومية في مزاد عام ','12/4/2003'); INSERT INTO aljazeera VALUES (460,'أميركا ليست مستعدة للإرهاب الإلكتروني ','12/4/2003'); INSERT INTO aljazeera VALUES (461,'ناسا تحذر من صعوبة الرحلة المقبلة للمريخ ','12/4/2003'); INSERT INTO aljazeera VALUES (462,'اعتقال إسرائيليين بتهمة الاتجار بالأعضاء البشرية ','12/4/2003'); INSERT INTO aljazeera VALUES (463,'تدبيس المعدة خطر على من يعانون السمنة ','12/4/2003'); INSERT INTO aljazeera VALUES (464,'لقاء عربي سويسري بالقاهرة بشأن الأدب والإعلام ','12/4/2003'); INSERT INTO aljazeera VALUES (465,'إسرائيل تعيد حظر فيلم وثائقي عن هجوم جنين ','12/4/2003'); INSERT INTO aljazeera VALUES (466,'باريس سان جيرمان إلى المركز الثالث بالدوري الفرنسي ','12/4/2003'); INSERT INTO aljazeera VALUES (467,'ريال مدريد ينفرد بصدارة الدوري الإسباني ','12/4/2003'); INSERT INTO aljazeera VALUES (468,'كتب: فرنسا التي تسقط ','12/4/2003'); INSERT INTO aljazeera VALUES (469,'كتب: الوطن العربي.. النواة والامتدادات عبر التاريخ','12/4/2003'); INSERT INTO aljazeera VALUES (470,'مصرع مستوطن قرب نابلس وتوغل في جنين ','12/12/2003'); INSERT INTO aljazeera VALUES (471,'انفجارات تهز بغداد ومقتل أميركي بالرمادي ','12/12/2003'); INSERT INTO aljazeera VALUES (472,'بوش يرفض الاعتراضات على قرارات إعمار العراق ','12/12/2003'); INSERT INTO aljazeera VALUES (473,'أوروبا تنقسم على الدستور وتقر اتفاق الدفاع ','12/12/2003'); INSERT INTO aljazeera VALUES (474,'مجاهدي خلق تواجه احتمال الإبعاد إلى إيران ','12/12/2003'); INSERT INTO aljazeera VALUES (475,'بدء فرز الأصوات في الانتخابات التكميلية باليمن ','12/12/2003'); INSERT INTO aljazeera VALUES (476,'انفجار رسالة ملغومة موجهة لرئيس تحرير السياسة الكويتية ','12/12/2003'); INSERT INTO aljazeera VALUES (477,'مقتل ستة أفغان بمواجهات في جلال آباد ','12/12/2003'); INSERT INTO aljazeera VALUES (478,'بيونغ يانغ ترفض عرضا مشتركا لحل الأزمة النووية ','12/12/2003'); INSERT INTO aljazeera VALUES (479,'البرلمان يقر انسحاب زيمبابوي من الكومنولث ','12/12/2003'); INSERT INTO aljazeera VALUES (480,'الجيش ومتمردو ساحل العاج يتفقون على نزع الأسلحة ','12/12/2003'); INSERT INTO aljazeera VALUES (481,'بيكر يبدأ جولة أوروبية لمناقشة الديون العراقية ','12/12/2003'); INSERT INTO aljazeera VALUES (482,'أكثر من 121 مليون طفل في العالم بلا تعليم ','12/12/2003'); INSERT INTO aljazeera VALUES (483,'الشرطة البريطانية تحبط هجمات في بريطانيا وأوروبا ','12/12/2003'); INSERT INTO aljazeera VALUES (484,'توصية بحظر الحجاب والقلنسوة والصلبان بمدارس فرنسا ','12/12/2003'); INSERT INTO aljazeera VALUES (485,'مؤتمر الجهات المانحة للفلسطينيين يبحث الإصلاحات ','12/12/2003'); INSERT INTO aljazeera VALUES (486,'هاليبيرتون تنفي رفع أسعار البنزين المصدر للعراق ','12/12/2003'); INSERT INTO aljazeera VALUES (487,'خلافات التمويل تخيم على قمة المعلومات بجنيف ','12/12/2003'); INSERT INTO aljazeera VALUES (488,'شركة ياهو تعالج ثغرة أمنية بالبريد الإلكتروني ','12/12/2003'); INSERT INTO aljazeera VALUES (489,'علاج لإيبولا يطيل صمود المصابين ','12/12/2003'); INSERT INTO aljazeera VALUES (490,'مقتل 150 ألف شخص بسبب التغيرات المناخية ','12/12/2003'); INSERT INTO aljazeera VALUES (491,'الروائي المصري خيري شلبي يفوز بجائزة نجيب محفوظ ','12/12/2003'); INSERT INTO aljazeera VALUES (492,'جرح صحافيين أميركيين بقنبلة يدوية في العراق ','12/12/2003'); INSERT INTO aljazeera VALUES (493,'لجنة تفتيش مونديال 2010 تصل تونس ','12/12/2003'); INSERT INTO aljazeera VALUES (494,'الإسماعيلي المصري يسعى لنيل اللقب الأفريقي ','12/12/2003'); INSERT INTO aljazeera VALUES (495,'كتب: فتاة البرتقال ','12/12/2003'); INSERT INTO aljazeera VALUES (496,'كتب: أين هي بلدي يا صاحبي؟','12/12/2003'); INSERT INTO aljazeera VALUES (497,'انقسامات الدستور تهدد بفشل القمة الأوروبية ','12/12/2003'); INSERT INTO aljazeera VALUES (498,'سنة وشيعة العراق يشكلون مجلسا لحل الأزمات ','12/12/2003'); INSERT INTO aljazeera VALUES (499,'إسرائيل تطلب استئناف المفاوضات مع الفلسطينيين ','12/12/2003'); INSERT INTO aljazeera VALUES (500,'بوش يرفض الاعتراضات على قرارات إعمار العراق ','12/12/2003'); INSERT INTO aljazeera VALUES (501,'واشنطن تلقن الديمقراطية لزعماء العشائر العراقية ','12/12/2003'); INSERT INTO aljazeera VALUES (502,'غالاوي يدعو بوش وبلير للخروج من الحكم ','12/12/2003'); INSERT INTO aljazeera VALUES (503,'مسلسل الرسائل الملغومة يتواصل بالكويت ','12/12/2003'); INSERT INTO aljazeera VALUES (504,'تأجيل البت في دستور أفغانستان الجديد للمرة الثانية ','12/12/2003'); INSERT INTO aljazeera VALUES (505,'خاتمي يتعهد بتوفير ظروف مواتية لشيرين عبادي ','12/12/2003'); INSERT INTO aljazeera VALUES (506,'قتلى بمواجهات بين الجيش ومسلحين في أبيدجان ','12/12/2003'); INSERT INTO aljazeera VALUES (507,'مصرع 12 عاجيا بمواجهات بين الدرك ومسلحين ','12/12/2003'); INSERT INTO aljazeera VALUES (508,'بول مارتن يخلف كريتيان في رئاسة الوزراء الكندية ','12/12/2003'); INSERT INTO aljazeera VALUES (509,'واشنطن تعلن نجاح تجربة صاروخية محمولة على السفن ','12/12/2003'); INSERT INTO aljazeera VALUES (510,'أنان يحذر من تزايد التوتر بين الغرب والإسلام ','12/12/2003'); INSERT INTO aljazeera VALUES (511,'بوتين يتعهد مجددا بعدم تغيير الدستور ','12/12/2003'); INSERT INTO aljazeera VALUES (512,'العطية: إنتاج أوبك يبحث في الاجتماع المقبل ','12/12/2003'); INSERT INTO aljazeera VALUES (513,'العراق يزود الكويت بالغاز ','12/12/2003'); INSERT INTO aljazeera VALUES (514,'ناسا تعجز عن إصلاح جناح كولومبيا أثناء الطيران ','12/12/2003'); INSERT INTO aljazeera VALUES (515,'طلاب عسكريون إماراتيون يطورون حوامة جو مائية ','12/12/2003'); INSERT INTO aljazeera VALUES (516,'الولايات الأميركية غير مستعدة لأي هجمات كيماوية ','12/12/2003'); INSERT INTO aljazeera VALUES (517,'نمرة مهددة بالانقراض تحتاج مساعدة دولية ','12/12/2003'); INSERT INTO aljazeera VALUES (518,'مؤرخ أميركي يصور غزو العراق قبل ربع قرن ','12/12/2003'); INSERT INTO aljazeera VALUES (519,'الآثار المهربة من العراق إلى الأردن بلغت 500 قطعة ','12/12/2003'); INSERT INTO aljazeera VALUES (520,'أنيمبا يحرز دوري أبطال أفريقيا على حساب الإسماعيلي ','12/12/2003'); INSERT INTO aljazeera VALUES (521,'البرازيل تكتسح اليابان وتبلغ نصف نهائي مونديال الشباب','12/12/2003'); INSERT INTO aljazeera VALUES (522,'الخرطوم والحركة الشعبية تعكفان على صياغة اتفاق الثروة ','12/21/2003'); INSERT INTO aljazeera VALUES (523,'CIA تكشف تفقدها عدة مواقع أسلحة في ليبيا ','12/21/2003'); INSERT INTO aljazeera VALUES (524,'استشهاد طفل في مخيم بلاطة والاحتلال يواصل توغله ','12/21/2003'); INSERT INTO aljazeera VALUES (525,'الحكيم والأسد يبحثان العلاقات بين سوريا والعراق ','12/21/2003'); INSERT INTO aljazeera VALUES (526,'الغالبية تشكك في حصول صدام على محاكمة عادلة ','12/21/2003'); INSERT INTO aljazeera VALUES (527,'قمة الخليج تبحث الوضع العربي ومكافحة الإرهاب ','12/21/2003'); INSERT INTO aljazeera VALUES (528,'أحكام بالسجن على 27 لبنانيا هاجموا مصالح أميركية ','12/21/2003'); INSERT INTO aljazeera VALUES (529,'التاميل ملتزمون بالمحادثات رغم خلاف الحكومة ','12/21/2003'); INSERT INTO aljazeera VALUES (530,'الصين تؤكد لبوش اعتراضها على استقلال تايوان ','12/21/2003'); INSERT INTO aljazeera VALUES (531,'الغينيون يصوتون في انتخابات شبه محسومة للرئيس الحالي ','12/21/2003'); INSERT INTO aljazeera VALUES (532,'إثيوبيا وإريتريا تشكلان لجانا عسكرية لتهدئة الحدود ','12/21/2003'); INSERT INTO aljazeera VALUES (533,'واشنطن تسقط تهما عن مترجم بغوانتانامو ','12/21/2003'); INSERT INTO aljazeera VALUES (534,'أميركا تصادر مخدرات ببحر العرب وتتهم بها القاعدة ','12/21/2003'); INSERT INTO aljazeera VALUES (535,'إسرائيل تعيد البرغوثي إلى السجن الانفرادي ','12/21/2003'); INSERT INTO aljazeera VALUES (536,'حزب يابلوكو يقاطع الانتخابات الرئاسية الروسية ','12/21/2003'); INSERT INTO aljazeera VALUES (537,'ملفات اقتصادية ساخنة أمام قادة الخليج ','12/21/2003'); INSERT INTO aljazeera VALUES (538,'آلاف الأرجنتينيين يتظاهرون احتجاجا على البطالة ','12/21/2003'); INSERT INTO aljazeera VALUES (539,'مغامرة بريطانية تفشل في تحطيم الرقم العالمي ','12/21/2003'); INSERT INTO aljazeera VALUES (540,'صيني يكسب قضية قرصنة على الإنترنت ','12/21/2003'); INSERT INTO aljazeera VALUES (541,'سول تبحث مواجهة انتشار فيروس إنفلونزا الدجاج ','12/21/2003'); INSERT INTO aljazeera VALUES (542,'نجاح أول عملية لزراعة الكلى في فلسطين ','12/21/2003'); INSERT INTO aljazeera VALUES (543,'العثور على 17 مومياء بمنطقة أثرية بالجيزة ','12/21/2003'); INSERT INTO aljazeera VALUES (544,'عدد خاص لمجلة نيوزويك بالفرنسية ','12/21/2003'); INSERT INTO aljazeera VALUES (545,'السعودية تبحث عن اللقب الخليجي الثالث ','12/21/2003'); INSERT INTO aljazeera VALUES (546,'الفرنسي لينكو يتصدر لاعبي الإسكواش في العالم ','12/21/2003'); INSERT INTO aljazeera VALUES (547,'كتب: التقرير الإستراتيجي العربي ','12/21/2003'); INSERT INTO aljazeera VALUES (548,'كتب: عصر التوافق.. بيان من أجل نظام عالمي جديد','12/21/2003'); INSERT INTO aljazeera VALUES (549,'مشرف ينجو من محاولة اغتيال ثانية ومقتل عشرة بالهجوم ','12/25/2003'); INSERT INTO aljazeera VALUES (550,'هجمات للمقاومة بقذائف الهاون وسط بغداد ','12/25/2003'); INSERT INTO aljazeera VALUES (551,'استشهاد فلسطيني بغزة واحتفالات حزينة في بيت لحم ','12/25/2003'); INSERT INTO aljazeera VALUES (552,'مخاوف واشنطن الأمنية تلغي رحلات أميركية وفرنسية ','12/25/2003'); INSERT INTO aljazeera VALUES (553,'انفجار قنبلة قرب القصر الرئاسي في كابل ','12/25/2003'); INSERT INTO aljazeera VALUES (554,'السودانيون يضعون اللمسات الأخيرة على اتفاق تقاسم الثروة ','12/25/2003'); INSERT INTO aljazeera VALUES (555,'الأسد ومبارك يدعوان لإخلاء المنطقة من أسلحة الدمار ','12/25/2003'); INSERT INTO aljazeera VALUES (556,'مسؤولون آسيويون يبحثون استئناف المحادثات الكورية ','12/25/2003'); INSERT INTO aljazeera VALUES (557,'واشنطن: باكستان ملاذ لطالبان والقاعدة ','12/25/2003'); INSERT INTO aljazeera VALUES (558,'إعادة انتخاب الرئيس الغيني بنسبة 95% ','12/25/2003'); INSERT INTO aljazeera VALUES (559,'سلطات أفريقيا الوسطى تعتقل رئيس جهاز الأمن الرئاسي ','12/25/2003'); INSERT INTO aljazeera VALUES (560,'مخاوف واشنطن الأمنية تربك أوروبا وأميركا ','12/25/2003'); INSERT INTO aljazeera VALUES (561,'الصين وكندا تحظران استيراد لحم البقر الأميركي ','12/25/2003'); INSERT INTO aljazeera VALUES (562,'البوسنة تحقق باتهام واشنطن لجمعية بدعم القاعدة ','12/25/2003'); INSERT INTO aljazeera VALUES (563,'حالة تأهب ببعض دول أوروبا خلال فترة الأعياد ','12/25/2003'); INSERT INTO aljazeera VALUES (564,'نتانياهو يرضخ لتهديدات النواب ويسحب مشروع الميزانية ','12/25/2003'); INSERT INTO aljazeera VALUES (565,'موازنة الأمم المتحدة المقبلة تتجاوز ثلاثة مليارات دولار ','12/25/2003'); INSERT INTO aljazeera VALUES (566,'فشل مارس إكسبريس بالاتصال بمركز المراقبة ','12/25/2003'); INSERT INTO aljazeera VALUES (567,'جامعة بتكساس تعلن ولادة أول أيل مستنسخ ','12/25/2003'); INSERT INTO aljazeera VALUES (568,'حالات جديدة من إنفلونزا الطيور في كوريا الجنوبية ','12/25/2003'); INSERT INTO aljazeera VALUES (569,'عملية في أمعاء الفئران تعالج السكري لديها ','12/25/2003'); INSERT INTO aljazeera VALUES (570,'اليونسكو تزيد من مساعدتها للسودان بعد السلام ','12/25/2003'); INSERT INTO aljazeera VALUES (571,'بيروت تستضيف مؤتمرا سنويا للمسرح العربي ','12/25/2003'); INSERT INTO aljazeera VALUES (572,'تعادل الزمالك واتحاد البليدة في دوري أبطال العرب ','12/25/2003'); INSERT INTO aljazeera VALUES (573,'السد القطري يهزم السالمية في بطولة آسيا لليد ','12/25/2003'); INSERT INTO aljazeera VALUES (574,'كتب: أمتي في العالم.. حولية قضايا العالم الإسلامي','12/25/2003'); Libraries/I18N/Arabic/Examples/PDF/fpdf.php 0000644 00000130340 15213350440 0014135 0 ustar 00 <?php /******************************************************************************* * FPDF * * * * Version: 1.7 * * Date: 2011-06-18 * * Author: Olivier PLATHEY * *******************************************************************************/ define('FPDF_VERSION','1.7'); class FPDF { var $page; // current page number var $n; // current object number var $offsets; // array of object offsets var $buffer; // buffer holding in-memory PDF var $pages; // array containing pages var $state; // current document state var $compress; // compression flag var $k; // scale factor (number of points in user unit) var $DefOrientation; // default orientation var $CurOrientation; // current orientation var $StdPageSizes; // standard page sizes var $DefPageSize; // default page size var $CurPageSize; // current page size var $PageSizes; // used for pages with non default sizes or orientations var $wPt, $hPt; // dimensions of current page in points var $w, $h; // dimensions of current page in user unit var $lMargin; // left margin var $tMargin; // top margin var $rMargin; // right margin var $bMargin; // page break margin var $cMargin; // cell margin var $x, $y; // current position in user unit var $lasth; // height of last printed cell var $LineWidth; // line width in user unit var $fontpath; // path containing fonts var $CoreFonts; // array of core font names var $fonts; // array of used fonts var $FontFiles; // array of font files var $diffs; // array of encoding differences var $FontFamily; // current font family var $FontStyle; // current font style var $underline; // underlining flag var $CurrentFont; // current font info var $FontSizePt; // current font size in points var $FontSize; // current font size in user unit var $DrawColor; // commands for drawing color var $FillColor; // commands for filling color var $TextColor; // commands for text color var $ColorFlag; // indicates whether fill and text colors are different var $ws; // word spacing var $images; // array of used images var $PageLinks; // array of links in pages var $links; // array of internal links var $AutoPageBreak; // automatic page breaking var $PageBreakTrigger; // threshold used to trigger page breaks var $InHeader; // flag set when processing header var $InFooter; // flag set when processing footer var $ZoomMode; // zoom display mode var $LayoutMode; // layout display mode var $title; // title var $subject; // subject var $author; // author var $keywords; // keywords var $creator; // creator var $AliasNbPages; // alias for total number of pages var $PDFVersion; // PDF version number /******************************************************************************* * * * Public methods * * * *******************************************************************************/ function FPDF($orientation='P', $unit='mm', $size='A4') { // Some checks $this->_dochecks(); // Initialization of properties $this->page = 0; $this->n = 2; $this->buffer = ''; $this->pages = array(); $this->PageSizes = array(); $this->state = 0; $this->fonts = array(); $this->FontFiles = array(); $this->diffs = array(); $this->images = array(); $this->links = array(); $this->InHeader = false; $this->InFooter = false; $this->lasth = 0; $this->FontFamily = ''; $this->FontStyle = ''; $this->FontSizePt = 12; $this->underline = false; $this->DrawColor = '0 G'; $this->FillColor = '0 g'; $this->TextColor = '0 g'; $this->ColorFlag = false; $this->ws = 0; // Font path if(defined('FPDF_FONTPATH')) { $this->fontpath = FPDF_FONTPATH; if(substr($this->fontpath,-1)!='/' && substr($this->fontpath,-1)!='\\') $this->fontpath .= '/'; } elseif(is_dir(dirname(__FILE__).'/font')) $this->fontpath = dirname(__FILE__).'/font/'; else $this->fontpath = ''; // Core fonts $this->CoreFonts = array('courier', 'helvetica', 'times', 'symbol', 'zapfdingbats'); // Scale factor if($unit=='pt') $this->k = 1; elseif($unit=='mm') $this->k = 72/25.4; elseif($unit=='cm') $this->k = 72/2.54; elseif($unit=='in') $this->k = 72; else $this->Error('Incorrect unit: '.$unit); // Page sizes $this->StdPageSizes = array('a3'=>array(841.89,1190.55), 'a4'=>array(595.28,841.89), 'a5'=>array(420.94,595.28), 'letter'=>array(612,792), 'legal'=>array(612,1008)); $size = $this->_getpagesize($size); $this->DefPageSize = $size; $this->CurPageSize = $size; // Page orientation $orientation = strtolower($orientation); if($orientation=='p' || $orientation=='portrait') { $this->DefOrientation = 'P'; $this->w = $size[0]; $this->h = $size[1]; } elseif($orientation=='l' || $orientation=='landscape') { $this->DefOrientation = 'L'; $this->w = $size[1]; $this->h = $size[0]; } else $this->Error('Incorrect orientation: '.$orientation); $this->CurOrientation = $this->DefOrientation; $this->wPt = $this->w*$this->k; $this->hPt = $this->h*$this->k; // Page margins (1 cm) $margin = 28.35/$this->k; $this->SetMargins($margin,$margin); // Interior cell margin (1 mm) $this->cMargin = $margin/10; // Line width (0.2 mm) $this->LineWidth = .567/$this->k; // Automatic page break $this->SetAutoPageBreak(true,2*$margin); // Default display mode $this->SetDisplayMode('default'); // Enable compression $this->SetCompression(true); // Set default PDF version number $this->PDFVersion = '1.3'; } function SetMargins($left, $top, $right=null) { // Set left, top and right margins $this->lMargin = $left; $this->tMargin = $top; if($right===null) $right = $left; $this->rMargin = $right; } function SetLeftMargin($margin) { // Set left margin $this->lMargin = $margin; if($this->page>0 && $this->x<$margin) $this->x = $margin; } function SetTopMargin($margin) { // Set top margin $this->tMargin = $margin; } function SetRightMargin($margin) { // Set right margin $this->rMargin = $margin; } function SetAutoPageBreak($auto, $margin=0) { // Set auto page break mode and triggering margin $this->AutoPageBreak = $auto; $this->bMargin = $margin; $this->PageBreakTrigger = $this->h-$margin; } function SetDisplayMode($zoom, $layout='default') { // Set display mode in viewer if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) $this->ZoomMode = $zoom; else $this->Error('Incorrect zoom display mode: '.$zoom); if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') $this->LayoutMode = $layout; else $this->Error('Incorrect layout display mode: '.$layout); } function SetCompression($compress) { // Set page compression if(function_exists('gzcompress')) $this->compress = $compress; else $this->compress = false; } function SetTitle($title, $isUTF8=false) { // Title of document if($isUTF8) $title = $this->_UTF8toUTF16($title); $this->title = $title; } function SetSubject($subject, $isUTF8=false) { // Subject of document if($isUTF8) $subject = $this->_UTF8toUTF16($subject); $this->subject = $subject; } function SetAuthor($author, $isUTF8=false) { // Author of document if($isUTF8) $author = $this->_UTF8toUTF16($author); $this->author = $author; } function SetKeywords($keywords, $isUTF8=false) { // Keywords of document if($isUTF8) $keywords = $this->_UTF8toUTF16($keywords); $this->keywords = $keywords; } function SetCreator($creator, $isUTF8=false) { // Creator of document if($isUTF8) $creator = $this->_UTF8toUTF16($creator); $this->creator = $creator; } function AliasNbPages($alias='{nb}') { // Define an alias for total number of pages $this->AliasNbPages = $alias; } function Error($msg) { // Fatal error die('<b>FPDF error:</b> '.$msg); } function Open() { // Begin document $this->state = 1; } function Close() { // Terminate document if($this->state==3) return; if($this->page==0) $this->AddPage(); // Page footer $this->InFooter = true; $this->Footer(); $this->InFooter = false; // Close page $this->_endpage(); // Close document $this->_enddoc(); } function AddPage($orientation='', $size='') { // Start a new page if($this->state==0) $this->Open(); $family = $this->FontFamily; $style = $this->FontStyle.($this->underline ? 'U' : ''); $fontsize = $this->FontSizePt; $lw = $this->LineWidth; $dc = $this->DrawColor; $fc = $this->FillColor; $tc = $this->TextColor; $cf = $this->ColorFlag; if($this->page>0) { // Page footer $this->InFooter = true; $this->Footer(); $this->InFooter = false; // Close page $this->_endpage(); } // Start new page $this->_beginpage($orientation,$size); // Set line cap style to square $this->_out('2 J'); // Set line width $this->LineWidth = $lw; $this->_out(sprintf('%.2F w',$lw*$this->k)); // Set font if($family) $this->SetFont($family,$style,$fontsize); // Set colors $this->DrawColor = $dc; if($dc!='0 G') $this->_out($dc); $this->FillColor = $fc; if($fc!='0 g') $this->_out($fc); $this->TextColor = $tc; $this->ColorFlag = $cf; // Page header $this->InHeader = true; $this->Header(); $this->InHeader = false; // Restore line width if($this->LineWidth!=$lw) { $this->LineWidth = $lw; $this->_out(sprintf('%.2F w',$lw*$this->k)); } // Restore font if($family) $this->SetFont($family,$style,$fontsize); // Restore colors if($this->DrawColor!=$dc) { $this->DrawColor = $dc; $this->_out($dc); } if($this->FillColor!=$fc) { $this->FillColor = $fc; $this->_out($fc); } $this->TextColor = $tc; $this->ColorFlag = $cf; } function Header() { // To be implemented in your own inherited class } function Footer() { // To be implemented in your own inherited class } function PageNo() { // Get current page number return $this->page; } function SetDrawColor($r, $g=null, $b=null) { // Set color for all stroking operations if(($r==0 && $g==0 && $b==0) || $g===null) $this->DrawColor = sprintf('%.3F G',$r/255); else $this->DrawColor = sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255); if($this->page>0) $this->_out($this->DrawColor); } function SetFillColor($r, $g=null, $b=null) { // Set color for all filling operations if(($r==0 && $g==0 && $b==0) || $g===null) $this->FillColor = sprintf('%.3F g',$r/255); else $this->FillColor = sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255); $this->ColorFlag = ($this->FillColor!=$this->TextColor); if($this->page>0) $this->_out($this->FillColor); } function SetTextColor($r, $g=null, $b=null) { // Set color for text if(($r==0 && $g==0 && $b==0) || $g===null) $this->TextColor = sprintf('%.3F g',$r/255); else $this->TextColor = sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255); $this->ColorFlag = ($this->FillColor!=$this->TextColor); } function GetStringWidth($s) { // Get width of a string in the current font $s = (string)$s; $cw = &$this->CurrentFont['cw']; $w = 0; $l = strlen($s); for($i=0;$i<$l;$i++) $w += $cw[$s[$i]]; return $w*$this->FontSize/1000; } function SetLineWidth($width) { // Set line width $this->LineWidth = $width; if($this->page>0) $this->_out(sprintf('%.2F w',$width*$this->k)); } function Line($x1, $y1, $x2, $y2) { // Draw a line $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k)); } function Rect($x, $y, $w, $h, $style='') { // Draw a rectangle if($style=='F') $op = 'f'; elseif($style=='FD' || $style=='DF') $op = 'B'; else $op = 'S'; $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op)); } function AddFont($family, $style='', $file='') { // Add a TrueType, OpenType or Type1 font $family = strtolower($family); if($file=='') $file = str_replace(' ','',$family).strtolower($style).'.php'; $style = strtoupper($style); if($style=='IB') $style = 'BI'; $fontkey = $family.$style; if(isset($this->fonts[$fontkey])) return; $info = $this->_loadfont($file); $info['i'] = count($this->fonts)+1; if(!empty($info['diff'])) { // Search existing encodings $n = array_search($info['diff'],$this->diffs); if(!$n) { $n = count($this->diffs)+1; $this->diffs[$n] = $info['diff']; } $info['diffn'] = $n; } if(!empty($info['file'])) { // Embedded font if($info['type']=='TrueType') $this->FontFiles[$info['file']] = array('length1'=>$info['originalsize']); else $this->FontFiles[$info['file']] = array('length1'=>$info['size1'], 'length2'=>$info['size2']); } $this->fonts[$fontkey] = $info; } function SetFont($family, $style='', $size=0) { // Select a font; size given in points if($family=='') $family = $this->FontFamily; else $family = strtolower($family); $style = strtoupper($style); if(strpos($style,'U')!==false) { $this->underline = true; $style = str_replace('U','',$style); } else $this->underline = false; if($style=='IB') $style = 'BI'; if($size==0) $size = $this->FontSizePt; // Test if font is already selected if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size) return; // Test if font is already loaded $fontkey = $family.$style; if(!isset($this->fonts[$fontkey])) { // Test if one of the core fonts if($family=='arial') $family = 'helvetica'; if(in_array($family,$this->CoreFonts)) { if($family=='symbol' || $family=='zapfdingbats') $style = ''; $fontkey = $family.$style; if(!isset($this->fonts[$fontkey])) $this->AddFont($family,$style); } else $this->Error('Undefined font: '.$family.' '.$style); } // Select it $this->FontFamily = $family; $this->FontStyle = $style; $this->FontSizePt = $size; $this->FontSize = $size/$this->k; $this->CurrentFont = &$this->fonts[$fontkey]; if($this->page>0) $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); } function SetFontSize($size) { // Set font size in points if($this->FontSizePt==$size) return; $this->FontSizePt = $size; $this->FontSize = $size/$this->k; if($this->page>0) $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); } function AddLink() { // Create a new internal link $n = count($this->links)+1; $this->links[$n] = array(0, 0); return $n; } function SetLink($link, $y=0, $page=-1) { // Set destination of internal link if($y==-1) $y = $this->y; if($page==-1) $page = $this->page; $this->links[$link] = array($page, $y); } function Link($x, $y, $w, $h, $link) { // Put a link on the page $this->PageLinks[$this->page][] = array($x*$this->k, $this->hPt-$y*$this->k, $w*$this->k, $h*$this->k, $link); } function Text($x, $y, $txt) { // Output a string $s = sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); if($this->underline && $txt!='') $s .= ' '.$this->_dounderline($x,$y,$txt); if($this->ColorFlag) $s = 'q '.$this->TextColor.' '.$s.' Q'; $this->_out($s); } function AcceptPageBreak() { // Accept automatic page break or not return $this->AutoPageBreak; } function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') { // Output a cell $k = $this->k; if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) { // Automatic page break $x = $this->x; $ws = $this->ws; if($ws>0) { $this->ws = 0; $this->_out('0 Tw'); } $this->AddPage($this->CurOrientation,$this->CurPageSize); $this->x = $x; if($ws>0) { $this->ws = $ws; $this->_out(sprintf('%.3F Tw',$ws*$k)); } } if($w==0) $w = $this->w-$this->rMargin-$this->x; $s = ''; if($fill || $border==1) { if($fill) $op = ($border==1) ? 'B' : 'f'; else $op = 'S'; $s = sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op); } if(is_string($border)) { $x = $this->x; $y = $this->y; if(strpos($border,'L')!==false) $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k); if(strpos($border,'T')!==false) $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k); if(strpos($border,'R')!==false) $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k); if(strpos($border,'B')!==false) $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k); } if($txt!=='') { if($align=='R') $dx = $w-$this->cMargin-$this->GetStringWidth($txt); elseif($align=='C') $dx = ($w-$this->GetStringWidth($txt))/2; else $dx = $this->cMargin; if($this->ColorFlag) $s .= 'q '.$this->TextColor.' '; $txt2 = str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt))); $s .= sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2); if($this->underline) $s .= ' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt); if($this->ColorFlag) $s .= ' Q'; if($link) $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link); } if($s) $this->_out($s); $this->lasth = $h; if($ln>0) { // Go to next line $this->y += $h; if($ln==1) $this->x = $this->lMargin; } else $this->x += $w; } function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false) { // Output text with automatic or explicit line breaks $cw = &$this->CurrentFont['cw']; if($w==0) $w = $this->w-$this->rMargin-$this->x; $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; $s = str_replace("\r",'',$txt); $nb = strlen($s); if($nb>0 && $s[$nb-1]=="\n") $nb--; $b = 0; if($border) { if($border==1) { $border = 'LTRB'; $b = 'LRT'; $b2 = 'LR'; } else { $b2 = ''; if(strpos($border,'L')!==false) $b2 .= 'L'; if(strpos($border,'R')!==false) $b2 .= 'R'; $b = (strpos($border,'T')!==false) ? $b2.'T' : $b2; } } $sep = -1; $i = 0; $j = 0; $l = 0; $ns = 0; $nl = 1; while($i<$nb) { // Get next character $c = $s[$i]; if($c=="\n") { // Explicit line break if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); $i++; $sep = -1; $j = $i; $l = 0; $ns = 0; $nl++; if($border && $nl==2) $b = $b2; continue; } if($c==' ') { $sep = $i; $ls = $l; $ns++; } $l += $cw[$c]; if($l>$wmax) { // Automatic line break if($sep==-1) { if($i==$j) $i++; if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); } else { if($align=='J') { $this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; $this->_out(sprintf('%.3F Tw',$this->ws*$this->k)); } $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); $i = $sep+1; } $sep = -1; $j = $i; $l = 0; $ns = 0; $nl++; if($border && $nl==2) $b = $b2; } else $i++; } // Last chunk if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } if($border && strpos($border,'B')!==false) $b .= 'B'; $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); $this->x = $this->lMargin; } function Write($h, $txt, $link='') { // Output text in flowing mode $cw = &$this->CurrentFont['cw']; $w = $this->w-$this->rMargin-$this->x; $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; $s = str_replace("\r",'',$txt); $nb = strlen($s); $sep = -1; $i = 0; $j = 0; $l = 0; $nl = 1; while($i<$nb) { // Get next character $c = $s[$i]; if($c=="\n") { // Explicit line break $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); $i++; $sep = -1; $j = $i; $l = 0; if($nl==1) { $this->x = $this->lMargin; $w = $this->w-$this->rMargin-$this->x; $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; } $nl++; continue; } if($c==' ') $sep = $i; $l += $cw[$c]; if($l>$wmax) { // Automatic line break if($sep==-1) { if($this->x>$this->lMargin) { // Move to next line $this->x = $this->lMargin; $this->y += $h; $w = $this->w-$this->rMargin-$this->x; $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; $i++; $nl++; continue; } if($i==$j) $i++; $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); } else { $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link); $i = $sep+1; } $sep = -1; $j = $i; $l = 0; if($nl==1) { $this->x = $this->lMargin; $w = $this->w-$this->rMargin-$this->x; $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; } $nl++; } else $i++; } // Last chunk if($i!=$j) $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link); } function Ln($h=null) { // Line feed; default value is last cell height $this->x = $this->lMargin; if($h===null) $this->y += $this->lasth; else $this->y += $h; } function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='') { // Put an image on the page if(!isset($this->images[$file])) { // First use of this image, get info if($type=='') { $pos = strrpos($file,'.'); if(!$pos) $this->Error('Image file has no extension and no type was specified: '.$file); $type = substr($file,$pos+1); } $type = strtolower($type); if($type=='jpeg') $type = 'jpg'; $mtd = '_parse'.$type; if(!method_exists($this,$mtd)) $this->Error('Unsupported image type: '.$type); $info = $this->$mtd($file); $info['i'] = count($this->images)+1; $this->images[$file] = $info; } else $info = $this->images[$file]; // Automatic width and height calculation if needed if($w==0 && $h==0) { // Put image at 96 dpi $w = -96; $h = -96; } if($w<0) $w = -$info['w']*72/$w/$this->k; if($h<0) $h = -$info['h']*72/$h/$this->k; if($w==0) $w = $h*$info['w']/$info['h']; if($h==0) $h = $w*$info['h']/$info['w']; // Flowing mode if($y===null) { if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) { // Automatic page break $x2 = $this->x; $this->AddPage($this->CurOrientation,$this->CurPageSize); $this->x = $x2; } $y = $this->y; $this->y += $h; } if($x===null) $x = $this->x; $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i'])); if($link) $this->Link($x,$y,$w,$h,$link); } function GetX() { // Get x position return $this->x; } function SetX($x) { // Set x position if($x>=0) $this->x = $x; else $this->x = $this->w+$x; } function GetY() { // Get y position return $this->y; } function SetY($y) { // Set y position and reset x $this->x = $this->lMargin; if($y>=0) $this->y = $y; else $this->y = $this->h+$y; } function SetXY($x, $y) { // Set x and y positions $this->SetY($y); $this->SetX($x); } function Output($name='', $dest='') { // Output PDF to some destination if($this->state<3) $this->Close(); $dest = strtoupper($dest); if($dest=='') { if($name=='') { $name = 'doc.pdf'; $dest = 'I'; } else $dest = 'F'; } switch($dest) { case 'I': // Send to standard output $this->_checkoutput(); if(PHP_SAPI!='cli') { // We send to a browser header('Content-Type: application/pdf'); header('Content-Disposition: inline; filename="'.$name.'"'); header('Cache-Control: private, max-age=0, must-revalidate'); header('Pragma: public'); } echo $this->buffer; break; case 'D': // Download file $this->_checkoutput(); header('Content-Type: application/x-download'); header('Content-Disposition: attachment; filename="'.$name.'"'); header('Cache-Control: private, max-age=0, must-revalidate'); header('Pragma: public'); echo $this->buffer; break; case 'F': // Save to local file $f = fopen($name,'wb'); if(!$f) $this->Error('Unable to create output file: '.$name); fwrite($f,$this->buffer,strlen($this->buffer)); fclose($f); break; case 'S': // Return as a string return $this->buffer; default: $this->Error('Incorrect output destination: '.$dest); } return ''; } /******************************************************************************* * * * Protected methods * * * *******************************************************************************/ function _dochecks() { // Check availability of %F if(sprintf('%.1F',1.0)!='1.0') $this->Error('This version of PHP is not supported'); // Check mbstring overloading if(ini_get('mbstring.func_overload') & 2) $this->Error('mbstring overloading must be disabled'); // Ensure runtime magic quotes are disabled if(get_magic_quotes_runtime()) @set_magic_quotes_runtime(0); } function _checkoutput() { if(PHP_SAPI!='cli') { if(headers_sent($file,$line)) $this->Error("Some data has already been output, can't send PDF file (output started at $file:$line)"); } if(ob_get_length()) { // The output buffer is not empty if(preg_match('/^(\xEF\xBB\xBF)?\s*$/',ob_get_contents())) { // It contains only a UTF-8 BOM and/or whitespace, let's clean it ob_clean(); } else $this->Error("Some data has already been output, can't send PDF file"); } } function _getpagesize($size) { if(is_string($size)) { $size = strtolower($size); if(!isset($this->StdPageSizes[$size])) $this->Error('Unknown page size: '.$size); $a = $this->StdPageSizes[$size]; return array($a[0]/$this->k, $a[1]/$this->k); } else { if($size[0]>$size[1]) return array($size[1], $size[0]); else return $size; } } function _beginpage($orientation, $size) { $this->page++; $this->pages[$this->page] = ''; $this->state = 2; $this->x = $this->lMargin; $this->y = $this->tMargin; $this->FontFamily = ''; // Check page size and orientation if($orientation=='') $orientation = $this->DefOrientation; else $orientation = strtoupper($orientation[0]); if($size=='') $size = $this->DefPageSize; else $size = $this->_getpagesize($size); if($orientation!=$this->CurOrientation || $size[0]!=$this->CurPageSize[0] || $size[1]!=$this->CurPageSize[1]) { // New size or orientation if($orientation=='P') { $this->w = $size[0]; $this->h = $size[1]; } else { $this->w = $size[1]; $this->h = $size[0]; } $this->wPt = $this->w*$this->k; $this->hPt = $this->h*$this->k; $this->PageBreakTrigger = $this->h-$this->bMargin; $this->CurOrientation = $orientation; $this->CurPageSize = $size; } if($orientation!=$this->DefOrientation || $size[0]!=$this->DefPageSize[0] || $size[1]!=$this->DefPageSize[1]) $this->PageSizes[$this->page] = array($this->wPt, $this->hPt); } function _endpage() { $this->state = 1; } function _loadfont($font) { // Load a font definition file from the font directory include($this->fontpath.$font); $a = get_defined_vars(); if(!isset($a['name'])) $this->Error('Could not include font definition file'); return $a; } function _escape($s) { // Escape special characters in strings $s = str_replace('\\','\\\\',$s); $s = str_replace('(','\\(',$s); $s = str_replace(')','\\)',$s); $s = str_replace("\r",'\\r',$s); return $s; } function _textstring($s) { // Format a text string return '('.$this->_escape($s).')'; } function _UTF8toUTF16($s) { // Convert UTF-8 to UTF-16BE with BOM $res = "\xFE\xFF"; $nb = strlen($s); $i = 0; while($i<$nb) { $c1 = ord($s[$i++]); if($c1>=224) { // 3-byte character $c2 = ord($s[$i++]); $c3 = ord($s[$i++]); $res .= chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2)); $res .= chr((($c2 & 0x03)<<6) + ($c3 & 0x3F)); } elseif($c1>=192) { // 2-byte character $c2 = ord($s[$i++]); $res .= chr(($c1 & 0x1C)>>2); $res .= chr((($c1 & 0x03)<<6) + ($c2 & 0x3F)); } else { // Single-byte character $res .= "\0".chr($c1); } } return $res; } function _dounderline($x, $y, $txt) { // Underline text $up = $this->CurrentFont['up']; $ut = $this->CurrentFont['ut']; $w = $this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '); return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt); } function _parsejpg($file) { // Extract info from a JPEG file $a = getimagesize($file); if(!$a) $this->Error('Missing or incorrect image file: '.$file); if($a[2]!=2) $this->Error('Not a JPEG file: '.$file); if(!isset($a['channels']) || $a['channels']==3) $colspace = 'DeviceRGB'; elseif($a['channels']==4) $colspace = 'DeviceCMYK'; else $colspace = 'DeviceGray'; $bpc = isset($a['bits']) ? $a['bits'] : 8; $data = file_get_contents($file); return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data); } function _parsepng($file) { // Extract info from a PNG file $f = fopen($file,'rb'); if(!$f) $this->Error('Can\'t open image file: '.$file); $info = $this->_parsepngstream($f,$file); fclose($f); return $info; } function _parsepngstream($f, $file) { // Check signature if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) $this->Error('Not a PNG file: '.$file); // Read header chunk $this->_readstream($f,4); if($this->_readstream($f,4)!='IHDR') $this->Error('Incorrect PNG file: '.$file); $w = $this->_readint($f); $h = $this->_readint($f); $bpc = ord($this->_readstream($f,1)); if($bpc>8) $this->Error('16-bit depth not supported: '.$file); $ct = ord($this->_readstream($f,1)); if($ct==0 || $ct==4) $colspace = 'DeviceGray'; elseif($ct==2 || $ct==6) $colspace = 'DeviceRGB'; elseif($ct==3) $colspace = 'Indexed'; else $this->Error('Unknown color type: '.$file); if(ord($this->_readstream($f,1))!=0) $this->Error('Unknown compression method: '.$file); if(ord($this->_readstream($f,1))!=0) $this->Error('Unknown filter method: '.$file); if(ord($this->_readstream($f,1))!=0) $this->Error('Interlacing not supported: '.$file); $this->_readstream($f,4); $dp = '/Predictor 15 /Colors '.($colspace=='DeviceRGB' ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w; // Scan chunks looking for palette, transparency and image data $pal = ''; $trns = ''; $data = ''; do { $n = $this->_readint($f); $type = $this->_readstream($f,4); if($type=='PLTE') { // Read palette $pal = $this->_readstream($f,$n); $this->_readstream($f,4); } elseif($type=='tRNS') { // Read transparency info $t = $this->_readstream($f,$n); if($ct==0) $trns = array(ord(substr($t,1,1))); elseif($ct==2) $trns = array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1))); else { $pos = strpos($t,chr(0)); if($pos!==false) $trns = array($pos); } $this->_readstream($f,4); } elseif($type=='IDAT') { // Read image data block $data .= $this->_readstream($f,$n); $this->_readstream($f,4); } elseif($type=='IEND') break; else $this->_readstream($f,$n+4); } while($n); if($colspace=='Indexed' && empty($pal)) $this->Error('Missing palette in '.$file); $info = array('w'=>$w, 'h'=>$h, 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'FlateDecode', 'dp'=>$dp, 'pal'=>$pal, 'trns'=>$trns); if($ct>=4) { // Extract alpha channel if(!function_exists('gzuncompress')) $this->Error('Zlib not available, can\'t handle alpha channel: '.$file); $data = gzuncompress($data); $color = ''; $alpha = ''; if($ct==4) { // Gray image $len = 2*$w; for($i=0;$i<$h;$i++) { $pos = (1+$len)*$i; $color .= $data[$pos]; $alpha .= $data[$pos]; $line = substr($data,$pos+1,$len); $color .= preg_replace('/(.)./s','$1',$line); $alpha .= preg_replace('/.(.)/s','$1',$line); } } else { // RGB image $len = 4*$w; for($i=0;$i<$h;$i++) { $pos = (1+$len)*$i; $color .= $data[$pos]; $alpha .= $data[$pos]; $line = substr($data,$pos+1,$len); $color .= preg_replace('/(.{3})./s','$1',$line); $alpha .= preg_replace('/.{3}(.)/s','$1',$line); } } unset($data); $data = gzcompress($color); $info['smask'] = gzcompress($alpha); if($this->PDFVersion<'1.4') $this->PDFVersion = '1.4'; } $info['data'] = $data; return $info; } function _readstream($f, $n) { // Read n bytes from stream $res = ''; while($n>0 && !feof($f)) { $s = fread($f,$n); if($s===false) $this->Error('Error while reading stream'); $n -= strlen($s); $res .= $s; } if($n>0) $this->Error('Unexpected end of stream'); return $res; } function _readint($f) { // Read a 4-byte integer from stream $a = unpack('Ni',$this->_readstream($f,4)); return $a['i']; } function _parsegif($file) { // Extract info from a GIF file (via PNG conversion) if(!function_exists('imagepng')) $this->Error('GD extension is required for GIF support'); if(!function_exists('imagecreatefromgif')) $this->Error('GD has no GIF read support'); $im = imagecreatefromgif($file); if(!$im) $this->Error('Missing or incorrect image file: '.$file); imageinterlace($im,0); $f = @fopen('php://temp','rb+'); if($f) { // Perform conversion in memory ob_start(); imagepng($im); $data = ob_get_clean(); imagedestroy($im); fwrite($f,$data); rewind($f); $info = $this->_parsepngstream($f,$file); fclose($f); } else { // Use temporary file $tmp = tempnam('.','gif'); if(!$tmp) $this->Error('Unable to create a temporary file'); if(!imagepng($im,$tmp)) $this->Error('Error while saving to temporary file'); imagedestroy($im); $info = $this->_parsepng($tmp); unlink($tmp); } return $info; } function _newobj() { // Begin a new object $this->n++; $this->offsets[$this->n] = strlen($this->buffer); $this->_out($this->n.' 0 obj'); } function _putstream($s) { $this->_out('stream'); $this->_out($s); $this->_out('endstream'); } function _out($s) { // Add a line to the document if($this->state==2) $this->pages[$this->page] .= $s."\n"; else $this->buffer .= $s."\n"; } function _putpages() { $nb = $this->page; if(!empty($this->AliasNbPages)) { // Replace number of pages for($n=1;$n<=$nb;$n++) $this->pages[$n] = str_replace($this->AliasNbPages,$nb,$this->pages[$n]); } if($this->DefOrientation=='P') { $wPt = $this->DefPageSize[0]*$this->k; $hPt = $this->DefPageSize[1]*$this->k; } else { $wPt = $this->DefPageSize[1]*$this->k; $hPt = $this->DefPageSize[0]*$this->k; } $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; for($n=1;$n<=$nb;$n++) { // Page $this->_newobj(); $this->_out('<</Type /Page'); $this->_out('/Parent 1 0 R'); if(isset($this->PageSizes[$n])) $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageSizes[$n][0],$this->PageSizes[$n][1])); $this->_out('/Resources 2 0 R'); if(isset($this->PageLinks[$n])) { // Links $annots = '/Annots ['; foreach($this->PageLinks[$n] as $pl) { $rect = sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]); $annots .= '<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] '; if(is_string($pl[4])) $annots .= '/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>'; else { $l = $this->links[$pl[4]]; $h = isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt; $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',1+2*$l[0],$h-$l[1]*$this->k); } } $this->_out($annots.']'); } if($this->PDFVersion>'1.3') $this->_out('/Group <</Type /Group /S /Transparency /CS /DeviceRGB>>'); $this->_out('/Contents '.($this->n+1).' 0 R>>'); $this->_out('endobj'); // Page content $p = ($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; $this->_newobj(); $this->_out('<<'.$filter.'/Length '.strlen($p).'>>'); $this->_putstream($p); $this->_out('endobj'); } // Pages root $this->offsets[1] = strlen($this->buffer); $this->_out('1 0 obj'); $this->_out('<</Type /Pages'); $kids = '/Kids ['; for($i=0;$i<$nb;$i++) $kids .= (3+2*$i).' 0 R '; $this->_out($kids.']'); $this->_out('/Count '.$nb); $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$wPt,$hPt)); $this->_out('>>'); $this->_out('endobj'); } function _putfonts() { $nf = $this->n; foreach($this->diffs as $diff) { // Encodings $this->_newobj(); $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); $this->_out('endobj'); } foreach($this->FontFiles as $file=>$info) { // Font file embedding $this->_newobj(); $this->FontFiles[$file]['n'] = $this->n; $font = file_get_contents($this->fontpath.$file,true); if(!$font) $this->Error('Font file not found: '.$file); $compressed = (substr($file,-2)=='.z'); if(!$compressed && isset($info['length2'])) $font = substr($font,6,$info['length1']).substr($font,6+$info['length1']+6,$info['length2']); $this->_out('<</Length '.strlen($font)); if($compressed) $this->_out('/Filter /FlateDecode'); $this->_out('/Length1 '.$info['length1']); if(isset($info['length2'])) $this->_out('/Length2 '.$info['length2'].' /Length3 0'); $this->_out('>>'); $this->_putstream($font); $this->_out('endobj'); } foreach($this->fonts as $k=>$font) { // Font objects $this->fonts[$k]['n'] = $this->n+1; $type = $font['type']; $name = $font['name']; if($type=='Core') { // Core font $this->_newobj(); $this->_out('<</Type /Font'); $this->_out('/BaseFont /'.$name); $this->_out('/Subtype /Type1'); if($name!='Symbol' && $name!='ZapfDingbats') $this->_out('/Encoding /WinAnsiEncoding'); $this->_out('>>'); $this->_out('endobj'); } elseif($type=='Type1' || $type=='TrueType') { // Additional Type1 or TrueType/OpenType font $this->_newobj(); $this->_out('<</Type /Font'); $this->_out('/BaseFont /'.$name); $this->_out('/Subtype /'.$type); $this->_out('/FirstChar 32 /LastChar 255'); $this->_out('/Widths '.($this->n+1).' 0 R'); $this->_out('/FontDescriptor '.($this->n+2).' 0 R'); if(isset($font['diffn'])) $this->_out('/Encoding '.($nf+$font['diffn']).' 0 R'); else $this->_out('/Encoding /WinAnsiEncoding'); $this->_out('>>'); $this->_out('endobj'); // Widths $this->_newobj(); $cw = &$font['cw']; $s = '['; for($i=32;$i<=255;$i++) $s .= $cw[chr($i)].' '; $this->_out($s.']'); $this->_out('endobj'); // Descriptor $this->_newobj(); $s = '<</Type /FontDescriptor /FontName /'.$name; foreach($font['desc'] as $k=>$v) $s .= ' /'.$k.' '.$v; if(!empty($font['file'])) $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$font['file']]['n'].' 0 R'; $this->_out($s.'>>'); $this->_out('endobj'); } else { // Allow for additional types $mtd = '_put'.strtolower($type); if(!method_exists($this,$mtd)) $this->Error('Unsupported font type: '.$type); $this->$mtd($font); } } } function _putimages() { foreach(array_keys($this->images) as $file) { $this->_putimage($this->images[$file]); unset($this->images[$file]['data']); unset($this->images[$file]['smask']); } } function _putimage(&$info) { $this->_newobj(); $info['n'] = $this->n; $this->_out('<</Type /XObject'); $this->_out('/Subtype /Image'); $this->_out('/Width '.$info['w']); $this->_out('/Height '.$info['h']); if($info['cs']=='Indexed') $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); else { $this->_out('/ColorSpace /'.$info['cs']); if($info['cs']=='DeviceCMYK') $this->_out('/Decode [1 0 1 0 1 0 1 0]'); } $this->_out('/BitsPerComponent '.$info['bpc']); if(isset($info['f'])) $this->_out('/Filter /'.$info['f']); if(isset($info['dp'])) $this->_out('/DecodeParms <<'.$info['dp'].'>>'); if(isset($info['trns']) && is_array($info['trns'])) { $trns = ''; for($i=0;$i<count($info['trns']);$i++) $trns .= $info['trns'][$i].' '.$info['trns'][$i].' '; $this->_out('/Mask ['.$trns.']'); } if(isset($info['smask'])) $this->_out('/SMask '.($this->n+1).' 0 R'); $this->_out('/Length '.strlen($info['data']).'>>'); $this->_putstream($info['data']); $this->_out('endobj'); // Soft mask if(isset($info['smask'])) { $dp = '/Predictor 15 /Colors 1 /BitsPerComponent 8 /Columns '.$info['w']; $smask = array('w'=>$info['w'], 'h'=>$info['h'], 'cs'=>'DeviceGray', 'bpc'=>8, 'f'=>$info['f'], 'dp'=>$dp, 'data'=>$info['smask']); $this->_putimage($smask); } // Palette if($info['cs']=='Indexed') { $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; $pal = ($this->compress) ? gzcompress($info['pal']) : $info['pal']; $this->_newobj(); $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>'); $this->_putstream($pal); $this->_out('endobj'); } } function _putxobjectdict() { foreach($this->images as $image) $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); } function _putresourcedict() { $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); $this->_out('/Font <<'); foreach($this->fonts as $font) $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); $this->_out('>>'); $this->_out('/XObject <<'); $this->_putxobjectdict(); $this->_out('>>'); } function _putresources() { $this->_putfonts(); $this->_putimages(); // Resource dictionary $this->offsets[2] = strlen($this->buffer); $this->_out('2 0 obj'); $this->_out('<<'); $this->_putresourcedict(); $this->_out('>>'); $this->_out('endobj'); } function _putinfo() { $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION)); if(!empty($this->title)) $this->_out('/Title '.$this->_textstring($this->title)); if(!empty($this->subject)) $this->_out('/Subject '.$this->_textstring($this->subject)); if(!empty($this->author)) $this->_out('/Author '.$this->_textstring($this->author)); if(!empty($this->keywords)) $this->_out('/Keywords '.$this->_textstring($this->keywords)); if(!empty($this->creator)) $this->_out('/Creator '.$this->_textstring($this->creator)); $this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis'))); } function _putcatalog() { $this->_out('/Type /Catalog'); $this->_out('/Pages 1 0 R'); if($this->ZoomMode=='fullpage') $this->_out('/OpenAction [3 0 R /Fit]'); elseif($this->ZoomMode=='fullwidth') $this->_out('/OpenAction [3 0 R /FitH null]'); elseif($this->ZoomMode=='real') $this->_out('/OpenAction [3 0 R /XYZ null null 1]'); elseif(!is_string($this->ZoomMode)) $this->_out('/OpenAction [3 0 R /XYZ null null '.sprintf('%.2F',$this->ZoomMode/100).']'); if($this->LayoutMode=='single') $this->_out('/PageLayout /SinglePage'); elseif($this->LayoutMode=='continuous') $this->_out('/PageLayout /OneColumn'); elseif($this->LayoutMode=='two') $this->_out('/PageLayout /TwoColumnLeft'); } function _putheader() { $this->_out('%PDF-'.$this->PDFVersion); } function _puttrailer() { $this->_out('/Size '.($this->n+1)); $this->_out('/Root '.$this->n.' 0 R'); $this->_out('/Info '.($this->n-1).' 0 R'); } function _enddoc() { $this->_putheader(); $this->_putpages(); $this->_putresources(); // Info $this->_newobj(); $this->_out('<<'); $this->_putinfo(); $this->_out('>>'); $this->_out('endobj'); // Catalog $this->_newobj(); $this->_out('<<'); $this->_putcatalog(); $this->_out('>>'); $this->_out('endobj'); // Cross-ref $o = strlen($this->buffer); $this->_out('xref'); $this->_out('0 '.($this->n+1)); $this->_out('0000000000 65535 f '); for($i=1;$i<=$this->n;$i++) $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i])); // Trailer $this->_out('trailer'); $this->_out('<<'); $this->_puttrailer(); $this->_out('>>'); $this->_out('startxref'); $this->_out($o); $this->_out('%%EOF'); $this->state = 3; } // End of class } // Handle special IE contype request if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype') { header('Content-Type: application/pdf'); exit; } ?> Libraries/I18N/Arabic/Examples/PDF/ufpdf.php 0000644 00000033026 15213350440 0014325 0 ustar 00 <?php /******************************************************************************* * Software: UFPDF, Unicode Free PDF generator * * Version: 0.1 * * based on FPDF 1.52 by Olivier PLATHEY * * Date: 2004-09-01 * * Author: Steven Wittens <steven@acko.net> * * License: GPL * * * * UFPDF is a modification of FPDF to support Unicode through UTF-8. * * * *******************************************************************************/ if(!class_exists('UFPDF')) { define('UFPDF_VERSION','0.1'); include_once 'fpdf.php'; class UFPDF extends FPDF { /******************************************************************************* * * * Public methods * * * *******************************************************************************/ function UFPDF($orientation='P',$unit='mm',$format='A4') { FPDF::FPDF($orientation, $unit, $format); } function GetStringWidth($s) { //Get width of a string in the current font $s = (string)$s; $codepoints=$this->utf8_to_codepoints($s); $cw=&$this->CurrentFont['cw']; $w=0; foreach($codepoints as $cp) $w+=$cw[$cp]; return $w*$this->FontSize/1000; } function AddFont($family,$style='',$file='') { //Add a TrueType or Type1 font $family=strtolower($family); if($family=='arial') $family='helvetica'; $style=strtoupper($style); if($style=='IB') $style='BI'; if(isset($this->fonts[$family.$style])) $this->Error('Font already added: '.$family.' '.$style); if($file=='') $file=str_replace(' ','',$family).strtolower($style).'.php'; if(defined('FPDF_FONTPATH')) $file=FPDF_FONTPATH.$file; include($file); if(!isset($name)) $this->Error('Could not include font definition file'); $i=count($this->fonts)+1; $this->fonts[$family.$style]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'file'=>$file,'ctg'=>$ctg); if($file) { if($type=='TrueTypeUnicode') $this->FontFiles[$file]=array('length1'=>$originalsize); else $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2); } } function Text($x,$y,$txt) { //Output a string $s=sprintf('BT %.2f %.2f Td %s Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escapetext($txt)); if($this->underline and $txt!='') $s.=' '.$this->_dounderline($x,$y,$this->GetStringWidth($txt),$txt); if($this->ColorFlag) $s='q '.$this->TextColor.' '.$s.' Q'; $this->_out($s); } function AcceptPageBreak() { //Accept automatic page break or not return $this->AutoPageBreak; } function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='') { //Output a cell $k=$this->k; if($this->y+$h>$this->PageBreakTrigger and !$this->InFooter and $this->AcceptPageBreak()) { //Automatic page break $x=$this->x; $ws=$this->ws; if($ws>0) { $this->ws=0; $this->_out('0 Tw'); } $this->AddPage($this->CurOrientation); $this->x=$x; if($ws>0) { $this->ws=$ws; $this->_out(sprintf('%.3f Tw',$ws*$k)); } } if($w==0) $w=$this->w-$this->rMargin-$this->x; $s=''; if($fill==1 or $border==1) { if($fill==1) $op=($border==1) ? 'B' : 'f'; else $op='S'; $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op); } if(is_string($border)) { $x=$this->x; $y=$this->y; if(is_int(strpos($border,'L'))) $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k); if(is_int(strpos($border,'T'))) $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k); if(is_int(strpos($border,'R'))) $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k); if(is_int(strpos($border,'B'))) $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k); } if($txt!='') { $width = $this->GetStringWidth($txt); if($align=='R') $dx=$w-$this->cMargin-$width; elseif($align=='C') $dx=($w-$width)/2; else $dx=$this->cMargin; if($this->ColorFlag) $s.='q '.$this->TextColor.' '; $txtstring=$this->_escapetext($txt); $s.=sprintf('BT %.2f %.2f Td %s Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txtstring); if($this->underline) $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$width,$txt); if($this->ColorFlag) $s.=' Q'; if($link) $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$width,$this->FontSize,$link); } if($s) $this->_out($s); $this->lasth=$h; if($ln>0) { //Go to next line $this->y+=$h; if($ln==1) $this->x=$this->lMargin; } else $this->x+=$w; } /******************************************************************************* * * * Protected methods * * * *******************************************************************************/ function _puttruetypeunicode($font) { //Type0 Font $this->_newobj(); $this->_out('<</Type /Font'); $this->_out('/Subtype /Type0'); $this->_out('/BaseFont /'. $font['name'] .'-UCS'); $this->_out('/Encoding /Identity-H'); $this->_out('/DescendantFonts ['. ($this->n + 1) .' 0 R]'); $this->_out('>>'); $this->_out('endobj'); //CIDFont $this->_newobj(); $this->_out('<</Type /Font'); $this->_out('/Subtype /CIDFontType2'); $this->_out('/BaseFont /'. $font['name']); $this->_out('/CIDSystemInfo <</Registry (Adobe) /Ordering (UCS) /Supplement 0>>'); $this->_out('/FontDescriptor '. ($this->n + 1) .' 0 R'); $c = 0; foreach ($font['cw'] as $i => $w) { $widths .= $i .' ['. $w.'] '; } $this->_out('/W ['. $widths .']'); $this->_out('/CIDToGIDMap '. ($this->n + 2) .' 0 R'); $this->_out('>>'); $this->_out('endobj'); //Font descriptor $this->_newobj(); $this->_out('<</Type /FontDescriptor'); $this->_out('/FontName /'.$font['name']); foreach ($font['desc'] as $k => $v) { $s .= ' /'. $k .' '. $v; } if ($font['file']) { $s .= ' /FontFile2 '. $this->FontFiles[$font['file']]['n'] .' 0 R'; } $this->_out($s); $this->_out('>>'); $this->_out('endobj'); //Embed CIDToGIDMap $this->_newobj(); if(defined('FPDF_FONTPATH')) $file=FPDF_FONTPATH.$font['ctg']; else $file=$font['ctg']; $size=filesize($file); if(!$size) $this->Error('Font file not found'); $this->_out('<</Length '.$size); if(substr($file,-2) == '.z') $this->_out('/Filter /FlateDecode'); $this->_out('>>'); $f = fopen($file,'rb'); $this->_putstream(fread($f,$size)); fclose($f); $this->_out('endobj'); } function _dounderline($x,$y,$width,$txt) { //Underline text $up=$this->CurrentFont['up']; $ut=$this->CurrentFont['ut']; $w=$width+$this->ws*substr_count($txt,' '); return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt); } function _textstring($s) { //Convert to UTF-16BE $s = $this->utf8_to_utf16be($s); //Escape necessary characters return '('. strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\')) .')'; } function _escapetext($s) { //Convert to UTF-16BE $s = $this->utf8_to_utf16be($s, false); //Escape necessary characters return '('. strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\')) .')'; } function _putinfo() { $this->_out('/Producer '.$this->_textstring('UFPDF '. UFPDF_VERSION)); if(!empty($this->title)) $this->_out('/Title '.$this->_textstring($this->title)); if(!empty($this->subject)) $this->_out('/Subject '.$this->_textstring($this->subject)); if(!empty($this->author)) $this->_out('/Author '.$this->_textstring($this->author)); if(!empty($this->keywords)) $this->_out('/Keywords '.$this->_textstring($this->keywords)); if(!empty($this->creator)) $this->_out('/Creator '.$this->_textstring($this->creator)); $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis'))); } // UTF-8 to UTF-16BE conversion. // Correctly handles all illegal UTF-8 sequences. function utf8_to_utf16be(&$txt, $bom = true) { $l = strlen($txt); $out = $bom ? "\xFE\xFF" : ''; for ($i = 0; $i < $l; ++$i) { $c = ord($txt{$i}); // ASCII if ($c < 0x80) { $out .= "\x00". $txt{$i}; } // Lost continuation byte else if ($c < 0xC0) { $out .= "\xFF\xFD"; continue; } // Multibyte sequence leading byte else { if ($c < 0xE0) { $s = 2; } else if ($c < 0xF0) { $s = 3; } else if ($c < 0xF8) { $s = 4; } // 5/6 byte sequences not possible for Unicode. else { $out .= "\xFF\xFD"; while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; } continue; } $q = array($c); // Fetch rest of sequence while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); } // Check length if (count($q) != $s) { $out .= "\xFF\xFD"; continue; } switch ($s) { case 2: $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80); // Overlong sequence if ($cp < 0x80) { $out .= "\xFF\xFD"; } else { $out .= chr($cp >> 8); $out .= chr($cp & 0xFF); } continue; case 3: $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80); // Overlong sequence if ($cp < 0x800) { $out .= "\xFF\xFD"; } // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder) else if ($c > 0xD800 && $c < 0xDFFF) { $out .= "\xFF\xFD"; } else { $out .= chr($cp >> 8); $out .= chr($cp & 0xFF); } continue; case 4: $cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80); // Overlong sequence if ($cp < 0x10000) { $out .= "\xFF\xFD"; } // Outside of the Unicode range else if ($cp >= 0x10FFFF) { $out .= "\xFF\xFD"; } else { // Use surrogates $cp -= 0x10000; $s1 = 0xD800 | ($cp >> 10); $s2 = 0xDC00 | ($cp & 0x3FF); $out .= chr($s1 >> 8); $out .= chr($s1 & 0xFF); $out .= chr($s2 >> 8); $out .= chr($s2 & 0xFF); } continue; } } } return $out; } // UTF-8 to codepoint array conversion. // Correctly handles all illegal UTF-8 sequences. function utf8_to_codepoints(&$txt) { $l = strlen($txt); $out = array(); for ($i = 0; $i < $l; ++$i) { $c = ord($txt{$i}); // ASCII if ($c < 0x80) { $out[] = ord($txt{$i}); } // Lost continuation byte else if ($c < 0xC0) { $out[] = 0xFFFD; continue; } // Multibyte sequence leading byte else { if ($c < 0xE0) { $s = 2; } else if ($c < 0xF0) { $s = 3; } else if ($c < 0xF8) { $s = 4; } // 5/6 byte sequences not possible for Unicode. else { $out[] = 0xFFFD; while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; } continue; } $q = array($c); // Fetch rest of sequence while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); } // Check length if (count($q) != $s) { $out[] = 0xFFFD; continue; } switch ($s) { case 2: $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80); // Overlong sequence if ($cp < 0x80) { $out[] = 0xFFFD; } else { $out[] = $cp; } continue; case 3: $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80); // Overlong sequence if ($cp < 0x800) { $out[] = 0xFFFD; } // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder) else if ($c > 0xD800 && $c < 0xDFFF) { $out[] = 0xFFFD; } else { $out[] = $cp; } continue; case 4: $cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80); // Overlong sequence if ($cp < 0x10000) { $out[] = 0xFFFD; } // Outside of the Unicode range else if ($cp >= 0x10FFFF) { $out[] = 0xFFFD; } else { $out[] = $cp; } continue; } } } return $out; } //End of class } } ?> Libraries/I18N/Arabic/Examples/PDF/font/ae_AlHor.ctg.z 0000644 00000002017 15213350440 0016073 0 ustar 00 x����eY���h۶m۶m۶m۶�c۶홗��NO5U��W����f�}��)���]�[��^ݧ���T�T,�V�U<�W%T"%V%U2%W �T*�V�U:�WeT&eVeU6eW�T.�V�U>�WT!VU1W �T)�V�U9�WUT%UVUU5UW �T-�V�U=�W5T#5V5U35W�T+�V����vh�&h�Nj�>�$��t��Vm�4M/k���k}��Z�):���Vi���w�^�S�v���k�:�Qu�CzDO�1=�'�:�=���[�����y=���E��3MU7uUw�T���V_�Q?��@ � ���a���:���Q���T���?��~���?�ݟ7=��1��I/���m�Ǝ=�{������{af������_��)\ "�E��W�^ӛzIoD} D��p�^E) ��Ә�+��v�u<�w't"'v'u2'w �t*�v�u:�wgt&gv�k���ٜ�9�ӹ��y����\Ѕ\�E\��\�IJ��K��˸�˹�+��+]�T��- ���?��a]�:���:N�498�~�7/]�rJ��&dt�;B��?4#�)K�u�u�e�g���ҟ�{����t�M��"�Y6�s��`]���'