<body>

<nav>
    <ul>
        <li class="navbar"><a href="Database/Database_Store_Manager.php">Admin</a></li>
        <li class="navbar"><a href="log_in.html">Log in</a></li>
        <li class="navbar"><a href="cart.html">Cart</a></li>
    </ul>
</nav>

<?php 
if ($_POST) {
    // get latitude, longitude and formatted address
    $sc_zip = $_POST['searchbox'];
    include_once '../Database/Store_Information.php';
    $store_info = new Store_Information();
    $store_info->queryAllStoreInfo();
    $index = count($store_info->_store_name);
    $counter_php = 1;
    $latitude = $store_info->_store_location_lat[1];
    $longitude = $store_info->_store_location_lan[1];
    $formatted_address = $store_info->_default_address_street[1] . " " . $store_info->_default_address_city[1] . " " . $store_info->_default_address_state[1] . " " . $store_info->_default_address_zip[1];
    ?>

    <!-- google map will be shown here -->
    <div id="gmap_canvas">Loading map...</div>

    <!-- JavaScript to show google map -->
    <script type="text/javascript" src="http://maps.google.com/maps/api/js"></script>
    <script type="text/javascript">
        function init_map() {
/**
 * List all saved Store information in Manager page
 */
function showStoreInfo()
{
    include_once '../Database/Store_Information.php';
    $store_info = new Store_Information();
    $store_info->queryAllStoreInfo();
    echo "<table id='tb_store_info_dba' border='1' align=center><tr><th>Store Name</th><th>Store Rating</th><th>Store Category</th><th>Store lat</th><th>Store lan</th>\n          <th>Store Address Street</th><th>Store Address Street Ref</th><th>Store Address City</th><th>Store Address State</th><th>Store Address Zip</th>\n          <th>Store Address Country</th></tr>";
    // output data of each row
    for ($x = 1; $x <= count($store_info->_store_name); $x++) {
        echo "<tr><td>" . $store_info->_store_name[$x] . "</td><td>" . $store_info->_store_rating[$x] . "</td><td>" . $store_info->_store_category[$x] . "</td><td>" . $store_info->_store_location_lat[$x] . "</td><td>" . $store_info->_store_location_lan[$x] . "</td><td>" . $store_info->_default_address_street[$x] . "</td><td>" . $store_info->_default_address_street_ref[$x] . "</td><td>" . $store_info->_default_address_city[$x] . "</td><td>" . $store_info->_default_address_state[$x] . "</td><td>" . $store_info->_default_address_zip[$x] . "</td><td>" . $store_info->_default_address_country[$x] . "</td></tr>";
    }
    echo "</table>";
}