Ejemplo n.º 1
0
 private function ReCalcMarkList($sheetid, $attProc)
 {
     $credit = RecordBookQuery::SheetItemFormControl($this->db, $sheetid);
     $markList = RecordBookQuery::MarkList($this->db, $sheetid);
     while ($d = $this->db->fetch_array($markList)) {
         $d['prliminary'] = round($attProc[0] * $d['firstatt'] / 100 + $attProc[1] * $d['secondatt'] / 100 + $attProc[2] * $d['thirdatt'] / 100);
         $result = $d['prliminary'] + $d['additional'];
         if ($result > 100) {
             $d['additional'] = 0;
             $d['mark'] = $d['prliminary'];
         } else {
             $d['mark'] = $result;
         }
         if ($credit === true) {
             $d['mark'] = $this->CreditSetMark($d['mark']);
         }
         $data = (object) $d;
         RecordBookQuery::MarkUpdate($this->db, $data);
     }
     return true;
 }