当前位置: 首页>>代码示例>>PHP>>正文


PHP rgblank函数代码示例

本文整理汇总了PHP中rgblank函数的典型用法代码示例。如果您正苦于以下问题:PHP rgblank函数的具体用法?PHP rgblank怎么用?PHP rgblank使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rgblank函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_field_input

 public function get_field_input($form, $value = '', $entry = null)
 {
     $form_id = $form['id'];
     $is_entry_detail = $this->is_entry_detail();
     $is_form_editor = $this->is_form_editor();
     $id = (int) $this->id;
     $product_name = !is_array($value) || empty($value[$this->id . '.1']) ? esc_attr($this->label) : esc_attr($value[$this->id . '.1']);
     $price = !is_array($value) || empty($value[$this->id . '.2']) ? $this->basePrice : esc_attr($value[$this->id . '.2']);
     $quantity = is_array($value) ? esc_attr($value[$this->id . '.3']) : '';
     if (rgblank($quantity)) {
         $quantity = 1;
     }
     if (empty($price)) {
         $price = 0;
     }
     $price = esc_attr($price);
     $has_quantity_field = sizeof(GFCommon::get_product_fields_by_type($form, array('quantity'), $this->id)) > 0;
     if ($has_quantity_field) {
         $this->disableQuantity = true;
     }
     $quantity_field = $has_quantity_field ? '' : "<input type='hidden' name='input_{$id}.3' value='" . esc_attr($quantity) . "' id='ginput_quantity_{$form_id}_{$this->id}' class='gform_hidden' />";
     $product_name_field = "<input type='hidden' name='input_{$id}.1' value='{$product_name}' class='gform_hidden' />";
     $disabled_text = $is_form_editor ? 'disabled="disabled"' : '';
     $field_type = $is_entry_detail || $is_form_editor ? 'text' : 'hidden';
     return $quantity_field . $product_name_field . "<input name='input_{$id}.2' id='ginput_base_price_{$form_id}_{$this->id}' type='{$field_type}' value='{$price}' class='gform_hidden ginput_amount' {$disabled_text}/>";
 }
开发者ID:nomadicmarc,项目名称:goodbay,代码行数:26,代码来源:class-gf-field-hiddenproduct.php

示例2: validate

 public function validate($value, $form)
 {
     // the POST value has already been converted from currency or decimal_comma to decimal_dot and then cleaned in get_field_value()
     $value = GFCommon::maybe_add_leading_zero($value);
     $raw_value = $_POST['input_' . $this->id];
     //Raw value will be tested against the is_numeric() function to make sure it is in the right format.
     $requires_valid_number = !rgblank($raw_value) && !$this->has_calculation();
     $is_valid_number = $this->validate_range($value) && GFCommon::is_numeric($raw_value, $this->numberFormat);
     if ($requires_valid_number && !$is_valid_number) {
         $this->failed_validation = true;
         $this->validation_message = empty($this->errorMessage) ? $this->get_range_message() : $this->errorMessage;
     } else {
         if ($this->type == 'quantity') {
             if (intval($value) != $value) {
                 $this->failed_validation = true;
                 $this->validation_message = empty($field['errorMessage']) ? __('Please enter a valid quantity. Quantity cannot contain decimals.', 'gravityforms') : $field['errorMessage'];
             } else {
                 if (!empty($value) && (!is_numeric($value) || intval($value) != floatval($value) || intval($value) < 0)) {
                     $this->failed_validation = true;
                     $this->validation_message = empty($field['errorMessage']) ? __('Please enter a valid quantity', 'gravityforms') : $field['errorMessage'];
                 }
             }
         }
     }
 }
开发者ID:anucha-digitalnoir,项目名称:freighthub-logistic,代码行数:25,代码来源:class-gf-field-number.php

示例3: bb_click_array_field_input

function bb_click_array_field_input($input, $field, $value, $lead_id, $form_id)
{
    if ($field["type"] == "bb_click_array") {
        $field_id = IS_ADMIN || $form_id == 0 ? "input_{$id}" : "input_" . $form_id . "_{$id}";
        $input_name = $form_id . '_' . $field["id"];
        $css = isset($field['cssClass']) ? $field['cssClass'] : "";
        $disabled_text = IS_ADMIN && RG_CURRENT_VIEW != "entry" ? "disabled='disabled'" : "";
        $amount = '';
        $clicked = '';
        if (is_array($value)) {
            $amount = esc_attr(rgget($field["id"] . ".1", $value));
            $clicked = rgget($field["id"] . ".5", $value);
        }
        $html = "<div id='{$field_id}' class='ginput_container bb-click-array-" . count($field['choices']) . " " . esc_attr($css) . "'>" . "\n";
        if (is_array($field["choices"])) {
            $choice_id = 0;
            $tabindex = GFCommon::get_tabindex();
            foreach ($field["choices"] as $choice) {
                $id = $field["id"] . '_' . $choice_id;
                $field_value = !empty($choice["value"]) || rgar($field, "enableChoiceValue") ? $choice["value"] : $choice["text"];
                if (rgblank($amount) && RG_CURRENT_VIEW != "entry") {
                    $active = rgar($choice, "isSelected") ? "checked='checked'" : "";
                } else {
                    $active = RGFormsModel::choice_value_match($field, $choice, $amount) ? "checked='checked'" : "";
                }
                if ($active) {
                    $amount = $field_value;
                }
                $field_class = $active ? 's-active' : 's-passive';
                if (rgar($field, 'field_bb_click_array_is_product')) {
                    require_once GFCommon::get_base_path() . '/currency.php';
                    $currency = new RGCurrency(GFCommon::get_currency());
                    $field_value = $currency->to_money($field_value);
                    $field_class .= ' s-currency';
                }
                $html .= sprintf('<div data-clickarray-value="%s" data-choice-id="%s" class="s-html-wrapper %s" id="%s">', esc_attr($field_value), $choice_id, $field_class, $id);
                $html .= sprintf('<div class="s-html-value">%s</div>', $field_value);
                $html .= sprintf("<label for='choice_%s' id='label_%s'>%s</label>", $id, $id, $choice["text"]);
                $html .= '</div>';
                $choice_id++;
            }
            $onblur = !IS_ADMIN ? 'if(jQuery(this).val().replace(" ", "") == "") { jQuery(this).val("' . $other_default_value . '"); }' : '';
            $onkeyup = empty($field["conditionalLogicFields"]) || IS_ADMIN ? '' : "onchange='gf_apply_rules(" . $field["formId"] . "," . GFCommon::json_encode($field["conditionalLogicFields"]) . ");' onkeyup='clearTimeout(__gf_timeout_handle); __gf_timeout_handle = setTimeout(\"gf_apply_rules(" . $field["formId"] . "," . GFCommon::json_encode($field["conditionalLogicFields"]) . ")\", 300);'";
            $value_exists = RGFormsModel::choices_value_match($field, $field["choices"], $value);
            $other_label = empty($field['field_bb_click_array_other_label']) ? 'My Best Gift' : $field['field_bb_click_array_other_label'];
            $other_class = rgar($field, 'enableOtherChoice') ? '' : 'hide';
            $html .= "<label for='input_{$field["formId"]}_{$field["id"]}_1' class='ginput_bb_click_array_other_label " . $other_class . "'>" . $other_label . "</label>";
            $other_class .= rgar($field, 'field_bb_click_array_is_product') ? ' ginput_amount gfield_price gfield_price_' . $field['formId'] . '_' . $field['id'] . '_1 gfield_product_' . $field['formId'] . '_' . $field['id'] . '_1' : '';
            $html .= "<input id='input_{$field["formId"]}_{$field["id"]}_1' name='input_{$field["id"]}_1' type='text' value='" . esc_attr($amount) . "' class='ginput_bb ginput_click_array_other " . $other_class . " " . $field['size'] . "' onblur='{$onblur}' {$tabindex} {$onkeyup} {$disabled_text}>";
            $html .= "<input id='input_{$field["formId"]}_{$field["id"]}_5' name='input_{$field["id"]}_5' type='hidden' value='" . esc_attr($clicked) . "' class='ginput_bb ginput_click_array_clicked'>";
        }
        $html .= "</div>";
        return $html;
    }
    return $input;
}
开发者ID:BrownBox,项目名称:bb-click-array,代码行数:56,代码来源:gravity-form-field.php

示例4: notification_page

 public static function notification_page()
 {
     $form_id = rgget('id');
     $notification_id = rgget("nid");
     if (!rgblank($notification_id)) {
         self::notification_edit_page($form_id, $notification_id);
     } else {
         self::notification_list_page($form_id);
     }
 }
开发者ID:rushabhrakholiya,项目名称:TEST,代码行数:10,代码来源:notification.php

示例5: validate

 public function validate($value, $form)
 {
     if (!class_exists('RGCurrency')) {
         require_once GFCommon::get_base_path() . '/currency.php';
     }
     $price = GFCommon::to_number($value);
     if (!rgblank($value) && ($price === false || $price < 0)) {
         $this->failed_validation = true;
         $this->validation_message = empty($this->errorMessage) ? __('Please enter a valid amount.', 'gravityforms') : $this->errorMessage;
     }
 }
开发者ID:renztoygwapo,项目名称:lincoln,代码行数:11,代码来源:class-gf-field-price.php

示例6: validate

 public function validate($value, $form)
 {
     $quantity_id = $this->id . '.3';
     $quantity = rgget($quantity_id, $value);
     if ($this->isRequired && rgblank($quantity) && !$this->disableQuantity) {
         $this->failed_validation = true;
         $this->validation_message = empty($this->errorMessage) ? esc_html__('This field is required.', 'gravityforms') : $this->errorMessage;
     } elseif (!empty($quantity) && (!is_numeric($quantity) || intval($quantity) != floatval($quantity) || intval($quantity) < 0)) {
         $this->failed_validation = true;
         $this->validation_message = esc_html__('Please enter a valid quantity', 'gravityforms');
     }
 }
开发者ID:kidaak,项目名称:gravityforms,代码行数:12,代码来源:class-gf-field-calculation.php

示例7: validate

 public function validate($value, $form)
 {
     $email = is_array($value) ? rgar($value, 0) : $value;
     // Form objects created in 1.8 will supply a string as the value.
     if (!rgblank($value) && !GFCommon::is_valid_email($email)) {
         $this->failed_validation = true;
         $this->validation_message = empty($this->errorMessage) ? __('Please enter a valid email address.', 'gravityforms') : $this->errorMessage;
     } elseif ($this->emailConfirmEnabled && !empty($email)) {
         $confirm = is_array($value) ? rgar($value, 1) : rgpost('input_' . $this->id . '_2');
         if ($confirm != $email) {
             $this->failed_validation = true;
             $this->validation_message = __('Your emails do not match.', 'gravityforms');
         }
     }
 }
开发者ID:anucha-digitalnoir,项目名称:freighthub-logistic,代码行数:15,代码来源:class-gf-field-email.php

示例8: make_request

 /**
  * Make API request.
  * 
  * @access public
  * @param string $action
  * @param array $options (default: array())
  * @param string $method (default: 'GET')
  * @return void
  */
 public function make_request($action = null, $options = array(), $method = 'GET', $expected_code = 200, $return_key = null)
 {
     /* Build request options string. */
     $request_options = 'auth_token=' . $this->api_token;
     $request_options .= $method == 'GET' && !empty($options) ? '&' . http_build_query($options) : '';
     /* Build request URL. */
     $request_url = 'https://' . $this->account_url . '.batchbook.com/api/v1/' . $action . '.json?' . $request_options;
     /* Prepare request and execute. */
     $args = array('method' => $method, 'headers' => array('Content-Type' => 'application/json'));
     if ($method == 'POST' || $method == 'PUT') {
         $args['body'] = json_encode($options);
     }
     $response = wp_remote_request($request_url, $args);
     /* If WP_Error, die. Otherwise, return decoded JSON. */
     if (is_wp_error($response)) {
         die('Request failed. ' . $response->get_error_messages());
     } else {
         if (strpos($response['headers']['content-type'], 'application/json') === FALSE) {
             throw new Exception('Invalid account URL.');
         } else {
             $response_body = json_decode($response['body'], true);
             if (isset($response_body['error'])) {
                 throw new Exception($response_body['error']);
             }
             if (isset($response_body['code']) && $response_body['code'] !== $expected_code) {
                 throw new Exception($response_body['message']);
             }
             if (!rgblank($response_body)) {
                 return empty($return_key) || !empty($return_key) && !isset($response_body[$return_key]) ? $response_body : $response_body[$return_key];
             }
             /* If the body is empty, retrieve the ID from the location header. */
             $id = explode('/', $response['headers']['location']);
             return end($id);
         }
     }
 }
开发者ID:wp-premium,项目名称:gravityformsbatchbook,代码行数:45,代码来源:class-batchbook.php

示例9: validate_settings

 /**
  * Validates settings fields.
  * Validates that all fields are valid. Fields can be invalid when they are blank and marked as required or if it fails a custom validation check.
  * To specify a custom validation, use the 'validation_callback' field meta property and implement the validation function with the custom logic.
  * @param $fields - A list of all fields from the field meta configuration
  * @param $settings - A list of submitted settings values
  * @return bool - Returns true if all fields have passed validation, and false otherwise.
  */
 protected function validate_settings($fields, $settings)
 {
     foreach ($fields as $section) {
         foreach ($section['fields'] as $field) {
             $field_setting = rgar($settings, rgar($field, 'name'));
             if (is_callable(rgar($field, 'validation_callback'))) {
                 call_user_func(rgar($field, 'validation_callback'), $field, $field_setting);
             } else {
                 if (rgar($field, 'required')) {
                     if (rgblank($field_setting)) {
                         $this->set_field_error($field, rgar($field, 'error_message'));
                     }
                 }
             }
         }
     }
     $field_errors = $this->get_field_errors();
     $is_valid = empty($field_errors);
     return $is_valid;
 }
开发者ID:jonnSmith,项目名称:btforms,代码行数:28,代码来源:class-gf-addon.php

示例10: get_conditional_logic


//.........这里部分代码省略.........
                     $field_val = array();
                     $field_val[] = esc_attr($matches[1]);
                     //hour
                     $field_val[] = esc_attr($matches[2]);
                     //minute
                     $field_val[] = rgar($matches, 3);
                     //am or pm
                 }
             } elseif ($input_type == 'list') {
                 $parameter_val = RGFormsModel::get_parameter_value($field->inputName, $field_values, $field);
                 $field_val = is_array($parameter_val) ? $parameter_val : explode(',', str_replace('|', ',', $parameter_val));
                 if (is_array(rgar($field_val, 0))) {
                     $list_values = array();
                     foreach ($field_val as $row) {
                         $list_values = array_merge($list_values, array_values($row));
                     }
                     $field_val = $list_values;
                 }
             } else {
                 $field_val = RGFormsModel::get_parameter_value($field->inputName, $field_values, $field);
             }
         }
         //use default value if pre-populated value is empty
         $field_val = $field->get_value_default_if_empty($field_val);
         if (is_array($field->choices) && $input_type != 'list') {
             //radio buttons start at 0 and checkboxes start at 1
             $choice_index = $input_type == 'radio' ? 0 : 1;
             $is_pricing_field = GFCommon::is_pricing_field($field->type);
             foreach ($field->choices as $choice) {
                 if ($input_type == 'checkbox' && $choice_index % 10 == 0) {
                     $choice_index++;
                 }
                 $is_prepopulated = is_array($field_val) ? in_array($choice['value'], $field_val) : $choice['value'] == $field_val;
                 $is_choice_selected = rgar($choice, 'isSelected') || $is_prepopulated;
                 if ($is_choice_selected && $input_type == 'select') {
                     $price = GFCommon::to_number(rgar($choice, 'price')) == false ? 0 : GFCommon::to_number(rgar($choice, 'price'));
                     $val = $is_pricing_field && $field->type != 'quantity' ? $choice['value'] . '|' . $price : $choice['value'];
                     $default_values[$field->id] = $val;
                 } elseif ($is_choice_selected) {
                     if (!isset($default_values[$field->id])) {
                         $default_values[$field->id] = array();
                     }
                     $default_values[$field->id][] = "choice_{$form['id']}_{$field->id}_{$choice_index}";
                 }
                 $choice_index++;
             }
         } elseif (!rgblank($field_val)) {
             switch ($input_type) {
                 case 'date':
                     // for date fields; that are multi-input; and where the field value is a string
                     // (happens with prepop, default value will always be an array for multi-input date fields)
                     if (is_array($field->inputs) && (!is_array($field_val) || !isset($field_val['m']))) {
                         $format = empty($field->dateFormat) ? 'mdy' : esc_attr($field->dateFormat);
                         $date_info = GFcommon::parse_date($field_val, $format);
                         // converts date to array( 'm' => 1, 'd' => '13', 'y' => '1987' )
                         $field_val = $field->get_date_array_by_format(array($date_info['month'], $date_info['day'], $date_info['year']));
                     }
                     break;
                 case 'time':
                     if (is_array($field_val)) {
                         $ampm_key = key(array_slice($field_val, -1, 1, true));
                         $field_val[$ampm_key] = strtolower($field_val[$ampm_key]);
                     }
                     break;
                 case 'address':
                     $state_input_id = sprintf('%s.4', $field->id);
                     if (isset($field_val[$state_input_id]) && !$field_val[$state_input_id]) {
                         $field_val[$state_input_id] = $field->defaultState;
                     }
                     $country_input_id = sprintf('%s.6', $field->id);
                     if (isset($field_val[$country_input_id]) && !$field_val[$country_input_id]) {
                         $field_val[$country_input_id] = $field->defaultCountry;
                     }
                     break;
             }
             $default_values[$field->id] = $field_val;
         }
     }
     $button_conditional_script = '';
     //adding form button conditional logic if enabled
     if (isset($form['button']['conditionalLogic'])) {
         $logics .= '0: ' . GFCommon::json_encode(array('field' => $form['button']['conditionalLogic'], 'section' => null)) . ',';
         $dependents .= '0: ' . GFCommon::json_encode(array(0)) . ',';
         $fields_with_logic[] = 0;
         $button_conditional_script = "jQuery('#gform_{$form['id']}').submit(" . 'function(event, isButtonPress){' . '    var visibleButton = jQuery(".gform_next_button:visible, .gform_button:visible, .gform_image_button:visible");' . '    return visibleButton.length > 0 || isButtonPress == true;' . '}' . ');';
     }
     if (!empty($logics)) {
         $logics = substr($logics, 0, strlen($logics) - 1);
     }
     //removing last comma;
     if (!empty($dependents)) {
         $dependents = substr($dependents, 0, strlen($dependents) - 1);
     }
     //removing last comma;
     $animation = rgar($form, 'enableAnimation') ? '1' : '0';
     global $wp_locale;
     $number_format = $wp_locale->number_format['decimal_point'] == ',' ? 'decimal_comma' : 'decimal_dot';
     $str = "if(window['jQuery']){" . "if(!window['gf_form_conditional_logic'])" . "window['gf_form_conditional_logic'] = new Array();" . "window['gf_form_conditional_logic'][{$form['id']}] = { logic: { {$logics} }, dependents: { {$dependents} }, animation: {$animation}, defaults: " . json_encode($default_values) . ", fields: " . json_encode($field_dependents) . " }; " . "if(!window['gf_number_format'])" . "window['gf_number_format'] = '" . $number_format . "';" . 'jQuery(document).ready(function(){' . "gf_apply_rules({$form['id']}, " . json_encode($fields_with_logic) . ', true);' . "jQuery('#gform_wrapper_{$form['id']}').show();" . "jQuery(document).trigger('gform_post_conditional_logic', [{$form['id']}, null, true]);" . $button_conditional_script . '} );' . '} ';
     return $str;
 }
开发者ID:fjbeteiligung,项目名称:development,代码行数:101,代码来源:form_display.php

示例11: all_leads_page

 public static function all_leads_page()
 {
     $view = rgget('view');
     $lead_id = rgget('lid');
     if ($view == 'entry' && (rgget('lid') || !rgblank(rgget('pos')))) {
         require_once GFCommon::get_base_path() . '/entry_detail.php';
         GFEntryDetail::lead_detail_page();
     } else {
         if ($view == 'entries' || empty($view)) {
             require_once GFCommon::get_base_path() . '/entry_list.php';
             GFEntryList::all_leads_page();
         } else {
             $form_id = rgget('id');
             do_action('gform_entries_view', $view, $form_id, $lead_id);
         }
     }
 }
开发者ID:healthcommcore,项目名称:osnap,代码行数:17,代码来源:gravityforms.php

示例12: entry_detail_pagination_link

 public static function entry_detail_pagination_link($pos, $label = '', $class = '', $icon = '')
 {
     $href = !rgblank($pos) ? 'href="' . add_query_arg(array('pos' => $pos), remove_query_arg(array('pos', 'lid'))) . '"' : '';
     $class .= ' gf_entry_pagination_link';
     $class .= $pos !== false ? ' gf_entry_pagination_link_active' : ' gf_entry_pagination_link_inactive';
     return '<a ' . $href . ' class="' . $class . '" title="' . $label . '"><i class="fa-lg ' . $icon . '"></i></a></li>';
 }
开发者ID:danaiser,项目名称:hollandLawns,代码行数:7,代码来源:entry_detail.php

示例13: update_lead_field_value

 public static function update_lead_field_value($form, $lead, $field, $lead_detail_id, $input_id, $value)
 {
     global $wpdb;
     $lead_id = $lead['id'];
     $form_id = $form['id'];
     $lead_detail_table = self::get_lead_details_table_name();
     $lead_detail_long_table = self::get_lead_details_long_table_name();
     if (!rgblank($value)) {
         $value = apply_filters('gform_save_field_value', $value, $lead, $field, $form, $input_id);
         $truncated_value = GFCommon::safe_substr($value, 0, GFORMS_MAX_FIELD_LENGTH);
         if ($lead_detail_id > 0) {
             $result = $wpdb->update($lead_detail_table, array('value' => $truncated_value), array('id' => $lead_detail_id), array('%s'), array('%d'));
             if (false === $result) {
                 return false;
             }
             //insert, update or delete long value
             $sql = $wpdb->prepare("SELECT count(0) FROM {$lead_detail_long_table} WHERE lead_detail_id=%d", $lead_detail_id);
             $has_long_field = intval($wpdb->get_var($sql)) > 0;
             //delete long field if value has been shortened
             if ($has_long_field && GFCommon::safe_strlen($value) <= GFORMS_MAX_FIELD_LENGTH) {
                 $sql = $wpdb->prepare("DELETE FROM {$lead_detail_long_table} WHERE lead_detail_id=%d", $lead_detail_id);
                 $result = $wpdb->query($sql);
                 if (false === $result) {
                     return false;
                 }
             } else {
                 if ($has_long_field) {
                     $result = $wpdb->update($lead_detail_long_table, array('value' => $value), array('lead_detail_id' => $lead_detail_id), array('%s'), array('%d'));
                     if (false === $result) {
                         return false;
                     }
                 } else {
                     if (GFCommon::safe_strlen($value) > GFORMS_MAX_FIELD_LENGTH) {
                         $result = $wpdb->insert($lead_detail_long_table, array('lead_detail_id' => $lead_detail_id, 'value' => $value), array('%d', '%s'));
                         if (false === $result) {
                             return false;
                         }
                     }
                 }
             }
         } else {
             $result = $wpdb->insert($lead_detail_table, array('lead_id' => $lead_id, 'form_id' => $form_id, 'field_number' => $input_id, 'value' => $truncated_value), array('%d', '%d', '%F', '%s'));
             if (false === $result) {
                 return false;
             }
             if (GFCommon::safe_strlen($value) > GFORMS_MAX_FIELD_LENGTH) {
                 //read newly created lead detal id
                 $lead_detail_id = $wpdb->insert_id;
                 //insert long value
                 $result = $wpdb->insert($lead_detail_long_table, array('lead_detail_id' => $lead_detail_id, 'value' => $value), array('%d', '%s'));
                 if (false === $result) {
                     return false;
                 }
             }
         }
     } else {
         //Deleting long field if there is one
         $sql = $wpdb->prepare("DELETE {$lead_detail_long_table} FROM {$lead_detail_long_table}\n\t\t\t\tJOIN (\n\t\t\t\t\tSELECT ld.id FROM {$lead_detail_table} ld\n\t\t\t\t\tWHERE lead_id=%d AND field_number BETWEEN %s AND %s\n\t\t\t\t) tmp\n\t\t\t\tON tmp.id = {$lead_detail_long_table}.lead_detail_id", $lead_id, doubleval($input_id) - 0.0001, doubleval($input_id) + 0.0001);
         $result = $wpdb->query($sql);
         if ($result === false) {
             return false;
         }
         //Deleting details for this field
         $sql = $wpdb->prepare("DELETE FROM {$lead_detail_table} WHERE lead_id=%d AND field_number BETWEEN %s AND %s ", $lead_id, doubleval($input_id) - 0.0001, doubleval($input_id) + 0.0001);
         $result = $wpdb->query($sql);
         if (false === $result) {
             return false;
         }
     }
     return true;
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:71,代码来源:forms_model.php

示例14: initialize_api

 /**
  * Initialized Zoho CRM API if credentials are valid.
  * 
  * @access public
  * @return bool
  */
 public function initialize_api()
 {
     if (!is_null($this->api)) {
         return true;
     }
     /* Include the API library. */
     if (!class_exists('Zoho_CRM')) {
         require_once 'includes/class-zohocrm.php';
     }
     /* Get the plugin settings */
     $settings = $this->get_plugin_settings();
     /* If the auth token, return null. */
     if (rgblank($settings['authToken'])) {
         return null;
     }
     $this->log_debug(__METHOD__ . "(): Validating API credentials.");
     $zohocrm = new Zoho_CRM($settings['authToken']);
     try {
         /* Run API test. */
         $zohocrm->get_users();
         /* Log that test passed. */
         $this->log_debug(__METHOD__ . '(): API credentials are valid.');
         /* Assign Zoho CRM object to the class. */
         $this->api = $zohocrm;
         return true;
     } catch (Exception $e) {
         /* Log that test failed. */
         $this->log_error(__METHOD__ . '(): API credentials are invalid; ' . $e->getMessage());
         return false;
     }
 }
开发者ID:wp-premium,项目名称:gravityformszohocrm,代码行数:37,代码来源:class-gf-zohocrm.php

示例15: payment_details_box

    public static function payment_details_box($lead, $form)
    {
        ?>
		<!-- PAYMENT BOX -->
		<div id="submitdiv" class="stuffbox">
			<h3 class="hndle" style="cursor:default;">
                <span><?php 
        echo $lead['transaction_type'] == 2 ? esc_html__('Subscription Details', 'gravityforms') : esc_html__('Payment Details', 'gravityforms');
        ?>
</span>
			</h3>

			<div class="inside">
				<div id="submitcomment" class="submitbox">
					<div id="minor-publishing" style="padding:10px;">
						<?php 
        $payment_status = apply_filters('gform_payment_status', $lead['payment_status'], $form, $lead);
        if (!empty($payment_status)) {
            ?>
							<div id="gf_payment_status" class="gf_payment_detail">
								<?php 
            esc_html_e('Status', 'gravityforms');
            ?>
:
								<span id="gform_payment_status"><?php 
            echo $payment_status;
            // May contain HTML
            ?>
</span>
							</div>

							<?php 
            $payment_date = apply_filters('gform_payment_date', GFCommon::format_date($lead['payment_date'], false, 'Y/m/d', $lead['transaction_type'] != 2), $form, $lead);
            if (!empty($payment_date)) {
                ?>
								<div id="gf_payment_date" class="gf_payment_detail">
									<?php 
                echo $lead['transaction_type'] == 2 ? esc_html__('Start Date', 'gravityforms') : esc_html__('Date', 'gravityforms');
                ?>
:
									<span id='gform_payment_date'><?php 
                echo $payment_date;
                // May contain HTML
                ?>
</span>
								</div>
							<?php 
            }
            $transaction_id = apply_filters('gform_payment_transaction_id', $lead['transaction_id'], $form, $lead);
            if (!empty($transaction_id)) {
                ?>
								<div id="gf_payment_transaction_id" class="gf_payment_detail">
									<?php 
                echo $lead['transaction_type'] == 2 ? esc_html__('Subscription Id', 'gravityforms') : esc_html__('Transaction Id', 'gravityforms');
                ?>
:
									<span id='gform_payment_transaction_id'><?php 
                echo $transaction_id;
                // May contain HTML
                ?>
</span>
								</div>
							<?php 
            }
            $payment_amount = apply_filters('gform_payment_amount', GFCommon::to_money($lead['payment_amount'], $lead['currency']), $form, $lead);
            if (!rgblank($payment_amount)) {
                ?>
								<div id="gf_payment_amount" class="gf_payment_detail">
									<?php 
                echo $lead['transaction_type'] == 2 ? esc_html__('Recurring Amount', 'gravityforms') : esc_html__('Amount', 'gravityforms');
                ?>
:
									<span id='gform_payment_amount'><?php 
                echo $payment_amount;
                // May contain HTML
                ?>
</span>
								</div>
							<?php 
            }
        }
        do_action('gform_payment_details', $form['id'], $lead);
        ?>
					</div>
				</div>
			</div>
		</div>
	<?php 
    }
开发者ID:christopherhodges,项目名称:wp-api,代码行数:89,代码来源:entry_detail.php


注:本文中的rgblank函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。