spacecp_credit_base.htm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <!--{template common/header}-->
  2. <!--{subtemplate home/spacecp_header}-->
  3. <!--{hook/spacecp_credit_top}-->
  4. <!--{subtemplate home/spacecp_credit_header}-->
  5. <!--{if in_array($_GET['op'], array('base', 'buy', 'transfer', 'exchange'))}-->
  6. <ul class="creditl mtm bbda cl">
  7. <!--{eval $creditid=0;}-->
  8. <!--{if $_GET['op'] == 'base' && $_G['setting']['creditstrans']}-->
  9. <!--{eval $creditid=$_G['setting']['creditstrans'];}-->
  10. <!--{if $_G['setting']['extcredits'][$creditid]}-->
  11. <!--{eval $credit=$_G['setting']['extcredits'][$creditid]; }-->
  12. <li class="xi1 cl"><em><!--{if $credit[img]}--> {$credit[img]}<!--{/if}--> {$credit[title]}: </em><!--{echo getuserprofile('extcredits'.$creditid);}--> {$credit[unit]} &nbsp; <!--{if ($_G['setting']['ec_ratio'] && ($_G['setting']['ec_tenpay_opentrans_chnid'] || $_G['setting'][ec_tenpay_bargainor] || $_G['setting']['ec_account'])) || $_G['setting']['card']['open']}--><a href="home.php?mod=spacecp&ac=credit&op=buy" class="xi2">{lang card_use}&raquo;</a><!--{/if}--></li>
  13. <!--{/if}-->
  14. <!--{/if}-->
  15. <!--{loop $_G['setting']['extcredits'] $id $credit}-->
  16. <!--{if $id!=$creditid}-->
  17. <li><em><!--{if $credit[img]}--> {$credit[img]}<!--{/if}--> {$credit[title]}: </em><!--{echo getuserprofile('extcredits'.$id);}--> {$credit[unit]}</li>
  18. <!--{/if}-->
  19. <!--{/loop}-->
  20. <!--{if $_GET['op'] == 'base'}-->
  21. <li class="cl"><em>{lang credits}: </em>$_G['member']['credits'] <span class="xg1">( $creditsformulaexp )</span></li>
  22. <!--{/if}-->
  23. <!--{hook/spacecp_credit_extra}-->
  24. </ul>
  25. <!--{/if}-->
  26. <!--{if $_GET['op'] == 'base'}-->
  27. <table summary="{lang memcp_credits_log_transaction}" cellspacing="0" cellpadding="0" class="dt mtm">
  28. <caption>
  29. <h2 class="mbm xs2">
  30. <a href="home.php?mod=spacecp&ac=credit&op=log" class="xi2 xs1 xw0 y">{lang viewmore}&raquo;</a>{lang memcp_credits_log}
  31. </h2>
  32. </caption>
  33. <tr>
  34. <th width="80">{lang operation}</th>
  35. <th width="80">{lang logs_credit}</th>
  36. <th>{lang detail}</th>
  37. <th width="100">{lang changedateline}</th>
  38. </tr>
  39. <!--{if $loglist}-->
  40. <!--{loop $loglist $value}-->
  41. <!--{eval $value = makecreditlog($value, $otherinfo);}-->
  42. <tr>
  43. <td><!--{if $value['operation']}--><a href="home.php?mod=spacecp&ac=credit&op=log&optype=$value['operation']">$value['optype']</a><!--{else}-->$value['title']<!--{/if}--></td>
  44. <td>$value['credit']</td>
  45. <td><!--{if $value['operation']}-->$value['opinfo']<!--{else}-->$value['text']<!--{/if}--></td>
  46. <td>$value['dateline']</td>
  47. </tr>
  48. <!--{/loop}-->
  49. <!--{else}-->
  50. <tr><td colspan="4"><p class="emp">{lang memcp_credits_log_none}</p></td></tr>
  51. <!--{/if}-->
  52. </table>
  53. <!--{elseif $_GET['op'] == 'buy'}-->
  54. <!--{if ($_G[setting][ec_ratio] && ($_G[setting][ec_account] || $_G[setting][ec_tenpay_opentrans_chnid] || $_G[setting][ec_tenpay_bargainor])) || $_G[setting][card][open]}-->
  55. <form id="addfundsform" name="addfundsform" method="post" autocomplete="off" action="home.php?mod=spacecp&ac=credit&op=buy" onsubmit="ajaxpost(this.id, 'return_addfundsform');">
  56. <input type="hidden" name="formhash" value="{FORMHASH}" />
  57. <input type="hidden" name="addfundssubmit" value="true" />
  58. <input type="hidden" name="handlekey" value="buycredit" />
  59. <table cellspacing="0" cellpadding="0" class="tfm mtn">
  60. <tr>
  61. <th>{lang mode_of_payment}</th>
  62. <td colspan="2">
  63. <!--{if $_G[setting][ec_ratio] && ($_G[setting][ec_tenpay_bargainor] || $_G[setting][ec_tenpay_opentrans_chnid])}-->
  64. <div class="mbm pbn bbda cl">
  65. <div id="div#tenpayBankList"></div><span id="#bank_type_value"></span>
  66. <link rel="stylesheet" type="text/css" href="http://union.tenpay.com/bankList/css_col3.css" />
  67. <script type="text/javascript">
  68. $('div#tenpayBankList').html = function(){$('div#tenpayBankList').innerHTML = htmlString.replace(/<span.+?\/span>/g, ''); };
  69. $("#bank_type_value").val = function(){{if $_G[setting][card][open]}$('cardbox').style.display='none';if($('card_box_sec')){$('card_box_sec').style.display='none';}$('paybox').style.display='';{/if}};
  70. appendscript('http://union.tenpay.com/bankList/bank.js', '');
  71. </script>
  72. </div>
  73. <!--{/if}-->
  74. <div class="long-logo mbw">
  75. <ul>
  76. <!--{if $_G[setting][ec_ratio] && $_G[setting][ec_account]}-->
  77. <li class="z">
  78. <input name="bank_type" type="radio" value="alipay" class="vm" id="apitype_alipay" $ecchecked onclick="checkValue(this)" /><label class="vm" style="margin-right:18px;width:135px;height:32px;background:#FFF url({STATICURL}image/common/alipay_logo.gif) no-repeat;border:1px solid #DDD;display:inline-block;" onclick="{if $_G[setting][card][open]}$('cardbox').style.display='none';if($('card_box_sec')){$('card_box_sec').style.display='none';}$('paybox').style.display='';{/if}" for="apitype_alipay"></label>
  79. </li>
  80. <!--{/if}-->
  81. <!--{if $_G[setting][card][open]}-->
  82. <li>
  83. <input name="bank_type" type="radio" value="card" id="apitype_card" class="vm" $ecchecked onclick="activatecardbox();" /><label class="vm" style="padding-left:10px;width:125px;height:32px;line-height:32px;background:#FFF;border:1px solid #DDD;display:inline-block;" onclick="activatecardbox();"><span class="xs2">{lang card_credit}</span></label>
  84. </li>
  85. <!--{/if}-->
  86. </ul>
  87. </div>
  88. </td>
  89. </tr>
  90. <tr id="paybox" style="{if ($_G[setting][ec_tenpay_bargainor] || $_G[setting][ec_tenpay_opentrans_chnid] || $_G[setting][ec_account]) && empty($ecchecked) }display:;{else}display:none;{/if}">
  91. <th>{lang memcp_credits_addfunds}</th>
  92. <td class="pns">
  93. <input type="text" size="5" class="px" style="width: auto;" id="addfundamount" name="addfundamount" value="0" onkeyup="addcalcredit()" />
  94. &nbsp;{$_G[setting][extcredits][$_G[setting][creditstrans]][title]}&nbsp;
  95. {lang credits_need}&nbsp;{lang memcp_credits_addfunds_caculate_radio}
  96. </td>
  97. <td width="300" class="d">
  98. {lang memcp_credits_addfunds_rules_ratio} = <strong>$_G[setting][ec_ratio]</strong> {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]}
  99. <!--{if $_G[setting][ec_mincredits]}--><br />{lang memcp_credits_addfunds_rules_min} <strong>$_G[setting][ec_mincredits]</strong> {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]}<!--{/if}-->
  100. <!--{if $_G[setting][ec_maxcredits]}--><br />{lang memcp_credits_addfunds_rules_max} <strong>$_G[setting][ec_maxcredits]</strong> {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]}<!--{/if}-->
  101. <!--{if $_G[setting][ec_maxcreditspermonth]}--><br />{lang memcp_credits_addfunds_rules_month} <strong>$_G[setting][ec_maxcreditspermonth]</strong> {$_G[setting][extcredits][$_G[setting][creditstrans]][unit]}{$_G[setting][extcredits][$_G[setting][creditstrans]][title]}<!--{/if}-->
  102. </td>
  103. </tr>
  104. <!--{if $_G[setting][card][open]}-->
  105. <tr id="cardbox" style="{if $_G[setting][card][open] && $ecchecked}display:;{else}display:none;{/if}">
  106. <th>{lang card}</th>
  107. <td colspan="2">
  108. <input type="text" class="px" id="cardid" name="cardid" />
  109. </td>
  110. </tr>
  111. <!--{if $seccodecheck}-->
  112. </table>
  113. <!--{block sectpl}--><table id="card_box_sec" style="{if $_G[setting][card][open] && $ecchecked}display:;{else}display:none;{/if}" cellspacing="0" cellpadding="0" class="tfm mtn"><tr><th><sec></th><td colspan="2"><span id="sec<hash>" onclick="showMenu({'ctrlid':this.id,'win':'{$_GET[handlekey]}'})"><sec></span><div id="sec<hash>_menu" class="p_pop p_opt" style="display:none"><sec></div></td></tr></table><!--{/block}-->
  114. <!--{subtemplate common/seccheck}-->
  115. <table cellspacing="0" cellpadding="0" class="tfm mtn">
  116. <!--{/if}-->
  117. <!--{/if}-->
  118. <tr>
  119. <th>&nbsp;</th>
  120. <td colspan="2">
  121. <button type="submit" name="addfundssubmit_btn" class="pn" id="addfundssubmit_btn" value="true"><em>{lang memcp_credits_addfunds}</em></button>
  122. </td>
  123. </tr>
  124. </table>
  125. </form>
  126. <span style="display: none" id="return_addfundsform"></span>
  127. <script type="text/javascript">
  128. function addcalcredit() {
  129. var addfundamount = $('addfundamount').value.replace(/^0/, '');
  130. var addfundamount = parseInt(addfundamount);
  131. $('desamount').innerHTML = !isNaN(addfundamount) ? Math.ceil(((addfundamount / $_G[setting][ec_ratio]) * 100)) / 100 : 0;
  132. }
  133. <!--{if $_G[setting][card][open]}-->
  134. function activatecardbox() {
  135. $('apitype_card').checked=true;
  136. $('cardbox').style.display='';
  137. if($('card_box_sec')){
  138. $('card_box_sec').style.display='';
  139. }
  140. $('paybox').style.display='none';
  141. }
  142. <!--{/if}-->
  143. </script>
  144. <!--{/if}-->
  145. <!--{elseif $_GET['op'] == 'transfer'}-->
  146. <!--{if $_G[setting][transferstatus] && $_G['group']['allowtransfer']}-->
  147. <form id="transferform" name="transferform" method="post" autocomplete="off" action="home.php?mod=spacecp&ac=credit&op=transfer" onsubmit="ajaxpost(this.id, 'return_transfercredit');">
  148. <input type="hidden" name="formhash" value="{FORMHASH}" />
  149. <input type="hidden" name="transfersubmit" value="true" />
  150. <input type="hidden" name="handlekey" value="transfercredit" />
  151. <table cellspacing="0" cellpadding="0" class="tfm mtn">
  152. <tr>
  153. <th>{lang memcp_credits_transfer}</th>
  154. <td class="pns">
  155. <input type="text" name="transferamount" id="transferamount" class="px" size="5" style="width: auto;" value="0" />
  156. &nbsp;{$_G[setting][extcredits][$_G[setting][creditstransextra][9]][title]}&nbsp;
  157. {lang credits_give}&nbsp;
  158. <input type="text" name="to" id="to" class="px" size="15" style="width: auto;" />
  159. </td>
  160. <td width="300" class="d">
  161. {lang memcp_credits_transfer_min_balance} $_G[setting][transfermincredits] {$_G[setting][extcredits][$_G[setting][creditstransextra][9]][unit]}<br />
  162. <!--{if intval($taxpercent) > 0}-->{lang credits_tax} $taxpercent<!--{/if}-->
  163. </td>
  164. </tr>
  165. <tr>
  166. <th><span class="rq">*</span>{lang transfer_login_password}</th>
  167. <td><input type="password" name="password" class="px" value="" /></td>
  168. </tr>
  169. <tr>
  170. <th>{lang credits_transfer_message}</th>
  171. <td><input type="text" name="transfermessage" class="px" size="40" /></td>
  172. </tr>
  173. <tr>
  174. <th>&nbsp;</th>
  175. <td colspan="2">
  176. <button type="submit" name="transfersubmit_btn" id="transfersubmit_btn" class="pn" value="true"><em>{lang memcp_credits_transfer}</em></button>
  177. <span style="display: none" id="return_transfercredit"></span>
  178. </td>
  179. </tr>
  180. </table>
  181. </form>
  182. <!--{/if}-->
  183. <!--{elseif $_GET['op'] == 'exchange'}-->
  184. <!--{if $_G[setting][exchangestatus] && ($_G[setting][extcredits] || $_CACHE['creditsettings'])}-->
  185. <form id="exchangeform" name="exchangeform" method="post" autocomplete="off" action="home.php?mod=spacecp&ac=credit&op=exchange&handlekey=credit" onsubmit="showWindow('credit', 'exchangeform', 'post');">
  186. <input type="hidden" name="formhash" value="{FORMHASH}" />
  187. <input type="hidden" name="operation" value="exchange" />
  188. <input type="hidden" name="exchangesubmit" value="true" />
  189. <input type="hidden" name="outi" value="" />
  190. <table cellspacing="0" cellpadding="0" class="tfm mtn">
  191. <tr>
  192. <th>{lang memcp_credits_exchange}</th>
  193. <td class="pns">
  194. <input type="text" id="exchangeamount" name="exchangeamount" class="px" size="5" style="width: auto;" value="0" onkeyup="exchangecalcredit()" />
  195. <select name="tocredits" id="tocredits" class="ps" onChange="exchangecalcredit()">
  196. <!--{loop $_G[setting][extcredits] $id $ecredits}-->
  197. <!--{if $ecredits[allowexchangein] && $ecredits[ratio]}-->
  198. <option value="$id" unit="$ecredits[unit]" title="$ecredits[title]" ratio="$ecredits[ratio]">$ecredits[title]</option>
  199. <!--{/if}-->
  200. <!--{/loop}-->
  201. <!--{eval $i=0;}-->
  202. <!--{loop $_CACHE['creditsettings'] $id $data}--><!--{eval $i++;}-->
  203. <!--{if $data[title]}-->
  204. <option value="$id" outi="$i">$data[title]</option>
  205. <!--{/if}-->
  206. <!--{/loop}-->
  207. </select>
  208. &nbsp;{lang credits_need}&nbsp;
  209. <input type="text" id="exchangedesamount" class="px" size="5" style="width: auto;" value="0" disabled="disabled" />
  210. <select name="fromcredits" id="fromcredits_0" class="ps" style="display: none" onChange="exchangecalcredit();">
  211. <!--{loop $_G[setting][extcredits] $id $credit}-->
  212. <!--{if $credit[allowexchangeout] && $credit[ratio]}-->
  213. <option value="$id" unit="$credit[unit]" title="$credit[title]" ratio="$credit[ratio]">$credit[title]</option>
  214. <!--{/if}-->
  215. <!--{/loop}-->
  216. </select>
  217. <!--{eval $i=0;}-->
  218. <!--{loop $_CACHE['creditsettings'] $id $data}--><!--{eval $i++;}-->
  219. <select name="fromcredits_$i" id="fromcredits_$i" class="ps" style="display: none" onChange="exchangecalcredit()">
  220. <!--{loop $data[creditsrc] $id $ratio}-->
  221. <option value="$id" unit="$_G['setting']['extcredits'][$id][unit]" title="$_G['setting']['extcredits'][$id][title]" ratiosrc="$data[ratiosrc][$id]" ratiodesc="$data[ratiodesc][$id]">$_G['setting']['extcredits'][$id][title]</option>
  222. <!--{/loop}-->
  223. </select>
  224. <!--{/loop}-->
  225. <script type="text/javascript">
  226. var tocredits = $('tocredits');
  227. var fromcredits = $('fromcredits_0');
  228. if(fromcredits.length > 1 && tocredits.value == fromcredits.value) {
  229. fromcredits.selectedIndex = tocredits.selectedIndex + 1;
  230. }
  231. </script>
  232. </td>
  233. <td width="300" class="d">
  234. <!--{if $_G[setting][exchangemincredits]}-->
  235. {lang memcp_credits_exchange_min_balance} $_G[setting][exchangemincredits]<br />
  236. <!--{/if}-->
  237. <span id="taxpercent">
  238. <!--{if intval($taxpercent) > 0}-->
  239. {lang credits_tax} $taxpercent
  240. <!--{/if}-->
  241. </span>
  242. </td>
  243. </tr>
  244. <tr>
  245. <th><span class="rq">*</span>{lang transfer_login_password}</th>
  246. <td colspan="2"><input type="password" name="password" class="px" value="" size="20" /></td>
  247. </tr>
  248. <tr>
  249. <th>&nbsp;</th>
  250. <td colspan="2">
  251. <button type="submit" name="exchangesubmit_btn" id="exchangesubmit_btn" class="pn" value="true" tabindex="2"><em>{lang memcp_credits_exchange}</em></button>
  252. </td>
  253. </tr>
  254. </table>
  255. </form>
  256. <script type="text/javascript">
  257. function exchangecalcredit() {
  258. with($('exchangeform')) {
  259. tocredit = tocredits[tocredits.selectedIndex];
  260. if(!tocredit) {
  261. return;
  262. }
  263. <!--{eval $i=0;}-->
  264. <!--{loop $_CACHE['creditsettings'] $id $data}--><!--{eval $i++;}-->
  265. $('fromcredits_$i').style.display = 'none';
  266. <!--{/loop}-->
  267. if(tocredit.getAttribute('outi')) {
  268. outi.value = tocredit.getAttribute('outi');
  269. fromcredit = $('fromcredits_' + tocredit.getAttribute('outi'));
  270. $('taxpercent').style.display = $('fromcredits_0').style.display = 'none';
  271. fromcredit.style.display = '';
  272. fromcredit = fromcredit[fromcredit.selectedIndex];
  273. $('exchangeamount').value = $('exchangeamount').value.toInt();
  274. if($('exchangeamount').value != 0) {
  275. $('exchangedesamount').value = Math.floor( fromcredit.getAttribute('ratiosrc') / fromcredit.getAttribute('ratiodesc') * $('exchangeamount').value);
  276. } else {
  277. $('exchangedesamount').value = '';
  278. }
  279. } else {
  280. outi.value = 0;
  281. $('taxpercent').style.display = $('fromcredits_0').style.display = '';
  282. fromcredit = fromcredits[fromcredits.selectedIndex];
  283. $('exchangeamount').value = $('exchangeamount').value.toInt();
  284. if(fromcredit.getAttribute('title') != tocredit.getAttribute('title') && $('exchangeamount').value != 0) {
  285. if(tocredit.getAttribute('ratio') < fromcredit.getAttribute('ratio')) {
  286. $('exchangedesamount').value = Math.ceil( tocredit.getAttribute('ratio') / fromcredit.getAttribute('ratio') * $('exchangeamount').value * (1 + $_G[setting][creditstax]));
  287. } else {
  288. $('exchangedesamount').value = Math.floor( tocredit.getAttribute('ratio') / fromcredit.getAttribute('ratio') * $('exchangeamount').value * (1 + $_G[setting][creditstax]));
  289. }
  290. } else {
  291. $('exchangedesamount').value = '';
  292. }
  293. }
  294. }
  295. }
  296. String.prototype.toInt = function() {
  297. var s = parseInt(this);
  298. return isNaN(s) ? 0 : s;
  299. }
  300. exchangecalcredit();
  301. </script>
  302. <!--{/if}-->
  303. <!--{else}-->
  304. {eval
  305. $_TPL['cycletype'] = array(
  306. '0' => '{lang one_time}',
  307. '1' => '{lang everyday}',
  308. '2' => '{lang the_time}',
  309. '3' => '{lang interval_minutes}',
  310. '4' => '{lang open_cycle}'
  311. );
  312. }
  313. <div class="tbmu bw0">
  314. <p>{lang activity_award_message}</p>
  315. </div>
  316. <table cellspacing="0" cellpadding="0" class="dt valt">
  317. <tr>
  318. <th class="xw1">{lang action_name}</th>
  319. <th class="xw1">{lang cycle_range}</th>
  320. <th class="xw1">{lang max_award_per_week}</th>
  321. <!--{loop $_G['setting']['extcredits'] $key $value}-->
  322. <th class="xw1">$value[title]</th>
  323. <!--{/loop}-->
  324. </tr>
  325. <!--{eval $i = 0;}-->
  326. <!--{loop $list $key $value}-->
  327. <!--{eval $i++;}-->
  328. <tr{if $i % 2 == 0} class="alt"{/if}>
  329. <td>$value[rulename]</td>
  330. <td>$_TPL[cycletype][$value[cycletype]]</td>
  331. <td><!--{if $value[rewardnum]}-->$value[rewardnum]<!--{else}-->{lang unlimited_time}<!--{/if}--></td>
  332. <!--{loop $_G['setting']['extcredits'] $key $credit}-->
  333. <!--{eval $creditkey = 'extcredits'.$key;}-->
  334. <td><!--{if $value[$creditkey] > 0}-->+$value[$creditkey]<!--{elseif $value[$creditkey] < 0}-->$value[$creditkey]<!--{else}-->0<!--{/if}--></td>
  335. <!--{/loop}-->
  336. </tr>
  337. <!--{/loop}-->
  338. </table>
  339. <!--{/if}-->
  340. <!--{hook/spacecp_credit_bottom}-->
  341. </div>
  342. </div>
  343. <div class="appl">
  344. <!--{subtemplate home/spacecp_footer}-->
  345. </div>
  346. </div>
  347. <!--{template common/footer}-->