Code Duplication    Length = 14-15 lines in 2 locations

includes/admin/reports/graphing.php 2 locations

@@ 85-98 (lines=14) @@
82
		$day     = $dates['day'];
83
		$day_end = $dates['day_end'];
84
		$month   = $dates['m_start'];
85
		while ( $day <= $day_end ) :
86
87
			$start_date = mktime( 0, 0, 0, $month, $day, $dates['year'] );
88
			$end_date   = mktime( 23, 59, 59, $month, $day, $dates['year'] );
89
			$sales      = $donation_stats->get_sales( 0, $start_date, $end_date );
90
			$earnings   = $donation_stats->get_earnings( 0, $start_date, $end_date );
91
92
			$sales_totals    += $sales;
93
			$earnings_totals += $earnings;
94
95
			$sales_data[]    = array( $start_date * 1000, $sales );
96
			$earnings_data[] = array( $start_date * 1000, $earnings );
97
			$day ++;
98
		endwhile;
99
100
	} else {
101
@@ 331-345 (lines=15) @@
328
		$day     = $dates['day'];
329
		$day_end = $dates['day_end'];
330
		$month   = $dates['m_start'];
331
		while ( $day <= $day_end ) :
332
333
			$date          = mktime( 0, 0, 0, $month, $day, $dates['year'] );
334
			$date_end      = mktime( 0, 0, 0, $month, $day + 1, $dates['year'] );
335
			$sales         = $stats->get_sales( $form_id, $date, $date_end );
336
			$sales_totals += $sales;
337
338
			$earnings         = $stats->get_earnings( $form_id, $date, $date_end );
339
			$earnings_totals += $earnings;
340
341
			$sales_data[]    = array( $date * 1000, $sales );
342
			$earnings_data[] = array( $date * 1000, $earnings );
343
344
			$day ++;
345
		endwhile;
346
347
	} else {
348