Пример #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Idea $idea)
 {
     // Edit an exisiting idea
     $brands = Brand::lists('short_name', 'id');
     $industries = Industry::lists('name', 'id');
     return view('ideas.edit', compact('idea', 'brands', 'industries'));
 }
 public function postAddJobLayout(Request $request)
 {
     $request['user_id'] = Auth::user()->id;
     if ($request['logo_image']) {
         $destinationPath = 'uploads';
         // upload path
         $extension = Input::file('logo_image')->getClientOriginalExtension();
         // getting image extension
         $fileName = time() . '.' . $extension;
         // renameing image
         $request['logo'] = $fileName;
         Input::file('logo_image')->move($destinationPath, $fileName);
     }
     if ($request['header_image']) {
         $destinationPath = 'uploads';
         // upload path
         $extension = Input::file('header_image')->getClientOriginalExtension();
         // getting image extension
         $headerfile = time() + 1 . '.' . $extension;
         // renameing image
         Input::file('header_image')->move($destinationPath, $headerfile);
         $request['header'] = $headerfile;
     }
     $jobaddlayout = Jobaddlayout::create($request->all());
     return view('job.index')->with('job', Job::find($request['job_id']))->with('educationalqualifications', Educationalqualification::lists('name', 'id'))->with('joblevels', Joblevel::lists('name', 'id'))->with('industries', Industry::lists('name', 'id'))->with('jobtypes', Jobtype::lists('name', 'id'))->with('jobcategories', Jobcategory::lists('name', 'id'))->with('level', 2);
     return $request;
 }
Пример #3
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     $router->bind('products', function ($slug) {
         return ProductLine::where('slug', $slug)->firstOrFail();
     });
     $router->bind('code', function ($code) {
         return Product::where('code', $code)->firstOrFail();
     });
     $router->bind('industries', function ($slug) {
         return Industry::where('slug', $slug)->firstOrFail();
     });
 }
Пример #4
0
 /**
  * Register a user
  * @return Response
  */
 public function register(Request $request)
 {
     //$credentials = $request->all();
     //$credentials = $request->only('name', 'email', 'password');
     try {
         //$user = User::create($credentials);
         $user = User::create(['name' => $request->input('name'), 'email' => $request->input('email'), 'password' => bcrypt($request->input('password'))]);
     } catch (\Exception $e) {
         //return response()->json(['error' => 'could_not_create_token'], HttpResponse::HTTP_CONFLICT);
         return response()->json(['error' => 'User already exists'], HttpResponse::HTTP_CONFLICT);
     }
     $token = JWTAuth::fromUser($user);
     //$industries = Industry::all();
     $industries = Industry::select('id', 'slug', 'name')->get();
     return response()->json(compact('token', 'industries'));
     //return response()->json($credentials);
 }
 /**
  * List all industries
  * @return Response
  */
 public function index()
 {
     try {
         if (!($user = JWTAuth::parseToken()->authenticate())) {
             return response()->json(['user_not_found'], 404);
         }
     } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
         return response()->json(['token_expired'], $e->getStatusCode());
     } catch (Tymon\JWTAuth\Exceptions\TokenInvalidException $e) {
         return response()->json(['token_invalid'], $e->getStatusCode());
     } catch (Tymon\JWTAuth\Exceptions\JWTException $e) {
         return response()->json(['token_absent'], $e->getStatusCode());
     }
     // the token is valid and we have found the user via the sub claim
     //$industry = Industry::latest()->get();
     $industries = Industry::all();
     return response()->json(compact('industries'));
 }
Пример #6
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $iid 	industry_id
  * @param  int  $id		profile_id
  * @return Response
  */
 public function destroy($iid, $id)
 {
     $industry = Industry::findOrFail($iid);
     $profile = Profile::findOrFail($id);
     $profile->delete();
     //dd($iid, $id);
     //return redirect('industries.profiles.index', compact('industry'));
     return view('profiles.index', compact('industry'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $deleteChecked = Input::get('list');
     if ($deleteChecked) {
         foreach ($deleteChecked as $delete) {
             $resumdel1 = Industry::where('id', $delete)->delete();
         }
         Session::flash('message', 'Successfully deleted');
     } else {
     }
     return Redirect::to('industry');
 }
Пример #8
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $industryId = Request::get('id');
     Industry::where('id', $industryId)->delete();
     return redirect("industries");
 }
Пример #9
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Industry $industry)
 {
     // Delete $industry
     $industry->delete();
     flash()->success('Industry has been deleted');
     return redirect('industries');
 }
Пример #10
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $iid 	industry_id
  * @param  int  $id		jobtype_id
  * @return Response
  */
 public function destroy($iid, $id)
 {
     $industry = Industry::findOrFail($iid);
     $jobtype = Jobtype::findOrFail($id);
     $jobtype->delete();
     //dd($iid, $id);
     return view('jobtypes.index', compact('industry'));
 }
Пример #11
0
 public function editIndustry($id)
 {
     $data = Industry::where('id', '=', $id)->first();
     if ($data != null) {
         $data->name = Input::get('industryname');
         $data->save();
         return redirect('/dataUpdate');
     } else {
         return 'some error occured.';
     }
 }
Пример #12
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $industry = Industry::findorfail($id);
     $industry->delete();
     return redirect('industries');
     //return Redirect::route('industries.index')->with('message', 'Specialization deleted.');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $industry = Industry::findOrFail($id);
     $industry->delete();
     return redirect()->route('admin.industries.index');
 }
Пример #14
0
 /**
  * Returns a json list of jobtypes.
  *
  * @param  int $iid 	industry_id
  * @return Response
  */
 public function index($iid)
 {
     $industry = Industry::findOrFail($iid);
     $jobtypes = $industry->jobtypes;
     return response()->json(compact('jobtypes'));
 }
Пример #15
0
 private static function prepareJobRecord($data)
 {
     $currentRecord = [];
     // VALIDATE DATA
     if (empty($data->external_job_id)) {
         ExportRecordFailure::create(['job_info' => json_encode($data), 'reason' => '[ external_job_id is missing ]', 'action' => '[ exiting process ]', 'calling_function' => __FUNCTION__]);
         return null;
     }
     if (empty($data->job_title)) {
         ExportRecordFailure::create(['external_job_id' => $data->external_job_id, 'job_info' => json_encode($data), 'reason' => '[ title is missing ]', 'action' => '[ exiting process ]', 'calling_function' => __FUNCTION__]);
         return null;
     }
     $end_date = null;
     if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})T.*\$/", $data->job_end_date, $end_date_matches)) {
         $end_date_mm = $end_date_matches[2];
         $end_date_dd = $end_date_matches[3];
         $end_date_yyyy = $end_date_matches[1];
         $end_date = $end_date_yyyy . '-' . $end_date_mm . "-" . $end_date_dd;
     }
     if (empty($end_date)) {
         ExportRecordFailure::create(['external_job_id' => $data->external_job_id, 'job_info' => json_encode($data), 'reason' => '[ end date is missing ]', 'action' => '[ exiting process ]', 'calling_function' => __FUNCTION__]);
         return null;
     } else {
         $jobObj = Job::firstOrNew(['external_job_id' => $data->external_job_id, 'source_id' => 1]);
         if (strtotime($end_date) < strtotime(date('Y-m-d'))) {
             if (!empty($jobObj->id)) {
                 $record_id = $jobObj->id;
                 $jobObj->delete();
                 ExportRecordFailure::create(['external_job_id' => $data->external_job_id, 'job_info' => json_encode($data), 'reason' => '[ expired job ]', 'action' => '[ record deleted ][ record id: ' . $record_id . ' ] [ exiting process ]', 'calling_function' => __FUNCTION__]);
                 return $record_id;
             } else {
                 ExportRecordFailure::create(['external_job_id' => $data->external_job_id, 'job_info' => json_encode($data), 'reason' => '[ expired job ] ', 'action' => '[ will not create a record ] [ exiting process ]', 'calling_function' => __FUNCTION__]);
                 $jobObj = null;
                 return 1;
             }
         }
     }
     if (!empty($data->job_state) && $data->job_state == 'expired') {
         if (!empty($jobObj->id)) {
             $record_id = $jobObj->id;
             $jobObj->delete();
             ExportRecordFailure::create(['external_job_id' => $data->external_job_id, 'job_info' => json_encode($data), 'reason' => '[ expired job ]', 'action' => '[ record deleted ][ record id: ' . $record_id . ' ] [ exiting process ]', 'calling_function' => __FUNCTION__]);
             return $record_id;
         } else {
             ExportRecordFailure::create(['external_job_id' => $data->external_job_id, 'job_info' => json_encode($data), 'reason' => '[ expired job ] ', 'action' => '[ will not create a record ] [ exiting process ]', 'calling_function' => __FUNCTION__]);
             $jobObj = null;
             return 1;
         }
     }
     // END OF DATA VALIDATION
     if (!empty($jobObj->id)) {
         $currentRecord = Job::getInfo($jobObj->id, ['JobState', 'JobCity', 'JobCompany', 'JobCategory', 'JobIndustry']);
     }
     $jobObj->source_id = 1;
     $jobObj->external_job_id = $data->external_job_id;
     if (!empty($data->job_name)) {
         $jobObj->name = self::cleanUpStr($data->job_name);
     }
     if (!empty($data->job_title)) {
         $jobObj->title = self::cleanUpStr($data->job_title);
     }
     if (!empty($data->org_name)) {
         $company_name = trim(str_replace("&apos;", "'", $data->org_name));
     } else {
         $company_name = 'Confidential';
     }
     if (empty($currentRecord) || $currentRecord['JobCompany'] != $company_name) {
         $company_obj = Company::saveInstance(['name' => $company_name]);
         $jobObj->company_id = $company_obj->id;
     }
     $jobObj->apply_url = 'http://jobview.monster.com/getjob.aspx?jobid=' . $data->external_job_id;
     if ($company_name == 'Comcast Cable Communications Management, LLC') {
         if (!empty($data->apply_url)) {
             $jobObj->apply_url = $data->apply_url;
         }
     }
     if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})T.*\$/", $data->job_begin_date, $begin_date_matches)) {
         $begin_date_mm = $begin_date_matches[2];
         $begin_date_dd = $begin_date_matches[3];
         $begin_date_yyyy = $begin_date_matches[1];
         $jobObj->begin_date = $begin_date_yyyy . '-' . $begin_date_mm . '-' . $begin_date_dd;
     }
     $jobObj->end_date = $end_date;
     if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})T.*\$/", $data->job_post_date, $post_date_matches)) {
         $post_date_mm = $post_date_matches[2];
         $post_date_dd = $post_date_matches[3];
         $post_date_yyyy = $post_date_matches[1];
         $jobObj->post_date = $post_date_yyyy . '-' . $post_date_mm . '-' . $post_date_dd;
     }
     if (!empty($data->job_category)) {
         if (empty($currentRecord) || $currentRecord['JobCategory'] != $data->job_category) {
             $cat_obj = Category::firstOrCreate(['name' => $data->job_category]);
             $jobObj->category_id = $cat_obj->id;
         }
     }
     if (!empty($data->job_industries[0])) {
         if (empty($currentRecord) || $currentRecord['JobIndustry'] != $data->job_industries[0]) {
             $ind_obj = Industry::firstOrCreate(['name' => $data->job_industries[0]]);
             $jobObj->industry_id = $ind_obj->id;
         }
     }
     if (isset($data->location) && !empty($data->location)) {
         $location = $data->location;
         if (!empty(trim($location->city))) {
             $jobObj->city = trim($location->city);
         }
         if (!empty(trim($location->state))) {
             $jobObj->state = trim($location->state);
         }
         if (!empty(trim($location->country))) {
             $jobObj->country = trim($location->country);
         }
         if (isset($location->zip) && !empty(trim($location->zip))) {
             if (trim($location->zip) == '00000') {
                 $jobObj->zip = null;
             } else {
                 $jobObj->zip = trim($location->zip);
             }
         }
         if (!empty($jobObj->city) && !empty($jobObj->state)) {
             if (empty($currentRecord) || $currentRecord['JobCity'] != $jobObj->city || $currentRecord['JobState'] != $jobObj->state) {
                 $dma_obj = DmaMap::where(['city' => $jobObj->city, 'state_abbr' => $jobObj->state])->first();
                 if (!empty($dma_obj)) {
                     $jobObj->dma_code = $dma_obj->code;
                 }
             }
         }
     }
     return $jobObj;
 }
Пример #16
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $industries = Industry::lists("slug", "id");
     return view('employees.create', compact('industries'));
 }
Пример #17
0
 public function getIndex()
 {
     $industries = Industry::with('productLines')->ordered()->get();
     return view('industries.index', compact('industries'));
 }