Code Duplication    Length = 4-6 lines in 2 locations

class/room.php 2 locations

@@ 584-589 (lines=6) @@
581
        $sql .= $room_date > 0 ? "and room_date = " . strtotime($room_date) . ' ' : " and room_date BETWEEN " . $Today . " AND " . $NextMouth;
582
        $sql .= " order by room_id , room_date desc ";
583
        $result = $this->db->query($sql);
584
        while ($row = $this->db->fetchArray($result)) {
585
            if ($room_date > 0) {
586
                return $row;
587
            }
588
            $rows[$row['room_date']] = $row;
589
        }
590
591
        return $room_date > 0 ? $rows[0] : $rows;
592
    }
@@ 613-616 (lines=4) @@
610
        $sql .= " order by room_id , room_date desc ";
611
        $sql .= " limit $start,$limit ";
612
        $result = $this->db->query($sql);
613
        while ($row = $this->db->fetchArray($result)) {
614
            $row['room_date'] = date('Y-m-d', $row['room_date']);
615
            $rows[]           = $row;
616
        }
617
618
        return $rows;
619
    }