presse, donate saimod & parameters, beta code count, maintaince

This commit is contained in:
Ulf Gebhardt 2018-05-23 13:10:15 +02:00
parent abcc1aa969
commit 6c8af84d02
33 changed files with 386 additions and 170 deletions

View File

@ -1,19 +1,30 @@
<?php
namespace WEBCRAFT;
function democracy_deutschland_config(){
return array( array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING, E_ALL | E_STRICT),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL, 'https://test.webcraft-media.de/democracy_deutschland/'),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH, '/home/web/web/test/democracy_deutschland/'),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE, \SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE_MYS),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST, '127.0.0.1'),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT, ''),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER, 'db_user'),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD, 'db_pw'),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME, 'db_name'),
array(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT, 'democracy_deutschland'),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL, 'lib/system/'),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_CACHE, '/home/web/web/test/democracy_deutschland/democracy/files/cache/'),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS, array('deDE')),
array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG, 'deDE'),
array(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH, '/home/web/web/log/democracy_deutschland/'));
return array( array(\config_ids::SYS_CONFIG_ERRORREPORTING, E_ALL | E_STRICT),
array(\config_ids::SYS_CONFIG_PATH_BASEURL, 'https://test.webcraft-media.de/democracy_deutschland/'),
array(\config_ids::SYS_CONFIG_PATH_BASEPATH, '/home/web/web/test/democracy_deutschland/'),
array(\config_ids::SYS_CONFIG_DB_TYPE, \SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE_MYS),
array(\config_ids::SYS_CONFIG_DB_HOST, '127.0.0.1'),
array(\config_ids::SYS_CONFIG_DB_PORT, ''),
array(\config_ids::SYS_CONFIG_DB_USER, 'db_user'),
array(\config_ids::SYS_CONFIG_DB_PASSWORD, 'db_pw'),
array(\config_ids::SYS_CONFIG_DB_DBNAME, 'db_name'),
array(\config_ids::SYS_SAI_CONFIG_PROJECT, 'democracy_deutschland'),
array(\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL, 'lib/system/'),
array(\config_ids::SYS_CONFIG_PATH_CACHE, '/home/web/web/test/democracy_deutschland/democracy/files/cache/'),
array(\config_ids::SYS_CONFIG_LANGS, array('deDE')),
array(\config_ids::SYS_CONFIG_DEFAULT_LANG, 'deDE'),
array(\config_ids::SYS_CRON_LOG2SQLITE_PATH, '/home/web/web/log/democracy_deutschland/'),
array(\config_ids::DEMOCRACY_EMAIL_PROTOTYPING, array( "host" => "",
"port" => 465,
"auth" => true,
"username" => "",
"password" => "")),
array(\config_ids::DEMOCRACY_EMAIL_CONTACT, array( "host" => "",
"port" => 465,
"auth" => true,
"username" => "",
"password" => ""))
);
}

View File

@ -1,34 +1,48 @@
<?php
class api_democracy extends \SYSTEM\API\api_system {
public static function call_send_mail($data){
/*$tbody = array_reduce($data, function($a, $b){return $a.="<tr><td>".implode("</td><td>",$b)."</td></tr>";});
$thead = "<tr><th>" . implode("</th><th>", array_keys($rows[0])) . "</th></tr>";
$new_data = "<table>\n$thead\n$tbody\n</table>";*/
if(array_key_exists('files', $data)){
$data['files'] = json_decode($data['files']);}
$new_data = str_replace('\/', '/',json_encode($data,JSON_PRETTY_PRINT));
//SendMail
private static function mailcannon($from,$subject,$html_file,$text_file,$to,$images,$replacements,$smtp){
$bcc = null;
$delay = 0;
$from = 'Website | DEMOCRACY <contact@democracy-deutschland.de>';
$subject = '📱 DEMOCRACY: EMail from democracy-deutschland.de';
$silent = true;
$unsubscribe_list = null;
$attachments = [];
\mailcannon::fire( $bcc,
$delay,
$from,
$subject,
$html_file,
$text_file,
$to,
$unsubscribe_list,
$images,
$attachments,
$replacements,
$smtp,
$silent);
}
public static function call_send_mail($data){
if(array_key_exists('files', $data)){
$data['files'] = json_decode($data['files']);}
$data_json = str_replace('\/', '/',json_encode($data,JSON_PRETTY_PRINT));
//SendMail
$from = 'Website | DEMOCRACY <'.(array_key_exists('email',$data) ? $data['email'] : 'contact@democracy-deutschland.de').'>';
$to = 'contact@democracy-deutschland.de';
//$to = 'ulf.gebhardt@webcraft-media.de';
$subject = '📱 DEMOCRACY Website: '.((array_key_exists('type',$data) && array_key_exists('email',$data)) ? $data['type'].' from '.$data['email'] : 'EMail from democracy-deutschland.de');
$html_file = (new \PAPI('tpl/send_mail.tpl'))->SERVERPATH();
$text_file = (new \PAPI('tpl/send_mail.txt'))->SERVERPATH();
$to = 'contact@democracy-deutschland.de';
$unsubscribe_list = null;
$replacements = [ 'data_json' => ['value' => ['text' => $data_json]],
'type' => ['value' => ['text' => array_key_exists('type',$data) ? $data['type'] : 'No Type given']],
'email' => ['value' => ['text' => array_key_exists('email',$data) ? $data['email'] : 'No EMail given']],
'name' => ['value' => ['text' => array_key_exists('name',$data) ? $data['name'] :
(array_key_exists('vorname',$data) && array_key_exists('nachname',$data)) ?
$data['vorname'].' '.$data['nachname'] : 'No Name given']],
'text' => ['value' => ['text' => array_key_exists('text',$data) ? $data['text'] : 'No Text given']]];
$images = ["democracy_logo" => (new \PAPI('img/logo.png'))->SERVERPATH()];
$attachments = [];
$replacements = ['data' => ['value' => ['text' => $new_data]]];
$smtp = [ "host" => "ssl://atmanspacher.eu",
"port" => 465,
"auth" => true,
"username" => "prototyping@democracy-deutschland.de",
"password" => "7$7ar0pZ"
];
$silent = true;
\mailcannon::fire($bcc, $delay, $from, $subject, $html_file, $text_file, $to, $unsubscribe_list, $images, $attachments, $replacements,$smtp, $silent);
$smtp = \SYSTEM\CONFIG\config::get(\config_ids::DEMOCRACY_EMAIL_CONTACT);
self::mailcannon($from,$subject,$html_file,$text_file,$to,$images,$replacements,$smtp);
return \SYSTEM\LOG\JsonResult::ok();
}
@ -121,12 +135,7 @@ class api_democracy extends \SYSTEM\API\api_system {
$images = ["democracy_logo" => (new \PAPI('img/logo.png'))->SERVERPATH()];
$attachments = [];
$replacements = [];
$smtp = [ "host" => "ssl://atmanspacher.eu",
"port" => 465,
"auth" => true,
"username" => "prototyping@democracy-deutschland.de",
"password" => "7$7ar0pZ"
];
$smtp = \SYSTEM\CONFIG\config::get(\config_ids::DEMOCRACY_EMAIL_PROTOTYPING);
$silent = true;
\mailcannon::fire($bcc, $delay, $from, $subject, $html_file, $text_file, $to, $unsubscribe_list, $images, $attachments, $replacements,$smtp, $silent);

View File

@ -0,0 +1,9 @@
<?php
namespace SQL;
class BETA_CODES_COUNT extends \SYSTEM\DB\QQ {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT COUNT(code) as count FROM beta_code;';
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace SQL;
class BETA_COUNT extends \SYSTEM\DB\QQ {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT COUNT(redeemedAt) as count, COUNT(redeemedAt) - COUNT(storedAt) as store FROM beta;';
}
}

View File

@ -1,7 +1,52 @@
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
Eine Nachricht ist über die Website eingegangen:<br>
<br>
<pre>${data}</pre>
<h3>Type: ${type}</h3>
<table>
<tr>
<th>EMail</th>
<td><a href="mailto:${email}">${email}<a></td>
</tr>
<tr>
<th>Name</th>
<td>${name}</td>
</tr>
<tr>
<th>Type</th>
<td>${type}</td>
</tr>
<tr>
<th>Text</th>
<td><pre>${text}</pre></td>
</tr>
</table>
<h3>Raw Data:</h3>
<pre>${data_json}</pre>
<br>
Achtung: Diese EMail ist die einzige Kopie dieser Daten<br>
<br>
<span><img src="cid:democracy_logo"></span>
<div class="footer" style="margin-top: 3em; padding-top: 1em; border-top-width: 2px; border-top-color: #4494d3; border-top-style: solid;">
<p style="max-width: 35rem;">
Wir sind gespannt, welche großartigen Möglichkeiten in der Zukunft noch für unser Projekt offen stehen und verbleiben mit einem Lächeln und ganz herzlichen Grüßen,
</p>
<p style="max-width: 35rem;">
Ihr TEAM DEMOCRACY
</p>
<img class="logo" alt="DEMOCRACY Logo" src="cid:democracy_logo" style="height: auto; line-height: 100%; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: 0 none;" />
<p style="max-width: 35rem;">
DEMOCRACY Deutschland e.V.<br />
mobil +49 176 470 40 213<br />
<a href="mailto:contact@democracy-deutschland.de" style="color: #4f81bd; font-weight: bold;">
contact@democracy-deutschland.de
</a><br />
<a href="https://www.democracy-deutschland.de" style="color: #4f81bd; font-weight: bold;">
https://www.democracy-deutschland.de
</a><br />
<a href="https://github.com/demokratie-live/" style="color: #4f81bd; font-weight: bold;">
https://github.com/demokratie-live
</a>
</p>
</div>

View File

@ -1,5 +1,5 @@
Eine Nachricht ist über die Website eingegangen:
${data}
${data_json}
Achtung: Diese EMail ist die einzige Kopie dieser Daten

View File

@ -4,4 +4,5 @@ require_once dirname(__FILE__).'/page/autoload.inc';
require_once dirname(__FILE__).'/files/autoload.inc';
require_once dirname(__FILE__).'/api/autoload.inc';
require_once dirname(__FILE__).'/sql/autoload.inc';
require_once dirname(__FILE__).'/sai/autoload.inc';
require_once dirname(__FILE__).'/sai/autoload.inc';
require_once dirname(__FILE__).'/config/autoload.inc';

View File

@ -0,0 +1,2 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');

View File

@ -0,0 +1,5 @@
<?php
class config_ids extends \SYSTEM\CONFIG\config_ids {
const DEMOCRACY_EMAIL_PROTOTYPING = 1100;
const DEMOCRACY_EMAIL_CONTACT = 1101;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

View File

@ -8,13 +8,19 @@ class default_donate implements SYSTEM\PAGE\Page {
return array();}// new PPAGE('default_donate/js/default_donate.js'));}
public static function css(){
return array();}// new PPAGE('default_donate/css/default_donate.css'));}
public static function donate_box(){
$vars = \SYSTEM\PAGE\text::tag('donation');
//Donations
/*$vars['donation_paten'] = 9;
$vars['donation_value'] = 61;
$vars['donation_date'] = '14.05.2018 * 18:45 Uhr';*/
$vars['donation_percentage'] = round($vars['donation_value']/100,0);
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_donate/tpl/donate_box.tpl'))->SERVERPATH(), $vars);
}
public function html(){
$vars = array();
//Donations
$vars['donation_paten'] = 7;
$vars['donation_value'] = 55;
$vars['donation_date'] = '14.05.2018 * 18:45 Uhr';
$vars['donation_percentage'] = round($vars['donation_value']/100,0);
//donate box
$vars['donate_box'] = self::donate_box();
//team
$vars['team'] = '';
$team = array( array( 'name' => 'Marius Krüger', 'text' => 'Mädchen für alles<br>Initiator & UI', 'img' => './files/wir/marius_krueger.jpg', 'aktiv' => 'lightgreen',

View File

@ -9,81 +9,7 @@
</div>
<div class="row" style="padding-top: 50px;">
<div class="col-lg-4">
<div style="width: 100%; margin-left: auto; margin-right: auto;">
<style>
progress {
height: 2.5em;
width: 100%;
-webkit-appearance: none;
border: none;
/* Set the progressbar to relative */
position:relative;
}
progress:before {
content: attr(data-label);
font-size: 0.8em;
font-weight: bold;
line-height: 3.3em;
padding-left: 15px;
vertical-align: central;
/*Position text over the progress bar */
position:absolute;
left:0;
right:0;
}
progress::-webkit-progress-bar {
background-color: #f6f6f6;
}
progress::-webkit-progress-value {
background-color: #7cc4ff;
background: repeating-linear-gradient(
45deg,
#3D87C1,
#3D87C1 10px,
#4494D3 10px,
#4494D3 20px
);
}
progress::-moz-progress-bar {
background-color: #f6f6f6;
}
#donate_init_text{
text-align: left;
padding-left: 50px;
}
.w3_agileits_team_grid{
margin-top: 50px;
}
@media (max-width: 575px){
#donate_init_text{
padding-left: 15px;
padding-top: 50px;
}
#donate-box{
padding-top: 50px;
}
}
</style>
<progress max="100" value="${donation_percentage}" data-label="${donation_percentage}% von 10.000€ GESCHAFFT!"></progress>
<div style="border-top: solid 3px #4494D3; margin-top: 5px; background-color: #f6f6f6; text-align: center;">
<span style="display:block; font-weight: bold; padding-top: 20px;">
<span style="font-size: x-large; color: #333">${donation_paten} VON 2.000</span>
</span>
<span style="display:block; font-size: large; font-weight: normal; color: #6a666b; padding-bottom: 15px;">PATENSCHAFTEN ERREICHT!</span>
<hr>
<span style="display:block; font-weight: bold; padding-top: 15px;">
<span style="font-size: larger; color: #333">${donation_value}€ von 10.000€</span>
</span>
<span style="display:block; font-size: medium; font-weight: normal; color: #6a666b;">(min. Finanzierungsziel/Monat)</span>
<span style="display:block; font-size: small; font-weight: normal; color: #6a666b;">Stand: ${donation_date}</span>
<img style="padding: 35px; height: 200px;" src="./files/images/Bubble.png" alt="DEMOCRACY Logo"/>
<!--<div style="background-color: #4494D3; font-size: x-large; height: 2.0em; line-height: 2.0em; cursor: pointer;" onclick="$('html,body').animate({scrollTop: $('#donate').offset().top},'slow');">
<i class="fa fa-heart"></i>&nbsp;JETZT PATE WERDEN!
</div>-->
</div>
</div>
${donate_box}
</div>
<div class="col-lg-8" id="donate_init_text">
<span> DEMOCRACY Deutschland e.V. ist ein gemeinnütziger Verein, der mit seiner

View File

@ -0,0 +1,75 @@
<div style="width: 100%; margin-left: auto; margin-right: auto;">
<style>
progress {
height: 2.5em;
width: 100%;
-webkit-appearance: none;
border: none;
/* Set the progressbar to relative */
position:relative;
}
progress:before {
content: attr(data-label);
font-size: 0.8em;
font-weight: bold;
line-height: 3.3em;
padding-left: 15px;
vertical-align: central;
/*Position text over the progress bar */
position:absolute;
left:0;
right:0;
}
progress::-webkit-progress-bar {
background-color: #f6f6f6;
}
progress::-webkit-progress-value {
background-color: #7cc4ff;
background: repeating-linear-gradient(
45deg,
#3D87C1,
#3D87C1 10px,
#4494D3 10px,
#4494D3 20px
);
}
progress::-moz-progress-bar {
background-color: #f6f6f6;
}
#donate_init_text{
text-align: left;
padding-left: 50px;
}
.w3_agileits_team_grid{
margin-top: 50px;
}
@media (max-width: 575px){
#donate_init_text{
padding-left: 15px;
padding-top: 50px;
}
#donate-box{
padding-top: 50px;
}
}
</style>
<progress max="100" value="${donation_percentage}" data-label="${donation_percentage}% von 10.000€ GESCHAFFT!"></progress>
<div style="border-top: solid 3px #4494D3; margin-top: 5px; background-color: #f6f6f6; text-align: center;">
<span style="display:block; font-weight: bold; padding-top: 20px;">
<span style="font-size: x-large; color: #333">${donation_paten} VON 2.000</span>
</span>
<span style="display:block; font-size: large; font-weight: normal; color: #6a666b; padding-bottom: 15px;">PATENSCHAFTEN ERREICHT!</span>
<hr>
<span style="display:block; font-weight: bold; padding-top: 15px;">
<span style="font-size: larger; color: #333">${donation_value}€ von 10.000€</span>
</span>
<span style="display:block; font-size: medium; font-weight: normal; color: #6a666b;">(min. Finanzierungsziel/Monat)</span>
<span style="display:block; font-size: small; font-weight: normal; color: #6a666b;">Stand: ${donation_date}</span>
<img style="padding: 35px; height: 200px;" src="./files/images/Bubble.png" alt="DEMOCRACY Logo"/>
<!--<div style="background-color: #4494D3; font-size: x-large; height: 2.0em; line-height: 2.0em; cursor: pointer;" onclick="$('html,body').animate({scrollTop: $('#donate').offset().top},'slow');">
<i class="fa fa-heart"></i>&nbsp;JETZT PATE WERDEN!
</div>-->
</div>
</div>

View File

@ -85,7 +85,19 @@ class default_press implements SYSTEM\PAGE\Page {
'title' => 'DEMOCRACY LOGO'),
array( 'link' => './files/download/Logo_with_sublines_2.png',
'img' => './files/download/Logo_with_sublines_2.png',
'title' => 'DEMOCRACY Logo quer')
'title' => 'DEMOCRACY Logo quer'),
array( 'link' => './files/download/Funktionen.png',
'img' => './files/download/Funktionen.png',
'title' => 'DEMOCRACY Funktionsgrafik'),
array( 'link' => './files/download/Hello.png',
'img' => './files/download/Hello.png',
'title' => 'DEMOCRACY Beta Schleife'),
array( 'link' => './files/download/PM.png',
'img' => './files/download/PM.png',
'title' => 'DEMOCRACY Beta Invite'),
array( 'link' => './files/download/offenes_Parlament.jpg',
'img' => './files/download/offenes_Parlament.jpg',
'title' => 'DEMOCRACY offenes Parlament'),
);
$result = '';
foreach($media as $m) {
@ -94,7 +106,13 @@ class default_press implements SYSTEM\PAGE\Page {
return $result;
}
private static function articles(){
$articles = array( array( 'img' => './files/medien/Stadt_Land.png',
$articles = array( array( 'img' => './files/medien/NuoViso_Talk.png',
'link' => 'https://www.youtube.com/watch?v=1Et7S8pi8zY',
'title' => 'NuoViso.tv - "Democracy" - Volksabstimmung per Handy - Marius Krüger im NuoViso Talk'),
array( 'img' => './files/medien/audiopreneur.png',
'link' => 'https://audiopreneur.de/34-ap-democracy-deutschland-die-app-fuer-mehr-demokratie/',
'title' => 'AudioPreneur Podcast - DEMOCRACY Deutschland die App für mehr Demokratie'),
array( 'img' => './files/medien/Stadt_Land.png',
'link' => 'http://ng.infranken.de/epaper/EPaper/PHP-Files/showclust.php?Ref=DText%2F94mvlhvqjm5-m4ssvjtetac&PageRef=DSArchiv%2Fg3~xgnu8amvnb567ftilydq&Clip=47%2C43%2C905%2C417&titel=bs&Spezial=&Display=print',
'title' => 'In Franken - Politische Mitspache bald per App?'),
array( 'img' => './files/medien/Startalp.png',

View File

@ -1,2 +1,3 @@
<?php
require_once dirname(__FILE__).'/saimod_beta/autoload.inc';
require_once dirname(__FILE__).'/saimod_beta/autoload.inc';
require_once dirname(__FILE__).'/saimod_donate/autoload.inc';

View File

@ -23,8 +23,12 @@ function init_saimod_beta_code() {
action: 'generate',
comment: comment
},
success: function(){
system.reload();
success: function(data){
if(data.status){
system.reload();
} else {
alert('Something happend - try again!');
}
},
error: function(){
alert('Something happend - try again!');
@ -153,38 +157,6 @@ function init_saimod_beta_store_ios() {
});
email_delete();
};
/* function init_saimod_beta_mail() {
$("#table_beta_mail").tablesorter();
$('#tabs_beta li a').each(function(){
$(this).removeClass('active');});
$('#menu_tag_mail').addClass('active');
$('.beta_mail').click(function(){
var email = $(this).attr('email');
var android = $(this).attr('android');
var ios = $(this).attr('ios');
$.ajax({
async: true,
url: this.endpoint,
type: 'GET',
dataType: 'JSON',
data: {
sai_mod: '.SAI.saimod_beta',
action: 'email',
email: email,
android: android,
ios: ios
},
success: function(){
system.reload();
},
error: function(){
alert('Something happend - try again!');
}
});
});
email_delete();
}; */
function email_delete(){
$('.email_delete').click(function(){
if (confirm('Are you sure you want to delete this user PERMANENTLY?')) {

View File

@ -54,6 +54,10 @@ class saimod_beta extends \SYSTEM\SAI\sai_module{
public static function sai_mod__SAI_saimod_beta_action_code(){
$vars = array();
$vars['code_count'] = \SQL\BETA_CODES_COUNT::Q1()['count'];
$beta_count = \SQL\BETA_COUNT::Q1();
$vars['redeemed_count'] = $beta_count['count'];
$vars['stored_count'] = $beta_count['store'];
$vars['data'] = '';
$beta = \SQL\BETA_CODES_FIND::QQ();

View File

@ -20,6 +20,15 @@
<th>Action</th>
</tr>
</thead>
<tbody>${data}</tbody>
<tbody>
<tr>
<th>Count</th>
<th>${code_count}</th>
<th>${redeemed_count} (${stored_count})</th>
<td></td>
<td></td>
</tr>
${data}
</tbody>
</table>
</div>

View File

@ -0,0 +1,4 @@
<?php
require_once dirname(__FILE__).'/sql/autoload.inc';
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SAI');
\SYSTEM\SAI\sai::register('\SAI\saimod_donate');

View File

@ -0,0 +1,28 @@
function init_saimod_donate() {
$('#donate-update').click(function(){
var paten = $('#donate-paten').val();
var value = $('#donate-value').val();
$.ajax({
async: true,
url: this.endpoint,
type: 'GET',
dataType: 'JSON',
data: {
sai_mod: '.SAI.saimod_donate',
action: 'update',
paten: paten,
value: value
},
success: function(data){
if(data.status){
system.reload();
} else {
alert('Something happend - try again!');
}
},
error: function(){
alert('Something happend - try again!');
}
});
});
};

View File

@ -0,0 +1,26 @@
<?php
namespace SAI;
class saimod_donate extends \SYSTEM\SAI\sai_module{
public static function sai_mod__SAI_saimod_donate(){
$vars = \SYSTEM\PAGE\text::tag('donation');
$vars['donate_box'] = \default_donate::donate_box();
return \SYSTEM\PAGE\replace::replaceFile((new \PSAI('saimod_donate/tpl/saimod_donate.tpl'))->SERVERPATH(),$vars);}
public static function sai_mod__SAI_saimod_donate_action_update($paten,$value){
\SYSTEM\PAGE\text::save('donation_paten', 'donation_paten', 'deDE', ['donation'], $paten);
\SYSTEM\PAGE\text::save('donation_value', 'donation_value', 'deDE', ['donation'], $value);
\SYSTEM\PAGE\text::save('donation_date', 'donation_date', 'deDE', ['donation'], date('d.m.Y * H:i').' Uhr');
return \SYSTEM\LOG\JsonResult::ok();
}
public static function menu(){
return new \SYSTEM\SAI\sai_module_menu( 100,
\SYSTEM\SAI\sai_module_menu::POISITION_LEFT,
\SYSTEM\SAI\sai_module_menu::DIVIDER_LEFT,
\SYSTEM\PAGE\replace::replaceFile((new \PSAI('saimod_donate/tpl/menu.tpl'))->SERVERPATH()));}
public static function right_public(){return false;}
public static function right_right(){return \SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
public static function js(){
return array(new \PSAI('saimod_donate/js/saimod_donate.js'));}
}

View File

@ -0,0 +1,9 @@
<?php
namespace SQL;
class DATA_SAIMOD_DONATE extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_mysql(){
return array( (new \PSAI('/saimod_donate/sql/mysql/system_page.sql'))->SERVERPATH(),
(new \PSAI('/saimod_donate/sql/mysql/system_api.sql'))->SERVERPATH());
}
}

View File

@ -0,0 +1,3 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SQL');
\SYSTEM\SQL\setup::register('SQL\\DATA_SAIMOD_DONATE');

View File

@ -0,0 +1,3 @@
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (8000, 42, 0, 0, '_SAI_saimod_donate', 'action', NULL);
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (8010, 42, 2, 8000, 'update', 'paten', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (8011, 42, 2, 8000, 'update', 'value', 'STRING');

View File

@ -0,0 +1 @@
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (800, 42, 'donate', 'donate', -1, 0, 0, '#content', './sai.php?sai_mod=.SAI.saimod_donate', 'init_saimod_donate', '\\SAI\\saimod_donate');

View File

@ -0,0 +1,7 @@
<li class="nav-item">
<a id="menu_donate" class="nav-link" data-toggle="tooltip" data-placement="bottom" title="Donate" href="#!donate">
<span class="d-md-none" style="padding-left: 15px;"></span>
<i class="fa fa-dollar" aria-hidden="true"></i>
<span class="d-md-none">&nbsp;&nbsp;Donate</span>
</a>
</li>

View File

@ -0,0 +1,26 @@
<div class="row">
<div class="col-12 sai_padding_off bg-primary sai_padding_10">
<h4 class="sai_margin_off" style="float:left;">&nbsp;<span class="fa fa-check" aria-hidden="true"></span>&nbsp;&nbsp;Donate</h4>
</div>
<div class="col-md-8 sai_padding_off" style="padding: 15px;">
<table class="table table-striped table-condensed" style="border: 1px solid #dee2e6;">
<tr>
<th>Paten</th>
<td><input type="text" id="donate-paten" value="${donation_paten}" style="width: 100%;"/></td>
</tr>
<tr>
<th>Value</th>
<td><input type="text" id="donate-value" value="${donation_value}" style="width: 100%;"/></td>
</tr>
<tr>
<td></td>
<td>
<button id="donate-update" class="btn btn-success">Update</button>
</td>
</tr>
</table>
</div>
<div class="col-md-4 sai_padding_off" style="padding: 15px;">
${donate_box}
</div>
</div>

View File

@ -175,4 +175,11 @@ INSERT IGNORE INTO `system_text_tag` (`id`, `tag`) VALUES ('faq_q_07', 'faq');
INSERT IGNORE INTO `system_text_tag` (`id`, `tag`) VALUES ('faq_q_08', 'faq');
INSERT IGNORE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('donate_notice', 'deDE', 'Für Spenden unter 200€ jährlich genügt der <a href=\"files/download/Vereinfachter Zuwendungsnachweis.pdf\" data-mce-href=\"files/download/Vereinfachter Zuwendungsnachweis.pdf\"><strong>»&nbsp;</strong>Vereinfachte Zuwendungsnachweis&nbsp;<strong>«</strong></a><br><br> Spendenquittung auf&nbsp;<a href=\"mailto:contact@democracy-deutschland.de\" data-mce-href=\"mailto:contact@democracy-deutschland.de\"><strong>»&nbsp;</strong>Anfrage&nbsp;<strong>«</strong></a>', '1', '1', '2017-12-28 16:42:29', '2017-12-28 16:42:29');
INSERT IGNORE INTO `system_text_tag` (`id`, `tag`) VALUES ('donate_notice', 'democracy');
INSERT IGNORE INTO `system_text_tag` (`id`, `tag`) VALUES ('donate_notice', 'democracy');
INSERT IGNORE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('donation_paten', 'deDE', '9', '1', '1', '2017-12-28 16:42:29', '2017-12-28 16:42:29');
INSERT IGNORE INTO `system_text_tag` (`id`, `tag`) VALUES ('donation_paten', 'donation');
INSERT IGNORE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('donation_value', 'deDE', '61', '1', '1', '2017-12-28 16:42:29', '2017-12-28 16:42:29');
INSERT IGNORE INTO `system_text_tag` (`id`, `tag`) VALUES ('donation_value', 'donation');
INSERT IGNORE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('donation_date', 'deDE', '14.05.2018 * 18:45 Uhr', '1', '1', '2017-12-28 16:42:29', '2017-12-28 16:42:29');
INSERT IGNORE INTO `system_text_tag` (`id`, `tag`) VALUES ('donation_date', 'donation');