Code Duplication    Length = 4-4 lines in 4 locations

web_interface/astpp/application/modules/accounts/controllers/accounts.php 3 locations

@@ 2422-2425 (lines=4) @@
2419
			}
2420
			if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') {
2421
				$files = $_FILES['file'];
2422
				if ($files['size'] < 0) {
2423
					$this->session->set_flashdata('astpp_notification', 'PLease upload maximum file');
2424
				redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/");
2425
				}
2426
				$file = $_FILES['file'];
2427
				$uploadedFile = $file["tmp_name"];
2428
				$file_name = $file['name'];
@@ 2435-2438 (lines=4) @@
2432
					$path = $dir_path . $add_array['accountid']."_".$file['name'];
2433
					if (move_uploaded_file($uploadedFile, $path)) {
2434
						$this->session->set_flashdata('astpp_errormsg', gettext('files added successfully!'));
2435
					} else {
2436
						$this->session->set_flashdata('astpp_notification', "File Uploading Fail Please Try Again");
2437
					redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/");
2438
					}
2439
				} else {
2440
					$this->session->set_flashdata('astpp_notification', 'Please upload only image!');
2441
				redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/");
@@ 2439-2442 (lines=4) @@
2436
						$this->session->set_flashdata('astpp_notification', "File Uploading Fail Please Try Again");
2437
					redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/");
2438
					}
2439
				} else {
2440
					$this->session->set_flashdata('astpp_notification', 'Please upload only image!');
2441
				redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/");
2442
				}
2443
			}
2444
			$add_array['logo'] = $file_name;
2445
			unset($add_array['submit']);

web_interface/astpp/application/modules/user/controllers/user.php 1 location

@@ 627-630 (lines=4) @@
624
			}
625
			if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') {
626
				$files = $_FILES['file'];
627
				if ($files['size'] < 0) {
628
					$this->session->set_flashdata('astpp_notification', 'PLease upload maximum file');
629
				redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/");
630
				}
631
				$file = $_FILES['file'];
632
				$uploadedFile = $file["tmp_name"];
633
				$file_name = $file['name'];