/**
  * 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);
 }
 /**
  * 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 = StudentAcademicRecordTrans::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
コード例 #4
0
 /**
  * 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
         $this->loadModel($id)->delete();
         // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
         if (!isset($_GET['ajax'])) {
             $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
         }
     } else {
         if (!Yii::app()->request->isPostRequest) {
             $emp_academic_record = EmployeeAcademicRecordTrans::model()->findAll(array('condition' => 'employee_academic_record_trans_eduboard_id=' . $id));
             $stud_academic_record = StudentAcademicRecordTrans::model()->findAll(array('condition' => 'student_academic_record_trans_eduboard_id=' . $id));
             if (!empty($emp_academic_record) || !empty($stud_academic_record)) {
                 throw new CHttpException(400, 'You can not delete this record because it is used in another table.');
             } else {
                 $this->loadModel($id)->delete();
                 $this->redirect(array('admin'));
             }
         } else {
             throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
         }
     }
 }
コード例 #5
0
 /**
  * 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.');
     }
 }
コード例 #6
0
	public function actionStudentacademicrecord()
	{
	   $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;
	   $stud_qua=new StudentAcademicRecordTrans('mysearch');
	   $parent = new ParentLogin;
	   $stud_qua->unsetAttributes();  // clear any default values
		if(isset($_GET['StudentAcademicRecordTrans']))
			 $stud_qua->attributes=$_GET['StudentAcademicRecordTrans'];

		$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
		));
	}
コード例 #7
0
	public function actionStudentacademicrecord()
	{
	   $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;
	   $stud_qua=new StudentAcademicRecordTrans('mysearch');
	   $parent = '';
	   $yearModel=new Year;
	   if(isset(Yii::app()->modules['parents']))
	   $parent = new ParentLogin;
	   $stud_qua->unsetAttributes();  // clear any default values
		if(isset($_GET['StudentAcademicRecordTrans']))
			 $stud_qua->attributes=$_GET['StudentAcademicRecordTrans'];

		$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
		));
	}