<?php
// define("SERVERNAME","127.0.0.1,1433");
// include('include/decrypt.php');

// define("SERVERNAME","172.16.2.220,1433");
// define("DATABASENAME","MASTER_LOGIN");
// define("UID","sa");
// $txtPass = decrypt("cYLqxvDi5sngY7m3t+bc4g==", "BwSystem!");
// define("PWD",$txtPass);
// define("CHARSET","UTF-8");

function ConnMLogin(){
    
  include('include/decrypt.php');
  $txtPass = decrypt("cYLqxvDi5sngY7m3t+bc4g==", "BwSystem!");
  define("SERVERNAME","172.16.2.220,1433");
  define("DATABASENAME","MASTER_LOGIN");
  define("UID","sa");
  define("PWD",$txtPass);
  define("CHARSET","UTF-8");
  $connectionInfo = array("Database"=>DATABASENAME,"UID"=>UID,"PWD"=>PWD,"MultipleActiveResultSets"=>true,"CharacterSet"=> CHARSET);
  $conn = sqlsrv_connect(SERVERNAME, $connectionInfo);
return $conn;
}

function ConnPF(){
  //define("SERVERNAMEP","localhost");
  define("SERVERNAMEP","172.16.2.252",true);
  //define("PWDP","123456789");
  define("PWDP","db@pf5733!");
  define("DATABASENAMEP","pf");
  define("UIDP","sa");
  define("CHARSETP","UTF-8");
  $connection = array("Database"=>DATABASENAMEP,"UID"=>UIDP,"PWD"=>PWDP,"MultipleActiveResultSets"=>true,"CharacterSet"=> CHARSETP);
  $conp = sqlsrv_connect(SERVERNAMEP, $connection);
return $conp;
}

function connms(){

  define("SERVERNAME","172.16.2.220,1433");
  // define("SERVERNAME","172.16.2.220,1433");
  // define("SERVERNAME","NB-KWAN\SQLEXPRESS01");
  define("DATABASENAME","YUSENDB");  //UAT
  // define("DATABASENAME","YUSENDB_TEST");     //TEST
  define("UID","sa");
  define("PWD","P@sswordsBw@dmin");
  define("CHARSET","UTF-8");

  $connectionInfo = array("Database"=>DATABASENAME,"UID"=>UID,"PWD"=>PWD,"MultipleActiveResultSets"=>true,"CharacterSet"  => CHARSET);
  $connms = sqlsrv_connect(SERVERNAME, $connectionInfo);
  // if( $connms === false ) {
  //     die( print_r( sqlsrv_errors(), true ));
  // }else{
  // // echo 'Connected';
  // }
  return $connms;
}

?>