<?php
require '../../../zb_system/function/c_system_base.php';

require '../../../zb_system/function/c_system_admin.php';

$zbp->Load();

$action='root';
if (!$zbp->CheckRights($action)) {$zbp->ShowError(6);die();}

if (!$zbp->CheckPlugin('payment')) {$zbp->ShowError(48);die();}

$blogtitle='在线支付';

if(count($_POST)>0){

	$zbp->Config('payment')->readme_text=$_POST['readme_text'];
	$zbp->Config('payment')->title_text=$_POST['title_text'];
	$zbp->Config('payment')->pay_account=$_POST['pay_account'];
	$zbp->Config('payment')->pay_amount=$_POST['pay_amount'];
	$zbp->Config('payment')->pay_show=$_POST['pay_show'];
	$zbp->Config('payment')->pay_note=$_POST['pay_note'];
	$zbp->SaveConfig('payment');
		if(GetVars('addnavbar')){
		$zbp->AddItemToNavbar('item','payment',$zbp->Config('payment')->title_text,$zbp->host.'?pay');
	}else{
		$zbp->DelItemToNavbar('item','payment');
	}
	
	$zbp->SetHint('good');
	Redirect('./main.php');
}


require $blogpath . 'zb_system/admin/admin_header.php';
require $blogpath . 'zb_system/admin/admin_top.php';

?>
<div id="divMain">

  <div class="divHeader"><?php echo $blogtitle;?></div>
<div class="SubMenu"></div>
  <div id="divMain2">
	<form id="edit" name="edit" method="post" action="#">
<input id="reset" name="reset" type="hidden" value="" />
<table border="1" class="tableFull tableBorder">
	<td class="td30"><p align='left'><b>将在线支付加入导航栏</b></p></td>
	<td><input type="checkbox" name="addnavbar" value="ok" <?php if($zbp->CheckItemToNavbar('item','payment')){?>checked="checked"<?php }?> /></td>
</tr>
<tr>
	<td class="td30"><p align='left'><b>在线支付页面标题</b></p></td>
	<td><input type="text" name="title_text" value="<?php echo htmlspecialchars($zbp->Config('payment')->title_text);?>" style="width:89%;" /></td>
</tr>
<tr>
	<td class="td30"><p align='left'><b>在线支付相关说明文字</b></p></td>
	<td><textarea name="readme_text" style="width:90%;height:100px;" /><?php echo htmlspecialchars($zbp->Config('payment')->readme_text);?></textarea></td>
</tr>

<tr>
	<td class="td30"><p align='left'><b>收款人（支付宝账户）</b></p></td>
	<td><input type="text" name="pay_account" value="<?php echo htmlspecialchars($zbp->Config('payment')->pay_account);?>" style="width:89%;" /></td>
</tr>

<tr>
	<td class="td30"><p align='left'><b>付款金额</b></p></td>
	<td><input type="number" name="pay_amount" min="1" max="200" value="<?php echo htmlspecialchars($zbp->Config('payment')->pay_amount);?>" /></td>
</tr>

<tr>
	<td class="td30"><p align='left'><b>付款说明</b></p></td>
	<td><input type="text" name="pay_show" value="<?php echo htmlspecialchars($zbp->Config('payment')->pay_show);?>" style="width:89%;" /></td>
</tr>

<tr>
	<td class="td30"><p align='left'><b>付款备注</b></p></td>
	<td><textarea name="pay_note" style="width:90%;height:100px;" /><?php echo htmlspecialchars($zbp->Config('payment')->pay_note);?></textarea></td>
</tr>

</table>

	  <hr/>
	  <p>
		<input type="submit" class="button" value="<?php echo $lang['msg']['submit']?>" />

	</form>
	<script type="text/javascript">ActiveLeftMenu("aPluginMng");</script>
	<script type="text/javascript">AddHeaderIcon("<?php echo $bloghost . 'zb_users/plugin/payment/logo.png';?>");</script>	
  </div>
</div>


<?php
require $blogpath . 'zb_system/admin/admin_footer.php';

RunTime();
?>