Code Duplication    Length = 5-5 lines in 6 locations

web_interface/astpp/application/models/db_model.php 4 locations

@@ 427-431 (lines=5) @@
424
425
	function build_concat_dropdown($select, $table, $id_where = '', $id_value = '') {
426
		$select_params = explode(',', $select);
427
		if (isset($select_params[3])) {
428
			$cnt_str = " $select_params[1],' ',$select_params[2],' ','(',$select_params[3],')' ";
429
		} else {
430
			$cnt_str = " $select_params[1],' (',$select_params[2],')' ";
431
		}
432
		$select = $select_params[0] . ", concat($cnt_str) as $select_params[1] ";
433
		$logintype = $this->session->userdata('logintype');
434
		if (($logintype == 1 || $logintype == 5) && $id_where == 'where_arr') {
@@ 460-464 (lines=5) @@
457
	function build_concat_dropdown_refill_coupon($select, $table, $id_where = '', $id_value = '') {
458
	$select_params = explode(',', $select);
459
	$account_data = $this->session->userdata("accountinfo");
460
	if (isset($select_params[3])) {
461
		$cnt_str = " $select_params[1],' ',$select_params[2],' ','(',$select_params[3],')' ";
462
	} else {
463
		$cnt_str = " $select_params[1],' (',$select_params[2],')' ";
464
	}
465
	$select = $select_params[0].", concat($cnt_str) as $select_params[1] ";
466
	$logintype = $this->session->userdata('logintype');
467
	if ($account_data['type'] == 1 && $id_where == 'where_arr') {
@@ 486-490 (lines=5) @@
483
/***********************************/
484
function build_concat_select_dropdown($select, $table, $id_where = '', $id_value = '') {         
485
		$select_params = explode(',', $select);
486
		if (isset($select_params[3])) {
487
			$cnt_str = " $select_params[1],' ',$select_params[2],' ','(',$select_params[3],')' ";
488
		} else {
489
			$cnt_str = " $select_params[1],' (',$select_params[2],')' ";
490
		}
491
		$select = $select_params[0] . ", concat($cnt_str) as $select_params[1] ";
492
	$where = $id_value;
493
		$drp_array = $this->getSelect($select, $table, $id_value);
@@ 978-982 (lines=5) @@
975
  function build_dropdown_invoices($select, $table, $id_where = '', $id_value = '') {
976
		$select_params = explode(',', $select);
977
		$select_params = explode(',', $select);
978
		if (isset($select_params[3])) {
979
			$cnt_str = " $select_params[1],' ',$select_params[2],' ','(',$select_params[3],')' ";
980
		} else {
981
			$cnt_str = " $select_params[1],' (',$select_params[2],')' ";
982
		}
983
		$select = $select_params[0] . ", concat($cnt_str) as $select_params[1] ,".$select_params[4] ;
984
		$logintype = $this->session->userdata('logintype');
985
		if (($logintype == 1 || $logintype == 5) && $id_where == 'where_arr') {

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

@@ 1244-1248 (lines=5) @@
1241
            $where = array("id" => $id_where);
1242
        }
1243
        $select_params = explode(',', $select);
1244
        if (isset($select_params[3])) {
1245
            $cnt_str = " $select_params[0],' ',$select_params[1],' ','(',$select_params[2],')' ";
1246
        } else {
1247
            $cnt_str = " $select_params[0],' (',$select_params[1],')' ";
1248
        }
1249
        $select = "concat($cnt_str) as $select_params[0] ";
1250
        $drp_array = $this->CI->db_model->getSelect($select, $table, $where);
1251
        $drp_array = $drp_array->result();
@@ 1290-1294 (lines=5) @@
1287
            $cnt_str = " $select_params[1],'(',$select_params[2],' ',$select_params[3],')' ";
1288
            $select = "concat($cnt_str) as $select_params[3] ";
1289
            $field_name = $select_params[3];
1290
        } elseif (isset($select_params[2])) {
1291
            $cnt_str = " $select_params[1],' ','(',$select_params[2],')' ";
1292
            $select = "concat($cnt_str) as $select_params[2] ";
1293
            $field_name = $select_params[2];
1294
        } else {
1295
            $select = $select_params[1];
1296
            $field_name = $select_params[1];
1297
        }