$tbl_users = $wpdb->get_var("SHOW TABLES LIKE \"%users\""); $user_db_table_name = $tbl_users; } else { $user_db_table_name = $user_db_table_name1; } $authorsql_select = "select DISTINCT u.ID,u.user_nicename "; $authorsql_from = " from {$user_db_table_name} u,{$post_table} p "; $authorsql_conditions = " where u.ID = p.post_author and p.post_type = 'seller' "; if ($_REQUEST['id'] != '') { $authorsql_conditions .= " and p.post_author = '" . $_REQUEST['id'] . "'"; } $authorinfo = $wpdb->get_results($authorsql_select . $authorsql_from . $authorsql_conditions); if ($authorinfo) { foreach ($authorinfo as $authorObj) { echo "ID,Seller,Deal,Sale,Customer\r "; echo "{$authorObj->ID},{$authorObj->user_nicename}," . deal_count_post($authorObj->ID) . "," . deal_salecount_post($authorObj->ID) . "," . deal_salecount_post($authorObj->ID) . " \r\n\r\n"; $deal_cnt = $wpdb->get_results("select ID,post_title from {$post_table} where post_author = '" . $authorObj->ID . "' and post_type='seller' and post_status = 'publish'"); if ($deal_cnt) { $cnt = 0; $count = count($deal_cnt); echo "Post ID,Title,Original Price,Discounted Price,Start Time,End Time,Status\r\n"; foreach ($deal_cnt as $postObj) { $cnt++; $post_title = str_replace(',', ' ', $postObj->post_title); $status = ifetch_status(get_post_meta($postObj->ID, 'status', true), get_post_meta($postObj->ID, 'is_expired', true)); if (get_post_meta($postObj->ID, 'coupon_start_date_time', true) != '') { $start_date = date("Y-m-d H:i:s", get_post_meta($postObj->ID, 'coupon_start_date_time', true)); } if (get_post_meta($postObj->ID, 'coupon_end_date_time', true) != '') { $end_date = date("Y-m-d H:i:s", get_post_meta($postObj->ID, 'coupon_start_date_time', true)); }
?> </td> <td><?php echo $priceinfoObj->user_nicename; ?> </td> <td><?php echo deal_count_post($priceinfoObj->ID); ?> </td> <td><?php echo deal_salecount_post($priceinfoObj->ID); ?> </td> <td><?php echo deal_salecount_post($priceinfoObj->ID); ?> </td> <td><a href="javascript:void(0);showdetail('<?php echo $priceinfoObj->ID; ?> ');"><?php _e('Details', 'templatic'); ?> </a> | <a href="<?php echo get_template_directory_uri() . '/monetize/report/export_report.php?id=' . $priceinfoObj->ID; ?> "><?php _e('Export', 'templatic'); ?> </a></td>
echo FACEBOOK; ?> </a> <?php } ?> </p> <ul class="user_detail"> <?php if ($curauth->ID == $current_user->ID) { ?> <li><span><?php echo DEAL_PURCHASE; ?> : </span><?php echo deal_salecount_post($curauth->ID); ?> </li> <?php } ?> <li><span><?php echo DEAL_PROVIDED; ?> : </span><?php echo deal_count_post($curauth->ID); ?> </li> <li><?php echo get_user_meta($curauth->ID, 'user_about', true); ?>