function check_form() { var message=''; f=document.mailing; if (f.nom.value=='') message='".addslashes($msg["command_phototeque_need_name"])."'; if ((f.mail.value=='')&&(f.telephone.value=='')&&(!message)) { message='".addslashes($msg["command_phototeque_need_phone"])."'; } if (message) { alert(message); return false; } return true; }

".htmlentities($msg["command_phototeque_coord"],ENT_QUOTES,$charset)."

".htmlentities($msg["command_phototeque_name"],ENT_QUOTES,$charset)."
".htmlentities($msg["command_phototeque_phone"],ENT_QUOTES,$charset)."
".htmlentities($msg["command_phototeque_email"],ENT_QUOTES,$charset)."
".htmlentities($msg["command_phototeque_nbre"],ENT_QUOTES,$charset)."
".htmlentities($msg["command_phototeque_comment"],ENT_QUOTES,$charset)."
"; if ($nom) { $corps=""; if ($id_empr) { $requete="select empr_cb,empr_nom,empr_prenom,empr_login from empr where id_empr=".$id_empr; $resultat=mysql_query($requete); if (mysql_num_rows($resultat)) { $r=mysql_fetch_object($resultat); $corps.="".htmlentities(sprintf($msg["command_phototeque_send_by"],$r->empr_cb." ".$r->empr_nom." ".$r->empr_prenom),ENT_QUOTES,$charset)."
"; } } $corps.="".htmlentities(sprintf($msg["command_phototeque_doc_id"],$id),ENT_QUOTES,$charset)."
"; $corps.=htmlentities($msg["command_phototeque_name"],ENT_QUOTES,$charset)." : ".$nom."
"; $corps.=htmlentities($msg["command_phototeque_phone"],ENT_QUOTES,$charset)." : ".$telephone."
"; $corps.=htmlentities($msg["command_phototeque_email"],ENT_QUOTES,$charset)." : ".$mail."
"; $corps.=htmlentities($msg["command_phototeque_nbre"],ENT_QUOTES,$charset)." : ".$nbre."
"; $corps.=htmlentities($msg["command_phototeque_comment"],ENT_QUOTES,$charset)." : ".$commentaire."
"; //Envoi du mail $mails=explode(" ",$opac_photo_email_form); $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; if (count($mails)) $ret=1; else $ret=0; for ($i=0; $i alert('".($ret?htmlentities($msg["command_phototeque_command_transmited"],ENT_QUOTES,$charset):htmlentities($msg["command_phototeque_command_no_transmited"],ENT_QUOTES,$charset))."'); document.location='index.php?lvl=notice_display&id=$id&mode_phototeque=1'; "; } else { $flag=false; if ($id_empr) { $requete="select empr_login,concat(empr_prenom,' ',empr_nom) as nom, empr_tel1,empr_mail from empr where id_empr=$id_empr"; $resultat=mysql_query($requete); if (mysql_num_rows($resultat)) { $flag=true; $r=mysql_fetch_object($resultat); $form_mailing=str_replace("!!nom!!",htmlentities($r->nom,ENT_QUOTES,$charset),$form_mailing); $form_mailing=str_replace("!!telephone!!",htmlentities($r->empr_tel1,ENT_QUOTES,$charset),$form_mailing); $form_mailing=str_replace("!!mail!!",htmlentities($r->empr_mail,ENT_QUOTES,$charset),$form_mailing); } } if (!$flag) { $form_mailing=str_replace("!!nom!!","",$form_mailing); $form_mailing=str_replace("!!telephone!!","",$form_mailing); $form_mailing=str_replace("!!mail!!","",$form_mailing); } print $form_mailing; } ?>