Jump to content

Support Departments Dropdown


Recommended Posts

I didn't like that extra step of selecting the department before you write up a ticket, so I just linked directly to: submitticket.php?step=2 from the homepage. I removed the hidden form input(deptid) and replaced where it showed the department with this:

<select name="deptid">
{foreach item=department from=$departments}
<option value ="{$department.id}">{$department.name}</option>
{/foreach}
</select>

 

Of course I had to pass it all to smarty first:

{php}

$i=0; 
$client_query = "SELECT * FROM tblticketdepartments WHERE hidden != 'on' ORDER BY id";
$result = mysql_query($client_query);
  while($row = mysql_fetch_array($result))
        {

        $tktdepart_array[$i]['id'] = $row['id'];
        $tktdepart_array[$i]['name'] = $row['name'];
        $i++;
        }

//Pass the values to smarty   
$this->assign('departments',$tktdepart_array); 


{/php} 

 

I just thought some here mite make some use of it.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 2 weeks later...
  • 2 weeks later...
  • 3 weeks later...

Have I got this right?

 

It doesnt seem to show the drop down for me..

 

{if $errormessage}


<font color=#cc0000>{$LANG.clientareaerrors}</font></p>
<ul>
{$errormessage}
[/list]
{/if}

<form method="post" action="{$SERVER.PHP_SELF}?step=3" enctype="multipart/form-data">


<table>
<tr><td width=120>{$LANG.supportticketsclientname}</td><td>{if $loggedin}{$clientname}{else}<input type="text" name="name" size=30 value="{$name}">{/if}</td></tr>
<tr><td>{$LANG.supportticketsclientemail}</td><td>{if $loggedin}{$email}{else}<input type="text" name="email" size=50 value="{$email}">{/if}</td></tr>
{php}

$i=0;
$client_query = "SELECT * FROM tblticketdepartments WHERE hidden != 'on' ORDER BY id";
$result = mysql_query($client_query);
  while($row = mysql_fetch_array($result))
        {

        $tktdepart_array[$i]['id'] = $row['id'];
        $tktdepart_array[$i]['name'] = $row['name'];
        $i++;
        }

//Pass the values to smarty   
$this->assign('departments',$tktdepart_array);


{/php} 
<tr><td>{$LANG.supportticketsticketsubject}</td><td><input type="text" name="subject" size=60 value="{$subject}"></td></tr>
<tr><td>{$LANG.supportticketsticketurgency}</td><td><select name="urgency"><option value="Low">{$LANG.supportticketsticketurgencylow}<option value="Medium" selected>{$LANG.supportticketsticketurgencymedium}<option value="High">{$LANG.supportticketsticketurgencyhigh}</select></td></tr>
</table>




<textarea name="message" rows=12 style="width:100%">{$message}</textarea>



{if $customfields}<table>{/if}
{foreach key=num item=customfield from=$customfields}
<tr><td width=120>{$customfield.name}</td><td>{$customfield.input} {$customfield.required}</td></tr>
{/foreach}
{if $customfields}</table>
{/if}

{$LANG.supportticketsticketattachment}: <input type="file" name="attachment" style="width:80%">
({$LANG.supportticketsallowedextensions}: {$allowedfiletypes})

<P ALIGN="center"><input type="submit" value="{$LANG.supportticketsticketsubmit}"></P>

</form>

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated