<?php
/**
 * Descriptions
 * @author yzxh24
 * @email yzxh24@gmail.com
 * @created 2010-06-07 15:10:02
 */
class DeleteAction extends BaseAction
{
    public function run()
    {
        //put your code here
        if(Yii::app()->request->isPostRequest)
		{
			// we only allow deletion via POST request
			$model = Adb::model()->findByPk(intval($_GET['id']));
            $model->deleted = 1;
            $model->save();

			// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
			if(!isset($_GET['ajax']))
            {
				$this->getController()->redirect(array('list'));
            }
		}
		else
        {
			throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
        }
    }
}