예제 #1
0
    /**
     * List withdraw request for a user
     *
     * @param  int  $user_id
     *
     * @return void
     */
    function withdraw_requests($user_id)
    {
        $withdraw_requests = $this->get_withdraw_requests($user_id);
        if ($withdraw_requests) {
            ?>
            <table class="table table-striped">
                <tr>
                    <th><?php 
            _e('Amount', 'dokan');
            ?>
</th>
                    <th><?php 
            _e('Method', 'dokan');
            ?>
</th>
                    <th><?php 
            _e('Date', 'dokan');
            ?>
</th>
                    <th><?php 
            _e('Cancel', 'dokan');
            ?>
</th>
                    <th><?php 
            _e('Status', 'dokan');
            ?>
</th>
                </tr>

                <?php 
            foreach ($withdraw_requests as $request) {
                ?>

                    <tr>
                        <td><?php 
                echo wc_price($request->amount);
                ?>
</td>
                        <td><?php 
                echo dokan_withdraw_get_method_title($request->method);
                ?>
</td>
                        <td><?php 
                echo dokan_format_time($request->date);
                ?>
</td>
                        <td>
                            <?php 
                $url = add_query_arg(array('action' => 'dokan_cancel_withdrow', 'id' => $request->id), dokan_get_navigation_url('withdraw'));
                ?>
                            <a href="<?php 
                echo wp_nonce_url($url, 'dokan_cancel_withdrow');
                ?>
">
                                <?php 
                _e('Cancel', 'dokan');
                ?>
                            </a>
                        </td>
                        <td><?php 
                echo $this->request_status($request->status);
                ?>
</td>
                    </tr>

                <?php 
            }
            ?>

            </table>
            <?php 
        }
    }
        <?php 
    foreach ($withdraw_requests as $request) {
        ?>

            <tr>
                <td><?php 
        echo wc_price($request->amount);
        ?>
</td>
                <td><?php 
        echo dokan_withdraw_get_method_title($request->method);
        ?>
</td>
                <td><?php 
        echo dokan_format_time($request->date);
        ?>
</td>
                <td>
                    <?php 
        $url = add_query_arg(array('action' => 'dokan_cancel_withdrow', 'id' => $request->id), dokan_get_navigation_url('withdraw'));
        ?>
                    <a href="<?php 
        echo wp_nonce_url($url, 'dokan_cancel_withdrow');
        ?>
">
                        <?php 
        _e('Cancel', 'dokan');
        ?>
                    </a>
                </td>