コード例 #1
0
<?php

get_header();
while (have_posts()) {
    the_post();
    $transaction_id = isset($_REQUEST['tx']) ? esc_attr($_REQUEST['tx']) : '';
    $payment_array = '';
    if ($transaction_id != '') {
        global $wpdb;
        $table_name = $wpdb->prefix . "imic_payment_transaction";
        $payment_array = imic_validate_payment($transaction_id);
        $st = isset($_REQUEST['st']) ? esc_attr($_REQUEST['st']) : '';
        $user_id = isset($_REQUEST['item_number']) ? esc_attr($_REQUEST['item_number']) : '';
        $cause_id = strstr($user_id, '-', true);
        $cause_name = get_the_title($cause_id);
        if (!empty($transaction_id)) {
            $sql_select = $wpdb->get_var($wpdb->prepare("select transaction_id from {$table_name} WHERE `transaction_id` = '{$transaction_id}'"));
            $data = $wpdb->get_results($sql_select, ARRAY_A) or print mysql_error();
            if (empty($data)) {
                $amt = isset($_REQUEST['amt']) ? esc_attr($_REQUEST['amt']) : '';
                $received_amount = get_post_meta($cause_id, 'imic_cause_amount_received', true);
                $updated_amount = $received_amount + $amt;
                //if($st=='Completed') {
                update_post_meta($cause_id, 'imic_cause_amount_received', $updated_amount);
                //}
                $sql = $wpdb->update($table_name, array('transaction_id' => $transaction_id, 'status' => $st), array('cause_id' => $user_id));
                require_once ABSPATH . 'wp-admin/includes/upgrade.php';
                dbDelta($sql);
            } else {
            }
        }
コード例 #2
0
ファイル: template-dashboard.php プロジェクト: zruiz/NG
                 if ($valid_with_plan == 1) {
                     $start_date = date('Y-m-d', $key);
                     $listing_date = strtotime(date("Y-m-d", strtotime($start_date)) . " +" . $plan_validity_number . " " . $plan_type);
                     $listing_date = date('Y-m-d', $listing_date);
                 }
                 if ($listing_date > date('Y-m-d')) {
                     $eligible_listing = 1;
                 }
             }
         }
     }
 }
 if ($opt_plans == 1) {
     $transaction_id = isset($_REQUEST['tx']) ? esc_attr($_REQUEST['tx']) : '';
     if ($transaction_id != '') {
         $paypal_details = imic_validate_payment($transaction_id);
         //Code to update plan information for user
         //Added next to v1.6
         //Start
         if ($plan_type != "0") {
             $plan_id = isset($_REQUEST['item_number']) ? esc_attr($_REQUEST['item_number']) : '';
             $post_type = get_post_type($plan_id);
             $plan_price = '';
             if ($post_type == 'plan') {
                 $plan_price = get_post_meta($plan_id, 'imic_plan_price', true);
                 $plan_price = floor($plan_price);
                 $plan_listings_count = get_post_meta($plan_id, 'imic_plan_validity_listings', true);
                 $plan_listings_count = esc_attr($plan_listings_count);
             }
             if (!empty($paypal_details)) {
                 $st = $paypal_details['payment_status'];
コード例 #3
0
get_header();
get_query_var('login') ? wp_enqueue_script('imic_event_pay') : '';
imic_sidebar_position_module();
$options = get_option('imic_options');
include_once ABSPATH . 'wp-admin/includes/plugin.php';
while (have_posts()) {
    the_post();
    $transaction_id = isset($_REQUEST['tx']) ? esc_attr($_REQUEST['tx']) : '';
    if ($transaction_id != '') {
        wp_enqueue_script('imic_print_ticket');
        if ($transaction_id != 'free') {
            global $wpdb;
            $table_name = $wpdb->prefix . "imic_payment_transaction";
            $paypal_payment = get_option('paypal_payment_option');
            $payment_array = imic_validate_payment($transaction_id, $paypal_payment);
            $st = $payment_array['payment_status'];
            $user_id = isset($_REQUEST['item_number']) ? esc_attr($_REQUEST['item_number']) : '';
            $cause_id = strstr($user_id, '-', true);
            $cause_name = get_the_title($cause_id);
            if (!empty($transaction_id) && !empty($st)) {
                $sql_select = $wpdb->get_var($wpdb->prepare("select transaction_id from {$table_name} WHERE `transaction_id` = '{$transaction_id}'"));
                $data = $wpdb->get_results($sql_select, ARRAY_A) or print mysql_error();
                if (empty($data)) {
                    $amt = isset($_REQUEST['amt']) ? esc_attr($_REQUEST['amt']) : '';
                    $sql = $wpdb->update($table_name, array('transaction_id' => $transaction_id, 'status' => $st), array('cause_id' => $user_id));
                    require_once ABSPATH . 'wp-admin/includes/upgrade.php';
                    dbDelta($sql);
                } else {
                }
            }
コード例 #4
0
ファイル: imic-theme-functions.php プロジェクト: zruiz/NG
 function imic_contact_site_plans()
 {
     $tx = isset($_POST['transaction']) ? $_POST['transaction'] : '';
     $message = isset($_POST['message']) ? $_POST['message'] : '';
     $plan_id = isset($_POST['plan']) ? $_POST['plan'] : '';
     if ($tx != '') {
         $paypal_details = imic_validate_payment($tx);
         if (!empty($paypal_details)) {
             $st = $paypal_details['payment_status'];
             $payment_gross = $paypal_details['payment_gross'];
             global $current_user;
             get_currentuserinfo();
             $user_id = get_current_user_id();
             $current_user = wp_get_current_user();
             $user_info_id = get_user_meta($user_id, 'imic_user_info_id', true);
             $site_manager_email = get_option('admin_email');
             $manager_email = esc_attr($site_manager_email);
             $dealer_name = get_the_title($user_info_id);
             $e_subject = __('Payment Related Query', 'framework');
             $e_body = __("You have been contacted by {$dealer_name} ", "framework") . PHP_EOL . PHP_EOL;
             $e_content = '';
             $e_content .= __("Name: ", "framework") . $dealer_name . PHP_EOL . PHP_EOL;
             $e_content .= __("Email: ", "framework") . $current_user->user_email . PHP_EOL . PHP_EOL;
             $e_content .= __("Plan: ", "framework") . get_the_title($plan_id) . PHP_EOL . PHP_EOL;
             $e_content .= __("Transaction ID: ", "framework") . $paypal_details['txn_id'] . PHP_EOL . PHP_EOL;
             $e_content .= __("Payment Status: ", "framework") . $paypal_details['payment_status'] . PHP_EOL . PHP_EOL;
             $e_content .= __("Message: ", "framework") . $message . PHP_EOL . PHP_EOL;
             $e_reply = __("You can contact ", "framework") . $dealer_name . __(" via email, ", "framework") . $current_user->user_email;
             $msg = wordwrap($e_body . $e_content . $e_reply, 70);
             $headers = __("From: ", "framework") . $current_user->user_email . PHP_EOL;
             $headers .= __("Reply-To: ", "framework") . $current_user->user_email . PHP_EOL;
             $headers .= "MIME-Version: 1.0" . PHP_EOL;
             $headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL;
             $headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL;
             if (mail($manager_email, $e_subject, $msg, $headers)) {
                 echo "<div class=\"alert alert-success\">" . __('Thank you', 'framework') . " <strong>{$dealer_name}</strong>, " . __('your message has been submitted to us.', 'framework') . "</div>";
             } else {
                 echo '<div class="alert alert-error">ERROR!</div>';
             }
         }
     }
     die;
 }