From: <ex...@us...> - 2013-05-10 11:22:47
|
Revision: 5906 http://sourceforge.net/p/web-erp/reponame/5906 Author: exsonqu Date: 2013-05-10 11:22:44 +0000 (Fri, 10 May 2013) Log Message: ----------- 10/5/2013 Exson: Add GetMailList function in MiscFunctions.php. Modified Paths: -------------- trunk/includes/MiscFunctions.php Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2013-05-10 11:20:30 UTC (rev 5905) +++ trunk/includes/MiscFunctions.php 2013-05-10 11:22:44 UTC (rev 5906) @@ -420,5 +420,22 @@ return $result; } +function GetMailList($Recipients){ + global $db; + $ToList = array(); + $sql = "SELECT email,realname FROM mailgroupdetails INNER JOIN www_users ON www_users.userid=mailgroupdetails.userid WHERE mailgroupdetails.groupname='".$Recipients."'"; + $ErrMsg = _('Failed to retrieve mail lists'); + $result = DB_query($sql,$db,$ErrMsg); + if(DB_num_rows($result) != 0){ + + //Create the string which meets the Recipients requirements + while($myrow = DB_fetch_array($result)){ + $ToList[]= $myrow['realname'].'<'.$myrow['email'].'>'; + } + + } + return $ToList; +} + ?> |