HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/NVonken/mijneigenlied.com/wwwroot/Core/Components/contact.com.php
<?php

class contact
{
    var $_tpl;

    public static function Settings()
    {
        return array("Pageable" => true,
            "DisplayName" => "Contact",
            "Version" => 1.0,
            "HasAdmin" => false,
            "Filename" => "contact.com.php",
            "ContentOptions" => array("contact" => "Contact"),
            "AdminOptions" => array());
    }

    public function __construct()
    {
        $this->_tpl = new tpl();
    }

    public function Dependancies()
    {
        return array("js" => array(),
            "css" => array());
    }

    public function Run()
    {
        if ($_SERVER["REQUEST_METHOD"] == "POST") {
            $valid = true;
            $message = "";

            if (!isset($_POST["txtFirstname"]) || $_POST["txtFirstname"] == "") {
                $valid = false;
                $message = "U heeft geen voornaam ingevuld";
            }

            if (!isset($_POST["txtLastname"]) || $_POST["txtLastname"] == "") {
                $valid = false;
                $message = "U heeft geen achternaam ingevuld";
            }

            if (!isset($_POST["txtEmail"]) || $_POST["txtEmail"] == "") {
                $valid = false;
                $message = "U heeft geen e-mailadres ingevuld";
            } else {
                if (!General::ValidEmail($_POST["txtEmail"])) {
                    $valid = false;
                    $message = "U heeft geen geldig e-mailadres ingevuld";
                }
            }

            $this->_tpl->assign("txtFirstname", isset($_POST["txtFirstname"]) ? htmlspecialchars($_POST["txtFirstname"]) : "");
            $this->_tpl->assign("txtLastname", isset($_POST["txtLastname"]) ? htmlspecialchars($_POST["txtLastname"]) : "");
            $this->_tpl->assign("txtEmail", isset($_POST["txtEmail"]) ? htmlspecialchars($_POST["txtEmail"]) : "");
            $this->_tpl->assign("txtComment", isset($_POST["txtComment"]) ? htmlspecialchars($_POST["txtComment"]) : "");

            if (!isset($_POST["txtComment"]) || $_POST["txtComment"] == "") {
                $valid = false;
                $message = "U heeft geen vraag/opmerking ingevuld";
            }

            if ($valid) {
                $this->_tpl->assign("message", "Uw aanvraag is met succes verzonden");
                $this->_tpl->assign("message", $this->_tpl->parse("General/success"));

                unset($_POST);

                $htmlEmail = $this->_tpl->parse("Email/contact-request");
                General::Email("Er is een nieuw contact aanvraag gedaan door: " . $_POST["txtFirstname"] . " " . $_POST["txtLastname"] . ".", "info@snookistrimsalon.nl", $htmlEmail);
            } else {
                $this->_tpl->assign("message", $message);
                $this->_tpl->assign("message", $this->_tpl->Parse("General/error"));
            }

        }

        $this->_tpl->assign("txtFirstname", isset($_POST["txtFirstname"]) ? htmlspecialchars($_POST["txtFirstname"]) : "");
        $this->_tpl->assign("txtLastname", isset($_POST["txtLastname"]) ? htmlspecialchars($_POST["txtLastname"]) : "");
        $this->_tpl->assign("txtEmail", isset($_POST["txtEmail"]) ? htmlspecialchars($_POST["txtEmail"]) : "");
        $this->_tpl->assign("txtComment", isset($_POST["txtComment"]) ? htmlspecialchars($_POST["txtComment"]) : "");


        return $this->_tpl->Parse("Contact/overview");
    }
}

?>