Code Duplication    Length = 9-9 lines in 2 locations

web_interface/astpp/application/libraries/astpp/form.php 2 locations

@@ 181-189 (lines=9) @@
178
                    if ($fieldvalue[7] != '' && $fieldvalue[8] != '') {
179
                        $str = $fieldvalue[7].",".$fieldvalue[8];
180
181
                        if (isset($this->CI->input->post)) {
182
                            $fieldvalue['value'] = ( ! $this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]);
183
                        } else {
184
                            if (is_array($fieldvalue[1])) {
185
                                $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]['name']] : @$fieldvalue[1];
186
                            } else {
187
                                $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1];
188
                            }
189
                        }
190
                        $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12]));
191
192
                        if ($fieldset_key ==  gettext('System Configuration Information') || ($fieldset_key == 'Billing Information'  && $fieldvalue[0] == 'Force Trunk') || ($fieldset_key == 'Card Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Account') || $fieldset_key == 'Freeswitch Devices' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key== 'Origination Rate Add/Edit' && $fieldvalue[0] == 'Trunks' )||$fieldset_key== 'Billing Information' && $fieldvalue[0] == 'Rate Group'  || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Failover GW Name #1') || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Failover GW Name #2') || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key== 'Sip Devices' && $fieldvalue[0] == 'Sip Profile') || ($fieldset_key== 'Sip Devices' && $fieldvalue[0] == 'Account')) {
@@ 222-230 (lines=9) @@
219
						$form_contents.= '<span class="popup_error error  no-padding" id="'.(gettext(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1])).'_error">
220
                        </span></div>';                         
221
					} else {
222
						if (isset($this->CI->input->post)) {
223
							$fieldvalue['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]);
224
						} else {
225
							if (is_array($fieldvalue[1])) {
226
								$fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]['name']] : @$fieldvalue[1];
227
							} else {
228
								$fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1];
229
							}
230
						}
231
232
						$str = $fieldvalue[7] . "," . $fieldvalue[8];
233
						$drp_array = call_user_func_array(array($this->CI->common, $fieldvalue[10]), array($fieldvalue[9]));