      <?
      echo "<option value='' selected>--Select Main Category--</option>";
      $mytradequery="Select * from settings_trades where tradelevel=1 order by 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']==$objtradepkey1) { echo "selected"; }
          echo ">";
          echo $mytraderow['tradecode']." - ".$mytraderow['tradedescription'];
          echo "</option>";
        }
      }
      ?>
