/** * 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) { $languae_known = LanguagesKnown::model()->findAll(array('condition' => 'languages_known1=' . $id . ' OR languages_known2=' . $id . ' OR languages_known3=' . $id . ' OR languages_known4=' . $id)); if (!empty($languae_known)) { throw new CHttpException(400, 'You can not delete this record because it is used in another table.'); } else { $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')); } }
</style> <?php $StudentInfo = StudentInfo::model()->findByPk($student_transaction[0]->student_transaction_student_id); $AcademicTermPeriod = AcademicTermPeriod::model()->findByPk($student_transaction[0]->academic_term_period_id); $AcademicTerm = AcademicTerm::model()->findByPk($student_transaction[0]->academic_term_id); if($student_transaction[0]->student_transaction_nationality_id != null) $Nationality = Nationality::model()->findByPk($student_transaction[0]->student_transaction_nationality_id); else $Nationality = new Nationality; $Batch = Batch::model()->findByPk($student_transaction[0]->student_transaction_batch_id); $Course = Course::model()->findByPk($student_transaction[0]->course_id); if($student_transaction[0]->student_transaction_languages_known_id != null) $LanguagesKnown = LanguagesKnown::model()->findByPk($student_transaction[0]->student_transaction_languages_known_id); if($student_transaction[0]->student_transaction_student_address_id != null) $StudentAddress = StudentAddress::model()->findByPk($student_transaction[0]->student_transaction_student_address_id); else $StudentAddress = new StudentAddress; if($student_transaction[0]->student_transaction_parent_id != null || $student_transaction[0]->student_transaction_parent_id != 0) $parent = ParentLogin::model()->findByPk($student_transaction[0]->student_transaction_parent_id); else $parent = new ParentLogin; ?> <h3 class="title">Student Detail</h3> <table class="no_border"> <tr>
/** * 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 = LanguagesKnown::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * 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) { $languages_known1 = LanguagesKnown::model()->findAll(array('condition' => 'languages_known1=' . $id)); $languages_known2 = LanguagesKnown::model()->findAll(array('condition' => 'languages_known2=' . $id)); if (!empty($languages_known1) || !empty($languages_known2)) { 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.'); } } }
/** * 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.'); } }
} if ($employee_transaction[0]->employee_transaction_religion_id != null) { $Religion = Religion::model()->findByPk($employee_transaction[0]->employee_transaction_religion_id); } else { $Religion = new Religion(); } $Shift = Shift::model()->findByPk($employee_transaction[0]->employee_transaction_shift_id); $EmployeeDesignation = EmployeeDesignation::model()->findByPk($employee_transaction[0]->employee_transaction_designation_id); if ($employee_transaction[0]->employee_transaction_nationality_id != null) { $Nationality = Nationality::model()->findByPk($employee_transaction[0]->employee_transaction_nationality_id); } else { $Nationality = new Nationality(); } $Department = Department::model()->findByPk($employee_transaction[0]->employee_transaction_department_id); if ($employee_transaction[0]->employee_transaction_languages_known_id != null) { $LanguagesKnown = LanguagesKnown::model()->findByPk($employee_transaction[0]->employee_transaction_languages_known_id); } $Organization = Organization::model()->findByPk($employee_transaction[0]->employee_transaction_organization_id); if ($employee_transaction[0]->employee_transaction_emp_address_id != null) { $EmployeeAddress = EmployeeAddress::model()->findByPk($employee_transaction[0]->employee_transaction_emp_address_id); } else { $EmployeeAddress = new EmployeeAddress(); } ?> <h3>Employee Detail</h3> <h4>Personal Info</h4> <table border="1" width="200px"> <tr> <td> <label> Employee ID </label> </td>
public function actionStudentperformance() { $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; $stud_feed=new FeedbackDetailsTable('mysearch'); $parent = new ParentLogin; $stud_feed->unsetAttributes(); // clear any default values if(isset($_GET['FeedbackDetailsTable'])) $stud_feed->attributes=$_GET['FeedbackDetailsTable']; $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 )); }
), 'htmlOptions'=>array( 'size'=>13, ), )); ?><span class="status"> </span> <?php echo $form->error($info,'visa_exp_date'); ?> </div> <div class="row-right"> <table style="width:auto"> <tr> <td style='max-width: 144px;'> <?php $data=LanguagesKnown::model()->findAll(array('condition'=>'languages_known_id='.$model->student_transaction_languages_known_id)); foreach($data as $d=>$row) { $langss=$row['languages_known1']; } $langArr = array(); $as=explode(',',$langss); foreach($as as $ai) { $langArr[$ai] = array('selected'=>true); } echo $form->labelEx($lang,'Languages Known',array('style'=>'width:143px'));
if (LanguagesKnown::model()->findByPk($langknownid)->languages_known3 != 0) { echo Languages::model()->findByPk(LanguagesKnown::model()->findByPk($langknownid)->languages_known3)->languages_name; echo "</br>"; } else { echo "N/A.</br>"; } ?> </div> </div> <div class="rowv"> <?php echo '<lable><b>Language 4 :</b></lable>'; ?> <div class="rown"> <?php if (LanguagesKnown::model()->findByPk($langknownid)->languages_known4 != 0) { echo Languages::model()->findByPk(LanguagesKnown::model()->findByPk($langknownid)->languages_known4)->languages_name; echo "</br>"; } else { echo "N/A.</br>"; } ?> </div> </div> </div>
/** * 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) { $model = $this->loadModel($id); $employee_info = EmployeeInfo::model()->findByPk($model->employee_transaction_employee_id); if($model->employee_transaction_emp_address_id != null) $address = EmployeeAddress::model()->findByPk($model->employee_transaction_emp_address_id); $emp_photo = EmployeePhotos::model()->findByPk($model->employee_transaction_emp_photos_id); if($model->employee_transaction_languages_known_id != null) $lang_known = LanguagesKnown::model()->findByPk($model->employee_transaction_languages_known_id); $dir1 = Yii::getPathOfAlias('webroot').'/college_data/emp_images/'; if($dh = opendir($dir1)) { if($emp_photo->employee_photos_path == "no-images") { } else { if(file_exists($dir1.$emp_photo->employee_photos_path)) { chmod($dir1.$emp_photo->employee_photos_path, 777); unlink($dir1.$emp_photo->employee_photos_path); } } } closedir($dh); if($this->loadModel($id)->delete()){ $use_model = User::model()->findByPk($model->employee_transaction_user_id)->delete(); $emp_photo->delete(); $employee_info->delete(); if($model->employee_transaction_emp_address_id != null) $address->delete(); if($model->employee_transaction_languages_known_id != null) $lang_known->delete(); } if(!isset($_GET['ajax'])) $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); }
/** * 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) { $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); $yearModel=new Year; //$assign_comp_model = assignCompanyUserTable::model()->findByPk($ass_comp->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($model->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(); } //echo $model->student_transaction_student_id; exit; // 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')); }
public function actionDelete($id) { if (Yii::app()->request->isPostRequest) { // we only allow deletion via POST request $model = $this->loadModel($id); $employee_info = EmployeeInfo::model()->findByPk($model->employee_transaction_employee_id); if ($model->employee_transaction_emp_address_id != null) { $address = EmployeeAddress::model()->findByPk($model->employee_transaction_emp_address_id); } $emp_photo = EmployeePhotos::model()->findByPk($model->employee_transaction_emp_photos_id); if ($model->employee_transaction_languages_known_id != null) { $lang_known = LanguagesKnown::model()->findByPk($model->employee_transaction_languages_known_id); } $dir1 = Yii::getPathOfAlias('webroot') . '/emp_images/'; if ($dh = opendir($dir1)) { if ($emp_photo->employee_photos_path == "no-images") { } else { if (file_exists($dir1 . $emp_photo->employee_photos_path)) { chmod($dir1 . $emp_photo->employee_photos_path, 777); unlink($dir1 . $emp_photo->employee_photos_path); } } } closedir($dh); if ($this->loadModel($id)->delete()) { $use_model = User::model()->findByPk($model->employee_transaction_user_id)->delete(); $emp_photo->delete(); $employee_info->delete(); if ($model->employee_transaction_emp_address_id != null) { $address->delete(); } if ($model->employee_transaction_languages_known_id != null) { $lang_known->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 { throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.'); } }
public function actionAprove($id) { $model= StudentRegistrationInfo::model()->findByPk($id); $info = new StudentInfo; $stud_trans = new StudentTransaction; $user =new User; $photo =new StudentPhotos; $address=new StudentAddress; $lang=new LanguagesKnown; $ass_comp = new assignCompanyUserTable; $auth_assign = new AuthAssignment; $qualification=new StudentAcademicRecordTrans; if(isset($_REQUEST['StudentRegistrationInfo'])) { $org_id = $model->organization_id; if($model->student_status==1){ $acd = Yii::app()->db->createCommand() ->select("academic_term_id,academic_term_name,academic_term_period_id") ->from('academic_term') ->where('current_sem=1 and academic_term_name =1 and academic_term_organization_id='.$org_id) ->queryAll(); if(!$acd){ Yii::app()->user->setFlash('notice','Semester-1 is not an Active semester'); $this->redirect(array('admin')); } $info->student_dtod_regular_status = 'Regular'; } elseif($model->student_status==2){ $acd = Yii::app()->db->createCommand() ->select("academic_term_id,academic_term_name,academic_term_period_id") ->from('academic_term') ->where('current_sem=1 and academic_term_name =3 and academic_term_organization_id='.$org_id) ->queryAll(); if(!$acd){ Yii::app()->user->setFlash('notice','Semester-3 is not an Active semester'); $this->redirect(array('admin')); } $info->student_dtod_regular_status = 'DTOD'; } $info->title = $model->student_title; $info->student_merit_no = $model->student_merit_no; $info->student_first_name = $model->student_first_name; $info->student_middle_name =$model->student_middle_name; $info->student_last_name = $model->student_last_name; $info->student_father_name = $model->student_father_name; $info->student_mother_name = $model->student_mother_name; $info->student_dob = $model->student_dob; $info->student_adm_date = new CDbExpression('NOW()'); $info->student_birthplace = $model->student_place_of_birth; $info->student_gender = $model->student_gender; $info->student_email_id_1 = $model->student_email_id; $info->student_mobile_no = $model->student_mobile; $info->student_created_by = Yii::app()->user->id; $info->student_creation_date = new CDbExpression('NOW()'); $user->user_organization_email_id = strtolower($info->student_email_id_1); $user->user_password = md5($info->student_email_id_1.$info->student_email_id_1); $user->user_created_by = Yii::app()->user->id; $user->user_creation_date = new CDbExpression('NOW()'); $user->user_organization_id = $org_id; $user->user_type = "student"; $photo->student_photos_path = $model->student_photo; $address->student_address_c_line1 = $model->student_address_c_line1; $address->student_address_c_line2 = $model->student_address_c_line2; $address->student_address_c_taluka = $model->student_address_c_taluka; $address->student_address_c_district = $model->student_address_c_district; $address->student_address_c_country = $model->student_address_c_country; $address->student_address_c_city = $model->student_address_c_city; $address->student_address_c_pin = $model->student_address_c_pin ; $address->student_address_c_state = $model->student_address_c_state; $address->student_address_p_line1 = $model->student_address_p_line1; $address->student_address_p_line2 = $model->student_address_p_line2; $address->student_address_p_taluka = $model->student_address_p_taluka; $address->student_address_p_district = $model->student_address_p_district; $address->student_address_p_country = $model->student_address_p_country; $address->student_address_p_city = $model->student_address_p_city; $address->student_address_p_pin = $model->student_address_p_pin ; $address->student_address_p_state = $model->student_address_p_state; $address->student_address_phone = $model->student_phoneno; $address->student_address_mobile = $model->student_mobile; if($info->save(false)){ $user->save(false); $photo->save(false); $address->save(false); $lang->save(false); $stud_trans->student_transaction_user_id = $user->user_id; $stud_trans->student_transaction_student_id = $info->student_id; //$stud_trans->student_transaction_branch_id = $model->student_branch_id; if(!empty($model->student_category_id)) $stud_trans->student_transaction_category_id = $model->student_category_id; $stud_trans->student_transaction_organization_id = $org_id; $stud_trans->student_transaction_student_address_id = $address->student_address_id; $stud_trans->student_transaction_languages_known_id= $lang->languages_known_id; $stud_trans->student_transaction_detain_student_flag='5'; $stud_trans->student_transaction_student_photos_id = $photo->student_photos_id; $stud_trans->student_transaction_branch_id=$_POST['StudentRegistrationInfo']['student_branch_id']; $stud_trans->student_academic_term_period_tran_id = $acd[0]['academic_term_period_id']; $stud_trans->student_academic_term_name_id = $acd[0]['academic_term_id']; $stud_trans->save(false); StudentInfo::model()->updateByPk($stud_trans->student_transaction_student_id, array('student_info_transaction_id'=>$stud_trans->student_transaction_id)); $org_data = Organization::model()->findByPk($org_id); $org_name = $org_data->organization_name; $org_arr = explode(' ',$org_name); $suffix_lab = ''; foreach($org_arr as $list) $suffix_lab .= $list[0]; $bizrule = 'return Yii::app()->user->getState("org_id")=='.$org_id.";"; $var_data = serialize(Yii::app()->user->getState('org_id')); $auth_assign->itemname = 'Student of '.$suffix_lab; $auth_assign->userid = $user->user_id; $auth_assign->bizrule = $bizrule; $auth_assign->data = $var_data; $auth_assign->save(); $ass_comp->assign_user_id = $user->user_id; $ass_comp->assign_org_id = $org_id; $ass_comp->assign_created_by = Yii::app()->user->id; $ass_comp->assign_creation_date = new CDbExpression('NOW()'); $ass_comp->save(); StudentRegistrationInfo::model()->updateByPk($id, array( 'student_aproved'=>'1', )); $this->redirect(array('admin')); } } $this->render('aprove',array('model'=>$model)); }