      <?
      echo "<option value='' selected>--Select Trade--</option>";
      //$mytradequery="Select * from settings_trades where tradelevel=3 order by tradecode, tradedescription"; 
      $mytradequery="select ST.* from settings_trades ST where ST.tradelevel=3 and ST.tradeparentpkey in (select ST2.tradepkey from settings_trades ST2 where ST2.tradelevel=2 and ST2.tradeparentpkey in (select ST3.tradepkey from settings_trades ST3 where ST3.tradelevel=1 and ST3.tradepkey='456b685e3475eb3c9cb1948e3d430318')) and ST.tradestatus=1 order by ST.tradecode, tradedescription";
      $mytraderesult =& $db_pms->query($mytradequery);
      $mytradecount=$mytraderesult->numRows();
      if ($mytradecount!=0) {
        while($mytraderow=$mytraderesult->fetchRow()) {
          echo "<option value='".$mytraderow['tradepkey']."' ";
          if ($mytraderow['tradepkey']==$objtradepkey3) { echo "selected"; }
          echo ">";
          echo $mytraderow['tradecode']." - ".$mytraderow['tradedescription'];
          echo "</option>";
        }
      }
      ?>
