/plan/print.class.php
PHP | 1714 lines | 1560 code | 54 blank | 100 comment | 77 complexity | 36221d5d7ea250b101009f76d83fe229 MD5 | raw file
Possible License(s): GPL-2.0
Large files files are truncated, but you can click here to view the full file
- <?php
- ini_set('max_execution_time', '120');
- require_once('pgsql.class.php');
- require_once('html.class.php');
- define(SESSIONID,4);
- ini_set("soap.wsdl_cache_enabled", "0");
- //$client = new SoapClient( "http://contingent.bmstu.ru:82/contingent.wsdl", array("trace" => 1) );
- //$client = new SoapClient( "http://work.e-u.bmstu.ru/contingent/contingent.wsdl", array("trace" => 0) );//ЯЕПБХЯ ЯРСДЕМРНБ
- function toCP($str='') {
- return iconv("UTF-8", "CP1251", $str);
- }
- function toUTF($str='') {
- return iconv("CP1251", "UTF-8", $str);
- }
- class stud
- {
- }
- class listStudentsRequest {
- var $lastName;
- var $firstName;
- var $middleName;
- var $group;
- var $cardNumber;
- function listStudentsRequest($lastName, $firstName, $middleName, $group, $cardNumber)
- {
- $this->lastName = $lastName;
- $this->firstName = $firstName;
- $this->middleName = $middleName;
- $this->group = $group;
- $this->cardNumber = $cardNumber;
- }
- }
- function ListByGroup( $client, $group, $_lastname=NULL, $_firstname=NULL, $_middlename=NULL, $_pcn=NULL )
- {
- return 10;
- $count = 0;
- // $client = new SoapClient( "http://work.e-u.bmstu.ru/contingent/contingent.wsdl", array('trace'=>1) );
- try
- {
- $gr = explode(" ",toUTF($group));
- for ($i=0;$i<count($gr);$i++) {
- //echo $gr[$i];
- $student = $client->listStudents(new listStudentsRequest( NULL, NULL, NULL, $gr[$i], NULL ))->student;
- //var_dump($student);
- $count += count($student);
- // echo $count;
- }
- }
- catch(Exception $e)
- {
- print_r($e);
- return false;
- }
- return $count;
- }
- function comparePrograms($id, $pid) {
- if ($id == '00000000-0000-0000-0000-000000000000' || $pid == '00000000-0000-0000-0000-000000000000') return 1000;
- $count='0';
- $ret = 0;
- $pg_cmp = new pgsql();
- $pg_cmp->_query("SELECT DISTINCT discipline_titleshort, discipline_title, subfaculty, discipline_code FROM dis WHERE discipline_id IN (SELECT discipline_id FROM prog WHERE program_id = '$id' OR program_id = '$pid')");
- while ($rez = $pg_cmp->_getResult())
- $count++;
- if ($count != 1) {
- $ret.='1';
- } else $ret.='0';
- $count=0;
- $pg_cmp->_query("SELECT DISTINCT semester, weeks, lectures, seminars, labs, labscount, individual, zach, difzach, exam, subfaculty_for, speciality_for, seminarscount, zach_count FROM prog WHERE program_id = '$id' OR program_id = '$pid'");
- while ($rez = $pg_cmp->_getResult())
- $count++;
- if ($count != 1) {
- $ret.=1;
- }
- else $ret.='0';
- $count=0;
- $pg_cmp->_query("SELECT control_type, control_title, week, vol FROM control WHERE program_id = '$id'");
- while ($rez = $pg_cmp->_getResult())
- $count++;
- $pcount=0;
- $pg_cmp->_query("SELECT control_type, control_title, week, vol FROM control WHERE program_id = '$pid'");
- while ($rez = $pg_cmp->_getResult())
- $pcount++;
- $dcount=0;
- $pg_cmp->_query("SELECT DISTINCT control_type, control_title, week, vol FROM control WHERE program_id = '$id' OR program_id = '$pid'");
- while ($rez = $pg_cmp->_getResult())
- $dcount++;
- if ($count != $pcount || $count!= $dcount) {
- $ret.=1;
- } else $ret.='0';
- return $ret;
- }
- function dateto ($date) {
- $ret = '';
- $arr = explode('-',$date);
- for ($i=2;$i>-1;$i--) $ret.=$arr[$i].(($i!=0)?'-':'');
- return $ret;
- }
- function getGroup($subfaculty, $semester, $speciality) {
- $i=-1;
- $ret[0] = '';
- $ret[1] = '';
- $parsed = simplexml_load_file('struct.xml');
- while(($current_faculty = $parsed->faculty[++$i])) {
- $j=-1;
- // echo $this->toKOI($current_faculty['abbr'])."<br>";
- while($current_subfaculty = $current_faculty->subfaculty[++$j]) {
- $k=-1;
- // echo "---".$this->toKOI($current_subfaculty['abbr'])."<br>";
- if ($subfaculty == toCP($current_subfaculty['abbr']))
- while ($current_group = $current_subfaculty->group[++$k]) {
- if ($current_group['speciality_code'] == $speciality && $current_group['semester'] == $semester) {
- $ret[0] .= $current_subfaculty->group[$k]['id']." ";
- $ret[1] .= toCP($current_subfaculty->group[$k]['abbr'])." ";
- }
- }
- }
- }
- $ret[0] = rtrim($ret[0]);
- $ret[1] = rtrim($ret[1]);
- return $ret;
- }
- class MyPDF extends FPDF {
- public $xml;
- public $xpath;
-
- function __construct($orientation='P',$unit='mm',$format='A4') {
- // Загружаем справочники
- $this->xml = new DOMDocument('1.0', 'UTF-8');
- $this->xml->appendChild($this->xml->createElement('content'));
-
- //Структура
- $structure = new DOMDocument('1.0', 'UTF-8');
- $file = "xml/structure".$_GET["year"].".xml";
- $rez = $structure->load($file);
- if (!$rez)
- $rez = $structure->load('xml/structute.xml');
- if (!$rez) echo "Не возможно подключить справочник \"Структура университета\"";
- $node=$this->xml->importNode($structure->getElementsByTagName("structure")->item(0), true);
- $this->xml->documentElement->appendChild($node);
-
- //Даты
- $structure = new DOMDocument('1.0', 'UTF-8');
- $file = "dates/dates".$_GET["year"].".xml";
- $rez = $structure->load($file);
- if (!$rez)
- $rez = $structure->load('struct.xml');
- if (!$rez) echo "Не возможно подключить справочник \"Организация учебного процесса\"";
- $node=$this->xml->importNode($structure->getElementsByTagName("year_organize")->item(0), true);
- $this->xml->documentElement->appendChild($node);
-
- //Специальности
- $structure = new DOMDocument('1.0', 'UTF-8');
- $rez = $structure->load('speciality.xml');
- if (!$rez) echo "Не возможно подключить справочник специальностей";
-
- $node=$this->xml->importNode($structure->getElementsByTagName("specialities")->item(0), true);
- $this->xml->documentElement->appendChild($node);
-
- //Языки
- $structure = new DOMDocument('1.0', 'UTF-8');
- $rez = $structure->load('lang.xml');
- if (!$rez) echo "Не возможно подключить справочник языков";
-
- $node=$this->xml->importNode($structure->getElementsByTagName("languages")->item(0), true);
- $this->xml->documentElement->appendChild($node);
-
- $this->xpath = new DOMXpath($this->xml);
-
- // echo $this->xml->saveXML();
- FPDF::__construct($orientation,$unit,$format);
- }
- function getDate($week, $semester, $year) {
- $semester = (fmod($semester,2)==0)?2:1;
- $exp="//year[@semester='$semester']";
- // echo $exp;
- $org = '';
- $elements=$this->xpath->query($exp);
- foreach ($elements as $element) {
- $org[0]=toCP($element->getAttribute('begin'));
- $org[1]=toCP($element->getAttribute('end'));
- }
- print_r($org);
-
- }
- function writeRotie($x,$y,$txt,$text_angle,$font_angle = 0)
- {
- if ($x < 0) {
- $x += $this->w;
- }
- if ($y < 0) {
- $y += $this->h;
- }
-
- /* Escape text. */
- $text = $this->_escape($txt);
-
- $font_angle += 90 + $text_angle;
- $text_angle *= M_PI / 180;
- $font_angle *= M_PI / 180;
-
- $text_dx = cos($text_angle);
- $text_dy = sin($text_angle);
- $font_dx = cos($font_angle);
- $font_dy = sin($font_angle);
-
- $s= sprintf('BT %.2f %.2f %.2f %.2f %.2f %.2f Tm (%s) Tj ET', $text_dx, $text_dy, $font_dx, $font_dy,$x * $this->k, ($this->h-$y) * $this->k, $text);
- if($this->underline && $txt!='')
- $s.=' '.$this->_dounderline($x,$y,$txt);
- if($this->ColorFlag)
- $s='q '.$this->TextColor.' '.$s.' Q';
- $this->_out($s);
- }
- public function MultiCell($width,$height,$text,$padding,$dist,$align) {
- $x=$this->GetX();
- $y=$this->GetY();
- $data_array=split("\n",$text);
- $this->Rect($x, $y, $width, $height);
- for($i=0;$i<count($data_array);$i++) {
- $this_x=$x+$padding;//+$width/2-$this->GetStringWidth(trim($data_array[$i]))/2;
- if($align == 'C') $this_x = $x+$width/2-$this->GetStringWidth(trim($data_array[$i]))/2;
- $this_y=$y+$padding+3;
- $this->Text($this_x,$this_y+$i*$dist,$data_array[$i]);
- }
- $this->SetXY($x+$width,$y);
- }
- }
- class ZAP extends MyPDF {
- public $baseWidth = 10;
- public $baseHeight = 5;
- public $subfaculty = '';
- function PrintZap($record_number, $record_date, $year) {
- $baseWidth = $this->baseWidth;
- $baseHeight = $this->baseHeight;
- $full = 18;
- $this->SetFont('TimesNewRomanPSMT','',12);
- //Переходим на следующую строку
- $this->Ln();
- $this->Cell(12*$baseWidth, $baseHeight, $record_number."/".$record_date,0,0,'L');
- // $this->SetXY($this->GetX()+12*$baseWidth,$this->GetY()+$baseHeight);
- $this->Cell(5*$baseWidth, $baseHeight, 'Проректору по учебной работе',0,0,'C');
- $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
- $this->Cell(5*$baseWidth, $baseHeight, '',0,0,'C');
- $this->Ln();
- $this->SetY($this->GetY()+14*$baseHeight);
- $this->Cell($full*$baseWidth, $baseHeight, 'Служебная записка',0,0,'C');
- $this->Ln();
- $this->Ln();
- $this->Write($baseHeight," Прошу разрешить внести следующие изменения в рабочие учебные планы на $year/".($year+1)." учебный год:\n");
- $this->Ln();
- $num = 0;
- $this->Write($baseHeight," Изменить дисциплину(ы):\n");
- $pg = new pgsql();
- $pg->_query("SET client_encoding TO 'WIN1251'");
- $pg->_query("SELECT * from prog, dis WHERE program_id IN (SELECT program_id FROM prog_status WHERE record_number=$record_number AND record_date='$record_date' AND deleted != 1) AND prog.discipline_id = dis.discipline_id AND parent_id != '00000000-0000-0000-0000-000000000000'");
- while ($rez=$pg->_getResult()) {
- $year=$rez['year'];
- $semester=$rez['semester'];
- $weeks=$rez['weeks'];
- $lectures=$rez['lectures'];
- $seminars=$rez['seminars'];
- $seminarscount=$rez['seminarscount'];
- $labs=$rez['labs'];
- $labscount=$rez['labscount'];
- $individual=$rez['individual'];
- $zach=$rez['zach'];
- $zach_count=$rez['zach_count'];
- $difzach=$rez['difzach'];
- $exam=$rez['exam'];
- $uuid=$rez['discipline_id'];
- $subfac=$rez['subfaculty_for'];
- $spec=$rez['speciality_for'];
- $subfaculty=$rez['subfaculty'];
- $title=str_replace("№","№",$rez['discipline_title']);
- $id = $rez['program_id'];
- $f_id = $rez['parent_id'];
- $cmp = comparePrograms($id, $f_id);
- $first = 0;
- $chg = Array("название","виды учебных работ","контрольные мероприятия");
- $msg = '';
- for ($i = 1; $i < 4; $i++)
- if ($cmp[$i]=='1') {
- if (!$first) $first=1;
- else $msg.=", ";
- $msg.=$chg[$i-1];
- }
- $msg.="; в связи с (указать причину):";
-
- $this->Write($baseHeight,++$num.".\"$title\" для специальности $spec кафедры $subfac, $semester семестр; изменения: $msg\n");
- $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
- $this->Ln();
- $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
- $this->Ln();
- $this->Ln();
- }
- (!$num) ? $this->Write($baseHeight," - \n") : "";
- $num = 0;
- $this->Write($baseHeight," Добавить дисциплину(ы):\n");
- $pg = new pgsql();
- $pg->_query("SET client_encoding TO 'WIN1251'");
- $pg->_query("SELECT * from prog, dis WHERE program_id IN (SELECT program_id FROM prog_status WHERE record_number=$record_number AND record_date='$record_date' AND deleted!=1) AND prog.discipline_id = dis.discipline_id AND parent_id = '00000000-0000-0000-0000-000000000000'");
- while ($rez=$pg->_getResult()) {
- $year=$rez['year'];
- $semester=$rez['semester'];
- $weeks=$rez['weeks'];
- $lectures=$rez['lectures'];
- $seminars=$rez['seminars'];
- $seminarscount=$rez['seminarscount'];
- $labs=$rez['labs'];
- $labscount=$rez['labscount'];
- $individual=$rez['individual'];
- $zach=$rez['zach'];
- $zach_count=$rez['zach_count'];
- $difzach=$rez['difzach'];
- $exam=$rez['exam'];
- $uuid=$rez['discipline_id'];
- $subfac=$rez['subfaculty_for'];
- $spec=$rez['speciality_for'];
- $title=str_replace("№","№",$rez['discipline_title']);
- $subfaculty=$rez['subfaculty'];
- $this->Write($baseHeight,++$num.". \"$title\" для специальности $spec кафедры $subfac, $semester семестр; в связи с (указать причину):\n");
- $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
- $this->Ln();
- $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
- $this->Ln();
- $this->Ln();
- }
- (!$num) ? $this->Write($baseHeight," - \n") : "";
- $num = 0;
- $this->Write($baseHeight," Удалить дисциплину(ы):\n");
- $pg = new pgsql();
- $pg->_query("SET client_encoding TO 'WIN1251'");
- $pg->_query("SELECT * from prog, dis WHERE program_id IN (SELECT program_id FROM prog_status WHERE record_number=$record_number AND record_date='$record_date' AND deleted = 1) AND prog.discipline_id = dis.discipline_id AND parent_id != '00000000-0000-0000-0000-000000000000'");
- while ($rez=$pg->_getResult()) {
- $year=$rez['year'];
- $semester=$rez['semester'];
- $weeks=$rez['weeks'];
- $lectures=$rez['lectures'];
- $seminars=$rez['seminars'];
- $seminarscount=$rez['seminarscount'];
- $labs=$rez['labs'];
- $labscount=$rez['labscount'];
- $individual=$rez['individual'];
- $zach=$rez['zach'];
- $zach_count=$rez['zach_count'];
- $difzach=$rez['difzach'];
- $exam=$rez['exam'];
- $uuid=$rez['discipline_id'];
- $subfac=$rez['subfaculty_for'];
- $spec=$rez['speciality_for'];
- $title=str_replace("№","№",$rez['discipline_title']);
- $subfaculty=$rez['subfaculty'];
- $this->Write($baseHeight,++$num.". \"$title\" для специальности $spec кафедры $subfac, $semester семестр; в связи с (указать причину):\n");
- $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
- $this->Ln();
- $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
- $this->Ln();
- $this->Ln();
- }
- (!$num) ? $this->Write($baseHeight," - \n") : "";
- $this->Ln();
- $this->Write($baseHeight," Изменения в дисциплины будут внесены в рабочие программы до начала учебного семестра.");
- $this->Ln();
- $this->Cell($full*$baseWidth, $baseHeight, "Заведующий кафедрой $subfaculty",0,0,'L');
- $pg = new pgsql();
- $pg->_query("SET client_encoding TO 'WIN1251'");
- $pg->_query("SELECT program_id as id FROM prog_status WHERE record_number=$record_number AND record_date='$record_date' AND deleted = 0");
-
- while ($rez=$pg->_getResult()) {
- $this->AddPage();
- PROG::PrintProg($rez["id"]);
- }
- }
- }
- class PROG extends MyPDF {
- public $baseWidth = 10;
- public $baseHeight = 5;
- function PrintProg($id) {
- $a=$kr=$krcount=$kz=$kzcount=$r=$rcount=$ku=$kucount=$dz=$dzcount=$sr=0;
- $baseWidth = $this->baseWidth;
- $baseHeight = 1.1*$this->baseHeight;
- $tbl = array(12,3,3);
- $full = 0;
- for ($i=0;$i<3;$i++)
- $full += $tbl[$i];
- $pg = new pgsql();
- $pg->_query("SET client_encoding TO 'WIN1251'");
- $pg->_query("SELECT * from prog WHERE program_id='$id'" );
- $rez=$pg->_getResult();
- $year=$rez['year'];
- $semester=$rez['semester'];
- $weeks=$rez['weeks'];
- $a+=$lectures=$rez['lectures'];
- $lecturescount=$rez['lecturescount'];
- $a+=$seminars=$rez['seminars'];
- $seminarscount=$rez['seminarscount'];
- $a+=$labs=$rez['labs'];
- $labscount=$rez['labscount'];
- $individual=$rez['individual'];
- $zach=$rez['zach'];
- $zach_count=$rez['zach_count'];
- $difzach=$rez['difzach'];
- $exam=$rez['exam'];
- // $memo=$rez['memo'];
- $uuid=$rez['discipline_id'];
- $subfac=$rez['subfaculty_for'];
- $subfac_id=$rez['subfaculty_for_id'];
- $spec=$rez['speciality_for'];
- $practice=$rez['practice'];
- // $lang_first=$rez['lang_first'];
- // $lang_second=$rez['lang_second'];
- $pg->_query("SELECT * from lang WHERE f_id='$id'" );
- $langs=$pg->_getResultAll();
- $pg->_query("SELECT * from dis WHERE discipline_id='$uuid'" );
- $rez=$pg->_getResult();
- $code=$rez['discipline_code'];
- $titleShort=str_replace("№","№",$rez['discipline_titleshort']);
- $title=str_replace("№","№",$rez['discipline_title']);
- $disSubfaculty=$rez['subfaculty'];
- $pg->_query("SELECT * from prog_status WHERE program_id='$id'" );
- $rez=$pg->_getResult();
- $record=$rez["record"];
- $record_number=$rez["record_number"];
- $record_date=$rez["record_date"];
- /* $pg->_query("SELECT * from memo WHERE program_id='$id'" );
- $rez=$pg->_getResult();
- $memo=$rez['annotation'];
- $lecturesMemo=$rez['lectures'];
- $seminarsMemo=$rez['seminars'];
- $labsMemo=$rez['labs'];
- $individualMemo=$rez['individual'];
- $literatureMemo=$rez['literature'];
- $dzMemo=$rez['dz'];
- $rkMemo=$rez['rk'];
- $krMemo=$rez['kr'];
- $dzMemo=$rez['zach'];
- $rkMemo=$rez['difzach'];
- $krMemo=$rez['exam'];
- */ $pg->_query("SELECT * from control WHERE program_id='$id' ORDER BY week" );
- $count=0;
- while ($rez=$pg->_getResult()) {
- $control[$count]["week"] = $rez["week"];
- $control[$count]["type"] = $rez["control_type"];
- $control[$count]["vol"] = $rez["vol"];
- $count++;
- switch ($rez["control_type"]) {
- case "КР": $kr+=$rez["vol"]; $krcount++; break;
- case "КЗ": $kz+=$rez["vol"]; $kzcount++; break;
- case "Р": $ind+=$r+=$rez["vol"];$rcount++;break;
- case "КУ": $ind+=$ku+=$rez["vol"];$kucount++;break;
- case "ДЗ": $ind+=$dz+=$rez["vol"];$dzcount++;break;
- }
- }
- $a+=$kz+$kr;
- /* $exp="//lang[@index='$lang_first' or @index='$lang_second']";
- // echo $exp;
- $lang = '';
- $elements=$this->xpath->query($exp);
- foreach ($elements as $element) {
-
- $lang[]=toCP($element->getAttribute('titleshort'));
- }
-
- */
- $l = '';
- $groups="";
- foreach ($langs as $lang) {
-
- $exists=0;
- $exp="//group[@speciality_code = '$spec' and @semester = '$semester' and @lang_first='".$lang["lang_first"]."' and @lang_second='".$lang["lang_second"]."' and @active='true']";
- // echo $exp;
- $elements=$this->xpath->query($exp);
- // print_r($elements->saveXML());
- foreach ($elements as $element) {
- $exists++;
- $groups.=toCP($element->getAttribute('abbr'));
- $groups.=" ";
- $study_form = toCP($element->getAttribute('study_form'));
- }
-
- if ($exists) {
- $exp_f="//lang[@index='".$lang["lang_first"]."']";
- $exp_s="//lang[@index='".$lang["lang_second"]."']";
- $elements=$this->xpath->query($exp_f);
- foreach ($elements as $element) {
- $l.=toCP($element->getAttribute('titleshort'));
- }
- $l.="/";
- $elements=$this->xpath->query($exp_s);
- foreach ($elements as $element) {
- $l.=toCP($element->getAttribute('titleshort'));
- }
- $l.=" ";
- }
- // $langs = $lang[0]."/".$lang[1];
- $langs = $l;
- }
-
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Cell($full*$baseWidth, $baseHeight, 'Форма 1',0,0,'R');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- //Выводим наименование компании
- $this->Cell($full*$baseWidth, $baseHeight, 'Министерство образования и науки Российской Федерации',0,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->Cell($full*$baseWidth, $baseHeight, 'Государственное образовательное учреждение высшего профессионального образования',0,3,'C');
- $this->Cell($full*$baseWidth, $baseHeight, toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('name')),0,3,'C');
- $this->Cell($full*$baseWidth, $baseHeight, '('.toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('abbr')).')','B',3,'C');
- $this->SetFont('TimesNewRomanPSMT','',12);
- //Переходим на следующую строку
- $this->Cell(5*$baseWidth, $baseHeight, (($record)? $record_number."/".$record_date : ""),0,0,'C');
- $this->SetXY($this->GetX()+7*$baseWidth,$this->GetY());
- $this->Cell(5*$baseWidth, $baseHeight, '"Утверждаю"',0,0,'C');
- $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
- $this->Cell(5*$baseWidth, $baseHeight, 'Проректор по учебной работе',0,0,'C');
- $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
- $this->Cell(5*$baseWidth, $baseHeight, toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('abbr')),0,0,'C');
- $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
- $this->Cell(5*$baseWidth, $baseHeight, '_________________',0,0,'C');
- $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
- $this->Cell(5*$baseWidth, $baseHeight, '"____""__________" '.date('Y').' г.',0,0,'C');
- $this->Ln();
- $this->Ln();
- $this->Cell($full*$baseWidth, $baseHeight, 'Выписка из рабочей программы учебной дициплины',0,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $y = $this->GetY();
- $this->SetFont('TimesNewRomanPS-BoldMT','B',14);
- //Выводим наименование компании
- FPDF::MultiCell(0, $baseHeight, $title,0,'C',0);
- //Переходим вниз на 4 строки
- // $this->SetY($y+4*$baseHeight);
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Cell($full*$baseWidth, $baseHeight, 'Учебный год '.$year.'/'.($year+1).' Семестр '.$semester.' Недель '.$weeks,0,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->Cell($full*$baseWidth, $baseHeight, 'Для специальности '.$spec.' Кафедры '.$subfac.' Читает '.$disSubfaculty,0,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->Cell($full*$baseWidth, $baseHeight, ' Группа(ы) '.$groups,0,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- //Переходим на следующую строку
- $this->Cell($full*$baseWidth, $baseHeight, ' Языки '.$langs,0,0,'C');
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(8*$baseWidth, $baseHeight,'Виды учебных работ',1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,'Обьем, час',1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,'Количество',1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Аудиторный занятия (А), в т.ч.:',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$a,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,'',1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Cell(8*$baseWidth, $baseHeight,'Лекции (Л)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$lectures,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$lecturescount,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Семинары (С)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$seminars,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$seminarscount,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Практическое занятие (ПЗ)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$labs,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$labscount,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Контрольная работа (КР)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$kr,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$krcount,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Контрольное занятие (КЗ)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$kz,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$kzcount,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Самостоятельная работа (СР), в т.ч.:',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$individual,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Реферат (Р)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$r,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$rcount,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Курсовая работа (КУ)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$ku,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$kucount,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Домашнее задание (ДЗ)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$dz,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$dzcount,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Другие виды работ',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$individual-$ind,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,'',1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Учебная работа (УР = А + СР) студента',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$ur=$a+$individual,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Практика (Недели)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$practice*54,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,$practice,1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(14*$baseWidth, $baseHeight,'Объем работы студента в период экзаменационной сессии (Э)',1,0,'L');
- // $this->Cell(14*$baseWidth, $baseHeight,'Объем работы студента в период экзаменационной сессии, по резултатам практики и за курсовую работу (Э)',1,0,'L');
- /* //Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(14*$baseWidth, $baseHeight,'Контроль знаний',1,0,'C');
- *///Переходим на следующую строку
- $this->Ln();
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Cell(8*$baseWidth, $baseHeight,'Зачет',1,0,'L');
- if ($zach=='t') {
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12) ;
- $this->Cell(3*$baseWidth, $baseHeight,$zachvol=($zach_count=='t')?18:0,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"+",1,0,'C');
- $e+=$zachvol;
- }
- else {
- $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"-",1,0,'C');
- }
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Дифференцированный зачет',1,0,'L');
- if ($difzach=='t') {
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(3*$baseWidth, $baseHeight,$zachvol=18,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"+",1,0,'C');
- $e+=$zachvol;
- }
- else {
- $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"-",1,0,'C');
- }
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Экзамен (защита ВКР)',1,0,'L');
- if ($exam=='t') {
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(3*$baseWidth, $baseHeight,$exam=36,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"+",1,0,'C');
- $e+=$exam;
- }
- else {
- $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"-",1,0,'C');
- }
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Оценка за курсовую работу',1,0,'L');
- if ($ku) {
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(3*$baseWidth, $baseHeight,$zachvol=18,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"+",1,0,'C');
- $e+=$zachvol;
- }
- else {
- $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"-",1,0,'C');
- }
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'Теоретическое обучение (ТО = УР + Э)',1,0,'L');
- $this->Cell(3*$baseWidth, $baseHeight,$to=$ur+$e,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->SetX($this->GetX()+2*$baseWidth);
- $this->Cell(8*$baseWidth, $baseHeight,'В кредитах (ТО/36)',1,0,'L');
- $kred=round($to/36,1);
- $kred=explode('.',$kred);
- // print_r($kred);
- if ($kred[1] > 0 && $kred[1] <= 5) $mod=0.5;
- elseif ($kred[1] > 5 && $kred[1] < 10) $mod=1;
- else $mod=0;
- $this->Cell(3*$baseWidth, $baseHeight,$kred[0]+$mod,1,0,'C');
- $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
- //Переходим на следующую строку
- $this->Ln();
- $this->Ln();
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell($full*$baseWidth, $baseHeight, 'График выполнения контрольных мероприятий (КМ)',0,0,'C');
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Ln();
- $baseWidth = 1.25*$baseHeight;
- $this->Cell(3*$baseWidth, $baseHeight,'Неделя',1,0,'C');
- for ($i = 0; $i<21; $i++) {
- $this->Cell($baseWidth, $baseHeight,$i+1,1,0,'C');
- }
- $this->Ln();
- $this->Cell(3*$baseWidth, $baseHeight,'План КМ',1,0,'C');
- $count = 0;
- for ($i = 0; $i<21; $i++) {
- $this->Cell($baseWidth, $baseHeight,($control[$count]["week"]==($i+1))?$control[$count++]["type"]:"",1,0,'C');
- }
- $this->Ln();
- $count = 0;
- $this->Cell(3*$baseWidth, $baseHeight,'Объем',1,0,'C');
- for ($i = 0; $i<21; $i++) {
- $this->Cell($baseWidth, $baseHeight,($control[$count]["week"]==($i+1))?$control[$count++]["vol"]:"",1,0,'C');
- }
- $this->Ln();
- $this->Ln();
- if ($subfac!=$disSubfaculty)
- $this->Cell(12*$baseWidth, $baseHeight,'Заведующий кафедрой '.$disSubfaculty,0,3,'L');
- $this->Cell(12*$baseWidth, $baseHeight,"Заведующий выпускающей кафедрой",0,3,'L');
- $this->Cell(12*$baseWidth, $baseHeight,"(руководитель выпускающего межкафедрального объединения)",0,3,'L');
- $this->Cell(12*$baseWidth, $baseHeight,'Начальник учебного отдела ',0,3,'L');
- }
- }
- class PLAN extends MyPDF {
- public $baseWidth = 9;
- public $baseHeight = 9;
- public $total = array();
- public $br=0;
- function PrintPlan($subfaculty,$year) {
- $baseWidth = $this->baseWidth;
- $baseHeight = 5;
- // $width = Array (1,14,1.5,1,1,1,6,1.2,1,1,1,1,2,1,1);
- $height = Array (1.1,2.2,4.4,8.8,17.6,35.2);
- // $width = Array (3,8,12,2,1,1,1,1,1,1,1,1,1,1.5,1.5,1.5,1.5,1.5,1.5,1.5);
- $width = Array (3,8,12,2,1,1,1,1,1,1,1,1,1.5,1.5,1.5,1.5,1.5,1.5);
- $width_count=0;
- $this->PrintSemester($subfaculty,$year,1);
- $this->PrintSemester($subfaculty,$year,2);
- for ($i=0;$i<4;$i++) $this->total[$i]='';
- $this->total[1]="Итого за год";
- for ($i=0;$i<count($width);$i++) {
- $this->Cell($width[$i]*$baseWidth,$baseHeight,$this->total[$i],1,0,($i==1 || $i==2)?'L':'C',1);
- }
- $this->ln();
- $this->MultiCell(20*$baseWidth,5*$baesHeight,"Начальник учебного отдела _____________________ \"____\"__________ 20___.' г.",1,3,'L');
- $this->MultiCell(20*$baseWidth,5*$baesHeight,"Заведующий кафедрой _____________________ \"____\"__________ 20___.' г.",1,3,'L');
- }
-
- function Header(){
- $baseWidth = $this->baseWidth;
- $baseHeight = 5;
- // $width = Array (1,14,1.5,1,1,1,6,1.2,1,1,1,1,2,1,1);
- $height = Array (1.1,2.2,4.4,8.8,17.6,35.2);
- $width = Array (3,8,12,2,1,1,1,1,1,1,1,1,1,1.5,1.5,1.5,1.5,1.5,1.5,1.5);
- $width_count=0;
- if ($this->PageNo()==1) $this->PrintHeader(toCP($_GET["subfaculty"]),$_GET["year"]);
- $this->SetFont('TimesNewRomanPS-BoldMT','B',10);
- $this->MultiCell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Факультет\nКурс\nГруппа",$height[4]*$baseHeight/2,3,'C');
- // $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Группа",1,0,'C');
- $this->MultiCell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Направление подготовки (специальность),\nквалификация(степень)",$height[4]*$baseHeight/2,3,'C');
- // $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Направление подготовки (специальность), квалификация(степень)",1,0,'C');
- $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Программа дисциплины",1,0,'C');
- $this->MultiCell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Форма\nобучения",$height[4]*$baseHeight/2,3,'C');
- $X=$this->GetX();
- $Y=$this->GetY();
- $this->Cell(($width[$width_count++]+$width[$width_count])*$baseWidth,$height[3]*$baseHeight,"",1,3,'C');
- $X_txt=$this->GetX()-3+$width[$width_count]*$baseWidth;
- $Y_txt=$this->GetY();
- $this->writeRotie($X_txt, $Y_txt, "Форма промежуточной", 90);
- $this->writeRotie($X_txt+=3, $Y_txt, " аттестации в", 90);
- $this->writeRotie($X_txt+=3, $Y_txt, " экзаменационную", 90);
- $this->writeRotie($X_txt+=3, $Y_txt, " сессию", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[3]*$baseHeight, "Экзамен (Э)", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[3]*$baseHeight, "Диф. зачет (Д)", 90);
- $this->SetXY($this->GetX(),$Y);
- $X=$this->GetX();
- $Y=$this->GetY();
- $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Руксовая работа (КУ)", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Реферат (Р)", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Выпускной курс (В)", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Количество недель практики", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Количество членов ГАК (декан ф-та)", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Кол-во часов за руководство кафедрой (в год)", 90);
- $X=$this->GetX();
- $Y=$this->GetY();
- $this->Cell(($width[$width_count++]+$width[$width_count])*$baseWidth,$height[3]*$baseHeight,"Количество",1,3,'C');
- $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "Студентов (докторантов", 90);
- $this->writeRotie($this->GetX()-3, $this->GetY()+$height[3]*$baseHeight, "аспирантов, соискателей)", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "Групп (потоков)", 90);
- $this->SetXY($this->GetX(),$Y);
- $X=$this->GetX();
- $Y=$this->GetY();
- $this->Cell(($width[$width_count]+$width[$width_count+1]+$width[$width_count+2]+$width[$width_count+3])*$baseWidth,$height[1]*$baseHeight,"Виды учебной работы (часов)",1,3,'C');
- // $this->MultiCell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Форма\nобучения",$height[4]*$baseHeight/2,3,'C');
- $this->MultiCell(($width[$width_count]+$width[$width_count+1])*$baseWidth,($height[1]+$height[2])*$baseHeight,"Чтение\nлекций",$height[2]*$baseHeight/2,3,'C');
- $this->MultiCell(($width[$width_count]+$width[$width_count+1])*$baseWidth,($height[1]+$height[2])*$baseHeight,"Проведение\nдругих видов\nаудиторных\nзанятий",$height[2]*$baseHeight/2,3,'C');
- $this->SetXY($X,$Y+$height[3]*$baseHeight);
- $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "по плану", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "Всего", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "по плану", 90);
- $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
- $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "Всего", 90);
- // $this->Cell($width[1]*$baseWidth,$height[0]*$baseHeight,"$semester семестр",1,2,'C');
- // $this->SetXY($X,$Y+$baseHeight);
- $this->Ln();
- }
- function PrintHeader($subfaculty,$year) {
- $baseWidth = $this->baseWidth;
- $baseHeight = 5;
- // $width = Array (1,14,1.5,1,1,1,6,1.2,1,1,1,1,2,1,1);
- $height = Array (1.1,2.2,4.4,8.8,17.6,35.2);
- $width = Array (3,8,12,2,1,1,1,1,1,1,1,1,1,1.5,1.5,1.5,1.5,1.5,1.5,1.5);
- $width_count=0;
- $this->SetMargins(20,20);
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Cell($full*$baseWidth, $baseHeight, 'Форма 3',0,0,'R');
- //Переходим на следующую строку
- $this->Ln();
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- //Выводим наименование компании
- $this->Cell($full*$baseWidth, $baseHeight, 'Министерство образования и науки Российской Федерации',0,3,'C');
- $this->Cell($full*$baseWidth, $baseHeight, 'Государственное образовательное учреждение высшего профессионального образования',0,3,'C');
- $this->Cell($full*$baseWidth, $baseHeight, toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('name')).' ('.toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('abbr')).')',0,3,'C');
- //Выводим заголовок
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->MultiCell(10*$baseWidth,5*$baesHeight,"Утверждаю\nПроректор по учебной работе\n _____________________\n\n\"____\"__________ 20___.' г.",1,3,'L');
- $exp="//subfaculty[@abbr='".toUTF($subfaculty)."']";
- // echo $exp;
- $subfaculty_name = '';
- $elements=$this->xpath->query($exp);
- foreach ($elements as $element) {
- $subfaculty_name=toCP($element->getAttribute('name'));
- }
- $this->MultiCell(30*$baseWidth,5*$baesHeight,"Выписка из учебных планов для кафедры $subfaculty($subfaculty_name) на $year/".($year+1)." учебный год.",1,3,'L');
- // $this->MultiCell(4*$baseWidth,5*$baesHeight,"Форма 4",1,3,'R');
- //Переходим на следующую строку
- $this->SetY($this->GetY()+5*$baseHeight);
- }
-
- function PrintSemester($subfaculty,$year,$semester) {
- $baseWidth = $this->baseWidth;
- $baseHeight = $this->baseHeight;
- $X = $this->GetX();
- $Y = $this->GetY();
- $X_max = 45*$baseWidth + 5.4;
- $width = Array (3,8,12,2,1,1,1,1,1,1,1,1,1.5,1.5,1.5,1.5,1.5,1.5);
- // $width = Array (8,0,1.5,1,1,1,1,1,1,1,0.8,0.8,0.8,0.8,0.8,0.8,1,1,1.1,1.1,3.5);
- // $width = Array (8,0,1.5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,3);
- // $width = Array (14,0,1.5,1,1,1,1.2,1,1,1,1,1,1);
- $sum = Array(0,0,0,0,0,0,0,0,0,0,0,0,0);
- $sem = ($semester==1)?1:0;
- $count=0;
- $pg = new pgsql();
- $pg->_query("SET client_encoding TO 'WIN1251'");
- $control = new pgsql();
- $control->_query("SET client_encoding TO 'WIN1251'");
- $sql = "SELECT prog.program_id as id, weeks,
- ltrim(rtrim(discipline_title)) as title,
- dis.subfaculty, speciality_for as speciality, semester,
- CASE WHEN difzach = true THEN 'Д' ELSE '' END as difzach,
- CASE WHEN exam = true THEN 'Э' ELSE '' END as exam,
- lectures,
- seminars,
- labs,
- individual,
- round(cast(lectures + seminars + labs AS numeric) / weeks,1) as aud,
- round(cast(individual AS numeric)/ weeks,1) as indiv
- from prog
- INNER JOIN dis ON (prog.discipline_id=dis.discipline_id AND subfaculty='$subfaculty')
- INNER JOIN prog_status ON (prog.program_id = prog_status.program_id)
- WHERE year='$year'
- AND mod(semester,2)=$sem
- ORDER BY semester, discipline_title";
- $pg->_query($sql);
- $this->SetFont('TimesNewRomanPSMT','',10);
- $this->SetFillColor(192,192,192);
- //var_dump($pg->_getResultAll());
- $prog = $stat = array();
- $prog[1]=$semester." полугодие";
- $stat[1]="Итого за ".$prog[1];
- $br=0;
- for ($i=0;$i<count($width);$i++) {
- $this->Cell($width[$i]*$baseWidth,$baseHeight/2,$prog[$i],1,0,($i==1 || $i==2)?'L':'C',0);
- }
- $this->ln();
- $prog = array();
- while ($rez=$pg->_getResultArray(true,PGSQL_ASSOC)) {
- $prog[0]="";
- $prog[1]=$rez["speciality"]." - ";
- $exp="//specialities/speciality[@name='".$rez["speciality"]."']";
- // echo $exp;
- $spec = '';
- $elements=$this->xpath->query($exp);
- foreach ($elements as $element) {
-
- $spec.=toCP($element->getAttribute('speciality_title'));
- if ($element->getAttribute('direction_title')) {
- $spec.="(";
- $spec.=toCP($element->getAttribute('direction_title'));
- $spec.="}";
- }
- }
- $langs_sql = "SELECT * FROM lang WHERE f_id = '".$rez["id"]."'";
- $control->_query($langs_sql);
- $count=1;
- $group=0;
- $students=0;
- while ($langs_rez=$control->_getResultArray()) {
- $exp="//group[@speciality_code = '".$rez["speciality"]."' and @semester = '".$rez["semester"]."' and @lang_first='".$langs_rez["lang_first"]."' and @lang_second='".$langs_rez["lang_second"]."' and @active='true']";
- // echo $exp;
- $elements=$this->xpath->query($exp);
- // print_r($elements->saveXML());
- foreach ($elements as $element) {
- $students+=toCP($element->getAttribute('students_count'));
- $prog[0].=toCP($element->getAttribute('abbr'));
- $prog[0].="\n";
- $prog[3]=toCP($element->getAttribute('study_form'));
- $count+=2.6;
- $group++;
- }
- }
- if ($prog[0]) {
- $prog[1].=$spec;
- $prog[2]=$rez["title"];
- if ($prog[4]=$rez["exam"])$stat[4]++;
- if ($prog[5]=$rez["difzach"]) $stat[5]++;
- $stat[14]+=$prog[14]=$rez["lectures"];
- $prog[16]=$rez["seminars"]+$rez["labs"];
- $control->_query("SELECT * FROM control WHERE program_id = '".$rez["id"]."' ORDER BY week");
- $week = 0;
- $vol='';
- while ($control_rez=$control->_getResultArray()) {
- while ($control_rez["week"] != $week++) {
- }
- switch ($control_rez["control_type"]) {
- case "КУ": $stat[6]++;$prog[6]=$control_rez["control_type"]; break;
- case "Р ": $stat[7]++;$prog[7]=$control_rez["control_type"]; break;
- case "ПЗ":
- case "КР":
- case "КЗ": $prog[16]+=$control_rez["vol"]; break;
- }
- }
- $prog[0] = trim($prog[0]);
- $stat[12]+=$prog[12] = $students;
- $stream = intval($students/100)+(fmod($students,100)?1:0);
- $prog[13] = $group." (".$stream.")";
- $stat[15]+=$prog[15] = $rez["lectures"]*$stream;
- $stat[17]+=$prog[17] = $prog[16]*$group;
- $stat[16]+=$prog[16];
- $x=$this->GetX();
- $y=$this->GetY();
- $buttom=$y+$baseHeight/2+$count;
- // echo $prog[0]."<br>";
- if ($buttom > 277) { $this->AddPage();
- $x=$this->GetX();
- $y=$this->GetY();
- }
- for ($i=0;$i<count($width);$i++) {
- $X=$this->GetX();
- $Y=$this->GetY();
- // echo "b: $buttom Y: ".$y." COUNT: ".$count." Pn: ".$this->PageNo()."<br>";
- $this->MultiCell($width[$i]*$baseWidth,$baseHeight/2+$count,$prog[$i],1,3,($i==1 || $i==2)?'L':'C');
- $this->SetXY($X+$width[$i]*$baseWidth, $Y);
- // $this->MultiCell($width[$i]*$baseWidth,$count*$baseHeight/2,$prog[$i],$count*$baseHeight/2,3,($i==1 || $i==2)?'L':'C');
- // $this->Cell($width[$i]*$baseWidth,$baseHeight/2,$prog[$i],1,0,($i==1 || $i==2)?'L':'C');
- }
- $this->ln();
- $this->SetY($y+$count+$baseHeight/2);
- }
- }
- // $this->SetXY($x,$y);
- for ($i=0;$i<count($width);$i++) {
- $this->Cell($width[$i]*$baseWidth,$baseHeight/2,"",1,0,($i==1 || $i==2)?'L':'C',1);
- }
- $this->ln();
-
- // for ($i=0;$i<17;$i++) $sum[$i]=0;
- for ($i=0;$i<count($width);$i++) {
- $this->Cell($width[$i]*$baseWidth,$baseHeight/2,$stat[$i],1,0,($i==1 || $i==2)?'L':'C',1);
- $this->total[$i] += $stat[$i];
- }
- $this->ln();
- }
- }
- class OTR extends MyPDF {
- public $baseWidth = 9;
- public $baseHeight = 9;
- public $lf = '';
- public $ls = '';
-
- function Footer() {
- $baseWidth = $this->baseWidth;
- $baseHeight = $this->baseHeight;
- $this->Cell($full*$baseWidth,$baseHeight,"Обозначение контрольных мероприятий (КМ): КР - Контрольная работа КМ - Контрольное мероприятие ДЗ - домашнее задание Р - Реферат КУ - Курсовая работа ВР - Квалификационная работа КЗ - Контрольное занятие",0,0,'L');
- }
- function PrintTitle($year,$subfaculty,$speciality,$semester,$lang_first,$lang_second,$prog_weeks=19) {
- $exp="//lang[@index='$lang_first' or @index='$lang_second']";
- // echo $exp;
- $lang = '';
- $elements=$this->xpath->query($exp);
- foreach ($elements as $element) {
-
- $lang[]=toCP($element->getAttribute('titleshort'));
- }
-
- $baseWidth = $this->baseWidth;
- $baseHeight = 5;
- //Выводим логотип
- //$this->Image($image,6,6,40,20);
- $this->SetFont('TimesNewRomanPSMT','',12);
- $X=$this->GetX();
- $this->Cell($full*$baseWidth, $baseHeight, 'Форма 3',0,0,'R');
- //Переходим на следующую строку
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- //Выводим наименование компании
- $this->SetXY($X, $this->GetY());
- $this->Cell($full*$baseWidth, $baseHeight, 'Министерство образования и науки Российской Федерации',0,3,'C');
- $this->Cell($full*$baseWidth, $baseHeight, 'Государственное образовательное учреждение высшего профессионального образования',0,3,'C');
- $this->Cell($full*$baseWidth, $baseHeight, toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('name')).' ('.toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('abbr')).')',0,3,'C');
- //Выводим наименование компании
- $this->Cell(20*$baseWidth,$baseHeight,'Утверждаю',0,0,'L');
- //Переходим на следующую строку
- $this->Ln();
- $this->Cell(20*$baseWidth,$baseHeight,'Проректор по учебной работе',0,0,'L');
- //Переходим на следующую строку
- $this->Ln();
- //Устанавливаем шрифт для наименования компании
- $this->SetFont('TimesNewRomanPSMT','',12);
- //Выводим наименование компании
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(25*$baseWidth,$baseHeight,'Рабочий учебный план на '.$year.'/'.($year+1).' учебный год',0,0,'R');
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Cell(5*$baseWidth,$baseHeight,'Специальность ',0,0,'R');
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(5*$baseWidth,$baseHeight,$speciality." (".$lang[0]."/".$lang[1].")",0,0,'L');
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Cell(3*$baseWidth,$baseHeight,'Кафедра ',0,0,'R');
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(2*$baseWidth,$baseHeight,$subfaculty,0,0,'L');
- $this->SetFont('TimesNewRomanPSMT','',12);
- $this->Cell(2*$baseWidth,$baseHeight,'Курс ',0,0,'R');
- $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
- $this->Cell(1*$baseWidth,$baseHeight,round($semester/2),0,0,'L');
- $this->SetFont('TimesNewRomanPSMT','',12);
- //Переходим на следующую строку
- $this->Ln();
- //Делаем отступ от левого края (рисуя прозрачную ячейку)
- // $this->Cell(37);
- //Устанавливаем цвет заливки следующих ячеек (R,G,B)
- // $this->SetFillColor(209,204,244);
- //Устанавливаем шрифт для наименования документа
- // $this->SetFont('Verdana','',12);
- //Выводим наименование документа
- // $this->Cell(150,8,$title,0,0,'C',1);
- //Переходим на следующую строку
- $this->Ln();
- //Устанавливаем шрифт заголовка таблицы
- $graf = Array(6.7,2.8,2,5,4.5,4.5,4.5,4.5,4.5,4.5);
- $old = $baseHeight;
- $baseHeight = 2*$baseHeight;
- $this->SetFont('TimesNewRomanPS-BoldMT','B',10);
- $this->MultiCell($graf[0]*$baseWidth+5,$baseHeight,"Группа (колличество)",1,3,'C');
- $this->MultiCell($graf[1]*$baseWidth,$baseHeight,"Кол-во\nстудентов",1,3,'C');
- $this->MultiCell($graf[2]*$baseWidth,$baseHeight,"Семестр",1,3,'C');
- $this->MultiCell($graf[3]*$baseWidth,$baseHeight,"Период проведения\nпрактических занятий",1,3,'C');
- $this->MultiCell($graf[4]*$baseWidth,$baseHeight,"Зачетная неделя\n(зачеты, диф.зачеты)",1,3,'C');
- $this->MultiCell($graf[6]*$baseWidth,$baseHeight,"Экзаменационная\nсессия",1,3,'C');
- $this->MultiCell($graf[5]*$baseWidth,$baseHeight,"Подготовка выпускной\nквалификац. работы",1,3,'C');
- $this->MultiCell($graf[7]*$baseWidth,$baseHeight,"Итоговая\nгос. аттестация",1,3,'C');
- $this->MultiCell($graf[7]*$baseWidth,$baseHeight,"Практика, недель",1,3,'C');
- $this->MultiCell($graf[8]*$baseWidth,$baseHeight,"Каникулы, период",1,3,'C');
- $this->Ln();
- $thi…
Large files files are truncated, but you can click here to view the full file