From 4cb104ab930f5d1e81c51a3f6443825d7306d35b Mon Sep 17 00:00:00 2001
From: RomanSteinberg <romanofficial@yandex.ru>
Date: Thu, 8 Jan 2015 18:50:03 +0300
Subject: [PATCH] FIX: exam form view

---
 .../Controller/Handler/FileCreator.php        |  38 +++++++++---------
 ~dev_rating/docs/template exam.xls            | Bin 30720 -> 30720 bytes
 2 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/~dev_rating/application/classes/Controller/Handler/FileCreator.php b/~dev_rating/application/classes/Controller/Handler/FileCreator.php
index c325671cb..97ba532fc 100644
--- a/~dev_rating/application/classes/Controller/Handler/FileCreator.php
+++ b/~dev_rating/application/classes/Controller/Handler/FileCreator.php
@@ -208,7 +208,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
         $this->prepareSheetHeader($objPHPExcel, $type, $headerData);
                 
         // fill students rows
-        $startRow = 13;  
+        $startRow = 12;
         $rowNumber = $startRow;
         $index = 1;
 
@@ -248,7 +248,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
         $range = $objPHPExcel->getNamedRange("Year")->getRange();
         $sheet->setCellValue($range, $data['Year']);
         $range = $objPHPExcel->getNamedRange("CreationDate")->getRange();
-        $sheet->setCellValue($range, date("dd.mm.yy"));
+        $sheet->setCellValue($range, date("d.m.y"));
         
         $range = $objPHPExcel->getNamedRange("Date")->getRange();
         if ($disciplineType == 'credit') {
@@ -316,50 +316,52 @@ class Controller_Handler_FileCreator extends Controller_Handler
     {
         $indPosition = 'A'; // Номер
         $namePosition = 'B';  // ФИО
-        $totalRatePosition = 'G';  // Итоговый рейтинг
-        $semesterRatePosition  = 'H';   // Сумма баллов
-        $bonusRatePosition = 'I'; // Бонусные баллы
-        $examRatePosition = 'J'; // Баллы за экзамен
-        $rateOfFivePosition = 'K'; // Оценка за экзамен по пятибальной системе
+        $totalRatePosition = 'H';  // Итоговый рейтинг
+        $semesterRatePosition  = 'I';   // Сумма баллов
+        $bonusRatePosition = 'J'; // Бонусные баллы
+        $examRatePosition = 'K'; // Баллы за экзамен
+        $rateOfFivePosition = 'L'; // Оценка за экзамен по пятибальной системе
 
-        $sheet  ->getStyle("A".$row.":S".$row)
+        $sheet  ->getStyle("A".$row.":V".$row)
             ->getBorders()->getAllBorders()
             ->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
-        $sheet  ->getStyle("G".$row.":J".$row)
+        $sheet  ->getStyle("H".$row.":K".$row)
             ->getAlignment()
             ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
-        $sheet  ->getStyle("K".$row.":L".$row)
+        $sheet  ->getStyle("L".$row.":M".$row)
             ->getAlignment()
             ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
-        $sheet  ->getStyle("M".$row.":N".$row)
+        $sheet  ->getStyle("N".$row.":O".$row)
             ->getAlignment()
             ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
-        $sheet  ->getStyle("O".$row.":U".$row)
+        $sheet  ->getStyle("P".$row.":V".$row)
             ->getAlignment()
             ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
-        $sheet  ->getStyle("R".$row.":R".$row)
+        $sheet  ->getStyle("S".$row.":S".$row)
             ->getAlignment()
             ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
-        $sheet->mergeCells("B".$row.":F".$row);
+        $sheet->mergeCells("B".$row.":G".$row);
 
         $lastName = $data['Last'];
         $firstName = $data['First'];
         $secondName = $data['Second'];
         $rate = (int)$data['intermediate'];
         $bonus = (int)$data['bonus'];
-        $examRate = 0; // TODO: get it from DB
+        $examRateValue = 0; // TODO: get it from DB
         $fullName = $lastName." ".$firstName." ".$secondName;
-        $totalRateValue = $rate + $examRate + $bonus;
+        $totalRateValue = $rate + $examRateValue + $bonus;
 
         if ($totalRateValue > 100)
             $totalRateValue = 100;
 
         $totalRate = '';
         $rateOfFive = '';
+        $examRate = '';
         if ($rate < 38) {
             $totalRate = ' ';
-            $rateOfFive = 'РЅРµ СѓРґРѕРІР»';
-        } elseif (($rate >= 38) and ($examRate >= 22)) {
+            $rateOfFive = 'неуд';
+            $examRate ='0';
+        } elseif (($rate >= 38) and ($examRateValue >= 22)) {
             $totalRate = $totalRateValue;
             $rateOfFive = 'СѓРґРѕРІР»';
             if (($totalRateValue >= 75) and ($totalRateValue < 85))
diff --git a/~dev_rating/docs/template exam.xls b/~dev_rating/docs/template exam.xls
index 14c107a280f69e4579afc08f9a364838cd5053d8..48e86ac60652f29364a15ee1d1f6cf8211d9f205 100644
GIT binary patch
delta 2862
zcmai0O^j1j6h8O$zV`KR`rp@fs_ifYjS`#@jq=xNXHb4dLGW(|(4jKOj4&euZb*>M
z&V`z&SHr@9hOjakkP4Bg12HDf!i6LzZZ*+0xNsqf!SCGnI&Enu-jnz4JLfy+JNKUZ
z)6U-#^S8vsBhnnGmM@N}Ir)|`IbFXkhduQ@)@(2vCZfOZ6p6mV2RHdi@i$6RSpA-`
zMOY1H_#I2yT|7T_Ju6+&&s}t`EBdyJc4uzH-bmVs9t^5|glE;^<d(vD&CrQ{>DW~@
zWoJ9l1s8q4D|*#M2fLyT=D&bO8l(C!7CRk09VB@{$3|6O+7>ajE<F*AH++7fXYg52
z@1<>ZE$z=Hn?Mnt;JU7Zld2lGv#BOpB`OsfXj;W=TiEO)GOA)fq{?>O_l1tku~mI)
z4~SlM173OPS!HC_h<oaTnSxML+5IA<c4ci9&1IrNq!1J(%HRV{P32bYEfQOt=8VS+
zMNl8n;~FV8M&i@<{tkO+8GBGwa<-b!XA1wrs3vkZ)!BTH`nESv-_iT9SZ&cDhOmMt
z4{qJA7f)JAI%zd@?vK-Z*8I-;5BYl0SXojhHk}gzl`r)Rsmi5&c%Lct2~%Awt;F{q
zrD8#1<~fd(JQuf(AFLi*Ph^r$^$)EPk^1hT6NV>&@(g+tDmc6tGD*bbfZPBXRsRfE
zYcLdPy&REcSpgN4wfG#7Ly!R(V#A2sA|I85a+4gD>m)mr<Rj8zr~+Uko{Ah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