Code Duplication    Length = 5-5 lines in 2 locations

html/pages/bills.inc.php 1 location

@@ 122-126 (lines=5) @@
119
        $wheres[] = 'bill_type = ?';
120
        $params[] = $_GET['bill_type'];
121
    }
122
    if ($_GET['state'] === 'under') {
123
        $wheres[] = "((bill_type = 'cdr' AND rate_95th <= bill_cdr) OR (bill_type = 'quota' AND total_data <= bill_quota))";
124
    } else if ($_GET['state'] === 'over') {
125
        $wheres[] = "((bill_type = 'cdr' AND rate_95th > bill_cdr) OR (bill_type = 'quota' AND total_data > bill_quota))";
126
    }
127
        
128
    $query = 'SELECT *
129
    FROM `bills`

html/pages/bills/pmonth.inc.php 1 location

@@ 33-37 (lines=5) @@
30
    $wheres[] = 'bill_history.bill_type = ?';
31
    $params[] = $_GET['bill_type'];
32
}
33
if ($_GET['state'] === 'under') {
34
    $wheres[] = 'bill_history.bill_overuse = 0';
35
} else if ($_GET['state'] === 'over') {
36
    $wheres[] = 'bill_history.bill_overuse > 0';
37
}
38
    
39
$query = 'SELECT bills.bill_name, bill_history.*
40
FROM `bills`