class-affiliates-totals.php
17.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Copyright (c) "kento" Karim Rahimpur www.itthinx.com
*
* This code is provided subject to the license granted.
*
* UNAUTHORIZED USE AND DISTRIBUTION IS PROHIBITED.
*
* See COPYRIGHT.txt and LICENSE.txt
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* This header and all notices must be kept intact.
*/
abstract class Affiliates_Totals implements I_Affiliates_Totals { public static function get_mass_payment_file( $IXAP34 = 'paypal', $IXAP35 = null, $IXAP7 = null ) { global $affiliates_db; $IXAP36 = isset( $IXAP35['from_date'] ) ? $IXAP35['from_date'] : null; $IXAP37 = $IXAP36 ? DateHelper::u2s( $IXAP36 ) : null; $IXAP38 = isset( $IXAP35['thru_date'] ) ? $IXAP35['thru_date'] : null; $IXAP39 = $IXAP38 ? DateHelper::u2s( $IXAP38, 24*3600 ) : null; $IXAP40 = isset( $IXAP35['minimum_total'] ) ? bcadd( "0", $IXAP35['minimum_total'], AFFILIATES_REFERRAL_AMOUNT_DECIMALS ) : null; $IXAP41 = isset( $IXAP35['referral_status'] ) ? Affiliates_Utility::verify_referral_status_transition( $IXAP35['referral_status'], $IXAP35['referral_status'] ) : null; $IXAP42 = isset( $IXAP35['currency_id'] ) ? Affiliates_Utility::verify_currency_id( $IXAP35['currency_id'] ) : null; $IXAP24 = isset( $IXAP35['affiliate_id'] ) ? affiliates_check_affiliate_id( $IXAP35['affiliate_id'] ) : null; $IXAP43 = isset( $IXAP35['affiliate_name'] ) ? $IXAP35['affiliate_name'] : null; $IXAP44 = isset( $IXAP35['affiliate_user_login'] ) ? $IXAP35['affiliate_user_login'] : null; $IXAP45 = isset( $IXAP35['orderby'] ) ? $IXAP35['orderby'] : null; $IXAP46 = isset( $IXAP35['order'] ) ? $IXAP35['order'] : null; switch ( $IXAP45 ) { case 'affiliate_id' : case 'name' : case 'user_login' : case 'email' : case 'total' : case 'currency_id' : break; default: $IXAP45 = 'name'; } switch ( $IXAP46 ) { case 'asc' : case 'ASC' : case 'desc' : case 'DESC' : break; default: $IXAP46 = 'ASC'; } if ( isset( $IXAP35['tables'] ) ) { $IXAP47 = $IXAP35['tables']['affiliates']; $IXAP48 = $IXAP35['tables']['affiliates_users']; $IXAP49 = $IXAP35['tables']['referrals']; $IXAP50 = $IXAP35['tables']['users']; $IXAP51 = array( " 1=%d " ); $IXAP52 = array( 1 ); if ( $IXAP24 ) { $IXAP51[] = " a.affiliate_id = %d "; $IXAP52[] = $IXAP24; } if ( $IXAP43 ) { $IXAP51[] = " a.name LIKE '%%%s%%' "; $IXAP52[] = $IXAP43; } if ( $IXAP44 ) { $IXAP51[] = " u.user_login LIKE '%%%s%%' "; $IXAP52[] = $IXAP44; } if ( $IXAP37 && $IXAP39 ) { $IXAP51[] = " r.datetime >= %s AND r.datetime < %s "; $IXAP52[] = $IXAP37; $IXAP52[] = $IXAP39; } else if ( $IXAP37 ) { $IXAP51[] = " r.datetime >= %s "; $IXAP52[] = $IXAP37; } else if ( $IXAP39 ) { $IXAP51[] = " r.datetime < %s "; $IXAP52[] = $IXAP39; } if ( $IXAP41 ) { $IXAP51[] = " r.status = %s "; $IXAP52[] = $IXAP41; } if ( $IXAP42 ) { $IXAP51[] = " r.currency_id = %s "; $IXAP52[] = $IXAP42; } if ( !empty( $IXAP51 ) ) { $IXAP51 = " WHERE " . implode( " AND ", $IXAP51 ); } else { $IXAP51 = ''; } $IXAP53 = ''; if ( $IXAP40 ) { $IXAP53 .= " HAVING SUM(r.amount) >= %s "; $IXAP52[] = $IXAP40; } $IXAP54 = ''; if ( $IXAP45 && $IXAP46 ) { $IXAP54 .= " ORDER BY $IXAP45 $IXAP46 "; } $IXAP55 = $affiliates_db->get_objects( "
SELECT a.*, u.user_login, SUM(r.amount) as total, r.currency_id
FROM $IXAP49 r
LEFT JOIN $IXAP47 a ON r.affiliate_id = a.affiliate_id
LEFT JOIN $IXAP48 au ON a.affiliate_id = au.affiliate_id
LEFT JOIN $IXAP50 u on au.user_id = u.ID
$IXAP51
GROUP BY r.affiliate_id, r.currency_id
$IXAP53
$IXAP54
", $IXAP52 ); $IXAP34 = strtolower( $IXAP34 ); if ( !headers_sent() ) { switch ( $IXAP34 ) { case 'paypal' : $IXAP56 = date( 'Y-m-d-H-i-s', time() ); header( 'Content-Description: File Transfer' ); if ( !empty( $IXAP7 ) ) { header( 'Content-Type: text/tab-separated-values; charset=' . $IXAP7 ); } else { header( 'Content-Type: text/tab-separated-values' ); } header( "Content-Disposition: attachment; filename=\"affiliates-mass-payment-$IXAP56.tsv\"" ); foreach( $IXAP55 as $IXAP15 ) { $IXAP57 = Affiliates_Affiliate::get_attribute( $IXAP15->affiliate_id, Affiliates_Attributes::IXAP58 ); $IXAP32 = !empty( $IXAP57 ) ? $IXAP57 : $IXAP15->email; $IXAP28 = $IXAP15->total; $IXAP42 = $IXAP15->currency_id; $IXAP24 = $IXAP15->affiliate_id; $IXAP59 = "Affiliate payment"; if ( !empty( $IXAP32 ) && !empty( $IXAP28 ) && !empty( $IXAP42 ) ) { echo "$IXAP32\t$IXAP28\t$IXAP42\t$IXAP24\t$IXAP59\n"; } } echo "\n"; break; case 'export' : $IXAP56 = date( 'Y-m-d-H-i-s', time() ); header( 'Content-Description: File Transfer' ); if ( !empty( $IXAP7 ) ) { header( 'Content-Type: text/tab-separated-values; charset=' . $IXAP7 ); } else { header( 'Content-Type: text/tab-separated-values' ); } header( "Content-Disposition: attachment; filename=\"affiliates-totals-export-$IXAP56.tsv\"" ); echo __( 'Id', AFFILIATES_PRO_PLUGIN_DOMAIN ); echo "\t"; echo __( 'Affiliate', AFFILIATES_PRO_PLUGIN_DOMAIN ); echo "\t"; echo __( 'Email', AFFILIATES_PRO_PLUGIN_DOMAIN ); echo "\t"; echo __( 'Username', AFFILIATES_PRO_PLUGIN_DOMAIN ); echo "\t"; echo __( 'Total', AFFILIATES_PRO_PLUGIN_DOMAIN ); echo "\t"; echo __( 'Currency', AFFILIATES_PRO_PLUGIN_DOMAIN ); echo "\n"; foreach( $IXAP55 as $IXAP15 ) { $IXAP24 = $IXAP15->affiliate_id; $name = stripslashes( $IXAP15->name ); $IXAP32 = $IXAP15->email; $IXAP60 = stripslashes( $IXAP15->user_login ); $IXAP28 = $IXAP15->total; $IXAP42 = $IXAP15->currency_id; echo "$IXAP24\t$name\t$IXAP32\t$IXAP60\t$IXAP28\t$IXAP42\n"; } echo "\n"; } } else { wp_die( 'ERROR: headers already sent' ); } } } public static function update_status( $IXAP61, $IXAP35 = null ) { global $affiliates_db; $IXAP62 = ""; $IXAP36 = isset( $IXAP35['from_date'] ) ? $IXAP35['from_date'] : null; $IXAP37 = $IXAP36 ? DateHelper::u2s( $IXAP36 ) : null; $IXAP38 = isset( $IXAP35['thru_date'] ) ? $IXAP35['thru_date'] : null; $IXAP39 = $IXAP38 ? DateHelper::u2s( $IXAP38, 24*3600 ) : null; $IXAP40 = isset( $IXAP35['minimum_total'] ) ? bcadd( "0", $IXAP35['minimum_total'], AFFILIATES_REFERRAL_AMOUNT_DECIMALS ) : null; $IXAP41 = isset( $IXAP35['referral_status'] ) ? Affiliates_Utility::verify_referral_status_transition( $IXAP35['referral_status'], $IXAP35['referral_status'] ) : null; $IXAP42 = isset( $IXAP35['currency_id'] ) ? Affiliates_Utility::verify_currency_id( $IXAP35['currency_id'] ) : null; $IXAP24 = isset( $IXAP35['affiliate_id'] ) ? affiliates_check_affiliate_id( $IXAP35['affiliate_id'] ) : null; $IXAP43 = isset( $IXAP35['affiliate_name'] ) ? $IXAP35['affiliate_name'] : null; $IXAP44 = isset( $IXAP35['affiliate_user_login'] ) ? $IXAP35['affiliate_user_login'] : null; $IXAP45 = isset( $IXAP35['orderby'] ) ? $IXAP35['orderby'] : null; $IXAP46 = isset( $IXAP35['order'] ) ? $IXAP35['order'] : null; switch ( $IXAP45 ) { case 'affiliate_id' : case 'name' : case 'email' : $IXAP45 = 'a.' . $IXAP45; break; case 'user_login' : $IXAP45 = 'au.' . $IXAP45; break; case 'currency_id' : $IXAP45 = 'r.' . $IXAP45; break; default: $IXAP45 = 'a.name'; } switch ( $IXAP46 ) { case 'asc' : case 'ASC' : case 'desc' : case 'DESC' : break; default: $IXAP46 = 'ASC'; } if ( isset( $IXAP35['tables'] ) ) { $IXAP62 .= "<h1>" . __( "Closing referrals", AFFILIATES_PRO_PLUGIN_DOMAIN ) . "</h1>"; $IXAP62 .= "<div class='closing-referrals-overview'>"; $IXAP47 = $IXAP35['tables']['affiliates']; $IXAP48 = $IXAP35['tables']['affiliates_users']; $IXAP49 = $IXAP35['tables']['referrals']; $IXAP50 = $IXAP35['tables']['users']; $IXAP51 = array( " 1=%d " ); $IXAP52 = array( 1 ); if ( $IXAP24 ) { $IXAP51[] = " a.affiliate_id = %d "; $IXAP52[] = $IXAP24; } if ( $IXAP43 ) { $IXAP51[] = " a.name LIKE '%%%s%%' "; $IXAP52[] = $IXAP43; } if ( $IXAP44 ) { $IXAP51[] = " u.user_login LIKE '%%%s%%' "; $IXAP52[] = $IXAP44; } if ( $IXAP37 && $IXAP39 ) { $IXAP51[] = " r.datetime >= %s AND r.datetime < %s "; $IXAP52[] = $IXAP37; $IXAP52[] = $IXAP39; } else if ( $IXAP37 ) { $IXAP51[] = " r.datetime >= %s "; $IXAP52[] = $IXAP37; } else if ( $IXAP39 ) { $IXAP51[] = " r.datetime < %s "; $IXAP52[] = $IXAP39; } if ( $IXAP41 ) { $IXAP51[] = " r.status = %s "; $IXAP52[] = $IXAP41; } if ( $IXAP42 ) { $IXAP51[] = " r.currency_id = %s "; $IXAP52[] = $IXAP42; } if ( $IXAP40 ) { $IXAP63 = $IXAP51; if ( !empty( $IXAP63 ) ) { $IXAP63 = " WHERE " . implode( " AND ", $IXAP51 ); } else { $IXAP63 = ''; } $IXAP64 = $IXAP52; $IXAP65 = " HAVING SUM(r.amount) >= %s "; $IXAP64[] = $IXAP40; $IXAP51[] = " (a.affiliate_id, r.currency_id) IN
(
SELECT r.affiliate_id, r.currency_id
FROM $IXAP49 r
LEFT JOIN $IXAP47 a ON r.affiliate_id = a.affiliate_id
LEFT JOIN $IXAP48 au ON a.affiliate_id = au.affiliate_id
LEFT JOIN $IXAP50 u on au.user_id = u.ID
$IXAP63
GROUP BY r.affiliate_id, r.currency_id
$IXAP65
)
"; foreach( $IXAP64 as $IXAP66 ) { array_push( $IXAP52, $IXAP66 ); } $IXAP51[] = " r.amount IS NOT NULL "; } if ( !empty( $IXAP51 ) ) { $IXAP51 = " WHERE " . implode( " AND ", $IXAP51 ); } else { $IXAP51 = ''; } $IXAP54 = ''; if ( $IXAP45 && $IXAP46 ) { $IXAP54 .= " ORDER BY $IXAP45 $IXAP46 "; } $IXAP67 = isset( $IXAP35['step'] ) ? intval( $IXAP35['step'] ) : 1; switch ( $IXAP67 ) { case 1 : $IXAP55 = $affiliates_db->get_objects( "
SELECT a.*, r.*, u.user_login
FROM $IXAP49 r
LEFT JOIN $IXAP47 a ON r.affiliate_id = a.affiliate_id
LEFT JOIN $IXAP48 au ON a.affiliate_id = au.affiliate_id
LEFT JOIN $IXAP50 u on au.user_id = u.ID
$IXAP51
$IXAP54
", $IXAP52 ); $IXAP62 .= "<div class='manage'>"; $IXAP62 .= "<div class='warning'>"; $IXAP62 .= "<p>"; $IXAP62 .= "<strong>"; $IXAP62 .= __( "Please review the list of referrals that will be <em>closed</em>.", AFFILIATES_PRO_PLUGIN_DOMAIN ); $IXAP62 .= "</strong>"; $IXAP62 .= "</p>"; $IXAP62 .= "</div>"; $IXAP62 .= "<p>"; $IXAP62 .= __( "Usually only referrals that are <em>accepted</em> and have been paid out should be <em>closed</em>. If there are unwanted or too many referrals shown, restrict your filter settings.", AFFILIATES_PRO_PLUGIN_DOMAIN ); $IXAP62 .= "</p>"; $IXAP62 .= "<p>"; $IXAP62 .= __( "If these referrals can be closed, click the confirmation button below.", AFFILIATES_PRO_PLUGIN_DOMAIN ); $IXAP62 .= "</p>"; $IXAP62 .= "</div>"; $IXAP62 .= '<div id="referrals-overview" class="referrals-overview">'; $IXAP62 .= self::render_results( $IXAP55 ); $IXAP62 .= '</div>'; if ( count( $IXAP55 > 0 ) ) { $IXAP68 = ""; if ( !empty( $IXAP36 ) ) { $IXAP68 .= "&from_date=" . urlencode( $IXAP36 ); } if ( !empty( $IXAP38 ) ) { $IXAP68 .= "&thru_date=" . urlencode( $IXAP38 ); } if ( !empty( $IXAP40 ) ) { $IXAP68 .= "&minimum_total=" . urlencode( $IXAP40 ); } if ( !empty( $IXAP41 ) ) { $IXAP68 .= "&referral_status=" . urlencode( $IXAP41 ); } if ( !empty( $IXAP42 ) ) { $IXAP68 .= "¤cy_id=" . urlencode( $IXAP42 ); } if ( !empty( $IXAP24 ) ) { $IXAP68 .= "&affiliate_id=" . urlencode( $IXAP24 ); } if ( !empty( $IXAP43 ) ) { $IXAP68 .= "&affiliate_name=" . urlencode( $IXAP43 ); } if ( !empty( $IXAP44 ) ) { $IXAP68 .= "&affiliate_user_login=" . urlencode( $IXAP44 ); } if ( !empty( $IXAP45 ) ) { $IXAP68 .= "&orderby=" . urlencode( $IXAP45 ); } if ( !empty( $IXAP46 ) ) { $IXAP68 .= "&order=" . urlencode( $IXAP46 ); } $IXAP69 = esc_url( AFFILIATES_PRO_PLUGIN_URL . 'lib/ext/includes/generate-mass-payment-file.php' ); $IXAP62 .= '<div class="manage confirm">'; $IXAP70 = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $IXAP70 = remove_query_arg( 'paged', $IXAP70 ); $IXAP70 = remove_query_arg( 'action', $IXAP70 ); $IXAP70 = remove_query_arg( 'affiliate_id', $IXAP70 ); $IXAP62 .= "<p>"; $IXAP62 .= __( "Close these referrals by clicking:", AFFILIATES_PRO_PLUGIN_DOMAIN ); $IXAP62 .= "</p>"; $IXAP62 .= "<a title='" . __( 'Click to close these referrals', AFFILIATES_PRO_PLUGIN_DOMAIN ) . "' " . "class='close-referrals button' " . "href='" . esc_url( $IXAP70 ) . "&action=close_referrals&step=2" . $IXAP68 . "'>" . "<img class='icon' alt='" . __( 'Close referrals', AFFILIATES_PRO_PLUGIN_DOMAIN) . "' src='". AFFILIATES_PRO_PLUGIN_URL ."images/closed.png'/>" . "<span class='label'>" . __( 'Close Referrals', AFFILIATES_PRO_PLUGIN_DOMAIN) . "</span>" . "</a>"; $IXAP62 .= "<div class='warning'>"; $IXAP62 .= "<p>"; $IXAP62 .= "<strong>"; $IXAP62 .= __( "This action can not be undone*.", AFFILIATES_PRO_PLUGIN_DOMAIN ); $IXAP62 .= "</strong>"; $IXAP62 .= "</p>"; $IXAP62 .= "<p>"; $IXAP62 .= "<span style='font-size:0.8em;'>"; $IXAP62 .= __( "*To undo, each referral would have to be set to the desired status individually.", AFFILIATES_PRO_PLUGIN_DOMAIN ); $IXAP62 .= "</span>"; $IXAP62 .= "</p>"; $IXAP62 .= "</div>"; $IXAP62 .= '</div>'; } break; case 2 : $IXAP55 = $affiliates_db->get_objects( "
SELECT a.*, r.*, u.user_login
FROM $IXAP49 r
LEFT JOIN $IXAP47 a ON r.affiliate_id = a.affiliate_id
LEFT JOIN $IXAP48 au ON a.affiliate_id = au.affiliate_id
LEFT JOIN $IXAP50 u on au.user_id = u.ID
$IXAP51
$IXAP54
", $IXAP52 ); $IXAP71 = array(); $IXAP72 = array(); $IXAP73 = array(); foreach ( $IXAP55 as $IXAP15 ) { if ( $IXAP74 = Affiliates_Utility::verify_referral_status_transition( $IXAP15->status, $IXAP61 ) ) { if ( $affiliates_db->query( "UPDATE $IXAP49 SET status = %s WHERE affiliate_id = %d AND post_id = %d AND datetime = %s ", $IXAP74, $IXAP15->affiliate_id, $IXAP15->post_id, $IXAP15->datetime ) ) { $IXAP15->status = $IXAP74; $IXAP71[] = $IXAP15; } else { $IXAP73[] = $IXAP15; } } else { $IXAP72[] = $IXAP15; } } $IXAP75 = array( AFFILIATES_REFERRAL_STATUS_ACCEPTED => __( 'Accepted', AFFILIATES_PLUGIN_DOMAIN ), AFFILIATES_REFERRAL_STATUS_CLOSED => __( 'Closed', AFFILIATES_PLUGIN_DOMAIN ), AFFILIATES_REFERRAL_STATUS_PENDING => __( 'Pending', AFFILIATES_PLUGIN_DOMAIN ), AFFILIATES_REFERRAL_STATUS_REJECTED => __( 'Rejected', AFFILIATES_PLUGIN_DOMAIN ), ); $IXAP62 .= "<h2>" . __( "Updated", AFFILIATES_PRO_PLUGIN_DOMAIN ) . "</h2>"; $IXAP62 .= "<p>"; $IXAP62 .= sprintf( __( "These referrals have been updated to <em>%s</em>.", AFFILIATES_PRO_PLUGIN_DOMAIN ), ( isset( $IXAP75[$IXAP61] ) ? $IXAP75[$IXAP61] : $IXAP61 ) ); $IXAP62 .= "</p>"; $IXAP62 .= self::render_results( $IXAP71 ); if ( count( $IXAP72 ) > 0 ) { $IXAP62 .= "<h2>" . __( "Omitted", AFFILIATES_PRO_PLUGIN_DOMAIN ) . "</h2>"; $IXAP62 .= "<p>"; $IXAP62 .= sprintf( __( "These referrals have been omitted because their status must not be changed to <em>%s</em>.", AFFILIATES_PRO_PLUGIN_DOMAIN ), ( isset( $IXAP75[$IXAP61] ) ? $IXAP75[$IXAP61] : $IXAP61 ) ); $IXAP62 .= "</p>"; $IXAP62 .= self::render_results( $IXAP72 ); } if ( count( $IXAP73 ) > 0 ) { $IXAP62 .= "<h2>" . __( "Failed", AFFILIATES_PRO_PLUGIN_DOMAIN ) . "</h2>"; $IXAP62 .= "<p>"; $IXAP62 .= sprintf( __( "These referrals could not be updated to <em>%s</em>.", AFFILIATES_PRO_PLUGIN_DOMAIN ), ( isset( $IXAP75[$IXAP61] ) ? $IXAP75[$IXAP61] : $IXAP61 ) ); $IXAP62 .= "</p>"; $IXAP62 .= self::render_results( $IXAP73 ); } break; } $IXAP62 .= "</div>"; } return $IXAP62; } public static function render_results( $IXAP55 ) { $IXAP62 = ""; $IXAP76 = array( 'datetime' => __( 'Date', AFFILIATES_PLUGIN_DOMAIN ), 'post_title' => __( 'Post', AFFILIATES_PLUGIN_DOMAIN ), 'name' => __( 'Affiliate', AFFILIATES_PLUGIN_DOMAIN ), 'amount' => __( 'Amount', AFFILIATES_PLUGIN_DOMAIN ), 'currency_id' => __( 'Currency', AFFILIATES_PLUGIN_DOMAIN ), 'status' => __( 'Status', AFFILIATES_PLUGIN_DOMAIN ) ); $IXAP75 = array( AFFILIATES_REFERRAL_STATUS_ACCEPTED => __( 'Accepted', AFFILIATES_PLUGIN_DOMAIN ), AFFILIATES_REFERRAL_STATUS_CLOSED => __( 'Closed', AFFILIATES_PLUGIN_DOMAIN ), AFFILIATES_REFERRAL_STATUS_PENDING => __( 'Pending', AFFILIATES_PLUGIN_DOMAIN ), AFFILIATES_REFERRAL_STATUS_REJECTED => __( 'Rejected', AFFILIATES_PLUGIN_DOMAIN ), ); $IXAP77 = array( AFFILIATES_REFERRAL_STATUS_ACCEPTED => "<img class='icon' alt='" . __( 'Accepted', AFFILIATES_PRO_PLUGIN_DOMAIN) . "' src='" . AFFILIATES_PRO_PLUGIN_URL . "images/accepted.png'/>", AFFILIATES_REFERRAL_STATUS_CLOSED => "<img class='icon' alt='" . __( 'Closed', AFFILIATES_PRO_PLUGIN_DOMAIN) . "' src='" . AFFILIATES_PRO_PLUGIN_URL . "images/closed.png'/>", AFFILIATES_REFERRAL_STATUS_PENDING => "<img class='icon' alt='" . __( 'Pending', AFFILIATES_PRO_PLUGIN_DOMAIN) . "' src='" . AFFILIATES_PRO_PLUGIN_URL . "images/pending.png'/>", AFFILIATES_REFERRAL_STATUS_REJECTED => "<img class='icon' alt='" . __( 'Rejected', AFFILIATES_PRO_PLUGIN_DOMAIN) . "' src='" . AFFILIATES_PRO_PLUGIN_URL . "images/rejected.png'/>", ); $IXAP62 .= '<table id="referrals" class="referrals wp-list-table widefat fixed" cellspacing="0">'; $IXAP62 .= "<thead>"; $IXAP62 .= "<tr>"; foreach ( $IXAP76 as $IXAP78 => $IXAP79 ) { $IXAP62 .= "<th scope='col'>$IXAP79</th>"; } $IXAP62 .= "</tr>"; $IXAP62 .= "</thead>"; $IXAP62 .= "<tbody>"; if ( count( $IXAP55 ) > 0 ) { for ( $IXAP80 = 0; $IXAP80 < count( $IXAP55 ); $IXAP80++ ) { $IXAP15 = $IXAP55[$IXAP80]; $IXAP62 .= '<tr class="details-referrals ' . ( $IXAP80 % 2 == 0 ? 'even' : 'odd' ) . '">'; $IXAP62 .= '<td class="datetime">' . DateHelper::s2u( $IXAP15->datetime ) . '</td>'; $IXAP81 = get_the_title( $IXAP15->post_id ); $IXAP62 .= '<td class="post_title">' . wp_filter_nohtml_kses( $IXAP81 ) . '</td>'; $IXAP62 .= "<td class='name'>" . stripslashes( wp_filter_nohtml_kses( $IXAP15->name ) ) . "</td>"; $IXAP62 .= "<td class='amount'>" . stripslashes( wp_filter_nohtml_kses( $IXAP15->amount ) ) . "</td>"; $IXAP62 .= "<td class='currency_id'>" . stripslashes( wp_filter_nohtml_kses( $IXAP15->currency_id ) ) . "</td>"; $IXAP62 .= "<td class='status'>"; $IXAP62 .= isset( $IXAP77[$IXAP15->status] ) ? $IXAP77[$IXAP15->status] : ''; $IXAP62 .= isset( $IXAP75[$IXAP15->status] ) ? $IXAP75[$IXAP15->status] : ''; $IXAP62 .= "</td>"; $IXAP62 .= '</tr>'; } } else { $IXAP62 .= '<tr><td colspan="' . count( $IXAP76 ) . '">' . __('There are no results.', AFFILIATES_PLUGIN_DOMAIN ) . '</td></tr>'; } $IXAP62 .= '</tbody>'; $IXAP62 .= '</table>'; return $IXAP62; } }