<?php
/*
Template Name: Dashboard User
*/

/**
 * @package WordPress
 * @subpackage Campoal
 */

global $campoal_options;

// Check user is loggedin or not, if not redirect to login page
conikal_redirect_login();

get_header();

$section = isset($_GET['section']) ? sanitize_text_field($_GET['section']) : 'dashboard';

?>

<div id="wrapper" class="wrapper petition">
    <?php 
    if (!wp_is_mobile() && is_page_template('dashboard-user.php')) {
        get_template_part('templates/dashboard-menu');
    }
    ?>
	<div class="ui grid" id="dashboard-content">
	 	<div class="sixteen wide mobile sixteen wide computer centered column">
            <div class="ui raised padded segment">
    		    <?php
    		    	switch ($section) {
    		    		case 'my_petitions':
    		    			get_template_part('templates/dashboard/my-petitions');
    		    			break;
                        case 'my_fundraisings':
                            get_template_part('templates/dashboard/my-fundraisings');
                            break;

    		    		case 'signed_petitions':
    		    			get_template_part('templates/dashboard/signed-petitions');
    		    			break;

    		    		case 'bookmarks':
    		    			get_template_part('templates/dashboard/bookmarks');
    		    			break;

    		    		case 'users_follow':
    		    			get_template_part('templates/dashboard/users-follow');
    		    			break;

    		    		case 'topics_follow':
    		    			get_template_part('templates/dashboard/topics-follow');
    		    			break;

    		    		case 'contributions':
    		    			get_template_part('templates/dashboard/contributions');
    		    			break;	

                        case 'transactions':
                            get_template_part('templates/dashboard/transactions');
                            break;  

                        case 'withdrawals':
                            get_template_part('templates/dashboard/withdrawals');
                            break;  

                        case 'financial':
                            get_template_part('templates/dashboard/financial');
                            break;  

						case 'donation-receipt':
							get_template_part('templates/dashboard/donation-receipt');
							break;  
    		    		
    		    		default:
    		    			get_template_part('templates/dashboard/my-petitions');
    		    			break;
    		    	}
    		    ?>
            </div>
	  	</div>
	</div>
</div>

<?php get_footer(); ?>
