public function SubjectSave($d) { $d->id = intval($d->id); $d->subjectid = intval($d->subjectid); $utmf = Abricos::TextParser(true); $utm = Abricos::TextParser(); $d->formcontrol = $utmf->Parser($d->formcontrol); $d->namesubject = $utmf->Parser($d->namesubject); $d->numcrs = intval($d->numcrs); $d->numhours1 = floatval($d->numhours1); $d->numhours2 = floatval($d->numhours2); $d->semestr = intval($d->semestr); $d->project1 = intval($d->project1); $d->project2 = intval($d->project2); switch ($d->formcontrol) { case 'Экзамен': break; case 'Зачет': break; case 'Зачет с оценкой': break; case 'Практика': $d->project1 = 0; $d->project2 = 0; break; case '-': break; default: return false; } if ($d->subjectid !== 0) { RecordBookQuery::SubjectEdit($this->db, $d); } else { RecordBookQuery::SubjectAppend($this->db, $d); } }