public function getDmaJobs($dma_code)
 {
     $featuredJobs = \App\Job::where('dma_code', $dma_code)->where('featured_flag', 1)->select('id', 'title', 'city', 'state', 'dma_code')->orderBy('updated_at', 'desc')->get();
     $jobs = \App\Job::where('dma_code', $dma_code)->where('featured_flag', 0)->select('id', 'title', 'city', 'state', 'dma_code')->orderBy('updated_at', 'desc')->take(10)->get();
     $response = ['set' => $jobs, 'list' => $featuredJobs];
     return response()->json($response);
 }
 public function getView($id)
 {
     $company = Company::where("id", $id)->with(['customers' => function ($q) {
         $q->whereNull("user_id");
     }])->first();
     return view("company_profile.company_profile", ["company" => $company, "estimators" => User::where("company_id", $id)->count(), "jobs" => Job::where("company_id", $id)->count(), "customers" => $company->customers->count(), "estimatorz" => User::where("company_id", $id)->get()]);
 }
 /**
  * Search jobs methods
  * @param \Illuminate\Http\Request $request
  *
  * @return $this
  */
 public function search(Request $request)
 {
     $keywords = $request->keywords;
     $searchJobs = Job::where('title', 'LIKE', '%' . $keywords . '%')->orWhere('type', 'LIKE', '%' . $keywords . '%')->get();
     $data = ['searchJobs' => $searchJobs];
     return view('search')->with($data);
 }
Example #4
0
 public function getEntry(Request $request, $job_number)
 {
     $singleObj = Job::where('job_number', $job_number)->first();
     $headTitle = '案件に応募';
     return view('jobs.entry', ['singleObj' => $singleObj, 'headTitle' => $headTitle]);
     //echo $_SERVER['DOCUMENT_ROOT'];
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $events = Event::where('user_id', $user_id)->get();
     $jobs = Job::where('user_id', $user_id)->get();
     // return view('members.dashboardpage', ['user' => $user, 'events' => $events, 'jobs' => $jobs]);
     return view('public.frontpage', ['user' => $user, 'events' => $events, 'jobs' => $jobs]);
 }
Example #6
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($company_id, Request $request)
 {
     // get current company
     $company = Company::find($company_id);
     // Sort by
     if ($request->has('sortby')) {
         $sort_value = $request->get('sortby');
         switch ($sort_value) {
             case 'job_title':
                 $jobs = Job::where('company_id', '=', $company_id)->where('status_id', '=', 1)->orderBy('job_title', 'desc')->paginate(10);
                 break;
             case 'exp_date':
                 $jobs = Job::where('company_id', '=', $company_id)->where('status_id', '=', 1)->orderBy('exp_date', 'desc')->paginate(10);
                 break;
             case 'view_stats':
                 $jobs = Job::where('company_id', '=', $company_id)->where('status_id', '=', 1)->orderBy('exp_date', 'desc')->paginate(10);
                 break;
             case 'applicants':
                 $jobs = Job::where('company_id', '=', $company_id)->where('status_id', '=', 1)->orderBy(count($company->job_applicants), 'desc')->paginate(10);
                 break;
             default:
                 $jobs = Job::where('company_id', '=', $company_id)->where('status_id', '=', 1)->orderBy('id', 'desc')->paginate(10);
                 break;
         }
     } else {
         $jobs = Job::where('company_id', '=', $company_id)->where('status_id', '=', 1)->paginate(10);
     }
     $baseurl = url();
     $jobs->setPath($baseurl . '/companies/' . $company_id . '/jobs');
     return view('jobs.index', compact('jobs', 'company'));
 }
 public function edit($id)
 {
     $message = Session::get('message');
     $quote_request = QuoteRequest::find($id);
     $job = Job::where('quote_requests_id', $id)->first();
     $qris = $quote_request->qris;
     return view('jobs.edit', compact('quote_request', 'qris', 'job', 'message'));
 }
Example #8
0
 /**
  * Permet de mettre à jour
  *
  * @return Response
  */
 public function update(Request $request)
 {
     $id = $request->job_id;
     $resume = $request->resume;
     $content = $request->content;
     $fiches = Job::where('id', $id)->update(['resume' => $resume, 'content' => $content]);
     return redirect(route('admin.metiers.index', compact('fiches')));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getEstimations()
 {
     if (!Auth::check()) {
         return Redirect::to("/");
     }
     $id = Auth::user()->id;
     $customer = Customer::where("user_id", $id)->with("user")->with("jobs")->first();
     $total = Job::where("customer_id", $id)->count();
     return view("customer.estimations", ["customer" => $customer, "total" => $total]);
 }
Example #10
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('export-monster-files test')->cron('00 * * * *')->name('process-feed')->withoutOverlapping();
     $schedule->call(function () {
         $files = \App\FileDeleteQueue::all();
         foreach ($files as $file) {
             $local_file = config('monster.tmp_storage_path') . $file->file_name;
             if (file_exists($local_file)) {
                 $tmp_is_deleted = unlink(realpath($local_file));
                 if (!$tmp_is_deleted) {
                     \App\ExportLog::create(['process' => 'deleting local file', 'filename' => $ftp_file, 'message' => 'cannot be deleted from /tmp/ folder']);
                 } else {
                     $file->delete();
                 }
             }
         }
     })->name('delete-local-files')->twiceDaily(12, 23);
     $schedule->call(function () {
         // deleting expired jobs
         $today = date('Y-m-d', time());
         $jobs = \App\Job::where('end_date', '<', $today)->take(1000)->get();
         if (!$jobs->isEmpty()) {
             $i = 0;
             foreach ($jobs as $j) {
                 $j->delete();
                 $i++;
             }
             \App\ExportLog::create(['process' => 'deleting expired jobs', 'message' => 'Deleted ' . $i . ' jobs']);
         }
     })->cron('5 * * * *')->name('delete-expired-jobs-hourly')->withoutOverlapping();
     $schedule->call(function () {
         $today = date('Y-m-d', time() - 3 * 86400);
         \App\ExportRecordFailure::where('created_at', '<', $today)->take(3000)->delete();
     })->cron('5 * * * *')->name('delete-export-record-failures')->withoutOverlapping();
     $schedule->call(function () {
         $queue = \App\CacheQueue::where(['in_process' => 0])->take(10);
         $records = $queue->get();
         if (!$records->isEmpty()) {
             $queue->update(['in_process' => 1]);
             foreach ($records as $record) {
                 $run = call_user_func($record->model . '::' . $record->method, $record->args);
                 if ($run) {
                     $record->delete();
                 } else {
                     $record->in_process = null;
                     $record->save();
                 }
             }
         }
     })->everyMinute()->name('process-cache-queue-records');
 }
Example #11
0
 private function replyToJobSender($category, $recipient)
 {
     $jobs = $this->job->where('deadline', '>=', Carbon::today())->where('category', 'like', '%' . $category . '%')->orderBy('id', 'desc')->take(5)->get();
     if (count($jobs) > 0) {
         foreach ($jobs as $job) {
             $message = "Job is {$job->jobType}, located at {$job->location}, contact {$job->contact} on {$job->contactName}, positions available {$job->positions}";
             $this->send($recipient, $message);
             Log::debug("msg sent: " . $message);
         }
     } else {
         $message = "Sorry no jobs matching your category, try another category";
         $this->send($recipient, $message);
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show(Request $request)
 {
     $user = $request->user();
     $user_id = $user->id;
     $events = Event::where('user_id', $user_id)->get();
     $jobs = Job::where('user_id', $user_id)->get();
     // return var_dump($events);
     // $data = '';
     //return(var_dump($user));
     //return $user->name;
     //return view('members.dashboardpage', ['user' => User::findOrFail($id)]);
     return view('members.dashboardpage', ['user' => $user, 'events' => $events, 'jobs' => $jobs]);
     //    ->withPosts($posts)
     //    ;
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request, $id)
 {
     //return ($request->all());
     $job = Job::where('job_id', $id)->first();
     $applicant = new Applicant($request->all());
     $applicant->job_id = $id;
     //return $applicant;
     //        $a =$job->applicants()->create($request->all());
     //        $applicant = new $job->applicants($request->all());
     $filename = Str::lower(pathinfo($request->file('resume')->getClientOriginalName(), PATHINFO_FILENAME) . '-' . uniqid() . '.' . $request->file('resume')->getClientOriginalExtension());
     $applicant->resume = $filename;
     if ($request->file('resume')->move(base_path() . '/public/images/Resumes/', $filename)) {
         $applicant->save();
         $firstname = $request->first_name;
         $lastname = $request->last_name;
         $applyemail = $request->email;
         $this->sendConfirmation($firstname, $lastname, $applyemail);
         return redirect('company/careers')->with('success', 'Your application is successfully submitted');
     } else {
         return redirect('company/careers')->with('fail', 'Something went wrong. Try again.');
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $job = Job::where('id', $id)->first();
     return view('jobs.edit')->with('job', $job);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     // validate
     // read more on validation at http://laravel.com/docs/validation
     $rules = array('judul' => 'required', 'deskripsi' => 'required', 'upah_max' => 'required|numeric', 'upah_min' => 'required|numeric', 'category' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     // process the login
     if ($validator->fails()) {
         return Redirect::to('job/create')->withErrors($validator)->withInput(Input::except('password'));
         // TODO: Check
     } else {
         $logged_user_id = Auth::user()->id;
         // store
         $new_job = new Job();
         $new_job->freelancer_info_id = $logged_user_id;
         $new_job->judul = Input::get('judul');
         $new_job->deskripsi = Input::get('deskripsi');
         $new_job->upah_max = Input::get('upah_max');
         $new_job->upah_min = Input::get('upah_min');
         $new_job->save();
         $new_job_cat = new JobCategory();
         $new_job_cat->job_id = Job::where('judul', Input::get('judul'))->first()->id;
         $new_job_cat->category_id = Input::get('category');
         $new_job_cat->save();
         // redirect
         //Session::flash('message', 'Successfully created job!');
         return Redirect::to('job');
     }
 }
 public function getJobs()
 {
     $jobs = Job::where("company_id", Auth::getUser()->company_id)->with(["company", "customer"]);
     return view("jobs", ["jobs" => $jobs]);
 }
 public function randomGenerator()
 {
     $id = 'JJ' . mt_rand(1000, 9999);
     $count = Job::where('job_id', '$id')->count();
     if ($count != 0) {
         randomGenerator();
     }
     return $id;
 }
 /**
  * Show all job request for the logged-in user
  *
  * @return Response
  */
 public function showAllRequest()
 {
     // get all his/her job
     $logged_user_id = Auth::user()->id;
     $user_info = UserInfo::find($logged_user_id);
     $freelancer_info = FreelancerInfo::find($user_info->user_id);
     $jobs = Job::where('freelancer_info_id', $freelancer_info->user_info_id)->get();
     $query = "SELECT jr.job_id, jr.seeker_id, j.deskripsi ";
     $query = $query . "FROM job_request jr, job j ";
     $query = $query . "WHERE j.freelancer_info_id = " . $freelancer_info->user_info_id . " and j.id = jr.job_id";
     $job_requests = DB::select(DB::raw($query));
     $job_requests_data = [];
     foreach ($job_requests as $a_job_req => $value) {
         # code...
         $job_id = $value->job_id;
         $job_deskripsi = $value->deskripsi;
         $seeker_id = $value->seeker_id;
         $seeker_email = User::find($seeker_id)->email;
         $a_job_req_data = array('job_id' => $job_id, 'job_deskripsi' => $job_deskripsi, 'seeker_id' => $seeker_id, 'seeker_email' => $seeker_email);
         array_push($job_requests_data, $a_job_req_data);
     }
     return View::make('job.requests')->with('job_requests_data', $job_requests_data);
 }
Example #19
0
 public function show($slug, $id)
 {
     $job = Job::where('id', $id)->where('title', $slug)->firstOrFail();
     return view('jobs.show', compact('job'));
 }
Example #20
0
 public function approveAll(Request $request)
 {
     $JobsId = $request->input('SelectedJobs');
     if (is_array($JobsId)) {
         foreach ($JobsId as $job) {
             $job = Job::where('id', $job)->update(['approved' => 1]);
         }
     }
     $jobs = Job::where('approved', 0)->orderBy('title', 'desc')->get();
     Session::flash('success', 'Jobs have been approved');
     return view('jobs.approve')->withJobs($jobs);
 }
Example #21
0
 public function display(Request $request)
 {
     $jobType = $request->input('jobtype', 'all');
     switch ($jobType) {
         case 'fixed':
             $jobType = 2;
             break;
         case 'hourly':
             $jobType = 3;
             break;
         case 'services':
             $jobType = 1;
             break;
         default:
             $jobType = 0;
     }
     $startDate = date('Y-m-d', strtotime('-12 month'));
     $endDate = date('Y-m-d');
     $jobModel = new Job();
     $jobCounts = $jobModel->select('jobtype', DB::raw('count(id) as counts'))->where('updated_at', '>=', $startDate)->where('updated_at', '<=', $endDate)->groupBy('jobtype')->get()->toArray();
     $chartData = array();
     foreach ($jobCounts as $counts) {
         switch ($counts['jobtype']) {
             case 1:
                 $label = 'Services';
                 break;
             case 2:
                 $label = 'Fixed';
                 break;
             case 3:
                 $label = 'Hourly';
                 break;
             default:
                 $label = 'All';
         }
         $chartData[] = array('label' => $label, 'value' => (int) $counts['counts']);
     }
     $jobStats = $jobModel->select(DB::raw('count(id) as counts'), DB::raw('date(updated_at) as date'))->whereIn('jobtype', array(2, 3))->where('status', 6)->where('updated_at', '>=', $startDate)->where('updated_at', '<=', $endDate)->groupBy('status')->groupBy('updated_at')->get()->toArray();
     $statsData = array();
     $maxValue = 3;
     foreach ($jobStats as $stats) {
         $statsData[strtotime($stats['date'])] = (int) $stats['counts'];
         $maxValue = $stats['counts'] > $maxValue ? (int) $stats['counts'] : $maxValue;
     }
     $xtmp = array();
     for ($i = 365; $i >= 0; $i--) {
         $date = strtotime($endDate . '-' . $i . ' day');
         if (isset($statsData[$date])) {
             $xtmp[] = array('x' => $date, 'y' => $statsData[$date]);
         } else {
             $xtmp[] = array('x' => $date, 'y' => 0);
         }
     }
     $tmp[] = array('key' => 'Project completed', 'values' => $xtmp);
     $totalProjects = $jobModel->where('status', '>', 0)->whereIn('jobtype', array(2, 3))->where('updated_at', '>=', $startDate)->where('updated_at', '<=', $endDate)->count();
     $totalPostedProjects = $jobModel->whereIn('jobtype', array(2, 3))->where('updated_at', '>=', $startDate)->where('updated_at', '<=', $endDate)->count();
     $projectStats = $jobModel->select('status', DB::raw('count(id) as counts'))->whereIn('jobtype', array(2, 3))->where('status', '>', 0)->where('updated_at', '>=', $startDate)->where('updated_at', '<=', $endDate)->groupBy('status')->lists('counts', 'status');
     $serviceStats = $jobModel->select('status', DB::raw('count(id) as counts'))->where('jobtype', 1)->where('updated_at', '>=', $startDate)->where('updated_at', '<=', $endDate)->groupBy('status')->lists('counts', 'status');
     $totalPostedServices = array_sum($serviceStats->all());
     $services = $jobModel->select('id')->where('jobtype', 1)->lists('id');
     $serviceWorkstream = Workstream::select('type_id', DB::raw('count(id) as counts'))->where('type', 0)->whereIn('type_id', $services)->where('status', 11)->where('updated_at', '>=', $startDate)->where('updated_at', '<=', $endDate)->groupBy('type_id')->lists('counts', 'type_id');
     $serviceWorkstream = $serviceWorkstream->all();
     $totalSold = array_sum($serviceWorkstream);
     $totalSellingServices = count($serviceWorkstream);
     if ($jobType != 0) {
         $jobModel = $jobModel->where('jobtype', $jobType);
     }
     $jobs = $jobModel->where('updated_at', '>=', $startDate)->where('updated_at', '<=', $endDate)->orderBy('id', 'desc')->paginate(10);
     $data = array();
     $data['page'] = 'job';
     $data['totalPostedProjects'] = $totalPostedProjects;
     $data['totalProjects'] = $totalProjects;
     $data['jobs'] = $jobs;
     $data['chartData'] = $chartData;
     $data['statsData'] = $tmp;
     $data['totalCompletedProject'] = isset($projectStats[6]) ? $projectStats[6] : 0;
     $data['totalPostedServices'] = $totalPostedServices;
     $data['totalActiveServices'] = isset($serviceStats[2]) ? $serviceStats[2] : 0;
     $data['totalSellingServices'] = $totalSellingServices;
     $data['totalSold'] = $totalSold;
     $data['maxValue'] = $maxValue;
     //how many jobs are posted and how many are  completed
     //calculate project convertion ratio
     return view('backend.display')->with($data);
 }