Jump to content

Help with some Code inside OS Ticket


sundog1

Recommended Posts

Hi Guys,

 

I've come hear hoping someone will able to help me with a issue i'm having with PHP and MySQL.

 

Basically, I've modified an installation of OS Ticket with help from the guys on the OS Ticket Forums (which are great by the way). The modification adds a Drop-down menu to the 'New Ticket' screen.

 

The Drop-down menu is being populated by a Field called 'Catagory' within a MySQL table called 'Catagory' (I know, not the best thing to do, naming the table and field the same but i'm just testing at the moment :))

 

I've managed to hack some script out of another modification so the drop-down menu works and the value selected is the written to another table which saves it as a 'Ticket'.

 

Now the thing is, this coding is hacked and slashed to get it to work and to be honest I'm not really too sure on aspects of the code and how its doing what it's doing.

 

I would love to know if there is a much simplier code to use to do the same thing?

 

The code i'm using currently is below.

</td>
	     <th width="20%">Company:</th>
        	<td width="20%">
        	 <select name="CompanyName"> 
        <option value="" selected>Select Company</option> 
        <?  
            $query ='SELECT * '. 
                'FROM category '.                  
                'ORDER BY category ASC'; 
            $services=db_query($query); 
            while (list($projectId,$projectName) = db_fetch_row($services)) { 
            $selected = ($info['project_id']==$projectId)?'selected':'';?> 
                <option value="<?=$projectName?>"<?=$selected?>><?=$projectName?> 
            </option>         
        <? 
            } 
        ?>

 

Many thanks for any adivce you guys out there can give me.

 

Kind regards

Mark.

Link to comment
https://forums.phpfreaks.com/topic/251859-help-with-some-code-inside-os-ticket/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.