<?php include('lib/config.php');?>
<?php 
      //--------------- Organisation Info ----------------							  								  
	  $selQry_orgs = "SELECT * FROM ".TBL_ORGANIZATIONS." WHERE organization_id ='1' LIMIT 1";
	  $orgsInfo =  $con->getSingleRow($selQry_orgs, __FILE__,__LINE__);
	  $totOrgsListings = count($orgsInfo);
	  //--------------- Users Info ----------------							  								  
	  $selQry_users = "SELECT * FROM ".TBL_USERS." WHERE group_id !='1' ORDER BY first_name";
	  $usersInfo =  $con->getMultiRow($selQry_users, __FILE__,__LINE__);
	  $totUsersListings = count($usersInfo);
	  //--------------- Departments Info ----------
	  $selQry_depts = "SELECT * FROM ".TBL_DEPARTMENTS." ORDER BY name";
	  $deptsInfo =  $con->getMultiRow($selQry_depts, __FILE__,__LINE__);
	  $totDeptsListings = count($deptsInfo);
	  //--------------- Files Info ----------------
	  $selQry_files = "SELECT * FROM ".TBL_FILES." ORDER BY name";
	  $filesInfo =  $con->getMultiRow($selQry_files, __FILE__,__LINE__);
	  $totFilesListings = count($filesInfo);
	  //--------------- Stakeholders Info ---------
	  $selQry_sh = "SELECT * FROM ".TBL_STAKEHOLDERS." ORDER BY name";
	  $shInfo =  $con->getMultiRow($selQry_sh, __FILE__,__LINE__);
	  $totSHListings = count($shInfo);
	  //-------------------------------------------
        
      if( ($totUsersListings>0) && ($totDeptsListings>0) && ($totFilesListings>0) )
	  {
		$return_arr[] = array("message" => 'proceed');
	  }
      else
	  {
      	$return_arr[] = array("message" => 'stop');
	  }
                    
      echo json_encode($return_arr);
?>