$id_composition = isset($params["id_composition"]) ? $params["id_composition"] : null;
$id_source_derivation = isset($params["id_source_derivation"]) ? $params["id_source_derivation"] : null;
$id_licence = isset($params["id_licence"]) ? $params["id_licence"] : null;
+ $is_reference = isset($params["is_reference"]) ? $params["is_reference"] : null;
$order_by = isset($params["order_by"]) ? $params["order_by"] : "ordre";
$order = isset($params["order"]) ? $params["order"] : "ASC";
$res = array();
if($rst = $sgbd->open_data("sml_sources"))
{ while($v_rst = $sgbd->fetch_data($rst))
- { if(isset($v_rst)) $res[$v_rst["id"]] = $v_rst;
+ { if(isset($v_rst)){
+ $res[$v_rst["id"]] = $v_rst;
+ if(!isset($res[$v_rst["id"]]["ordre"])) $res[$v_rst["id"]]["ordre"] = 0;
+ }
else
{ $res = false;
break;
}
}
+ // -------------------------------- filtre sur is_reference
+ if($MATCH){
+ if(isset($is_reference)){
+ if($is_reference){
+ $MATCH = isset($v_rst["reference"]) && $v_rst["reference"];
+ }
+ else{
+ $MATCH = !isset($v_rst["reference"]) || !$v_rst["reference"];
+ }
+ }
+ }
+
// -------------------------------- filtre sur quantite de resultats
if($MATCH)
{ $sources["total"]++;