function envoi_email_tradeProposition($id_pool, $gerant_expediteur, $gerant_destinataire, $id_proposition, $id_saison, $old_id_proposition, $duree_prop, $periode)
 {
     $data = $this->getConfigPool($id_pool, $id_saison);
     $salary_cap_enabled = $data['enable_salary_cap'];
     $trade_howto_switch_players = $data["trade_howto_switch_players"];
     $salary_cap = $data['salary_cap'];
     $salary_floor = $data['salary_floor'];
     $query = "SELECT name FROM pools WHERE id = {$id_pool}";
     $resultID = mysql_query($query, $this->handle);
     $data = mysql_fetch_array($resultID, MYSQL_ASSOC);
     mysql_free_result($resultID);
     $poolName = $data["name"];
     $poolNameUpper = strtoupper($poolName);
     $poolNameLower = strtolower($poolName);
     // information du gérant expéditeur
     $expediteurA = $this->getGerantProfil($id_pool, $gerant_expediteur, $id_saison);
     $from_name = $expediteurA["real_name"];
     $from_nickname = $expediteurA["real_name_abrege"];
     // information du gérant destinataire
     $destinataireA = $this->getGerantProfil($id_pool, $gerant_destinataire, $id_saison);
     $to_name = $destinataireA["real_name"];
     $to_nickname = $destinataireA["real_name_abrege"];
     $to_email_format = $destinataireA['email_format'];
     // on va chercher certaines info de la proposition
     $query = "select comment,date,time from trade_proposition where id = {$id_proposition}";
     $resultID = mysql_query($query, $this->handle);
     $data = mysql_fetch_array($resultID, MYSQL_ASSOC);
     mysql_free_result($resultID);
     $commentaire = $data['comment'];
     $date_prop = $data['date'];
     $time_prop = $data['time'];
     // durée de la propostion
     if ($duree_prop == 99) {
         $str_duree = "valide jusqu'à la fin de la période.";
     } else {
         $str_duree_prop = "+{$duree_prop} days";
         $_mydate = Datetime::createFromFormat('Y-m-d H:i:s', "{$date_prop} {$time_prop}", $this->timeZone);
         $_mydate->modify('$str_duree_prop');
         $jour_fin_prop = $this->date_getJour($_mydate->format('l'));
         $str_duree = "valide jusqu'à {$jour_fin_prop} {$time_prop}";
     }
     if ($old_id_proposition == "") {
         $subject = "{$poolNameUpper} - Proposition d'échange...";
     } else {
         $subject = "{$poolNameUpper} - Contre-offre d'une proposition d'échange précédente...";
     }
     if ($to_email_format == "html") {
         $body = "<p>{$from_nickname} propose l'échange suivant:</p>\n                        <br>\n                        <table border=0 cellspacing=3 cellpadding=3>\n                        <tr>";
     }
     $body_text = "{$from_nickname} propose l'échange suivant:\n\n";
     // on va chercher les joueurs impliqués dans la proposition...
     $query = "SELECT liste_joueurs_gerant1,liste_joueurs_gerant2,liste_picks_gerant1,liste_picks_gerant2\n                    FROM trade_proposition\n                    WHERE id_pool = {$id_pool} AND id = {$id_proposition}\n                    AND saison_id = {$id_saison}";
     $resultID = mysql_query($query, $this->handle);
     $data = mysql_fetch_array($resultID, MYSQL_ASSOC);
     mysql_free_result($resultID);
     $liste_joueurs_expediteur = $data["liste_joueurs_gerant1"];
     $liste_joueurs_destinataire = $data["liste_joueurs_gerant2"];
     $liste_picks_expediteur = $data["liste_picks_gerant1"];
     $liste_picks_destinataire = $data['liste_picks_gerant2'];
     $liste_joueurs_expediteurA = explode(":", $liste_joueurs_expediteur);
     $liste_joueurs_destinataireA = explode(":", $liste_joueurs_destinataire);
     $liste_joueurs_prop_expediteur = 0;
     foreach ($liste_joueurs_expediteurA as $this_id_player) {
         if ($this_id_player != "") {
             $liste_joueurs_prop_expediteur .= ",{$this_id_player}";
         }
     }
     $liste_joueurs_prop_destinataire = 0;
     foreach ($liste_joueurs_destinataireA as $this_id_player) {
         if ($this_id_player != "") {
             $liste_joueurs_prop_destinataire .= ",{$this_id_player}";
         }
     }
     $compteur = 0;
     foreach (array('TM', 'G', 'D', 'F') as $pos_en_trait) {
         $playersPropGerant1 = $this->getPlayerInfoForTrade2($id_pool, $id_saison, $gerant_expediteur, $periode, $liste_joueurs_prop_expediteur, $pos_en_trait, $trade_howto_switch_players, $salary_cap_enabled);
         foreach ($playersPropGerant1 as $item) {
             $id_player = $item['id_player'];
             $pos = $item['pos'];
             $pts = $item['pts_nhl'];
             $pj = $item['pj'];
             $first_name = $item['first_name'];
             $last_name = $item['last_name'];
             $logo = "http://www.{$poolNameLower}.lamoria.ca/" . $item['logo'];
             $id_forecaster = $item['id_forecaster'];
             $salaire_unformatted = $item['salary_frozen'];
             $birthday = $item['birthday'];
             $url_photo = $item['url_photo'];
             $abbr = $item['abbr'];
             $salaire = number_format($salaire_unformatted, 0, ".", ",");
             // get pj restantes pour le joueur si nécessaire
             if ($salary_cap_enabled == "Y") {
                 $pj_restantes = $this->getPlayerPJRestantes($id_pool, $id_saison, $id_player, $periode);
             }
             // âge du joueur
             if ($pos == "TM") {
                 $age = "";
             } elseif ($birthday != "0000-00-00") {
                 $_mydate = Datetime::createFromFormat('Y-m-d', $birthday, $this->timeZone);
                 $age = $_mydate->diff($this->todayDate)->y;
             } else {
                 $age = "???";
             }
             if ($pj == "") {
                 $pj = 0;
             }
             if ($this->isPlayerInjured($id_player, $this->today, $id_saison)) {
                 $show_injury = "<img class=\"injury_icon_topLeft\" id=\"{$id_player}\" src=\"http://www.{$poolNameLower}.lamoria.ca/images/red-cross.png\" " . "border=0 width=20 height=20 style=\"padding-top:5px;padding-left:5px;\" /><br>";
             } else {
                 $show_injury = "";
             }
             if ($pos != "TM") {
                 if ($id_forecaster < 10) {
                     $id_forecaster_photo = "000{$id_forecaster}";
                 } elseif ($id_forecaster < 100) {
                     $id_forecaster_photo = "00{$id_forecaster}";
                 } elseif ($id_forecaster < 1000) {
                     $id_forecaster_photo = "0{$id_forecaster}";
                 } else {
                     $id_forecaster_photo = $id_forecaster;
                 }
                 if ($url_photo == "") {
                     //$photo = "http://www.$poolNameLower.lamoria.ca/images/players/forecaster/${id_forecaster_photo}.jpg";
                     $photo = "http://pics.forecaster.ca/nhl-player/{$id_forecaster_photo}.jpg";
                 } else {
                     //$photo = "http://www.$poolNameLower.lamoria.ca/$url_photo";
                     $photo = $url_photo;
                 }
             } else {
                 $photo = $logo;
             }
             if ($to_email_format == "html") {
                 $body .= "<td>";
                 $body .= "<table border=0>\n";
                 $body .= "<tr>\n";
                 if ($pos != "TM") {
                     $body .= "<td align='left'><img src=\"{$photo}\" width=55 height=80 border=0></td>\n";
                     $body .= "<td style=\"padding-right:5px;vertical-align:top;\"><img src=\"{$logo}\" border=0 style=\"padding:2px 2px 2px 2px;\"/>";
                     $body .= "<br><font style=\"padding-left:10px;\">{$pos}</font>";
                     $body .= "<br>{$show_injury}\n";
                 } else {
                     $body .= "<td align='left'><img src=\"{$photo}\" height=135% border=0></td>\n";
                 }
                 $body .= "</td>\n";
                 $body .= "</tr>\n";
                 $body .= "<tr>\n";
                 if ($pos == "TM") {
                     $body .= "<TD nowrap colspan=50 style=\"padding-right:5px;font-weight:bold;\">{$last_name}";
                 } else {
                     $body .= "<TD nowrap colspan=50 style=\"padding-right:5px;font-weight:bold;\">" . "<a class=\"player\" id=\"{$id_player}\" alt=\"Profil de {$first_name} {$last_name}\">" . "{$first_name['0']}. {$last_name}</a>";
                 }
                 $body .= "</td>\n";
                 $body .= "</tr>\n";
                 if ($salary_cap_enabled == "Y") {
                     if ($pos != "TM") {
                         $body .= "<tr>\n";
                         $body .= "<TD nowrap colspan=50 style=\"padding-right:5px;{$style_color}\">âge: {$age} ans</td>";
                         $body .= "</tr>\n";
                     }
                     $body .= "<tr>\n";
                     $body .= "<TD nowrap colspan=50 style=\"padding-right:5px;\">\$: {$salaire}";
                     if ($pos != "TM") {
                         $body .= "<img src=\"/images/plus.gif\" style=\"padding-right:2px;padding-left:2px;\" class=\"img_moreSalaries\" id=\"{$id_player}\" />\n";
                     }
                     $body .= "</td></tr>\n";
                 }
                 $body .= "<tr>\n";
                 $body .= "<TD nowrap colspan=50 align=\"left\">pj: {$pj}</td>\n";
                 $body .= "</tr>\n";
                 if ($salary_cap_enabled == "Y") {
                     $body .= "<tr>\n";
                     $body .= "<TD nowrap colspan=50 style=\"{$style_color};\" align=\"left\">pj reste: {$pj_restantes}</td>\n";
                     $body .= "</tr>\n";
                 }
                 $body .= "<tr>\n";
                 $body .= "<TD nowrap colspan=50 align=\"left\">pts: {$pts}</td>\n";
                 $body .= "</tr>\n";
                 $body .= "</table>\n";
                 $body .= "</td>\n";
                 $compteur++;
             }
             if ($pos == "TM") {
                 $body_text .= "\t{$last_name} (l'équipe) - {$pts} pts\n";
             } else {
                 $body_text .= "\t{$first_name} {$last_name}, {$pos} ({$abbr}) - {$pts} pts\n";
             }
         }
     }
     // draft picks...
     $liste_picks_expediteurA = explode(":", $liste_picks_expediteur);
     foreach ($liste_picks_expediteurA as $this_id_pick) {
         if ($this_id_pick == "") {
             continue;
         }
         $q = "select a.pick_no,a.owner,a.owner_ori,b.real_name_abrege\n                     from trade_draftPicks_gerant a, accounts b\n                     where\n                         a.id = {$this_id_pick}\n                         and a.owner_ori = b.id";
         $data = DB::dbSelect($q);
         $data = $data[0];
         $this_pick_no = $data['pick_no'];
         $this_pick_owner = $data['owner'];
         $this_pick_owner_ori = $data['owner_ori'];
         $this_pick_owner_ori_name = $data['real_name_abrege'];
         switch ($this_pick_no) {
             case 1:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/1st_round.png";
                 $str_pick = "Choix de 1ère ronde";
                 break;
             case 2:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/2nd_round.png";
                 $str_pick = "Choix de 2e ronde";
                 break;
             case 3:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/3rd_round.png";
                 $str_pick = "Choix de 3e ronde";
                 break;
             case 4:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/4th_round.png";
                 $str_pick = "Choix de 4e ronde";
                 break;
             case 5:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/5th_round.png";
                 $str_pick = "Choix de 5e ronde";
                 break;
             case 6:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/6th_round.png";
                 $str_pick = "Choix de 6e ronde";
                 break;
             case 7:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/7th_round.png";
                 $str_pick = "Choix de 7e ronde";
                 break;
             default:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/img_not_found.gif";
         }
         if ($to_email_format == "html") {
             $body .= "<td align='center'>\n";
             $body .= "<table border=0>\n";
             $body .= "<tr>\n";
             $body .= "<td>\n";
             $body .= "<img src=\"{$this_img_src}\" />";
             $body .= "</td>\n";
             $body .= "</tr>\n";
             $body .= "<tr>\n";
             $body .= "<td>\n";
             if ($this_pick_owner_ori != $this_pick_owner) {
                 $body .= "(Choix de {$this_pick_owner_ori_name})";
             } else {
                 $body .= "&nbsp;";
             }
             $body .= "</td>\n";
             $body .= "</tr>\n";
             $body .= "</table>\n";
             $body .= "</td>\n";
             $compteur++;
         }
         $body_text .= "\t{$str_pick}";
         if ($this_pick_owner_ori != $this_pick_owner) {
             $body_text .= " (Choix de {$this_pick_owner_ori_name})\n";
         } else {
             $body_text .= "\n";
         }
     }
     if ($to_email_format == "html") {
         $body .= "</tr>\n";
         $body .= "<tr>\n";
         for ($i = 0; $i < $compteur; $i++) {
             $body .= "<td align='center'><img src=\"http://www.{$poolNameLower}.lamoria.ca/images/trade_swap_players.png\" border=0 class=\"trade_swap_players_rotate_90\" /></td>\n";
         }
         $body .= "</tr>\n";
         $body .= "<tr>\n";
     }
     $body_text .= "\n\tcontre\n\n";
     // Gérant 2
     foreach (array('TM', 'G', 'D', 'F') as $pos_en_trait) {
         $playersPropGerant2 = $this->getPlayerInfoForTrade2($id_pool, $id_saison, $gerant_destinataire, $periode, $liste_joueurs_prop_destinataire, $pos_en_trait, $trade_howto_switch_players, $salary_cap_enabled);
         foreach ($playersPropGerant2 as $item) {
             echo "<td align='center'>\n";
             $id_player = $item['id_player'];
             $pos = $item['pos'];
             $pts = $item['pts_nhl'];
             $pj = $item['pj'];
             $first_name = $item['first_name'];
             $last_name = $item['last_name'];
             $logo = "http://www.{$poolNameLower}.lamoria.ca" . $item['logo'];
             $id_forecaster = $item['id_forecaster'];
             $salaire_unformatted = $item['salary_frozen'];
             $birthday = $item['birthday'];
             $url_photo = $item['url_photo'];
             $abbr = $item['abbr'];
             $salaire = number_format($salaire_unformatted, 0, ".", ",");
             // get pj restantes pour le joueur si nécessaire
             if ($salary_cap_enabled == "Y") {
                 $pj_restantes = $this->getPlayerPJRestantes($id_pool, $id_saison, $id_player, $periode);
             }
             // âge du joueur
             if ($pos == "TM") {
                 $age = "";
             } elseif ($birthday != "0000-00-00") {
                 $_mydate = Datetime::createFromFormat('Y-m-d', $birthday, $this->timeZone);
                 $age = $_mydate->diff($this->todayDate)->y;
             } else {
                 $age = "???";
             }
             if ($pj == "") {
                 $pj = 0;
             }
             if ($this->isPlayerInjured($id_player, $this->today, $id_saison)) {
                 $show_injury = "<img class=\"injury_icon_bottomLeft\" id=\"{$id_player}\" src=\"/images/red-cross.png\" " . "border=0 width=20 height=20 style=\"padding-top:5px;padding-left:5px;\" /><br>";
             } else {
                 $show_injury = "";
             }
             if ($pos != "TM") {
                 if ($id_forecaster < 10) {
                     $id_forecaster_photo = "000{$id_forecaster}";
                 } elseif ($id_forecaster < 100) {
                     $id_forecaster_photo = "00{$id_forecaster}";
                 } elseif ($id_forecaster < 1000) {
                     $id_forecaster_photo = "0{$id_forecaster}";
                 } else {
                     $id_forecaster_photo = $id_forecaster;
                 }
                 if ($url_photo == "") {
                     //$photo = "http://www.$poolNameLower.lamoria.ca/images/players/forecaster/${id_forecaster_photo}.jpg";
                     $photo = "http://pics.forecaster.ca/nhl-player/{$id_forecaster_photo}.jpg";
                 } else {
                     //$photo = "http://www.$poolNameLower.lamoria.ca/$url_photo";
                     $photo = $url_photo;
                 }
             } else {
                 $photo = $logo;
             }
             if ($to_email_format == "html") {
                 $body .= "<td>";
                 $body .= "<table border=0>\n";
                 $body .= "<tr>\n";
                 if ($pos != "TM") {
                     $body .= "<td align='left'><img src=\"{$photo}\" width=55 height=80 border=0></td>\n";
                     $body .= "<td style=\"padding-right:5px;vertical-align:top;\"><img src=\"{$logo}\" border=0 style=\"padding:2px 2px 2px 2px;\"/>";
                     $body .= "<br><font style=\"padding-left:10px;\">{$pos}</font>";
                     $body .= "<br>{$show_injury}\n";
                 } else {
                     $body .= "<td align='left'><img src=\"{$photo}\" height=135% border=0></td>\n";
                 }
                 $body .= "</td>\n";
                 $body .= "</tr>\n";
                 $body .= "<tr>\n";
                 if ($pos == "TM") {
                     $body .= "<TD nowrap colspan=50 style=\"padding-right:5px;font-weight:bold;\">{$last_name}";
                 } else {
                     $body .= "<TD nowrap colspan=50 style=\"padding-right:5px;font-weight:bold;\">" . "<a class=\"player\" id=\"{$id_player}\" alt=\"Profil de {$first_name} {$last_name}\">" . "{$first_name['0']}. {$last_name}</a>";
                 }
                 $body .= "</td>\n";
                 $body .= "</tr>\n";
                 if ($salary_cap_enabled == "Y") {
                     if ($pos != "TM") {
                         $body .= "<tr>\n";
                         $body .= "<TD nowrap colspan=50 style=\"padding-right:5px;{$style_color}\">âge: {$age} ans</td>";
                         $body .= "</tr>\n";
                     }
                     $body .= "<tr>\n";
                     $body .= "<TD nowrap colspan=50 style=\"padding-right:5px;\">\$: {$salaire}";
                     if ($pos != "TM") {
                         $body .= "<img src=\"/images/plus.gif\" style=\"padding-right:2px;padding-left:2px;\" class=\"img_moreSalaries\" id=\"{$id_player}\" />\n";
                     }
                     $body .= "</td></tr>\n";
                 }
                 $body .= "<tr>\n";
                 $body .= "<TD nowrap colspan=50 align=\"left\">pj: {$pj}</td>\n";
                 $body .= "</tr>\n";
                 if ($salary_cap_enabled == "Y") {
                     $body .= "<tr>\n";
                     $body .= "<TD nowrap colspan=50 style=\"{$style_color};\" align=\"left\">pj reste: {$pj_restantes}</td>\n";
                     $body .= "</tr>\n";
                 }
                 $body .= "<tr>\n";
                 $body .= "<TD nowrap colspan=50 align=\"left\">pts: {$pts}</td>\n";
                 $body .= "</tr>\n";
                 $body .= "</table>\n";
                 $body .= "</td>\n";
                 $compteur++;
             }
             if ($pos == "TM") {
                 $body_text .= "\t{$last_name} (l'équipe) - {$pts} pts\n";
             } else {
                 $body_text .= "\t{$first_name} {$last_name}, {$pos} ({$abbr}) - {$pts} pts\n";
             }
         }
     }
     // draft picks...
     $liste_picks_destinataireA = explode(":", $liste_picks_destinataire);
     foreach ($liste_picks_destinataireA as $this_id_pick) {
         if ($this_id_pick == "") {
             continue;
         }
         $q = "select a.pick_no,a.owner,a.owner_ori,b.real_name_abrege\n                     from trade_draftPicks_gerant a, accounts b\n                     where\n                         a.id = {$this_id_pick}\n                         and a.owner_ori = b.id";
         $data = DB::dbSelect($q);
         $data = $data[0];
         $this_pick_no = $data['pick_no'];
         $this_pick_owner = $data['owner'];
         $this_pick_owner_ori = $data['owner_ori'];
         $this_pick_owner_ori_name = $data['real_name_abrege'];
         switch ($this_pick_no) {
             case 1:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/1st_round.png";
                 $str_pick = "Choix de 1ère ronde";
                 break;
             case 2:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/2nd_round.png";
                 $str_pick = "Choix de 2e ronde";
                 break;
             case 3:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/3rd_round.png";
                 $str_pick = "Choix de 3e ronde";
                 break;
             case 4:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/4th_round.png";
                 $str_pick = "Choix de 4e ronde";
                 break;
             case 5:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/5th_round.png";
                 $str_pick = "Choix de 5e ronde";
                 break;
             case 6:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/6th_round.png";
                 $str_pick = "Choix de 6e ronde";
                 break;
             case 7:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/7th_round.png";
                 $str_pick = "Choix de 7e ronde";
                 break;
             default:
                 $this_img_src = "http://www.{$poolNameLower}.lamoria.ca/images/img_not_found.gif";
         }
         if ($to_email_format == "html") {
             $body .= "<td align='center'>\n";
             $body .= "<table border=0>\n";
             $body .= "<tr>\n";
             $body .= "<td>\n";
             $body .= "<img src=\"{$this_img_src}\" />";
             $body .= "</td>\n";
             $body .= "</tr>\n";
             $body .= "<tr>\n";
             $body .= "<td>\n";
             if ($this_pick_owner_ori != $this_pick_owner) {
                 $body .= "(Choix de {$this_pick_owner_ori_name})";
             } else {
                 $body .= "&nbsp;";
             }
             $body .= "</td>\n";
             $body .= "</tr>\n";
             $body .= "</table>\n";
             $body .= "</td>\n";
             $compteur++;
         }
         $body_text .= "\t{$str_pick}";
         if ($this_pick_owner_ori != $this_pick_owner) {
             $body_text .= " (Choix de {$this_pick_owner_ori_name})\n";
         } else {
             $body_text .= "\n";
         }
     }
     if ($to_email_format == "html") {
         $body .= "</tr>";
         $body .= "</table>";
         $body .= "<br><br>\n                         <p>La propostion est {$str_duree} </p>\n                         <br>\n                         <br>\n                         <p>Commentaire:</p>\n                         <br>";
         $body .= "<textarea cols=40 rows=10 class=\"tradeProposition\" disabled>{$commentaire}</textarea>\n";
         $body .= "<br><p>Pour tous les détails, suivez le lien. http://www.{$poolNameLower}.lamoria.ca</p>";
     }
     $body_text .= "\n\nLa propostion est {$str_duree}";
     $body_text .= "\n\n\nCommentaire(s):\n\n{$commentaire}";
     $body_text .= "\n\n\nPour tous les détails, suivez le lien. http://www.{$poolNameLower}.lamoria.ca";
     require_once "class.mail.php";
     $email = new eMail($poolNameUpper, "{$poolNameLower}@lamoria.ca");
     $emails_destinatairesA = explode(";", $destinataireA['email']);
     foreach ($emails_destinatairesA as $this_email) {
         if ($this_email == "") {
             continue;
         }
         $email->to($this_email);
     }
     $email->subject($subject);
     if ($to_email_format == "html") {
         $email->html($body);
     } else {
         $email->text($body_text);
     }
     $email->send();
     // insertion dans la table emails (à cause du problème que les mails sont longs à envoyer sur le serveur)
     $query = "insert into emails (id_pool,saison_id,`from`,`to`,subject,body)\n                    values ({$id_pool},{$id_saison},{$gerant_expediteur},{$gerant_destinataire},\"{$subject}\",\"{$body_text}\")";
     mysql_query($query, $this->handle);
     if (mysql_affected_rows() > 0) {
         $this->dbLog($id_pool, $gerant_expediteur, "envoie_email", $query);
         $rtn = 1;
     } else {
         $rtn = 0;
     }
     unset($query, $resultID, $data, $expediteurA, $destinataireA, $emails_expediteur, $emails_expediteurA, $from_email, $from_name, $from_nickname, $to_name, $to_nickname, $subject, $liste_joueurs_expediteur, $liste_joueurs_destinataire, $liste_joueurs_expediteurA, $liste_joueurs_destinataireA, $body, $playerInfoA, $first_name, $last_name, $pos, $abbr, $emails_destinataire, $emails_destinataireA, $pool, $sess);
     if ($rtn == 1) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
示例#2
0
        }
        $loginEmail = $checkEmail[0]['email'];
        $loginPass = $checkEmail[0]['parola'];
        // send confirmation email
        $mail = new eMail("Free Ex Admin", $configArray['notifyEmail']);
        // subiect = titlu
        $mail->subject("Free Ex Admin - Recuperare Parola");
        // to ...
        $mail->to($sendToName, $sendToMail);
        // HTML ...
        $doc = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">";
        $articolHTML_font = $doc . "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><title></title></head> ";
        $articolHTML_font .= "<body><br /> ";
        $articolHTML_font .= "<p>Recuperare Parola</p>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t<p>Ati primit acest email pentru ca dvs (sau cineva in numele dvs) ati completat formularul de recuperare parola de pe http://freeex.activewatch.ro/admin/.</p>\n\t\t\t\t\t\t\t\t\t\t\t\t<p>In cazul in care nu dvs ati cerut parola, va rugam sa ignorati acest mail.</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\tDatele dvs de autentificare pe http://freeex.activewatch.ro/admin/ sunt:<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t---------------------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t\t<p><table>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr><td width='30%'>Email: </td><td><strong>" . $loginEmail . "</strong></td></tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr><td width='30%'>Parola: </td><td><strong>" . $loginPass . "</strong></td></tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr><td width='30%'>URL: </td><td><a href=\"http://freeex.activewatch.ro/admin/\">http://freeex.activewatch.ro/admin/</td></tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</table></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t---------------------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t\t<p>Va puteti autentifica acum folosind datele de mai sus.</p>\n\t\t\t\t\t\t\t\t\t\t\t\t<p>Va multumim!</p>\n\t\t\t\t\t\t\t\t\t\t\t\t---------------------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t<p>Echipa Free Ex</p>";
        $articolHTML_font .= "</body></html>";
        $mail->html($articolHTML_font);
        $mail->send();
        echo '<p>Un email cu datele de acces a fost trimis la adresa completata de dvs. <br />
													 Verificati contul de email <strong>' . $sendToMail . '</strong> pentru datele de acces.<br /><br />Va multumim!</p>';
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    } else {
        // print registration form
        ?>
												<form method="post" id="detaliiForm" name="detaliiForm" enctype="multipart/form-data" action="forgot_pass.php?noheader=1">
													<input type="hidden" name="frefererf" value="<?php 
        echo $_SERVER['HTTP_REFERER'];
        ?>
" /><br />
                                                    Introduceti adresa de email cu care va autenficati in sistemul de administrare:
                                                    <br /><br />													
													<table cellpadding="2" cellspacing="2" border="0" class="w100">
示例#3
0
function sentmail($mailid, $msg, $sub)
{
    //mail('*****@*****.**', 'sendtestipn', 'sendtestipn');
    $html = true;
    $mail = new eMail("clubpedia@localhost", "*****@*****.**");
    $mail->subject($sub);
    $mail->to($mailid);
    // CC-Entf\E4nger angeben
    $mail->cc("*****@*****.**");
    // BCC-Entf\E4nger angeben
    $mail->bcc("*****@*****.**");
    $mail->html($msg);
    $mail->send();
}
示例#4
0
     $afficheNotification_sticky = array(0 => "true");
 }
 if ($rtn == "cancel_ballotage") {
     $afficheNotification_type = array(0 => "error");
     $afficheNotification_msg = array(0 => "L'échange que vous venez d'accepter ne peut pas être complétée, car un des joueurs impliqué dans l'échange est donné en retour d'un ballotage.");
     $afficheNotification_sticky = array(0 => "true");
 }
 if ($rtn == "approbation") {
     $afficheNotification_type = array(0 => "warning");
     $afficheNotification_msg = array(0 => "Tous les échanges sont sous approbation du commissaire. Ce dernier y donnera suite dans les prochaines heures.");
     $afficheNotification_sticky = array(0 => "true");
     // envoie d'un email aux admin du pool (et TOUJOURS moi...)
     require_once "class.mail.php";
     $email = new eMail($poolName, "{$poolName}@lamoria.ca");
     $email->subject("{$poolName} - Transaction en attente d'approbation");
     $email->html("Aller sur le site en Admin pour approuver/supprimer la transaction. http://www.{$poolName}.lamoria.ca");
     $email->to("*****@*****.**");
     $q = "select email from accounts\n                     where\n                         id_pool = {$id_pool}\n                         and saison_id = {$id_saison}\n                         and admin = 'Y'";
     $resultID = mysql_query($q, $pool->handle);
     while ($data = mysql_fetch_array($resultID, MYSQL_ASSOC)) {
         $emails = $data['email'];
         $emailA = explode(";", $emails);
         foreach ($emailA as $this_email) {
             if ($this_email == "") {
                 continue;
             }
             $email->to($this_email);
         }
     }
     $email->send();
     /*
示例#5
0
    foreach ($data2 as $item2A) {
        $id_gerant = $item2A['id'];
        $emails = $item2A['email'];
        $morning_email = $item2A['morning_email'];
        $realName = $item2A['real_name'];
        //if ($id_gerant != 13) continue;
        // 1ere adresse email seulement...
        $ar = split(";", $emails);
        $email = $ar[0];
        if ($morning_email == "Y") {
            $url = "http://www.lamoria.ca/interPool/src/morning_email.php?id_pool={$id_pool}&id_saison={$id_saison}&gerant={$id_gerant}&periode={$periode}&poolName={$poolName}";
            $lines = file($url);
            $body = "";
            foreach ($lines as $line) {
                $body .= "{$line}\n";
            }
            $url = "http://www.lamoria.ca/interPool/src/morning_email3.php?id_pool={$id_pool}&id_saison={$id_saison}&gerant={$id_gerant}&periode={$periode}&poolName={$poolName}";
            $lines = file($url);
            foreach ($lines as $line) {
                $body .= "{$line}\n";
            }
            $_email = new eMail(strtoupper($poolName), strtolower($poolName) . "@lamoria.ca");
            $_email->to($email);
            $_email->subject($subject);
            $_email->html($body);
            $_email->send();
        }
    }
    DB::dbClose();
}
unlink($SUCCESSFILE);