コード例 #1
0
 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;
     }
 }