function ajaxsportsrequestaccountAction()
 {
     if (!($sport = new FM_Components_Sports(array('id' => $_POST['orgId'])))) {
         print '0';
         exit;
     }
     //print_r($sport);
     $user = new FM_Components_Member(array('id' => $sport->getAdminId()));
     if ($user->getId()) {
         $headers = 'MIME-Version: 1.0' . "\r\n";
         $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
         $headers .= 'From: ' . $sport->getName() . ' administrator @ 4Monmouth.com' . "\r\n" . 'Reply-To: nobody@4monmouth.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
         mail($_POST['email'], 'Account Request For  ' . $sport->getName() . ' @ 4Monmouth.com', FM_Components_EmailFormatter::createAccountRequestLetter($_POST, $sport), $headers);
         mail($user->getEmail(), 'Account Request For  ' . $sport->getName() . ' @ 4Monmouth.com', FM_Components_EmailFormatter::createAdminAccountRequestLetter($_POST, $sport), $headers);
         //print_r($user->getEmail());
         print '1';
         exit;
     }
     print '0';
     exit;
 }
 public function ajaxupdatepwdAction()
 {
     if ($_POST) {
         $member = new FM_Components_Member(array('pwd' => $_POST['old']));
         if ($member && $member->getId()) {
             if (FM_Components_Member::update(array('id' => $member->getId()), array('pwd' => $_POST['newPwd']))) {
                 $headers = 'MIME-Version: 1.0' . "\r\n";
                 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                 $headers .= 'From: Password Admin @ 4Monmouth.com' . "\r\n" . 'Reply-To: nobody@4monmouth.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
                 mail($member->getEmail(), 'Password Change @ 4Monmouth.com', FM_Components_EmailFormatter::updatePasswordNoOrg($_POST), $headers);
                 print '1';
                 exit;
             }
         }
         print '2';
         exit;
     }
     print '0';
     exit;
 }
 public function ajaxcontactusAction()
 {
     if ($_POST) {
         if ($id = FM_Components_Email::insertEmail($_POST)) {
             $org = new FM_Components_Organization(array('id' => $_POST['orgId']));
             $user = new FM_Components_Member(array('id' => $org->getAdminId()));
             $headers = 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
             $headers .= 'From:' . $org->getName() . '  @ 4Monmouth.com' . "\r\n" . 'Reply-To: nobody@4monmouth.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
             //print $user->getEmail();
             mail($user->getEmail(), 'You recieved an email from your 4monmouth miniweb', FM_Components_EmailFormatter::contactUs($_POST), $headers);
             mail($_POST['email'], 'Your question has been submitted', FM_Components_EmailFormatter::contactUs($_POST), $headers);
             print 'Your email has been sent. You should expect a response within 24 - 48 hours.';
         } else {
             print 'Your email failed to send. Please try again';
         }
     }
     exit;
 }