<?php
/* Smarty version 4.5.3, created on 2025-11-12 22:58:14
  from 'E:\GITHUB\phpnuxbill\ui\ui\admin\odp\add.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_6914ae962d3b13_67750318',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '4b09f95ee5972970efc8aa9da3ed4c1e6030b8b7' => 
    array (
      0 => 'E:\\GITHUB\\phpnuxbill\\ui\\ui\\admin\\odp\\add.tpl',
      1 => 1762963057,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:sections/header.tpl' => 1,
    'file:sections/footer.tpl' => 1,
  ),
),false)) {
function content_6914ae962d3b13_67750318 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:sections/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<div class="row">
	<div class="col-sm-12 col-md-12">
	    <div class="panel panel-primary panel-hovered panel-stacked mb30">
		    <div class="panel-heading"><?php echo Lang::T('Add Optical Distribution Points');?>
</div>
		    <div class="panel-body">

                <form class="form-horizontal" method="post" role="form" action="<?php echo Text::url('');?>
odp/add-post" >
                    <div class="form-group">
						<label class="col-md-2 control-label"><?php echo Lang::T('Name');?>
</label>
						<div class="col-md-6">
							<input type="text" class="form-control" id="name" name="name">
						</div>
                    </div>
                    <div class="form-group">
						<label class="col-md-2 control-label"><?php echo Lang::T('Port Amount');?>
</label>
						<div class="col-md-6">
							<input type="number" class="form-control" id="port_amount" name="port_amount" placeholder="8" max="16">
						</div>
                    </div>
                    <div class="form-group">
						<label class="col-md-2 control-label"><?php echo Lang::T('Attenuation');?>
</label>
						<div class="col-md-6">
							<input type="text" class="form-control" id="attenuation" name="attenuation" placeholder="-18.15">
						</div>
                    </div>
                    <div class="form-group">
						<label class="col-md-2 control-label"><?php echo Lang::T('Address');?>
</label>
						<div class="col-md-6">
							<textarea name="address" id="address" class="form-control"></textarea>
						</div>
                    </div>
                    <div class="form-group">
						<label class="col-md-2 control-label"><?php echo Lang::T('Coordinates');?>
</label>
						<div class="col-md-6">
							<input type="text" name="coordinates" id="coordinates" class="form-control"
                                   placeholder="6.465422, 3.406448" value="">
                            <div id="map" class="mt-2" style="width: 100%; height: 200px; min-height: 150px;"></div>
						</div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label"><?php echo Lang::T('Coverage (meters)');?>
</label>
                        <div class="col-md-6">
                            <input type="number" name="coverage" id="coverage" class="form-control"
                                   placeholder="500" value="0">
                        </div>
                    </div>
					<div class="form-group">
						<div class="col-lg-offset-2 col-lg-10">
							<button class="btn btn-primary" onclick="return ask(this, '<?php echo Lang::T("Continue the ODP addition process?");?>
')" type="submit"><?php echo Lang::T('Save Changes');?>
</button>
							Or <a href="<?php echo Text::url('');?>
odp/list"><?php echo Lang::T('Cancel');?>
</a>
						</div>
					</div>
                </form>
			</div>
		</div>
	</div>
</div>


    <?php echo '<script'; ?>
 src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
>
        function getLocation() {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(showPosition);
            } else {
                setupMap(51.505, -0.09);
            }
        }

        function showPosition(position) {
            setupMap(position.coords.latitude, position.coords.longitude);
            document.getElementById('coordinates').value = position.coords.latitude + ',' + position.coords.longitude;
        }

        function setupMap(lat, lon) {
            var map = L.map('map').setView([lat, lon], 13);
            L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/light_all/{z}/{x}/{y}.png', {
                attribution:
                    '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',
                    subdomains: 'abcd',
                    maxZoom: 20
            }).addTo(map);
            var marker = L.marker([lat, lon]).addTo(map);
            map.on('click', function(e){
                var coord = e.latlng;
                var lat = coord.lat;
                var lng = coord.lng;
                var newLatLng = new L.LatLng(lat, lng);
                marker.setLatLng(newLatLng);
                $('#coordinates').val(lat + ',' + lng);
            });
        }
        window.onload = function() {
            getLocation();
        }
    <?php echo '</script'; ?>
>


<?php $_smarty_tpl->_subTemplateRender("file:sections/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}
