summaryrefslogtreecommitdiff
path: root/template.email.php
blob: 9c764252c36762eb08db44148d31150aa5fe0f30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */
?>
<?php
/* vim: set ts=4 sw=4 et : */

require_once __DIR__ . "/check_auth.php";
require_once __DIR__ . "/../includes/common.php";
session_write_close();
require_once __DIR__ . "/lookup.php";
require_once __DIR__ . "/lookup_more.php";

(function () use ($mysqli) {
    global $eventID;

    $sql = "
SELECT
   email_templates.id AS ID,
   email_templates.*,
   email_templates_fav.tid AS etfav
FROM email_templates
LEFT JOIN email_templates_fav ON email_templates.id = email_templates_fav.tid AND email_templates_fav.userid = ?
WHERE email_templates.id=?
";
    $stmt = $mysqli->prepare($sql);
    $stmt->bind_param('ii', $_SESSION['auth_userid'], $_GET['id']);
    $stmt->execute();
    $r = $stmt->get_result();
    $l = $r->fetch_object();

    $_title = 'E-Mail-Template: "<span class="pii">' . $l->name . '</span>" (ID ' . $l->ID . ')';
    include_once __DIR__ . "/header.php";
?>

<h1 style="display: inline-block;"><?=$_title?></h1>

<?php
    $id = "emailtemplate";
    $def = [
        [4, '=3name~Name', '_ts'],
        [6, '+active~Aktiv', '+etfav~pers. Favorit <small>(' . $_SESSION['auth_user'] . ')</small>', '=4tags'],
        ['from', 'cc', 'bcc'],
        ['%subject'],
        ['*text'],
    ];
    $entrytable = "email_templates";

    include __DIR__ . '/autoform.php';
    $stmt->reset();
})();

include_once __DIR__ . "/footer.php";
?>