public function actionUpdateprofiletab2($id) { $model=$this->loadModel($id); $user = User::model()->findByPk($model->student_transaction_user_id); $info = StudentInfo::model()->findByPk($model->student_transaction_student_id); $address = StudentAddress::model()->findByPk($model->student_transaction_student_address_id); $photo = StudentPhotos::model()->findByPk($model->student_transaction_student_photos_id); $lang = LanguagesKnown::model()->findByPk($model->student_transaction_languages_known_id); $studentdocstrans = new StudentDocsTrans; $stud_qua = new StudentAcademicRecordTrans; $studentcertificate=new StudentCertificateDetailsTable; $parent = ''; $yearModel=new Year; if(isset(Yii::app()->modules['parents'])) $parent = new ParentLogin; $this->performAjaxValidation(array($info,$parent)); if(isset($_POST['StudentInfo'])){ StudentInfo::model()->updateByPk($model->student_transaction_student_id, array( 'student_guardian_name'=>$_POST['StudentInfo']['student_guardian_name'], 'student_guardian_relation'=>$_POST['StudentInfo']['student_guardian_relation'], 'student_guardian_qualification'=>$_POST['StudentInfo']['student_guardian_qualification'], 'student_guardian_occupation'=>$_POST['StudentInfo']['student_guardian_occupation'], 'student_guardian_income'=>$_POST['StudentInfo']['student_guardian_income'], 'student_guardian_occupation_address'=>$_POST['StudentInfo']['student_guardian_occupation_address'], 'student_guardian_home_address'=>$_POST['StudentInfo']['student_guardian_home_address'], 'student_guardian_occupation_city'=>$_POST['StudentInfo']['student_guardian_occupation_city'], 'student_guardian_city_pin'=>$_POST['StudentInfo']['student_guardian_city_pin'], 'student_guardian_phoneno'=>$_POST['StudentInfo']['student_guardian_phoneno'], 'student_guardian_mobile'=>$_POST['StudentInfo']['student_guardian_mobile'], )); if(($model->student_transaction_parent_id == 0 || $model->student_transaction_parent_id == null) && isset(Yii::app()->modules['parents'])) { $parent->attributes=$_POST['ParentLogin']; $parent->parent_user_name = strtolower($parent->parent_user_name); $parent->parent_password = md5($parent->parent_user_name.$parent->parent_user_name); $parent->created_by = Yii::app()->user->id; $parent->creation_date = new CDbExpression('NOW()'); $parent->parent_organization_id =Yii::app()->user->getState('org_id'); $parent->save(); StudentTransaction::model()->updateByPk($id, array('student_transaction_parent_id'=>$parent->parent_id)); } $this->redirect(array('update','id'=>$id,'#'=>'tab_3')); } $this->render('updateproftab2',array( 'model'=>$model,'info'=>$info,'photo'=>$photo,'address'=>$address,'lang'=>$lang,'user'=>$user,'studentdocstrans'=>$studentdocstrans, 'stud_qua'=>$stud_qua, 'flag'=>0, 'studentcertificate'=>$studentcertificate,'parent'=>$parent,'yearModel'=>$yearModel )); }