test.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. class test_c extends Control
  3. {
  4. function __construct()
  5. {
  6. parent::Control();
  7. $this->load_model("user");
  8. $this->load_model("commission");
  9. $this->load_model("customer");
  10. }
  11. function test_c()
  12. {
  13. $this->__construct();
  14. }
  15. function index_f()
  16. {
  17. if(!$_SESSION["user_id"])
  18. {
  19. error('',$this->url('login'));
  20. }
  21. $rs = $this->user_m->user_from_id($_SESSION["user_id"]);
  22. $id=$rs["id"];
  23. $this->tpl->assign("rs",$rs);
  24. //$id=10;
  25. $pageid = $this->trans_lib->int(SYS_PAGEID);
  26. $offset = $pageid>0 ? ($pageid-1)*SYS_PSIZE : 0;
  27. //$rslist = $this->customer_m->get_list_all($offset,5);
  28. $rslist = $this->customer_m->get_list($id,$offset,SYS_PSIZE);
  29. //$this->tpl->assign("rslist",$rslist);
  30. //$total = $this->customer_m->get_all_count();
  31. $total = $this->customer_m->get_count($id);
  32. $this->tpl->assign("total",$total);
  33. $pageurl = site_url("customer","uid=".$id);
  34. $this->page_lib->set_psize(SYS_PSIZE);
  35. $pagelist = $this->page_lib->page($pageurl,$total,true);//分页数组
  36. $this->tpl->assign("pagelist",$pagelist);
  37. $this->tpl->assign("rslist",$rslist);
  38. // print_r($total);
  39. $sitetitle = $this->lang["customer"];
  40. $this->tpl->assign("sitetitle",$sitetitle);
  41. $this->tpl->display("test.".$this->tpl->ext);
  42. }
  43. function myfun_f()
  44. {
  45. $this->tpl->display("close.".$this->tpl->ext);
  46. print_r("close.".$this->tpl->ext);
  47. }
  48. function view_f()
  49. {
  50. if(!$_SESSION["user_id"])
  51. {
  52. error('',$this->url('login'));
  53. }
  54. $cid = $this->trans_lib->safe("id");
  55. //print_r($cid);
  56. $rs = $this->customer_m->customer_from_id($cid);
  57. $this->tpl->assign("rs",$rs);
  58. $this->tpl->display("msg_customer.".$this->tpl->ext);
  59. }
  60. }
  61. ?>