Example #1
0
function updstorder($idorder)
{
    global $modx, $shop_lang, $tsvshop;
    $user = $modx->userLoggedIn();
    $output = "";
    $output_sales_notice = "";
    $output_sales_error = "";
    $act = $_GET['act'];
    if ($user['usertype'] == "manager") {
        if (!empty($act) && $act == "updstorder" && !empty($idorder) && is_numeric(intval($idorder)) && $idorder != "0") {
            /*
            if (!empty($_GET['commentadmin'])) {
             $fields = array('status'       => $modx->db->escape($_GET['status']),
            		              'commentadmin' => $modx->db->escape($_GET['commentadmin'])
             );
            	          } else {
            	           $fields = array('status'       => $modx->db->escape($_GET['status']));
            	          }
            */
            //---v5.2rc2----
            $sysfielad = explode(',', $tsvshop['sysfields']);
            foreach ($_GET as $key => $value) {
                if (in_array($key, $sysfielad)) {
                    $fields[$key] = $modx->db->escape($value);
                }
            }
            //------
            updateMail($modx->db->escape($_GET['status']), $idorder);
            $result = $modx->db->update($fields, $tsvshop['dborders'], 'numorder = "' . intval($idorder) . '"');
            if ($result) {
                $status = explode("||", $tsvshop['StatusOrder']);
                foreach ($status as $tmp) {
                    $tmpstatus = explode("==", $tmp);
                    if ($_GET['status'] == $tmpstatus[0]) {
                        $color = $tmpstatus[1];
                    }
                }
                //Запускаем событие TSVshopOnOrderStatusUpdate
                $modx->invokeEvent("TSVshopOnOrderStatusUpdate", array("idorder" => $idorder, "newstatus" => $modx->db->escape($_GET['status'])));
                return $idorder . "||" . $color . "||success";
            } else {
                return $idorder . "||" . $color . "||error";
            }
        }
    }
}
Example #2
0
         }
     }
 }
 // EDITMAIL-Formular
 if (isset($do) && $do === 'editmail') {
     if (isset($_POST['user_mail']) && !empty($_POST['user_mail'])) {
         $mail = filter_input(INPUT_POST, 'user_mail', FILTER_VALIDATE_EMAIL);
         if (!$mail) {
             // Fehlernachricht, dem Fehlerarray hinzugefügt
             // dafür assoziativen Index "email" gesetzt (zur Zuordnung)
             $error['email'] = 'Dies ist keine gültige E-Mail Adresse.';
         }
         // Abfragen, ob das Fehlerarray leer ist...
         if (empty($error)) {
             // ... wenn ja geht es hier weiter (Keine Fehler!)
             $result = updateMail($db, $_SESSION['user_id'], $mail);
             // Prüfen, ob Ergebnis positiv oder negativ
             if ($result) {
                 // Erfolgsfall
                 $output = 'E-Mail Adresse geändert.';
             } else {
                 // Fehlerfall
                 $output = 'E-Mail Adresse konnte nicht geändert werden.';
             }
         } else {
             // Es ist mind. 1 Fehler aufgetreten!
             $output = $error['email'];
         }
     }
 }
 $userData = getUserData($_SESSION['user_name'], $db);
Example #3
0
    }
}
// *** save use mail template ***
if (isset($_POST['use'])) {
    if (isset($_POST['use'])) {
        $data['mailid'] = $_POST['maillist'];
        if (updateUseMail($data, $db)) {
            header("location: " . ROOT . "admin/mail_create.php");
            exit;
        }
    }
}
if (isset($_POST['mailsetup'])) {
    if (empty($_POST['mailTO'])) {
        header("location: " . ROOT . "admin/mail_setup.php");
        exit;
    }
    $mailTO = empty($_POST['mailTO']) ? "" : implode(":", $_POST['mailTO']);
    $mailCC = empty($_POST['mailCC']) ? "" : implode(":", $_POST['mailCC']);
    $mailBCC = empty($_POST['mailBCC']) ? "" : implode(":", $_POST['mailBCC']);
    $data['mailid'] = trim($_POST['mailid']);
    $data['mailto'] = $mailTO;
    $data['mailcc'] = $mailCC;
    $data['mailbcc'] = $mailBCC;
    if (!updateMail($data, $db)) {
        header("location: " . ROOT . "error.html");
        exit;
    }
}
$getMailList = getMailList($db);
$getMailListAll = getMailListAll($db);
Example #4
0
            $correo->Subject = "{$recipent}";
            $correo->Body = "{$content}";
            $correo->AddAttachment("images/phpmailer.gif");
            if (!$correo->Send()) {
                echo "Hubo un error: " . $correo->ErrorInfo;
            } else {
                echo "Mensaje enviado con exito. ";
                updateMail($id_mail);
            }
        }
    } else {
        ###
        $correo->AddAddress("{$issue}", "");
        $correo->Subject = "{$recipent}";
        $correo->Body = "{$content}";
        $correo->AddAttachment("images/phpmailer.gif");
        if (!$correo->Send()) {
            echo "Hubo un error: " . $correo->ErrorInfo;
        } else {
            echo "Mensaje enviado con exito. ";
            updateMail($id_mail);
        }
    }
    ##
    $i++;
}
function updateMail($id)
{
    $sentencia = "update mail set state='sent'\n  where id_mail=" . $id . "";
    $result = mysql_query($sentencia);
}