This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/themes/default/blocks/service/user_modify.tpl

236 lines
10 KiB
Smarty
Raw Normal View History

2009-08-03 04:10:16 +00:00
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
2009-08-03 04:10:16 +00:00
{if $SESS_LOGGED != 1}
{$block->display('account:user_login')}
{else}
2009-08-03 04:10:16 +00:00
{$method->exe($meth.0,$meth.1)}
{if ($method->result == false)}
{$block->display('core:method_error')}
{else}
<!-- Show the category drill-down -->
<form id="modify" method="post" action="" enctype="multipart/form-data">
{if $VAR.id == ''}
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="table_heading">{osb f=tt}</td>
</tr>
<tr>
<td class="row1">&nbsp;</td>
</tr>
<tr valign="top">
<td class="row1">
<select name="id">
{foreach from=$product_arr item=product}
<option value="{$product.id}">
{if $list->translate('product_translate','name,description_short,description_full','product_id',$product.id,'prod_translate')}
{$prod_translate.name}
{else}
{$product.sku}
{/if}
- {$list->format_currency_num($product.price_base,$smarty.const.SESS_CURRENCY)}
</option>
{/foreach}
</select>
<input type="submit" name="Submit" value="{t}Submit{/t}"/>
<input type="hidden" name="_page" value="{$VAR._page}"/>
<input type="hidden" name="service_id" value="{$VAR.service_id}"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
{else}
{if $product_show}
{$method->exe('product','details')}
2010-11-29 22:41:08 +00:00
{if ($method->result == false || !$record)}
2009-08-03 04:10:16 +00:00
{$block->display('core:method_error')}
{else}
2010-11-29 22:41:08 +00:00
{if $record}
2009-08-03 04:10:16 +00:00
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_heading_cart">
<tr valign="top">
<td>
2010-11-29 22:41:08 +00:00
{if $list->translate('product_translate','name,description_short,description_full','product_id',$record.id,'prod_translate')}
2009-08-03 04:10:16 +00:00
{$prod_translate.name}
{else}
2010-11-29 22:41:08 +00:00
{$record.sku}
2009-08-03 04:10:16 +00:00
{/if}
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="body">
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="body">
<tr valign="top" class="body">
<td>
2010-11-29 22:41:08 +00:00
{if $record.thumbnail != ''}
<img src="{$URL}{$smarty.const.URL_IMAGES}{$record.thumbnail}" alt="" style="border: 0px;"/>
2009-08-03 04:10:16 +00:00
{/if}
{$prod_translate.description_full}
</td>
</tr>
<tr valign="top">
<td align="left">
2010-11-29 22:41:08 +00:00
{if $record.price_type == '1'}
2009-08-03 04:10:16 +00:00
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="body">
<tr valign="top" class="body">
<td><b>{osb f=tf module=product field=price_recurr_type}</b></td>
</tr>
<tr valign="top" class="body">
<td>
<select name="recurr_schedule" >
{foreach from=$price item=price_recurr key=key}
2010-11-29 22:41:08 +00:00
<option value="{$key}" {if $record.price_recurr_default == $key} selected="selected"{/if}>
2009-08-03 04:10:16 +00:00
{$list->format_currency_num($price_recurr.base,$smarty.const.SESS_CURRENCY)}&nbsp;
{$list->menu_staticlist('recur_schedule','','',$key,'form_menu')}
{if $waive_setup != 1}
{if $price_recurr.setup > 0}
&nbsp; + &nbsp; {$list->format_currency_num($price_recurr.setup,$smarty.const.SESS_CURRENCY)} {t}Setup{/t}
{/if}
{/if}
</option>
{/foreach}
</select>
</td>
</tr>
</table>
{/if}
{if $attr}
<br/>
{foreach from=$attr item=attr_arr key=key}
{assign var=attr_id value=$attr_arr.id}
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="body">
<tr valign="middle" class="body">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="body">
<tr>
<td style="width: 70%;" valign="middle"><b>{$attr_arr.name}</b></td>
<td style="width: 30%;" valign="middle" align="right">
{if $attr_arr.type == '0' || $attr_arr.type == '1' || $attr_arr.type == '3'}
{if $attr_arr.price_base != 0}
{$list->format_currency_num($attr_arr.price_base, $smarty.const.SESS_CURRENCY)}
{/if}
{if $attr_arr.price_setup != 0}
{if $attr_arr.price_base != 0} + {/if}
{$list->format_currency_num($attr_arr.price_setup, $smarty.const.SESS_CURRENCY)} {t}Setup{/t}
{/if}
{elseif $attr_arr.type == '2'}
&nbsp;
{/if}
</td>
</tr>
</table>
</td>
</tr>
{if $attr_arr.description}
<tr valign="top">
<td>
{if $attr_arr.type == '0'}
<input type="checkbox" name="attr[{$attr_id}]" value="Yes" {if $VAR.attr[$attr_id] || $attr_arr.default}checked="checked"{/if}/>&nbsp;{$attr_arr.description}
{elseif $attr_arr.type == '1'}
<input type="text" id="attr_{$attr_id}" name="attr[{$attr_id}]" size="20"/>&nbsp;{$attr_arr.description}
{elseif $attr_arr.type == '2'}
<select id="attr_{$attr_id}" name="attr[{$attr_id}]" >
{foreach from=$attr_arr.default item=attr_menu key=attr_key}
<option value="{$attr_menu.name}">
{$attr_menu.name}
{if $attr_menu.base > 0}: {$list->format_currency_num($attr_menu.base, $smarty.const.SESS_CURRENCY)}{/if}
{if $attr_menu.base > 0 && $attr_menu.setup > 0} +
{elseif $attr_menu.base <= 0 && $attr_menu.setup > 0}:
{/if}
{if $attr_menu.setup > 0}
{$list->format_currency_num($attr_menu.setup, $smarty.const.SESS_CURRENCY)} {t}Setup{/t}
{/if}
</option>
{/foreach}
</select>
&nbsp;{$attr_arr.description}
{elseif $attr_arr.type == '3'}
<textarea id="attr_{$attr_id}" name="attr[{$attr_id}]2" cols="50" rows="3"></textarea> {$attr_arr.description}
{/if}
</td>
</tr>
{/if}
</table>
{/foreach}
{/if}
<script type="text/javascript">
<!--
{literal}
function addCart(addtype) {
2010-11-29 22:41:08 +00:00
var hosting = '{/literal}{$record.host}{literal}';
2009-08-03 04:10:16 +00:00
if (hosting == '1') {}
attrValidate(addtype);
}
function attrValidate(addtype) {
var val_arr = new Array(2);
var i=0;
{/literal} {foreach from=$attr item=attr_arr key=key} {assign var=attr_id value=$attr_arr.id}{if $attr_arr.required == "1"}
val_arr[i] = new Array ('attr_{$attr_id}','{$attr_arr.name}','{$attr_arr.type}');
i++;
{/if}{/foreach} {literal}
for(ii=0; ii < i; ii++) {
if(!document.getElementById(val_arr[ii][0]).value) {
document.getElementById(val_arr[ii][0]).focus();
if(val_arr[ii][2] == "1") {
alert("You must select an option for \""+val_arr[ii][1]+"\"");
} else {
alert("You must enter a value for the product option \""+val_arr[ii][1]+"\"")
}
return false;
}
}
doCart(addtype);
}
function doCart(addtype) {
if(addtype == 'checkout') {
document.getElementById('page').value = 'checkout:checkout';
document.getElementById('product_view').action = '{/literal}{$SSL_URL}{literal}';
}
document.product_view.submit();
}
{/literal}
//-->
</script>
{/if}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
2009-08-03 04:10:16 +00:00
<p style="text-align: center;">
<input type="submit" onclick="addCart('checkout')" name="modify" value="{t}Modify Service{/t}" class="form_button"/>
<input type="hidden" name="service_id" value="{$VAR.service_id}"/>
<input type="hidden" id="page" name="_page" value=""/>
<input type="hidden" name="do[]" value="cart:add"/>
2010-11-29 22:41:08 +00:00
<input type="hidden" name="product_id" value="{$record.id}"/>
2009-08-03 04:10:16 +00:00
<input type="hidden" name="s" value="{$SESS}"/>
</p>
{/if}
2009-08-03 04:10:16 +00:00
{/if}
{/if}
</form>
{/if}
{/if}