123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <?php
- class commissiontx_c extends Control
- {
- var $_sysModel;
- function __construct()
- {
- parent::Control();
- $this->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");
- }
- }
- ?>
|