$id_empr = @pmb_mysql_result($result, '0', 'id_empr'); if ($id_empr && $form_cb) { print dsi_list_bannettes_abo($id_empr); } else { print get_cb_dsi($msg[circ_tit_form_cb_empr], $msg[34], './dsi.php?categ=bannettes&sub=abo&suite=search', $form_cb); $ret = dsi_list_empr($form_cb); if ($ret['id_empr']) { print dsi_list_bannettes_abo($ret['id_empr']); } else { print $ret['message']; } } break; case 'transform_equ': // mettre à jour l'équation $equation = new equation($id_equation); $s = new search(); $equ_human = $s->make_serialized_human_query(stripslashes($requete)); $temp = new stdClass(); $temp->id_equation = $id_equation; $temp->num_classement = 0; $temp->nom_equation = $equ_human; $temp->comment_equation = addslashes($equation->comment_equation); $temp->requete = $requete; $temp->proprio_equation = $equation->proprio_equation; $temp->update_type = "C"; $equation->update($temp); print dsi_list_bannettes_abo($id_empr); break; case 'modif': $bannette = new bannette($id_bannette);
function dsi_list_bannettes_abo($id_empr = 0) { global $dbh, $msg, $charset; global $page, $nbr_lignes; global $dsi_list_tmpl; global $form_cb; $clause = "WHERE proprio_bannette='{$id_empr}' "; $requete = "SELECT id_bannette FROM bannettes {$clause} ORDER BY nom_bannette, id_bannette "; $res = @mysql_query($requete, $dbh); $bann_list .= "<tr >"; $bann_list .= "\n\t\t\t\t<th>\n\t\t\t\t\t<strong>" . htmlentities($msg[dsi_ban_form_nom], ENT_QUOTES, $charset) . "</strong><ul>\n\t\t\t\t\t</li><li>" . htmlentities($msg[dsi_ban_form_com_gestion], ENT_QUOTES, $charset) . "\n\t\t\t\t\t</li><li>" . htmlentities($msg[dsi_ban_form_com_public], ENT_QUOTES, $charset) . "\n\t\t\t\t\t</li></ul></th>"; $bann_list .= "\n\t\t\t\t<th>\n\t\t\t\t\t<strong>" . htmlentities($msg[dsi_ban_list_equ], ENT_QUOTES, $charset) . "</strong>\n\t\t\t\t\t</th>"; $bann_list .= "\n\t\t\t\t<th>\n\t\t\t\t\t<strong>" . htmlentities($msg[dsi_ban_nb_notices], ENT_QUOTES, $charset) . "</strong>\n\t\t\t\t\t</th>"; $bann_list .= "\n\t\t\t\t<th>\n\t\t\t\t\t<strong>" . htmlentities($msg[dsi_ban_date_last_envoi], ENT_QUOTES, $charset) . "</strong>\n\t\t\t\t\t<br />(" . htmlentities($msg[dsi_ban_date_last_remp], ENT_QUOTES, $charset) . ")\n\t\t\t\t\t</th>"; $bann_list .= "</tr>"; $parity = 0; $ban_trouvees = mysql_num_rows($res); while ($ban = mysql_fetch_object($res)) { $bann = new bannette($ban->id_bannette); if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" "; $bann_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer' >"; $td_javascript = " onmousedown=\"document.location='./dsi.php?categ=bannettes&sub=abo&id_bannette={$bann->id_bannette}&suite=modif&id_empr={$id_empr}';\" "; $bann_list .= "\n\t\t\t\t<td valign='top' {$td_javascript}>\n\t\t\t\t\t<strong>" . htmlentities($bann->nom_bannette, ENT_QUOTES, $charset) . "</strong><ul>\n\t\t\t\t\t</li><li>" . htmlentities($bann->comment_gestion, ENT_QUOTES, $charset) . "\n\t\t\t\t\t</li><li>" . htmlentities($bann->comment_public, ENT_QUOTES, $charset) . "\n\t\t\t\t\t</li></ul></td>"; $requete = "select id_equation, num_classement, nom_equation, comment_equation, proprio_equation, num_bannette from equations, bannette_equation where num_equation=id_equation and proprio_equation={$id_empr} and num_bannette='{$bann->id_bannette}' order by nom_equation "; $resequ = mysql_query($requete, $dbh) or die($requete); $equ_trouvees = mysql_num_rows($resequ); $equations = ""; while ($equa = mysql_fetch_object($resequ)) { $eq_form = new equation($equa->id_equation); $equations .= "<li>" . $equa->nom_equation . $eq_form->make_hidden_search_form("", "PRI", $id_empr) . "</li>"; } $td_javascript = " onmousedown= \"document.modif_requete_form_{$eq_form->id_equation}.submit();\" "; $bann_list .= "<td valign='top' {$td_javascript}><ul>{$equations}</ul></td>"; $bann_list .= "<td valign='top'>{$bann->nb_notices}</td>"; $td_javascript = " onmousedown=\"document.location='./dsi.php?categ=diffuser&sub=lancer';\" "; $bann_list .= "<td valign='top' sorttable_customkey='" . $bann->date_last_envoi . "' {$td_javascript}>\n\t\t\t\t\t<strong>" . htmlentities($bann->aff_date_last_envoi, ENT_QUOTES, $charset) . "</strong>"; if ($bann->alert_diff) { $bann_list .= "<br /><font color=red>(" . htmlentities($bann->aff_date_last_remplissage, ENT_QUOTES, $charset) . ")</font>"; } else { $bann_list .= "<br />(" . htmlentities($bann->aff_date_last_remplissage, ENT_QUOTES, $charset) . ")"; } $bann_list .= "</td>"; $bann_list .= "</tr>"; $parity += 1; } $nav_bar = ""; $dsi_list_tmpl = str_replace("!!cle!!", $form_cb, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!list!!", $bann_list, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!message_trouve!!", $msg['dsi_ban_abo_trouvees'], $dsi_list_tmpl); return $dsi_list_tmpl; }