';
switch($v['attr']['type']) {
case 'ShopCart' :
$Shop = $Mizu->getClass('Shop',dirname(__FILE__).'/../shop/Shop.class.php');
$this->FormOut.= $Shop->getRequestFormField();
if($this->FormSended) {
$this->FormSended = $Shop->inAction();
}
break;
/*
case 'captcha' :
$this->FormOut.='
';
break;
*/
case 'privacyCheckbox' :
$this->FormOut.='
';
if($El['value']) {
$El['check'] = 'checked="checked"';
}
$this->FormOut.='
'.nl2br($v['txt']).'
';
break;
case 'label' :
case 'caption' :
$this->FormOut.='
';
$this->FormOut.='
'.$Mizu->parseHtmlTextField(nl2br($v['txt'])).'
';
break;
case 'title' :
$this->FormOut.='
';
$this->FormOut.='
';
break;
case 'textarea' :
$this->FormOut.= '
';
break;
case 'submit' :
$this->FormOut.='
';
$this->FormOut.='
';
break;
case 'checkbox' :
if($El['value']) {
$El['check'] = 'checked="checked"';
}
$this->FormOut.= '
'.$El['name'].'
';
break;
case 'checkboxGroup' :
$opts = '';
$El['valueF'] = '';
if(is_array($El['options']['option'])) {
foreach($El['options']['option'] as $v) {
$v = $v['attr'];
$s = '';
if(!isset($v['value'])) $v['value'] = $Mizu->_Url->nameEncode($v['name']);
if($El['value'][$v['value']]) {
$s = 'checked="checked"';
$El['valueF'].= '-'.$v['name']."
";
}
$v['id'] = $El['id'].'-'.$v['value'];
$opts.= '
';
}
}
$this->FormOut.= '
'.$opts.'
';
break;
case 'year' :
$El['options']['option'][]['attr'] = array('name'=>'');
$from = date('Y')+$El['attr']['from'];
$until = date('Y')+$El['attr']['until'];
if($from<$until) {
for($y = $from;$y<= $until;$y++) {
$El['options']['option'][]['attr'] = array('name'=>$y);
}
} else {
for($y = $from;$y>= $until;$y--) {
$El['options']['option'][]['attr'] = array('name'=>$y);
}
}
case 'select' :
if($El['attr']['data']) {
switch($El['attr']['data']) {
case 'persons' :
$El['options']['option'][0]['attr']['name'] = '';
$El['options']['option'][0]['attr']['value'] = '';
foreach(range(1,15) as $xx) {
$El['options']['option'][]['attr']['name'] = $xx;
}
break;
}
}
$opts = '';
if(is_array($El['options']['option'])) {
foreach($El['options']['option'] as $v) {
$v = $v['attr'];
$s = '';
if(!isset($v['value'])) $v['value'] = $Mizu->_Url->nameEncode($v['name']);
if($v['value']==$El['value']) {
$s = 'selected="selected"';
$El['valueF'] = $v['name'];
}
$opts.= '
';
}
}
$this->FormOut.= '
';
break;
case 'survey' :
foreach(range(1,5) as $xx) {
$El['options']['option'][]['attr'] = array(
'name' => $xx,
);
}
$El['spc'][5] = '
'.$El['attr']['answ1'].'';
$El['spc'][10] = '
'.$El['attr']['answ2'].'';
case 'radio' :
$opts = '';
if(is_array($El['options']['option'])) {
foreach($El['options']['option'] as $v) {
$v = $v['attr'];
if(!isset($v['value'])) $v['value'] = $Mizu->_Url->nameEncode($v['name']);
$s = '';
if($v['value']==$El['value']) {
$s = 'checked="checked"';
$El['valueF'] = $v['name'];
}
$opts.= '
'.$v['name'].'';
}
}
$this->FormOut.= '
'.$El['spc'][5].$opts.$El['spc'][10].'
';
break;
case 'spacer' :
$this->FormOut.= '
';
break;
case 'day' :
$El['type'] = 'text';
$El['class'].=' datepicker ';
default :
$this->FormOut.= '
';
if(!$El['type']) {
$El['type'] = 'text';
}
if($El['attr']['valid']=='email') {
$El['type'] = 'email';
}
$this->FormOut.= '
';
break;
}
/////////////////////////////////////////////////////////////////
// build mail
if($El['value']) {
switch($v['attr']['type']) {
default :
break;
}
if(!$El['valueF']) {
$El['valueF'] = $El['value'];
}
}
$Mail[] = $El;
$V[$El['id']] = $El['valueF'];
$RV[$El['id']] = $El['value'];
$this->Elements[$El['id']] = $El;
$this->FormOut.='
';
}
// send
if($this->FormSended AND !count($Error)) {
#if($this->isSpam()) return false;
$mails = explode(';',$Mizu->getC('email'));
if(!$absendermail) {
$absendermail = $mails[0];
}
// save to Asa
if($Mizu->get('cnt/saveAsa')) {
$V['id'] = mktime().rand(1,200);
ob_start();
require_once('services/mo-asa.xml.php');
$XML = ob_get_contents();
ob_end_clean();
if(file_exists($Mizu->get('cnt/saveAsa'))) {
file_put_contents($Mizu->get('cnt/saveAsa').$V['id'].'.xml',$XML);
}
}
if($Mizu->get('cnt/sendThxPage')) {
$this->sendThx =true;
}
if($RV['sendType']=='1') {
$this->sendThx =true;
} else if($V['sendType']=='2') {
$this->sendThx =false;
}
// send danke page
if($this->sendThx AND $nix) {
$mail = $this->Mizu->getHelperClass('Mailer');
$mail->CharSet = 'utf-8';
$mail->IsHTML(true);
$mail->AddAddress($absendermail,$absendermail);
$mail->Subject = $Mizu->get('lng/title');
$mail->From = $mails[0];
$mail->FromName = $mails[0];
$mailToClient = $Mizu->get('lng/thx');
$mail->Body = $mailToClient;
if($absendermail!=$mails[0]) {
$mail->Send();
}
}
$mail = $this->Mizu->getHelperClass('Mailer');
$mail->CharSet = 'utf-8';
$mail->IsHTML(true);
foreach($mails as $e) {
if($e) {
$mail->AddAddress($e,$e);
}
}
$mail->From = $absendermail;
$mail->FromName = $absendermail;
$mail->Subject = $Mizu->get('betreff');
$mailbody = '