<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(61);
$prom_event_obj = new Keke_witkey_prom_event_class();
$w['page_size'] and $page_size = intval($w['page_size']) or $page_size = 10;
$page and $page = intval($page) or $page = '1';
$url = "index.php?do={$do}&view={$view}&w[event_id]=" . $w['event_id'] . "&w[parent_username]=" . $w['parent_username'] . "&w[username]=" . $w['username'] . "&w[action]=" . $w['action'] . "&w[page_size]={$page_size}&w[ord][0]={$w['ord']['0']}&w[ord][1]={$w['ord']['1']}&page={$page}";
$ac_url = "index.php?do={$do}&view={$view}&w['page_size']=" . $w['page_size'] . "&w['action']=" . $w['action'] . "&w[ord][0]={$w['ord']['0']}&w[ord][1]={$w['ord']['1']}" . "&page={$page}";
if (isset($ac)) {
    if ($event_id) {
        switch ($ac) {
            case "del":
                $prom_event_obj->setWhere("event_id = " . intval($event_id));
                $res = $prom_event_obj->del_keke_witkey_prom_event();
                $res and kekezu::admin_show_msg($_lang['delete_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['delete_fail'], $url, 3, '', 'warning');
                break;
        }
    }
} elseif (isset($sbt_action)) {
    $ckb_string = $ckb;
    is_array($ckb_string) and $ckb_string = implode(',', $ckb_string);
    if (count($ckb_string)) {
        $prom_event_obj->setWhere('event_id in (' . $ckb_string . ')');
        $res = $prom_event_obj->del_keke_witkey_prom_event();
        $res and kekezu::admin_show_msg($_lang['mulit_operate_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['mulit_operate_fail'], $url, 3, '', 'warning');
    }
} else {
    $type_arr = keke_prom_class::get_prom_type();
    $where = '1=1';
    $w['event_id'] and $where .= " and event_id = " . intval($w['event_id']);
Exemple #2
0
 function create_prom_event($action, $uid, $obj_id, $cash = 0, $credit = 0, $event_status = '1')
 {
     $result = FALSE;
     if ($this->_prom_open) {
         $prom_relation = $this->get_prom_relation($uid, $action);
         $r_status = intval($prom_relation['relation_status']);
         if ($prom_relation && $r_status != 3 && $r_status != 4 && $prom_relation['prom_uid'] != $uid) {
             if (!$this->get_prom_event($obj_id, $uid, $action, $event_status)) {
                 $income_rule = $this->get_income_rule($action, $obj_id, $cash, $credit);
                 $event_obj = new Keke_witkey_prom_event_class();
                 $event_obj->setEvent_desc($income_rule['event_desc']);
                 $event_obj->setUid($uid);
                 $event_obj->setUsername($prom_relation['username']);
                 $event_obj->setParent_uid($prom_relation['prom_uid']);
                 $event_obj->setParent_username($prom_relation['prom_username']);
                 $event_obj->setObj_id($obj_id);
                 $event_obj->setAction($income_rule['action']);
                 $event_obj->setRake_cash($income_rule['rake_cash']);
                 $event_obj->setRake_credit($income_rule['rake_credit']);
                 $event_obj->setEvent_time(time());
                 $event_obj->setEvent_status(intval($event_status));
                 $result = $event_obj->create_keke_witkey_prom_event();
                 $this->clear_prom_cookie();
             }
         }
     }
     return $result;
 }
 function create_prom_event($action, $uid, $obj_id, $cash = 0, $credit = 0, $event_status = '1')
 {
     $result = FALSE;
     $arrTaskInfo = db_factory::get_one(sprintf("select * from %switkey_task where task_id = %d", TABLEPRE, $obj_id));
     $arrBidInfo = db_factory::get_one(sprintf("select * from %switkey_task_bid where task_id = %d and bid_status = 4", TABLEPRE, $obj_id));
     if ($this->_prom_open) {
         $prom_relation = $this->get_prom_relation($uid, $action);
         $r_status = intval($prom_relation['relation_status']);
         if ($prom_relation && $r_status != 3 && $r_status != 4 && $prom_relation['prom_uid'] != $uid) {
             if (!$this->get_prom_event($obj_id, $uid, $action, $event_status)) {
                 if ($arrTaskInfo['model_id'] == 5) {
                     $cash = $arrBidInfo['quote'];
                 }
                 $income_rule = $this->get_income_rule($action, $obj_id, $cash, $credit);
                 $event_obj = new Keke_witkey_prom_event_class();
                 $event_obj->setEvent_desc($income_rule['event_desc']);
                 $event_obj->setUid($uid);
                 $event_obj->setUsername($prom_relation['username']);
                 $event_obj->setParent_uid($prom_relation['prom_uid']);
                 $event_obj->setParent_username($prom_relation['prom_username']);
                 $event_obj->setObj_id($obj_id);
                 $event_obj->setAction($income_rule['action']);
                 $event_obj->setRake_cash($income_rule['rake_cash']);
                 $event_obj->setRake_credit($income_rule['rake_credit']);
                 $event_obj->setEvent_time(time());
                 $event_obj->setEvent_status(intval($event_status));
                 $result = $event_obj->create_keke_witkey_prom_event();
                 $this->clear_prom_cookie();
             }
         }
     }
     return $result;
 }