Ejemplo n.º 1
0
Archivo: aaa.php Proyecto: ram-1501/rs
         MultiSession::logoutUser();
         echo $api->changePassword();
     }
     break;
 case 'sendChartToMail':
     if (isset($_POST['mails']) && trim($_POST['mails']) != '' && isset($_POST['elem']) && isset($_POST['note']) && isset($_POST['svg_w']) && isset($_POST['svg_h'])) {
         $message = $_POST['elem'];
         $note = $_POST['note'];
         $width = intval($_POST['svg_w']);
         $height = intval($_POST['svg_h']);
         try {
             if ($_POST['send_all'] == "true") {
                 $message = $api->svgToPDF($message, $width, $height);
                 $type = "pdf";
             } else {
                 $message = $api->svgToPng($message, $width, $height);
                 $type = "png";
             }
         } catch (Exception $e) {
             echo "Internal error while attempting to generate graph image";
         }
         if (strpos($_POST['mails'], ",")) {
             $mails = explode(",", $_POST['mails']);
             $incorrectMails = 0;
             foreach ($mails as $mail) {
                 if (!filter_var(trim($mail), FILTER_VALIDATE_EMAIL)) {
                     $incorrectMails++;
                 }
             }
             if ($incorrectMails >= 1) {
                 echo "Your email was not sent. Please check the email address and try again. Use a comma to separate multiple email addresses.";