<?php
#=


include("../include/vars_adm.php");
include("../include/util.inc.php");
include("../include/get.inc.php");
include("../include/utiljs.php");
include("../include/sadmin.inc.php");
include ("../sadmin/table_verifs.inc.php");

connecte($host,$user,$mdp,$db);
recuprequest();

$tetabs=getetabs();
?>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<script>
    function revenir(vetab) {
        var f0=window.opener.document.form0;
        f0.action='details.php?etab='+vetab+'&op=retourpop'; //renvoi de etab à l'appelant
        f0.submit();
        window.close();
        }
</script>
</head>
<body>
<form method="post" name="form1">
<select name="etab_sel" style="font-size:7pt;" size="12" ondblclick="revenir(this.value);" >
    <?php
    foreach($tetabs as $id => $coordetab) {
        if ($id==$etab) $selected='selected="selected"'; else $selected='';
        print "<option value=$id $selected>".$coordetab['rne'].' - '.substr($coordetab['nom'],0,30). //' - '.$coordetab['adresse'].
                ' - '.$coordetab['codepostal'].' - '.$coordetab['ville']."</option>\n";
        }
    ?>
</select>
<p>
<input type="submit" name="ok" value="Choisir" onclick="revenir(document.form1.etab_sel.value);" >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="annuler" value="Annuler" onclick="revenir(<?php print $etab; ?>);" >
</p>
</form>
</body>
</html>
