SHARE
TWEET

Untitled

yanachristian Mar 20th, 2017 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. class Registration extends CI_Controller {
  3.     public function index() {
  4.         $this->load->helper('url');
  5.         $this->load->library('form_validation');
  6.  
  7.         $this->form_validation->set_rules('first_name', 'First Name', 'trim|required|alpha|min_length[2]|max_length[10]');
  8.         $this->form_validation->set_rules('middle_name', 'Middle Name', 'trim|required|alpha|min_length[2]|max_length[10]');
  9.         $this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|alpha|min_length[2]|max_length[10]');
  10.         $this->form_validation->set_rules('gender', 'Gender', 'required');
  11.         $this->form_validation->set_rules('email', 'Email', 'required|valid_email');
  12.         $this->form_validation->set_rules('place_of_birth', 'Place Of Birth', 'trim|required|alpha');
  13.         $this->form_validation->set_rules('date_of_birth', 'Date Of Birth', 'trim|required');
  14.         $this->form_validation->set_rules('address', 'Address', 'trim|required');
  15.         $this->form_validation->set_rules('province', 'Province', 'trim|required');
  16.         $this->form_validation->set_rules('districts', 'Districts', 'trim|required');
  17.         $this->form_validation->set_rules('postal_code', 'Postal Code', 'trim|required|numeric');
  18.         $this->form_validation->set_rules('phone', 'Phone No.', 'trim|required|numeric');
  19.  
  20.         $this->form_validation->set_rules('father_name', 'Father Name', 'trim|required|alpha|min_length[3]|max_length[30]');
  21.         $this->form_validation->set_rules('father_occupation', 'Father Occupation', 'trim|required');
  22.         $this->form_validation->set_rules('father_phone', 'Father Phone No.', 'trim|required|numeric');
  23.         $this->form_validation->set_rules('mother_name', 'Mother Name', 'trim|required|alpha|min_length[3]|max_length[30]');
  24.         $this->form_validation->set_rules('mother_occupation', 'Mother Occupation', 'trim|required');
  25.         $this->form_validation->set_rules('mother_phone', 'Mother Phone No.', 'trim|required|numeric');
  26.         $this->form_validation->set_rules('parent_address', 'Parent Address', 'trim|required');        
  27.  
  28.  
  29.                 if ($this->form_validation->run() == FALSE)
  30.                 {
  31.                         $this->load->view('view_registration');
  32.                 }
  33.                 else
  34.                 {
  35.                         $this->load->view('formsuccess');
  36.                 }
  37.     }
  38. }
RAW Paste Data
Top