}
     $output .= '<figcaption>';
     $output .= '<p>' . themeum_get_project_info(get_the_ID(), 'percent') . '%</p>';
     $output .= '<p class="pull-left">' . __("Rise Funded", "themeum-startup-idea") . '</p>';
     $output .= themeum_get_ratting_data(get_the_ID());
     $output .= '</figcaption>';
     $output .= '</figure>';
     $output .= '</a>';
     $output .= '</div>';
     $output .= '<div class="clearfix"></div>';
     $output .= '<div class="details">';
     $output .= '<div class="country-name">' . esc_attr($location) . '</div>';
     $output .= '<h4><a href="' . get_the_permalink() . '">' . get_the_title() . '</a></h4>';
     $output .= '<div class="entry-meta">';
     $output .= '<span class="entry-food">' . get_the_term_list(get_the_ID(), 'project_tag', '<i class="fa fa-tags"></i> ', ', ') . '</span>';
     $output .= '<span class="entry-money"><i class="fa fa-money"></i> ' . __('investment:', 'themeum-startup-idea') . ' <strong>' . themeum_get_currency_symbol() . esc_attr($funding_goal) . '</strong></span>';
     $output .= '</div>';
     $output .= '</div> ';
     $output .= '</div>';
     //ideas item
     $output .= '</div>';
     // -----------------
     if ($inner % 3 == 0) {
         $output .= '</div>';
     }
     $inner++;
 }
 if ($inner % 3 != 0) {
     $output .= '</div>';
 }
 // Reset Query
Example #2
0
function themeum_startup_idea_paid()
{
    ?>
<h1><?php 
    _e('Withdraw Done', 'themeum-startup-idea');
    ?>
</h1>
<?php 
    global $wpdb;
    $range = 20;
    $limit = 'LIMIT 0,' . $range;
    if (isset($_GET['limit'])) {
        if ($_GET['limit']) {
            $all = $range * $_GET['limit'];
            $limit = 'LIMIT ' . ($all - $range) . ', ' . $all . ' ';
        }
    }
    $result = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM " . $wpdb->prefix . "postmeta WHERE meta_key='%s' AND meta_value='%s' {$limit}", 'thm_withdraw_request', 'done'));
    ?>

<table class="wp-list-table widefat fixed posts">
	<thead>
	<tr>
		<td><?php 
    _e('Name', 'themeum-startup-idea');
    ?>
</td>
		<td><?php 
    _e('Author', 'themeum-startup-idea');
    ?>
</td>
		<td><?php 
    _e('Budget', 'themeum-startup-idea');
    ?>
</td>
		<td><?php 
    _e('Comission', 'themeum-startup-idea');
    ?>
(n%)</td>
		<td><?php 
    _e('Status', 'themeum-startup-idea');
    ?>
</td>
	</tr>
	</thead>
	<tbody>
		 <?php 
    if (is_array($result)) {
        foreach ($result as $value) {
            $funding_goal = esc_attr(get_post_meta($value->post_id, 'thm_funding_goal', true));
            $percent = esc_attr(get_post_meta($value->post_id, 'thm_percentage', true));
            $status = esc_attr(get_post_meta($value->post_id, 'thm_withdraw_request', true));
            echo '<tr>';
            echo '<td>' . get_the_title($value->post_id) . '</td>';
            echo '<td>' . get_the_author_meta('user_login', get_post_field('post_author', $value->post_id)) . '</td>';
            echo '<td>' . $funding_goal . esc_attr(themeum_get_currency_symbol()) . '</td>';
            $per = 0;
            if ($funding_goal > 0 && $percent > 0) {
                $per = $percent / 100 * $funding_goal;
            }
            echo '<td>' . $per . ' (' . $percent . '%)</td>';
            echo '<td>' . $status . '</td>';
            echo '</tr>';
        }
    }
    ?>
	</tbody>
</table>
<?php 
    $results = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM " . $wpdb->prefix . "postmeta WHERE meta_key='%s' AND meta_value='%s'", 'thm_withdraw_request', 'done'));
    $loop = ceil(count($results) / $range);
    $actual_link = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
    $actual_link = explode('&limit=', $actual_link);
    echo '<div class="tablenav"><div class="tablenav-pages"><span class="pagination-links">';
    for ($i = 1; $i <= $loop; $i++) {
        if (isset($_GET['limit'])) {
            if ($i == $_GET['limit']) {
                echo '<a class="actives" href="' . $actual_link[0] . '&limit=' . $i . '">' . $i . '</a>';
            } else {
                echo '<a href="' . $actual_link[0] . '&limit=' . $i . '">' . $i . '</a>';
            }
        } else {
            if ($i == 1) {
                echo '<a class="actives" href="' . $actual_link[0] . '&limit=' . $i . '">' . $i . '</a>';
            } else {
                echo '<a href="' . $actual_link[0] . '&limit=' . $i . '">' . $i . '</a>';
            }
        }
    }
    echo '</span></div></div>';
}