Leaderboard.php 1.3 KB

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