<?php
	$serverName = "DESKTOP-0DNPIVP\AMANACU"; 
	$basededatos='AMANACU';
	$usuario='sa';
	$clave='12345678';
	$connectionInfo = array( "Database"=>"$basededatos", "UID"=>"$usuario", "PWD"=>"$clave");
	$conn = sqlsrv_connect( $serverName, $connectionInfo);

	if( $conn ) {
		//echo "Conexión establecida.<br />";
	}else{
		 echo "Conexión no se pudo establecer.<br />";
		 die( print_r( sqlsrv_errors(), true));
	}
			/*
			$cabecera_fact = sqlsrv_query($conn,"SELECT * FROM SAFACT where NumeroD>='00018884' and TipoFac='A'  ");
			while($row = sqlsrv_fetch_array($cabecera_fact, SQLSRV_FETCH_ASSOC)) {
				$NumeroD=$row['NumeroD'];
				$cuerpo_fact = sqlsrv_query($conn,"SELECT NumeroD,SUM(Cantidad) AS CANT	FROM SAITEMFAC where TipoFac='A' AND NumeroD='$NumeroD' group by NumeroD");
				$row_cuerpo = sqlsrv_fetch_array($cuerpo_fact, SQLSRV_FETCH_ASSOC);
				$Cantidad=$row_cuerpo['CANT'];
				$Date = $row['FechaV']->format('d/m/Y');
				//echo $row['TipoFac'].'-'.$row['NumeroD'].'-'.$row['CodClie'].'-'.$row['Descrip'].' - '.$Date.'     -  <b>PESO: </b>  '.$Cantidad.'<br>';
			}*/


	
	
?>