dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
bernd Rudimentäres Newsletter-Arc...

bernd authored 13 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

5) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

10) 
11) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
12) */
bernd Rudimentäres Newsletter-Arc...

bernd authored 13 years ago

13) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

14) function set_newsletter_address($address)
15) {
16)     $cid = $_SESSION['customerinfo']['customerno'];
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

17)     db_query("UPDATE kundendaten.kunden SET email_newsletter=:address WHERE id=:cid", [":address" => $address, ":cid" => $cid]);
bernd Rudimentäres Newsletter-Arc...

bernd authored 13 years ago

18) }
19) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

20) function get_newsletter_address()
21) {
22)     $cid = $_SESSION['customerinfo']['customerno'];
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

23)     $result = db_query("SELECT email_newsletter FROM kundendaten.kunden WHERE id=?", [$cid]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

24)     $r = $result->fetch();
25)     return $r['email_newsletter'];
bernd Rudimentäres Newsletter-Arc...

bernd authored 13 years ago

26) }
27) 
28) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

29) function get_latest_news()
30) {
31)     $result = db_query("SELECT id, date, subject, content FROM misc.news WHERE date > CURDATE() - INTERVAL 2 YEAR ORDER BY date DESC");
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

32)     $ret = [];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

33)     while ($item = $result->fetch()) {
34)         $ret[] = $item;
35)     }
36)     DEBUG($ret);
37)     return $ret;
bernd Rudimentäres Newsletter-Arc...

bernd authored 13 years ago

38) }
39) 
40) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

41) function get_news_item($id)
42) {
43)     $id = (int) $id;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

44)     $result = db_query("SELECT date, subject, content FROM misc.news WHERE id=?", [$id]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

45)     $ret = $result->fetch();
46)     DEBUG($ret);
47)     return $ret;