Code Duplication    Length = 10-11 lines in 2 locations

code/reports/SearchablePaymentReport.php 2 locations

@@ 88-97 (lines=10) @@
85
                        $where[] = ' {$bt}Order{$bt}.{$bt}ID{$bt} = '.intval($value);
86
                        $humanWhere[] = ' OrderID equals '.intval($value);
87
                        break;
88
                    case "From":
89
                        $d = new Date("date");
90
                        $d->setValue($value);
91
                        $t = new Time("time");
92
                        $cleanTime = trim(preg_replace('/([ap]m)/', "", Convert::raw2sql($_REQUEST["FromTime"])));
93
                        $t->setValue($cleanTime); //
94
                        $exactTime = strtotime($d->format("Y-m-d")." ".$t->Nice24());
95
                        $where[] = ' UNIX_TIMESTAMP({$bt}Payment{$bt}.{$bt}Created{$bt}) >= "'.$exactTime.'"';
96
                        $humanWhere[] = ' Order on or after '.Date("r", $exactTime);//r = Example: Thu, 21 Dec 2000 16:01:07 +0200 // also consider: l jS \of F Y H:i Z(e)
97
                        break;
98
                    case "Until":
99
                        $d = new Date("date");
100
                        $d->setValue($value);
@@ 98-108 (lines=11) @@
95
                        $where[] = ' UNIX_TIMESTAMP({$bt}Payment{$bt}.{$bt}Created{$bt}) >= "'.$exactTime.'"';
96
                        $humanWhere[] = ' Order on or after '.Date("r", $exactTime);//r = Example: Thu, 21 Dec 2000 16:01:07 +0200 // also consider: l jS \of F Y H:i Z(e)
97
                        break;
98
                    case "Until":
99
                        $d = new Date("date");
100
                        $d->setValue($value);
101
                        $t = new Time("time");
102
                        $cleanTime = trim(preg_replace('/([ap]m)/', "", Convert::raw2sql($_REQUEST["FromTime"])));
103
                        $t->setValue($cleanTime); //
104
                        $exactTime = strtotime($d->format("Y-m-d")." ".$t->Nice24());
105
                        $where[] = ' UNIX_TIMESTAMP({$bt}Payment{$bt}.{$bt}Created{$bt}) <= "'.$exactTime.'"';
106
                        $humanWhere[] = ' Order before or on '.Date("r", $exactTime);//r = Example: Thu, 21 Dec 2000 16:01:07 +0200 // also consider: l jS \of F Y H:i Z(e)
107
108
                        break;
109
                    case "Status":
110
                        $subWhere = array();
111
                        foreach ($value as $item) {