You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
1.5 KiB

<?php
$id1 = $_GET["id1"];
$id2 = $_GET["id2"];
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(selObj){ //v3.0
window.parent.document.form1.departamento.value = selObj.options[selObj.selectedIndex].value;
}
//-->
</script>
<link href="admin/css/forms.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body bgcolor="#EAEAEA" onLoad="MM_jumpMenu(departamento.options[departamento.selectedIndex].value)">
<input type="hidden" name="valDepto" value="alert">
<?php if ($id1 != "") { ?>
<select name="departamento" class="caixas" id="departamento" onChange="MM_jumpMenu(this);" onFocus="MM_jumpMenu(this)" onBlur="MM_jumpMenu(this)">
<?php
$query2 = "SELECT * FROM pbx_departamentos where empresa=$id1 order by id asc";
$result2 = pg_query($dbcon, $query2);
while ($dados2 = pg_fetch_array($result2)) {
?>
<option value="<?php echo $dados2['id']; ?>" <?php
if ($id2 == $dados2['id']) {
echo "selected";
}
?>><?php echo $dados2['nome_depto']; ?></option>
<?php } ?>
</select>
<?php } else { ?>
<span class="labels">SELECIONE UMA EMPRESA!</span>
<?php } ?>