public static function getAllFacult() { $model = new Facult(); $arr = $model->model()->findAll(); $arrAllFacult = array(); foreach ($arr as $array) { $arrAllFacult[$array->id] = $array->title; } return $arrAllFacult; }
public function getDataProviderAllGroupStud() { $id = Facult::getFacultId(); $criteria = new CDbCriteria(); $criteria->with = array('studentGrupa'); $criteria->condition = "facult_id='{$id}'"; $dataProvider = new CActiveDataProvider('StudentLogin', array('criteria' => $criteria)); return $dataProvider; }
public function dataProvider() { $model = new Specialnist(); $criteria = new CDbCriteria(); $facult_id = Facult::getFacultId(); $criteria->with = array('hasSpecialnistSpetsializacias', 'napryam'); //$criteria->compare(); $criteria->condition = "hasSpecialnistSpetsializacias.facult_id='{$facult_id}'"; return $model->model()->findAll($criteria); }
public function getPredmetVikladach() { $fakult_id = Facult::getFacultId(); $criteria = new CDbCriteria(); $model = new StudentPredmet(); $criteria->alias = "s"; if ($_SESSION['permissions']['admin_stud'] != 0) { $criteria->condition = "s.fakult_id='{$fakult_id}'"; } $criteria->with = array('pracivnukus', 'studentGrupas'); return $model->model()->findAll($criteria); }
public static function getGrupaOnlyThisFacultAll() { $facultet_id = Facult::getFacultId(); $model = new StudentGrupa(); $arr = $model->model()->findAll("facultet_id='{$facultet_id}'"); $arrayZag = array(); foreach ($arr as $array) { $arrayGrupa = array(); $id_grupa = $array->id; /***************************************************************масив з предметами кожноъ групи*****************************************************/ $modelPredmetHasStudentGrupa = new PredmetHasStudentGrupa(); $arrPredObj = $modelPredmetHasStudentGrupa->model()->findAll("student_grupa_id='{$id_grupa}'"); $arrayPred = array(); foreach ($arrPredObj as $a) { $id = $a->student_predmet_id; $arrayPred[$id] = StudentPredmet::returnPredmetName($id); } /******************************************************************масив з предметами кожноъ групи кінець**************************************************/ $arrayGrupa[$id_grupa] = $array->grupa_title; $arrayGrupa['predmet'] = $arrayPred; $arrayZag[$id_grupa] = $arrayGrupa; } return $arrayZag; }
public function getDataProviderNoCloseCountList() { $model = new Vidomist(); $fakult = Facult::getFacultId(); //return count($model->model()->findAll("data_paper='-' and fakult='$fakult'")); return '1'; }
public static function addDataPropusk($post) { $data_propusk = $post['data_propusk']; $data_vnes = date("Y-m-d"); $id_predm = $_GET['propuskPredmet']; $id_grupa = $_GET['propuskGrupa']; foreach ($post['StudentPropusk']['id'] as $k => $v) { if ($v != 0) { $model = new StudentPropusk(); $model->id_stud = substr(substr($k, 1), 0, -1); $model->id_predm = $id_predm; $model->id_grupa = $id_grupa; $model->form_navch_id = StudentGrupa::getIdFormaNavchanya($id_grupa); $model->propusk_god = $post['StudentPropusk']['propusk_god'][$k]; $model->id_fakult = Facult::getFacultId(); $model->data_propusk = $data_propusk; $model->data_vnes = $data_vnes; $model->id_vikl = $post['StudentPropusk']['id_vikl']; $model->save(); } // $model->id_stud=substr(substr($id_stud,1),0,-1); // $model->id_predm=$id_predm; // $model->id_grupa=$id_grupa; // $model->form_navch_id=$form_navch_id; // $model->propusk_god=$propusk_god; // $model->id_fakult=Facult::getFacultId(); //if($model->save()) Yii::app()->getController()->redirect($_SERVER['HTTP_REFERER']); } }
/** * всі викладачі конкретного факультету */ public static function allVukladachFakult() { $idFacult = Facult::getFacultId(); $model = new Pracivnuku(); $array = $model->model()->findAll("is_vikladach='{$idFacult}'"); $arr = array(); foreach ($array as $a) { $arr[$a->id] = $a->surname . " " . $a->name . " " . $a->middle_name; } return $arr; }