예제 #1
0
파일: single.php 프로젝트: zruiz/NG
</span>
                                        </div>
                                        <div class="star-rating-container">
                                        	<div class="star-rating" style="width:<?php 
    echo esc_attr($rates / 5 * 100);
    ?>
%"></div>
                                        </div>
                                    </div>
                                </div>
                                <div class="points-review">
                                	<div class="row">
                                    <?php 
    $total_fields = count($rating[0]);
    $half = $total_fields / 2;
    $half = imic_is_decimal($half) ? $half + 1 : $half;
    $half = floor($half);
    $st = 1;
    foreach ($rating[0] as $rate) {
        $total = count($rating[0]);
        $divide = $total / 2;
        if ($st == 1 || $st == $half + 1) {
            echo '<div class="col-md-6">';
        }
        ?>
                                        	<div class="review-point">
                                            	<strong><?php 
        echo esc_attr($rate[1]);
        ?>
</strong>
                                                <div class="star-rating-container">
예제 #2
0
파일: imi-functions.php 프로젝트: zruiz/NG
    function imic_set_ad_fields()
    {
        //echo "saibaba";
        global $imic_options;
        $custom_details = array();
        $category_slug = $_POST['slug'];
        $update_id = $_POST['update'];
        $required_value = '';
        $specifications = get_post_meta($update_id, 'feat_data', true);
        $term_id = get_term_by('slug', $category_slug, 'listing-category');
        $parents = get_ancestors($term_id->term_id, 'listing-category');
        $term_id = $term_id->term_id;
        $classifieds_details = get_option('imic_classifieds');
        $classifieds_details = !empty($classifieds_details) ? get_option('imic_classifieds') : array();
        if (array_key_exists($term_id, $classifieds_details) && !empty($classifieds_details)) {
            $custom_details = $classifieds_details[$term_id]['ad'];
            $custom_details = explode(',', $custom_details);
        } else {
            foreach ($parents as $parent) {
                $list_term = get_term_by('id', $parent, 'listing-category');
                if (array_key_exists($list_term->term_id, $classifieds_details) && !empty($classifieds_details)) {
                    $custom_details = $classifieds_details[$list_term->term_id]['ad'];
                    $custom_details = explode(',', $custom_details);
                    break;
                }
            }
        }
        if (empty($custom_details) && $imic_options['ad_listing_fields'] != 1) {
            $custom_details = $imic_options['custom_vehicle_details'];
        }
        $total_fields = count($custom_details);
        $half = $total_fields / 2;
        $half = imic_is_decimal($half) ? $half + 1 : $half;
        $half = floor($half);
        if (!empty($custom_details) && $imic_options['ad_listing_fields'] == 1) {
            echo "<div class=\"row\">";
            $st = 1;
            foreach ($custom_details as $field) {
                $label = get_post_meta($field, 'imic_plugin_value_label', true);
                $editable = get_post_meta($field, 'imic_plugin_status_after_payment', true);
                $disable = $editable == 0 && $payment_status != 0 ? 'disabled' : '';
                if ($st == 1 || $st == $half + 1) {
                    echo '<div class="col-md-6">';
                }
                $values = get_post_meta($field, 'specifications_value', true);
                $post_data = get_post($field);
                $spec_slug = $post_data->post_name;
                $required = get_post_meta($field, 'imic_plugin_required_mandatory', true);
                $integer = get_post_meta($field, 'imic_plugin_spec_char_type', true);
                $sub_fields = get_post_meta($field, 'imic_plugin_sub_field_switch', true);
                $sortable_class = $sub_fields == 1 ? "sortable-specs" : "";
                if ($integer == 0) {
                    $input_id = 'field-' . ($field + 2648);
                } elseif ($integer == 2) {
                    $input_id = 'char-' . ($field + 2648);
                } else {
                    $input_id = 'int-' . $field;
                }
                $required = $required == 1 ? 'mandatory' : '';
                $int_value = $integer == 1 ? 'integer-val' : '';
                echo '<label>' . __('Select ', 'framework') . get_the_title($field) . '</label>';
                if (count($values) > 1 && ($integer == 0 || $integer == 2)) {
                    echo '<select ' . $disable . ' name="' . basename(get_permalink($field)) . '" id="' . $input_id . '" class="' . $sortable_class . ' form-control selectpicker custom-cars-fields ' . $required . '">';
                    echo '<option value="0">' . __('Select', 'framework') . '</option>';
                    if ($update_id != '') {
                        if ($integer == 0) {
                            $key = array_search($field, $specifications['sch_title']);
                            $required_value = $specifications['start_time'][$key];
                        } elseif ($integer == 2) {
                            $required_value = get_post_meta($update_id, 'char_' . $spec_slug, true);
                        } else {
                            $required_value = get_post_meta($update_id, 'int_' . $spec_slug, true);
                        }
                    }
                    $key_select = $count = 0;
                    foreach ($values as $value) {
                        $required_select = $required_value == $value['imic_plugin_specification_values'] ? 'selected' : '';
                        if ($required_select != '') {
                            $key_select = $count;
                        }
                        echo '<option ' . esc_attr($required_select) . ' value="' . $value['imic_plugin_specification_values'] . '">' . $value['imic_plugin_specification_values'] . '</option>';
                        $count++;
                    }
                    echo '</select>';
                    if ($sub_fields == 1 && $integer == 0 || $sub_fields == 1 && $integer == 2) {
                        $child_field_class = $integer == 0 ? "field-" : "char-";
                        $child_field_class_select = $integer == 0 ? "field-" : "child-";
                        echo '<div class="' . $child_field_class . ($field * 111 + 2648) . ' sorting-dynamic">';
                        if (!empty($values[$key_select]['imic_plugin_specification_values_child'])) {
                            echo '<label>' . __('Select ', 'framework') . get_post_meta($field, 'imic_plugin_sub_field_label', true) . '</label>';
                            echo '<select ' . $disable . ' id="' . $child_field_class_select . ($field * 111 + 2648) . '" name="' . $field * 111 . '" class="form-control selectpicker custom-cars-fields">';
                            echo '<option value="0">' . __('Select ', 'framework') . get_the_title($field) . '</option>';
                            if ($update_id != '') {
                                if ($specification_data_type == "0") {
                                    $key = array_search($field * 111, $specifications['sch_title']);
                                    $required_value = $specifications['start_time'][$key];
                                } else {
                                    $child_field_slug = imic_the_slug($field);
                                    $required_value = get_post_meta($update_id, 'child_' . $child_field_slug, true);
                                }
                                $child_vals = $values[$key_select]['imic_plugin_specification_values_child'];
                                if (!empty($child_vals)) {
                                    $child_values = explode(',', $child_vals);
                                }
                                foreach ($child_values as $value) {
                                    $required_select = $required_value == $value ? 'selected' : '';
                                    echo '<option ' . $required_select . ' value="' . $value . '">' . $value . '</option>';
                                }
                            }
                            echo '</select>';
                        }
                        echo '</div>';
                    }
                } else {
                    if ($update_id != '') {
                        $required_value = '';
                        if ($integer == 0) {
                            $key = array_search($field, $specifications['sch_title']);
                            $required_value = $specifications['start_time'][$key];
                        } elseif ($integer == 2) {
                            $required_value = get_post_meta($update_id, 'char_' . $spec_slug, true);
                        } else {
                            $required_value = get_post_meta($update_id, 'int_' . $spec_slug, true);
                        }
                    }
                    if ($label != '') {
                        echo '<div class="input-group">
														<input ' . $disable . ' type="text" id="' . $input_id . '" value="' . $required_value . '" name="' . basename(get_permalink($field)) . '" class="form-control custom-cars-fields ' . $required . ' ' . $int_value . '" placeholder="' . get_the_title($field) . '">
														<span class="input-group-addon">' . $label . '</span></div>';
                    } else {
                        echo '<input ' . $disable . ' type="text" id="' . $input_id . '" value="' . $required_value . '" name="' . basename(get_permalink($field)) . '" class="form-control custom-cars-fields ' . $required . ' ' . $int_value . '" placeholder="' . get_the_title($field) . '">';
                    }
                }
                if ($st == $half || count($custom_details) == $st) {
                    echo '</div>';
                }
                $st++;
            }
            //echo "</div>";
            if (is_user_logged_in()) {
                ?>
	<button id="ss" class="btn btn-info pull-right save-searched-value"><?php 
                echo esc_attr_e('Save', 'framework');
                ?>
 &amp; <?php 
                echo esc_attr_e('continue', 'framework');
                ?>
</button><?php 
            } else {
                echo '<a class="btn btn-primary pull-right" data-toggle="modal" data-target="#PaymentModal">' . __('Login/Register', 'framework') . '</a>';
            }
        } else {
            echo "blank";
        }
        die;
    }