<p class="pagedesc">
<?php if (!$this->hasPermission) {
        echo $this->lang("Guest ticket access is disabled, please login.");
        return;
    } else
        echo $this->lang("If you can't find a solution to your problems in our <a href=\"index.php?fuse=knowledgebase&amp;view=KB_MainView\">knowledgebase</a>, you can submit a ticket by selecting the appropriate department below.");
?>
</p>

 <script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'clean'
 };
 </script>

<form id="supportform" name="SupportForm" action="<?php echo $this->formAction; ?>" method="post" enctype="multipart/form-data">
    <input type="hidden" name="userid" value="<?php echo $this->userid; ?>" />
    <?php if ( isset($this->clientid)) { ?>
    <input type="hidden" name="clientid" value="<?php echo $this->clientid; ?>" />
    <?php } ?>
    <input type="hidden" name = "ticketfilter" value = "All" />

<table class="ts2" cellspacing="0">
    <?php if($this->userid==0) { ?>
    <tr>
    	<td class="label"><?php echo $this->lang("First Name");?>:</td>
        <td><input type="text" id="guestFirstName" name="guestFirstName" value="<?php echo @htmlentities($_GET['guestFirstName']); ?>" /></td>
    </tr>
    <tr>
    	<td class="label"><?php echo $this->lang("Last Name");?>:</td>
    	<td><input type="text" id="guestLastName" name="guestLastName" value="<?php echo @htmlentities($_GET['guestLastName']); ?>" /></td>
    </tr>
    <tr>
    	<td class="label"><?php echo $this->lang("Email");?>:</td>
        <td><input type="text" id="guestEmail" name="guestEmail" value="<?php echo @htmlentities($_GET['guestEmail']); ?>" /> </td>
    </tr>
    <?php } //end guest info ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Ticket Type");?>:</td>
        <td><select id="messagetype" name="messagetype">
        <option value='0' selected="selected"><?php echo $this->lang("Select a Type ...");?></option>
        <?php foreach ($this->tickettypes as $ticketType) { ?>
        <option value='<?php echo $ticketType['value']; ?>' <?php echo $ticketType['selected']; ?>><?php echo $ticketType['name'];?></option>
        <?php }//end foreach ?>
    	</select></td>
    </tr>
    <tr>
    	<td class="label"><?php echo $this->lang("Priority");?>:</td>
        <td>
            <select id="priority" name="priority" onchange="highPriorityWarning(document.forms['SupportForm'].priority)">
                <?php foreach ( $this->priorities as $priority ) { ?>
                <option<?php echo $priority['selected']; ?> value="<?php echo $priority['value']; ?>"><?php echo $priority['name']; ?></option>
                <?php } ?>
            </select>
        </td>
    </tr>
    <?php if (isset($this->domainDropDown)) { ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Select Package"); ?>:</td>
        <td><?php echo $this->domainDropDown; ?></td>
    </tr>
    <?php } //end select package ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Message Subject");?>:</td>
        <td><input class="st_subject" onkeyup="<?php echo $this->subjectOnkeyup; ?>" type="text" id="supportTicketSubject" name="subject" maxlength="200" value="<?php echo @htmlentities($_GET['subject']); ?>" /></td>
    </tr>
    <tr>
    	<td class="label"><?php echo $this->lang("Message");?>:</td>
        <td><textarea name="message" rows="10"><?php echo @htmlentities($_GET['message']); ?></textarea></td>
    </tr>

    <?php if ($this->maxfilesize > 0) { ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Upload File(s)");?>:</td>
        <td><div id="fileFieldsContainer">
                <div id="fileFields_0">
                    <input type="file" value="" name="file_0" id="file_0" /><a style="visibility:hidden; margin-left:10px;position: relative;top:-10px;" ><?php echo $this->lang("Delete");?></a><br />
                </div>
            </div><br />(<?php echo $this->lang("Max file size");?>: <?php echo $this->maxfilesize; ?><?php echo $this->extnsmessage; ?>)<br />
                <a class='liveupdate' href="javascript:Clon('fileFields_0');"><?php echo $this->lang("Add a New File");?></a>
            <input type="hidden" name="validExtns" value="<?php echo $this->extns; ?>" />
        </td>
    </tr>
    <?php } //attach file ?>

<?php if ($this->showCaptcha) { ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Enter the code");?>:</td>
        <td><?php echo recaptcha_get_html($this->publickey); ?></td>
    </tr>
<?php }//end if show captcha  ?>

</table>

<div id="kb_wrap" style="margin:20px 0;"></div>


<input type="submit" class="submit" name="button" onclick="return validateSupportForm(form);" value='<?php echo $this->lang("Submit");?>' />

</form>