updated saimod_webcraf_contact - send email, new design
This commit is contained in:
parent
5a17f893dd
commit
61e9237641
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
require_once dirname(__FILE__).'/sql/autoload.inc';
|
||||
\SYSTEM\SAI\sai::register('saimod_webcraft_contact');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SAI');
|
||||
\SYSTEM\SAI\sai::register('\SAI\saimod_webcraft_contact');
|
||||
@ -3,18 +3,27 @@ function init_saimod_webcraft_contact() {
|
||||
preventSubmit: true,
|
||||
submitError: function($form, event, errors) {},
|
||||
submitSuccess: function($form, event){
|
||||
$.ajax({type :'POST',
|
||||
url : 'https://wat.webcraft-media.de/api.php?',
|
||||
data : { call: 'bug',
|
||||
message: '!!!KUNDENKONTAKT: '+$('#input_contact_message').val(),
|
||||
data: { email: $('#input_contact_email').val(), name: $('#btn_send').attr('project')}},
|
||||
success : function(data) {
|
||||
if(data.status){
|
||||
$('.help-block').html("EMail erfolgreich abgeschickt.");
|
||||
$('#input_contact_message').val('');
|
||||
}else{
|
||||
$('.help-block').html("EMail nicht erfolgreich abgeschickt - wir kümmern uns umgehend darum!");}
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type :'POST',
|
||||
dataType: 'JSON',
|
||||
data : {
|
||||
sai_mod: '.SAI.saimod_webcraft_contact',
|
||||
action: 'mail',
|
||||
data: {
|
||||
email: $('#input_contact_email').val(),
|
||||
message: $('#input_contact_message').val(),
|
||||
project: $('#btn_send').attr('project'),
|
||||
}
|
||||
},
|
||||
success : function(data) {
|
||||
if(data.status){
|
||||
$('.help-block').html("EMail erfolgreich abgeschickt.");
|
||||
$('#input_contact_message').val('');
|
||||
}else{
|
||||
$('.help-block').html("EMail nicht erfolgreich abgeschickt - wir kümmern uns umgehend darum!");}
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
@ -1,17 +1,25 @@
|
||||
<?php
|
||||
namespace SAI;
|
||||
class saimod_webcraft_contact extends \SYSTEM\SAI\sai_module {
|
||||
public static function sai_mod_saimod_webcraft_contact(){
|
||||
public static function sai_mod__SAI_saimod_webcraft_contact(){
|
||||
$vars = array('project' => \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT));
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new PSAI('saimod_webcraft_contact/tpl/saimod_webcraft_contact.tpl'))->SERVERPATH(),$vars);
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new \PSAI('saimod_webcraft_contact/tpl/saimod_webcraft_contact.tpl'))->SERVERPATH(),$vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_webcraft_contact_action_mail($data){
|
||||
return \SYSTEM\LOG\JsonResult::status(
|
||||
\mail( 'service@webcraft-media.de',
|
||||
'SAI: '.$data['project'].' - '.$data['email'],
|
||||
'EMail: '.$data['email']."\n\nProject: ".$data['project']."\n\nMessage:\n".$data['message']));
|
||||
}
|
||||
|
||||
public static function menu(){
|
||||
return new \SYSTEM\SAI\sai_module_menu( 10, \SYSTEM\SAI\sai_module_menu::POISITION_RIGHT, \SYSTEM\SAI\sai_module_menu::DIVIDER_RIGHT,
|
||||
\SYSTEM\PAGE\replace::replaceFile((new PSAI('saimod_webcraft_contact/tpl/menu.tpl'))->SERVERPATH()));}
|
||||
\SYSTEM\PAGE\replace::replaceFile((new \PSAI('saimod_webcraft_contact/tpl/menu.tpl'))->SERVERPATH()));}
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return true;}
|
||||
public static function js(){
|
||||
return array( \LIB\lib_jqbootstrapvalidation::js(),
|
||||
new PSAI('saimod_webcraft_contact/js/saimod_webcraft_contact.js'));}
|
||||
new \PSAI('saimod_webcraft_contact/js/saimod_webcraft_contact.js'));}
|
||||
public static function css(){return array();}
|
||||
}
|
||||
@ -3,6 +3,7 @@ namespace SQL;
|
||||
class DATA_SAIMOD_WEBCRAFT_CONTACT extends \SYSTEM\DB\QI {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function files_mysql(){
|
||||
return array( (new \PSAI('/saimod_webcraft_contact/sql/mysql/system_page.sql'))->SERVERPATH());
|
||||
return array( (new \PSAI('/saimod_webcraft_contact/sql/mysql/system_api.sql'))->SERVERPATH(),
|
||||
(new \PSAI('/saimod_webcraft_contact/sql/mysql/system_page.sql'))->SERVERPATH());
|
||||
}
|
||||
}
|
||||
2
sql/mysql/system_api.sql
Normal file
2
sql/mysql/system_api.sql
Normal file
@ -0,0 +1,2 @@
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5400, 42, 0, 0, '_SAI_saimod_webcraft_contact', 'action', NULL);
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5410, 42, 2, 5400, 'mail', 'data', 'JSON');
|
||||
@ -1 +1 @@
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (5400, 42, 'contact', 'contact', -1, 0, 0, '#content', './sai.php?sai_mod=saimod_webcraft_contact', 'init_saimod_webcraft_contact', 'saimod_webcraft_contact');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (5400, 42, 'contact', 'contact', -1, 0, 0, '#content', './sai.php?sai_mod=.SAI.saimod_webcraft_contact', 'init_saimod_webcraft_contact', '\\SAI\\saimod_webcraft_contact');
|
||||
@ -1,37 +1,47 @@
|
||||
<h4>Kontakt</h4>
|
||||
<hr>
|
||||
Nehmen Sie mit <b><a href="https://www.webcraft-media.de" target="blank">Webcraft Media</a></b> Kontakt auf.
|
||||
<br>
|
||||
<br>
|
||||
<div class="row" id="contact_address">
|
||||
<form class="textbox trojan" id="contact_form">
|
||||
<div class="control-group">
|
||||
<div class="controls col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<label>Antwort an:</label>
|
||||
<input class="form-control text_width"
|
||||
type="email"
|
||||
id="input_contact_email"
|
||||
placeholder="Email Adresse"
|
||||
data-validation-email-message="Bitte gebe doch eine gültige EMail-Adresse an!"
|
||||
required data-validation-required-message="Bitte gebe doch eine EMail-Adresse an!">
|
||||
<div class="row">
|
||||
<div class="col-12 sai_padding_off bg-primary sai_padding_10">
|
||||
<h4 class="sai_margin_off" style="float:left;"> <span class="fa fa-envelope" aria-hidden="true"></span> Kontakt</h4>
|
||||
</div>
|
||||
<div class="col-md-12 sai_padding_off sai_border_left" id="content_contact">
|
||||
<div class="row-fluid" id="contact_address">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<br>
|
||||
Nehmen Sie mit <b><a href="https://www.webcraft-media.de" target="blank">Webcraft Media</a></b> Kontakt auf.
|
||||
<hr>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<div class="controls col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<label>Ihre Nachricht:</label>
|
||||
<textarea class="form-control text_width"
|
||||
id="input_contact_message"
|
||||
rows="7"
|
||||
required data-validation-required-message="Bitte beschreibe kurz dein Anliegen ;-)."></textarea>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="help-block"></div>
|
||||
<button type="submit" class="btn-sm btn btn-success" project="${project}" id="btn_send"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> Email senden!</button>
|
||||
<form class="textbox trojan w-100" id="contact_form">
|
||||
<div class="control-group">
|
||||
<div class="controls col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<label>Antwort an:</label>
|
||||
<input class="form-control text_width "
|
||||
type="email"
|
||||
id="input_contact_email"
|
||||
placeholder="Email Adresse"
|
||||
data-validation-email-message="Bitte gebe doch eine gültige EMail-Adresse an!"
|
||||
required data-validation-required-message="Bitte gebe doch eine EMail-Adresse an!">
|
||||
</div>
|
||||
<br>
|
||||
<div class="controls col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<label>Ihre Nachricht:</label>
|
||||
<textarea class="form-control text_width"
|
||||
id="input_contact_message"
|
||||
rows="7"
|
||||
required data-validation-required-message="Bitte beschreibe kurz dein Anliegen ;-)."></textarea>
|
||||
</div>
|
||||
<br>
|
||||
<div class="col-md-12">
|
||||
<div class="help-block"></div>
|
||||
<br>
|
||||
<button type="submit" class="btn-sm btn btn-success" project="${project}" id="btn_send"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> Email senden!</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<br>
|
||||
(Sie können uns auch eine EMail schreiben - an <a href="mailto:service@webcraft-media.de">service@webcraft-media.de</a> - oder anrufen unter <b>0157/84841600</b>)
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<br>
|
||||
(Sie können uns auch eine EMail schreiben - an <a href="mailto:service@webcraft-media.de">service@webcraft-media.de</a> - oder anrufen unter <b>0157/84841600</b>)
|
||||
</div>
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user