forked from thirtybees/niara
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact-form.tpl
136 lines (132 loc) · 7.59 KB
/
contact-form.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{capture name=path}{l s='Contact'}{/capture}
<h1 class="page-heading">
{l s='Customer service'} - {if isset($customerThread) && $customerThread}{l s='Your reply'}{else}{l s='Contact us'}{/if}
</h1>
{if isset($confirmation)}
<div class="alert alert-success">{l s='Your message has been successfully sent to our team.'}</div>
<nav>
<ul class="pager">
<li class="previous">
<a href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}">
{if $isRtl}→{else}←{/if} {l s='Home'}
</a>
</li>
</ul>
</nav>
{elseif isset($alreadySent)}
<div class="alert alert-warning">{l s='Your message has already been sent.'}</div>
<nav>
<ul class="pager">
<li class="previous">
<a href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}">
{if $isRtl}→{else}←{/if} {l s='Home'}
</a>
</li>
</ul>
</nav>
{else}
{include file="$tpl_dir./errors.tpl"}
<form action="{$request_uri}" method="post" class="contact-form-box" enctype="multipart/form-data">
<fieldset>
<h3 class="page-subheading">{l s='send a message'}</h3>
<div class="row">
<div class="col-xs-12 col-md-3">
<div class="form-group selector1">
<label for="id_contact">{l s='Subject Heading'}</label>
{if isset($customerThread.id_contact) && $customerThread.id_contact && $contacts|count}
{assign var=flag value=true}
{foreach from=$contacts item=contact}
{if $contact.id_contact == $customerThread.id_contact}
<input type="text" class="form-control" id="contact_name" name="contact_name" value="{$contact.name|escape:'html':'UTF-8'}" readonly="readonly">
<input type="hidden" name="id_contact" value="{$contact.id_contact|intval}">
{$flag=false}
{/if}
{/foreach}
{if $flag && isset($contacts[0].id_contact)}
<input type="text" class="form-control" id="contact_name" name="contact_name" value="{$contacts[0].name|escape:'html':'UTF-8'}" readonly="readonly">
<input type="hidden" name="id_contact" value="{$contacts[0].id_contact|intval}">
{/if}
{else}
<select id="id_contact" class="form-control" name="id_contact">
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$contacts item=contact}
<option value="{$contact.id_contact|intval}"{if isset($smarty.request.id_contact) && $smarty.request.id_contact == $contact.id_contact} selected="selected"{/if}>{$contact.name|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
<p id="desc_contact0" class="desc_contact{if isset($smarty.request.id_contact)} unvisible{/if}"> </p>
{foreach from=$contacts item=contact}
<p id="desc_contact{$contact.id_contact|intval}" class="desc_contact contact-title{if !isset($smarty.request.id_contact) || $smarty.request.id_contact|intval != $contact.id_contact|intval} unvisible{/if}">
<i class="icon icon-comment-alt"></i> {$contact.description|escape:'html':'UTF-8'}
</p>
{/foreach}
{/if}
</div>
<div class="form-group">
<label for="email">{l s='Email address'}</label>
{if isset($customerThread.email)}
<input class="form-control" type="email" id="email" name="from" value="{$customerThread.email|escape:'html':'UTF-8'}" readonly="readonly">
{else}
<input class="form-control validate" type="email" id="email" name="from" data-validate="isEmail" value="{$email|escape:'html':'UTF-8'}" required>
{/if}
</div>
{if !$PS_CATALOG_MODE}
{if (!isset($customerThread.id_order) || $customerThread.id_order > 0)}
<div class="form-group selector1">
<label>{l s='Order reference'}</label>
{if !isset($customerThread.id_order) && isset($is_logged) && $is_logged}
<select name="id_order" class="form-control">
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$orderList item=order}
<option value="{$order.value|intval}"{if $order.selected|intval} selected="selected"{/if}>{$order.label|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
{elseif !isset($customerThread.id_order) && empty($is_logged)}
<input class="form-control" type="text" name="id_order" id="id_order" value="{if isset($customerThread.id_order) && $customerThread.id_order|intval > 0}{$customerThread.id_order|intval}{else}{if isset($smarty.post.id_order) && !empty($smarty.post.id_order)}{$smarty.post.id_order|escape:'html':'UTF-8'}{/if}{/if}">
{elseif $customerThread.id_order|intval > 0}
<input class="form-control" type="text" name="id_order" id="id_order" value="{if isset($customerThread.reference) && $customerThread.reference}{$customerThread.reference|escape:'html':'UTF-8'}{else}{$customerThread.id_order|intval}{/if}" readonly="readonly">
{/if}
</div>
{/if}
{if isset($is_logged) && $is_logged}
<div class="form-group selector1">
<label class="unvisible">{l s='Product'}</label>
{if !isset($customerThread.id_product)}
{foreach from=$orderedProductList key=id_order item=products name=products}
<select name="id_product" id="{$id_order}_order_products" class="unvisible product_select form-control"{if !$smarty.foreach.products.first} style="display:none;"{/if}{if !$smarty.foreach.products.first} disabled="disabled"{/if}>
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$products item=product}
<option value="{$product.value|intval}">{$product.label|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
{/foreach}
{elseif $customerThread.id_product > 0}
<input type="hidden" name="id_product" id="id_product" value="{$customerThread.id_product|intval}" readonly="readonly">
{/if}
</div>
{/if}
{/if}
{if $fileupload == 1}
<div class="form-group">
<label for="fileUpload">{l s='Attach File'}</label>
<input type="hidden" name="MAX_FILE_SIZE" value="{if isset($max_upload_size) && $max_upload_size}{$max_upload_size|intval}{else}2000000{/if}">
<input type="file" name="fileUpload" id="fileUpload" class="form-control">
</div>
{/if}
</div>
<div class="col-xs-12 col-md-9">
<div class="form-group">
<label for="message">{l s='Message'}</label>
<textarea class="form-control" id="message" name="message" required>{if isset($message)}{$message|escape:'html':'UTF-8'|stripslashes}{/if}</textarea>
</div>
</div>
</div>
<div class="submit">
<button type="submit" name="submitMessage" id="submitMessage" class="btn btn-lg btn-success">
<span>{l s='Send'} <i class="icon icon-chevron-right"></i></span>
</button>
</div>
</fieldset>
</form>
{/if}
{addJsDefL name='contact_fileDefaultHtml'}{l s='No file selected' js=1}{/addJsDefL}
{addJsDefL name='contact_fileButtonHtml'}{l s='Choose File' js=1}{/addJsDefL}