PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
admin
/
controllers
<?php class PlanController extends PController { public $layout = 'admin_column'; public function filters() { return array( 'accessControl', ); } public function accesssRules() { $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 Plan('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Plan'])) { $model->attributes = $_GET['Plan']; } $this->render('index', array( //'filtersForm' => $filtersForm, 'model' => $model, )); } public function actionUpdate() { $model = new PlanForm('update'); if (isset($_POST['PlanForm'])) { $model->attributes = $_POST['PlanForm']; 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 = Plan::model()->findByPk((int) $id); if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } $attributes = array(); $planConditions = PlanCondition::model()->findAll('plan_id=:plan_id', array(':plan_id' => $t->id)); foreach ($planConditions as $planCondition) { if (isset($model[$planCondition->name])) { $model[$planCondition->name] = $planCondition->value; } } $planAdditions = PlanAddition::model()->findAll('plan_id=:plan_id', array(':plan_id' => $t->id)); foreach ($planAdditions as $planAddition) { if (isset($model[$planAddition->name])) { $model[$planAddition->name] = $planAddition->value; } } foreach ($model->getAttributes() as $name => $value) { if (isset($t->$name)) { $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 = Plan::model()->findByPk((int) $id); if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } if ($t->deleable) { $t->delete(); } echo 'ok'; } public function actionAjaxUpdate() { $act = $_GET['act']; $autoIdAll = array(); if (isset($_POST['autoId'])) { $autoIdAll = $_POST['autoId']; } if (count($autoIdAll) > 0) { foreach ($autoIdAll as $autoId) { $plan = Plan::model()->findByPk((int) $autoId); if ($act == 'doDelete') { if ($plan->deleable) { $plan->delete(); } } echo 'ok'; } } } public function actionCreate() { $model = new PlanForm('create'); if (isset($_POST['PlanForm'])) { $model->attributes = $_POST['PlanForm']; 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]