public function xml()
 {
     $xml = file_get_contents(public_path('xml') . '/test.xml');
     $xml = simplexml_load_string($xml, null, LIBXML_NOCDATA);
     $xml = json_encode($xml);
     $xml = json_decode($xml, TRUE);
     $client_name = $xml['@attributes']['client_name'];
     foreach ($xml['job'] as $xml_job) {
         $job = new Job();
         $job->client_name = $client_name;
         $job->title = $xml_job['title'];
         $job->address_1 = $xml_job['location_address1'];
         $job->address_2 = $xml_job['location_address2'];
         $job->city = $xml_job['location_city'];
         $job->state = $xml_job['location_state'];
         $job->zip = $xml_job['location_zip'];
         $job->country = $xml_job['location_country'];
         $job->job_id = $xml_job['job_id'];
         $job->description = $xml_job['description'];
         $job->category = $xml_job['category'];
         $job->sub_category = $xml_job['subcat'];
         $job->recruiter_id = $xml_job['recruiter_id'];
         $job->recruiter_first = $xml_job['recruiter_name_first'];
         $job->recruiter_last = $xml_job['recruiter_name_last'];
         $job->language = $xml_job['language'];
         $job->market = $xml_job['market'];
         /** this is causing an error when blank because it creates an empty array */
         //$job->recruiter_email = $xml['job']['recruiter_email'];
         $job->start_date = strtotime($xml_job['date_start']);
         $job->end_date = strtotime($xml_job['date_end']);
         $job->save();
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $job = new Job($request->all());
     $job->author = Auth::user()->name;
     $job->save();
     return redirect('jobs/create')->with('success', 'Job is successfully submitted');
 }
 public function store(Request $request)
 {
     $data = $request->all();
     $validator = Validator::make($data, ['title' => 'required|max:255', 'description' => 'required', 'local' => 'required', 'remote' => 'in:yes,no', 'type' => 'integer']);
     if ($validator->fails()) {
         return response()->json(['message' => 'Validation Failed', 'errors' => $validator->errors()->all()], 422);
     }
     $job = new Job();
     $job->fill($data);
     $job->company_id = \Auth::user()->id;
     $job->save();
     return response()->json($job, 201);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //
     $job = new Job();
     $job->id = Input::get('id');
     $job->freelancer_id = Input::get('freelancer_id');
     $job->judul = Input::get('judul');
     $job->deskripsi = Input::get('deskripsi');
     $job->upah_max = Input::get('upah_max');
     $job->upah_min = Input::get('upah_min');
     $job->save();
     return Redirect::to('/admin/manage/job');
 }
 /**
  * Store a newly created resource in storage.
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['title' => 'required', 'expired' => 'required', 'nature' => 'required', 'descriptions' => 'required']);
     $jobs = new Job();
     $jobs->title = $request->title;
     $jobs->type = $request->type;
     $jobs->location = $request->location;
     $jobs->expired = $request->expired;
     $jobs->nature = $request->nature;
     $jobs->descriptions = $request->descriptions;
     $jobs->save();
     \Session::flash('message', 'Successfully Stored your Data!');
     return redirect('/add/jobs');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(JobRequest $request)
 {
     $input = $request->all();
     $user_id = '1';
     $job = new Job();
     $job->estimate_id = $input['estimate_id'];
     $job->promised_date = $input['promised_date'];
     $job->section_incharge = $input['section-incharge'];
     $job->s_adviser = $input['advisor'];
     $job->remarks = $input['remark'];
     $job->status = 'open';
     $job->created_by = $user_id;
     $job->save($request->all());
     return redirect('/jobs');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //validate
     $this->validate($request, ['job_title' => 'required||min:10|max:255', 'job_description' => 'min:10|max:500|required', 'job_requirements' => 'min:10|max:500|required', 'remote' => 'required|boolean', 'fulltime' => 'required|boolean']);
     //insert
     $job = new Job();
     $job->title = $request->job_title;
     $job->fulltime = $request->fulltime;
     $job->remote = $request->remote;
     $job->description = $request->job_description;
     $job->user_id = $request->user()->id;
     $job->requirements = $request->job_requirements;
     $job->save();
     Session::flash('message', "Gratz Bro/Sis! Job Saved.");
     return redirect('dashboard');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //
     array_forget($request, "_token");
     $all_request = $request->all();
     $job = new Job();
     foreach ($all_request as $key => $value) {
         $job->{$key} = $value;
     }
     $job->save();
     $jobs = Job::all();
     if ($request->ajax()) {
         if ($jobs) {
             foreach ($jobs as $job) {
                 echo "\n                       <tr>\n                            <td>{$job->id}</td>\n                            <td>{$job->name}</td>\n\n                            <td>{$job->description}</td>\n                            <td>{$job->created_at}</td>\n                            <td>{$job->updated_at}</td>\n                            <td><button class='edtJobLink btn-primary' cid='{$job->id}' cname='{$job->name}' cdescription='{$job->description}'><span  class='glyphicon glyphicon-pencil'></span></button></td>\n                            <td><button class='btn-danger'  data-target='#myModalPaperEdit' data-toggle='modal'><span  class='glyphicon glyphicon-trash'></span></button></td>\n                        </tr>\n                        ";
             }
         }
         exit;
     }
     return View("settings.jobs", ['jobs' => $jobs, 'title' => 'Job Setting']);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store($company_id, Request $request)
 {
     //dd($request->all());
     $job = new Job();
     $job->company_id = $company_id;
     $job->status_id = 2;
     // Save as Draft or Inactive
     $job->job_title = $request->input('job_title');
     $job->creative_field = $request->input('creative_fields');
     $job->location = $request->input('location');
     $job->exp_date = $request->input('exp_date');
     $job->pre_lang = $request->input('pre_lang');
     $job->res_lang = $request->input('res_lang');
     $job->salary = $request->input('salary');
     $job->salary_from = $request->input('salary_from');
     $job->salary_to = $request->input('salary_to');
     $job->contact_gender = $request->input('contact_gender');
     $job->contact_name = $request->input('contact_name');
     $job->apply_email = $request->input('apply_email');
     $job->job_desc = $request->input('description');
     $job->apply_reason = $request->input('apply_reason');
     $job->save();
     /* Create job level */
     $levels = $request->input('job_level');
     $count_lev = sizeof($levels);
     for ($i = 0; $i < $count_lev; $i++) {
         $job_level = new JobLevel();
         $job_level->job_id = $job->id;
         $job_level->level_id = $levels[$i];
         $job_level->save();
     }
     /* Create job type */
     $types = $request->input('job_type');
     $count_typ = sizeof($types);
     for ($i = 0; $i < $count_typ; $i++) {
         $job_type = new JobType();
         $job_type->job_id = $job->id;
         $job_type->type_id = $types[$i];
         $job_type->save();
     }
     /* Store job skills */
     $names = $request->input('skillnames');
     $descs = $request->input('skilldescs');
     $count_ski = sizeof($names);
     for ($i = 0; $i < $count_ski; $i++) {
         $jobskill = new JobSkill();
         $jobskill->job_id = $job->id;
         $jobskill->name = $names[$i];
         $jobskill->description = $descs[$i];
         $jobskill->save();
     }
     $company = Company::find($company_id);
     return view('jobs.show', compact('job', 'company'));
 }
Exemple #10
0
 public static function saveInstance(Job $jobObj)
 {
     $old_keywords = '';
     $record_status = 'new';
     if (!empty($jobObj->id)) {
         // updating record
         $currentData = self::getInfo($jobObj->id, ['JobTitle', 'JobKeywords', 'JobDmaCode', 'JobCompanyId', 'JobCompanyStrId', 'JobCompany']);
         // we need to comapare data to manage caches
         $currentDmaCode = $currentData['JobDmaCode'];
         $currentCompanyIdStr = $currentData['JobCompanyId'];
         if ($currentData['JobTitle'] != $jobObj->title) {
             // reset keywords
             $old_keywords = $currentData['JobKeywords'];
         }
         if ($currentData['JobDmaCode'] != $jobObj->dma_code) {
             // remove from dma cache
             self::removeJobFromDmaCache($currentData['JobDmaCode'], $jobObj->id);
         }
         if ($currentData['JobCompanyId'] != $jobObj->company_id) {
             Company::removeJobFromCompanyCache($currentData['JobCompanyStrId'], $jobObj->id);
         }
         $record_status = 'existed';
         //$jobObj->updated_at = date('Y-m-d H:i:s');
     }
     $is_saved = $jobObj->save();
     $job_id = $jobObj->id;
     if (empty($job_id)) {
         ExportRecordFailure::create(['job_info' => json_encode($attr), 'reason' => '[ failed to create|update a DB record ]', 'calling_function' => __FUNCTION__]);
         return null;
     } else {
         // process job keywords
         self::processKeywords($jobObj, $record_status, $old_keywords);
         // update/add to all nessecary caches
         self::addToCaches($job_id);
         return $job_id;
     }
 }
 /**
  * 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');
     }
 }