/plan/print.class.php
https://github.com/melnik/Contingent · PHP · 1714 lines · 1560 code · 54 blank · 100 comment · 77 complexity · 36221d5d7ea250b101009f76d83fe229 MD5 · raw file
Large files are truncated 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…