?> </div> </div> </div> <div class="row"> <div class="form-group"> <div class="span2"> <?php echo $form->labelEx($model, 'role_id'); ?> </div> <div class="col-sm-8 clearLeftPadding"> <?php //echo $form->textField($model,'role_id'); echo $form->dropDownList($model, 'role_id', CHtml::listData(userrole::model()->findAll(array('select' => 'id, user_role', 'order' => 'user_role')), 'id', 'user_role'), array('empty' => '- Select -')); ?> <?php echo $form->error($model, 'role_id'); ?> </div> </div> </div> <div class="row"> <div class="form-group"> <div class="span2"> <?php echo $form->labelEx($model, 'created_by'); ?> </div>
$action = $_REQUEST['action']; include_once MODELS_ADMIN . "/" . $model . "_model.php"; switch (strtoupper($action)) { case 'ADD': break; case 'SAVE': $objURole = new userrole(); $objURole->setUserRole($_REQUEST); $objComm->redirect('index.php?model=' . $model); break; case 'VIEW': case 'EDIT': $objURole = new userrole(); $row = $objURole->getUser($_REQUEST['id']); $rowModule = $objURole->getModulePermission($_REQUEST['id']); break; case 'UPDATE': $objURole = new userrole(); $objURole->setUserRole($_REQUEST); $objComm->redirect('index.php?model=' . $model . '&action=edit&id=' . $_REQUEST['pk_id']); break; case 'DELETE': $objURole = new userrole(); $objURole->delUserRole($_REQUEST['id']); $objComm->redirect('index.php?model=' . $model); break; default: $objURole = new userrole(); $Records = $objURole->getAllUserRole(); break; }