Exemple #1
0
 function plan_load_repay()
 {
     require_once APP_ROOT_PATH . "app/Lib/common.php";
     require_once APP_ROOT_PATH . "app/Lib/plan_func.php";
     $id = intval($_REQUEST['id']);
     if ($id == 0) {
         $this->success("数据错误");
     }
     $plan_info = get_plan($id);
     if (!$plan_info) {
         $this->success("该计划不存在");
     }
     $this->assign("plan_info", $plan_info);
     $repay_list = get_plan_load_list($plan_info);
     if (!$repay_list) {
         $this->success("无还款信息");
     }
     foreach ($repay_list as $k => $v) {
         $repay_list[$k]['idx'] = $k + 1;
     }
     $this->assign("repay_list", $repay_list);
     $this->assign("deal_id", $id);
     $this->assign("deal_info", $deal_info);
     $this->display();
 }
Exemple #2
0
<?php

if (!$_GET[planID]) {
    redirect("/?error=some");
}
$plan = get_plan($_GET[planID] * 1);
if ($user[perm] != 1) {
    if ($user[userID] == $plan[userID]) {
        $_GET['return'] = 1;
    } else {
        redirect("/?error=some");
    }
}
cancel_buy($plan[planID], $_GET['return'] * 1);
redirect("/?error=delok");
Exemple #3
0
function cancel_buy($planID, $return)
{
    $user = get_plan($planID);
    $q = "UPDATE rt_plan SET userID=0 WHERE planID='" . $planID . "'";
    $q = db_query($q);
    if ($return) {
        user_pay($user[userID], read_setting("price"), "Отмена оплаты кванта времени (id=" . $planID . ")");
    }
}