commissiontx.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <?php
  2. class commissiontx_c extends Control
  3. {
  4. var $_sysModel;
  5. function __construct()
  6. {
  7. parent::Control();
  8. $this->load_model("commissiontx");
  9. $this->load_model("user");
  10. }
  11. //兼容PHP4的写法
  12. function commissiontx_c()
  13. {
  14. $this->__construct();
  15. }
  16. function load_sysModel()
  17. {
  18. $file = ROOT_DATA."system_".$_SESSION["sys_lang_id"].".php";
  19. $_sys = array();
  20. if(file_exists($file))
  21. {
  22. include($file);
  23. }
  24. $this->_sysModel=$_sys;
  25. $this->tpl->assign("_sys",$_sys);
  26. }
  27. //会员列表
  28. function index_f()
  29. { $this->load_sysModel();
  30. sys_popedom("commissiontx:list","tpl");
  31. $pageid = $this->trans_lib->int(SYS_PAGEID);
  32. $offset = $pageid>0 ? ($pageid-1)*SYS_PSIZE : 0;
  33. $condition = " 1=1 ";
  34. $startdate = $this->trans_lib->safe("startdate");
  35. $page_url = $this->url("commissiontx");
  36. if($startdate)
  37. {
  38. $this->tpl->assign("startdate",$startdate);
  39. $condition .= " AND postdate>='".strtotime($startdate)."'";
  40. $page_url .= "startdate=".rawurlencode($startdate)."&";
  41. }
  42. $enddate = $this->trans_lib->safe("enddate");
  43. if($enddate)
  44. {
  45. $this->tpl->assign("enddate",$enddate);
  46. $condition .= " AND postdate<='".strtotime($enddate)."'";
  47. $page_url .= "enddate=".rawurlencode($enddate)."&";
  48. }
  49. $status = $this->trans_lib->int("status");
  50. if($status)
  51. {
  52. $this->tpl->assign("status",$status);
  53. $condition .= " AND status='".($status == 1 ? 1 : 0)."'";
  54. $page_url .= "status=".$status."&";
  55. }
  56. $keytype = $this->trans_lib->safe("keytype");
  57. $keywords = $this->trans_lib->safe("keywords");
  58. if($keytype && $keywords)
  59. {
  60. $this->tpl->assign("keytype",$keytype);
  61. $this->tpl->assign("keywords",$keywords);
  62. $condition .= " AND ".$keytype." LIKE '%".$keywords."%' ";
  63. $page_url .= "keytype=".rawurlencode($keytype)."&keywords=".rawurlencode($keywords)."&";
  64. }
  65. $total = $this->commissiontx_m->get_count($condition);
  66. $rslist = $this->commissiontx_m->get_list($offset,$condition);
  67. $this->tpl->assign("total",$total);
  68. $this->tpl->assign("rslist",$rslist);
  69. $pagelist = $this->page_lib->page($page_url,$total);
  70. $this->tpl->assign("pagelist",$pagelist);
  71. $this->tpl->display("commissiontx/list.html");
  72. }
  73. function set_f()
  74. {
  75. $this->load_sysModel();
  76. $id = $this->trans_lib->int("id");
  77. if($id)
  78. {
  79. sys_popedom("commissiontx:modify","tpl");
  80. $rs = $this->commissiontx_m->get_one($id);
  81. $this->tpl->assign("rs",$rs);
  82. }
  83. else
  84. {
  85. sys_popedom("commissiontx:add","tpl");
  86. }
  87. $this->tpl->display("commissiontx/set.html");
  88. }
  89. //存储信息
  90. function setok_f()
  91. {
  92. $id = $this->trans_lib->int("id");
  93. if($id)
  94. {
  95. sys_popedom("commissiontx:modify","tpl");
  96. }
  97. else
  98. {
  99. sys_popedom("commissiontx:add","tpl");
  100. }
  101. $status=$this->trans_lib->safe("status");
  102. if(!$status){
  103. $status=0;
  104. }
  105. $array = array();
  106. $array["uid"] = $this->trans_lib->safe("uid");
  107. $array["uname"] = $this->trans_lib->safe("uname");
  108. $array["money"] = $this->trans_lib->safe("money");
  109. $array["postdate"] = $this->system_time;
  110. //print_r($ctypevalue."|".$partnerID2."|".$partnerID3);
  111. //die();
  112. $insert_id = $this->commissiontx_m->save($array,$id);
  113. error("提现明细添加/存储成功",site_url("commissiontx"));
  114. }
  115. function ajax_status_f()
  116. {
  117. $id = $this->trans_lib->int("id");
  118. if(!$id)
  119. {
  120. exit("error:没有指定ID");
  121. }
  122. sys_popedom("commissiontx:check","ajax");
  123. $rs = $this->commissiontx_m->get_one($id);
  124. if($rs["status"]==1)
  125. {
  126. $status=0;
  127. $time=0;
  128. }
  129. else
  130. {
  131. $status=1;
  132. $time=$this->system_time;
  133. }
  134. $this->commissiontx_m->set_status($id,$status,$time);
  135. exit("ok");
  136. }
  137. function ajax_del_f()
  138. {
  139. $id = $this->trans_lib->int("id");
  140. if(!$id)
  141. {
  142. exit("error:没有指定ID");
  143. }
  144. sys_popedom("commissiontx:delete","ajax");
  145. $this->commissiontx_m->del($id);
  146. exit("ok");
  147. }
  148. function pl_status_f()
  149. {
  150. sys_popedom("commissiontx:check","ajax");
  151. $id = $this->trans_lib->safe("id");
  152. $status = $this->trans_lib->int("status");
  153. if($status){
  154. $time=$this->system_time;
  155. }else{
  156. $time=0;
  157. }
  158. $this->commissiontx_m->status($id,$status,$time);
  159. exit("ok");
  160. }
  161. function del_f()
  162. {
  163. sys_popedom("commissiontx:delete","ajax");
  164. $id = $this->trans_lib->safe("id");
  165. if(!$id)
  166. {
  167. exit("操作错误,没有指定ID!");
  168. }
  169. $this->commissiontx_m->del($id);
  170. exit("ok");
  171. }
  172. function pl_del_f()
  173. {
  174. sys_popedom("commissiontx:delete","ajax");
  175. $id = $this->trans_lib->safe("id");
  176. if(!$id)
  177. {
  178. exit("操作错误,没有指定ID!");
  179. }
  180. $this->commissiontx_m->pl_del($id);
  181. exit("ok");
  182. }
  183. }
  184. ?>