<?php

class skin_treasury {


function start() {
global $ibforums;
return <<<EOF
<!-- nothing here -->
EOF;
}

function end() {
global $ibforums;
return <<<EOF
</table></td></tr></table></div>
EOF;
}

function listRichers($name, $money) {
global $ibforums;
return <<<EOF
<tr><td align='left'><b>$name</b></td>
    <td align='right'><b>$ $money</b></td>
</tr>
EOF;
}

function listLenders($name, $money, $time) {
global $ibforums;
return <<<EOF
<tr class='row4'>
	<td align='left'>&nbsp;&nbsp;{$name}</td>
	<td width='100' align='right'>{$time}&nbsp;</td>
	<td align='right'><font color=green>$ {$money}</font> {$ibforums->lang['money_unit']}&nbsp;&nbsp;</td>
</tr>
EOF;
}

function listMiddle() {
global $ibforums;
return <<<EOF
  </table>
</td>
<td>
  <table width="100%" border="0" align='center' cellpadding='0' cellspacing='1'>
EOF;
}

function listBorrowers($name, $money, $time) {
global $ibforums;
return <<<EOF
<tr class='row4'>
	<td align='left'>&nbsp;&nbsp;{$name}</td>
	<td width='100' align='right'>{$time}&nbsp;</td>
	<td align='right'><font color=red>$ {$money}</font> {$ibforums->lang['money_unit']}&nbsp;&nbsp;</td>
</tr>
EOF;
}

function Page_header($interest, $interest_days, $deposit, $total_member, $total_deposit) {
global $ibforums;
$curr_deposit = $interest+$deposit;
return <<<EOF
<script language='Javascript' type='text/javascript'>
<!-- 
function isEmpty(s) {
	return ((s == null) || (s.length == 0))
}
function isDigit (c) {
	return ((c >= "0") && (c <= "9"))
}
function isInteger(s){
	var i;
    if (isEmpty(s)) return false;
    for (i = 0; i < s.length; i++) {   
        var c = s.charAt(i);
        if (!isDigit(c)) return false;
    }
    return true;
}
function verify1() {
   var inputValue = document.Treasury1.amount.value;
   if ( inputValue == "0" || !isInteger(inputValue)) {
      alert("请输入正确整数(>0)");
      return false;
   } else {
      document.Treasury1.submit1.disabled = true;
      return true;
   }
}
function verify2() {
   var inputValue = document.Treasury2.amount.value;
   if ( inputValue == "0" || !isInteger(inputValue)) {
      alert("请输入正确整数(>0)");
      return false;
   } else {
      document.Treasury2.submit2.disabled = true;
      return true;
   }
}
function verify3() {
   var inputValue = document.Treasury3.amount.value;
   if ( inputValue == "0" || !isInteger(inputValue)) {
      alert("请输入正确整数(>0)");
      return false;
   } else {
      document.Treasury3.submit3.disabled = true;
      return true;
   }
}
//-->
</script>


<table width="100%" border="1" cellspacing="1" cellpadding="4">
<td class="maintitle">{$ibforums->lang['page_title']}</td>
<table width="100%" border="1" cellspacing="1" cellpadding="4">


<tr>
<th class='pformstrip' align="center" colspan="2">{$ibforums->lang['sb_002']}</th>
</tr>

<tr>

<td class='row4' width="50%">
<table width='100%' align=center cellpadding='1' cellspacing='1'>
   
   	<tr><td align='left'><b>{$ibforums->lang['sb_003']}</b></td>
	        <td align='right'><b>$ {$ibforums->member['money']} {$ibforums->lang['money_unit']}</b></td>
	    </tr>
        <tr><td align='left'><b>{$ibforums->lang['sb_004']}</b></td>
	        <td align='right'><b>$ $curr_deposit {$ibforums->lang['money_unit']}</b></td>
	    </tr>
        <tr><td align='left'><b>{$ibforums->lang['sb_016']}</b></td>
	        <td align='right'><b>{$ibforums->lang['interest_info']}</b></td>
	    </tr>
        <tr><td align='left'><b>{$ibforums->lang['total_member']}</b></td>
	        <td align='right'><b>$total_member</b></td>
	    </tr>
        <tr><td align='left'><b>{$ibforums->lang['total_deposit']}</b></td>
	        <td align='right'><b>$ $total_deposit</b></td>
	    </tr>
        <tr><td align='left'><b>{$ibforums->lang['sb_015']}</b></td>
	        <td align='right'><b>{$ibforums->vars['interest_per_day']}%</b></td>
	    </tr>
</table>
</td>

<td class='row4' width="50%">
<table width='100%' align=center cellpadding='1' cellspacing='1'>
<tr><td>
	          <form action='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?act=Treasury' method='post' name='Treasury1' id='Treasury1' onSubmit='return verify1()'>
              <input type='hidden' name='act' value='Treasury'>
              <input type='hidden' name='CODE' value='01'>
              <input type='text' name='amount' value='{$ibforums->lang['sb_005']}' onFocus=this.value='' size='30' class='forminput'></td>
            <td align='center'><input id='submit1' type='submit' value='{$ibforums->lang['sb_006']}' name='B1' class='forminput'></td></form>
        </tr>
        <tr><td>
              <form action='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?act=Treasury' method='post' name='Treasury2' id='Treasury2' onSubmit='return verify2()'>
              <input type='hidden' name='act' value='Treasury'>
              <input type='hidden' name='CODE' value='02'>
              <input type='text' name='amount' size='30' value='{$ibforums->lang['sb_007']}' onFocus=this.value='' class='forminput'></td>
            <td align='center'><input id='submit2' type='submit' value='{$ibforums->lang['sb_008']}' name='B1' class='forminput'></td></form>
        </tr>
        <tr><td ><br></td></tr>
        <tr><td>
              <form action='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?act=Treasury' method='post' name='Treasury3' id='Treasury3' onSubmit='return verify3()'>
              <input type='hidden' name='act' value='Treasury'>
              <input type='hidden' name='CODE' value='03'>
              <input type='text' name='friendname' value='{$ibforums->lang['sb_009']}' onFocus=this.value='' size='30' class='forminput'></td>
        <tr><td>
	          <input type='text' name='amount' value='{$ibforums->lang['sb_010']}' onFocus=this.value='' size='30' class='forminput'></td>
	        <td align='center'><input id='submit3' type='submit' value='{$ibforums->lang['sb_011']}' name='B1' class='forminput'></td>
	    </tr></form>
</table>
</td>
</tr>

<th class='pformstrip' align="center" colspan="2"><b>{$ibforums->lang['bank_richers']}</b></th>
<tr>

<td class='row4'>
<table align=center cellpadding='1' cellspacing='1'>
<!-- BANKRICHERS -->
</table>
</td>

<td class='row4'>
<table align=center cellpadding='1' cellspacing='1'>
<tr>
<td align=center class='row4' width="50%">
<img border='0' src='html/sys-img/bank.jpg' width='106' height='115'>
</td>
</tr>
</table>
</td>

</tr>

</div>


<!--<br>-->
<div>
<table width="100%" border="1" cellspacing="1" cellpadding="4">
<div class="maintitle">{$ibforums->lang['sb_012']}</div>
<table width="100%" border="1" cellspacing="1" cellpadding="4">
  <tr>
    <table width="100%" border="1" cellspacing="1" cellpadding="1">
	<tr>
	<th class='pformstrip' align="center" width="50%">{$ibforums->lang['sb_013']}</th>
	<th class='pformstrip' align="center" width="50%">{$ibforums->lang['sb_014']}</th>
	</tr>
      <tr>
	    <td>
         <table width="100%" border="0" align='center' cellpadding='0' cellspacing='1'>
EOF;
}


function deposit_error($num){
global $ibforums;
$error_msg = "error_deposit".$num;
return <<<EOF
<!--<div class='tableborder'>-->
<table width="100%" border="1" cellspacing="1" cellpadding="4">
<td class="maintitle" align="center"><font color=red>{$ibforums->lang['error_msg']}</font></td>
<table width="100%" border="1" cellspacing="1" cellpadding="4">
  <tr>
	<th class='pformstrip' align="center"><font color=red>{$ibforums->lang[$error_msg]}</font></th>
  </tr>
<!--</table>
</table>
</div>
<br>-->
EOF;
}

function withdraw_error($num){
global $ibforums;
$error_msg = "error_withdraw".$num;
return <<<EOF
<!--<div class='tableborder'>-->
<table width="100%" border="1" cellspacing="1" cellpadding="4">
<td class="maintitle" align="center"><font color=red>{$ibforums->lang['error_msg']}</font></td>
<table width="100%" border="1" cellspacing="1" cellpadding="4">
  <tr>
	<th class='pformstrip' align="center"><font color=red>{$ibforums->lang[$error_msg]}</font></th>
  </tr>
<!--</table>
</table>-->
</div>
<br>
EOF;
}

function give_error($num){
global $ibforums;
$error_msg = "error_give".$num;
return <<<EOF
<!--<div class='tableborder'>-->
<table width="100%" border="1" cellspacing="1" cellpadding="4">
<td class="maintitle" align="center"><font color=red>{$ibforums->lang['error_msg']}</font></td>
<table width="100%" border="1" cellspacing="1" cellpadding="4">
  <tr>
	<th class='pformstrip' align="center"><font color=red>{$ibforums->lang[$error_msg]}</font></th>
  </tr>
<!--</table>
</table>-->
</div>
<br>
EOF;
}


}
?>
