コード例 #1
0
 public function ajaxaddtestimonialAction()
 {
     if ($_POST) {
         if ($_POST['edit'] > 0) {
             if (FM_Components_Util_Testimonial::editTestimonial(array('id' => $_POST['edit']), $_POST)) {
                 print '1';
             } else {
                 print '0';
             }
         } else {
             if (FM_Components_Util_Testimonial::insertTestimonial($_POST)) {
                 $org = new FM_Components_Organization(array('id' => $_POST['orgId']));
                 $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();
                 mail($_POST['from'], 'Your review has been submitted', FM_Components_EmailFormatter::reviewEmail($_POST), $headers);
                 mail($org->getEmail(), 'A review has been submitted', FM_Components_EmailFormatter::reviewEmailAdmin($_POST), $headers);
                 print '1';
             } else {
                 print '0';
             }
         }
     } else {
         print '0';
     }
     exit;
 }