get_count_tpl()){ $mailtpl_script="
".$mailtpl->get_sel('mailtpl_id',0)."
"; } else $mailtpl_script=""; $mailtpl_vars="
".mailtpl::get_selvars()."
"; $get_sel_img=""; $sel_img=mailtpl::get_sel_img(); if($sel_img)$get_sel_img="
".mailtpl::get_sel_img()."
"; $urlbase="./circ/caddie/"; if (!$idemprcaddie) die(); if ($pmb_javascript_office_editor) { print $pmb_javascript_office_editor ; } if (!$f_message && !$pmb_javascript_office_editor) { $f_message=" "; } else $f_message=stripslashes($f_message); $f_objet_mail = stripslashes($f_objet_mail); print "
" ; switch ($sub) { case "redige" : echo "

$msg[empr_mailing_titre_form]

$mailtpl_script
$mailtpl_vars $get_sel_img
"; if (!$pmb_javascript_office_editor) echo ""; echo "
"; 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 "

".$msg[empr_mailing_raz_pointage]."
"; $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 "
"; // Fonction qui construit un formulaire qui relance function construit_formulaire_recharge ($time_out, $action, $name, $hidden_param, $texte_titre="",$texte_message="") { global $current_module, $msg; if (!is_array($hidden_param)) return ""; $formulaire="\n
"; $formulaire.="\n

$texte_titre

"; while (list($cle, $params) = each($hidden_param)) { $formulaire.="\n"; } // fin de liste $formulaire.=$texte_message; $formulaire.="\n
"; if ($time_out<0) $formulaire.="\n
"; $formulaire.="\n
"; switch ($time_out) { case 0: $formulaire.="\n"; break; case -1: break; default: $formulaire.="\n"; break; } return $formulaire; }