public function Delete() { global $obj, $model, $param1; include_once 'Model/usertype.php'; $model = new Usertype(); $model->Id = $param1; if ($model->Delete()) { print '<span class="success">User type Updated</span>'; } else { print '<span class="error">' . $model->Error . '</span>'; } include_once 'View/Usertype/index.php'; }
?> <?php echo $form->error($model, 'username'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'type'); ?> <?php /*echo $form->dropDownList($model,'type', CHtml::listData(Usertype::model()->findall(),'id','role')); */ ?> <?php echo CHtml::activeDropDownList($model, 'type', CHtml::listData(Usertype::model()->findall(), 'role', 'role')); ?> <?php echo $form->error($model, 'type'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'email'); ?> <?php echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 255)); ?> <?php
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Usertype the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Usertype::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function getUsertypes() { return Response::json(array('usertypes' => Usertype::all())); }
public function getLibelle() { $this->__load(); return parent::getLibelle(); }