本文整理汇总了PHP中get_user_orders函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_orders函数的具体用法?PHP get_user_orders怎么用?PHP get_user_orders使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_user_orders函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cp_prepare_transaction_entry
function cp_prepare_transaction_entry($order_vals)
{
global $wpdb;
if (is_array($order_vals)) {
if (isset($order_vals['post_id'])) {
$trdata['ad_id'] = $order_vals['post_id'];
}
$trdata['payment_type'] = $order_vals['cp_payment_method'];
$trdata['payment_status'] = 'Pending';
$trdata['txn_id'] = $order_vals['oid'];
$trdata['transaction_subject'] = $order_vals['oid'];
$trdata['custom'] = $order_vals['oid'];
$trdata['item_name'] = $order_vals['item_name'];
$trdata['item_number'] = $order_vals['item_number'];
$trdata['mc_gross'] = $order_vals['item_amount'];
$trdata['mc_currency'] = get_option('cp_curr_pay_type');
if (isset($order_vals['user_id'])) {
$the_user = get_userdata($order_vals['user_id']);
} else {
$orders = get_user_orders('', $order_vals['oid']);
if (!empty($orders)) {
$user_id = get_order_userid($orders);
$the_user = get_userdata($user_id);
}
}
if ($the_user) {
$trdata['first_name'] = $the_user->first_name;
$trdata['last_name'] = $the_user->last_name;
$trdata['payer_email'] = $the_user->user_email;
}
return $trdata;
} else {
return false;
}
}
示例2: order
function order()
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
$order_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
if ($order_id > 0) {
$r_data = get_order_detail($order_id, $user_id);
} else {
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$limit = isset($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 1;
$r_data = get_user_orders($user_id, $limit, $page);
}
// $record_count = $db->getOne("SELECT COUNT(*) FROM " .$ecs->table('order_info'). " WHERE user_id = '$user_id'");
return $r_data;
break;
case 'DELETE':
$order_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
$user_id = $_SESSION['user_id'];
if (cancel_order($order_id, $user_id)) {
$r_data = 'Cancle Order Success!';
} else {
$r_data = 'Cancle Order Failed!';
}
return $r_data;
break;
default:
return 'This API can not support ' . $_SERVER['REQUEST_METHOD'] . ' method';
break;
}
}
示例3: appthemes_process_membership_order
function appthemes_process_membership_order($current_user, $order)
{
//if order ID matches pending membership id suffix, then process the order by extendning the date and setting the ID
if (isset($current_user->active_membership_pack)) {
$user_active_pack_id = get_pack_id($current_user->active_membership_pack);
} else {
$user_active_pack_id = false;
}
if (isset($current_user->membership_expires)) {
$user_active_pack_expiration = $current_user->membership_expires;
} else {
$user_active_pack_expiration = strtotime(current_time('mysql'));
}
if ($order['total_cost'] == 0 || $order['order_id'] == $_REQUEST['oid'] || $order['order_id'] == $_REQUEST['custom'] || $order['order_id'] == $_REQUEST['invoice']) {
//update the user profile to current order pack_id taking it off "pending" status and setup the membership object
update_user_meta($current_user->ID, 'active_membership_pack', $order['pack_id']);
$membership = get_pack($order['pack_id']);
//extend membership if its still active, so long as its not free (otherwise free extentions could be infinite)
$expires_in_days = appthemes_seconds_to_days(strtotime($user_active_pack_expiration) - strtotime(current_time('mysql')));
$purchase = $order['pack_duration'] . ' ' . __('days', 'appthemes');
if ($expires_in_days > 0 && $order['total_cost'] > 0 && $order['pack_id'] == $user_active_pack_id) {
$updated_expires_date = appthemes_mysql_date($user_active_pack_expiration, $order['pack_duration']);
} else {
$updated_expires_date = appthemes_mysql_date(current_time('mysql'), $order['pack_duration']);
}
update_user_meta($current_user->ID, 'membership_expires', $updated_expires_date);
$order['updated_expires_date'] = $updated_expires_date;
delete_option($order['option_order_id']);
//return the order information in case its needed
return $order;
} else {
//get orders of the user
$the_order = get_user_orders($current_user->ID, $order['order_id']);
return false;
}
}
示例4: orders
public function orders($user_id, $size = 10, $start = 0)
{
include_once ROOT_PATH . 'includes/lib_transaction.php';
$orders = get_user_orders($user_id, $size, $start);
return $orders;
}
示例5: cp_use_coupon
$order['option_order_id'] = 'cp_order_' . $current_user->ID . '_' . $_POST['oid'];
$order['pack_type'] = 'membership';
$order['total_cost'] = $total_cost;
//Check for coupon and use to to reduce total price and total number of coupon uses left
if (isset($_POST['cp_coupon_code'])) {
$order['cp_coupon_code'] = $_POST['cp_coupon_code'];
//incriment coupon code count only if total ad price was not zero
if (cp_check_coupon_discount($order['cp_coupon_code'])) {
cp_use_coupon($order['cp_coupon_code']);
//TODO - handle discounting of total cost
}
}
$order = array_merge($order, (array) $membership);
//save the order for use when payment is completed
if (add_option($order['option_order_id'], $order)) {
$cp_user_orders = get_user_orders($current_user->ID);
if (isset($cp_user_orders) && $cp_user_orders) {
$cp_user_recent_order = $cp_user_orders[0];
}
} else {
$order_already_exists = true;
}
include_once TEMPLATEPATH . '/includes/forms/step3-membership.php';
} else {
// create a unique ID for this new ad order
// uniqid requires a param for php 4.3 or earlier. added for 3.0.1
if (empty($cp_user_recent_order)) {
$order_id = uniqid(rand(10, 1000), false);
} else {
$order_id = get_order_id($cp_user_recent_order);
}
示例6: elseif
} elseif ($action == 'order_list') {
include_once ROOT_PATH . 'include/lib_transaction.php';
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}'");
$pager = get_pager('user.php', array('act' => $action), $record_count, $page);
$orders = get_user_orders($user_id, $pager['size'], $pager['start']);
$merge = get_user_merge($user_id);
$smarty->assign('merge', $merge);
$smarty->assign('pager', $pager);
$smarty->assign('orders', $orders);
$smarty->display('user_transaction.dwt');
} elseif ($action == 'async_order_list') {
include_once ROOT_PATH . 'include/lib_transaction.php';
$start = $_POST['last'];
$limit = $_POST['amount'];
$orders = get_user_orders($user_id, $limit, $start);
if (is_array($orders)) {
foreach ($orders as $vo) {
//获取订单第一个商品的图片
$img = $db->getOne("SELECT g.goods_thumb FROM " . $ecs->table('order_goods') . " as og left join " . $ecs->table('goods') . " g on og.goods_id = g.goods_id WHERE og.order_id = " . $vo['order_id'] . " limit 1");
$tracking = $vo['shipping_id'] > 0 ? '<a href="user.php?act=order_tracking&order_id=' . $vo['order_id'] . '" class="c-btn3">订单跟踪</a>' : '';
$asyList[] = array('order_status' => '订单状态:' . $vo['order_status'], 'order_handler' => $vo['handler'], 'order_content' => '<a href="user.php?act=order_detail&order_id=' . $vo['order_id'] . '"><table width="100%" border="0" cellpadding="5" cellspacing="0" class="ectouch_table_no_border">
<tr>
<td><img src="' . $config['site_url'] . $img . '" width="50" height="50" /></td>
<td>订单编号:' . $vo['order_sn'] . '<br>
订单金额:' . $vo['total_fee'] . '<br>
下单时间:' . $vo['order_time'] . '</td>
<td style="position:relative"><span class="new-arr"></span></td>
</tr>
</table></a>', 'order_tracking' => $tracking);
}
示例7: cp_transactions
function cp_transactions()
{
global $wpdb;
// check to prevent php "notice: undefined index" msg when php strict warnings is on
if (isset($_GET['action'])) {
$theswitch = $_GET['action'];
} else {
$theswitch = '';
}
switch ($theswitch) {
// mark transaction as paid
case 'setPaid':
$update = "UPDATE " . $wpdb->prefix . "cp_order_info SET payment_status = 'Completed' WHERE id = '" . $_GET['id'] . "'";
$wpdb->query($update);
?>
<p style="text-align:center;padding-top:50px;font-size:22px;"><?php
_e('Updating transaction entry.....', 'appthemes');
?>
<br /><br /><img src="<?php
echo bloginfo('template_directory');
?>
/images/loader.gif" alt="" /></p>
<meta http-equiv="refresh" content="0; URL=?page=transactions">
<?php
break;
// mark transaction as unpaid
// mark transaction as unpaid
case 'unsetPaid':
$update = "UPDATE " . $wpdb->prefix . "cp_order_info SET payment_status = 'Pending' WHERE id = '" . $_GET['id'] . "'";
$wpdb->query($update);
?>
<p style="text-align:center;padding-top:50px;font-size:22px;"><?php
_e('Updating transaction entry.....', 'appthemes');
?>
<br /><br /><img src="<?php
echo bloginfo('template_directory');
?>
/images/loader.gif" alt="" /></p>
<meta http-equiv="refresh" content="0; URL=?page=transactions">
<?php
break;
// delete transaction entry
// delete transaction entry
case 'delete':
$delete = "DELETE FROM " . $wpdb->prefix . "cp_order_info WHERE id = '" . $_GET['id'] . "'";
$wpdb->query($delete);
?>
<p style="text-align:center;padding-top:50px;font-size:22px;"><?php
_e('Deleting transaction entry.....', 'appthemes');
?>
<br /><br /><img src="<?php
echo bloginfo('template_directory');
?>
/images/loader.gif" alt="" /></p>
<meta http-equiv="refresh" content="0; URL=?page=transactions">
<?php
break;
// activate membership, update transaction entry
// activate membership, update transaction entry
case 'activateMembership':
include_once TEMPLATEPATH . '/includes/forms/step-functions.php';
$orders = get_user_orders('', $_GET['oid']);
if (!empty($orders)) {
$order_id = get_order_id($orders);
$storedOrder = get_option($orders);
$user_id = get_order_userid($orders);
$the_user = get_userdata($user_id);
//activate membership
$order_processed = appthemes_process_membership_order($the_user, $storedOrder);
//send email to user
if ($order_processed) {
cp_owner_activated_membership_email($the_user, $order_processed);
}
//update transaction entry
$update = "UPDATE " . $wpdb->prefix . "cp_order_info SET payment_status = 'Completed' WHERE custom = '" . $_GET['oid'] . "'";
$wpdb->query($update);
}
?>
<p style="text-align:center;padding-top:50px;font-size:22px;"><?php
_e('Activating membership plan.....', 'appthemes');
?>
<br /><br /><img src="<?php
echo bloginfo('template_directory');
?>
/images/loader.gif" alt="" /></p>
<meta http-equiv="refresh" content="0; URL=?page=transactions">
<?php
break;
// show the table of all transactions
// show the table of all transactions
default:
?>
<div class="wrap">
<div class="icon32" id="icon-themes"><br /></div>
<h2><?php
_e('Order Transactions', 'appthemes');
//.........这里部分代码省略.........
示例8: cp_handle_ipn_response
function cp_handle_ipn_response($_POST)
{
global $wpdb;
//step functions required to process orders
include_once "wp-load.php";
include_once TEMPLATEPATH . '/includes/forms/step-functions.php';
// make sure the ad unique trans id (stored in invoice var) is included
if (!empty($_POST['txn_type']) && !empty($_POST['invoice'])) {
// process the ad based on the paypal response
switch (strtolower($_POST['payment_status'])) {
// payment was made so we can approve the ad
case 'completed':
$pid = trim($_POST['invoice']);
//attempt to process membership order first
$orders = get_user_orders('', $pid);
if (!empty($orders)) {
$order_id = get_order_id($orders);
$storedOrder = get_option($orders);
$user_id = get_order_userid($orders);
$the_user = get_userdata($user_id);
if (get_option('cp_paypal_ipn_debug') == 'true' && !empty($orders)) {
wp_mail(get_option('admin_email'), 'PayPal IPN Attempting to Activate Memebership', print_r($orders, true) . PHP_EOL . print_r($order, true) . PHP_EOL . print_r($_REQUEST, true));
}
$order_processed = appthemes_process_membership_order($the_user, $storedOrder);
}
if ($order_processed) {
//admin email confirmation
//TODO - move into wordpress options panel and allow customization
wp_mail(get_option('admin_email'), 'PayPal IPN Activated Memebership', __('A membership order has been completed. Check to make sure this is a valid order by comparing this messages Paypal Transaction ID to the respective ID in the Paypal payment receipt email.', 'appthemes') . PHP_EOL . __('Order ID: ', 'appthemes') . print_r($orders, true) . PHP_EOL . __('User ID: ', 'appthemes') . print_r($user_id, true) . PHP_EOL . __('User Login: ', 'appthemes') . print_r($the_user->user_login, true) . PHP_EOL . __('Pack Name: ', 'appthemes') . print_r(stripslashes($storedOrder['pack_name']), true) . PHP_EOL . __('Total Cost: ', 'appthemes') . print_r($storedOrder['total_cost'], true) . PHP_EOL . __('Paypal Transaction ID: ', 'appthemes') . print_r($_POST['txn_id'], true) . PHP_EOL);
break;
}
$sql = $wpdb->prepare("SELECT p.ID, p.post_status\r\n FROM {$wpdb->posts} p, {$wpdb->postmeta} m\r\n WHERE p.ID = m.post_id\r\n AND p.post_status <> 'publish'\r\n AND m.meta_key = 'cp_sys_ad_conf_id'\r\n AND m.meta_value = %s\r\n ", $pid);
$newadid = $wpdb->get_row($sql);
// if the ad is found, then publish it
if ($newadid) {
$the_ad = array();
$the_ad['ID'] = $newadid->ID;
$the_ad['post_status'] = 'publish';
$ad_id = wp_update_post($the_ad);
// now we need to update the ad expiration date so they get the full length of time
// sometimes they didn't pay for the ad right away or they are renewing
// first get the ad duration and first see if ad packs are being used
// if so, get the length of time in days otherwise use the default
// prune period defined on the CP settings page
$ad_length = get_post_meta($ad_id, 'cp_sys_ad_duration', true);
if (isset($ad_length)) {
$ad_length = $ad_length;
} else {
$ad_length = get_option('cp_prun_period');
}
// set the ad listing expiration date
$ad_expire_date = date_i18n('m/d/Y H:i:s', strtotime('+' . $ad_length . ' days'));
// don't localize the word 'days'
//now update the expiration date on the ad
update_post_meta($ad_id, 'cp_sys_expire_date', $ad_expire_date);
}
break;
case 'pending':
// send an email if payment is pending
wp_mail(get_option('admin_email'), 'PayPal IPN - payment pending', "" . print_r($_POST, true));
break;
// payment failed so don't approve the ad
// payment failed so don't approve the ad
case 'denied':
case 'expired':
case 'failed':
case 'voided':
// send an email if payment didn't work
wp_mail(get_option('admin_email'), 'PayPal IPN - payment failed', "" . print_r($_POST, true));
break;
}
// regardless of what happens, log the transaction
if (file_exists(TEMPLATEPATH . '/includes/gateways/process.php')) {
include_once TEMPLATEPATH . '/includes/gateways/process.php';
}
}
}
示例9: auth_redirect_login
* was randomly generated during the ad submission. It is stored in
* the cp_sys_ad_conf_id custom field. If this page is loaded and no
* matching ad id is found or the ad is already published then
* show an error message instead of doing any db updates
*
* @package ClassiPress
* @author AppThemes
* @version 3.0
*
*/
// if not logged in, redirect to login page
auth_redirect_login();
//otherwise load step functions file with functions required to process the order
include_once TEMPLATEPATH . '/includes/forms/step-functions.php';
global $wpdb, $current_user;
$order = get_user_orders($current_user->ID, $_REQUEST['oid']);
//if the order was found by OID, setup the order details into the $order variable
if (isset($order) && $order) {
$order = get_option($order);
}
//make sure the order sent from payment gateway is logged in the database and that the current user created it
if (isset($order['order_id']) && $order['order_id'] == $_REQUEST['oid'] && $order['user_id'] == $current_user->ID) {
$order_processed = appthemes_process_membership_order($current_user, $order);
//send email to user
if ($order_processed) {
cp_owner_activated_membership_email($current_user, $order_processed);
}
} else {
$order_processed = false;
// check and make sure this transaction hasn't already been added
$sql = "SELECT * " . "FROM {$wpdb->cp_order_info} " . "WHERE custom = '" . $wpdb->escape(appthemes_clean($_REQUEST['oid'])) . "' LIMIT 1";
示例10: get_user_tickets
$last_name = "";
}
if (!($phone_number = portal_get_user_meta($page_id, "phone_number"))) {
$phone_number = "";
}
if (!($telegram = portal_get_user_meta($page_id, "telegram_account"))) {
$telegram = "";
}
if (!$public_viewer) {
$tickets = get_user_tickets($real_user->ID, 10);
} else {
$tickets = array();
}
$departments = array(0 => "فروش", 1 => "پشتیبانی فنی", 2 => "بررسی سفارشات");
$pending_orders = get_user_pending_orders($page_id, 10);
$orders = get_user_orders($page_id, 10);
$register_date_obj = new DateTime($real_user->user_registered);
$register_date = $register_date_obj->format("Y/m/d H:i:s");
$can_change_user_name = portal_get_user_meta($page_id, "username-change");
?>
<html>
<head>
<title>مدیریت · اطلاعات کاربر</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="../stylesheets/signin.css">
<!-- New Stylesheet -->
<?php
include '../template/ui.php';
示例11: cp_payments_handle_membership_activated
/**
* Processes membership activation on order activation.
*
* @param object $order
*/
function cp_payments_handle_membership_activated($order)
{
// include all the functions needed for this action
require_once get_template_directory() . '/includes/forms/step-functions.php';
foreach ($order->get_items(CP_ITEM_MEMBERSHIP) as $item) {
$user = get_user_by('id', $order->get_author());
$membership_orders = get_user_orders($user->ID, false);
if (empty($membership_orders)) {
continue;
}
$order_id = get_order_id($membership_orders[0]);
$stored_order = get_option($membership_orders[0]);
$order_processed = appthemes_process_membership_order($user, $stored_order);
if ($order_processed) {
cp_owner_activated_membership_email($user, $order_processed);
}
}
}
示例12: isset
/**
* This script is the landing page after payment has been processed
* by PayPal or other gateways. It is expecting a unique ad id which
* was randomly generated during the ad submission. It is stored in
* the cp_sys_ad_conf_id custom field. If this page is loaded and no
* matching ad id is found or the ad is already published then
* show an error message instead of doing any db updates
*
* @package ClassiPress
* @author AppThemes
* @version 3.0
*
*/
global $wpdb, $current_user;
$oid = isset($_REQUEST['oid']) ? appthemes_clean($_REQUEST['oid']) : false;
$order = get_user_orders($current_user->ID, $oid);
//if the order was found by OID, setup the order details into the $order variable
if (isset($order) && $order) {
$order = get_option($order);
}
//make sure the order sent from payment gateway is logged in the database and that the current user created it
if (isset($order['order_id']) && $order['order_id'] == $oid && $order['user_id'] == $current_user->ID) {
$order_processed = appthemes_process_membership_order($current_user, $order);
//send email to user
if ($order_processed) {
cp_owner_activated_membership_email($current_user, $order_processed);
}
} else {
$order_processed = false;
// check and make sure this transaction hasn't already been added
$sql = "SELECT * FROM {$wpdb->cp_order_info} WHERE custom = '%s' LIMIT 1";
示例13: cp_dashboard_paypal_button
function cp_dashboard_paypal_button($the_id)
{
global $wpdb, $current_user;
$current_user = wp_get_current_user();
$pack = get_pack($the_id);
// figure out the number of days this ad was listed for
if (get_post_meta($the_id, 'cp_sys_ad_duration', true)) {
$prun_period = get_post_meta($the_id, 'cp_sys_ad_duration', true);
} else {
$prun_period = get_option('cp_prun_period');
}
//setup variables depending on the purchase type
if (isset($pack->pack_name) && stristr($pack->pack_status, 'membership')) {
//get any existing orders
$cp_user_orders = get_user_orders($current_user->ID);
if (isset($cp_user_orders) && $cp_user_orders) {
$cp_user_recent_order = $cp_user_orders[0];
} else {
$oid = uniqid(rand(10, 1000), false);
$order = array();
$order['user_id'] = $current_user->ID;
$order['order_id'] = $oid;
$order['option_order_id'] = 'cp_order_' . $current_user->ID . '_' . $oid;
$order['pack_type'] = 'membership';
$order['total_cost'] = $pack->pack_membership_price;
$order = array_merge($order, (array) $pack);
if (add_option($order['option_order_id'], $order)) {
$cp_user_orders = get_user_orders($current_user->ID);
if (isset($cp_user_orders) && $cp_user_orders) {
$cp_user_recent_order = $cp_user_orders[0];
}
}
}
$item_name = sprintf(__('Membership on %s for %s days', 'appthemes'), get_bloginfo('name'), $pack->pack_duration);
$item_number = stripslashes($pack->pack_name);
$custom = get_order_id($cp_user_recent_order);
$amount = $pack->pack_membership_price;
$notify_url = get_bloginfo('url') . '/index.php?invoice=' . $custom;
$return = CP_MEMBERSHIP_PURCHASE_CONFIRM_URL . '?oid=' . $custom;
$cbt = __('Click here to complete your purchase on', 'appthemes') . ' ' . get_bloginfo('name');
} else {
//by default we assume its an ad posting
$item_name = sprintf(__('Classified ad listing on %s for %s days', 'appthemes'), get_bloginfo('name'), $prun_period);
$item_number = get_post_meta($the_id, 'cp_sys_ad_conf_id', true);
$custom = get_post_meta($the_id, 'cp_sys_ad_conf_id', true);
$amount = get_post_meta($the_id, 'cp_sys_total_ad_cost', true);
$notify_url = get_bloginfo('url') . '/index.php?invoice=' . get_post_meta($the_id, 'cp_sys_ad_conf_id', true) . '&aid=' . $the_id;
$return = CP_ADD_NEW_CONFIRM_URL . '?pid=' . get_post_meta($the_id, 'cp_sys_ad_conf_id', true) . '&aid=' . $the_id;
$cbt = __('Click here to publish your ad on', 'appthemes') . ' ' . get_bloginfo('name');
}
?>
<form name="paymentform" action="<?php
if (get_option('cp_paypal_sandbox') == 'true') {
echo 'https://www.sandbox.paypal.com/cgi-bin/webscr';
} else {
echo 'https://www.paypal.com/cgi-bin/webscr';
}
?>
" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="business" value="<?php
echo get_option('cp_paypal_email');
?>
" />
<input type="hidden" name="item_name" value="<?php
echo esc_attr($item_name);
?>
" />
<input type="hidden" name="item_number" value="<?php
echo esc_attr($item_number);
?>
" />
<input type="hidden" name="amount" value="<?php
echo esc_attr($amount);
?>
" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="custom" value="<?php
echo esc_attr($custom);
?>
" />
<input type="hidden" name="cancel_return" value="<?php
echo home_url();
?>
" />
<input type="hidden" name="return" value="<?php
echo esc_attr($return);
?>
" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="cbt" value="<?php
echo esc_attr($cbt);
?>
" />
<input type="hidden" name="currency_code" value="<?php
echo esc_attr(get_option('cp_curr_pay_type'));
//.........这里部分代码省略.........
示例14: defined
<body>
<?php
if ($user_level == 10) {
defined("FUNCTIONSOFADMIN") || define("FUNCTIONSOFADMIN", true);
require_once "admin_funcs.php";
include '../template/header.php';
} else {
defined("FUNCTIONSOFUSERS") || define("FUNCTIONSOFUSERS", true);
require_once "user_funcs.php";
include "../template/header-user.php";
defined("RSSCLASS") || define("RSSCLASS", true);
require_once "../__Classes/class.RssReader.php";
$tickets = get_user_tickets($user->ID, 10);
$order = get_user_orders($user->ID, 1);
}
if ($user_level == 10) {
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="yekan success-text">
<i class="fa fa-comments"></i> تیکت های پشتیبانی
</h4>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-3 col-md-6">
<div class="panel panel-primary">
示例15: process_membership_order
/**
* Process membership order
*
* @param array
*/
public static function process_membership_order($order_info)
{
$file = get_template_directory() . '/includes/forms/step-functions.php';
if (is_readable($file)) {
include_once $file;
/*
* Abracadabra
*/
$txn_id = $order_info['txn_id'];
/*
* First we retrieve user orders by the transaction id
* @see https://bitbucket.org/Pronamic/classipress/src/bc1334736c6e/includes/theme-functions.php?at=3.2.1#cl-2488
*/
$orders = get_user_orders('', $txn_id);
$order = get_option($orders);
/*
* Get the user ID from the orders
* @see https://bitbucket.org/Pronamic/classipress/src/bc1334736c6e/includes/theme-functions.php?at=3.2.1#cl-2476
*/
$user_id = get_order_userid($orders);
/*
* Get user data
* @see http://codex.wordpress.org/Function_Reference/get_userdata
*/
$userdata = get_userdata($user_id);
// @see https://bitbucket.org/Pronamic/classipress/src/bc1334736c6e/includes/forms/step-functions.php?at=3.2.1#cl-895
$order_processed = appthemes_process_membership_order($userdata, $order);
if ($order_processed) {
// @see https://bitbucket.org/Pronamic/classipress/src/bc1334736c6e/includes/theme-emails.php?at=3.2.1#cl-563
cp_owner_activated_membership_email($userdata, $order_processed);
}
}
}