PageRenderTime 66ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/plan/print.class.php

https://github.com/melnik/Contingent
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

  1. <?php
  2. ini_set('max_execution_time', '120');
  3. require_once('pgsql.class.php');
  4. require_once('html.class.php');
  5. define(SESSIONID,4);
  6. ini_set("soap.wsdl_cache_enabled", "0");
  7. //$client = new SoapClient( "http://contingent.bmstu.ru:82/contingent.wsdl", array("trace" => 1) );
  8. //$client = new SoapClient( "http://work.e-u.bmstu.ru/contingent/contingent.wsdl", array("trace" => 0) );//ЯЕПБХЯ ЯРСДЕМРНБ
  9. function toCP($str='') {
  10. return iconv("UTF-8", "CP1251", $str);
  11. }
  12. function toUTF($str='') {
  13. return iconv("CP1251", "UTF-8", $str);
  14. }
  15. class stud
  16. {
  17. }
  18. class listStudentsRequest {
  19. var $lastName;
  20. var $firstName;
  21. var $middleName;
  22. var $group;
  23. var $cardNumber;
  24. function listStudentsRequest($lastName, $firstName, $middleName, $group, $cardNumber)
  25. {
  26. $this->lastName = $lastName;
  27. $this->firstName = $firstName;
  28. $this->middleName = $middleName;
  29. $this->group = $group;
  30. $this->cardNumber = $cardNumber;
  31. }
  32. }
  33. function ListByGroup( $client, $group, $_lastname=NULL, $_firstname=NULL, $_middlename=NULL, $_pcn=NULL )
  34. {
  35. return 10;
  36. $count = 0;
  37. // $client = new SoapClient( "http://work.e-u.bmstu.ru/contingent/contingent.wsdl", array('trace'=>1) );
  38. try
  39. {
  40. $gr = explode(" ",toUTF($group));
  41. for ($i=0;$i<count($gr);$i++) {
  42. //echo $gr[$i];
  43. $student = $client->listStudents(new listStudentsRequest( NULL, NULL, NULL, $gr[$i], NULL ))->student;
  44. //var_dump($student);
  45. $count += count($student);
  46. // echo $count;
  47. }
  48. }
  49. catch(Exception $e)
  50. {
  51. print_r($e);
  52. return false;
  53. }
  54. return $count;
  55. }
  56. function comparePrograms($id, $pid) {
  57. if ($id == '00000000-0000-0000-0000-000000000000' || $pid == '00000000-0000-0000-0000-000000000000') return 1000;
  58. $count='0';
  59. $ret = 0;
  60. $pg_cmp = new pgsql();
  61. $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')");
  62. while ($rez = $pg_cmp->_getResult())
  63. $count++;
  64. if ($count != 1) {
  65. $ret.='1';
  66. } else $ret.='0';
  67. $count=0;
  68. $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'");
  69. while ($rez = $pg_cmp->_getResult())
  70. $count++;
  71. if ($count != 1) {
  72. $ret.=1;
  73. }
  74. else $ret.='0';
  75. $count=0;
  76. $pg_cmp->_query("SELECT control_type, control_title, week, vol FROM control WHERE program_id = '$id'");
  77. while ($rez = $pg_cmp->_getResult())
  78. $count++;
  79. $pcount=0;
  80. $pg_cmp->_query("SELECT control_type, control_title, week, vol FROM control WHERE program_id = '$pid'");
  81. while ($rez = $pg_cmp->_getResult())
  82. $pcount++;
  83. $dcount=0;
  84. $pg_cmp->_query("SELECT DISTINCT control_type, control_title, week, vol FROM control WHERE program_id = '$id' OR program_id = '$pid'");
  85. while ($rez = $pg_cmp->_getResult())
  86. $dcount++;
  87. if ($count != $pcount || $count!= $dcount) {
  88. $ret.=1;
  89. } else $ret.='0';
  90. return $ret;
  91. }
  92. function dateto ($date) {
  93. $ret = '';
  94. $arr = explode('-',$date);
  95. for ($i=2;$i>-1;$i--) $ret.=$arr[$i].(($i!=0)?'-':'');
  96. return $ret;
  97. }
  98. function getGroup($subfaculty, $semester, $speciality) {
  99. $i=-1;
  100. $ret[0] = '';
  101. $ret[1] = '';
  102. $parsed = simplexml_load_file('struct.xml');
  103. while(($current_faculty = $parsed->faculty[++$i])) {
  104. $j=-1;
  105. // echo $this->toKOI($current_faculty['abbr'])."<br>";
  106. while($current_subfaculty = $current_faculty->subfaculty[++$j]) {
  107. $k=-1;
  108. // echo "---".$this->toKOI($current_subfaculty['abbr'])."<br>";
  109. if ($subfaculty == toCP($current_subfaculty['abbr']))
  110. while ($current_group = $current_subfaculty->group[++$k]) {
  111. if ($current_group['speciality_code'] == $speciality && $current_group['semester'] == $semester) {
  112. $ret[0] .= $current_subfaculty->group[$k]['id']." ";
  113. $ret[1] .= toCP($current_subfaculty->group[$k]['abbr'])." ";
  114. }
  115. }
  116. }
  117. }
  118. $ret[0] = rtrim($ret[0]);
  119. $ret[1] = rtrim($ret[1]);
  120. return $ret;
  121. }
  122. class MyPDF extends FPDF {
  123. public $xml;
  124. public $xpath;
  125. function __construct($orientation='P',$unit='mm',$format='A4') {
  126. // Загружаем справочники
  127. $this->xml = new DOMDocument('1.0', 'UTF-8');
  128. $this->xml->appendChild($this->xml->createElement('content'));
  129. //Структура
  130. $structure = new DOMDocument('1.0', 'UTF-8');
  131. $file = "xml/structure".$_GET["year"].".xml";
  132. $rez = $structure->load($file);
  133. if (!$rez)
  134. $rez = $structure->load('xml/structute.xml');
  135. if (!$rez) echo "Не возможно подключить справочник \"Структура университета\"";
  136. $node=$this->xml->importNode($structure->getElementsByTagName("structure")->item(0), true);
  137. $this->xml->documentElement->appendChild($node);
  138. //Даты
  139. $structure = new DOMDocument('1.0', 'UTF-8');
  140. $file = "dates/dates".$_GET["year"].".xml";
  141. $rez = $structure->load($file);
  142. if (!$rez)
  143. $rez = $structure->load('struct.xml');
  144. if (!$rez) echo "Не возможно подключить справочник \"Организация учебного процесса\"";
  145. $node=$this->xml->importNode($structure->getElementsByTagName("year_organize")->item(0), true);
  146. $this->xml->documentElement->appendChild($node);
  147. //Специальности
  148. $structure = new DOMDocument('1.0', 'UTF-8');
  149. $rez = $structure->load('speciality.xml');
  150. if (!$rez) echo "Не возможно подключить справочник специальностей";
  151. $node=$this->xml->importNode($structure->getElementsByTagName("specialities")->item(0), true);
  152. $this->xml->documentElement->appendChild($node);
  153. //Языки
  154. $structure = new DOMDocument('1.0', 'UTF-8');
  155. $rez = $structure->load('lang.xml');
  156. if (!$rez) echo "Не возможно подключить справочник языков";
  157. $node=$this->xml->importNode($structure->getElementsByTagName("languages")->item(0), true);
  158. $this->xml->documentElement->appendChild($node);
  159. $this->xpath = new DOMXpath($this->xml);
  160. // echo $this->xml->saveXML();
  161. FPDF::__construct($orientation,$unit,$format);
  162. }
  163. function getDate($week, $semester, $year) {
  164. $semester = (fmod($semester,2)==0)?2:1;
  165. $exp="//year[@semester='$semester']";
  166. // echo $exp;
  167. $org = '';
  168. $elements=$this->xpath->query($exp);
  169. foreach ($elements as $element) {
  170. $org[0]=toCP($element->getAttribute('begin'));
  171. $org[1]=toCP($element->getAttribute('end'));
  172. }
  173. print_r($org);
  174. }
  175. function writeRotie($x,$y,$txt,$text_angle,$font_angle = 0)
  176. {
  177. if ($x < 0) {
  178. $x += $this->w;
  179. }
  180. if ($y < 0) {
  181. $y += $this->h;
  182. }
  183. /* Escape text. */
  184. $text = $this->_escape($txt);
  185. $font_angle += 90 + $text_angle;
  186. $text_angle *= M_PI / 180;
  187. $font_angle *= M_PI / 180;
  188. $text_dx = cos($text_angle);
  189. $text_dy = sin($text_angle);
  190. $font_dx = cos($font_angle);
  191. $font_dy = sin($font_angle);
  192. $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);
  193. if($this->underline && $txt!='')
  194. $s.=' '.$this->_dounderline($x,$y,$txt);
  195. if($this->ColorFlag)
  196. $s='q '.$this->TextColor.' '.$s.' Q';
  197. $this->_out($s);
  198. }
  199. public function MultiCell($width,$height,$text,$padding,$dist,$align) {
  200. $x=$this->GetX();
  201. $y=$this->GetY();
  202. $data_array=split("\n",$text);
  203. $this->Rect($x, $y, $width, $height);
  204. for($i=0;$i<count($data_array);$i++) {
  205. $this_x=$x+$padding;//+$width/2-$this->GetStringWidth(trim($data_array[$i]))/2;
  206. if($align == 'C') $this_x = $x+$width/2-$this->GetStringWidth(trim($data_array[$i]))/2;
  207. $this_y=$y+$padding+3;
  208. $this->Text($this_x,$this_y+$i*$dist,$data_array[$i]);
  209. }
  210. $this->SetXY($x+$width,$y);
  211. }
  212. }
  213. class ZAP extends MyPDF {
  214. public $baseWidth = 10;
  215. public $baseHeight = 5;
  216. public $subfaculty = '';
  217. function PrintZap($record_number, $record_date, $year) {
  218. $baseWidth = $this->baseWidth;
  219. $baseHeight = $this->baseHeight;
  220. $full = 18;
  221. $this->SetFont('TimesNewRomanPSMT','',12);
  222. //Переходим на следующую строку
  223. $this->Ln();
  224. $this->Cell(12*$baseWidth, $baseHeight, $record_number."/".$record_date,0,0,'L');
  225. // $this->SetXY($this->GetX()+12*$baseWidth,$this->GetY()+$baseHeight);
  226. $this->Cell(5*$baseWidth, $baseHeight, 'Проректору по учебной работе',0,0,'C');
  227. $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
  228. $this->Cell(5*$baseWidth, $baseHeight, '',0,0,'C');
  229. $this->Ln();
  230. $this->SetY($this->GetY()+14*$baseHeight);
  231. $this->Cell($full*$baseWidth, $baseHeight, 'Служебная записка',0,0,'C');
  232. $this->Ln();
  233. $this->Ln();
  234. $this->Write($baseHeight," Прошу разрешить внести следующие изменения в рабочие учебные планы на $year/".($year+1)." учебный год:\n");
  235. $this->Ln();
  236. $num = 0;
  237. $this->Write($baseHeight," Изменить дисциплину(ы):\n");
  238. $pg = new pgsql();
  239. $pg->_query("SET client_encoding TO 'WIN1251'");
  240. $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'");
  241. while ($rez=$pg->_getResult()) {
  242. $year=$rez['year'];
  243. $semester=$rez['semester'];
  244. $weeks=$rez['weeks'];
  245. $lectures=$rez['lectures'];
  246. $seminars=$rez['seminars'];
  247. $seminarscount=$rez['seminarscount'];
  248. $labs=$rez['labs'];
  249. $labscount=$rez['labscount'];
  250. $individual=$rez['individual'];
  251. $zach=$rez['zach'];
  252. $zach_count=$rez['zach_count'];
  253. $difzach=$rez['difzach'];
  254. $exam=$rez['exam'];
  255. $uuid=$rez['discipline_id'];
  256. $subfac=$rez['subfaculty_for'];
  257. $spec=$rez['speciality_for'];
  258. $subfaculty=$rez['subfaculty'];
  259. $title=str_replace("&#8470;","№",$rez['discipline_title']);
  260. $id = $rez['program_id'];
  261. $f_id = $rez['parent_id'];
  262. $cmp = comparePrograms($id, $f_id);
  263. $first = 0;
  264. $chg = Array("название","виды учебных работ","контрольные мероприятия");
  265. $msg = '';
  266. for ($i = 1; $i < 4; $i++)
  267. if ($cmp[$i]=='1') {
  268. if (!$first) $first=1;
  269. else $msg.=", ";
  270. $msg.=$chg[$i-1];
  271. }
  272. $msg.="; в связи с (указать причину):";
  273. $this->Write($baseHeight,++$num.".\"$title\" для специальности $spec кафедры $subfac, $semester семестр; изменения: $msg\n");
  274. $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
  275. $this->Ln();
  276. $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
  277. $this->Ln();
  278. $this->Ln();
  279. }
  280. (!$num) ? $this->Write($baseHeight," - \n") : "";
  281. $num = 0;
  282. $this->Write($baseHeight," Добавить дисциплину(ы):\n");
  283. $pg = new pgsql();
  284. $pg->_query("SET client_encoding TO 'WIN1251'");
  285. $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'");
  286. while ($rez=$pg->_getResult()) {
  287. $year=$rez['year'];
  288. $semester=$rez['semester'];
  289. $weeks=$rez['weeks'];
  290. $lectures=$rez['lectures'];
  291. $seminars=$rez['seminars'];
  292. $seminarscount=$rez['seminarscount'];
  293. $labs=$rez['labs'];
  294. $labscount=$rez['labscount'];
  295. $individual=$rez['individual'];
  296. $zach=$rez['zach'];
  297. $zach_count=$rez['zach_count'];
  298. $difzach=$rez['difzach'];
  299. $exam=$rez['exam'];
  300. $uuid=$rez['discipline_id'];
  301. $subfac=$rez['subfaculty_for'];
  302. $spec=$rez['speciality_for'];
  303. $title=str_replace("&#8470;","№",$rez['discipline_title']);
  304. $subfaculty=$rez['subfaculty'];
  305. $this->Write($baseHeight,++$num.". \"$title\" для специальности $spec кафедры $subfac, $semester семестр; в связи с (указать причину):\n");
  306. $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
  307. $this->Ln();
  308. $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
  309. $this->Ln();
  310. $this->Ln();
  311. }
  312. (!$num) ? $this->Write($baseHeight," - \n") : "";
  313. $num = 0;
  314. $this->Write($baseHeight," Удалить дисциплину(ы):\n");
  315. $pg = new pgsql();
  316. $pg->_query("SET client_encoding TO 'WIN1251'");
  317. $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'");
  318. while ($rez=$pg->_getResult()) {
  319. $year=$rez['year'];
  320. $semester=$rez['semester'];
  321. $weeks=$rez['weeks'];
  322. $lectures=$rez['lectures'];
  323. $seminars=$rez['seminars'];
  324. $seminarscount=$rez['seminarscount'];
  325. $labs=$rez['labs'];
  326. $labscount=$rez['labscount'];
  327. $individual=$rez['individual'];
  328. $zach=$rez['zach'];
  329. $zach_count=$rez['zach_count'];
  330. $difzach=$rez['difzach'];
  331. $exam=$rez['exam'];
  332. $uuid=$rez['discipline_id'];
  333. $subfac=$rez['subfaculty_for'];
  334. $spec=$rez['speciality_for'];
  335. $title=str_replace("&#8470;","№",$rez['discipline_title']);
  336. $subfaculty=$rez['subfaculty'];
  337. $this->Write($baseHeight,++$num.". \"$title\" для специальности $spec кафедры $subfac, $semester семестр; в связи с (указать причину):\n");
  338. $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
  339. $this->Ln();
  340. $this->Cell($full*$baseWidth, $baseHeight, '','B',0,'C');
  341. $this->Ln();
  342. $this->Ln();
  343. }
  344. (!$num) ? $this->Write($baseHeight," - \n") : "";
  345. $this->Ln();
  346. $this->Write($baseHeight," Изменения в дисциплины будут внесены в рабочие программы до начала учебного семестра.");
  347. $this->Ln();
  348. $this->Cell($full*$baseWidth, $baseHeight, "Заведующий кафедрой $subfaculty",0,0,'L');
  349. $pg = new pgsql();
  350. $pg->_query("SET client_encoding TO 'WIN1251'");
  351. $pg->_query("SELECT program_id as id FROM prog_status WHERE record_number=$record_number AND record_date='$record_date' AND deleted = 0");
  352. while ($rez=$pg->_getResult()) {
  353. $this->AddPage();
  354. PROG::PrintProg($rez["id"]);
  355. }
  356. }
  357. }
  358. class PROG extends MyPDF {
  359. public $baseWidth = 10;
  360. public $baseHeight = 5;
  361. function PrintProg($id) {
  362. $a=$kr=$krcount=$kz=$kzcount=$r=$rcount=$ku=$kucount=$dz=$dzcount=$sr=0;
  363. $baseWidth = $this->baseWidth;
  364. $baseHeight = 1.1*$this->baseHeight;
  365. $tbl = array(12,3,3);
  366. $full = 0;
  367. for ($i=0;$i<3;$i++)
  368. $full += $tbl[$i];
  369. $pg = new pgsql();
  370. $pg->_query("SET client_encoding TO 'WIN1251'");
  371. $pg->_query("SELECT * from prog WHERE program_id='$id'" );
  372. $rez=$pg->_getResult();
  373. $year=$rez['year'];
  374. $semester=$rez['semester'];
  375. $weeks=$rez['weeks'];
  376. $a+=$lectures=$rez['lectures'];
  377. $lecturescount=$rez['lecturescount'];
  378. $a+=$seminars=$rez['seminars'];
  379. $seminarscount=$rez['seminarscount'];
  380. $a+=$labs=$rez['labs'];
  381. $labscount=$rez['labscount'];
  382. $individual=$rez['individual'];
  383. $zach=$rez['zach'];
  384. $zach_count=$rez['zach_count'];
  385. $difzach=$rez['difzach'];
  386. $exam=$rez['exam'];
  387. // $memo=$rez['memo'];
  388. $uuid=$rez['discipline_id'];
  389. $subfac=$rez['subfaculty_for'];
  390. $subfac_id=$rez['subfaculty_for_id'];
  391. $spec=$rez['speciality_for'];
  392. $practice=$rez['practice'];
  393. // $lang_first=$rez['lang_first'];
  394. // $lang_second=$rez['lang_second'];
  395. $pg->_query("SELECT * from lang WHERE f_id='$id'" );
  396. $langs=$pg->_getResultAll();
  397. $pg->_query("SELECT * from dis WHERE discipline_id='$uuid'" );
  398. $rez=$pg->_getResult();
  399. $code=$rez['discipline_code'];
  400. $titleShort=str_replace("&#8470;","№",$rez['discipline_titleshort']);
  401. $title=str_replace("&#8470;","№",$rez['discipline_title']);
  402. $disSubfaculty=$rez['subfaculty'];
  403. $pg->_query("SELECT * from prog_status WHERE program_id='$id'" );
  404. $rez=$pg->_getResult();
  405. $record=$rez["record"];
  406. $record_number=$rez["record_number"];
  407. $record_date=$rez["record_date"];
  408. /* $pg->_query("SELECT * from memo WHERE program_id='$id'" );
  409. $rez=$pg->_getResult();
  410. $memo=$rez['annotation'];
  411. $lecturesMemo=$rez['lectures'];
  412. $seminarsMemo=$rez['seminars'];
  413. $labsMemo=$rez['labs'];
  414. $individualMemo=$rez['individual'];
  415. $literatureMemo=$rez['literature'];
  416. $dzMemo=$rez['dz'];
  417. $rkMemo=$rez['rk'];
  418. $krMemo=$rez['kr'];
  419. $dzMemo=$rez['zach'];
  420. $rkMemo=$rez['difzach'];
  421. $krMemo=$rez['exam'];
  422. */ $pg->_query("SELECT * from control WHERE program_id='$id' ORDER BY week" );
  423. $count=0;
  424. while ($rez=$pg->_getResult()) {
  425. $control[$count]["week"] = $rez["week"];
  426. $control[$count]["type"] = $rez["control_type"];
  427. $control[$count]["vol"] = $rez["vol"];
  428. $count++;
  429. switch ($rez["control_type"]) {
  430. case "КР": $kr+=$rez["vol"]; $krcount++; break;
  431. case "КЗ": $kz+=$rez["vol"]; $kzcount++; break;
  432. case "Р": $ind+=$r+=$rez["vol"];$rcount++;break;
  433. case "КУ": $ind+=$ku+=$rez["vol"];$kucount++;break;
  434. case "ДЗ": $ind+=$dz+=$rez["vol"];$dzcount++;break;
  435. }
  436. }
  437. $a+=$kz+$kr;
  438. /* $exp="//lang[@index='$lang_first' or @index='$lang_second']";
  439. // echo $exp;
  440. $lang = '';
  441. $elements=$this->xpath->query($exp);
  442. foreach ($elements as $element) {
  443. $lang[]=toCP($element->getAttribute('titleshort'));
  444. }
  445. */
  446. $l = '';
  447. $groups="";
  448. foreach ($langs as $lang) {
  449. $exists=0;
  450. $exp="//group[@speciality_code = '$spec' and @semester = '$semester' and @lang_first='".$lang["lang_first"]."' and @lang_second='".$lang["lang_second"]."' and @active='true']";
  451. // echo $exp;
  452. $elements=$this->xpath->query($exp);
  453. // print_r($elements->saveXML());
  454. foreach ($elements as $element) {
  455. $exists++;
  456. $groups.=toCP($element->getAttribute('abbr'));
  457. $groups.=" ";
  458. $study_form = toCP($element->getAttribute('study_form'));
  459. }
  460. if ($exists) {
  461. $exp_f="//lang[@index='".$lang["lang_first"]."']";
  462. $exp_s="//lang[@index='".$lang["lang_second"]."']";
  463. $elements=$this->xpath->query($exp_f);
  464. foreach ($elements as $element) {
  465. $l.=toCP($element->getAttribute('titleshort'));
  466. }
  467. $l.="/";
  468. $elements=$this->xpath->query($exp_s);
  469. foreach ($elements as $element) {
  470. $l.=toCP($element->getAttribute('titleshort'));
  471. }
  472. $l.=" ";
  473. }
  474. // $langs = $lang[0]."/".$lang[1];
  475. $langs = $l;
  476. }
  477. $this->SetFont('TimesNewRomanPSMT','',12);
  478. $this->Cell($full*$baseWidth, $baseHeight, 'Форма 1',0,0,'R');
  479. //Переходим на следующую строку
  480. $this->Ln();
  481. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  482. //Выводим наименование компании
  483. $this->Cell($full*$baseWidth, $baseHeight, 'Министерство образования и науки Российской Федерации',0,0,'C');
  484. //Переходим на следующую строку
  485. $this->Ln();
  486. $this->Cell($full*$baseWidth, $baseHeight, 'Государственное образовательное учреждение высшего профессионального образования',0,3,'C');
  487. $this->Cell($full*$baseWidth, $baseHeight, toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('name')),0,3,'C');
  488. $this->Cell($full*$baseWidth, $baseHeight, '('.toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('abbr')).')','B',3,'C');
  489. $this->SetFont('TimesNewRomanPSMT','',12);
  490. //Переходим на следующую строку
  491. $this->Cell(5*$baseWidth, $baseHeight, (($record)? $record_number."/".$record_date : ""),0,0,'C');
  492. $this->SetXY($this->GetX()+7*$baseWidth,$this->GetY());
  493. $this->Cell(5*$baseWidth, $baseHeight, '"Утверждаю"',0,0,'C');
  494. $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
  495. $this->Cell(5*$baseWidth, $baseHeight, 'Проректор по учебной работе',0,0,'C');
  496. $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
  497. $this->Cell(5*$baseWidth, $baseHeight, toCP($this->xml->getElementsByTagName("structure")->item(0)->getAttribute('abbr')),0,0,'C');
  498. $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
  499. $this->Cell(5*$baseWidth, $baseHeight, '_________________',0,0,'C');
  500. $this->SetXY($this->GetX()-5*$baseWidth,$this->GetY()+$baseHeight);
  501. $this->Cell(5*$baseWidth, $baseHeight, '"____""__________" '.date('Y').' г.',0,0,'C');
  502. $this->Ln();
  503. $this->Ln();
  504. $this->Cell($full*$baseWidth, $baseHeight, 'Выписка из рабочей программы учебной дициплины',0,0,'C');
  505. //Переходим на следующую строку
  506. $this->Ln();
  507. $y = $this->GetY();
  508. $this->SetFont('TimesNewRomanPS-BoldMT','B',14);
  509. //Выводим наименование компании
  510. FPDF::MultiCell(0, $baseHeight, $title,0,'C',0);
  511. //Переходим вниз на 4 строки
  512. // $this->SetY($y+4*$baseHeight);
  513. $this->SetFont('TimesNewRomanPSMT','',12);
  514. $this->Cell($full*$baseWidth, $baseHeight, 'Учебный год '.$year.'/'.($year+1).' Семестр '.$semester.' Недель '.$weeks,0,0,'C');
  515. //Переходим на следующую строку
  516. $this->Ln();
  517. $this->Cell($full*$baseWidth, $baseHeight, 'Для специальности '.$spec.' Кафедры '.$subfac.' Читает '.$disSubfaculty,0,0,'C');
  518. //Переходим на следующую строку
  519. $this->Ln();
  520. $this->Cell($full*$baseWidth, $baseHeight, ' Группа(ы) '.$groups,0,0,'C');
  521. //Переходим на следующую строку
  522. $this->Ln();
  523. //Переходим на следующую строку
  524. $this->Cell($full*$baseWidth, $baseHeight, ' Языки '.$langs,0,0,'C');
  525. $this->Ln();
  526. $this->SetX($this->GetX()+2*$baseWidth);
  527. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  528. $this->Cell(8*$baseWidth, $baseHeight,'Виды учебных работ',1,0,'C');
  529. $this->Cell(3*$baseWidth, $baseHeight,'Обьем, час',1,0,'C');
  530. $this->Cell(3*$baseWidth, $baseHeight,'Количество',1,0,'C');
  531. //Переходим на следующую строку
  532. $this->Ln();
  533. $this->SetX($this->GetX()+2*$baseWidth);
  534. $this->Cell(8*$baseWidth, $baseHeight,'Аудиторный занятия (А), в т.ч.:',1,0,'L');
  535. $this->Cell(3*$baseWidth, $baseHeight,$a,1,0,'C');
  536. $this->Cell(3*$baseWidth, $baseHeight,'',1,0,'C');
  537. //Переходим на следующую строку
  538. $this->Ln();
  539. $this->SetX($this->GetX()+2*$baseWidth);
  540. $this->SetFont('TimesNewRomanPSMT','',12);
  541. $this->Cell(8*$baseWidth, $baseHeight,'Лекции (Л)',1,0,'L');
  542. $this->Cell(3*$baseWidth, $baseHeight,$lectures,1,0,'C');
  543. $this->Cell(3*$baseWidth, $baseHeight,$lecturescount,1,0,'C');
  544. //Переходим на следующую строку
  545. $this->Ln();
  546. $this->SetX($this->GetX()+2*$baseWidth);
  547. $this->Cell(8*$baseWidth, $baseHeight,'Семинары (С)',1,0,'L');
  548. $this->Cell(3*$baseWidth, $baseHeight,$seminars,1,0,'C');
  549. $this->Cell(3*$baseWidth, $baseHeight,$seminarscount,1,0,'C');
  550. //Переходим на следующую строку
  551. $this->Ln();
  552. $this->SetX($this->GetX()+2*$baseWidth);
  553. $this->Cell(8*$baseWidth, $baseHeight,'Практическое занятие (ПЗ)',1,0,'L');
  554. $this->Cell(3*$baseWidth, $baseHeight,$labs,1,0,'C');
  555. $this->Cell(3*$baseWidth, $baseHeight,$labscount,1,0,'C');
  556. //Переходим на следующую строку
  557. $this->Ln();
  558. $this->SetX($this->GetX()+2*$baseWidth);
  559. $this->Cell(8*$baseWidth, $baseHeight,'Контрольная работа (КР)',1,0,'L');
  560. $this->Cell(3*$baseWidth, $baseHeight,$kr,1,0,'C');
  561. $this->Cell(3*$baseWidth, $baseHeight,$krcount,1,0,'C');
  562. //Переходим на следующую строку
  563. $this->Ln();
  564. $this->SetX($this->GetX()+2*$baseWidth);
  565. $this->Cell(8*$baseWidth, $baseHeight,'Контрольное занятие (КЗ)',1,0,'L');
  566. $this->Cell(3*$baseWidth, $baseHeight,$kz,1,0,'C');
  567. $this->Cell(3*$baseWidth, $baseHeight,$kzcount,1,0,'C');
  568. //Переходим на следующую строку
  569. $this->Ln();
  570. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  571. $this->SetX($this->GetX()+2*$baseWidth);
  572. $this->Cell(8*$baseWidth, $baseHeight,'Самостоятельная работа (СР), в т.ч.:',1,0,'L');
  573. $this->Cell(3*$baseWidth, $baseHeight,$individual,1,0,'C');
  574. $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
  575. //Переходим на следующую строку
  576. $this->Ln();
  577. $this->SetFont('TimesNewRomanPSMT','',12);
  578. $this->SetX($this->GetX()+2*$baseWidth);
  579. $this->Cell(8*$baseWidth, $baseHeight,'Реферат (Р)',1,0,'L');
  580. $this->Cell(3*$baseWidth, $baseHeight,$r,1,0,'C');
  581. $this->Cell(3*$baseWidth, $baseHeight,$rcount,1,0,'C');
  582. //Переходим на следующую строку
  583. $this->Ln();
  584. $this->SetX($this->GetX()+2*$baseWidth);
  585. $this->Cell(8*$baseWidth, $baseHeight,'Курсовая работа (КУ)',1,0,'L');
  586. $this->Cell(3*$baseWidth, $baseHeight,$ku,1,0,'C');
  587. $this->Cell(3*$baseWidth, $baseHeight,$kucount,1,0,'C');
  588. //Переходим на следующую строку
  589. $this->Ln();
  590. $this->SetX($this->GetX()+2*$baseWidth);
  591. $this->Cell(8*$baseWidth, $baseHeight,'Домашнее задание (ДЗ)',1,0,'L');
  592. $this->Cell(3*$baseWidth, $baseHeight,$dz,1,0,'C');
  593. $this->Cell(3*$baseWidth, $baseHeight,$dzcount,1,0,'C');
  594. //Переходим на следующую строку
  595. $this->Ln();
  596. $this->SetX($this->GetX()+2*$baseWidth);
  597. $this->Cell(8*$baseWidth, $baseHeight,'Другие виды работ',1,0,'L');
  598. $this->Cell(3*$baseWidth, $baseHeight,$individual-$ind,1,0,'C');
  599. $this->Cell(3*$baseWidth, $baseHeight,'',1,0,'C');
  600. //Переходим на следующую строку
  601. $this->Ln();
  602. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  603. $this->SetX($this->GetX()+2*$baseWidth);
  604. $this->Cell(8*$baseWidth, $baseHeight,'Учебная работа (УР = А + СР) студента',1,0,'L');
  605. $this->Cell(3*$baseWidth, $baseHeight,$ur=$a+$individual,1,0,'C');
  606. $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
  607. //Переходим на следующую строку
  608. $this->Ln();
  609. $this->SetX($this->GetX()+2*$baseWidth);
  610. $this->Cell(8*$baseWidth, $baseHeight,'Практика (Недели)',1,0,'L');
  611. $this->Cell(3*$baseWidth, $baseHeight,$practice*54,1,0,'C');
  612. $this->Cell(3*$baseWidth, $baseHeight,$practice,1,0,'C');
  613. //Переходим на следующую строку
  614. $this->Ln();
  615. $this->SetX($this->GetX()+2*$baseWidth);
  616. $this->Cell(14*$baseWidth, $baseHeight,'Объем работы студента в период экзаменационной сессии (Э)',1,0,'L');
  617. // $this->Cell(14*$baseWidth, $baseHeight,'Объем работы студента в период экзаменационной сессии, по резултатам практики и за курсовую работу (Э)',1,0,'L');
  618. /* //Переходим на следующую строку
  619. $this->Ln();
  620. $this->SetX($this->GetX()+2*$baseWidth);
  621. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  622. $this->Cell(14*$baseWidth, $baseHeight,'Контроль знаний',1,0,'C');
  623. *///Переходим на следующую строку
  624. $this->Ln();
  625. $this->SetX($this->GetX()+2*$baseWidth);
  626. $this->SetFont('TimesNewRomanPSMT','',12);
  627. $this->Cell(8*$baseWidth, $baseHeight,'Зачет',1,0,'L');
  628. if ($zach=='t') {
  629. $this->SetFont('TimesNewRomanPS-BoldMT','B',12) ;
  630. $this->Cell(3*$baseWidth, $baseHeight,$zachvol=($zach_count=='t')?18:0,1,0,'C');
  631. $this->Cell(3*$baseWidth, $baseHeight,"+",1,0,'C');
  632. $e+=$zachvol;
  633. }
  634. else {
  635. $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
  636. $this->Cell(3*$baseWidth, $baseHeight,"-",1,0,'C');
  637. }
  638. //Переходим на следующую строку
  639. $this->Ln();
  640. $this->SetFont('TimesNewRomanPSMT','',12);
  641. $this->SetX($this->GetX()+2*$baseWidth);
  642. $this->Cell(8*$baseWidth, $baseHeight,'Дифференцированный зачет',1,0,'L');
  643. if ($difzach=='t') {
  644. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  645. $this->Cell(3*$baseWidth, $baseHeight,$zachvol=18,1,0,'C');
  646. $this->Cell(3*$baseWidth, $baseHeight,"+",1,0,'C');
  647. $e+=$zachvol;
  648. }
  649. else {
  650. $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
  651. $this->Cell(3*$baseWidth, $baseHeight,"-",1,0,'C');
  652. }
  653. //Переходим на следующую строку
  654. $this->Ln();
  655. $this->SetFont('TimesNewRomanPSMT','',12);
  656. $this->SetX($this->GetX()+2*$baseWidth);
  657. $this->Cell(8*$baseWidth, $baseHeight,'Экзамен (защита ВКР)',1,0,'L');
  658. if ($exam=='t') {
  659. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  660. $this->Cell(3*$baseWidth, $baseHeight,$exam=36,1,0,'C');
  661. $this->Cell(3*$baseWidth, $baseHeight,"+",1,0,'C');
  662. $e+=$exam;
  663. }
  664. else {
  665. $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
  666. $this->Cell(3*$baseWidth, $baseHeight,"-",1,0,'C');
  667. }
  668. //Переходим на следующую строку
  669. $this->Ln();
  670. $this->SetFont('TimesNewRomanPSMT','',12);
  671. $this->SetX($this->GetX()+2*$baseWidth);
  672. $this->Cell(8*$baseWidth, $baseHeight,'Оценка за курсовую работу',1,0,'L');
  673. if ($ku) {
  674. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  675. $this->Cell(3*$baseWidth, $baseHeight,$zachvol=18,1,0,'C');
  676. $this->Cell(3*$baseWidth, $baseHeight,"+",1,0,'C');
  677. $e+=$zachvol;
  678. }
  679. else {
  680. $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
  681. $this->Cell(3*$baseWidth, $baseHeight,"-",1,0,'C');
  682. }
  683. //Переходим на следующую строку
  684. $this->Ln();
  685. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  686. $this->SetX($this->GetX()+2*$baseWidth);
  687. $this->Cell(8*$baseWidth, $baseHeight,'Теоретическое обучение (ТО = УР + Э)',1,0,'L');
  688. $this->Cell(3*$baseWidth, $baseHeight,$to=$ur+$e,1,0,'C');
  689. $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
  690. //Переходим на следующую строку
  691. $this->Ln();
  692. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  693. $this->SetX($this->GetX()+2*$baseWidth);
  694. $this->Cell(8*$baseWidth, $baseHeight,'В кредитах (ТО/36)',1,0,'L');
  695. $kred=round($to/36,1);
  696. $kred=explode('.',$kred);
  697. // print_r($kred);
  698. if ($kred[1] > 0 && $kred[1] <= 5) $mod=0.5;
  699. elseif ($kred[1] > 5 && $kred[1] < 10) $mod=1;
  700. else $mod=0;
  701. $this->Cell(3*$baseWidth, $baseHeight,$kred[0]+$mod,1,0,'C');
  702. $this->Cell(3*$baseWidth, $baseHeight,"",1,0,'C');
  703. //Переходим на следующую строку
  704. $this->Ln();
  705. $this->Ln();
  706. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  707. $this->Cell($full*$baseWidth, $baseHeight, 'График выполнения контрольных мероприятий (КМ)',0,0,'C');
  708. $this->SetFont('TimesNewRomanPSMT','',12);
  709. $this->Ln();
  710. $baseWidth = 1.25*$baseHeight;
  711. $this->Cell(3*$baseWidth, $baseHeight,'Неделя',1,0,'C');
  712. for ($i = 0; $i<21; $i++) {
  713. $this->Cell($baseWidth, $baseHeight,$i+1,1,0,'C');
  714. }
  715. $this->Ln();
  716. $this->Cell(3*$baseWidth, $baseHeight,'План КМ',1,0,'C');
  717. $count = 0;
  718. for ($i = 0; $i<21; $i++) {
  719. $this->Cell($baseWidth, $baseHeight,($control[$count]["week"]==($i+1))?$control[$count++]["type"]:"",1,0,'C');
  720. }
  721. $this->Ln();
  722. $count = 0;
  723. $this->Cell(3*$baseWidth, $baseHeight,'Объем',1,0,'C');
  724. for ($i = 0; $i<21; $i++) {
  725. $this->Cell($baseWidth, $baseHeight,($control[$count]["week"]==($i+1))?$control[$count++]["vol"]:"",1,0,'C');
  726. }
  727. $this->Ln();
  728. $this->Ln();
  729. if ($subfac!=$disSubfaculty)
  730. $this->Cell(12*$baseWidth, $baseHeight,'Заведующий кафедрой '.$disSubfaculty,0,3,'L');
  731. $this->Cell(12*$baseWidth, $baseHeight,"Заведующий выпускающей кафедрой",0,3,'L');
  732. $this->Cell(12*$baseWidth, $baseHeight,"(руководитель выпускающего межкафедрального объединения)",0,3,'L');
  733. $this->Cell(12*$baseWidth, $baseHeight,'Начальник учебного отдела ',0,3,'L');
  734. }
  735. }
  736. class PLAN extends MyPDF {
  737. public $baseWidth = 9;
  738. public $baseHeight = 9;
  739. public $total = array();
  740. public $br=0;
  741. function PrintPlan($subfaculty,$year) {
  742. $baseWidth = $this->baseWidth;
  743. $baseHeight = 5;
  744. // $width = Array (1,14,1.5,1,1,1,6,1.2,1,1,1,1,2,1,1);
  745. $height = Array (1.1,2.2,4.4,8.8,17.6,35.2);
  746. // $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);
  747. $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);
  748. $width_count=0;
  749. $this->PrintSemester($subfaculty,$year,1);
  750. $this->PrintSemester($subfaculty,$year,2);
  751. for ($i=0;$i<4;$i++) $this->total[$i]='';
  752. $this->total[1]="Итого за год";
  753. for ($i=0;$i<count($width);$i++) {
  754. $this->Cell($width[$i]*$baseWidth,$baseHeight,$this->total[$i],1,0,($i==1 || $i==2)?'L':'C',1);
  755. }
  756. $this->ln();
  757. $this->MultiCell(20*$baseWidth,5*$baesHeight,"Начальник учебного отдела _____________________ \"____\"__________ 20___.' г.",1,3,'L');
  758. $this->MultiCell(20*$baseWidth,5*$baesHeight,"Заведующий кафедрой _____________________ \"____\"__________ 20___.' г.",1,3,'L');
  759. }
  760. function Header(){
  761. $baseWidth = $this->baseWidth;
  762. $baseHeight = 5;
  763. // $width = Array (1,14,1.5,1,1,1,6,1.2,1,1,1,1,2,1,1);
  764. $height = Array (1.1,2.2,4.4,8.8,17.6,35.2);
  765. $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);
  766. $width_count=0;
  767. if ($this->PageNo()==1) $this->PrintHeader(toCP($_GET["subfaculty"]),$_GET["year"]);
  768. $this->SetFont('TimesNewRomanPS-BoldMT','B',10);
  769. $this->MultiCell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Факультет\nКурс\nГруппа",$height[4]*$baseHeight/2,3,'C');
  770. // $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Группа",1,0,'C');
  771. $this->MultiCell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Направление подготовки (специальность),\nквалификация(степень)",$height[4]*$baseHeight/2,3,'C');
  772. // $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Направление подготовки (специальность), квалификация(степень)",1,0,'C');
  773. $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Программа дисциплины",1,0,'C');
  774. $this->MultiCell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Форма\nобучения",$height[4]*$baseHeight/2,3,'C');
  775. $X=$this->GetX();
  776. $Y=$this->GetY();
  777. $this->Cell(($width[$width_count++]+$width[$width_count])*$baseWidth,$height[3]*$baseHeight,"",1,3,'C');
  778. $X_txt=$this->GetX()-3+$width[$width_count]*$baseWidth;
  779. $Y_txt=$this->GetY();
  780. $this->writeRotie($X_txt, $Y_txt, "Форма промежуточной", 90);
  781. $this->writeRotie($X_txt+=3, $Y_txt, " аттестации в", 90);
  782. $this->writeRotie($X_txt+=3, $Y_txt, " экзаменационную", 90);
  783. $this->writeRotie($X_txt+=3, $Y_txt, " сессию", 90);
  784. $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
  785. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[3]*$baseHeight, "Экзамен (Э)", 90);
  786. $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
  787. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[3]*$baseHeight, "Диф. зачет (Д)", 90);
  788. $this->SetXY($this->GetX(),$Y);
  789. $X=$this->GetX();
  790. $Y=$this->GetY();
  791. $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
  792. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Руксовая работа (КУ)", 90);
  793. $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
  794. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Реферат (Р)", 90);
  795. $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
  796. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Выпускной курс (В)", 90);
  797. $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
  798. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Количество недель практики", 90);
  799. $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
  800. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Количество членов ГАК (декан ф-та)", 90);
  801. $this->Cell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"",1,0,'C');
  802. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[4]*$baseHeight, "Кол-во часов за руководство кафедрой (в год)", 90);
  803. $X=$this->GetX();
  804. $Y=$this->GetY();
  805. $this->Cell(($width[$width_count++]+$width[$width_count])*$baseWidth,$height[3]*$baseHeight,"Количество",1,3,'C');
  806. $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
  807. $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "Студентов (докторантов", 90);
  808. $this->writeRotie($this->GetX()-3, $this->GetY()+$height[3]*$baseHeight, "аспирантов, соискателей)", 90);
  809. $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
  810. $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "Групп (потоков)", 90);
  811. $this->SetXY($this->GetX(),$Y);
  812. $X=$this->GetX();
  813. $Y=$this->GetY();
  814. $this->Cell(($width[$width_count]+$width[$width_count+1]+$width[$width_count+2]+$width[$width_count+3])*$baseWidth,$height[1]*$baseHeight,"Виды учебной работы (часов)",1,3,'C');
  815. // $this->MultiCell($width[$width_count++]*$baseWidth,$height[4]*$baseHeight,"Форма\nобучения",$height[4]*$baseHeight/2,3,'C');
  816. $this->MultiCell(($width[$width_count]+$width[$width_count+1])*$baseWidth,($height[1]+$height[2])*$baseHeight,"Чтение\nлекций",$height[2]*$baseHeight/2,3,'C');
  817. $this->MultiCell(($width[$width_count]+$width[$width_count+1])*$baseWidth,($height[1]+$height[2])*$baseHeight,"Проведение\nдругих видов\nаудиторных\nзанятий",$height[2]*$baseHeight/2,3,'C');
  818. $this->SetXY($X,$Y+$height[3]*$baseHeight);
  819. $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
  820. $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "по плану", 90);
  821. $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
  822. $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "Всего", 90);
  823. $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
  824. $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "по плану", 90);
  825. $this->Cell($width[$width_count++]*$baseWidth,$height[3]*$baseHeight,"",1,0,'C');
  826. $this->writeRotie($this->GetX()-7, $this->GetY()+$height[3]*$baseHeight, "Всего", 90);
  827. // $this->Cell($width[1]*$baseWidth,$height[0]*$baseHeight,"$semester семестр",1,2,'C');
  828. // $this->SetXY($X,$Y+$baseHeight);
  829. $this->Ln();
  830. }
  831. function PrintHeader($subfaculty,$year) {
  832. $baseWidth = $this->baseWidth;
  833. $baseHeight = 5;
  834. // $width = Array (1,14,1.5,1,1,1,6,1.2,1,1,1,1,2,1,1);
  835. $height = Array (1.1,2.2,4.4,8.8,17.6,35.2);
  836. $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);
  837. $width_count=0;
  838. $this->SetMargins(20,20);
  839. $this->SetFont('TimesNewRomanPSMT','',12);
  840. $this->Cell($full*$baseWidth, $baseHeight, 'Форма 3',0,0,'R');
  841. //Переходим на следующую строку
  842. $this->Ln();
  843. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  844. //Выводим наименование компании
  845. $this->Cell($full*$baseWidth, $baseHeight, 'Министерство образования и науки Российской Федерации',0,3,'C');
  846. $this->Cell($full*$baseWidth, $baseHeight, 'Государственное образовательное учреждение высшего профессионального образования',0,3,'C');
  847. $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');
  848. //Выводим заголовок
  849. $this->SetFont('TimesNewRomanPSMT','',12);
  850. $this->MultiCell(10*$baseWidth,5*$baesHeight,"Утверждаю\nПроректор по учебной работе\n _____________________\n\n\"____\"__________ 20___.' г.",1,3,'L');
  851. $exp="//subfaculty[@abbr='".toUTF($subfaculty)."']";
  852. // echo $exp;
  853. $subfaculty_name = '';
  854. $elements=$this->xpath->query($exp);
  855. foreach ($elements as $element) {
  856. $subfaculty_name=toCP($element->getAttribute('name'));
  857. }
  858. $this->MultiCell(30*$baseWidth,5*$baesHeight,"Выписка из учебных планов для кафедры $subfaculty($subfaculty_name) на $year/".($year+1)." учебный год.",1,3,'L');
  859. // $this->MultiCell(4*$baseWidth,5*$baesHeight,"Форма 4",1,3,'R');
  860. //Переходим на следующую строку
  861. $this->SetY($this->GetY()+5*$baseHeight);
  862. }
  863. function PrintSemester($subfaculty,$year,$semester) {
  864. $baseWidth = $this->baseWidth;
  865. $baseHeight = $this->baseHeight;
  866. $X = $this->GetX();
  867. $Y = $this->GetY();
  868. $X_max = 45*$baseWidth + 5.4;
  869. $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);
  870. // $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);
  871. // $width = Array (8,0,1.5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,3);
  872. // $width = Array (14,0,1.5,1,1,1,1.2,1,1,1,1,1,1);
  873. $sum = Array(0,0,0,0,0,0,0,0,0,0,0,0,0);
  874. $sem = ($semester==1)?1:0;
  875. $count=0;
  876. $pg = new pgsql();
  877. $pg->_query("SET client_encoding TO 'WIN1251'");
  878. $control = new pgsql();
  879. $control->_query("SET client_encoding TO 'WIN1251'");
  880. $sql = "SELECT prog.program_id as id, weeks,
  881. ltrim(rtrim(discipline_title)) as title,
  882. dis.subfaculty, speciality_for as speciality, semester,
  883. CASE WHEN difzach = true THEN 'Д' ELSE '' END as difzach,
  884. CASE WHEN exam = true THEN 'Э' ELSE '' END as exam,
  885. lectures,
  886. seminars,
  887. labs,
  888. individual,
  889. round(cast(lectures + seminars + labs AS numeric) / weeks,1) as aud,
  890. round(cast(individual AS numeric)/ weeks,1) as indiv
  891. from prog
  892. INNER JOIN dis ON (prog.discipline_id=dis.discipline_id AND subfaculty='$subfaculty')
  893. INNER JOIN prog_status ON (prog.program_id = prog_status.program_id)
  894. WHERE year='$year'
  895. AND mod(semester,2)=$sem
  896. ORDER BY semester, discipline_title";
  897. $pg->_query($sql);
  898. $this->SetFont('TimesNewRomanPSMT','',10);
  899. $this->SetFillColor(192,192,192);
  900. //var_dump($pg->_getResultAll());
  901. $prog = $stat = array();
  902. $prog[1]=$semester." полугодие";
  903. $stat[1]="Итого за ".$prog[1];
  904. $br=0;
  905. for ($i=0;$i<count($width);$i++) {
  906. $this->Cell($width[$i]*$baseWidth,$baseHeight/2,$prog[$i],1,0,($i==1 || $i==2)?'L':'C',0);
  907. }
  908. $this->ln();
  909. $prog = array();
  910. while ($rez=$pg->_getResultArray(true,PGSQL_ASSOC)) {
  911. $prog[0]="";
  912. $prog[1]=$rez["speciality"]." - ";
  913. $exp="//specialities/speciality[@name='".$rez["speciality"]."']";
  914. // echo $exp;
  915. $spec = '';
  916. $elements=$this->xpath->query($exp);
  917. foreach ($elements as $element) {
  918. $spec.=toCP($element->getAttribute('speciality_title'));
  919. if ($element->getAttribute('direction_title')) {
  920. $spec.="(";
  921. $spec.=toCP($element->getAttribute('direction_title'));
  922. $spec.="}";
  923. }
  924. }
  925. $langs_sql = "SELECT * FROM lang WHERE f_id = '".$rez["id"]."'";
  926. $control->_query($langs_sql);
  927. $count=1;
  928. $group=0;
  929. $students=0;
  930. while ($langs_rez=$control->_getResultArray()) {
  931. $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']";
  932. // echo $exp;
  933. $elements=$this->xpath->query($exp);
  934. // print_r($elements->saveXML());
  935. foreach ($elements as $element) {
  936. $students+=toCP($element->getAttribute('students_count'));
  937. $prog[0].=toCP($element->getAttribute('abbr'));
  938. $prog[0].="\n";
  939. $prog[3]=toCP($element->getAttribute('study_form'));
  940. $count+=2.6;
  941. $group++;
  942. }
  943. }
  944. if ($prog[0]) {
  945. $prog[1].=$spec;
  946. $prog[2]=$rez["title"];
  947. if ($prog[4]=$rez["exam"])$stat[4]++;
  948. if ($prog[5]=$rez["difzach"]) $stat[5]++;
  949. $stat[14]+=$prog[14]=$rez["lectures"];
  950. $prog[16]=$rez["seminars"]+$rez["labs"];
  951. $control->_query("SELECT * FROM control WHERE program_id = '".$rez["id"]."' ORDER BY week");
  952. $week = 0;
  953. $vol='';
  954. while ($control_rez=$control->_getResultArray()) {
  955. while ($control_rez["week"] != $week++) {
  956. }
  957. switch ($control_rez["control_type"]) {
  958. case "КУ": $stat[6]++;$prog[6]=$control_rez["control_type"]; break;
  959. case "Р ": $stat[7]++;$prog[7]=$control_rez["control_type"]; break;
  960. case "ПЗ":
  961. case "КР":
  962. case "КЗ": $prog[16]+=$control_rez["vol"]; break;
  963. }
  964. }
  965. $prog[0] = trim($prog[0]);
  966. $stat[12]+=$prog[12] = $students;
  967. $stream = intval($students/100)+(fmod($students,100)?1:0);
  968. $prog[13] = $group." (".$stream.")";
  969. $stat[15]+=$prog[15] = $rez["lectures"]*$stream;
  970. $stat[17]+=$prog[17] = $prog[16]*$group;
  971. $stat[16]+=$prog[16];
  972. $x=$this->GetX();
  973. $y=$this->GetY();
  974. $buttom=$y+$baseHeight/2+$count;
  975. // echo $prog[0]."<br>";
  976. if ($buttom > 277) { $this->AddPage();
  977. $x=$this->GetX();
  978. $y=$this->GetY();
  979. }
  980. for ($i=0;$i<count($width);$i++) {
  981. $X=$this->GetX();
  982. $Y=$this->GetY();
  983. // echo "b: $buttom Y: ".$y." COUNT: ".$count." Pn: ".$this->PageNo()."<br>";
  984. $this->MultiCell($width[$i]*$baseWidth,$baseHeight/2+$count,$prog[$i],1,3,($i==1 || $i==2)?'L':'C');
  985. $this->SetXY($X+$width[$i]*$baseWidth, $Y);
  986. // $this->MultiCell($width[$i]*$baseWidth,$count*$baseHeight/2,$prog[$i],$count*$baseHeight/2,3,($i==1 || $i==2)?'L':'C');
  987. // $this->Cell($width[$i]*$baseWidth,$baseHeight/2,$prog[$i],1,0,($i==1 || $i==2)?'L':'C');
  988. }
  989. $this->ln();
  990. $this->SetY($y+$count+$baseHeight/2);
  991. }
  992. }
  993. // $this->SetXY($x,$y);
  994. for ($i=0;$i<count($width);$i++) {
  995. $this->Cell($width[$i]*$baseWidth,$baseHeight/2,"",1,0,($i==1 || $i==2)?'L':'C',1);
  996. }
  997. $this->ln();
  998. // for ($i=0;$i<17;$i++) $sum[$i]=0;
  999. for ($i=0;$i<count($width);$i++) {
  1000. $this->Cell($width[$i]*$baseWidth,$baseHeight/2,$stat[$i],1,0,($i==1 || $i==2)?'L':'C',1);
  1001. $this->total[$i] += $stat[$i];
  1002. }
  1003. $this->ln();
  1004. }
  1005. }
  1006. class OTR extends MyPDF {
  1007. public $baseWidth = 9;
  1008. public $baseHeight = 9;
  1009. public $lf = '';
  1010. public $ls = '';
  1011. function Footer() {
  1012. $baseWidth = $this->baseWidth;
  1013. $baseHeight = $this->baseHeight;
  1014. $this->Cell($full*$baseWidth,$baseHeight,"Обозначение контрольных мероприятий (КМ): КР - Контрольная работа КМ - Контрольное мероприятие ДЗ - домашнее задание Р - Реферат КУ - Курсовая работа ВР - Квалификационная работа КЗ - Контрольное занятие",0,0,'L');
  1015. }
  1016. function PrintTitle($year,$subfaculty,$speciality,$semester,$lang_first,$lang_second,$prog_weeks=19) {
  1017. $exp="//lang[@index='$lang_first' or @index='$lang_second']";
  1018. // echo $exp;
  1019. $lang = '';
  1020. $elements=$this->xpath->query($exp);
  1021. foreach ($elements as $element) {
  1022. $lang[]=toCP($element->getAttribute('titleshort'));
  1023. }
  1024. $baseWidth = $this->baseWidth;
  1025. $baseHeight = 5;
  1026. //Выводим логотип
  1027. //$this->Image($image,6,6,40,20);
  1028. $this->SetFont('TimesNewRomanPSMT','',12);
  1029. $X=$this->GetX();
  1030. $this->Cell($full*$baseWidth, $baseHeight, 'Форма 3',0,0,'R');
  1031. //Переходим на следующую строку
  1032. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  1033. //Выводим наименование компании
  1034. $this->SetXY($X, $this->GetY());
  1035. $this->Cell($full*$baseWidth, $baseHeight, 'Министерство образования и науки Российской Федерации',0,3,'C');
  1036. $this->Cell($full*$baseWidth, $baseHeight, 'Государственное образовательное учреждение высшего профессионального образования',0,3,'C');
  1037. $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');
  1038. //Выводим наименование компании
  1039. $this->Cell(20*$baseWidth,$baseHeight,'Утверждаю',0,0,'L');
  1040. //Переходим на следующую строку
  1041. $this->Ln();
  1042. $this->Cell(20*$baseWidth,$baseHeight,'Проректор по учебной работе',0,0,'L');
  1043. //Переходим на следующую строку
  1044. $this->Ln();
  1045. //Устанавливаем шрифт для наименования компании
  1046. $this->SetFont('TimesNewRomanPSMT','',12);
  1047. //Выводим наименование компании
  1048. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  1049. $this->Cell(25*$baseWidth,$baseHeight,'Рабочий учебный план на '.$year.'/'.($year+1).' учебный год',0,0,'R');
  1050. $this->SetFont('TimesNewRomanPSMT','',12);
  1051. $this->Cell(5*$baseWidth,$baseHeight,'Специальность ',0,0,'R');
  1052. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  1053. $this->Cell(5*$baseWidth,$baseHeight,$speciality." (".$lang[0]."/".$lang[1].")",0,0,'L');
  1054. $this->SetFont('TimesNewRomanPSMT','',12);
  1055. $this->Cell(3*$baseWidth,$baseHeight,'Кафедра ',0,0,'R');
  1056. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  1057. $this->Cell(2*$baseWidth,$baseHeight,$subfaculty,0,0,'L');
  1058. $this->SetFont('TimesNewRomanPSMT','',12);
  1059. $this->Cell(2*$baseWidth,$baseHeight,'Курс ',0,0,'R');
  1060. $this->SetFont('TimesNewRomanPS-BoldMT','B',12);
  1061. $this->Cell(1*$baseWidth,$baseHeight,round($semester/2),0,0,'L');
  1062. $this->SetFont('TimesNewRomanPSMT','',12);
  1063. //Переходим на следующую строку
  1064. $this->Ln();
  1065. //Делаем отступ от левого края (рисуя прозрачную ячейку)
  1066. // $this->Cell(37);
  1067. //Устанавливаем цвет заливки следующих ячеек (R,G,B)
  1068. // $this->SetFillColor(209,204,244);
  1069. //Устанавливаем шрифт для наименования документа
  1070. // $this->SetFont('Verdana','',12);
  1071. //Выводим наименование документа
  1072. // $this->Cell(150,8,$title,0,0,'C',1);
  1073. //Переходим на следующую строку
  1074. $this->Ln();
  1075. //Устанавливаем шрифт заголовка таблицы
  1076. $graf = Array(6.7,2.8,2,5,4.5,4.5,4.5,4.5,4.5,4.5);
  1077. $old = $baseHeight;
  1078. $baseHeight = 2*$baseHeight;
  1079. $this->SetFont('TimesNewRomanPS-BoldMT','B',10);
  1080. $this->MultiCell($graf[0]*$baseWidth+5,$baseHeight,"Группа (колличество)",1,3,'C');
  1081. $this->MultiCell($graf[1]*$baseWidth,$baseHeight,"Кол-во\nстудентов",1,3,'C');
  1082. $this->MultiCell($graf[2]*$baseWidth,$baseHeight,"Семестр",1,3,'C');
  1083. $this->MultiCell($graf[3]*$baseWidth,$baseHeight,"Период проведения\nпрактических занятий",1,3,'C');
  1084. $this->MultiCell($graf[4]*$baseWidth,$baseHeight,"Зачетная неделя\n(зачеты, диф.зачеты)",1,3,'C');
  1085. $this->MultiCell($graf[6]*$baseWidth,$baseHeight,"Экзаменационная\nсессия",1,3,'C');
  1086. $this->MultiCell($graf[5]*$baseWidth,$baseHeight,"Подготовка выпускной\nквалификац. работы",1,3,'C');
  1087. $this->MultiCell($graf[7]*$baseWidth,$baseHeight,"Итоговая\nгос. аттестация",1,3,'C');
  1088. $this->MultiCell($graf[7]*$baseWidth,$baseHeight,"Практика, недель",1,3,'C');
  1089. $this->MultiCell($graf[8]*$baseWidth,$baseHeight,"Каникулы, период",1,3,'C');
  1090. $this->Ln();
  1091. $thi…

Large files files are truncated, but you can click here to view the full file