Code Duplication    Length = 17-17 lines in 2 locations

includes/api/class-give-api.php 2 locations

@@ 1235-1251 (lines=17) @@
1232
					endwhile;
1233
1234
					$donations['totals'] = $total;
1235
				} else {
1236
					if ( $args['date'] == 'this_quarter' || $args['date'] == 'last_quarter' ) {
1237
						$donations_count = 0;
1238
1239
						// Loop through the months
1240
						$month = $dates['m_start'];
1241
1242
						while ( $month <= $dates['m_end'] ) :
1243
							$donations_count += give_get_sales_by_date( null, $month, $dates['year'] );
1244
							$month ++;
1245
						endwhile;
1246
1247
						$donations['donations'][ $args['date'] ] = $donations_count;
1248
					} else {
1249
						$donations['donations'][ $args['date'] ] = give_get_sales_by_date( $dates['day'], $dates['m_start'], $dates['year'] );
1250
					}
1251
				}// End if().
1252
			} elseif ( $args['form'] == 'all' ) {
1253
				$forms = get_posts( array(
1254
					'post_type' => 'give_forms',
@@ 1370-1386 (lines=17) @@
1367
					endwhile;
1368
1369
					$earnings['totals'] = $total;
1370
				} else {
1371
					if ( $args['date'] == 'this_quarter' || $args['date'] == 'last_quarter' ) {
1372
						$earnings_count = (float) 0.00;
1373
1374
						// Loop through the months
1375
						$month = $dates['m_start'];
1376
1377
						while ( $month <= $dates['m_end'] ) :
1378
							$earnings_count += give_get_earnings_by_date( null, $month, $dates['year'] );
1379
							$month ++;
1380
						endwhile;
1381
1382
						$earnings['earnings'][ $args['date'] ] = $earnings_count;
1383
					} else {
1384
						$earnings['earnings'][ $args['date'] ] = give_get_earnings_by_date( $dates['day'], $dates['m_start'], $dates['year'] );
1385
					}
1386
				}// End if().
1387
			} elseif ( $args['form'] == 'all' ) {
1388
				$forms = get_posts( array(
1389
					'post_type' => 'give_forms',