Пример #1
0
    function create_table_front_end_data()
    {
        $sql = 'CREATE TABLE ' . frontend_controls_data_Table() . '(
		id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
		form_id INTEGER(10) NOT NULL,
		field_Id INTEGER(10) NOT NULL,
		dynamic_control_id INTEGER(10) NOT NULL,
		dynamic_frontend_value TEXT NOT NULL,
		form_submit_id INTEGER(10) NOT NULL,
		PRIMARY KEY (id)
		) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE utf8_general_ci';
        dbDelta($sql);
    }
Пример #2
0
                    $ux_textarea = esc_attr($_REQUEST["ux_textarea_control_" . $dynamicId]);
                    $wpdb->query($wpdb->prepare("INSERT INTO " . frontend_controls_data_Table() . " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)", $form_id, $field_id, $control_dynamicId, $ux_textarea, $form_submit_id));
                    break;
                case 3:
                    $ux_email = esc_attr($_REQUEST["ux_txt_email_" . $dynamicId]);
                    $wpdb->query($wpdb->prepare("INSERT INTO " . frontend_controls_data_Table() . " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)", $form_id, $field_id, $control_dynamicId, $ux_email, $form_submit_id));
                    break;
                case 4:
                    $ux_dropdown = esc_attr($_REQUEST["ux_select_default_" . $dynamicId]);
                    $wpdb->query($wpdb->prepare("INSERT INTO " . frontend_controls_data_Table() . " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)", $form_id, $field_id, $control_dynamicId, $ux_dropdown, $form_submit_id));
                    break;
                case 5:
                    $ux_checkbox = $_REQUEST[$dynamicId . "_chk"];
                    $checkbox_options = "";
                    for ($flag1 = 0; $flag1 < count($ux_checkbox); $flag1++) {
                        $checkbox_options .= $ux_checkbox[$flag1];
                        if ($flag1 < count($ux_checkbox) - 1) {
                            $checkbox_options .= "-";
                        }
                    }
                    $wpdb->query($wpdb->prepare("INSERT INTO " . frontend_controls_data_Table() . " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)", $form_id, $field_id, $control_dynamicId, $checkbox_options, $form_submit_id));
                    break;
                case 6:
                    $ux_multiple = esc_attr($_REQUEST[$dynamicId . "_rdl"]);
                    $wpdb->query($wpdb->prepare("INSERT INTO " . frontend_controls_data_Table() . " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)", $form_id, $field_id, $control_dynamicId, $ux_multiple, $form_submit_id));
                    break;
            }
        }
        die;
    }
}
Пример #3
0
     }
     $wpdb->query($wpdb->prepare("DELETE FROM " . contact_bank_email_template_admin() . " WHERE form_id = %d ", $form_id));
     $wpdb->query($wpdb->prepare("DELETE FROM " . contact_bank_form_settings_Table() . " WHERE form_id = %d ", $form_id));
     $wpdb->query($wpdb->prepare("DELETE FROM " . frontend_controls_data_Table() . " WHERE form_id = %d ", $form_id));
     $wpdb->query($wpdb->prepare("DELETE FROM " . contact_bank_frontend_forms_Table() . " WHERE form_id = %d ", $form_id));
     $wpdb->query($wpdb->prepare("DELETE FROM " . contact_bank_layout_settings_Table() . " WHERE form_id = %d ", $form_id));
     $wpdb->query($wpdb->prepare("DELETE FROM " . create_control_Table() . " WHERE form_id = %d ", $form_id));
     $wpdb->query($wpdb->prepare("DELETE FROM " . contact_bank_contact_form() . " WHERE form_id = %d ", $form_id));
     die;
 } else {
     if ($_REQUEST["param"] == "delete_forms") {
         global $wpdb;
         $wpdb->query("TRUNCATE Table " . contact_bank_dynamic_settings_form());
         $wpdb->query("TRUNCATE Table " . contact_bank_email_template_admin());
         $wpdb->query("TRUNCATE Table " . contact_bank_form_settings_Table());
         $wpdb->query("TRUNCATE Table " . frontend_controls_data_Table());
         $wpdb->query("TRUNCATE Table " . contact_bank_frontend_forms_Table());
         $wpdb->query("TRUNCATE Table " . contact_bank_layout_settings_Table());
         $wpdb->query("TRUNCATE Table " . create_control_Table());
         $wpdb->query("TRUNCATE Table " . contact_bank_contact_form());
         die;
     } else {
         if ($_REQUEST["param"] == "submit_form_messages_settings") {
             $sql = "";
             $labels_for_email = "";
             $sql1 = array();
             $form_id = intval($_REQUEST["form_id"]);
             $form_settings = json_decode(stripcslashes($_REQUEST["form_settings"]), true);
             $array_delete_form_controls = json_decode(stripcslashes($_REQUEST["array_delete_form_controls"]), true);
             foreach ($array_delete_form_controls as $element) {
                 $sql1[] = $element;
Пример #4
0
<?php

global $wpdb;
$sql = "DROP TABLE " . contact_bank_contact_form();
$wpdb->query($sql);
$sql = "DROP TABLE " . create_control_Table();
$wpdb->query($sql);
$sql = "DROP TABLE " . contact_bank_dynamic_settings_form();
$wpdb->query($sql);
$sql = "DROP TABLE " . contact_bank_email_template_admin();
$wpdb->query($sql);
$sql = "DROP TABLE " . frontend_controls_data_Table();
$wpdb->query($sql);
$sql = "DROP TABLE " . contact_bank_frontend_forms_Table();
$wpdb->query($sql);
$sql = "DROP TABLE " . contact_bank_form_settings_Table();
$wpdb->query($sql);
$sql = "DROP TABLE " . contact_bank_layout_settings_Table();
$wpdb->query($sql);
$sql = "DROP TABLE " . contact_bank_licensing();
$wpdb->query($sql);
$sql = "DROP TABLE " . contact_bank_roles_capability();
$wpdb->query($sql);
delete_option("contact-bank-info-popup");
delete_option("contact-bank-version-number");
<?php

global $wpdb;
if (isset($_REQUEST["param"])) {
    if ($_REQUEST["param"] == "email_management") {
        $form_id = intval($_REQUEST["form_id"]);
        $form_submit_id = intval($_REQUEST["submit_id"]);
        $file_uploaded_path_admin = "";
        $email_content = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . contact_bank_email_template_admin() . "  WHERE form_id = %d ", $form_id));
        $frontend_control_value = $wpdb->get_results($wpdb->prepare("SELECT * FROM  " . contact_bank_frontend_forms_Table() . " JOIN  " . frontend_controls_data_Table() . " ON " . contact_bank_frontend_forms_Table() . ".submit_id = " . frontend_controls_data_Table() . ".form_submit_id  WHERE " . contact_bank_frontend_forms_Table() . ".submit_id = %d", $form_submit_id));
        for ($flag = 0; $flag < count($email_content); $flag++) {
            $email_exits = "";
            $email_to = $email_content[$flag]->email_to;
            $email_from = stripslashes($email_content[$flag]->email_from);
            $messageTxt = stripcslashes($email_content[$flag]->body_content);
            $email_subject = stripslashes($email_content[$flag]->subject);
            $email_from_name = stripslashes(htmlspecialchars_decode($email_content[$flag]->from_name, ENT_QUOTES));
            $email_reply_to = $email_content[$flag]->reply_to;
            $email_cc = $email_content[$flag]->cc;
            $email_bcc = $email_content[$flag]->bcc;
            for ($flag1 = 0; $flag1 < count($frontend_control_value); $flag1++) {
                $dynamicId = $frontend_control_value[$flag1]->dynamic_control_id;
                $email_to = str_replace("[control_" . $dynamicId . "]", $frontend_control_value[$flag1]->dynamic_frontend_value, $email_to);
                $email_from = str_replace("[control_" . $dynamicId . "]", $frontend_control_value[$flag1]->dynamic_frontend_value, $email_from);
                $email_subject = str_replace("[control_" . $dynamicId . "]", $frontend_control_value[$flag1]->dynamic_frontend_value, $email_subject);
                $email_from_name = str_replace("[control_" . $dynamicId . "]", $frontend_control_value[$flag1]->dynamic_frontend_value, $email_from_name);
                $email_reply_to = str_replace("[control_" . $dynamicId . "]", $frontend_control_value[$flag1]->dynamic_frontend_value, $email_reply_to);
                $email_cc = str_replace("[control_" . $dynamicId . "]", $frontend_control_value[$flag1]->dynamic_frontend_value, $email_cc);
                $email_bcc = str_replace("[control_" . $dynamicId . "]", $frontend_control_value[$flag1]->dynamic_frontend_value, $email_bcc);
                if ($frontend_control_value[$flag1]->field_Id == 5) {
                    $chk_options = str_replace("-", ", ", $frontend_control_value[$flag1]->dynamic_frontend_value);
Пример #6
0
</td>
				<?php 
        }
        ?>
				<td></td>
				</tr>
			</thead>
			<tbody>
				<?php 
        $form_submit_count = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . contact_bank_frontend_forms_Table() . " WHERE form_id = %d", $form_id));
        for ($flag1 = 0; $flag1 < count($form_submit_count); $flag1++) {
            ?>
						<tr>
						<?php 
            for ($flag2 = 0; $flag2 < count($form_data); $flag2++) {
                $form_control_labels_values = $wpdb->get_var($wpdb->prepare("SELECT dynamic_frontend_value FROM " . frontend_controls_data_Table() . " WHERE dynamic_control_id = %d AND form_id = %d AND form_submit_id = %d", $form_data[$flag2]->control_id, $form_id, $form_submit_count[$flag1]->submit_id));
                if ($form_data[$flag2]->field_id == 5) {
                    if ($form_control_labels_values != "") {
                        $chk_options = str_replace("-", ", ", $form_control_labels_values);
                        ?>
										<td><?php 
                        echo $chk_options;
                        ?>
</td>
										<?php 
                    } else {
                        ?>
										<td ></td>
										<?php 
                    }
                } else {