public function postEditcategory()
 {
     $type = Input::get("type");
     $nic = Input::get("nic");
     if ($type == 0) {
         $hasCategory1 = DBCategory1Controller::hasCategory1($nic);
         if ($hasCategory1) {
             $category1 = DBCategory1Controller::getCategory1($nic);
             return View::make('G1SAS/category1edit')->with('category1', $category1);
         } else {
             return "you don't have category 1 type application";
         }
     } elseif ($type == 1) {
         $schoolId = Input::get("schoolId");
         $category2 = DBCategory2Controller::getCategory2($schoolId, $nic);
         $achieve = DBPPAchievementController::getPastPupilAch($schoolId, $nic);
         $eAch = $achieve[0];
         $cAch = $achieve[1];
         return View::make('G1SAS/category2edit')->with('category2', $category2)->with('eAch', $eAch)->with('cAch', $cAch);
     } elseif ($type == 2) {
         # code...
     } elseif ($type == 3) {
         $hasCategory4 = DBCategory4Controller::hasCategory4($nic);
         if ($hasCategory4) {
             $category4 = DBCategory4Controller::getCategory4($nic);
             return View::make('G1SAS/category4edit')->with('category4', $category4);
         } else {
             return "you don't have category 4 type application";
         }
     } elseif ($type == 4) {
         $hasCategory5 = DBCategory5Controller::hasCategory5($nic);
         if ($hasCategory5) {
             $category5 = DBCategory5Controller::getCategory5($nic);
             return View::make('G1SAS/category5edit')->with('category5', $category5);
         } else {
             return "you don't have category 5 type application";
         }
     } elseif ($type == 5) {
         $hasCategory6 = DBCategory6Controller::hasCategory6($nic);
         if ($hasCategory6) {
             $category6 = DBCategory6Controller::getCategory6($nic);
             return View::make('G1SAS/category6edit')->with('category6', $category6);
         } else {
             return "you don't have category 6 type application";
         }
     }
 }