id) { return; } $struktur = $this->EinstellungenStruktur(); if($this->app->Secure->GetPOST('speichern')) { foreach($struktur as $name => $val) { $json[$name] = $this->app->Secure->GetPOST($name, '','', 1); if(isset($val['replace'])) { switch($val['replace']) { case 'lieferantennummer': $json[$name] = $this->app->erp->ReplaceLieferantennummer(1,$json[$name],1); break; } } } $json_str = $this->app->DB->real_escape_string(json_encode($json)); $this->app->DB->Update( sprintf( "UPDATE `zahlungsweisen` SET `einstellungen_json` = '%s' WHERE `id` = %d LIMIT 1", $json_str, $this->id ) ); } $modul = $this->app->DB->Select( sprintf( 'SELECT z.modul FROM `zahlungsweisen` AS `z` WHERE z.id = %d LIMIT 1', $this->id ) ); $id = $this->id; $html = ''; $html .= '
'.$modul.' Einstellungen'; $json = $this->app->DB->Select( sprintf( 'SELECT z.einstellungen_json FROM `zahlungsweisen` AS `z` WHERE z.id = %d LIMIT 1', $id ) ); if(!empty($json)) { $json = json_decode($json, true); } foreach($struktur as $name => $val) { $html .= ''; } if($target === 'return') { return $html; } $this->app->Tpl->Add($target, $html); } }
'.(empty($val['bezeichnung'])?$name:$val['bezeichnung']).''; $typ = 'text'; if(!empty($val['typ'])) { $typ = $val['typ']; } if(isset($val['replace'])) { switch($val['replace']) { case 'lieferantennummer': $json[$name] = $this->app->erp->ReplaceLieferantennummer(0,$json[$name],0); if($target !== 'return') { $this->app->YUI->AutoComplete($name, 'lieferant', 1); } break; case 'etiketten': //$json[$name] = $this->app->erp->ReplaceLieferantennummer(0,$json[$name],0); if($target !== 'return') { $this->app->YUI->AutoComplete($name, 'etiketten'); } break; } } switch($typ) { case 'textarea': $lang = ''; if(!empty($val['lang'])) { $lang = ' data-lang="'.htmlspecialchars($val['lang']).'" '; } $html .= ''; break; case 'checkbox': $html .= ''; break; case 'select': $html .= ''; break; case 'submit': if(isset($val['text'])) { $html .= '
'; } break; case 'custom': if(isset($val['function'])) { $tmpfunction = $val['function']; if(method_exists($this, $tmpfunction)) { $html .= $this->$tmpfunction(); } } break; default: $lang = ''; if(!empty($val['lang'])) { $lang = ' data-lang="'.htmlspecialchars($val['lang']).'" '; } $html .= ''; break; } if(isset($val['info']) && $val['info']) { $html .= ' '.$val['info'].''; } $html .= '