PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
admin
/
controllers
<?php class PlanDescriptionController extends PController { public $layout = 'admin_column'; public function filters() { return array( 'accessControl', ); } public function accessRules() { $module = $this->getModule(); return array( array('allow', 'actions' => array( 'ajaxupdate','index','create','view','delete','update', ), 'roles' => array($module->templateManagerRole), ), array('deny', // deny all users 'users' => array('*'), ), ); } public function actionIndex() { $model = new PlanDescription('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['PlanDescription'])) { $model->attributes = $_GET['PlanDescription']; } $this->render('index', array( //'filtersForm' => $filtersForm, 'model' => $model, )); } public function actionView() { $id = $_REQUEST['id']; $model = PlanDescription::model()->findByPk($id); $this->render('view', array('model' => $model)); } public function actionUpdate() { $model = new PlanDescriptionForm('update'); if (isset($_POST['PlanDescriptionForm'])) { $model->attributes = $_POST['PlanDescriptionForm']; if ($model->save()) { $url = $this->createUrl('index'); $this->redirect($url); } } if (!isset($_REQUEST['id'])) { $url = $this->createUrl('index'); $this->redirect($url); } $id = $_REQUEST['id']; $t = PlanDescription::model()->findByPk($id); if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } $attributes = array(); foreach ($model->getAttributes() as $name => $value) { $model->$name = $t->$name; } $this->render('update', array('model' => $model)); } public function actionDelete() { if (!isset($_REQUEST['id'])) { $url = $this->createUrl('index'); $this->redirect($url); } $id = $_REQUEST['id']; $t = PlanDescription::model()->findByPk($id); if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } } public function actionAjaxUpdate() { $act = $_GET['act']; $autoIdAll = $_POST['autoId']; if (count($autoIdAll) > 0) { foreach ($autoIdAll as $autoId) { $model = PlanDescription::model()->findByPk($autoId); if ($act == 'doDelete') { $model->is_deleted = '1'; } if ($model->save()) { echo 'ok'; } else { throw new Exception('Sorry', 500); } } } } public function actionCreate() { $model = new PlanDescriptionForm('create'); if (isset($_POST['PlanDescriptionForm'])) { $model->attributes = $_POST['PlanDescriptionForm']; if ($model->save()) { $url = $this->createUrl('index'); $this->redirect($url); } } $this->render('create', array('model' => $model)); } }
[+]
..
[-] TemplateController.php
[edit]
[-] PlanController.php
[edit]
[-] DomainController.php
[edit]
[-] WebsiteController.php
[edit]
[-] ConfigController.php
[edit]
[-] TransactionController.php
[edit]
[-] MailtemplateController.php
[edit]
[-] DefaultController.php
[edit]
[-] CategoryController.php
[edit]
[-] DashboardController.php
[edit]
[-] UserController.php
[edit]
[-] LanguageController.php
[edit]
[-] ModuleController.php
[edit]
[-] ModulecategoryController.php
[edit]
[-] PlanDescriptionController.php
[edit]
[-] TermController.php
[edit]
[-] SubscriptionController.php
[edit]
[-] InterfaceController.php
[edit]
[-] ColorController.php
[edit]
[-] ShareButtonController.php
[edit]
[-] SkinpresetController.php
[edit]
[-] ContentController.php
[edit]
[-] LogController.php
[edit]
[-] ProfileController.php
[edit]