Пример #1
0
    public function executeUpdateRequestStatus(sfWebRequest $request)
    {
        $userId = $_SESSION['userId'];
        $stat = $_POST['stat'];
        $friendship_id = $_POST['friendship_id'];
        Friendship::updateRequestStatus($stat, $friendship_id);
        $q1 = Doctrine::getTable('Friendship')->findOneBy("id", $friendship_id);
        $q2 = Doctrine::getTable('Member')->findOneBy("id", $q1->member_id);
        $q3 = Doctrine::getTable('Member')->findOneBy("id", $userId);
        if ($stat == 2) {
            $body = '<div style="font-family:tahoma;font-size:12px;">
                    Hi <b>' . $q2->nick_name . '</b>,
                    <br/>
                    <p>
                        <b> ' . $q3->nick_name . ' </b> has added you as their friend!
                    </p>

                    <blockqoute>
                        <div>
                        You can log onto your account and send messages to each other at any time.
                        </div>
                    </blockqoute>
                    <br/>                    
                </div>';
        } else {
            $body = '<div style="font-family:tahoma;font-size:12px;">
                    Hi <b>' . $q2->nick_name . '</b>,
                    <br/>
                    <p>
                        <b> ' . $q3->nick_name . ' </b> has decided not to add you as their friend at this time.
                    </p>

                    <blockqoute>
                        <div>
                        Don’t let that discourage you.  Log onto your account and respond to or create your own postings and meet a new friend today.
                        </div>
                    </blockqoute>
                    <br/>                    
                </div>';
        }
        $recipient = $q2->email;
        CustomHangout::email($recipient, $body, 'HangOutToday', 'HangOutToday Notification');
        die;
    }
Пример #2
0
 public function executeForgotPassword(sfWebRequest $request)
 {
     $email_address = $_POST['email_'];
     $email_address = trim($email_address);
     if (!$this->checkEmailAddress($email_address)) {
         die('Please enter a valid email address!');
     }
     $member = Member::checkMemberInfo('email', $email_address);
     if ($member->count() > 0) {
         Member::resetPassword($email_address);
         $Body = " <div style='font-family:tahoma;font-size:12px;'>\n                <p>\n                     You have requested to reset your password. Below is your new password, you can login to your account and change the password.<br/>\n                     If you are not the account holder, please ignore this message.\n                     <br/>\n                     <br/>\n                     New Password : 123456                                          \n                </p>\n                </div>\n                  ";
         CustomHangout::email($email_address, $Body, 'HangOutToday', 'Request: Reset Password');
         die('An email notification has been sent to your email address.');
     } else {
         die('Email address entered does not exist!');
     }
 }
Пример #3
0
 public function executeSaveChanges(sfWebRequest $request)
 {
     try {
         $q = Postings::getPostingInfo($_REQUEST['posting_id']);
         $q->gender_type = $_REQUEST['gender_type'];
         $q->date_to_hangout = date("Y-m-d", strtotime($_REQUEST['startdt_hangout']));
         $q->num_ppl = $_REQUEST['num_ppl'];
         $q->posting_enddt = $this->calculatePostingEndDate($_REQUEST['posting_enddt'], $_REQUEST['starttime'], $_REQUEST['startdt_hangout']);
         $q->age_range_1 = $_REQUEST['age_range_1'];
         $q->age_range_2 = $_REQUEST['age_range_2'];
         $q->starttime = $_REQUEST['starttime'];
         $q->endtime = $_REQUEST['endtime'];
         $q->posting_title = $_REQUEST['posting_title'];
         $q->posting_desc = $_REQUEST['posting_desc'];
         $q->enddate_hangout = date("Y-m-d", strtotime($_REQUEST['enddt_hangout']));
         $q->save();
         $hotlistMembers = HotList::getHotListMembers($_REQUEST['posting_id'], $_SESSION['userId']);
         $Member = new Member();
         $Member->setId($_SESSION['userId']);
         $nick_name = $Member->getMemberInfo('nick_name');
         foreach ($hotlistMembers as $v) {
             $body = '
                 <div style="font-family:tahoma;font-size:12px;">
                     Hi <b>' . $v->getMember()->getNickName() . '</b>,
                     <br/><br/>
                     <p>
                         <b> ' . $nick_name . ' </b> has made some changes on a post with title "<b>' . $v->getPostings()->getPostingTitle() . '</b>".
                     </p>
                     <br/>
                     Thank you
                     <br/>                    
                 </div>';
             CustomHangout::email($v->getMember()->getEmail(), $body, 'HangOutToday', 'HangOutToday Notification');
         }
         die(true);
     } catch (Exception $e) {
         die(false);
     }
 }