Esempio n. 1
0
 
              </div> <?php 
    }
}), array('header' => 'Рейтингові відмітки', 'htmlOptions' => array('style' => 'width: 200px;'), 'value' => function ($data, $row) {
    /* @var $data Personspeciality */
    $Total = 0.0;
    $doc_val = 0;
    $doc_val_zno = 0;
    if (!$data->edbo && $data->edboID) {
        $data->edbo = EdboData::model()->findByPk($data->edboID);
    }
    // 123
    $ConverAttestat = new ConvertAttestat();
    if ($data->QualificationID == 1) {
        $doc_val = round($data->PointDocValue, 2);
        $post = ConvertAttestat::model()->findall('twelve_p=:twelve_p', array(':twelve_p' => $doc_val));
        $doc_val = (double) $post[0]['two_hundred_p'] * Yii::app()->params['scoreweight_AtestatValue'];
    } else {
        $doc_val = $data->PointDocValue;
    }
    /*$post=ConvertAttestat::model()->find(array(
          'select'=>'two_hundred_p',
          'condition'=>'twelve_p=:twelve_p',
          'params'=>array(':twelve_p'=>'9.4'),
      ));*/
    $doc_val_zno = round($data->ZnoDocValue, 2);
    $doc_name = 'Документ';
    $doc_desc = $data->entrantdoc ? $data->entrantdoc->type->PersonDocumentTypesName : "Відсутній";
    $Total += $doc_val;
    $Total += $data->documentSubject1 ? (double) $data->documentSubject1->SubjectValue * $data->sepciality->ZnoKoef1 : 0.0;
    $Total += $data->documentSubject2 ? (double) $data->documentSubject2->SubjectValue * $data->sepciality->ZnoKoef2 : 0.0;
 /**
  * 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 = ConvertAttestat::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Esempio n. 3
0
 /**
  * Метод формує рейтингові дані (PARTIAL) для конкретної спеціальності.
  * @param Personspeciality[] $models масив моделей, що повертає метод rating_search
  * @return array
  */
 protected function CreateRatingData($models)
 {
     $data = array();
     for ($i = 0; $i < count($models); $i++) {
         $ZNO = 0 + (!empty($models[$i]->documentSubject1) ? $models[$i]->documentSubject1->SubjectValue : 0) + (!empty($models[$i]->documentSubject2) ? $models[$i]->documentSubject2->SubjectValue : 0) + (!empty($models[$i]->documentSubject3) ? $models[$i]->documentSubject3->SubjectValue : 0);
         $ExamsPoints = 0 + $models[$i]->Exam1Ball + $models[$i]->Exam2Ball + $models[$i]->Exam3Ball;
         $quotaID = intval($models[$i]->QuotaID);
         $isOutOfComp = intval($models[$i]->isOutOfComp);
         $info_row['PIB'] = $models[$i]->NAME;
         $info_row['Points'] = $models[$i]->ComputedPoints;
         $info_row['ZNO'] = $ZNO;
         $info_row['AdditionalBall'] = $models[$i]->AdditionalBall > 0.0 ? 0.0 + $models[$i]->AdditionalBall : 0.0;
         // Змінено для бакалаврів (вираховується по 200бальній
         $info_row['DocPoints'] = $models->QualificationID == 1 ? $models[$i]->ZnoDocValue = ConvertAttestat::model()->findall('twelve_p=:twelve_p', array(':twelve_p' => $models[$i]->ZnoDocValue)) : $models[$i]->ZnoDocValue;
         //$info_row['DocPoints'] = $models[$i]->ZnoDocValue;
         $info_row['ExamsPoints'] = $ExamsPoints;
         $info_row['OlympsPoints'] = 0 + (!empty($models[$i]->olymp) ? $models[$i]->olymp->OlympiadAwardBonus : 0);
         $info_row['CoursesPoints'] = 0 + $models[$i]->CoursedpBall * Yii::app()->params['scoreweight_CoursedpBall'];
         $info_row['isPZK'] = $isOutOfComp ? 'V' : '—';
         $info_row['isExtra'] = $models[$i]->isExtraEntry ? 'V' : '—';
         $info_row['isQuota'] = $quotaID > 0 ? 'V' : '—';
         $info_row['isOriginal'] = !$models[$i]->isCopyEntrantDoc ? 'V' : '—';
         $info_row['AnyOriginal'] = $models[$i]->AnyOriginal && $models[$i]->isCopyEntrantDoc ? 'V' : '—';
         $info_row['idPersonSpeciality'] = $models[$i]->idPersonSpeciality;
         $info_row['priority'] = $models[$i]->priority;
         $data[$i] = $info_row;
     }
     return $data;
 }