<?php 


class locations{


	function __construct(){


	}


	function handle_locations_menu(){

		$output = '';

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

        $selected = $tab;

        ?>

        <div class="wrap swpm-admin-menu-wrap"><!-- start wrap -->

            <h1>Add New Location</h1><!-- page title -->

            <!-- start nav menu tabs -->

            <h2 class="nav-tab-wrapper">

                <a class="nav-tab <?php echo ($tab == '') ? 'nav-tab-active' : ''; ?>" href="admin.php?page=add-location-slug">Find Us Locations</a>

                <?php

                if ($tab == 'edit_location') {//Only show the "edit button" tab when a button is being edited.

                    echo '<a class="nav-tab nav-tab-active" href="#">Edit Location</a>';

                }

               ?>

            </h2>

            <!-- end nav menu tabs -->

            <?php

            switch ($tab) {

                case 'edit_city':

                    include_once(FIND_US_PATH . '/backend/edit_location.php');
	                break;

                default:

                    include_once(FIND_US_PATH . '/backend/add_location.php');
                    break;

            }


        echo '</div>'; //<!-- end of .wrap -->

	}

}