2017-10-27 1 views
-1

우리는 작업 스크립을 작업 중입니다. 가입 페이지 유효성 검사에 직면합니다. 이력서에도 있습니다. 업로드 이력서의 유효성 검사를 삭제해야합니다. 업로드시 등록 페이지에서 유효성 검사를 제거하는 방법 재개 전용. 이걸 도와주세요.이력서에서 유효성 검사를 제거하고 싶습니다 codeigniter에서 업로드하십시오

컨트롤러가 codeigniter에 있습니다. 우리를 도와주세요, 우리는 이것에 집착했습니다.

$this->form_validation->set_message('is_unique', 'The %s is already taken'); 

    if (empty($_FILES['cv_file']['name'])) 
     $this->form_validation->set_rules('cv_file', 'Resume', 'required'); 

    $this->form_validation->set_error_delimiters('<div class="errowbox"><div class="erormsg">', '</div></div>'); 
    if ($this->form_validation->run() === FALSE) { 
     $data['cpt_code'] = create_ml_captcha(); 
     $this->load->view('jobseeker_signup_view',$data); 
     return; 

    } 
    $current_date = date("Y-m-d H:i:s"); 
    $job_seeker_array = array(
          'first_name' => $this->input->post('full_name'), 
          'email' => $this->input->post('email'), 
          'password' => $this->input->post('pass'), 
          'dob' => $this->input->post('dob_year').'-'.$this->input->post('dob_month').'-'.$this->input->post('dob_day'), 
          'mobile' => $this->input->post('mobile_number'), 
          'home_phone' => $this->input->post('phone'), 
          'present_address' => $this->input->post('current_address'), 
          'country' => $this->input->post('country'), 
          'city' => $this->input->post('city'), 
          'nationality' => $this->input->post('nationality'), 
          'gender' => $this->input->post('gender'), 
          'ip_address' => $this->input->ip_address(), 
          'dated' => $current_date 
    ); 


    if (!empty($_FILES['cv_file']['name'])){ 

     //$verification_code = md5(time()); 

     $extention = get_file_extension($_FILES['cv_file']['name']); 
     $allowed_types = array('doc','docx','pdf','rtf','jpg','txt'); 

     if(!in_array($extention,$allowed_types)){ 
      $data['cpt_code'] = create_ml_captcha(); 
      $data['msg'] = 'This file type is not allowed.'; 
      $this->load->view('jobseeker_signup_view',$data); 
      return; 
     } 

     $seeker_id = $this->job_seekers_model->add_job_seekers($job_seeker_array); 
     $resume_array = array(); 
     $real_path = realpath(APPPATH . '../public/uploads/candidate/resumes/'); 
     $config['upload_path'] = $real_path; 
     $config['allowed_types'] = 'doc|docx|pdf|rtf|jpg|txt'; 
     $config['overwrite'] = true; 
     $config['max_size'] = 6000; 
     $config['file_name'] = replace_string(' ','-',strtolower($this->input->post('full_name'))).'-'.$seeker_id; 
     $this->upload->initialize($config); 
     if (!$this->upload->do_upload('cv_file')){ 
      $this->job_seekers_model->delete_job_seeker($seeker_id); 
      $data['cpt_code'] = create_ml_captcha(); 
      $data['msg'] = $this->upload->display_errors(); 
      $this->load->view('jobseeker_signup_view',$data); 
      return; 
     } 

     $resume = array('upload_data' => $this->upload->data());  
     $resume_file_name = $resume['upload_data']['file_name']; 
     $resume_array = array(
           'seeker_ID' => $seeker_id, 
           'file_name' => $resume_file_name, 
           'dated' => $current_date, 
           'is_uploaded_resume' => 'yes' 

     ); 
    } 
+0

는보기 페이지를 표시 –

답변

0

제거이

if (empty($_FILES['cv_file']['name'])) 
     $this->form_validation->set_rules('cv_file', 'Resume', 'required'); 
관련 문제