<?php require_once("../../includes/initialize.php"); ?>
<?php include '../comunes_php/session_control.php'; ?>
<?php
    	
    	$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : '-1';

       include '../rdb/conn.php';


	$rs = mysqli_query( $conn,"SELECT l.id, l.nombre FROM localidades l ,provincias p WHERE l.provincia_id=$id and  l.provincia_id=p.id union all SELECT -1, '-' from dual  order by 2");
	
	$rows = array();
	while($row = mysqli_fetch_assoc($rs)){
	    $rows[] = $row;
}
	echo json_encode($rows);
?>