<?php
class Database {
	public static $db;
	public static $con;
	function Database(){
			$this->user="grupopu4";$this->pass="10QvlsYB9CiX3aNp";$this->host="localhost";$this->ddbb="grupopu4_sistemarestaurante";
	}

	function connect(){
		$con = new mysqli($this->host,$this->user,$this->pass,$this->ddbb);
		return $con;
	}

	public static function getCon(){
		if(self::$con==null && self::$db==null){
			self::$db = new Database();
			self::$con = self::$db->connect();
		}
		return self::$con;
	}
	
}
?>
