public function actionAddDoctor() { $attr = StringHelper::filterArrayString($_POST); $model = new Doctors(); $model->setAttributes($attr); $model->created_at = time(); $model->updated_at = time(); if ($model->save(FALSE)) { ResponseHelper::JsonReturnSuccess("", "Success"); } else { ResponseHelper::JsonReturnError("", "Server Error"); } }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new Doctors(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Doctors'])) { $model->attributes = $_POST['Doctors']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }
public function addDoctor($attr) { $model = new Doctors(); $model->setAttributes($attr); $model->updated_at = time(); $model->created_at = time(); $model->status = 0; if ($model->save(FALSE)) { ResponseHelper::JsonReturnSuccess($model->id, "Success"); } else { ResponseHelper::JsonReturnError("", "Server Error"); } }