<?php
//      $zmaes='enti';
     $zmaes0=$zmaes.'0';
     $sql_data='select * from '.$zmaes0.' order by '.$zmaes.'_descri';
     $res_data=msql_query($sql_data,$link_data);
     $datalist=$screen1->appendChild($domd->createElement("datalist"));
          $datalist->setAttribute("id","dl_".$zmaes);
          $options=$datalist->appendChild($domd->createElement("options"));
          while($aso_data=msql_fetch_assoc($res_data))
          {
               $option=$options->appendChild($domd->createElement("option",htmlspecialchars($aso_data[$zmaes.'_descri'])));
                    $option->setAttribute("value",htmlspecialchars($aso_data[$zmaes.'_codigo']));
               
               $div=$screen1->appendChild($domd->createElement("div"));
                    $div->setAttribute("id",$zmaes.'_'.$aso_data[$zmaes.'_codigo']);
                    $div->setAttribute("descri",$aso_data[$zmaes.'_descri']);
                    $div->setAttribute("razsoc",$aso_data[$zmaes.'_razsoc']);
                    $div->setAttribute("nomcom",$aso_data[$zmaes.'_nomcom']);
                    $div->setAttribute("wsapp",$aso_data[$zmaes.'_wsapp']);
          }


?>