Beispiel #1
0
function Manage_Form_maker()
{
    require_once "form_maker_functions.php";
    require_once "form_maker_functions.html.php";
    if (!function_exists('print_html_nav')) {
        require_once "nav_function/nav_html_func.php";
    }
    global $wpdb;
    if (isset($_GET["task"])) {
        $task = esc_html($_GET["task"]);
    } else {
        $task = "show";
    }
    if (isset($_GET["id"])) {
        $id = (int) $_GET["id"];
    } else {
        $id = 0;
    }
    switch ($task) {
        case 'update':
            update_form_maker();
            break;
        case 'save_update':
            save_update_form_maker();
            break;
        case 'update_complite':
            update_complete();
            display_form_lists();
            break;
        case "add_form":
            add_form();
            break;
        case "edit_form":
            edit_form_maker($id);
            break;
        case "Save":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
            }
            display_form_lists();
            break;
        case "Apply":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
                $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
            }
            forchrome($id);
            break;
        case "gotoedit":
            gotoedit();
            edit_form_maker($id);
            break;
        case "remove_form":
            remove_form($id);
            display_form_lists();
            break;
            // Form options.
        // Form options.
        case "form_options":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
                $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
            }
            wd_form_options($id);
            break;
        case "Save_form_options":
            Apply_form_options($id);
            forchrome($id);
            break;
        case "Apply_form_options":
            Apply_form_options($id);
            wd_form_options($id);
            break;
        case "save_as_copy":
            save_as_copy();
            display_form_lists();
            break;
        default:
            display_form_lists();
    }
}
Beispiel #2
0
function Manage_contact_form()
{
    require_once "contact_form_functions.php";
    require_once "contact_form_functions.html.php";
    if (!function_exists('print_html_nav')) {
        require_once "nav_function/nav_html_func.php";
    }
    global $wpdb;
    if (isset($_GET["task"])) {
        $task = esc_html($_GET["task"]);
    } else {
        $task = "show";
    }
    if (isset($_GET["id"])) {
        $id = (int) $_GET["id"];
    } else {
        $id = 0;
    }
    switch ($task) {
        case "add_form":
            add_form();
            break;
        case "edit_form":
            edit_contact_form($id);
            break;
        case "Save":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
            }
            display_form_lists();
            break;
        case "Apply":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
                $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
            }
            forchrome($id);
            break;
        case "gotoedit":
            gotoedit();
            edit_contact_form($id);
            break;
        case "remove_form":
            remove_form($id);
            display_form_lists();
            break;
            //	Actions_after_submission
        //	Actions_after_submission
        case "Actions_after_submission":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
                $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
            }
            Actions_after_submission($id);
            break;
        case "Save_Actions_after_submission":
            Apply_Actions_after_submission($id);
            edit_contact_form($id);
            break;
        case "Apply_Actions_after_submission":
            Apply_Actions_after_submission($id);
            Actions_after_submission($id);
            break;
            //	Edit_JavaScript
        //	Edit_JavaScript
        case "Edit_JavaScript":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
                $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
            }
            Edit_JavaScript($id);
            break;
        case "Save_Edit_JavaScript":
            Apply_Edit_JavaScript($id);
            edit_contact_form($id);
            break;
        case "Apply_Edit_JavaScript":
            Apply_Edit_JavaScript($id);
            Edit_JavaScript($id);
            break;
            //	Custom_text_in_email_for_administrator
        //	Custom_text_in_email_for_administrator
        case "Custom_text_in_email_for_administrator":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
                $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
            }
            Custom_text_in_email_for_administrator($id);
            break;
        case "Save_Custom_text_in_email_for_administrator":
            Apply_Custom_text_in_email_for_administrator($id);
            edit_contact_form($id);
            break;
        case "Apply_Custom_text_in_email_for_administrator":
            Apply_Custom_text_in_email_for_administrator($id);
            Custom_text_in_email_for_administrator($id);
            break;
            //	Custom text in email for user
        //	Custom text in email for user
        case "Custom_text_in_email_for_user":
            if ($id) {
                apply_form($id);
            } else {
                save_form();
                $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
            }
            Custom_text_in_email_for_user($id);
            break;
        case "Save_Custom_text_in_email_for_user":
            Apply_Custom_text_in_email_for_user($id);
            edit_contact_form($id);
            break;
        case "Apply_Custom_text_in_email_for_user":
            Apply_Custom_text_in_email_for_user($id);
            Custom_text_in_email_for_user($id);
            break;
        case "save_as_copy":
            save_as_copy();
            display_form_lists();
            break;
        default:
            display_form_lists();
    }
}