<td><a href = '<?php echo home_url() . "/wp-admin/user-edit.php?user_id=" . $log["uid"]; ?> ' title = "View Profile"><?php echo $user_info->user_login; ?> </a></td> <td><a href = '<?php echo home_url() . "/wp-admin/post.php?post=" . $log["oid"] . "&action=edit"; ?> ' title = "View Order"><?php echo "#" . $log["oid"] . " - View Order"; ?> </a></td> <td><?php wc_w_get_type($log["wcw_type"]); ?> </td> <td><?php echo wc_price($log["amount"]); ?> </td> <td><?php echo $log["date"]; ?> </td> <tr> <?php } } ?>
/** * * @param int $uid * @param int $amount * @param int $method * @subpackage 0 => Wallet to Credits * 1 => Credits to Wallet * @param int $order_id */ function wc_w_add_to_log($uid, $amount, $method, $order_id) { /** * 0 => Wallet to Credits * 1 => Credits to Wallet */ switch ($method) { case 0: $method = 0; break; case 1: $method = 1; break; default: $method = 0; break; } $arg = array("post_title" => "Logs", "post_content" => "", "post_type" => "wcw_logs", "post_status" => "publish"); $pid = wp_insert_post($arg); add_post_meta($pid, 'wcw_type', $method); add_post_meta($pid, 'uid', $uid); add_post_meta($pid, 'date', date('d M Y')); add_post_meta($pid, 'oid', $order_id); add_post_meta($pid, 'amount', $amount); if (is_wcw_notify_admin()) { $user_info = get_userdata($uid); wcw_ntify_admin(get_option('admin_email'), $user_info->user_login, date('d M Y'), $order_id, $amount, wc_w_get_type($method)); } }