Code Duplication    Length = 9-10 lines in 3 locations

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

@@ 511-520 (lines=10) @@
508
509
			$str.= preg_match( $alpha_numeric_regex, $csvdata['destination'] ) ? null :'Destination,';
510
	      
511
		  if($str){
512
		$str=rtrim($str,',');
513
		$error_field=explode(',',$str);
514
		$count = count($error_field);
515
		$str.= $count > 1 ? ' are not valid' : ' is not Valid';
516
		return $str;
517
		  }
518
		  else{
519
		  return false;
520
		  }
521
	  }
522
	  else{
523
	  $str=rtrim($str,',');

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

@@ 794-802 (lines=9) @@
791
			$str.= is_numeric($csvdata['number']) ? null : 'Number,';
792
			$str.=!empty($csvdata['connectcost']) && is_numeric($csvdata['connectcost']) ? null : ( empty($csvdata['connectcost']) ? null : 'Connect Cost,');
793
			$str.=!empty($csvdata['includedseconds']) && is_numeric($csvdata['includedseconds']) ? null : ( empty($csvdata['includedseconds']) ? null : 'Included Seconds,');
794
			if ($str) {
795
				$str = rtrim($str, ',');
796
				$error_field = explode(',', $str);
797
				$count = count($error_field);
798
				$str.= $count > 1 ? ' are not valid' : ' is not Valid';
799
				return $str;
800
			} else {
801
				return false;
802
			}
803
		} else {
804
			$str = rtrim($str, ',');
805
			$error_field = explode(',', $str);

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

@@ 466-475 (lines=10) @@
463
			$str.= !empty($csvdata['inc']) && is_numeric($csvdata['inc']) ? null : (empty($csvdata['inc']) ? null : 'Increment,');
464
			$str.= !empty($csvdata['precedence']) && is_numeric($csvdata['precedence']) ? null : (empty($csvdata['precedence']) ? null : 'Precedence,');
465
			$str.= (isset($csvdata['strip']) && !empty($csvdata['strip'])) ? (is_numeric($csvdata['strip']) ? null : 'Strip,') : null;
466
			if ($str)
467
			{
468
				$str = rtrim($str, ',');
469
				$error_field = explode(',', $str);
470
				$count = count($error_field);
471
				$str.= $count > 1 ? ' are not valid' : ' is not Valid';
472
				return $str;
473
			}
474
			else
475
			{
476
				return false;
477
			}
478
		}