QQ:632518024
EMail:linlongvip@163.com
欢迎测试交流
1.复制admin,languages下文件夹
2.恢复数据库
admin/includes/inc_priv.php文件中添加
//会员管理权限
$purview['11_czcard_manage'] = 'account_manage';
inc_menu.php
增加
$modules['08_members']['11_czcard_manage'] = 'czcard.php?act=list';
languages/zh_cn/admin/common.php
$_LANG['11_czcard_manage'] = '充值卡管理';
user.php
/* 载入语言文件 */
下增加
require_once(ROOT_PATH . 'languages/' .$_CFG['lang']. '/user_others.php');
/* 显示页面的action列表 */
$ui_arr = array(…………
中增加'account_czcard'
/* 会员充值和提现申请记录 */
上面增加
//------------------------------------------------
/* 会员充值卡界面 */
elseif ($action == 'account_czcard')
{
include_once(ROOT_PATH . 'includes/lib_clips.php');
$czcard_sn = !empty($_POST['czcard_sn'])? $_POST['czcard_sn']: 0;
$czcard_pwd = !empty($_POST['czcard_pwd'])? $_POST['czcard_pwd']: 0;
if ($czcard_sn != 0)
{
$sql = "SELECT * FROM " .$ecs->table('user_czcard').
" WHERE bonus_sn = '$czcard_sn'" .
" AND bonus_pwd = '$czcard_pwd'";
$record_arr = $db->getRow($sql);
if (empty($record_arr))
{
// show_message($user_id);
show_message(卡号或密码错误);
return 0;
}else
{
if ($record_arr['czcard_status']==0)
{
//卡号有效处理充值
//更新卡标识
$sql = "UPDATE " .$ecs->table('user_czcard'). " SET ".
"czcard_status = 1 , ".
"user_id = $user_id , ".
"used_time = '".gmtime()."' ".
// "admin_note = '$admin_note', ".
" WHERE bonus_id = '$record_arr[bonus_id]'";
$Res = $db->query($sql);
// return $GLOBALS['db']->query($sql);
if ($Res!=0)
{//增加金额
$sql = "SELECT * FROM " . $ecs->table('czcard_type') .
" WHERE type_id = '$record_arr[bonus_type_id]'";
$Res_arr = $db->getRow($sql);
if (empty($record_arr))
{
show_message('此类卡已停止使用');
return 0;
}else
{
$amount = $Res_arr['type_money'];
//-----------
$sql = 'INSERT INTO ' .$ecs->table('user_account').
' (user_id, admin_user, amount, add_time, paid_time, admin_note, user_note, process_type, payment, is_paid)'.
" VALUES ('$user_id', '', '$amount', '".gmtime()."', 0, '充值卡充值', '充值卡充值', '0', '充值卡', 1)";
$db->query($sql);
/* 如果成功提交 */
if ($db->insert_id() > 0)
{
log_account_change($user_id, $amount, 0, 0, 0, $_LANG['surplus_type_0'], ACT_SAVING);
// $content = $_LANG['surplus_appl_submit'];
// show_message($content, $_LANG['back_account_log'], 'user.php?act=account_log', 'info');
show_message('成功');
}
else
{
// $content = $_LANG['process_false'];
// show_message($content, $_LANG['back_page_up'], '', 'info');
show_message('失败');
}
//-----------
}
}
}
else if ($record_arr['czcard_status']==1)//已使用
show_message($_LANG['czcard_status_used']);
else if ($record_arr['czcard_status']==2)//被锁定
show_message($_LANG['czcard_status_locked']);
}
}
$smarty->display('user_transaction.dwt');
}
//------------------------------------------------
修改user_transaction.dwt
<!--#会员余额 start-->
<!--{if $action eq "account_czcard" || $action eq "account_raply" ||
在<!-- {if $action eq "account_raply"} -->前
<!--#会员充值 start-->
<!-- {if $action eq "account_czcard"} -->
<div class="content" style="padding:8px;">
<form name="formSurplus" method="post" action="user.php" onSubmit="return submitSurplus()">
<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
<tr>
<td width="15%" bgcolor="#ffffff">{$lang.label_czcard_sn}:</td>
<td bgcolor="#ffffff" align="left"><input type="text" name="czcard_sn" value="{$order.amount|escape}" class="inputBg" size="30" />
</td>
</tr>
<td width="15%" bgcolor="#ffffff">{$lang.label_czcard_pwd}:</td>
<td bgcolor="#ffffff" align="left"><input type="text" name="czcard_pwd" value="{$order.amount|escape}" class="inputBg" size="30" />
</td>
</tr>
<tr>
<td bgcolor="#ffffff" colspan="2" align="center">
<input type="hidden" name="surplus_type" value="1" />
<input type="hidden" name="act" value="account_czcard" />
<input type="submit" name="submit" value="{$lang.submit_request}" />
<input type="reset" name="reset" value="{$lang.button_reset}" />
</td>
</tr>
</table>
</form>
</div></div>
<!-- {/if} -->
<!--#会员充值 end-->
最好修改library/user_menu.lib
查找<li><a href="user.php?act=account_log"
下面增加一行
<div class="item {if $action eq 'account_czcard'} curr{/if}"><a href="user.php?act=account_czcard">{$lang.label_user_czcard}</a></div>
- 1
- 2
前往页