コード例 #1
0
}
$base_price = floatval(str_replace(array('$', ',', ' '), '', $_POST["base_price"]));
$max_entries = intval($max_entries);
// Create the form.
$form = BigTreeAutoModule::createItem("btx_form_builder_forms", 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 = "";
foreach ($_POST["type"] as $key => $type) {
    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) {
            $column = BigTreeAutoModule::createItem("btx_form_builder_fields", array("form" => $form, "type" => "column", "position" => $position));
            $alignment = "left";
            // Otherwise we're starting the second column of the set, just change the alignment.
        } elseif ($alignment == "left") {
            $alignment = "right";
        }
    } elseif ($type == "column_end") {
        if ($alignment == "right") {
            $column = 0;
            $alignment = "";
        }
    } elseif ($type) {
        BigTreeAutoModule::createItem("btx_form_builder_fields", array("form" => $form, "column" => $column, "alignment" => $alignment, "type" => $type, "data" => $_POST["data"][$key], "position" => $position));
    }
    $position--;
}
$admin->growl("Form Builder", "Created Form");
BigTree::redirect(MODULE_ROOT);
コード例 #2
0
        $email .= $address["street2"] . "\n";
    }
    $email .= $address["city"] . ", " . $address["state"] . " " . $address["zip"] . "\n";
    $email .= $address["country"];
    $email .= "\n\n";
    $email .= "Credit Card Info:\n";
    $email .= $card["type"] . "\n";
    $email .= "**** **** **** " . $pg->Last4CC . "\n";
    $email .= "Expires " . $card["month"] . "/" . $card["year"];
    $email .= "\n\n";
    $email .= "Total Charged: \$" . number_format($total, 2);
}
// Get rid of saved data or errors.
unset($_SESSION["form_builder"]);
// Add the entry to the entries table.
BigTreeAutoModule::createItem("btx_form_builder_entries", array("form" => $form["id"], "data" => $entry, "created_at" => "NOW()"));
// Update the totals for the form and recache it.
sqlquery("UPDATE btx_form_builder_forms SET entries = (entries + 1), last_entry = NOW(), total_collected = (total_collected + " . round($total, 2) . ") WHERE id = '" . $form["id"] . "'");
BigTreeAutoModule::recacheItem($form["id"], "btx_form_builder_forms");
// Get the no-reply domain
$no_reply_domain = str_replace(array("http://www.", "https://www.", "http://", "https://"), "", DOMAIN);
$email_title = $page_header ? $page_header : $bigtree["page"]["nav_title"];
$email = $email_title . ' - Form Submission
' . str_repeat("=", strlen($email_title)) . '==================

' . $email;
// Send out email alerts
$emails = explode(",", $emails);
foreach ($emails as $e) {
    $e = trim($e);
    mail($e, $email_title . " - Form Submission", $email, "From: no-reply@{$no_reply_domain}");
コード例 #3
0
ファイル: process.php プロジェクト: matthisamoto/Graphfan
    // If we have an edit_id we're modifying something that exists.
    if ($edit_id) {
        // If the edit id starts with a "p" it's a pending entry we're publishing.
        if (substr($edit_id, 0, 1) == "p") {
            $edit_id = BigTreeAutoModule::publishPendingItem($table, substr($edit_id, 1), $item, $many_to_many, $tags);
            $admin->growl($bigtree["module"]["name"], "Updated & Published " . $bigtree["form"]["title"]);
            $did_publish = true;
            // Otherwise we're updating something that is already published
        } else {
            BigTreeAutoModule::updateItem($table, $edit_id, $item, $many_to_many, $tags);
            $admin->growl($bigtree["module"]["name"], "Updated " . $bigtree["form"]["title"]);
            $did_publish = true;
        }
        // We're creating a new published entry.
    } else {
        $edit_id = BigTreeAutoModule::createItem($table, $item, $many_to_many, $tags);
        $admin->growl($bigtree["module"]["name"], "Created " . $bigtree["form"]["title"]);
        $did_publish = true;
    }
}
// Kill off any applicable locks to the entry
if ($edit_id) {
    $admin->unlock($table, $edit_id);
}
// Figure out if we should return to a view with search results / page / sorting preset.
if (isset($_POST["_bigtree_return_view_data"])) {
    $return_view_data = unserialize(base64_decode($_POST["_bigtree_return_view_data"]));
    if (!$bigtree["form"]["return_view"] || $bigtree["form"]["return_view"] == $return_view_data["view"]) {
        $redirect_append = array();
        unset($return_view_data["view"]);
        // We don't need the view passed back.
コード例 #4
0
<?php

BigTree::globalizePOSTVars();
if ($type == "Location") {
    list($lat, $lon) = explode(" ", $query);
    $query = array("latitude" => $lat, "longitude" => $lon, "radius" => $radius);
}
$id = BigTreeAutoModule::createItem("btx_social_feed_queries", array("service" => $service, "type" => $type, "query" => $query, "cached_info" => $cached_info), $category_parser);
BTXSocialFeed::sync($id);
$admin->growl("Social Feed", "Created Query");
BigTree::redirect(MODULE_ROOT . "view-queries/");