<?php
if(!$_SESSION['admin_id']){
	pe_goto("index.php");
}
$menumark = 'brokerage_list';
switch ($act) {
	//#####################@ 佣金修改 @#####################//
	case 'edit':
		$info = $db->pe_select('sheet', array('id'=>$_g_id));

		$seo = pe_seo('修改佣金信息', '', '', 'sheet');
		$action = "admin.php?mod=brokerage&act=editsql&id={$_g_id}";
		include(pe_tpl('brokerage_add.html'));
	break;
	//#####################@ 佣金修改sql @#####################//
	case 'editsql':
		if ($db->pe_update('sheet', array('id'=>$_g_id), $_p_info)) {
			pe_success('佣金信息修改成功!', 'admin.php?mod=brokerage&act=list');
		}
		else {
			pe_error('佣金信息修改失败...');
		}
	break;
	//#####################@ 佣金删除sql @#####################//
	case 'delsql':
		if ($db->pe_delete('sheet', array('id'=>$_g_id))) {
			pe_success('佣金删除成功!');
		}
		else {
			pe_error('佣金删除失败...');
		}
	break;
	//#####################@ 佣金列表 @#####################//
	default:
		$_g_user_name && $sqlwhere .= " and `tj_name` like '%{$_g_user_name}%'";
		$_g_user_name_pay && $sqlwhere .= " and `user_name_pay` like '%{$_g_user_name_pay}%'";
		$sqlwhere .= " order by `id` desc";
		$info_list = $db->pe_selectall('sheet', $sqlwhere, '*', array(20, $_g_page));

		$seo = pe_seo('佣金列表', '', '', 'sheet');
		include(pe_tpl('brokerage_list.html'));
	break;
}
pe_result();
?>