0) $clause.= " and num_classement='$id_classement' " ;
if(!$nbr_lignes) {
$requete = "SELECT COUNT(1) FROM bannettes $clause ";
$res = mysql_query($requete, $dbh);
$nbr_lignes = mysql_result($res, 0, 0);
}
if($nbr_lignes) {
// on lance la vraie requête
$requete = "SELECT id_bannette, proprio_bannette FROM bannettes $clause ORDER BY nom_bannette, id_bannette ";
$res = mysql_query($requete, $dbh);
$parity = 0;
$ban_trouvees = mysql_num_rows($res) ;
$bann_list .= "
";
$bann_list .= "
| ";
$bann_list .= "
".htmlentities($msg[dsi_ban_form_nom],ENT_QUOTES, $charset)."
(".htmlentities($msg[dsi_ban_form_com_public],ENT_QUOTES, $charset).")
| ";
$bann_list .= "
".htmlentities($msg[dsi_ban_date_last_envoi],ENT_QUOTES, $charset)."
(".htmlentities($msg[dsi_ban_date_last_remp],ENT_QUOTES, $charset).")
| ";
$bann_list .= "
".htmlentities($msg[dsi_ban_nb_notices],ENT_QUOTES, $charset)."
| ";
$bann_list .= "
";
$id_check_list='';
while(($bann=mysql_fetch_object($res))) {
$id_check="auto_".$bannette->id_bannette;
if($id_check_list)$id_check_list.='|';
$id_check_list.=$id_check;
if ($parity % 2) $pair_impair = "even";
else $pair_impair = "odd";
$bannette = new bannette($bann->id_bannette) ;
if ($bann->proprio_bannette) $nom_bannette = "".htmlentities($bannette->nom_bannette,ENT_QUOTES, $charset)."" ;
else $nom_bannette = htmlentities($bannette->nom_bannette,ENT_QUOTES, $charset) ;
$td_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" ";
$bann_list .= "";
$bann_list .= "
| ";
$bann_list .= "
".$nom_bannette."
(".htmlentities($bannette->comment_public,ENT_QUOTES, $charset).")
| ";
$bann_list .= "
".htmlentities($bannette->aff_date_last_envoi,ENT_QUOTES, $charset)."";
if ($bannette->alert_diff) $bann_list .= " (".htmlentities($bannette->aff_date_last_remplissage,ENT_QUOTES, $charset).")";
else $bann_list .= " (".htmlentities($bannette->aff_date_last_remplissage,ENT_QUOTES, $charset).")" ;
$bann_list .= "
|
".htmlentities($bannette->nb_notices,ENT_QUOTES, $charset)."
| ";
$bann_list .= "
";
$parity += 1;
}
$bann_list.="";
mysql_free_result($res);
if ($auto==1) $dsi_ban_list_diff = str_replace("!!titre!!", $msg[dsi_diff_ban_auto_found], $dsi_ban_list_diff);
else $dsi_ban_list_diff = str_replace("!!titre!!", $msg[dsi_diff_ban_manu_found], $dsi_ban_list_diff);
$dsi_ban_list_diff = str_replace("!!cle!!", $form_cb, $dsi_ban_list_diff);
$dsi_ban_list_diff = str_replace("!!id_classement!!", $id_classement, $dsi_ban_list_diff);
$dsi_ban_list_diff = str_replace("!!list!!", $bann_list, $dsi_ban_list_diff);
$dsi_ban_list_diff = str_replace("!!form_action!!", $form_action, $dsi_ban_list_diff);
return $dsi_ban_list_diff;
} else return $msg['dsi_no_ban_found'] ;
}
function dif_list_bannettes_full_auto($form_action) {
global $dbh, $msg, $charset;
global $page, $nbr_lignes;
global $dsi_ban_list_diff;
$clause = "WHERE (DATE_ADD(date_last_envoi, INTERVAL periodicite DAY) <= sysdate()) and bannette_auto=1 " ;
if(!$nbr_lignes) {
$requete = "SELECT COUNT(1) FROM bannettes $clause ";
$res = mysql_query($requete, $dbh);
$nbr_lignes = mysql_result($res, 0, 0);
}
if($nbr_lignes) {
// on lance la vraie requête
$requete = "SELECT id_bannette, proprio_bannette FROM bannettes $clause ORDER BY nom_bannette, id_bannette ";
$res = mysql_query($requete, $dbh);
$parity = 0;
$ban_trouvees = mysql_num_rows($res) ;
$bann_list .= "";
$bann_list .= "
| ";
$bann_list .= "
".htmlentities($msg[dsi_ban_form_nom],ENT_QUOTES, $charset)."
(".htmlentities($msg[dsi_ban_form_com_public],ENT_QUOTES, $charset).")
| ";
$bann_list .= "
".htmlentities($msg[dsi_ban_date_last_envoi],ENT_QUOTES, $charset)."
(".htmlentities($msg[dsi_ban_date_last_remp],ENT_QUOTES, $charset).")
| ";
$bann_list .= "
".htmlentities($msg[dsi_ban_nb_notices],ENT_QUOTES, $charset)."
| ";
$bann_list .= "
";
$id_check_list='';
while(($bann=mysql_fetch_object($res))) {
$id_check="auto_".$bannette->id_bannette;
if($id_check_list)$id_check_list.='|';
$id_check_list.=$id_check;
if ($parity % 2) $pair_impair = "even";
else $pair_impair = "odd";
$bannette = new bannette($bann->id_bannette) ;
if ($bann->proprio_bannette) $nom_bannette = "".htmlentities($bannette->nom_bannette,ENT_QUOTES, $charset)."" ;
else $nom_bannette = htmlentities($bannette->nom_bannette,ENT_QUOTES, $charset) ;
$td_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" ";
$bann_list .= "";
$bann_list .= "
| ";
$bann_list .= "
".$nom_bannette."
(".htmlentities($bannette->comment_public,ENT_QUOTES, $charset).")
| ";
$bann_list .= "
".htmlentities($bannette->aff_date_last_envoi,ENT_QUOTES, $charset)."
(".htmlentities($bannette->aff_date_last_remplissage,ENT_QUOTES, $charset).")
| ";
$bann_list .= "
".htmlentities($bannette->nb_notices,ENT_QUOTES, $charset)."
| ";
$bann_list .= "
";
$parity += 1;
}
$bann_list.="";
mysql_free_result($res);
$dsi_ban_list_diff = str_replace("!!titre!!", $msg[dsi_diff_ban_auto_found], $dsi_ban_list_diff);
$dsi_ban_list_diff = str_replace("!!cle!!", "", $dsi_ban_list_diff);
$dsi_ban_list_diff = str_replace("!!id_classement!!", 0, $dsi_ban_list_diff);
$dsi_ban_list_diff = str_replace("!!list!!", $bann_list, $dsi_ban_list_diff);
$dsi_ban_list_diff = str_replace("!!form_action!!", $form_action, $dsi_ban_list_diff);
return $dsi_ban_list_diff;
} else return $msg['dsi_no_automatic_ban_found_ech'] ;
}