public function getPrintUrl($personid, $specid) { // http://10.1.103.26:8080/request_report-1.0/magistr.jsp?PersonID=197&PersonSpecialityID=205 - магистры // http://10.1.103.26:8080/request_report-1.0/bachelor.jsp?PersonID=197&PersonSpecialityID=205 - бакалавры $model = $this->getUserModel(); if (empty($model->syspk) || empty($model->syspk->printIP)) { throw new Exception("Необхідно визначити адресу серверу друку документів!"); } $ip = $model->syspk->printIP; $spec = Personspeciality::model()->find("idPersonSpeciality={$specid}"); if (empty($spec)) { throw new Exception("Необхідно визначити спеціальність!"); } if ($spec->QualificationID > 1) { return "http://" . $ip . ":8080/request_report-1.0/magistr.jsp?PersonID={$personid}&PersonSpecialityID={$specid}&iframe=true&width=1024&height=600"; } else { return "http://" . $ip . ":8080/request_report-1.0/bachelor.jsp?PersonID={$personid}&PersonSpecialityID={$specid}&iframe=true&width=1024&height=600"; } return ""; }
?> </TD> <TD class="pv"> <?php echo iconv("utf-8", "windows-1251", $list[$i]['isExtra']); ?> </TD> <TD class="original"> <?php echo iconv("utf-8", "windows-1251", $list[$i]['isOriginal']); ?> </TD> <TD class="wave"> <?php if ($contacts) { $model = Personspeciality::model()->findByPk($list[$i]['idPersonSpeciality']); $array_contacts = array(); foreach ($model->person->contacts as $mcontact) { $array_contacts[] = iconv("utf-8", "windows-1251", 'т:' . $mcontact->Value); } echo implode(';<br/>', $array_contacts); } ?> </TD> </TR> <?php } // end for $list } // end foreach $data ?>
public function getPrintPriceUrl($specid) { $model = $this->getUserModel(); if (empty($model->syspk) || empty($model->syspk->printIP)) { throw new Exception("Необхідно визначити адресу серверу друку документів!"); } $ip = $model->syspk->printIP; $spec = Personspeciality::model()->find("idPersonSpeciality={$specid}"); if (empty($spec)) { throw new Exception("Необхідно визначити спеціальність!"); } return "http://" . $ip . ":8080/request_report-1.0/price.jsp?PersonSpecialityID={$specid}&iframe=true&width=1024&height=600"; return ""; }
public function CoursedpBall() { $model = Personspeciality::model()->findBySql("SELECT `CoursedpBall` FROM `personspeciality` WHERE `idPersonSpeciality` = {$this->idPersonSpeciality}"); if (!empty($model)) { return $model->CoursedpBall; } return ""; }
public function actionUtil() { $model = new PersonSpecialityView('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['PersonSpecialityView'])) { $model->attributes = $_GET['PersonSpecialityView']; $out = ""; if (isset($_GET['renum'])) { $c = new CDbCriteria(); $c->compare("SepcialityID", $model->SepcialityID); $c->order = "CreateDate"; $pspes = Personspeciality::model()->findAll($c); foreach ($pspes as $i => $obj) { $out .= "RequestNumber: " . $obj->RequestNumber . " chaget to: " . ($i + 1) . "<br>"; $obj->RequestNumber = $i + 1; if ($obj->QualificationID > 1 && $obj->SepcialityID != 70686 && $obj->SepcialityID != 90661) { $obj->scenario = "SHORTFORM"; //$obj->CausalityID = 100; } if (!$obj->save()) { debug(print_r($obj->getErrors(), true)); } } } $this->render('sverka', array("model" => $model)); if (!empty($out)) { echo $out; } } else { $this->render('util'); } }
public function actionDocsend() { if (isset($_REQUEST["idSpeciality"])) { $model = Personspeciality::model()->findAll("SepcialityID = " . $_REQUEST["idSpeciality"] . " and StatusID in (7)"); } elseif (isset($_REQUEST["idQualification"])) { $model = Personspeciality::model()->findAll("QualificationID = " . $_REQUEST["idQualification"] . " and StatusID in (7)"); } elseif (!isset($_REQUEST["idPersons"]) || trim($_REQUEST["idPersons"]) == "") { $model = Personspeciality::model()->findAll("StatusID = 7"); } $res = array(); if (!isset($_REQUEST["idPersons"]) || trim($_REQUEST["idPersons"]) == "") { foreach ($model as $item) { $res[] = $item->person->idPerson; } } else { $model = Person::model()->findAll("idPerson in (" . $_REQUEST["idPersons"] . ")"); foreach ($model as $item) { $res[] = $item->idPerson; } } $this->render("proces/doc", array("res" => json_encode($res))); }
/** * 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 = Personspeciality::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * Метод повертає архів із фото усіх зарахованих персон для факультету з ID = $id */ public function actionGetphotozip() { $id = Yii::app()->request->getParam('id', 0); if (!is_numeric($id)) { throw new CHttpException(400, 'Помилка: ID має бути цілим числом.'); } $faculty = Facultets::model()->findByPk($id); if (!$faculty) { throw new CHttpException(400, 'Факультет з ID=' . $id . ' не знайдено.'); } $criteria = new CDbCriteria(); $criteria->with = array('person', 'sepciality', 'sepciality.facultet'); $criteria->compare('sepciality.FacultetID', $id); $criteria->compare('StatusID', 7); $criteria->together = true; $models = Personspeciality::model()->findAll($criteria); if (count($models) == 0) { throw new CHttpException(400, 'Помилка: немає даних.'); } $zipname = 'Facultet_' . $models[0]->sepciality->FacultetID . '.zip'; $zip = new ZipArchive(); $zip->open($zipname, ZipArchive::CREATE); $def_path = Yii::app()->getBasePath() . '/../images/Photos/'; $count = 0; foreach ($models as $model) { $file_entity = $def_path . $model->person->PhotoName; if (file_exists($file_entity)) { $file_ext = substr(strrchr($file_entity, '.'), 1); $res = $zip->addFile($file_entity, $model->PersonID . '.' . $file_ext); if ($res) { $count++; } } } $zip->close(); if ($count > 0) { $this->redirect(Yii::app()->CreateUrl($zipname)); } else { throw new CHttpException(400, 'Помилка: не знайдено жодного файлу фотографії.'); } }
width: 230px; } li.person-item-edboid { width: 200px; } li.person-item-msg { width: 500px; } </style> <?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $requests = Personspeciality::model()->findAll("SepcialityID = {$specid}"); echo "<div> Обрано " . count($requests) . " заявок. </div>"; $i = 0; foreach ($requests as $item) { $msg = ""; try { $res = WebServices::getPersonBaseEducations($item->person->codeU); $res = CJSON::decode($res); if (is_array($res)) { $msg .= ""; foreach ($res as $obj) { $obj = (object) $obj; if (!(strpos($obj->universityFullName, "Запорізький національний університет") > 0)) { $msg .= $obj->personEducationFormName . " : " . $obj->personEducationPaymentTypeName . " : " . $obj->qualificationName . " : " . $obj->specDirectionName . " : " . $obj->universityFullName; } else { $msg = " немає ";
public function valididateCopyEntrantDoc($attributes) { if ($this->isCopyEntrantDoc == 1) { return true; } $count = Personspeciality::model()->count("PersonID = {$this->PersonID} and isCopyEntrantDoc = 0 and EntrantDocumentID = {$this->EntrantDocumentID} "); if ($this->isNewRecord) { if ($count > 0) { $this->addError($attributes, "В іншій заявці вже вказано оригінал документу!"); return false; } } else { $model = Personspeciality::model()->findByPk($this->idPersonSpeciality); if ($model->isCopyEntrantDoc == 1 && $count > 0) { $this->addError($attributes, "В іншій заявці вже вказано оригінал документу!"); return false; } } return true; }
public function actionRatinginfolinks6() { $criteria = new CDbCriteria(); $criteria->with = array('eduform'); $criteria->together = true; //$criteria->addCondition('eduform.idPersonEducationForm IN (1,2)'); $criteria->addCondition('substr(SpecialityClasifierCode,1,1) LIKE "6"'); $criteria->addCondition('idSpeciality NOT IN(162738)'); $criteria->select = array('idSpeciality', new CDbExpression("concat_ws(' '," . "SpecialityClasifierCode," . "(case substr(SpecialityClasifierCode,1,1) when '6' then " . "SpecialityDirectionName else SpecialityName end)," . "(case SpecialitySpecializationName when '' then '' " . " else concat('(',SpecialitySpecializationName,')') end)" . ",',',concat('форма: ',eduform.PersonEducationFormName)) AS tSPEC")); $criteria->order = 'SpecialityName ASC,SpecialityDirectionName ASC,SpecialityClasifierCode ASC, eduform.PersonEducationFormName ASC'; echo '<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Інформація про подані абітурієнтами заяви (ОКР "Бакалавр")</title> </head><body>'; echo "<p style='text-align: right; font-family: \"Courier New\"; font-size: 8pt;'>Дані сформовано " . date('d.m.Y H:i') . "</p>"; echo "<h1 style='text-align: center;'>Інформація про подані абітурієнтами заяви</h1>"; echo "<h3 style='text-align: center;'>Заяви на ОКР \"Бакалавр\"</h3>"; echo "<ul>"; foreach (Specialities::model()->findAll($criteria) as $spec) { $href = Yii::app()->createAbsoluteUrl("/rating/rating/ratinginfo", array('Personspeciality[SepcialityID]' => $spec->idSpeciality, 'Personspeciality[rating_order_mode]' => 1)); echo "<li><a href='" . $href . "' target='_blank'>" . $spec->tSPEC . " (" . Personspeciality::model()->count('(SepcialityID=' . $spec->idSpeciality . ' AND StatusID IN (1,4,5,7,8))') . ")</a></li>"; } echo "</ul><footer style='text-align: center;'>ЗНУ, Лабораторія ІС та КТ</footer>" . '<!--ZNUstat--><center> <script> document.writeln(\'<a href="http://sites.znu.edu.ua/counter/statistic1.php?site_id=10&time=year&groupby=daily&t=\'+Math.random()+\'"><img src="http://sites.znu.edu.ua:8000/counter/count.php?id=10&t=\'+Math.random()+\'"></a>\'); </script> <noscript> <a href="http://sites.znu.edu.ua/counter/statistic1.php?site_id=10&time=year&groupby=daily"><img src="http://sites.znu.edu.ua:8000/counter/count.php?id=10"></a> </noscript> </center><!--/ZNUstat-->' . "</body></html>"; }
/** * Формування рейтингових даних для цільовиків. * @param integer $mode 0 - цільовики, 1 - пільговики, 2 - бюджетники, 3 - контрактники, 4 - решта * @param boolean $sort_status сортувати за статусом? * @return Personspeciality[] */ public function rating_search($mode, $sort_status = false) { if (!is_numeric($this->SepcialityID)) { return array(); } Yii::import('application.models.Qualifications'); $spec_model = Specialities::model()->findByPk($this->SepcialityID); $first_symbol = mb_substr($spec_model->SpecialityClasifierCode, 0, 1, 'utf-8'); $is_spec_mag = $first_symbol == '7' || $first_symbol == '8'; if (!$spec_model) { return array(); } $criteria = new CDbCriteria(); //З якими відношеннями маємо справу $with_rel = array(); array_push($with_rel, 'sepciality'); array_push($with_rel, 'person'); array_push($with_rel, 'olymp'); array_push($with_rel, 'entrantdoc'); array_push($with_rel, 'educationForm'); array_push($with_rel, 'edbo'); array_push($with_rel, 'documentSubject1'); array_push($with_rel, 'documentSubject2'); array_push($with_rel, 'documentSubject3'); array_push($with_rel, 'documentSubject1.subject1'); array_push($with_rel, 'documentSubject2.subject2'); array_push($with_rel, 'documentSubject3.subject3'); $with_rel['sepciality.facultet'] = array('select' => false); $with_rel['person.country'] = array('select' => false); $with_rel['status'] = array('select' => false); $with_rel['pbenefits'] = array('select' => false); $with_rel['pbenefits.psbenefit'] = array('select' => false); $with_rel['pbenefits.psbenefit.benefit'] = array('select' => false); $criteria->with = $with_rel; //також йде вибірка :: // ПІБ персон і спеціальності, // формат поля спеціальності: (( код_спеціальності назва_спеціальності[ (назва_напряму)] , форма: назва_форми )) // бал документу ,перерахований по шкалі ЄДЕБО, // бал документу, // загальна сума балів для рейтингу, // бал профільного предмету, // відмітка про позаконкурсний вступ або ж про те, що є відповідна пільга, // відмітка про першочерговий вступ або ж про те, що є відповідна пільга, // відмітка про оригінал на іншій спеціальності, // сума балів ЗНО. // МЫ ТУТ МЕНЯЛИ УМНОЖЕНИЕ НА 5 $criteria->select = array('*', new CDbExpression("concat_ws(' ',trim(person.LastName),trim(person.FirstName),trim(person.MiddleName)) AS NAME"), new CDbExpression("concat_ws(' '," . "sepciality.SpecialityClasifierCode," . "(case substr(sepciality.SpecialityClasifierCode,1,1) when '6' then " . "sepciality.SpecialityDirectionName else sepciality.SpecialityName end)," . "(case sepciality.SpecialitySpecializationName when '' then '' " . " else concat('(',sepciality.SpecialitySpecializationName,')') end)" . ",',',concat('форма: ',educationForm.PersonEducationFormName)) AS SPEC"), new CDbExpression('ROUND( IF(ISNULL(entrantdoc.AtestatValue),0.0, IF((entrantdoc.AtestatValue > 12), entrantdoc.AtestatValue ,entrantdoc.AtestatValue)) ,2) AS ZnoDocValue'), new CDbExpression('ROUND( IF(ISNULL(entrantdoc.AtestatValue),0.0,entrantdoc.AtestatValue),2) AS PointDocValue'), new CDbExpression('(ROUND(( ROUND( IF( ISNULL(entrantdoc.AtestatValue), 0.0, IF( t.QualificationID = ' . Qualifications::$bakalavr . ', set_bal(entrantdoc.AtestatValue)* ' . Yii::app()->params['scoreweight_AtestatValue'] . ' , entrantdoc.AtestatValue ) ),2)+ IF(ISNULL(documentSubject1.SubjectValue),0.0,documentSubject1.SubjectValue*sepciality.ZnoKoef1)+ IF(ISNULL(documentSubject2.SubjectValue),0.0,documentSubject2.SubjectValue*sepciality.ZnoKoef2)+ IF(ISNULL(documentSubject3.SubjectValue),0.0,documentSubject3.SubjectValue*sepciality.ZnoKoef3)+ IF(ISNULL(t.AdditionalBall),0.0,t.AdditionalBall)+ IF(ISNULL(t.CoursedpBall),0.0,t.CoursedpBall*' . Yii::app()->params['scoreweight_CoursedpBall'] . ')+ IF(ISNULL(olymp.OlympiadAwardBonus),0.0,olymp.OlympiadAwardBonus)+ IF(ISNULL(t.Exam1Ball),0.0,t.Exam1Ball*sepciality.ZnoKoef1)+ IF(ISNULL(t.Exam2Ball),0.0,t.Exam2Ball*sepciality.ZnoKoef2)+ IF(ISNULL(t.Exam3Ball),0.0,t.Exam3Ball*sepciality.ZnoKoef3)),2)) AS ComputedPoints'), new CDbExpression('IF(documentSubject1.SubjectID IN(SELECT ssj.SubjectID FROM specialitysubjects ssj WHERE ssj.isProfile=1 AND ssj.SpecialityID=t.SepcialityID), documentSubject1.SubjectValue, IF(documentSubject2.SubjectID IN(SELECT ssj.SubjectID FROM specialitysubjects ssj WHERE ssj.isProfile=1 AND ssj.SpecialityID=t.SepcialityID), documentSubject2.SubjectValue, IF(documentSubject3.SubjectID IN(SELECT ssj.SubjectID FROM specialitysubjects ssj WHERE ssj.isProfile=1 AND ssj.SpecialityID=t.SepcialityID),documentSubject3.SubjectValue, 0 ) ) ) AS ProfileSubjectValue'), new CDbExpression('if(ISNULL((SELECT bf.idBenefit FROM personspecialitybenefits psbf ' . 'LEFT JOIN personbenefits pbf ON psbf.PersonBenefitID=pbf.idPersonBenefits ' . 'LEFT JOIN benefit bf ON pbf.BenefitID=bf.idBenefit ' . 'WHERE psbf.PersonSpecialityID=t.idPersonSpeciality AND bf.isPZK>0 LIMIT 1)),0,1) AS isOutOfComp'), new CDbExpression('if(ISNULL((SELECT bf.idBenefit FROM personspecialitybenefits psbf ' . 'LEFT JOIN personbenefits pbf ON psbf.PersonBenefitID=pbf.idPersonBenefits ' . 'LEFT JOIN benefit bf ON pbf.BenefitID=bf.idBenefit ' . 'WHERE psbf.PersonSpecialityID=t.idPersonSpeciality AND bf.isPV>0 LIMIT 1)),0,1) AS isExtraEntry'), new CDbExpression('IF((t.isCopyEntrantDoc = 0),0,(SELECT SUM(IF((ISNULL(prsp.isCopyEntrantDoc) OR prsp.isCopyEntrantDoc = 0),1,0)) FROM personspeciality prsp WHERE prsp.PersonID=t.PersonID)) AS AnyOriginal'), new CDbExpression('(IF(ISNULL(documentSubject1.SubjectValue),0.0,documentSubject1.SubjectValue)+ IF(ISNULL(documentSubject2.SubjectValue),0.0,documentSubject2.SubjectValue)+ IF(ISNULL(documentSubject3.SubjectValue),0.0,documentSubject3.SubjectValue)) AS ZNOSum')); //оформлення єдиного запиту на вибірку $criteria->together = true; //вибірка для певної спеціальності/напряму певної форми $criteria->compare("t.SepcialityID", $this->SepcialityID); //вибірка для обраних статусів або для нових заяв, допущених, рекомендованих, до наказу і затриманих $status_in = '('; $status_ids = array(); if ($this->status_confirmed) { $status_ids[] = '4'; } if ($this->status_committed) { $status_ids[] = '5'; } if ($this->status_submitted) { $status_ids[] = '7'; } $status_in .= implode(',', $status_ids) . ')'; if ($status_in != '()') { $criteria->addCondition('t.StatusID IN ' . $status_in); } else { $criteria->addCondition('t.StatusID IN (1,4,5,7,8)'); } if ($sort_status) { $criteria->addCondition('t.StatusID < 8'); } switch ($mode) { //цільовики case 0: $criteria->compare('t.QuotaID', $this->param_quotaID); if (is_numeric($this->param_quotaID)) { $criteria->limit = intval($this->quota_budget_places); } else { return array(); } if ($sort_status) { $criteria->addCondition('t.StatusID IN (7)'); } break; //пільговики //пільговики case 1: $criteria->compare('if(isnull(benefit.isPZK),0,benefit.isPZK)', 1); $criteria->addCondition('t.isBudget > 0'); if (!empty($this->exludedIDs)) { $criteria->addCondition('t.idPersonSpeciality NOT IN (' . implode(',', $this->excludedIDs) . ')'); } $criteria->limit = intval($spec_model->Quota1); if ($sort_status) { $criteria->addCondition('t.StatusID IN (7)'); } break; //бюджетники //бюджетники case 2: $criteria->addCondition('t.isBudget > 0'); $place_num = intval($spec_model->SpecialityBudgetCount) - count($this->excludedIDs); $criteria->limit = $place_num >= 0 ? $place_num : 0; if ($sort_status) { $criteria->addCondition('t.StatusID IN (7)'); } break; //контрактники //контрактники case 3: $criteria->limit = intval($spec_model->SpecialityContractCount); if ($sort_status) { $criteria->addCondition('t.StatusID IN (7,5,4)'); } break; //решта //решта case 4: $criteria->limit = 100000; break; } if (count($this->excludedIDs) > 0) { $criteria->addCondition('t.idPersonSpeciality NOT IN (' . implode(',', $this->excludedIDs) . ')'); } //дані групуються по ІД заявки $criteria->group = "t.idPersonSpeciality"; //параметр сортування даних для формування рейтингу //$rating_order = ($sort_status)? "t.StatusID DESC, ":""; $rating_order = 'ComputedPoints DESC,' . 'IF(SUM(benefit.isPV)>0,1,0) DESC, IF(ISNULL(entrantdoc.PersonDocumentsAwardsTypesID),0,10-entrantdoc.PersonDocumentsAwardsTypesID) DESC, ProfileSubjectValue DESC, t.CreateDate ASC'; // $criteria->order = $rating_order; $result_models = Personspeciality::model()->findAll($criteria); if ($mode < 4) { $excl_ids = array(); foreach ($result_models as $res_model) { $excl_ids[] = $res_model->idPersonSpeciality; } $this->excludedIDs = array_merge($this->excludedIDs, $excl_ids); } return $result_models; }