<?php
/**
 * Copy Right IJH.CC
 * Each engineer has a duty to keep the code elegant
 * $Id$
 */

if(!defined('__CORE_DIR')){
    exit("Access Denied");
}

class Ctl_Ucenter_Share extends Ctl_Ucenter
{
	public function index()
    {     
        $this->check_login();       
        if($invite_cnt = K::M('member/invite')->invite_count($this->uid)) {
            $cnt = (float)$invite_cnt['invite_money'];
        }else{
            $cnt = 0;
        }
        if($detail = K::M('member/member')->detail($this->uid)) {
            $this->pagedata['mylink'] = $this->mklink('market:invite', array('args'=>$detail['pid']));  // 推广链接
        }
        //print_r($invite_cnt);die;
        $this->pagedata['invite'] = $this->system->config->get('invite');
        $this->pagedata['incnt'] = $cnt;
        $this->pagedata['from'] = $this->GP('from');
		$this->tmpl = "ucenter/share/index.html";
	}
    
    public function detail()
    {
        //print_r($_COOKIE);die;
        if($detail = K::M('member/member')->detail($this->uid)) {
            $this->pagedata['mylink'] = $this->mklink('market:invite', array('args'=>$detail['pid']));  // 推广链接
        }
        $this->pagedata['invite'] = $this->system->config->get('invite');
    	$this->tmpl = "ucenter/share/detail.html";
    }
}
