96649f21ba18d07757afa9d98998f7a22c0d86a3
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) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 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) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) 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.
15) */
bernd Rudimentäres Newsletter-Arc...

bernd authored 13 years ago

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

Hanno authored 6 years ago

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

Hanno Böck authored 3 years ago

20)     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

21) }
22) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

Hanno Böck authored 3 years ago

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

Hanno authored 6 years ago

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

bernd authored 13 years ago

29) }
30) 
31) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

32) function get_latest_news()
33) {
34)     $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

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

Hanno authored 6 years ago

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

bernd authored 13 years ago

41) }
42) 
43) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

44) function get_news_item($id)
45) {
46)     $id = (int) $id;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

47)     $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

48)     $ret = $result->fetch();
49)     DEBUG($ret);
50)     return $ret;