<?php
class DataManager{

	//errores Numerico y Mensajes
	private static $error;
	private static $mensajeError;


    static public function getInstance()
	{
    	global $dsn;
      	$db = null;

		try
		{
			// $db = new PDO("sqlsrv:Server=LAPTOP-NI11DAGF;Database=SILS20230126", 'sa', 'Central2012');
			$db = new PDO("sqlsrv:Server=sils.c4higtjexnyk.us-east-1.rds.amazonaws.com;Database=sils", 'silsPicking', 'Clave1234.');
			//$db = new PDO("sqlsrv:Server=192.168.1.83;Database=SILS20230126", 'sa', 'Central2012');
			$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
		}
		catch (exception $e)
		{
			self::$mensajeError = $e->getMessage();
            self::$error = true;
        	echo self::$mensajeError;
        	$db = null;
        	exit;
		}

		return $db;
	}
}
?>