<?php $entry = BTXFormBuilder::getEntry($bigtree["commands"][0]); $form = BTXFormBuilder::getForm($entry["form"]); function _local_draw_form_builder_form_fields($fields) { global $entry; foreach ($fields as $field) { $value = _local_recursive_clean($entry["data"][$field["id"]]); $field["data"] = json_decode($field["data"], true); $label = $field["data"]["label"] ? $field["data"]["label"] : ucwords($field["type"]); if ($field["type"] == "column") { _local_draw_form_builder_form_fields($field["fields"]); } elseif ($field["type"] != "section") { echo "<fieldset>"; echo "<label><strong>{$label}</strong></label>"; echo "<p>"; if ($field["type"] == "name") { echo $value["first"] . " " . $value["last"] . ""; } elseif ($field["type"] == "address") { echo $value["street"] . "<br />"; if ($value["street2"]) { echo $value["street2"] . "<br />"; } echo $value["city"] . ", " . $value["state"] . " " . $value["zip"] . "<br />" . $value["country"] . ""; } elseif ($field["type"] == "checkbox") { if (is_array($value)) { echo implode(", ", $value) . ""; } else { echo $value; }
<?php $page = $_POST["page"] ? $_POST["page"] : 1; $search = $_POST["search"] ? $_POST["search"] : ""; $form = $_POST["form"] ? BTXFormBuilder::getForm($_POST["form"]) : $form; $entries = BTXFormBuilder::searchEntries($form["id"], $search, $page); $get_table_record = function ($fields) { global $get_table_record, $record, $entry; foreach ($fields as $field) { $value = $entry["data"][$field["id"]]; $t = $field["type"]; if ($t == "column") { $get_table_record($field["fields"]); } elseif ($t == "address") { $record[] = $value["street"]; $record[] = $value["street2"]; $record[] = $value["city"]; $record[] = $value["state"]; $record[] = $value["zip"]; $record[] = $value["country"]; } elseif ($t == "name") { $record[] = $value["first"]; $record[] = $value["last"]; } elseif ($t == "checkbox") { if (is_array($value)) { $record[] = implode(", ", $value); } else { $record[] = $value; } } elseif ($t != "section" && $field["type"] != "captcha") { $record[] = $value;
<?php $form = BTXFormBuilder::getForm($bigtree["commands"][0]); ?> <div class="container"> <form method="post" action="<?php echo MODULE_ROOT; ?> update/<?php echo $form["id"]; ?> /" class="module"> <?php include "_form.php"; ?> <footer> <input type="submit" class="button blue" value="Update" /> </footer> </form> </div>
<?php // Make sure this page is never cached. if (!defined("BIGTREE_DO_NOT_CACHE")) { define("BIGTREE_DO_NOT_CACHE", true); } $form = BTXFormBuilder::getForm($form); $settings = $cms->getSetting("settings"); // Make sure we're serving over HTTPS if ($form["paid"]) { $cms->makeSecure(); $form["fields"] = array_merge($form["fields"], array(array("type" => "section", "data" => json_encode(array("title" => "Billing Address & Payment", "description" => "Please enter your billing information as it appears on your credit card."))), array("type" => "name", "data" => json_encode(array("name" => "fb_cc_billing_name", "required" => true, "label" => "Billing Name"))), array("type" => "email", "data" => json_encode(array("name" => "fb_cc_billing_email", "required" => true, "label" => "Billing Email"))), array("type" => "address", "data" => json_encode(array("name" => "fb_cc_billing_address", "required" => true, "label" => "Billing Address"))), array("type" => "credit-card", "data" => json_encode(array("name" => "fb_cc_card", "required" => true))))); $page_link = str_replace("http://", "https://", WWW_ROOT) . $bigtree["page"]["path"] . "/"; } else { $page_link = WWW_ROOT . $bigtree["page"]["path"] . "/"; }