<?php
session_start();
$q=$_GET["q"];
include "../include/mysql.php";
include "../include/global.php";
?>

        <?PHP

        $SQL_disp = "SELECT * from CATEGORIES WHERE ID = '$q'";
        $result_disp = @mysql_query( $SQL_disp );
        $row_disp = @mysql_fetch_array( $result_disp );
        
        ?>
<div id="txtHint"> 
<select name="JUMPBOX" size="8" onchange="showCategory(this.value)">
<option selected value = "<?php echo $row_disp[ID]; ?>"> 
<?php echo $row_disp[TITLE]; ?>
</option>
<option value="">< - - - - - - - - - - - - - - - - - - -</option>
<?PHP
        $sql="SELECT * FROM CATEGORIES WHERE CATEGORY = '$q' ORDER BY TITLE ASC";
        $result = mysql_query($sql);
        while($row = mysql_fetch_array($result))
        {
        ?>
<?PHP
        $sql_peer = "SELECT count(*) FROM CATEGORIES WHERE CATEGORY = '$row[ID]'";
        $res_peer = mysql_query($sql_peer);
        $row_peer = mysql_fetch_row($res_peer);
        
        ?>
<option <?php if (!empty($row_peer[0])) { ?>style="font-weight: bold"<?PHP } ?> value="<?php echo $row[ID]; ?>"> 
<?php echo $row[TITLE]; ?>
</option>
<?PHP } ?>
</select>
<?PHP if (empty($rowxxx[CATLIMIT])) $rowxxx[CATLIMIT] = 3; ?>
<br>
<input type="button" value="Add Category" onMouseDown="ChangeFieldName('-<?PHP echo $q; ?>-|<?php echo $row_disp[TITLE]; ?>')" onClick="showCategory('')">
</div>

