Exemplo n.º 1
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
  */
 public function checkunique()
 {
     $record = ParentLogin::model()->findByAttributes(array('parent_user_name' => $this->user_organization_email_id));
     if (!empty($record)) {
         $this->addError('user_organization_email_id', 'Email ID must be unique');
     }
 }
Exemplo n.º 2
0
 public function authenticate()
 {
     $record = ParentLogin::model()->findByAttributes(array('parent_user_name' => $this->username));
     if ($record === null) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     } else {
         if ($record->parent_password !== md5($this->password . $this->password)) {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         } else {
             $this->_id = $record->parent_id;
             $this->errorCode = self::ERROR_NONE;
         }
     }
     return !$this->errorCode;
 }
Exemplo n.º 3
0
	public function actionChange()
	{
		$model=ParentLogin::model()->findByPk(Yii::app()->user->id);
		$model->setScenario('change');

		// Uncomment the following line if AJAX validation is needed
		 $this->performAjaxValidation($model);

		if(isset($_POST['ParentLogin']))
		{
			$model->attributes=$_POST['ParentLogin'];
			$model->parent_password = md5($model->new_pass.$model->new_pass);
			if($model->save())
				$this->redirect(array('/site/newdashboard'));
		}

		$this->render('change_password',array(
			'model'=>$model,
		));
	}
Exemplo n.º 4
0
$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>

		<td  rowspan='4' width="135px" align="center" style="border:1px solid #74b9f0;">
<img src="college_data/stud_images/<?php echo StudentPhotos::model()->findBypk($student_transaction[0]->student_transaction_student_photos_id)->student_photos_path; ?>" height="147px" width="129px" class="photo" />
		</td>

		<td class="label" style="border:1.5px solid white;"><b>Name</b></td><td><?php echo $StudentInfo->title." ". $StudentInfo->student_first_name." ".$StudentInfo->student_middle_name." ".$StudentInfo->student_last_name;?></td>
		
	/**
	 * 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=ParentLogin::model()->findByPk($id);
		if($model===null)
			throw new CHttpException(404,'The requested page does not exist.');
		return $model;
	}
Exemplo n.º 6
0
			<?php echo $form->textField($info,'student_guardian_occupation',array('size'=>13,'maxlength'=>50)); ?><span class="status">&nbsp;</span>
			<?php echo $form->error($info,'student_guardian_occupation'); ?>
		</div>
  
	</div>

	<div class="row">
		<div class="row-left">        
			<?php echo $form->labelEx($info,'student_guardian_income'); ?>
			<?php echo $form->textField($info,'student_guardian_income',array('size'=>13,'maxlength'=>15)); ?><span class="status">&nbsp;</span>
			<?php echo $form->error($info,'student_guardian_income'); ?>
		</div>      
	</div>
	<div class="row">
		<?php if($model->student_transaction_parent_id != 0) 
			   $parent->parent_user_name = ParentLogin::model()->findByPk($model->student_transaction_parent_id)->parent_user_name;
		?>
		<?php if (isset(Yii::app()->modules['parents'])) { ?>
		<?php echo $form->labelEx($parent,'parent_user_name'); ?>
		<?php echo $form->textField($parent,'parent_user_name',array('size'=>59,'maxlength'=>60)); ?><span class="status">&nbsp;</span>
		<?php echo $form->error($parent,'parent_user_name'); ?>
	</div>
		<?php } ?>

	<div class="row">
		<?php echo $form->labelEx($info,'student_guardian_occupation_address'); ?>
		<?php echo $form->textArea($info,'student_guardian_occupation_address',array('size'=>59,'maxlength'=>100,'style'=>'width:500px;height:80px;margin-bottom:15px')); ?><span class="status">&nbsp;</span>
		<?php echo $form->error($info,'student_guardian_occupation_address'); ?>
	</div>

	<div class="row">
Exemplo n.º 7
0
 public function actionParentlogin()
 {
     $this->layout = 'login_layout';
     if (Yii::app()->user->isGuest) {
         $login = new LoginUser();
         $model = $this->captchaRequired() ? new LoginForm('parentcaptchaRequired') : new LoginForm('parentlogin');
         if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form') {
             echo CActiveForm::validate($model);
             Yii::app()->end();
         }
         if (isset($_POST['LoginForm'])) {
             $model->attributes = $_POST['LoginForm'];
             if ($model->validate() && $model->parentlogin()) {
                 $login->user_id = Yii::app()->user->id;
                 $loginuser = $login->user_id;
                 $res = ParentLogin::model()->findByPk($loginuser);
                 $studlogin = StudentTransaction::model()->findByAttributes(array('student_transaction_parent_id' => $res->parent_id));
                 Yii::app()->user->setState('stud_id', $studlogin->student_transaction_id);
                 Yii::app()->user->setState('parent_id', $loginuser);
                 Yii::app()->user->setState('org_id', $res->parent_organization_id);
                 $login->status = 1;
                 $login->log_in_time = new CDbExpression('NOW()');
                 $login->user_ip_address = $_SERVER['REMOTE_ADDR'];
                 //$login->login_oraganization_id=$res->parent_organization_id;
                 $login->save();
                 $this->redirect(array('parents/parent/studentprofile?id=' . $studlogin->student_transaction_id));
             } else {
                 $this->counter = Yii::app()->session->itemAt('captchaRequired') + 1;
                 Yii::app()->session->add('captchaRequired', $this->counter);
             }
         }
         $this->render('parent_login', array('model' => $model));
     } else {
         if (Yii::app()->user->getState('org_id') != NULL) {
             $this->redirect(array('site/dashboard'));
         } else {
             Yii::app()->user->logout();
             $this->redirect(Yii::app()->homeUrl);
         }
     }
 }
Exemplo n.º 8
0
	public function checkOldPassword($attribute,$params)
	{
	    $record=ParentLogin::model()->findByAttributes(array('parent_password'=>md5($this->current_pass.$this->current_pass)));

	    if($record===null){
		$this->addError($attribute, 'Invalid password');
	    }
	}
	public function actionUpdateprofiletab2($id)
	{
	   $model=$this->loadModel($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);
      	   $studentdocstrans = new StudentDocsTrans;
	   $stud_qua = new StudentAcademicRecordTrans;
	   $studentcertificate=new StudentCertificateDetailsTable;
	   $parent = '';
	   $yearModel=new Year;
	   if(isset(Yii::app()->modules['parents']))
	   $parent = new ParentLogin;

	    $this->performAjaxValidation(array($info,$parent));
		 if(isset($_POST['StudentInfo'])){

		StudentInfo::model()->updateByPk($model->student_transaction_student_id, 
		array(
		'student_guardian_name'=>$_POST['StudentInfo']['student_guardian_name'],
		'student_guardian_relation'=>$_POST['StudentInfo']['student_guardian_relation'],
		'student_guardian_qualification'=>$_POST['StudentInfo']['student_guardian_qualification'],
		'student_guardian_occupation'=>$_POST['StudentInfo']['student_guardian_occupation'],
		'student_guardian_income'=>$_POST['StudentInfo']['student_guardian_income'],
		'student_guardian_occupation_address'=>$_POST['StudentInfo']['student_guardian_occupation_address'],
		'student_guardian_home_address'=>$_POST['StudentInfo']['student_guardian_home_address'],
		'student_guardian_occupation_city'=>$_POST['StudentInfo']['student_guardian_occupation_city'],
		'student_guardian_city_pin'=>$_POST['StudentInfo']['student_guardian_city_pin'],
		'student_guardian_phoneno'=>$_POST['StudentInfo']['student_guardian_phoneno'],
		'student_guardian_mobile'=>$_POST['StudentInfo']['student_guardian_mobile'],
		));
		

		if(($model->student_transaction_parent_id == 0 || $model->student_transaction_parent_id == null) && isset(Yii::app()->modules['parents']))
		{
			$parent->attributes=$_POST['ParentLogin'];
			$parent->parent_user_name = strtolower($parent->parent_user_name);
			$parent->parent_password = md5($parent->parent_user_name.$parent->parent_user_name);
			$parent->created_by = Yii::app()->user->id;
			$parent->creation_date = new CDbExpression('NOW()');
			$parent->parent_organization_id =Yii::app()->user->getState('org_id');
			$parent->save();
			StudentTransaction::model()->updateByPk($id, array('student_transaction_parent_id'=>$parent->parent_id));
		}
		$this->redirect(array('update','id'=>$id,'#'=>'tab_3'));
		}
		
	   $this->render('updateproftab2',array(
			'model'=>$model,'info'=>$info,'photo'=>$photo,'address'=>$address,'lang'=>$lang,'user'=>$user,'studentdocstrans'=>$studentdocstrans, 'stud_qua'=>$stud_qua, 'flag'=>0, 'studentcertificate'=>$studentcertificate,'parent'=>$parent,'yearModel'=>$yearModel
		));
		
	}