Server IP : 108.163.255.210 / Your IP : 18.219.81.129 Web Server : Apache System : Linux blossom.urlnameserver.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64 User : ( 1172) PHP Version : 7.2.34 Disable Function : eval,escapeshellarg,proc_close,proc_get_status,proc_nice,proc_open,symlink,system,pcntl_exec,getrusage,chown,chgp,closelog,openlog,syslog,define_syslog_variables,php_ini_loaded_file,getservbyname,getservbyport,posix_getgid,posix_getgrgid,proc_terminate,pfsockopen,apache_child_terminate,posix_mkfifo,posix_setpgid,posix_setuid,hypot,pg_host,pos,posix_access,posix_getcwd,posix_getservbyname,myshellexec,getpid,posix_getsid,posix_isatty,posix_kill,posix_mknod,posix_setgid,posix_setsid,posix_setuid,posix_times,posix_uname,ps_fill,posix_getpwuid,global,ini_restore,zip_open,zip_read,rar_open,bzopen,bzread,bzwrite,apache_get_modules,apache_get_version,phpversionphpinfo,php_ini_scanned_files,get_current_user,disk_total_space,diskfreespace,leak,imap_list,hypo,filedump,safe_mode,getmygid,apache_getenv,apache_setenv,bzread,bzwrite,bzopen,phpini,higlight_file,dos_conv,get_cwd,er_log,cmd,e_name,vdir,get_dir,only_read,ftok,ftpexec,posix_getpwnam,mysql_list_dbs,disk_free_space,session_save_path,confirm_phpdoc_compiled,zip_entry_rea,php_u,psockopen,crack_opendict,crack_getlastmessage,crack_closedict,crack_check,fpassthru,posix_get_last_error,posix_getlogin,posix_getgroups,posix_strerror,posix_getrlimit,posix_getpgrp,posix_getgrnam,pos,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/unilinki/public_html/csrability.in/app/Http/Controllers/ |
Upload File : |
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Mail; use Exception; use App\Job; use App\UserInterest; use App\Video; use App\Advertisement; use App\Rfp; use App\Event; use App\Trend; use App\Banner; use App\Feedback; use App\Application; use App\User; use App\Contact; use App\ContentManagement; use App\JobSearch; use App\TroubleSign; use App\StoreAdvertisement; use App\JobSeeker; use App\ProfileSeeker; use App\Rules\Captcha; class HomeController extends Controller { public function index() { return view('front.pages.home.about')->with(['title'=>'Home CSR']); } public function update(Request $request) { try { $interest = $request->input('interest_area'); $rs = false; foreach ($interest as $key => $value) { $rs= UserInterest::create([ 'user_id' => \Auth::user()->id, 'interest_area' => $value, 'interest_selected' => '1' ]); } if($rs) { $message = array('flag'=>'alert-success', 'message'=>'Interest Area Saved Successfully'); return back()->with(['message'=>$message]); } $message = array('flag'=>'alert-danger', 'message'=>'Unable to save Interest Area, Please try again'); return back()->with(['message'=>$message]); } catch (Exception $e) { $message = array('flag'=>'alert-danger', 'message'=>'Something went wrong, Please try again'); return back()->with(['message'=>$message]); } } public function showVideo(Request $request) { $content = Video::orderBy('created_at', 'desc')->limit(1)->get(); $latjobs = Job::orderBy(DB::raw('RAND()'))->where('job_type', 'Prime')->where('job_status', '0')->limit(5)->get(); $advertisement = Advertisement::orderBy('created_at', 'desc')->where('status', '0')->limit(2)->get(); $latrfp1 = Rfp::orderBy('created_at', 'desc')->where('rfp_status', '0')->limit(1)->get(); $latrfp2 = Rfp::orderBy('created_at', 'desc')->where('rfp_status', '0')->skip(1)->take(10)->get(); $trend = Trend::orderBy('created_at', 'desc')->where('status', '0')->limit(4)->get(); $event = Event::orderBy('created_at', 'desc')->where('status', '0')->limit(3)->get(); $banner = Banner::orderBy('created_at', 'desc')->limit(1)->whereNotBetween('id', [4, 6])->get(); $banner1 = Banner::orderBy('created_at', 'desc')->skip(1)->take(2)->whereNotBetween('id', [4, 6])->get(); $banner2 = Banner::orderBy('created_at', 'desc')->where('id', 4)->get(); $banner3 = Banner::orderBy('created_at', 'desc')->where('id', 5)->get(); $banner4 = Banner::orderBy('created_at', 'desc')->where('id', 6)->get(); $jobstatus = DB::table('jobs')->whereDate('closing_date', '<', now())->update(['job_status' => '4']); $rfpstatus = DB::table('rfps')->whereDate('closing_date', '<', now())->update(['rfp_status' => '4']); $scrapejobstatus = DB::table('temp_jobs')->whereDate('closing_date', '<', now())->update(['job_status' => '1']); $savedjob = Application::orderBy('id', 'desc')->get(); // dd($content); $jobscity = DB::table('cities') ->leftJoin('jobs', 'cities.id', '=', 'jobs.city') ->select('jobs.city', 'cities.city', 'cities.id', 'jobs.id as city_id') ->get(); $jobsstate = DB::table('states') ->leftJoin('jobs', 'states.id', '=', 'jobs.state') ->select('jobs.state', 'states.name', 'states.id', 'jobs.id as state_id') ->get(); $jobscountry = DB::table('countries') ->leftJoin('jobs', 'countries.id', '=', 'jobs.country') ->select('jobs.country', 'countries.name', 'countries.id','jobs.id as job_id') ->get(); $users = User::orderBy('created_at', 'desc')->where('is_deleted', '=', '0')->get(); $organisations = DB::table('jobs')->distinct('organisation')->pluck('organisation'); return view('front.pages.home.index')->with(['title'=>'Home', 'content' => $content, 'latjobs' => $latjobs, 'advertisement' => $advertisement, 'latrfp1' => $latrfp1, 'latrfp2' => $latrfp2, 'trend' => $trend, 'event' => $event, 'banner' => $banner, 'banner1' => $banner1, 'banner2' => $banner2, 'banner3' => $banner3, 'banner4' => $banner4, 'jobstatus' => $jobstatus, 'scrapejobstatus' => $scrapejobstatus, 'savedjob' => $savedjob, 'jobscity' => $jobscity, 'jobsstate' => $jobsstate, 'jobscountry' => $jobscountry, 'users' => $users, 'organisations' => $organisations]); } public function storeFeedback(Request $request) { $request->validate([ 'g-recaptcha-response'=>new Captcha(), ]); try { $rs = Feedback::create([ 'name' =>$request->input('name'), 'email' => $request->input('email'), 'contact' => $request->input('contact'), 'subject' => $request->input('subject'), 'message' => $request->input('message'), 'status' => 0 ]); if($rs) { # Send OTP in email after successful registration $data = array(); $data['name'] = $request->input('name'); $data['email'] = $request->input('email'); Mail::send('mail.feedback', $data, function ($message) use ($data) { $message->to($data['email']); $message->from('admin@csrability.com', 'CSR Ability'); $message->subject('Thank You for your Feedback'); }); //$message1 = array('flag'=>'alert-success', 'message1'=>'Feedback Sent Successfully'); return redirect()->back()->with('message1', 'Feedback Sent Successfully!'); } $message = array('flag'=>'alert-danger', 'message'=>'Unable to send Feedback, Please try again'); return back()->with(['message'=>$message]); } catch (Exception $e) { $message = array('flag'=>'alert-danger', 'message'=>$e->getMessage()); return back()->with(['message'=>$message]); } } public function storeHelp(Request $request) { $request->validate([ 'g-recaptcha-response'=>new Captcha(), ]); try { $rs = JobSearch::create([ 'name' =>$request->input('name'), 'email' => $request->input('email'), 'subject' => $request->input('subject'), 'organisation' => $request->input('organisation'), 'message' => $request->input('message'), 'status' => 0 ]); if($rs) { # Send OTP in email after successful registration $data = array(); $data['name'] = $request->input('name'); $data['email'] = $request->input('email'); Mail::send('mail.feedback', $data, function ($message) use ($data) { $message->to($data['email']); $message->from('admin@csrability.com', 'CSR Ability'); $message->subject('Thank You for your Contacting'); }); //$message1 = array('flag'=>'alert-success', 'message1'=>'Feedback Sent Successfully'); return redirect()->back()->with('message5', 'Mail Sent Successfully!'); } $message = array('flag'=>'alert-danger', 'message'=>'Unable to send mail, Please try again'); return back()->with(['message'=>$message]); } catch (Exception $e) { $message = array('flag'=>'alert-danger', 'message'=>$e->getMessage()); return back()->with(['message'=>$message]); } } public function storeTrouble(Request $request) { try { $rs = TroubleSign::create([ 'name' =>$request->input('name'), 'email' => $request->input('email'), 'contact' => $request->input('contact'), 'message' => $request->input('message'), 'status' => 0 ]); if($rs) { # Send OTP in email after successful registration $data = array(); $data['name'] = $request->input('name'); $data['email'] = $request->input('email'); $data['contact'] = $request->input('contact'); $data['textarea'] = $request->input('message'); Mail::send('mail.trouble', $data, function ($message) use ($data) { $message->to($data['email']); $message->from('admin@csrability.com', 'CSR Ability'); $message->subject('Trouble signing in'); }); Mail::send('mail.troubleadmin', $data, function ($message) use ($data) { $message->to('clients@csrability.com'); $message->from('admin@csrability.com', 'CSRAbility'); $message->subject('Trouble signing in'); }); $message1 = array('flag'=>'alert-success', 'message'=>'Mail Sent Successfully'); return redirect()->back()->with(['message'=>$message1]); } $message = array('flag'=>'alert-danger', 'message'=>'Unable to send Feedback, Please try again'); return back()->with(['message'=>$message]); } catch (Exception $e) { $message = array('flag'=>'alert-danger', 'message'=>$e->getMessage()); return back()->with(['message'=>$message]); } } public function storeAdvertise(Request $request) { $request->validate([ 'g-recaptcha-response'=>new Captcha(), ]); try { $rs = StoreAdvertisement::create([ 'name' =>$request->input('name'), 'email' => $request->input('email'), 'contact' => $request->input('contact'), 'message' => $request->input('message'), 'status' => 0 ]); if($rs) { # Send OTP in email after successful registration $data = array(); $data['name'] = $request->input('name'); $data['email'] = $request->input('email'); $data['contact'] = $request->input('contact'); $data['textarea'] = $request->input('message'); Mail::send('mail.advertisement', $data, function ($message) use ($data) { $message->to($data['email']); $message->from('clients@csrability.com', 'CSR Ability'); $message->subject('Advertise with CSRAbility’'); }); Mail::send('mail.advertisementadmin', $data, function ($message) use ($data) { $message->to('clients@csrability.com'); $message->from('admin@csrability.com', 'CSRAbility'); $message->subject('Advertise with CSRAbility'); }); //$message1 = array('flag'=>'alert-success', 'message1'=>'Feedback Sent Successfully'); return redirect()->back()->with('message9', 'Advertise with CSRAbility’!'); } $message = array('flag'=>'alert-danger', 'message'=>'Unable to send Feedback, Please try again'); return back()->with(['message'=>$message]); } catch (Exception $e) { $message = array('flag'=>'alert-danger', 'message'=>$e->getMessage()); return back()->with(['message'=>$message]); } } public function forgot_password() { return view('front.pages.auth.forgot_password'); } public function reset_password($token) { return view('front.pages.auth.reset_password'); } public function changePassword() { return view('front.pages.auth.change_password'); } public function changePasswordSuccessfully(Request $request) { $request->validate([ 'password'=>['min:6', 'confirmed'], ]); $data = $request->all(); $user = User::find(auth()->user()->id); $userId = Auth::user()->id; if(!Hash::check($data['cpassword'], $user->password)){ $request->session()->flash('success','Please Enter Correct Current Password'); return back(); }else{ DB::table('users')->where('id',$userId) ->update(['password' => Hash::make($data['password'])]); $request->session()->flash('success','Password Changed Successfully'); return redirect()->route('change_passsword'); } } public function contact() { return view('front.pages.home.contact')->with(['title'=>'Contact CSR']); } public function contactForm(Request $request) { $request->validate([ 'g-recaptcha-response'=>new Captcha(), ]); try { $rs = Contact::create([ 'name' =>$request->input('name'), 'email' => $request->input('email'), 'contact' => $request->input('contact'), 'message' => $request->input('message'), 'status' => 0 ]); if($rs) { # Send OTP in email after successful registration $data = array(); $data['name'] = $request->input('name'); $data['email'] = $request->input('email'); Mail::send('mail.support', $data, function ($message) use ($data) { $message->to($data['email']); $message->from('admin@csrability.com', 'CSR Ability'); $message->subject('Thank You for Contacting Us'); }); //$message1 = array('flag'=>'alert-success', 'message1'=>'Feedback Sent Successfully'); return redirect()->back()->with('message1', 'Feedback Sent Successfully!'); } $message = array('flag'=>'alert-danger', 'message'=>'Unable to send Feedback, Please try again'); return back()->with(['message'=>$message]); } catch (Exception $e) { $message = array('flag'=>'alert-danger', 'message'=>$e->getMessage()); return back()->with(['message'=>$message]); } } public function aboutcontent() { $content = ContentManagement::where('id', '1')->get(); return view('front.pages.home.about')->with(['title'=>'About CSR', 'content' => $content]); } public function terms() { $content = ContentManagement::where('id', '2')->get(); return view('front.pages.home.terms')->with(['title'=>'Terms & Conditions CSR', 'content' => $content]); } public function agreements() { $content = ContentManagement::where('id', '2')->get(); return view('front.pages.home.agreement')->with(['title'=>'Terms & Agreements CSR', 'content' => $content]); } public function privacy() { $content = ContentManagement::where('id', '3')->get(); return view('front.pages.home.privacy')->with(['title'=>'Privacy Policy CSR', 'content' => $content]); } public function contactSeeker(Request $request) { $request->validate([ 'g-recaptcha-response'=>new Captcha(), ]); try { $rs = JobSeeker::create([ 'name' =>$request->input('name'), 'email' => $request->input('email'), 'organisation' => $request->input('organisation'), 'subject' => $request->input('subject'), 'mail_for' => $request->input('mail_for'), 'status' => 0 ]); if($rs) { # Send OTP in email after successful registration $data = array(); $data['name'] = $request->input('name'); $data['email'] = $request->input('email'); $data['organisation'] = $request->input('organisation'); $data['textarea'] = $request->input('message'); $data['subject'] = $request->input('subject'); $data['mail_for'] = $request->input('mail_for'); Mail::send('mail.seeker', $data, function ($message) use ($data) { $message->to($data['email']); $message->from('admin@csrability.com', 'CSRAbility'); $message->subject('Thanks for your mail'); }); Mail::send('mail.seekeradmin', $data, function ($message) use ($data) { $message->to('clients@csrability.com'); $message->from('admin@csrability.com', 'CSRAbility'); $message->subject($data['subject']); }); //$message1 = array('flag'=>'alert-success', 'message1'=>'Feedback Sent Successfully'); return redirect()->back()->with('message8', 'Mail Sent Successfully!'); } $message = array('flag'=>'alert-danger', 'message'=>'Unable to send Feedback, Please try again'); return back()->with(['message'=>$message]); } catch (Exception $e) { $message = array('flag'=>'alert-danger', 'message'=>$e->getMessage()); return back()->with(['message'=>$message]); } } public function profileSeeker(Request $request) { $request->validate([ 'g-recaptcha-response'=>new Captcha(), ]); try { $rs = ProfileSeeker::create([ 'name' =>$request->input('name'), 'profile_name' =>$request->input('profile_name'), 'email' => $request->input('email'), 'organisation' => $request->input('organisation'), 'subject' => $request->input('subject'), 'textarea' => $request->input('textarea'), 'status' => 0 ]); if($rs) { # Send OTP in email after successful registration $data = array(); $data['name'] = $request->input('name'); $data['profile_name'] = $request->input('profile_name'); $data['email'] = $request->input('email'); $data['organisation'] = $request->input('organisation'); $data['subject'] = $request->input('subject'); $data['textarea'] = $request->input('textarea'); Mail::send('mail.profile', $data, function ($message) use ($data) { $message->to($data['email']); $message->from('admin@csrability.com', 'CSRAbility'); $message->subject('Thanks for your mail'); }); Mail::send('mail.profileadmin', $data, function ($message) use ($data) { $message->to('clients@csrability.com'); $message->from('admin@csrability.com', 'CSRAbility'); $message->subject('Featured job profile required'); }); //$message1 = array('flag'=>'alert-success', 'message1'=>'Feedback Sent Successfully'); return redirect()->back()->with('message8', 'Mail Sent Successfully!'); } $message = array('flag'=>'alert-danger', 'message'=>'Unable to send Feedback, Please try again'); return back()->with(['message'=>$message]); } catch (Exception $e) { $message = array('flag'=>'alert-danger', 'message'=>$e->getMessage()); return back()->with(['message'=>$message]); } } }