Ejemplo n.º 1
0
 public function uploadCvPic($code)
 {
     include app_path() . '/crop-avatar-passport.php';
     $cv = Cv::where('cv_code', $code)->first();
     $cv->profile_image = $crop->getResult();
     $cv->save();
     echo json_encode($response);
 }
Ejemplo n.º 2
0
 public function duplicatecvpage($cv_code)
 {
     $cv_old = Cv::where('cv_code', $cv_code)->first();
     if ($cv_old->user_id != Auth::id()) {
         return 'False';
     }
     $new_cv_name = $cv_old->cv_name . ' - Copy';
     $cv = new Cv();
     do {
         $random = str_random(10);
         $count = Cv::where('cv_code', $random)->count();
     } while ($count != 0);
     $cv->cv_code = $random;
     if (Auth::check()) {
         $cv->user_id = Auth::id();
     }
     $cv->cv_name = $new_cv_name;
     $cv->user_id = $cv_old->user_id;
     $cv->full_name = $cv_old->full_name;
     $cv->phone_num = $cv_old->phone_num;
     $cv->email = $cv_old->email;
     $cv->website = $cv_old->website;
     $cv->add_line1 = $cv_old->add_line1;
     $cv->add_line2 = $cv_old->add_line2;
     $cv->dob = $cv_old->dob;
     $cv->marital_status = $cv_old->marital_status;
     $cv->profile_image = $cv_old->profile_image;
     $cv->sex = $cv_old->sex;
     $cv->state_origin = $cv_old->state_origin;
     $cv->religion = $cv_old->religion;
     $cv->religion_text = $cv_old->religion_text;
     $cv->show_profile_pic = $cv_old->show_profile_pic;
     $cv->local_government = $cv_old->local_government;
     $cv->save();
     $new_cv_id = $cv->id;
     // copying sections
     $sections = Section::where('cv_id', $cv_old->id)->get();
     foreach ($sections as $section) {
         $section_new = new Section();
         $section_new->cv_id = $new_cv_id;
         $section_new->section_name = $section->section_name;
         $section_new->type = $section->type;
         $section_new->content = $section->content;
         $section_new->default = $section->default;
         $section_new->priority = $section->priority;
         $section_new->save();
     }
     // copying educations
     $educations = Education::where('cv_id', $cv_old->id)->get();
     foreach ($educations as $education) {
         $education_new = new Education();
         $education_new->cv_id = $new_cv_id;
         $education_new->coursename = $education->coursename;
         $education_new->institutename = $education->institutename;
         $education_new->add_line1 = $education->add_line1;
         $education_new->add_line2 = $education->add_line2;
         $education_new->startdate = $education->startdate;
         $education_new->enddate = $education->enddate;
         $education_new->otherinfo = $education->otherinfo;
         $education_new->priority = $education->priority;
         $education_new->save();
     }
     // copying languages
     $languages = Language::where('cv_id', $cv_old->id)->get();
     foreach ($languages as $language) {
         $language_new = new Language();
         $language_new->cv_id = $new_cv_id;
         $language_new->language_id = $language->language_id;
         $language_new->language_name = $language->language_name;
         $language_new->ability_id = $language->ability_id;
         $language_new->level_id = $language->level_id;
         $language_new->priority = $language->priority;
         $language_new->save();
     }
     // copying nysc
     $nyscs = Nysc::where('cv_id', $cv_old->id)->get();
     foreach ($nyscs as $nysc) {
         $nysc_new = new Nysc();
         $nysc_new->cv_id = $new_cv_id;
         $nysc_new->year = $nysc->year;
         $nysc_new->batch = $nysc->batch;
         $nysc_new->ppa = $nysc->ppa;
         $nysc_new->cd = $nysc->cd;
         $nysc_new->otherinfo = $nysc->otherinfo;
         $nysc_new->priority = $nysc->priority;
         $nysc_new->save();
     }
     // copying work_exp
     $work_exps = WorkExperience::where('cv_id', $cv_old->id)->get();
     foreach ($work_exps as $work_exp) {
         $work_exp_new = new WorkExperience();
         $work_exp_new->cv_id = $new_cv_id;
         $work_exp_new->title = $work_exp->title;
         $work_exp_new->company = $work_exp->company;
         $work_exp_new->location = $work_exp->location;
         $work_exp_new->startdate = $work_exp->startdate;
         $work_exp_new->enddate = $work_exp->enddate;
         $work_exp_new->otherinfo = $work_exp->otherinfo;
         $work_exp_new->priority = $work_exp->priority;
         $work_exp_new->save();
     }
     return Redirect::back();
 }
Ejemplo n.º 3
0
    Route::post('/askquestion', 'UserprofileController@postAskQuestion');
});
Route::group(['prefix' => 'cv-page', 'before' => 'auth'], function () {
    Route::get('/', 'UserprofileController@getcvpage');
    Route::get('/duplicate/{code}', 'UserprofileController@duplicatecvpage');
    Route::get('/delete/{code}', 'UserprofileController@deleteCV');
});
Route::group(['prefix' => 'content-page', 'before' => 'auth'], function () {
    Route::get('/', 'ForumController@getcontentpage');
});
Route::group(['prefix' => 'cvbuilder'], function () {
    Route::get('/', 'CVController@getIndex');
    Route::post('/createnew', 'CVController@postCreateNew');
    Route::post('/uploadCvPic/{code}', 'UserMediaController@uploadCvPic');
    Route::post('/editcv', function () {
        $count = Cv::where('cv_code', Input::get('cvcode'))->count();
        if ($count == 0) {
            return Redirect::Back()->with('fail', 'Invalid CV Code')->withInput();
        } else {
            return Redirect::to('/cvbuilder/cv/' . Input::get('cvcode'));
        }
    });
    Route::get('/cv/{id}', 'CVController@getCV');
    Route::post('/saveinfo/{id}', 'CVController@putSaveInfo');
    Route::get('/fetch_workex', function () {
        return View::make('cvbuilder.section_views.workex');
    });
    Route::get('/fetch_education', function () {
        return View::make('cvbuilder.section_views.education');
    });
    Route::get('/fetch_nysc', function () {
Ejemplo n.º 4
0
 public function deleteSection($section_id, $code)
 {
     $cv = Cv::where('cv_code', $code)->first();
     $cv_id = $cv->id;
     Section::where('id', $section_id)->where('cv_id', $cv_id)->delete();
     $data["success"] = 1;
     $data["message"] = "Succefully deleted";
     return json_encode($data);
 }