<%temp_customer_manage_account_exchangetocount_edit_handle=site.object_p%>
<!-- object[<%=site.object_p%>]::temp_customer_manage_account_exchangetocount_edit_handle -->
<%
dim account
dim count_t
dim change_t
dim sql_content

account=request.form("account")
if account="" then
site.Error.info="请填入您想兑换的帐户金额！"
site.Error.location="back"
site.Error.err()
end if

if account-site.temp.customer.info.account_rest>0 then
site.Error.info="您要兑换的帐户金额超出了您的帐户余额！"
site.Error.location="back"
site.Error.err()
end if

change_t=conn.execute("select sort_exchangetocount from jins_customer_sort where sort_id="&site.temp.customer.info.sort_id&" ")("sort_exchangetocount")
count_t=account*change_t

sql_content="insert into jins_customer_count_list (customer_count_sum,customer_count_addtime,customer_name,sort_id,customer_count_out,customer_count_kind) "
sql_content=sql_content+"values ("&count_t&",'"&now()&"','"&site.temp.customer.info.reg_name&"',1,'增加','帐户存款兑换') "
conn.execute(sql_content)

sql_content=""

sql_content="insert into jins_customer_consume_list (customer_consume_temp,customer_consume_sum,customer_consume_addtime,customer_name,sort_id,customer_consume_out,customer_consume_kind) "
sql_content=sql_content+"values (1,"&account&",'"&now()&"','"&site.temp.customer.info.reg_name&"',20,'出帐','兑换为积分') "
conn.execute(sql_content)

site.Error.info="您成功的将帐户存款"&site.info.unit_money(1)&" "&account&"兑换为"&count_t&"个积分!"
site.Error.location="back"
site.Error.suc()
%>