Source of: tutorial/login-news/news-add-v1.php (Download Source)
Last Modified: Fri, 16 Feb 2007 13:38:18 UTC

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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
    // ...
    case "add":
        if(!isset($_SESSION['titel'])) {
            $_SESSION['titel'] = "";
        }
        if(!isset($_SESSION['text'])) {
            $_SESSION['text'] = "";
        }
        if(!isset($_SESSION['links'])) {
            $_SESSION['links'] = array();
        }
        echo "<form ".
             "action=\"index.php?section=admin&amp;site=news&amp;action=add\" ".
             "method=\"post\" ".
             "class=\"formular\">\n";
        echo "    <p>\n";
        echo "        Neue News hinzufügen.\n";
        echo "    </p>\n";
        echo "    <ol>\n";
        echo "        <li>\n";
        echo "            Titel:\n";
        echo "            <ul>\n";
        echo "                <li>\n";
        echo $_SESSION['titel']."\n";
        echo "                </li>\n";
        echo "                <li>\n";
        echo "                    <input type=\"submit\" name=\"submit\" value=\"Titel bearbeiten\" />\n";
        echo "                </li>\n";
        echo "            </ul>\n";
        echo "        </li>\n";
        echo "        <li>\n";
        echo "            Text:\n";
        echo "            <ul>\n";
        echo "                <li>\n";
        echo nl2br($_SESSION['text'])."\n";
        echo "                </li>\n";
        echo "                <li>\n";
        echo "                    <input type=\"submit\" name=\"submit\" value=\"Text bearbeiten\" />\n";
        echo "                </li>\n";
        echo "            </ul>\n";
        echo "        </li>\n";
        echo "        <li>\n";
        echo "            Links zu den News:\n";
        echo "            <ul>\n";
        if(count($_SESSION['links'])) {
            foreach($_SESSION['links'] as $key => $value) {
                echo "<li>\n";
                echo "                <input type=\"checkbox\" name=\"link[]\" value=\"".$key."\" />\n";
                echo $value['beschreibung']."<br />\n";
                echo $value['link']."\n";
                echo "</li>\n";
            }
        } else {
            echo "<li>\n";
            echo "    Keine Links vorhanden\n";
            echo "</li>\n";
        }
        echo "                <li>\n";
        echo "                    <input type=\"submit\" name=\"submit\" value=\"Link hinzufügen\" />\n";
        if(count($_SESSION['links'])) {
            echo "<input type=\"submit\" name=\"submit\" value=\"Markierte Links löschen\" />\n";
        }
        echo "                </li>\n";
        echo "            </ul>\n";
        echo "        </li>\n";
        echo "        <li>\n";
        echo "                <input type=\"submit\" name=\"submit\" value=\"News hinzufügen\" />\n";
        echo "                <input type=\"reset\" name=\"submit\" value=\"Zurücksetzen\" />\n";
        echo "                <input type=\"hidden\" name=\"".session_name()."\" value=\"".session_id()."\" />\n";
        echo "        </li>\n";
        echo "    </ol>\n";
        echo "</form>\n";
        echo "<p>\n";
        echo "    <a href=\"index.php?section=admin&amp;".SID."\">\n";
        echo "        Zurück zum Adminbereich\n";
        echo "    </a>\n";
        echo "</p>\n";
        break;
    // ...
?>