public function validateconfirm()
 {
     $required = array("admission_number" => "Admission Number", "admission_date" => "Admission Date", "name" => "Name", "class_level" => "Class", "date_of_birth" => "Date of Birth", "gender" => "Gender", "mobile" => "Mobile");
     global $user;
     global $objPDO;
     $student = new Student($objPDO, $user->getuserId());
     if ($user->checkAdmin() == true || $student->checkTeacher() || $student->checkStudent()) {
         if (isset($_POST)) {
             foreach ($required as $key => $value) {
                 if (!isset($_POST[$key]) || $_POST[$key] == '' || $_POST[$key] == 'select') {
                     echo $value . ' is Required<br/>';
                     return;
                 }
             }
             if (!is_numeric($_POST['mobile']) || !is_numeric($_POST['parent_mobile'])) {
                 echo "Mobile number must be Numeric";
             } else {
                 if (isset($_POST['permanent_pincode']) && $_POST['permanent_pincode'] != '' && !is_numeric($_POST['permanent_pincode']) || isset($_POST['correspondence_pincode']) && $_POST['correspondence_pincode'] != '' && !is_numeric($_POST['correspondence_pincode'])) {
                     echo "Pincode must be Numeric";
                 } else {
                     echo 'Saving...';
                     global $objPDO;
                     require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_class.php';
                     require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
                     require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/parent_class.php';
                     $studentProfile = new StudentProfile($objPDO);
                     $parent = new StudentParent($objPDO);
                     if ($_POST['category'] == 'select') {
                         unset($_POST['category']);
                     }
                     if ($_POST['blood_group'] == 'select') {
                         unset($_POST['blood_group']);
                     }
                     $parent->loadByStudentId($_GET['uid']);
                     $studentProfile->setByArray($_POST);
                     $parent->setByArray($_POST);
                     $studentProfile->loadByUserId($_GET['uid']);
                     $studentProfile->save();
                     $parent->save();
                     echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/studentprofile/view/' . $studentProfile->getUserId() . '"/>';
                 }
             }
         }
     } else {
         header('Location:http://localhost/cloud');
     }
 }