<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

class loginclass
{

    function checksession( $name, $action = "1" )
    {
        if ( isset( $_SESSION[$name] ) )
        {
            return $_SESSION[$name];
        }
        if ( $action == 1 )
        {
            exit( "<script>alert('É necessrio você fazer a atualizção'); location = 'index.php'; </script>" );
        }
        if ( $action == 2 )
        {
            return 1;
        }
    }

    function insertsession( $name, $valor )
    {
        $GLOBALS['_SESSION'][$name] = $valor;
        echo "<script>location = 'index.php'; </script>";
    }

    function destroysession( )
    {
        session_destroy( );
        exit( "<script>window.location = 'index.php'; </script>" );
    }

}

echo "﻿";
session_start( );
?>
