get_results($sql,ARRAY_A) ; $earliest_record_sql = "SELECT MIN(`date`) AS `date` FROM `".WPSC_TABLE_PURCHASE_LOGS."` WHERE `date`!=''"; $earliest_record = $wpdb->get_results($earliest_record_sql,ARRAY_A) ; $current_timestamp = time(); $earliest_timestamp = $earliest_record[0]['date']; $current_year = date("Y"); $earliest_year = date("Y",$earliest_timestamp); $date_list[0]['start'] = $start_timestamp; $date_list[0]['end'] = $end_timestamp; ?>

Kogunenud boonusraha: ID.'"') or die(mysql_error()); $row = mysql_fetch_array($query); echo $row['money_on_account']; ?>

0)) { echo "
"; if(($purchase_log == null) && !is_numeric($_GET['purchaseid'])) { if($earliest_record[0]['date'] != null) { $form_sql = "SELECT * FROM `".WPSC_TABLE_CHECKOUT_FORMS."` WHERE `active` = '1' AND `display_log` = '1';"; $col_count = 4 + count($form_data); echo ""; $sql = "SELECT * FROM `".WPSC_TABLE_PURCHASE_LOGS."` WHERE `user_ID` IN ('".$user_ID."') ORDER BY `date` DESC"; $purchase_log = $wpdb->get_results($sql,ARRAY_A) ; $i = 0; $subtotal = 0; if($purchase_log != null) { echo ""; echo " "; echo " "; echo " "; if(get_option('payment_method') == 2) { echo " "; } echo ""; foreach((array)$purchase_log as $purchase) { $status_state = "expand"; $status_style = ""; $alternate = ""; $i++; if(($i % 2) != 0) { $alternate = "class='alt'"; } echo "\n\r"; // echo " "; echo " \n\r"; echo " \n\r"; echo " \n\r"; if(get_option('payment_method') == 2) { echo " \n\r"; } echo "\n\r"; //$stage_list_sql = "SELECT * FROM `".WPSC_TABLE_PURCHASE_STATUSES."` ORDER BY `id` ASC"; //$stage_list_data = $wpdb->get_results($stage_list_sql,ARRAY_A); echo "\n\r"; echo " \n\r"; echo "\n\r"; } echo ""; } else { echo ""; echo " "; echo ""; } echo "
"; echo TXT_WPSC_STATUS; echo " "; echo TXT_WPSC_DATE; echo " "; echo TXT_WPSC_PRICE; echo " "; echo TXT_WPSC_PAYMENT_METHOD; echo "
"; // echo $purchase['id']; // echo " "; echo ""; if($_GET['id'] == $purchase['id']) { $status_state = "collapse"; $status_style = "style='display: block;'"; } echo ""; if($stage_data['colour'] != '') { $colour = "style='color: #".$stage_data['colour'].";'"; } echo "".TXT_WPSC_VIEWDETAILS.""; echo ""; echo " "; echo date("jS M Y",$purchase['date']); echo " "; if($purchase['shipping_country'] != '') { $billing_country = $purchase['billing_country']; $shipping_country = $purchase['shipping_country']; } else { $country_sql = "SELECT * FROM `".WPSC_TABLE_SUBMITED_FORM_DATA."` WHERE `log_id` = '".$purchase['id']."' AND `form_id` = '".get_option('country_form_field')."' LIMIT 1"; $country_data = $wpdb->get_results($country_sql,ARRAY_A); $billing_country = $country_data[0]['value']; $shipping_country = $country_data[0]['value']; } echo nzshpcrt_currency_display($purchase['totalprice'],1); $subtotal += $purchase['totalprice']; echo " "; $gateway_name = ''; foreach((array)$GLOBALS['nzshpcrt_gateways'] as $gateway) { if($purchase['gateway'] != 'testmode') { if($gateway['internalname'] == $purchase['gateway'] ) { $gateway_name = $gateway['name']; } } else { $gateway_name = "Manual Payment"; } } echo $gateway_name; echo "
\n\r"; echo "
\n\r"; echo "
\n\r"; //order status code lies heret $stage_sql = "SELECT * FROM `".WPSC_TABLE_PURCHASE_STATUSES."` WHERE `id`='".$purchase['processed']."' AND `active`='1' LIMIT 1"; $stage_data = $wpdb->get_row($stage_sql,ARRAY_A); echo " ".TXT_WPSC_ORDER_STATUS.":\n\r"; echo $stage_data['name']."

"; //written by allen $usps_id = get_option('usps_user_id'); if ($usps_id!=null) { $XML1 = ""; //eecho cho "--->".$purchase['track_id']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://secure.shippingapis.com/ShippingAPITest.dll?"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $postdata = "API=TrackV2&XML=".$XML1; curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); // $result = curl_exec($ch); $parser = new xml2array; $parsed = $parser->parse($result); $parsed = $parsed[0]['children'][0]['children']; if($purchase['track_id'] != null){ echo "

"; echo " ".TXT_WPSC_SHIPPING_DETAILS."\n\r"; echo ""; foreach((array)$parsed as $parse){ if ($parse['name'] == "TRACKSUMMARY") foreach((array)$parse['children'] as $attrs){ if ($attrs['name']!="EVENT") $attrs['name'] = str_replace("EVENT", "", $attrs['name']); $bar = ucfirst(strtolower($attrs['name'])); echo ""; } } echo "
".$bar."".$attrs['tagData']."
"; } echo "

"; } //end of written by allen //cart contents display starts here; echo " ".TXT_WPSC_ORDER_DETAILS.":\n\r"; $cartsql = "SELECT * FROM `".WPSC_TABLE_CART_CONTENTS."` WHERE `purchaseid`=".$purchase['id'].""; $cart_log = $wpdb->get_results($cartsql,ARRAY_A) ; $j = 0; // /* if($cart_log != null) { echo ""; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; $endtotal = 0; foreach((array)$cart_log as $cart_row) { $alternate = ""; $j++; if(($j % 2) != 0) { $alternate = "class='alt'"; } $productsql= "SELECT * FROM `".WPSC_TABLE_PRODUCT_LIST."` WHERE `id`=".$cart_row['prodid'].""; $product_data = $wpdb->get_results($productsql,ARRAY_A); $variation_sql = "SELECT * FROM `".WPSC_TABLE_CART_ITEM_VARIATIONS."` WHERE `cart_id`='".$cart_row['id']."'"; $variation_data = $wpdb->get_results($variation_sql,ARRAY_A); $variation_count = count($variation_data); if($variation_count > 1) { $variation_list = " ("; $i = 0; foreach((array)$variation_data as $variation) { if($i > 0) { $variation_list .= ", "; } $value_id = $variation['value_id']; $value_data = $wpdb->get_results("SELECT * FROM `".WPSC_TABLE_VARIATION_VALUES."` WHERE `id`='".$value_id."' LIMIT 1",ARRAY_A); $variation_list .= $value_data[0]['name']; $i++; } $variation_list .= ")"; } else if($variation_count == 1) { $value_id = $variation_data[0]['value_id']; $value_data = $wpdb->get_results("SELECT * FROM `".WPSC_TABLE_VARIATION_VALUES."` WHERE `id`='".$value_id."' LIMIT 1",ARRAY_A); $variation_list = " (".$value_data[0]['name'].")"; } else { $variation_list = ''; } if($purch_data[0]['shipping_country'] != '') { $billing_country = $purch_data[0]['billing_country']; $shipping_country = $purch_data[0]['shipping_country']; } else { $country_sql = "SELECT * FROM `".WPSC_TABLE_SUBMITED_FORM_DATA."` WHERE `log_id` = '".$purchase['id']."' AND `form_id` = '".get_option('country_form_field')."' LIMIT 1"; $country_data = $wpdb->get_results($country_sql,ARRAY_A); $billing_country = $country_data[0]['value']; $shipping_country = $country_data[0]['value']; } $shipping = $cart_row['pnp']; $total_shipping += $shipping; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ''; } echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo ''; echo "
"; echo TXT_WPSC_NAME; echo " "; echo TXT_WPSC_QUANTITY; echo " "; echo TXT_WPSC_PRICE; echo " "; echo TXT_WPSC_GST; echo " "; echo TXT_WPSC_PP; echo " "; echo TXT_WPSC_TOTAL; echo "
"; echo $product_data[0]['name']; echo $variation_list; echo " "; echo $cart_row['quantity']; echo " "; $price = $cart_row['price'] * $cart_row['quantity']; echo nzshpcrt_currency_display($price, 1); echo " "; $gst = $cart_row['tax_charged']; $endtotal += $gst * $cart_row['quantity']; echo nzshpcrt_currency_display($gst, 1); echo " "; echo nzshpcrt_currency_display($shipping, 1); echo " "; $endtotal += $price; echo nzshpcrt_currency_display(($shipping + $price + ($gst * $cart_row['quantity'])), 1); echo "
"; echo " "; echo " "; echo " "; echo "".TXT_WPSC_TOTALSHIPPING.":
"; echo "".TXT_WPSC_FINALTOTAL.":"; echo "
"; $total_shipping += $purchase['base_shipping']; $endtotal += $total_shipping; echo nzshpcrt_currency_display($total_shipping, 1) . "
"; echo nzshpcrt_currency_display($endtotal,1); echo "
"; echo "
"; echo "".TXT_WPSC_CUSTOMERDETAILS.":"; echo ""; $form_sql = "SELECT * FROM `".WPSC_TABLE_SUBMITED_FORM_DATA."` WHERE `log_id` = '".$purchase['id']."'"; $input_data = $wpdb->get_results($form_sql,ARRAY_A); //exit("
".print_r($input_data,true)."
"); if($input_data != null) { foreach((array)$input_data as $form_field) { $form_sql = "SELECT * FROM `".WPSC_TABLE_CHECKOUT_FORMS."` WHERE `active` = '1' AND `id` = '".$form_field['form_id']."' LIMIT 1"; $form_data = $wpdb->get_results($form_sql,ARRAY_A); if($form_data != null) { $form_data = $form_data[0]; if($form_data['type'] == 'country' ) { if($form_field['value'] != null) { echo " "; } else { echo " "; } } else { echo " "; } } } } else { echo " "; echo " "; echo " "; echo " "; } //if(get_option('payment_method') == 2) //{ $gateway_name = ''; foreach((array)$GLOBALS['nzshpcrt_gateways'] as $gateway) { if($purchase_log[0]['gateway'] != 'testmode') { if($gateway['internalname'] == $purchase_log[0]['gateway'] ) { $gateway_name = $gateway['name']; } } else { $gateway_name = "Manual Payment"; } } //} echo " "; echo " "; if($purchase['transactid'] != '') { echo " "; } echo "
".$form_data['name'].":".wpsc_get_country($form_field['value'])."
".$form_data['name'].":".wpsc_get_country($purchase['shipping_country'])."
".$form_data['name'].":".$form_field['value']."
".TXT_WPSC_NAME.":".$purchase['firstname']." ".$purchase['lastname']."
".TXT_WPSC_ADDRESS.":".$purchase['address']."
".TXT_WPSC_PHONE.":".$purchase['phone']."
".TXT_WPSC_EMAIL.":".$purchase['email']."
".TXT_WPSC_PAYMENT_METHOD.":".$gateway_name."
".TXT_WPSC_PURCHASE_NUMBER.":".$purchase['id']."
".TXT_WPSC_TXN_ID.":".$purchase['transactid']."
"; } // */ echo "
\n\r"; echo "
\n\r"; echo "
"; echo TXT_WPSC_AT_THIS_MOMENT_NO_TRANSACTION; echo "
"; } else { echo " "; echo ""; echo " "; echo ""; echo "
"; echo TXT_WPSC_NO_PURCHASES; echo "
"; } } $sql = "SELECT * FROM `".WPSC_TABLE_PURCHASE_LOGS."` WHERE `date`!=''"; $purchase_log = $wpdb->get_results($sql,ARRAY_A) ; } else { echo TXT_WPSC_MUST_BE_LOGGED_IN; ?>