" ;
switch ($sub) {
case "redige" :
echo "
$msg[empr_mailing_titre_form]
";
if (!$pmb_javascript_office_editor) echo "
".htmlentities(stripslashes($f_objet_mail),ENT_QUOTES,$charset)."
";
break;
case "envoi" :
$mailing = new mailing_empr($idemprcaddie);
if ($total_envoyes) $mailing->total_envoyes = $total_envoyes;
if ($total) $mailing->total = $total;
$mailing->send($f_objet_mail, $f_message, 20);
$sql = "select id_empr, empr_mail, empr_nom, empr_prenom from empr, empr_caddie_content where (flag='' or flag is null) and empr_caddie_id=$idemprcaddie and object_id=id_empr";
$sql_result = mysql_query($sql) or die ("Couldn't select compte reste mailing !");
$n_envoi_restant=mysql_num_rows($sql_result);
if ($n_envoi_restant > 0) {
$parametres[total]=$mailing->total;
$parametres[sub]="envoi";
$parametres[total_envoyes]=$mailing->total_envoyes;
$parametres[f_objet_mail]=htmlentities($f_objet_mail,ENT_QUOTES,$charset);
$parametres[f_message]=htmlentities($f_message,ENT_QUOTES,$charset);
$parametres[idemprcaddie]=$idemprcaddie;
$msg[empr_mailing_recap_comptes_encours] = str_replace("!!total_envoyes!!", $mailing->total_envoyes, $msg[empr_mailing_recap_comptes_encours]) ;
$msg[empr_mailing_recap_comptes_encours] = str_replace("!!total!!", $mailing->total, $msg[empr_mailing_recap_comptes_encours]) ;
$msg[empr_mailing_recap_comptes_encours] = str_replace("!!n_envoi_restant!!", $n_envoi_restant, $msg[empr_mailing_recap_comptes_encours]) ;
$message_info="
".
$msg[empr_mailing_recap_comptes_encours]."
";
print construit_formulaire_recharge (1000, "./mailing.php", "envoi_mailing", $parametres, $f_objet_mail, $message_info) ;
} else {
print "
$msg[empr_mailing_titre_resultat]
$msg[empr_mailing_form_obj_mail]
".htmlentities($f_objet_mail,ENT_QUOTES,$charset)."
$msg[empr_mailing_resultat_envoi] ";
$msg[empr_mailing_recap_comptes] = str_replace("!!total_envoyes!!", $mailing->total_envoyes, $msg[empr_mailing_recap_comptes]) ;
$msg[empr_mailing_recap_comptes] = str_replace("!!total!!", $mailing->total, $msg[empr_mailing_recap_comptes]) ;
print $msg[empr_mailing_recap_comptes] ;
print "
";
$sql = "select id_empr, empr_mail, empr_nom, empr_prenom from empr, empr_caddie_content where flag='2' and empr_caddie_id=$idemprcaddie and object_id=id_empr ";
$sql_result = mysql_query($sql) ;
if (mysql_num_rows($sql_result)) {
print "
$msg[empr_mailing_liste_erreurs]
";
while ($obj_erreur=mysql_fetch_object($sql_result)) {
print "
".$obj_erreur->empr_nom." ".$obj_erreur->empr_prenom." (".$obj_erreur->empr_mail.")
";
}
}
}
break;
default:
// include("$include_path/messages/help/$lang/mailing_empr.txt") ;
break;
}
print "