title: I want to add upload image code to my form
body: <p>Anyone pls help ...</p>
  
  <p>This is my Controller code (Actions.php)</p>
  
  <pre><code>public function add_admin()
      {
          $data['employee'] = $this-&gt;employee_model-&gt;get_new();
          $data['department'] = $this-&gt;employee_model-&gt;dpdown_admins();
          $data['gender'] = $this-&gt;employee_model-&gt;dpdown_gender();
          $data['status'] = $this-&gt;employee_model-&gt;dpdown_status();
          $data['attainment'] = $this-&gt;employee_model-&gt;dpdown_attainment();
  
          $rules = $this-&gt;employee_model-&gt;rules['insert'];
          $this-&gt;form_validation-&gt;set_rules($rules);
  
          if ($this-&gt;form_validation-&gt;run() == TRUE)
          {
              $post = $this-&gt;employee_model-&gt;array_from_post(array(
                                                              'ID_number',
                                                              'employee_no',
                                                              'department_id',
                                                              'department_position',
                                                              'tin_number',
                                                              'sss_number',
                                                              'ph_number',
                                                              'first_name',
                                                              'middle_name',
                                                              'last_name',
                                                              'suffix_name',
                                                              'street',
                                                              'barangay',
                                                              'city',
                                                              'zipcode',
                                                              'birthday',
                                                              'age',
                                                              'gender_id',
                                                              'nationality',
                                                              'religion',
                                                              'status_id',
                                                              'telephone_number',
                                                              'cellphone_number',
                                                              'email',
                                                              'educational_att_id',
                                                              'diploma_title',
                                                              'school_name',
                                                              'year_graduated',
                                                              'company1_name',
                                                              'position1_title',
                                                              'inclusive_dates1',
                                                              'company2_name',
                                                              'position2_title',
                                                              'inclusive_dates2',
                                                              'company3_name',
                                                              'position3_title',
                                                              'inclusive_dates3',
                                                              'date_employed'
                                                             ));
  
              $data = $this-&gt;employee_model-&gt;save($post);
              return self::redirect_to('human_resource/admin', '&lt;b&gt;Success&lt;/b&gt;&lt;br&gt;New Admin Employee has been successfully Registered.');
          }
  
          $data['error'] = validation_errors('&lt;li class="error"&gt;', '&lt;/li&gt;');
  
          $data['content'] = 'human_resource/actions/add_admin';
          return $this-&gt;load-&gt;view('templates', $data);
      }
  </code></pre>
  
  <p>and then this is how my model looks like (employee_model.php)
  these are for my rules</p>
  
  <pre><code>public $rules = array('insert' =&gt; array(
                                          'department_position' =&gt; array(
                                                          'field' =&gt; 'department_position', 
                                                          'label' =&gt; 'Employee Position', 
                                                          'rules' =&gt; 'trim|required',
                                                          'errors' =&gt; array('required' =&gt; 'This Field is Required')),
                                          'ID_number' =&gt; array(
                                                          'field' =&gt; 'ID_number', 
                                                          'label' =&gt; 'ID Number', 
                                                          'rules' =&gt; 'trim|required',
                                                          'errors' =&gt; array('required' =&gt; 'This Field is Required')),
                                          'employee_no' =&gt; array(
                                                          'field' =&gt; 'employee_no', 
                                                          'label' =&gt; 'Employee Number', 
                                                          'rules' =&gt; 'trim|required',
                                                          'errors' =&gt; array('required' =&gt; 'This Field is Required')),
                                          'tin_number' =&gt; array(
                                                          'field' =&gt; 'tin_number', 
                                                          'label' =&gt; 'Tin Number', 
                                                          'rules' =&gt; 'trim|required',
                                                          'errors' =&gt; array('required' =&gt; 'This Field is Required')),
                                          'sss_number' =&gt; array(
                                                          'field' =&gt; 'sss_number', 
                                                          'label' =&gt; 'SSS Number', 
                                                          'rules' =&gt; 'trim|required',
                                                          'errors' =&gt; array('required' =&gt; 'This Field is Required')),
                                          'ph_number' =&gt; array(
                                                          'field' =&gt; 'ph_number', 
                                                          'label' =&gt; 'Phil Health Number', 
                                                          'rules' =&gt; 'trim|required',
                                                          'errors' =&gt; array('required' =&gt; 'This Field is Required')),));
  </code></pre>
  
  <p>then this is my save function still inside the same model</p>
  
  <pre><code>public function save($post, $employee_id = NULL)
      {
          if($this-&gt;timestamp == TRUE)
          {
              $now = date('Y-m-d H:i:s');
              $employee_id || $post['created_at'] = $now;
              $post['updated_at'] = $now;
          }
  
          if($employee_id === NULL)
          {
              !isset($post[$this-&gt;primary_key]) || $post[$this-&gt;primary_key] = NULL;
  
              $this-&gt;db-&gt;insert($this-&gt;table_name, $post);
              $employee_id = $this-&gt;db-&gt;insert_id();
          }else{
              $filter = $this-&gt;filter;
              $this-&gt;db-&gt;where($this-&gt;primary_key, $filter($employee_id))
                       -&gt;update($this-&gt;table_name, $post);
          }
      }
  </code></pre>
  
  <p>then this is my view form 
  i did not put all in here just the 1/4 of my view code</p>
  
  <pre><code>&lt;div class="main-content"&gt;
      &lt;div class="main-content-inner"&gt;
          &lt;div class="breadcrumbs ace-save-state" id="breadcrumbs"&gt;
              &lt;ul class="breadcrumb"&gt;
                  &lt;li&gt;
                      &lt;i class="ace-icon fa fa-tachometer home-icon"&gt;&lt;/i&gt;
                      &lt;a href="&lt;?php echo base_url('main/human_resource'); ?&gt;"&gt;Dashboard&lt;/a&gt;
                  &lt;/li&gt;
  
                  &lt;li&gt;
                      &lt;i class="ace-icon fa fa-user home-icon"&gt;&lt;/i&gt;
                      &lt;a href="&lt;?php echo base_url('human_resource/admin'); ?&gt;"&gt;Administration Table&lt;/a&gt;
                  &lt;/li&gt;
  
                  &lt;li&gt;
                      &lt;a href="#"&gt;New Admin Form&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li class="active"&gt;Application Form&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
          &lt;!-- /end of breadcrumb --&gt;         
  
          &lt;div class="page-content"&gt;
              &lt;div class="page-header"&gt;
                  &lt;h1&gt;
                      &lt;i class="fa fa-user-plus"&gt;&lt;/i&gt;
                      New Admin Form
                      &lt;small&gt;
                          &lt;i class="ace-icon fa fa-angle-double-right"&gt;&lt;/i&gt;
                          Application Form
                      &lt;/small&gt;
                  &lt;/h1&gt;
              &lt;/div&gt;
              &lt;!-- end of page header --&gt;
  
              &lt;?php echo form_open(NULL, array('class' =&gt; 'form-horizontal', 'role' =&gt; 'form'));?&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-xs-12"&gt;
                      &lt;!-- table content --&gt;
                      &lt;div class="widget-box"&gt;
                          &lt;div class="widget-header widget-header-blue widget-header-flat"&gt;
                              &lt;h4 class="widget-title lighter"&gt;Form Wizard&lt;/h4&gt;
                          &lt;/div&gt;
                          &lt;!-- end of widget header    --&gt;
  
                          &lt;!-- R-1 --&gt;
                          &lt;div class="widget-body"&gt;
                              &lt;div class="widget-main"  style="padding-bottom: 0;"&gt;
                                          &lt;h4 class="lighter block green"&gt;Employee General Information
                                              &lt;span class="help-button" style="background-color: red;" data-rel="popover" data-trigger="hover" data-placement="right" data-content="If a field is not applicable please type N/A" title="Notice!"&gt;
                                                  &lt;i class="fa fa-exclamation"&gt;&lt;/i&gt;
                                              &lt;/span&gt;
                                          &lt;/h4&gt;
  
                                          &lt;div class="row"&gt;
                                              &lt;!-- B-1 col --&gt;
                                              &lt;div class="col-xs-12 col-sm-4"&gt;
                                                  &lt;div class="widget-box"&gt;
                                                      &lt;div class="widget-header"&gt;
                                                          &lt;h5 class="widget-title"&gt;General Information&lt;/h5&gt;   
                                                      &lt;/div&gt;
                                                      &lt;!-- end of widget header --&gt;
  
                                                      &lt;div class="widget-body"&gt;
                                                          &lt;div class="widget-main"&gt;
                                                              &lt;!-- employee information B-1--&gt;
                                                              &lt;!-- first name --&gt;
                                                              &lt;?php echo form_label('First Name', 'first_name', array('class' =&gt; 'control-label'));?&gt;
                                                              &lt;span style="font-weight: bolder; color: red;"&gt;*&lt;/span&gt;
                                                              &lt;div class="form-group &lt;?php if (form_error('first_name')==TRUE){echo 'has-error';} ?&gt;" style="margin-bottom: 0;"&gt;
                                                                  &lt;div class="col-sm-12"&gt;
                                                                      &lt;?php echo form_input('first_name', set_value('first_name', $employee-&gt;first_name),
                                                                                      array(  'type' =&gt; 'text',
                                                                                              'name' =&gt; 'first_name', 
                                                                                              'id' =&gt; 'firstname', 
                                                                                              'class' =&gt; 'form-control')); ?&gt;
                                                                  &lt;/div&gt;
                                                              &lt;/div&gt;
                                                              &lt;!-- validation --&gt;
                                                              &lt;?php if (!empty($error)): ?&gt;
                                                                  &lt;div class="has-error" style="margin-bottom: 0;"&gt;
                                                                      &lt;div class="help-block col-xs-12 col-sm-reset inline" 
                                                                           style="margin-bottom: 0; font-size: 12px;"&gt; 
                                                                          &lt;?php echo form_error('first_name'); ?&gt;
                                                                      &lt;/div&gt;
                                                                  &lt;/div&gt;
                                                              &lt;?php endif ?&gt;
                                                              &lt;!-- last name --&gt;
                                                              &lt;?php echo form_label('Last Name', 'last_name', array('class' =&gt; 'control-label'));?&gt;
                                                              &lt;span style="font-weight: bolder; color: red;"&gt;*&lt;/span&gt;
                                                              &lt;div class="form-group &lt;?php if (form_error('last_name')==TRUE){echo 'has-error';} ?&gt;" style="margin-bottom: 0;"&gt;
                                                                  &lt;div class="col-sm-12"&gt;
                                                                      &lt;?php echo form_input('last_name', set_value('last_name', $employee-&gt;last_name),
                                                                                      array(  'type' =&gt; 'text',
                                                                                              'name' =&gt; 'last_name', 
                                                                                              'id' =&gt; 'lastname', 
                                                                                              'class' =&gt; 'form-control'));?&gt;
                                                                  &lt;/div&gt;
                                                              &lt;/div&gt;
                                                              &lt;!-- validation --&gt;
                                                              &lt;?php if (!empty($error)): ?&gt;
                                                                  &lt;div class="has-error" style="margin-bottom: 0;"&gt;
                                                                      &lt;div class="help-block col-xs-12 col-sm-reset inline" 
                                                                           style="margin-bottom: 0; font-size: 12px;"&gt; 
                                                                          &lt;?php echo form_error('last_name'); ?&gt;
                                                                      &lt;/div&gt;
                                                                  &lt;/div&gt;
                                                              &lt;?php endif ?&gt;
                                                              &lt;!-- middle name --&gt;
                                                              &lt;?php echo form_label('Middle Name', 'middle_name', array('class' =&gt; 'control-label'));?&gt;
                                                              &lt;span style="font-weight: bolder; color: red;"&gt;*&lt;/span&gt;
                                                              &lt;div class="form-group &lt;?php if (form_error('middle_name')==TRUE){echo 'has-error';} ?&gt;" style="margin-bottom: 0;"&gt;
                                                                  &lt;div class="col-sm-12"&gt;
                                                                      &lt;?php echo form_input('middle_name', set_value('middle_name', $employee-&gt;middle_name),
                                                                                      array(  'type' =&gt; 'text',
                                                                                              'name' =&gt; 'middle_name', 
                                                                                              'id' =&gt; 'middlename', 
                                                                                              'class' =&gt; 'form-control'));?&gt;
                                                                  &lt;/div&gt;
                                                              &lt;/div&gt;
                                                              &lt;!-- validation --&gt;
                                                              &lt;?php if (!empty($error)): ?&gt;
                                                                  &lt;div class="has-error" style="margin-bottom: 0;"&gt;
                                                                      &lt;div class="help-block col-xs-12 col-sm-reset inline" 
                                                                           style="margin-bottom: 0; font-size: 12px;"&gt; 
                                                                          &lt;?php echo form_error('middle_name'); ?&gt;
                                                                      &lt;/div&gt;
                                                                  &lt;/div&gt;
                                                              &lt;?php endif ?&gt;
                                                              &lt;!-- suffix name --&gt;
                                                              &lt;?php echo form_label('Suffix', 'suffix_name', array('class' =&gt; 'control-label'));?&gt;
                                                              &lt;div class="form-group" style="margin-bottom: 0;"&gt;
                                                                  &lt;div class="col-sm-6"&gt;
                                                                      &lt;?php echo form_input('suffix_name', set_value('suffix_name', $employee-&gt;suffix_name),
                                                                                      array(  'type' =&gt; 'text',
                                                                                              'name' =&gt; 'suffix_name', 
                                                                                              'id' =&gt; 'suffixname', 
                                                                                              'class' =&gt; 'form-control'));?&gt;
                                                                  &lt;/div&gt;
                                                              &lt;/div&gt;
                                                              &lt;hr&gt;
                                                          &lt;/div&gt;
                                                      &lt;/div&gt;
  
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                              &lt;!-- end of B-1 col --&gt;
  </code></pre>
  
  <p>please anyone i really need your help</p>