Exemplo n.º 1
0
    $dvd->author = htmlspecialchars($data['author']);
    $dvd->email = htmlspecialchars($data['email']);
    $dvd->publishDate = empty($data['publishDate']) ? null : $data['publishDate'];
    $dvd->deadlineDate = empty($data['deadlineDate']) ? null : $data['deadlineDate'];
    $dvd->description = empty($data['description']) ? null : htmlspecialchars($data['description']);
    if (!empty($data['status']) && $data['status'] == 'active') {
        $dvd->status = 1;
    } else {
        $dvd->status = 0;
    }
    if (!empty($data['showFrontpage']) && $data['showFrontpage'] == 'show') {
        $dvd->showFrontpage = 1;
    } else {
        $dvd->showFrontpage = 0;
    }
    $adminUrl = $dvd->create();
    if (empty($adminUrl)) {
        die('Virhe luodessa DVD:tä.');
    }
    // Send the admin link via email
    $link = SITE_URL . '/' . $dvd->id . '/' . $dvd->publicUrl . '/' . $dvd->adminHash;
    $to = $dvd->email;
    $subject = 'xqDVD:si ylläpitolinkki';
    $message = '
<html> 
<head> 
<title>xqDVD:si ylläpitolinkki</title> 
</head> 
<body> 
xqDVD:si ylläpitolinkki on <a href="' . $link . '">' . $link . '</a> 
</body>