<?php
///////////////////////////////////
// DATABASE INFORMATION local         //
///////////////////////////////////
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_DB', 'banks_control');

define('DB_HOST_SERVER', 'localhost');
define('DB_USER_SERVER', 'ydsystem_app');
define('DB_PASSWORD_SERVER', '#p36hS1@tX_k');
define('DB_DB_SERVER', 'ydsystem_banks_control');

class Conectar{
function conexion()
{
    $ambiente="L";
    static $con2;
    if ($con2 === null) {

        if ($ambiente == "S") {
        $con2=new mysqli(DB_HOST_SERVER, DB_USER_SERVER, DB_PASSWORD_SERVER,DB_DB_SERVER);
        }else{
        $con2=new mysqli(DB_HOST, DB_USER, DB_PASSWORD,DB_DB);
        }
        $con2->query("SET NAMES 'utf8'");
        //$con2 = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD,DB_DB) or die("<br/>Could not connect to MySQL server");
        //mysqli_set_charset($con2, "utf8");
    }
    return $con2;
}
function conexion1()
{
    static $con2;
    if ($con2 === null) {
    	 $con2=new mysqli(DB_HOST, DB_USER, DB_PASSWORD,DB_DB);
        $con2->query("SET NAMES 'utf8'");
        //$con2 = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD,DB_DB) or die("<br/>Could not connect to MySQL server");
        //mysqli_set_charset($con2, "utf8");
    }
    return $con2;
}
}
?>