/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new MiscellaneousFeesPaymentTransaction(); // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); if (isset($_POST['MiscellaneousFeesPaymentTransaction'])) { $model->attributes = $_POST['MiscellaneousFeesPaymentTransaction']; $model->student_fees_id = $_REQUEST['id']; $model->miscellaneous_fees_payment_transaction_organization_id = Yii::app()->user->getState('org_id'); if ($model->save()) { $this->redirect(array('view', 'id' => $model->miscellaneous_trans_id)); } //$this->redirect(array('miscellaneousFeesPaymentTransaction/madmin')); } $cash_model = new MiscellaneousFeesPaymentCash('mysearch'); $cash_model->unsetAttributes(); // clear any default values if (isset($_GET['MiscellaneousFeesPaymentCash'])) { $cash_model->attributes = $_GET['MiscellaneousFeesPaymentCash']; } $cheque_model = new MiscellaneousFeesPaymentCheque('mysearch'); $cheque_model->unsetAttributes(); // clear any default values if (isset($_GET['MiscellaneousFeesPaymentCheque'])) { $cheque_model->attributes = $_GET['MiscellaneousFeesPaymentCheque']; } $this->render('create', array('model' => $model, 'cash_model' => $cash_model, 'cheque_model' => $cheque_model)); }
public function actionmis_feesExportToExcel($id) { $cash_data = MiscellaneousFeesPaymentCash::model()->findAll('miscellaneous_fees_payment_cash_student_id=' . $id); $cheque_data = MiscellaneousFeesPaymentCheque::model()->findAll('miscellaneous_fees_payment_cheque_student_id=' . $id); Yii::app()->request->sendFile(date('YmdHis') . '.xlsx', $this->renderPartial('/miscellaneousFeesPaymentTransaction/mis_pdf', array('cash_data' => $cash_data, 'cheque_data' => $cheque_data, 'id' => $id), true)); }
/** * 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 = MiscellaneousFeesPaymentCash::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }