Esempio n. 1
0
if ($early_bird) {
    $early_bird_date = "'" . date("Y-m-d H:i:s", strtotime(str_replace("@", "", $_POST["early_bird_date"]))) . "'";
    $early_bird_base_price = floatval(str_replace(array('$', ',', ' '), '', $_POST["early_bird_base_price"]));
} else {
    $early_bird_date = "NULL";
}
$base_price = floatval(str_replace(array('$', ',', ' '), '', $_POST["base_price"]));
$max_entries = intval($max_entries);
BigTreeAutoModule::updateItem("btx_form_builder_forms", $form, array("title" => $title, "paid" => $paid, "base_price" => $base_price, "early_bird_base_price" => $early_bird_base_price, "early_bird_date" => $early_bird_date, "limit_entries" => $limit_entries, "max_entries" => $max_entries));
// Setup the default column, sort position, alignment inside columns.
$position = count($_POST["type"]);
$column = 0;
$alignment = "";
// Get all the previous fields so we know which to delete.
$fields_to_delete = array();
$existing_fields = $fieldMod->getMatching("form", $form);
foreach ($existing_fields as $field) {
    $fields_to_delete[$field["id"]] = $field["id"];
}
foreach ($_POST["type"] as $key => $type) {
    $id = $_POST["id"][$key];
    // The field still exists, remove it from the list to delete
    if ($id) {
        unset($fields_to_delete[$id]);
    }
    if ($type == "column_start") {
        // If we're starting a set of columns and don't have an alignment it's a new set.
        if (!$alignment) {
            if (!$id) {
                $column = $fieldMod->add(array("form" => $form, "type" => "column", "position" => $position), false, false, true);
            } else {
 static function getEntries($id)
 {
     $mod = new BigTreeModule("btx_form_builder_entries");
     return $mod->getMatching("form", $id, "id DESC");
 }