alpha_full/_include/_mail/client.insc.mailAdmins.php
2026-04-06 22:58:51 +02:00

74 lines
3.5 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
include_once("mailer.v04.php");
include_once ($includePath. "/req/14-init.mailMsgList.php");
include ($includePath. "/req/06-init.cliMsgList.php");
if(!isset($nom) || empty($nom)) include ("../pages/clients/client.reqSelectFromMail.php");
// ---------------------------------------------------
// Fabrication du message
// ---------------------------------------------------
$sujet="Nouvelle inscription sur " .$_SESSION['nomSiteAff'];
if ($_SESSION['isWbAdm']===true ) {$sujet="en Test --- " .$sujet;}
$test= strpos($sujet,$_SESSION['nomSiteAff']);
if($test==false) $sujet.= ' ' .$_SESSION['nomSiteAff'];
$msgB ='';
$msgB .="<br>";
$msgB .="<img src='" .$mailImgPt[19]. "' alt='" .$mailAlt[19]. "'' /><br><br>";
$msgB .="Chers administrateurs,<br>";
$msgB .="Une nouvelle inscription cliente a été effectuée sur votre site " .$_SESSION['nomSiteAff']. ". Voici les informations de contact :<br>";
$msgB .='<br> --------------------------------- <br>';
$msgB .="<br>$clientMsg[81] $civ";
$msgB .="<br>$clientMsg[88] $nom";
$msgB .="<br>$clientMsg[10] $prenom<br>";
require_once ($includePath. "/_fonctions/fonctions.gene.php");
$telAff=formatTelAff($tel);
$msgB .="<br>$clientMsg[11] $telAff ";
$msgB .="<br>$clientMsg[8] $idMail";
$msgB .='<br> --------------------------------- <br>';
$msgB .='<br><a href="' .$prodServer. '/admin/stats/frm.stats.php">Voir les statistiques</a><br>';
try {
// $msgB .=file_get_contents($prodServer. "/Publication/piedDePageMail/ppdp_" .$lg. ".php");
$url=$prodServer. "/Publication/piedDePageMail/pdpMail_" .$lg. ".php";
$ch=curl_init();
$timeout=5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$result=curl_exec($ch);
curl_close($ch);
$msgB .= $result;
}
catch (Exception $e) {
if (isset($debug[1]) && $debug[1] == '1' ) {echo $e->getMessage();}
}
$msgB=stripslashes($msgB);
if (isset($debug[1]) && $debug[1] == '1' ) { $debugMsg .= monDebug(2, ['message_' => $msgB, 'nbAdmin' => $nbAdmin ], 'client.insc.mailAdmins.php');}
// ---------------------------------------------------
// Pied de page
// ---------------------------------------------------
include ("./admin/mails/pdpAdmin.php");
$msgB .=stripslashes($msgPdp);
$message_business = '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>' .$sujet. '</title></head><body>' .$msgB. '<br></body></html>';
if (isset($debug[1]) && $debug[1] == '1' ) {echo 'message_business=' .$message_business. '<br>';}
// ---------------------------------------------------
// Envoi des mails pour chaque admin
// ---------------------------------------------------
include ($includePath. "/req/15-init.adminMsgList.php");
for ( $ijk=0 ; $ijk<$_SESSION['nbAdmin'] ; $ijk++) {
if (isset($debug[1]) && $debug[1] == '1' ) { $debugMsg .= '<br><span class="debugStyle">tableLibAdmin[' .$ijk. ']=' .$tableLibAdmin[$ijk]. ' | tableAdminSms[' .$ijk. ']=' .$tableAdminSms[$ijk]. '</span> <br>';}
if ($lg=='') {$lg='FRA';}
$envMail = mailer(1, '','', 0, $_SESSION['smtpServer123'], $sujet, $message_business, $tableLibAdmin[$ijk], '', '', 0, $navMsg[9], $navMsg[22], '0', '', '', $_SESSION['expediteur_mails123'], $_SESSION['from_mails123'], '', $lg);
}//for nb admin
?>