} $f = $field . '_click'; $model->{$f} = count($model->getContactClickedUsers()); $model->update($f); echo $model->{$f}; } public function actionSubmitTcForm() { if (isset($_POST['CompanyListingAgreement'])) { $model = new CompanyListingAgreement('show-popup'); $model->attributes = $_POST['CompanyListingAgreement'];
{ public $userId; public function run() { $userId = $this->userId; $existed = CompanyListingAgreement::model()->exists(array('condition' => 'user_id=:user', 'params' => array(':user' => $userId))); if ($existed) { return; } $model = new CompanyListingAgreement('show-popup'); $model->user_id = $userId;
public function actionTcAgreement() { $model = new CompanyListingAgreement('search'); $model->unsetAttributes(); // clear any default values $this->render('agreement', array('model' => $model, 'actions' => $this->listActionsCanAccess)); }