/** * Displays a particular model. * @param integer $id the ID of the model to be displayed */ public function actionView($id) { $test = new StudentDocsTrans(); $docs_model = new StudentDocsTrans('mysearch'); $stu_record = new StudentAcademicRecordTrans('mysearch'); $docs_model->unsetAttributes(); // clear any default values $stu_record->unsetAttributes(); // clear any default values if (isset($_GET['StudentDocsTrans'])) { $docs_model->attributes = $_GET['StudentDocsTrans']; } if (isset($_GET['StudentAcademicRecordTrans'])) { $stu_record->attributes = $_GET['StudentAcademicRecordTrans']; } $this->render('view', array('model' => $this->loadModel($id), 'docs_model' => $docs_model, 'test' => $test, 'stu_record' => $stu_record)); }
public function actionStudentFinalViewExportToPdf($id) { $student_docs = StudentDocsTrans::model()->findAll('student_docs_trans_user_id=' . $id); $studentqualification = StudentAcademicRecordTrans::model()->findAll('student_academic_record_trans_stud_id=' . $id); $student_transaction = StudentTransaction::model()->findAll('student_transaction_id=' . $id); $studentfeedbackdetailstable = FeedbackDetailsTable::model()->findAll('feedback_details_table_student_id=' . $id); $html = $this->renderPartial('/studentTransaction/studentfinalview', array('student_docs' => $student_docs, 'studentqualification' => $studentqualification, 'student_transaction' => $student_transaction, 'studentfeedbackdetailstable' => $studentfeedbackdetailstable), true); $this->exporttopdf('Stundent Report', 'StundentFinalView.pdf', $html); }
/** * Deletes a particular model. * If deletion is successful, the browser will be redirected to the 'admin' page. * @param integer $id the ID of the model to be deleted */ public function actionDelete($id) { if (Yii::app()->request->isPostRequest) { // we only allow deletion via POST request $model = $this->loadModel($id); $student_info = StudentInfo::model()->findByPk($model->student_transaction_student_id); if ($model->student_transaction_student_address_id != null) { $address = StudentAddress::model()->findByPk($model->student_transaction_student_address_id); } $stud_photo = StudentPhotos::model()->findByPk($model->student_transaction_student_photos_id); if ($model->student_transaction_languages_known_id != null) { $lang_known = LanguagesKnown::model()->findByPk($model->student_transaction_languages_known_id); } $dir1 = Yii::getPathOfAlias('webroot') . '/college_data/stud_images/'; if ($dh = opendir($dir1)) { if ($stud_photo->student_photos_path == "no-images") { } else { if (file_exists($dir1 . $stud_photo->student_photos_path)) { //chmod($dir1.$stud_photo->student_photos_path, 777); unlink($dir1 . $stud_photo->student_photos_path); } } } closedir($dh); if ($this->loadModel($id)->delete()) { $use_model = User::model()->findByPk($model->student_transaction_user_id)->delete(); $stud_photo->delete(); $student_info->delete(); if ($model->student_transaction_student_address_id != null) { $address->delete(); } if ($model->student_transaction_languages_known_id != null) { $lang_known->delete(); } StudentPaidFeesDetails::model()->deleteAll("student_paid_student_id = :studId", array(':studId' => $id)); StudentAcademicRecordTrans::model()->deleteAll("student_academic_record_trans_stud_id = :studId", array(':studId' => $id)); StudentDocsTrans::model()->deleteAll("student_docs_trans_user_id = :studId", array(':studId' => $id)); } if (!isset($_GET['ajax'])) { $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); } } else { throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.'); } }
/** * 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 the ID of the model to be loaded */ public function loadModel($id) { $model = StudentDocsTrans::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function actionStudentdocs() { $id = Yii::app()->user->getState('stud_id'); $model=StudentTransaction::model()->findByPk($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); $stud_qua = new StudentAcademicRecordTrans; $stud_feed = new FeedbackDetailsTable; $studentcertificate=new StudentCertificateDetailsTable; $studentdocstrans=new StudentDocsTrans('mysearch'); $parent = new ParentLogin; $studentdocstrans->unsetAttributes(); // clear any default values if(isset($_GET['StudentDocsTrans'])) $studentdocstrans->attributes=$_GET['StudentDocsTrans']; $this->render('update',array( 'model'=>$model,'info'=>$info,'photo'=>$photo,'address'=>$address,'lang'=>$lang,'studentdocstrans'=>$studentdocstrans, 'stud_qua'=>$stud_qua,'stud_feed'=>$stud_feed,'flag'=>0,'studentcertificate'=>$studentcertificate,'parent'=>$parent )); }
public function actionStudentdocs() { $model=$this->loadModel($_REQUEST['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); $stud_qua = new StudentAcademicRecordTrans; $studentcertificate=new StudentCertificateDetailsTable; $studentdocstrans=new StudentDocsTrans('mysearch'); $parent = ''; $yearModel=new Year; if(isset(Yii::app()->modules['parents'])) $parent = new ParentLogin; $studentdocstrans->unsetAttributes(); // clear any default values if(isset($_GET['StudentDocsTrans'])) $studentdocstrans->attributes=$_GET['StudentDocsTrans']; $this->render('update',array( 'model'=>$model,'info'=>$info,'photo'=>$photo,'address'=>$address,'user'=>$user,'lang'=>$lang,'studentdocstrans'=>$studentdocstrans, 'stud_qua'=>$stud_qua, 'flag'=>0, 'studentcertificate'=>$studentcertificate,'parent'=>$parent,'yearModel'=>$yearModel )); }