Viewing file: tres.php (6.6 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
$ses = isset($usuario);
if ($ses == false) {
$usuario = "EMAIL";
}
$de = isset($loc);
if ($de == false) {
$loc = 0;
}
$db = "sia";
$c1 = OciLogon("EMAIL","EMAIL2003",$db);
?>
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<script language="JavaScript">
<!--
//Double Combo Box with Description Code- by Randall Wald (http://www.rwald.com)
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use
var num_of_cats = 4; // This is the number of categories, including the first, blank, category.
var open_in_newwindow=1; //Set 1 to open links in new window, 0 for no.
var option_array = new Array(num_of_cats);
option_array[0] = new Array("You need to select a category"); // This is the first (blank) category. Don't mess with it.
option_array[1] = new Array("-- Select One --",
"JavaScript Kit",
"News.com",
"Wired");
option_array[2] = new Array("-- Select One --",
"CNN",
"ABC News");
option_array[3] = new Array("-- Select One --",
"Google",
"Ask Jeeves");
var text_array = new Array(num_of_cats);
text_array[0] = new Array("Here's how you use this box: First, you select a category in the Category drop-down. Then, select a link from the Link drop-down. Then, read the description in this box, or click Go to go to the page. If you ever need to see this help again, just go back to the top option in the Category box."); // These are general instructions. Change them if you want, or keep them if you don't.
text_array[1] = new Array("These are some of my favorite technology sites. You should visit them.", // Note that the first entry here is a general description of this category. After than, they're descriptions of each link. Make sure that you don't put the first link first; the general description must be first.
"This is a page with a bunch of nice JavaScripts that you can use. They also have tutorials in all sorts of subjects.",
"CNet news. If it's in technology, it's in here.",
"Wired magazine is the type of magazine which needs no introduction.");
text_array[2] = new Array("These days, it's important to keep up on the news. These sites will help you do that.",
"CNN. What list of news sites would be complete without it?",
"Here, you can get links to World News Tonight, or see video clips.");
text_array[3] = new Array("If you can't find it via other means, you'll need to find it with a search engine. These are some of the best.",
"Undoubtedly, the best search engine out there.",
"Their natural-language search sometimes comes up with results you won't get with other engines.");
var url_array = new Array(num_of_cats);
url_array[0] = new Array("#"); // The first category. This should have no items other than "#".
url_array[1] = new Array("#", // The second category; the first "real" category. Note the initial #. That is the category which says "Please select a link." It doesn't need a URL. Start putting the other URL's in after that first line.
"http://javascriptkit.com/",
"http://www.news.com/",
"http://www.wired.com/");
url_array[2] = new Array("#",
"http://www.cnn.com/",
"http://abcnews.go.com/");
url_array[3] = new Array("#",
"http://www.google.com/",
"http://www.aj.com/");
function switch_select()
{
for (loop = window.document.form_1.select_2.options.length-1; loop > 0; loop--)
{
window.document.form_1.select_2.options[loop] = null;
}
for (loop = 0; loop < option_array[window.document.form_1.select_1.selectedIndex].length; loop++)
{
window.document.form_1.select_2.options[loop] = new Option(option_array[window.document.form_1.select_1.selectedIndex][loop]);
}
window.document.form_1.select_2.selectedIndex = 0;
}
function switch_text()
{
window.document.form_1.textarea_1.value = text_array[window.document.form_1.select_1.selectedIndex][window.document.form_1.select_2.selectedIndex];
}
function box()
{
if (window.document.form_1.select_2.selectedIndex == 0)
{
alert("Where do you think you're going?");
} else {
if (open_in_newwindow==1)
window.open(url_array[window.document.form_1.select_1.selectedIndex][window.document.form_1.select_2.selectedIndex],"_blank");
else
window.location=url_array[window.document.form_1.select_1.selectedIndex][window.document.form_1.select_2.selectedIndex]
}
}
function set_orig()
{
window.document.form_1.select_1.selectedIndex = 0;
window.document.form_1.select_2.selectedIndex = 0;
}
window.onload=set_orig
// -->
</script>
<form name="form_1" onSubmit="return false;">
<textarea WRAP="virtual" name="textarea_1" rows=6 cols=60>Here's how you use this box: First, you select a category in the Category drop-down. Then, select a link from the Link drop-down. Then, read the description in this box, or click Go to go to the page. If you ever need to see this help again, just go back to the top option in the Category box.</textarea><br> <!-- This should be the same as the general instructions in the above code. -->
<select name="loc" onChange="MM_jumpMenu('parent',this,0)">
<option value="0">SELECCIONE LA LOCALIDAD</option>
<?php
$stmt = ociparse($c1,"SELECT LOCALIDAD_ID, NOMBRE FROM envista.LOCALIDAD WHERE LOCALIDAD_ID < 20 ORDER BY LOCALIDAD_ID");
$result = OCIExecute($stmt);
while (OCIFetchInto($stmt, $cur)) {
$il = $cur[0];
$nl = $cur[1];
if ($loc == 0) {
echo "<option value=\"tres.php?loc=$il\">$nl</option>";
}else{
if ($il == $loc) {
echo "<option value=\"tres.php?loc=$il\">$nl</option>";
}
}
}
?>
</select>
<select name="barrio" id="barrio">
<?php
if ($loc == 0) {
?>
<option value="0">Ninguno</option>
<?php
}else{
$stmt = ociparse($c1,"SELECT BARRIO_ID, DESCRIPCION FROM SIA_BARRIO WHERE COD_LOC = $loc ORDER BY DESCRIPCION");
$result = OCIExecute($stmt);
while (OCIFetchInto($stmt, $cur)) {
$ib = $cur[0];
$nb = $cur[1];
echo "<option value=\"$ib\">$nb</option>";
}
}
?>
</select>
<input type="submit" onClick="box();" value="Go!">
</form>
<p align="center"><font face="arial" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
Kit</a></font></p>
</body>
</html>
|