2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2009 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
14 $_user_location = 'public';
16 define('AT_INCLUDE_PATH', '../../../../include/');
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 require(AT_SOCIAL_INCLUDE.'constants.inc.php');
19 require(AT_SOCIAL_INCLUDE.'friends.inc.php');
20 require(AT_SOCIAL_INCLUDE.'classes/SocialGroups/SocialGroup.class.php');
21 require(AT_SOCIAL_INCLUDE.'classes/SocialGroups/SocialGroups.class.php');
22 $_custom_css = $_base_path . AT_SOCIAL_BASENAME . 'module.css'; // use a custom stylesheet
25 $gid = intval($_REQUEST['id']);
26 $group_obj = new SocialGroup($gid);
29 if (isset($_POST['inviteMember']) && isset($_POST['new_members'])){
30 // debug($_POST['new_members']);
31 //add to request table
32 foreach ($_POST['new_members'] as $k=>$v){
35 $sql_notify = "SELECT first_name, last_name, email FROM ".TABLE_PREFIX."members WHERE member_id=$k";
36 $result_notify = mysql_query($sql_notify, $db);
37 $row_notify = mysql_fetch_assoc($result_notify);
39 if ($row_notify['email'] != '') {
40 require(AT_INCLUDE_PATH . 'classes/phpmailer/atutormailer.class.php');
41 $body = _AT('notification_group_invite', get_display_name($_SESSION['member_id']),$group_obj->getName() , $_base_href.AT_SOCIAL_BASENAME.'index_mystart.php');
42 $sender = get_display_name($_SESSION['member_id']);
43 $mail = new ATutorMailer;
44 $mail->AddAddress($row_notify['email'], $sender);
45 $mail->FromName = $_config['site_name'];
46 $mail->From = $_config['contact_email'];
47 $mail->Subject = _AT('group_invitation');
51 $msg->addError('SENDING_ERROR');
55 //TODO, move the following function from friends.inc.php to the SocialGroup.class object
56 addGroupInvitation($k, $gid);
59 $msg->addFeedback('INVITATION_SENT');
63 include(AT_INCLUDE_PATH.'header.inc.php');
64 $savant->display('social/pubmenu.tmpl.php');
65 $savant->assign('group_obj', $group_obj);
66 $savant->display('social/sgroup_invite.tmpl.php');
67 include(AT_INCLUDE_PATH.'footer.inc.php');