zoom to view function problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

zoom to view function problem

spoke
hello. I have tried to execute the ZoomToView function using code:

<?php
session_start();
print_r($_SESSION);
if(($_POST["zoom"]!=null)&&($_POST["pickname"]!="Choose"&&$_POST["pickname"]!="- - - - - - -"))
	{
		$_SESSION["onload"]=1;
	}
?>
<html>
<head>
<title>Search By Name</title>
    <meta http-equiv="content-script-type" content="text/javascript">
<meta content="text/html; charset=windows-1255" http-equiv="Content-Type">
<script language="javascript">
function zoomtoview()
{
    parent.parent.ZoomToView(document.getElementById("HX").value, document.getElementById("HY").value, 700, true);    
}
</script>
</head>

<body dir="rtl" onload="<?php if ($_SESSION['onload']==1) { echo 'zoomtoview()'; } ?>">
<form method="post">
<select name="pickname">
<?php
$conn_id=odbc_connect('NetuneyYishuvimLamas','','');
$sql="select Name From Yishuvim2010";
$exec_id=odbc_exec($conn_id, $sql);
$i=1;
if($_POST["pickname"]=="Choose"||$_POST["pickname"]=="- - - - - - -"||$_POST["pickname"]==null)
{
	echo "<option>Choose</option>";
	echo "<option>- - - - - - -</option>";
}
	else
	{
		echo "<option value='".$_POST["pickname"]."'>".$_POST["pickname"]."</option>";
		echo "<option>- - - - - - -</option>";
	}
if($_POST["foraftersearch"]==null) {
	while(odbc_fetch_row($exec_id, $i))
	{
		echo "<option value='".odbc_result($exec_id, "Name")."'>".odbc_result($exec_id, "Name")."</option>";
		$i++;
	}
}
else {
		$sql="select Name from Yishuvim2010 where Name like '%".$_POST["foraftersearch"]."' or Name like '".$_POST["foraftersearch"]."%' or Name like '%".$_POST["foraftersearch"]."%'";
		$exec_id=odbc_exec($conn_id, $sql);
		while(odbc_fetch_row($exec_id, $i))
		{
			echo "<option value='".odbc_result($exec_id, "Name")."'>".odbc_result($exec_id, "Name")."</option>";
			$i++;
		}
	}
?>
</select>
<br>
<input type="submit" name="zoom" value="Zoom" />
<?php
	if(($_POST["zoom"]!=null)&&($_POST["pickname"]!="Choose"&&$_POST["pickname"]!="- - - - - - -"))
	{
		$sqlst="select X,Y from Yishuvim2010 where Name='".$_POST["pickname"]."'";
		$exec2_id=odbc_exec($conn_id, $sqlst);
		$XV=odbc_result($exec2_id, "X");
		$YV=odbc_result($exec2_id, "Y");
		echo "<br/>".$XV."<br/>".$YV;
	}
	elseif(($_POST["pickname"]=="Choose"||$_POST["pickname"]=="- - - - - - -")&&$_POST["foraftersearch"]==null)
	{
		$_SESSION["onload"]=0;
		echo "<br/>You have to choose";		
	}
?><br>
<input type="text" name="foraftersearch" id="foraftersearch" /><br>
<input type="submit" name="aftersearch" id="aftersearch" value="search" /><br>
<input type="hidden" name="HX" id="HX" value="<?php echo $XV; ?>" /><br>
<input type="hidden" name="HY" id="HY" value="<?php echo $YV; ?>" />
<input type="hidden" name="HV" value="700" />
</form>
</body>
<?php
odbc_close($conn_id);
$_SESSION["onload"]=0;
?>
</html>

This works. The problem is after i press the "Zoom" button, when i scroll out and/or move the pointer, the web layout sends us to unreasonable coordinates. What might be the reason? thanks for your help.