load_model("commissiontx"); $this->load_model("user"); } //兼容PHP4的写法 function commissiontx_c() { $this->__construct(); } function load_sysModel() { $file = ROOT_DATA."system_".$_SESSION["sys_lang_id"].".php"; $_sys = array(); if(file_exists($file)) { include($file); } $this->_sysModel=$_sys; $this->tpl->assign("_sys",$_sys); } //会员列表 function index_f() { $this->load_sysModel(); sys_popedom("commissiontx:list","tpl"); $pageid = $this->trans_lib->int(SYS_PAGEID); $offset = $pageid>0 ? ($pageid-1)*SYS_PSIZE : 0; $condition = " 1=1 "; $startdate = $this->trans_lib->safe("startdate"); $page_url = $this->url("commissiontx"); if($startdate) { $this->tpl->assign("startdate",$startdate); $condition .= " AND postdate>='".strtotime($startdate)."'"; $page_url .= "startdate=".rawurlencode($startdate)."&"; } $enddate = $this->trans_lib->safe("enddate"); if($enddate) { $this->tpl->assign("enddate",$enddate); $condition .= " AND postdate<='".strtotime($enddate)."'"; $page_url .= "enddate=".rawurlencode($enddate)."&"; } $status = $this->trans_lib->int("status"); if($status) { $this->tpl->assign("status",$status); $condition .= " AND status='".($status == 1 ? 1 : 0)."'"; $page_url .= "status=".$status."&"; } $keytype = $this->trans_lib->safe("keytype"); $keywords = $this->trans_lib->safe("keywords"); if($keytype && $keywords) { $this->tpl->assign("keytype",$keytype); $this->tpl->assign("keywords",$keywords); $condition .= " AND ".$keytype." LIKE '%".$keywords."%' "; $page_url .= "keytype=".rawurlencode($keytype)."&keywords=".rawurlencode($keywords)."&"; } $total = $this->commissiontx_m->get_count($condition); $rslist = $this->commissiontx_m->get_list($offset,$condition); $this->tpl->assign("total",$total); $this->tpl->assign("rslist",$rslist); $pagelist = $this->page_lib->page($page_url,$total); $this->tpl->assign("pagelist",$pagelist); $this->tpl->display("commissiontx/list.html"); } function set_f() { $this->load_sysModel(); $id = $this->trans_lib->int("id"); if($id) { sys_popedom("commissiontx:modify","tpl"); $rs = $this->commissiontx_m->get_one($id); $this->tpl->assign("rs",$rs); } else { sys_popedom("commissiontx:add","tpl"); } $this->tpl->display("commissiontx/set.html"); } //存储信息 function setok_f() { $id = $this->trans_lib->int("id"); if($id) { sys_popedom("commissiontx:modify","tpl"); } else { sys_popedom("commissiontx:add","tpl"); } $status=$this->trans_lib->safe("status"); if(!$status){ $status=0; } $array = array(); $array["uid"] = $this->trans_lib->safe("uid"); $array["uname"] = $this->trans_lib->safe("uname"); $array["money"] = $this->trans_lib->safe("money"); $array["postdate"] = $this->system_time; //print_r($ctypevalue."|".$partnerID2."|".$partnerID3); //die(); $insert_id = $this->commissiontx_m->save($array,$id); error("提现明细添加/存储成功",site_url("commissiontx")); } function ajax_status_f() { $id = $this->trans_lib->int("id"); if(!$id) { exit("error:没有指定ID"); } sys_popedom("commissiontx:check","ajax"); $rs = $this->commissiontx_m->get_one($id); if($rs["status"]==1) { $status=0; $time=0; } else { $status=1; $time=$this->system_time; } $this->commissiontx_m->set_status($id,$status,$time); exit("ok"); } function ajax_del_f() { $id = $this->trans_lib->int("id"); if(!$id) { exit("error:没有指定ID"); } sys_popedom("commissiontx:delete","ajax"); $this->commissiontx_m->del($id); exit("ok"); } function pl_status_f() { sys_popedom("commissiontx:check","ajax"); $id = $this->trans_lib->safe("id"); $status = $this->trans_lib->int("status"); if($status){ $time=$this->system_time; }else{ $time=0; } $this->commissiontx_m->status($id,$status,$time); exit("ok"); } function del_f() { sys_popedom("commissiontx:delete","ajax"); $id = $this->trans_lib->safe("id"); if(!$id) { exit("操作错误,没有指定ID!"); } $this->commissiontx_m->del($id); exit("ok"); } function pl_del_f() { sys_popedom("commissiontx:delete","ajax"); $id = $this->trans_lib->safe("id"); if(!$id) { exit("操作错误,没有指定ID!"); } $this->commissiontx_m->pl_del($id); exit("ok"); } } ?>