index.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. class index_c extends Control
  3. {
  4. function __construct()
  5. {
  6. parent::Control();
  7. $this->load_model("user");
  8. }
  9. function index_c()
  10. {
  11. $this->__construct();
  12. }
  13. function index_f()
  14. { if(!$_SESSION["user_id"])
  15. {
  16. error('',$this->url('login'));
  17. exit;
  18. }
  19. $oauthuser_info=false;
  20. $urs = $this->user_m->user_from_id($_SESSION["user_id"]);
  21. if($_SESSION["oauthuser_info"])
  22. {
  23. $urs["picture"]=$_SESSION["oauthuser_info"]->headimgurl;
  24. }
  25. $this->tpl->assign("urs",$urs);
  26. $total = $this->user_m->get_count($_SESSION["user_id"]);
  27. $money = $this->user_m->get_money($_SESSION["user_id"]);
  28. if(!$money){
  29. $money ='0';
  30. }
  31. $this->tpl->assign("total",$total);
  32. $this->tpl->assign("money",sprintf("%.2f", $money));
  33. $this->tpl->display("index.".$this->tpl->ext);
  34. }
  35. //网站关闭说明
  36. function close_f()
  37. {
  38. $this->tpl->display("close.".$this->tpl->ext);
  39. }
  40. function updategroup_f()
  41. {
  42. if(!$_SESSION["user_id"])
  43. {
  44. echo "分享成功";
  45. exit;
  46. }else{
  47. $uid = $_SESSION["user_id"];
  48. $this->user_m->update_group($uid);
  49. echo "分享成功,你已经升级为金牌合伙人";
  50. exit;
  51. }
  52. }
  53. }
  54. ?>