2017-10-27 3 views
-1

私たちはジョブ・スケッチで作業しています。サインアップページの検証に直面しています。それはまた履歴書にもあります。アップロード履歴書から検証を削除する必要があります。アップロード時にサインアップページからバリデーションを削除する方法のみを再開してください。これで私たちを助けてください。再開時に妥当性検査を削除したい場合コードインジケータでアップロードする

コントローラが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'); 
関連する問題