0 && $_FILES[$name]['type']){ $ret['error']=""; if ($_FILES[$name]['size']>$maxbytes){ $ret['error']="Datei ist zu groß (max. $maxbytes Bytes)"; } if (is_array($types)) { if (!in_array($_FILES[$name]['type'],$types)) { $ret['error']="Falsche Dateiart!"; } } if (!$ret['error']){ if(strlen($_FILES[$name]['name']>20)){$s=substr($_FILES[$name]['name'],-20);} else { $s=$_FILES[$name]['name']; } $fname=kb_correctFilename($s); if($filenamefunction){ $res=call_user_func($filenamefunction,$name,$fname); $fpath=$uploaddir.$res; } else { if(!session_id()){ $fpath=$uploaddir.rand()."_".$name.$fname; } else { $fpath=$uploaddir.session_id()."_".$name.$fname; } unset($i); while(file_exists($fpath)){ $i++; $fname2 =$i."_".$fname; if(!session_id()){ $fpath2=$uploaddir.rand()."_".$name.$fname2; } else { $fpath2=$uploaddir.session_id()."_".$name.$fname2; } } } if ($i && $fname2 && $fpath2){ $fname=$fname2; $fpath=$fpath2; } if (move_uploaded_file($_FILES[$name]['tmp_name'], $fpath)) { // print "File is valid, and was successfully uploaded. Here's some more debugging info:\n"; } else { //$ret['error']="Possible file upload attack!\n"; $ret['error']="--\n"; } } } else if ($_POST[$name."name"]){ $fname=kb_correctFilename(substr($_POST[$name."name"],-20)); $fpath=$uploaddir.session_id().$name.$fname; } if ($fname){ $ret["ht_field"]=''; $ret["img_ht"]=''; $ret["fname"]=$fname; $ret["size"]=$_FILES[$name]['size']; $ret["type"]=$_FILES[$name]['type']; $ret["fpath"]=$fpath; $ret["file"]=session_id().$name.$fname; if (substr($ret["type"],0,5)=="image"){ $ret["img"]=getimagesize($ret["fpath"]);} /* [0] => 468 Breite [1] => 60 Höhe [2] => 1 Typ: 1 = GIF, 2 = JPG, 3 = PNG, SWF = 4 [3] => width="468" height="60" [bits] => 5 [channels] => 3 [mime] => image/gif */ } else { $ret["fpath"]=$dataforward_name; } return $ret; } function kb_correctFilename($in){ $in=strtolower($in); $ok_zeichen='abcdefghijklmnopqstruvwxyz_-1234567890.'; $len=strlen($in); for ($i=0; $i <$len ; $i++) { $pos = strpos($ok_zeichen, $in{$i}); if ($pos === false) { // not ok } else { $out.=$in{$i}; } } return $out; } //if (!function_exists('form2mail_mail')) { function formCenter_mail($felder,$p,$search,$wert){ global $cms_pagepar; //echo "Mail
".$p[6]; print_r($addresses); print_r($felder);print_r($p);print_r($search);print_r($wert); echo "
"; // echo "Mail
".$p[6]; print_r($p); echo "
"; $anz=count($felder); $p[7]=str_replace($search,$wert,$p[7]); $p[8]=str_replace($search,$wert,$p[8]); $a_s=count($search); $mailtext= $p[6]; for ( $i=0; $i <$a_s ; $i++ ) { $mailtext=str_replace($search[$i],$wert[$i],$mailtext); $p[7]=str_replace($search[$i],$wert[$i],$p[7]); $p[8]=str_replace($search[$i],$wert[$i],$p[8]); } $mailtext=preg_replace("#\%\%(.*?)\%\%#s",'',$mailtext); $p[7]=preg_replace("#\%\%(.*?)\%\%#s",'',$p[7]); $p[8]=preg_replace("#\%\%(.*?)\%\%#s",'',$p[8]); $mailtext= wordwrap($mailtext,60,"\n"); if (substr_count($p[7],",")>0){ $addresses=explode(",",$p[7]); $art="to"; foreach ($addresses as $key => $value) { if (substr_count($value,"bcc:")>0){ $art="bcc"; $t=explode("bcc:",$value); $a['bcc'][]=trim($t[1]); } else if (substr_count($value,"from:")>0){ $art="from"; $t=explode("from:",$value); $a['from']=trim($t[1]); } else { $a[$art][]=$value; } } } else if($p[7]!=""){ $a['to']=$p[7]; } if(is_array($a['to'])){$to=implode(",",$a['to']);} else {$to=$a['to']; } if(is_array($a['bcc'])){$bcc=implode(",",$a['bcc']);} else {$bcc=$a['bcc']; } if(is_array($a['from'])){$from=implode(",",$a['from']);} else {$from=$a['from']; } if (trim($bcc)) { $headers .= 'Bcc: '.$bcc."\n";} //if (trim($from)){ $headers .= 'From: '.$from.' <'.$from.'>' . "\n";} if (trim($from)){ $headers .= 'From: '.$from."\n";} if($cms_pagepar['encoding']=='utf-8'){$mailtext=utf8_decode($mailtext);} //echo "to:".$to." p8:".$p[8]." TXT:".$mailtext." h:".$headers; $mres= mail($to,$p[8],$mailtext,$headers); if($_GET['debug']=="cck" || $d){ echo "
To:".$to."\n\nBetreff:\n".$p[8]." \n\nMail:\n".$mailtext." \n\nHeaders:\n".$headers."\n\nmresult:".$mres."
"; } return $mres; } // } function formCenter_db_save($p,$in){ // echo "
"; print_r($in); echo "
"; $data=$in["f"]; $p4=explode("|",$p[4]); $to_db=$p4[0]; if (!strpos($p[4],"|")){$to_db=$p[4]; } $dyn_db=dyn_data_db("",$to_db); $conn_id=mysql_connect($dyn_db["host"], $dyn_db["user"], $dyn_db["password"]) or die( "Unable to connect to SQL server (save)"); $connected =mysql_select_db($dyn_db["database"],$conn_id) or die( "Unable to select database ".$dyn_db["database"]); $query = "INSERT INTO ".$dyn_db["table_data"]; $felder_anz=count($data); unset($fields);unset($vals); foreach ($data as $key => $value) { if ($value!=""){ $fields[]=$key; $vals[]=addslashes($value);} } $query.=" (".implode(",",$fields).") values ('".implode("','",$vals)."')"; //echo $query."
"; if (!mysql_query($query, $conn_id)) { echo "DB-Fehler 1 formCenter_db_save "; echo mysql_errno($conn_id).": ".mysql_error($conn_id)."
".$query."\n"; } $id=mysql_insert_id(); mysql_close($conn_id); return $id; } function formCenter_db_eintrag($felder,$p,$wert,$db_id="id"){ global $cms_pagepar; $p4=explode("|",$p[4]); $to_db=$p4[0]; if (!strpos($p[4],"|")){$to_db=$p[4]; } $dyn_db=dyn_data_db("",$to_db); //echo "p4:".print_r($p[4]); //echo "XXX:".$to_db.$dyn_db["host"].$dyn_db["user"].$dyn_db["password"]; $conn_id=mysql_connect($dyn_db["host"], $dyn_db["user"], $dyn_db["password"]) or die( "Unable to connect to SQL server (db_e)"); $connected =mysql_select_db($dyn_db["database"],$conn_id) or die( "Unable to select database ".$dyn_db["database"]); if ($dyn_db['encoding']!="") { // echo "UTF8"; mysql_query("SET character_set_connection = '".$dyn_db['encoding']."'") or die ("Datenbankfehler! (formcenter 131)"); // mysql_query ("SET NAMES 'utf8'") or die ("Datenbankfehler!(formcenter 132)"); // mysql_query ("SET CHARACTER SET 'utf8'") or die ("Datenbankfehler!(formcenter 133)"); } // Felder anlegen, falls nicht vorhanden $q="SHOW COLUMNS FROM ".$dyn_db["table_data"]; $result = mysql_query($q,$conn_id); if (!$result) { echo 'Abfrage ('.$q.') konnte nicht ausgeführt werden: ' . mysql_error(); exit; } $spalten=mysql_num_rows($result); if (mysql_num_rows($result) < 2) { echo "Keine Felder"; $felder_anz=count($felder); //$sql = 'ALTER TABLE `a_det_ghkp_` ADD `9` VARCHAR(5) NOT NULL AFTER `t16`, ADD `10` VARCHAR(5) NOT NULL AFTER `9`, ADD `11` VARCHAR(50) NOT NULL AFTER `10`;'; $query="ALTER TABLE `".$dyn_db["table_data"]."` "; for ($i=0; $i<=$felder_anz; $i++){ if ($felder[$i]!=""){ $f[]="ADD `".$felder[$i]."` varchar(50) DEFAULT ''";} } $query.=implode(",",$f); //echo $query."


"; if (!mysql_query($query, $conn_id)) { echo "DB-Fehler 1a "; // echo mysql_errno($conn_id).": ".mysql_error($conn_id)."\n

".$query."
"; } } else { for ( $i=0; $i <$spalten ; $i++ ){ $spalte=mysql_fetch_assoc($result); $spaltenname[$i]=$spalte['Field']; } $spalten_anz=count($spaltenname); //echo "
"; print_r($spaltenname); echo "
"; } // $query = "INSERT INTO ".$dyn_db["table_data"]; $felder_anz=count($felder); unset($fields);unset($vals); /* // alt - ohne check auf Spaltenexistenz for ($i=0; $i<=$felder_anz; $i++){ if (trim($felder[$i])!="") { $fields[]=$felder[$i]; $vals[]=addslashes($wert[$i]); } } */ // neu - mit check auf Spaltenexistenz for ($i=0; $i<=$felder_anz; $i++){ $w=$wert[$i]; if (trim($felder[$i])!=$db_id && trim($felder[$i])!="" && in_array(trim($felder[$i]),$spaltenname) ) { if(is_array($fields)){ if(!in_array(trim($felder[$i]),$fields)){ $fields[]=$felder[$i]; $vals[]=addslashes($w); } } else { $fields[]=$felder[$i]; $vals[]=addslashes($w); } } } $query.=" (".implode(",",$fields).") values ('".implode("','",$vals)."')"; //echo $query."
"; if (!mysql_query($query, $conn_id)) { echo "DB-Fehler 1 formCenter_db_eintrag "; echo mysql_errno($conn_id).": ".mysql_error($conn_id)."
Q:".$query."\n"; } $id=mysql_insert_id(); //echo $id; mysql_close($conn_id); return $id; } // function formCenter_db_update($felder,$p,$wert,$dataforward,$db_id="id"){ //$dataforward["id"] global $cms_pagepar; //$cms_pagepar['encoding']='utf-8'; $p4=explode("|",$p[4]."|"); $to_db=$p4[0]; $dyn_db=dyn_data_db("",$to_db); //echo "dyn_db"; print_r($dyn_db); $conn_id=mysql_connect($dyn_db["host"], $dyn_db["user"], $dyn_db["password"]) or die( "Unable to connect to SQL server (formCenter_db_update)"); $connected =mysql_select_db($dyn_db["database"],$conn_id) or die( "Unable to select database"); $query= "SHOW COLUMNS FROM ".$dyn_db["table_data"].""; //echo "Query:".$query."
"; $result = mysql_query($query, $conn_id); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $cols[]=$row["Field"]; } } //KB_DUMP($cols); unset($row); $query = "UPDATE ".$dyn_db["table_data"]; $felder_anz=count($felder); unset($fields);unset($vals); for ($i=0; $i<=$felder_anz; $i++){ if (trim($felder[$i])!="" && in_array($felder[$i],$cols)) { if($cms_pagepar['encoding']=='utf-8'){ $up[]="`".$felder[$i]."`='".addslashes(utf8_encode($wert[$i]))."'"; } $up[]="`".$felder[$i]."`='".addslashes($wert[$i])."'"; } } if(is_array($up)){ $query.=" SET ".implode(",",$up); } $query.=" WHERE `".$db_id."`='".$dataforward[$db_id]."'"; //echo "Query:".$query."
"; if(is_array($up)){ if (!mysql_query($query, $conn_id)) { echo "DB-Fehler formCenter_db_update "; echo mysql_errno($conn_id).": ".mysql_error($conn_id)."\n"; } $n=mysql_affected_rows(); } //echo "affected:".$n; mysql_close($conn_id); return $n; } function formCenter_check($p,$mode,$wert,$feld,$table=""){ // DB-Mode? //formCenter_check($p,"unique",$wert[$i],$name,$uniquepar[1])) if ($mode=="unique" && trim($p[4])){ if (strstr($p[4],"|")){ $p4=explode("|",trim($p[4])); $to_db=$p4[0]; $anz=count($p4); } else {$p4[0]=trim($p[4]);$to_db=$p4[0]; } if($table!=""){ $to_db=$table; unset($p4); $p4[0]=$table; } $dyn_db=dyn_data_db("",$to_db); //echo "DynDB:".$to_db; print_r($dyn_db); $conn_id=mysql_connect($dyn_db["host"], $dyn_db["user"], $dyn_db["password"]) or die( "Unable to connect to SQL server (17)"); $connected =mysql_select_db($dyn_db["database"],$conn_id) or die( "Unable to select database"); $num=0; foreach ($p4 as $dbtab) { //echo "DB unique:".$dbtab; $dyn_db=dyn_data_db("",$dbtab); $query = "SELECT ".$feld." FROM ".$dyn_db["table_data"]." WHERE ".$feld."='".$wert."' LIMIT 1"; //echo $query; $query_result_handle=mysql_query($query, $conn_id); if (!$query_result_handle) { echo "DB-Fehler Check "; // echo mysql_errno($conn_id).": ".mysql_error($conn_id)."\n"; } $num=$num+mysql_num_rows ($query_result_handle); //echo $dyn_db["table_data"]." ".$num; } //echo "num:".$num; mysql_close($conn_id); if (!$num){ return TRUE;} else { return FALSE; } } else {return FALSE; } } function formCenter($p,$dataforward,$mode){ //print_r($dataforward); //echo "FC:
".$p[6]; print_r($p); echo "
"; $vals=$_POST; if(!$_POST){ $vals=$dataforward; } //if ($_GET['debug']){ KB_DUMP( $_POST,"vals"); } $ht=trim($p[5]); //// PARAMETER preg_match_all("#(.*?)#s",$ht,$pars); $pars=$pars[1]; $anz=count($pars); for ($i=0; $i<$anz; $i++){ preg_match_all("#(.*?)#s",$pars[$i],$pname); $pname=$pname[1][0]; preg_match_all("#(.*?)#s",$pars[$i],$pval); $pval =$pval[1][0]; //preg_match_all("#(.*?)#s",$pars[$i],$pp); $pp =$pp[1][0]; //preg_match_all("#(.*?)#s",$pars[$i],$pm); $pm =$pm[1][0]; $formpar[$pname]=$pval; //$formpar[$pname]['pars']=$pp; //$formpar[$pname]['mode']=$pm; //if ($pname="savebutton"){$submit=$pval; }//$formpar["savebutton"] } //echo "formpar['dbid']:".$formpar['dbid']; //print_r($formpar); if($formpar['dbid']==""){ $formpar['dbid']="id"; } if (trim($p[4])){ $m["DB"]="save"; } if (trim($p[4]) && $dataforward[$formpar['dbid']]!="" && ($p[9]=="Datenquelle" OR $p[9]=="Vormodul" OR $p[9]=="Vormodul strikt")){ $m["DB"]="update"; } if($formpar['DB']){$m["DB"]=$formpar['DB']; } if (trim($p[7])){ $m["Mail"]="ja"; } $error_text["date"]="Bitte tragen Sie ein korrektes Datum ein."; $error_text["email"]="Bitte tragen Sie Ihre korrekte E-Mail-Adresse ein."; $error_text["plz"]="Bitte tragen Sie Ihre korrekte Postleitzahl ein."; $error_text["plzchecked"]="Die von Ihnen eingegebene Postleitzahl existiert nicht."; $error_text["global"]="Bitte füllen Sie alle Pflichtfelder korrekt aus."; $error_text["uniqueuser"]="Der Benutzername existiert bereits. Bitte wählen Sie einen anderen."; $error_text["safepw"]="Das Passwort ist unsicher. Bitte wählen Sie ein anderes."; $error_text["unique"]="Ein Account mit diesem Wert exisitert schon. Bitte wählen Sie einen anderen."; preg_match_all("#(.*?)#s",$ht,$e); $e=$e[1]; foreach ($e as $key => $value) { preg_match("#(.*?)#s",$value,$name); $name=$name[1]; preg_match("#(.*?)#s",$value,$text); $text=$text[1]; $error_text[$name]=$text; } if ($_POST["kbfcform"]!='kbfc'.$p['blockId']){ $first_show=1; } /* $error_text["date"]="Please enter a correct date."; $error_text["email"]="Please enter your correct e-mail-address."; $error_text["plz"]="Please enter your correct zip-code."; $error_text["plzchecked"]="The zip-code you entered is not correct."; $error_text["global"]="Please fill out all obligation fields correctly."; */ /// TESTS //$p[3]: HTML Formular //$ht: Formular-Def if (strpos($ht,"test")){ // welche Tests preg_match_all("#(.*?)#s",$ht,$test); $test=$test[1]; $test_anz=count($test); $debug=$_GET['debug']; if ($debug){ echo "
test_anz:".$test_anz;} // Testbedingungen auswerten for ($i=0; $i<$test_anz; $i++){ preg_match("#(.*?)#s",$test[$i],$tid); $tid =$tid[1]; preg_match("#(.*?)#s",$test[$i],$typ); $typ =$typ[1]; preg_match("#(.*?)#s",$test[$i],$expr); $expr =$expr[1]; preg_match("#(.*?)#s",$test[$i],$repl); $repl =$repl[1]; preg_match("#(.*?)#s",$test[$i],$tmode); $tmode =$tmode[1]; if ($debug){ echo "
".$tid.'-'.$typ."-".$expr."| ";} switch ($typ) { case "if": $expr=explode(":",$expr); switch ($expr[0]) { case "is": $v=explode("=",$expr[1]); //if (($vals[$expr[1]]!="" && $vals[$expr[1]]!=0) || strlen($vals[$expr[1]])!=0){ $testok[$i]="ja"; echo "Test set mit (".$vals[$expr[1]].") bestanden.";} else { echo "Test set mit (".$vals[$expr[1]].") nicht bestanden.";} if($tmode=="initget" && !$_POST['kbfc10'] && $_GET[$v[0]]){ $vals[$v[0]]=$_GET[$v[0]]; } if($tmode=="ds_strict"){ $vals[$v[0]]=$dataforward[$v[0]]; } if ($debug){ echo $_GET[$v[0]]."|".$v[0]; } if ($vals[$v[0]]==$v[1]){ $testok[$i]="ja"; if ($debug){ echo "Test is (".$vals[$v[0]]."=".$v[1].") bestanden.";}} else { if ($debug){ echo "Test is mit (".$vals[$v[0]]."=".$v[1].") nicht bestanden.";}} break; case "isnot": // UNFERTIG $v=explode("=",$expr[1]); if($tmode=="initget" && !$_POST['kbfc10'] && $_GET[$v[0]]){ $vals[$v[0]]=$_GET[$v[0]]; } if($tmode=="ds_strict"){ $vals[$v[0]]=$dataforward[$v[0]]; } //if (($vals[$expr[1]]!="" && $vals[$expr[1]]!=0) || strlen($vals[$expr[1]])!=0){ $testok[$i]="ja"; echo "Test set mit (".$vals[$expr[1]].") bestanden.";} else { echo "Test set mit (".$vals[$expr[1]].") nicht bestanden.";} if ($vals[$v[0]]!=$v[1]){ $testok[$i]="ja"; if ($debug){ echo "Test isnot (".$vals[$v[0]]."=".$v[1].") bestanden.";}} else { if ($debug){ echo "Test isnot mit (".$vals[$expr[1]].") nicht bestanden.";}} break; case "set": // UNFERTIG //if (($vals[$expr[1]]!="" && $vals[$expr[1]]!=0) || strlen($vals[$expr[1]])!=0){ $testok[$i]="ja"; echo "Test set mit (".$vals[$expr[1]].") bestanden.";} else { echo "Test set mit (".$vals[$expr[1]].") nicht bestanden.";} $posSep = strpos($expr[1], '|'); if ($posSep === false) { if ((isset($_POST[$expr[1]]) && $_POST[$expr[1]]!="0" && $_POST[$expr[1]]!="") || $dataforward[$expr[1]]!=""){ $testok[$i]="ja"; if ($debug){ echo "Test set mit (".$_POST[$expr[1]].") bestanden.";}} else { if ($debug){ echo "Test set mit (".$_POST[$expr[1]].") nicht bestanden.";}} } else { if (isset($_POST[$expr[1]]) && $_POST[$expr[1]]!="0" && $_POST[$expr[1]]!=""){ $testok[$i]="ja"; if ($debug){ echo "Test set mit (".$_POST[$expr[1]].") bestanden.";}} else { if ($debug){ echo "Test set mit (".$_POST[$expr[1]].") nicht bestanden.";}} } break; case "oneset": $v=explode(",",$expr[1]); $v_anz=count($v); //echo $v_anz; $testok[$i]="nein"; for ($vi=0; $vi<$v_anz; $vi++){ //echo " v$i". $vals[$v[$vi]]; if (isset($_POST[$v[$vi]]) && $_POST[$v[$vi]]!="0" && $_POST[$v[$vi]]!=""){ $testok[$i]="ja"; } } if ($debug){ echo "Test oneset mit (".$_POST[$expr[1]].") bestanden?".$testok[$i];} break; case "notset": if (strlen($vals[$expr[1]])>0){ if ($debug){ echo "Test notset mit (".$vals[$expr[1]].") nicht bestanden.";}} else { $testok[$i]="ja"; if ($debug){ echo " Test notset (".$expr[1].") mit (".$vals[$expr[1]].") bestanden.";}} break; //2ifsession:APVLEVEL:Arzt case "session": // UNFERTIG if ($_SESSION[$expr[1]]==$expr[2]){ $testok[$i]="ja"; } break; case "cookie_is": // UNFERTIG if ($_COOKIE[$expr[1]]==$expr[2]){ $testok[$i]="ja"; } else { $testok[$i]="nein"; } //if ($debug){ echo $tid.':... $_COOKIE[$expr[1]]==$expr[2]:'.$expr[1]."=".$expr[2]." bestanden:".$testok[$i]; echo "
"; print_r($_COOKIE);echo "
";} break; case "cookie_notset": // UNFERTIG if (!$_COOKIE[$expr[1]]){ $testok[$i]="ja"; }else { $testok[$i]="nein"; } //if ($debug){ echo $tid.':... $_COOKIE[$expr[1]]==$expr[2]:'.$expr[1]."=".$expr[2]." bestanden:".$testok[$i]; echo "
"; print_r($_COOKIE);echo "
";} break; case "cookie_isnot": // UNFERTIG if ($_COOKIE[$expr[1]]!=$expr[2]){ $testok[$i]="ja"; }else { $testok[$i]="nein"; } //if ($debug){ echo $tid.':... $_COOKIE[$expr[1]]==$expr[2]:'.$expr[1]."=".$expr[2]." bestanden:".$testok[$i]; echo "
"; print_r($_COOKIE);echo "
";} break; } // Filtern: if ($testok[$i]!="ja"){ $p[1]=preg_replace("#\{\{test_".$tid."\}\}(.*?)\{\{/test_".$tid."\}\}#s", $repl, $p[1]); $p[2]=preg_replace("#\{\{test_".$tid."\}\}(.*?)\{\{/test_".$tid."\}\}#s", $repl, $p[2]); $p[3]=preg_replace("#\{\{test_".$tid."\}\}(.*?)\{\{/test_".$tid."\}\}#s", $repl, $p[3]); $ht=preg_replace("#\{\{test_".$tid."\}\}(.*?)\{\{/test_".$tid."\}\}#s", $repl, $ht); $p[1]=preg_replace("#\{\{test".$tid."\}\}(.*?)\{\{/test".$tid."\}\}#s", $repl, $p[1]); $p[2]=preg_replace("#\{\{test".$tid."\}\}(.*?)\{\{/test".$tid."\}\}#s", $repl, $p[2]); $p[3]=preg_replace("#\{\{test".$tid."\}\}(.*?)\{\{/test".$tid."\}\}#s", $repl, $p[3]); $ht=preg_replace("#\{\{test".$tid."\}\}(.*?)\{\{/test".$tid."\}\}#s", $repl, $ht); } break; } } // Testbereiche säubern //$se=array("#\{\{(.*?)\}\}#s",""); $p[1]=preg_replace("#\{\{(.*?)\}\}#s", "", $p[1]); $p[2]=preg_replace("#\{\{(.*?)\}\}#s", "", $p[2]); $p[3]=preg_replace("#\{\{(.*?)\}\}#s", "", $p[3]); $ht=preg_replace("#\{\{(.*?)\}\}#s", "", $ht); } /// FORMULARE if (strpos($ht,"
")){ /// MEHRERE FORULARE preg_match_all("#(.*?)
#s",$ht,$forms); $forms=$forms[1]; $form_anz=count($forms); $form_ht=$forms[0]; // FORM-PARAMETER // 0always // 1fachgebiet=Zahnarzt $HTMLFormulare=explode("%%form%%",$p[3]); $formularHTML="";$form_ht=""; //echo "Formulare:".count($HTMLFormulare); preg_match_all("#(.*?)#s",$ht,$formpars); $formpars=$formpars[1]; $anz=count($formpars); for ($i=0; $i<=$anz; $i++){ preg_match_all("#(.*?)#s",$formpars[$i],$pval); $pval =$pval[1][0]; $formpar[$i]=$pval; // echo $pval."-"; if ($pval=="always"){ //echo "always".$i; // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } else if (strpos($pval,"=!=")){ //echo $pval." != ".$i; // Parameter $pa=explode("=!=",$pval); // gesetzt aber nicht pval //echo "ddd:".$pa[0]." 2:".$pa[1]." 3:".$p[$pa[0]]." 4:".$dataforward[$pa[0]]."
"; $pos = strpos($pa[1], '|'); if ($pos === false) { if ($_POST[$pa[0]]!=$pa[1] && $_POST[$pa[0]]!=""){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else { $nots=explode('|',$pa[1]); $x=0; foreach( $nots as $not ) { if ($_POST[$pa[0]]!=$not && $_POST[$pa[0]]!=""){ $x++; } } if ($x>0){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } } else if (strpos($pval,"!=")){ //echo $pval." != ".$i; // Parameter $pa=explode("!=",$pval); //echo "ddd:".$pa[0]." 2:".$pa[1]." 3:".$p[$pa[0]]." 4:".$dataforward[$pa[0]]."
"; $posSep = strpos($pa[1], '|'); if ($posSep === false) { if ($_POST[$pa[0]]!=$pa[1] && $dataforward[$pa[0]]!=$pa[1] && $p[$pa[0]]!=$pa[1]){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else { $nots=explode('|',$pa[1]); $x=0; foreach( $nots as $not ) { if ($_POST[$pa[0]]!=$not && $dataforward[$pa[0]]!=$not && $p[$pa[0]]!=$not){ // } else { $x++; } } if ($x==0){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } } else if (strpos($pval,"=")){ //echo $pval." = ".$i; // Parameter $pa=explode("=",$pval); //echo "ddd:".$pa[0]." 2:".$pa[1]." 3:".$p[$pa[0]]." 4:".$dataforward[$pa[0]]."
"; $pos = strpos($pa[1], '|'); $x=0; if ($pos === false) { if ($_POST[$pa[0]]==$pa[1] OR $_GET[$pa[0]]==$pa[1] OR ($dataforward[$pa[0]]==$pa[1] && $first_show==1) OR $p[$pa[0]]==$pa[1]){ $x++; } } else { $cs=explode('|',$pa[1]); foreach( $cs as $c ) { if ($_POST[$pa[0]]==$c OR $_GET[$pa[0]]==$c OR ($dataforward[$pa[0]]==$c && $first_show==1) OR $p[$pa[0]]==$c){ $x++; } } } if ($x>0){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else if (substr($pval,0,9)=="POSTorGET"){ //echo " POSTorGET "; // Parameter $pa=explode(":",$pval); if ($_POST[$pa[1]]!=""){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } else if ($_GET[$pa[1]]!=""){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else if (substr($pval,0,10)=="notPOSTGET"){ //echo " notPOSTGET "; // Parameter $pa=explode(":",$pval); if ($_POST[$pa[1]]=="" && $_GET[$pa[1]]==""){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else if (substr($pval,0,3)=="GET"){ //echo " POST "; // Parameter $pa=explode(":",$pval); if ($_GET[$pa[1]]){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else if (substr($pval,0,4)=="POST"){ //echo " POST "; // Parameter $pa=explode(":",$pval); /* if ($_POST[$pa[1]]){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } */ $posSep = strpos($pa[1], '|'); if ($posSep === false) { if ($_POST[$pa[1]]){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else { $posts=explode('|',$pa[1]); $x=0; foreach( $posts as $pos ) { if (trim($_POST[$pos])!=""){ // } else { $x++; } } if ($x==0){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } } else if (substr($pval,0,3)=="SET"){ //echo " SET "; // Parameter $pa=explode(":",$pval); if ($_POST[$pa[1]] || $dataforward[$pa[1]]!=""){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; //echo "1"; } else { //echo "0: ".$pa[1]." ".$dataforward[$pa[1]]; //print_r($dataforward); } } else if (substr($pval,0,6)=="NOTSET"){ //echo " NOTSET ".$_POST[$pa[1]]." ".$dataforward[$pa[1]]; // Parameter $pa=explode(":",$pval); if ($_POST[$pa[1]]=="" && $dataforward[$pa[1]]==""){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else if (substr($pval,0,7)=="SESSION"){ //SESSION:fachgebiet:zahnarzt //echo " SESSION "; // Parameter $pa=explode(":",$pval); //echo $pa[1].'=='.$pa[2]." ".$_SESSION[$pa[1]]; if ($_SESSION[$pa[1]]==$pa[2]){ // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } else { //echo " nop ".$pval; // Parameter $form_ht.=$forms[$i]; // HTML $formularHTML.=$HTMLFormulare[$i]; } } //echo "
".htmlentities($form_ht)."
"; //$formularHTML=$p[3]; } else { $formularHTML=$p[3]; $form_ht=$ht; } //echo "
"; print_r($form_ht);  echo "
";
	

	//// FELDER
	preg_match_all("#(.*?)#s",$form_ht,$defs);	$def=$defs[1];
	$anzfelder=count($def);
	global $cms_pagepar;
	//$form='
'."\n".$formularHTML."\n"; //kb_dump($formpar); /* if($formpar['submitmode']=="jquery"){ $form=''."\n".$formularHTML."\n"; } else { $form=''."\n".$formularHTML."\n"; } $form.=''."
\n"; */ $form=$formularHTML; unset($felder); if ($_POST["Submit"]==$formpar["savebutton"] OR (!$formpar["savebutton"] && $_POST["Submit"])OR (!$formpar["savebutton"] && $_POST["kbfc"].$p[0]=="kbfc".$p[0])){$savebut=1; } //if (!$_POST["Submit"]){ $first_show=1; } //echo "save:".$savebut."fs".$first_show; for ($i=0; $i<$anzfelder; $i++){ $d=$def[$i]; preg_match("#(.*?)#s",$d,$name); $name=$name[1]; preg_match("#(.*?)#s",$d,$typ); $typ =$typ[1]; preg_match("#(.*?)#s",$d,$required); $required=$required[1];// if ($required=="" || $required==0){ unset($required);} preg_match("#(.*?)#s",$d,$errortext); $errortext=$errortext[1]; $field_errortext=$errortext; preg_match("#(.*?)#s",$d,$tab); $tab=$tab[1]; preg_match("#(.*?)#s",$d,$cssclass); $cssclass =$cssclass[1]; preg_match("##s",$d,$style); $style =$style[1]; preg_match("#(.*?)#s",$d,$tag_ext); $tag_ext =$tag_ext[1]; // echo $i." ".$name."
"; switch ($typ) { case "plugin": preg_match("#(.*?)#s",$d,$callback); $callback=$callback[1]; preg_match("#(.*?)#s",$d,$param); $param=$param[1]; preg_match("#(.*?)#s",$d,$include); $include=$include[1]; preg_match("#(.*?)#s",$d,$default); $default =$default[1]; $felder[$i]=$name; if ($first_show){ if($dataforward){$wert[$i]=$dataforward[$name];} else if ($default){$wert[$i]=$default; } } else { $wert[$i]=strip_tags($_POST[$name]); } if($include){ include_once($include);} //echo "PLUGIN.".$callback; $res=call_user_func($callback,array("name"=>$name,"required"=>$required,"errortext"=>$errortext,"par"=>$param,"mode"=>$mode,"wert"=>$wert[$i],"submit"=>$formpar["savebutton"],"first_show"=>$first_show,"formpar"=>$formpar,"dataforward"=>$dataforward )); //print_r($res); $wert[$i]=$res["wert"]; $replace[$i]=$res["replace"]; $search[$i]="%%".$name."%%"; if($res["error"]){$error["plugin"].=" ".$res["error"];} break; case "transecho": //preg_match_all("#(.*?)#s",$d,$cols); $cols =$cols[1][0]; preg_match("#(.*?)#s",$d,$format); $format =$format[1]; preg_match("#(.*?)#s",$d,$modus); $modus=$modus[1]; $felder[$i]=$name; $wert[$i]=$p[$name]; $search[$i]="%%".$name."%%"; if ($format=="Datum") { $replace[$i]=date("d.m.Y",strtotime(trim($p[$name]))); } else { $replace[$i]=$p[$name]."\n";} if($mode=="Vorschau" || $modus=="hiddenfield"){$replace[$i]=$replace[$i].''; } break; case "calc_userfunction": preg_match("#(.*?)#s",$d,$callback); $callback=$callback[1]; preg_match("#(.*?)#s",$d,$inputfield); $inputfield=$inputfield[1]; preg_match("#(.*?)#s",$d,$mode); $mode=$mode[1]; preg_match("#(.*?)#s",$d,$db); $db=$db[1]; $felder[$i]=$name; $wert[$i]=""; if ($mode=="in" && $callback){ $wert[$i]=$dataforward[$inputfield]; $wert[$i]=call_user_func($callback,$wert[$i]); } else { if ($first_show){ $wert[$i]=$dataforward[$name]; } else { if ($callback){ $w=strip_tags($_POST[$inputfield]); switch ( $callback){ case 'now_SQL': $wert[$i]=date("Y-m-d H:i:s"); break; default: $wert[$i]=call_user_func($callback,$w); break; } } } } //echo "
retval:".$retval."
"; $search[$i]="%%".$name."%%"; $replace[$i]=$wert[$i]; if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } break; case "calcmd5": //passmd5calcmd5user preg_match("#(.*?)#s",$d,$calcfield); $calcfield =$calcfield[1]; $felder[$i]=$name; $wert[$i]=md5(strip_tags($_POST[$calcfield])); //echo "calcfield:".$calcfield.":".$_POST[$calcfield]; $search[$i]="%%".$name."%%"; $replace[$i]=$wert[$i]; if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } break; case "calcval": //passmd5calcmd5user preg_match("#(.*?)#s",$d,$calcfield); $calcfield=explode("+",$calcfield[1]); preg_match("#(.*?)#s",$d,$numformat); $numformat=explode("|",$numformat[1]); preg_match("#(.*?)#s",$d,$element); $element=$element[1]; preg_match("#(.*?)#s",$d,$cols); $cols =$cols[1]; preg_match("#(.*?)#s",$d,$max); $max =$max[1]; $felder[$i]=$name; $sum_a=count($calcfield); for ($s=0; $s<=$sum_a; $s++){ if (strpos($calcfield[$s],"*")){ $calcfield_mul=explode("*",$calcfield[$s]); $prod=$calcfield_mul[0]*$_POST[$calcfield_mul[1]]; $wert[$i]=$wert[$i]+$prod; } else { $wert[$i]=$wert[$i]+$_POST[$calcfield[$s]]; } } //echo "calcfield:".$calcfield.":".$_POST[$calcfield]; //echo $element; $search[$i]="%%".$name."%%"; if ($element=="disabled_input"){ $replace[$i]=''."\n"; } else { $replace[$i]=number_format($wert[$i],$numformat[0],$numformat[1],$numformat[2]); } //$replace[$i]=$wert[$i]; if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } break; case "calcanrede": //briefanredecalcanredeanrede|titel preg_match("#(.*?)#s",$d,$calcfield); $calcfield =$calcfield[1]; $felder[$i]=$name; $calcfields=explode("|",$calcfield); $cf_anrede=strip_tags($_POST[$calcfields[0]]); $cf_titel=strip_tags($_POST[$calcfields[1]]); if ($cf_anrede=="Frau"){$wert[$i]="Sehr geehrte Frau"; } if ($cf_anrede=="Herr"){$wert[$i]="Sehr geehrter Herr"; } if ($cf_anrede=="Mevr."){$wert[$i]="Geachte mevrouw"; } // Frau nl if ($cf_anrede=="Dhr."){$wert[$i]="Geachte heer"; } // Herr nl if ($cf_titel){ $wert[$i].=" ".$cf_titel; } //echo $_POST[$calcfields[0]].$calcfields[0]."calcanrede:".$wert[$i]; $search[$i]="%%".$name."%%"; $replace[$i]=$wert[$i]; if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } break; case "file": //r_bild1filepictemp500000image/gif|image/jpegimage/* preg_match("#(.*?)#s",$d,$cols); $cols =$cols[1]; preg_match("#(.*?)#s",$d,$tempdir); $tempdir=$tempdir[1]; preg_match("#(.*?)#s",$d,$max); $max=$max[1]; preg_match("#(.*?)#s",$d,$types); $types=$types[1]; preg_match("#(.*?)#s",$d,$accept); $accept=$accept[1]; preg_match("#(.*?)#s",$d,$extra); $extra =$extra[1]; preg_match("#(.*?)#s",$d,$filenamefunction); $filenamefunction =$filenamefunction[1]; preg_match("#(.*?)#s",$d,$fprefix); $fprefix =$fprefix[1]; $fprefix=""; preg_match("#(.*?)#s",$d,$filedisplayfunction); $filedisplayfunction =$filedisplayfunction[1]; $felder[$i]=$name; if ($first_show){ $wert[$i]=$dataforward[$name]; } else { if($_FILES[$name]["size"]){ $fileUL=kb_fileUL($name,$tempdir,$max,$types,'',$filenamefunction); $wert[$i]=$fileUL['fpath']; } else {$wert[$i]=$_POST[$name."name"];} } $search[$i]="%%".$name."%%"; $replace[$i]=''."\n"; if (!$first_show && $filedisplayfunction==""){$replace[$i].=$fileUL["ht_field"].$fileUL["error"].$fileUL["fname"];} else if ($wert[$i] && !$extra && $filedisplayfunction==""){ $replace[$i].=$wert[$i].''; } if ($extra=="new_win" && $wert[$i]){$replace[$i].=''.$wert[$i]."";} if ($filedisplayfunction){ if (function_exists($filedisplayfunction)) { $p['name']=$name; $displayfunction_ret=call_user_func($filedisplayfunction,$p,$wert[$i]); } else { echo "function does NOT exist:".$filedisplayfunction; } $replace[$i].=''; $replace[$i].=$displayfunction_ret["ht"]; } break; case "textupper": preg_match("#(.*?)#s",$d,$cols); $cols =$cols[1]; preg_match("#(.*?)#s",$d,$max); $max =$max[1]; $felder[$i]=$name; if ($first_show){ $wert[$i]=$dataforward[$name]; } else { $wert[$i]=strip_tags($_POST[$name]); } $wert[$i]=strtoupper($wert[$i]); $search[$i]="%%".$name."%%"; $replace[$i]=''."\n"; if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } break; case "textlower": preg_match("#(.*?)#s",$d,$cols); $cols =$cols[1]; preg_match("#(.*?)#s",$d,$max); $max =$max[1]; $felder[$i]=$name; if ($first_show){ $wert[$i]=$dataforward[$name]; } else { $wert[$i]=strip_tags($_POST[$name]); } $wert[$i]=strtolower($wert[$i]); $search[$i]="%%".$name."%%"; $replace[$i]=''."\n"; if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } break; case "text": preg_match("#(.*?)#s",$d,$cols); $cols =$cols[1]; preg_match("#(.*?)#s",$d,$max); $max =$max[1]; preg_match("#(.*?)#s",$d,$default); $default =$default[1]; preg_match("#(.*?)#s",$d,$format); $format =$format[1]; preg_match("#(.*?)#s",$d,$emptyget); $emptyget =$emptyget[1]; preg_match("#(.*?)#s",$d,$postfkt); $postfkt =$postfkt[1]; $add=''; preg_match("#(.*?)#s",$d,$add); $add =$add[1]; $felder[$i]=$name; if ($first_show){ if ($dataforward[$name]) { $wert[$i]=$dataforward[$name]; } else if ($default){$wert[$i]=trim($default); } } else { $wert[$i]=strip_tags($_POST[$name]); } if ($format=="Preis") { $wert[$i]=str_replace(",",".",$wert[$i]); } else if ($format=="strtolower") { $wert[$i]= strtolower($wert[$i]); } else if ($format=="ucwords") { $wert[$i]= ucwords($wert[$i]); } else if ($format=="ucfirst") { $wert[$i]= ucfirst($wert[$i]); } else if ($format=="strtoupper") { $wert[$i]= strtoupper($wert[$i]); } else if ($format=="int") { if (!$wert[$i]){$wert[$i]="0"; } else { $wert[$i]=intval($wert[$i]); } } if($required=="plznl"){ //$wert[$i]= strtoupper(str_replace(" ","",$wert[$i])); // "1234 AA" $wert[$i]= trim(strtoupper($wert[$i])); if (strlen($wert[$i])==6 && $wert[$i]{4}!=""){ $wert[$i]=substr($wert[$i],0,4)." ".substr($wert[$i],-2); } } if($wert[$i]=="" && $emptyget!=""){$wert[$i]=$_GET[$name]; } if ($required=="email"){$wert[$i]=strtolower($wert[$i]); } if ($postfkt && function_exists($postfkt)){ $wert[$i]=call_user_func($postfkt,$wert[$i]); } $search[$i]="%%".$name."%%"; $replace[$i]=''.$add."\n"; if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } break; case "pass": preg_match("#(.*?)#s",$d,$cols); $cols =$cols[1]; preg_match("#(.*?)#s",$d,$max); $max =$max[1]; $felder[$i]=$name; $wert[$i]=strip_tags($_POST[$name]); $search[$i]="%%".$name."%%"; $replace[$i]=''."\n"; if($mode=="Vorschau"){$replace[$i]='*****'; } break; case "textmul": preg_match("#(.*?)#s",$d,$cols); $cols =$cols[1]; preg_match("#(.*?)#s",$d,$rows); $rows =$rows[1]; preg_match("#(.*?)#s",$d,$max); $max =$max[1]; preg_match("#(.*?)#s",$d,$default); $default =$default[1]; preg_match("#(.*?)#s",$d,$html_ok); $html_ok =$html_ok[1]; $felder[$i]=$name; if ($first_show){ if ($dataforward[$name]) { $wert[$i]=$dataforward[$name]; } else if ($default){$wert[$i]=$default; } } else if($html_ok){ $wert[$i]=$_POST[$name]; } else { $wert[$i]=strip_tags($_POST[$name]); } $search[$i]="%%".$name."%%"; $replace[$i]=''; if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } //$replace[$i]=''."\n"; break; case "select": preg_match("#(.*?)#s",$d,$top); $top =$top[1]; preg_match("#(.*?)#s",$d,$valsrc); $valsrc =$valsrc[1]; preg_match("#(.*?)#s",$d,$param); $param =$param[1]; preg_match("#(.*?)#s",$d,$divider); $divider =$divider[1]; preg_match("#(.*?)#s",$d,$rows); $rows =$rows[1]; if(!$divider){$divider="|"; } //echo "VALSRC $valsrc"; if($valsrc=="years"){ unset($val); unset($text); preg_match("#(.*?)#s",$d,$years); $years =explode("|",$years[1]); if ($years[0]=="now"){ $years[0]=date("Y"); } if ($years[1]=="now"){ $years[1]=date("Y"); } if ($years[0] && $years[1] && ($years[0] < $years[1])){ for ( $y=$years[0]; $y <= $years[1]; $y++ ){ $val[] = $y; } } else if ($years[0] && $years[1] && ($years[0] > $years[1])){ for ( $y=$years[0]; $y >= $years[1]; $y-- ){ $val[] = $y; } } //echo "YEARS:".$years[0]."-".$years[1]; $valcount=count($val); $textcount=$valcount; $text = $val; } else if($valsrc){ //$v=call_user_func($valsrc,array("name"=>$name,"cssclass"=>$cssclass,"top"=>$top,"required"=>$required,"errortext"=>$errortext,"par"=>$param,"mode"=>$mode,"wert"=>$wert[$i],"submit"=>$formpar["savebutton"] )); $v=call_user_func($valsrc,$param); $val=$v["vals"]; $text=$v["texts"]; $valcount=$v["valcount"]; $textcount=$valcount; unset($v); } else { preg_match("#(.*?)#s",$d,$vals); $val =explode($divider,$vals[1]); $valcount=count($val); preg_match("#(.*?)#s",$d,$texts); $text =explode($divider,$texts[1]); $textcount=count($text); } //echo " T".$textcount."V".$valcount."TS:".$texts[1]; if ($textcount< $valcount){$text=$val; $textcount=$valcount;} if ($valcount < $textcount){$val=$text; $valcount=$textcount;} preg_match("#(.*?)#s",$d,$auto); $auto = $auto[1]; preg_match("#(.*?)#s",$d,$fixval); $fixval = $fixval[1]; preg_match("#(.*?)#s",$d,$default); $default =$default[1]; preg_match("#(.*?)#s",$d,$smode); $smode =$smode[1]; preg_match("#(.*?)#s",$d,$dataformat); $dataformat =$dataformat[1]; $felder[$i]=$name; if ($first_show){ if ($dataforward[$name]){$wert[$i]=$dataforward[$name]; } else if ($default){$wert[$i]=$default; } } else { if (!is_array($_POST[$name])){$wert[$i]=strip_tags($_POST[$name]);} else { $wert[$i]=$_POST[$name]; } } if ($fixval){ $wert[$i]=$fixval; } $search[$i]="%%".$name."%%"; if($smode=="multiple"){ if($dataformat=='kommaspace' && $first_show){ $w=explode(",",$wert[$i]); unset($sw); foreach ($w as $key => $value) { $sw[]=trim($value); } $wert[$i]=$sw; } if($rows<1){ $rows=1;} $c=''."\n"; if($smode=="multiple" && $dataformat=="kommaspace" && is_array($wert[$i])){ $wert[$i]=@implode(",",$wert[$i]); } if(is_array($wert[$i])){ $wert[$i]=@implode(", ",$wert[$i]); } if($mode=="Vorschau"){$replace[$i]=$wert[$i].''; } if($smode=="show"){$replace[$i]=''.$tx; } break; case "date": preg_match("#(.*?)#s",$d,$range); $range =$range[1]; preg_match("#(.*?)#s",$d,$default); $default =$default[1]; preg_match("#(.*?)#s",$d,$modedate); $modedate =$modedate[1]; preg_match("#(.*?)#s",$d,$nonull); $nonull =$nonull[1]; $felder[$i]=$name; if($modedate=="date-pick"){ if ($first_show){ if ($dataforward[$name]!="0000-00-00") { $wert[$i]=$dataforward[$name]; } else if ($default){$wert[$i]=$default; } else {$wert[$i]=""; } if($wert[$i]){ $d=explode("-",$wert[$i]); $yyyy=$d[0]; $mm=$d[1]; $dd=$d[2]; $ddate=$dd.".".$mm.".".$yyyy; } if ($default=="now"){ $yyyy=date("Y"); $mm=date("m"); $dd=date("d"); $ddate=date("d.m.Y"); } } else { $wert[$i]=strip_tags($_POST[$name]); $d=explode(".",$_POST[$name]); $dd=$d[0]; $mm=$d[1]; $yyyy=$d[2]; $wert[$i] = sprintf("%04d-%02d-%02d", $yyyy, $mm, $dd); $ddate= sprintf("%02d.%02d.%04d", $dd, $mm, $yyyy); } if($nonull && $dd==0 && $mm==0 && $yyy==0){ $ddate=""; $wert[$i]=""; } if ($_POST[$name]){ if ($range){ if (!@checkdate($mm,$dd,$yyyy)){$error[$i]="ja";} $r=explode("|",$range); if ($yyyy<$r[0] OR $yyyy>$r[1] ){$error[$i]="ja";} } } else { if (!$first_show && $required){$error[$i]="ja";} } $search[$i]="%%".$name."%%"; $replace[$i]=''."\n"; if($mode=="Vorschau"){$replace[$i]=$dd.".".$mm.".".$yyyy.''; } unset($ddate); } else { if ($first_show){ $wert[$i]=$dataforward[$name]; $d=explode("-",$dataforward[$name]); $yyyy=$d[0]; $mm=$d[1]; $dd=$d[2]; if ($default=="now"){ $yyyy=date("Y"); $mm=date("m"); $dd=date("d"); } } else { $wert[$i]=strip_tags($_POST[$name."y"]."-".$_POST[$name."m"]."-".$_POST[$name."d"]); $dd=strip_tags($_POST[$name."d"]); $mm=strip_tags($_POST[$name."m"]); $yyyy=strip_tags($_POST[$name."y"]); } $search[$i]="%%".$name."%%"; $replace[$i]=""; if($modedate!="year_only"){ $replace[$i]='.'."\n"; $replace[$i].='.'."\n"; } $replace[$i].=''."\n"; //$mm=$_POST[$name."m"]; $dat_d=$_POST[$name."d"]; $dat_y=$_POST[$name."y"]; if($modedate=="year_only"){ $wert[$i]=strip_tags($yyyy."-01-01"); $mm='01'; $dd='01'; } if ($mm && $dd && $yyyy){ //echo "range:".$range; if (substr($range,0,8)=="min_age:"){ //echo "\n*minAge..."; if (!checkdate($mm,$dd,$yyyy)){$error[$i]="ja";} $min_age=substr($range,9); //echo " min-age:".$min_age; $age= mktime (0,0,0,$mm,$dad,$yyyy); //echo " age_ts:".$age; if(mktime(0,0,0,date('m'),date('d'),date('Y')-$min_age)>$age){ //echo "\nOK"; } else { $error[$i]="ja"; } } else if ($range){ if (!@checkdate($mm,$dd,$yyyy)){$error[$i]="ja";} $r=explode("|",$range); if ($yyyy<$r[0] OR $yyyy>$r[1] ){$error[$i]="ja";} } } else { if (!$first_show && $required){$error[$i]="ja";} } if($mode=="Vorschau"){$replace[$i]=$dd.".".$mm.".".$yyyy.''; } } break; case "datetime": // 2006-08-07 13:18:04 preg_match("#(.*?)#s",$d,$range); $range =$range[1]; preg_match("#(.*?)#s",$d,$default); $default =$default[1]; preg_match("#(.*?)#s",$d,$trenner); $trenner =$trenner[1]; preg_match("#(.*?)#s",$d,$nonull); $nonull =$nonull[1]; preg_match("#(.*?)#s",$d,$dmode); $dmode =$dmode[1]; $felder[$i]=$name; $search[$i]="%%".$name."%%"; if($dmode=="datepicker"){ echo "datepicker"; if ($first_show){ $wert[$i]=$dataforward[$name]; if($nonull && $dataforward[$name]=="0000-00-00"){ $dataforward[$name]=""; } if ($default=="now"){ $wert[$i]=date("d.m.Y"); } } else { $wert[$i]=strip_tags($_POST[$name]); } if ($_POST[$name]){ if ($range){ $dt=explode(" ",$_POST[$name]); $d=$d[0]; $t=$d[1]; $d=explode("-",$d); $yyyy=$d[0]; $mm=$d[1]; $dd=$d[2]; $t=explode(":",$t); $h=$d[0]; $min=$d[1]; $sec=$d[2]; if (!checkdate($mm,$dd,$yyyy)){$error[$i]="ja";} $r=explode("|",$range); if ($yyyy<$r[0] OR $yyyy>$r[1] ){$error[$i]="ja";} } } else { if (!$first_show && $required){$error[$i]="ja";} } $replace[$i]='.'."\n"; if($mode=="Vorschau"){$replace[$i]=$dd.".".$mm.".".$yyyy." ".$h.":".$min.":".'Uhr'; } } else { if ($first_show){ $wert[$i]=$dataforward[$name]; if($nonull && $dataforward[$name]=="0000-00-00"){ $dataforward[$name]=""; } $dt=explode(" ",$dataforward[$name]); $d=$d[0]; $t=$d[1]; $d=explode("-",$d); $yyyy=$d[0]; $mm=$d[1]; $dd=$d[2]; $t=explode(":",$t); $h=$d[0]; $min=$d[1]; $sec=$d[2]; if ($default=="now"){ $yyyy=date("Y"); $mm=date("m"); $dd=date("d"); $h=date("H"); $min=date("i"); $sec="00"; } } else { $wert[$i]=strip_tags($_POST[$name."y"]."-".$_POST[$name."m"]."-".$_POST[$name."d"]." ".$_POST[$name."h"].":".$_POST[$name."min"].":00"); $dd=$_POST[$name."d"]; $mm=$_POST[$name."m"]; $yyyy=$_POST[$name."y"]; $h=$_POST[$name."h"]; $min=$_POST[$name."min"]; $sec="00"; } $replace[$i]='.'."\n"; $replace[$i].='.'."\n"; $replace[$i].=''."\n"; $replace[$i].=$trenner.':'."\n"; $replace[$i].=''."\n"; //$replace[$i].='' Uhr"\n"; if ($_POST[$name."m"] && $_POST[$name."d"] && $_POST[$name."y"] && $_POST[$name."h"] && $_POST[$name."min"]){ if ($range){ if (!checkdate($_POST[$name."m"],$_POST[$name."d"],$_POST[$name."y"])){$error[$i]="ja";} $r=explode("|",$range); if ($_POST[$name."y"]<$r[0] OR $_POST[$name."y"]>$r[1] ){$error[$i]="ja";} } } else { if (!$first_show && $required){$error[$i]="ja";} } if($mode=="Vorschau"){$replace[$i]=$dd.".".$mm.".".$yyyy." ".$h.":".$min.":".'Uhr'; } } break; case "checkbox": preg_match("#(.*?)#s",$d,$val); $val =$val[1]; preg_match("#(.*?)#s",$d,$checked); $checked =$checked[1]; preg_match("#(.*?)#s",$d,$getchecked); $getchecked =$getchecked[1]; preg_match("#(.*?)#s",$d,$disabled); $disabled =$disabled[1]; if($disa){$disa=' disabled="disabled"'; } if ($first_show){ $wert[$i]=$dataforward[$name]; if ($checked OR $wert[$i]==$val){ $check='" checked="checked"'; } if ($_GET[$getchecked] && $getchecked) {$check='" checked="checked"';} } else { if ($checked=="true" && $_POST["kbfcform"]!='kbfc'.$p['blockId']){$check='" checked="checked"'; } else {$check=''; } if ($_POST["kbfcform"]=='kbfc'.$p['blockId'] && $_POST[$name]==$val){$check='" checked="checked"';$wert[$i]=$val; } } $felder[$i]=$name; $search[$i]="%%".$name."%%"; $replace[$i]=''."\n"; if($mode=="Vorschau" && $check){$replace[$i]=$wert[$i].'Ja'; } if($mode=="Vorschau" && !$check){$replace[$i]=$wert[$i].'Nein'; } unset($check); break; case "radio": preg_match("#(.*?)#s",$d,$val); $val =$val[1]; preg_match("#(.*?)#s",$d,$varname); $varname =$varname[1]; preg_match("#(.*?)#s",$d,$checked); $checked =$checked[1]; if ($first_show){ $wert[$i]=$dataforward[$varname]; if ($checked OR $wert[$i]==$val){ $check='" checked="checked"'; } } else { if ($checked=="true" && $_POST["kbfcform"]!='kbfc'.$p['blockId']){$check='" checked="checked"'; } else {$check=''; } if ($_POST["kbfcform"]=='kbfc'.$p['blockId'] && $_POST[$varname]==$val){ $check='" checked="checked"';$wert[$i]=$val; $felder[$i]=$varname; $ret["followup"]["f"][$felder[$i]]=$wert[$i]; } } $followupinsert="no"; $search[$i]="%%".$name."%%"; $replace[$i]=''."\n"; if($mode=="Vorschau" && $check){$replace[$i]=$wert[$i].'Ja'; } if($mode=="Vorschau" && !$check){$replace[$i]=$wert[$i].'Nein'; } unset($check); break; case "js": preg_match("#(.*?)#s",$d,$jscript); $jscript =$jscript[1]; if($jscript==""){ preg_match("##s",$d,$jscript); $jscript =$jscript[1]; } preg_match("#(.*?)#s",$d,$jssrc); $jssrc =$jssrc[1]; $felder[$i]=$name; $search[$i]="%%".$name."%%"; //if ($val){ $wert[$i]=$jscript;} // if ($var){ $wert[$i]=$dataforward[$name];} if($jssrc){ $replace[$i]="\n".' '."\n"; } else { $replace[$i]="\n".' '."\n"; } break; case "show": $divider='|'; preg_match("#(.*?)#s",$d,$format); $format =$format[1]; preg_match("#(.*?)#s",$d,$mode); $mode =$mode[1]; preg_match("#(.*?)#s",$d,$var); $var =$var[1]; preg_match("#(.*?)#s",$d,$vals); $val =explode($divider,$vals[1]); $valcount=count($val); preg_match("#(.*?)#s",$d,$texts); $text =explode($divider,$texts[1]); $textcount=count($text); $add=''; preg_match("#(.*?)#s",$d,$add); $add =$add[1]; //preg_match("#(.*?)#s",$d,$var); $var =$var[1]; $felder[$i]=$name; if ($var){ $wert[$i]=$dataforward[$var]; } else { $wert[$i]=$dataforward[$name]; } $search[$i]="%%".$name."%%"; $replace[$i]=$wert[$i]; if ($mode=="initdf" && $var && $first_show){ $wert[$i]=$dataforward[$var]; } if ($mode=="initdf" && $var && !$first_show){ $wert[$i]=strip_tags($_POST[$var]); } if ($mode=="initget" && $var && $first_show){ $wert[$i]=strip_tags($_GET[$var]); } if (strtolower($mode)=="post" && $var) { $wert[$i]=strip_tags($_POST[$var]); $replace[$i]=$wert[$i]; } if ($mode=="initget" && $var && !$first_show) { $wert[$i]=strip_tags($_POST[$var]); } if ($format=="datetime_ts"){ if ($wert[$i]>0){$replace[$i]=date("d.m.Y H:i:s",$wert[$i]);} else {$replace[$i]="-";}} if ($format=="datetime"){ $replace[$i]=date("d.m.Y H:i:s",strtotime($wert[$i])); } if ($format=="int"){ $replace[$i]=intval($wert[$i]); if($wert[$i]==0 || !$wert[$i]){$replace[$i]=" 0 "; } $replace[$i]=" 0 "; } if ($mode=="select" && $val && $text){ foreach ($val as $key => $value) { if($value==$wert[$i]){ $replace[$i]=$text[$key]; } } } if ($mode=="initget" || $mode=="Vorschau" || $mode=="variable"){$replace[$i]=$wert[$i].''; } $replace[$i].=$add; break; case "hidden": preg_match("#(.*?)#s",$d,$val); $val =$val[1]; preg_match("#(.*?)#s",$d,$var); $var =$var[1]; preg_match("#(.*?)#s",$d,$txt); $txt=$txt[1]; preg_match("#(.*?)#s",$d,$f); $f=$f[1]; preg_match("#(.*?)#s",$d,$extra); $extra=$extra[1]; preg_match("#(.*?)#s",$d,$mode); $mode =$mode[1]; $felder[$i]=$name; $search[$i]="%%".$name."%%"; if ($val){ $wert[$i]=$val;} if ($var){ $wert[$i]=$dataforward[$name];} if ($f) { $wert[$i]=strip_tags($_POST[$f]); } if ($mode=="initget" && $var && $first_show){ $wert[$i]=strip_tags($_GET[$var]); } if (strtolower($mode)=="post" && $var) { $wert[$i]=strip_tags($_POST[$var]); $replace[$i]=$wert[$i]; } if ($mode=="initget" && $var && !$first_show) { $wert[$i]=strip_tags($_POST[$var]); } if ($extra=='nowwhenempty'){ if ($dataforward[$name]!="" && $wert[$i]==""){$wert[$i]=$dataforward[$name]; } else if ($wert[$i]=="") {$wert[$i]=date('Y-m-d H:i:s');} } if ($extra=='now'){ $wert[$i]=date('Y-m-d H:i:s'); } $replace[$i]=$txt.''."\n"; break; case "sessionvar": preg_match("#(.*?)#s",$d,$val); $val =$val[1]; $felder[$i]=$name; $search[$i]="%%".$name."%%"; $wert[$i]=$_SESSION[$val]; $replace[$i]=''."\n"; break; case "cookie": preg_match("#(.*?)#s",$d,$val); $val =$val[1]; $felder[$i]=$name; $search[$i]="%%".$name."%%"; $wert[$i]=$_COOKIE[$val]; $replace[$i]=''."\n"; break; case "button": preg_match("#(.*?)#s",$d,$val); $val =$val[1]; //$felder[$i]=$name; $search[$i]="%%".$name."%%"; if(!$cssclass || $cssclass==""){ $cssclass="button"; } $replace[$i]=''."\n"; break; case "submit": preg_match("#(.*?)#s",$d,$val); $val =$val[1]; //$felder[$i]=$name; $search[$i]="%%".$name."%%"; if(!$cssclass || $cssclass==""){ $cssclass="button"; } $replace[$i]=''."\n"; break; } //echo $_POST["kbfcform"]." - ".'kbfc'.$p['blockId']; if ($required && $_POST["kbfcform"]=='kbfc'.$p['blockId'] && $savebut){ //echo "req:".$name.$required." - "; if (substr($required,0,16)=="functionvalidate"){ //echo "functionvalidate".$required; // Momentan verwendet bei ISC $re_f=substr($required,17); if (function_exists($re_f)) { $e=call_user_func($re_f,$name,$wert[$i]); if ($e!=""){$error["plugin"]=$e; $error[$i]="ja"; } //else { $error[$i]=""; unset($error["plugin"]); } } else { echo "Überprüfung durch $re_f fehlgeschlagen"; } } else if (substr($required,0,13)=="functioncheck"){ //echo $required; $re_f=substr($required,14); if (function_exists($re_f)) { $e=call_user_func($re_f,$wert[$i]); if ($e){$error["plugin"]=$e; } } else { echo "Überprüfung durch $re_f fehlgeschlagen"; } } else if ($required=="uniqueuser" && !formCenter_check($p,"unique",$wert[$i],$name)){ if(!$wert[$i]){ $error["required"]="ja"; $error[$i]="ja"; } else { $error["uniqueuser"]="Der Benutzername existiert bereits. Bitte wählen Sie einen anderen."; $error[$i]="ja"; $checkuser_with_secpw=$wert[$i]; } } else if (substr($required,0,6)=="unique" && $required!="uniqueuser"){ $uniquepar=explode("|",$required); //echo "unique|".$uniquepar[1]; if(!$wert[$i]){ $error["required"]="ja"; $error[$i]="ja"; //echo "..Wert ja.."; } if(substr($uniquepar[0],6)=="email"){ if(preg_match("!^[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$!",$wert[$i])!=1){ $error["email"]="ja"; $error[$i]="ja"; $errortext=$error_text["email"]; //echo "..keine E-Mail.."; } } if($error[$i]!="ja"){ if(!formCenter_check($p,"unique",$wert[$i],$name,$uniquepar[1])){ $error[$i]="ja"; $error["unique"]="ja"; //$error["custom"]=$errortext; //echo "..E-Mail existiert.."; } } } else if ($required=="safepw"){ if($wert[$i]!=""){ if(strlen($wert[$i])>5){ if (!$checkuser_with_secpw){$checkuser_with_secpw="hfgilutuoir654"; } if ($checkuser_with_secpw){ include_once "assets/php/secpassw/securepwd.inc.php"; //securepwd ($check_wordbased, $check_dictionary, $check_lessthan, $check_onlynumbers, $baseword, $lessthan, $dictionary_file) $securepwd = new securepwd (true, false, true, true, $checkuser_with_secpw, 6, ""); if (!$securepwd->check($wert[$i])){ $error["safepw"]="Das Passwort ist unsicher (".$securepwd->geterror_list().").
Bitte wählen Sie ein anderes."; $error[$i]="ja"; } } else { $error["safepw"]="Das Passwort ist unsicher.
Bitte wählen Sie ein anderes."; $error[$i]="ja";} } else { $error["safepw"]="Das Passwort ist unsicher.
Bitte wählen Sie ein anderes.";$error[$i]="ja"; } } else { $error["required"]="ja";$error[$i]="ja"; } } else if ($required=="date"){ if ($error[$i]=="ja"){$error["date"]="ja";$error[$i]="ja";} //if (preg_match("/^\d{1,2}+\.d{1,2}+\.d{4}$/",$wert[$i])!=1){$derr="ja";} if ($derr=="ja" OR $error[$i]=="ja"){ $error["date"]="ja"; $error[$i]="ja";} } else if ($required=="email" && preg_match("!^[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$!",$wert[$i])!=1){$error["email"]="ja";$error[$i]="ja";} else if ($required=="plz" && preg_match("/^\d{5,6}$/",$wert[$i])!=1){$error["plz"]="ja";$error[$i]="ja";} else if ($required=="plz4" && preg_match("/^\d{4,6}$/",$wert[$i])!=1){$error["plz"]="ja";$error[$i]="ja";} else if ($required=="plznl" && preg_match("/^\d{4}\ [A-Z]{2}$/",strtoupper(trim($wert[$i])))!=1){$error["plz"]="ja";$error[$i]="ja";} else if ($required=="plzchecked"){ if (preg_match("/^\d{5,6}$/",$wert[$i])!=1){ $error["plz"]="ja";$error[$i]="ja"; } else if (!kb_PLZcheck($wert[$i])){ $error["plzchecked"]="ja";$error[$i]="ja"; } } else if ($wert[$i]=="") {$error["required"]="ja"; $error[$i]="ja".$name; $error[$i]="ja";} if($formpar["errorstyle"] && $error[$i]=="ja"){ $replace[$i]= ''.$replace[$i].$formpar["errorappend"]."";} if ($error[$i]=="ja"){ $error[$i]="ja: ".$felder[$i]; } if ($error[$i] ){ $error["custom"]=$errortext; } } if ($followupinsert!="no"){ $ret["followup"]["f"][$felder[$i]]=$wert[$i]; } unset($followupinsert); } if($formpar["phpcheck"] && $_POST["kbfcform"]=='kbfc'.$p['blockId'] && $savebut){ //echo $formpar["phpcheck"]; $formpar['error_text']=$error_text; $phpcheck=call_user_func($formpar["phpcheck"],$ret["followup"]["f"],$felder,$search,$replace,$formpar); if (is_array($phpcheck)){ if($phpcheck['error']!=""){$error["phpcheck"]=$phpcheck['error']; } $replace=$phpcheck['replace']; } else if ($phpcheck!=""){ $error["phpcheck"]=$phpcheck; } // $error["phpcheck"]; } for ($i=0; $i<$anzfelder; $i++){ $form=str_replace($search[$i],$replace[$i],$form); $p[1]=str_replace($search[$i],$replace[$i],$p[1]); // Intro $p[2]=str_replace($search[$i],$replace[$i],$p[2]); // Outro } // Ende Felder // Display preg_match_all("#(.*?)#s",$form_ht,$show); $show=$show[1]; $anz=count($show); //echo "Anz:".$anz; for ($i=0; $i<$anz; $i++){ $d=$show[$i]; preg_match("#(.*?)#s",$d,$typ); $typ =$typ[1]; preg_match("#(.*?)#s",$d,$name); $name =$name[1]; //echo "typ:".$typ; switch($typ){ case "df": preg_match("#(.*?)#s",$d,$numformat); $numformat=explode("|",$numformat[1]); preg_match("#(.*?)#s",$d,$calcfield); $calcfield=$calcfield[1]; $show_search[$i]="%%".$name."%%"; $show_replace[$i]=$dataforward[$calcfield]; break; case "plain": preg_match("#(.*?)#s",$d,$numformat); $numformat=explode("|",$numformat[1]); preg_match("#(.*?)#s",$d,$calcfield); $calcfield=$calcfield[1]; $show_search[$i]="%%".$name."%%"; $show_replace[$i]=$ret["followup"]["f"][$calcfield]; break; //activatelinkuserfunctionactivatelinkpatienten_activatelinkpatienten case "calcdisplay": preg_match("#(.*?)#s",$d,$numformat); $numformat=explode("|",$numformat[1]); preg_match("#(.*?)#s",$d,$calcfield); $calcfield=$calcfield[1]; if ($format="PlzToOrt"){ $show_search[$i]="%%".$name."%%"; //$show_replace[$i]=$ret["followup"]["f"]["ort"].$calcfield.$_POST[$calcfield]; $show_replace[$i]=kb_PLZcheck($ret["followup"]["f"]["plz"]); } break; //activatelinkuserfunctionactivatelinkpatienten_activatelinkpatienten case "userfunction": preg_match("#(.*?)#s",$d,$callback); $callback=$callback[1]; preg_match("#(.*?)#s",$d,$db); $db=$db[1]; $show_search[$i]="%%".$name."%%"; // z.B: newsletter_activatelink($dyn_db,$in) $dyn_db=dyn_data_db("",$db); if ($dyn_db){$retval=call_user_func($callback, $dyn_db,$ret["followup"]["f"]);} //echo "
retval:".$retval."
"; $show_replace[$i]=$retval; break; } $form=str_replace($show_search[$i],$show_replace[$i],$form); $p[1]=str_replace($show_search[$i],$show_replace[$i],$p[1]); // Intro $p[2]=str_replace($show_search[$i],$show_replace[$i],$p[2]); // Outro } if ($savebut){ //print_r($error); if($error["custom"]){ $error["text"]=$error["custom"]; } else if($error["plugin"]){ $error["text"]=$error["plugin"]; } else if($error["uniqueuser"]){ $error["text"]=$error_text["uniqueuser"]; } else if($error["safepw"]){$error["text"]=$error_text["safepw"]; } else if($error["date"]){$error["text"]=$error_text["date"]; } else if($error["email"]){$error["text"]=$error_text["email"]; } else if($error["unique"]){ $error["text"]=$error_text["unique"]; } else if($error["plz"]){$error["text"]=$error_text["plz"]; } else if($error["plzchecked"]){$error["text"]=$error_text["plzchecked"]; } else if($error["required"] && $error["custom"]){ $error["text"]=$error["custom"]; } else if($error["required"] && !$error["custom"]){ $error["text"]=$error_text["global"].$error["custom"]; } if($error["phpcheck"]){$error["text"]=$error["phpcheck"]; } //echo "

savebut

"; // REFERER-Check if ($error=="" && $_POST["kbfcform"]=='kbfc'.$p['blockId'] && $savebut){ $refe=parse_url(getenv("HTTP_REFERER")); if($refe['host']!=$_SERVER['HTTP_HOST'] && $refe['host']!=""){ $error["text"]="Externern Aufruf!"; } //else {$error["text"]="Interner Aufruf - OK ref:".$refe['host']." self:".$_SERVER['HTTP_HOST'];} } } $form=str_replace("%%error%%",$error["text"],$form); $block="\n\n"."\n"; // Javascript hinzu if($formpar["javascript"]){ $block.=''."\n"; } // Display $form.=''; // KEEP DATA FROM PREVIOUS FORM if(is_array($p['keepvalues'])){ //echo "Keep values:"; //print_r($p['keepvalues']); foreach ($p['keepvalues'] as $key => $value) { $form.=''; if(!@in_array($key,$felder)){ $anzfelder++; $felder[$anzfelder]=$key; $wert[$anzfelder]=$value; $search[$anzfelder]="%%".$key."%%"; } } } else if(is_array($p['keepvaluesbyfield'])){ //echo "Kept values:"; //print_r($p['keepvaluesbyfield']); foreach ($p['keepvaluesbyfield'] as $key => $value) { $form.=''; if(!@in_array($value,$felder)){ $anzfelder++; $felder[$anzfelder]=$value; $wert[$anzfelder]=$_POST[$value]; $search[$anzfelder]="%%".$value."%%"; } } } $forminner=$form; // FORM TAG if($formpar['submitmode']=="jquery"){ $form='
'."\n".$form."
\n"."\n"; } else { $form='
'."\n".$form."
\n"."\n"; } $block.='
'; //if ($_POST["kbfcform"]=='kbfc'.$p['blockId'] && $savebut){ echo "

savebut+form

"; print_r($felder); print_r($error); } if ($error=="" && $_POST["kbfcform"]=='kbfc'.$p['blockId'] && $savebut){ // Eingabe korrekt $kbFormCenterError=""; // extend if ($formpar["save_function"]){ //echo $formpar["save_function"]; //KB_DUMP($formpar["save_function"]); $save_par=explode("|",$formpar["save_function"]."|"); //KB_DUMP($felder);KB_DUMP($wert); //print_r($save_par); if($save_par[1]!="-" && $save_par[1]){ include_once($save_par[1]); } foreach ($felder as $key => $value) { $save_vals[$value]=$wert[$key]; } $pp=call_user_func($save_par[0],$save_par,$save_vals,$felder,$p,$search,$wert); $search=$pp['search']; $wert=$pp['wert']; $kbFormCenterError=$pp['error']; } if ($formpar["extend"]){ $extp=explode("|",$formpar["extend"]); //echo "0:".$extp[0]." 1:".$extp[1]." 2:".$extp[2]; if($formpar["extend"]['mode']!='no_inc' || $extp[0]!="-"){ include_once($extp[0]); } // extendvcards/vcard.php|vcardlink|##vcardlink## $pp=call_user_func($extp[1],$extp,$felder,$p,$search,$wert); } if ($formpar["cleanup"]){ $cleanupp=explode("|",$formpar["cleanup"]); if($cleanupp[0]!="-"){ include_once($cleanupp[0]); } $pp=call_user_func($cleanupp[1],$cleanupp,$felder,$p,$search,$wert); $felder=$pp['felder']; $p=$pp['p']; $search=$pp['search']; $wert=$pp['wert']; $kbFormCenterError=$pp['error']; unset($pp); } if ($m["DB"]=="update"){ $n=formCenter_db_update($felder,$p,$wert,$dataforward,$formpar['dbid']); //if (!$n) { $kbFormCenterError.="DB "; } $p[2]=str_replace("[[lid]]",$dataforward[$formpar['dbid']],$p[2]); } else if ($m["DB"]=="save"){ $lid=formCenter_db_eintrag($felder,$p,$wert,$formpar['dbid']); $p[2]=str_replace("[[lid]]",$lid,$p[2]); $ret["followup"]["f"]["lid"]=$lid; if (!$lid) { $kbFormCenterError.="DB Eintrag"; } } if ($m["Mail"]=="ja"){ if (!formCenter_mail($felder,$p,$search,$wert)) { $kbFormCenterError.="Mail "; } } if (!$kbFormCenterError){ $formht=$block; $block.=$p[2]."\n"; $ret['text']=$p[2]; $ret["followup"]["ready"]='kbfc'.$p['blockId']; $ret["ready"]=TRUE; $formht.=$p[1]."\n"."

".$form."

\n"; } else { $formfehler[$anz]="Fehler. Bitte versuchen Sie es noch einmal.";$ff=true; $b.=' Datenbankfehler. ('.$kbFormCenterError.')
'."\n"; $b.='Bitte versuchen Sie es noch einmal.'; $b.='
'; $ret['text']=$b; $block.=$b; $formht=$block; } $ret["error"]=""; if($formpar['keepDataHidden']){ $keepDataHidden_first=1; } } else { // Formular ausgeben $block.=$p[1]."\n"; $ret['text']=$p[1]; //$block.="Error:".$error; $block.="

".$form."

\n"; $ret["error"]="TRUE"; $formht=$block; //print_r($error); } if((($formpar['keepDataHidden'] && $_POST['kbfc_keptdata'.$p['blockId']]) || $keepDataHidden_first==1) && $p[10]!="Nein"){ foreach ($felder as $key => $value) { $save_vals[$value]=$wert[$key]; //$keepfelder[]= } $ret['keepvalues']=$save_vals; //echo "zu sichernde Felder:"; print_r($felder); $ret['keepvalues']['kbfc_keptdata'.$p['blockId']]=implode('|',$felder); $ret['keepvalues']['kbfcready'.$p['blockId']]=1; $block=''."\n"; $block.=''."\n"; $block.=''."\n"; $block=""."\n\n".'
'."\n".$block."
\n"."\n"; //$block="KeptDataHidden."; $formht=$block; $ret['forminner']=''; $ret["followup"]["ready"]='kbfc'.$p['blockId']; } $block.='
'."\n"; $block.=""."\n\n"; $ret["block"]=$block; $ret['text']=$ret['text']; $ret['form']=$form; $ret['formht']=$formht; $ret['errortext']=$error["text"]; $ret['forminner']=$forminner; $ret["followup"]["felder"]=$felder; $ret["followup"]["search"]=$search; $ret["followup"]["wert"]=$wert; $ret["followup"]["pt"]=$p; return $ret; } ?> <? echo htmlentities($title)." "; ?> // ?> // ?> // ?> */ ?> '; } ?> '."\n".''."\n".''."\n"; } ?>
  • Neuer Kontakt
  • Kontakte
  • "; ?>
  • Mein Messestand
  • Persönliche Daten
  • "; ?>
  • Persönliche Daten
  • Online-Vertrag abschließen
  • Vertrag per Post oder Fax
  • "; ?>
    Eingeloggt als
    "; ?>
    "; ?> '; } ?>
    Aktuelle News

    Was Sie wissen sollten:

    1.) Ein mehrseitiger Folder der Gastro-Online-Messe ist in diesem Monat in zahlreichen Fachzeitschriften als Beileger erschienen. Die Gesamtauflage der Beileger in diesem Monat beträgt knapp 200.000 Exemplare!

    2.) Der erste Individual- Messestand ist da! Schauen Sie doch gleich mal bei der Firma Objekt Shop vorbei!

    Sie sind Lieferant für die Gastronomie?

    Seien Sie von Anfang an auf Europas erster Gastro-Online-Messe mit Ihrem eigenen Stand vertreten!

    Nehmen Sie unverbindlich Kontakt auf und erfahren Sie mehr!

    '; }?>
    >
    Sie sind hier: STARTSEITE >Kontakt %%m_pfad%%
    "; $p[1]=stripslashes($p[1]); $p[2]="ff5_einzoomen.swf"; $p[2]=stripslashes($p[2]); $p[3]="mpv_wideillu_start.jpg"; $p[3]=stripslashes($p[3]); $p[4]="StandardFlash"; $p[4]=stripslashes($p[4]); $id='3'; $lang='de'; */ $block="\n\n"."\n"; $flashblockid="gom_widetop_".$thisblockpos; $block.='\n"; if ($p[2]){ $flashvars="p0=$p0&p1=$p1&p2=$p2&p3=$p3&p4=$p4&p5=$p5&p6=$p6&p7=$p7&p8=$p8&p9=$p9&img="."media/gom_widetop/images/".$p[3]; $flashsrc="media/gom_widetop/flash/".$p[2]; $flash_par=getimagesize($flashsrc); // 0: Breite | 1:Hoehe | 2:Art(1=GIF,2=JPG,3=PNG,4=SWF..13=SWC etc.) | 3:IMG-parameter als HTML oder //Array ( [0] => 780 [1] => 180 [2] => 4 [3] => width="780" height="180" [mime] => application/x-shockwave-flash ) //print_r($flash_par); $height=$flash_par[1]; $width =$flash_par[0]; if(!$flash_par){ $height=$img_par[1]; $width =$img_par[0];} if ($p[5]=="ausblendbar" && $_COOKIE["gom_widetop"]=="off"){$block.='';} else {$block.='';} $block.=''."\n"; } echo $block; $block.=""."\n\n"; if ($_GET['editmode']=="1"){ $editlink='
    '; echo $editlink; } ?>
    >
    > artselectPatient|ArztPatient|ArztBitte wählen3 arzttyptext30150 anredeselectFrau|HerrFrau|HerrBitte wählen titeltext30150 vornametext30150 nametext30150 emailtext30150email plztext6110plz orttext301503 strassetext30150 landselectde|at|chDeutschland|Österreich|SchweizBitte wählentrue submitbuttonsubmitAnmelden */ //print_r($dataforward); $p['blockId']=$id; if($parfornextmod['keepvalues']){ $p['keepvalues']=$parfornextmod['keepvalues']; } if($parfornextmod['keepvaluesbyfield']){ $p['keepvaluesbyfield']=$parfornextmod['keepvaluesbyfield']; } if($_POST['kbfc_keptdata'.$p['blockId']]){ //echo 'kbfc_keptdata'.$p['blockId']; $pnmf=@explode('|',$_POST['kbfc_keptdata'.$p['blockId']]); foreach ($pnmf as $key => $value) { $parfornextmod['keepvaluesbyfield'][]=$value; } $parfornextmod['keepvaluesbyfield'][]='kbfc_keptdata'.$p['blockId']; $parfornextmod['keepvaluesbyfield']=array_unique($parfornextmod['keepvaluesbyfield']); //$ret["followup"]["ready"]='kbfc'.$p['blockId']; } else { if($p[9]=="Ja" && is_array($parfornextmod)) { //$p[]=$parfornextmod; //$trans_keys=array_keys($parfornextmod); $tkeys=array_keys($parfornextmod); $a_tkeys=count($tkeys); for ($i=0; $i<$a_tkeys; $i++){ $p["trans_".$tkeys[$i]]=$parfornextmod[$tkeys[$i]]; //echo "trans_".$tkeys[$i]." - ".$parfornextmod[$tkeys[$i]]."
    "; } } if($p[9]=="Vormodul strikt" && is_array($parfornextmod)) { foreach ($parfornextmod as $key => $value) { //echo "Key: $key; Value: $value
    \n"; $p[$key]=$value; } } //print_r($parfornextmod); //print_r($p); if($p[4]) { include_once("assets/ini/db.ini.php"); } if($p[9]=="GET") { $dataforward=$_GET; //print_r($dataforward); $formCenter=formCenter($p,$dataforward,""); } else if($p[9]=="Vormodul") { if(is_array($parfornextmod)){ //print_r($parfornextmod); foreach ($parfornextmod as $key => $value) { $p[$key]=$value; } } $formCenter=formCenter($p,$dataforward,""); } else if($p[9]=="Nachmodul silent") { $pformcenter=$p; //$formCenter=formCenter($p,$dataforward,""); } else if($p[9]=="Vormodul strikt") { //print_r($dataforward); if (is_array($dataforward)){ $formCenter=formCenter($p,$dataforward,""); } } else if ($_POST["Submit"]=="Vorschau") { //$formCenter=formCenter($p,$_POST,"Vorschau"); } else if($p[9]=="Einfach mit Dataforward") { $formCenter=formCenter($p,$dataforward,""); } else { $formCenter=formCenter($p,"",""); } if($p[9]!="Nachmodul silent"){ $block=$formCenter["block"]; if($p[10]=="Ja" && $formCenter["followup"]["ready"]){ //unset($dataforward); foreach ($formCenter["followup"]["felder"] as $key => $value) { $dataforward[$value]=$formCenter["followup"]["wert"][$key]; } $dataforward['kbfcready'.$p['blockId']]=1; $parfornextmod['keepvalues']=$formCenter["keepvalues"]; //print_r($dataforward); } } } if ($mode=="edit"){ $editlink="Formcenter"; $block.=$editlink; } echo $block; ?>
    '."\n".''."\n".''."\n"; } if (!in_array($_SERVER["SERVER_ADDR"],$kb_ips)){ ?> '; } ?>