/** * Расписание * * @return CArrayList */ public function getSchedule() { if (is_null($this->_schedules)) { $this->_schedules = new CArrayList(); $query = new CQuery(); $query->select("schedule.*")->from(TABLE_SCHEDULE . " as schedule")->condition("schedule.id=" . $this->getId() . " and schedule.year=" . CUtils::getCurrentYear()->getId() . " and schedule.month=" . CUtils::getCurrentYearPart()->getId()); foreach ($query->execute()->getItems() as $item) { $schedule = new CSchedule(new CActiveRecord($item)); $this->_schedules->add($schedule->getId(), $schedule); } } return $this->_schedules; }
$a = mysql_fetch_array($res_all); $def_settings['year_name'] = $a['name']; $query_all = 'select id,name from time_parts where id="' . $def_settings['part_id'] . '"'; $res_all = mysql_query($query_all); $a = mysql_fetch_array($res_all); $def_settings['part_name'] = $a['name']; } else { /** * Переписано для использования новой системы глобальных настроек */ $def_settings["year_name"] = CUtils::getCurrentYear()->name; $def_settings["date_start"] = CUtils::getCurrentYear()->date_start; $def_settings["date_end"] = CUtils::getCurrentYear()->date_end; $def_settings["year_id"] = CUtils::getCurrentYear()->getId(); $def_settings["part_id"] = CUtils::getCurrentYearPart()->getId(); $def_settings["part_name"] = CUtils::getCurrentYearPart()->name; } if ($_SESSION['auth'] == 1) { if (!$view_all_mode || !$write_mode) { $_SESSION['lect_id'] = $_SESSION['id']; $_SESSION['lect_fio'] = $_SESSION['FIO']; } else { if (isset($_GET['user_id']) && $_GET['user_id'] != 0) { $_SESSION['lect_id'] = $_GET['user_id']; $res = mysql_query('select fio from users where id="' . $_SESSION['lect_id'] . '" limit 0,1'); if (mysql_num_rows($res) > 0) { $a = mysql_fetch_array($res); $_SESSION['lect_fio'] = $a['fio']; } } }