<?php

include('views/_header.tpl.php');

?>

<style>
    .form .row-item .lbl {
        font-weight: 300;
        width: 70px !important;
        min-width: 70px !important;
    }
    #mmen { display:none; }
    .spacer { padding-top: 35px; }
    button.btn.btn-success.upload-result { background:#325fac; }
   /*.cr-viewport.cr-vp-square { max-width:384px !important; width:384px !important; height:250px !important; }*/
   .cr-viewport.cr-vp-square { max-width:696px !important; width:696px !important; height:390px !important; }
   .btn { padding: 15px 40px; min-width:150px; }
   .form .row-item .lbl { font-weight:300; }
/************* MAP ****************/
#map-canvas {
    height: 300px;
    width: 97%;
    margin: auto;
    padding: 0;
    border:3px solid #325fac;
}
/************* MAP ****************/
</style>

 <div class="home-feature-category" style="background:none; border:none;">
        <div class="container_12 clearfix">
        <div class="grid_8 marked-category">

        <h1 style="margin-bottom:0px;"><?php
        
        if ($location) {
            echo "Edit now...";
        } else {
            echo "Add";
            $def = "/static/uploads/locations/placeholder.jpg";
        }
        
        ?> Location</h1>

        <form method="post" class="form form-profile" enctype="multipart/form-data" style="padding:25px 0px 0px;">
            <div class="row-item clearfix" style="padding-bottom:10px;">       
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Name:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="name" value="<?= $location['name'] ?>" >
                    <p class="rs description-input"></p>
                </div>
                
                
                 <label class="lbl" for="txt_name1" style="text-align:left; width:80px; margin-right:5px;">Address:</label>
                <div class="val" style="margin-left:0px; font-weight:300;">
                    <input class="txt" type="text" onblur="geocodeAddress();" id="txt_location" name="address" value="<?= $location['address']; ?>"><br />
                    <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">LAT:</label> 
                    <input class="txt" name='latitude' value="<?= $location['latitude']; ?>" style="" /><br />
                    <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">LNG:</label> 
                    <input class="txt" name='longitude' value="<?= $location['longitude']; ?>" style="" />     
                    <!--<input class="txt" type="text" name="full_address" value="<?= $mdeal['full_address'] ?>">-->
                    <p class="rs description-input"></p>
                </div>     
                <div class="clear"></div>            
                
                <br />
                
                    <div class="row-item clearfix">
                        <div  id="map-canvas"></div>
                    </div>      
                    
                                   
                
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Time:</label>
                <div class="val" style="margin-left:0px;">
                    <textarea class="txt" name="work_time"><?= $location['work_time'] ?></textarea>
                    <p class="rs description-input"></p>
                </div>
     
            </div>
            <br />
            <input type="submit" style="font-weight:300" class="btn btn-blue" /> 
            <input type="button" value="Cancel" class="btn btn-black" onclick="location = '/admin/'" />
        </form>

        </div>
    </div>
</div>

<script src='/static/js/googlemaps/GoogleMapsLocations.js'></script>

<?php

include('views/_footer.tpl.php');

?>