<?php

	//Security
	if( ! defined( 'IS_INIT' ) )
	{
		die( 'Unauthorized Access');
	}
	
class Handler 
{
    public $theme = null;
	
    public function NewHandle( $name , $object )
    {
        $this->$name = $object;
    }
    
    public function WriteLog( $type , $message , $extra , $extra1 , $extra2 = null , $extra3 = null )
    {
        if( isset( $this->user->UserOptions['nUserNo'] ) )
        {
            $user = $this->user->UserOptions['nUserNo'];
        }
        else
        {
            $user = 0;
        }
        
        $ip = $_SERVER['REMOTE_ADDR'];
        
    	$do = sqlsrv_prepare( $this->database->conn , "Insert into Account.dbo.WebsiteLogs values ( ? , ? , ? , ? , ? , ? , ? , ? , CURRENT_TIMESTAMP )" , array( &$type , &$user , &$message , &$extra , &$extra1 , &$extra2 , &$extra3 , &$ip ) );
        sqlsrv_execute( $do );
            
    }
}

?>