public function assignmentsearch($assignment,$submitflag)
	{
		
		$query = '';
		$criteria=new CDbCriteria;
		$criteria->compare('student_transaction_id',$this->student_transaction_id);
		if($submitflag==1){
		$criteria->alias = 'st';
		$criteria->select = 'student_transaction_id,student_roll_no,student_last_name,student_first_name,assignment_trans_document,assignment_trans_creation_date';
		$criteria->join='INNER JOIN assignment_trans ON assignment_trans_student_id=st.student_transaction_id INNER JOIN student_info ON student_info.student_id =st.student_transaction_student_id';
		$criteria->condition = $query."assignment_trans.assignment_trans_assignment_id=".$assignment;
		$criteria->compare('student_roll_no',$this->student_roll_no,true);
		$criteria->compare('student_last_name',$this->student_last_name,true);
		$criteria->compare('student_first_name',$this->student_first_name,true);
		$criteria->compare('assignment_trans_creation_date',$this->dbDateSearch($this->assignment_trans_creation_date),true);
		$stu_data = new CActiveDataProvider(get_class($this), array(
		'criteria'=>$criteria,
		'sort'=>array(
		'defaultOrder'=>'student_roll_no',
		),
		));
		}
		else
		{
			$criteria->with = array('Rel_Stud_Info');
			$criteria->select = 'student_transaction_id';
			$criteria->distinct = true;
			$criteria->alias = 'st';
			$criteria->condition = $query." student_transaction_detain_student_flag=".Studentstatusmaster::model()->findByAttributes(array('status_name'=>'Regular'))->id." AND ".Studentstatusmaster::model()->findByAttributes(array('status_name'=>'Rejoin'))->id.' and student_transaction_id NOT IN(select assignment_trans_student_id from  assignment_trans where assignment_trans.assignment_trans_assignment_id='.$assignment.')';	
		$criteria->compare('Rel_Stud_Info.student_first_name',$this->student_first_name,true);
		$criteria->compare('Rel_Stud_Info.student_roll_no',$this->student_roll_no,true);
		$criteria->compare('Rel_Stud_Info.student_middle_name',$this->student_middle_name,true);
		$criteria->compare('Rel_Stud_Info.student_last_name',$this->student_last_name,true);	
		$stu_data = new CActiveDataProvider(get_class($this), array(
		'criteria'=>$criteria,
		));
		}
	

		return $stu_data;
	}
Ejemplo n.º 2
0
		$if_detain = LeftDetainedPassStudentTable::model()->findByAttributes(array('student_id'=>$stud_trans[0]['student_transaction_id'],'sem'=>$data['academic_term_id']));
		if(!empty($if_detain))
		{?>
			<tr class="<?php echo $class;?>">
				<td><?php echo ++$i;?></td>
				<td><?php echo AcademicTermPeriod::model()->findByPk($if_detain['academic_term_period_id'])->academic_term_period; ?></td>
				<td><?php echo "Sem-".AcademicTerm::model()->findByPk($if_detain['sem'])->academic_term_name; ?></td>
				<td>Detain</td>
			</tr>
		<?php $m++; 
		}
		$if_stud_arch = StudentArchiveTable::model()->findByAttributes(array('student_archive_stud_tran_id'=>$stud_trans[0]['student_transaction_id'],'student_archive_ac_t_n_id'=>$data['academic_term_id']));
		if($if_stud_arch)
		{
			$st = Studentstatusmaster::model()->findByPk($if_stud_arch->student_archive_status)->status_name;	
		?>
			<tr class="<?php echo $class;?>">
				<td><?php echo ++$i; ?></td>
				<td><?php echo AcademicTermPeriod::model()->findByPk($if_stud_arch['student_archive_ac_t_p_id'])->academic_term_period; ?></td>
				<td><?php echo "Sem-".AcademicTerm::model()->findByPk($if_stud_arch['student_archive_ac_t_n_id'])->academic_term_name; ?></td>
				<td><?php echo $st;?></td>
			</tr>
				
		<?php $m++; }
	
	}
	

?>
 /**
  * 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 = Studentstatusmaster::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 4
0
echo $form->labelEx($model, 'student_academic_term_name_id');
?>
			<?php 
echo $form->dropDownList($model, 'student_academic_term_name_id', $acdterm, array('prompt' => 'Select Semester'));
?>
<span class="status">&nbsp;</span>
			<?php 
echo $form->error($model, 'student_academic_term_name_id');
?>
		</div>
	      <div class="row-right">
			<?php 
echo $form->labelEx($model, 'student_transaction_detain_student_flag');
?>
			<?php 
echo $form->dropDownList($model, 'student_transaction_detain_student_flag', CHtml::listData(Studentstatusmaster::model()->findAll(), 'id', 'status_name'), array('prompt' => 'Student Status'));
?>
<span class="status">&nbsp;</span>
			<?php 
echo $form->error($model, 'student_transaction_detain_student_flag');
?>
		</div>		

 	</div>

	<div class="row">
	      <div class="row-left">
			<?php 
echo $form->labelEx($model, 'student_transaction_course_id');
?>
			<?php 
Ejemplo n.º 5
0
    $data = CHtml::listData(AcademicTerm::model()->findAll(array('condition' => 'academic_term_period_id=' . $_REQUEST['StudentTransaction']['student_academic_term_period_tran_id'])), 'academic_term_id', 'academic_term_name');
    echo $form->dropDownList($model, 'student_academic_term_name_id', $data, array('empty' => 'Select Semester'));
} else {
    ?>
		<?php 
    echo $form->dropDownList($model, 'student_academic_term_name_id', array(), array('empty' => 'Select Semester'));
    ?>
	<?php 
}
?>
	
		<?php 
echo $form->labelEx($model, 'student_transaction_detain_student_flag');
?>
		<?php 
echo $form->dropDownList($model, 'student_transaction_detain_student_flag', CHtml::listData(Studentstatusmaster::model()->findAll(), 'id', 'status_name'), array('empty' => 'Select Status', 'tabindex' => 1));
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton('Search', array('class' => 'submit'));
?>
	</div>

<?php 
$this->endWidget();
?>

</div><!-- search-form -->
	/**
	 * 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';
			$auth_assign->userid = $user->user_id;
			$auth_assign->bizrule = '';
			$auth_assign->data = '';
			$auth_assign->save(true);	
			$this->redirect(array('update','id'=>$model->student_transaction_id));
		} //end of isset if
		else
		{
			$this->render('create',array(
			'model'=>$model,'info'=>$info,'user'=>$user
			));
		}
	}
			  {
			     $sName = AcademicTerm::model()->findByPk($l['sem']);
			     if($sName)
				$semester = $sName->academic_term_name;
			     else
				$semester = '-';
			     $sStatus = Studentstatusmaster::model()->findByPk($l['status_id'])->status_name;
			     echo 'SEM- '.$semester."-".$sStatus.'<br />';
			  
			  }			
		    }
		  }
		}		
	}
	echo '</td>';
		$stud_tran=StudentTransaction::model()->findByPk($s['student_transaction_id']);
		$status=Studentstatusmaster::model()->findByAttributes(array('id'=> $stud_tran->student_transaction_detain_student_flag));
		$sem=AcademicTerm::model()->findByAttributes(array('academic_term_id'=> $stud_tran->student_academic_term_name_id ));
	echo '<td style=width:200px;>';
			echo 'SEM-'.$sem->academic_term_name .'  '.$status->status_name ;
	echo '</td>';	
	echo '</tr>';
   }
	
	echo "</table>";
}
?>
</div>
</div>
</div>
 /**
  * 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));
     }
 }