当前位置: 首页>>代码示例>>PHP>>正文


PHP StudentInfo::save方法代码示例

本文整理汇总了PHP中StudentInfo::save方法的典型用法代码示例。如果您正苦于以下问题:PHP StudentInfo::save方法的具体用法?PHP StudentInfo::save怎么用?PHP StudentInfo::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StudentInfo的用法示例。


在下文中一共展示了StudentInfo::save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new StudentTransaction();
     $info = new StudentInfo();
     $user = new User();
     $photo = new StudentPhotos();
     $address = new StudentAddress();
     $lang = new LanguagesKnown();
     $auth_assign = new AuthAssignment();
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation(array($info, $model, $user));
     if (!empty($_POST['StudentTransaction']) || !empty($_POST['StudentInfo'])) {
         //print_r($_POST['StudentTransaction']); exit;
         $model->attributes = $_POST['StudentTransaction'];
         $info->attributes = $_POST['StudentInfo'];
         $user->attributes = $_POST['User'];
         $info->student_created_by = Yii::app()->user->id;
         $info->student_creation_date = new CDbExpression('NOW()');
         $info->student_email_id_1 = strtolower($user->user_organization_email_id);
         $info->student_adm_date = date('Y-m-d', strtotime($_POST['StudentInfo']['student_adm_date']));
         $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 = Yii::app()->user->getState('org_id');
         $user->user_type = "student";
         if ($info->save(false)) {
             $user->save(false);
             $address->save(false);
             $lang->save(false);
             $photo->student_photos_path = "no-images";
             $photo->save();
         }
         if (empty($model->student_transaction_batch_id)) {
             $model->student_transaction_batch_id = 0;
         }
         $model->student_transaction_languages_known_id = $lang->languages_known_id;
         $model->student_transaction_student_id = $info->student_id;
         $model->student_transaction_user_id = $user->user_id;
         $model->student_transaction_student_address_id = $address->student_address_id;
         $model->student_transaction_student_photos_id = $photo->student_photos_id;
         $model->student_transaction_organization_id = Yii::app()->user->getState('org_id');
         $model->save();
         $auth_assign->itemname = 'Student';
         $auth_assign->userid = $user->user_id;
         $auth_assign->save();
         StudentInfo::model()->updateByPk($model->student_transaction_student_id, array('student_info_transaction_id' => $model->student_transaction_id));
         $this->redirect(array('admin'));
     } else {
         $this->render('create', array('model' => $model, 'info' => $info, 'user' => $user));
     }
 }
开发者ID:sharmarakesh,项目名称:EduSec2.0.0,代码行数:56,代码来源:StudentTransactionController.php

示例2: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new StudentInfo();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['StudentInfo'])) {
         $model->attributes = $_POST['StudentInfo'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->student_id));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:sharmarakesh,项目名称:EduSec2.0.0,代码行数:17,代码来源:StudentInfoController.php

示例3: actionCreate

	/**
	 * Creates a new model.
	 * If creation is successful, the browser will be redirected to the 'view' page.
	 */
	public function actionCreate()
	{
		$model=new StudentTransaction;
		$info =new StudentInfo;
		$user =new User;
		$photo =new StudentPhotos;
		$address=new StudentAddress;
		$lang=new LanguagesKnown;
		$auth_assign = new AuthAssignment;
		// Uncomment the following line if AJAX validation is needed
		$this->performAjaxValidation(array($info,$model,$user));

		if(!empty($_POST['StudentTransaction']) || !empty($_POST['StudentInfo'] ))
		{
			
		$stud_roll_no = StudentInfo::model()->findAll();
	     if(Yii::app()->controller->action->id=='create'){
		if(empty($stud_roll_no))
		{
			$rollno=$info->student_roll_no=1;
		}
		else
		{
			//$rand=mt_rand(1,2000);
			foreach($stud_roll_no as $s)
			{
                    		$stud[]=$s['student_roll_no'];
				$rollno_m=MAX($stud)+1;
			}		
				if(StudentInfo::model()->exists('student_roll_no='.$rollno_m))
				{
					$rollno=$rollno_m+1;
				}
				else
				{
					$rollno=$rollno_m;
				}			
		}
	      }
	    else
		{
		
		}
		//echo $rollno; exit;
					
		
			
			
			/*$batch_id=$_POST['StudentTransaction']['student_transaction_batch_id'];
			$batch=Batch::model()->findByPk($batch_id);
			$course=$batch->course_id;
			$academic_year=AcademicTerm::model()->findByPk($course);
		
			$model->academic_term_period_id=$academic_year->academic_term_period_id;
			$model->course_id=$batch->course_id;
			$model->academic_term_id=$batch->academic_term_id; */
			$model->attributes=$_POST['StudentTransaction'];			
			$info->attributes=$_POST['StudentInfo'];
			$user->attributes=$_POST['User'];
					
			$info->student_created_by = Yii::app()->user->id;
			$info->student_creation_date = new CDbExpression('NOW()');
			$info->student_email_id_1=strtolower($user->user_organization_email_id);
			$info->student_adm_date = date('Y-m-d',strtotime($_POST['StudentInfo']['student_adm_date']));			
			$info->student_roll_no=$rollno;
			$info->passport_exp_date=date('Y-m-d',strtotime($_POST['StudentInfo']['passport_exp_date']));
			$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_type = "student";
			
			if($info->save(false))  
			{  
				$user->save(false);
				$address->save(false);
				$lang->save(false); 						
				$photo->student_photos_path = "no-images";
				$photo->save();
			}
			//if(empty($model->student_transaction_batch_id))
			//$model->student_transaction_batch_id=0;
			//$model->academic_term_id=$_POST['StudentTransaction']['academic_term_id'];
			//$model->academic_term_period_id=$_POST['StudentTransaction']['academic_term_period_id'];
			$model->course_id=$_POST['StudentTransaction']['course_id'];	  
			$model->student_transaction_languages_known_id= $lang->languages_known_id;
			$model->student_transaction_student_id = $info->student_id;
			$model->student_transaction_user_id = $user->user_id;
			$model->student_transaction_student_address_id = $address->student_address_id;
			$model->student_transaction_student_photos_id = $photo->student_photos_id;
			$flag = Studentstatusmaster::model()->findByAttributes(array('status_name'=>'Regular'))->id;
			$model->student_transaction_detain_student_flag = 1;
			$model->save(false);
			
			StudentInfo::model()->updateByPk($model->student_transaction_student_id, array('student_info_transaction_id'=>$model->student_transaction_id));
			$auth_assign->itemname = 'Student';
//.........这里部分代码省略.........
开发者ID:rinodung,项目名称:EduSec3.0.0,代码行数:101,代码来源:StudentTransactionController.php

示例4: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new StudentTransaction();
     $info = new StudentInfo();
     $user = new User();
     $photo = new StudentPhotos();
     $address = new StudentAddress();
     $lang = new LanguagesKnown();
     $auth_assign = new AuthAssignment();
     $student_fees_master = new StudentFeesMaster();
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation(array($info, $model, $user));
     if (!empty($_POST['StudentTransaction']) || !empty($_POST['StudentInfo'])) {
         //print_r($_POST['StudentTransaction']); exit;
         $model->attributes = $_POST['StudentTransaction'];
         $info->attributes = $_POST['StudentInfo'];
         $user->attributes = $_POST['User'];
         $info->student_created_by = Yii::app()->user->id;
         $info->student_creation_date = new CDbExpression('NOW()');
         $info->student_email_id_1 = strtolower($user->user_organization_email_id);
         $info->student_adm_date = date('Y-m-d', strtotime($_POST['StudentInfo']['student_adm_date']));
         $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 = Yii::app()->user->getState('org_id');
         $user->user_type = "student";
         if ($info->save(false)) {
             $user->save(false);
             $address->save(false);
             $lang->save(false);
             $photo->student_photos_path = "no-images";
             $photo->save();
         }
         if (empty($model->student_transaction_batch_id)) {
             $model->student_transaction_batch_id = 0;
         }
         $model->student_transaction_languages_known_id = $lang->languages_known_id;
         $model->student_transaction_student_id = $info->student_id;
         $model->student_transaction_user_id = $user->user_id;
         $model->student_transaction_student_address_id = $address->student_address_id;
         $model->student_transaction_student_photos_id = $photo->student_photos_id;
         $model->student_transaction_organization_id = Yii::app()->user->getState('org_id');
         $flag = Studentstatusmaster::model()->findByAttributes(array('status_name' => 'Regular'))->id;
         $model->student_transaction_detain_student_flag = $flag;
         $model->save();
         //Fees Assignment to a student=========== By Ravi Bhalodiya=========================================================
         $fees_data = FeesMaster::model()->findByAttributes(array('fees_branch_id' => $model->student_transaction_branch_id, 'fees_academic_term_id' => $model->student_academic_term_period_tran_id, 'fees_academic_term_name_id' => $model->student_academic_term_name_id, 'fees_quota_id' => $model->student_transaction_quota_id));
         if ($fees_data) {
             $fees_master = FeesMasterTransaction::model()->findAll(array('condition' => 'fees_master_id=' . $fees_data->fees_master_id));
             foreach ($fees_master as $list) {
                 $fees_detail = FeesDetailsTable::model()->findByPk($list['fees_desc_id']);
                 $student_fees_master->setIsNewRecord(true);
                 $student_fees_master->student_fees_master_id = null;
                 $student_fees_master->student_fees_master_student_transaction_id = $model->student_transaction_id;
                 $student_fees_master->fees_master_table_id = $fees_data->fees_master_id;
                 $student_fees_master->student_fees_master_details_id = $fees_detail->fees_details_name;
                 $student_fees_master->fees_details_amount = $fees_detail->fees_details_amount;
                 $student_fees_master->student_fees_master_org_id = Yii::app()->user->getState('org_id');
                 $student_fees_master->student_fees_master_created_by = Yii::app()->user->id;
                 $student_fees_master->student_fees_master_creation_date = new CDbExpression('NOW()');
                 $student_fees_master->save();
             }
         }
         //==================================================================================================================
         StudentInfo::model()->updateByPk($model->student_transaction_student_id, array('student_info_transaction_id' => $model->student_transaction_id));
         $auth_assign->itemname = 'Student';
         $auth_assign->userid = $user->user_id;
         $auth_assign->save();
         $this->redirect(array('update', 'id' => $model->student_transaction_id));
     } else {
         $this->render('create', array('model' => $model, 'info' => $info, 'user' => $user));
     }
 }
开发者ID:sharmarakesh,项目名称:edusec-college-management-system,代码行数:78,代码来源:StudentTransactionController.php

示例5: actionAprove

	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))
//.........这里部分代码省略.........
开发者ID:rinodung,项目名称:EduSec3.0.0,代码行数:101,代码来源:StudentRegistrationInfoController.php


注:本文中的StudentInfo::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。