~mratix/osticketplus/osticketplus

« back to all changes in this revision

Viewing changes to upload/include/client/open.inc.php

  • Committer: Alexandre Haguiar
  • Date: 2011-11-01 10:52:12 UTC
  • Revision ID: git-v1:c7c355511789a2a15e1233697010ce20dd69c362
first commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
if(!defined('OSTCLIENTINC')) die(_('Kwaheri rafiki!')); //Say bye to our friend..
 
3
 
 
4
$info=($_POST && $errors)?Format::input($_POST):array(); //on error...use the post data
 
5
?>
 
6
<div>
 
7
    <?if($errors['err']) {?>
 
8
        <p align="center" id="errormessage"><?=$errors['err']?></p>
 
9
    <?}elseif($msg) {?>
 
10
        <p align="center" id="infomessage"><?=$msg?></p>
 
11
    <?}elseif($warn) {?>
 
12
        <p id="warnmessage"><?=$warn?></p>
 
13
    <?}?>
 
14
</div>
 
15
<div><?= _('Please fill in the form below to open a new ticket.')?></div><br>
 
16
<form action="open.php" method="POST" enctype="multipart/form-data">
 
17
<table align="left" cellpadding=2 cellspacing=1 width="90%">
 
18
    <tr>
 
19
        <th width="20%"><?= _('Full Name:')?></th>
 
20
        <td>
 
21
            <?if ($thisclient && ($name=$thisclient->getName())) {
 
22
                ?>
 
23
                <input type="hidden" name="name" value="<?=$name?>"><?=$name?>
 
24
            <?}else {?>
 
25
                <input type="text" name="name" size="25" value="<?=$info['name']?>">
 
26
                <?}?>
 
27
            &nbsp;<font class="error">*&nbsp;<?=$errors['name']?></font>
 
28
        </td>
 
29
    </tr>
 
30
    <tr>
 
31
        <th nowrap ><?= _('Email Address:')?></th>
 
32
        <td>
 
33
            <?if ($thisclient && ($email=$thisclient->getEmail())) {
 
34
                ?>
 
35
                <input type="hidden" name="email" size="25" value="<?=$email?>"><?=$email?>
 
36
            <?}else {?>             
 
37
                <input type="text" name="email" size="25" value="<?=$info['email']?>">
 
38
            <?}?>
 
39
            &nbsp;<font class="error">*&nbsp;<?=$errors['email']?></font>
 
40
        </td>
 
41
    </tr>
 
42
    <tr>
 
43
        <td><?= _('Telephone:')?></td>
 
44
        <td><input type="text" name="phone" size="25" value="<?=$info['phone']?>">
 
45
             &nbsp;Ext&nbsp;<input type="text" name="phone_ext" size="6" value="<?=$info['phone_ext']?>">
 
46
            &nbsp;<font class="error">&nbsp;<?=$errors['phone']?></font></td>
 
47
    </tr>
 
48
    <tr height=2px><td align="left" colspan=2 >&nbsp;</td</tr>
 
49
    <tr>
 
50
        <th><?= _('Help Topic:')?></th>
 
51
        <td>
 
52
            <select name="topicId">
 
53
                <option value="" selected >Select One</option>
 
54
                <?
 
55
                 $services= db_query('SELECT topic_id,topic FROM '.TOPIC_TABLE.' WHERE isactive=1 ORDER BY topic');
 
56
                 if($services && db_num_rows($services)) {
 
57
                     while (list($topicId,$topic) = db_fetch_row($services)){
 
58
                        $selected = ($info['topicId']==$topicId)?'selected':''; ?>
 
59
                        <option value="<?=$topicId?>"<?=$selected?>><?=$topic?></option>
 
60
                        <?
 
61
                     }
 
62
                 }else{?>
 
63
                    <option value="0" ><?= _('General Inquiry')?></option>
 
64
                <?}?>
 
65
            </select>
 
66
            &nbsp;<font class="error">*&nbsp;<?=$errors['topicId']?></font>
 
67
        </td>
 
68
    </tr>
 
69
    <tr>
 
70
        <th><?= _('Subject:')?></th>
 
71
        <td>
 
72
            <input type="text" name="subject" size="35" value="<?=$info['subject']?>">
 
73
            &nbsp;<font class="error">*&nbsp;<?=$errors['subject']?></font>
 
74
        </td>
 
75
    </tr>
 
76
    <tr>
 
77
        <th valign="top"><?= _('Message:')?></th>
 
78
        <td>
 
79
            <? if($errors['message']) {?> <font class="error"><b>&nbsp;<?=$errors['message']?></b></font><br/><?}?>
 
80
            <textarea name="message" cols="35" rows="8" wrap="soft" style="width:85%"><?=$info['message']?></textarea></td>
 
81
    </tr>
 
82
    <?
 
83
    if($cfg->allowPriorityChange() ) {
 
84
      $sql='SELECT priority_id,priority_desc FROM '.TICKET_PRIORITY_TABLE.' WHERE ispublic=1 ORDER BY priority_urgency DESC';
 
85
      if(($priorities=db_query($sql)) && db_num_rows($priorities)){ ?>
 
86
      <tr>
 
87
        <td><?= _('Priority:')?></td>
 
88
        <td>
 
89
            <select name="pri">
 
90
              <?
 
91
                $info['pri']=$info['pri']?$info['pri']:$cfg->getDefaultPriorityId(); //use system's default priority.
 
92
                while($row=db_fetch_array($priorities)){ ?>
 
93
                    <option value="<?=$row['priority_id']?>" <?=$info['pri']==$row['priority_id']?'selected':''?> ><?=$row['priority_desc']?></option>
 
94
              <?}?>
 
95
            </select>
 
96
        </td>
 
97
       </tr>
 
98
    <? }
 
99
    }?>
 
100
 
 
101
    <?if(($cfg->allowOnlineAttachments() && !$cfg->allowAttachmentsOnlogin())  
 
102
                || ($cfg->allowAttachmentsOnlogin() && ($thisclient && $thisclient->isValid()))){
 
103
        
 
104
        ?>
 
105
    <tr>
 
106
        <td><?= _('Attachment:')?></td>
 
107
        <td>
 
108
            <input type="file" name="attachment"><font class="error">&nbsp;<?=$errors['attachment']?></font>
 
109
        </td>
 
110
    </tr>
 
111
    <?}?>
 
112
    <?if($cfg && $cfg->enableCaptcha() && (!$thisclient || !$thisclient->isValid())) {
 
113
        if($_POST && $errors && !$errors['captcha'])
 
114
            $errors['captcha']='Please re-enter the text again';
 
115
        ?>
 
116
    <tr>
 
117
        <th valign="top"><?= _('Captcha Text:')?></th>
 
118
        <td><img src="captcha.php" border="0" align="left">
 
119
        <span>&nbsp;&nbsp;<input type="text" name="captcha" size="7" value="">&nbsp;<i><?= _('Enter the text shown on the image.')?></i></span><br/>
 
120
                <font class="error">&nbsp;<?=$errors['captcha']?></font>
 
121
        </td>
 
122
    </tr>
 
123
    <?}?>
 
124
    <tr height=2px><td align="left" colspan=2 >&nbsp;</td</tr>
 
125
    <tr>
 
126
        <td></td>
 
127
        <td>
 
128
            <input class="button" type="submit" name="submit_x" value="<?= _('Submit Ticket')?>">
 
129
            <input class="button" type="reset" value="<?= _('Reset')?>">
 
130
            <input class="button" type="button" name="cancel" value="<?= _('Cancel')?>" onClick='window.location.href="index.php"'>
 
131
        </td>
 
132
    </tr>
 
133
</table>
 
134
</form>