

<?php



                error_reporting(E_ALL);
                ini_set('display_errors', 1);
                
                include('../config/config.php');
                
                //collect the input details
                $prosotp = trim($_POST['prosotp']);
                $institution = trim($_POST['InstutionID']);
                $usertype = trim($_POST['usertype']);
                $UserID = trim($_POST['UserID']);
                
                
                
                
                  if($usertype == 'student')
                   {
                    
                    
                    
                             $prosgetusernumbercontent = mysqli_query($link,"SELECT * FROM `student` WHERE StudentID='$prosuserID' AND `OTP`='$prosotp'");
                          
                            
                            $prosgetusernumbercontentcnt = mysqli_num_rows($prosgetusernumbercontent);
                            $prosgetusernumbercontentcnt_row = mysqli_fetch_assoc($prosgetusernumbercontent);
                            
                            
                                    if($prosgetusernumbercontentcnt > 0)
                                    {
                                        
                                        echo 'great';
                                        
                                    }else
                                    {
                                        
                                        echo 'failed';
                                        
                                    }
                           
               
                       
                   }else if($usertype == 'parent')
                   {
                       
                       
                       
                       
                                    $prosgetusernumbercontent = mysqli_query($link,"SELECT * FROM `parent` WHERE ParentID='$prosuserID' AND `OTP`='$prosotp'");
                                    
                                    $prosgetusernumbercontentcnt = mysqli_num_rows($prosgetusernumbercontent);
                                    $prosgetusernumbercontentcnt_row = mysqli_fetch_assoc($prosgetusernumbercontent);
                                    
                                    
                                    if($prosgetusernumbercontentcnt > 0)
                                    {
                                        
                                        echo 'great';
                                        
                                    }else
                                    {
                                        
                                        echo 'failed';
                                        
                                    }
                       
                       
                       
                      
                       
                   }else
                   {
                       
                                    $prosgetusernumbercontent = mysqli_query($link,"SELECT * FROM `staff` WHERE StaffID='$UserID' AND `OTP`='$prosotp'");
                                    
                                    $prosgetusernumbercontentcnt = mysqli_num_rows($prosgetusernumbercontent);
                                    $prosgetusernumbercontentcnt_row = mysqli_fetch_assoc($prosgetusernumbercontent);
                                    
                                    
                                    if($prosgetusernumbercontentcnt > 0)
                                    {
                                        
                                        echo 'great';
                                        
                                    }else
                                    {
                                        
                                        echo 'failed';
                                        
                                    }
                       
                       
                       
                   }


                
                
                
                
             


?>