Code Duplication    Length = 6-8 lines in 2 locations

ecrire/public/criteres.php 2 locations

@@ 609-616 (lines=8) @@
606
	elseif ($type == 'mois')
607
		$boucle->where[]= array("'='", "'DATE_FORMAT($date, \'%Y%m\')'",
608
					("$annee . $mois"));
609
	elseif ($type == 'semaine')
610
		$boucle->where[]= array("'AND'", 
611
					array("'>='",
612
					     "'DATE_FORMAT($date, \'%Y%m%d\')'", 
613
					      ("date_debut_semaine($annee, $mois, $jour)")),
614
					array("'<='",
615
					      "'DATE_FORMAT($date, \'%Y%m%d\')'",
616
					      ("date_fin_semaine($annee, $mois, $jour)")));
617
	elseif (count($crit->param) > 2) 
618
		$boucle->where[]= array("'AND'",
619
					array("'>='",
@@ 617-622 (lines=6) @@
614
					array("'<='",
615
					      "'DATE_FORMAT($date, \'%Y%m%d\')'",
616
					      ("date_fin_semaine($annee, $mois, $jour)")));
617
	elseif (count($crit->param) > 2) 
618
		$boucle->where[]= array("'AND'",
619
					array("'>='",
620
					      "'DATE_FORMAT($date, \'%Y%m%d\')'",
621
					      ("$annee . $mois . $jour")),
622
					array("'<='", "'DATE_FORMAT($date, \'%Y%m%d\')'", ("$annee2 . $mois2 . $jour2")));
623
	// sinon on prend tout
624
}
625