function cp_show_review($postvals) { global $wpdb; // if there's no form id it must mean the default form is being used so let's go grab those fields if (!$postvals['fid']) { // use this if there's no custom form being used and give us the default form $sql = $wpdb->prepare("SELECT field_label, field_name, field_type, field_values, field_req " . "FROM {$wpdb->cp_ad_fields} " . "WHERE field_core = '1' " . "ORDER BY field_id asc"); } else { // now we should have the formid so show the form layout based on the category selected $sql = $wpdb->prepare("SELECT f.field_label,f.field_name,f.field_type,f.field_values,f.field_perm,m.meta_id,m.field_pos,m.field_req,m.form_id " . "FROM {$wpdb->cp_ad_fields} f " . "INNER JOIN {$wpdb->cp_ad_meta} m " . "ON f.field_id = m.field_id " . "WHERE m.form_id = %s " . "ORDER BY m.field_pos asc", $postvals['fid']); } $results = $wpdb->get_results($sql); if ($results) { // loop through the custom form fields and display them echo cp_formbuilder_review($results); } else { echo sprintf(__('ERROR: The form template for form ID %s does not exist or the session variable is empty.', 'appthemes'), $postvals['fid'] . "\n\n"); } ?> <hr class="bevel" /> <div class="clr"></div> <?php }
function cp_show_review($postvals) { //var_dump($postvals); global $wpdb; // if there's no form id it must mean the default form is being used so let's go grab those fields if (empty($postvals['fid'])) { // use this if there's no custom form being used and give us the default form $sql = "SELECT field_label, field_name, field_type, field_values, field_req FROM {$wpdb->cp_ad_fields} WHERE field_core = '1' ORDER BY field_id asc"; } else { // now we should have the formid so show the form layout based on the category selected $sql = $wpdb->prepare("SELECT f.field_label,f.field_name,f.field_type,f.field_values,f.field_perm,m.meta_id,m.field_pos,m.field_req,m.form_id " . "FROM {$wpdb->cp_ad_fields} f " . "INNER JOIN {$wpdb->cp_ad_meta} m " . "ON f.field_id = m.field_id " . "WHERE m.form_id = %s " . "ORDER BY m.field_pos asc", $postvals['fid']); } $results = $wpdb->get_results($sql); if ($results) { // loop through the custom form fields and display them echo cp_formbuilder_review($results); } else { printf(__('ERROR: The form template for form ID %s does not exist or the session variable is empty.', APP_TD), $postvals['fid']); } ?> <hr class="bevel" /> <div class="clr"></div> <li> <div class="labelwrapper"> <label><?php _e('Ad Listing Fee:', APP_TD); ?> </label> </div> <div id="review"><?php if (cp_payments_is_enabled()) { appthemes_display_price($postvals['cp_sys_ad_listing_fee']); } else { _e('FREE', APP_TD); } ?> </div> <div class="clr"></div> </li> <?php if (isset($postvals['featured_ad'])) { ?> <li> <div class="labelwrapper"> <label><?php _e('Featured Listing Fee:', APP_TD); ?> </label> </div> <div id="review"><?php appthemes_display_price($postvals['cp_sys_feat_price']); ?> </div> <div class="clr"></div> </li> <?php } ?> <?php if (isset($postvals['membership_pack'])) { ?> <li> <div class="labelwrapper"> <label><?php _e('Membership:', APP_TD); ?> </label> </div> <div id="review"><?php echo get_pack_benefit($postvals['membership_pack']); ?> </div> <div class="clr"></div> </li> <?php } ?> <hr class="bevel-double" /> <div class="clr"></div> <li> <div class="labelwrapper"> <label><?php _e('Total Amount Due:', APP_TD); ?> </label> </div> <div id="review"><strong> <?php if (cp_payments_is_enabled()) { appthemes_display_price($postvals['cp_sys_total_ad_cost']); } else { _e('--', APP_TD); } ?> </strong></div> <div class="clr"></div> </li> <?php if (cp_payments_is_enabled() && $postvals['cp_sys_total_ad_cost'] > 0) { do_action('appthemes_purchase_fields'); } ?> <?php }
/** * Displays preview of submitted ad listing. * * @param array $postvals * * @return void */ function cp_show_review($postvals) { if (empty($postvals['fid'])) { // get default form fields $form_fields = cp_get_custom_form_fields(); } else { $form_fields = cp_get_custom_form_fields($postvals['fid']); } if ($form_fields) { // loop through the custom form fields and display them cp_formbuilder_review($form_fields, $postvals); } else { printf(__('ERROR: The form template for form ID %s does not exist or the session variable is empty.', APP_TD), $postvals['fid']); } ?> <hr class="bevel" /> <div class="clr"></div> <li> <div class="labelwrapper"> <label><?php _e('Ad Listing Fee:', APP_TD); ?> </label> </div> <div id="review"><?php if (cp_payments_is_enabled()) { appthemes_display_price($postvals['cp_sys_ad_listing_fee']); } else { _e('FREE', APP_TD); } ?> </div> <div class="clr"></div> </li> <?php if (!empty($postvals['featured_ad'])) { ?> <li> <div class="labelwrapper"> <label><?php _e('Featured Listing Fee:', APP_TD); ?> </label> </div> <div id="review"><?php appthemes_display_price($postvals['cp_sys_feat_price']); ?> </div> <div class="clr"></div> </li> <?php } ?> <?php if (isset($postvals['membership_pack'])) { ?> <li> <div class="labelwrapper"> <label><?php _e('Membership:', APP_TD); ?> </label> </div> <div id="review"><?php echo cp_get_membership_package_benefit_text($postvals['membership_pack']); ?> </div> <div class="clr"></div> </li> <?php } ?> <hr class="bevel-double" /> <div class="clr"></div> <li> <div class="labelwrapper"> <label><?php _e('Total Amount Due:', APP_TD); ?> </label> </div> <div id="review"><strong> <?php if (cp_payments_is_enabled()) { appthemes_display_price($postvals['cp_sys_total_ad_cost']); } else { _e('--', APP_TD); } ?> </strong></div> <div class="clr"></div> </li> <?php if (cp_payments_is_enabled()) { do_action('appthemes_purchase_fields'); } ?> <?php }
function cp_show_review($postvals) { global $wpdb; // if there's no form id it must mean the default form is being used so let's go grab those fields if (!$postvals['fid']) { // use this if there's no custom form being used and give us the default form $sql = "SELECT field_label, field_name, field_type, field_values, field_req FROM {$wpdb->cp_ad_fields} WHERE field_core = '1' ORDER BY field_id asc"; } else { // now we should have the formid so show the form layout based on the category selected $sql = $wpdb->prepare("SELECT f.field_label,f.field_name,f.field_type,f.field_values,f.field_perm,m.meta_id,m.field_pos,m.field_req,m.form_id " . "FROM {$wpdb->cp_ad_fields} f " . "INNER JOIN {$wpdb->cp_ad_meta} m " . "ON f.field_id = m.field_id " . "WHERE m.form_id = %s " . "ORDER BY m.field_pos asc", $postvals['fid']); } $results = $wpdb->get_results($sql); if ($results) { // loop through the custom form fields and display them echo cp_formbuilder_review($results); } else { echo sprintf(__('ERROR: The form template for form ID %s does not exist or the session variable is empty.', APP_TD), $postvals['fid'] . "\n\n"); } ?> <hr class="bevel" /> <div class="clr"></div> <?php if (isset($_POST['cp_payment_method']) && $postvals['cp_sys_total_ad_cost'] != 0) { // if a payment method has been posted AND the total is not equal to zero ?> <li> <div class="labelwrapper"> <label><?php _e('Payment Method:', APP_TD); ?> </label> </div> <div id="review"><?php echo ucfirst($_POST['cp_payment_method']); ?> </div> <div class="clr"></div> </li> <?php } ?> <li> <div class="labelwrapper"> <label><?php _e('Ad Listing Fee:', APP_TD); ?> </label> </div> <div id="review"><?php if (get_option('cp_charge_ads') == 'yes') { cp_display_price($postvals['cp_sys_ad_listing_fee']); } else { _e('FREE', APP_TD); } ?> </div> <div class="clr"></div> </li> <?php if (isset($_POST['featured_ad'])) { ?> <li> <div class="labelwrapper"> <label><?php _e('Featured Listing Fee:', APP_TD); ?> </label> </div> <div id="review"><?php cp_display_price($postvals['cp_sys_feat_price']); ?> </div> <div class="clr"></div> </li> <?php } ?> <?php if (isset($postvals['cp_coupon_type'])) { ?> <li> <div class="labelwrapper"> <label><?php _e('Coupon:', APP_TD); ?> </label> </div> <?php if ($postvals['cp_coupon_type'] != '%') { ?> <div id="review"><?php cp_display_price($postvals['cp_coupon']); ?> </div> <?php } else { ?> <div id="review"><?php echo str_replace('.00', '', $postvals['cp_coupon']) . $postvals['cp_coupon_type']; ?> </div> <?php } ?> <div class="clr"></div> </li> <?php } ?> <?php if (isset($postvals['cp_membership_pack'])) { ?> <li> <div class="labelwrapper"> <label><?php _e('Membership:', APP_TD); ?> </label> </div> <div id="review"><?php echo get_pack_benefit($postvals['cp_membership_pack']); ?> </div> <div class="clr"></div> </li> <?php } ?> <hr class="bevel-double" /> <div class="clr"></div> <li> <div class="labelwrapper"> <label><?php _e('Total Amount Due:', APP_TD); ?> </label> </div> <div id="review"><strong> <?php // if it costs to post an ad OR its free and someone selected a featured ad price if (get_option('cp_charge_ads') == 'yes' || isset($postvals['featured_ad'])) { cp_display_price($postvals['cp_sys_total_ad_cost']); } else { _e('--', APP_TD); } ?> </strong></div> <div class="clr"></div> </li> <?php }