Code Duplication    Length = 11-13 lines in 2 locations

advancedsearch.php 2 locations

@@ 92-102 (lines=11) @@
89
            case 'radio':
90
                $filter_arr[] = getPostedValue_text($dtypeid);
91
                break;
92
            case 'select':
93
                $selectarr = getPostedValue_array($dtypeid);
94
                $count_arr = count($selectarr);
95
96
                if ($count_arr >= 1) {
97
                    foreach ($selectarr as $arr) {
98
                        $selectarray[] = $arr['postvalue'];
99
                    }
100
                    $filter_arr[] = array('dtypeid' => $dtypeid, 'constr' => 'equal', 'postvalue' => $selectarr['postvalue'], 'selectfields' => $selectarray, 'addressfields' => 0);
101
                }
102
                break;
103
            case 'dhtml':
104
                $filter_arr[] = getPostedValue_text($dtypeid);
105
                break;
@@ 117-129 (lines=13) @@
114
                    $filter_arr[] = array('dtypeid' => $dtypeid, 'constr' => 'equal', 'postvalue' => $arr['postvalue'], 'selectfields' => 0, 'addressfields' => $addressarray);
115
                }
116
                break;
117
            case 'rating':
118
                $selectarr = getPostedValue_array($dtypeid);
119
                //$selectarr = getPostedValue_text($dtypeid);
120
                $count_arr = count($selectarr);
121
122
                if ($count_arr >= 1) {
123
                    foreach ($selectarr as $arr) {
124
                        $selectarray[] = $arr;
125
                    }
126
                    //echo $selectarr['postvalue'];
127
                    $filter_arr[] = array('dtypeid' => $dtypeid, 'constr' => $selectarr['constr'], 'postvalue' => $selectarr['postvalue'], 'selectfields' => '', 'addressfields' => 0);
128
                }
129
                break;
130
            case 'date':
131
                $filter_arr[] = getPostedValue_text($dtypeid);
132
                break;