UnsubscribeController.php 1.01 KB
<?php
class UnsubscribeController extends QLib_Controller_Default_Action 
{
    public function init() {
    	parent::preDispatch();
        $this->QLayoutLink()->appendStylesheet($this->_css('style_css'))->appendStylesheet($this->_css('common_style'));
        if($this->uid < 1)
        {
        	$this->helpRefresh('/passport/signin/unsubscribe');
        }
    }
    
    public function indexAction()
    {
    	$userinfo = $this->helpProfile($this->uid, 'less');
    	$info = QCSubscribe_Models_Client::checkUnsubscribe($userinfo['email']);
    	if(!empty($info))
    	{
    		$this->view->status = 3;
    		return $this->render('save');
    	}
    }
    
    public function saveAction()
    {
    	$userinfo = $this->helpProfile($this->uid, 'less');
    	$remark = $this->helpGpost('remark');
    	$desc = '';
    	$i = 1;
    	foreach ($remark as $v)
    	{
    		$desc .= $i . '.' . $v . '<br />';
    		++$i;
    	}
    	$this->view->status = QCSubscribe_Models_Client::setUnsubscribe($userinfo['email'], $desc);
    }
}