-- OBJECT TYPE:  PACKAGE
-- OBJECT NAME:  SZGCRST

-- AUTHOR:       Rodney Clark
-- LAST UPDATE:  05/01/17
--
-- DESCRIPTION:  Course Toolkit 
--
-- REVISED: 		
--          
-- ASSOCIATED WITH: 
--      PACKAGE NAME:
--                 
--
--      TABLES: 
--         
--         
--         
--         
--         
-- 
--
--      FORMS:SZFACIP
--          
--      VIEWS:
-- 


-- CREATES A WORK INV IN MY INV.
CREATE OR REPLACE PACKAGE auburn.szgmjch
AS

 
    procedure p_major_change;
  
 
END szgmjch;
/

CREATE OR REPLACE PACKAGE BODY auburn.szgmjch

IS 

	-- GLOBAL VARIABLES
    global_pidm             gobeacc.gobeacc_pidm%TYPE;
	global_user             gobeacc.gobeacc_username%TYPE;	
	
	v_error_messages        varchar2(32000) := null;
	v_term                  stvterm.stvterm_code%type;
	
	TYPE nt_split_result IS TABLE OF VARCHAR2(4000);
    
--
--*****************************************************************************
-- OBJECT TYPE:  FUNCTION.
-- OBJECT NAME:  f_Get_Message
-- AUTHOR:       R Phillips 
-- DATE WRITTEN: 02/07/07
-- DATE REVISED:    
--


-- f_Get_Message return header/footer/email message
--
FUNCTION f_Get_Message (strPage IN VARCHAR2, 
                        strKeyword IN VARCHAR2) RETURN VARCHAR2
IS
    
  --get message text
  CURSOR get_Message IS
         SELECT szccrsw.szccrsw_content 
         FROM szccrsw
         WHERE UPPER(szccrsw.szccrsw_page) = UPPER(strPage)
               AND UPPER(szccrsw.szccrsw_keyword) = UPPER(strKeyword);
    
  --variables             
  strMessage    szccrsw.szccrsw_CONTENT%TYPE := '';
  v_add_br      varchar2(1) := 'Y';
    
BEGIN

   OPEN get_Message;
    FETCH get_Message INTO strMessage;
    CLOSE get_Message;
 
    if strKeyword = 'DOCUMENTATION_TEST' then
    
        v_add_br := 'N';
    
    end if;
    
    if INSTR(strKeyword, 'EMAIL') = 0   then
    
        v_add_br := 'N';
    
    end if;
 
   IF v_add_br = 'Y' THEN    

        strMessage := REPLACE(strMessage, CHR(10), '<BR>'||CHR(10));
    
    END IF;
    
    RETURN strMessage; 
    
EXCEPTION
    WHEN OTHERS THEN
        htp.P('ERROR IN f_Get_Message ' || SQLERRM);
        


END f_Get_Message;



   -- OBJECT TYPE:  PROCEDURE
   -- OBJECT NAME:  p_major_change
   -- AUTHOR:       Albert Homburger
   -- DATE WRITTEN:10/24/2013
   -- DESCRIPTION:  p_major_change  main procedure for major change process

   ----------------------------------------------------------------------------------------------------------
   -- Modifications:
   --
   ----------------------------------------------------------------------------------------------------------
   PROCEDURE p_major_change
   IS

   BEGIN
    
           
        --STANDARD CODE FOR ALL PAGES
        -- Check global_pidm    
        IF NOT twbkwbis.F_ValidUser(global_pidm) THEN
             RETURN;
        END IF; 
        
        bwckfrmt.p_open_doc('szgmjch.p_major_change');
        twbkwbis.P_DispInfo('szgmjch.p_major_change','DEFAULT');
        bwpkolib.P_DisplayErrors; 
         
        htp.p('<p>');
        htp.p('<p>');
        htp.p('<p>');
        htp.p('<p>');
        htp.p('<p>');
        
        twbkwbis.p_closedoc;
   
   END p_major_change;
 
   

END szgmjch;
/