public static function getPastPupilMarkingCriteria($schoolid, $year)
 {
     $db = Connection::getInstance();
     $mysqli = $db->getConnection();
     $query = "select * from pastpupilmarkingcriteria where schoolId='{$schoolid}' and refYear='{$year}';";
     $result = $mysqli->query($query);
     $ppmc = new pastPupil_markingCriteria();
     if ($result->num_rows > 0) {
         if ($row = $result->fetch_assoc()) {
             $ppmc->setAll($row["schoolId"], $row["refYear"], $row["internationalEduAchieve"], $row["nationalEduAchieve"], $row["provincialEduAchieve"], $row["districtEduAchieve"], $row["zonalEduAchieve"], $row["internationalExtraCurricular"], $row["nationalExtraCurricular"], $row["provincialExtraCurricular"], $row["districtExtraCurricular"], $row["zonalExtraCurricular"], $row["pastPupilOrgMember"], $row["contribution"], $row["other_after_school"]);
             //$ppmc->setSchoolId($row["schoolId"]);
             //$ppmc->setRefYear($row["refYear"]);
             //$ppmc->setInternationalEduAchieve($row["internationalEduAchieve"]);
             //$ppmc->setNationalEduAchieve($row["nationalEduAchieve"]);
             //$ppmc->setProvincialEduAchieve($row["provincialEduAchieve"]);
             //$ppmc->setDistrictEduAchieve($row["districtEduAchieve"]);
             //$ppmc->setZonalEduAchieve($row["zonalEduAchieve"]);
             //$ppmc->setInternationalExtraCurricular($row["internationalExtraCurricular"]);
             //$ppmc->setNationalExtraCurricular($row["nationalExtraCurricular"]);
             //$ppmc->setProvincialExtraCurricular($row["provincialExtraCurricular"]);
             //$ppmc->setDistrictExtraCurricular($row["districtExtraCurricular"]);
             //$ppmc->setZonalExtraCurricular($row["zonalExtraCurricular"]);
             //$ppmc->setPastPupilOrgMemeber($row["pastPupilOrgMember"]);
             //$ppmc->setContribution($row["contribution"]);
             //$ppmc->setOther_after_school($row["other_after_school"]);
         }
     }
     return $ppmc;
 }
 public function postSaveppmarkingcriteria()
 {
     $schoolid = Input::get('schoolidtext');
     $year = Input::get('year');
     $intEduAch = Input::get('intEduAchMarks');
     $natEduAch = Input::get('natEduAchMarks');
     $proEduAch = Input::get('proEduAchMarks');
     $disEduAch = Input::get('disEduAchMarks');
     $zonEduAch = Input::get('zonEduAchMarks');
     $intExtAch = Input::get('intExtAchMarks');
     $natExtAch = Input::get('natExtAchMarks');
     $proExtAch = Input::get('proExtAchMarks');
     $disExtAch = Input::get('disExtAchMarks');
     $zonExtAch = Input::get('zonExtAchMarks');
     $pastPupOrg = Input::get('pastPupOrgMarks');
     $contribution = Input::get('contributionMarks');
     $other = Input::get('otherMarks');
     $ppmc = new pastPupil_markingCriteria();
     $ppmc->setAll($schoolid, $year, $intEduAch, $natEduAch, $proEduAch, $disEduAch, $zonEduAch, $intExtAch, $natExtAch, $proExtAch, $disExtAch, $zonExtAch, $pastPupOrg, $contribution, $other);
     $result = DBPastPupilMarkingCriteriaController::addCriteria($ppmc);
     $school = DBSchoolController::getSchool($schoolid);
     if ($result) {
         return View::make('G1SAS/schoolpage')->with('school', $school)->with('notice', "PatPupil Marking Criteria added successfully");
     } else {
         return View::make('G1SAS/schoolpage')->with('school', $school)->with('notice', "PatPupil Marking Criteria addition Failed");
     }
 }