hauptdatei
<?php $tmpfile = "tmp.php"; include("func.php"); $inputs = addedinputs($tmpfile); $uniqueinputs = array_unique($inputs); array_shift($uniqueinputs); include("editform.php"); include("createform.php"); include("tools.php"); if(is_file("form.php")){ $sbv = "Formular ändern"; }else{ $sbv = "Formular erstellen"; } $inputs = addedinputs($tmpfile); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Kontaktformular-Generator</title> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" type="text/css" href="style.css" /> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /> <script type="text/javascript" src="ajax.js"></script> </head> <body <?php if(isset($_GET["type"])){echo 'onload="addinput(\''.$_GET["type"].'\')"';}elseif(isset($_GET["edit"]) && $_GET["edit"] != 'edit' && isset($_GET["id"])){echo 'onload="fademsg()"';}?>> <div id="message" style="display: none;" onclick="closepopup('message')"> <span><?php echo $msg; ?></span> <a href="javascript:closepopup('message')">Meldung ausblenden</a> </div> <div id="createformpopup" style="display: none;"> <div id="formoptions"> <form method="post" action="index.php?action=createform"> <br/> <a href="javascript:Klapptext('formoptions')" class="formoptions"><img src="images/plus.gif" id="image_formoptions" alt="+" title="Aus/Ein-klappen" border="0"> Optionale Einstellungen für das Formular:</a><br/> <div id="layer_formoptions" style="display: none;"> <input type="checkbox" value="checked" name="antispam" checked="checked"/> Anti-Spam aktivieren <span>(empfohlen)</span><br/> </div> <br/> <a href="javascript:closepopup('createformpopup')" class="abortcreateform">Abbrechen</a><input type="submit" name="submitcreateform" value="<?php echo $sbv; ?>" class="submitcreateform"/> </form> </div> </div> <div id="toolbox"> <a href="index.php?action=preview"><img src="images/preview.gif" width="12" height="12" alt="" border="0" /> Vorschau</a> <a href="index.php?action=load"><img src="images/load.gif" width="12" height="12" alt="" border="0" /> Formular laden</a> <a href="index.php?action=save"><img src="images/save.gif" width="12" height="12" alt="" border="0" /> Formular speichern</a> <a href="javascript:delform()"><img src="images/delete.gif" width="12" height="12" alt="" border="0" /> Formular löschen</a> </div> <div id="wrap"> <noscript>Bitte aktivieren Sie Javaskript, um diese Funktion nutzen zu können!</noscript> <div id="selecttype"> <span>Art des Eigabefelds:</span> <a href="javascript:addinput('txt')"><img src="images/plus.gif" width="" height="" alt="+" border="0"/> Textfeld</a> <a href="javascript:addinput('select')"><img src="images/plus.gif" width="" height="" alt="+" border="0"/> Auswahlfeld</a> <a href="javascript:addinput('radio')"><img src="images/plus.gif" width="" height="" alt="+" border="0"/> Radio-Buttons</a> <a href="javascript:addinput('checkbox')"><img src="images/plus.gif" width="" height="" alt="+" border="0"/> Checkbox</a> <a href="javascript:addinput('txtarea')"><img src="images/plus.gif" width="" height="" alt="+" border="0"/> großes Textfeld</a> </div> <!--<input type="hidden" name="addedinputs" value="0" id="addedinputs"/>--> <div id="inputs"> <?php $addedinputs = array_unique($inputs); // 'none' Werte im 0-Schluessel zusammenfassen if(count($addedinputs) == '1'){ echo '<div style="padding: 5px 0px; font-weight: bold; text-align: center;">Erstellen Sie bitte Ihr Formular!</div>'; }else{ ksort($addedinputs); array_shift($addedinputs); // 0-Schluessel entfernen foreach($addedinputs AS $addedinput){ $values = explode('[#]', $addedinput); $id = $values['0']; $type = $values['1']; $output = $type; ### Erweitern! echo '<div class="input">'; echo $output; echo '<a href="index.php?edit=delete&id='.$id.'" class="delete" title="Eingabefeld löschen"> </a><a href="index.php?edit=edit&id='.$id.'" class="edit" title="Eingabefeld überarbeiten"> </a><a href="index.php?edit=down&id='.$id.'" class="down" title="Eingabefeld eine Position nach unten verschieben"> </a><a href="index.php?edit=up&id='.$id.'" class="up" title="Eingabefeld eine Position nach oben verschieben"> </a></div>'; } } ?> </div> <br/> <div id="addinputbox"> <div id="default" style="display: block;"> Bitte wählen Sie rechts das hinzuzufügende Eingabefeld. </div> <div id="txt" style="display: none;"> <form method="post" action="index.php?type=txt"> <fieldset> <input type="hidden" name="txt" value="0" id="txt_hidden"/> <label for="txt_label">Bezeichnung: </label><input type="text" name="label" value="" id="txt_label"/><br/> <label for="txt_req">Pflichtfeld: </label><input type="checkbox" name="req" value="1" id="txt_req"/><br/> <br/><input type="submit" name="addtxt" value="Eingabefeld hinzufügen" class="addinput"/> </fieldset> </form> </div> <div id="select" style="display: none;"> <form method="post" action="index.php?type=select"> <fieldset> <input type="hidden" name="select" value="0" id="select_hidden"/> <label for="select_label">Bezeichnung: </label><input type="text" name="label" value="" id="select_label"/><br/> <label for="select_req">Pflichtfeld: </label><input type="checkbox" name="req" value="1" id="select_req"/><br/> <br/><input type="submit" name="addselect" value="Auswahlfeld hinzufügen" class="addinput"/> </fieldset> </form> </div> <div id="radio" style="display: none;"> <form method="post" action="index.php?type=radio"> <fieldset> <input type="hidden" name="radio" value="0" id="radio_hidden"/> <label for="radio_label">Bezeichnung: </label><input type="text" name="label" value="" id="radio_label"/><br/> <label for="radio_req">Pflichtfeld: </label><input type="checkbox" name="req" value="1" id="radio_req"/><br/> <br/><input type="submit" name="addradio" value="Radio-Button hinzufügen" class="addinput"/> </fieldset> </form> </div> <div id="checkbox" style="display: none;"> <form method="post" action="index.php?type=checkbox"> <fieldset> <input type="hidden" name="checkbox" value="0" id="checkbox_hidden"/> <label for="checkbox_label">Bezeichnung: </label><input type="text" name="label" value="" id="checkbox_label"/><br/> <label for="checkbox_req">Pflichtfeld: </label><input type="checkbox" name="req" value="1" id="checkbox_req"/><br/> <br/><input type="submit" name="addcheckbox" value="Checkbox hinzufügen" class="addinput"/> </fieldset> </form> </div> <div id="txtarea" style="display: none;"> <form method="post" action="index.php?type=txtarea"> <fieldset> <input type="hidden" name="txtarea" value="0" id="txtarea_hidden"/> <label for="txtarea_label">Bezeichnung: </label><input type="text" name="label" value="" id="txtarea_label"/><br/> <label for="txtarea_req">Pflichtfeld: </label><input type="checkbox" name="req" value="1" id="txtarea_req"/><br/> <br/><input type="submit" name="addtxtarea" value="großes Eingabefeld hinzufügen" class="addinput"/> </fieldset> </form> </div> </div> </form> <br/> <a href="javascript:openpopup('createformpopup')" class="createform">Formular erstellen</a> </div> <div id="developmentoutput"> <b>$inputs</b> = <?php print_r($inputs); ?> <br/><br/> <b>$addedinputs</b> = <?php print_r($addedinputs); ?> <br/><br/> <b>$uniqueinputs</b> = <?php print_r($uniqueinputs); ?> </div> </body> </html>