{if isset($RSThemes['pages'][$templatefile]) && file_exists($RSThemes['pages'][$templatefile]['fullPath'])}
    {include file=$RSThemes['pages'][$templatefile]['fullPath']}
{else}	
	{if $invalid}
		{include file="$template/includes/alert.tpl" type="error" msg=$LANG.clientareacancelinvalid textcenter=true}
		<p class="text-center">
			<a tabindex="0" href="clientarea.php?action=productdetails&amp;id={$id}" class="btn btn-primary">{$LANG.clientareabacklink}</a>
		</p>
	{elseif $requested}
		{include file="$template/includes/alert.tpl" type="success" msg=$LANG.clientareacancelconfirmation textcenter=true}
		<p class="text-center">
			<a tabindex="0" href="clientarea.php?action=productdetails&amp;id={$id}" class="btn btn-primary">{$LANG.clientareabacklink}</a>
		</p>
	{else}
		{if $error}
			{include file="$template/includes/alert.tpl" type="error" errorshtml="<li>{$LANG.clientareacancelreasonrequired}</li>"}
		{/if}

		<h4>{$rslang->trans('cancellation.details')}</h4>

		<form method="post" action="{$smarty.server.PHP_SELF}?action=cancel&amp;id={$id}" class="form-stacked">
			<input type="hidden" name="sub" value="submit" />
			<div class="panel panel-default panel-form panel-cancelrequest">
				<div class="panel-body">
					<label>{$rslang->trans('cancellation.chosen_product')}</label>
					<div class="well">
						<div class="d-flex gap-base align-items-center">
							{assign var=currentServiceId value=$smarty.get.id|default: $smarty.request.id}
							{if $currentServiceId && isset($productServicesID[$currentServiceId]) && isset($graphics['product'][$productServicesID[$currentServiceId]]) && $graphics['product'][$productServicesID[$currentServiceId]]->enabled}
								{assign var=productId value=$productServicesID[$currentServiceId]}
								{assign var=graphicData value=$graphics['product'][$productId]->getJson()->condensed}

								{if $graphicData->type}
									<div class="graphic-item graphic-item-sm">
										{assign var=graphic value=$graphicData->graphic}
										{assign var=graphicType value=$graphicData->type}

										{if $graphicType == "icon"}
											{include file="$template/assets/svg-icon/{$graphic}"}
										{elseif $graphicType == "font-icon"}
											<span class="graphic-item-bg">
                            					<i class="{$graphic}"></i>
                        					</span>
										{elseif $graphicType == "media"}
											<img src="{$WEB_ROOT}/templates/{$template}/assets/img/page-manager/{$graphic}" alt="{$productname}">
										{/if}
									</div>
								{/if}
							{/if}
							<div>
								<h4 class="h8 m-b-0">
									<b>{$groupname}</b> - {$productname}
								</h4>
								{if $domain}
									<a tabindex="0" href="https://{$domain}" class="text-small">{$domain}</a>
								{/if}
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="cancellationreason">{$rslang->trans('cancellation.reason')}</label>
						<textarea name="cancellationreason" id="cancellationreason" class="form-control" rows="6"></textarea>
					</div>
					<div class="form-group">
						<label class="control-label" for="type">{$LANG.clientareacancellationtype}</label>
						<select name="type" id="type" class="form-control">
                            {if $RSThemes['pages'][$templatefile]['config']['hideOptionImmediate'] != "1"}
                                <option value="Immediate">{$LANG.clientareacancellationimmediate}</option>
                            {/if}
							<option value="End of Billing Period">{$LANG.clientareacancellationendofbillingperiod}</option>
						</select>
					</div>
				</div>
				</div>

			{if $domainid}
				<h4>{$rslang->trans('cancellation.associated_domain')}</h4>

				<div class="panel panel-default panel-cancelrequest">
					<div class="panel-body">

						<div class="alert alert-lagom alert-danger">
							<div class="alert-icon">
								<i class="ls ls-exclamation-circle"></i>
							</div>
							<div class="alert-body">
								{$rslang->trans('cancellation.domain_desc')|sprintf:$domainnextduedate:$domainprice:$domainregperiod}
			</div>
						</div>
					<label class="checkbox">
							<input class="icheck-control" type="checkbox" name="canceldomain" id="canceldomain" />
							<b>{$rslang->trans('cancellation.domainconfirm_label')}</b>
					</label>
						<p class="text-lighter p-sm">{$rslang->trans('cancellation.domainconfirm_note')}</p>

				</div>
				</div>
			{/if}

			<div class="panel panel-default">
				<div class="panel-body">
					<button tabindex="0" type="submit" value="{$LANG.clientareacancelrequestbutton}" class="btn btn-danger"><i class="ls ls-denial"></i>{$LANG.clientareacancelrequestbutton}</button>
					<a role="button" tabindex="0" href="clientarea.php?action=productdetails&id={$id}" class="btn btn-default">{$LANG.cancel}</a>
				</div>
			</div>
		</form>
	{/if}
{/if}