Code Duplication    Length = 4-7 lines in 5 locations

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

@@ 285-289 (lines=5) @@
282
                 * Image upload from invoice configuration code.
283
                 */
284
				else if ($fieldvalue[1] == 'IMAGE') {
285
					if (isset($this->CI->input->post))
286
						$fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']);
287
                       
288
					else
289
						$fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value'];
290
						$fieldvalue[2]['style'] = isset($fieldvalue[2]['style']) ? $fieldvalue[2]['style'] : "";
291
					$form_contents.= form_image($fieldvalue[2], 'readonly',$fieldvalue[2]['style']);
292
						 $form_contents.=@$fieldvalue[6];
@@ 299-303 (lines=5) @@
296
                    </span></div>';
297
				}
298
				else if ($fieldvalue[1] == 'DEL_BUTTON') {
299
					if (isset($this->CI->input->post))
300
						$fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']);
301
                       
302
					else
303
						$fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value'];
304
						$fieldvalue[2]['style'] = isset($fieldvalue[2]['style']) ? $fieldvalue[2]['style'] : "";
305
					$form_contents.= form_img_delete($fieldvalue[2], 'readonly',$fieldvalue[2]['style']);
306
						 $form_contents.=@$fieldvalue[6];
@@ 314-317 (lines=4) @@
311
				}
312
				/**********************************************************************************/
313
				else if ($fieldvalue[1] == 'PASSWORD') {
314
					if (isset($this->CI->input->post))
315
						$fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']);
316
					else
317
						$fieldvalue[2]['value'] = ($values) ?@$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value'];
318
					$form_contents.= form_password($fieldvalue[2]);
319
					$this->CI->form_validation->set_rules($fieldvalue[2]['name'], $fieldvalue[0], $fieldvalue[3]);
320
					$form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>';
@@ 328-334 (lines=7) @@
325
326
					if(isset($fieldvalue[7]) && $fieldvalue[7] != '')
327
					$OptionArray = call_user_func_array(array($this->CI->common, $fieldvalue[7]), array($fieldvalue[6]));
328
					if (isset($this->CI->input->post)){
329
						$fieldvalue[3]['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[3]['value'] : $this->CI->input->post($fieldvalue[1]);
330
					}    
331
					else
332
					{
333
						$fieldvalue[3]['value'] = ($values) ? (isset($values[$fieldvalue[1]]) && $values[$fieldvalue[1]] ? 1: 0) : @$fieldvalue[3]['value'];
334
					}
335
					if ($fieldvalue[3]['value'] == "1") {
336
						$checked = true;
337
					} else {
@@ 348-351 (lines=4) @@
345
					}
346
				} else if ($fieldvalue[1] == 'TEXTAREA') {
347
348
					if (isset($this->CI->input->post))
349
						$fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']);
350
					else
351
						$fieldvalue[2]['value'] = ($values) ? $values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value'];
352
					$form_contents.= form_textarea($fieldvalue[2]);
353
				}
354
				else if ($fieldvalue[2] == 'RADIO') {