本文整理汇总了PHP中Subjects::getSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP Subjects::getSubject方法的具体用法?PHP Subjects::getSubject怎么用?PHP Subjects::getSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subjects
的用法示例。
在下文中一共展示了Subjects::getSubject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
function show($metaPoziadavkaID)
{
$res = $this->requirements->load($metaPoziadavkaID);
$this->set("meta_poziadavka", $res["meta_poziadavka"]);
$this->set("requirement", $res["requirement"]);
// doplnujuce informacie, co, kto a kedy
$subjects = new Subjects();
$rooms = new Rooms();
//TODO nenatiahnut to do meta poziadavky rovno aj nazov predmetu ??
$id_predmet = $res["meta_poziadavka"]["id_predmet"];
$subject = $subjects->getSubject($id_predmet);
$student_count = $subjects->getStudentCount($id_predmet);
$student_count_info = $subjects->getStudentCountInfo($id_predmet);
$this->set("subject", $subject["nazov"]);
$this->set('student_count', $student_count['count']);
$this->set('student_count_info', $student_count_info);
$this->set('rooms', $rooms->getAll());
$this->set('metaPoziadavkaID', $metaPoziadavkaID);
$id_predmet = $res["meta_poziadavka"]["id_predmet"];
$id_poziadavka_typ = 1;
$previousMetaID = $this->requirements->getPreviousMetaID($id_predmet, $metaPoziadavkaID);
$nextMetaID = $this->requirements->getNextMetaID($id_predmet, $metaPoziadavkaID);
$this->set("previousMetaID", $previousMetaID);
$this->set("nextMetaID", $nextMetaID);
}
示例2: show
function show($metaPoziadavkaID)
{
$res = $this->requirements->load($metaPoziadavkaID);
$this->set("meta_poziadavka", $res["meta_poziadavka"]);
$this->set("requirement", $res["requirement"]);
$subjects = new Subjects();
$rooms = new Rooms();
$id_predmet = $res["meta_poziadavka"]["id_predmet"];
$subject = $subjects->getSubject($id_predmet);
$student_count = $subjects->getStudentCount($id_predmet);
$student_count_info = $subjects->getStudentCountInfo($id_predmet);
$this->set("subject", $subject["nazov"]);
$this->set('student_count', $student_count['count']);
$this->set('student_count_info', $student_count_info);
$this->set('rooms', $rooms->getAll());
$this->set('types', $rooms->getTypes());
$this->set('metaPoziadavkaID', $metaPoziadavkaID);
$id_predmet = $res["meta_poziadavka"]["id_predmet"];
$id_poziadavka_typ = 2;
$previousMetaID = $this->requirements->getPreviousMetaID($id_predmet, $metaPoziadavkaID);
$nextMetaID = $this->requirements->getNextMetaID($id_predmet, $metaPoziadavkaID);
$this->set("previousMetaID", $previousMetaID);
$this->set("nextMetaID", $nextMetaID);
}
示例3: __getCommonData
/**
* Ziska data poziadavky, nastavi aj predmet aj semester
* @param unknown_type $courseID
* @return unknown_type
*/
private function __getCommonData($courseID)
{
$rooms = new Rooms();
$subjects = new Subjects();
$student_count = $subjects->getStudentCount($courseID);
$student_count_info = $subjects->getStudentCountInfo($courseID);
$this->set('capacities', $rooms->getCapacities());
$this->set('types', $rooms->getTypes());
$this->set('type_capacity', $rooms->getCapacitiesForTypes());
$this->set('rooms', $rooms->getAll());
// zoradene, len podla nazvu
$this->set('roomsByName', $rooms->getAll(true));
$this->set('subject', $subjects->getSubject($courseID));
$this->set('student_count', $student_count['count']);
$this->set('student_count_info', $student_count_info);
$this->set('course_id', $courseID);
$this->set("semester_id", $this->session->read("semester"));
// flag blokovania a comment k tomu
$this->set('blokovanie_preberania', $this->subjects->isBlockedCopying($courseID));
}
示例4: __createcsvrow
private function __createcsvrow($id_predmet)
{
//vytiahni data o prednaskach a cvikach predmetu
$metaPoz = $this->prequirements->getLastRequest($id_predmet);
$metaPoz2 = $this->crequirements->getLastRequest($id_predmet);
if (!empty($metaPoz)) {
$req = $this->prequirements->load($metaPoz["id"]);
}
if (!empty($metaPoz2)) {
$req2 = $this->crequirements->load($metaPoz2["id"]);
}
$subjects = new Subjects();
$roomz = new Rooms();
$subject = $subjects->getSubject($id_predmet);
$student_count = $subjects->getStudentCount($id_predmet);
$student_count_info = $subjects->getStudentCountInfo($id_predmet);
$rooms = $roomz->getAll();
$types = $roomz->getTypes();
$rooms_nazvy = array();
foreach ($rooms as $room) {
$rooms_nazvy[$room["id"]] = $room["nazov"];
}
$rooms_types = array();
foreach ($types as $type) {
$rooms_types[$type["id"]] = $type["nazov"];
}
//nahadz vytiahnute data do struktury csv
$csvrow .= '"' . $subject["nazov"] . '"';
$csvrow .= ';"' . $student_count['count'] . '"';
$csvrow .= ';"' . ($req["requirement"]["komentare"]["vseobecne"] ? str_replace(array("\n", "\r"), " ", $req["requirement"]["komentare"]["vseobecne"]) : "NULL") . '"';
$csvrow .= ';"' . ($req["requirement"]["komentare"]["sw"] ? str_replace(array("\n", "\r"), " ", $req["requirement"]["komentare"]["sw"]) : "NULL") . '"';
$layind = "a";
for ($j = 1; $j <= 3; $j++) {
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["lecture_count"] ? $req["requirement"]["layouts"][$layind]["lecture_count"] : "NULL") . '"';
$tmp = '';
for ($k = 0; $k < 13; $k++) {
if ($req["requirement"]["layouts"][$layind]["weeks"][$k]) {
$tmp .= $k + 1 . ' ';
}
}
$csvrow .= ';"' . ($tmp ? $tmp : "NULL") . '"';
for ($k = 1; $k <= 3; $k++) {
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["lecture_hours"] ? $req["requirement"]["layouts"][$layind]["requirement"][$k]["lecture_hours"] : "NULL") . '"';
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"]["students_count"] ? $req["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"]["students_count"] : "NULL") . '"';
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["equipment"]["chair_count"] ? $req["requirement"]["layouts"][$layind]["requirement"][$k]["equipment"]["chair_count"] : "NULL") . '"';
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"]["capacity"] ? $req["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"]["capacity"] : "NULL") . '"';
$sel_rooms = array();
foreach ($req["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"]["selected"] as $sel_room) {
$sel_rooms[] = $rooms_nazvy[$sel_room];
}
$csvrow .= ';"' . ($sel_rooms ? implode(" ", $sel_rooms) : "NULL") . '"';
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["equipment"]["notebook"] ? "true" : "false") . '"';
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["equipment"]["beamer"] ? "true" : "false") . '"';
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["after_lecture"] ? "true" : "false") . '"';
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["before_lecture"] ? "true" : "false") . '"';
$csvrow .= ';"' . ($req["requirement"]["layouts"][$layind]["requirement"][$k]["comment"] ? str_replace(array("\n", "\r"), " ", $req["requirement"]["layouts"][$layind]["requirement"][$k]["comment"]) : "NULL") . '"';
}
$layind = chr(ord($layind) + 1);
}
$csvrow .= ';"' . ($req2["requirement"]["komentare"]["vseobecne"] ? str_replace(array("\n", "\r"), " ", $req2["requirement"]["komentare"]["vseobecne"]) : "NULL") . '"';
$csvrow .= ';"' . ($req2["requirement"]["komentare"]["sw"] ? str_replace(array("\n", "\r"), " ", $req2["requirement"]["komentare"]["sw"]) : "NULL") . '"';
$layind = "a";
for ($j = 1; $j <= 3; $j++) {
$csvrow .= ';"' . ($req2["requirement"]["layouts"][$layind]["pract_count"] ? $req2["requirement"]["layouts"][$layind]["pract_count"] : "NULL") . '"';
$tmp = '';
for ($k = 0; $k < 13; $k++) {
if ($req2["requirement"]["layouts"][$layind]["weeks"][$k]) {
$tmp .= $k + 1 . ' ';
}
}
$csvrow .= ';"' . ($tmp ? $tmp : "NULL") . '"';
for ($k = 1; $k <= 3; $k++) {
$csvrow .= ';"' . ($req2["requirement"]["layouts"][$layind]["requirement"][$k]["pract_hours"] ? $req2["requirement"]["layouts"][$layind]["requirement"][$k]["pract_hours"] : "NULL") . '"';
$csvrow .= ';"' . ($req2["requirement"]["layouts"][$layind]["requirement"][$k]["pract_paralell"] ? $req2["requirement"]["layouts"][$layind]["requirement"][$k]["pract_paralell"] : "NULL") . '"';
for ($l = 1; $l <= 2; $l++) {
$csvrow .= ';"' . ($req2["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"][$l]["students_count"] ? $req2["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"][$l]["students_count"] : "NULL") . '"';
$csvrow .= ';"' . ($req2["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"][$l]["type"] ? $rooms_types[$req2["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"][$l]["type"]] : "NULL") . '"';
$csvrow .= ';"' . ($req2["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"][$l]["capacity"] ? $req2["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"][$l]["capacity"] : "NULL") . '"';
$sel_rooms2 = array();
foreach ($req2["requirement"]["layouts"][$layind]["requirement"][$k]["rooms"][$l]["selected"] as $sel_room) {
$sel_rooms2[] = $rooms_nazvy[$sel_room];
}
$csvrow .= ';"' . ($sel_rooms2 ? implode(" ", $sel_rooms2) : "NULL") . '"';
$csvrow .= ';"' . ($req2["requirement"]["layouts"][$layind]["requirement"][$k]["comment"] ? str_replace(array("\n", "\r"), " ", $req2["requirement"]["layouts"][$layind]["requirement"][$k]["comment"]) : "NULL") . '"';
}
}
$layind = chr(ord($layind) + 1);
}
$csvrow .= "\n";
return $csvrow;
}
示例5: createdoc
function createdoc($id_predmet)
{
$doc = $this->__createdocstruct($id_predmet);
$subjects = new Subjects();
$subject = $subjects->getSubject($id_predmet);
$filename = '"export-' . $subject["kod"] . '.doc"';
header('Content-Type: application/msword; charset="utf-8"');
header('Content-Disposition: attachment; filename=' . $filename);
echo $doc;
die;
}